From 54d0ec0e3875a3cfb08abc7a8f1c8476f745edf2 Mon Sep 17 00:00:00 2001 From: KholdFuzion Date: Thu, 28 Sep 2023 11:49:33 -0400 Subject: [PATCH] update --- .github/workflows/EU.yml | 2 +- .github/workflows/JPN.yml | 7 +- .github/workflows/main.yml | 2 +- .gitignore | 16 +- Makefile | 30 +- assets/GlobalImageTable.c | 446 +- assets/GlobalImageTable.h | 46 + ...le_controller_small.c => fontBankGothic.c} | 8 +- ...le_controller_large.c => fontZurichBold.c} | 190 +- assets/obseg/Makefile.bg | 6 +- .../bg/{bg_lip_all_p.c => bg_len_all_p.c} | 2 +- .../bg/{bg_lip_all_p.h => bg_len_all_p.h} | 0 .../bg/{bg_rit_all_p.c => bg_oat_all_p.c} | 0 assets/obseg/gun/fist/gunFileRecord.inc.c | 2 +- assets/obseg/gun/fist/gunWeaponStat.inc.c | 8 +- assets/obseg/gun/gunModelFileRecord.inc.c | 172 +- assets/obseg/gun/gunWeaponStats.inc.c | 422 +- assets/obseg/gun/knife/gunFileRecord.inc.c | 2 +- assets/obseg/gun/knife/gunWeaponStat.inc.c | 7 +- assets/obseg/ob_seg.s | 6 +- assets/obseg/prop/alarm1/Model.c | 161 +- assets/obseg/prop/cctv/Model.c | 312 + assets/obseg/prop/cctv/propFileRecord.inc.c | 1 + .../obseg/prop/propItemModelFileRecord.inc.c | 2 +- assets/obseg/setup/UsetuparchZ.c | 13 +- assets/obseg/setup/UsetupaztZ.c | 2429 +- assets/obseg/text/LgunE.c | 448 +- assets/obseg/text/LgunE.h | 227 + assets/obseg/text/LmiscE.c | 140 +- assets/obseg/text/LmiscE.h | 75 + assets/obseg/text/LmpmenuE.c | 72 +- assets/obseg/text/LmpmenuE.h | 39 + assets/obseg/text/LmpweaponsE.c | 32 +- assets/obseg/text/LmpweaponsE.h | 19 + assets/obseg/text/LoptionE.h | 67 + assets/obseg/text/LoptionsE.c | 128 +- assets/obseg/text/LpropobjE.c | 136 +- assets/obseg/text/LpropobjE.h | 72 + assets/obseg/text/LtitleE.c | 609 +- assets/obseg/text/LtitleE.h | 310 + ...agetable_commandblock.c => rarewarelogo.c} | 160 +- build/test.c | 12 +- checksums.txt | 8 +- filelist.e.csv | 8 +- filelist.j.csv | 18 +- filelist.u.csv | 18 +- ge007.e-test_basis.csv | 10 +- ge007.j-test_basis.csv | 10 +- ge007.ld | 25 +- ge007.u-test_basis.csv | 10 +- include/gbi_extension.h | 18 + include/math.h | 6 +- ld/game.bss.ld.inc | 2 +- ld/game.data.ld.inc | 2 +- ld/game.rodata.ld.inc | 2 +- ld/game.text.ld.inc | 2 +- readme.md | 16 +- src/aicommands.def | 60 +- src/audi.c | 3 +- src/bondaicommands.h | 363 +- src/bondconstants.h | 734 +- src/bondgame.h | 23 +- src/bondtypes.h | 517 +- src/boss.c | 718 +- src/boss.h | 2 +- src/crash.c | 49 +- src/crash.h | 2 +- src/debugmenu.c | 436 +- src/fr.c | 55 +- src/fr.h | 18 +- src/game/bg.c | 1156 +- src/game/bg.h | 8 +- src/game/bg2.c | 14 +- src/game/blood_decrypt.c | 669 +- src/game/blood_decrypt.h | 3 +- src/game/bondhead.c | 152 +- src/game/bondhead.h | 2 +- src/game/bondinv.c | 22 +- src/game/bondview.c | 31371 +++------------- src/game/bondview.h | 263 +- src/game/bondview_r.c | 32 +- src/game/cheat_buttons.c | 60 +- src/game/chr.c | 359 +- src/game/chr.h | 11 +- src/game/chr_b.c | 4 +- src/game/chrai.c | 66 +- src/game/chrai.h | 289 +- src/game/chrlv.c | 1095 +- src/game/chrlv.h | 6 +- src/game/chrobjdata.h | 1 - src/game/chrobjhandler.c | 18204 ++++----- src/game/chrobjhandler.h | 90 +- src/game/chrprop.c | 1545 +- src/game/cleanplayersound.c | 130 +- src/game/cleanupSFXRelated.c | 12 +- src/game/cleanup_guard_data.c | 26 +- src/game/deb_loadallmodels.c | 1 + src/game/debugmenu_08FE00.c | 211 +- src/game/debugmenu_handler.c | 1144 +- src/game/debugmenu_handler.h | 2 +- src/game/decompress.c | 68 +- src/game/dyn.c | 51 +- src/game/dyn.h | 7 +- src/game/explosions.c | 56 +- src/game/explosions.h | 10 +- src/game/file.c | 6 +- src/game/file.h | 8 +- src/game/file2.h | 6 + src/game/fog.c | 211 +- src/game/fog.h | 25 +- src/game/front.c | 22102 ++--------- src/game/front.h | 97 +- src/game/game_debug.c | 10 +- src/game/game_debug.h | 2 +- src/game/gun.c | 2438 +- src/game/gun.h | 33 +- src/game/image.c | 2 +- src/game/image.h | 1 + src/game/image_bank.h | 3 + src/game/indy_commands.c | 267 +- src/game/indy_commands.h | 26 +- src/game/initBondDATA.c | 12 +- src/game/initBondDATA.h | 1 + src/game/initBondDATAdefaults.c | 80 +- src/game/initactorpropstuff.c | 55 +- src/game/initanitable.c | 2 +- src/game/initanitable.h | 6 +- src/game/initgamedata.c | 4 +- src/game/initguards.c | 14 +- src/game/initguards.h | 2 +- src/game/initmenus.c | 2 +- src/game/initobjects.c | 52 +- src/game/loadobjectmodel.c | 207 +- src/game/lvl.c | 1659 +- src/game/lvl.h | 11 +- src/game/lvl_text.c | 724 +- src/game/lvl_text.h | 16 +- src/game/math_asinacos.c | 1 + src/game/math_asinfacosf.c | 4 +- src/game/matrixmath.c | 280 +- src/game/matrixmath.h | 23 +- src/game/matrixmath_misc.c | 129 +- src/game/{objecthandler_1.c => model.c} | 1061 +- src/game/mp_music.c | 2 +- src/game/mp_watch.c | 1073 +- src/game/mp_watch.h | 4 + src/game/mp_weapon.c | 32 +- src/game/ob.c | 95 +- src/game/ob.h | 16 +- src/game/objecthandler.c | 55 +- src/game/objecthandler.h | 33 +- src/game/objecthandler_2.c | 30 +- src/game/objective.c | 72 +- src/game/objective_status.c | 710 +- src/game/objective_status.h | 7 +- src/game/objective_status2.c | 368 +- src/game/othermodemicrocode.c | 398 +- src/game/padhalllv.c | 296 +- src/game/player.c | 6 +- src/game/player_2.c | 463 +- src/game/player_2.h | 2 +- src/game/playerstats_007770.c | 2 +- src/game/prop.c | 2428 +- src/game/radar.c | 11 +- src/game/ramromreplay.c | 881 +- src/game/ramromreplay.h | 11 +- src/game/rsp.c | 2 +- src/game/rsp.h | 2 +- src/game/spectrum.c | 159 +- src/game/stan.c | 1394 +- src/game/stan.h | 11 +- src/game/textrelated.c | 193 +- src/game/textrelated.h | 34 +- src/game/title.c | 46 +- src/game/title.h | 2 + src/game/unk_01B240.h | 2 +- src/game/unk_09B7A0.c | 448 +- src/game/unk_0A1DA0.c | 115 +- src/game/unk_0A1DA0.h | 3 +- src/game/unk_0B3200.c | 4 +- src/game/unk_0B3200.h | 10 + src/game/unk_0CC4C0.c | 104 +- src/game/unk_0D1AC0.c | 2 + src/game/watch.c | 705 +- src/game/watch.h | 14 +- src/game/zlib.c | 586 +- src/game/zlib.h | 1 + src/inflate/inflate.c | 6 + src/init.c | 468 +- src/init.h | 23 +- src/joy.c | 37 +- src/joy.h | 6 + src/macro.h | 8 + src/mema.c | 632 +- src/mema.h | 17 +- src/memp.c | 3 +- src/memp.h | 2 +- src/music.c | 1 + src/ramrom.c | 28 +- src/random.h | 3 + src/rmon.c | 37 +- src/sched.c | 4 +- src/sched.h | 5 +- src/snd.c | 1 + src/thread_config.h | 2 + src/tlb_hardwire.h | 2 +- src/tlb_hardwire.s | 15 +- src/tlb_manage.c | 97 +- src/usb.c | 1704 +- src/usb.h | 62 +- src/vi.c | 2 +- src/vi.h | 2 +- tools/aiParse.c | 4 +- tools/asmpreproc/asm-processor.py | 806 +- tools/asmpreproc/asm_processor.py | 1479 + tools/ge-stats.py | 30 +- 216 files changed, 32928 insertions(+), 80085 deletions(-) rename assets/font/{font_first_font_table_controller_small.c => fontBankGothic.c} (99%) rename assets/font/{font_first_font_table_controller_large.c => fontZurichBold.c} (93%) rename assets/obseg/bg/{bg_lip_all_p.c => bg_len_all_p.c} (99%) rename assets/obseg/bg/{bg_lip_all_p.h => bg_len_all_p.h} (100%) rename assets/obseg/bg/{bg_rit_all_p.c => bg_oat_all_p.c} (100%) create mode 100644 assets/obseg/prop/cctv/Model.c create mode 100644 assets/obseg/prop/cctv/propFileRecord.inc.c create mode 100644 assets/obseg/text/LgunE.h create mode 100644 assets/obseg/text/LmiscE.h create mode 100644 assets/obseg/text/LmpmenuE.h create mode 100644 assets/obseg/text/LmpweaponsE.h create mode 100644 assets/obseg/text/LoptionE.h create mode 100644 assets/obseg/text/LpropobjE.h create mode 100644 assets/obseg/text/LtitleE.h rename assets/{Globalimagetable_commandblock.c => rarewarelogo.c} (98%) rename src/game/{objecthandler_1.c => model.c} (92%) create mode 100644 src/game/unk_0B3200.h create mode 100755 tools/asmpreproc/asm_processor.py diff --git a/.github/workflows/EU.yml b/.github/workflows/EU.yml index 6b474305..5135844c 100644 --- a/.github/workflows/EU.yml +++ b/.github/workflows/EU.yml @@ -18,7 +18,7 @@ on: jobs: buildeu: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/JPN.yml b/.github/workflows/JPN.yml index ae699105..f1764e69 100644 --- a/.github/workflows/JPN.yml +++ b/.github/workflows/JPN.yml @@ -18,7 +18,7 @@ on: jobs: buildjp: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -64,7 +64,7 @@ jobs: - name: Upload output files - uses: dmnemec/copy_file_to_another_repo_action@main + uses: dmnemec/copy_file_to_another_repo_action@v1.0.4 env: API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} @@ -75,6 +75,7 @@ jobs: destination_repo: 'kholdfuzion/goldeneyestatus' user_email: $API_TOKEN_EMAIL user_name: $API_TOKEN_USER - source_file: 'tools/report/JPN.htm' + source_file: | + tools/report/JPN.htm #need way of telling report that JP passed/failed diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9eb5bd28..41ff72d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: buildus: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 222801f8..9d8537fd 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ assets/jfont_dl.bin assets/font_chardataj.bin assets/font_chardatae.bin assets/ge007.u.29D160.Globalimagetable.bin -assets/Globalimagetable_commandblock.bin +assets/rarewarelogo.bin assets/ge007.u.2A4D50.usedby7F008DE4.bin assets/ge007.u.117880.jfont_dl.bin assets/ge007.u.117940.jfont_chardata.bin @@ -93,3 +93,17 @@ uld_c.c umerge_c.c uopt_c.c usplit_c.c + +#exclude local user scripts in root folder +/my_*.sh +assets/obseg/em/data/alien8.seg +assets/obseg/em/data/atic.seg +assets/obseg/em/data/cookie.seg +assets/obseg/em/data/gunfright.seg +assets/obseg/em/data/jetman.seg +assets/obseg/em/data/jetpac.seg +assets/obseg/em/data/knightlore.seg +assets/obseg/em/data/pssst.seg +assets/obseg/em/data/sabre.seg +assets/obseg/em/data/spec_rom.seg +assets/obseg/em/data/under.seg diff --git a/Makefile b/Makefile index cfce136f..5776c774 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ default: colour FINAL := YES VERSION := US IDO_RECOMP := YES -VERBOSE := 0 +VERBOSE := 2 # If COMPARE is 1, check the output sha1sum when building 'all', and if fail to match # then compare ELF sections to known md5 checksums. # If compare is 2, it will just compare the sha1sum. @@ -298,7 +298,7 @@ GAMEOBJECTS := $(foreach file,$(GAMEFILES_S),$(BUILD_DIR)/$(file:.s=.o)) \ $(foreach file,$(GAMEFILES_C),$(BUILD_DIR)/$(file:.c=.o)) -ASSET_DATAFILES := assets/GlobalImageTable.c assets/animationtable_data.c assets/animationtable_entries.c assets/font_dl.c assets/font_chardataj.c assets/font_chardatae.c assets/Globalimagetable_commandblock.c +ASSET_DATAFILES := assets/GlobalImageTable.c assets/animationtable_data.c assets/animationtable_entries.c assets/font_dl.c assets/font_chardataj.c assets/font_chardatae.c assets/rarewarelogo.c ASSET_DATAOBJECTS := $(foreach file,$(ASSET_DATAFILES),$(BUILD_DIR)/$(file:.c=.o)) ROMFILES2 := assets/romfiles2.s @@ -447,21 +447,16 @@ $(BUILD_DIR)/assets/images/split/%.o: assets/images/split/%.bin pb5 $(BUILD_DIR)/$(OBSEGMENT): $(OBSEG_RZ) $(IMAGE_OBJS) pb6 $(call PRINT_STATUS,Compressing6:,$<,$@) -#Build C files in root/ -$(BUILD_DIR)/%.o: src/%.c pb7 - $(call PRINT_STATUS,Compiling7:,$<,$@) - $(ASM_PREPROC) $(OPTIMIZATION) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION) - $(ASM_PREPROC) $(OPTIMIZATION) $< --post-process $@ --assembler "$(AS) $(ASFLAGS)" --asm-prelude tools/asmpreproc/prelude.s - #Build C files in src/ -$(BUILD_DIR)/src/%.o: src/%.c pb8 +$(BUILD_DIR)/src/%.o: src/%.c $(call PRINT_STATUS,Compiling8:,$<,$@) - # convert AI_PRINT commands from readable to byte-array - # echo $< - # echo filter = $(filter-out %chraidata.c,$<) - # for some reason, normal ifeq doesnt work, so has to be single line... - $(if $(filter %chraidata.c,$<), $(ConvertAIPRINT) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION), $(ASM_PREPROC) $(OPTIMIZATION) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION); $(ASM_PREPROC) $(OPTIMIZATION) $< --post-process $@ --assembler "$(AS) $(ASFLAGS)" --asm-prelude tools/asmpreproc/prelude.s) + @if grep -q 'GLOBAL_ASM(' $<; then \ + $(ASM_PREPROC) $(OPTIMIZATION) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION); \ + $(ASM_PREPROC) $(OPTIMIZATION) $< --post-process $@ --assembler "$(AS) $(ASFLAGS)" --asm-prelude tools/asmpreproc/prelude.s; \ + else \ + $(CC) -c $(CFLAGS) -o $@ $(OPTIMIZATION) $<; \ + fi #Build RamRom @@ -490,8 +485,7 @@ $(BUILD_DIR)/assets/%.o: assets/%.c pb4 ifeq ($(filter-out %setup%,$<),) $(ConvertAIPRINT) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION) else - $(ASM_PREPROC) $(OPTIMIZATION) $< | $(CC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ $(OPTIMIZATION) - $(ASM_PREPROC) $(OPTIMIZATION) $< --post-process $@ --assembler "$(AS) $(ASFLAGS)" --asm-prelude tools/asmpreproc/prelude.s + $(CC) -c $(CFLAGS) -o $@ $(OPTIMIZATION) $< endif #$(BUILD_DIR)/src/random.o: OPTIMIZATION := -O3 @@ -744,8 +738,8 @@ testPB: $(call IncrementProgressBarFromAtRate,0,0.125) textures: - for file in assets/images/split/*.bin; do ../../tools/mktex/build/tex2png $file .assets/images/out; done - + $(foreach x,$(IMAGE_BINS),tools/mktex/build/tex2png $(x) assets/images/out ${\n}) + colour: @echo "\033[3A" ifeq ($(VERBOSE),0) diff --git a/assets/GlobalImageTable.c b/assets/GlobalImageTable.c index 419a0f79..11dadee9 100644 --- a/assets/GlobalImageTable.c +++ b/assets/GlobalImageTable.c @@ -458,44 +458,44 @@ sImageTableEntry s_genericimage[] = { {IMAGE_FLAREWHITEROUND, 0x36, 0x36, 3, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} }; -sImageTableEntry s_impactimages[] = { - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT2, 0x40, 0x20, 7, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTLOTS, 0x40, 0x20, 7, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT4, 0x20, 0x20, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTMULTI, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTREDBRICK1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTREDBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTREDBRICK3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTBRICK3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTBROWNBRICK1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACTBROWNBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} -}; - -sImageTableEntry s_explosion_smokeimages[] = { - {IMAGE_SMOKE1, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKE2, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKE3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKE4, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKE5, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKE6, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} -}; - -sImageTableEntry s_scattered_explosions[] = { - {IMAGE_SMOKEBALLS1, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKEBALLS2, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKEBALLS3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKEBALLS4, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_SMOKEBALLS5, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} +sImageTableEntry s_impactimages[] = { // bg/debris? + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT2, 0x40, 0x20, 7, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/bullethit + {IMAGE_IMPACT3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhit + {IMAGE_IMPACTLOTS, 0x40, 0x20, 7, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/bulletholesplaster + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT4, 0x20, 0x20, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/bullethole + {IMAGE_IMPACTMULTI, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/bulletholesplasterrgb + {IMAGE_IMPACTREDBRICK1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole1 + {IMAGE_IMPACTREDBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole2 + {IMAGE_IMPACTREDBRICK3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole3 + {IMAGE_IMPACTBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole6 + {IMAGE_IMPACTBRICK3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole7 + {IMAGE_IMPACTBROWNBRICK1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole8 + {IMAGE_IMPACTBROWNBRICK2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhole9 + {IMAGE_IMPACT3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/wallhit + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // bg/windowhit + {IMAGE_IMPACT1, 0x30, 0x30, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/windowhit +}; + +sImageTableEntry s_explosion_smokeimages[] = { // sfx/smoke? + {IMAGE_SMOKE1, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/hit5 + {IMAGE_SMOKE2, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/hit10 + {IMAGE_SMOKE3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/hit15 + {IMAGE_SMOKE4, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/hit20 + {IMAGE_SMOKE5, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/hit25 + {IMAGE_SMOKE6, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/hit30 +}; + +sImageTableEntry s_scattered_explosions[] = { // sfx/firebomb? + {IMAGE_SMOKEBALLS1, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/backhit6 + {IMAGE_SMOKEBALLS2, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/backhit12 + {IMAGE_SMOKEBALLS3, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/backhit18 + {IMAGE_SMOKEBALLS4, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/backhit24 + {IMAGE_SMOKEBALLS5, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/backhit30 }; sImageTableEntry s_flareimage1[] = { @@ -503,246 +503,258 @@ sImageTableEntry s_flareimage1[] = { }; sImageTableEntry s_flareimage2[] = { - {IMAGE_WHITEBOX, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_WHITEBOX, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/white }; sImageTableEntry s_flareimage3[] = { - {IMAGE_FLAREORANGELINE, 0x10, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_FLAREORANGELINE, 0x10, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/laser }; sImageTableEntry s_flareimage4[] = { - {IMAGE_FLAREBLUELINE, 0x10, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_FLAREBLUELINE, 0x10, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/beam }; sImageTableEntry s_flareimage5[] = { - {IMAGE_FLAREBLUEROUND, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_FLAREBLUEROUND, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} // sfx/beamhead }; + + sImageTableEntry s_ammo9mmimage[] = { - {IMAGE_9MMAMMO, 5, 0xC, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} + {IMAGE_9MMAMMO, 5, 0xC, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoicon9mm }; -sImageTableEntry s_rifleammoimage[] = { - {IMAGE_RIFLEAMMO, 5, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_rifleammoimage[] = { + {IMAGE_RIFLEAMMO, 5, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconrifle }; -sImageTableEntry s_shotgunammoimage[] = { - {IMAGE_SHOTAMMO, 6, 0x14, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_shotgunammoimage[] = { + {IMAGE_SHOTAMMO, 6, 0x14, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconshell }; -sImageTableEntry s_knifeammoimage[] = { - {IMAGE_KNIFEAMMO, 6, 0x18, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_knifeammoimage[] = { + {IMAGE_KNIFEAMMO, 6, 0x18, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconknife }; -sImageTableEntry s_glammoimage[] = { - {IMAGE_GLAMMO, 8, 0x15, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0} +sImageTableEntry s_glammoimage[] = { + {IMAGE_GLAMMO, 8, 0x15, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0} // bg/ammoicongrenade }; -sImageTableEntry s_rocketammoimage[] = { - {IMAGE_ROCKETAMMO, 7, 0x16, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_rocketammoimage[] = { + {IMAGE_ROCKETAMMO, 7, 0x16, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconrocket }; -sImageTableEntry s_genericmineammoimage[] = { - {IMAGE_PLAINMINEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_genericmineammoimage[] = { + {IMAGE_PLAINMINEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconmine }; -sImageTableEntry s_grenadeammoimage[] = { - {IMAGE_GRENADEAMMO, 0xE, 0x12, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_grenadeammoimage[] = { + {IMAGE_GRENADEAMMO, 0xE, 0x12, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammogrenadehand }; -sImageTableEntry s_magnumammoimage[] = { - {IMAGE_MAGAMMO, 5, 0xF, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_magnumammoimage[] = { + {IMAGE_MAGAMMO, 5, 0xF, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconmagnum }; -sImageTableEntry s_goldengunammoimage[] = { - {IMAGE_GGAMMO, 5, 0xC, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_goldengunammoimage[] = { + {IMAGE_GGAMMO, 5, 0xC, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoicongold }; -sImageTableEntry s_remotemineammoimage[] = { - {IMAGE_MINEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_remotemineammoimage[] = { + {IMAGE_MINEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconminered }; -sImageTableEntry s_timedmineammoimage[] = { - {IMAGE_TIMEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_timedmineammoimage[] = { + {IMAGE_TIMEAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconmineyellow }; -sImageTableEntry s_proxmineammoimage[] = { - {IMAGE_PROXAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_proxmineammoimage[] = { + {IMAGE_PROXAMMO, 0xE, 0xE, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoiconminegreen }; -sImageTableEntry s_tankammoimage[] = { - {IMAGE_TANKAMMO, 7, 0x16, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_tankammoimage[] = { + {IMAGE_TANKAMMO, 7, 0x16, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/ammoicontankshell }; -sImageTableEntry s_crosshairimage[] = { - {IMAGE_CROSSHAIR1, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} +sImageTableEntry s_crosshairimage[] = { + {IMAGE_CROSSHAIR1, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} // bg/sight }; -sImageTableEntry s_betacrosshairimage[] = { - {IMAGE_CROSSHAIR2, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} +sImageTableEntry s_betacrosshairimage[] = { + {IMAGE_CROSSHAIR2, 0x20, 0x20, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_WRAP, 0} // }; -sImageTableEntry s_glassoverlayimage[] = { - {IMAGE_GLASS7, 0x20, 1, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_GLASS3, 0x36, 0x36, 3, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} +sImageTableEntry s_glassoverlayimage[] = { + {IMAGE_GLASS7, 0x20, 1, 6, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // sfx/glass? + {IMAGE_GLASS3, 0x36, 0x36, 3, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} // sfx/glass? }; sImageTableEntry s_monitorimages[] = { - {IMAGE_MONITOR_BOND, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_LOCATION, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_BEGINARMING, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TARGET, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SEVERNAYA, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_BREAKTARGET, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_AIMER, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_EARTH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_DESKTOPBANG, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_HEATMAP, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_3DMATH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_DESKTOPBARS, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_2DMATH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SATELLITE, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_DESKTOP, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_DESKTOPSTAGGERED, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_CUBE1, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SHUTTLE1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SHUTTLE2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_EARTHFULL1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_EARTHFULL2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_BLUESTARS, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_GALAXY1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_GALAXY2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_EARTHTEXT, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TARGETEARTH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_GALAXY3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_STATIC, 0x40, 0x40, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SINE, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TEXT, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_BARS, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SQUARES, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_FIST1, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_FIST2, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_FIST3, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_FIST4, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SKATEBOARD4, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SKATEBOARD1, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SKATEBOARD2, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_SKATEBOARD3, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TALK1, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TALK2, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TALK3, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TALK4, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_WORLDMAP, 0x80, 0x30, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_CLAMP, 0}, - {IMAGE_MONITOR_CUBE2, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_CUBE3, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_CUBE4, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_MONITOR_TRIANGLE, 0x36, 0x36, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MONITOR_KEYBOARDKEY, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_MONITOR_BOND, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/bondlogo + {IMAGE_MONITOR_LOCATION, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrlocation + {IMAGE_MONITOR_BEGINARMING, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrweaponarmed + {IMAGE_MONITOR_TARGET, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrtarget + {IMAGE_MONITOR_SEVERNAYA, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrsevernaya + {IMAGE_MONITOR_BREAKTARGET, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrtimetotarget + {IMAGE_MONITOR_AIMER, 0x80, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/cyrxhairspanel + {IMAGE_MONITOR_EARTH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen1 + {IMAGE_MONITOR_DESKTOPBANG, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen2 + {IMAGE_MONITOR_HEATMAP, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen3 + {IMAGE_MONITOR_3DMATH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen4 + {IMAGE_MONITOR_DESKTOPBARS, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen5 + {IMAGE_MONITOR_2DMATH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen6 + {IMAGE_MONITOR_SATELLITE, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen7 + {IMAGE_MONITOR_DESKTOP, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen8 + {IMAGE_MONITOR_DESKTOPSTAGGERED, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screen9 + {IMAGE_MONITOR_CUBE1, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim2.0 + {IMAGE_MONITOR_SHUTTLE1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax1 + {IMAGE_MONITOR_SHUTTLE2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax2 + {IMAGE_MONITOR_EARTHFULL1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax3 + {IMAGE_MONITOR_EARTHFULL2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax4 + {IMAGE_MONITOR_BLUESTARS, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax5 + {IMAGE_MONITOR_GALAXY1, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax6 + {IMAGE_MONITOR_GALAXY2, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax7 + {IMAGE_MONITOR_EARTHTEXT, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax10 + {IMAGE_MONITOR_TARGETEARTH, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax11 + {IMAGE_MONITOR_GALAXY3, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/drax12 + {IMAGE_MONITOR_STATIC, 0x40, 0x40, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screenstatic + {IMAGE_MONITOR_SINE, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screennew1 + {IMAGE_MONITOR_TEXT, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screennew2 + {IMAGE_MONITOR_BARS, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screennew3 + {IMAGE_MONITOR_SQUARES, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/screennew4 + {IMAGE_MONITOR_FIST1, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim4.1 + {IMAGE_MONITOR_FIST2, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim4.2 + {IMAGE_MONITOR_FIST3, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim4.3 + {IMAGE_MONITOR_FIST4, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim4.4 + {IMAGE_MONITOR_SKATEBOARD4, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim5.1 + {IMAGE_MONITOR_SKATEBOARD1, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim5.2 + {IMAGE_MONITOR_SKATEBOARD2, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim5.3 + {IMAGE_MONITOR_SKATEBOARD3, 0x20, 0x20, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim5.4 + {IMAGE_MONITOR_TALK1, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim3.1 + {IMAGE_MONITOR_TALK2, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim3.2 + {IMAGE_MONITOR_TALK3, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim3.3 + {IMAGE_MONITOR_TALK4, 0x20, 0x20, 6, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim3.4 + {IMAGE_MONITOR_WORLDMAP, 0x80, 0x30, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_CLAMP, 0}, // monitors/earthmap + {IMAGE_MONITOR_CUBE2, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim2.1 + {IMAGE_MONITOR_CUBE3, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim2.2 + {IMAGE_MONITOR_CUBE4, 0x10, 0x10, 5, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // monitors/anim2.3 + {IMAGE_MONITOR_TRIANGLE, 0x36, 0x36, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // monitors/animradar + {IMAGE_MONITOR_KEYBOARDKEY, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} // monitors/keyboardkey }; sImageTableEntry s_skywaterimages[] = { - {IMAGE_CLOUDS_GRAYSCALE, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_WATER_GRAYSCALE, 0x40, 0x40, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, - {IMAGE_WATER_BLUE, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_CLOUDS_GRAYSCALE, 0x40, 0x40, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // bg/clouds + {IMAGE_WATER_GRAYSCALE, 0x40, 0x40, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0}, // bg/water1 + {IMAGE_WATER_BLUE, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} // bg/water2 }; sImageTableEntry s_mainfolderimages[] = { - {IMAGE_COPYICON, 0x20, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0}, - {IMAGE_DELICON, 0x20, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0}, - {IMAGE_SELECTFILE, 0x7A, 0x12, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_X, 0xF, 0xF, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_CHECK, 0x14, 0x14, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_DOT, 0x10, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_COPYICON, 0x20, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0}, // + {IMAGE_DELICON, 0x20, 0x1C, 0, G_IM_FMT_RGBA, G_IM_SIZ_32b, G_TX_WRAP, G_TX_CLAMP, 0}, // + {IMAGE_SELECTFILE, 0x7A, 0x12, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // + {IMAGE_X, 0xF, 0xF, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // cross + {IMAGE_CHECK, 0x14, 0x14, 0, G_IM_FMT_IA, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // tick + {IMAGE_DOT, 0x10, 0x10, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_WRAP, G_TX_WRAP, 0} // }; sImageTableEntry s_mpradarimages[] = { - {IMAGE_RUSTYDRUM_END, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} + {IMAGE_RUSTYDRUM_END, 0x20, 0x20, 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TX_WRAP, G_TX_WRAP, 0} //circle }; sImageTableEntry s_mpcharselimages[] = { - {IMAGE_BROSNAN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BROSNAN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BROSNAN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BROSNAN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MOORE_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MOORE_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MOORE_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MOORE_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_DALTON_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_DALTON_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_DALTON_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_DALTON_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_CONNERY_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_CONNERY_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_CONNERY_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_CONNERY_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BORIS_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BORIS_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BORIS_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BORIS_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_OURUMOV_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_OURUMOV_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_OURUMOV_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_OURUMOV_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_TREVELYAN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_TREVELYAN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_TREVELYAN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_TREVELYAN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_VALENTIN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_VALENTIN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_VALENTIN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_VALENTIN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_XENIA_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_XENIA_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_XENIA_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_XENIA_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_NATALYA_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_NATALYA_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_NATALYA_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_NATALYA_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BARON_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BARON_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BARON_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_BARON_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_JAWS_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_JAWS_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_JAWS_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_JAWS_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MAYDAY_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MAYDAY_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MAYDAY_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MAYDAY_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_ODDJOB_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_ODDJOB_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_ODDJOB_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_ODDJOB_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_RANDOM_UL, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_RANDOM_UR, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_RANDOM_LL, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_RANDOM_LR, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MISHKIN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MISHKIN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MISHKIN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MISHKIN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0} + {IMAGE_BROSNAN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/brosnan + {IMAGE_BROSNAN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/brosnan + {IMAGE_BROSNAN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/brosnan + {IMAGE_BROSNAN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/brosnan + {IMAGE_MOORE_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/moore + {IMAGE_MOORE_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/moore + {IMAGE_MOORE_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/moore + {IMAGE_MOORE_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/moore + {IMAGE_DALTON_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/dalton + {IMAGE_DALTON_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/dalton + {IMAGE_DALTON_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/dalton + {IMAGE_DALTON_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/dalton + {IMAGE_CONNERY_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/connery + {IMAGE_CONNERY_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/connery + {IMAGE_CONNERY_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/connery + {IMAGE_CONNERY_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/connery + {IMAGE_BORIS_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/boris + {IMAGE_BORIS_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/boris + {IMAGE_BORIS_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/boris + {IMAGE_BORIS_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/boris + {IMAGE_OURUMOV_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/ourumov/oumorov + {IMAGE_OURUMOV_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/ourumov/oumorov + {IMAGE_OURUMOV_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/ourumov/oumorov + {IMAGE_OURUMOV_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/ourumov/oumorov + {IMAGE_TREVELYAN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0 }, // characters/trevelyan + {IMAGE_TREVELYAN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0 }, // characters/trevelyan + {IMAGE_TREVELYAN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0 }, // characters/trevelyan + {IMAGE_TREVELYAN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0 }, // characters/trevelyan + {IMAGE_VALENTIN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/valentin + {IMAGE_VALENTIN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/valentin + {IMAGE_VALENTIN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/valentin + {IMAGE_VALENTIN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/valentin + {IMAGE_XENIA_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/xenia + {IMAGE_XENIA_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/xenia + {IMAGE_XENIA_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/xenia + {IMAGE_XENIA_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/xenia + {IMAGE_NATALYA_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/natalya + {IMAGE_NATALYA_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/natalya + {IMAGE_NATALYA_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/natalya + {IMAGE_NATALYA_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/natalya + {IMAGE_BARON_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/baron + {IMAGE_BARON_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/baron + {IMAGE_BARON_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/baron + {IMAGE_BARON_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/baron + {IMAGE_JAWS_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/jaws + {IMAGE_JAWS_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/jaws + {IMAGE_JAWS_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/jaws + {IMAGE_JAWS_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/jaws + {IMAGE_MAYDAY_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mayday + {IMAGE_MAYDAY_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mayday + {IMAGE_MAYDAY_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mayday + {IMAGE_MAYDAY_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mayday + {IMAGE_ODDJOB_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/oddjob + {IMAGE_ODDJOB_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/oddjob + {IMAGE_ODDJOB_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/oddjob + {IMAGE_ODDJOB_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/oddjob + {IMAGE_RANDOM_UL, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/who + {IMAGE_RANDOM_UR, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/who + {IMAGE_RANDOM_LL, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/who + {IMAGE_RANDOM_LR, 0x41, 0x43, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/who + {IMAGE_MISHKIN_UL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mishkin + {IMAGE_MISHKIN_UR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mishkin + {IMAGE_MISHKIN_LL, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0}, // characters/mishkin + {IMAGE_MISHKIN_LR, 0x41, 0x41, 7, G_IM_FMT_I, G_IM_SIZ_4b, G_TX_CLAMP, G_TX_CLAMP, 0} // characters/mishkin }; sImageTableEntry s_mpstageselimages[] = { - {IMAGE_MP_BUNKER2, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_CAVERNS, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_ARCHIVES, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_DAM, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_FACILITY, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_RUNWAY, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_FRIGATE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_STATUE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_CRADLE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_AZTEC, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_EGYPT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_DEPOT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_TEMPLE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_BASEMENT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_COMPLEX, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_CAVES, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, - {IMAGE_MP_RANDOM, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} + //{IMAGE_MP_BUNKER, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/sevicon + //{IMAGE_MP_SILO, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/siloicon + //{IMAGE_MP_CONTROL, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/arecicon + //{IMAGE_MP_TRAIN, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/traicon + //{IMAGE_MP_STREETS, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/peteicon + //{IMAGE_MP_SURFACE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/sevxicon + //{IMAGE_MP_JUNGLE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/junicon + //{IMAGE_MP_SURFACE2, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/sevxbicon + {IMAGE_MP_BUNKER2, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/sevbicon + {IMAGE_MP_CAVERNS, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/caveicon + {IMAGE_MP_ARCHIVES, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/archicon + {IMAGE_MP_DAM, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/damicon + {IMAGE_MP_FACILITY, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/arkicon + {IMAGE_MP_RUNWAY, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/runicon + {IMAGE_MP_FRIGATE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/desticon + {IMAGE_MP_STATUE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/staticon + {IMAGE_MP_CRADLE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/cradicon + {IMAGE_MP_AZTEC, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/azticon + {IMAGE_MP_EGYPT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/crypicon + {IMAGE_MP_DEPOT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/depoicon + {IMAGE_MP_TEMPLE, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/smptempleicon + {IMAGE_MP_BASEMENT, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/smplibicon + {IMAGE_MP_COMPLEX, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/smpcomplexicon + {IMAGE_MP_CAVES, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0}, // level/smpcaveicon + {IMAGE_MP_RANDOM, 0x44, 0x2C, 0, G_IM_FMT_I, G_IM_SIZ_8b, G_TX_CLAMP, G_TX_CLAMP, 0} // bg/where }; + + diff --git a/assets/GlobalImageTable.h b/assets/GlobalImageTable.h index 0ac788a7..8974bcd6 100644 --- a/assets/GlobalImageTable.h +++ b/assets/GlobalImageTable.h @@ -56,7 +56,53 @@ enum MONIMGIDS { IMGKEYBOARDKEY }; +enum MAINFOLDERIMGIDS { + IMG_COPY, + IMG_DEL, + IMG_SEL, + IMG_X, + IMG_CHECK, + IMG_DOT +}; + +enum MPSELECTIMGIDS { + IMG_MP_BUNKER2, + IMG_MP_CAVERNS, + IMG_MP_ARCHIVES, + IMG_MP_DAM, + IMG_MP_FACILITY, + IMG_MP_RUNWAY, + IMG_MP_FRIGATE, + IMG_MP_STATUE, + IMG_MP_CRADLE, + IMG_MP_AZTEC, + IMG_MP_EGYPT, + IMG_MP_DEPOT, + IMG_MP_TEMPLE, + IMG_MP_BASEMENT, + IMG_MP_COMPLEX, + IMG_MP_CAVES, + IMG_MP_RANDOM +}; +enum MPCHRSELIMAGES { + IMG_MPC_BROSNAN, + IMG_MPC_MOORE, + IMG_MPC_DALTON, + IMG_MPC_CONNERY, + IMG_MPC_BORIS, + IMG_MPC_OURUMOV, + IMG_MPC_TREVELYAN, + IMG_MPC_VALENTIN, + IMG_MPC_XENIA, + IMG_MPC_NATALYA, + IMG_MPC_BARON, + IMG_MPC_JAWS, + IMG_MPC_MAYDAY, + IMG_MPC_ODDJOB, + IMG_MPC_RANDOM, + IMG_MPC_MISHKIN +}; extern Gfx globalDL_0x000; extern Gfx globalDL_0x078; diff --git a/assets/font/font_first_font_table_controller_small.c b/assets/font/fontBankGothic.c similarity index 99% rename from assets/font/font_first_font_table_controller_small.c rename to assets/font/fontBankGothic.c index 41124023..8b6c07f4 100644 --- a/assets/font/font_first_font_table_controller_small.c +++ b/assets/font/fontBankGothic.c @@ -1,6 +1,6 @@ #include - -u32 font_first_font_table_controller_small[] = +//bank gothic +u32 fontBankGothic_kerning[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, @@ -18,7 +18,7 @@ u32 font_first_font_table_controller_small[] = }; -u32 font_second_font_table_controller_small1[] = +u32 fontBankGothic_fontchartable[] = { 0x00000000, 0x00000002, 0x00000008, 0x00000002, 0x00000000, 0x00000B80, 0x00000001, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000BC8, @@ -116,7 +116,7 @@ u32 font_second_font_table_controller_small1[] = 0x0000005D, 0x00000004, 0x00000003, 0x00000008, 0x00000000, 0x00002490 }; -u32 font_second_font_table_controller_small2[] = +u32 fontBankGothic_fontbytes[] = { 0x00000000, 0xB8000000, 0x00000000, 0x272B2B2B, 0x2B2B2B2B, 0xBDCBCBCB, 0xCBCBCBCB, 0xBFCECECE, 0xCECECECE, 0xA4B4B4B4, 0xB4B4B4B4, 0x4B545454, diff --git a/assets/font/font_first_font_table_controller_large.c b/assets/font/fontZurichBold.c similarity index 93% rename from assets/font/font_first_font_table_controller_large.c rename to assets/font/fontZurichBold.c index a797688b..f1174fe5 100644 --- a/assets/font/font_first_font_table_controller_large.c +++ b/assets/font/fontZurichBold.c @@ -1,181 +1,25 @@ #include - -u32 font_first_font_table_controller_large[] = +//zurich bold +u32 fontZurichBold_kerning[13*13] = { - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0xFFFFFFFF, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0xFFFFFFFF, - 0x00000000, - 0xFFFFFFFF, - 0x00000000, - 0x00000000, - 0xFFFFFFFF, - 0x00000001, - 0xFFFFFFFF, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000001, - 0x00000000, - 0x00000000, - 0x00000001, - 0x00000001, - 0x00000000, - 0x00000000 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, + 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000 }; -u32 font_second_font_table_controller_large1[] = +u32 fontZurichBold_fontchartable[] = { 0x00000000, 0x00000000, 0x0000000C, 0x00000002, 0x00000000, 0x00000B80, 0x00000001, 0x00000000, 0x00000006, 0x00000002, 0x00000000, 0x00000BE8, @@ -273,7 +117,7 @@ u32 font_second_font_table_controller_large1[] = 0x0000005D, 0x00000005, 0x00000003, 0x0000000A, 0x00000000, 0x00003508 }; -u32 font_second_font_table_controller_large2[] = +u32 fontZurichBold_fontbytes[] = { 0x00000000, 0xB8000000, 0x00000000, 0x09212121, 0x21212121, 0x31BBBBBB, 0xBBBBBBBB, 0x37D9D9D9, 0xD9D9D9D9, 0x34D2D2D2, 0xD2D2D2D2, 0x33CECECE, diff --git a/assets/obseg/Makefile.bg b/assets/obseg/Makefile.bg index a7b85f3a..5f55fcfb 100644 --- a/assets/obseg/Makefile.bg +++ b/assets/obseg/Makefile.bg @@ -51,12 +51,12 @@ BG_SEG_FILES = \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_ash_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_sho_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_ame_all_p.seg \ - $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_oat_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_rit_all_p.seg \ - $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_len_all_p.seg \ + $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_oat_all_p.seg \ + $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_lip_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_lee_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_ear_all_p.seg \ - $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_lip_all_p.seg \ + $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_len_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_pam_all_p.seg \ $(BUILD_DIR)/$(OBSEG_DIR)/bg/bg_wax_all_p.seg diff --git a/assets/obseg/bg/bg_lip_all_p.c b/assets/obseg/bg/bg_len_all_p.c similarity index 99% rename from assets/obseg/bg/bg_lip_all_p.c rename to assets/obseg/bg/bg_len_all_p.c index 4bf16ec1..bd4a3a01 100644 --- a/assets/obseg/bg/bg_lip_all_p.c +++ b/assets/obseg/bg/bg_len_all_p.c @@ -1,5 +1,5 @@ #include "bg_all_p.h" -#include "bg_lip_all_p.h" +#include "bg_len_all_p.h" struct bg_header header = {0, &room_data_table, &portal_data_table, &global_visibility_commands, 0}; diff --git a/assets/obseg/bg/bg_lip_all_p.h b/assets/obseg/bg/bg_len_all_p.h similarity index 100% rename from assets/obseg/bg/bg_lip_all_p.h rename to assets/obseg/bg/bg_len_all_p.h diff --git a/assets/obseg/bg/bg_rit_all_p.c b/assets/obseg/bg/bg_oat_all_p.c similarity index 100% rename from assets/obseg/bg/bg_rit_all_p.c rename to assets/obseg/bg/bg_oat_all_p.c diff --git a/assets/obseg/gun/fist/gunFileRecord.inc.c b/assets/obseg/gun/fist/gunFileRecord.inc.c index 2ca6b24f..615bd306 100644 --- a/assets/obseg/gun/fist/gunFileRecord.inc.c +++ b/assets/obseg/gun/fist/gunFileRecord.inc.c @@ -1,2 +1,2 @@ /*NAME, NOMODEL, STATS, UPPERTEXTID, LOWERTEXTID, POSX, POSY, POSZ, XROT, YROT, WOCTEXT, EQUIPTEXT, EQUIPX, EQUIPY, EQUIPZ*/ -GUNFILERECORD( fist, 0, GUNSTATS(fist), TEXT(LGUN, 0x83), TEXT(LGUN, 0x76), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x76), TEXT(LGUN, 0xCD), 10.0, 10.0, 1000.0) +GUNFILERECORD( fist, 0, GUNSTATS(fist), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_76), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_76), TEXT(LGUN, GUN_STR_CD), 10.0, 10.0, 1000.0) diff --git a/assets/obseg/gun/fist/gunWeaponStat.inc.c b/assets/obseg/gun/fist/gunWeaponStat.inc.c index 6a0aa779..6043fcc3 100644 --- a/assets/obseg/gun/fist/gunWeaponStat.inc.c +++ b/assets/obseg/gun/fist/gunWeaponStat.inc.c @@ -2,7 +2,7 @@ WeaponStats fist_stats = { 1.0, //MuzzleFlashExtension 11.0, -50.0, -33.0, //PosXYZ 3.0, 3.0, 8.5, //PlayXYZ - 0, 0, //ammotype magsize + AMMO_NONE, 0, //ammotype magsize 0xFF, 0x06, //AutomaticFiringRate SingleFiringRate 1, //ObjectsShootThrough 0, 0, //SoundTriggerRate Sound @@ -23,5 +23,9 @@ WeaponStats fist_stats = { 2.0, //field_60 4.0, //field_64 0.0, //ForceOfImpact - 0x64D91//BitFlags + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_MENU | + WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO//BitFlags }; diff --git a/assets/obseg/gun/gunModelFileRecord.inc.c b/assets/obseg/gun/gunModelFileRecord.inc.c index c4c65eb0..ca4c5617 100644 --- a/assets/obseg/gun/gunModelFileRecord.inc.c +++ b/assets/obseg/gun/gunModelFileRecord.inc.c @@ -2,90 +2,90 @@ GunModelFileRecord gitem_structs[] = { { NULL, NULL, TRUE, NULL, 0x9883, 0x9811, 0.0, 0.0, 1000.0, 0.0, 0.0, 0x9811, 0x9811, 10.0, 10.0, 1000.0}, #include #include - GUNFILERECORD( throwknife, 0, GUNSTATS(throwknife), TEXT(LGUN, 0x71), TEXT(LGUN, 0x06), 200.0, 51.0, 1327.0, 0.0, 0.0, TEXT(LGUN, 0x70), TEXT(LGUN, 0xCA), 38.0, 118.0, 800.0) - GUNFILERECORD( wppk, 0, GUNSTATS(wppk), TEXT(LGUN, 0x57), TEXT(LGUN, 0x01), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, 0x56), TEXT(LGUN, 0xBA), 94.0, 2.0, 356.0) - GUNFILERECORD( wppksil, 0, GUNSTATS(wppksil), TEXT(LGUN, 0x03), TEXT(LGUN, 0x10), 26.0, 162.0, 668.0, 0.0, 0.0, TEXT(LGUN, 0x55), TEXT(LGUN, 0xB9), 169.0, 5.0, 535.0) - GUNFILERECORD( tt33, 0, GUNSTATS(tt33), TEXT(LGUN, 0x04), TEXT(LGUN, 0x32), 22.0, 128.0, 709.0, 0.0, 0.0, TEXT(LGUN, 0x2A), TEXT(LGUN, 0x9A), 124.0, 14.0, 455.0) - GUNFILERECORD( skorpion, 0, GUNSTATS(skorpion), TEXT(LGUN, 0x83), TEXT(LGUN, 0x6B), 46.0, 124.0, 785.0, 0.0, 0.0, TEXT(LGUN, 0x6B), TEXT(LGUN, 0xC6), 124.0, 32.0, 545.0) - GUNFILERECORD( ak47, 0, GUNSTATS(ak47), TEXT(LGUN, 0x08), TEXT(LGUN, 0x68), -29.0, 307.0, 1410.0, 0.0, 0.0, TEXT(LGUN, 0x42), TEXT(LGUN, 0xAB), 304.0, -31.0, 1020.0) - GUNFILERECORD( uzi, 0, GUNSTATS(uzi), TEXT(LGUN, 0x83), TEXT(LGUN, 0x82), -18.0, 57.0, 1198.0, 0.0, 0.0, TEXT(LGUN, 0x82), TEXT(LGUN, 0xD7), 68.0, -49.0, 667.0) - GUNFILERECORD( mp5k, 0, GUNSTATS(mp5k), TEXT(LGUN, 0x00), TEXT(LGUN, 0x2F), 12.0, 112.0, 1300.0, 0.0, 0.0, TEXT(LGUN, 0x29), TEXT(LGUN, 0x96), 123.0, -2.0, 628.0) - GUNFILERECORD( mp5ksil, 0, GUNSTATS(mp5ksil), TEXT(LGUN, 0x00), TEXT(LGUN, 0x10), 14.0, 227.0, 1300.0, 0.0, 0.0, TEXT(LGUN, 0x28), TEXT(LGUN, 0x95), 226.0, -10.0, 834.0) - GUNFILERECORD( spectre, 0, GUNSTATS(spectre), TEXT(LGUN, 0x83), TEXT(LGUN, 0x58), -4.0, 144.0, 1128.0, 0.0, 0.0, TEXT(LGUN, 0x58), TEXT(LGUN, 0xB4), 146.0, -18.0, 801.0) - GUNFILERECORD( m16, 0, GUNSTATS(m16), TEXT(LGUN, 0x75), TEXT(LGUN, 0x12), 25.0, 251.0, 1796.0, 0.0, 0.0, TEXT(LGUN, 0x74), TEXT(LGUN, 0x84), 246.0, -45.0, 1497.0) - GUNFILERECORD( fnp90, 0, GUNSTATS(fnp90), TEXT(LGUN, 0x83), TEXT(LGUN, 0x5E), 88.0, -44.0, 1107.0, 0.0, 0.0, TEXT(LGUN, 0x5E), TEXT(LGUN, 0xBC), -44.0, 31.0, 867.0) - GUNFILERECORD( shotgun, 0, GUNSTATS(shotgun), TEXT(LGUN, 0x83), TEXT(LGUN, 0x64), 39.0, 283.0, 1224.0, 0.0, 0.0, TEXT(LGUN, 0x64), TEXT(LGUN, 0xC1), 284.0, -22.0, 999.0) - GUNFILERECORD( autoshot, 0, GUNSTATS(autoshot), TEXT(LGUN, 0x16), TEXT(LGUN, 0x0C), 73.0, 285.0, 1224.0, 0.0, 0.0, TEXT(LGUN, 0x15), TEXT(LGUN, 0x86), 284.0, 4.0, 980.0) - GUNFILERECORD( sniperrifle, 0, GUNSTATS(sniperrifle), TEXT(LGUN, 0x67), TEXT(LGUN, 0x0A), 49.0, 265.0, 1760.0, 0.0, 0.0, TEXT(LGUN, 0x66), TEXT(LGUN, 0xC3), 268.0, 14.0, 1497.0) - GUNFILERECORD( ruger, 0, GUNSTATS(ruger), TEXT(LGUN, 0x26), TEXT(LGUN, 0x4C), 47.0, 184.0, 769.0, 0.0, 0.0, TEXT(LGUN, 0x25), TEXT(LGUN, 0x93), 182.0, 36.0, 604.0) - GUNFILERECORD( goldengun, 0, GUNSTATS(goldengun), TEXT(LGUN, 0x3B), TEXT(LGUN, 0x05), 29.0, 146.0, 629.0, 0.0, 0.0, TEXT(LGUN, 0x39), TEXT(LGUN, 0xA3), 144.0, 18.0, 464.0) - GUNFILERECORD( silverwppk, 0, GUNSTATS(silverwppk), TEXT(LGUN, 0x83), TEXT(LGUN, 0x65), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, 0x65), TEXT(LGUN, 0xC2), 94.0, 2.0, 356.0) - GUNFILERECORD( goldwppk, 0, GUNSTATS(goldwppk), TEXT(LGUN, 0x83), TEXT(LGUN, 0x38), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, 0x38), TEXT(LGUN, 0xA2), 94.0, 2.0, 356.0) - GUNFILERECORD( laser, 0, GUNSTATS(laser), TEXT(LGUN, 0x52), TEXT(LGUN, 0x47), 67.0, 106.0, 738.0, 0.0, 0.0, TEXT(LGUN, 0x51), TEXT(LGUN, 0xAC), 103.0, 21.0, 545.0) - GUNFILERECORD( watchlaser, 0, GUNSTATS(watchlaser), TEXT(LGUN, 0x7F), TEXT(LGUN, 0x47), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x7B), TEXT(LGUN, 0xD2), 0.0, -40.0, 1383.0) - GUNFILERECORD( grenadelaunch, 0, GUNSTATS(grenadelaunch), TEXT(LGUN, 0x3D), TEXT(LGUN, 0x48), 27.0, 279.0, 1152.0, 0.0, 0.0, TEXT(LGUN, 0x3C), TEXT(LGUN, 0xA5), 284.0, -22.0, 960.0) - GUNFILERECORD( rocketlaunch, 0, GUNSTATS(rocketlaunch), TEXT(LGUN, 0x0B), TEXT(LGUN, 0x48), 111.0, -50.0, 1624.0, 0.0, 0.0, TEXT(LGUN, 0x61), TEXT(LGUN, 0xBF), -42.0, 16.0, 1381.0) - GUNFILERECORD( grenade, 0, GUNSTATS(grenade), TEXT(LGUN, 0x83), TEXT(LGUN, 0x3D), 180.0, 0.0, 2745.0, 0.0, 90.0, TEXT(LGUN, 0x3E), TEXT(LGUN, 0xA6), 0.0, 48.0, 1468.0) - GUNFILERECORD( timedmine, 0, GUNSTATS(timedmine), TEXT(LGUN, 0x09), TEXT(LGUN, 0x0F), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, 0x72), TEXT(LGUN, 0xCB), 0.0, -3.0, 179.0) - GUNFILERECORD( proximitymine, 0, GUNSTATS(proximitymine), TEXT(LGUN, 0x02), TEXT(LGUN, 0x0D), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, 0x5D), TEXT(LGUN, 0xBB), 0.0, -3.0, 179.0) - GUNFILERECORD( remotemine, 0, GUNSTATS(remotemine), TEXT(LGUN, 0x07), TEXT(LGUN, 0x0E), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, 0x60), TEXT(LGUN, 0xBE), 0.0, -3.0, 179.0) - GUNFILERECORD( trigger, 0, GUNSTATS(trigger), TEXT(LGUN, 0x83), TEXT(LGUN, 0x2E), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x2E), TEXT(LGUN, 0x9B), 0.0, -40.0, 1383.0) - GUNFILERECORD( taser, 0, GUNSTATS(taser), TEXT(LGUN, 0x83), TEXT(LGUN, 0x6F), 107.0, 49.0, 568.0, 0.0, 0.0, TEXT(LGUN, 0x6F), TEXT(LGUN, 0xC9), 64.0, 80.0, 333.0) - { NULL, NULL, 0, GUNSTATS(tank), TEXT(LGUN, 0x83), TEXT(LGUN, 0x6E), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, 0x6E), TEXT(LGUN, 0xC8), 94.0, 2.0, 356.0}, - GUNFILERECORD( bombcase, 0, GUNSTATS(bombcase), TEXT(LGUN, 0x83), TEXT(LGUN, 0x1A), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, 0x1A), TEXT(LGUN, 0x8A), 0.0, -8.0, 323.0) - GUNFILERECORD( plastique, 0, GUNSTATS(plastique), TEXT(LGUN, 0x83), TEXT(LGUN, 0x5B), 28.0, 0.0, 1062.0, 80.0, 90.0, TEXT(LGUN, 0x5B), TEXT(LGUN, 0xB7), 0.0, -16.0, 739.0) - GUNFILERECORD( flarepistol, 0, GUNSTATS(flarepistol), TEXT(LGUN, 0x83), TEXT(LGUN, 0x34), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x34), TEXT(LGUN, 0x9F), 0.0, 0.0, 1000.0) - GUNFILERECORD( pitongun, 0, GUNSTATS(pitongun), TEXT(LGUN, 0x83), TEXT(LGUN, 0x59), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x59), TEXT(LGUN, 0xB5), 0.0, 0.0, 1000.0) - GUNFILERECORD( bungee, TRUE, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x1F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x1F), TEXT(LGUN, 0x8F), 0.0, 0.0, 1000.0) - GUNFILERECORD( doordecoder, TRUE, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x30), 12.0, 0.0, 364.0, 90.0, 90.0, TEXT(LGUN, 0x30), TEXT(LGUN, 0x9C), 0.0, -6.0, 199.0) - GUNFILERECORD( bombdefuser, TRUE, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x1B), 14.0, 0.0, 379.0, 90.0, 90.0, TEXT(LGUN, 0x1B), TEXT(LGUN, 0x8B), 0.0, 0.0, 279.0) - GUNFILERECORD( camera, 0, GUNSTATS(camera), TEXT(LGUN, 0x83), TEXT(LGUN, 0x20), 4.0, 0.0, 195.0, 20.0, 90.0, TEXT(LGUN, 0x20), TEXT(LGUN, 0x90), 0.0, -2.0, 144.0) - GUNFILERECORD( lockexploder, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x4A), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x4A), TEXT(LGUN, 0xAE), 0.0, 0.0, 1000.0) - GUNFILERECORD( doorexploder, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x31), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x31), TEXT(LGUN, 0x9D), 0.0, 0.0, 1000.0) - GUNFILERECORD( briefcase, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x1C), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, 0x1C), TEXT(LGUN, 0x8C), 0.0, -8.0, 323.0) - GUNFILERECORD( weaponcase, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x80), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, 0x80), TEXT(LGUN, 0xD5), 0.0, -8.0, 323.0) - GUNFILERECORD( safecrackercase, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x63), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, 0x62), TEXT(LGUN, 0xC0), 0.0, -8.0, 323.0) - GUNFILERECORD( keyanalysercase, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x44), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, 0x43), TEXT(LGUN, 0xA9), 0.0, -8.0, 323.0) - GUNFILERECORD( bug, 0, GUNSTATS(bug), TEXT(LGUN, 0x83), TEXT(LGUN, 0x1E), 16.0, 0.0, 513.0, 0.0, 90.0, TEXT(LGUN, 0x1E), TEXT(LGUN, 0x8E), 0.0, -6.0, 387.0) - GUNFILERECORD( microcamera, 0, GUNSTATS(microcamera), TEXT(LGUN, 0x83), TEXT(LGUN, 0x4E), 8.0, 0.0, 310.0, 0.0, 270.0, TEXT(LGUN, 0x4E), TEXT(LGUN, 0xB0), 0.0, -8.0, 229.0) - GUNFILERECORD( bugdetector, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x1D), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x1D), TEXT(LGUN, 0x8D), 0.0, 0.0, 1000.0) - GUNFILERECORD( explosivefloppy, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x33), 12.0, 0.0, 336.0, 0.0, 90.0, TEXT(LGUN, 0x33), TEXT(LGUN, 0x9E), 0.0, -4.0, 176.0) - GUNFILERECORD( polarizedglasses, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x5C), 2.0, 0.0, 183.0, 15.0, 90.0, TEXT(LGUN, 0x5C), TEXT(LGUN, 0xB8), 0.0, 0.0, 147.0) - GUNFILERECORD( darkglasses, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x2B), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x2B), TEXT(LGUN, 0x97), 0.0, 0.0, 1000.0) - GUNFILERECORD( creditcard, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x27), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x27), TEXT(LGUN, 0x94), 0.0, 0.0, 1000.0) - GUNFILERECORD( gaskeyring, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x35), 26.0, 0.0, 769.0, 90.0, 90.0, TEXT(LGUN, 0x35), TEXT(LGUN, 0xA0), 0.0, -8.0, 387.0) - GUNFILERECORD( datathief, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x2D), 16.0, 0.0, 474.0, 80.0, 0.0, TEXT(LGUN, 0x2D), TEXT(LGUN, 0x99), 0.0, -6.0, 350.0) - GUNFILERECORD( watchidentifier, 1, NULL, TEXT(LGUN, 0x7F), TEXT(LGUN, 0x41), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x7A), TEXT(LGUN, 0xD1), 0.0, -40.0, 1383.0) - GUNFILERECORD( watchcommunicator, 1, NULL, TEXT(LGUN, 0x7F), TEXT(LGUN, 0x23), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x78), TEXT(LGUN, 0xCF), 0.0, -40.0, 1383.0) - GUNFILERECORD( watchgeigercounter, 1, NULL, TEXT(LGUN, 0x7F), TEXT(LGUN, 0x36), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x79), TEXT(LGUN, 0xD0), 0.0, -40.0, 1383.0) - GUNFILERECORD( watchmagnetrepel, 1, NULL, TEXT(LGUN, 0x7F), TEXT(LGUN, 0x4B), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, 0x7D), TEXT(LGUN, 0xD4), 0.0, -40.0, 1383.0) - GUNFILERECORD( watchmagnetattract, 0,GUNSTATS(watchmagnetattract), TEXT(LGUN, 0x7E), TEXT(LGUN, 0x13), 80.0, 0.0, 3036.0, 0.0, 90.0, TEXT(LGUN, 0x7C), TEXT(LGUN, 0xD3), 0.0, -40.0, 1383.0) - GUNFILERECORD( goldeneyekey, 0, GUNSTATS(goldeneyekey), TEXT(LGUN, 0x83), TEXT(LGUN, 0x3A), 18.0, 0.0, 560.0, 80.0, 0.0, TEXT(LGUN, 0x3A), TEXT(LGUN, 0xA4), 0.0, -4.0, 310.0) - GUNFILERECORD( blackbox, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x17), 18.0, 0.0, 545.0, 0.0, 90.0, TEXT(LGUN, 0x17), TEXT(LGUN, 0x87), 0.0, -8.0, 380.0) - GUNFILERECORD( circuitboard, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x21), 20.0, 0.0, 568.0, 80.0, 0.0, TEXT(LGUN, 0x21), TEXT(LGUN, 0x91), 0.0, 0.0, 394.0) - GUNFILERECORD( clipboard, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x22), 40.0, 0.0, 1151.0, 80.0, 90.0, TEXT(LGUN, 0x22), TEXT(LGUN, 0x92), 0.0, -20.0, 580.0) - GUNFILERECORD( stafflist, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x6C), 44.0, 0.0, 1274.0, 80.0, 90.0, TEXT(LGUN, 0x6C), TEXT(LGUN, 0xC7), 0.0, -16.0, 681.0) - GUNFILERECORD( dossierred, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x5F), 38.0, 0.0, 1084.0, 350.0, 90.0, TEXT(LGUN, 0x5F), TEXT(LGUN, 0xBD), 0.0, -12.0, 580.0) - GUNFILERECORD( plans, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x5A), 18.0, 0.0, 464.0, 350.0, 90.0, TEXT(LGUN, 0x5A), TEXT(LGUN, 0xB6), 0.0, -2.0, 253.0) - GUNFILERECORD( spyfile, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x6A), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x6A), TEXT(LGUN, 0xC5), 0.0, 0.0, 1000.0) - GUNFILERECORD( blueprints, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x18), 18.0, 0.0, 579.0, 350.0, 90.0, TEXT(LGUN, 0x18), TEXT(LGUN, 0x88), 0.0, -8.0, 364.0) - GUNFILERECORD( map, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x4D), 18.0, 0.0, 579.0, 350.0, 90.0, TEXT(LGUN, 0x4D), TEXT(LGUN, 0xAF), 0.0, -6.0, 364.0) - GUNFILERECORD( audiotape, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x14), 16.0, 0.0, 428.0, 90.0, 90.0, TEXT(LGUN, 0x14), TEXT(LGUN, 0x85), 0.0, -2.0, 292.0) - GUNFILERECORD( videotape, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x77), 26.0, 0.0, 753.0, 90.0, 0.0, TEXT(LGUN, 0x77), TEXT(LGUN, 0xCE), 0.0, -8.0, 395.0) - GUNFILERECORD( dattape, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x2C), 14.0, 0.0, 387.0, 90.0, 90.0, TEXT(LGUN, 0x2C), TEXT(LGUN, 0x98), 0.0, 0.0, 238.0) - GUNFILERECORD( spooltape, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x69), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x69), TEXT(LGUN, 0xC4), 0.0, 0.0, 1000.0) - GUNFILERECORD( microfilm, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x50), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x50), TEXT(LGUN, 0xB2), 0.0, 0.0, 1000.0) - GUNFILERECORD( microcode, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x4F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x4F), TEXT(LGUN, 0xB1), 0.0, 0.0, 1000.0) - GUNFILERECORD( lectre, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x49), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x49), TEXT(LGUN, 0xAD), 0.0, 0.0, 1000.0) - GUNFILERECORD( money, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x53), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x53), TEXT(LGUN, 0xB3), 0.0, 0.0, 1000.0) - GUNFILERECORD( goldbar, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x37), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x37), TEXT(LGUN, 0xA1), 0.0, 0.0, 1000.0) - GUNFILERECORD( heroin, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x3F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x3F), TEXT(LGUN, 0xA7), 0.0, 0.0, 1000.0) - GUNFILERECORD( keycard, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x45), 24.0, 0.0, 556.0, 80.0, 90.0, TEXT(LGUN, 0x45), TEXT(LGUN, 0xAA), 0.0, -6.0, 411.0) - GUNFILERECORD( keyyale, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x81), 64.0, 0.0, 1912.0, 260.0, 90.0, TEXT(LGUN, 0x81), TEXT(LGUN, 0xD6), 0.0, -18.0, 1568.0) - GUNFILERECORD( keybolt, 1, NULL, TEXT(LGUN, 0x83), TEXT(LGUN, 0x19), 78.0, 0.0, 3518.0, 80.0, 90.0, TEXT(LGUN, 0x19), TEXT(LGUN, 0x89), 0.0, -12.0, 2582.0) - SUIT_LFRECORD(suit_lf_hand, 0, GUNSTATS(Csuit_lf_handz), TEXT(LGUN, 0x83), TEXT(LGUN, 0x6D), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x83), TEXT(LGUN, 0x83), 10.0, 10.0, 1000.0) - GUNFILERECORD( joypad, 0, GUNSTATS(joypad), TEXT(LGUN, 0x83), TEXT(LGUN, 0x24), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x83), TEXT(LGUN, 0x83), 10.0, 10.0, 1000.0) - { NULL , NULL, 0, GUNSTATS(null1), TEXT(LGUN, 0x83), TEXT(LGUN, 0x54), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x83), TEXT(LGUN, 0x83), 10.0, 10.0, 1000.0}, - { NULL , NULL, 0, GUNSTATS(null2), TEXT(LGUN, 0x83), TEXT(LGUN, 0x54), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, 0x83), TEXT(LGUN, 0x83), 10.0, 10.0, 1000.0}, - { NULL , NULL, 0, GUNSTATS(token), TEXT(LGUN, 0x83), TEXT(LGUN, 0x73), 12.0, 0.0, 528.0, 80.0, 0.0, TEXT(LGUN, 0x73), TEXT(LGUN, 0xCC), 0.0, -4.0, 310.0} + GUNFILERECORD( throwknife, 0, GUNSTATS(throwknife), TEXT(LGUN, GUN_STR_71), TEXT(LGUN, GUN_STR_06), 200.0, 51.0, 1327.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_70), TEXT(LGUN, GUN_STR_CA), 38.0, 118.0, 800.0) + GUNFILERECORD( wppk, 0, GUNSTATS(wppk), TEXT(LGUN, GUN_STR_57), TEXT(LGUN, GUN_STR_01), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_56), TEXT(LGUN, GUN_STR_BA), 94.0, 2.0, 356.0) + GUNFILERECORD( wppksil, 0, GUNSTATS(wppksil), TEXT(LGUN, GUN_STR_03), TEXT(LGUN, GUN_STR_10), 26.0, 162.0, 668.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_55), TEXT(LGUN, GUN_STR_B9), 169.0, 5.0, 535.0) + GUNFILERECORD( tt33, 0, GUNSTATS(tt33), TEXT(LGUN, GUN_STR_04), TEXT(LGUN, GUN_STR_32), 22.0, 128.0, 709.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_2A), TEXT(LGUN, GUN_STR_9A), 124.0, 14.0, 455.0) + GUNFILERECORD( skorpion, 0, GUNSTATS(skorpion), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6B), 46.0, 124.0, 785.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_6B), TEXT(LGUN, GUN_STR_C6), 124.0, 32.0, 545.0) + GUNFILERECORD( ak47, 0, GUNSTATS(ak47), TEXT(LGUN, GUN_STR_08), TEXT(LGUN, GUN_STR_68), -29.0, 307.0, 1410.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_42), TEXT(LGUN, GUN_STR_AB), 304.0, -31.0, 1020.0) + GUNFILERECORD( uzi, 0, GUNSTATS(uzi), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_82), -18.0, 57.0, 1198.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_82), TEXT(LGUN, GUN_STR_D7), 68.0, -49.0, 667.0) + GUNFILERECORD( mp5k, 0, GUNSTATS(mp5k), TEXT(LGUN, GUN_STR_00), TEXT(LGUN, GUN_STR_2F), 12.0, 112.0, 1300.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_29), TEXT(LGUN, GUN_STR_96), 123.0, -2.0, 628.0) + GUNFILERECORD( mp5ksil, 0, GUNSTATS(mp5ksil), TEXT(LGUN, GUN_STR_00), TEXT(LGUN, GUN_STR_10), 14.0, 227.0, 1300.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_28), TEXT(LGUN, GUN_STR_95), 226.0, -10.0, 834.0) + GUNFILERECORD( spectre, 0, GUNSTATS(spectre), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_58), -4.0, 144.0, 1128.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_58), TEXT(LGUN, GUN_STR_B4), 146.0, -18.0, 801.0) + GUNFILERECORD( m16, 0, GUNSTATS(m16), TEXT(LGUN, GUN_STR_75), TEXT(LGUN, GUN_STR_12), 25.0, 251.0, 1796.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_74), TEXT(LGUN, GUN_STR_84), 246.0, -45.0, 1497.0) + GUNFILERECORD( fnp90, 0, GUNSTATS(fnp90), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_5E), 88.0, -44.0, 1107.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_5E), TEXT(LGUN, GUN_STR_BC), -44.0, 31.0, 867.0) + GUNFILERECORD( shotgun, 0, GUNSTATS(shotgun), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_64), 39.0, 283.0, 1224.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_64), TEXT(LGUN, GUN_STR_C1), 284.0, -22.0, 999.0) + GUNFILERECORD( autoshot, 0, GUNSTATS(autoshot), TEXT(LGUN, GUN_STR_16), TEXT(LGUN, GUN_STR_0C), 73.0, 285.0, 1224.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_15), TEXT(LGUN, GUN_STR_86), 284.0, 4.0, 980.0) + GUNFILERECORD( sniperrifle, 0, GUNSTATS(sniperrifle), TEXT(LGUN, GUN_STR_67), TEXT(LGUN, GUN_STR_0A), 49.0, 265.0, 1760.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_66), TEXT(LGUN, GUN_STR_C3), 268.0, 14.0, 1497.0) + GUNFILERECORD( ruger, 0, GUNSTATS(ruger), TEXT(LGUN, GUN_STR_26), TEXT(LGUN, GUN_STR_4C), 47.0, 184.0, 769.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_25), TEXT(LGUN, GUN_STR_93), 182.0, 36.0, 604.0) + GUNFILERECORD( goldengun, 0, GUNSTATS(goldengun), TEXT(LGUN, GUN_STR_3B), TEXT(LGUN, GUN_STR_05), 29.0, 146.0, 629.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_39), TEXT(LGUN, GUN_STR_A3), 144.0, 18.0, 464.0) + GUNFILERECORD( silverwppk, 0, GUNSTATS(silverwppk), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_65), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_65), TEXT(LGUN, GUN_STR_C2), 94.0, 2.0, 356.0) + GUNFILERECORD( goldwppk, 0, GUNSTATS(goldwppk), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_38), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_38), TEXT(LGUN, GUN_STR_A2), 94.0, 2.0, 356.0) + GUNFILERECORD( laser, 0, GUNSTATS(laser), TEXT(LGUN, GUN_STR_52), TEXT(LGUN, GUN_STR_47), 67.0, 106.0, 738.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_51), TEXT(LGUN, GUN_STR_AC), 103.0, 21.0, 545.0) + GUNFILERECORD( watchlaser, 0, GUNSTATS(watchlaser), TEXT(LGUN, GUN_STR_7F), TEXT(LGUN, GUN_STR_47), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_7B), TEXT(LGUN, GUN_STR_D2), 0.0, -40.0, 1383.0) + GUNFILERECORD( grenadelaunch, 0, GUNSTATS(grenadelaunch), TEXT(LGUN, GUN_STR_3D), TEXT(LGUN, GUN_STR_48), 27.0, 279.0, 1152.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_3C), TEXT(LGUN, GUN_STR_A5), 284.0, -22.0, 960.0) + GUNFILERECORD( rocketlaunch, 0, GUNSTATS(rocketlaunch), TEXT(LGUN, GUN_STR_0B), TEXT(LGUN, GUN_STR_48), 111.0, -50.0, 1624.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_61), TEXT(LGUN, GUN_STR_BF), -42.0, 16.0, 1381.0) + GUNFILERECORD( grenade, 0, GUNSTATS(grenade), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_3D), 180.0, 0.0, 2745.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_3E), TEXT(LGUN, GUN_STR_A6), 0.0, 48.0, 1468.0) + GUNFILERECORD( timedmine, 0, GUNSTATS(timedmine), TEXT(LGUN, GUN_STR_09), TEXT(LGUN, GUN_STR_0F), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, GUN_STR_72), TEXT(LGUN, GUN_STR_CB), 0.0, -3.0, 179.0) + GUNFILERECORD( proximitymine, 0, GUNSTATS(proximitymine), TEXT(LGUN, GUN_STR_02), TEXT(LGUN, GUN_STR_0D), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, GUN_STR_5D), TEXT(LGUN, GUN_STR_BB), 0.0, -3.0, 179.0) + GUNFILERECORD( remotemine, 0, GUNSTATS(remotemine), TEXT(LGUN, GUN_STR_07), TEXT(LGUN, GUN_STR_0E), 8.0, 0.0, 364.0, 90.0, 0.0, TEXT(LGUN, GUN_STR_60), TEXT(LGUN, GUN_STR_BE), 0.0, -3.0, 179.0) + GUNFILERECORD( trigger, 0, GUNSTATS(trigger), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_2E), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_2E), TEXT(LGUN, GUN_STR_9B), 0.0, -40.0, 1383.0) + GUNFILERECORD( taser, 0, GUNSTATS(taser), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6F), 107.0, 49.0, 568.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_6F), TEXT(LGUN, GUN_STR_C9), 64.0, 80.0, 333.0) + { NULL, NULL, 0, GUNSTATS(tank), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6E), 20.0, 97.0, 579.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_6E), TEXT(LGUN, GUN_STR_C8), 94.0, 2.0, 356.0}, + GUNFILERECORD( bombcase, 0, GUNSTATS(bombcase), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1A), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_1A), TEXT(LGUN, GUN_STR_8A), 0.0, -8.0, 323.0) + GUNFILERECORD( plastique, 0, GUNSTATS(plastique), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_5B), 28.0, 0.0, 1062.0, 80.0, 90.0, TEXT(LGUN, GUN_STR_5B), TEXT(LGUN, GUN_STR_B7), 0.0, -16.0, 739.0) + GUNFILERECORD( flarepistol, 0, GUNSTATS(flarepistol), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_34), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_34), TEXT(LGUN, GUN_STR_9F), 0.0, 0.0, 1000.0) + GUNFILERECORD( pitongun, 0, GUNSTATS(pitongun), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_59), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_59), TEXT(LGUN, GUN_STR_B5), 0.0, 0.0, 1000.0) + GUNFILERECORD( bungee, TRUE, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_1F), TEXT(LGUN, GUN_STR_8F), 0.0, 0.0, 1000.0) + GUNFILERECORD( doordecoder, TRUE, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_30), 12.0, 0.0, 364.0, 90.0, 90.0, TEXT(LGUN, GUN_STR_30), TEXT(LGUN, GUN_STR_9C), 0.0, -6.0, 199.0) + GUNFILERECORD( bombdefuser, TRUE, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1B), 14.0, 0.0, 379.0, 90.0, 90.0, TEXT(LGUN, GUN_STR_1B), TEXT(LGUN, GUN_STR_8B), 0.0, 0.0, 279.0) + GUNFILERECORD( camera, 0, GUNSTATS(camera), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_20), 4.0, 0.0, 195.0, 20.0, 90.0, TEXT(LGUN, GUN_STR_20), TEXT(LGUN, GUN_STR_90), 0.0, -2.0, 144.0) + GUNFILERECORD( lockexploder, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_4A), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_4A), TEXT(LGUN, GUN_STR_AE), 0.0, 0.0, 1000.0) + GUNFILERECORD( doorexploder, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_31), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_31), TEXT(LGUN, GUN_STR_9D), 0.0, 0.0, 1000.0) + GUNFILERECORD( briefcase, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1C), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_1C), TEXT(LGUN, GUN_STR_8C), 0.0, -8.0, 323.0) + GUNFILERECORD( weaponcase, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_80), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_80), TEXT(LGUN, GUN_STR_D5), 0.0, -8.0, 323.0) + GUNFILERECORD( safecrackercase, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_63), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_62), TEXT(LGUN, GUN_STR_C0), 0.0, -8.0, 323.0) + GUNFILERECORD( keyanalysercase, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_44), 16.0, 0.0, 568.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_43), TEXT(LGUN, GUN_STR_A9), 0.0, -8.0, 323.0) + GUNFILERECORD( bug, 0, GUNSTATS(bug), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1E), 16.0, 0.0, 513.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_1E), TEXT(LGUN, GUN_STR_8E), 0.0, -6.0, 387.0) + GUNFILERECORD( microcamera, 0, GUNSTATS(microcamera), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_4E), 8.0, 0.0, 310.0, 0.0, 270.0, TEXT(LGUN, GUN_STR_4E), TEXT(LGUN, GUN_STR_B0), 0.0, -8.0, 229.0) + GUNFILERECORD( bugdetector, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_1D), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_1D), TEXT(LGUN, GUN_STR_8D), 0.0, 0.0, 1000.0) + GUNFILERECORD( explosivefloppy, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_33), 12.0, 0.0, 336.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_33), TEXT(LGUN, GUN_STR_9E), 0.0, -4.0, 176.0) + GUNFILERECORD( polarizedglasses, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_5C), 2.0, 0.0, 183.0, 15.0, 90.0, TEXT(LGUN, GUN_STR_5C), TEXT(LGUN, GUN_STR_B8), 0.0, 0.0, 147.0) + GUNFILERECORD( darkglasses, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_2B), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_2B), TEXT(LGUN, GUN_STR_97), 0.0, 0.0, 1000.0) + GUNFILERECORD( creditcard, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_27), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_27), TEXT(LGUN, GUN_STR_94), 0.0, 0.0, 1000.0) + GUNFILERECORD( gaskeyring, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_35), 26.0, 0.0, 769.0, 90.0, 90.0, TEXT(LGUN, GUN_STR_35), TEXT(LGUN, GUN_STR_A0), 0.0, -8.0, 387.0) + GUNFILERECORD( datathief, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_2D), 16.0, 0.0, 474.0, 80.0, 0.0, TEXT(LGUN, GUN_STR_2D), TEXT(LGUN, GUN_STR_99), 0.0, -6.0, 350.0) + GUNFILERECORD( watchidentifier, 1, NULL, TEXT(LGUN, GUN_STR_7F), TEXT(LGUN, GUN_STR_41), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_7A), TEXT(LGUN, GUN_STR_D1), 0.0, -40.0, 1383.0) + GUNFILERECORD( watchcommunicator, 1, NULL, TEXT(LGUN, GUN_STR_7F), TEXT(LGUN, GUN_STR_23), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_78), TEXT(LGUN, GUN_STR_CF), 0.0, -40.0, 1383.0) + GUNFILERECORD( watchgeigercounter, 1, NULL, TEXT(LGUN, GUN_STR_7F), TEXT(LGUN, GUN_STR_36), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_79), TEXT(LGUN, GUN_STR_D0), 0.0, -40.0, 1383.0) + GUNFILERECORD( watchmagnetrepel, 1, NULL, TEXT(LGUN, GUN_STR_7F), TEXT(LGUN, GUN_STR_4B), 82.0, 0.0, 2857.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_7D), TEXT(LGUN, GUN_STR_D4), 0.0, -40.0, 1383.0) + GUNFILERECORD( watchmagnetattract, 0,GUNSTATS(watchmagnetattract), TEXT(LGUN, GUN_STR_7E), TEXT(LGUN, GUN_STR_13), 80.0, 0.0, 3036.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_7C), TEXT(LGUN, GUN_STR_D3), 0.0, -40.0, 1383.0) + GUNFILERECORD( goldeneyekey, 0, GUNSTATS(goldeneyekey), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_3A), 18.0, 0.0, 560.0, 80.0, 0.0, TEXT(LGUN, GUN_STR_3A), TEXT(LGUN, GUN_STR_A4), 0.0, -4.0, 310.0) + GUNFILERECORD( blackbox, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_17), 18.0, 0.0, 545.0, 0.0, 90.0, TEXT(LGUN, GUN_STR_17), TEXT(LGUN, GUN_STR_87), 0.0, -8.0, 380.0) + GUNFILERECORD( circuitboard, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_21), 20.0, 0.0, 568.0, 80.0, 0.0, TEXT(LGUN, GUN_STR_21), TEXT(LGUN, GUN_STR_91), 0.0, 0.0, 394.0) + GUNFILERECORD( clipboard, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_22), 40.0, 0.0, 1151.0, 80.0, 90.0, TEXT(LGUN, GUN_STR_22), TEXT(LGUN, GUN_STR_92), 0.0, -20.0, 580.0) + GUNFILERECORD( stafflist, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6C), 44.0, 0.0, 1274.0, 80.0, 90.0, TEXT(LGUN, GUN_STR_6C), TEXT(LGUN, GUN_STR_C7), 0.0, -16.0, 681.0) + GUNFILERECORD( dossierred, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_5F), 38.0, 0.0, 1084.0, 350.0, 90.0, TEXT(LGUN, GUN_STR_5F), TEXT(LGUN, GUN_STR_BD), 0.0, -12.0, 580.0) + GUNFILERECORD( plans, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_5A), 18.0, 0.0, 464.0, 350.0, 90.0, TEXT(LGUN, GUN_STR_5A), TEXT(LGUN, GUN_STR_B6), 0.0, -2.0, 253.0) + GUNFILERECORD( spyfile, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6A), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_6A), TEXT(LGUN, GUN_STR_C5), 0.0, 0.0, 1000.0) + GUNFILERECORD( blueprints, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_18), 18.0, 0.0, 579.0, 350.0, 90.0, TEXT(LGUN, GUN_STR_18), TEXT(LGUN, GUN_STR_88), 0.0, -8.0, 364.0) + GUNFILERECORD( map, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_4D), 18.0, 0.0, 579.0, 350.0, 90.0, TEXT(LGUN, GUN_STR_4D), TEXT(LGUN, GUN_STR_AF), 0.0, -6.0, 364.0) + GUNFILERECORD( audiotape, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_14), 16.0, 0.0, 428.0, 90.0, 90.0, TEXT(LGUN, GUN_STR_14), TEXT(LGUN, GUN_STR_85), 0.0, -2.0, 292.0) + GUNFILERECORD( videotape, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_77), 26.0, 0.0, 753.0, 90.0, 0.0, TEXT(LGUN, GUN_STR_77), TEXT(LGUN, GUN_STR_CE), 0.0, -8.0, 395.0) + GUNFILERECORD( dattape, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_2C), 14.0, 0.0, 387.0, 90.0, 90.0, TEXT(LGUN, GUN_STR_2C), TEXT(LGUN, GUN_STR_98), 0.0, 0.0, 238.0) + GUNFILERECORD( spooltape, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_69), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_69), TEXT(LGUN, GUN_STR_C4), 0.0, 0.0, 1000.0) + GUNFILERECORD( microfilm, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_50), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_50), TEXT(LGUN, GUN_STR_B2), 0.0, 0.0, 1000.0) + GUNFILERECORD( microcode, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_4F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_4F), TEXT(LGUN, GUN_STR_B1), 0.0, 0.0, 1000.0) + GUNFILERECORD( lectre, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_49), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_49), TEXT(LGUN, GUN_STR_AD), 0.0, 0.0, 1000.0) + GUNFILERECORD( money, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_53), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_53), TEXT(LGUN, GUN_STR_B3), 0.0, 0.0, 1000.0) + GUNFILERECORD( goldbar, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_37), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_37), TEXT(LGUN, GUN_STR_A1), 0.0, 0.0, 1000.0) + GUNFILERECORD( heroin, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_3F), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_3F), TEXT(LGUN, GUN_STR_A7), 0.0, 0.0, 1000.0) + GUNFILERECORD( keycard, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_45), 24.0, 0.0, 556.0, 80.0, 90.0, TEXT(LGUN, GUN_STR_45), TEXT(LGUN, GUN_STR_AA), 0.0, -6.0, 411.0) + GUNFILERECORD( keyyale, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_81), 64.0, 0.0, 1912.0, 260.0, 90.0, TEXT(LGUN, GUN_STR_81), TEXT(LGUN, GUN_STR_D6), 0.0, -18.0, 1568.0) + GUNFILERECORD( keybolt, 1, NULL, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_19), 78.0, 0.0, 3518.0, 80.0, 90.0, TEXT(LGUN, GUN_STR_19), TEXT(LGUN, GUN_STR_89), 0.0, -12.0, 2582.0) + SUIT_LFRECORD(suit_lf_hand, 0, GUNSTATS(Csuit_lf_handz), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_6D), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_83), 10.0, 10.0, 1000.0) + GUNFILERECORD( joypad, 0, GUNSTATS(joypad), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_24), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_83), 10.0, 10.0, 1000.0) + { NULL , NULL, 0, GUNSTATS(null1), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_54), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_83), 10.0, 10.0, 1000.0}, + { NULL , NULL, 0, GUNSTATS(null2), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_54), 0.0, 0.0, 1000.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_83), 10.0, 10.0, 1000.0}, + { NULL , NULL, 0, GUNSTATS(token), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_73), 12.0, 0.0, 528.0, 80.0, 0.0, TEXT(LGUN, GUN_STR_73), TEXT(LGUN, GUN_STR_CC), 0.0, -4.0, 310.0} }; diff --git a/assets/obseg/gun/gunWeaponStats.inc.c b/assets/obseg/gun/gunWeaponStats.inc.c index 3f000552..a421c5b4 100644 --- a/assets/obseg/gun/gunWeaponStats.inc.c +++ b/assets/obseg/gun/gunWeaponStats.inc.c @@ -3,8 +3,14 @@ #define SCALEVAL1 0.80000001 #define SCALEVAL_KNIFE 0.80000001 #define SCALEVAL_SKORPION 0.80000001 +#define RATE_SKORPION 0xB #define SCALEVAL_AK47 0.80000001 +#define RATE_AK47 0x4 #define SCALEVAL_UZI 0.80000001 +#define RATE_UZI 0x4 +#define RATE_MP5k 0x4 +#define RATE_SPECTRE 0x4 +#define RATE_M16 0x5 #define SCALEVAL_P90 0.80000001 #define SCALEVAL_RUGER 0.80000001 #define SCALEVAL_LAUNCHER 0.80000001 @@ -14,8 +20,14 @@ #define SCALEVAL1 0.881200015545f #define SCALEVAL_KNIFE 0.82279998064f #define SCALEVAL_SKORPION 0.869499981403f +#define RATE_SKORPION 9 #define SCALEVAL_AK47 0.893000006676f +#define RATE_AK47 0x3 #define SCALEVAL_UZI 0.857800006866f +#define RATE_UZI 0x3 +#define RATE_MP5k 0x3 +#define RATE_SPECTRE 0x3 +#define RATE_M16 0x4 #define SCALEVAL_P90 0.846099972725 #define SCALEVAL_RUGER 0.834399998188 #define SCALEVAL_LAUNCHER 0.904799997807 @@ -25,8 +37,14 @@ #define SCALEVAL1 0.8812 #define SCALEVAL_KNIFE 0.8228 #define SCALEVAL_SKORPION 0.8695 +#define RATE_SKORPION 0xB #define SCALEVAL_AK47 0.893 +#define RATE_AK47 0x4 #define SCALEVAL_UZI 0.8578 +#define RATE_UZI 0x4 +#define RATE_MP5k 0x4 +#define RATE_SPECTRE 0x4 +#define RATE_M16 0x5 #define SCALEVAL_P90 0.8461 #define SCALEVAL_RUGER 0.8344 #define SCALEVAL_LAUNCHER 0.9048 @@ -35,7 +53,13 @@ #endif //D:80032494 WeaponStats default_weaponstats = { - 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 4.0, 0.0, 0x110 + 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 4.0, 0.0, + + WEAPONSTATBITFLAG_CLICKY | + WEAPONSTATBITFLAG_ONLY_1_HANDED + + + }; //D:80032504 #include @@ -45,233 +69,457 @@ WeaponStats default_weaponstats = { //D:800325E4 WeaponStats throwknife_stats = { - 1.0, 14.0, -24.799999, -34.0, 3.0, 3.0, 8.5, 0xA, 1, 0xFF, 0x06, 1, 0, 0, NULL, 3.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0,2.0, 4.0, 1.0, 0x560D83 + 1.0, 14.0, -24.799999, -34.0, 3.0, 3.0, 8.5, AMMO_KNIFE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 3.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0,2.0, 4.0, 1.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD | WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80032654 WeaponStats wppk_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 1, 7, 0xFF, 0x10, 1, 0, 0x6B, &cartridge_header, 1.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, 0x170FB9 + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_9MM, 7, 0xFF, 0x10, 1, 0, 0x6B, &cartridge_header, 1.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:800326C4 WeaponStats wppksil_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 1, 7, 0xFF, 0x10, 1, 0, 0x2E, &cartridge_header, 1.0, 3.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 1.5, 5.0, 29.999998, 0.0, 5.0, 1.0, 2.0, 4.0, 0.0, 0x170FB9 + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_9MM, 7, 0xFF, 0x10, 1, 0, 0x2E, &cartridge_header, 1.0, 3.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 1.5, 5.0, 29.999998, 0.0, 5.0, 1.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032734 WeaponStats tt33_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 1, 8, 0xFF, 0x10, 1, 0, 0x70, &cartridge_header, 1.0, 6.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 5.0, 10.0, 59.999996, 2.0, 16.0, 3.0, 2.0, 4.0, 0.0, 0x170FB9 -}; + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_9MM, 8, 0xFF, 0x10, 1, 0, 0x70, &cartridge_header, 1.0, 6.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 5.0, 10.0, 59.999996, 2.0, 16.0, 3.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | -#if defined(VERSION_EU) -WeaponStats skorpion_stats = { - 2.0, 11.5, -25.0, -27.5, 3.0, 5.0, 10.0, 1, 0x14, 0x03, 0x00, 1, 0x9, 0x6A, &cartridge_header, 0.60000002, 15.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 6, 0.0, 0.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x170B79 + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#else + //D:800327A4 WeaponStats skorpion_stats = { - 2.0, 11.5, -25.0, -27.5, 3.0, 5.0, 10.0, 1, 0x14, 0x03, 0x00, 1, 0xB, 0x6A, &cartridge_header, 0.60000002, 15.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 6, 0.0, 0.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x170B79 -}; -#endif + 2.0, 11.5, -25.0, -27.5, 3.0, 5.0, 10.0, AMMO_9MM, 0x14, 0x03, 0x00, 1, RATE_SKORPION, 0x6A, &cartridge_header, 0.60000002, 15.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 6, 0.0, 0.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | -#if defined(VERSION_EU) -WeaponStats ak47_stats = { - 2.0, 11.0, -19.0, -16.0, 3.0, 3.0, 8.5, 3, 0x1E, 0x03, 0x00, 1, 3, 0x6D, &cartrifle_header, 1.0, 10.0, 30.0, SCALEVAL_AK47, 0.91000003, 1.0, 0x40C0006,4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 3.0, 0x171A7C + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#else + //D:80032814 WeaponStats ak47_stats = { - 2.0, 11.0, -19.0, -16.0, 3.0, 3.0, 8.5, 3, 0x1E, 0x03, 0x00, 1, 4, 0x6D, &cartrifle_header, 1.0, 10.0, 30.0, SCALEVAL_AK47, 0.91000003, 1.0, 0x40C0006,4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 3.0, 0x171A7C + 2.0, 11.0, -19.0, -16.0, 3.0, 3.0, 8.5, AMMO_RIFLE, 0x1E, 0x03, 0x00, 1, RATE_AK47, 0x6D, &cartrifle_header, 1.0, 10.0, 30.0, SCALEVAL_AK47, 0.91000003, 1.0, 0x40C0006,4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 3.0, + WEAPONSTATBITFLAG_BURST_FIRE | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif -#if defined(VERSION_EU) -WeaponStats uzi_stats = { - 3.0, 11.0, -24.5, -37.0, 3.0, 8.0, 15.0, 1, 0x20, 0x02, 0x00, 1, 3, 0x6E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_UZI, 0.88, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171B79 -}; -#else //D:80032884 WeaponStats uzi_stats = { - 3.0, 11.0, -24.5, -37.0, 3.0, 8.0, 15.0, 1, 0x20, 0x02, 0x00, 1, 4, 0x6E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_UZI, 0.88, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171B79 + 3.0, 11.0, -24.5, -37.0, 3.0, 8.0, 15.0, AMMO_9MM, 0x20, 0x02, 0x00, 1, RATE_UZI, 0x6E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_UZI, 0.88, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif -#if defined(VERSION_EU) -WeaponStats mp5k_stats = { - 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, 1, 0x1E, 0x03, 0x00, 1, 3, 0x75, &cartridge_header, 1.0, 7.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171A79 -}; -#else //D:800328F4 WeaponStats mp5k_stats = { - 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, 1, 0x1E, 0x03, 0x00, 1, 4, 0x75, &cartridge_header, 1.0, 7.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171A79 + 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, AMMO_9MM, 0x1E, 0x03, 0x00, 1, RATE_MP5k, 0x75, &cartridge_header, 1.0, 7.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 4.0, 3.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif -#if defined(VERSION_EU) -WeaponStats mp5ksil_stats = { - 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, 1, 0x1E, 0x03, 0x00, 1, 3, 0x2E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 3.5, 2.0, 0.0, 0.0, 7.0, 1.2, 2.0, 4.0, 0.0, 0x171A79 -}; -#else //D:80032964 WeaponStats mp5ksil_stats = { - 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, 1, 0x1E, 0x03, 0x00, 1, 4, 0x2E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 3.5, 2.0, 0.0, 0.0, 7.0, 1.2, 2.0, 4.0, 0.0, 0x171A79 + 2.0, 11.0, -26.4, -35.0, 3.0, 8.0, 15.0, AMMO_9MM, 0x1E, 0x03, 0x00, 1, RATE_MP5k, 0x2E, &cartridge_header, 1.0, 9.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6120006, 3.5, 2.0, 0.0, 0.0, 7.0, 1.2, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif -#if defined(VERSION_EU) -WeaponStats spectre_stats = { - 2.0, 11.0, -21.9, -35.0, 3.0, 8.0, 15.0, 1, 0x32, 0x03, 0x00, 1, 3, 0x6D, &cartridge_header, 1.4, 12.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x40C0006, 4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171A79 -}; -#else //D:800329D4 WeaponStats spectre_stats = { - 2.0, 11.0, -21.9, -35.0, 3.0, 8.0, 15.0, 1, 0x32, 0x03, 0x00, 1, 4, 0x6D, &cartridge_header, 1.4, 12.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x40C0006, 4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x171A79 + 2.0, 11.0, -21.9, -35.0, 3.0, 8.0, 15.0, AMMO_9MM, 0x32, 0x03, 0x00, 1, RATE_SPECTRE, 0x6D, &cartridge_header, 1.4, 12.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x40C0006, 4.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif -#if defined(VERSION_EU) -WeaponStats m16_stats = { - 6.0, 11.0, -19.200001, -21.5, 3.0, 3.0, 8.5, 3, 0x1E, 0x02, 0x00, 2, 4, 0x71, &cartblue_header, 1.4, 6.0, 20.0, SCALEVAL_AK47, 0.91000003, 0.5, 0x6120208, 5.0, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 4.0, 0x171A7C -}; -#else //D:80032A44 WeaponStats m16_stats = { - 6.0, 11.0, -19.200001, -21.5, 3.0, 3.0, 8.5, 3, 0x1E, 0x02, 0x00, 2, 5, 0x71, &cartblue_header, 1.4, 6.0, 20.0, SCALEVAL_AK47, 0.91000003, 0.5, 0x6120208, 5.0, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 4.0, 0x171A7C + 6.0, 11.0, -19.200001, -21.5, 3.0, 3.0, 8.5, AMMO_RIFLE, 0x1E, 0x02, 0x00, 2, RATE_M16, 0x71, &cartblue_header, 1.4, 6.0, 20.0, SCALEVAL_AK47, 0.91000003, 0.5, 0x6120208, 5.0, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 4.0, + WEAPONSTATBITFLAG_BURST_FIRE | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; -#endif //D:80032AB4 WeaponStats fnp90_stats = { - 4.0, 12.5, -25.299999, -32.5, 3.0, 8.0, 15.0, 1, 0x50, 0x02, 0x00, 3, 2, 0xFD, &cartridge_header, 1.8, 6.0, 0.0, SCALEVAL_P90, 0.87, 1.0, 0x4080003, 3.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 4.0, 0x171A78 + 4.0, 12.5, -25.299999, -32.5, 3.0, 8.0, 15.0, AMMO_9MM, 0x50, 0x02, 0x00, 3, 2, 0xFD, &cartridge_header, 1.8, 6.0, 0.0, SCALEVAL_P90, 0.87, 1.0, 0x4080003, 3.5, 2.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 4.0, + WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032B24 WeaponStats shotgun_stats = { - 4.0, 11.0, -20.6, -19.5, 3.0, 3.0, 8.5, 4, 5, 0xFF, 0x0A, 1, 0, 0x79, &cartshell_header, 0.40000001, 20.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0x812080C, 9.0, 10.0, 0.0, 2.0, 25.0, 4.0, 2.0, 4.0, 5.0, 0x170AF9 + 4.0, 11.0, -20.6, -19.5, 3.0, 3.0, 8.5, AMMO_SHOTGUN, 5, 0xFF, 0x0A, 1, 0, 0x79, &cartshell_header, 0.40000001, 20.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0x812080C, 9.0, 10.0, 0.0, 2.0, 25.0, 4.0, 2.0, 4.0, 5.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032B94 WeaponStats autoshot_stats = { - 4.0, 12.0, -24.1, -19.0, 3.0, 3.0, 8.5, 4, 5, 0xFF, 0x0A, 1, 0, 0x74, NULL, 0.60000002, 16.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0x812080C, 4.5, 3.0, 0.0, 2.0, 20.0, 3.0, 2.0, 4.0, 5.0, 0x170AF9 + 4.0, 12.0, -24.1, -19.0, 3.0, 3.0, 8.5, AMMO_SHOTGUN, 5, 0xFF, 0x0A, 1, 0, 0x74, NULL, 0.60000002, 16.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0x812080C, 4.5, 3.0, 0.0, 2.0, 20.0, 3.0, 2.0, 4.0, 5.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032C04 WeaponStats sniperrifle_stats = { - 6.0, 11.0, -20.700001, -31.5, 3.0, 3.0, 8.5, 3, 8, 0xFF, 0x10, 1, 0, 0x2E, &cartblue_header, 1.0, 0.0, 15.0, SCALEVAL_AK47, 0.91000003, 0.25, 0, 0.0, 0.0, 0.0, 0.0, 7.0, 1.2, 2.0, 4.0, 0.0, 0x178A70 + 6.0, 11.0, -20.700001, -31.5, 3.0, 3.0, 8.5, AMMO_RIFLE, 8, 0xFF, 0x10, 1, 0, 0x2E, &cartblue_header, 1.0, 0.0, 15.0, SCALEVAL_AK47, 0.91000003, 0.25, 0, 0.0, 0.0, 0.0, 0.0, 7.0, 1.2, 2.0, 4.0, 0.0, + + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_DISABLE_CROUCH | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032C74 WeaponStats ruger_stats = { - 2.0, 12.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 0xC, 6, 0xFF, 0x14, 0xA, 0, 0x6F, NULL, 2.0, 0.0, 0.0, SCALEVAL_RUGER, 0.86000001, 1.0, 0x81000FF, 12.0, 35.0, 0.0, 2.0, 20.0, 3.0, 2.0, 4.0, 6.0, 0x170FB9 + 2.0, 12.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_MAGNUM, 6, 0xFF, 0x14, 0xA, 0, 0x6F, NULL, 2.0, 0.0, 0.0, SCALEVAL_RUGER, 0.86000001, 1.0, 0x81000FF, 12.0, 35.0, 0.0, 2.0, 20.0, 3.0, 2.0, 4.0, 6.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032CE4 WeaponStats goldengun_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 0xD, 1, 0xFF, 0x00, 1, 0, 0x75, NULL, 100.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x40800FF, 5.0, 10.0, 0.0, 1.0, 9.0, 1.5, 2.0, 4.0, 0.0, 0x170F99 + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_GGUN, 1, 0xFF, 0x00, 1, 0, 0x75, NULL, 100.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x40800FF, 5.0, 10.0, 0.0, 1.0, 9.0, 1.5, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032D54 WeaponStats silverwppk_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 1, 7, 0xFF, 0x10, 0xA, 0, 0x6B, &cartridge_header, 2.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, 0x170FB9 + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_9MM, 7, 0xFF, 0x10, 0xA, 0, 0x6B, &cartridge_header, 2.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300, 3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032DC4 WeaponStats goldwppk_stats = { - 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, 1, 7, 0xFF, 0x10, 1, 0, 0x6B, &cartridge_header, 100.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300,3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, 0x170FB9 + 1.0, 11.0, -20.799999, -33.5, 3.0, 3.0, 8.5, AMMO_9MM, 7, 0xFF, 0x10, 1, 0, 0x6B, &cartridge_header, 100.0, 1.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0x4080300,3.0, 10.0, 29.999998, 1.0, 12.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032E34 WeaponStats laser_stats = { - 1.0, 11.0, -19.5, -28.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x06, 2, 0, 0xE4, NULL, 2.0, 0.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6000606, 0.0, 0.0, 0.0, 2.0, 16.0, 2.0, 2.0, 4.0, 2.0, 0x170B99 + 1.0, 11.0, -19.5, -28.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0x06, 2, 0, 0xE4, NULL, 2.0, 0.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0x6000606, 0.0, 0.0, 0.0, 2.0, 16.0, 2.0, 2.0, 4.0, 2.0, + WEAPONSTATBITFLAG_00000001 | WEAPONSTATBITFLAG_HAS_AUTO_AIM | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032EA4 WeaponStats watchlaser_stats = { - 1.0, -2.0, -21.5, -19.0, 3.0, 3.0, 8.5, 0x18, 0x3E8, 0xFF, 0x00, 1, 0, 0, NULL, 2.0, 0.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0xFF, 0.0, 0.0, 0.0, 1.0, 4.0, 0.2, 1.0, 4.0, 0.0, 0x600F91 + 1.0, -2.0, -21.5, -19.0, 3.0, 3.0, 8.5, AMMO_WATCH_LASER, 0x3E8, 0xFF, 0x00, 1, 0, 0, NULL, 2.0, 0.0, 0.0, SCALEVAL_SKORPION, 0.88999999, 1.0, 0xFF, 0.0, 0.0, 0.0, 1.0, 4.0, 0.2, 1.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + + WEAPONSTATBITFLAG_AMMO_CLIP_LIMIT | WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80032F14 WeaponStats grenadelaunch_stats = { - 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, 0xB, 6, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0x120AF1 + 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, AMMO_GRENADEROUND, 6, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032F84 WeaponStats rocketlaunch_stats = { - 1.0, 10.5, -22.200001, -14.5, 3.0, 3.0, 8.5, 6, 1, 0xFF, 0x14, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 0.5, 0xFF, 0.0, 0.0, 0.0, 2.0, 25.0, 10.0,2.0, 4.0, 0.0, 0x120FF1 + 1.0, 10.5, -22.200001, -14.5, 3.0, 3.0, 8.5, AMMO_ROCKETS, 1, 0xFF, 0x14, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 0.5, 0xFF, 0.0, 0.0, 0.0, 2.0, 25.0, 10.0,2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_CAN_DUAL_WIELD }; //D:80032FF4 WeaponStats grenade_stats = { - 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, 5, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0, 0.0, 0x422982 + 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, AMMO_GRENADE, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033064 WeaponStats timedmine_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 9, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, 0x422D82 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_TIMEDMINE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:800330D4 WeaponStats proximitymine_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 8, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, 0x422D82 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_PROXMINE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033144 WeaponStats remotemine_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 7, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, 0x422D82 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_REMOTEMINE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 4.0,0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:800331B4 WeaponStats trigger_stats = { - 1.0, -2.0, -21.5, -19.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0xFF, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0,0.0, 0x890 + 1.0, -2.0, -21.5, -19.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0xFF, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0,0.0, + + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_SHOW_FIRST_PERSON + + + }; //D:80033224 WeaponStats taser_stats = { - 1.0, 16.0, -16.700001, -22.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x00, 1, 0, 0x64, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 2.0, 10.0, 2.0, 2.0, 4.0, 0.0, 0x620F70 + 1.0, 16.0, -16.700001, -22.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0x00, 1, 0, 0x64, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 2.0, 10.0, 2.0, 2.0, 4.0, 0.0, + + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_AMMO_CLIP_LIMIT | WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033294 WeaponStats tank_stats = { - 1.0, 8.0, -19.200001, -11.5, 3.0, 3.0, 8.5, 0x1C, 1, 0xFF, 0x14, 1, 0, 0xB, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x780078FF, 0.0, 0.0, 0.0, 2.0, 25.0, 10.0, 2.0, 4.0, 0.0, 0x76781 + 1.0, 8.0, -19.200001, -11.5, 3.0, 3.0, 8.5, AMMO_TANK, 1, 0xFF, 0x14, 1, 0, 0xB, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x780078FF, 0.0, 0.0, 0.0, 2.0, 25.0, 10.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_MIRROR_DUAL | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_MENU | + WEAPONSTATBITFLAG_PLAYER_STAT_HIT | WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO + }; //D:80033304 WeaponStats bombcase_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 0x10, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0,4.0, 0.0, 0x402D82 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_BOMBCASE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0,4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033374 WeaponStats plastique_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 0x17, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0,4.0, 0.0, 0x422D82 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_PLASTIQUE, 1, 0xFF, 0x06, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0,4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_USE_HOLD_TIME | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:800333E4 WeaponStats flarepistol_stats = { - 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, 0x11, 1, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0xAF1 + 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, AMMO_FLARE, 1, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON + + + }; //D:80033454 WeaponStats pitongun_stats = { - 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, 0x12, 1, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, 0xAF1 + 1.0, 9.5, -18.0, -18.5, 3.0, 3.0, 8.5, AMMO_PITON, 1, 0xFF, 0x14, 1, 0, 0xC, NULL, 1.0, 0.0, 0.0, SCALEVAL_LAUNCHER, 0.92000002, 1.0, 0x81000FF, 10.5, 15.0, 0.0, 2.0, 20.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000020 | WEAPONSTATBITFLAG_00000040 | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_HOLD_AS_GUN | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON + + + }; //D:800334C4 WeaponStats bug_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 0x14, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x402982 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_BUG, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033534 WeaponStats microcamera_stats = { - 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, 0x15, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x402982 + 1.0, 11.0, -21.0, -37.0, 3.0, 3.0, 8.5, AMMO_MICRO_CAMERA, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:800335A4 WeaponStats watchmagnetattract_stats = { - 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, 0x19, 0xA, 0xFF, 0xFF, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 4.0, 0.0, 0x602980 + 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, AMMO_WATCH_MAGNET, 0xA, 0xFF, 0xFF, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 4.0, 0.0, + + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + + WEAPONSTATBITFLAG_AMMO_CLIP_LIMIT | WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033614 WeaponStats goldeneyekey_stats = { - 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, 0x16, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x482982 + 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, AMMO_GEKEY, 1, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_HIDE_AMMO_DISPLAY | + WEAPONSTATBITFLAG_NO_CLIP_RELOADS }; //D:80033684 WeaponStats camera_stats = { - 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0xFF, 1, 0, 0xF4, NULL, 1.0, 0.0, 20.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0xA990 + 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0xFF, 1, 0, 0xF4, NULL, 1.0, 0.0, 20.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, + + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | WEAPONSTATBITFLAG_DISABLE_CROUCH + + }; //D:800336F4 WeaponStats Csuit_lf_handz_stats = { - 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x110 + 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_CLICKY | + WEAPONSTATBITFLAG_ONLY_1_HANDED + + + + }; //D:80033764 WeaponStats joypad_stats = { - 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 0, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x110 + 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, AMMO_NONE, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_CLICKY | + WEAPONSTATBITFLAG_ONLY_1_HANDED + + + + }; +//ITEM_NULL86? //D:800337D4 WeaponStats null1_stats = { - 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 6, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x110 + 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, AMMO_ROCKETS, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_CLICKY | + WEAPONSTATBITFLAG_ONLY_1_HANDED + + + + }; +//ITEM_NULL87? //D:80033844 WeaponStats null2_stats = { - 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, 0xB, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x110 + 1.0, 0.0, 0.0, 0.0, 3.0, 3.0, 8.5, AMMO_GRENADEROUND, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL1, 0.89999998, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_CLICKY | + WEAPONSTATBITFLAG_ONLY_1_HANDED + + + + }; //D:800338B4 WeaponStats token_stats = { - 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, 0x1D, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, 0x82182 + 1.0, 11.0, -41.799999, -33.0, 3.0, 3.0, 8.5, AMMO_TOKEN, 0, 0xFF, 0x00, 1, 0, 0, NULL, 1.0, 0.0, 0.0, SCALEVAL_KNIFE, 0.85000002, 1.0, 0xFF, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 4.0, 0.0, + WEAPONSTATBITFLAG_SINGLE_USE_RELOAD | + WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | + WEAPONSTATBITFLAG_HIDE_FIRST_PERSON_HAND | + WEAPONSTATBITFLAG_HIDE_AMMO_DISPLAY + }; diff --git a/assets/obseg/gun/knife/gunFileRecord.inc.c b/assets/obseg/gun/knife/gunFileRecord.inc.c index 7c00912b..dad5a3b8 100644 --- a/assets/obseg/gun/knife/gunFileRecord.inc.c +++ b/assets/obseg/gun/knife/gunFileRecord.inc.c @@ -1,2 +1,2 @@ /*NAME, NOMODEL, STATS, UPPERTEXTID, LOWERTEXTID, POSX, POSY, POSZ, XROT, YROT, WOCTEXT, EQUIPTEXT, EQUIPX, EQUIPY, EQUIPZ*/ -GUNFILERECORD(knife, 0, GUNSTATS(knife), TEXT(LGUN, 0x83), TEXT(LGUN, 0x46), 200.0, 39.0, 1327.0, 0.0, 0.0, TEXT(LGUN, 0x40), TEXT(LGUN, 0xA8), 38.0, 118.0, 800.0) +GUNFILERECORD(knife, 0, GUNSTATS(knife), TEXT(LGUN, GUN_STR_83), TEXT(LGUN, GUN_STR_46), 200.0, 39.0, 1327.0, 0.0, 0.0, TEXT(LGUN, GUN_STR_40), TEXT(LGUN, GUN_STR_A8), 38.0, 118.0, 800.0) diff --git a/assets/obseg/gun/knife/gunWeaponStat.inc.c b/assets/obseg/gun/knife/gunWeaponStat.inc.c index 200a2170..b375fa08 100644 --- a/assets/obseg/gun/knife/gunWeaponStat.inc.c +++ b/assets/obseg/gun/knife/gunWeaponStat.inc.c @@ -2,7 +2,7 @@ WeaponStats knife_stats = { 1.0, //MuzzleFlashExtension 14.0, -24.799999, -34.0, //PosXYZ 3.0, 3.0, 8.5, //PlayXYZ - 0, 0, //ammotype magsize + AMMO_NONE, 0, //ammotype magsize 0xFF, 0x06, //AutomaticFiringRate SingleFiringRate 1, //ObjectsShootThrough 0, 0, //SoundTriggerRate Sound @@ -23,5 +23,8 @@ WeaponStats knife_stats = { 2.0, //field_60 4.0, //field_64 0.0, //ForceOfImpact - 0x160D91 //BitFlags + WEAPONSTATBITFLAG_00000001 | + WEAPONSTATBITFLAG_CLICKY | WEAPONSTATBITFLAG_00000080 | + WEAPONSTATBITFLAG_ONLY_1_HANDED | WEAPONSTATBITFLAG_MIRROR_DUAL | WEAPONSTATBITFLAG_SHOW_FIRST_PERSON | + WEAPONSTATBITFLAG_USE_HOLD_TIME | WEAPONSTATBITFLAG_HAS_AMMO | WEAPONSTATBITFLAG_CAN_DUAL_WIELD //BitFlags }; diff --git a/assets/obseg/ob_seg.s b/assets/obseg/ob_seg.s index e717be85..161c963f 100644 --- a/assets/obseg/ob_seg.s +++ b/assets/obseg/ob_seg.s @@ -93,12 +93,12 @@ bg_file_seg bg_imp_all_p_seg, bg_imp_all_p bg_file_seg bg_ash_all_p_seg, bg_ash_all_p bg_file_seg bg_sho_all_p_seg, bg_sho_all_p bg_file_seg bg_ame_all_p_seg, bg_ame_all_p -bg_file_seg bg_oat_all_p_seg, bg_oat_all_p bg_file_seg bg_rit_all_p_seg, bg_rit_all_p -bg_file_seg bg_len_all_p_seg, bg_len_all_p +bg_file_seg bg_oat_all_p_seg, bg_oat_all_p +bg_file_seg bg_lip_all_p_seg, bg_lip_all_p bg_file_seg bg_lee_all_p_seg, bg_lee_all_p bg_file_seg bg_ear_all_p_seg, bg_ear_all_p -bg_file_seg bg_lip_all_p_seg, bg_lip_all_p +bg_file_seg bg_len_all_p_seg, bg_len_all_p bg_file_seg bg_pam_all_p_seg, bg_pam_all_p bg_file_seg bg_wax_all_p_seg, bg_wax_all_p diff --git a/assets/obseg/prop/alarm1/Model.c b/assets/obseg/prop/alarm1/Model.c index f4002010..e9391d91 100644 --- a/assets/obseg/prop/alarm1/Model.c +++ b/assets/obseg/prop/alarm1/Model.c @@ -1,132 +1,85 @@ #include -#define VERTEXGROUPCOUNT0 = 12 -#define COLLISIONVERTEXCOUNT0 = 12 - -ModelFileTextures proptextures[2] = +#define TEXTURECOUNT 2 +#define VERTEXGROUPCOUNT0 12 +#define COLLISIONVERTEXCOUNT0 12 +//base address is 0x05000000 +ModelFileTextures proptextures[TEXTURECOUNT] = { - {0x1D, 32, 32, 0x06, 0x0, 0x02, 0x0, 0x0}, - {0x1F, 32, 32, 0x06, 0x0, 0x02, 0x0, 0x0} + {_image29_ID, 32, 32, 0x06, 0x0, 0x02, 0x0, 0x0}, + {_image31_ID, 32, 32, 0x06, 0x0, 0x02, 0x0, 0x0} }; + // {opcode, data, parent, next, prev, child} +ModelNode ModelNode_0x018 = { MODELNODE_OPCODE_GROUP, GroupRecord_0x060, 0x0, 0x0, 0x0, ModelNode_0x030}; +ModelNode ModelNode_0x030 = { MODELNODE_OPCODE_BBOX, BoundingBoxRecord_0x07c, ModelNode_0x018, 0x0, 0x0, ModelNode_0x048}; +ModelNode ModelNode_0x048 = { MODELNODE_OPCODE_DLCOLLISION, DLCollisionRecord_0x230, ModelNode_0x030, 0x0, 0x0, 0x0}; -ModelNode ModelNode_05000018 = {0x2, ModelNode_GroupRecord_05000060, 0x0, 0x0, 0x0, ModelNode_05000030}; -ModelNode ModelNode_05000030 = {0xA, ModelNode_BoundingBoxRecord_0500007c, ModelNode_05000018, 0x0, 0x0, ModelNode_05000048}; -ModelNode ModelNode_05000048 = {0x18, ModelNode_DisplayList_CollisionRecord_05000230, ModelNode_05000030, 0x0, 0x0, 0x0}; - -ModelRoData_GroupRecord ModelNode_GroupRecord_05000060 = +ModelRoData_GroupRecord GroupRecord_0x060 = { - {962.5, 2015.0167, -36.117146}, - 0x0, - 0x0, - 0xFFFF, - 0xFFFF, - 0x0, - 304.6402 + {962.5, 2015.0167, -36.117146}, //origin {x,y,z} + 0x0, //JointID + 0x0, //MatrixID0 + 0xFFFF, //MatrixID1 + 0xFFFF, //MatrixID2 + 0x0, //ChildGroup + 304.6402 //BoundingVolumeRadius }; -ModelRoData_BoundingBoxRecord ModelNode_BoundingBoxRecord_0500007c = +ModelRoData_BoundingBoxRecord BoundingBoxRecord_0x07c = { 0x1, {-146.0, 146.0, -265.0, 265.0, -36.0, 36.0} }; -Vertex Vertex_ARRAY_05000098[VERTEXGROUPCOUNT0] = -{ - { - {-87, -207, 36}, 0x0, 0xCC, 0x9B, {0xFE, 0xFE, 0xFE, 0xFF} - }, - { - {88, -207, 36}, 0x0, 0x346, 0x9B, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {88, 55, 36}, 0x0, 0x346, 0x37E, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {-87, 55, 36}, 0x0, 0xCC, 0x37E, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {146, -265, -36}, 0x0, 0x419, 0x8, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {146, 143, -36}, 0x0, 0x419, 0x412, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {-146, -265, -36}, 0x0, -7, 0x8, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {-146, 143, -36}, 0x0, -7, 0x412, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {146, 113, 2}, 0x0, 0x800, 0x0, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {146, 265, 2}, 0x0, 0x800, 0x400, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {-146, 265, 2}, 0x0, 0x0, 0x400, {0xFE, 0xFE, 0xFE, 0xFF) - }, - { - {-146, 113, 2}, 0x0, 0x0, 0x0, {0xFE, 0xFE, 0xFE, 0xFF) - }, +Vertex Vertex_ARRAY_0x098[VERTEXGROUPCOUNT0] = +{ //{ { x, y, z}, index, s, t, { r, g, b, a} } + { { -87, -207, 36}, 0x0, 0xCC, 0x9B, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 88, -207, 36}, 0x0, 0x346, 0x9B, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 88, 55, 36}, 0x0, 0x346, 0x37E, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { -87, 55, 36}, 0x0, 0xCC, 0x37E, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 146, -265, -36}, 0x0, 0x419, 0x8, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 146, 143, -36}, 0x0, 0x419, 0x412, {0xFE, 0xFE, 0xFE, 0xFF} }, + { {-146, -265, -36}, 0x0, -7, 0x8, {0xFE, 0xFE, 0xFE, 0xFF} }, + { {-146, 143, -36}, 0x0, -7, 0x412, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 146, 113, 2}, 0x0, 0x800, 0x0, {0xFE, 0xFE, 0xFE, 0xFF} }, + { { 146, 265, 2}, 0x0, 0x800, 0x400, {0xFE, 0xFE, 0xFE, 0xFF} }, + { {-146, 265, 2}, 0x0, 0x0, 0x400, {0xFE, 0xFE, 0xFE, 0xFF} }, + { {-146, 113, 2}, 0x0, 0x0, 0x0, {0xFE, 0xFE, 0xFE, 0xFF} }, }; -Vertex Collision_Vertex_ARRAY_05000158[COLLISIONVERTEXCOUNT0] = -{ - { - {-87, -207, 36}, 0x0, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {88, -207, 36}, 0x1, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {88, 85, 36}, 0x2, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {-87, 85, 36}, 0x3, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {146, -265, -36}, 0x4, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {146, 143, -36}, 0x5, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {-146, -265, -36}, 0x6, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {-146, 143, -36}, 0x7, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {146, 113, 2}, 0x8, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {146, 265, 2}, 0x9, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {-146, 265, 2}, 0xA, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, - { - {-146, 113, 2}, 0xB, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0) - }, +Vertex Collision_Vertex_ARRAY_0x158[COLLISIONVERTEXCOUNT0] = +{ //{ { x, y, z}, index, s, t, { r, g, b, a} } + { { -87, -207, 36}, 0x0, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 88, -207, 36}, 0x1, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 88, 85, 36}, 0x2, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { -87, 85, 36}, 0x3, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 146, -265, -36}, 0x4, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 146, 143, -36}, 0x5, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { {-146, -265, -36}, 0x6, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { {-146, 143, -36}, 0x7, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 146, 113, 2}, 0x8, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { { 146, 265, 2}, 0x9, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { {-146, 265, 2}, 0xA, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, + { {-146, 113, 2}, 0xB, 0x0, 0x0, {0xFF, 0xFF, 0x0, 0x0} }, }; -s16 POINT_USAGE_ARRAY_05000218[VERTEXGROUPCOUNT0] = +s16 POINT_USAGE_ARRAY_0x218[VERTEXGROUPCOUNT0] = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, }; -ModelRoData_DisplayList_CollisionRecord ModelNode_DisplayList_CollisionRecord_05000230 = +ModelRoData_DisplayList_CollisionRecord DLCollisionRecord_0x230 = { - GFX_ARRAY_PRIMARY_05000250, - GFX_ARRAY_SECONDARY_050002B0, - Vertex_ARRAY_05000098, VERTEXGROUPCOUNT0, - COLLISIONVERTEXCOUNT0, Collision_Vertex_ARRAY_05000158, - POINT_USAGE_ARRAY_05000218, + GFX_ARRAY_PRIMARY_0x250, + GFX_ARRAY_SECONDARY_0x2B0, + Vertex_ARRAY_0x098, VERTEXGROUPCOUNT0, + COLLISIONVERTEXCOUNT0, Collision_Vertex_ARRAY_0x158, + POINT_USAGE_ARRAY_0x218, 0x4, 0x0, 0x0, 0x0 }; -Gfx GFX_ARRAY_PRIMARY_05000250 = +Gfx GFX_ARRAY_PRIMARY_0x250 = { gsDPSetTextureLOD(G_TL_LOD), gsSPTexture(0xFFFF, 0xFFFF, 6, 0, true), @@ -138,7 +91,7 @@ Gfx GFX_ARRAY_PRIMARY_05000250 = gsSPEndDisplayList(), }; -Gfx GFX_ARRAY_SECONDARY_050002B0 = +Gfx GFX_ARRAY_SECONDARY_0x2B0 = { gsDPLoadSync(), gsDPSetTextureLOD(G_TL_LOD), diff --git a/assets/obseg/prop/cctv/Model.c b/assets/obseg/prop/cctv/Model.c new file mode 100644 index 00000000..ec9ff77b --- /dev/null +++ b/assets/obseg/prop/cctv/Model.c @@ -0,0 +1,312 @@ +#include +#define TEXTURECOUNT 6 + +#define VERTEXGROUPCOUNT0 16 +#define COLLISIONVERTEXCOUNT0 13 + +#define VERTEXGROUPCOUNT1 4 +#define COLLISIONVERTEXCOUNT1 4 + +#define VERTEXGROUPCOUNT2 24 +#define COLLISIONVERTEXCOUNT2 12 + +ModelNode* ModelNode1 = ModelNodeGroup_1; +ModelNode* ModelNode2 = ModelNodeDL_Lens; +ModelNode* ModelNode3 = ModelNodeBB_Lens; +ModelNode* ModelNode4 = ModelNodeSwitch_0; + +ModelFileTextures proptextures[TEXTURECOUNT] = +{ + {_image247_ID, 0x20, 0x40, 0x07, 0x00, 0x01, 0x00, 0x0000}, + {_image265_ID, 0x40, 0x20, 0x07, 0x00, 0x01, 0x00, 0x0000}, + {_image511_ID, 0x80, 0x20, 0x07, 0x00, 0x00, 0x00, 0x0000}, + {_image856_ID, 0x40, 0x40, 0x07, 0x00, 0x00, 0x00, 0x0000}, + {IMAGE_GLASS3, 0x36, 0x36, 0x03, 0x00, 0x01, 0x02, 0x0200}, + {_image1514_ID, 0x01, 0x01, 0x01, 0x00, 0x02, 0x00, 0x0000}, +}; + // { opcode, data, parent, next, prev, child} +ModelNode ModelNodeGroup_0 = { MODELNODE_OPCODE_GROUP, GroupRecord_0x118, 0x0, 0x0, 0x0, ModelNodeBB_0}; +ModelNode ModelNodeBB_0 = { MODELNODE_OPCODE_BBOX, BBoxRecord_0x134, ModelNodeGroup_0, 0x0, 0x0, ModelNodeDL_Mount}; +ModelNode ModelNodeDL_Mount = { MODELNODE_OPCODE_DLCOLLISION, DL_Mount, ModelNodeBB_0, ModelNodeGroup_1, 0x0, 0x0}; +ModelNode ModelNodeGroup_1 = { MODELNODE_OPCODE_GROUP, GroupRecord_0x360, ModelNodeBB_0, 0x0, ModelNodeDL_Mount, ModelNodeSwitch_0}; +ModelNode ModelNodeSwitch_0 = { MODELNODE_OPCODE_SWITCH, Switch_0x37c, ModelNodeGroup_1, ModelNodeDL_Housing, 0x0, ModelNodeBB_Lens}; +ModelNode ModelNodeBB_Lens = { MODELNODE_OPCODE_BBOX, BBox_Lens, ModelNodeSwitch_0, 0x0, 0x0, ModelNodeDL_Lens}; +ModelNode ModelNodeDL_Lens = { MODELNODE_OPCODE_DLCOLLISION, DL_Lens, ModelNodeBB_Lens, 0x0, 0x0, 0x0}; +ModelNode ModelNodeDL_Housing = { MODELNODE_OPCODE_DLCOLLISION, DL_Housing, ModelNodeGroup_1, 0x0, ModelNodeSwitch_0, 0x0}; + +ModelRoData_GroupRecord GroupRecord_0x118 = +{ + {0.005449, -773.8468, -200.64182}, + 0x0, + 0x0, + 0xFFFF, + 0xFFFF, + ModelNodeGroup_1, + 291.0673 +}; + +ModelRoData_BoundingBoxRecord BBoxRecord_0x134 = +{ + 0x1, + {-482.0, 482.0, -119.0, 552.0, -247.0, 514.0} +}; + +Vertex Vertex_ARRAY_0x150[VERTEXGROUPCOUNT0] = +{ + {{ 98, -119, -247}, 0x0000, 0x0002, 0x01f2, {0xc6, 0xc6, 0xc6, 0xff} }, + {{ 0, 16, 84}, 0x0000, 0x03f6, 0x038b, {0x72, 0x72, 0x72, 0xff} }, + {{ -98, -119, -247}, 0x0000, 0x0006, 0x07e3, {0x72, 0x72, 0x72, 0xff} }, + {{ 0, 16, 84}, 0x0000, 0x1000, 0x0000, {0xff, 0xff, 0xff, 0xff} }, + {{ -98, 16, -247}, 0x0000, 0x0000, 0x0000, {0xc3, 0xc3, 0xc3, 0xff} }, + {{ -98, -119, -247}, 0x0000, 0x0000, 0xf9c0, {0xc0, 0xc0, 0xc0, 0xff} }, + {{ 98, -119, -247}, 0x0000, 0x0000, 0x0640, {0xc6, 0xc6, 0xc6, 0xff} }, + {{ 98, 16, -247}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0xff, 0xff} }, + {{ 0, 16, 59}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0xff, 0xff} }, + {{ 0, 16, 10}, 0x0000, 0x0800, 0x0000, {0xfe, 0xfe, 0xfe, 0xff} }, + {{ 0, 77, 10}, 0x0000, 0x0800, 0x0a00, {0xff, 0xff, 0xff, 0xff} }, + {{ 0, 77, 59}, 0x0000, 0x0000, 0x0a00, {0xff, 0xff, 0xff, 0xff} }, + {{ -25, 16, 35}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0xff, 0xff} }, + {{ 24, 16, 35}, 0x0000, 0x0800, 0x0000, {0xff, 0xff, 0xff, 0xff} }, + {{ 24, 77, 35}, 0x0000, 0x0800, 0x0a00, {0xff, 0xff, 0xff, 0xff} }, + {{ -25, 77, 35}, 0x0000, 0x0000, 0x0a00, {0xff, 0xff, 0xff, 0xff} } +}; + +Vertex Collision_Vertex_ARRAY_0x250[COLLISIONVERTEXCOUNT0] = +{ + {{ 98, -119, -247}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 0, 16, 84}, 0x0001, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -98, -119, -247}, 0x0002, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -98, 16, -247}, 0x0004, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 98, 16, -247}, 0x0007, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 0, 16, 59}, 0x0008, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 0, 16, 10}, 0x0009, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 0, 77, 10}, 0x000a, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 0, 77, 59}, 0x000b, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -25, 16, 35}, 0x000c, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 24, 16, 35}, 0x000d, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 24, 77, 35}, 0x000e, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -25, 77, 35}, 0x000f, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} } +}; + +s16 POINT_USAGE_ARRAY_0x320[] = +{ + 0x6, 0x3, 0x5, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF +}; + +ModelRoData_DisplayList_CollisionRecord DL_Mount = +{ + GFX_ARRAY_PRIMARY_0x6d8, + GFX_ARRAY_SECONDARY_0x738, + Vertex_ARRAY_0x150, + VERTEXGROUPCOUNT0, + COLLISIONVERTEXCOUNT0, + Collision_Vertex_ARRAY, + POINT_USAGE_ARRAY_0x320, + 4, 0, 0, 0 +}; + + +ModelRoData_GroupRecord GroupRecord_0x360 = +{ + {0.0, 70.36643, 31.983679}, + 1, + 1, + 0xFFFF, + 0xFFFF, + NULL, + 481.60675 +}; + +ModelRoData_SwitchRecord Switch_0x37c = +{ + ModelNodeBB_Lens, + 0 +}; + +ModelRoData_BoundingBoxRecord BBox_Lens = +{ + 0x2, + {-123.0, 122.0, 6.0, 202.0, 199.0, 285.0} +}; + + Vertex Vertex_ARRAY_0x3a0[VERTEXGROUPCOUNT1] = +{ + {{ 122, 202, 285}, 0x0000, 0x0000, 0x0000, {0x47, 0x40, 0x53, 0xff} }, + {{ -123, 202, 285}, 0x0000, 0x0000, 0x0000, {0xb9, 0x40, 0x53, 0xff} }, + {{ -123, 6, 199}, 0x0000, 0x0000, 0x0000, {0xb9, 0xc0, 0x53, 0xff} }, + {{ 122, 6, 199}, 0x0000, 0x0000, 0x0000, {0x47, 0xc0, 0x53, 0xff} }, +}; + +Vertex Collision_Vertex_ARRAY_0x3e0[COLLISIONVERTEXCOUNT1] = +{ + {{ 122, 202, 285}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 202, 285}, 0x0001, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 6, 199}, 0x0002, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 6, 199}, 0x0003, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, +}; + +s16 POINT_USAGE_ARRAY_0x420[VERTEXGROUPCOUNT1] = +{ + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF +}; + +ModelRoData_DisplayList_CollisionRecord DL_Lens = +{ + GFX_ARRAY_PRIMARY_0x790, + GFX_ARRAY_SECONDARY_0x7a8, + Vertex_ARRAY_0x3a0, + VERTEXGROUPCOUNT1, + COLLISIONVERTEXCOUNT1, + Collision_Vertex_ARRAY, + POINT_USAGE_ARRAY_0x420, + 4, 0, 0, 0 +}; + +Vertex Vertex_ARRAY_0x448[VERTEXGROUPCOUNT2] = +{ + {{ 122, 6, -205}, 0x0000, 0x1000, 0x07fa, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, -205}, 0x0000, 0x1000, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 202, -205}, 0x0000, 0x081c, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ 122, 202, -205}, 0x0000, 0x081c, 0x07fa, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, 187}, 0x0000, 0xffa6, 0x0099, {0xe8, 0xe8, 0xe8, 0xff} }, + {{ 122, 6, 187}, 0x0000, 0x0895, 0x0081, {0xff, 0xff, 0xff, 0xff} }, + {{ 122, 202, 187}, 0x0000, 0x0895, 0x0780, {0xff, 0xff, 0xff, 0xff} }, + {{ -123, 202, 187}, 0x0000, 0xffa6, 0x0799, {0xf0, 0xf0, 0xf0, 0xff} }, + {{ 122, 6, 236}, 0x0000, 0x0000, 0x06c4, {0xff, 0xff, 0xff, 0xff} }, + {{ 122, 6, -205}, 0x0000, 0x0000, 0x0000, {0xe2, 0xe2, 0xe2, 0xff} }, + {{ 122, 202, -205}, 0x0000, 0x0400, 0x0000, {0xe6, 0xe6, 0xe6, 0xff} }, + {{ 122, 202, 419}, 0x0000, 0x0400, 0x0996, {0xff, 0xff, 0xff, 0xff} }, + {{ -123, 202, 419}, 0x0000, 0x0400, 0x0990, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 202, -205}, 0x0000, 0x0400, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, -205}, 0x0000, 0x0000, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, 236}, 0x0000, 0x0000, 0x06c0, {0x72, 0x72, 0x72, 0xff} }, + {{ 122, 6, -205}, 0x0000, 0x1000, 0x07fa, {0x72, 0x72, 0x72, 0xff} }, + {{ 122, 6, 236}, 0x0000, 0x0000, 0x07fa, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, 236}, 0x0000, 0x0000, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ -123, 6, -205}, 0x0000, 0x1000, 0x0000, {0x72, 0x72, 0x72, 0xff} }, + {{ 122, 202, 419}, 0x0000, 0x0000, 0x0000, {0x36, 0x36, 0x36, 0xff} }, + {{ -123, 202, 419}, 0x0000, 0x0000, 0x0000, {0x36, 0x36, 0x36, 0xff} }, + {{ -123, 202, -205}, 0x0000, 0x0000, 0x0000, {0x36, 0x36, 0x36, 0xff} }, + {{ 122, 202, -205}, 0x0000, 0x0000, 0x0000, {0x36, 0x36, 0x36, 0xff} } +}; +Vertex Collision_Vertex_ARRAY_0x5c8[COLLISIONVERTEXCOUNT2] = +{ + {{ 122, 6, -205}, 0x0000, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 6, -205}, 0x0001, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 202, -205}, 0x0002, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 202, -205}, 0x0003, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 6, 187}, 0x0004, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 6, 187}, 0x0005, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 202, 187}, 0x0006, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 202, 187}, 0x0007, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 6, 236}, 0x0008, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ 122, 202, 419}, 0x000b, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 202, 419}, 0x000c, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} }, + {{ -123, 6, 236}, 0x000f, 0x0000, 0x0000, {0xff, 0xff, 0x00, 0x00} } +}; + +s16 POINT_USAGE_ARRAY_0x688[VERTEXGROUPCOUNT2] = +{ + 0x9, 0xE, 0xD, 0xA, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0x11, 0x10, 0x17, 0x14, + 0x15, 0x16, 0x13, 0x12, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF +}; + +ModelRoData_DisplayList_CollisionRecord DL_Housing = +{ + GFX_ARRAY_PRIMARY_0x810, + NULL, + Vertex_ARRAY_0x448, + VERTEXGROUPCOUNT2, + COLLISIONVERTEXCOUNT2, + Collision_Vertex_ARRAY, + POINT_USAGE_ARRAY_0x688, + 4, 0, 0, 0 +}; + +Gfx GFX_ARRAY_PRIMARY_0x6d8[] = +{ + gsDPPipeSync(), + gsDPSetTextureLOD(G_TL_LOD), + gsSPTexture(0xFFFF, 0xFFFF, 6, G_TX_RENDERTILE, G_ON), + gsDPNoOpTag(0x000000F7), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPMatrix(0x03000000, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW), + gsSPVertex(0x04000000, 8, 0), + gsSP1Triangle(0, 1, 2, 0), + gsDPNoOpTag(0x000001FF), + 0xB1000035, 0x00007643, + gsSPEndDisplayList(), +}; + +Gfx GFX_ARRAY_SECONDARY_0x738[] = +{ + gsDPPipeSync(), + gsDPSetTextureLOD(G_TL_LOD), + gsSPTexture(0xFFFF, 0xFFFF, 6, G_TX_RENDERTILE, G_ON), + gsDPNoOpTag(0x00000109), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPClearGeometryMode(G_CULL_BOTH), + gsSPMatrix(0x03000000, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW), + gsSPVertex(0x04000080, 8, 0), + 0xB1007632, 0x64542010, + gsSPEndDisplayList(), +}; + +Gfx GFX_ARRAY_PRIMARY_0x790[] = +{ + gsDPPipeSync(), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPEndDisplayList(), +}; + +Gfx GFX_ARRAY_SECONDARY_0x7a8[] = +{ + gsDPPipeSync(), + gsDPSetTextureLOD(G_TL_LOD), + gsSPTexture(3456, 3456, 2, G_TX_RENDERTILE, G_ON), + gsDPNoOpTag(0x0000028E), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPSetGeometryMode(G_LIGHTING | G_TEXTURE_GEN), + gsSPClearGeometryMode(G_CULL_BOTH), + gsSPMatrix(0x03000040, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW), + gsSPVertex(0x04000000, 4, 0), + 0xB1000032, 0x00002010, + gsSPClearGeometryMode(G_LIGHTING | G_TEXTURE_GEN), + gsSPEndDisplayList(), +}; + + +Gfx GFX_ARRAY_PRIMARY_0x810[] = +{ + gsDPPipeSync(), + gsDPSetTextureLOD(G_TL_LOD), + gsSPTexture(0xFFFF, 0xFFFF, 6, G_TX_RENDERTILE, G_ON), + gsDPNoOpTag(0x000001FF), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPMatrix(0x03000040, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW), + gsSPVertex(0x04000000, 16, 0), + 0xB1000032, 0x00002010, + gsDPNoOpTag(0x00000358), + 0xB1000076, 0x00006454, + gsDPNoOpTag(0x000000F7), + gsSPClearGeometryMode(G_CULL_BOTH), + 0xB100FEBA, 0xECDCA898, + gsDPNoOpTag(0x000001FF), + gsSPVertex(0x04000100, 8, 0), + 0xB1000032, 0x00002010, + gsSPTexture(0xFFFF, 0xFFFF, 1, G_TX_RENDERTILE, G_ON), + gsDPNoOpTag(0x000005EA), + 0xB1000076, 0x00006454, + gsSPEndDisplayList(), +}; diff --git a/assets/obseg/prop/cctv/propFileRecord.inc.c b/assets/obseg/prop/cctv/propFileRecord.inc.c new file mode 100644 index 00000000..11a46de9 --- /dev/null +++ b/assets/obseg/prop/cctv/propFileRecord.inc.c @@ -0,0 +1 @@ + PROPFILERECORD(cctv, 0.1) diff --git a/assets/obseg/prop/propItemModelFileRecord.inc.c b/assets/obseg/prop/propItemModelFileRecord.inc.c index dca38f81..7af2d7c0 100644 --- a/assets/obseg/prop/propItemModelFileRecord.inc.c +++ b/assets/obseg/prop/propItemModelFileRecord.inc.c @@ -23,7 +23,7 @@ ItemModelFileRecord PitemZ_entries[] = { PROPFILERECORD(card_box4_lg, 0.1) PROPFILERECORD(card_box5_lg, 0.1) PROPFILERECORD(card_box6_lg, 0.1) - PROPFILERECORD(cctv, 0.1) + #include PROPFILERECORD(console1, 0.1) PROPFILERECORD(console2, 0.1) PROPFILERECORD(console3, 0.1) diff --git a/assets/obseg/setup/UsetuparchZ.c b/assets/obseg/setup/UsetuparchZ.c index 9d7bf1af..372a1533 100644 --- a/assets/obseg/setup/UsetuparchZ.c +++ b/assets/obseg/setup/UsetuparchZ.c @@ -7,6 +7,7 @@ #include "ultra64.h" #include "bondtypes.h" +#include "bondconstants.h" #include // forward declarations @@ -2336,7 +2337,7 @@ u8 chrAI_7[] = { IFMyAngleToBondLessThanDeg(90.000000,lbl30) IFMyAngleToBondGreaterThanDeg(270.000000,lbl30) //USING HUD MESSAGE Stringy = 0, ai->txt = 2057 - TextPrintTop(TEXT(2,9)) + TextPrintTop(TEXT(LARCH,9)) LookSurprised() GotoNext(lbl10) @@ -2345,13 +2346,13 @@ u8 chrAI_7[] = { IFObjectiveBitfieldHas(0x800,lbl42) IFChrDoesNotExist(1,lbl42) //USING HUD MESSAGE Stringy = 0, ai->txt = 2082 - TextPrintTop(TEXT(2,34)) + TextPrintTop(TEXT(LARCH,34)) GotoNext(lbl43) Label(lbl42) //USING HUD MESSAGE Stringy = 0, ai->txt = 2058 - TextPrintTop(TEXT(2,10)) + TextPrintTop(TEXT(LARCH,10)) Label(lbl43) RaiseArms() @@ -2370,7 +2371,7 @@ u8 chrAI_7[] = { Label(lbl27) UnsetObjectiveBitfield(0x400) //USING HUD MESSAGE Stringy = 0, ai->txt = 2059 - TextPrintTop(TEXT(2,11)) + TextPrintTop(TEXT(LARCH,11)) SetReturnAiList(1032) SetNewRandom() IFRandomGreaterThan(128,lbl26) @@ -2389,7 +2390,7 @@ u8 chrAI_7[] = { Label(lbl48) //USING HUD MESSAGE Stringy = 0, ai->txt = 2060 - TextPrintTop(TEXT(2,12)) + TextPrintTop(TEXT(LARCH,12)) YIELD_FOREVER(lbl12) @@ -2476,7 +2477,7 @@ u8 chrAI_8[] = { Label(lbl5) PRINT("saw bond\n") //USING HUD MESSAGE Stringy = 0, ai->txt = 2056 - TextPrintTop(TEXT(2,8)) + TextPrintTop(TEXT(LARCH,8)) RaiseArms() SetObjectiveBitfield(0x100) SetMyFlags2(0x80) diff --git a/assets/obseg/setup/UsetupaztZ.c b/assets/obseg/setup/UsetupaztZ.c index de48da4e..78967f62 100644 --- a/assets/obseg/setup/UsetupaztZ.c +++ b/assets/obseg/setup/UsetupaztZ.c @@ -7,6 +7,7 @@ #include "ultra64.h" #include "bondtypes.h" +#include "bondaicommands.h" // forward declarations PadRecord padlist[]; @@ -1432,29 +1433,2411 @@ PathRecord patrolpaths[] = { }; -u32 ai_0[] = { 0x200005fd, 0x00070400 }; -u32 ai_10[] = { 0x02060355, 0x00832c01, 0x06022c9c, 0x00000100, 0x365e0b02, 0x36020703, 0xad57320a, 0x009c0000, 0x01002c01, 0x07022cae, 0x020b03ad, 0x49320a00, 0xb4000258, 0x18b40001, 0x8617b400, 0x014a16b4, 0x0000d215, 0xb4000096, 0x14b40000, 0x5a13b400, 0x001e1201, 0x0b0212ad, 0x54310a00, 0xa4010002, 0x00005f01, 0xa4020002, 0x00005f02, 0x010b0213, 0xa4030002, 0x00005f03, 0xa4040002, 0x00005f04, 0x010b0214, 0xa4050002, 0x00005f05, 0xa4060002, 0x00005f06, 0x010b0215, 0xa4070002, 0x00005f07, 0xa4080002, 0x00005f08, 0x010b0216, 0x010b0217, 0x010b0218, 0xad434c0a, 0x0005fd00, 0x01040000 }; -u32 ai_11[] = { 0x9b000001, 0x00020003, 0x9c000001, 0x00369c00, 0x0004000a, 0x01000236, 0x9c000008, 0x000d0100, 0x020ac314, 0x06671466, 0x00ae020b, 0x03b40003, 0x842c010b, 0x022c6609, 0x670a020c, 0x03680002, 0x2c010c02, 0x2c9a0000, 0x01009b00, 0x00040001, 0x00020dc3, 0x14076614, 0x6700ae02, 0x0e03b400, 0x03842c01, 0x0e022c67, 0x09660a02, 0x0f036800, 0x012c010f, 0x022c9b00, 0x0001009b, 0x00000800, 0x01000400 }; -u32 ai_12[] = { 0x0200039c, 0x00000400, 0x369c0000, 0x0800365c, 0x0b2c0236, 0x5c0b3602, 0x36010002, 0x2c9c0000, 0x01000a9a, 0x00000400, 0x0100020a, 0x9c000100, 0x000b9a00, 0x00080001, 0x00020bc3, 0x140f0100, 0x04000000 }; -u32 ai_13[] = { 0x0206035d, 0x132c5c13, 0x2d010602, 0x2c59320b, 0x022dc314, 0x09010602, 0x0b9a0000, 0x1000c314, 0x08020c03, 0x010c0400 }; -u32 ai_14[] = { 0x0206035d, 0x0f2c5c0f, 0x2d010602, 0x2c59490b, 0x022dc314, 0x0a010602, 0x0bc3140b, 0x022cae02, 0x0d03b400, 0x012c2c01, 0x0d022c9a, 0x00002000, 0x020c0301, 0x0c040000 }; -u32 ai_15[] = { 0x0206039c, 0x00002000, 0x2c010602, 0x2cb7001e, 0xb9b5f400, 0x00ffc314, 0x0c020a03, 0x9c000001, 0x002c0036, 0x022c9a00, 0x01000002, 0x36bb000a, 0x2c010a02, 0x2c9c0000, 0x0800079c, 0x00000100, 0x040207b8, 0xb7000aae, 0x9c000001, 0x0036c314, 0x0e020c03, 0xb400012c, 0x2c010c02, 0x2c010702, 0x369a0001, 0x0000b902, 0x04c3140d, 0x9a000100, 0x00020b03, 0xbb00012c, 0x010b022c, 0x9a000040, 0x009a0000, 0x8000b605, 0xfd000104 }; -u32 ai_1[] = { 0x91329332, 0x05fd0002, 0x04000000 }; -u32 ai_3[] = { 0x91329332, 0x05fd0005, 0x04000000 }; -u32 ai_2[] = { 0x9001f48f, 0x01f49150, 0x93509250, 0x9d000008, 0x0005fd00, 0x02040000 }; -u32 ai_4[] = { 0x90001491, 0x50935002, 0x04140021, 0x00000602, 0x0603462c, 0x3a2c3b2c, 0x322c3c2c, 0x0106022c, 0x3335c82d, 0x35642c16, 0x00010000, 0x0a022d1a, 0x0a022c09, 0xae020b03, 0x3335fa2c, 0xb40000b4, 0x08010b02, 0x2c140021, 0x00002c02, 0x2c160001, 0x00002c02, 0x2c020a03, 0x2f08010a, 0x02080104, 0x04000000 }; -u32 ai_16[] = { 0x0204039c, 0x00004000, 0x2c010402, 0x2ceb5fec, 0xd700da02, 0x0a03dc2c, 0x010a022c, 0xddeaed03, 0x0303d516, 0x00020000, 0xd9f80081, 0x2c022c03, 0x03dbfc17, 0xe9ae020c, 0x03b40002, 0x582c010c, 0x022cda02, 0x0d03dc2c, 0x010d022c, 0xd205fd00, 0x01025f05, 0xfd000104 }; -u32 ai_17[] = { 0x02060355, 0x00824055, 0x00164003, 0x55001741, 0x55006b41, 0x55005442, 0x55005542, 0x55004e42, 0x03550027, 0x43550025, 0x4355007e, 0x44550041, 0x4455006d, 0x4555004b, 0x45010602, 0x4003ad53, 0x54415254, 0x0a00ac00, 0x0061ac01, 0x0065ac02, 0x00630106, 0x024103ad, 0x53435245, 0x454e0a00, 0xac000067, 0xac01005a, 0xac020059, 0x01060242, 0x03ad4455, 0x43540a00, 0xac000075, 0xac010080, 0xac020076, 0x01060243, 0x03ad4241, 0x590a00ac, 0x000054ac, 0x01007dac, 0x02007c01, 0x06024403, 0xad415a54, 0x310a00ac, 0x000076ac, 0x01006fac, 0x02007001, 0x06024503, 0xad415a54, 0x320a00ac, 0x00005fac, 0x01005bac, 0x02007c01, 0x06040000 }; -u32 ai_18[] = { 0x8e00ae02, 0x4a03b400, 0x00780401, 0x4a02049c, 0x00040000, 0x0bae020a, 0x03b40002, 0x582c010a, 0x022c3103, 0x2c010402, 0x2cad7370, 0x61776e31, 0x00f33602, 0x56bd27ff, 0x23280406, 0x00000000, 0x080236ad, 0x2d3e6661, 0x696c0001, 0x040208ad, 0x7331204f, 0x4b210001, 0x04020b03, 0x9c000200, 0x002c010b, 0x022c0104, 0x04000000 }; -u32 ai_19[] = { 0x8e01ae02, 0x4a03b400, 0x00780401, 0x4a02049c, 0x00040000, 0x0bae020a, 0x03b40002, 0x582c010a, 0x022c3104, 0x2c010402, 0x2cad7370, 0x61776e32, 0x00f33602, 0x56bd27ff, 0x23280407, 0x00000000, 0x080236ad, 0x2d3e6661, 0x696c0001, 0x040208ad, 0x7332204f, 0x4b210001, 0x04020b03, 0x9c000200, 0x002c010b, 0x022c0104, 0x04000000 }; -u32 ai_20[] = { 0x8e02ae02, 0x4a03b400, 0x00780401, 0x4a02049c, 0x00040000, 0x0bae020a, 0x03b40002, 0x582c010a, 0x022c3105, 0x2c010402, 0x2cad7370, 0x61776e33, 0x00f33602, 0x56bd27ff, 0x23280408, 0x00000000, 0x080236ad, 0x2d3e6661, 0x696c0001, 0x040208ad, 0x7333204f, 0x4b210001, 0x04020b03, 0x9c000200, 0x002c010b, 0x022c0104, 0x04000000 }; -u32 ai_5[] = { 0x8e0305fd, 0x04090400 }; -u32 ai_6[] = { 0x8e0405fd, 0x04090400 }; -u32 ai_7[] = { 0x8e0505fd, 0x04090400 }; -u32 ai_8[] = { 0x02409128, 0x9328002c, 0x02419132, 0x9332002c, 0x0242913c, 0x933c002c, 0x02439150, 0x9350002c, 0x022c3335, 0x82390236, 0x8f002890, 0x000a8dcc, 0xbf00bb16, 0x00000000, 0x2c022c02, 0x2c000802, 0x398f0028, 0x90001402, 0x2cbf00bb, 0x16800000, 0x002c022c, 0xbf00bb16, 0x90000000, 0x08020805, 0xfd040a04 }; -u32 ai_9[] = { 0x023a034c, 0x012c364c, 0x03200928, 0x0a02362a, 0x0a020a03, 0x4c019036, 0x4c032009, 0x3c3b0236, 0x2f3c010a, 0x023b3c2c, 0x0008023c, 0x03013a02, 0x2c023d33, 0x350a2c1a, 0x08022c35, 0x322c0e08, 0x022c353c, 0x2c130802, 0x2c35502c, 0x1308022c, 0x35642c11, 0x08022c35, 0x962c1208, 0x022c35c8, 0x2c140001, 0x00000802, 0x2c150001, 0x00000802, 0x08032f2c, 0x0108022c, 0x3c2c000a, 0x020a0301, 0x3a022c03, 0x013d0209, 0x4236ad44, 0x454c4554, 0x45210023, 0xfd05fd00, 0x01023601, 0x3a040000 }; -u32 ai_21[] = { 0x9a000400, 0x009b0002, 0x00000206, 0x03312a2c, 0x01060106, 0x022c9a00, 0x0200009b, 0x00040000, 0x05fd0001, 0x04000000 }; -u32 ai_22[] = { 0x0058025b, 0x03681504, 0x5a015b02, 0x5e036815, 0x01586815, 0x0859015e, 0x025c0368, 0x15085901, 0x5c025d03, 0x68150257, 0x6815045a, 0x015d0257, 0xd012002f, 0x015b025a, 0xd012002e, 0x015e0258, 0xd012002e, 0x015c0259, 0xd012002f, 0x015d0400 }; +u8 ai_0[] = { + // 0x20 + guard_start_patrol( + // path_num + 0x0) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x700) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_10[] = { + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x8300, 0x2c) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x36) + // 0x5e + object_activate( + // object_tag + 0xb) + // 0x02 + label( + // id + 0x36) + // 0x02 + label( + // id + 0x7) + // 0x03 + ai_sleep + // 0xad + // debug_log: W2 + 0xad, 0x57, 0x32, 0x0a, 0x00, + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x2c) + // 0x01 + goto_first( + // label + 0x7) + // 0x02 + label( + // id + 0x2c) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0xad + // debug_log: I2 + 0xad, 0x49, 0x32, 0x0a, 0x00, + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x580200, 0x18) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x860100, 0x17) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x4a0100, 0x16) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0xd20000, 0x15) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x960000, 0x14) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x5a0000, 0x13) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x1e0000, 0x12) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x12) + // 0xad + // debug_log: T1 + 0xad, 0x54, 0x31, 0x0a, 0x00, + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x1, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x1) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x2, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x2) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x13) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x3, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x3) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x4, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x4) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x14) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x5, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x5) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x6, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x6) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x15) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x7, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x7) + // 0xa4 + object_flags_1_set_off( + // object_tag, bitfield + 0x8, 0x200) + // 0x5f + object_destroy( + // object_tag + 0x8) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x16) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x17) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x18) + // 0xad + // debug_log: CL + 0xad, 0x43, 0x4c, 0x0a, 0x00, + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x04 + ai_list_end + ,0x00,0x00 + }; +u8 ai_11[] = { + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x10000) + // 0x02 + label( + // id + 0x0) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x36) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x40000, 0xa) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0x36) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x80000, 0xd) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0xa) + // 0xc3 + text_print_top( + // text_slot + 0x614) + // 0x67 + door_close( + // object_tag + 0x14) + // 0x66 + door_open( + // object_tag + 0x0) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x840300, 0x2c) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x66 + door_open( + // object_tag + 0x9) + // 0x67 + door_close( + // object_tag + 0xa) + // 0x02 + label( + // id + 0xc) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x0, 0x2, 0x2c) + // 0x01 + goto_first( + // label + 0xc) + // 0x02 + label( + // id + 0x2c) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x10000) + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x40000) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0xd) + // 0xc3 + text_print_top( + // text_slot + 0x714) + // 0x66 + door_open( + // object_tag + 0x14) + // 0x67 + door_close( + // object_tag + 0x0) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xe) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x840300, 0x2c) + // 0x01 + goto_first( + // label + 0xe) + // 0x02 + label( + // id + 0x2c) + // 0x67 + door_close( + // object_tag + 0x9) + // 0x66 + door_open( + // object_tag + 0xa) + // 0x02 + label( + // id + 0xf) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x0, 0x1, 0x2c) + // 0x01 + goto_first( + // label + 0xf) + // 0x02 + label( + // id + 0x2c) + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x10000) + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x80000) + // 0x01 + goto_first( + // label + 0x0) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_12[] = { + // 0x02 + label( + // id + 0x0) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x40000, 0x36) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x80000, 0x36) + // 0x5c + if_object_was_activated( + // object_tag, label + 0xb, 0x2c) + // 0x02 + label( + // id + 0x36) + // 0x5c + if_object_was_activated( + // object_tag, label + 0xb, 0x36) + // 0x02 + label( + // id + 0x36) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0x2c) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0xa) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x40000) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0xa) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x100, 0xb) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x80000) + // 0x01 + goto_first( + // label + 0x0) + // 0x02 + label( + // id + 0xb) + // 0xc3 + text_print_top( + // text_slot + 0xf14) + // 0x01 + goto_first( + // label + 0x0) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_13[] = { + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x5d + if_bond_used_gadget_on_object( + // object_tag, label + 0x13, 0x2c) + // 0x5c + if_object_was_activated( + // object_tag, label + 0x13, 0x2d) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0x59 + if_bond_has_item_equipped( + // item_num, label + 0x32, 0xb) + // 0x02 + label( + // id + 0x2d) + // 0xc3 + text_print_top( + // text_slot + 0x914) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0xb) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x100000) + // 0xc3 + text_print_top( + // text_slot + 0x814) + // 0x02 + label( + // id + 0xc) + // 0x03 + ai_sleep + // 0x01 + goto_first( + // label + 0xc) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_14[] = { + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x5d + if_bond_used_gadget_on_object( + // object_tag, label + 0xf, 0x2c) + // 0x5c + if_object_was_activated( + // object_tag, label + 0xf, 0x2d) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0x59 + if_bond_has_item_equipped( + // item_num, label + 0x49, 0xb) + // 0x02 + label( + // id + 0x2d) + // 0xc3 + text_print_top( + // text_slot + 0xa14) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0xb) + // 0xc3 + text_print_top( + // text_slot + 0xb14) + // 0x02 + label( + // id + 0x2c) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xd) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x2c0100, 0x2c) + // 0x01 + goto_first( + // label + 0xd) + // 0x02 + label( + // id + 0x2c) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x200000) + // 0x02 + label( + // id + 0xc) + // 0x03 + ai_sleep + // 0x01 + goto_first( + // label + 0xc) + // 0x04 + ai_list_end + ,0x00,0x00 + }; +u8 ai_15[] = { + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x200000, 0x2c) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0xb7 + hud_countdown_set( + // seconds + 0x1e00) + // 0xb9 + hud_countdown_start + // 0xb5 + hud_countdown_show + // 0xf4 + music_xtrack_play( + // music_slot, seconds_stopped_duration, seconds_total_duration + 0x0, 0x0, 0xff) + // 0xc3 + text_print_top( + // text_slot + 0xc14) + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x2c) + // 0x00 + goto_next( + // label + 0x36) + // 0x02 + label( + // id + 0x2c) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x100) + // 0x02 + label( + // id + 0x36) + // 0xbb + if_hud_countdown_less_than( + // seconds, label + 0xa00, 0x2c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x80000, 0x7) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x4) + // 0x02 + label( + // id + 0x7) + // 0xb8 + hud_countdown_stop + // 0xb7 + hud_countdown_set( + // seconds + 0xa00) + // 0xae + local_timer_reset_start + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x10000, 0x36) + // 0xc3 + text_print_top( + // text_slot + 0xe14) + // 0x02 + label( + // id + 0xc) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x2c0100, 0x2c) + // 0x01 + goto_first( + // label + 0xc) + // 0x02 + label( + // id + 0x2c) + // 0x01 + goto_first( + // label + 0x7) + // 0x02 + label( + // id + 0x36) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x100) + // 0xb9 + hud_countdown_start + // 0x02 + label( + // id + 0x4) + // 0xc3 + text_print_top( + // text_slot + 0xd14) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x100) + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0xbb + if_hud_countdown_less_than( + // seconds, label + 0x100, 0x2c) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x400000) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x800000) + // 0xb6 + hud_countdown_hide + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x04 + ai_list_end + + }; +u8 ai_1[] = { + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x32) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x32) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x200) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_3[] = { + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x32) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x32) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x500) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_2[] = { + // 0x90 + guard_set_armour( + // armour_value + 0xf401) + // 0x8f + guard_set_health_total( + // total_health + 0xf401) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x50) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x50) + // 0x92 + guard_set_argh_rating( + // speed_rating + 0x50) + // 0x9d + guard_flags_set_on( + // bitfield + 0x80000) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x200) + // 0x04 + ai_list_end + ,0x00,0x00 + }; +u8 ai_4[] = { + // 0x90 + guard_set_armour( + // armour_value + 0x1400) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x50) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x50) + // 0x02 + label( + // id + 0x4) + // 0x14 + guard_try_fire_or_aim_at_target( + // bitfield, target, label + 0x2100, 0x0, 0x6) + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x46 + if_guard_shot_from_bond_missed( + // label + 0x2c) + // 0x3a + if_guard_see_another_guard_shot( + // label + 0x2c) + // 0x3b + if_guard_see_another_guard_die( + // label + 0x2c) + // 0x32 + if_guard_sees_bond( + // label + 0x2c) + // 0x3c + if_guard_and_bond_within_line_of_sight( + // label + 0x2c) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0x33 + random_generate_seed + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0xc8, 0x2d) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x64, 0x2c) + // 0x16 + guard_try_fire_or_aim_at_target_update( + // bitfield, target, label + 0x100, 0x0, 0xa) + // 0x02 + label( + // id + 0x2d) + // 0x1a + guard_try_throwing_grenade( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0x09 + guard_kneel + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0x33 + random_generate_seed + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0xfa, 0x2c) + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0xb40000, 0x8) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x14 + guard_try_fire_or_aim_at_target( + // bitfield, target, label + 0x2100, 0x0, 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x16 + guard_try_fire_or_aim_at_target_update( + // bitfield, target, label + 0x100, 0x0, 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0x2f + if_guard_has_stopped_moving( + // label + 0x8) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x8) + // 0x01 + goto_first( + // label + 0x4) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_16[] = { + // 0x02 + label( + // id + 0x4) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x400000, 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x2c) + // 0xeb + if_bond_is_dead( + // label + 0x5f) + // 0xec + bond_disable_damage_and_pickups + // 0xd7 + hud_hide_and_lock_controls_and_pause_mission_time( + // bitfield + 0x0) + // 0xda + screen_fade_to_black + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0xdc + if_screen_fade_completed( + // label + 0x2c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0xdd + chr_hide_all + // 0xea + trigger_fade_and_exit_level_on_button_press + // 0xed + bond_hide_weapons + // 0x03 + ai_sleep + // 0x03 + ai_sleep + // 0x03 + ai_sleep + // 0xd5 + camera_switch( + // object_tag, look_at_bond_flag, unused_flag + 0x16, 0x200, 0x0) + // 0xd9 + chr_try_teleporting_to_pad( + // chr_num, pad, label + 0xf8, 0x8100, 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x03 + ai_sleep + // 0x03 + ai_sleep + // 0xdb + screen_fade_from_black + // 0xfc + object_rocket_launch( + // object_tag + 0x17) + // 0xe9 + switch_fog_instantly + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xc) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x580200, 0x2c) + // 0x01 + goto_first( + // label + 0xc) + // 0x02 + label( + // id + 0x2c) + // 0xda + screen_fade_to_black + // 0x02 + label( + // id + 0xd) + // 0x03 + ai_sleep + // 0xdc + if_screen_fade_completed( + // label + 0x2c) + // 0x01 + goto_first( + // label + 0xd) + // 0x02 + label( + // id + 0x2c) + // 0xd2 + exit_level + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x02 + label( + // id + 0x5f) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x04 + ai_list_end + + }; +u8 ai_17[] = { + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x8200, 0x40) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x1600, 0x40) + // 0x03 + ai_sleep + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x1700, 0x41) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x6b00, 0x41) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x5400, 0x42) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x5500, 0x42) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x4e00, 0x42) + // 0x03 + ai_sleep + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x2700, 0x43) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x2500, 0x43) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x7e00, 0x44) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x4100, 0x44) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x6d00, 0x45) + // 0x55 + if_bond_in_room_with_pad( + // pad, label + 0x4b00, 0x45) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x40) + // 0x03 + ai_sleep + // 0xad + // debug_log: START + 0xad, 0x53, 0x54, 0x41, 0x52, 0x54, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x6100) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x6500) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x6300) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x41) + // 0x03 + ai_sleep + // 0xad + // debug_log: SCREEN + 0xad, 0x53, 0x43, 0x52, 0x45, 0x45, 0x4e, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x6700) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x5a00) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x5900) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x42) + // 0x03 + ai_sleep + // 0xad + // debug_log: DUCT + 0xad, 0x44, 0x55, 0x43, 0x54, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x7500) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x8000) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x7600) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x43) + // 0x03 + ai_sleep + // 0xad + // debug_log: BAY + 0xad, 0x42, 0x41, 0x59, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x5400) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x7d00) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x7c00) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x44) + // 0x03 + ai_sleep + // 0xad + // debug_log: AZT1 + 0xad, 0x41, 0x5a, 0x54, 0x31, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x7600) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x6f00) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x7000) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x45) + // 0x03 + ai_sleep + // 0xad + // debug_log: AZT2 + 0xad, 0x41, 0x5a, 0x54, 0x32, 0x0a, 0x00, + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x0, 0x5f00) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x1, 0x5b00) + // 0xac + chr_set_pad_preset( + // chr_num, pad_preset + 0x2, 0x7c00) + // 0x01 + goto_first( + // label + 0x6) + // 0x04 + ai_list_end + ,0x00,0x00 + }; +u8 ai_18[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x0) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0x4a) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x780000, 0x4) + // 0x01 + goto_first( + // label + 0x4a) + // 0x02 + label( + // id + 0x4) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x400, 0xb) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x580200, 0x2c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0x31 + if_chr_does_not_exist( + // chr_num, label + 0x3, 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x2c) + // 0xad + // debug_log: spawn1 + 0xad, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x31, 0x00, + // 0xf3 + if_bond_damage_and_pickups_disabled( + // label + 0x36) + // 0x02 + label( + // id + 0x56) + // 0xbd + chr_try_spawning_at_pad( + // body_num, head_num, pad, ai_list, bitfield, label + 0x27, 0xff, 0x2823, 0x604, 0x0, 0x8) + // 0x02 + label( + // id + 0x36) + // 0xad + // debug_log: ->fail + 0xad, 0x2d, 0x3e, 0x66, 0x61, 0x69, 0x6c, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x8) + // 0xad + // debug_log: s1 OK! + 0xad, 0x73, 0x31, 0x20, 0x4f, 0x4b, 0x21, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x200, 0x2c) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_19[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x1) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0x4a) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x780000, 0x4) + // 0x01 + goto_first( + // label + 0x4a) + // 0x02 + label( + // id + 0x4) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x400, 0xb) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x580200, 0x2c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0x31 + if_chr_does_not_exist( + // chr_num, label + 0x4, 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x2c) + // 0xad + // debug_log: spawn2 + 0xad, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x32, 0x00, + // 0xf3 + if_bond_damage_and_pickups_disabled( + // label + 0x36) + // 0x02 + label( + // id + 0x56) + // 0xbd + chr_try_spawning_at_pad( + // body_num, head_num, pad, ai_list, bitfield, label + 0x27, 0xff, 0x2823, 0x704, 0x0, 0x8) + // 0x02 + label( + // id + 0x36) + // 0xad + // debug_log: ->fail + 0xad, 0x2d, 0x3e, 0x66, 0x61, 0x69, 0x6c, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x8) + // 0xad + // debug_log: s2 OK! + 0xad, 0x73, 0x32, 0x20, 0x4f, 0x4b, 0x21, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x200, 0x2c) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_20[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x2) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0x4a) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x780000, 0x4) + // 0x01 + goto_first( + // label + 0x4a) + // 0x02 + label( + // id + 0x4) + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x400, 0xb) + // 0xae + local_timer_reset_start + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0xb4 + if_local_timer_greater_than( + // time60, label + 0x580200, 0x2c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x2c) + // 0x31 + if_chr_does_not_exist( + // chr_num, label + 0x5, 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x2c) + // 0xad + // debug_log: spawn3 + 0xad, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x33, 0x00, + // 0xf3 + if_bond_damage_and_pickups_disabled( + // label + 0x36) + // 0x02 + label( + // id + 0x56) + // 0xbd + chr_try_spawning_at_pad( + // body_num, head_num, pad, ai_list, bitfield, label + 0x27, 0xff, 0x2823, 0x804, 0x0, 0x8) + // 0x02 + label( + // id + 0x36) + // 0xad + // debug_log: ->fail + 0xad, 0x2d, 0x3e, 0x66, 0x61, 0x69, 0x6c, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0x8) + // 0xad + // debug_log: s3 OK! + 0xad, 0x73, 0x33, 0x20, 0x4f, 0x4b, 0x21, 0x00, + // 0x01 + goto_first( + // label + 0x4) + // 0x02 + label( + // id + 0xb) + // 0x03 + ai_sleep + // 0x9c + if_objective_bitfield_is_set_on( + // bitfield, label + 0x200, 0x2c) + // 0x01 + goto_first( + // label + 0xb) + // 0x02 + label( + // id + 0x2c) + // 0x01 + goto_first( + // label + 0x4) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_5[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x3) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x904) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_6[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x4) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x904) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_7[] = { + // 0x8e + guard_set_chr_num( + // chr_num + 0x5) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x904) + // 0x04 + ai_list_end + ,0x00 + }; +u8 ai_8[] = { + // 0x02 + label( + // id + 0x40) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x28) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x28) + // 0x00 + goto_next( + // label + 0x2c) + // 0x02 + label( + // id + 0x41) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x32) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x32) + // 0x00 + goto_next( + // label + 0x2c) + // 0x02 + label( + // id + 0x42) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x3c) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x3c) + // 0x00 + goto_next( + // label + 0x2c) + // 0x02 + label( + // id + 0x43) + // 0x91 + guard_set_speed_rating( + // speed_rating + 0x50) + // 0x93 + guard_set_accuracy_rating( + // accuracy_rating + 0x50) + // 0x00 + goto_next( + // label + 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x33 + random_generate_seed + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x82, 0x39) + // 0x02 + label( + // id + 0x36) + // 0x8f + guard_set_health_total( + // total_health + 0x2800) + // 0x90 + guard_set_armour( + // armour_value + 0xa00) + // 0x8d + guard_set_grenade_probability( + // grenade_prob + 0xcc) + // 0xbf + guard_try_spawning_item( + // prop_num, item_num, prop_bitfield, label + 0xbb00, 0x16, 0x0, 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0x00 + goto_next( + // label + 0x8) + // 0x02 + label( + // id + 0x39) + // 0x8f + guard_set_health_total( + // total_health + 0x2800) + // 0x90 + guard_set_armour( + // armour_value + 0x1400) + // 0x02 + label( + // id + 0x2c) + // 0xbf + guard_try_spawning_item( + // prop_num, item_num, prop_bitfield, label + 0xbb00, 0x16, 0x80, 0x2c) + // 0x02 + label( + // id + 0x2c) + // 0xbf + guard_try_spawning_item( + // prop_num, item_num, prop_bitfield, label + 0xbb00, 0x16, 0x90, 0x8) + // 0x02 + label( + // id + 0x8) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0xa04) + // 0x04 + ai_list_end + + }; +u8 ai_9[] = { + // 0x02 + label( + // id + 0x3a) + // 0x03 + ai_sleep + // 0x4c + if_guard_distance_to_bond_greater_than( + // distance, label + 0x2c01, 0x36) + // 0x4c + if_guard_distance_to_bond_greater_than( + // distance, label + 0x2003, 0x9) + // 0x28 + guard_try_running_to_bond_position( + // label + 0xa) + // 0x02 + label( + // id + 0x36) + // 0x2a + guard_try_sprinting_to_bond_position( + // label + 0xa) + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0x4c + if_guard_distance_to_bond_greater_than( + // distance, label + 0x9001, 0x36) + // 0x4c + if_guard_distance_to_bond_greater_than( + // distance, label + 0x2003, 0x9) + // 0x3c + if_guard_and_bond_within_line_of_sight( + // label + 0x3b) + // 0x02 + label( + // id + 0x36) + // 0x2f + if_guard_has_stopped_moving( + // label + 0x3c) + // 0x01 + goto_first( + // label + 0xa) + // 0x02 + label( + // id + 0x3b) + // 0x3c + if_guard_and_bond_within_line_of_sight( + // label + 0x2c) + // 0x00 + goto_next( + // label + 0x8) + // 0x02 + label( + // id + 0x3c) + // 0x03 + ai_sleep + // 0x01 + goto_first( + // label + 0x3a) + // 0x02 + label( + // id + 0x2c) + // 0x02 + label( + // id + 0x3d) + // 0x33 + random_generate_seed + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0xa, 0x2c) + // 0x1a + guard_try_throwing_grenade( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x32, 0x2c) + // 0x0e + guard_try_sidestepping( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x3c, 0x2c) + // 0x13 + guard_try_firing_roll( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x50, 0x2c) + // 0x13 + guard_try_firing_roll( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x64, 0x2c) + // 0x11 + guard_try_firing_walk( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0x96, 0x2c) + // 0x12 + guard_try_firing_run( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x35 + if_random_seed_greater_than( + // cbyte, label + 0xc8, 0x2c) + // 0x14 + guard_try_fire_or_aim_at_target( + // bitfield, target, label + 0x100, 0x0, 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x15 + guard_try_fire_or_aim_at_target_kneel( + // bitfield, target, label + 0x100, 0x0, 0x8) + // 0x02 + label( + // id + 0x8) + // 0x03 + ai_sleep + // 0x2f + if_guard_has_stopped_moving( + // label + 0x2c) + // 0x01 + goto_first( + // label + 0x8) + // 0x02 + label( + // id + 0x2c) + // 0x3c + if_guard_and_bond_within_line_of_sight( + // label + 0x2c) + // 0x00 + goto_next( + // label + 0xa) + // 0x02 + label( + // id + 0xa) + // 0x03 + ai_sleep + // 0x01 + goto_first( + // label + 0x3a) + // 0x02 + label( + // id + 0x2c) + // 0x03 + ai_sleep + // 0x01 + goto_first( + // label + 0x3d) + // 0x02 + label( + // id + 0x9) + // 0x42 + if_guard_is_on_screen( + // label + 0x36) + // 0xad + // debug_log: DELETE! + 0xad, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x21, 0x00, + // 0x23 + chr_remove_instant( + // chr_num + 0xfd) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x02 + label( + // id + 0x36) + // 0x01 + goto_first( + // label + 0x3a) + // 0x04 + ai_list_end + ,0x00,0x00 + }; +u8 ai_21[] = { + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x400) + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x200) + // 0x02 + label( + // id + 0x6) + // 0x03 + ai_sleep + // 0x31 + if_chr_does_not_exist( + // chr_num, label + 0x2a, 0x2c) + // 0x01 + goto_first( + // label + 0x6) + // 0x01 + goto_first( + // label + 0x6) + // 0x02 + label( + // id + 0x2c) + // 0x9a + objective_bitfield_set_on( + // bitfield + 0x200) + // 0x9b + objective_bitfield_set_off( + // bitfield + 0x400) + // 0x05 + jump_to_ai_list( + // chr_num, ai_list + 0xfd, 0x100) + // 0x04 + ai_list_end + ,0x00,0x00,0x00 + }; +u8 ai_22[] = { + // 0x00 + goto_next( + // label + 0x58) + // 0x02 + label( + // id + 0x5b) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x4, 0x5a) + // 0x01 + goto_first( + // label + 0x5b) + // 0x02 + label( + // id + 0x5e) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x1, 0x58) + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x8, 0x59) + // 0x01 + goto_first( + // label + 0x5e) + // 0x02 + label( + // id + 0x5c) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x8, 0x59) + // 0x01 + goto_first( + // label + 0x5c) + // 0x02 + label( + // id + 0x5d) + // 0x03 + ai_sleep + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x2, 0x57) + // 0x68 + if_door_state_equal( + // object_tag, door_state, label + 0x15, 0x4, 0x5a) + // 0x01 + goto_first( + // label + 0x5d) + // 0x02 + label( + // id + 0x57) + // 0xd0 + tv_change_screen_bank( + // object_tag, screen_index, screen_bank + 0x12, 0x0, 0x2f) + // 0x01 + goto_first( + // label + 0x5b) + // 0x02 + label( + // id + 0x5a) + // 0xd0 + tv_change_screen_bank( + // object_tag, screen_index, screen_bank + 0x12, 0x0, 0x2e) + // 0x01 + goto_first( + // label + 0x5e) + // 0x02 + label( + // id + 0x58) + // 0xd0 + tv_change_screen_bank( + // object_tag, screen_index, screen_bank + 0x12, 0x0, 0x2e) + // 0x01 + goto_first( + // label + 0x5c) + // 0x02 + label( + // id + 0x59) + // 0xd0 + tv_change_screen_bank( + // object_tag, screen_index, screen_bank + 0x12, 0x0, 0x2f) + // 0x01 + goto_first( + // label + 0x5d) + // 0x04 + ai_list_end + ,0x00 + }; AIListRecord ailists[] = { /* index = 0 */ diff --git a/assets/obseg/text/LgunE.c b/assets/obseg/text/LgunE.c index e54c6ab7..9ab09fc1 100644 --- a/assets/obseg/text/LgunE.c +++ b/assets/obseg/text/LgunE.c @@ -1,227 +1,227 @@ char *LgunE[] = { - " D5K\n", - " Issue\n", - " Mine\n", - " PP7\n", - " DD44\n", - " Gun\n", - " Knife\n", - " Mine\n", - " KF7\n", - " Mine\n", - " Rifle\n", - " Rocket\n", - " Shotgun\n", - "(Proximity)\n", - "(Remote)\n", - "(Timed)\n", - "(silenced)\n", - "-\n", - "Assault\n", - "Attract\n", - "Audio Tape\n", - "Automatic Shotgun\n", - "Automatic\n", - "Blackbox\n", - "Blueprints\n", - "Bolt Key\n", - "Bomb Case\n", - "Bomb Defuser\n", - "Briefcase\n", - "Bug Detector\n", - "Bug\n", - "Bungee\n", - "Camera\n", - "Circuit Board\n", - "Clipboard\n", - "Communicator\n", - "Controller\n", - "Cougar Magnum\n", - "Cougar\n", - "Credit Card\n", - "D5K (silenced)\n", - "D5K Deutsche\n", - "DD44 Dostovei\n", - "Dark Glasses\n", - "Dat Tape\n", - "Datathief\n", - "Detonator\n", - "Deutsche\n", - "Door Decoder\n", - "Door Exploder\n", - "Dostovei\n", - "Guidance Data\n", - "Flare Pistol\n", - "Gas Keyring\n", - "Geiger Counter\n", - "Gold Bar\n", - "Gold PP7\n", - "Golden Gun\n", - "GoldenEye Key\n", - "Golden\n", - "Grenade Launcher\n", - "Grenade\n", - "Hand Grenade\n", - "Heroine\n", - "Hunting Knife\n", - "Identifier\n", - "KF7 Soviet\n", - "Key Analyzer Case\n", - "Key Analyzer\n", - "Keycard\n", - "Knife\n", - "Laser\n", - "Launcher\n", - "Lectre\n", - "Lock Exploder\n", - "Magnet Repel\n", - "Magnum\n", - "Map\n", - "Micro Camera\n", - "Microcode\n", - "Microfilm\n", - "Military Laser\n", - "Military\n", - "Money\n", - "Null\n", - "PP7 (silenced)\n", - "PP7 Special Issue\n", - "PP7 Special\n", - "Phantom\n", - "Piton Gun\n", - "Plans\n", - "Plastique\n", - "Polarized Glasses\n", - "Proximity Mine\n", - "RC-P90\n", - "Red Dossier\n", - "Remote Mine\n", - "Rocket Launcher\n", - "Safecracker Case\n", - "Safecracker\n", - "Shotgun\n", - "Silver PP7\n", - "Sniper Rifle\n", - "Sniper\n", - "Soviet\n", - "Spool Tape\n", - "Spy File\n", - "Klobb\n", - "Staff List\n", - "Suit_lf_hand\n", - "Tank\n", - "Taser\n", - "Throwing Knife\n", - "Throwing\n", - "Timed Mine\n", - "Token\n", - "US AR33 Assault Rifle\n", - "US AR33\n", - "Unarmed\n", - "Video Tape\n", - "Watch Communicator\n", - "Watch Geiger Counter\n", - "Watch Identifier\n", - "Watch Laser\n", - "Watch Magnet Attract\n", - "Watch Magnet Repel\n", - "Watch Magnet\n", - "Watch\n", - "Weapon Case\n", - "Yale Key\n", - "ZMG (9mm)\n", - "\n", - "ar33\n", - "audio tape\n", - "auto shotgun\n", - "blackbox\n", - "blueprints\n", - "bolt key\n", - "bomb case\n", - "bomb defuser\n", - "briefcase\n", - "bug detector\n", - "bug\n", - "bungee\n", - "camera\n", - "circuit board\n", - "clipboard\n", - "cougar magnum\n", - "credit card\n", - "d5k (silenced)\n", - "d5k\n", - "dark glasses\n", - "dat tape\n", - "datathief\n", - "dd44\n", - "detonator\n", - "door decoder\n", - "door exploder\n", - "guidance data\n", - "flare pistol\n", - "gas keyring\n", - "gold bar\n", - "gold pp7\n", - "golden gun\n", - "goldeneye key\n", - "grenade launcher\n", - "grenade\n", - "heroine\n", - "hunting knife\n", - "key analyzer\n", - "keycard\n", - "kf7 soviet\n", - "laser\n", - "lectre\n", - "lock exploder\n", - "map\n", - "micro camera\n", - "microcode\n", - "microfilm\n", - "money\n", - "phantom\n", - "piton gun\n", - "plans\n", - "plastique\n", - "polarized glasses\n", - "pp7 (silenced)\n", - "pp7\n", - "proximity mine\n", - "rc-p90\n", - "red dossier\n", - "remote mine\n", - "rocket launcher\n", - "safecracker\n", - "shotgun\n", - "silver pp7\n", - "sniper rifle\n", - "spool tape\n", - "spy file\n", - "klobb\n", - "staff list\n", - "tank\n", - "taser\n", - "throwing knife\n", - "timed mine\n", - "token\n", - "unarmed\n", - "video tape\n", - "watch communicator\n", - "watch geiger counter\n", - "watch identifier\n", - "watch laser\n", - "watch magnet attract\n", - "watch magnet repel\n", - "weapon case\n", - "yale key\n", - "zmg (9mm)\n", - "Analyzing the GoldenEye key...\n", - "You do not have the GoldenEye\n key.\n", - "kill count", - "died once\n", - "died", - "times", - "suicide count", - 0 + " D5K\n", //GUN_STR_00 + " Issue\n", //GUN_STR_01 + " Mine\n", //GUN_STR_02 + " PP7\n", //GUN_STR_03 + " DD44\n", //GUN_STR_04 + " Gun\n", //GUN_STR_05 + " Knife\n", //GUN_STR_06 + " Mine\n", //GUN_STR_07 + " KF7\n", //GUN_STR_08 + " Mine\n", //GUN_STR_09 + " Rifle\n", //GUN_STR_0A + " Rocket\n", //GUN_STR_0B + " Shotgun\n", //GUN_STR_0C + "(Proximity)\n", //GUN_STR_0D + "(Remote)\n", //GUN_STR_0E + "(Timed)\n", //GUN_STR_0F + "(silenced)\n", //GUN_STR_10 + "-\n", //GUN_STR_11 + "Assault\n", //GUN_STR_12 + "Attract\n", //GUN_STR_13 + "Audio Tape\n", //GUN_STR_14 + "Automatic Shotgun\n", //GUN_STR_15 + "Automatic\n", //GUN_STR_16 + "Blackbox\n", //GUN_STR_17 + "Blueprints\n", //GUN_STR_18 + "Bolt Key\n", //GUN_STR_19 + "Bomb Case\n", //GUN_STR_1A + "Bomb Defuser\n", //GUN_STR_1B + "Briefcase\n", //GUN_STR_1C + "Bug Detector\n", //GUN_STR_1D + "Bug\n", //GUN_STR_1E + "Bungee\n", //GUN_STR_1F + "Camera\n", //GUN_STR_20 + "Circuit Board\n", //GUN_STR_21 + "Clipboard\n", //GUN_STR_22 + "Communicator\n", //GUN_STR_23 + "Controller\n", //GUN_STR_24 + "Cougar Magnum\n", //GUN_STR_25 + "Cougar\n", //GUN_STR_26 + "Credit Card\n", //GUN_STR_27 + "D5K (silenced)\n", //GUN_STR_28 + "D5K Deutsche\n", //GUN_STR_29 + "DD44 Dostovei\n", //GUN_STR_2A + "Dark Glasses\n", //GUN_STR_2B + "Dat Tape\n", //GUN_STR_2C + "Datathief\n", //GUN_STR_2D + "Detonator\n", //GUN_STR_2E + "Deutsche\n", //GUN_STR_2F + "Door Decoder\n", //GUN_STR_30 + "Door Exploder\n", //GUN_STR_31 + "Dostovei\n", //GUN_STR_32 + "Guidance Data\n", //GUN_STR_33 + "Flare Pistol\n", //GUN_STR_34 + "Gas Keyring\n", //GUN_STR_35 + "Geiger Counter\n", //GUN_STR_36 + "Gold Bar\n", //GUN_STR_37 + "Gold PP7\n", //GUN_STR_38 + "Golden Gun\n", //GUN_STR_39 + "GoldenEye Key\n", //GUN_STR_3A + "Golden\n", //GUN_STR_3B + "Grenade Launcher\n", //GUN_STR_3C + "Grenade\n", //GUN_STR_3D + "Hand Grenade\n", //GUN_STR_3E + "Heroine\n", //GUN_STR_3F + "Hunting Knife\n", //GUN_STR_40 + "Identifier\n", //GUN_STR_41 + "KF7 Soviet\n", //GUN_STR_42 + "Key Analyzer Case\n", //GUN_STR_43 + "Key Analyzer\n", //GUN_STR_44 + "Keycard\n", //GUN_STR_45 + "Knife\n", //GUN_STR_46 + "Laser\n", //GUN_STR_47 + "Launcher\n", //GUN_STR_48 + "Lectre\n", //GUN_STR_49 + "Lock Exploder\n", //GUN_STR_4A + "Magnet Repel\n", //GUN_STR_4B + "Magnum\n", //GUN_STR_4C + "Map\n", //GUN_STR_4D + "Micro Camera\n", //GUN_STR_4E + "Microcode\n", //GUN_STR_4F + "Microfilm\n", //GUN_STR_50 + "Military Laser\n", //GUN_STR_51 + "Military\n", //GUN_STR_52 + "Money\n", //GUN_STR_53 + "Null\n", //GUN_STR_54 + "PP7 (silenced)\n", //GUN_STR_55 + "PP7 Special Issue\n", //GUN_STR_56 + "PP7 Special\n", //GUN_STR_57 + "Phantom\n", //GUN_STR_58 + "Piton Gun\n", //GUN_STR_59 + "Plans\n", //GUN_STR_5A + "Plastique\n", //GUN_STR_5B + "Polarized Glasses\n", //GUN_STR_5C + "Proximity Mine\n", //GUN_STR_5D + "RC-P90\n", //GUN_STR_5E + "Red Dossier\n", //GUN_STR_5F + "Remote Mine\n", //GUN_STR_60 + "Rocket Launcher\n", //GUN_STR_61 + "Safecracker Case\n", //GUN_STR_62 + "Safecracker\n", //GUN_STR_63 + "Shotgun\n", //GUN_STR_64 + "Silver PP7\n", //GUN_STR_65 + "Sniper Rifle\n", //GUN_STR_66 + "Sniper\n", //GUN_STR_67 + "Soviet\n", //GUN_STR_68 + "Spool Tape\n", //GUN_STR_69 + "Spy File\n", //GUN_STR_6A + "Klobb\n", //GUN_STR_6B + "Staff List\n", //GUN_STR_6C + "Suit_lf_hand\n", //GUN_STR_6D + "Tank\n", //GUN_STR_6E + "Taser\n", //GUN_STR_6F + "Throwing Knife\n", //GUN_STR_70 + "Throwing\n", //GUN_STR_71 + "Timed Mine\n", //GUN_STR_72 + "Token\n", //GUN_STR_73 + "US AR33 Assault Rifle\n", //GUN_STR_74 + "US AR33\n", //GUN_STR_75 + "Unarmed\n", //GUN_STR_76 + "Video Tape\n", //GUN_STR_77 + "Watch Communicator\n", //GUN_STR_78 + "Watch Geiger Counter\n", //GUN_STR_79 + "Watch Identifier\n", //GUN_STR_7A + "Watch Laser\n", //GUN_STR_7B + "Watch Magnet Attract\n", //GUN_STR_7C + "Watch Magnet Repel\n", //GUN_STR_7D + "Watch Magnet\n", //GUN_STR_7E + "Watch\n", //GUN_STR_7F + "Weapon Case\n", //GUN_STR_80 + "Yale Key\n", //GUN_STR_81 + "ZMG (9mm)\n", //GUN_STR_82 + "\n", //GUN_STR_83 + "ar33\n", //GUN_STR_84 + "audio tape\n", //GUN_STR_85 + "auto shotgun\n", //GUN_STR_86 + "blackbox\n", //GUN_STR_87 + "blueprints\n", //GUN_STR_88 + "bolt key\n", //GUN_STR_89 + "bomb case\n", //GUN_STR_8A + "bomb defuser\n", //GUN_STR_8B + "briefcase\n", //GUN_STR_8C + "bug detector\n", //GUN_STR_8D + "bug\n", //GUN_STR_8E + "bungee\n", //GUN_STR_8F + "camera\n", //GUN_STR_90 + "circuit board\n", //GUN_STR_91 + "clipboard\n", //GUN_STR_92 + "cougar magnum\n", //GUN_STR_93 + "credit card\n", //GUN_STR_94 + "d5k (silenced)\n", //GUN_STR_95 + "d5k\n", //GUN_STR_96 + "dark glasses\n", //GUN_STR_97 + "dat tape\n", //GUN_STR_98 + "datathief\n", //GUN_STR_99 + "dd44\n", //GUN_STR_9A + "detonator\n", //GUN_STR_9B + "door decoder\n", //GUN_STR_9C + "door exploder\n", //GUN_STR_9D + "guidance data\n", //GUN_STR_9E + "flare pistol\n", //GUN_STR_9F + "gas keyring\n", //GUN_STR_A0 + "gold bar\n", //GUN_STR_A1 + "gold pp7\n", //GUN_STR_A2 + "golden gun\n", //GUN_STR_A3 + "goldeneye key\n", //GUN_STR_A4 + "grenade launcher\n", //GUN_STR_A5 + "grenade\n", //GUN_STR_A6 + "heroine\n", //GUN_STR_A7 + "hunting knife\n", //GUN_STR_A8 + "key analyzer\n", //GUN_STR_A9 + "keycard\n", //GUN_STR_AA + "kf7 soviet\n", //GUN_STR_AB + "laser\n", //GUN_STR_AC + "lectre\n", //GUN_STR_AD + "lock exploder\n", //GUN_STR_AE + "map\n", //GUN_STR_AF + "micro camera\n", //GUN_STR_B0 + "microcode\n", //GUN_STR_B1 + "microfilm\n", //GUN_STR_B2 + "money\n", //GUN_STR_B3 + "phantom\n", //GUN_STR_B4 + "piton gun\n", //GUN_STR_B5 + "plans\n", //GUN_STR_B6 + "plastique\n", //GUN_STR_B7 + "polarized glasses\n", //GUN_STR_B8 + "pp7 (silenced)\n", //GUN_STR_B9 + "pp7\n", //GUN_STR_BA + "proximity mine\n", //GUN_STR_BB + "rc-p90\n", //GUN_STR_BC + "red dossier\n", //GUN_STR_BD + "remote mine\n", //GUN_STR_BE + "rocket launcher\n", //GUN_STR_BF + "safecracker\n", //GUN_STR_C0 + "shotgun\n", //GUN_STR_C1 + "silver pp7\n", //GUN_STR_C2 + "sniper rifle\n", //GUN_STR_C3 + "spool tape\n", //GUN_STR_C4 + "spy file\n", //GUN_STR_C5 + "klobb\n", //GUN_STR_C6 + "staff list\n", //GUN_STR_C7 + "tank\n", //GUN_STR_C8 + "taser\n", //GUN_STR_C9 + "throwing knife\n", //GUN_STR_CA + "timed mine\n", //GUN_STR_CB + "token\n", //GUN_STR_CC + "unarmed\n", //GUN_STR_CD + "video tape\n", //GUN_STR_CE + "watch communicator\n", //GUN_STR_CF + "watch geiger counter\n", //GUN_STR_D0 + "watch identifier\n", //GUN_STR_D1 + "watch laser\n", //GUN_STR_D2 + "watch magnet attract\n", //GUN_STR_D3 + "watch magnet repel\n", //GUN_STR_D4 + "weapon case\n", //GUN_STR_D5 + "yale key\n", //GUN_STR_D6 + "zmg (9mm)\n", //GUN_STR_D7 + "Analyzing the GoldenEye key...\n", //GUN_STR_D8 + "You do not have the GoldenEye\n key.\n", //GUN_STR_D9 + "kill count", //GUN_STR_DA + "died once\n", //GUN_STR_DB + "died", //GUN_STR_DC + "times", //GUN_STR_DD + "suicide count", //GUN_STR_DE + 0 //GUN_STR_DF }; diff --git a/assets/obseg/text/LgunE.h b/assets/obseg/text/LgunE.h new file mode 100644 index 00000000..960cd792 --- /dev/null +++ b/assets/obseg/text/LgunE.h @@ -0,0 +1,227 @@ +enum LGUNE_STRINGS +{ + GUN_STR_00, // " D5K\n", + GUN_STR_01, // " Issue\n", + GUN_STR_02, // " Mine\n", + GUN_STR_03, // " PP7\n", + GUN_STR_04, // " DD44\n", + GUN_STR_05, // " Gun\n", + GUN_STR_06, // " Knife\n", + GUN_STR_07, // " Mine\n", + GUN_STR_08, // " KF7\n", + GUN_STR_09, // " Mine\n", + GUN_STR_0A, // " Rifle\n", + GUN_STR_0B, // " Rocket\n", + GUN_STR_0C, // " Shotgun\n", + GUN_STR_0D, // "(Proximity)\n", + GUN_STR_0E, // "(Remote)\n", + GUN_STR_0F, // "(Timed)\n", + GUN_STR_10, // "(silenced)\n", + GUN_STR_11, // "-\n", + GUN_STR_12, // "Assault\n", + GUN_STR_13, // "Attract\n", + GUN_STR_14, // "Audio Tape\n", + GUN_STR_15, // "Automatic Shotgun\n", + GUN_STR_16, // "Automatic\n", + GUN_STR_17, // "Blackbox\n", + GUN_STR_18, // "Blueprints\n", + GUN_STR_19, // "Bolt Key\n", + GUN_STR_1A, // "Bomb Case\n", + GUN_STR_1B, // "Bomb Defuser\n", + GUN_STR_1C, // "Briefcase\n", + GUN_STR_1D, // "Bug Detector\n", + GUN_STR_1E, // "Bug\n", + GUN_STR_1F, // "Bungee\n", + GUN_STR_20, // "Camera\n", + GUN_STR_21, // "Circuit Board\n", + GUN_STR_22, // "Clipboard\n", + GUN_STR_23, // "Communicator\n", + GUN_STR_24, // "Controller\n", + GUN_STR_25, // "Cougar Magnum\n", + GUN_STR_26, // "Cougar\n", + GUN_STR_27, // "Credit Card\n", + GUN_STR_28, // "D5K (silenced)\n", + GUN_STR_29, // "D5K Deutsche\n", + GUN_STR_2A, // "DD44 Dostovei\n", + GUN_STR_2B, // "Dark Glasses\n", + GUN_STR_2C, // "Dat Tape\n", + GUN_STR_2D, // "Datathief\n", + GUN_STR_2E, // "Detonator\n", + GUN_STR_2F, // "Deutsche\n", + GUN_STR_30, // "Door Decoder\n", + GUN_STR_31, // "Door Exploder\n", + GUN_STR_32, // "Dostovei\n", + GUN_STR_33, // "Guidance Data\n", + GUN_STR_34, // "Flare Pistol\n", + GUN_STR_35, // "Gas Keyring\n", + GUN_STR_36, // "Geiger Counter\n", + GUN_STR_37, // "Gold Bar\n", + GUN_STR_38, // "Gold PP7\n", + GUN_STR_39, // "Golden Gun\n", + GUN_STR_3A, // "GoldenEye Key\n", + GUN_STR_3B, // "Golden\n", + GUN_STR_3C, // "Grenade Launcher\n", + GUN_STR_3D, // "Grenade\n", + GUN_STR_3E, // "Hand Grenade\n", + GUN_STR_3F, // "Heroine\n", + GUN_STR_40, // "Hunting Knife\n", + GUN_STR_41, // "Identifier\n", + GUN_STR_42, // "KF7 Soviet\n", + GUN_STR_43, // "Key Analyzer Case\n", + GUN_STR_44, // "Key Analyzer\n", + GUN_STR_45, // "Keycard\n", + GUN_STR_46, // "Knife\n", + GUN_STR_47, // "Laser\n", + GUN_STR_48, // "Launcher\n", + GUN_STR_49, // "Lectre\n", + GUN_STR_4A, // "Lock Exploder\n", + GUN_STR_4B, // "Magnet Repel\n", + GUN_STR_4C, // "Magnum\n", + GUN_STR_4D, // "Map\n", + GUN_STR_4E, // "Micro Camera\n", + GUN_STR_4F, // "Microcode\n", + GUN_STR_50, // "Microfilm\n", + GUN_STR_51, // "Military Laser\n", + GUN_STR_52, // "Military\n", + GUN_STR_53, // "Money\n", + GUN_STR_54, // "Null\n", + GUN_STR_55, // "PP7 (silenced)\n", + GUN_STR_56, // "PP7 Special Issue\n", + GUN_STR_57, // "PP7 Special\n", + GUN_STR_58, // "Phantom\n", + GUN_STR_59, // "Piton Gun\n", + GUN_STR_5A, // "Plans\n", + GUN_STR_5B, // "Plastique\n", + GUN_STR_5C, // "Polarized Glasses\n", + GUN_STR_5D, // "Proximity Mine\n", + GUN_STR_5E, // "RC-P90\n", + GUN_STR_5F, // "Red Dossier\n", + GUN_STR_60, // "Remote Mine\n", + GUN_STR_61, // "Rocket Launcher\n", + GUN_STR_62, // "Safecracker Case\n", + GUN_STR_63, // "Safecracker\n", + GUN_STR_64, // "Shotgun\n", + GUN_STR_65, // "Silver PP7\n", + GUN_STR_66, // "Sniper Rifle\n", + GUN_STR_67, // "Sniper\n", + GUN_STR_68, // "Soviet\n", + GUN_STR_69, // "Spool Tape\n", + GUN_STR_6A, // "Spy File\n", + GUN_STR_6B, // "Klobb\n", + GUN_STR_6C, // "Staff List\n", + GUN_STR_6D, // "Suit_lf_hand\n", + GUN_STR_6E, // "Tank\n", + GUN_STR_6F, // "Taser\n", + GUN_STR_70, // "Throwing Knife\n", + GUN_STR_71, // "Throwing\n", + GUN_STR_72, // "Timed Mine\n", + GUN_STR_73, // "Token\n", + GUN_STR_74, // "US AR33 Assault Rifle\n", + GUN_STR_75, // "US AR33\n", + GUN_STR_76, // "Unarmed\n", + GUN_STR_77, // "Video Tape\n", + GUN_STR_78, // "Watch Communicator\n", + GUN_STR_79, // "Watch Geiger Counter\n", + GUN_STR_7A, // "Watch Identifier\n", + GUN_STR_7B, // "Watch Laser\n", + GUN_STR_7C, // "Watch Magnet Attract\n", + GUN_STR_7D, // "Watch Magnet Repel\n", + GUN_STR_7E, // "Watch Magnet\n", + GUN_STR_7F, // "Watch\n", + GUN_STR_80, // "Weapon Case\n", + GUN_STR_81, // "Yale Key\n", + GUN_STR_82, // "ZMG (9mm)\n", + GUN_STR_83, // "\n", + GUN_STR_84, // "ar33\n", + GUN_STR_85, // "audio tape\n", + GUN_STR_86, // "auto shotgun\n", + GUN_STR_87, // "blackbox\n", + GUN_STR_88, // "blueprints\n", + GUN_STR_89, // "bolt key\n", + GUN_STR_8A, // "bomb case\n", + GUN_STR_8B, // "bomb defuser\n", + GUN_STR_8C, // "briefcase\n", + GUN_STR_8D, // "bug detector\n", + GUN_STR_8E, // "bug\n", + GUN_STR_8F, // "bungee\n", + GUN_STR_90, // "camera\n", + GUN_STR_91, // "circuit board\n", + GUN_STR_92, // "clipboard\n", + GUN_STR_93, // "cougar magnum\n", + GUN_STR_94, // "credit card\n", + GUN_STR_95, // "d5k (silenced)\n", + GUN_STR_96, // "d5k\n", + GUN_STR_97, // "dark glasses\n", + GUN_STR_98, // "dat tape\n", + GUN_STR_99, // "datathief\n", + GUN_STR_9A, // "dd44\n", + GUN_STR_9B, // "detonator\n", + GUN_STR_9C, // "door decoder\n", + GUN_STR_9D, // "door exploder\n", + GUN_STR_9E, // "guidance data\n", + GUN_STR_9F, // "flare pistol\n", + GUN_STR_A0, // "gas keyring\n", + GUN_STR_A1, // "gold bar\n", + GUN_STR_A2, // "gold pp7\n", + GUN_STR_A3, // "golden gun\n", + GUN_STR_A4, // "goldeneye key\n", + GUN_STR_A5, // "grenade launcher\n", + GUN_STR_A6, // "grenade\n", + GUN_STR_A7, // "heroine\n", + GUN_STR_A8, // "hunting knife\n", + GUN_STR_A9, // "key analyzer\n", + GUN_STR_AA, // "keycard\n", + GUN_STR_AB, // "kf7 soviet\n", + GUN_STR_AC, // "laser\n", + GUN_STR_AD, // "lectre\n", + GUN_STR_AE, // "lock exploder\n", + GUN_STR_AF, // "map\n", + GUN_STR_B0, // "micro camera\n", + GUN_STR_B1, // "microcode\n", + GUN_STR_B2, // "microfilm\n", + GUN_STR_B3, // "money\n", + GUN_STR_B4, // "phantom\n", + GUN_STR_B5, // "piton gun\n", + GUN_STR_B6, // "plans\n", + GUN_STR_B7, // "plastique\n", + GUN_STR_B8, // "polarized glasses\n", + GUN_STR_B9, // "pp7 (silenced)\n", + GUN_STR_BA, // "pp7\n", + GUN_STR_BB, // "proximity mine\n", + GUN_STR_BC, // "rc-p90\n", + GUN_STR_BD, // "red dossier\n", + GUN_STR_BE, // "remote mine\n", + GUN_STR_BF, // "rocket launcher\n", + GUN_STR_C0, // "safecracker\n", + GUN_STR_C1, // "shotgun\n", + GUN_STR_C2, // "silver pp7\n", + GUN_STR_C3, // "sniper rifle\n", + GUN_STR_C4, // "spool tape\n", + GUN_STR_C5, // "spy file\n", + GUN_STR_C6, // "klobb\n", + GUN_STR_C7, // "staff list\n", + GUN_STR_C8, // "tank\n", + GUN_STR_C9, // "taser\n", + GUN_STR_CA, // "throwing knife\n", + GUN_STR_CB, // "timed mine\n", + GUN_STR_CC, // "token\n", + GUN_STR_CD, // "unarmed\n", + GUN_STR_CE, // "video tape\n", + GUN_STR_CF, // "watch communicator\n", + GUN_STR_D0, // "watch geiger counter\n", + GUN_STR_D1, // "watch identifier\n", + GUN_STR_D2, // "watch laser\n", + GUN_STR_D3, // "watch magnet attract\n", + GUN_STR_D4, // "watch magnet repel\n", + GUN_STR_D5, // "weapon case\n", + GUN_STR_D6, // "yale key\n", + GUN_STR_D7, // "zmg (9mm)\n", + GUN_STR_D8, // "Analyzing the GoldenEye key...\n", + GUN_STR_D9, // "You do not have the GoldenEye\n key.\n", + GUN_STR_DA, // "kill count", + GUN_STR_DB, // "died once\n", + GUN_STR_DC, // "died", + GUN_STR_DD, // "times", + GUN_STR_DE, // "suicide count", + GUN_STR_DF // 0 +}; diff --git a/assets/obseg/text/LmiscE.c b/assets/obseg/text/LmiscE.c index 3516c841..600029b0 100644 --- a/assets/obseg/text/LmiscE.c +++ b/assets/obseg/text/LmiscE.c @@ -1,74 +1,74 @@ char *LmiscE[] = { - "Invincible", - "All Guns", - "Super x2 Health", - "Super x2 Armor", - "Bond Invisible", - "Bond Phase", - "Infinite Ammo", - "DK Mode", - "Tiny Bond", - "Super x10 Health", - "Magnum", - "Laser", - "Golden Gun", - "Silver PP7", - "Gold PP7", - "invincibility on\n", - "all guns on\n", - "maximum ammo\n", - "super x2 health\n", - "super x2 armor\n", - "invisibility on\n", - "bond phase on\n", - "infinite ammo on\n", - "dk mode on\n", - "extra weapons\n", - "tiny bond on\n", - "paintball mode on\n", - "super x10 health\n", - "happy now karl?\n", - "fast mode on\n", - "invincibility off\n", - "all guns off\n", - "invisibility off\n", - "bond phase off\n", - "infinite ammo off\n", - "dk mode off\n", - "tiny bond off\n", - "paintball mode off\n", - "radar on\n", - "fast mode off\n", - "NO NAME", - "E R R O R\n", - "no briefing for this mission\n", - "\n", - "objective", - "completed\n", - "incomplete\n", - "failed\n", - "slowest motion\n", - "very slow motion\n", - "slow motion\n", - "normal motion\n", - "fast motion\n", - "very fast motion\n", - "fastest motion\n", - "Line Mode", - "Paintball Mode", - "Enemy Rockets", - "2x Rocket L.", - "2x Grenade L.", - "2x RC-P90", - "2x Throwing Knife", - "2x Hunting Knife", - "2x Laser", - "Turbo Mode", - "Fast Animation", - "Slow Animation", - "No Radar [Multi]" - #ifdef VERSION_JP - ,"One minute left" + "Invincible", //MISC_STR_00 + "All Guns", //MISC_STR_01 + "Super x2 Health", //MISC_STR_02 + "Super x2 Armor", //MISC_STR_03 + "Bond Invisible", //MISC_STR_04 + "Bond Phase", //MISC_STR_05 + "Infinite Ammo", //MISC_STR_06 + "DK Mode", //MISC_STR_07 + "Tiny Bond", //MISC_STR_08 + "Super x10 Health", //MISC_STR_09 + "Magnum", //MISC_STR_0A + "Laser", //MISC_STR_0B + "Golden Gun", //MISC_STR_0C + "Silver PP7", //MISC_STR_0D + "Gold PP7", //MISC_STR_0E + "invincibility on\n", //MISC_STR_0F + "all guns on\n", //MISC_STR_10 + "maximum ammo\n", //MISC_STR_11 + "super x2 health\n", //MISC_STR_12 + "super x2 armor\n", //MISC_STR_13 + "invisibility on\n", //MISC_STR_14 + "bond phase on\n", //MISC_STR_15 + "infinite ammo on\n", //MISC_STR_16 + "dk mode on\n", //MISC_STR_17 + "extra weapons\n", //MISC_STR_18 + "tiny bond on\n", //MISC_STR_19 + "paintball mode on\n", //MISC_STR_1A + "super x10 health\n", //MISC_STR_1B + "happy now karl?\n", //MISC_STR_1C + "fast mode on\n", //MISC_STR_1D + "invincibility off\n", //MISC_STR_1E + "all guns off\n", //MISC_STR_1F + "invisibility off\n", //MISC_STR_20 + "bond phase off\n", //MISC_STR_21 + "infinite ammo off\n", //MISC_STR_22 + "dk mode off\n", //MISC_STR_23 + "tiny bond off\n", //MISC_STR_24 + "paintball mode off\n", //MISC_STR_25 + "radar on\n", //MISC_STR_26 + "fast mode off\n", //MISC_STR_27 + "NO NAME", //MISC_STR_28 + "E R R O R\n", //MISC_STR_29 + "no briefing for this mission\n", //MISC_STR_2A + "\n", //MISC_STR_2B + "objective", //MISC_STR_2C + "completed\n", //MISC_STR_2D + "incomplete\n", //MISC_STR_2E + "failed\n", //MISC_STR_2F + "slowest motion\n", //MISC_STR_30 + "very slow motion\n", //MISC_STR_31 + "slow motion\n", //MISC_STR_32 + "normal motion\n", //MISC_STR_33 + "fast motion\n", //MISC_STR_34 + "very fast motion\n", //MISC_STR_35 + "fastest motion\n", //MISC_STR_36 + "Line Mode", //MISC_STR_37 + "Paintball Mode", //MISC_STR_38 + "Enemy Rockets", //MISC_STR_39 + "2x Rocket L.", //MISC_STR_3A + "2x Grenade L.", //MISC_STR_3B + "2x RC-P90", //MISC_STR_3C + "2x Throwing Knife", //MISC_STR_3D + "2x Hunting Knife", //MISC_STR_3E + "2x Laser", //MISC_STR_3F + "Turbo Mode", //MISC_STR_40 + "Fast Animation", //MISC_STR_41 + "Slow Animation", //MISC_STR_42 + "No Radar [Multi]" //MISC_STR_43 + #ifdef VERSION_JP + ,"One minute left" //MISC_STR_44 #endif }; diff --git a/assets/obseg/text/LmiscE.h b/assets/obseg/text/LmiscE.h new file mode 100644 index 00000000..49221a5a --- /dev/null +++ b/assets/obseg/text/LmiscE.h @@ -0,0 +1,75 @@ +enum LMISCE_STRINGS +{ + MISC_STR_00, // "Invincible", + MISC_STR_01, // "All Guns", + MISC_STR_02, // "Super x2 Health", + MISC_STR_03, // "Super x2 Armor", + MISC_STR_04, // "Bond Invisible", + MISC_STR_05, // "Bond Phase", + MISC_STR_06, // "Infinite Ammo", + MISC_STR_07, // "DK Mode", + MISC_STR_08, // "Tiny Bond", + MISC_STR_09, // "Super x10 Health", + MISC_STR_0A, // "Magnum", + MISC_STR_0B, // "Laser", + MISC_STR_0C, // "Golden Gun", + MISC_STR_0D, // "Silver PP7", + MISC_STR_0E, // "Gold PP7", + MISC_STR_0F, // "invincibility on\n", + MISC_STR_10, // "all guns on\n", + MISC_STR_11, // "maximum ammo\n", + MISC_STR_12, // "super x2 health\n", + MISC_STR_13, // "super x2 armor\n", + MISC_STR_14, // "invisibility on\n", + MISC_STR_15, // "bond phase on\n", + MISC_STR_16, // "infinite ammo on\n", + MISC_STR_17, // "dk mode on\n", + MISC_STR_18, // "extra weapons\n", + MISC_STR_19, // "tiny bond on\n", + MISC_STR_1A, // "paintball mode on\n", + MISC_STR_1B, // "super x10 health\n", + MISC_STR_1C, // "happy now karl?\n", + MISC_STR_1D, // "fast mode on\n", + MISC_STR_1E, // "invincibility off\n", + MISC_STR_1F, // "all guns off\n", + MISC_STR_20, // "invisibility off\n", + MISC_STR_21, // "bond phase off\n", + MISC_STR_22, // "infinite ammo off\n", + MISC_STR_23, // "dk mode off\n", + MISC_STR_24, // "tiny bond off\n", + MISC_STR_25, // "paintball mode off\n", + MISC_STR_26, // "radar on\n", + MISC_STR_27, // "fast mode off\n", + MISC_STR_28, // "NO NAME", + MISC_STR_29, // "E R R O R\n", + MISC_STR_2A, // "no briefing for this mission\n", + MISC_STR_2B, // "\n", + MISC_STR_2C, // "objective", + MISC_STR_2D, // "completed\n", + MISC_STR_2E, // "incomplete\n", + MISC_STR_2F, // "failed\n", + MISC_STR_30, // "slowest motion\n", + MISC_STR_31, // "very slow motion\n", + MISC_STR_32, // "slow motion\n", + MISC_STR_33, // "normal motion\n", + MISC_STR_34, // "fast motion\n", + MISC_STR_35, // "very fast motion\n", + MISC_STR_36, // "fastest motion\n", + MISC_STR_37, // "Line Mode", + MISC_STR_38, // "Paintball Mode", + MISC_STR_39, // "Enemy Rockets", + MISC_STR_3A, // "2x Rocket L.", + MISC_STR_3B, // "2x Grenade L.", + MISC_STR_3C, // "2x RC-P90", + MISC_STR_3D, // "2x Throwing Knife", + MISC_STR_3E, // "2x Hunting Knife", + MISC_STR_3F, // "2x Laser", + MISC_STR_40, // "Turbo Mode", + MISC_STR_41, // "Fast Animation", + MISC_STR_42, // "Slow Animation", + MISC_STR_43 // "No Radar [Multi]" + +#ifdef VERSION_JP + ,MISC_STR_44//,"One minute left" +#endif +}; diff --git a/assets/obseg/text/LmpmenuE.c b/assets/obseg/text/LmpmenuE.c index 1ddc7c1e..1d41495b 100644 --- a/assets/obseg/text/LmpmenuE.c +++ b/assets/obseg/text/LmpmenuE.c @@ -1,39 +1,39 @@ char *LmpmenuE[] = { - "Lemming Award", - "Where's the Ammo?", - "Where's the Armor?", - "AC -10 Award", - "Marksmanship Award", - "Most Professional", - "Most Deadly", - "Mostly Harmless", - "Most Cowardly", - "Most Frantic", - "Most Honorable", - "Most Dishonorable", - "Shortest Innings", - "Longest Innings", - "Double Kill", - "Triple Kill", - "Quad Kill (Doh!)", - "Rank: 1st", - "Rank: 2nd", - "Rank: 3rd", - "Rank: 4th", - "PLAY", - "GAME OVER", - "START TO EXIT", - "PAUSED", - "PAUSE", - "EXIT", - "SCORES", - "P", - "KILLS", - "LOSSES", - "Weapon of choice:", - "cancel", - "confirm", - "press start\n", - "to continue\n" + "Lemming Award", //MPMENU_STR_00 + "Where's the Ammo?", //MPMENU_STR_01 + "Where's the Armor?", //MPMENU_STR_02 + "AC -10 Award", //MPMENU_STR_03 + "Marksmanship Award", //MPMENU_STR_04 + "Most Professional", //MPMENU_STR_05 + "Most Deadly", //MPMENU_STR_06 + "Mostly Harmless", //MPMENU_STR_07 + "Most Cowardly", //MPMENU_STR_08 + "Most Frantic", //MPMENU_STR_09 + "Most Honorable", //MPMENU_STR_0A + "Most Dishonorable", //MPMENU_STR_0B + "Shortest Innings", //MPMENU_STR_0C + "Longest Innings", //MPMENU_STR_0D + "Double Kill", //MPMENU_STR_0E + "Triple Kill", //MPMENU_STR_0F + "Quad Kill (Doh!)", //MPMENU_STR_10 + "Rank: 1st", //MPMENU_STR_11 + "Rank: 2nd", //MPMENU_STR_12 + "Rank: 3rd", //MPMENU_STR_13 + "Rank: 4th", //MPMENU_STR_14 + "PLAY", //MPMENU_STR_15 + "GAME OVER", //MPMENU_STR_16 + "START TO EXIT", //MPMENU_STR_17 + "PAUSED", //MPMENU_STR_18 + "PAUSE", //MPMENU_STR_19 + "EXIT", //MPMENU_STR_1A + "SCORES", //MPMENU_STR_1B + "P", //MPMENU_STR_1C + "KILLS", //MPMENU_STR_1D + "LOSSES", //MPMENU_STR_1E + "Weapon of choice:", //MPMENU_STR_1F + "cancel", //MPMENU_STR_20 + "confirm", //MPMENU_STR_21 + "press start\n", //MPMENU_STR_22 + "to continue\n" //MPMENU_STR_23 }; diff --git a/assets/obseg/text/LmpmenuE.h b/assets/obseg/text/LmpmenuE.h new file mode 100644 index 00000000..8280651e --- /dev/null +++ b/assets/obseg/text/LmpmenuE.h @@ -0,0 +1,39 @@ +enum LMPMENUE_STRINGS +{ + MPMENU_STR_00, // "Lemming Award", + MPMENU_STR_01, // "Where's the Ammo?", + MPMENU_STR_02, // "Where's the Armor?", + MPMENU_STR_03, // "AC -10 Award", + MPMENU_STR_04, // "Marksmanship Award", + MPMENU_STR_05, // "Most Professional", + MPMENU_STR_06, // "Most Deadly", + MPMENU_STR_07, // "Mostly Harmless", + MPMENU_STR_08, // "Most Cowardly", + MPMENU_STR_09, // "Most Frantic", + MPMENU_STR_0A, // "Most Honorable", + MPMENU_STR_0B, // "Most Dishonorable", + MPMENU_STR_0C, // "Shortest Innings", + MPMENU_STR_0D, // "Longest Innings", + MPMENU_STR_0E, // "Double Kill", + MPMENU_STR_0F, // "Triple Kill", + MPMENU_STR_10, // "Quad Kill (Doh!)", + MPMENU_STR_11, // "Rank: 1st", + MPMENU_STR_12, // "Rank: 2nd", + MPMENU_STR_13, // "Rank: 3rd", + MPMENU_STR_14, // "Rank: 4th", + MPMENU_STR_15, // "PLAY", + MPMENU_STR_16, // "GAME OVER", + MPMENU_STR_17, // "START TO EXIT", + MPMENU_STR_18, // "PAUSED", + MPMENU_STR_19, // "PAUSE", + MPMENU_STR_1A, // "EXIT", + MPMENU_STR_1B, // "SCORES", + MPMENU_STR_1C, // "P", + MPMENU_STR_1D, // "KILLS", + MPMENU_STR_1E, // "LOSSES", + MPMENU_STR_1F, // "Weapon of choice:", + MPMENU_STR_20, // "cancel", + MPMENU_STR_21, // "confirm", + MPMENU_STR_22, // "press start\n", + MPMENU_STR_23, // "to continue\n" +}; diff --git a/assets/obseg/text/LmpweaponsE.c b/assets/obseg/text/LmpweaponsE.c index 2b256d1c..d3aeb070 100644 --- a/assets/obseg/text/LmpweaponsE.c +++ b/assets/obseg/text/LmpweaponsE.c @@ -1,19 +1,19 @@ char *LmpweaponsE[] = { - "Slappers only!", - "Pistols", - "Automatics", - "Power Weapons", - "Sniper Rifles", - "Grenades", - "Remote Mines", - "Grenade Launchers", - "Timed Mines", - "Proximity Mines", - "Rockets", - "Lasers", - "Golden Gun", - "Throwing Knives", - 0, - 0 + "Slappers only!", //MPWEAPON_STR_00 + "Pistols", //MPWEAPON_STR_01 + "Automatics", //MPWEAPON_STR_02 + "Power Weapons", //MPWEAPON_STR_03 + "Sniper Rifles", //MPWEAPON_STR_04 + "Grenades", //MPWEAPON_STR_05 + "Remote Mines", //MPWEAPON_STR_06 + "Grenade Launchers", //MPWEAPON_STR_07 + "Timed Mines", //MPWEAPON_STR_08 + "Proximity Mines", //MPWEAPON_STR_09 + "Rockets", //MPWEAPON_STR_0A + "Lasers", //MPWEAPON_STR_0B + "Golden Gun", //MPWEAPON_STR_0C + "Throwing Knives", //MPWEAPON_STR_0D + 0, //MPWEAPON_STR_0E + 0 //MPWEAPON_STR_0F }; diff --git a/assets/obseg/text/LmpweaponsE.h b/assets/obseg/text/LmpweaponsE.h new file mode 100644 index 00000000..054e4969 --- /dev/null +++ b/assets/obseg/text/LmpweaponsE.h @@ -0,0 +1,19 @@ +enum LMPWEAPONSE_STRINGS +{ + MPWEAPON_STR_00, // "Slappers only!", + MPWEAPON_STR_01, // "Pistols", + MPWEAPON_STR_02, // "Automatics", + MPWEAPON_STR_03, // "Power Weapons", + MPWEAPON_STR_04, // "Sniper Rifles", + MPWEAPON_STR_05, // "Grenades", + MPWEAPON_STR_06, // "Remote Mines", + MPWEAPON_STR_07, // "Grenade Launchers", + MPWEAPON_STR_08, // "Timed Mines", + MPWEAPON_STR_09, // "Proximity Mines", + MPWEAPON_STR_0A, // "Rockets", + MPWEAPON_STR_0B, // "Lasers", + MPWEAPON_STR_0C, // "Golden Gun", + MPWEAPON_STR_0D, // "Throwing Knives", + MPWEAPON_STR_0E, // 0, + MPWEAPON_STR_0F // 0 +}; diff --git a/assets/obseg/text/LoptionE.h b/assets/obseg/text/LoptionE.h new file mode 100644 index 00000000..aa85692f --- /dev/null +++ b/assets/obseg/text/LoptionE.h @@ -0,0 +1,67 @@ +enum LOPTIONE_STRINGS +{ + OPTION_STR_00, //"fire\n", + OPTION_STR_01, //"aim\n", + OPTION_STR_02, //"action\n", + OPTION_STR_03, //"weapon\n", + OPTION_STR_04, //"pause\n", + OPTION_STR_05, //"move\n", + OPTION_STR_06, //"look\n", + OPTION_STR_07, //"?\n", + OPTION_STR_08, //"move sight\n", + OPTION_STR_09, //"1.1 honey\n", + OPTION_STR_0A, //"1.2 solitaire\n", + OPTION_STR_0B, //"1.3 kissy\n", + OPTION_STR_0C, //"1.4 goodnight\n", + OPTION_STR_0D, //"2.1 plenty\n", + OPTION_STR_0E, //"2.2 galore\n", + OPTION_STR_0F, //"2.3 domino\n", + OPTION_STR_10, //"2.4 goodhead\n", + OPTION_STR_11, //"look up/down\n", + OPTION_STR_12, //"auto-aim\n", + OPTION_STR_13, //"look ahead\n", + OPTION_STR_14, //"aim control\n", + OPTION_STR_15, //"sight on-screen\n", + OPTION_STR_16, //"ammo on-screen\n", + OPTION_STR_17, //"screen\n", + OPTION_STR_18, //"ratio\n", + OPTION_STR_19, //"on\n", + OPTION_STR_1A, //"off\n", + OPTION_STR_1B, //"upright\n", + OPTION_STR_1C, //"reverse\n", + OPTION_STR_1D, //"toggle\n", + OPTION_STR_1E, //"hold\n", + OPTION_STR_1F, //"full\n", + OPTION_STR_20, //"wide\n", + OPTION_STR_21, //"cinema\n", + OPTION_STR_22, //"normal\n", + OPTION_STR_23, //"16:9\n", + OPTION_STR_24, //"abort:\n", + OPTION_STR_25, //"confirm\n", + OPTION_STR_26, //"cancel\n", + OPTION_STR_27, //"mission status:\n", + OPTION_STR_28, //"complete\n", + OPTION_STR_29, //"incomplete\n", + OPTION_STR_2A, //"Left Hand\n", + OPTION_STR_2B, //"q watch v2.01 beta\n", + OPTION_STR_2C, //"down\n", + OPTION_STR_2D, //"up\n", + OPTION_STR_2E, //"sidestep\n", + OPTION_STR_2F, //"sidestep\n", + OPTION_STR_30, //"forward\n", + OPTION_STR_31, //"back\n", + OPTION_STR_32, //"control style\n", + OPTION_STR_33, //"controller\n", + OPTION_STR_34, //"controllers\n", + OPTION_STR_35, //"music\n", + OPTION_STR_36, //"fx\n", + OPTION_STR_37, //"failed\n", + OPTION_STR_38, //"2. background\n", + OPTION_STR_39, //"3. M briefing\n", + OPTION_STR_3A, //"4. Q branch\n", + OPTION_STR_3B, //"5. moneypenny\n", + OPTION_STR_3C, //"1. mission objectives\n", + OPTION_STR_3D, //0, + OPTION_STR_3E, //0, + OPTION_STR_3F //0 +}; diff --git a/assets/obseg/text/LoptionsE.c b/assets/obseg/text/LoptionsE.c index d2da2cc1..f7d47f9d 100644 --- a/assets/obseg/text/LoptionsE.c +++ b/assets/obseg/text/LoptionsE.c @@ -1,67 +1,67 @@ char *LoptionsE[] = { - "fire\n", - "aim\n", - "action\n", - "weapon\n", - "pause\n", - "move\n", - "look\n", - "?\n", - "move sight\n", - "1.1 honey\n", - "1.2 solitaire\n", - "1.3 kissy\n", - "1.4 goodnight\n", - "2.1 plenty\n", - "2.2 galore\n", - "2.3 domino\n", - "2.4 goodhead\n", - "look up/down\n", - "auto-aim\n", - "look ahead\n", - "aim control\n", - "sight on-screen\n", - "ammo on-screen\n", - "screen\n", - "ratio\n", - "on\n", - "off\n", - "upright\n", - "reverse\n", - "toggle\n", - "hold\n", - "full\n", - "wide\n", - "cinema\n", - "normal\n", - "16:9\n", - "abort:\n", - "confirm\n", - "cancel\n", - "mission status:\n", - "complete\n", - "incomplete\n", - "Left Hand\n", - "q watch v2.01 beta\n", - "down\n", - "up\n", - "sidestep\n", - "sidestep\n", - "forward\n", - "back\n", - "control style\n", - "controller\n", - "controllers\n", - "music\n", - "fx\n", - "failed\n", - "2. background\n", - "3. M briefing\n", - "4. Q branch\n", - "5. moneypenny\n", - "1. mission objectives\n", - 0, - 0, - 0 + "fire\n", //OPTION_STR_00 + "aim\n", //OPTION_STR_01 + "action\n", //OPTION_STR_02 + "weapon\n", //OPTION_STR_03 + "pause\n", //OPTION_STR_04 + "move\n", //OPTION_STR_05 + "look\n", //OPTION_STR_06 + "?\n", //OPTION_STR_07 + "move sight\n", //OPTION_STR_08 + "1.1 honey\n", //OPTION_STR_09 + "1.2 solitaire\n", //OPTION_STR_0A + "1.3 kissy\n", //OPTION_STR_0B + "1.4 goodnight\n", //OPTION_STR_0C + "2.1 plenty\n", //OPTION_STR_0D + "2.2 galore\n", //OPTION_STR_0E + "2.3 domino\n", //OPTION_STR_0F + "2.4 goodhead\n", //OPTION_STR_10 + "look up/down\n", //OPTION_STR_11 + "auto-aim\n", //OPTION_STR_12 + "look ahead\n", //OPTION_STR_13 + "aim control\n", //OPTION_STR_14 + "sight on-screen\n", //OPTION_STR_15 + "ammo on-screen\n", //OPTION_STR_16 + "screen\n", //OPTION_STR_17 + "ratio\n", //OPTION_STR_18 + "on\n", //OPTION_STR_19 + "off\n", //OPTION_STR_1A + "upright\n", //OPTION_STR_1B + "reverse\n", //OPTION_STR_1C + "toggle\n", //OPTION_STR_1D + "hold\n", //OPTION_STR_1E + "full\n", //OPTION_STR_1F + "wide\n", //OPTION_STR_20 + "cinema\n", //OPTION_STR_21 + "normal\n", //OPTION_STR_22 + "16:9\n", //OPTION_STR_23 + "abort:\n", //OPTION_STR_24 + "confirm\n", //OPTION_STR_25 + "cancel\n", //OPTION_STR_26 + "mission status:\n", //OPTION_STR_27 + "complete\n", //OPTION_STR_28 + "incomplete\n", //OPTION_STR_29 + "Left Hand\n", //OPTION_STR_2A + "q watch v2.01 beta\n", //OPTION_STR_2B + "down\n", //OPTION_STR_2C + "up\n", //OPTION_STR_2D + "sidestep\n", //OPTION_STR_2E + "sidestep\n", //OPTION_STR_2F + "forward\n", //OPTION_STR_30 + "back\n", //OPTION_STR_31 + "control style\n", //OPTION_STR_32 + "controller\n", //OPTION_STR_33 + "controllers\n", //OPTION_STR_34 + "music\n", //OPTION_STR_35 + "fx\n", //OPTION_STR_36 + "failed\n", //OPTION_STR_37 + "2. background\n", //OPTION_STR_38 + "3. M briefing\n", //OPTION_STR_39 + "4. Q branch\n", //OPTION_STR_3A + "5. moneypenny\n", //OPTION_STR_3B + "1. mission objectives\n", //OPTION_STR_3C + 0, //OPTION_STR_3D + 0, //OPTION_STR_3E + 0 //OPTION_STR_3F }; diff --git a/assets/obseg/text/LpropobjE.c b/assets/obseg/text/LpropobjE.c index 63086742..85a489a6 100644 --- a/assets/obseg/text/LpropobjE.c +++ b/assets/obseg/text/LpropobjE.c @@ -1,71 +1,71 @@ char *LpropobjE[] = { - "Picked up ", - "some ", - "a ", - "an ", - "the ", - "ammo", - "shotgun cartridge", - "magnum bullet", - "golden bullet", - "hand grenade", - "grenade round", - "rocket", - "remote mine", - "proximity mine", - "timed mine", - "throwing ", - "knife", - "knives", - "s", - "dart", - "explosive pen", - "explosive case", - "flare", - "piton", - "of dynamite", - "stick ", - "sticks ", - "bug", - "micro camera", - "GoldenEye key", - "token", - "plastique", - "a hunting knife.\n", - "a PP7.\n", - "a silenced PP7.\n", - "a DD44 Dostovei.\n", - "a Klobb.\n", - "a KF7 Soviet.\n", - "a ZMG (9mm).\n", - "a D5K Deutsche.\n", - "a silenced D5K.\n", - "a Phantom.\n", - "an AR33 assault rifle.\n", - "an RC-P90.\n", - "a shotgun.\n", - "an automatic shotgun.\n", - "a sniper rifle.\n", - "a grenade launcher.\n", - "a rocket launcher.\n", - "a Cougar Magnum.\n", - "the Golden Gun.\n", - "a Moonraker laser.\n", - "a flare pistol.\n", - "a piton gun.\n", - "a silver PP7.\n", - "a gold PP7.\n", - "a keycard.\n", - "a yale key.\n", - "a bolt key.\n", - "a new weapon.\n", - "Picked up a key.\n", - "Picked up some body armor.\n", - "body armor.\n", - "Picked up something.\n", - "This door is locked.\n", - 0, - 0, - 0 + "Picked up ", //PROPOBJ_STR_00 + "some ", //PROPOBJ_STR_01 + "a ", //PROPOBJ_STR_02 + "an ", //PROPOBJ_STR_03 + "the ", //PROPOBJ_STR_04 + "ammo", //PROPOBJ_STR_05 + "shotgun cartridge", //PROPOBJ_STR_06 + "magnum bullet", //PROPOBJ_STR_07 + "golden bullet", //PROPOBJ_STR_08 + "hand grenade", //PROPOBJ_STR_09 + "grenade round", //PROPOBJ_STR_0A + "rocket", //PROPOBJ_STR_0B + "remote mine", //PROPOBJ_STR_0C + "proximity mine", //PROPOBJ_STR_0D + "timed mine", //PROPOBJ_STR_0E + "throwing ", //PROPOBJ_STR_0F + "knife", //PROPOBJ_STR_10 + "knives", //PROPOBJ_STR_11 + "s", //PROPOBJ_STR_12 + "dart", //PROPOBJ_STR_13 + "explosive pen", //PROPOBJ_STR_14 + "explosive case", //PROPOBJ_STR_15 + "flare", //PROPOBJ_STR_16 + "piton", //PROPOBJ_STR_17 + "of dynamite", //PROPOBJ_STR_18 + "stick ", //PROPOBJ_STR_19 + "sticks ", //PROPOBJ_STR_1A + "bug", //PROPOBJ_STR_1B + "micro camera", //PROPOBJ_STR_1C + "GoldenEye key", //PROPOBJ_STR_1D + "token", //PROPOBJ_STR_1E + "plastique", //PROPOBJ_STR_1F + "a hunting knife.\n", //PROPOBJ_STR_20 + "a PP7.\n", //PROPOBJ_STR_21 + "a silenced PP7.\n", //PROPOBJ_STR_22 + "a DD44 Dostovei.\n", //PROPOBJ_STR_23 + "a Klobb.\n", //PROPOBJ_STR_24 + "a KF7 Soviet.\n", //PROPOBJ_STR_25 + "a ZMG (9mm).\n", //PROPOBJ_STR_26 + "a D5K Deutsche.\n", //PROPOBJ_STR_27 + "a silenced D5K.\n", //PROPOBJ_STR_28 + "a Phantom.\n", //PROPOBJ_STR_29 + "an AR33 assault rifle.\n", //PROPOBJ_STR_2A + "an RC-P90.\n", //PROPOBJ_STR_2B + "a shotgun.\n", //PROPOBJ_STR_2C + "an automatic shotgun.\n", //PROPOBJ_STR_2D + "a sniper rifle.\n", //PROPOBJ_STR_2E + "a grenade launcher.\n", //PROPOBJ_STR_2F + "a rocket launcher.\n", //PROPOBJ_STR_30 + "a Cougar Magnum.\n", //PROPOBJ_STR_31 + "the Golden Gun.\n", //PROPOBJ_STR_32 + "a Moonraker laser.\n", //PROPOBJ_STR_33 + "a flare pistol.\n", //PROPOBJ_STR_34 + "a piton gun.\n", //PROPOBJ_STR_35 + "a silver PP7.\n", //PROPOBJ_STR_36 + "a gold PP7.\n", //PROPOBJ_STR_37 + "a keycard.\n", //PROPOBJ_STR_38 + "a yale key.\n", //PROPOBJ_STR_39 + "a bolt key.\n", //PROPOBJ_STR_3A + "a new weapon.\n", //PROPOBJ_STR_3B + "Picked up a key.\n", //PROPOBJ_STR_3C + "Picked up some body armor.\n", //PROPOBJ_STR_3D + "body armor.\n", //PROPOBJ_STR_3E + "Picked up something.\n", //PROPOBJ_STR_3F + "This door is locked.\n", //PROPOBJ_STR_40 + 0, //PROPOBJ_STR_41 + 0, //PROPOBJ_STR_42 + 0 //PROPOBJ_STR_43 }; diff --git a/assets/obseg/text/LpropobjE.h b/assets/obseg/text/LpropobjE.h new file mode 100644 index 00000000..5a320686 --- /dev/null +++ b/assets/obseg/text/LpropobjE.h @@ -0,0 +1,72 @@ +enum LPROPOBJE_STRINGS +{ + PROPOBJ_STR_00, // "Picked up ", + PROPOBJ_STR_01, // "some ", + PROPOBJ_STR_02, // "a ", + PROPOBJ_STR_03, // "an ", + PROPOBJ_STR_04, // "the ", + PROPOBJ_STR_05, // "ammo", + PROPOBJ_STR_06, // "shotgun cartridge", + PROPOBJ_STR_07, // "magnum bullet", + PROPOBJ_STR_08, // "golden bullet", + PROPOBJ_STR_09, // "hand grenade", + PROPOBJ_STR_0A, // "grenade round", + PROPOBJ_STR_0B, // "rocket", + PROPOBJ_STR_0C, // "remote mine", + PROPOBJ_STR_0D, // "proximity mine", + PROPOBJ_STR_0E, // "timed mine", + PROPOBJ_STR_0F, // "throwing ", + PROPOBJ_STR_10, // "knife", + PROPOBJ_STR_11, // "knives", + PROPOBJ_STR_12, // "s", + PROPOBJ_STR_13, // "dart", + PROPOBJ_STR_14, // "explosive pen", + PROPOBJ_STR_15, // "explosive case", + PROPOBJ_STR_16, // "flare", + PROPOBJ_STR_17, // "piton", + PROPOBJ_STR_18, // "of dynamite", + PROPOBJ_STR_19, // "stick ", + PROPOBJ_STR_1A, // "sticks ", + PROPOBJ_STR_1B, // "bug", + PROPOBJ_STR_1C, // "micro camera", + PROPOBJ_STR_1D, // "GoldenEye key", + PROPOBJ_STR_1E, // "token", + PROPOBJ_STR_1F, // "plastique", + PROPOBJ_STR_20, // "a hunting knife.\n", + PROPOBJ_STR_21, // "a PP7.\n", + PROPOBJ_STR_22, // "a silenced PP7.\n", + PROPOBJ_STR_23, // "a DD44 Dostovei.\n", + PROPOBJ_STR_24, // "a Klobb.\n", + PROPOBJ_STR_25, // "a KF7 Soviet.\n", + PROPOBJ_STR_26, // "a ZMG (9mm).\n", + PROPOBJ_STR_27, // "a D5K Deutsche.\n", + PROPOBJ_STR_28, // "a silenced D5K.\n", + PROPOBJ_STR_29, // "a Phantom.\n", + PROPOBJ_STR_2A, // "an AR33 assault rifle.\n", + PROPOBJ_STR_2B, // "an RC-P90.\n", + PROPOBJ_STR_2C, // "a shotgun.\n", + PROPOBJ_STR_2D, // "an automatic shotgun.\n", + PROPOBJ_STR_2E, // "a sniper rifle.\n", + PROPOBJ_STR_2F, // "a grenade launcher.\n", + PROPOBJ_STR_30, // "a rocket launcher.\n", + PROPOBJ_STR_31, // "a Cougar Magnum.\n", + PROPOBJ_STR_32, // "the Golden Gun.\n", + PROPOBJ_STR_33, // "a Moonraker laser.\n", + PROPOBJ_STR_34, // "a flare pistol.\n", + PROPOBJ_STR_35, // "a piton gun.\n", + PROPOBJ_STR_36, // "a silver PP7.\n", + PROPOBJ_STR_37, // "a gold PP7.\n", + PROPOBJ_STR_38, // "a keycard.\n", + PROPOBJ_STR_39, // "a yale key.\n", + PROPOBJ_STR_3A, // "a bolt key.\n", + PROPOBJ_STR_3B, // "a new weapon.\n", + PROPOBJ_STR_3C, // "Picked up a key.\n", + PROPOBJ_STR_3D, // "Picked up some body armor.\n", + PROPOBJ_STR_3E, // "body armor.\n", + PROPOBJ_STR_3F, // "Picked up something.\n", + PROPOBJ_STR_40, // "This door is locked.\n", + PROPOBJ_STR_41, // 0, + PROPOBJ_STR_42, // 0, + PROPOBJ_STR_43 // 0 +}; + diff --git a/assets/obseg/text/LtitleE.c b/assets/obseg/text/LtitleE.c index c98b25d5..02d996ca 100644 --- a/assets/obseg/text/LtitleE.c +++ b/assets/obseg/text/LtitleE.c @@ -1,310 +1,309 @@ - char *LtitleE[] = { - "hour", - "minute", - "second", - "s", - "START\n", - "NEXT\n", - "PREVIOUS\n", - "TWYCROSS BOARD OF GAME CLASSIFICATION\n", - "This is to certify\n", - "(c) 1997 Nintendo/Rare\n", - "(c) 1962, 1995 Danjaq, LLC. &\n", - "U.A.C. All Rights Reserved\n", - "(c) 1997 Eon Productions\n", - "Ltd. & Mac B. Inc.\n", - "Suitable only for 1-4 persons\n", - "PRESIDENT\n", - "VICE\n", - "James Bond theme by Monty Norman.\n", - "Used by permission of EMI Unart Catalog Inc.\n", - "Agent", - "Secret Agent", - "00 Agent", - "007", - "Erase file?\n", - "cancel\n", - "confirm\n", - "Mission ", - "Copy\n", - "Erase\n", - "SELECT MISSION\n", - "MULTIPLAYER\n", - "CHEAT OPTIONS\n", - ": James Bond\n", - "Mission ", - "Part ", - "DIFFICULTY:\n", - "Agent\n", - "Secret Agent\n", - "00 Agent\n", - "007\n", - "SPECIAL OPTIONS:\n", - "Enemy reaction speed\n", - "Enemy health\n", - "Enemy damage\n", - "Enemy accuracy\n", - "Unlimited", - "5 Minutes", - "10 Minutes", - "20 Minutes", - "First to 5 points", - "First to 10 points", - "First to 20 points", - "Last person alive wins", - "Normal", - "You Only Live Twice", - "The Living Daylights [Flag Tag]", - "The Man With the Golden Gun", - "License to Kill", - "Team: 2 vs 2", - "Team: 3 vs 1", - "Team: 2 vs 1", - "Health -10\n(Hero)", - "Health -4\n(Veteran)", - "Health -3\n(Veteran)", - "Health -2\n(Veteran)", - "Health -1\n(Veteran)", - "Health +0\n(Normal)", - "Health +1\n(Novice)", - "Health +2\n(Novice)", - "Health +3\n(Novice)", - "Health +4\n(Novice)", - "Health +10\n(Rookie)", - "Sight OFF, Auto Aim OFF", - "Sight ON, Auto Aim OFF", - "Sight OFF, Auto Aim ON", - "Sight ON, Auto Aim ON", - "MULTIPLAYER OPTIONS:\n", - "Players:\n", - "Scenario:\n", - "Level:\n", - "Game Length:\n", - "Weapons:\n", - "Characters\n", - "Health\n", - "Aim:\n", - "Select Character", - "Select Handicap:", - "SCENARIO:\n", - "Select Teams", - "Red Team", - "Blue Team", - "Completed\n", - "FAILED\n", - "PRIMARY OBJECTIVES:\n", - "BACKGROUND:\n", - "M BRIEFING:\n", - "Q BRANCH:\n", - "MONEYPENNY:\n", - "REPORT:\n", - "Mission status:\n", - " KILLED IN ACTION\n", - " ABORTED\n", - " Completed\n", - " FAILED\n", - "STATISTICS:\n", - "Time:\n", - "Accuracy:\n", - "Weapon of choice:\n", - "Shot total:\n", - "Head hits:\n", - "Body hits:\n", - "Limb hits:\n", - "Others:\n", - "Kill total:\n", - "CHEAT OPTIONS:\n", - "ON\n", - "OFF\n", - "CHEAT SELECT MISSION", - "NO CONTROLLER IN CONTROLLER SOCKET 1", - "PLEASE POWER OFF AND ATTACH A CONTROLLER", - "Arkangelsk", - "Dam", - "Facility", - "Runway", - "Severnaya", - "Surface", - "Bunker", - "Kirghizstan", - "Launch Silo #4", - "Silo", - "Monte Carlo", - "Frigate", - "St. Petersburg", - "Statue Park", - "Statue", - "Military Archives", - "Archives", - "Streets", - "Depot", - "Train", - "Cuba", - "Jungle", - "Control Center", - "Control", - "Water Caverns", - "Caverns", - "Antenna Cradle", - "Cradle", - "Teotihuaca'n", - "Aztec Complex", - "Aztec", - "el-Saghira", - "Egyptian Temple", - "Egyptian", - "Random", - "RANDOM", - "Temple", - "TEMPLE", - "Complex", - "COMPLEX", - "Library", - "LIBRARY", - "Caves", - "CAVES", - "Facility", - "FACILITY", - "Severnaya Bunker", - "BUNKER", - "Military Archives", - "ARCHIVES", - "Water Caverns", - "CAVERNS", - "Egyptian Temple", - "EGYPTIAN", - "Citadel", - "CITADEL", - "dest", - "dest", - "stat", - "stat", - "crad", - "cradle", - "azt", - "azt", - "Bond", - "Mishkin", - "Boris", - "Ourumov", - "Trevelyan", - "Valentin", - "Xenia", - "Natalya", - "Baron Samedi", - "Jaws", - "Mayday", - "Oddjob", - "Rosika", - "Karl", - "Martin", - "Mark", - "Dave", - "Duncan", - "B", - "Steve E", - "Grant", - "Graeme", - "Ken", - "Alan", - "Pete", - "Shaun", - "Dwayne", - "Des", - "Chris", - "Lee", - "Neil", - "Jim", - "Robin", - "Steve H", - "Terrorist", - "Biker", - "Joel", - "Scott", - "Joe", - "Sally", - "Marion", - "Mandy", - "Vivien", - "\n", - "The Actors\n", - "Starring\n", - "Also Featuring\n", - "Guest Star\n", - "007\n", - "James Bond", - "Natalya Simonova\n", - "006\n", - "Alec Trevelyan\n", - "Janus Operative\n", - "Xenia Onatopp\n", - "General\n", - "Arkady Ourumov\n", - "Boris Grishenko\n", - "Ex KGB Agent\n", - "Valentin Zukovsky\n", - "Defense Minister\n", - "Dimitri Mishkin\n", - "Mayday\n", - "Jaws\n", - "Oddjob\n", - "Baron Samedi\n", - "Jungle Commando\n", - "St. Petersburg Guard\n", - "Russian Infantry\n", - "Russian Soldier\n", - "Janus Marine\n", - "Janus Special Forces\n", - "Russian Commandant\n", - "Naval Officer\n", - "Siberian Guard\n", - "Arctic Commando\n", - "Siberian Special Forces\n", - "Moonraker Elite\n", - "Helicopter Pilot\n", - "Scientist\n", - "Civilian\n", - "1.\n", - "2.\n", - "3.\n", - "4.\n", - "Basement", - "BASEMENT", - "Stack", - "STACK", - "Best Time:", - "Target:", - "New Cheat Available", - "CHEAT MULTIPLAYER\n", - "1.1 Honey\n", - "1.2 Solitaire\n", - "1.3 Kissy\n", - "1.4 Goodnight\n", - "2.1 Plenty\n", - "2.2 Galore\n", - "2.3 Domino\n", - "2.4 Goodhead\n", - "Select Control Style\n", - "Control Style\n", - #ifdef LANG_US - 0 + "hour", //TITLE_STR_0 + "minute", //TITLE_STR_1 + "second", //TITLE_STR_2 + "s", //TITLE_STR_3 + "START\n", //TITLE_STR_04 + "NEXT\n", //TITLE_STR_05 + "PREVIOUS\n", //TITLE_STR_06 + "TWYCROSS BOARD OF GAME CLASSIFICATION\n", //TITLE_STR_07 + "This is to certify\n", //TITLE_STR_08 + "(c) 1997 Nintendo/Rare\n", //TITLE_STR_09 + "(c) 1962, 1995 Danjaq, LLC. &\n", //TITLE_STR_10 + "U.A.C. All Rights Reserved\n", //TITLE_STR_11 + "(c) 1997 Eon Productions\n", //TITLE_STR_12 + "Ltd. & Mac B. Inc.\n", //TITLE_STR_13 + "Suitable only for 1-4 persons\n", //TITLE_STR_14 + "PRESIDENT\n", //TITLE_STR_15 + "VICE\n", //TITLE_STR_16 + "James Bond theme by Monty Norman.\n", //TITLE_STR_17 + "Used by permission of EMI Unart Catalog Inc.\n", //TITLE_STR_18 + "Agent", //TITLE_STR_19 + "Secret Agent", //TITLE_STR_20 + "00 Agent", //TITLE_STR_21 + "007", //TITLE_STR_22 + "Erase file?\n", //TITLE_STR_23 + "cancel\n", //TITLE_STR_24 + "confirm\n", //TITLE_STR_25 + "Mission ", //TITLE_STR_26 + "Copy\n", //TITLE_STR_27 + "Erase\n", //TITLE_STR_28 + "SELECT MISSION\n", //TITLE_STR_29 + "MULTIPLAYER\n", //TITLE_STR_30 + "CHEAT OPTIONS\n", //TITLE_STR_31 + ": James Bond\n", //TITLE_STR_32 + "Mission ", //TITLE_STR_33 + "Part ", //TITLE_STR_34 + "DIFFICULTY:\n", //TITLE_STR_35 + "Agent\n", //TITLE_STR_36 + "Secret Agent\n", //TITLE_STR_37 + "00 Agent\n", //TITLE_STR_38 + "007\n", //TITLE_STR_39 + "SPECIAL OPTIONS:\n", //TITLE_STR_40 + "Enemy reaction speed\n", //TITLE_STR_41 + "Enemy health\n", //TITLE_STR_42 + "Enemy damage\n", //TITLE_STR_43 + "Enemy accuracy\n", //TITLE_STR_44 + "Unlimited", //TITLE_STR_45 + "5 Minutes", //TITLE_STR_46 + "10 Minutes", //TITLE_STR_47 + "20 Minutes", //TITLE_STR_48 + "First to 5 points", //TITLE_STR_49 + "First to 10 points", //TITLE_STR_50 + "First to 20 points", //TITLE_STR_51 + "Last person alive wins", //TITLE_STR_52 + "Normal", //TITLE_STR_53 + "You Only Live Twice", //TITLE_STR_54 + "The Living Daylights [Flag Tag]", //TITLE_STR_55 + "The Man With the Golden Gun", //TITLE_STR_56 + "License to Kill", //TITLE_STR_57 + "Team: 2 vs 2", //TITLE_STR_58 + "Team: 3 vs 1", //TITLE_STR_59 + "Team: 2 vs 1", //TITLE_STR_60 + "Health -10\n(Hero)", //TITLE_STR_61 + "Health -4\n(Veteran)", //TITLE_STR_62 + "Health -3\n(Veteran)", //TITLE_STR_63 + "Health -2\n(Veteran)", //TITLE_STR_64 + "Health -1\n(Veteran)", //TITLE_STR_65 + "Health +0\n(Normal)", //TITLE_STR_66 + "Health +1\n(Novice)", //TITLE_STR_67 + "Health +2\n(Novice)", //TITLE_STR_68 + "Health +3\n(Novice)", //TITLE_STR_69 + "Health +4\n(Novice)", //TITLE_STR_70 + "Health +10\n(Rookie)", //TITLE_STR_71 + "Sight OFF, Auto Aim OFF", //TITLE_STR_72 + "Sight ON, Auto Aim OFF", //TITLE_STR_73 + "Sight OFF, Auto Aim ON", //TITLE_STR_74 + "Sight ON, Auto Aim ON", //TITLE_STR_75 + "MULTIPLAYER OPTIONS:\n", //TITLE_STR_76 + "Players:\n", //TITLE_STR_77 + "Scenario:\n", //TITLE_STR_78 + "Level:\n", //TITLE_STR_79 + "Game Length:\n", //TITLE_STR_80 + "Weapons:\n", //TITLE_STR_81 + "Characters\n", //TITLE_STR_82 + "Health\n", //TITLE_STR_83 + "Aim:\n", //TITLE_STR_84 + "Select Character", //TITLE_STR_85 + "Select Handicap:", //TITLE_STR_86 + "SCENARIO:\n", //TITLE_STR_87 + "Select Teams", //TITLE_STR_88 + "Red Team", //TITLE_STR_89 + "Blue Team", //TITLE_STR_90 + "Completed\n", //TITLE_STR_91 + "FAILED\n", //TITLE_STR_92 + "PRIMARY OBJECTIVES:\n", //TITLE_STR_93 + "BACKGROUND:\n", //TITLE_STR_94 + "M BRIEFING:\n", //TITLE_STR_95 + "Q BRANCH:\n", //TITLE_STR_96 + "MONEYPENNY:\n", //TITLE_STR_97 + "REPORT:\n", //TITLE_STR_98 + "Mission status:\n", //TITLE_STR_99 + " KILLED IN ACTION\n", //TITLE_STR_100 + " ABORTED\n", //TITLE_STR_101 + " Completed\n", //TITLE_STR_102 + " FAILED\n", //TITLE_STR_103 + "STATISTICS:\n", //TITLE_STR_104 + "Time:\n", //TITLE_STR_105 + "Accuracy:\n", //TITLE_STR_106 + "Weapon of choice:\n", //TITLE_STR_107 + "Shot total:\n", //TITLE_STR_108 + "Head hits:\n", //TITLE_STR_109 + "Body hits:\n", //TITLE_STR_110 + "Limb hits:\n", //TITLE_STR_111 + "Others:\n", //TITLE_STR_112 + "Kill total:\n", //TITLE_STR_113 + "CHEAT OPTIONS:\n", //TITLE_STR_114 + "ON\n", //TITLE_STR_115 + "OFF\n", //TITLE_STR_116 + "CHEAT SELECT MISSION", //TITLE_STR_117 + "NO CONTROLLER IN CONTROLLER SOCKET 1", //TITLE_STR_118 + "PLEASE POWER OFF AND ATTACH A CONTROLLER", //TITLE_STR_119 + "Arkangelsk", //TITLE_STR_120 + "Dam", //TITLE_STR_121 + "Facility", //TITLE_STR_122 + "Runway", //TITLE_STR_123 + "Severnaya", //TITLE_STR_124 + "Surface", //TITLE_STR_125 + "Bunker", //TITLE_STR_126 + "Kirghizstan", //TITLE_STR_127 + "Launch Silo #4", //TITLE_STR_128 + "Silo", //TITLE_STR_129 + "Monte Carlo", //TITLE_STR_130 + "Frigate", //TITLE_STR_131 + "St. Petersburg", //TITLE_STR_132 + "Statue Park", //TITLE_STR_133 + "Statue", //TITLE_STR_134 + "Military Archives", //TITLE_STR_135 + "Archives", //TITLE_STR_136 + "Streets", //TITLE_STR_137 + "Depot", //TITLE_STR_138 + "Train", //TITLE_STR_139 + "Cuba", //TITLE_STR_140 + "Jungle", //TITLE_STR_141 + "Control Center", //TITLE_STR_142 + "Control", //TITLE_STR_143 + "Water Caverns", //TITLE_STR_144 + "Caverns", //TITLE_STR_145 + "Antenna Cradle", //TITLE_STR_146 + "Cradle", //TITLE_STR_147 + "Teotihuaca'n", //TITLE_STR_148 + "Aztec Complex", //TITLE_STR_149 + "Aztec", //TITLE_STR_150 + "el-Saghira", //TITLE_STR_151 + "Egyptian Temple", //TITLE_STR_152 + "Egyptian", //TITLE_STR_153 + "Random", //TITLE_STR_154 + "RANDOM", //TITLE_STR_155 + "Temple", //TITLE_STR_156 + "TEMPLE", //TITLE_STR_157 + "Complex", //TITLE_STR_158 + "COMPLEX", //TITLE_STR_159 + "Library", //TITLE_STR_160 + "LIBRARY", //TITLE_STR_161 + "Caves", //TITLE_STR_162 + "CAVES", //TITLE_STR_163 + "Facility", //TITLE_STR_164 + "FACILITY", //TITLE_STR_165 + "Severnaya Bunker", //TITLE_STR_166 + "BUNKER", //TITLE_STR_167 + "Military Archives", //TITLE_STR_168 + "ARCHIVES", //TITLE_STR_169 + "Water Caverns", //TITLE_STR_170 + "CAVERNS", //TITLE_STR_171 + "Egyptian Temple", //TITLE_STR_172 + "EGYPTIAN", //TITLE_STR_173 + "Citadel", //TITLE_STR_174 + "CITADEL", //TITLE_STR_175 + "dest", //TITLE_STR_176 + "dest", //TITLE_STR_177 + "stat", //TITLE_STR_178 + "stat", //TITLE_STR_179 + "crad", //TITLE_STR_180 + "cradle", //TITLE_STR_181 + "azt", //TITLE_STR_182 + "azt", //TITLE_STR_183 + "Bond", //TITLE_STR_184 + "Mishkin", //TITLE_STR_185 + "Boris", //TITLE_STR_186 + "Ourumov", //TITLE_STR_187 + "Trevelyan", //TITLE_STR_188 + "Valentin", //TITLE_STR_189 + "Xenia", //TITLE_STR_190 + "Natalya", //TITLE_STR_191 + "Baron Samedi", //TITLE_STR_192 + "Jaws", //TITLE_STR_193 + "Mayday", //TITLE_STR_194 + "Oddjob", //TITLE_STR_195 + "Rosika", //TITLE_STR_196 + "Karl", //TITLE_STR_197 + "Martin", //TITLE_STR_198 + "Mark", //TITLE_STR_199 + "Dave", //TITLE_STR_200 + "Duncan", //TITLE_STR_201 + "B", //TITLE_STR_202 + "Steve E", //TITLE_STR_203 + "Grant", //TITLE_STR_204 + "Graeme", //TITLE_STR_205 + "Ken", //TITLE_STR_206 + "Alan", //TITLE_STR_207 + "Pete", //TITLE_STR_208 + "Shaun", //TITLE_STR_209 + "Dwayne", //TITLE_STR_210 + "Des", //TITLE_STR_211 + "Chris", //TITLE_STR_212 + "Lee", //TITLE_STR_213 + "Neil", //TITLE_STR_214 + "Jim", //TITLE_STR_215 + "Robin", //TITLE_STR_216 + "Steve H", //TITLE_STR_217 + "Terrorist", //TITLE_STR_218 + "Biker", //TITLE_STR_219 + "Joel", //TITLE_STR_220 + "Scott", //TITLE_STR_221 + "Joe", //TITLE_STR_222 + "Sally", //TITLE_STR_223 + "Marion", //TITLE_STR_224 + "Mandy", //TITLE_STR_225 + "Vivien", //TITLE_STR_226 + "\n", //TITLE_STR_227 + "The Actors\n", //TITLE_STR_228 + "Starring\n", //TITLE_STR_229 + "Also Featuring\n", //TITLE_STR_230 + "Guest Star\n", //TITLE_STR_231 + "007\n", //TITLE_STR_232 + "James Bond", //TITLE_STR_233 + "Natalya Simonova\n", //TITLE_STR_234 + "006\n", //TITLE_STR_235 + "Alec Trevelyan\n", //TITLE_STR_236 + "Janus Operative\n", //TITLE_STR_237 + "Xenia Onatopp\n", //TITLE_STR_238 + "General\n", //TITLE_STR_239 + "Arkady Ourumov\n", //TITLE_STR_240 + "Boris Grishenko\n", //TITLE_STR_241 + "Ex KGB Agent\n", //TITLE_STR_242 + "Valentin Zukovsky\n", //TITLE_STR_243 + "Defense Minister\n", //TITLE_STR_244 + "Dimitri Mishkin\n", //TITLE_STR_245 + "Mayday\n", //TITLE_STR_246 + "Jaws\n", //TITLE_STR_247 + "Oddjob\n", //TITLE_STR_248 + "Baron Samedi\n", //TITLE_STR_249 + "Jungle Commando\n", //TITLE_STR_250 + "St. Petersburg Guard\n", //TITLE_STR_251 + "Russian Infantry\n", //TITLE_STR_252 + "Russian Soldier\n", //TITLE_STR_253 + "Janus Marine\n", //TITLE_STR_254 + "Janus Special Forces\n", //TITLE_STR_255 + "Russian Commandant\n", //TITLE_STR_256 + "Naval Officer\n", //TITLE_STR_257 + "Siberian Guard\n", //TITLE_STR_258 + "Arctic Commando\n", //TITLE_STR_259 + "Siberian Special Forces\n", //TITLE_STR_260 + "Moonraker Elite\n", //TITLE_STR_261 + "Helicopter Pilot\n", //TITLE_STR_262 + "Scientist\n", //TITLE_STR_263 + "Civilian\n", //TITLE_STR_264 + "1.\n", //TITLE_STR_265 + "2.\n", //TITLE_STR_266 + "3.\n", //TITLE_STR_267 + "4.\n", //TITLE_STR_268 + "Basement", //TITLE_STR_269 + "BASEMENT", //TITLE_STR_270 + "Stack", //TITLE_STR_271 + "STACK", //TITLE_STR_272 + "Best Time:", //TITLE_STR_273 + "Target:", //TITLE_STR_274 + "New Cheat Available", //TITLE_STR_275 + "CHEAT MULTIPLAYER\n", //TITLE_STR_276 + "1.1 Honey\n", //TITLE_STR_277 + "1.2 Solitaire\n", //TITLE_STR_278 + "1.3 Kissy\n", //TITLE_STR_279 + "1.4 Goodnight\n", //TITLE_STR_280 + "2.1 Plenty\n", //TITLE_STR_281 + "2.2 Galore\n", //TITLE_STR_282 + "2.3 Domino\n", //TITLE_STR_283 + "2.4 Goodhead\n", //TITLE_STR_284 + "Select Control Style\n", //TITLE_STR_285 + "Control Style\n", //TITLE_STR_286 + #ifdef LANG_US + 0 //TITLE_STR_287 #endif #ifdef LANG_JP - "Russian Soldier\n", - "Russian Infantry\n", - "Scientist\n", - "Russian Commandant\n", - "Janus Marine\n", - "Naval Officer\n", - "Helicopter Pilot\n", - "St. Petersburg Guard\n", - "Civilian\n", - "Siberian Guard\n", - "Arctic Commando\n", - "Siberian Special Forces\n", - "Jungle Commando\n", - "Janus Special Forces\n", - "Moonraker Elite\n" + "Russian Soldier\n", //TITLE_STR_287 + "Russian Infantry\n", //TITLE_STR_288 + "Scientist\n", //TITLE_STR_289 + "Russian Commandant\n", //TITLE_STR_290 + "Janus Marine\n", //TITLE_STR_291 + "Naval Officer\n", //TITLE_STR_292 + "Helicopter Pilot\n", //TITLE_STR_293 + "St. Petersburg Guard\n", //TITLE_STR_294 + "Civilian\n", //TITLE_STR_295 + "Siberian Guard\n", //TITLE_STR_296 + "Arctic Commando\n", //TITLE_STR_297 + "Siberian Special Forces\n", //TITLE_STR_298 + "Jungle Commando\n", //TITLE_STR_299 + "Janus Special Forces\n", //TITLE_STR_300 + "Moonraker Elite\n" //TITLE_STR_301 #endif }; diff --git a/assets/obseg/text/LtitleE.h b/assets/obseg/text/LtitleE.h new file mode 100644 index 00000000..71d70b6b --- /dev/null +++ b/assets/obseg/text/LtitleE.h @@ -0,0 +1,310 @@ +typedef enum LTITLE_STRINGS +{ + TITLE_STR_00, + TITLE_STR_01, + TITLE_STR_02, + TITLE_STR_03, + TITLE_STR_04, + TITLE_STR_05, + TITLE_STR_06, + TITLE_STR_07, + TITLE_STR_08, + TITLE_STR_09, + TITLE_STR_10, + TITLE_STR_11, + TITLE_STR_12, + TITLE_STR_13, + TITLE_STR_14, + TITLE_STR_15, + TITLE_STR_16, + TITLE_STR_17, + TITLE_STR_18, + TITLE_STR_19, + TITLE_STR_20, + TITLE_STR_21, + TITLE_STR_22, + TITLE_STR_23, + TITLE_STR_24, + TITLE_STR_25, + TITLE_STR_26, + TITLE_STR_27, + TITLE_STR_28, + TITLE_STR_29, + TITLE_STR_30, + TITLE_STR_31, + TITLE_STR_32, + TITLE_STR_33, + TITLE_STR_34, + TITLE_STR_35, + TITLE_STR_36, + TITLE_STR_37, + TITLE_STR_38, + TITLE_STR_39, + TITLE_STR_40, + TITLE_STR_41, + TITLE_STR_42, + TITLE_STR_43, + TITLE_STR_44, + TITLE_STR_45, + TITLE_STR_46, + TITLE_STR_47, + TITLE_STR_48, + TITLE_STR_49, + TITLE_STR_50, + TITLE_STR_51, + TITLE_STR_52, + TITLE_STR_53, + TITLE_STR_54, + TITLE_STR_55, + TITLE_STR_56, + TITLE_STR_57, + TITLE_STR_58, + TITLE_STR_59, + TITLE_STR_60, + TITLE_STR_61, + TITLE_STR_62, + TITLE_STR_63, + TITLE_STR_64, + TITLE_STR_65, + TITLE_STR_66, + TITLE_STR_67, + TITLE_STR_68, + TITLE_STR_69, + TITLE_STR_70, + TITLE_STR_71, + TITLE_STR_72, + TITLE_STR_73, + TITLE_STR_74, + TITLE_STR_75, + TITLE_STR_76, + TITLE_STR_77, + TITLE_STR_78, + TITLE_STR_79, + TITLE_STR_80, + TITLE_STR_81, + TITLE_STR_82, + TITLE_STR_83, + TITLE_STR_84, + TITLE_STR_85, + TITLE_STR_86, + TITLE_STR_87, + TITLE_STR_88, + TITLE_STR_89, + TITLE_STR_90, + TITLE_STR_91, + TITLE_STR_92, + TITLE_STR_93, + TITLE_STR_94, + TITLE_STR_95, + TITLE_STR_96, + TITLE_STR_97, + TITLE_STR_98, + TITLE_STR_99, + TITLE_STR_100, + TITLE_STR_101, + TITLE_STR_102, + TITLE_STR_103, + TITLE_STR_104, + TITLE_STR_105, + TITLE_STR_106, + TITLE_STR_107, + TITLE_STR_108, + TITLE_STR_109, + TITLE_STR_110, + TITLE_STR_111, + TITLE_STR_112, + TITLE_STR_113, + TITLE_STR_114, + TITLE_STR_115, + TITLE_STR_116, + TITLE_STR_117, + TITLE_STR_118, + TITLE_STR_119, + TITLE_STR_120, + TITLE_STR_121, + TITLE_STR_122, + TITLE_STR_123, + TITLE_STR_124, + TITLE_STR_125, + TITLE_STR_126, + TITLE_STR_127, + TITLE_STR_128, + TITLE_STR_129, + TITLE_STR_130, + TITLE_STR_131, + TITLE_STR_132, + TITLE_STR_133, + TITLE_STR_134, + TITLE_STR_135, + TITLE_STR_136, + TITLE_STR_137, + TITLE_STR_138, + TITLE_STR_139, + TITLE_STR_140, + TITLE_STR_141, + TITLE_STR_142, + TITLE_STR_143, + TITLE_STR_144, + TITLE_STR_145, + TITLE_STR_146, + TITLE_STR_147, + TITLE_STR_148, + TITLE_STR_149, + TITLE_STR_150, + TITLE_STR_151, + TITLE_STR_152, + TITLE_STR_153, + TITLE_STR_154, + TITLE_STR_155, + TITLE_STR_156, + TITLE_STR_157, + TITLE_STR_158, + TITLE_STR_159, + TITLE_STR_160, + TITLE_STR_161, + TITLE_STR_162, + TITLE_STR_163, + TITLE_STR_164, + TITLE_STR_165, + TITLE_STR_166, + TITLE_STR_167, + TITLE_STR_168, + TITLE_STR_169, + TITLE_STR_170, + TITLE_STR_171, + TITLE_STR_172, + TITLE_STR_173, + TITLE_STR_174, + TITLE_STR_175, + TITLE_STR_176, + TITLE_STR_177, + TITLE_STR_178, + TITLE_STR_179, + TITLE_STR_180, + TITLE_STR_181, + TITLE_STR_182, + TITLE_STR_183, + TITLE_STR_184, + TITLE_STR_185, + TITLE_STR_186, + TITLE_STR_187, + TITLE_STR_188, + TITLE_STR_189, + TITLE_STR_190, + TITLE_STR_191, + TITLE_STR_192, + TITLE_STR_193, + TITLE_STR_194, + TITLE_STR_195, + TITLE_STR_196, + TITLE_STR_197, + TITLE_STR_198, + TITLE_STR_199, + TITLE_STR_200, + TITLE_STR_201, + TITLE_STR_202, + TITLE_STR_203, + TITLE_STR_204, + TITLE_STR_205, + TITLE_STR_206, + TITLE_STR_207, + TITLE_STR_208, + TITLE_STR_209, + TITLE_STR_210, + TITLE_STR_211, + TITLE_STR_212, + TITLE_STR_213, + TITLE_STR_214, + TITLE_STR_215, + TITLE_STR_216, + TITLE_STR_217, + TITLE_STR_218, + TITLE_STR_219, + TITLE_STR_220, + TITLE_STR_221, + TITLE_STR_222, + TITLE_STR_223, + TITLE_STR_224, + TITLE_STR_225, + TITLE_STR_226, + TITLE_STR_227, + TITLE_STR_228, + TITLE_STR_229, + TITLE_STR_230, + TITLE_STR_231, + TITLE_STR_232, + TITLE_STR_233, + TITLE_STR_234, + TITLE_STR_235, + TITLE_STR_236, + TITLE_STR_237, + TITLE_STR_238, + TITLE_STR_239, + TITLE_STR_240, + TITLE_STR_241, + TITLE_STR_242, + TITLE_STR_243, + TITLE_STR_244, + TITLE_STR_245, + TITLE_STR_246, + TITLE_STR_247, + TITLE_STR_248, + TITLE_STR_249, + TITLE_STR_250, + TITLE_STR_251, + TITLE_STR_252, + TITLE_STR_253, + TITLE_STR_254, + TITLE_STR_255, + TITLE_STR_256, + TITLE_STR_257, + TITLE_STR_258, + TITLE_STR_259, + TITLE_STR_260, + TITLE_STR_261, + TITLE_STR_262, + TITLE_STR_263, + TITLE_STR_264, + TITLE_STR_265, + TITLE_STR_266, + TITLE_STR_267, + TITLE_STR_268, + TITLE_STR_269, + TITLE_STR_270, + TITLE_STR_271, + TITLE_STR_272, + TITLE_STR_273, + TITLE_STR_274, + TITLE_STR_275, + TITLE_STR_276, + TITLE_STR_277, + TITLE_STR_278, + TITLE_STR_279, + TITLE_STR_280, + TITLE_STR_281, + TITLE_STR_282, + TITLE_STR_283, + TITLE_STR_284, + TITLE_STR_285, + TITLE_STR_286, + #ifdef BUGFIX_R0 + TITLE_STR_287 + #endif + #ifdef BUGFIX_R1 + TITLE_STR_287, + TITLE_STR_288, + TITLE_STR_289, + TITLE_STR_290, + TITLE_STR_291, + TITLE_STR_292, + TITLE_STR_293, + TITLE_STR_294, + TITLE_STR_295, + TITLE_STR_296, + TITLE_STR_297, + TITLE_STR_298, + TITLE_STR_299, + TITLE_STR_300, + TITLE_STR_301 + #endif +} LTITLE_STRINGS; diff --git a/assets/Globalimagetable_commandblock.c b/assets/rarewarelogo.c similarity index 98% rename from assets/Globalimagetable_commandblock.c rename to assets/rarewarelogo.c index 589655d2..baf72918 100644 --- a/assets/Globalimagetable_commandblock.c +++ b/assets/rarewarelogo.c @@ -670,7 +670,7 @@ u32 imgwaRE_0x2060[] = { }; //split me into 28 groups of verts per the gsSPVertex calls -Vtx maybeverts2B18[] = { +Vtx verts2B18[] = { {0x008E, 0x008E, 0x000B, 0x0000, 0x0362, 0x0317, 0x08, 0x09, 0x7E, 0x00}, {0x008A, 0x009D, 0x000B, 0x0000, 0x0359, 0x0335, 0x07, 0x09, 0x7E, 0x00}, {0x0080, 0x00AB, 0x000B, 0x0000, 0x033D, 0x0351, 0x07, 0x0A, 0x7E, 0x00}, @@ -686,7 +686,9 @@ Vtx maybeverts2B18[] = { {0x008A, 0xFF64, 0x000B, 0x0000, 0x0359, 0x00CB, 0x08, 0xF7, 0x7E, 0x00}, {0x0080, 0xFF56, 0x000B, 0x0000, 0x033D, 0x00AE, 0x07, 0xF6, 0x7E, 0x00}, {0x0071, 0xFF4B, 0x000B, 0x0000, 0x0317, 0x009A, 0x06, 0xF6, 0x7E, 0x00}, - {0x0062, 0xFF48, 0x000B, 0x0000, 0x02EE, 0x0093, 0x05, 0xF5, 0x7E, 0x00}, + {0x0062, 0xFF48, 0x000B, 0x0000, 0x02EE, 0x0093, 0x05, 0xF5, 0x7E, 0x00} +}; +Vtx verts2C18[] = { {0xFF99, 0xFF63, 0x000B, 0x0000, 0x0010, 0x0010, 0x00, 0x00, 0x7F, 0x00}, {0xFFD2, 0xFF63, 0x000B, 0x0000, 0x03F0, 0x0010, 0x00, 0x00, 0x7F, 0x00}, {0x000A, 0xFF87, 0x000B, 0x0000, 0x03F0, 0x03F0, 0x6A, 0x44, 0x00, 0x00}, @@ -700,7 +702,9 @@ Vtx maybeverts2B18[] = { {0xFF8C, 0x009D, 0x000B, 0x0000, 0x00A8, 0x0335, 0xF9, 0x09, 0x7E, 0x00}, {0xFF88, 0x008E, 0x000B, 0x0000, 0x009F, 0x0317, 0xF8, 0x09, 0x7E, 0x00}, {0xFF88, 0xFF73, 0x000B, 0x0000, 0x009F, 0x00E8, 0xF8, 0xF7, 0x7E, 0x00}, - {0xFFD2, 0xFF87, 0x000B, 0x0000, 0x03F0, 0x03F0, 0x00, 0x00, 0x00, 0x00}, + {0xFFD2, 0xFF87, 0x000B, 0x0000, 0x03F0, 0x03F0, 0x00, 0x00, 0x00, 0x00} +}; +Vtx verts2CF8[] = { {0x0028, 0x0013, 0x000B, 0x0000, 0x0198, 0x03F5, 0x3F, 0x27, 0x66, 0x00}, {0x001D, 0x0019, 0x000F, 0x0000, 0x012B, 0x0429, 0x3F, 0x27, 0x66, 0x00}, {0x0077, 0xFF98, 0x000F, 0x0000, 0x04BF, 0xFFD8, 0x40, 0x2C, 0x64, 0x00}, @@ -716,7 +720,9 @@ Vtx maybeverts2B18[] = { {0x0043, 0xFF63, 0x000B, 0x0000, 0x03F0, 0x0010, 0x6B, 0xBE, 0x00, 0x00}, {0x000A, 0xFF63, 0x000B, 0x0000, 0x0010, 0x0010, 0x96, 0xBC, 0x00, 0x00}, {0x000A, 0xFF87, 0x000B, 0x0000, 0x0010, 0x03F0, 0x96, 0x44, 0x00, 0x00}, - {0x0043, 0xFF87, 0x000B, 0x0000, 0x03F0, 0x03F0, 0x6B, 0x42, 0x00, 0x00}, + {0x0043, 0xFF87, 0x000B, 0x0000, 0x03F0, 0x03F0, 0x6B, 0x42, 0x00, 0x00} +}; +Vtx verts2DF8[] = { {0xFFB4, 0x002D, 0x000F, 0x0000, 0xFCE9, 0x04D9, 0xF0, 0x41, 0x6B, 0x00}, {0xFFBF, 0x0033, 0x000F, 0x0000, 0xFD5D, 0x0504, 0xDB, 0x3D, 0x68, 0x00}, {0xFFBC, 0x0037, 0x000B, 0x0000, 0xFD40, 0x052D, 0xDB, 0x3D, 0x68, 0x00}, @@ -732,7 +738,9 @@ Vtx maybeverts2B18[] = { {0xFFA6, 0x002B, 0x000F, 0x0000, 0xFC5F, 0x04C7, 0x00, 0x46, 0x69, 0x00}, {0xFF9D, 0x0031, 0x000B, 0x0000, 0xFC01, 0x04FB, 0x00, 0x46, 0x69, 0x00}, {0xFFA5, 0x0032, 0x000B, 0x0000, 0xFC56, 0x04FC, 0xFC, 0x44, 0x6A, 0x00}, - {0xFFAB, 0x002C, 0x000F, 0x0000, 0xFC93, 0x04CA, 0xFC, 0x44, 0x6A, 0x00}, + {0xFFAB, 0x002C, 0x000F, 0x0000, 0xFC93, 0x04CA, 0xFC, 0x44, 0x6A, 0x00} +}; +Vtx verts2EF8[] = { {0xFFB6, 0x0096, 0x000B, 0x0000, 0xFD01, 0x0857, 0xD7, 0xB2, 0x5A, 0x00}, {0xFFB8, 0x009A, 0x000F, 0x0000, 0xFD17, 0x0876, 0xD7, 0xB2, 0x5A, 0x00}, {0x0049, 0x0065, 0x000B, 0x0000, 0x02EB, 0x06B0, 0x4E, 0x00, 0x64, 0x00}, @@ -746,7 +754,9 @@ Vtx maybeverts2B18[] = { {0xFFD8, 0x0065, 0x000F, 0x0000, 0xFE58, 0x06B1, 0xB2, 0x00, 0x64, 0x00}, {0xFFD4, 0x007B, 0x000F, 0x0000, 0xFE30, 0x076D, 0xB8, 0xE5, 0x64, 0x00}, {0xFFCF, 0x0079, 0x000B, 0x0000, 0xFDFD, 0x075E, 0xB8, 0xE5, 0x64, 0x00}, - {0xFFC5, 0x008A, 0x000B, 0x0000, 0xFD96, 0x07EE, 0xC1, 0xCA, 0x5F, 0x00}, + {0xFFC5, 0x008A, 0x000B, 0x0000, 0xFD96, 0x07EE, 0xC1, 0xCA, 0x5F, 0x00} +}; +Vtx verts2FD8[] = { {0x0045, 0x004D, 0x000B, 0x0000, 0x02C0, 0x05E5, 0x4A, 0xE8, 0x63, 0x00}, {0x0040, 0x004F, 0x000F, 0x0000, 0x028F, 0x05F7, 0x4A, 0xE8, 0x63, 0x00}, {0x0049, 0x0065, 0x000B, 0x0000, 0x02EB, 0x06B0, 0x4E, 0x00, 0x64, 0x00}, @@ -762,7 +772,9 @@ Vtx maybeverts2B18[] = { {0x003B, 0x003A, 0x000B, 0x0000, 0x0259, 0x0540, 0x3D, 0xD2, 0x65, 0x00}, {0x002B, 0x0033, 0x000F, 0x0000, 0x01B9, 0x0504, 0x28, 0xC5, 0x68, 0x00}, {0x002E, 0x002E, 0x000B, 0x0000, 0x01D6, 0x04DC, 0x28, 0xC5, 0x68, 0x00}, - {0x0023, 0x0028, 0x000B, 0x0000, 0x0166, 0x04AA, 0x14, 0xC2, 0x6C, 0x00}, + {0x0023, 0x0028, 0x000B, 0x0000, 0x0166, 0x04AA, 0x14, 0xC2, 0x6C, 0x00} +}; +Vtx verts30D8[] = { {0xFFA7, 0x001E, 0x000B, 0x0000, 0xFC6C, 0x0451, 0xBE, 0xCE, 0x60, 0x00}, {0xFFB1, 0x0019, 0x000F, 0x0000, 0xFCCE, 0x0429, 0xC7, 0xD1, 0x66, 0x00}, {0xFFA6, 0x002B, 0x000F, 0x0000, 0xFC5F, 0x04C7, 0xBC, 0xE6, 0x67, 0x00}, @@ -776,7 +788,9 @@ Vtx maybeverts2B18[] = { {0xFFB1, 0x0019, 0x000F, 0x0000, 0xFCCE, 0x0429, 0xBE, 0xDA, 0x64, 0x00}, {0xFFA7, 0x001E, 0x000B, 0x0000, 0xFC6C, 0x0451, 0xBE, 0xDA, 0x64, 0x00}, {0x0006, 0xFF93, 0x000B, 0x0000, 0x0041, 0xFFA8, 0xC1, 0xD5, 0x64, 0x00}, - {0x000A, 0xFF98, 0x000F, 0x0000, 0x0062, 0xFFD8, 0xC1, 0xD5, 0x64, 0x00}, + {0x000A, 0xFF98, 0x000F, 0x0000, 0x0062, 0xFFD8, 0xC1, 0xD5, 0x64, 0x00} +}; +Vtx verts31B8[] = { {0x0040, 0x007B, 0x000F, 0x0000, 0x028C, 0x076D, 0x49, 0x1B, 0x64, 0x00}, {0x0045, 0x007D, 0x000B, 0x0000, 0x02BF, 0x077C, 0x49, 0x1B, 0x64, 0x00}, {0xFF78, 0xFF73, 0x0007, 0x0000, 0x027D, 0x0117, 0xE2, 0xFF, 0x7B, 0x00}, @@ -790,7 +804,10 @@ Vtx maybeverts2B18[] = { {0xFFA8, 0x00A4, 0x000B, 0x0000, 0xFC70, 0x08CD, 0x00, 0x49, 0x67, 0x00}, {0x0024, 0x009A, 0x000F, 0x0000, 0x016F, 0x0876, 0x1F, 0x43, 0x66, 0x00}, {0x0026, 0x009F, 0x000B, 0x0000, 0x0184, 0x08A1, 0x1F, 0x43, 0x66, 0x00}, - {0x0038, 0x0091, 0x000B, 0x0000, 0x0242, 0x082A, 0x39, 0x33, 0x64, 0x00}, + {0x0038, 0x0091, 0x000B, 0x0000, 0x0242, 0x082A, 0x39, 0x33, 0x64, 0x00} + +}; +Vtx verts3298[] = { {0x0062, 0xFF48, 0x000B, 0x0000, 0xFE37, 0x00CB, 0x0C, 0xE4, 0x7B, 0x00}, {0xFFB3, 0xFF48, 0x000B, 0x0000, 0x016B, 0x00CB, 0xF4, 0xE4, 0x7B, 0x00}, {0xFFB3, 0xFF38, 0x0007, 0x0000, 0x016B, 0x00AF, 0xF4, 0xE1, 0x7A, 0x00}, @@ -806,7 +823,9 @@ Vtx maybeverts2B18[] = { {0x0062, 0x00C9, 0x0007, 0x0000, 0xFE37, 0x0374, 0x01, 0x1E, 0x7B, 0x00}, {0x0063, 0x00B9, 0x000B, 0x0000, 0xFE37, 0x0358, 0x01, 0x1E, 0x7B, 0x00}, {0xFFB3, 0x00B9, 0x000B, 0x0000, 0x016B, 0x0358, 0x00, 0x1E, 0x7B, 0x00}, - {0xFFB3, 0x00C9, 0x0007, 0x0000, 0x016B, 0x0374, 0x00, 0x1E, 0x7B, 0x00}, + {0xFFB3, 0x00C9, 0x0007, 0x0000, 0x016B, 0x0374, 0x00, 0x1E, 0x7B, 0x00} +}; +Vtx verts3398[] = { {0xFFB3, 0x00B9, 0x000B, 0x0000, 0x016B, 0x0358, 0x00, 0x1E, 0x7B, 0x00}, {0x0062, 0x00C9, 0x0007, 0x0000, 0xFE37, 0x0374, 0x01, 0x1E, 0x7B, 0x00}, {0x0063, 0x00B9, 0x000B, 0x0000, 0xFE37, 0x0358, 0x01, 0x1E, 0x7B, 0x00}, @@ -822,7 +841,9 @@ Vtx maybeverts2B18[] = { {0xFF7D, 0x00A3, 0x0007, 0x0000, 0x0265, 0x0332, 0xE5, 0x0C, 0x7B, 0x00}, {0xFF8C, 0x009D, 0x000B, 0x0000, 0x0223, 0x0326, 0xE5, 0x0C, 0x7B, 0x00}, {0xFF88, 0x008E, 0x000B, 0x0000, 0x0234, 0x030C, 0xE2, 0x01, 0x7B, 0x00}, - {0xFF78, 0x008E, 0x0007, 0x0000, 0x027D, 0x030C, 0xE2, 0x01, 0x7B, 0x00}, + {0xFF78, 0x008E, 0x0007, 0x0000, 0x027D, 0x030C, 0xE2, 0x01, 0x7B, 0x00} +}; +Vtx verts3498[] = { {0x0098, 0xFF5D, 0x0007, 0x0000, 0xFD3C, 0x00F1, 0x1B, 0xF4, 0x7B, 0x00}, {0x008B, 0xFF4A, 0x0007, 0x0000, 0xFD7A, 0x00CF, 0x15, 0xEB, 0x7B, 0x00}, {0x0080, 0xFF56, 0x000B, 0x0000, 0xFDAE, 0x00E3, 0x15, 0xEB, 0x7B, 0x00}, @@ -838,7 +859,9 @@ Vtx maybeverts2B18[] = { {0x008E, 0xFF73, 0x000B, 0x0000, 0xFD6E, 0x0117, 0x1E, 0xFF, 0x7B, 0x00}, {0x009D, 0xFF73, 0x0007, 0x0000, 0xFD25, 0x0117, 0x1E, 0xFF, 0x7B, 0x00}, {0x009D, 0x008E, 0x0007, 0x0000, 0xFD25, 0x030C, 0x1E, 0x00, 0x7B, 0x00}, - {0x008E, 0x008E, 0x000B, 0x0000, 0xFD6E, 0x030C, 0x1E, 0x00, 0x7B, 0x00}, + {0x008E, 0x008E, 0x000B, 0x0000, 0xFD6E, 0x030C, 0x1E, 0x00, 0x7B, 0x00} +}; +Vtx verts3598[] = { {0xFFB3, 0xFF38, 0x0007, 0x0000, 0x016B, 0x00AF, 0x00, 0xE2, 0x7B, 0x00}, {0xFFB3, 0xFF48, 0x000B, 0x0000, 0x016B, 0x00CB, 0x00, 0xE2, 0x7B, 0x00}, {0x0062, 0x00D0, 0x0005, 0x0000, 0x02D8, 0x0381, 0x03, 0x1E, 0x7B, 0x00}, @@ -852,7 +875,10 @@ Vtx maybeverts2B18[] = { {0xFF78, 0xFF73, 0x0007, 0x0000, 0x027D, 0x0117, 0xE2, 0xFF, 0x7B, 0x00}, {0xFF8B, 0xFF4A, 0x0007, 0x0000, 0x0227, 0x00CF, 0xEB, 0xEB, 0x7B, 0x00}, {0xFF96, 0xFF56, 0x000B, 0x0000, 0x01F3, 0x00E3, 0xEB, 0xEB, 0x7B, 0x00}, - {0xFF9D, 0xFF3D, 0x0007, 0x0000, 0x01D0, 0x00B8, 0xF3, 0xE6, 0x7B, 0x00}, + {0xFF9D, 0xFF3D, 0x0007, 0x0000, 0x01D0, 0x00B8, 0xF3, 0xE6, 0x7B, 0x00} + +}; +Vtx verts3678[] = { {0xFFB3, 0xFF31, 0x0005, 0x0000, 0x0129, 0x00A2, 0xFD, 0xE2, 0x7B, 0x00}, {0x0062, 0xFF31, 0x0005, 0x0000, 0x02D8, 0x00A2, 0x03, 0xE2, 0x7B, 0x00}, {0x0062, 0xFF38, 0x0007, 0x0000, 0x02D8, 0x00AF, 0x03, 0xE2, 0x7B, 0x00}, @@ -868,7 +894,9 @@ Vtx maybeverts2B18[] = { {0x009D, 0xFF73, 0x0007, 0x0000, 0x0367, 0x0117, 0x1E, 0xFD, 0x7B, 0x00}, {0x009D, 0x008E, 0x0007, 0x0000, 0x0367, 0x030C, 0x1E, 0x03, 0x7B, 0x00}, {0x00A5, 0x008E, 0x0005, 0x0000, 0x0379, 0x030C, 0x1E, 0x03, 0x7B, 0x00}, - {0x00A5, 0xFF73, 0x0005, 0x0000, 0x0379, 0x0117, 0x1E, 0xFD, 0x7B, 0x00}, + {0x00A5, 0xFF73, 0x0005, 0x0000, 0x0379, 0x0117, 0x1E, 0xFD, 0x7B, 0x00} +}; +Vtx verts3778[] = { {0xFF9D, 0xFF3D, 0x0007, 0x0000, 0x00F5, 0x00B8, 0xF4, 0xE5, 0x7B, 0x00}, {0xFF9B, 0xFF36, 0x0005, 0x0000, 0x00EE, 0x00AC, 0xF4, 0xE5, 0x7B, 0x00}, {0xFFB3, 0xFF31, 0x0005, 0x0000, 0x0129, 0x00A2, 0xFD, 0xE2, 0x7B, 0x00}, @@ -884,7 +912,9 @@ Vtx maybeverts2B18[] = { {0x0062, 0xFF38, 0x0007, 0x0000, 0x02D8, 0x00AF, 0x03, 0xE2, 0x7B, 0x00}, {0x0062, 0xFF31, 0x0005, 0x0000, 0x02D8, 0x00A2, 0x03, 0xE2, 0x7B, 0x00}, {0x007B, 0xFF36, 0x0005, 0x0000, 0x0313, 0x00AC, 0x0C, 0xE5, 0x7B, 0x00}, - {0x0078, 0xFF3D, 0x0007, 0x0000, 0x030C, 0x00B8, 0x0C, 0xE5, 0x7B, 0x00}, + {0x0078, 0xFF3D, 0x0007, 0x0000, 0x030C, 0x00B8, 0x0C, 0xE5, 0x7B, 0x00} +}; +Vtx verts3878[] = { {0xFFB3, 0x00C9, 0x0007, 0x0000, 0x0129, 0x0374, 0xFD, 0x1D, 0x7B, 0x00}, {0xFFB3, 0x00D0, 0x0005, 0x0000, 0x0129, 0x0381, 0xFD, 0x1D, 0x7B, 0x00}, {0x0062, 0x00C9, 0x0007, 0x0000, 0x02D8, 0x0374, 0x03, 0x1E, 0x7B, 0x00}, @@ -898,7 +928,9 @@ Vtx maybeverts2B18[] = { {0xFF71, 0x008E, 0x0005, 0x0000, 0x0088, 0x030C, 0xE2, 0x03, 0x7B, 0x00}, {0xFF85, 0x00BC, 0x0005, 0x0000, 0x00BA, 0x035D, 0xEB, 0x15, 0x7B, 0x00}, {0xFF8B, 0x00B6, 0x0007, 0x0000, 0x00C7, 0x0353, 0xEB, 0x15, 0x7B, 0x00}, - {0xFF9D, 0x00C4, 0x0007, 0x0000, 0x00F5, 0x036B, 0xF2, 0x1A, 0x7B, 0x00}, + {0xFF9D, 0x00C4, 0x0007, 0x0000, 0x00F5, 0x036B, 0xF2, 0x1A, 0x7B, 0x00} +}; +Vtx verts3958[] = { {0xFFB3, 0x00D0, 0x0005, 0x0000, 0x0364, 0x03BC, 0xF2, 0x7E, 0x00, 0x00}, {0x0062, 0x00D0, 0x0005, 0x0000, 0x0364, 0x03BC, 0x0E, 0x7E, 0x00, 0x00}, {0x0062, 0x00D0, 0xFFF4, 0x0000, 0x0190, 0x03BC, 0x0E, 0x7E, 0x00, 0x00}, @@ -914,7 +946,9 @@ Vtx maybeverts2B18[] = { {0x008B, 0x00B6, 0x0007, 0x0000, 0x033A, 0x0353, 0x15, 0x15, 0x7B, 0x00}, {0x0078, 0x00C4, 0x0007, 0x0000, 0x030C, 0x036B, 0x0C, 0x1B, 0x7B, 0x00}, {0x007B, 0x00CB, 0x0005, 0x0000, 0x0313, 0x0377, 0x0C, 0x1B, 0x7B, 0x00}, - {0x0090, 0x00BC, 0x0005, 0x0000, 0x0347, 0x035D, 0x15, 0x15, 0x7B, 0x00}, + {0x0090, 0x00BC, 0x0005, 0x0000, 0x0347, 0x035D, 0x15, 0x15, 0x7B, 0x00} +}; +Vtx verts3A58[] = { {0x009F, 0xFF5A, 0x0005, 0x0000, 0x0364, 0x009D, 0x74, 0xCD, 0x00, 0x00}, {0x0090, 0xFF45, 0x0005, 0x0000, 0x0364, 0x006F, 0x59, 0xA7, 0x00, 0x00}, {0x0090, 0xFF45, 0xFFF4, 0x0000, 0x0190, 0x006F, 0x59, 0xA7, 0x00, 0x00}, @@ -930,7 +964,9 @@ Vtx maybeverts2B18[] = { {0x00A5, 0xFF73, 0xFFF4, 0x0000, 0x0190, 0x00D1, 0x7E, 0xF2, 0x00, 0x00}, {0x00A5, 0xFF73, 0x0005, 0x0000, 0x0364, 0x00D1, 0x7E, 0xF2, 0x00, 0x00}, {0x00A5, 0x008E, 0xFFF4, 0x0000, 0x0190, 0x032F, 0x7E, 0x0E, 0x00, 0x00}, - {0x00A5, 0x008E, 0x0005, 0x0000, 0x0364, 0x032F, 0x7E, 0x0E, 0x00, 0x00}, + {0x00A5, 0x008E, 0x0005, 0x0000, 0x0364, 0x032F, 0x7E, 0x0E, 0x00, 0x00} +}; +Vtx verts3B58[] = { {0xFF76, 0xFF5A, 0x0005, 0x0000, 0x0364, 0x009D, 0x8C, 0xCD, 0x00, 0x00}, {0xFF71, 0xFF73, 0x0005, 0x0000, 0x0364, 0x00D1, 0x82, 0xF2, 0x00, 0x00}, {0xFF71, 0xFF73, 0xFFF4, 0x0000, 0x0190, 0x00D1, 0x82, 0xF2, 0x00, 0x00}, @@ -946,7 +982,9 @@ Vtx maybeverts2B18[] = { {0xFF85, 0xFF45, 0xFFF4, 0x0000, 0x0190, 0x006F, 0xA7, 0xA7, 0x00, 0x00}, {0xFF85, 0xFF45, 0x0005, 0x0000, 0x0364, 0x006F, 0xA7, 0xA7, 0x00, 0x00}, {0xFF9B, 0xFF36, 0x0005, 0x0000, 0x0364, 0x004F, 0xCD, 0x8C, 0x00, 0x00}, - {0xFF9B, 0xFF36, 0xFFF4, 0x0000, 0x0190, 0x004F, 0xCD, 0x8C, 0x00, 0x00}, + {0xFF9B, 0xFF36, 0xFFF4, 0x0000, 0x0190, 0x004F, 0xCD, 0x8C, 0x00, 0x00} +}; +Vtx verts3C58[] = { {0x00A5, 0x008E, 0xFFF4, 0x0000, 0x0379, 0x030C, 0x1E, 0x03, 0x85, 0x00}, {0x00A5, 0xFF73, 0xFFF4, 0x0000, 0x0379, 0x0117, 0x1E, 0xFD, 0x85, 0x00}, {0x009D, 0xFF73, 0xFFF2, 0x0000, 0x0367, 0x0117, 0x1E, 0xFD, 0x85, 0x00}, @@ -962,7 +1000,9 @@ Vtx maybeverts2B18[] = { {0xFFB3, 0x00D0, 0x0005, 0x0000, 0x0364, 0x03BC, 0xF2, 0x7E, 0x00, 0x00}, {0xFFB3, 0x00D0, 0xFFF4, 0x0000, 0x0190, 0x03BC, 0xF2, 0x7E, 0x00, 0x00}, {0xFF9B, 0x00CB, 0x0005, 0x0000, 0x0364, 0x03B0, 0xC5, 0x70, 0x00, 0x00}, - {0xFF9B, 0x00CB, 0xFFF4, 0x0000, 0x0190, 0x03B0, 0xC5, 0x70, 0x00, 0x00}, + {0xFF9B, 0x00CB, 0xFFF4, 0x0000, 0x0190, 0x03B0, 0xC5, 0x70, 0x00, 0x00} +}; +Vtx verts3D58[] = { {0x0078, 0x00C4, 0xFFF2, 0x0000, 0x030C, 0x036B, 0x0C, 0x1B, 0x85, 0x00}, {0x008B, 0x00B6, 0xFFF2, 0x0000, 0x033A, 0x0353, 0x15, 0x15, 0x85, 0x00}, {0x0090, 0x00BC, 0xFFF4, 0x0000, 0x0347, 0x035D, 0x15, 0x15, 0x85, 0x00}, @@ -978,7 +1018,9 @@ Vtx maybeverts2B18[] = { {0x0062, 0x00C9, 0xFFF2, 0x0000, 0x02D8, 0x0374, 0x03, 0x1E, 0x85, 0x00}, {0x0062, 0x00D0, 0xFFF4, 0x0000, 0x02D8, 0x0381, 0x03, 0x1E, 0x85, 0x00}, {0xFFB3, 0x00D0, 0xFFF4, 0x0000, 0x0129, 0x0381, 0xFD, 0x1D, 0x85, 0x00}, - {0xFFB3, 0x00C9, 0xFFF2, 0x0000, 0x0129, 0x0374, 0xFD, 0x1D, 0x85, 0x00}, + {0xFFB3, 0x00C9, 0xFFF2, 0x0000, 0x0129, 0x0374, 0xFD, 0x1D, 0x85, 0x00} +}; +Vtx verts3E58[] = { {0xFF71, 0x008E, 0xFFF4, 0x0000, 0x0088, 0x030C, 0xE2, 0x03, 0x85, 0x00}, {0xFF78, 0xFF73, 0xFFF2, 0x0000, 0x009A, 0x0117, 0xE2, 0xFD, 0x85, 0x00}, {0xFF7D, 0xFF5D, 0xFFF2, 0x0000, 0x00A6, 0x00F1, 0xE5, 0xF4, 0x85, 0x00}, @@ -994,7 +1036,9 @@ Vtx maybeverts2B18[] = { {0xFF76, 0x00A6, 0xFFF4, 0x0000, 0x0095, 0x0337, 0xE5, 0x0C, 0x85, 0x00}, {0xFF7D, 0x00A3, 0xFFF2, 0x0000, 0x00A6, 0x0332, 0xE5, 0x0C, 0x85, 0x00}, {0xFF85, 0x00BC, 0xFFF4, 0x0000, 0x00BA, 0x035D, 0xEB, 0x15, 0x85, 0x00}, - {0xFF8A, 0x00B6, 0xFFF2, 0x0000, 0x00C7, 0x0353, 0xEB, 0x15, 0x85, 0x00}, + {0xFF8A, 0x00B6, 0xFFF2, 0x0000, 0x00C7, 0x0353, 0xEB, 0x15, 0x85, 0x00} +}; +Vtx verts3F58[] = { {0x00A5, 0xFF73, 0xFFF4, 0x0000, 0x0379, 0x0117, 0x1E, 0xFD, 0x85, 0x00}, {0x008B, 0xFF4A, 0xFFF2, 0x0000, 0x033A, 0x00CF, 0x15, 0xEB, 0x85, 0x00}, {0x0090, 0xFF45, 0xFFF4, 0x0000, 0x0347, 0x00C6, 0x15, 0xEB, 0x85, 0x00}, @@ -1010,7 +1054,9 @@ Vtx maybeverts2B18[] = { {0x0098, 0xFF5D, 0xFFF2, 0x0000, 0x035B, 0x00F1, 0x1B, 0xF4, 0x85, 0x00}, {0x009F, 0xFF5A, 0xFFF4, 0x0000, 0x036C, 0x00EC, 0x1B, 0xF4, 0x85, 0x00}, {0xFFB3, 0xFF31, 0xFFF4, 0x0000, 0x0129, 0x00A2, 0xFD, 0xE2, 0x85, 0x00}, - {0xFFB3, 0xFF38, 0xFFF2, 0x0000, 0x0129, 0x00AF, 0xFD, 0xE2, 0x85, 0x00}, + {0xFFB3, 0xFF38, 0xFFF2, 0x0000, 0x0129, 0x00AF, 0xFD, 0xE2, 0x85, 0x00} +}; +Vtx verts4058[] = { {0x009D, 0xFF73, 0xFFF2, 0x0000, 0x000A, 0x00A5, 0x09, 0xF8, 0x82, 0x00}, {0x0098, 0xFF5D, 0xFFF2, 0x0000, 0x001B, 0x0071, 0x08, 0xF7, 0x82, 0x00}, {0x008B, 0xFF4A, 0xFFF2, 0x0000, 0x0049, 0x0043, 0x07, 0xF6, 0x82, 0x00}, @@ -1026,7 +1072,9 @@ Vtx maybeverts2B18[] = { {0x0098, 0x00A3, 0xFFF2, 0x0000, 0x001B, 0x038E, 0x08, 0x09, 0x82, 0x00}, {0x008B, 0x00B6, 0xFFF2, 0x0000, 0x0049, 0x03BC, 0x07, 0x0A, 0x82, 0x00}, {0x0078, 0x00C4, 0xFFF2, 0x0000, 0x0089, 0x03DD, 0x06, 0x0B, 0x82, 0x00}, - {0x0062, 0x00C9, 0xFFF2, 0x0000, 0x00D3, 0x03E9, 0x05, 0x0B, 0x82, 0x00}, + {0x0062, 0x00C9, 0xFFF2, 0x0000, 0x00D3, 0x03E9, 0x05, 0x0B, 0x82, 0x00} +}; +Vtx verts4158[] = { {0x001D, 0x0019, 0x000F, 0x0000, 0x0241, 0x0391, 0x07, 0xF7, 0x7E, 0x00}, {0x0012, 0x002B, 0x000F, 0x0000, 0x021C, 0x0419, 0x08, 0xF7, 0x7E, 0x00}, {0xFFA6, 0x002B, 0x000F, 0x0000, 0x00A8, 0x0419, 0xF4, 0xFD, 0x7E, 0x00}, @@ -1042,7 +1090,9 @@ Vtx maybeverts2B18[] = { {0x000A, 0xFF98, 0x000F, 0x0000, 0x01FE, 0xFFDE, 0x01, 0xF4, 0x7E, 0x00}, {0xFFB1, 0x0019, 0x000F, 0x0000, 0x00CD, 0x0391, 0xF6, 0xFA, 0x7E, 0x00}, {0xFF78, 0x008E, 0xFFF2, 0x0000, 0x03F6, 0x035A, 0xF7, 0x08, 0x82, 0x00}, - {0xFF78, 0xFF73, 0xFFF2, 0x0000, 0x03F6, 0x00A5, 0xF7, 0xF8, 0x82, 0x00}, + {0xFF78, 0xFF73, 0xFFF2, 0x0000, 0x03F6, 0x00A5, 0xF7, 0xF8, 0x82, 0x00} +}; +Vtx verts4258[] = { {0x0037, 0x003D, 0x000F, 0x0000, 0x0299, 0x049B, 0x0C, 0xFF, 0x7E, 0x00}, {0x0040, 0x004F, 0x000F, 0x0000, 0x02B8, 0x051D, 0x0C, 0x01, 0x7E, 0x00}, {0xFFD4, 0x004F, 0x000F, 0x0000, 0x0144, 0x051D, 0xF4, 0x02, 0x7E, 0x00}, @@ -1058,7 +1108,9 @@ Vtx maybeverts2B18[] = { {0xFFB8, 0x009A, 0x000F, 0x0000, 0x00E5, 0x0740, 0xF9, 0x09, 0x7E, 0x00}, {0xFFA8, 0x009E, 0x000F, 0x0000, 0x00AD, 0x0761, 0xF8, 0x09, 0x7E, 0x00}, {0x0010, 0x009E, 0x000F, 0x0000, 0x0215, 0x0761, 0x03, 0x0C, 0x7E, 0x00}, - {0x0024, 0x009A, 0x000F, 0x0000, 0x0258, 0x0740, 0x05, 0x0B, 0x7E, 0x00}, + {0x0024, 0x009A, 0x000F, 0x0000, 0x0258, 0x0740, 0x05, 0x0B, 0x7E, 0x00} +}; +Vtx verts4358[] = { {0xFFBF, 0x0033, 0x000F, 0x0000, 0x00FC, 0x044D, 0xF4, 0xFD, 0x7E, 0x00}, {0xFFB4, 0x002D, 0x000F, 0x0000, 0x00D6, 0x0428, 0xF5, 0xFC, 0x7E, 0x00}, {0xFFAB, 0x002C, 0x000F, 0x0000, 0x00B9, 0x041B, 0xF4, 0xFD, 0x7E, 0x00}, @@ -1075,7 +1127,7 @@ Gfx D_020043E8[] = { gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2), gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0), gsSPSetGeometryMode(G_LIGHTING | G_TEXTURE_GEN ), - gsSPVertex(maybeverts2B18, 16, 0), + gsSPVertex(verts2B18, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 11, 15, 0), @@ -1090,7 +1142,7 @@ Gfx D_020043E8[] = { gsSP1Triangle(8, 3, 4, 0), gsSP1Triangle(8, 4, 5, 0), gsSP1Triangle(8, 5, 6, 0), - gsSPVertex(0x02002C18, 14, 0), + gsSPVertex(verts2C18, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(7, 9, 10, 0), gsSP1Triangle(7, 10, 11, 0), @@ -1123,7 +1175,7 @@ Gfx DL_RAREWARETEXT[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, 342, 5, 0, G_TX_WRAP, 0, 5, G_TX_WRAP, 0, 5), gsDPSetTileSize(5, 2, 2, 2, 2), gsDPSetRenderMode(G_RM_PASS, G_RM_OPA_SURF2), - gsSPVertex(0x02002C18, 14, 0), + gsSPVertex(verts2C18, 14, 0), gsSP1Triangle(13, 6, 0, 0), gsSP1Triangle(13, 0, 1, 0), gsDPPipeSync(), @@ -1164,7 +1216,7 @@ Gfx DL_RAREWARETEXT[] = { gsDPSetTileSize(4, 2, 2, 6, 6), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, 0x156, 5, 0, G_TX_WRAP, 0, 5, G_TX_WRAP, 0, 5), gsDPSetTileSize(5, 2, 2, 2, 2), - gsSPVertex(0x02002CF8, 16, 0), + gsSPVertex(verts2CF8, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsDPPipeSync(), @@ -1198,14 +1250,14 @@ Gfx D_02004758[] = { gsSPTexture(0x1C81, 0x1426, 0, 0, 1), gsDPSetTileSize(0, 46, 116, 124, 124), - gsSPVertex(0x02002CF8, 16, 0), + gsSPVertex(verts2CF8, 16, 0), gsSP1Triangle(7, 0, 1, 0), gsSP1Triangle(7, 1, 2, 0), gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02002DF8, 16, 0), - gsSPVertex(0x02002EF8, 14, 0), + gsSPVertex(verts2DF8, 16, 0), + gsSPVertex(verts2EF8, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(7, 9, 10, 0), gsSP1Triangle(11, 12, 7, 0), @@ -1217,7 +1269,7 @@ Gfx D_02004758[] = { gsSP1Triangle(2, 3, 4, 0), gsSP1Triangle(2, 4, 5, 0), - gsSPVertex(0x02002FD8, 16, 0), + gsSPVertex(verts2FD8, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(11, 9, 8, 0), gsSP1Triangle(11, 8, 15, 0), @@ -1231,7 +1283,7 @@ Gfx D_02004758[] = { gsSP1Triangle(1, 2, 3, 0), gsSP1Triangle(4, 5, 6, 0), - gsSPVertex(0x020030D8, 14, 0), + gsSPVertex(verts30D8, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(10, 11, 12, 0), gsSP1Triangle(10, 12, 13, 0), @@ -1239,7 +1291,7 @@ Gfx D_02004758[] = { gsSP1Triangle(6, 1, 2, 0), gsSP1Triangle(3, 4, 5, 0), - gsSPVertex(0x020031B8, 14, 0), + gsSPVertex(verts31B8, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(7, 9, 10, 0), gsSP1Triangle(11, 12, 9, 0), @@ -1251,7 +1303,7 @@ Gfx D_02004758[] = { gsSP1Triangle(2, 3, 4, 0), gsSP1Triangle(2, 4, 5, 0), - gsSPVertex(0x02003298, 16, 0), + gsSPVertex(verts3298, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 14, 13, 0), @@ -1261,7 +1313,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02003398, 16, 0), + gsSPVertex(verts3398, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 14, 13, 0), @@ -1273,7 +1325,7 @@ Gfx D_02004758[] = { gsSP1Triangle(5, 4, 3, 0), gsSP1Triangle(5, 3, 6, 0), - gsSPVertex(0x02003498, 16, 0), + gsSPVertex(verts3498, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 11, 15, 0), @@ -1287,7 +1339,7 @@ Gfx D_02004758[] = { gsSP1Triangle(5, 3, 4, 0), gsSP1Triangle(5, 4, 6, 0), - gsSPVertex(0x02003598, 14, 0), + gsSPVertex(verts3598, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(7, 9, 10, 0), gsSP1Triangle(11, 12, 8, 0), @@ -1299,7 +1351,7 @@ Gfx D_02004758[] = { gsSP1Triangle(2, 3, 4, 0), gsSP1Triangle(2, 4, 5, 0), - gsSPVertex(0x02003678, 16, 0), + gsSPVertex(verts3678, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 14, 13, 0), @@ -1311,7 +1363,7 @@ Gfx D_02004758[] = { gsSP1Triangle(12, 5, 6, 0), gsSP1Triangle(12, 6, 15, 0), - gsSPVertex(0x02003778, 16, 0), + gsSPVertex(verts3778, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(11, 15, 14, 0), @@ -1325,7 +1377,7 @@ Gfx D_02004758[] = { gsSP1Triangle(4, 5, 6, 0), gsSP1Triangle(4, 6, 3, 0), - gsSPVertex(0x02003878, 14, 0), + gsSPVertex(verts3878, 14, 0), gsSP1Triangle(7, 8, 9, 0), gsSP1Triangle(7, 9, 10, 0), gsSP1Triangle(11, 9, 8, 0), @@ -1337,7 +1389,7 @@ Gfx D_02004758[] = { gsSP1Triangle(2, 3, 4, 0), gsSP1Triangle(2, 4, 5, 0), - gsSPVertex(0x02003958, 16, 0), + gsSPVertex(verts3958, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 14, 13, 0), @@ -1351,7 +1403,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02003A58, 16, 0), + gsSPVertex(verts3A58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 11, 15, 0), @@ -1367,7 +1419,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02003B58, 16, 0), + gsSPVertex(verts3B58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 11, 10, 0), @@ -1383,7 +1435,7 @@ Gfx D_02004758[] = { gsSP1Triangle(5, 4, 3, 0), gsSP1Triangle(5, 3, 6, 0), - gsSPVertex(0x02003C58, 16, 0), + gsSPVertex(verts3C58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 11, 10, 0), @@ -1395,7 +1447,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02003D58, 16, 0), + gsSPVertex(verts3D58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(15, 14, 13, 0), @@ -1409,7 +1461,7 @@ Gfx D_02004758[] = { gsSP1Triangle(5, 4, 3, 0), gsSP1Triangle(5, 3, 6, 0), - gsSPVertex(0x02003E58, 16, 0), + gsSPVertex(verts3E58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(11, 10, 15, 0), @@ -1423,7 +1475,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 2, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02003F58, 16, 0), + gsSPVertex(verts3F58, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(10, 9, 15, 0), @@ -1437,7 +1489,7 @@ Gfx D_02004758[] = { gsSP1Triangle(5, 4, 3, 0), gsSP1Triangle(5, 3, 6, 0), - gsSPVertex(0x02004058, 16, 0), + gsSPVertex(verts4058, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 11, 15, 0), @@ -1453,7 +1505,7 @@ Gfx D_02004758[] = { gsSP1Triangle(8, 4, 5, 0), gsSP1Triangle(8, 5, 6, 0), - gsSPVertex(0x02004158, 16, 0), + gsSPVertex(verts4158, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 11, 15, 0), @@ -1465,7 +1517,7 @@ Gfx D_02004758[] = { gsSP1Triangle(3, 4, 5, 0), gsSP1Triangle(3, 5, 6, 0), - gsSPVertex(0x02004258, 16, 0), + gsSPVertex(verts4258, 16, 0), gsSP1Triangle(8, 9, 10, 0), gsSP1Triangle(8, 10, 11, 0), gsSP1Triangle(8, 15, 14, 0), @@ -1478,7 +1530,7 @@ Gfx D_02004758[] = { gsSP1Triangle(0, 2, 3, 0), gsSP1Triangle(4, 5, 6, 0), - gsSPVertex(0x02004358, 9, 0), + gsSPVertex(verts4358, 9, 0), gsSP1Triangle(5, 6, 7, 0), gsSP1Triangle(5, 7, 8, 0), gsSP1Triangle(5, 8, 4, 0), diff --git a/build/test.c b/build/test.c index 78cdbc82..6ae83112 100644 --- a/build/test.c +++ b/build/test.c @@ -3752,8 +3752,8 @@ void crashSetBuffers2(u16 *buffer1, u16 *buffer2) } -extern stagesetup *_load_resource_named_to_membank(); -f32 g_scale_1_0_item_related = 1.0f; +extern stagesetup *_fileNameLoadToBank(); +f32 g_g_DoorScale = 1.0f; char *setup_text_pointers[] = { NULL, NULL, @@ -3990,7 +3990,7 @@ void proplvreset2(s32 stageID) bnoprop = tokenFind(1, "-noprop") == 0; } - g_scale_1_0_item_related = 1.0f; + g_g_DoorScale = 1.0f; // for each itme itementries_1 = PitemZ_entries; @@ -4020,9 +4020,9 @@ void proplvreset2(s32 stageID) strcat(ptrsp174, "mp_"); } strcat(ptrsp174, *textptr + 1); - resource = _load_resource_named_to_membank(ptrsp174, 1, 0x100, 4); + resource = _fileNameLoadToBank(ptrsp174, 1, 0x100, 4); g_ptrStageSetupFile = resource; - load_mission_text_bank(get_textbank_number_for_stagenum(stageID)); + langLoadToBank(langGetLangBankIndexFromStagenum(stageID)); g_CurrentSetup.pathwaypoints = resource->pathwaypoints; g_CurrentSetup.waypointgroups = resource->waypointgroups; g_CurrentSetup.intro = resource->intro; @@ -4348,7 +4348,7 @@ void proplvreset2(s32 stageID) } break; case PROPDEF_DOOR_SCALE: // switch 1 - g_scale_1_0_item_related = ((GlobalDoorScaleRecord *)prop)->Scale / 65536.0f; + g_g_DoorScale = ((GlobalDoorScaleRecord *)prop)->Scale / 65536.0f; break; case PROPDEF_COLLECTABLE: // switch 1 if ((bnoprop != 0) && ((prop->flags2 & phi_s4_2) == 0)) diff --git a/checksums.txt b/checksums.txt index df480fcd..1278b2d4 100644 --- a/checksums.txt +++ b/checksums.txt @@ -24,12 +24,12 @@ da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_imp_all_p.s da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_ash_all_p.seg da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_sho_all_p.seg 46774d70127cae35b898f5b94246c77f6e239a71 build/u/assets/obseg/bg/bg_ame_all_p.seg -da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_oat_all_p.seg -70ac79017821950bc71d0f5ea0148cde1825a615 build/u/assets/obseg/bg/bg_rit_all_p.seg -da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_len_all_p.seg +da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_rit_all_p.seg +70ac79017821950bc71d0f5ea0148cde1825a615 build/u/assets/obseg/bg/bg_oat_all_p.seg +da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_lip_all_p.seg da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_lee_all_p.seg da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_ear_all_p.seg -53ea3a1252992714b8f09235909390c001a3f3b8 build/u/assets/obseg/bg/bg_lip_all_p.seg +53ea3a1252992714b8f09235909390c001a3f3b8 build/u/assets/obseg/bg/bg_len_all_p.seg da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_pam_all_p.seg da39a3ee5e6b4b0d3255bfef95601890afd80709 build/u/assets/obseg/bg/bg_wax_all_p.seg f4e72081570eae7ec26d1fcca157b762f686f465 build/u/assets/obseg/brief/UbriefarchZ.rz diff --git a/filelist.e.csv b/filelist.e.csv index 56c26f5d..a84caf6d 100644 --- a/filelist.e.csv +++ b/filelist.e.csv @@ -26,12 +26,12 @@ 7148064,0,assets/obseg/bg/bg_ash_all_p.bin,0,1 7148064,0,assets/obseg/bg/bg_lue_all_p.bin,0,1 7148064,40800,assets/obseg/bg/bg_ame_all_p.bin,0,1 -7188864,0,assets/obseg/bg/bg_rit_all_p.bin,0,0 -7188864,28240,assets/obseg/bg/bg_oat_all_p.bin,0,1 +7188864,0,assets/obseg/bg/bg_oat_all_p.bin,0,0 +7188864,28240,assets/obseg/bg/bg_rit_all_p.bin,0,1 7217104,0,assets/obseg/bg/bg_ear_all_p.bin,0,0 7217104,0,assets/obseg/bg/bg_lee_all_p.bin,0,0 -7217104,0,assets/obseg/bg/bg_lip_all_p.bin,0,0 -7217104,4000,assets/obseg/bg/bg_len_all_p.bin,0,1 +7217104,0,assets/obseg/bg/bg_len_all_p.bin,0,0 +7217104,4000,assets/obseg/bg/bg_lip_all_p.bin,0,1 7221104,0,assets/obseg/bg/bg_wax_all_p.bin,0,0 7221104,0,assets/obseg/bg/bg_pam_all_p.bin,0,0 7221104,9344,assets/obseg/chr/CarmourguardZ,1,1 diff --git a/filelist.j.csv b/filelist.j.csv index f41864b9..2852fc43 100644 --- a/filelist.j.csv +++ b/filelist.j.csv @@ -4,7 +4,7 @@ 1202144,1482432,assets/animationtable_entries.bin,0,0 2684576,59360,assets/animationtable_data.bin,0,0 2743936,5120,assets/ge007.u.29D160.Globalimagetable.bin,0,0 -2749056,26608,assets/Globalimagetable_commandblock.bin,0,0 +2749056,26608,assets/rarewarelogo.bin,0,0 2775664,107904,assets/ge007.u.2A4D50.usedby7F008DE4.bin,0,1 2883568,20992,assets/ramrom/ramrom_Dam_1.bin,0,1 2904560,8144,assets/ramrom/ramrom_Dam_2.bin,0,1 @@ -20,10 +20,10 @@ 3007632,6576,assets/ramrom/ramrom_Frigate_1.bin,0,1 3014208,13536,assets/ramrom/ramrom_Frigate_2.bin,0,1 3027744,15856,assets/ramrom/ramrom_Train.bin,0,1 -3043600,676,assets/font/font_first_font_table_controller_small.bin,0,0 -3044276,8716,assets/font/font_second_font_table_controller_small.bin,0,0 -3052992,676,assets/font/font_first_font_table_controller_large.bin,0,0 -3053668,12956,assets/font/font_second_font_table_controller_large.bin,0,0 +3043600,676,assets/font/fontBankGothic_kerning.bin,0,0 +3044276,8716,assets/font/fontZurichBold_fontchartable.bin,0,0 +3052992,676,assets/font/fontZurichBold_kerning.bin,0,0 +3053668,12956,assets/font/fontZurichBold_fontchartable.bin,0,0 3066624,23488,assets/music/sfx.ctl,0,1 3090112,797360,assets/music/sfx.tbl,0,1 3887472,17312,assets/music/instruments.ctl,0,1 @@ -119,12 +119,12 @@ 7191392,0,assets/obseg/bg/bg_ash_all_p.bin,0,1 7191392,0,assets/obseg/bg/bg_sho_all_p.bin,0,1 7191392,40800,assets/obseg/bg/bg_ame_all_p.bin,0,0 -7232192,0,assets/obseg/bg/bg_oat_all_p.bin,0,1 -7232192,28240,assets/obseg/bg/bg_rit_all_p.bin,0,0 -7260432,0,assets/obseg/bg/bg_len_all_p.bin,0,1 +7232192,0,assets/obseg/bg/bg_rit_all_p.bin,0,1 +7232192,28240,assets/obseg/bg/bg_oat_all_p.bin,0,0 +7260432,0,assets/obseg/bg/bg_lip_all_p.bin,0,1 7260432,0,assets/obseg/bg/bg_lee_all_p.bin,0,1 7260432,0,assets/obseg/bg/bg_ear_all_p.bin,0,1 -7260432,4000,assets/obseg/bg/bg_lip_all_p.bin,0,0 +7260432,4000,assets/obseg/bg/bg_len_all_p.bin,0,0 7264432,0,assets/obseg/bg/bg_pam_all_p.bin,0,1 7264432,0,assets/obseg/bg/bg_wax_all_p.bin,0,1 7264432,9344,assets/obseg/chr/CarmourguardZ,1,1 diff --git a/filelist.u.csv b/filelist.u.csv index 54155088..b846f054 100644 --- a/filelist.u.csv +++ b/filelist.u.csv @@ -4,7 +4,7 @@ 1198784,1482432,assets/animationtable_entries.bin,0,0 2681216,59360,assets/animationtable_data.bin,0,0 2740576,2760,assets/ge007.u.29D160.Globalimagetable.bin,0,0 -2745696,26608,assets/Globalimagetable_commandblock.bin,0,0 +2745696,26608,assets/rarewarelogo.bin,0,0 2772304,107904,assets/ge007.u.2A4D50.usedby7F008DE4.bin,0,1 2880208,20992,assets/ramrom/ramrom_Dam_1.bin,0,1 2901200,8144,assets/ramrom/ramrom_Dam_2.bin,0,1 @@ -20,10 +20,10 @@ 3004272,6576,assets/ramrom/ramrom_Frigate_1.bin,0,1 3010848,13536,assets/ramrom/ramrom_Frigate_2.bin,0,1 3024384,15856,assets/ramrom/ramrom_Train.bin,0,1 -3040240,676,assets/font/font_first_font_table_controller_small.bin,0,0 -3040916,8716,assets/font/font_second_font_table_controller_small.bin,0,0 -3049632,676,assets/font/font_first_font_table_controller_large.bin,0,0 -3050308,12956,assets/font/font_second_font_table_controller_large.bin,0,0 +3040240,676,assets/font/fontBankGothic_kerning.bin,0,0 +3040916,8716,assets/font/fontBankGothic_fontchartable.bin,0,0 +3049632,676,assets/font/fontZurichBold_kerning.bin,0,0 +3050308,12956,assets/font/fontZurichBold_fontchartable.bin,0,0 3063264,23488,assets/music/sfx.ctl,0,1 3086752,797360,assets/music/sfx.tbl,0,1 3884112,17312,assets/music/instruments.ctl,0,1 @@ -120,12 +120,12 @@ 7188032,0,assets/obseg/bg/bg_ash_all_p.bin,0,1 7188032,0,assets/obseg/bg/bg_sho_all_p.bin,0,1 7188032,40800,assets/obseg/bg/bg_ame_all_p.bin,0,0 -7228832,0,assets/obseg/bg/bg_oat_all_p.bin,0,1 -7228832,28240,assets/obseg/bg/bg_rit_all_p.bin,0,0 -7257072,0,assets/obseg/bg/bg_len_all_p.bin,0,1 +7228832,0,assets/obseg/bg/bg_rit_all_p.bin,0,1 +7228832,28240,assets/obseg/bg/bg_oat_all_p.bin,0,0 +7257072,0,assets/obseg/bg/bg_lip_all_p.bin,0,1 7257072,0,assets/obseg/bg/bg_lee_all_p.bin,0,1 7257072,0,assets/obseg/bg/bg_ear_all_p.bin,0,1 -7257072,4000,assets/obseg/bg/bg_lip_all_p.bin,0,0 +7257072,4000,assets/obseg/bg/bg_len_all_p.bin,0,0 7261072,0,assets/obseg/bg/bg_pam_all_p.bin,0,1 7261072,0,assets/obseg/bg/bg_wax_all_p.bin,0,1 7261072,9344,assets/obseg/chr/CarmourguardZ.bin,1,1 diff --git a/ge007.e-test_basis.csv b/ge007.e-test_basis.csv index 6fef3bc3..8bc721da 100644 --- a/ge007.e-test_basis.csv +++ b/ge007.e-test_basis.csv @@ -638,11 +638,11 @@ d41d8cd98f00b204e9800998ecf8427e,.code,build/e/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/e/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.data,build/e/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.rodata,build/e/src/game/null_007970.o -7b22a2783a019bcd60f173947237c811,.text,build/e/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.code,build/e/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.bss,build/e/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.data,build/e/src/game/objecthandler_1.o -e130944f728e41b7ccd6730873dc6bb9,.rodata,build/e/src/game/objecthandler_1.o +7b22a2783a019bcd60f173947237c811,.text,build/e/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.code,build/e/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.bss,build/e/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.data,build/e/src/game/model.o +e130944f728e41b7ccd6730873dc6bb9,.rodata,build/e/src/game/model.o b9ecfe8ecc3ef965e425146c53659a76,.text,build/e/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.code,build/e/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/e/src/game/objecthandler_2.o diff --git a/ge007.j-test_basis.csv b/ge007.j-test_basis.csv index a5ff0057..964e5729 100644 --- a/ge007.j-test_basis.csv +++ b/ge007.j-test_basis.csv @@ -633,11 +633,11 @@ d41d8cd98f00b204e9800998ecf8427e,.code,build/j/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/j/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.data,build/j/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.rodata,build/j/src/game/null_007970.o -eb1d4282f3c092f900ae0384b32c45ff,.text,build/j/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.code,build/j/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.bss,build/j/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.data,build/j/src/game/objecthandler_1.o -63392afd7ef8420cf22b9e1f4b947ac7,.rodata,build/j/src/game/objecthandler_1.o +eb1d4282f3c092f900ae0384b32c45ff,.text,build/j/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.code,build/j/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.bss,build/j/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.data,build/j/src/game/model.o +63392afd7ef8420cf22b9e1f4b947ac7,.rodata,build/j/src/game/model.o b9ecfe8ecc3ef965e425146c53659a76,.text,build/j/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.code,build/j/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/j/src/game/objecthandler_2.o diff --git a/ge007.ld b/ge007.ld index c0551c71..d4a7ae1d 100644 --- a/ge007.ld +++ b/ge007.ld @@ -52,9 +52,10 @@ SECTIONS _alt_startSegmentRomStart = _startSegmentRomStart + 0x100000; _alt_startSegmentStart = _startSegmentStart - 0x10000000 + 0x100000; + /* 0x70000450, 0x70020D90 001050-021990 */ - BEGIN_SEG(code, _startSegmentRomEnd, 0x70000450) SUBALIGN(16) + BEGIN_SEG(code, _startSegmentRomEnd, (_startSegmentEnd - 0x10000000)) SUBALIGN(16) { #include "ld/lib.text.ld.inc" } @@ -125,13 +126,13 @@ SECTIONS } END_SEG(Globalimagetable) - BEGIN_SEG(Globalimagetablecmdblk, _GlobalimagetableSegmentRomEnd, 0x02000000) + BEGIN_SEG(rarewarelogo, _GlobalimagetableSegmentRomEnd, 0x02000000) { - build/OUTCODE/assets/Globalimagetable_commandblock.o (.data); + build/OUTCODE/assets/rarewarelogo.o (.data); } - END_SEG(Globalimagetablecmdblk) + END_SEG(rarewarelogo) - BEGIN_SEG(romfiles2, _GlobalimagetablecmdblkSegmentRomEnd, _romfiles2SegmentRomStart) + BEGIN_SEG(romfiles2, _rarewarelogoSegmentRomEnd, _romfiles2SegmentRomStart) { build/OUTCODE/assets/romfiles2.o (.data); } @@ -144,21 +145,21 @@ SECTIONS END_SEG(ramromfiles) - BEGIN_SEG(fonttablectlsmall1, _ramromfilesSegmentRomEnd, _fonttablectlsmall1SegmentRomStart) + BEGIN_SEG(fontbankgothic, _ramromfilesSegmentRomEnd, 0) { - build/OUTCODE/assets/font/font_first_font_table_controller_small.o (.data); + build/OUTCODE/assets/font/fontBankGothic.o (.data); } - END_SEG(fonttablectlsmall1) + END_SEG(fontbankgothic) - BEGIN_SEG(fonttablectllarge1, _fonttablectlsmall1SegmentRomEnd, _fonttablectllarge1SegmentRomStart) + BEGIN_SEG(fontzurichbold, _fontbankgothicSegmentRomEnd, 0) { - build/OUTCODE/assets/font/font_first_font_table_controller_large.o (.data); + build/OUTCODE/assets/font/fontZurichBold.o (.data); } - END_SEG(fonttablectllarge1) + END_SEG(fontzurichbold) - BEGIN_SEG(musicfiles, _fonttablectllarge1SegmentRomEnd, _musicfilesSegmentRomStart) + BEGIN_SEG(musicfiles, _fontzurichboldSegmentRomEnd, _musicfilesSegmentRomStart) { build/OUTCODE/assets/music/sfx.ctl.o (.data); build/OUTCODE/assets/music/sfx.tbl.o (.data); diff --git a/ge007.u-test_basis.csv b/ge007.u-test_basis.csv index a672b7b5..e4d8283f 100644 --- a/ge007.u-test_basis.csv +++ b/ge007.u-test_basis.csv @@ -633,11 +633,11 @@ d41d8cd98f00b204e9800998ecf8427e,.code,build/u/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/u/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.data,build/u/src/game/null_007970.o d41d8cd98f00b204e9800998ecf8427e,.rodata,build/u/src/game/null_007970.o -eb1d4282f3c092f900ae0384b32c45ff,.text,build/u/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.code,build/u/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.bss,build/u/src/game/objecthandler_1.o -d41d8cd98f00b204e9800998ecf8427e,.data,build/u/src/game/objecthandler_1.o -63392afd7ef8420cf22b9e1f4b947ac7,.rodata,build/u/src/game/objecthandler_1.o +eb1d4282f3c092f900ae0384b32c45ff,.text,build/u/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.code,build/u/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.bss,build/u/src/game/model.o +d41d8cd98f00b204e9800998ecf8427e,.data,build/u/src/game/model.o +63392afd7ef8420cf22b9e1f4b947ac7,.rodata,build/u/src/game/model.o b9ecfe8ecc3ef965e425146c53659a76,.text,build/u/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.code,build/u/src/game/objecthandler_2.o d41d8cd98f00b204e9800998ecf8427e,.bss,build/u/src/game/objecthandler_2.o diff --git a/include/gbi_extension.h b/include/gbi_extension.h index d48c1bb2..73391f69 100644 --- a/include/gbi_extension.h +++ b/include/gbi_extension.h @@ -69,6 +69,16 @@ /*** *** 4 Triangles ***/ +/** + * Remarks: + * Ryan: I've been learning a lot about PD's graphics microcode lately. It's likely that the decision to + * implement tri4 was to reduce memory usage in RDRAM. But to fit 4 tris in one command they had to limit + * themselves to 4 bits per vertex, which means they can only address up to 16 vertices. They could have + * fit 32 vertices in DMEM if they wanted. In stock microcodes the vertex IDs are pre-multiplied by 10 + * which makes it easy for the RSP to calculate the vertex offset in the DMEM buffer (it can use a + * single shift operation). But because PD is using a compact format there's more work for the RSP to + * calculate it. So they've sacrificed RSP performance for memory saving. +*/ //cannot use 2tri with 4tri, so lets just make sure they are undefined so errors happen. #undef gSP2Triangles @@ -186,6 +196,14 @@ _g->words.w1 = _SHIFTL(0x06, 24, 8) | _SHIFTL((c), 14, 10) | _SHIFTL((d), 2, 10); \ } +#define gDPLoadTLUTCmd2(pkt, tile, count) \ +{ \ + Gfx *_g = (Gfx *)pkt; \ + \ + _g->words.w0 = _SHIFTL(G_LOADTLUT, 24, 8) | 0xff0; \ + _g->words.w1 = _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10) | 0xff0;\ +} + /* * Texturing macro Overrides */ diff --git a/include/math.h b/include/math.h index 5fd7d7b0..369be310 100644 --- a/include/math.h +++ b/include/math.h @@ -45,9 +45,9 @@ /* Half of PI. (PI/2)*/ -#define M_HALF_PI M_PI_F / 2 +#define M_HALF_PI (M_PI_F / 2) /* 3 Halves of PI. (3*(PI/2))*/ -#define M_THREE_HALF_PI 3 * M_HALF_PI +#define M_THREE_HALF_PI (3 * M_HALF_PI) #define M_U16_MAX_VALUE_F 65536.0f @@ -68,6 +68,8 @@ #define RAD2BYTE(RAD) (char)(256.0f / M_TAU_F * (RAD)) /* Converts an angle from Degrees to Radians */ #define DegToRad(DEG) (float)((DEG) * M_TAU_F / 360.0f) +/* Converts an angle from Degrees to Radians with only one multiply*/ +#define DegToRad1Fact(DEG) (float)((DEG) * (float)(M_TAU / 360.0)) /* Converts and halves an angle from Degrees to Radians */ #define mDegToHalfRad(x) ((x * M_PI_F) / 360.0f) /* Converts an angle from Radians to Degrees */ diff --git a/ld/game.bss.ld.inc b/ld/game.bss.ld.inc index d41e7691..28799392 100644 --- a/ld/game.bss.ld.inc +++ b/ld/game.bss.ld.inc @@ -71,7 +71,7 @@ build/OUTCODE/src/game/gun.o (.bss); build/OUTCODE/src/game/bondwalk2.o (.bss); build/OUTCODE/src/game/objecthandler.o (.bss); - build/OUTCODE/src/game/objecthandler_1.o (.bss); + build/OUTCODE/src/game/model.o (.bss); build/OUTCODE/src/game/objecthandler_2.o (.bss); build/OUTCODE/src/game/othermodemicrocode.o (.bss); build/OUTCODE/src/game/bondview.o (.bss); diff --git a/ld/game.data.ld.inc b/ld/game.data.ld.inc index 5372c005..80449754 100644 --- a/ld/game.data.ld.inc +++ b/ld/game.data.ld.inc @@ -71,7 +71,7 @@ build/OUTCODE/src/game/gun.o (.data); build/OUTCODE/src/game/bondwalk2.o (.data); build/OUTCODE/src/game/objecthandler.o (.data); - build/OUTCODE/src/game/objecthandler_1.o (.data); + build/OUTCODE/src/game/model.o (.data); build/OUTCODE/src/game/objecthandler_2.o (.data); build/OUTCODE/src/game/othermodemicrocode.o (.data); build/OUTCODE/src/game/bondview.o (.data); diff --git a/ld/game.rodata.ld.inc b/ld/game.rodata.ld.inc index e6f7e4f1..c8e4e7eb 100644 --- a/ld/game.rodata.ld.inc +++ b/ld/game.rodata.ld.inc @@ -71,7 +71,7 @@ build/OUTCODE/src/game/gun.o (.rodata); build/OUTCODE/src/game/bondwalk2.o (.rodata); build/OUTCODE/src/game/objecthandler.o (.rodata); - build/OUTCODE/src/game/objecthandler_1.o (.rodata); + build/OUTCODE/src/game/model.o (.rodata); build/OUTCODE/src/game/objecthandler_2.o (.rodata); build/OUTCODE/src/game/othermodemicrocode.o (.rodata); build/OUTCODE/src/game/bondview.o (.rodata); diff --git a/ld/game.text.ld.inc b/ld/game.text.ld.inc index 84696a72..14f4cbb6 100644 --- a/ld/game.text.ld.inc +++ b/ld/game.text.ld.inc @@ -71,7 +71,7 @@ build/OUTCODE/src/game/gun.o (.text); build/OUTCODE/src/game/bondwalk2.o (.text); build/OUTCODE/src/game/objecthandler.o (.text); - build/OUTCODE/src/game/objecthandler_1.o (.text); + build/OUTCODE/src/game/model.o (.text); build/OUTCODE/src/game/objecthandler_2.o (.text); build/OUTCODE/src/game/othermodemicrocode.o (.text); build/OUTCODE/src/game/bondview.o (.text); diff --git a/readme.md b/readme.md index 10cc8c4d..e5c1166d 100644 --- a/readme.md +++ b/readme.md @@ -50,20 +50,20 @@ Additionally [qemu-irix](https://github.com/n64decomp/qemu-irix/releases) is nee sudo dpkg -i qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb ``` -#### Step 2: Recompile IDO +#### Step 2: Clone the repository + +Clone this repository where you wish to have the project, with a command such as: -Recompile IDO for your platform for increased compile speed ```bash -cd tools/ido5.3_recomp -make +git clone https://github.com/kholdfuzion/goldeneye_src ``` -#### Step 3: Clone the repository - -Clone this repository where you wish to have the project, with a command such as: +#### Step 3: Recompile IDO +Recompile IDO for your platform for increased compile speed ```bash -git clone https://github.com/kholdfuzion/goldeneye_src +cd tools/ido5.3_recomp +make ``` #### Step 4: Prepare baserom(s) for asset extraction diff --git a/src/aicommands.def b/src/aicommands.def index 06368d0e..1bd3cb57 100644 --- a/src/aicommands.def +++ b/src/aicommands.def @@ -4862,7 +4862,7 @@ _AI_CMD( ObjectRecord *obj = objFindByTagId(ai->val[0]); if (obj && obj->prop) { - if (!do_something_if_object_destroyed(obj)) + if (!objGetDestroyedLevel(obj)) { f32 damage = ((obj->damage - obj->maxdamage) + 1) / 250.0f; maybe_detonate_object(obj, damage, &obj->runtime_pos, 29, -1); @@ -5049,7 +5049,7 @@ _AI_CMD( if (obj && obj->prop) { bool a = collect_or_interact_object(obj->prop, 0); - sub_GAME_7F03C2BC(obj->prop, a); + propExecuteTickOperation(obj->prop, a); } Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); break; @@ -5094,7 +5094,7 @@ _AI_CMD( { if (obj->prop->parent) { - sub_GAME_7F04C044(obj->prop); + objDetach(obj->prop); } else { @@ -5102,7 +5102,7 @@ _AI_CMD( chrpropDelist(obj->prop); chrpropDisable(obj->prop); } - if (obj->type != PROPDEF_COLLECTABLE || !sub_GAME_7F051E1C(obj, chr)) + if (obj->type != PROPDEF_COLLECTABLE || !chrEquipWeapon(obj, chr)) { chrpropReparent(obj->prop, chr->prop); } @@ -9122,7 +9122,7 @@ _AI_CMD( bool ok = FALSE; if (ChrEntityp && ChrEntityp->prop && ChrEntityp->model) { - ok = chrTryEquipHat(ChrEntityp, modelnum, flags); + ok = hatCreateForChr(ChrEntityp, modelnum, flags); } if (ok) { @@ -9223,7 +9223,7 @@ _AI_CMD( if (hatprop) { hatobj = hatprop->obj; - chrTryEquipHat(clone, hatobj->obj, 0); + hatCreateForChr(clone, hatobj->obj, 0); } } /*PD extras @@ -9952,15 +9952,15 @@ _AI_CMD( if (obj->type == PROPDEF_MONITOR) { MonitorObjRecord *sm = (MonitorObjRecord *) obj; - monitorSetImageByNum(&sm->Monitor.image, ai->val[2]); + monitorSetImageByNum(&sm->Monitor.cmdlist, ai->val[2]); } else if (obj->type == PROPDEF_MULTI_MONITOR) { u8 slot = ai->val[1]; if (slot < 4) { - multimonitorobj *mm = (multimonitorobj *) obj; - monitorSetImageByNum(&mm->Monitor[slot].image, ai->val[2]); + MultiMonitorObjRecord *mm = (MultiMonitorObjRecord *) obj; + monitorSetImageByNum(&mm->Monitor[slot].cmdlist, ai->val[2]); } } } @@ -10295,15 +10295,15 @@ _AI_CMD( _AI_CMD( { AIRecord1 * ai = AiListp + Offset; - set_unset_bitflags(4, FALSE); - set_unset_ammo_on_screen_setting(2, FALSE); + gunSetSightVisible(GUNSIGHTREASON_NOCONTROL, FALSE); + gunSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, FALSE); if (!(PLAYERFLAG_NOCONTROL & ai->val)) { hudmsgsSetOff(PLAYERFLAG_NOCONTROL); } if (!(ai->val & PLAYERFLAG_LOCKCONTROLS)) { - sub_GAME_7F08A944(PLAYERFLAG_NOCONTROL); + bondviewSetUpperTextDisplayFlag(PLAYERFLAG_NOCONTROL); } if (!(ai->val & PLAYERFLAG_NOTIMER)) { @@ -10342,10 +10342,10 @@ _AI_CMD( _AI_CMD( { - set_unset_bitflags(4, TRUE); - set_unset_ammo_on_screen_setting(2, TRUE); + gunSetSightVisible(GUNSIGHTREASON_NOCONTROL, TRUE); + gunSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, TRUE); hudmsgsSetOn(PLAYERFLAG_NOCONTROL); - sub_GAME_7F08A928(2); + bondviewClearUpperTextDisplayFlag(2); countdownTimerSetVisible(16, TRUE); D_800364B0 = TRUE; Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); @@ -10588,9 +10588,9 @@ _AI_CMD( s32 num; for (num = get_numguards() - 1; num >= 0; num--) { - if (ptr_guard_data[num].model != NULL) + if (g_ChrSlots[num].model != NULL) { - ptr_guard_data[num].chrflags |= CHRFLAG_HIDDEN; + g_ChrSlots[num].chrflags |= CHRFLAG_HIDDEN; } } Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); @@ -10625,7 +10625,7 @@ _AI_CMD( s32 num; for (num = get_numguards() - 1; num >= 0; num--) { - ptr_guard_data[num].chrflags &= ~CHRFLAG_HIDDEN; + g_ChrSlots[num].chrflags &= ~CHRFLAG_HIDDEN; } Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); break; @@ -10916,9 +10916,9 @@ _AI_CMD( _AI_CMD( { AIRecord * ai = AiListp + Offset; - flt_CODE_bss_80079990.x = (s8) ai->val[0]; - flt_CODE_bss_80079990.y = 0; - flt_CODE_bss_80079990.z = (s8) ai->val[1]; + g_ForceBondMoveOffset.x = (s8) ai->val[0]; + g_ForceBondMoveOffset.y = 0; + g_ForceBondMoveOffset.z = (s8) ai->val[1]; Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); break; }) @@ -11838,15 +11838,15 @@ _AI_CMD( sub_GAME_7F03FDA8(obj->prop); if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - obj->unk6C->flags |= 0x601; - sub_GAME_7F03FE14(obj->prop); - matrix_4x4_set_identity(&obj->unk6C->m); - obj->unk6C->pos.x = 0; - obj->unk6C->pos.y = 1.0f / CHRLV_FRAMERATE_F; - obj->unk6C->pos.z = 0; - obj->unk6C->vec.x = 0; - obj->unk6C->vec.y = 0.29166666f; - obj->unk6C->vec.z = 0; + obj->projectile->flags |= 0x601; + projectileSetSticky(obj->prop); + matrix_4x4_set_identity(&obj->projectile->mtx); + obj->projectile->speed.x = 0; + obj->projectile->speed.y = 1.0f / CHRLV_FRAMERATE_F; + obj->projectile->speed.z = 0; + obj->projectile->unk10.x = 0; + obj->projectile->unk10.y = 0.29166666f; + obj->projectile->unk10.z = 0; } } Offset += CAT(CAT(AI_, CMDNAME), _LENGTH); diff --git a/src/audi.c b/src/audi.c index 5a014f54..5495a185 100644 --- a/src/audi.c +++ b/src/audi.c @@ -3,6 +3,7 @@ #include "sched.h" #include "audi.h" #include "thread_config.h" +#include "bondgame.h" /** * EU .data, offset from start of data_seg : 0x23A0 @@ -392,7 +393,7 @@ void amCreateAudioManager(ALSynConfig* alconf) g_AudioManager.cmdList[j] = (Acmd *)alHeapDBAlloc(0, 0, alconf->heap, 1, MAX_ACMD_SIZE * sizeof(Acmd)); } - osCreateThread(&g_AudioManager.audioThread, AUDI_THREAD_ID, &amMain, 0, (void*)set_stack_entry((u8*)(&sp_audi), 0x1000), AUDI_THREAD_PRIORITY); + osCreateThread(&g_AudioManager.audioThread, AUDI_THREAD_ID, &amMain, 0, (void*)setSPToEnd((u8*)(&sp_audi), sizeof(sp_audi)), AUDI_THREAD_PRIORITY); } /** diff --git a/src/bondaicommands.h b/src/bondaicommands.h index e92ade65..b83c4899 100644 --- a/src/bondaicommands.h +++ b/src/bondaicommands.h @@ -228,6 +228,16 @@ #define _BONDAICOMMANDS_H_ #include + + +// Reverse endieness, to write things like 0x700 to be translated into 0x00, 0x07. +// This is not compatible with aicommands2.h +#define CharArrayFrom16Rev(input) (input) & 0x00FF, ((input) & 0xFF00) >> 8 +#define CharArrayFrom24Rev(input) (input) & 0x0000FF, ((input) & 0x00FF00) >> 8, ((input) & 0xFF0000) >> 16 +#define CharArrayFrom32Rev(input) (input) & 0x000000FF, ((input) & 0x0000FF00) >> 8, ((input) & 0x00FF0000) >> 16, ((input) & 0xFF000000) >> 24 + + + // "standard" aicommands2.h definition #define CharArrayFrom16(input) ((input) & 0xFF00) >> 8, (input) & 0x00FF #define CharArrayFrom24(input) ((input) & 0xFF0000) >> 16, ((input) & 0x00FF00) >> 8, (input) & 0x0000FF #define CharArrayFrom32(input) ((input) & 0xFF000000) >> 24, ((input) & 0x00FF0000) >> 16, ((input) & 0x0000FF00) >> 8, (input) & 0x000000FF @@ -554,101 +564,102 @@ IF_VA(NOT(IS_EMPTY(CASE_CONTENT1)))(IF_VA(NOT(IS_EMPTY(CASE_CONTENT2)))(Label(lb IF_VA(NOT(IS_EMPTY(CASE_CONTENT0)))(IF_VA(NOT(IS_EMPTY(CASE_CONTENT1)))(Label(lblNext)) EXPAND_ARGS_STACK(CASE_CONTENT0)(lblDone) \ Label(lblDone)) + #include "aicommands2.h" -#if 0 +#if 1 -//temporary thunking for ai names -#define DO(label_id) \ - label(label_id) \ - ai_sleep +// //temporary thunking for ai names +// #define DO(label_id) \ +// label(label_id) \ +// ai_sleep -#define LOOP(label) \ - goto_first(label) +// #define LOOP(label) \ +// goto_first(label) -#define CONTINUE(label) \ - goto_first(label) +// #define CONTINUE(label) \ +// goto_first(label) -#define YIELD_FOREVER(label_id) \ - label(label_id) \ - ai_sleep \ - goto_first(label_id) +// #define YIELD_FOREVER(label_id) \ +// label(label_id) \ +// ai_sleep \ +// goto_first(label_id) -#define RETURN(label_id)\ - label(label_id) \ - jump_to_return_ai_list \ - ai_list_end +// #define RETURN(label_id)\ +// label(label_id) \ +// jump_to_return_ai_list \ +// ai_list_end -/*============================================================================= -// ai command shortcuts -//===========================================================================*/ -#define goto_loop_start(label_id) \ - label(label_id) \ - ai_sleep +// /*============================================================================= +// // ai command shortcuts +// //===========================================================================*/ +// #define goto_loop_start(label_id) \ +// label(label_id) \ +// ai_sleep -#define goto_loop_repeat(label) \ - goto_first(label) +// #define goto_loop_repeat(label) \ +// goto_first(label) -#define goto_loop_infinite(label_id) \ - label(label_id) \ - ai_sleep \ - goto_first(label_id) +// #define goto_loop_infinite(label_id) \ +// label(label_id) \ +// ai_sleep \ +// goto_first(label_id) -#define random_generate_greater_than(byte, label) \ - random_generate_seed \ - if_random_seed_greater_than(byte, label) +// #define random_generate_greater_than(byte, label) \ +// random_generate_seed \ +// if_random_seed_greater_than(byte, label) -#define random_generate_less_than(byte, label) \ - random_generate_seed \ - if_random_seed_less_than(byte, label) +// #define random_generate_less_than(byte, label) \ +// random_generate_seed \ +// if_random_seed_less_than(byte, label) -#define if_guard_meters_to_bond_less_than(distance, label) \ - if_guard_distance_to_bond_less_than((distance * 10U), label) +// #define if_guard_meters_to_bond_less_than(distance, label) \ +// if_guard_distance_to_bond_less_than((distance * 10U), label) -#define if_guard_meters_to_bond_greater_than(distance, label) \ - if_guard_distance_to_bond_greater_than((distance * 10U), label) +// #define if_guard_meters_to_bond_greater_than(distance, label) \ +// if_guard_distance_to_bond_greater_than((distance * 10U), label) -#define if_chr_meters_to_pad_less_than(chr_num, distance, pad, label) \ - if_chr_distance_to_pad_less_than(chr_num, (distance * 10U), pad, label) +// #define if_chr_meters_to_pad_less_than(chr_num, distance, pad, label) \ +// if_chr_distance_to_pad_less_than(chr_num, (distance * 10U), pad, label) -#define if_chr_meters_to_pad_greater_than(chr_num, distance, pad, label) \ - if_chr_distance_to_pad_greater_than(chr_num, (distance * 10U), pad, label) +// #define if_chr_meters_to_pad_greater_than(chr_num, distance, pad, label) \ +// if_chr_distance_to_pad_greater_than(chr_num, (distance * 10U), pad, label) -#define if_guard_meters_to_chr_less_than(distance, chr_num, label) \ - if_guard_distance_to_chr_less_than((distance * 10U), chr_num, label) +// #define if_guard_meters_to_chr_less_than(distance, chr_num, label) \ +// if_guard_distance_to_chr_less_than((distance * 10U), chr_num, label) -#define if_guard_meters_to_chr_greater_than(distance, chr_num, label) \ - if_guard_distance_to_chr_greater_than((distance * 10U), chr_num, label) +// #define if_guard_meters_to_chr_greater_than(distance, chr_num, label) \ +// if_guard_distance_to_chr_greater_than((distance * 10U), chr_num, label) -#define guard_try_setting_chr_preset_to_guard_within_meters(distance, label) \ - guard_try_setting_chr_preset_to_guard_within_distance((distance * 10U), label) +// #define guard_try_setting_chr_preset_to_guard_within_meters(distance, label) \ +// guard_try_setting_chr_preset_to_guard_within_distance((distance * 10U), label) -#define if_bond_meters_to_pad_less_than(distance, pad, label) \ - if_bond_distance_to_pad_less_than((distance * 10U), pad, label) +// #define if_bond_meters_to_pad_less_than(distance, pad, label) \ +// if_bond_distance_to_pad_less_than((distance * 10U), pad, label) -#define if_bond_meters_to_pad_greater_than(distance, pad, label) \ - if_bond_distance_to_pad_greater_than((distance * 10U), pad, label) +// #define if_bond_meters_to_pad_greater_than(distance, pad, label) \ +// if_bond_distance_to_pad_greater_than((distance * 10U), pad, label) -#define debug_log_end \ - '\0', +// #define debug_log_end \ +// '\0', -#define if_local_timer_seconds_less_than(seconds, label) \ - if_local_timer_less_than((SECS_TO_TIMER60(seconds)), label) +// #define if_local_timer_seconds_less_than(seconds, label) \ +// if_local_timer_less_than((SECS_TO_TIMER60(seconds)), label) -#define if_local_timer_seconds_greater_than(seconds, label) \ - if_local_timer_greater_than((SECS_TO_TIMER60(seconds)), label) +// #define if_local_timer_seconds_greater_than(seconds, label) \ +// if_local_timer_greater_than((SECS_TO_TIMER60(seconds)), label) -#define camera_transition_from_bond \ - bond_hide_weapons \ - ai_sleep \ - ai_sleep \ - ai_sleep +// #define camera_transition_from_bond \ +// bond_hide_weapons \ +// ai_sleep \ +// ai_sleep \ +// ai_sleep -#define camera_transition_to_bond \ - ai_sleep \ - ai_sleep \ - ai_sleep +// #define camera_transition_to_bond \ +// ai_sleep \ +// ai_sleep \ +// ai_sleep /*===========================================================================*/ /*============================================================================= @@ -732,7 +743,7 @@ Label(lblDone)) #define jump_to_ai_list(chr_num, ai_list) \ jump_to_ai_list_ID, \ chr_num, \ - CharArrayFrom16(ai_list), + CharArrayFrom16Rev(ai_list), /*============================================================================= // name: set_return_ai_list @@ -745,7 +756,7 @@ Label(lblDone)) #define set_return_ai_list_LENGTH 0x03 #define set_return_ai_list(ai_list) \ set_return_ai_list_ID, \ - CharArrayFrom16(ai_list), + CharArrayFrom16Rev(ai_list), /*============================================================================= // name: jump_to_return_ai_list @@ -796,9 +807,9 @@ Label(lblDone)) #define guard_play_animation_LENGTH 0x09 #define guard_play_animation(animation_id, start_time30, end_time30, bitfield, interpol_time60) \ guard_play_animation_ID, \ - CharArrayFrom16(animation_id), \ - CharArrayFrom16(start_time30), \ - CharArrayFrom16(end_time30), \ + CharArrayFrom16Rev(animation_id), \ + CharArrayFrom16Rev(start_time30), \ + CharArrayFrom16Rev(end_time30), \ bitfield, \ interpol_time60, @@ -926,8 +937,8 @@ Label(lblDone)) #define guard_try_fire_or_aim_at_target_LENGTH 0x06 #define guard_try_fire_or_aim_at_target(bitfield, target, label) \ guard_try_fire_or_aim_at_target_ID, \ - CharArrayFrom16(bitfield), \ - CharArrayFrom16(target), \ + CharArrayFrom16Rev(bitfield), \ + CharArrayFrom16Rev(target), \ label, /*============================================================================= @@ -942,8 +953,8 @@ Label(lblDone)) #define guard_try_fire_or_aim_at_target_kneel_LENGTH 0x06 #define guard_try_fire_or_aim_at_target_kneel(bitfield, target, label) \ guard_try_fire_or_aim_at_target_kneel_ID, \ - CharArrayFrom16(bitfield), \ - CharArrayFrom16(target), \ + CharArrayFrom16Rev(bitfield), \ + CharArrayFrom16Rev(target), \ label, /*============================================================================= @@ -959,8 +970,8 @@ Label(lblDone)) #define guard_try_fire_or_aim_at_target_update_LENGTH 0x06 #define guard_try_fire_or_aim_at_target_update(bitfield, target, label) \ guard_try_fire_or_aim_at_target_update_ID, \ - CharArrayFrom16(bitfield), \ - CharArrayFrom16(target), \ + CharArrayFrom16Rev(bitfield), \ + CharArrayFrom16Rev(target), \ label, /*============================================================================= @@ -976,8 +987,8 @@ Label(lblDone)) #define guard_try_facing_target_LENGTH 0x06 #define guard_try_facing_target(bitfield, target, label) \ guard_try_facing_target_ID, \ - CharArrayFrom16(bitfield), \ - CharArrayFrom16(target), \ + CharArrayFrom16Rev(bitfield), \ + CharArrayFrom16Rev(target), \ label, /*============================================================================= @@ -1039,7 +1050,7 @@ Label(lblDone)) #define guard_try_dropping_item_LENGTH 0x05 #define guard_try_dropping_item(prop_num, item_num, label) \ guard_try_dropping_item_ID, \ - CharArrayFrom16(prop_num), \ + CharArrayFrom16Rev(prop_num), \ item_num, \ label, @@ -1052,7 +1063,7 @@ Label(lblDone)) #define guard_runs_to_pad_LENGTH 0x03 #define guard_runs_to_pad(pad) \ guard_runs_to_pad_ID, \ - CharArrayFrom16(pad), + CharArrayFrom16Rev(pad), /*============================================================================= // name: guard_runs_to_pad_preset @@ -1073,7 +1084,7 @@ Label(lblDone)) #define guard_walks_to_pad_LENGTH 0x03 #define guard_walks_to_pad(pad) \ guard_walks_to_pad_ID, \ - CharArrayFrom16(pad), + CharArrayFrom16Rev(pad), /*============================================================================= // name: guard_sprints_to_pad @@ -1084,7 +1095,7 @@ Label(lblDone)) #define guard_sprints_to_pad_LENGTH 0x03 #define guard_sprints_to_pad(pad) \ guard_sprints_to_pad_ID, \ - CharArrayFrom16(pad), + CharArrayFrom16Rev(pad), /*============================================================================= // name: guard_start_patrol @@ -1151,7 +1162,7 @@ Label(lblDone)) #define guard_try_triggering_alarm_at_pad_LENGTH 0x04 #define guard_try_triggering_alarm_at_pad(pad, label) \ guard_try_triggering_alarm_at_pad_ID, \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1590,7 +1601,7 @@ Label(lblDone)) #define if_room_containing_pad_is_on_screen_LENGTH 0x04 #define if_room_containing_pad_is_on_screen(pad, label) \ if_room_containing_pad_is_on_screen_ID, \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1707,7 +1718,7 @@ Label(lblDone)) #define if_guard_distance_to_bond_less_than_LENGTH 0x04 #define if_guard_distance_to_bond_less_than(distance, label) \ if_guard_distance_to_bond_less_than_ID, \ - CharArrayFrom16(distance), \ + CharArrayFrom16Rev(distance), \ label, /*============================================================================= @@ -1721,7 +1732,7 @@ Label(lblDone)) #define if_guard_distance_to_bond_greater_than_LENGTH 0x04 #define if_guard_distance_to_bond_greater_than(distance, label) \ if_guard_distance_to_bond_greater_than_ID, \ - CharArrayFrom16(distance), \ + CharArrayFrom16Rev(distance), \ label, /*============================================================================= @@ -1736,8 +1747,8 @@ Label(lblDone)) #define if_chr_distance_to_pad_less_than(chr_num, distance, pad, label) \ if_chr_distance_to_pad_less_than_ID, \ chr_num, \ - CharArrayFrom16(distance), \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(distance), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1752,8 +1763,8 @@ Label(lblDone)) #define if_chr_distance_to_pad_greater_than(chr_num, distance, pad, label) \ if_chr_distance_to_pad_greater_than_ID, \ chr_num, \ - CharArrayFrom16(distance), \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(distance), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1767,7 +1778,7 @@ Label(lblDone)) #define if_guard_distance_to_chr_less_than_LENGTH 0x05 #define if_guard_distance_to_chr_less_than(distance, chr_num, label) \ if_guard_distance_to_chr_less_than_ID, \ - CharArrayFrom16(distance), \ + CharArrayFrom16Rev(distance), \ chr_num, \ label, @@ -1782,7 +1793,7 @@ Label(lblDone)) #define if_guard_distance_to_chr_greater_than_LENGTH 0x05 #define if_guard_distance_to_chr_greater_than(distance, chr_num, label) \ if_guard_distance_to_chr_greater_than_ID, \ - CharArrayFrom16(distance), \ + CharArrayFrom16Rev(distance), \ chr_num, \ label, @@ -1800,7 +1811,7 @@ Label(lblDone)) #define guard_try_setting_chr_preset_to_guard_within_distance_LENGTH 0x04 #define guard_try_setting_chr_preset_to_guard_within_distance(distance, label) \ guard_try_setting_chr_preset_to_guard_within_distance_ID, \ - CharArrayFrom16(distance), \ + CharArrayFrom16Rev(distance), \ label, /*============================================================================= @@ -1814,8 +1825,8 @@ Label(lblDone)) #define if_bond_distance_to_pad_less_than_LENGTH 0x06 #define if_bond_distance_to_pad_less_than(distance, pad, label) \ if_bond_distance_to_pad_less_than_ID, \ - CharArrayFrom16(distance), \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(distance), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1829,8 +1840,8 @@ Label(lblDone)) #define if_bond_distance_to_pad_greater_than_LENGTH 0x06 #define if_bond_distance_to_pad_greater_than(distance, pad, label) \ if_bond_distance_to_pad_greater_than_ID, \ - CharArrayFrom16(distance), \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(distance), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1843,7 +1854,7 @@ Label(lblDone)) #define if_chr_in_room_with_pad(chr_num, pad, label) \ if_chr_in_room_with_pad_ID, \ chr_num, \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -1855,7 +1866,7 @@ Label(lblDone)) #define if_bond_in_room_with_pad_LENGTH 0x04 #define if_bond_in_room_with_pad(pad, label) \ if_bond_in_room_with_pad_ID, \ - CharArrayFrom16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -2085,7 +2096,7 @@ Label(lblDone)) #define object_move_to_pad(object_tag, pad) \ object_move_to_pad_ID, \ object_tag, \ - chrarray16(pad), + CharArrayFrom16Rev(pad), /*============================================================================= // name: door_open @@ -2288,7 +2299,7 @@ Label(lblDone)) #define if_mission_time_less_than_LENGTH 0x04 #define if_mission_time_less_than(seconds, label) \ if_mission_time_less_than_ID, \ - CharArrayFrom16(seconds), \ + CharArrayFrom16Rev(seconds), \ label, /*============================================================================= @@ -2302,7 +2313,7 @@ Label(lblDone)) #define if_mission_time_greater_than_LENGTH 0x04 #define if_mission_time_greater_than(seconds, label) \ if_mission_time_greater_than_ID, \ - CharArrayFrom16(seconds), \ + CharArrayFrom16Rev(seconds), \ label, /*============================================================================= @@ -2316,7 +2327,7 @@ Label(lblDone)) #define if_system_power_time_less_than_LENGTH 0x04 #define if_system_power_time_less_than(minutes, label) \ if_system_power_time_less_than_ID, \ - CharArrayFrom16(minutes), \ + CharArrayFrom16Rev(minutes), \ label, /*============================================================================= @@ -2330,7 +2341,7 @@ Label(lblDone)) #define if_system_power_time_greater_than_LENGTH 0x04 #define if_system_power_time_greater_than(minutes, label) \ if_system_power_time_greater_than_ID, \ - CharArrayFrom16(minutes), \ + CharArrayFrom16Rev(minutes), \ label, /*============================================================================= @@ -2657,7 +2668,7 @@ Label(lblDone)) #define guard_set_hearing_scale_LENGTH 0x03 #define guard_set_hearing_scale(hearing_scale) \ guard_set_hearing_scale_ID, \ - CharArrayFrom16(hearing_scale), + CharArrayFrom16Rev(hearing_scale), /*============================================================================= // name: guard_set_vision_range @@ -2717,7 +2728,7 @@ Label(lblDone)) #define guard_set_health_total_LENGTH 0x03 #define guard_set_health_total(total_health) \ guard_set_health_total_ID, \ - CharArrayFrom16(total_health), + CharArrayFrom16Rev(total_health), /*============================================================================= // name: guard_set_armour @@ -2739,7 +2750,7 @@ Label(lblDone)) #define guard_set_armour_LENGTH 0x03 #define guard_set_armour(armour_value) \ guard_set_armour_ID, \ - CharArrayFrom16(armour_value), + CharArrayFrom16Rev(armour_value), /*============================================================================= // name: guard_set_speed_rating @@ -2895,7 +2906,7 @@ Label(lblDone)) #define objective_bitfield_set_on_LENGTH 0x05 #define objective_bitfield_set_on(bitfield) \ objective_bitfield_set_on_ID, \ - CharArrayFrom32(bitfield) + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: objective_bitfield_set_off @@ -2912,7 +2923,7 @@ Label(lblDone)) #define objective_bitfield_set_off_LENGTH 0x05 #define objective_bitfield_set_off(bitfield) \ objective_bitfield_set_off_ID, \ - CharArrayFrom32(bitfield) + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: if_objective_bitfield_is_set_on @@ -2925,7 +2936,7 @@ Label(lblDone)) #define if_objective_bitfield_is_set_on_LENGTH 0x06 #define if_objective_bitfield_is_set_on(bitfield, label) \ if_objective_bitfield_is_set_on_ID, \ - CharArrayFrom32(bitfield), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -2941,7 +2952,7 @@ Label(lblDone)) #define guard_flags_set_on_LENGTH 0x05 #define guard_flags_set_on(bitfield) \ guard_flags_set_on_ID, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: guard_flags_set_off @@ -2956,7 +2967,7 @@ Label(lblDone)) #define guard_flags_set_off_LENGTH 0x05 #define guard_flags_set_off(bitfield) \ guard_flags_set_off_ID, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: if_guard_flags_is_set_on @@ -2971,7 +2982,7 @@ Label(lblDone)) #define if_guard_flags_is_set_on_LENGTH 0x06 #define if_guard_flags_is_set_on(bitfield, label) \ if_guard_flags_is_set_on_ID, \ - CharArrayFrom32(bitfield), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -2987,7 +2998,7 @@ Label(lblDone)) #define chr_flags_set_on(chr_num, bitfield) \ chr_flags_set_on_ID, \ chr_num, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: chr_flags_set_off @@ -3002,7 +3013,7 @@ Label(lblDone)) #define chr_flags_set_off(chr_num, bitfield) \ chr_flags_set_off_ID, \ chr_num, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: if_chr_flags_is_set_on @@ -3017,7 +3028,7 @@ Label(lblDone)) #define if_chr_flags_is_set_on(chr_num, bitfield, label) \ if_chr_flags_is_set_on_ID, \ chr_num, \ - CharArrayFrom32(bitfield), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -3032,7 +3043,7 @@ Label(lblDone)) #define object_flags_1_set_on(object_tag, bitfield) \ object_flags_1_set_on_ID, \ object_tag, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: object_flags_1_set_off @@ -3046,7 +3057,7 @@ Label(lblDone)) #define object_flags_1_set_off(object_tag, bitfield) \ object_flags_1_set_off_ID, \ object_tag, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: if_object_flags_1_is_set_on @@ -3060,7 +3071,7 @@ Label(lblDone)) #define if_object_flags_1_is_set_on(object_tag, bitfield, label) \ if_object_flags_1_is_set_on_ID, \ object_tag, \ - CharArrayFrom32(bitfield), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -3075,7 +3086,7 @@ Label(lblDone)) #define object_flags_2_set_on(object_tag, bitfield) \ object_flags_2_set_on_ID, \ object_tag, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: object_flags_2_set_off @@ -3089,7 +3100,7 @@ Label(lblDone)) #define object_flags_2_set_off(object_tag, bitfield) \ object_flags_2_set_off_ID, \ object_tag, \ - CharArrayFrom32(bitfield), + CharArrayFrom32Rev(bitfield), /*============================================================================= // name: if_object_flags_2_is_set_on @@ -3103,7 +3114,7 @@ Label(lblDone)) #define if_object_flags_2_is_set_on(object_tag, bitfield, label) \ if_object_flags_2_is_set_on_ID, \ object_tag, \ - CharArrayFrom32(bitfield), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -3140,9 +3151,9 @@ Label(lblDone)) //===========================================================================*/ #define guard_set_pad_preset_ID 0xAB #define guard_set_pad_preset_LENGTH 0x03 -#define guard_set_pad_preset(chr_preset) \ +#define guard_set_pad_preset(pad_preset) \ guard_set_pad_preset_ID, \ - chrarray16(pad_preset), + CharArrayFrom16Rev(pad_preset), /*============================================================================= // name: chr_set_pad_preset @@ -3151,10 +3162,10 @@ Label(lblDone)) //===========================================================================*/ #define chr_set_pad_preset_ID 0xAC #define chr_set_pad_preset_LENGTH 0x04 -#define chr_set_pad_preset(chr_num, chr_preset) \ +#define chr_set_pad_preset(chr_num, pad_preset) \ chr_set_pad_preset_ID, \ chr_num, \ - chrarray16(pad_preset), + CharArrayFrom16Rev(pad_preset), /*============================================================================= // name: debug_log @@ -3246,7 +3257,7 @@ Label(lblDone)) #define if_local_timer_less_than_LENGTH 0x05 #define if_local_timer_less_than(time60, label) \ if_local_timer_less_than_ID, \ - CharArrayFrom24(time60), \ + CharArrayFrom24Rev(time60), \ label, /*============================================================================= @@ -3261,7 +3272,7 @@ Label(lblDone)) #define if_local_timer_greater_than_LENGTH 0x05 #define if_local_timer_greater_than(time60, label) \ if_local_timer_greater_than_ID, \ - CharArrayFrom24(time60), \ + CharArrayFrom24Rev(time60), \ label, /*============================================================================= @@ -3298,7 +3309,7 @@ Label(lblDone)) #define hud_countdown_set_LENGTH 0x03 #define hud_countdown_set(seconds) \ hud_countdown_set_ID, \ - CharArrayFrom16(seconds), + CharArrayFrom16Rev(seconds), /*============================================================================= // name: hud_countdown_stop @@ -3345,7 +3356,7 @@ Label(lblDone)) #define if_hud_countdown_less_than_LENGTH 0x04 #define if_hud_countdown_less_than(seconds, label) \ if_hud_countdown_less_than_ID, \ - CharArrayFrom16(seconds), \ + CharArrayFrom16Rev(seconds), \ label, /*============================================================================= @@ -3360,7 +3371,7 @@ Label(lblDone)) #define if_hud_countdown_greater_than_LENGTH 0x04 #define if_hud_countdown_greater_than(seconds, label) \ if_hud_countdown_greater_than_ID, \ - CharArrayFrom16(seconds), \ + CharArrayFrom16Rev(seconds), \ label, /*============================================================================= @@ -3377,9 +3388,9 @@ Label(lblDone)) chr_try_spawning_at_pad_ID, \ body_num, \ head_num, \ - CharArrayFrom16(pad), \ - CharArrayFrom16(ai_list), \ - CharArrayFrom32(bitfield), \ + CharArrayFrom16Rev(pad), \ + CharArrayFrom16Rev(ai_list), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -3398,8 +3409,8 @@ Label(lblDone)) body_num, \ head_num, \ chr_num_target, \ - CharArrayFrom16(ai_list), \ - CharArrayFrom32(bitfield), \ + CharArrayFrom16Rev(ai_list), \ + CharArrayFrom32Rev(bitfield), \ label, /*============================================================================= @@ -3415,9 +3426,9 @@ Label(lblDone)) #define guard_try_spawning_item_LENGTH 0x09 #define guard_try_spawning_item(prop_num, item_num, prop_bitfield, label) \ guard_try_spawning_item_ID, \ - CharArrayFrom16(prop_num), \ + CharArrayFrom16Rev(prop_num), \ item_num, \ - CharArrayFrom32(prop_bitfield), \ + CharArrayFrom32Rev(prop_bitfield), \ label, /*============================================================================= @@ -3432,8 +3443,8 @@ Label(lblDone)) #define guard_try_spawning_hat_LENGTH 0x08 #define guard_try_spawning_hat(prop_num, prop_bitfield, label) \ guard_try_spawning_hat_ID, \ - CharArrayFrom16(prop_num), \ - CharArrayFrom32(prop_bitfield), \ + CharArrayFrom16Rev(prop_num), \ + CharArrayFrom32Rev(prop_bitfield), \ label, /*============================================================================= @@ -3449,7 +3460,7 @@ Label(lblDone)) #define chr_try_spawning_clone(chr_num, ai_list, label) \ chr_try_spawning_clone_ID, \ chr_num, \ - CharArrayFrom16(ai_list), \ + CharArrayFrom16Rev(ai_list), \ label, /*============================================================================= @@ -3464,7 +3475,7 @@ Label(lblDone)) #define text_print_bottom_LENGTH 0x03 #define text_print_bottom(text_slot) \ text_print_bottom_ID, \ - chrarray16(text_slot), + CharArrayFrom16Rev(text_slot), /*============================================================================= // name: text_print_top @@ -3478,7 +3489,7 @@ Label(lblDone)) #define text_print_top_LENGTH 0x03 #define text_print_top(text_slot) \ text_print_top_ID, \ - chrarray16(text_slot), + CharArrayFrom16Rev(text_slot), /*============================================================================= // name: sfx_play @@ -3495,7 +3506,7 @@ Label(lblDone)) #define sfx_play_LENGTH 0x04 #define sfx_play(sound_num, channel_num) \ sfx_play_ID, \ - chrarray16(sound_num), \ + CharArrayFrom16Rev(sound_num), \ channel_num, /*============================================================================= @@ -3512,7 +3523,7 @@ Label(lblDone)) sfx_emit_from_object_ID, \ channel_num, \ object_tag, \ - CharArrayFrom16(vol_decay_time60), + CharArrayFrom16Rev(vol_decay_time60), /*============================================================================= // name: sfx_emit_from_pad @@ -3527,8 +3538,8 @@ Label(lblDone)) #define sfx_emit_from_pad(channel_num, pad, vol_decay_time60) \ sfx_emit_from_pad_ID, \ channel_num, \ - CharArrayFrom16(pad), \ - CharArrayFrom16(vol_decay_time60), + CharArrayFrom16Rev(pad), \ + CharArrayFrom16Rev(vol_decay_time60), /*============================================================================= // name: sfx_set_channel_volume @@ -3543,8 +3554,8 @@ Label(lblDone)) #define sfx_set_channel_volume(channel_num, target_volume, transition_time60) \ sfx_set_channel_volume_ID, \ channel_num, \ - CharArrayFrom16(target_volume), \ - CharArrayFrom16(transition_time60), + CharArrayFrom16Rev(target_volume), \ + CharArrayFrom16Rev(transition_time60), /*============================================================================= // name: sfx_fade_channel_volume @@ -3559,8 +3570,8 @@ Label(lblDone)) #define sfx_fade_channel_volume(channel_num, fade_volume_percent, fade_time60) \ sfx_fade_channel_volume_ID, \ channel_num, \ - CharArrayFrom16(fade_volume_percent), \ - CharArrayFrom16(fade_time60), + CharArrayFrom16Rev(fade_volume_percent), \ + CharArrayFrom16Rev(fade_time60), /*============================================================================= // name: sfx_stop_channel @@ -3586,7 +3597,7 @@ Label(lblDone)) #define if_sfx_channel_volume_less_than(channel_num, volume, label) \ if_sfx_channel_volume_less_than_ID, \ channel_num, \ - CharArrayFrom16(volume), \ + CharArrayFrom16Rev(volume), \ label, /*============================================================================= @@ -3612,8 +3623,8 @@ Label(lblDone)) #define vehicle_speed_LENGTH 0x05 #define vehicle_speed(top_speed, acceleration_time60) \ vehicle_speed_ID, \ - CharArrayFrom16(top_speed), \ - CharArrayFrom16(acceleration_time60), + CharArrayFrom16Rev(top_speed), \ + CharArrayFrom16Rev(acceleration_time60), /*============================================================================= // name: aircraft_rotor_speed @@ -3627,8 +3638,8 @@ Label(lblDone)) #define aircraft_rotor_speed_LENGTH 0x05 #define aircraft_rotor_speed(rotor_speed, acceleration_time60) \ aircraft_rotor_speed_ID, \ - CharArrayFrom16(rotor_speed), \ - CharArrayFrom16(acceleration_time60), + CharArrayFrom16Rev(rotor_speed), \ + CharArrayFrom16Rev(acceleration_time60), /*============================================================================= // name: if_camera_is_in_intro @@ -3728,7 +3739,7 @@ Label(lblDone)) #define camera_look_at_bond_from_pad_LENGTH 0x03 #define camera_look_at_bond_from_pad(pad) \ camera_look_at_bond_from_pad_ID, \ - CharArrayFrom16(pad), + CharArrayFrom16Rev(pad), /*============================================================================= // name: camera_switch @@ -3747,8 +3758,8 @@ Label(lblDone)) #define camera_switch(object_tag, look_at_bond_flag, unused_flag) \ camera_switch_ID, \ object_tag, \ - CharArrayFrom16(look_at_bond_flag), \ - CharArrayFrom16(unused_flag), + CharArrayFrom16Rev(look_at_bond_flag), \ + CharArrayFrom16Rev(unused_flag), /*============================================================================= // name: if_bond_y_pos_less_than @@ -3763,7 +3774,7 @@ Label(lblDone)) #define if_bond_y_pos_less_than_LENGTH 0x04 #define if_bond_y_pos_less_than(y_pos, label) \ if_bond_y_pos_less_than_ID, \ - CharArrayFrom16(y_pos), \ + CharArrayFrom16Rev(y_pos), \ label, /*============================================================================= @@ -3807,7 +3818,7 @@ Label(lblDone)) #define chr_try_teleporting_to_pad(chr_num, pad, label) \ chr_try_teleporting_to_pad_ID, \ chr_num, \ - chrarray16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -3979,7 +3990,7 @@ Label(lblDone)) #define if_object_in_room_with_pad(object_tag, pad, label) \ if_object_in_room_with_pad_ID, \ object_tag, \ - chrarray16(pad), \ + CharArrayFrom16Rev(pad), \ label, /*============================================================================= @@ -4012,10 +4023,10 @@ Label(lblDone)) // note: this command can't be stopped after executing. level must have a fog // assigned or will crash! //===========================================================================*/ -#define gas_leak_and_switch_fog_ID 0xE9 -#define gas_leak_and_switch_fog_LENGTH 0x01 -#define gas_leak_and_switch_fog \ - gas_leak_and_switch_fog_ID, +#define switch_fog_instantly_ID 0xE9 +#define switch_fog_instantly_LENGTH 0x01 +#define switch_fog_instantly \ + switch_fog_instantly_ID, /*============================================================================= // name: trigger_fade_and_exit_level_on_button_press @@ -4088,12 +4099,12 @@ Label(lblDone)) #define camera_orbit_pad_LENGTH 0x0D #define camera_orbit_pad(lat_distance, vert_distance, orbit_speed60, pad, y_pos_offset, initial_rotation) \ camera_orbit_pad_ID, \ - CharArrayFrom16(lat_distance), \ - CharArrayFrom16(vert_distance), \ - CharArrayFrom16(orbit_speed60), \ - CharArrayFrom16(pad), \ - CharArrayFrom16(y_pos_offset), \ - CharArrayFrom16(initial_rotation), + CharArrayFrom16Rev(lat_distance), \ + CharArrayFrom16Rev(vert_distance), \ + CharArrayFrom16Rev(orbit_speed60), \ + CharArrayFrom16Rev(pad), \ + CharArrayFrom16Rev(y_pos_offset), \ + CharArrayFrom16Rev(initial_rotation), /*============================================================================= // name: credits_roll @@ -4293,3 +4304,5 @@ Label(lblDone)) #endif #endif + + diff --git a/src/bondconstants.h b/src/bondconstants.h index 5373fc14..8577cb67 100644 --- a/src/bondconstants.h +++ b/src/bondconstants.h @@ -224,6 +224,27 @@ typedef enum CHRFLAG CHRFLAG_80000000 = 0x80000000 // unknown }CHRFLAG; +// collision detection types +typedef enum CDTYPE +{ + CDTYPE_OBJS = 0x0001, + CDTYPE_DOORS = 0x0002, + CDTYPE_PLAYERS = 0x0004, + CDTYPE_CHRS = 0x0008, + CDTYPE_PATHBLOCKER = 0x0010, // glass and scenery with OBJFLAG_PATHBLOCKER + CDTYPE_BG = 0x0020, + CDTYPE_OBJSIMMUNETOGUNFIRE = 0x0080, + CDTYPE_AIOPAQUE = 0x0100, // exclude objects with OBJFLAG_AISEETHROUGH + CDTYPE_OBJSIMMUNETOEXPLOSIONS = 0x0200, + CDTYPE_OBJSNOTSAFEORHELI = 0x0400, + CDTYPE_DOORSWITHOUTFLAG = 0x0800, + CDTYPE_CLOSEDDOORS = 0x1000, + CDTYPE_OPENDOORS = 0x2000, + CDTYPE_AJARDOORS = 0x4000, + CDTYPE_DOORSLOCKEDTOAI = 0x8000, + CDTYPE_ALL = 0x003f +} CDTYPE; + typedef enum GUARD_SETUP_FLAG // u16 { GUARD_SETUP_FLAG_NONE = 0, @@ -260,82 +281,124 @@ BITFLAG(PS_FLAGS2, // prop definition flags typedef enum PROPFLAG { - PROPFLAG_00000001 = 0x00000001, // unknown - PROPFLAG_ONSCREEN = 0x00000002, // onscreen - PROPFLAG_ENABLED = 0x00000004, // unknown - PROPFLAG_00000008 = 0x00000008, // unknown - PROPFLAG_00000010 = 0x00000010, // unknown - PROPFLAG_00000020 = 0x00000020, // unknown - PROPFLAG_00000040 = 0x00000040, // unknown - PROPFLAG_00000080 = 0x00000080, // unknown - PROPFLAG_00000100 = 0x00000100, // unknown - PROPFLAG_00000200 = 0x00000200, // unknown + PROPFLAG_RENDERPOSTBG = 0x00000001, // Fall to Ground + PROPFLAG_ONSCREEN = 0x00000002, // In Air Rotated 90 Deg Upside-Down + PROPFLAG_ENABLED = 0x00000004, // In Air Upside-Down + PROPFLAG_00000008 = 0x00000008, // In Air + PROPFLAG_00000010 = 0x00000010, // Scale to Pad Bounds + PROPFLAG_00000020 = 0x00000020, // Scale X to Pad Bounds + PROPFLAG_00000040 = 0x00000040, // Scale Y to Pad Bounds + PROPFLAG_00000080 = 0x00000080, // Scale Z to Pad Bounds + PROPFLAG_00000100 = 0x00000100, // Force Collisions + PROPFLAG_00000200 = 0x00000200, // Glass Env Mapping Style PROPFLAG_ILLUMINATED = 0x00000400, /* ignore Stan Colour?*/ - PROPFLAG_00000800 = 0x00000800, // unknown - PROPFLAG_00001000 = 0x00001000, // unknown + PROPFLAG_00000800 = 0x00000800, // Free Standing Glass + PROPFLAG_00001000 = 0x00001000, // Absolute Position PROPFLAG_AIUNDROPPABLE = 0x00002000, /* Item Not Droppedz*/ - PROPFLAG_ASSIGNEDTOCHR = 0x00004000, // unknown - PROPFLAG_00008000 = 0x00008000, // unknown - PROPFLAG_00010000 = 0x00010000, // unknown - PROPFLAG_00020000 = 0x00020000, // unknown - PROPFLAG_00040000 = 0x00040000, // unknown - PROPFLAG_00080000 = 0x00080000, // unknown + PROPFLAG_ASSIGNEDTOCHR = 0x00004000, // Assigned to Actor + PROPFLAG_INSIDEANOTHEROBJ = 0x00008000, // Embedded Object + PROPFLAG_FORCEMORTAL = 0x00010000, // unknown + PROPFLAG_INVINCIBLE = 0x00020000, // Invincible + PROPFLAG_00040000 = 0x00040000, // Allow Pickup (chr_type) + PROPFLAG_00080000 = 0x00080000, // Collect Object by Interaction Button Only PROPFLAG_UNCOLLECTABLE = 0x00100000, /* Item Not Collectable*/ - PROPFLAG_00200000 = 0x00200000, // unknown + PROPFLAG_00200000 = 0x00200000, // Bounce and Destroy If Shot PROPFLAG_00400000 = 0x00400000, // unknown PROPFLAG_00800000 = 0x00800000, // unknown - PROPFLAG_01000000 = 0x01000000, // unknown - PROPFLAG_02000000 = 0x02000000, // unknown - PROPFLAG_04000000 = 0x04000000, // unknown - PROPFLAG_08000000 = 0x08000000, // unknown - PROPFLAG_WEAPON_LEFTHANDED = 0x10000000, /* Left Handed*/ - PROPFLAG_NO_AI_INTERACTION = 0x20000000, /* Concealed*/ - PROPFLAG_40000000 = 0x40000000, /* No Ammo on pickup*/ - PROPFLAG_80000000 = 0x80000000 // unknown + PROPFLAG_01000000 = 0x01000000, // Embedded Object + PROPFLAG_CANNOT_ACTIVATE = 0x02000000, // Cannot Activate Door/Object + PROPFLAG_04000000 = 0x04000000, // AI Sees Through Door/Object + PROPFLAG_DOOR_TWOWAY = 0x08000000, // Open Away From Player + PROPFLAG_WEAPON_LEFTHANDED = 0x10000000, /* Area Behind Door Invisible/Monitor Fixed/Left-Handed weapon/Disable security camera/drone gun*/ + PROPFLAG_CULL_BEHIND_DOOR = 0x10000000, + PROPFLAG_FIXED_MONITOR = 0x10000000, + PROPFLAG_CCTV_DISABLED = 0x10000000, + PROPFLAG_IS_DRONE_GUN = 0x10000000, + PROPFLAG_DOOR_OPENTOFRONT = 0x20000000, /* Open Backwards/Special Function/Conceal Weapon*/ + PROPFLAG_SPECIAL_FUNC = 0x20000000, + PROPFLAG_CONCEAL_GUN = 0x20000000, + PROPFLAG_MONITOR_RENDERPOSTBG = 0x40000000, /* No Ammo on pickup / Area Behind Door Visible*/ + PROPFLAG_NO_PORTAL_CLOSE = 0x40000000, + PROPFLAG_NO_AMMO = 0x40000000, + PROPFLAG_80000000 = 0x80000000, // Open By Default/Weapon Paired for Player + PROPFLAG_IS_DOUBLE = 0x80000000 }PROPFLAG; // prop definition flags typedef enum PROPFLAG2 { - PROPFLAG2_00000001 = 0x00000001, // unknown - PROPFLAG2_00000002 = 0x00000002, // unknown - PROPFLAG2_00000004 = 0x00000004, // unknown - PROPFLAG2_00000008 = 0x00000008, // unknown - PROPFLAG2_00000010 = 0x00000010, // unknown - PROPFLAG2_00000020 = 0x00000020, // unknown - PROPFLAG2_00000040 = 0x00000040, // unknown - PROPFLAG2_00000080 = 0x00000080, // unknown - PROPFLAG2_00000100 = 0x00000100, // unknown - PROPFLAG2_00000200 = 0x00000200, // unknown - PROPFLAG2_00000400 = 0x00000400, // unknown - PROPFLAG2_00000800 = 0x00000800, // unknown - PROPFLAG2_00001000 = 0x00001000, // unknown - PROPFLAG2_00002000 = 0x00002000, // unknown - PROPFLAG2_00004000 = 0x00004000, // unknown - PROPFLAG2_00008000 = 0x00008000, // unknown - PROPFLAG2_00010000 = 0x00010000, // unknown - PROPFLAG2_00020000 = 0x00020000, // unknown - PROPFLAG2_00040000 = 0x00040000, // unknown - PROPFLAG2_00080000 = 0x00080000, // unknown - PROPFLAG2_00100000 = 0x00100000, // unknown - PROPFLAG2_00200000 = 0x00200000, // unknown - PROPFLAG2_00400000 = 0x00400000, // unknown - PROPFLAG2_00800000 = 0x00800000, // unknown - PROPFLAG2_01000000 = 0x01000000, // unknown - PROPFLAG2_02000000 = 0x02000000, // unknown - PROPFLAG2_04000000 = 0x04000000, // unknown - PROPFLAG2_08000000 = 0x08000000, // unknown - PROPFLAG2_10000000 = 0x10000000, // unknown - PROPFLAG2_20000000 = 0x20000000, // unknown - PROPFLAG2_40000000 = 0x40000000, // unknown - PROPFLAG2_80000000 = 0x80000000 // unknown -}PROPFLAG2; + PROPFLAG2_00000001 = 0x00000001, // Activate Drone Gun + PROPFLAG2_00000002 = 0x00000002, // lightweight (move when shot) + PROPFLAG2_00000004 = 0x00000004, // Interaction Text Not Shown for Doors + PROPFLAG2_00000008 = 0x00000008, // Don't Load in Multiplayer + PROPFLAG2_00000010 = 0x00000010, // Don't Load on Agent Mode + PROPFLAG2_00000020 = 0x00000020, // Don't Load on Secret Agent Mode + PROPFLAG2_00000040 = 0x00000040, // Don't Load on 00 Agent Mode + PROPFLAG2_00000080 = 0x00000080, // Don't Load on 007 Mode + PROPFLAG2_NOFALL = 0x00000100, // immobile + PROPFLAG2_FALLWITHOUTROTATION = 0x00000200, // used with mines + PROPFLAG2_LINKEDTOSAFE = 0x00000400, // unknown + PROPFLAG2_INTERACTCHECKLOS = 0x00000800, // Don't activate if stan gap Bond/Object + PROPFLAG2_00001000 = 0x00001000, // Watch Magnet Attract through Walls/Objects + PROPFLAG2_00002000 = 0x00002000, // Remove When Destroyed + PROPFLAG2_00004000 = 0x00004000, // Immune to Gunfire + PROPFLAG2_SHOOTTHROUGH = 0x00008000, // Can Shoot Through Object + PROPFLAG2_00010000 = 0x00010000, // Always Visible (in front) + PROPFLAG2_00020000 = 0x00020000, // unknown + PROPFLAG2_00040000 = 0x00040000, // Hide inventory item (for tagged armor/ammo/magazine) + PROPFLAG2_00080000 = 0x00080000, // Invincible Except to Explosions + PROPFLAG2_00100000 = 0x00100000, // Bulletproof Glass + PROPFLAG2_00200000 = 0x00200000, // Immune to Explosions + PROPFLAG2_00400000 = 0x00400000, // Don't load on 2P + PROPFLAG2_00800000 = 0x00800000, // Don't load on 3P + PROPFLAG2_01000000 = 0x01000000, // Don't load on 4P + PROPFLAG2_THROWTHROUGH = 0x02000000, // Rockets/Mines/Grenades Pass Through + PROPFLAG2_04000000 = 0x04000000, // unknown + PROPFLAG2_08000000 = 0x08000000, // One-Way Lock (Front) + PROPFLAG2_10000000 = 0x10000000, // One-Way Lock (Back) + PROPFLAG2_20000000 = 0x20000000, // Character AI Cannot Operate + PROPFLAG2_40000000 = 0x40000000, // Deactivate Special Feature + PROPFLAG2_DOOR_ALTCOORDSYSTEM = 0x80000000 // Massive Explosion (08 Type)/Rotating Disabled Drone Gun (0D Type) +} PROPFLAG2; typedef enum DOORFLAG { - DOORFLAG_100 = 0x00000100, - DOORFLAG_CANNOT_ACTIVATE = 0x02000000, - DOORFLAG_KEEPOPEN = 0x80000000 -}DOORFLAG; + DOORFLAG_080 = 0x00000080, + DOORFLAG_100 = 0x00000100, + DOORFLAG_CANNOT_ACTIVATE = 0x02000000, + DOORFLAG_KEEPOPEN = 0x80000000 + +} DOORFLAG; + +typedef enum DROPTYPE +{ + DROPTYPE_DEFAULT = 1, + DROPTYPE_SURRENDER = 2, + DROPTYPE_THROWGRENADE = 3, + DROPTYPE_HAT = 4 +} DROPTYPE; + +typedef enum PROJECTILEFLAG +{ + PROJECTILEFLAG_AIRBORNE = 0x00000001, + PROJECTILEFLAG_00000002 = 0x00000002, + PROJECTILEFLAG_STICKY = 0x00000004, + PROJECTILEFLAG_POWERED = 0x00000010, + PROJECTILEFLAG_00000020 = 0x00000020, + PROJECTILEFLAG_LAUNCHING = 0x00000080, + PROJECTILEFLAG_00000100 = 0x00000100, + PROJECTILEFLAG_FALLING = 0x00000400, + PROJECTILEFLAG_SLIDING = 0x00000800, + PROJECTILEFLAG_00001000 = 0x00001000, + PROJECTILEFLAG_00002000 = 0x00002000, + PROJECTILEFLAG_NOTIMELIMIT = 0x00004000, + PROJECTILEFLAG_INROOM = 0x00008000, + PROJECTILEFLAG_00010000 = 0x00010000, + PROJECTILEFLAG_LIGHTWEIGHT = 0x40000000, + PROJECTILEFLAG_FREE = 0x80000000 +} PROJECTILE_FLAG; + +// Might be the same flags as PROJECTILEFLAG +#define EMBEDMENTFLAG_FREE 0x00000001 /* door lock flags*/ BITFLAG(DOOR_LOCK, @@ -371,23 +434,23 @@ BITFLAG(RUNTIMEBITFLAG, 00000001, 00000002, REMOVE, /* removes object when set */ - 00000008, + ISRETICK, 00000010, THROWING_KNIFE_RELATED, - 00000040, + EMBEDDED, DEPOSIT, /* depositted (thrown/launching) */ 00000100, BEENOPENED, DESTROYED, /* only set with disabled or destroyed doors */ 00000800, 00001000, - 00002000, + PADLOCKEDDOOR, ACTIVATED, /* activated */ 00008000, 00010000, 00020000, /* owner 2bit (0-3) used to */ 00040000, /* attribute kills to players */ - 00080000, + HASOWNER, 00100000, 00200000, 00400000, @@ -405,6 +468,42 @@ BITFLAG(RUNTIMEBITFLAG, #define RUNTIMEBITFLAG_OWNER 0x60000 #define RUNTIMEBITSHIFT_OWNER 0x11 +BITFLAG(WEAPONSTATBITFLAG, + 00000001, + SINGLE_USE_RELOAD, /* skip from fire to reload animation; item "disappears" after use, redrawn from off-screen like knives" */ + BURST_FIRE, /* fire three round burst*/ + HAS_AUTO_AIM, /* auto aim capable*/ + CLICKY, /* if holding trigger, click if empty */ + 00000020, + 00000040, + 00000080, + ONLY_1_HANDED, /* requires HOLD_AS_GUN as well */ + HOLD_AS_GUN, /* default 2 handed*/ + MIRROR_DUAL, /* mirror double weapon, not copy */ + SHOW_FIRST_PERSON, /* display 1st person model */ + FIRST_SHOT_ACCURACY, /* for a single first shot, inaccuracy multiplied by 0.25 */ + HIDE_FIRST_PERSON_HAND, /* hide first person model in hand */ + HIDE_FIRST_PERSON_MENU, /* hide first person model in menu */ + DISABLE_CROUCH, /* can not crouch */ + PLAYER_STAT_HIT, /* count hits in player statistics */ + USE_HOLD_TIME, /* increment hold time when used, to consider as weapon of choice */ + HAS_AMMO, + HIDE_AMMO_DISPLAY, /* do not display ammo on screen */ + CAN_DUAL_WIELD, /* capable of doubles */ + AMMO_CLIP_LIMIT, /* limit ammo to assigned value on clip */ + NO_CLIP_RELOADS, /* no ammo clip/reloads - draw straight from ammo supply (right of icon) */ + 00800000, + 01000000, + 02000000, + 04000000, + 08000000, + 10000000, + 20000000, + 40000000, + 80000000 +) + + #define OBJECTTYPE_00 0x00 #define OBJECTTYPE_01 0x01 #define OBJECTTYPE_02 0x02 @@ -458,6 +557,14 @@ BITFLAG(RUNTIMEBITFLAG, #pragma region Constants +#define SP_BOOT_SZ 0x10 +#define SP_RMON_SZ 0x300 +#define SP_IDLE_SZ 0x40 +#define SP_SHED_SZ 0x200 +#define SP_MAIN_SZ 0x8000 +#define SP_AUDI_SZ 0x1000 +#define SP_DEBUG_SZ 0x6B0 + /* Enums Index by adding 1 to the list from the first value, unless this value is not 0, it should not be set for every item @@ -798,28 +905,103 @@ typedef enum CHEAT_IDS typedef enum CONTROLLER_CONFIG { + /* 1.1 */ CONTROLLER_CONFIG_HONEY, + + /* 1.2 */ CONTROLLER_CONFIG_SOLITARE, + + /* 1.3 */ CONTROLLER_CONFIG_KISSY, + + /* 1.4 */ CONTROLLER_CONFIG_GOODNIGHT, + + /* 2.1 */ CONTROLLER_CONFIG_PLENTY, + + /* 2.2 */ CONTROLLER_CONFIG_GALORE, + + /* 2.3 */ CONTROLLER_CONFIG_DOMINO, + + /* 2.4 */ CONTROLLER_CONFIG_GOODHEAD, + CONTROLLER_CONFIG_CINEMA } CONTROLLER_CONFIG; +enum WALLETBOND_SWITCHNAMES +{ + SW_TABS, + SW_PAPER, + SW_EYESONLY, + SW_OHMSS, + SW_CONFIDENTIAL, + SW_CONFIDENTIAL2, + SW_CLASSIFIED, + SW_PHOTOBOND, + SW_BROSNAN, + SW_CONNERY, + SW_DALTON, + SW_MOORE, + SW_PHOTOBRIEF, + SW_COVER, + SW_PHOTOCOVER, + SW_BROSNANCOVER, + SW_CONNERYCOVER, + SW_DALTONCOVER, + SW_MOORECOVER, + SW_SLIDES, + SW_PICS, + GFXHIT0_PICS, + SW_BRIEF1, + SW_BRIEF2, + SW_BRIEF3, + SW_BRIEF4, + SW_BRIEF5, + SW_BRIEF6, + SW_BRIEF7, + SW_BRIEF8, + SW_BRIEF9, + SW_BRIEF10, + SW_BRIEF11, + SW_BRIEF12, + SW_BRIEF13, + SW_BRIEF14, + SW_BRIEF15, + SW_BRIEF16, + SW_BRIEF17, + SW_BRIEF18, + SW_BRIEF19, + SW_BRIEF20, + SW_BLANK +} ; + +typedef enum GAMELENGTH +{ + LEN_UNLIMITED, + LEN_5MIN, + LEN_10MIN, + LEN_20MIN, + LEN_5PT, + LEN_10PT, + LEN_20PT, + LEN_LAST +} GAMELENGTH; + typedef enum CUFF_TYPES { CUFF_BLUE, - CUFF_TUX, + CUFF_BROSNAN, CUFF_JUNGLE, CUFF_BOILER, CUFF_SNOW, - CUFF_WHITE, - CUFF_TUX6, - CUFF_TUX7, - CUFF_TUX8 + CUFF_CONNERY, + CUFF_DALTON, + CUFF_MOORE, + CUFF_FOLDER } CUFF_TYPES; typedef enum CREDITS_ALIGNMENT @@ -918,6 +1100,7 @@ typedef enum DEBUG_OPTIONS DEB_FOG } DEBUG_MODES; + typedef enum DIFFICULTY { DIFFICULTY_MULTI = -1, @@ -962,6 +1145,37 @@ typedef enum E_EXPLOSIONTYPE E_EXPLOSIONTYPE_COUNT } E_EXPLOSIONTYPE; +/* index into array_explosion_types. +* Is this the same as E_EXPLOSIONTYPE ? +* Some names are based on logic in chrobjWeaponTick method. +*/ +typedef enum EXPLOSION_DEF +{ + EXPLOSION_DEF_00, + EXPLOSION_DEF_01, + EXPLOSION_DEF_02, + EXPLOSION_DEF_03, + EXPLOSION_DEF_04, + EXPLOSION_DEF_05, + EXPLOSION_DEF_06, + EXPLOSION_DEF_07, + EXPLOSION_DEF_08, + EXPLOSION_DEF_09, + EXPLOSION_DEF_10, + EXPLOSION_DEF_11, + EXPLOSION_DEF_DRONE, + // used with grenades and mines + EXPLOSION_DEF_STANDARD, + EXPLOSION_DEF_14, + EXPLOSION_DEF_15, + EXPLOSION_DEF_16, + EXPLOSION_DEF_MASSIVE, + EXPLOSION_DEF_PLAYER, + EXPLOSION_DEF_FACILITY_REMOTE, + EXPLOSION_DEF_20, + EXPLOSION_DEF_21 +} EXPLOSION_DEF; + typedef enum GAMEMODE { GAMEMODE_INTRO = -1, @@ -977,29 +1191,25 @@ typedef enum GUNHAND //Canonical name } GUNHAND; -#define HIT_TYPES(HIT) \ - HIT DEFAULT \ - HIT STONE \ - HIT WOOD \ - HIT METAL \ - HIT GLASS \ - HIT WATER \ - HIT SNOW \ - HIT DIRT \ - HIT MUD \ - HIT TILE \ - HIT METALOBJ \ - HIT CHR \ - HIT GLASS_XLU /*Hit Type for triangle (Canonical name)*/ typedef enum HIT_TYPE { - CREATE_TYPES(ENUM, HIT, HIT_TYPES) + HIT_DEFAULT, + HIT_STONE, + HIT_WOOD, + HIT_METAL, + HIT_GLASS, + HIT_WATER, + HIT_SNOW, + HIT_DIRT, + HIT_MUD, + HIT_TILE, + HIT_METALOBJ, + HIT_CHR, + HIT_GLASS_XLU, HIT_TYPE_COUNT -}HIT_TYPE; -#ifdef DEBUG - char *HIT_TYPE_ToString[] = { CREATE_TYPES(STRINGS, HIT, HIT_TYPES) }; -#endif +} HIT_TYPE; + #define IMAGE(NAME, SZ, HS, HT, F3, F4, F5, F6) IMAGE_ ## NAME, typedef enum IMAGEIDS @@ -1064,7 +1274,12 @@ typedef enum LEVELID LEVELID_WAX, LEVELID_PAM, LEVELID_MAX, - LEVELID_TITLE = 90 + LEVELID_TITLE = 90, + LEVELID_BUNKER2_MP = LEVELID_BUNKER2 + ENVIRONMENTDATA_PLAYERS_4, + LEVELID_ARCHIVES_MP = LEVELID_ARCHIVES + ENVIRONMENTDATA_PLAYERS_4, + LEVELID_CAVERNS_MP = LEVELID_CAVERNS + ENVIRONMENTDATA_PLAYERS_4, + LEVELID_FACILITY_MP = LEVELID_FACILITY + ENVIRONMENTDATA_PLAYERS_4, + LEVELID_EGYPT_MP = LEVELID_EGYPT + ENVIRONMENTDATA_PLAYERS_4 } LEVELID; typedef enum LEVEL_SOLO_SEQUENCE @@ -1135,6 +1350,17 @@ typedef enum LEVEL_INDEX LEVEL_INDEX_MAX = LEVEL_INDEX_X } LEVEL_INDEX; +typedef enum TEXT_ALIGNMENT +{ + LEFT_ALIGN, + CENTER_ALIGN, + RIGHT_ALIGN, + TOP_ALIGN = LEFT_ALIGN, + BOTTOM_ALIGN = RIGHT_ALIGN +} TEXT_ALIGNMENT; + + + typedef enum MENU { MENU_INVALID = -1, @@ -1184,30 +1410,30 @@ typedef enum MISSION_BRIEFING typedef enum MODELNODE_OPCODE { MODELNODE_OPCODE_NULL, - MODELNODE_OPCODE_HEADERRECORD, - MODELNODE_OPCODE_GROUPRECORD, - MODELNODE_OPCODE_UNUSED_03, - MODELNODE_OPCODE_DISPLAYLISTRECORD, - MODELNODE_OPCODE_UNUSED_05, - MODELNODE_OPCODE_UNUSED_06, - MODELNODE_OPCODE_OP07RECORD, - MODELNODE_OPCODE_LODRECORD, - MODELNODE_OPCODE_BSPRECORD, - MODELNODE_OPCODE_BOUNDINGBOXRECORD, - MODELNODE_OPCODE_OP11RECORD, - MODELNODE_OPCODE_GUNFIRERECORD, - MODELNODE_OPCODE_SHADOWRECORD, - MODELNODE_OPCODE_OP14RECORD, - MODELNODE_OPCODE_INTERLINKAGERECORD, - MODELNODE_OPCODE_OP16RECORD, - MODELNODE_OPCODE_UNUSED_17, - MODELNODE_OPCODE_SWITCHRECORD, - MODELNODE_OPCODE_UNUSED_19, - MODELNODE_OPCODE_UNUSED_20, - MODELNODE_OPCODE_GROUPSIMPLERECORD, - MODELNODE_OPCODE_DISPLAYLISTPRIMARYRECORD, - MODELNODE_OPCODE_HEADPLACEHOLDERRECORD, - MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD, + MODELNODE_OPCODE_HEADER, + MODELNODE_OPCODE_GROUP, + MODELNODE_OPCODE_OP03, + MODELNODE_OPCODE_DL, + MODELNODE_OPCODE_OP05, + MODELNODE_OPCODE_OP06, + MODELNODE_OPCODE_OP07, + MODELNODE_OPCODE_LOD, + MODELNODE_OPCODE_BSP, + MODELNODE_OPCODE_BBOX, + MODELNODE_OPCODE_OP11, + MODELNODE_OPCODE_GUNFIRE, + MODELNODE_OPCODE_SHADOW, + MODELNODE_OPCODE_OP14, + MODELNODE_OPCODE_INTERLINK, + MODELNODE_OPCODE_OP16, + MODELNODE_OPCODE_OP17, + MODELNODE_OPCODE_SWITCH, + MODELNODE_OPCODE_OP19, + MODELNODE_OPCODE_OP20, + MODELNODE_OPCODE_GROUPSIMPLE, + MODELNODE_OPCODE_DLPRIMARY, + MODELNODE_OPCODE_HEAD, + MODELNODE_OPCODE_DLCOLLISION, MODELNODE_OPCODE_MAX } MODELNODE_OPCODE; @@ -1411,6 +1637,7 @@ typedef enum PLAYER_ID } PLAYER_ID; #define MAX_PLAYER_COUNT 4 +#define MAX_FOLDER_COUNT 4 typedef enum RGBA_ENUM { @@ -2029,14 +2256,30 @@ typedef enum TEXTBANK_LEVEL_INDEX LMISC /* Cheat options */ } TEXTBANK_LEVEL_INDEX; +#define GUNSIGHTREASON_1 0x01 +#define GUNSIGHTREASON_NOTAIMING 0x02 +#define GUNSIGHTREASON_NOCONTROL 0x04 +#define GUNSIGHTREASON_DAMAGE 0x10 +#define GUNAMMOREASON_OPTION 0x01 +#define GUNAMMOREASON_NOCONTROL 0x02 +#define GUNAMMOREASON_DAMAGE 0x08 typedef enum WATCH_ANIMATION_STATE_IDS { WATCH_ANIMATION_0x0 = 0, - WATCH_ANIMATION_0x4 = 4, - WATCH_ANIMATION_0x5 = 5, - WATCH_ANIMATION_0x6 = 6, - WATCH_ANIMATION_0xc = 12 + WATCH_ANIMATION_0x1, + WATCH_ANIMATION_0x2, + WATCH_ANIMATION_0x3, + WATCH_ANIMATION_0x4, + WATCH_ANIMATION_0x5, + WATCH_ANIMATION_0x6, + WATCH_ANIMATION_0x7, + WATCH_ANIMATION_0x8, + WATCH_ANIMATION_0x9, + WATCH_ANIMATION_0xa, + WATCH_ANIMATION_0xb, + WATCH_ANIMATION_0xc, + WATCH_ANIMATION_0xd } WATCH_ANIMATION_STATE; typedef enum WATCH_BRIEFING_PAGE @@ -2097,6 +2340,26 @@ typedef enum SPSEGMENT SPSEGMENT_BG_DL = 15 } SPSEGMENT; +typedef enum TVCMD +{ + TVCMD_STOPSCROLL = 0x00, + TVCMD_SCROLLRELX = 0x01, + TVCMD_SCROLLRELY = 0x02, + TVCMD_SCROLLABSX = 0x03, + TVCMD_SCROLLABSY = 0x04, + TVCMD_SCALEABSX = 0x05, + TVCMD_SCALEABSY = 0x06, + TVCMD_SETTEXTURE = 0x07, + TVCMD_PAUSE = 0x08, + TVCMD_SETCMDLIST = 0x09, + TVCMD_RANDSETCMDLIST = 0x0a, + TVCMD_RESTART = 0x0b, + TVCMD_YIELD = 0x0c, + TVCMD_SETCOLOUR = 0x0d, + TVCMD_ROTATEABS = 0x0e, + TVCMD_ROTATEREL = 0x0f +} TVCMD; + #pragma region Object Instance Stuff typedef enum BODIES { @@ -2105,7 +2368,12 @@ typedef enum SPSEGMENT BODY_Russian_Soldier, BODY_Russian_Infantry, BODY_Janus_Special_Forces, - BODY_Tuxedo, + BODY_Brosnan_Tuxedo, + /* + BODY_Connery_Tuxedo, + BODY_Dalton_Tuxedo, + BODY_Moore_Tuxedo, + */ BODY_Boris, BODY_Ourumov, BODY_Trevelyan_Janus, @@ -2225,11 +2493,16 @@ typedef enum SPSEGMENT HEAD_Female_Mandy, HEAD_Female_Vivien, HEAD_BOND_START, - HEAD_Male_Pierce_Bond_1 = HEAD_BOND_START, - HEAD_Male_Pierce_Bond_2, - HEAD_Male_Pierce_Bond_3, - HEAD_Male_Pierce_Bond_Parka, - HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, + HEAD_Male_Brosnan_Boiler = HEAD_BOND_START, + HEAD_Male_Brosnan_Default, + HEAD_Male_Brosnan_Jungle, + HEAD_Male_Brosnan_Parka, + HEAD_Male_Brosnan_Tuxedo, + /* + HEAD_Male_Connery_Tuxedo, + HEAD_Male_Dalton_Tuxedo, + HEAD_Male_Moore_Tuxedo, + */ HEAD_Natalya_Jungle_Fatigues, HEAD_END, /*The following are some maybe helpfull counts (maybe GE doesnt need them, but thought Id ad while here)*/ @@ -2603,106 +2876,95 @@ typedef enum SPSEGMENT } PROJECTILES; /** For use in Prop Records (Not to be confused with Object (canonical - Prop Definition) Records which use PROPDEF (canonical Name)) */ - #define PROP_TYPES(TYPE)\ - TYPE NUL \ - TYPE OBJ \ - TYPE DOOR \ - TYPE CHR \ - TYPE WEAPON \ - TYPE PLAYER \ - TYPE VIEWER \ - TYPE EXPLOSION \ - TYPE SMOKE - typedef enum PROP_TYPE { - CREATE_TYPES(ENUM, PROP_TYPE, PROP_TYPES) + PROP_TYPE_NUL, + PROP_TYPE_OBJ, + PROP_TYPE_DOOR, + PROP_TYPE_CHR, + PROP_TYPE_WEAPON, + PROP_TYPE_PLAYER, + PROP_TYPE_VIEWER, + PROP_TYPE_EXPLOSION, + PROP_TYPE_SMOKE, PROP_TYPE_MAX } PROP_TYPE; - #ifdef DEBUG - char *PROP_TYPE_ToString[] = { CREATE_TYPES(STRINGS, PROP_TYPE, PROP_TYPES) }; - #endif - #pragma endregion #pragma region PropDef stuff // used by characters /*Action Type to be performed by chr (canonical names)*/ - #define ACT_STATUS(STATUS) \ - STATUS NONE \ - STATUS NORMAL \ - STATUS COVERWAIT \ - STATUS GRENADEWAIT \ - STATUS WAITING \ - STATUS COVERGOTO \ - STATUS COVERBREAK \ - STATUS COVERSEEN \ - STATUS FLANKLEFT \ - STATUS FLANKRIGHT \ - STATUS DODGE \ - STATUS GRENADE \ - STATUS WAITSEEN \ - STATUS WITHDRAW \ - STATUS SHOOTING \ - STATUS SYNCSHOOT \ - STATUS WAITTIMEOUT \ - STATUS COVERTIMEOUT \ - STATUS TRACKING \ - STATUS RETREAT \ - STATUS SURRENDER \ - STATUS TALKING \ - STATUS LISTENING \ - STATUS GOTOALARM \ - STATUS BOTFRIENDFOLLOW \ - STATUS BOTHIDE \ - STATUS BOTPATH \ - STATUS BOTINJURED \ - STATUS BOTNORMAL \ - STATUS BOTSHOOTING \ - STATUS DRUGGED \ - STATUS PANIC \ - STATUS RUNFROMGRENADE \ - STATUS UNARMEDATTACK typedef enum ACT_STATUS { - CREATE_TYPES(ENUM, , ACT_STATUS) - ACT_STATUS_MAX + ACT_STATUS_NONE, + ACT_STATUS_NORMAL, + ACT_STATUS_COVERWAIT, + ACT_STATUS_GRENADEWAIT, + ACT_STATUS_WAITING, + ACT_STATUS_COVERGOTO, + ACT_STATUS_COVERBREAK, + ACT_STATUS_COVERSEEN, + ACT_STATUS_FLANKLEFT, + ACT_STATUS_FLANKRIGHT, + ACT_STATUS_DODGE, + ACT_STATUS_GRENADE, + ACT_STATUS_WAITSEEN, + ACT_STATUS_WITHDRAW, + ACT_STATUS_SHOOTING, + ACT_STATUS_SYNCSHOOT, + ACT_STATUS_WAITTIMEOUT, + ACT_STATUS_COVERTIMEOUT, + ACT_STATUS_TRACKING, + ACT_STATUS_RETREAT, + ACT_STATUS_SURRENDER, + ACT_STATUS_TALKING, + ACT_STATUS_LISTENING, + ACT_STATUS_GOTOALARM, + ACT_STATUS_BOTFRIENDFOLLOW, + ACT_STATUS_BOTHIDE, + ACT_STATUS_BOTPATH, + ACT_STATUS_BOTINJURED, + ACT_STATUS_BOTNORMAL, + ACT_STATUS_BOTSHOOTING, + ACT_STATUS_DRUGGED, + ACT_STATUS_PANIC, + ACT_STATUS_RUNFROMGRENADE, + ACT_STATUS_UNARMEDATTACK, + ACT_STATUS_MAX } ACT_STATUS; - #ifdef DEBUG - char *ACT_STATUS_ToString[] = {CREATE_TYPES(STRINGS, , ACT_STATUS)}; - #endif - - #define ACT_TYPES(ACT) \ - ACT INIT \ - ACT STAND \ - ACT KNEEL \ - ACT ANIM \ - ACT DIE \ - ACT DEAD \ - ACT ARGH \ - ACT PREARGH \ - ACT ATTACK \ - ACT ATTACKWALK \ - ACT ATTACKROLL \ - ACT SIDESTEP \ - ACT JUMPOUT \ - ACT RUNPOS \ - ACT PATROL \ - ACT GOPOS \ - ACT SURRENDER \ - ACT LOOKATTARGET \ - ACT SURPRISED \ - ACT STARTALARM \ - ACT THROWGRENADE \ - ACT TURNDIR \ - ACT TEST \ - ACT BONDINTRO \ - ACT BONDDIE \ - ACT BONDMULTI \ - /* PD ONLY + /*Action Type to be performed by chr (canonical names)*/ + typedef enum ACT_TYPE + { + ACT_INIT, + ACT_STAND, + ACT_KNEEL, + ACT_ANIM, + ACT_DIE, + ACT_DEAD, + ACT_ARGH, + ACT_PREARGH, + ACT_ATTACK, + ACT_ATTACKWALK, + ACT_ATTACKROLL, + ACT_SIDESTEP, + ACT_JUMPOUT, + ACT_RUNPOS, + ACT_PATROL, + ACT_GOPOS, + ACT_SURRENDER, + ACT_LOOKATTARGET, + ACT_SURPRISED, + ACT_STARTALARM, + ACT_THROWGRENADE, + ACT_TURNDIR, + ACT_TEST, + ACT_BONDINTRO, + ACT_BONDDIE, + ACT_BONDMULTI, + /* PD ONLY ACT_BOT_ATTACKSTAND ACT_BOT_ATTACKKNEEL ACT_BOT_ATTACKSTRAFE @@ -2713,18 +2975,10 @@ typedef enum SPSEGMENT ACT_ROBOTATTACK ACT_SKJUMP* */ - /*Action Type to be performed by chr (canonical names)*/ - typedef enum ACT_TYPE - { - CREATE_TYPES(ENUM, ACT, ACT_TYPES) ACT_NULL, ACT_TYPE_MAX } ACT_TYPE; - #ifdef DEBUG - char *ACT_TYPE_ToString[] = {CREATE_TYPES(STRINGS, ACT, ACT_TYPES) "ACT_NULL"}; - #endif - typedef enum AMMOTYPE { @@ -2941,6 +3195,12 @@ typedef enum SPSEGMENT #pragma endregion #pragma region Setup + + /** + * enums were listed in a particular order, it appears the first few are associated with the start/intro + * of a level: + * if (g_CurrentPlayer->redbloodfinished && g_CurrentPlayer->deathanimfinished && (D_80036510 >= CAMERAMODE_SWIRL)) + */ typedef enum CAMERAMODE { CAMERAMODE_NONE, @@ -2948,8 +3208,8 @@ typedef enum SPSEGMENT CAMERAMODE_FADESWIRL, CAMERAMODE_SWIRL, CAMERAMODE_FP, - CAMERAMODE_UNK5, - CAMERAMODE_UNK6, + CAMERAMODE_DEATH_CAM_FIRST, + CAMERAMODE_DEATH_CAM_SECOND, CAMERAMODE_POSEND, CAMERAMODE_FP_NOINPUT, CAMERAMODE_MP, @@ -2989,6 +3249,13 @@ typedef enum SPSEGMENT OBJECTIVESTATUS_FAILED } OBJECTIVESTATUS; + typedef enum TANK_RUN_STATE + { + TANK_RUN_STATE_NOT_RUNNING = 0, + TANK_RUN_STATE_STARTING, + TANK_RUN_STATE_RUNNING + } TANK_RUN_STATE; + #pragma endregion #pragma region VI @@ -3057,15 +3324,21 @@ typedef enum SPSEGMENT #define NUMBER_SHOTGUN_BULLETS 5 #ifdef VERSION_EU -#define NTSC 0 -#define PAL 1 + #define NTSC 0 + #define PAL 1 + #define TICKS_PER_SECOND 50 + #define FRAMES_PER_SECOND 25 #else -#define NTSC 1 -#define PAL 0 + #define NTSC 1 + #define PAL 0 + #define TICKS_PER_SECOND 60 + #define FRAMES_PER_SECOND 30 #endif #pragma endregion +#define S32_MAX 2147483647 +#define U32_MAX 4294967295 #pragma region Inline Macro Functions #ifndef _MATH_EXT_H_ #define M_TAU_F 6.2831855f @@ -3276,6 +3549,15 @@ typedef enum SPSEGMENT #define ARRAYCOUNT(a) (s32)(sizeof(a) / sizeof(a[0])) #define ALIGN8(val) (((val) + 0x7 | 0x7) ^ 0x7) #define RANDOMFRAC() ((f32) randomGetNext() * 2.3283064e-10f) +#define MAXFLOAT ((float)3.40282346638528860e+38) + +#define HUDHALIGN_RIGHT 0 +#define HUDHALIGN_LEFT 1 +#define HUDHALIGN_MIDDLE 2 + +#define HUDVALIGN_BOTTOM 0 +#define HUDVALIGN_TOP 1 +#define HUDVALIGN_MIDDLE 2 #pragma endregion diff --git a/src/bondgame.h b/src/bondgame.h index 73fe11ea..4e765872 100644 --- a/src/bondgame.h +++ b/src/bondgame.h @@ -1,6 +1,9 @@ #ifndef _BONDGAME_H_ #define _BONDGAME_H_ #include +//#include // game ai commands actually... this shouldnt be here as they are only needed by setups +#include // game constants +#include // game structs and types extern u32 *_codeSegmentStart; extern u32 *_codeSegmentEnd; @@ -22,17 +25,17 @@ extern u32 *_gameSegmentVaddrEnd; extern u32 *_gameSegmentRomStart; extern u32 *_gameSegmentRomEnd; +extern u32* _alt_startSegmentRomStart; +extern u32* _alt_startSegmentStart; + +extern u8 sp_boot[SP_BOOT_SZ]; +extern u8 sp_rmon[SP_RMON_SZ]; +extern u8 sp_idle[SP_IDLE_SZ]; +extern u8 sp_shed[SP_SHED_SZ]; +extern u8 sp_main[SP_MAIN_SZ]; +extern u8 sp_audi[SP_AUDI_SZ]; +extern u8 sp_debug[SP_DEBUG_SZ]; -extern u8 sp_boot[]; -extern u8 sp_rmon[]; -extern u8 sp_idle[]; -extern u8 sp_shed[]; -extern u8 sp_main[]; -extern u8 sp_audi[]; -extern u8 sp_debug[]; -//#include // game ai commands actually... this shouldnt be here as they are only needed by setups -#include // game constants -#include // game structs and types #endif diff --git a/src/bondtypes.h b/src/bondtypes.h index a3740b7a..c2215160 100644 --- a/src/bondtypes.h +++ b/src/bondtypes.h @@ -48,7 +48,7 @@ * then move bool to bondtypes.h */ typedef s32 bool; /* Boolean (TRUE/FALSE) */ - +typedef u32 romptr_t; struct object_standard; struct ChrRecord; struct PropRecord; @@ -255,7 +255,6 @@ typedef union IF_ELSE(IS_EMPTY(y))(0)(y),\ IF_ELSE(IS_EMPTY(z))(0)(z) \ } - typedef f32 vec3[3]; //!depreciated /** 16bit Co-Ordinate used for Integer co-ordinates eg, pumping straight to RSP. @@ -359,6 +358,14 @@ typedef union f32 f[8]; }; }rect4f; + + struct rectbbox + { + f32 left; + f32 up; + f32 right; + f32 down; + }; #pragma endregion #pragma endregion @@ -1222,7 +1229,7 @@ typedef union Gfx *Primary; /*0x0*/ Gfx *Secondary; /*0x4*/ // optional Vertex *Vertices; /*0x8*/ - u16 numVertices; /*0xC*/ + s16 numVertices; /*0xC*/ s16 numCollisionVertices; /*0xE*/ Vertex *CollisionVertices; /*0x10 Table of vertices with unique point in space (UV's and Colour are disregarded). */ s16 *PointUsage; /*0x14*/ @@ -1408,25 +1415,22 @@ typedef union f32 unk5c; }; - struct modeldata_unk_pos { - s32 unk00; - f32 p1[2]; - f32 p2[2]; - f32 p3[2]; - }; - /** * I beleve that "datas" is actually " struct modeldata_root" and that * unk1c is the model node data array */ typedef struct Model { - u8 unk00; /*0x00*/ // init_standard_object() indicates that unk00 is a s16... - s16 Type; /*0x01*/ // but sub_GAME_7F075F68() indicates that Type is a s16... + u8 unk00; /*0x00*/ // objInit() indicates that unk00 is a s16... + s16 Type; /*0x01*/ // but modelInit() indicates that Type is a s16... // not sure which is correct. struct ChrRecord *chr; /*0x04*/ ModelFileHeader *obj; /*0x08 GE Name confirmed*/ + + /** + * List of length model->obj->numMatrices dynamically allocated. + */ RenderPosView *render_pos; /*0x0c*/ union ModelRwData **datas; // array of pointers to modeldata structs /*0x10*/ @@ -1458,7 +1462,7 @@ typedef union s16 frameb; s32 unk34; s32 unk38; - f32 unk3c; + f32 endframe; f32 speed; /*0x40*/ f32 newspeed; /*0x44*/ @@ -1468,7 +1472,7 @@ typedef union ModelAnimation *anim2; - s32 unk58; + f32 unk58; f32 unk5c; /** @@ -1487,7 +1491,7 @@ typedef union s32 unk68; f32 unk6c; // 0x70 - f32 unk70; + f32 speed2; s32 unk74; s32 unk78; f32 unk7c; @@ -1508,7 +1512,7 @@ typedef union s32 unk9c; // 0xa0 s32 unka0; - f32 unka4; // used by ACT_STAND in chrlv + f32 playspeed; // used by ACT_STAND in chrlv f32 animrate; f32 unkac; // 0xb0 @@ -1698,14 +1702,14 @@ typedef union struct act_stand { - s32 unk02c; /*0x2c*/ + s32 prestand; /*0x2c*/ s32 face_entitytype; /*0x30*/ s32 face_entityid; /*0x34*/ - s32 unk038; /*0x38*/ - s32 unk03c; /*0x3c*/ - u32 unk040; /*0x40*/ - s32 unk044; /*0x44*/ - f32 unk048; /*0x48*/ + s32 reaim; /*0x38*/ + s32 turning; /*0x3c*/ + u32 checkfacingwall; /*0x40*/ + s32 wallcount; /*0x44*/ + f32 mergetime; /*0x48*/ s8 face_target; /*0x4c*/ }; @@ -2210,7 +2214,7 @@ typedef union /** * Offset 0x10 */ - vec3 delta; + struct coord3d delta; f32 unk1c; f32 unk20; @@ -2218,78 +2222,6 @@ typedef union f32 unk28; } ChrRecord_f180; - typedef struct ObjectRecord_f6c - { - u32 flags; - coord3d pos; - - /** - * Offset 0x10 - */ - vec3d vec; - u32 padding; - - /* - {{1, 0, 0, 0}, - {0, 1, 0, 0}, - {0, 0, 1, 0}, - {0, 0, 0, 1}}; - This is probably not a matrix, only 8 vals are read - Offset 0x20. - */ - Mtxf m; - - u32 unk60; - u32 unk64; - u32 unk68; - u32 unk6c; - - u32 unk70; - u32 unk74; - u32 unk78; - u32 unk7c; - - u32 unk80; - u32 unk84; - // used by sub_GAME_7F05EB0C - PropRecord *prop; - f32 unk8c; - - u32 unk90; - f32 unk94; - ALSoundState *unk98[2]; - //ALSoundState * unk9c; - - u32 unka0; - u32 unka4; - u32 animrate; - u32 unkac; - - f32 unkb0; // runtime y position? - f32 unkb4; // previous pos.y? - u32 unkb8; - u32 refreshrate; - - u32 unkc0; - u32 unkc4; - u32 unkc8; - u32 unkcc; - - u32 unkd0; - u32 unkd4; - u32 unkd8; - u32 unkdc; - - u32 unke0; - /** - * Offset 0xe4. - */ - struct ObjectRecord *parent; - u32 unke8; - u32 unkec; - } ObjectRecord_f6c; - - typedef struct PropDefHeaderRecord { @@ -2454,7 +2386,7 @@ typedef union /* 0x0180 */ /** - * Method chrlvFireWeaponRelated calls sub_GAME_7F061948, and passes an address + * Method chrlvFireWeaponRelated calls CapBeamLengthAndDecideIfRendered, and passes an address * which makes it look like this is an array at ChrRecord offset 180. */ ChrRecord_f180 unk180[2]; @@ -2486,6 +2418,63 @@ typedef union f32 unk48; }; + typedef struct Projectile { + u32 flags; + coord3d speed; + coord3d unk10; + + f32 unk1C; + Mtxf mtx; // 0x20-0x5c + + f32 unk60; + f32 unk64; + + f32 unk68[4]; + f32 unk78[4]; + + struct PropRecord* ownerprop; // 0x88 + f32 unk8C; + + u32 unk90; + f32 unk94; + struct ALSoundState* sound1; // 0x98 + struct ALSoundState* sound2; // 0x9C + + u32 unkA0; + u32 unkA4; + u32 unkA8; + u32 unkAC; + + f32 unkB0; // runtime y position? + f32 unkB4; // previous pos.y? + DROPTYPE droptype; // 0xB8 + u32 refreshrate; // 0xBC; + + f32 unkC0; + f32 unkC4; + f32 unkC8; + + u8 unkCC; + u8 unkCD; + u8 unkCE; + u8 unkCF; + + u32 unkD0; + f32 unkd4; // probably struct coord3d + u32 unkD8; + u32 unkDC; + + u32 unkE0; + struct ObjectRecord* obj; // 0xE4; + s32 unkE8; + } Projectile; + + typedef struct Embedment { + /*0x000*/ s32 flags; + /*0x004*/ Mtxf matrix; + /*0x044*/ struct Projectile *projectile; + } Embedment; + /** * Object (Prop Definition) Record holds common data such as pad and health. */ @@ -2668,15 +2657,15 @@ typedef union }; struct collision_data *ptr_allocated_collisiondata_block; - ObjectRecord_f6c *unk6C; //pointer somewhere at least 0x44 long and the pointer at 0 and 0x44 is also at least 0xb8 long + union { + struct Projectile *projectile; // 0x6c + struct Embedment *embedment; // 0x6c + }; - f32 maxdamage; - f32 damage; - rgba_u8 field_78; - char field_7C; - char field_7D; - char field_7E; - char field_7F; + f32 maxdamage; // 0x70 + f32 damage; // 0x74 + rgba_u8 shadecol; // 0x78 + rgba_u8 nextcol; // 0x7C } ObjectRecord; #define New_ObjectRecord(pad) \ { \ @@ -2832,9 +2821,9 @@ typedef union u8 unkbd; /*0xbd*/ // something related to rendering - s16 unkbe; /*0xbe*/ - s32 unkc0; /*0xc0*/ - s16 unkc4; /*0xc4*/ + s16 calculatedopacity; /*0xbe*/ + s32 TintDist; /*0xc0*/ + s16 CullDist; /*0xc4*/ s8 soundType; /*0xc6*/ s8 fadeTime60; /*0xc7*/ @@ -2844,11 +2833,9 @@ typedef union */ struct DoorRecord *linkedDoor; - u8 laserFade; /*0xcc*/ - u8 unkcd; - s16 unkce; + Vertex* unkcc; /*0xcc*/ - // maybe struct modeldata_unk_pos * + // maybe struct ModelRoData_BoundingBoxRecord * u32 unkd0; u32 unkd4; @@ -2936,15 +2923,24 @@ typedef union New_PropDefHeaderRecord(5), 0, pad + 0 \ } + struct beam { + /*0x00*/ s8 age; + /*0x01*/ s8 weaponnum; + /*0x04*/ struct coord3d from; + /*0x10*/ struct coord3d dir; + /*0x1c*/ f32 maxdist; + /*0x20*/ f32 speed; + /*0x24*/ f32 mindist; + /*0x28*/ f32 dist; + }; typedef struct AutogunRecord { inherits ObjectRecord; - s16 unk80; /*0x80*/ - u16 lookpad; /*0x82*/ + s32 padID; // 0x80 // Units seem to be radians. - f32 rot_related; + f32 rot_related; // 0x84 // Units seem to be radians. f32 unk88; @@ -2958,6 +2954,7 @@ typedef union // changes when active/firing f32 unk94; f32 unk98; + // changes when active/firing f32 unk9C; @@ -2965,75 +2962,61 @@ typedef union f32 unkA0; // How fast the gun turns. Runway default is around 0.01f. - f32 speed; + f32 speed; // 0xA4 /** * Distance before deactivating. * Default (on Runway at least): 7500.0f * Offset 0xa0. */ - f32 aimdist; - u32 unkAC; + f32 aimdist; // 0xA8 + s32 unkAC; // changes when active/firing - s32 unkB0; + f32 unkB0; + // changes when active/firing f32 unkB4; - f32 unkB8; + s32 unkB8; s32 unkBC; - s32 unkC0; - void *unkC4; - void *unkC8; - void *unkCC; + ALSoundState *unkC4; + ALSoundState *unkC8; + struct beam *beam; /** * Offset 0xd0. * Used in object_interaction, setting to zero won't disable. */ - f32 is_active; + s32 is_active; // 0xD0 // changes when active/firing - u32 unkD8; - - ////////////////////////////////////////////////////// - // Previously: - // u8 firing; - // u8 firecount; - // u16 unk64; /*0x84*/ - // s16 yzero; /*0x88 */ - // s16 ymaxleft; /*0x8a how far gun can rotate from center. 0 = free rotate*/ - // s16 ymaxright; /*0x8c */ - // s16 yrot; /*0x8e how far gun can rotate from center. 0 = free rotate*/ - // u32 yspeed; /*0xa0*/ - // u16 unk98; /*0xa4*/ - // u16 Speed; /*0xa6 how fast the gun turns*/ - // u16 aimdist; /*0xa8 distance before deactivating.*/ - // u16 unkaa; /*0xaa*/ - // u32 unkac; - + f32 unkD4; } AutogunRecord; // PROPDEF_CCTV (6) typedef struct CCTVRecord { - inherits AutogunRecord; - // needs camrotm 40byte matrix to go in here somewhere - s16 UpMax; /*0xcc = 0 Camera cannot move vertically*/ - s16 LeftMax; /*0xce how far camera can rotate from center. 0 = free rotate*/ - s16 DownMax; /*0xd0 = -1 Camera cannot move vertically*/ - s16 RightMax; /*0xd2 how far camera can rotate from center. 0 = free - rotate*/ - u32 unkd4; /*0xd4*/ - u32 unk98; /*0xd8*/ - u16 unkdc; /*0xdc*/ - u16 Speed; /*0xde how fast the camera turns*/ - u32 unka0; /*0xe0*/ - u32 unka4; /*0xe4*/ - s16 VerticalDetectionAngle; /*0xe8 detection arc up/down from current - position. default = -1*/ - s16 HorizontalDetectionAngle; /*0xeA detection arc left/right from current - position. default = -100*/ + struct ObjectRecord; + s32 unk80; + Mtxf unk84; + f32 unkC4; + f32 unkC8; + f32 unkCC; + + f32 unkD0; + s32 unkD4; + f32 unkD8; + f32 unkDC; + + s32 timer; // 0xe0 + s32 unkE4; + f32 unkE8; + s32 unkEC; + + s32 unkF0; + s32 unkF4; + s32 unkF8; } CCTVRecord; #define New_CCTVRecord(pad) \ @@ -3045,7 +3028,7 @@ typedef union typedef struct AmmoCrateRecord { inherits ObjectRecord; - u32 type; //Use AMMOTYPE /*0x80*/ + AMMOTYPE ammoType; /*0x80*/ } AmmoCrateRecord; #define New_AmmoCrateRecord(pad) \ @@ -3110,10 +3093,10 @@ typedef union //[This struct uses original names] typedef struct MonitorRecord { - s32 image; // 0x80 4 image pointer for this monitor + u32 *cmdlist; // 0x80 4 image pointer for this monitor u16 offset; // 0x84 2 [runtime] cur. #commands from start of routine - u16 pause60; // 0x86 2 [runtime] loop counter - void *unk88; //0x88 4 [runtime] monitor image# or p->image header + s16 pause60; // 0x86 2 [runtime] loop counter + struct sImageTableEntry *tconfig; //0x88 4 [runtime] monitor image# or p->image header f32 rot; // 0x8C 4 [runtime][float] rotation f32 xscale; // 0x90 4 [runtime] [float] cur. horizontal zoom f32 xscalefrac; // 0x94 4 [runtime] [float] cur. h.zoom time @@ -3156,9 +3139,9 @@ typedef union { inherits ObjectRecord; MonitorRecord Monitor; - u32 nextstep; // 0xF4 4 backward monitor link - u32 forwards; // 0xF8 4 forward monitor link - u32 turnspeed; // 0xFC 4 animation# + s32 OwnerOffset; + s32 OwnerPart; + s32 ImageNum; } MonitorObjRecord; #define New_MonitorObjRecord(pad) \ { \ @@ -3166,16 +3149,13 @@ typedef union } // PROPDEF_MULTI_MONITOR (11) - typedef struct multimonitorobj + typedef struct MultiMonitorObjRecord { inherits ObjectRecord; MonitorRecord Monitor[4]; - /* Some stuff here then 0x101414 at 0x250*/ - u32 nextstep; // 0xF4 4 backward monitor link - u32 forwards; // 0xF8 4 forward monitor link - u32 turnspeed; // 0xFC 4 animation# - } multimonitorobj; - #define New_multimonitorobj(pad) \ + u8 ImageNums[4]; + } MultiMonitorObjRecord; + #define New_MultiMonitorObjRecord(pad) \ { \ New_PropDefHeaderRecord(11), 0, pad + 0 \ } @@ -3187,7 +3167,6 @@ typedef union } // PROPDEF_AUTOGUN (13) - #define New_AutogunRecord(pad) \ { \ New_PropDefHeaderRecord(13), 0, pad + 0 \ @@ -3208,6 +3187,10 @@ typedef union //Types 15,16 missing? // PROPDEF_HAT (17) + typedef struct HatRecord + { + inherits ObjectRecord; + } HatRecord; // PROPDEF_GUARD_ATTRIBUTE (18) typedef struct GuardAttributeRecord @@ -3430,6 +3413,9 @@ typedef union typedef struct LockDoorRecord { inherits PropDefHeaderRecord; + struct DoorRecord* door; + struct ObjectRecord* lock; + struct LockDoorRecord* next; //u16 TagID; } LockDoorRecord; #define New_RenameObjectRecord(TagID) \ @@ -3446,16 +3432,16 @@ typedef union AIRecord * ailist; /*0x80*/ u16 aioffset; /*0x84*/ s16 aireturnlist; /*0x86*/ - u32 speed; /*0x88 ?*/ - u32 wheelxrot; /*0x8c ? changes when onscreen*/ - u32 wheelyrot; /*0x90 ?*/ + f32 speed; /*0x88 ?*/ + f32 wheelxrot; /*0x8c ? changes when onscreen*/ + f32 wheelyrot; /*0x90 ?*/ f32 speedaim; /*0x94 CONFIRNMED*/ f32 speedtime60; /*0x98 CONFIRNMED*/ - u32 turnrot60; /*0x9c*/ - u32 roty; /*0xa0*/ + f32 turnrot60; /*0x9c*/ + f32 roty; /*0xa0*/ PathRecord *path; /*0xa4*/ s32 nextstep; /*0xa8*/ - void * Sound; /*0xac*/ + struct ALSoundState *Sound; /*0xac*/ } VehichleRecord; // VehichleRecord *pVehichleData;//not Global, local to Object or function // VehichleRecord *pAircraftData;//not Global, local to Object or function @@ -3469,21 +3455,21 @@ typedef union // [This struct uses original names] typedef struct AircraftRecord { - inherits ObjectRecord; - AIRecord * ailist; /*0x80*/ - u16 aioffset; /*0x84*/ - s16 aireturnlist; /*0x86*/ - u32 rotoryrot; /*0x88 changes when onscreen even after destruction*/ - f32 rotaryspeed; /*0x8c*/ - f32 rotaryspeedaim; /*0x90 CONFIRMED*/ - f32 rotaryspeedtime; /*0x94 CONFIRMED*/ - f32 speed; /*0x98*/ - f32 speedaim; /*0x9c*/ - f32 speedtime60; /*0xa0*/ - u32 yrot; /*0xa4*/ - u32 nextstep; /*0xa8*/ - PathRecord *path; /*0xac*/ - void * Sound; /*0xb0 CONFIRMED*/ + inherits ObjectRecord; + AIRecord * ailist; /*0x80*/ + u16 aioffset; /*0x84*/ + s16 aireturnlist; /*0x86*/ + f32 rotoryrot; /*0x88 changes when onscreen even after destruction*/ + f32 rotaryspeed; /*0x8c*/ + f32 rotaryspeedaim; /*0x90 CONFIRMED*/ + f32 rotaryspeedtime; /*0x94 CONFIRMED*/ + f32 speed; /*0x98*/ + f32 speedaim; /*0x9c*/ + f32 speedtime60; /*0xa0*/ + f32 yrot; /*0xa4*/ + f32 nextstep; /*0xa8*/ + PathRecord *path; /*0xac*/ + struct ALSoundState *Sound; /*0xb0*/ } AircraftRecord; #define New_AircraftRecord(pad) \ { \ @@ -3509,8 +3495,11 @@ typedef union //PROPDEF_SAFE_ITEM (42) typedef struct SafeObjectRecord { - inherits ObjectRecord; - coord3d normal; + u32 unk00; + struct ObjectRecord *item; + struct SafeRecord *safe; + struct DoorRecord *door; + struct SafeObjectRecord *next; } SafeObjectRecord; // PROPDEF_TANK (45) @@ -3518,15 +3507,15 @@ typedef union typedef struct TankRecord { inherits ObjectRecord; - s32 unk80; - struct rect4f *rect; /*0x84*/ - s32 unk88; - s32 unk8C; - s32 unk90; - s32 unk94; - s32 unk98; - s32 unk9C; - s32 unkA0; + struct collision_data *unk80; + struct rect4f rect; /*0x84*/ + //s32 unk88; + //s32 unk8C; + //s32 unk90; + //s32 unk94; + //s32 unk98; + //s32 unk9C; + //s32 unkA0; s32 unkA4; s32 unkA8; s32 unkAC; @@ -3540,7 +3529,7 @@ typedef union f32 turret_orientation_angle; f32 unkD0; f32 stan_y; - f32 unkD8; + s32 unkD8; // ammo related f32 tank_orientation_angle; } TankRecord; #define New_TankRecord(pad) \ @@ -3552,12 +3541,10 @@ typedef union typedef struct CutsceneRecord { inherits PropDefHeaderRecord; - s32 x; //4 - s32 y; //8 - s32 z; //c - s32 theta; //10 - s32 verta; //14 - u32 pad; //18 + struct coord3d pos; + f32 theta; //10 + f32 verta; //14 + s32 pad; //18 } CutsceneRecord; #define New_CutsceneRecord(pad) \ { \ @@ -3570,7 +3557,7 @@ typedef union inherits ObjectRecord; s32 TintDist; s32 CullDist; - s32 unk88; + s32 calculatedopacity; s32 unk8c; f32 unk90; } TintedGlassRecord; @@ -3893,9 +3880,111 @@ typedef struct object_weapon { } object_weapon; +struct MoveData { + // 0x0, bondviewProcessInput sp120 + s32 analogWalk; // sp120 ? + s32 analogStrafe; // sp124 ? + s32 analogPitch; // sp128 ? + s32 analogTurn; // sp12C ? + + // 0x10 + s32 controlStickYRaw; + s32 controlStickXRaw; + s32 controlStickYSafe; + s32 controlStickXSafe; + + // 0x20 + s32 disableLookAhead; + s32 invertPitch; + s32 canAutoAim; + s32 detonating; + + // 0x30 + s32 rLeanRight; + s32 rLeanLeft; + s32 crouchUp; + s32 crouchDown; + + // 0x40, bondviewProcessInput sp160 + f32 zoomInFovPersec; + // sp164 + f32 zoomOutFovPersec; + s32 zooming; + s32 aiming; + + // 0x50 + s32 weaponForwardOffset; + s32 weaponBackOffset; + f32 aimTurnRightSpeed; + f32 aimTurnLeftSpeed; + + // 0x60 + f32 speedVertaUp; + f32 speedVertaDown; + f32 tankTurnRightSpeed; + f32 tankTurnLeftSpeed; + + // 0x70 + s32 digitalStepRight; + s32 digitalStepLeft; + s32 digitalStepBack; + s32 digitalStepForward; + + // 0x80 + s32 canNaturalPitch; + s32 canNaturalTurn; + s32 canTurnTank; + s32 canLookAhead; + + // 0x90 + s32 btap; + s32 triggerOn; + s32 canManualAim; + // sp1BC + s32 canSwivelGun; +}; +struct unkown_gun_struct +{ + union + { + u32 arr[2]; + struct + { + s32 unk00; + s32 unk04; + }; + }; +}; +/* matches Perfect Dark */ +struct criteria_roomentered { + u32 unk00; + u32 pad; + u32 status; + struct criteria_roomentered *next; +}; + +/* completely made up */ +struct criteria_deposit { + s32 unk00; + s32 weaponnum; + s32 padid; + s32 flag; + struct criteria_deposit *next; +}; +struct PortalMetric { + struct coord3d normal; + f32 min; + f32 max; +}; + +struct FolderSelect { + s32 unk00; + s32 unk04; + s32 unk08; +}; #endif diff --git a/src/boss.c b/src/boss.c index 4573e8a9..13ec6ec8 100644 --- a/src/boss.c +++ b/src/boss.c @@ -115,12 +115,12 @@ struct memallocstring memallocstringtable[] = { { LEVELID_BASEMENT, "-ml0 -me0 -mgfx130 -mvtx100 -mt400 -ma100"}, { LEVELID_STACK, "-ml0 -me0 -mgfx130 -mvtx100 -mt400 -ma100"}, { LEVELID_CAVES, "-ml0 -me0 -mgfx130 -mvtx100 -mt400 -ma300"}, -{ 0x1AB, "-ml0 -me0 -mgfx130 -mvtx100 -mt550 -ma170"}, -{ 0x1A8, "-ml0 -me0 -mgfx80 -mvtx100 -mt550 -ma250"}, -{ 0x1B7, "-ml0 -me0 -mgfx130 -mvtx100 -mt440 -ma220"}, -{ 0x1B2, "-ml0 -me0 -mgfx90 -mvtx100 -mt550 -ma230"}, -{ 0x1B0, "-ml0 -me0 -mgfx110 -mvtx100 -mt350 -ma400"}, -{ 0x0, "-ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400"}, +{ LEVELID_BUNKER2_MP , "-ml0 -me0 -mgfx130 -mvtx100 -mt550 -ma170"}, +{ LEVELID_ARCHIVES_MP , "-ml0 -me0 -mgfx80 -mvtx100 -mt550 -ma250"}, +{ LEVELID_CAVERNS_MP , "-ml0 -me0 -mgfx130 -mvtx100 -mt440 -ma220"}, +{ LEVELID_FACILITY_MP , "-ml0 -me0 -mgfx90 -mvtx100 -mt550 -ma230"}, +{ LEVELID_EGYPT_MP , "-ml0 -me0 -mgfx110 -mvtx100 -mt350 -ma400"}, +{ 0x0, "-ml0 -me0 -mgfx100 -mvtx50 -mt700 -ma400"}, { 0x0, }, { 0x0, }, { 0x0, } @@ -154,16 +154,16 @@ void bossInitMainthreadData(void) romCreateMesgQueue(); tlbmanageEstablishManagementTable(); image_entries_load(); - mempInitDebugNoticeList(); + mempInit(); memaInit(); - bgInitDebugNoticeList(); - viInitDebugNoticeList(); + bgInit(); + viInit(); viInitVideoSettings(); indycommInit(); g_DebugAndUpdateStageFlag = rmonGetToken(); - obInitDebugNoticeList(); - rspInitDebugNoticeList(); - dynInitDebugNoticeList(); + obInit(); + rspInit(); + dynInit(); joyInit(); osCreateMesgQueue(&bossmq, &bossmsg, 1); @@ -186,8 +186,8 @@ void bossInitMainthreadData(void) g_DebugAndUpdateStageFlag = 1; } - stanInitDebugNoticeList(); - gameInitDebugNoticeList(); + stanInit(); + gameInit(); if (g_DebugAndUpdateStageFlag != 0) { @@ -201,10 +201,10 @@ void bossInitMainthreadData(void) temp_s0 = (osVirtualToPhysical(&room_model_buffer) | 0x80000000); mempCheckMemflagTokens(temp_s0, ((u32)tlbmanageGetTlbAllocatedBlock() - (u32)temp_s0)); - mempResetBank(6); - init_LnameX(); - lvInitDebugNoticeList(); - bossInitDebugNoticeList(); + mempResetBank(MEMPOOL_PERMANENT); + langInit(); + lvInit(); + bossInit(); textrelatedInit_REMOVED(); debmenu7000ADA8(); default_player_perspective_and_height(); @@ -254,7 +254,6 @@ void bossEntry(void) { } } -#if defined(LEFTOVERDEBUG) /** * Main program loop. * @@ -399,14 +398,14 @@ void bossMainloop(void) tokenSetString(memallocstringtable[stringIndex].string); } - mempResetBank(4); - obBlankResourcesLoadedInBank(4); + mempResetBank(MEMPOOL_STAGE); + obBlankResourcesLoadedInBank(MEMPOOL_STAGE); if (tokenFind(1, "-ma")) { g_CurentMaMallocValue = (s32) (strtol(tokenFind(1, "-ma"), NULL, 0) * 1024); } - memaSetBuffer(mempAllocBytesInBank(g_CurentMaMallocValue, 4), g_CurentMaMallocValue); + memaReset(mempAllocBytesInBank(g_CurentMaMallocValue, MEMPOOL_STAGE), g_CurentMaMallocValue); reset_play_data_ptrs(); localSelectedNumPlayers = 0; @@ -428,18 +427,16 @@ void bossMainloop(void) sub_GAME_7F0C0B4C(); speedGraphVideoRelated_2(); - // The following 4 empty blocks are to make s2/s3 match. - - if(1){} // regalloc - do{}while(0); // regalloc + if(1); // regalloc + if(1); while (osRecvMesg(&gfxFrameMsgQ, (OSMesg *)&localGfxFrameMsg, OS_MESG_NOBLOCK) == 0) { // empty } - if(1){} // regalloc - do{}while(0); // regalloc + if(1); // regalloc + if(1); while (g_MainStageNum < 0 || pendingGfx != 0) { @@ -525,7 +522,7 @@ void bossMainloop(void) localPlayer = g_CurrentPlayer; viSetViewPosition(localPlayer->viewleft, localPlayer->viewtop); - lvlUpdateMpPlayerData(); + lvlViewMoveTick(); } } @@ -610,14 +607,15 @@ void bossMainloop(void) rspGfxTaskStart(firstGdl, gdl, 0, (s32*)rspReplyMsg); pendingGfx++; - memaIterateAndMerge(); + memaSingleDefragPass(); #ifdef VERSION_EU eu_sub_7f0c00a4(); #endif toggleFlag ^= 1; #if defined(VERSION_EU) - speedGraphDisplay(1); + speedGraphDisplay(0x10000); + if(1); #else profileSetMarker(0x10000); #endif @@ -630,16 +628,20 @@ void bossMainloop(void) pendingGfx--; break; - case 5: + case OS_SC_PRE_NMI_MSG: pendingGfx = 4U; break; } } - + lvlUnloadStageTextData(); stop_demo_playback(); - mempNullNextEntryInBank(4); - obBlankResourcesLoadedInBank(4); + mempNullNextEntryInBank(MEMPOOL_STAGE); + obBlankResourcesLoadedInBank(MEMPOOL_STAGE); + +#if defined(VERSION_EU) + if(1); +#endif g_StageNum = g_MainStageNum; g_MainStageNum = LEVELID_NONE; @@ -653,650 +655,6 @@ void bossMainloop(void) sub_GAME_7F0D1A7C(); } -#endif -#if !defined(LEFTOVERDEBUG) - - -GLOBAL_ASM( - - - -.rdata -glabel aLevel__0 -.word 0x2d6c6576, 0x656c5f00 /*"-level_"*/ -glabel aLevel__1 -.word 0x2d6c6576, 0x656c5f00 /*"-level_"*/ -glabel aHard -.word 0x2d686172, 0x64000000 /*"-hard"*/ -glabel aHard_1 -.word 0x2d686172, 0x64000000 /*"-hard"*/ -glabel aHard_2 -.word 0x2d686172, 0x64000000 /*"-hard"*/ -glabel aMa -.word 0x2d6d6100 /*"-ma"*/ -glabel aMa_0 -.word 0x2d6d6100 /*"-ma"*/ -glabel aU64_taskgrab_D_core -.word 0x7536342e, 0x7461736b, 0x67726162, 0x2e25642e, 0x636f7265, 0x00000000 /*"u64.taskgrab.%d.core"*/ - - -.data -glabel taskgrab_ramdump_num -.word 0x1 - -.text -glabel bossMainloop -/* 006080 70005480 27BDFE20 */ addiu $sp, $sp, -0x1e0 -/* 006084 70005484 AFBF003C */ sw $ra, 0x3c($sp) -/* 006088 70005488 AFBE0038 */ sw $fp, 0x38($sp) -/* 00608C 7000548C AFB70034 */ sw $s7, 0x34($sp) -/* 006090 70005490 AFB60030 */ sw $s6, 0x30($sp) -/* 006094 70005494 AFB5002C */ sw $s5, 0x2c($sp) -/* 006098 70005498 AFB40028 */ sw $s4, 0x28($sp) -/* 00609C 7000549C AFB30024 */ sw $s3, 0x24($sp) -/* 0060A0 700054A0 AFB20020 */ sw $s2, 0x20($sp) -/* 0060A4 700054A4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0060A8 700054A8 AFB00018 */ sw $s0, 0x18($sp) -/* 0060AC 700054AC 0FC343DB */ jal reset_mem_bank_5 -/* 0060B0 700054B0 AFA001DC */ sw $zero, 0x1dc($sp) -/* 0060B4 700054B4 3C058002 */ lui $a1, %hi(aLevel__0) # $a1, 0x8002 -/* 0060B8 700054B8 24A547D4 */ addiu $a1, %lo(aLevel__0) # addiu $a1, $a1, 0x47d4 -/* 0060BC 700054BC 0C0026C0 */ jal tokenFind -/* 0060C0 700054C0 24040001 */ li $a0, 1 -/* 0060C4 700054C4 1040000D */ beqz $v0, .L700054FC -/* 0060C8 700054C8 24040001 */ li $a0, 1 -/* 0060CC 700054CC 3C058002 */ lui $a1, %hi(aLevel__1) # $a1, 0x8002 -/* 0060D0 700054D0 0C0026C0 */ jal tokenFind -/* 0060D4 700054D4 24A547DC */ addiu $a1, %lo(aLevel__1) # addiu $a1, $a1, 0x47dc -/* 0060D8 700054D8 904F0000 */ lbu $t7, ($v0) -/* 0060DC 700054DC 904E0001 */ lbu $t6, 1($v0) -/* 0060E0 700054E0 3C018002 */ lui $at, %hi(g_StageNum) # $at, 0x8002 -/* 0060E4 700054E4 000FC080 */ sll $t8, $t7, 2 -/* 0060E8 700054E8 030FC021 */ addu $t8, $t8, $t7 -/* 0060EC 700054EC 0018C040 */ sll $t8, $t8, 1 -/* 0060F0 700054F0 01D8C821 */ addu $t9, $t6, $t8 -/* 0060F4 700054F4 2728FDF0 */ addiu $t0, $t9, -0x210 -/* 0060F8 700054F8 AC282038 */ sw $t0, %lo(g_StageNum)($at) -.L700054FC: -/* 0060FC 700054FC 3C098002 */ lui $t1, %hi(g_StageNum) # $t1, 0x8002 -/* 006100 70005500 8D292038 */ lw $t1, %lo(g_StageNum)($t1) -/* 006104 70005504 2401005A */ li $at, 90 -/* 006108 70005508 1121001D */ beq $t1, $at, .L70005580 -/* 00610C 7000550C 00000000 */ nop -/* 006110 70005510 0FC0777C */ jal fileValidateSaves -/* 006114 70005514 00000000 */ nop -/* 006118 70005518 0FC074F9 */ jal set_selected_folder_num -/* 00611C 7000551C 00002025 */ move $a0, $zero -/* 006120 70005520 0FC074FC */ jal set_selected_difficulty -/* 006124 70005524 00002025 */ move $a0, $zero -/* 006128 70005528 3C048002 */ lui $a0, %hi(g_StageNum) # $a0, 0x8002 -/* 00612C 7000552C 0FC07510 */ jal set_solo_and_ptr_briefing -/* 006130 70005530 8C842038 */ lw $a0, %lo(g_StageNum)($a0) -/* 006134 70005534 3C058002 */ lui $a1, %hi(aHard) # $a1, 0x8002 -/* 006138 70005538 24A547E4 */ addiu $a1, %lo(aHard) # addiu $a1, $a1, 0x47e4 -/* 00613C 7000553C 0C0026C0 */ jal tokenFind -/* 006140 70005540 24040001 */ li $a0, 1 -/* 006144 70005544 1040000E */ beqz $v0, .L70005580 -/* 006148 70005548 24040001 */ li $a0, 1 -/* 00614C 7000554C 3C058002 */ lui $a1, %hi(aHard_1) # $a1, 0x8002 -/* 006150 70005550 0C0026C0 */ jal tokenFind -/* 006154 70005554 24A547EC */ addiu $a1, %lo(aHard_1) # addiu $a1, $a1, 0x47ec -/* 006158 70005558 90440000 */ lbu $a0, ($v0) -/* 00615C 7000555C 0FC074FC */ jal set_selected_difficulty -/* 006160 70005560 2484FFD0 */ addiu $a0, $a0, -0x30 -/* 006164 70005564 3C058002 */ lui $a1, %hi(aHard_2) # $a1, 0x8002 -/* 006168 70005568 24A547F4 */ addiu $a1, %lo(aHard_2) # addiu $a1, $a1, 0x47f4 -/* 00616C 7000556C 0C0026C0 */ jal tokenFind -/* 006170 70005570 24040001 */ li $a0, 1 -/* 006174 70005574 90440000 */ lbu $a0, ($v0) -/* 006178 70005578 0FC2FC24 */ jal lvlSetSelectedDifficulty -/* 00617C 7000557C 2484FFD0 */ addiu $a0, $a0, -0x30 -.L70005580: -/* 006180 70005580 0C003190 */ jal osGetCount -/* 006184 70005584 00000000 */ nop -/* 006188 70005588 0C00263E */ jal randomSetSeed -/* 00618C 7000558C 00402025 */ move $a0, $v0 -/* 006190 70005590 3C168002 */ lui $s6, %hi(aU64_taskgrab_D_core) # $s6, 0x8002 -/* 006194 70005594 3C158007 */ lui $s5, %hi(g_CurrentPlayer) # $s5, 0x8007 -/* 006198 70005598 26B58BC0 */ addiu $s5, %lo(g_CurrentPlayer) # addiu $s5, $s5, -0x7440 -/* 00619C 7000559C 26D64804 */ addiu $s6, %lo(aU64_taskgrab_D_core) # addiu $s6, $s6, 0x4804 -/* 0061A0 700055A0 27B70058 */ addiu $s7, $sp, 0x58 -/* 0061A4 700055A4 27B4005C */ addiu $s4, $sp, 0x5c -/* 0061A8 700055A8 8FB301A8 */ lw $s3, 0x1a8($sp) -.L700055AC: -/* 0061AC 700055AC 3C0B8002 */ lui $t3, %hi(g_bossGfxDoneMsg) # $t3, 0x8002 -/* 0061B0 700055B0 AFA001D4 */ sw $zero, 0x1d4($sp) -/* 0061B4 700055B4 256B2194 */ addiu $t3, %lo(g_bossGfxDoneMsg) # addiu $t3, $t3, 0x2194 -/* 0061B8 700055B8 8D610000 */ lw $at, ($t3) -/* 0061BC 700055BC 8D6F0004 */ lw $t7, 4($t3) -/* 0061C0 700055C0 27AA01B4 */ addiu $t2, $sp, 0x1b4 -/* 0061C4 700055C4 AD410000 */ sw $at, ($t2) -/* 0061C8 700055C8 AD4F0004 */ sw $t7, 4($t2) -/* 0061CC 700055CC 8D6F000C */ lw $t7, 0xc($t3) -/* 0061D0 700055D0 8D610008 */ lw $at, 8($t3) -/* 0061D4 700055D4 0000F025 */ move $fp, $zero -/* 0061D8 700055D8 AD4F000C */ sw $t7, 0xc($t2) -/* 0061DC 700055DC AD410008 */ sw $at, 8($t2) -/* 0061E0 700055E0 8D610010 */ lw $at, 0x10($t3) -/* 0061E4 700055E4 8D6F0014 */ lw $t7, 0x14($t3) -/* 0061E8 700055E8 00008825 */ move $s1, $zero -/* 0061EC 700055EC AD410010 */ sw $at, 0x10($t2) -/* 0061F0 700055F0 AD4F0014 */ sw $t7, 0x14($t2) -/* 0061F4 700055F4 8D6F001C */ lw $t7, 0x1c($t3) -/* 0061F8 700055F8 8D610018 */ lw $at, 0x18($t3) -/* 0061FC 700055FC AD4F001C */ sw $t7, 0x1c($t2) -/* 006200 70005600 AD410018 */ sw $at, 0x18($t2) -/* 006204 70005604 0FC2FC21 */ jal lvlGetSelectedDifficulty -/* 006208 70005608 AFA001AC */ sw $zero, 0x1ac($sp) -/* 00620C 7000560C 3C048002 */ lui $a0, %hi(g_StageNum) # $a0, 0x8002 -/* 006210 70005610 8C842038 */ lw $a0, %lo(g_StageNum)($a0) -/* 006214 70005614 0FC2FEB0 */ jal test_if_recording_demos_this_stage_load -/* 006218 70005618 00402825 */ move $a1, $v0 -/* 00621C 7000561C 3C0E8002 */ lui $t6, %hi(g_DebugAndUpdateStageFlag) # $t6, 0x8002 -/* 006220 70005620 8DCE2034 */ lw $t6, %lo(g_DebugAndUpdateStageFlag)($t6) -/* 006224 70005624 3C188002 */ lui $t8, %hi(g_StageNum) # $t8, 0x8002 -/* 006228 70005628 11C00038 */ beqz $t6, .L7000570C -/* 00622C 7000562C 00000000 */ nop -/* 006230 70005630 8F182038 */ lw $t8, %lo(g_StageNum)($t8) -/* 006234 70005634 2401005A */ li $at, 90 -/* 006238 70005638 2410FFFF */ li $s0, -1 -/* 00623C 7000563C 1301001D */ beq $t8, $at, .L700056B4 -/* 006240 70005640 00000000 */ nop -/* 006244 70005644 0FC04060 */ jal get_selected_num_players -/* 006248 70005648 00000000 */ nop -/* 00624C 7000564C 28410002 */ slti $at, $v0, 2 -/* 006250 70005650 14200018 */ bnez $at, .L700056B4 -/* 006254 70005654 3C058002 */ lui $a1, %hi(memallocstringtable) # $a1, 0x8002 -/* 006258 70005658 24A5204C */ addiu $a1, %lo(memallocstringtable) # addiu $a1, $a1, 0x204c -/* 00625C 7000565C 8CB90000 */ lw $t9, ($a1) -/* 006260 70005660 00008025 */ move $s0, $zero -/* 006264 70005664 3C048002 */ lui $a0, %hi(g_StageNum) # $a0, 0x8002 -/* 006268 70005668 1320000C */ beqz $t9, .L7000569C -/* 00626C 7000566C 3C088002 */ lui $t0, %hi(memallocstringtable) # $t0, 0x8002 -/* 006270 70005670 8C842038 */ lw $a0, %lo(g_StageNum)($a0) -/* 006274 70005674 2502204C */ addiu $v0, $t0, %lo(memallocstringtable) # addiu $v0, $t0, 0x204C -/* 006278 70005678 8C430000 */ lw $v1, ($v0) -/* 00627C 7000567C 24840190 */ addiu $a0, $a0, 0x190 -.L70005680: -/* 006280 70005680 50830007 */ beql $a0, $v1, .L700056A0 -/* 006284 70005684 001048C0 */ sll $t1, $s0, 3 -/* 006288 70005688 8C430008 */ lw $v1, 8($v0) -/* 00628C 7000568C 26100001 */ addiu $s0, $s0, 1 -/* 006290 70005690 24420008 */ addiu $v0, $v0, 8 -/* 006294 70005694 1460FFFA */ bnez $v1, .L70005680 -/* 006298 70005698 00000000 */ nop -.L7000569C: -/* 00629C 7000569C 001048C0 */ sll $t1, $s0, 3 -.L700056A0: -/* 0062A0 700056A0 00A96821 */ addu $t5, $a1, $t1 -/* 0062A4 700056A4 8DAC0000 */ lw $t4, ($t5) -/* 0062A8 700056A8 15800002 */ bnez $t4, .L700056B4 -/* 0062AC 700056AC 00000000 */ nop -/* 0062B0 700056B0 2410FFFF */ li $s0, -1 -.L700056B4: -/* 0062B4 700056B4 3C058002 */ lui $a1, %hi(memallocstringtable) # $a1, 0x8002 -/* 0062B8 700056B8 06010010 */ bgez $s0, .L700056FC -/* 0062BC 700056BC 24A5204C */ addiu $a1, %lo(memallocstringtable) # addiu $a1, $a1, 0x204c -/* 0062C0 700056C0 8CAA0000 */ lw $t2, ($a1) -/* 0062C4 700056C4 00008025 */ move $s0, $zero -/* 0062C8 700056C8 3C048002 */ lui $a0, %hi(g_StageNum) # $a0, 0x8002 -/* 0062CC 700056CC 1140000B */ beqz $t2, .L700056FC -/* 0062D0 700056D0 3C0B8002 */ lui $t3, 0x8002 -/* 0062D4 700056D4 2562204C */ addiu $v0, $t3, 0x204c -/* 0062D8 700056D8 8C430000 */ lw $v1, ($v0) -/* 0062DC 700056DC 8C842038 */ lw $a0, %lo(g_StageNum)($a0) -.L700056E0: -/* 0062E0 700056E0 50830007 */ beql $a0, $v1, .L70005700 -/* 0062E4 700056E4 001078C0 */ sll $t7, $s0, 3 -/* 0062E8 700056E8 8C430008 */ lw $v1, 8($v0) -/* 0062EC 700056EC 26100001 */ addiu $s0, $s0, 1 -/* 0062F0 700056F0 24420008 */ addiu $v0, $v0, 8 -/* 0062F4 700056F4 1460FFFA */ bnez $v1, .L700056E0 -/* 0062F8 700056F8 00000000 */ nop -.L700056FC: -/* 0062FC 700056FC 001078C0 */ sll $t7, $s0, 3 -.L70005700: -/* 006300 70005700 00AF7021 */ addu $t6, $a1, $t7 -/* 006304 70005704 0C00267B */ jal tokenSetString -/* 006308 70005708 8DC40004 */ lw $a0, 4($t6) -.L7000570C: -/* 00630C 7000570C 0C00237F */ jal mempResetBank -/* 006310 70005710 24040004 */ li $a0, 4 -/* 006314 70005714 0FC2F15D */ jal obBlankResourcesLoadedInBank -/* 006318 70005718 24040004 */ li $a0, 4 -/* 00631C 7000571C 3C058002 */ lui $a1, %hi(aMa) # $a1, 0x8002 -/* 006320 70005720 24A547FC */ addiu $a1, %lo(aMa) # addiu $a1, $a1, 0x47fc -/* 006324 70005724 0C0026C0 */ jal tokenFind -/* 006328 70005728 24040001 */ li $a0, 1 -/* 00632C 7000572C 1040000B */ beqz $v0, .L7000575C -/* 006330 70005730 24040001 */ li $a0, 1 -/* 006334 70005734 3C058002 */ lui $a1, %hi(aMa_0) # $a1, 0x8002 -/* 006338 70005738 0C0026C0 */ jal tokenFind -/* 00633C 7000573C 24A54800 */ addiu $a1, %lo(aMa_0) # addiu $a1, $a1, 0x4800 -/* 006340 70005740 00402025 */ move $a0, $v0 -/* 006344 70005744 00002825 */ move $a1, $zero -/* 006348 70005748 0C002790 */ jal strtol -/* 00634C 7000574C 00003025 */ move $a2, $zero -/* 006350 70005750 0002C280 */ sll $t8, $v0, 0xa -/* 006354 70005754 3C018002 */ lui $at, %hi(g_CurentMaMallocValue) # $at, 0x8002 -/* 006358 70005758 AC382040 */ sw $t8, %lo(g_CurentMaMallocValue)($at) -.L7000575C: -/* 00635C 7000575C 3C048002 */ lui $a0, %hi(g_CurentMaMallocValue) # $a0, 0x8002 -/* 006360 70005760 8C842040 */ lw $a0, %lo(g_CurentMaMallocValue)($a0) -/* 006364 70005764 0C0022E0 */ jal mempAllocBytesInBank -/* 006368 70005768 24050004 */ li $a1, 4 -/* 00636C 7000576C 3C058002 */ lui $a1, %hi(g_CurentMaMallocValue) # $a1, 0x8002 -/* 006370 70005770 8CA52040 */ lw $a1, %lo(g_CurentMaMallocValue)($a1) -/* 006374 70005774 0C00247E */ jal memaSetBuffer -/* 006378 70005778 00402025 */ move $a0, $v0 -/* 00637C 7000577C 0FC2661B */ jal reset_play_data_ptrs -/* 006380 70005780 00000000 */ nop -/* 006384 70005784 3C198002 */ lui $t9, %hi(g_StageNum) # $t9, 0x8002 -/* 006388 70005788 8F392038 */ lw $t9, %lo(g_StageNum)($t9) -/* 00638C 7000578C 2401005A */ li $at, 90 -/* 006390 70005790 13210009 */ beq $t9, $at, .L700057B8 -/* 006394 70005794 00000000 */ nop -/* 006398 70005798 0FC04060 */ jal get_selected_num_players -/* 00639C 7000579C 24110001 */ li $s1, 1 -/* 0063A0 700057A0 28410002 */ slti $at, $v0, 2 -/* 0063A4 700057A4 14200004 */ bnez $at, .L700057B8 -/* 0063A8 700057A8 00000000 */ nop -/* 0063AC 700057AC 0FC04060 */ jal get_selected_num_players -/* 0063B0 700057B0 00000000 */ nop -/* 0063B4 700057B4 00408825 */ move $s1, $v0 -.L700057B8: -/* 0063B8 700057B8 0FC26633 */ jal init_player_data_ptrs_construct_viewports -/* 0063BC 700057BC 02202025 */ move $a0, $s1 -/* 0063C0 700057C0 0FC2F20F */ jal dynInitMemory -/* 0063C4 700057C4 00000000 */ nop -/* 0063C8 700057C8 0C0028F3 */ jal joyCheckStatusThreadSafe -/* 0063CC 700057CC 00000000 */ nop -/* 0063D0 700057D0 3C048002 */ lui $a0, %hi(g_StageNum) # $a0, 0x8002 -/* 0063D4 700057D4 0FC2F398 */ jal lvlStageLoad -/* 0063D8 700057D8 8C842038 */ lw $a0, %lo(g_StageNum)($a0) -/* 0063DC 700057DC 0C000B26 */ jal viInitBuffers -/* 0063E0 700057E0 00000000 */ nop -/* 0063E4 700057E4 0C00287A */ jal debmenuInit -/* 0063E8 700057E8 00000000 */ nop -/* 0063EC 700057EC 0FC30001 */ jal sub_GAME_7F0C0B4C -/* 0063F0 700057F0 00000000 */ nop -/* 0063F4 700057F4 0C000AEC */ jal speedGraphVideoRelated_2 -/* 0063F8 700057F8 00000000 */ nop -/* 0063FC 700057FC 3C048005 */ lui $a0, %hi(gfxFrameMsgQ) # $a0, 0x8005 -/* 006400 70005800 24841D60 */ addiu $a0, %lo(gfxFrameMsgQ) # addiu $a0, $a0, 0x1d60 -/* 006404 70005804 27A501D4 */ addiu $a1, $sp, 0x1d4 -/* 006408 70005808 0C0031F4 */ jal osRecvMesg -/* 00640C 7000580C 00003025 */ move $a2, $zero -/* 006410 70005810 14400007 */ bnez $v0, .L70005830 -.L70005814: -/* 006414 70005814 3C048005 */ lui $a0, %hi(gfxFrameMsgQ) # $a0, 0x8005 -/* 006418 70005818 24841D60 */ addiu $a0, %lo(gfxFrameMsgQ) # addiu $a0, $a0, 0x1d60 -/* 00641C 7000581C 27A501D4 */ addiu $a1, $sp, 0x1d4 -/* 006420 70005820 0C0031F4 */ jal osRecvMesg -/* 006424 70005824 00003025 */ move $a2, $zero -/* 006428 70005828 1040FFFA */ beqz $v0, .L70005814 -/* 00642C 7000582C 00000000 */ nop -.L70005830: -/* 006430 70005830 3C088002 */ lui $t0, %hi(g_MainStageNum) # $t0, 0x8002 -/* 006434 70005834 8D08218C */ lw $t0, %lo(g_MainStageNum)($t0) -/* 006438 70005838 05010130 */ bgez $t0, .L70005CFC -.L7000583C: -/* 00643C 7000583C 3C048005 */ lui $a0, %hi(gfxFrameMsgQ) # $a0, 0x8005 -/* 006440 70005840 24841D60 */ addiu $a0, %lo(gfxFrameMsgQ) # addiu $a0, $a0, 0x1d60 -/* 006444 70005844 27A501D4 */ addiu $a1, $sp, 0x1d4 -/* 006448 70005848 0C0031F4 */ jal osRecvMesg -/* 00644C 7000584C 24060001 */ li $a2, 1 -/* 006450 70005850 8FA901D4 */ lw $t1, 0x1d4($sp) -/* 006454 70005854 24010001 */ li $at, 1 -/* 006458 70005858 85230000 */ lh $v1, ($t1) -/* 00645C 7000585C 10610009 */ beq $v1, $at, .L70005884 -/* 006460 70005860 24010002 */ li $at, 2 -/* 006464 70005864 1061011C */ beq $v1, $at, .L70005CD8 -/* 006468 70005868 3C028002 */ lui $v0, 0x8002 -/* 00646C 7000586C 24010005 */ li $at, 5 -/* 006470 70005870 1061011C */ beq $v1, $at, .L70005CE4 -/* 006474 70005874 3C028002 */ lui $v0, 0x8002 -/* 006478 70005878 3C028002 */ lui $v0, %hi(g_MainStageNum) # $v0, 0x8002 -/* 00647C 7000587C 1000011B */ b .L70005CEC -/* 006480 70005880 8C42218C */ lw $v0, %lo(g_MainStageNum)($v0) -.L70005884: -/* 006484 70005884 0C003190 */ jal osGetCount -/* 006488 70005888 00000000 */ nop -/* 00648C 7000588C 3C0C8004 */ lui $t4, %hi(D_800484B4) # $t4, 0x8004 -/* 006490 70005890 8D8C113C */ lw $t4, %lo(D_800484B4)($t4) -/* 006494 70005894 3C01000E */ lui $at, (0x000E34EA >> 16) # lui $at, 0xe -/* 006498 70005898 342134EA */ ori $at, (0x000E34EA & 0xFFFF) # ori $at, $at, 0x34ea -/* 00649C 7000589C 01810019 */ multu $t4, $at -/* 0064A0 700058A0 3C0D8004 */ lui $t5, %hi(copy_of_osgetcount_value_1) # $t5, 0x8004 -/* 0064A4 700058A4 8DAD1138 */ lw $t5, %lo(copy_of_osgetcount_value_1)($t5) -/* 0064A8 700058A8 3C01FFF8 */ lui $at, (0xFFF8E58B >> 16) # lui $at, 0xfff8 -/* 0064AC 700058AC 3421E58B */ ori $at, (0xFFF8E58B & 0xFFFF) # ori $at, $at, 0xe58b -/* 0064B0 700058B0 004D1823 */ subu $v1, $v0, $t5 -/* 0064B4 700058B4 3C028002 */ lui $v0, 0x8002 -/* 0064B8 700058B8 00005012 */ mflo $t2 -/* 0064BC 700058BC 01415821 */ addu $t3, $t2, $at -/* 0064C0 700058C0 006B082B */ sltu $at, $v1, $t3 -/* 0064C4 700058C4 10200004 */ beqz $at, .L700058D8 -/* 0064C8 700058C8 00000000 */ nop -/* 0064CC 700058CC 3C028002 */ lui $v0, %hi(g_MainStageNum) # $v0, 0x8002 -/* 0064D0 700058D0 10000106 */ b .L70005CEC -/* 0064D4 700058D4 8C42218C */ lw $v0, %lo(g_MainStageNum)($v0) -.L700058D8: -/* 0064D8 700058D8 8C42218C */ lw $v0, 0x218c($v0) -/* 0064DC 700058DC 2FC10002 */ sltiu $at, $fp, 2 -/* 0064E0 700058E0 04410102 */ bgez $v0, .L70005CEC -/* 0064E4 700058E4 00000000 */ nop -/* 0064E8 700058E8 10200100 */ beqz $at, .L70005CEC -/* 0064EC 700058EC 27AF01B4 */ addiu $t7, $sp, 0x1b4 -/* 0064F0 700058F0 0FC2FC43 */ jal get_is_ramrom_flag -/* 0064F4 700058F4 AFAF0048 */ sw $t7, 0x48($sp) -/* 0064F8 700058F8 10400005 */ beqz $v0, .L70005910 -/* 0064FC 700058FC 00000000 */ nop -/* 006500 70005900 0FC2FDBA */ jal iterate_ramrom_entries_handle_camera_out -/* 006504 70005904 00000000 */ nop -/* 006508 70005908 10000003 */ b .L70005918 -/* 00650C 7000590C 00000000 */ nop -.L70005910: -/* 006510 70005910 0FC30001 */ jal sub_GAME_7F0C0B4C -/* 006514 70005914 00000000 */ nop -.L70005918: -/* 006518 70005918 0C000AEE */ jal profileSetMarker -/* 00651C 7000591C 00000000 */ nop -/* 006520 70005920 0C000AEC */ jal speedGraphVideoRelated_2 -/* 006524 70005924 00000000 */ nop -/* 006528 70005928 0C000AF0 */ jal speedGraphDisplay -/* 00652C 7000592C 3C040002 */ lui $a0, %hi(0x20004) # $a0, 2 -/* 006530 70005930 0C002AA0 */ jal joyConsumeSamplesWrapper -/* 006534 70005934 00000000 */ nop -/* 006538 70005938 0C000262 */ jal permit_stderr -/* 00653C 7000593C 00002025 */ move $a0, $zero -/* 006540 70005940 0FC2F289 */ jal dynGetMasterDisplayList -/* 006544 70005944 00000000 */ nop -/* 006548 70005948 3C0E8002 */ lui $t6, %hi(g_BossIsDebugMenuOpen) # $t6, 0x8002 -/* 00654C 7000594C 8DCE2190 */ lw $t6, %lo(g_BossIsDebugMenuOpen)($t6) -/* 006550 70005950 AFA201A4 */ sw $v0, 0x1a4($sp) -/* 006554 70005954 00409825 */ move $s3, $v0 -/* 006558 70005958 11C0001D */ beqz $t6, .L700059D0 -/* 00655C 7000595C 00000000 */ nop -/* 006560 70005960 0C002B98 */ jal joyGetStickX -/* 006564 70005964 00002025 */ move $a0, $zero -/* 006568 70005968 00028600 */ sll $s0, $v0, 0x18 -/* 00656C 7000596C 0010C603 */ sra $t8, $s0, 0x18 -/* 006570 70005970 03008025 */ move $s0, $t8 -/* 006574 70005974 0C002BDC */ jal joyGetStickY -/* 006578 70005978 00002025 */ move $a0, $zero -/* 00657C 7000597C 00028E00 */ sll $s1, $v0, 0x18 -/* 006580 70005980 0011CE03 */ sra $t9, $s1, 0x18 -/* 006584 70005984 03208825 */ move $s1, $t9 -/* 006588 70005988 00002025 */ move $a0, $zero -/* 00658C 7000598C 0C002C20 */ jal joyGetButtons -/* 006590 70005990 3405FFFF */ li $a1, 65535 -/* 006594 70005994 3052FFFF */ andi $s2, $v0, 0xffff -/* 006598 70005998 00002025 */ move $a0, $zero -/* 00659C 7000599C 0C002C48 */ jal joyGetButtonsPressedThisFrame -/* 0065A0 700059A0 3405FFFF */ li $a1, 65535 -/* 0065A4 700059A4 00102600 */ sll $a0, $s0, 0x18 -/* 0065A8 700059A8 00112E00 */ sll $a1, $s1, 0x18 -/* 0065AC 700059AC 00054E03 */ sra $t1, $a1, 0x18 -/* 0065B0 700059B0 00044603 */ sra $t0, $a0, 0x18 -/* 0065B4 700059B4 01002025 */ move $a0, $t0 -/* 0065B8 700059B8 01202825 */ move $a1, $t1 -/* 0065BC 700059BC 3246FFFF */ andi $a2, $s2, 0xffff -/* 0065C0 700059C0 0FC240F2 */ jal debug_menu_processor -/* 0065C4 700059C4 3047FFFF */ andi $a3, $v0, 0xffff -/* 0065C8 700059C8 3C018002 */ lui $at, %hi(g_BossIsDebugMenuOpen) # $at, 0x8002 -/* 0065CC 700059CC AC222190 */ sw $v0, %lo(g_BossIsDebugMenuOpen)($at) -.L700059D0: -/* 0065D0 700059D0 0FC2F7EB */ jal lvlManageMpGame -/* 0065D4 700059D4 00000000 */ nop -/* 0065D8 700059D8 0FC26A57 */ jal shuffle_player_ids -/* 0065DC 700059DC 00000000 */ nop -/* 0065E0 700059E0 3C0D8002 */ lui $t5, %hi(g_StageNum) # $t5, 0x8002 -/* 0065E4 700059E4 8DAD2038 */ lw $t5, %lo(g_StageNum)($t5) -/* 0065E8 700059E8 2401005A */ li $at, 90 -/* 0065EC 700059EC 11A10018 */ beq $t5, $at, .L70005A50 -/* 0065F0 700059F0 00000000 */ nop -/* 0065F4 700059F4 0FC26669 */ jal getPlayerCount -/* 0065F8 700059F8 00008825 */ move $s1, $zero -/* 0065FC 700059FC 18400014 */ blez $v0, .L70005A50 -/* 006600 70005A00 00000000 */ nop -.L70005A04: -/* 006604 70005A04 0FC26A9A */ jal get_nth_player_from_shuffled -/* 006608 70005A08 02202025 */ move $a0, $s1 -/* 00660C 70005A0C 0FC26993 */ jal set_cur_player -/* 006610 70005A10 00402025 */ move $a0, $v0 -/* 006614 70005A14 8EB00000 */ lw $s0, ($s5) -/* 006618 70005A18 860407F0 */ lh $a0, 0x7f0($s0) -/* 00661C 70005A1C 0C000FA3 */ jal viSetViewSize -/* 006620 70005A20 860507F2 */ lh $a1, 0x7f2($s0) -/* 006624 70005A24 8EB00000 */ lw $s0, ($s5) -/* 006628 70005A28 860407F4 */ lh $a0, 0x7f4($s0) -/* 00662C 70005A2C 0C000FC3 */ jal viSetViewPosition -/* 006630 70005A30 860507F6 */ lh $a1, 0x7f6($s0) -/* 006634 70005A34 0FC2FB11 */ jal lvlUpdateMpPlayerData -/* 006638 70005A38 00000000 */ nop -/* 00663C 70005A3C 0FC26669 */ jal getPlayerCount -/* 006640 70005A40 26310001 */ addiu $s1, $s1, 1 -/* 006644 70005A44 0222082A */ slt $at, $s1, $v0 -/* 006648 70005A48 1420FFEE */ bnez $at, .L70005A04 -/* 00664C 70005A4C 00000000 */ nop -.L70005A50: -/* 006650 70005A50 0FC2F5B3 */ jal lvlRender -/* 006654 70005A54 02602025 */ move $a0, $s3 -/* 006658 70005A58 0FC2411C */ jal get_debug_VisCVG_flag -/* 00665C 70005A5C 00409825 */ move $s3, $v0 -/* 006660 70005A60 10400037 */ beqz $v0, .L70005B40 /*NOP this so vis-cvg are always drawn*/ -/* 006664 70005A64 2407FFFF */ li $a3, -1 -/* 006668 70005A68 02601025 */ move $v0, $s3 -/* 00666C 70005A6C 26730008 */ addiu $s3, $s3, 8 -/* 006670 70005A70 3C0CE700 */ lui $t4, 0xe700 -/* 006674 70005A74 02601825 */ move $v1, $s3 -/* 006678 70005A78 AC4C0000 */ sw $t4, ($v0) -/* 00667C 70005A7C AC400004 */ sw $zero, 4($v0) -/* 006680 70005A80 26730008 */ addiu $s3, $s3, 8 -/* 006684 70005A84 3C0ABA00 */ lui $t2, (0xBA001402 >> 16) # lui $t2, 0xba00 -/* 006688 70005A88 02602025 */ move $a0, $s3 -/* 00668C 70005A8C 354A1402 */ ori $t2, (0xBA001402 & 0xFFFF) # ori $t2, $t2, 0x1402 -/* 006690 70005A90 26730008 */ addiu $s3, $s3, 8 -/* 006694 70005A94 AC6A0000 */ sw $t2, ($v1) -/* 006698 70005A98 AC600004 */ sw $zero, 4($v1) -/* 00669C 70005A9C 02602825 */ move $a1, $s3 -/* 0066A0 70005AA0 3C0BF900 */ lui $t3, 0xf900 -/* 0066A4 70005AA4 26730008 */ addiu $s3, $s3, 8 -/* 0066A8 70005AA8 AC8B0000 */ sw $t3, ($a0) -/* 0066AC 70005AAC AC870004 */ sw $a3, %lo(0x20004)($a0) -/* 0066B0 70005AB0 02603025 */ move $a2, $s3 -/* 0066B4 70005AB4 3C0FEE00 */ lui $t7, 0xee00 -/* 0066B8 70005AB8 26730008 */ addiu $s3, $s3, 8 -/* 0066BC 70005ABC ACAF0000 */ sw $t7, ($a1) -/* 0066C0 70005AC0 ACA70004 */ sw $a3, 4($a1) -/* 0066C4 70005AC4 3C0EB900 */ lui $t6, (0xB9000201 >> 16) # lui $t6, 0xb900 -/* 0066C8 70005AC8 02601025 */ move $v0, $s3 -/* 0066CC 70005ACC 35CE0201 */ ori $t6, (0xB9000201 & 0xFFFF) # ori $t6, $t6, 0x201 -/* 0066D0 70005AD0 24180004 */ li $t8, 4 -/* 0066D4 70005AD4 26730008 */ addiu $s3, $s3, 8 -/* 0066D8 70005AD8 3C19B900 */ lui $t9, (0xB900031D >> 16) # lui $t9, 0xb900 -/* 0066DC 70005ADC 3C080FA5 */ lui $t0, (0x0FA54040 >> 16) # lui $t0, 0xfa5 -/* 0066E0 70005AE0 ACD80004 */ sw $t8, 4($a2) -/* 0066E4 70005AE4 ACCE0000 */ sw $t6, ($a2) -/* 0066E8 70005AE8 35084040 */ ori $t0, (0x0FA54040 & 0xFFFF) # ori $t0, $t0, 0x4040 -/* 0066EC 70005AEC 3739031D */ ori $t9, (0xB900031D & 0xFFFF) # ori $t9, $t9, 0x31d -/* 0066F0 70005AF0 02608025 */ move $s0, $s3 -/* 0066F4 70005AF4 AC590000 */ sw $t9, ($v0) -/* 0066F8 70005AF8 AC480004 */ sw $t0, 4($v0) -/* 0066FC 70005AFC 0C000F9B */ jal viGetX -/* 006700 70005B00 26730008 */ addiu $s3, $s3, 8 -/* 006704 70005B04 00028C00 */ sll $s1, $v0, 0x10 -/* 006708 70005B08 00114C03 */ sra $t1, $s1, 0x10 -/* 00670C 70005B0C 0C000F9F */ jal viGetY -/* 006710 70005B10 01208825 */ move $s1, $t1 -/* 006714 70005B14 244DFFFF */ addiu $t5, $v0, -1 -/* 006718 70005B18 31AC03FF */ andi $t4, $t5, 0x3ff -/* 00671C 70005B1C 262FFFFF */ addiu $t7, $s1, -1 -/* 006720 70005B20 31EE03FF */ andi $t6, $t7, 0x3ff -/* 006724 70005B24 000C5080 */ sll $t2, $t4, 2 -/* 006728 70005B28 3C01F600 */ lui $at, 0xf600 -/* 00672C 70005B2C 01415825 */ or $t3, $t2, $at -/* 006730 70005B30 000EC380 */ sll $t8, $t6, 0xe -/* 006734 70005B34 0178C825 */ or $t9, $t3, $t8 -/* 006738 70005B38 AE190000 */ sw $t9, ($s0)/*NOP this so vis_cvg are always drawn*/ -/* 00673C 70005B3C AE000004 */ sw $zero, 4($s0)/*NOP this so vis_cvg are always drawn*/ -.L70005B40: -/* 006740 70005B40 0C00289B */ jal debmenuDraw -/* 006744 70005B44 02602025 */ move $a0, $s3 -/* 006748 70005B48 0FC24100 */ jal get_memusage_display_flag -/* 00674C 70005B4C 00409825 */ move $s3, $v0 -/* 006750 70005B50 10400004 */ beqz $v0, .L70005B64 -/* 006754 70005B54 00000000 */ nop -/* 006758 70005B58 0C000AF2 */ jal video_DL_related_4 -/* 00675C 70005B5C 02602025 */ move $a0, $s3 -/* 006760 70005B60 00409825 */ move $s3, $v0 -.L70005B64: -/* 006764 70005B64 3C088002 */ lui $t0, %hi(g_BossIsDebugMenuOpen) # $t0, 0x8002 -/* 006768 70005B68 8D082190 */ lw $t0, %lo(g_BossIsDebugMenuOpen)($t0) -/* 00676C 70005B6C 51000007 */ beql $t0, $zero, .L70005B8C -/* 006770 70005B70 02601025 */ move $v0, $s3 -/* 006774 70005B74 0FC240F0 */ jal debugmenuUpdate -/* 006778 70005B78 00000000 */ nop -/* 00677C 70005B7C 0FC240DE */ jal debugmenuRender -/* 006780 70005B80 02602025 */ move $a0, $s3 -/* 006784 70005B84 00409825 */ move $s3, $v0 -/* 006788 70005B88 02601025 */ move $v0, $s3 -.L70005B8C: -/* 00678C 70005B8C 26730008 */ addiu $s3, $s3, 8 -/* 006790 70005B90 3C09E900 */ lui $t1, 0xe900 -/* 006794 70005B94 AC490000 */ sw $t1, ($v0) -/* 006798 70005B98 AC400004 */ sw $zero, 4($v0) -/* 00679C 70005B9C 02601825 */ move $v1, $s3 -/* 0067A0 70005BA0 3C0DB800 */ lui $t5, 0xb800 -/* 0067A4 70005BA4 AC6D0000 */ sw $t5, ($v1) -/* 0067A8 70005BA8 AC600004 */ sw $zero, 4($v1) -/* 0067AC 70005BAC 3C0C8002 */ lui $t4, %hi(g_ShowMemUseFlag) # $t4, 0x8002 -/* 0067B0 70005BB0 8D8C2044 */ lw $t4, %lo(g_ShowMemUseFlag)($t4) -/* 0067B4 70005BB4 26730008 */ addiu $s3, $s3, 8 -/* 0067B8 70005BB8 1180000B */ beqz $t4, .L70005BE8 -/* 0067BC 70005BBC 00000000 */ nop -/* 0067C0 70005BC0 0C002354 */ jal nulled_mempLoopAllMemBanks -/* 0067C4 70005BC4 00000000 */ nop -/* 0067C8 70005BC8 0C0025BF */ jal memaDumpPrePostMerge -/* 0067CC 70005BCC 00000000 */ nop -/* 0067D0 70005BD0 0FC2F2C9 */ jal dynRemovedFunc -/* 0067D4 70005BD4 02602025 */ move $a0, $s3 -/* 0067D8 70005BD8 0FC316DC */ jal nullsub_41 -/* 0067DC 70005BDC 00002025 */ move $a0, $zero -/* 0067E0 70005BE0 3C018002 */ lui $at, %hi(g_ShowMemUseFlag) # $at, 0x8002 -/* 0067E4 70005BE4 AC202044 */ sw $zero, %lo(g_ShowMemUseFlag)($at) -.L70005BE8: -/* 0067E8 70005BE8 3C0A8002 */ lui $t2, %hi(g_ShowMemBarsFlag) # $t2, 0x8002 -/* 0067EC 70005BEC 8D4A2048 */ lw $t2, %lo(g_ShowMemBarsFlag)($t2) -/* 0067F0 70005BF0 11400003 */ beqz $t2, .L70005C00 -/* 0067F4 70005BF4 00000000 */ nop -/* 0067F8 70005BF8 0FC2F2F0 */ jal dynDrawMembars -/* 0067FC 70005BFC 02602025 */ move $a0, $s3 -.L70005C00: -/* 006800 70005C00 0FC2F293 */ jal dynGetFreeGfx2 -/* 006804 70005C04 02602025 */ move $a0, $s3 -/* 006808 70005C08 0FC2F2BA */ jal dynSwapBuffers -/* 00680C 70005C0C 00000000 */ nop -/* 006810 70005C10 0C000B83 */ jal video_related_8 -/* 006814 70005C14 00000000 */ nop -/* 006818 70005C18 0FC2412E */ jal get_debug_taskgrab_val -/* 00681C 70005C1C 00000000 */ nop -/* 006820 70005C20 1040001C */ beqz $v0, .L70005C94 -/* 006824 70005C24 00002025 */ move $a0, $zero -/* 006828 70005C28 0C002C48 */ jal joyGetButtonsPressedThisFrame -/* 00682C 70005C2C 3405C000 */ li $a1, 49152 -/* 006830 70005C30 10400018 */ beqz $v0, .L70005C94 -/* 006834 70005C34 00002025 */ move $a0, $zero -/* 006838 70005C38 0C002C20 */ jal joyGetButtons -/* 00683C 70005C3C 3405C000 */ li $a1, 49152 -/* 006840 70005C40 3401C000 */ li $at, 49152 -/* 006844 70005C44 14410013 */ bne $v0, $at, .L70005C94 -.L70005C48: -/* 006848 70005C48 3C068002 */ lui $a2, %hi(taskgrab_ramdump_num) # $a2, 0x8002 -/* 00684C 70005C4C 8CC621B4 */ lw $a2, %lo(taskgrab_ramdump_num)($a2) -/* 006850 70005C50 02802025 */ move $a0, $s4 -/* 006854 70005C54 0C00283D */ jal sprintf -/* 006858 70005C58 02C02825 */ move $a1, $s6 -/* 00685C 70005C5C 02802025 */ move $a0, $s4 -/* 006860 70005C60 0FC33D6E */ jal indycommHostCheckFileExists -/* 006864 70005C64 02E02825 */ move $a1, $s7 -/* 006868 70005C68 10400006 */ beqz $v0, .L70005C84 -/* 00686C 70005C6C 3C068002 */ lui $a2, %hi(taskgrab_ramdump_num) # $a2, 0x8002 -/* 006870 70005C70 8CC621B4 */ lw $a2, %lo(taskgrab_ramdump_num)($a2) -/* 006874 70005C74 3C018002 */ lui $at, %hi(taskgrab_ramdump_num) # $at, 0x8002 -/* 006878 70005C78 24C60001 */ addiu $a2, $a2, 1 -/* 00687C 70005C7C 1000FFF2 */ b .L70005C48 -/* 006880 70005C80 AC2621B4 */ sw $a2, %lo(taskgrab_ramdump_num)($at) -.L70005C84: -/* 006884 70005C84 02802025 */ move $a0, $s4 -/* 006888 70005C88 3C058000 */ lui $a1, 0x8000 -/* 00688C 70005C8C 0FC33D40 */ jal indycommHostSendDump -/* 006890 70005C90 3C060040 */ lui $a2, 0x40 -.L70005C94: -/* 006894 70005C94 8FA401A4 */ lw $a0, 0x1a4($sp) -/* 006898 70005C98 02602825 */ move $a1, $s3 -/* 00689C 70005C9C 00003025 */ move $a2, $zero -/* 0068A0 70005CA0 0FC33CCE */ jal rspGfxTaskStart -/* 0068A4 70005CA4 8FA70048 */ lw $a3, 0x48($sp) -/* 0068A8 70005CA8 0C00249C */ jal memaIterateAndMerge -/* 0068AC 70005CAC 27DE0001 */ addiu $fp, $fp, 1 -/* 0068B0 70005CB0 0FC30029 */ jal eu_sub_7f0c00a4 -/* 0068B4 70005CB4 00000000 */ nop -/* 0068B8 70005CB8 8FAF01AC */ lw $t7, 0x1ac($sp) -/* 0068BC 70005CBC 3C040001 */ lui $a0, 1 -/* 0068C0 70005CC0 39EE0001 */ xori $t6, $t7, 1 -/* 0068C4 70005CC4 0C000AF0 */ jal speedGraphDisplay -/* 0068C8 70005CC8 AFAE01AC */ sw $t6, 0x1ac($sp) -/* 0068CC 70005CCC 3C028002 */ lui $v0, %hi(g_MainStageNum) # $v0, 0x8002 -/* 0068D0 70005CD0 10000006 */ b .L70005CEC -/* 0068D4 70005CD4 8C42218C */ lw $v0, %lo(g_MainStageNum)($v0) -.L70005CD8: -/* 0068D8 70005CD8 27DEFFFF */ addiu $fp, $fp, -1 -/* 0068DC 70005CDC 10000003 */ b .L70005CEC -/* 0068E0 70005CE0 8C42218C */ lw $v0, 0x218c($v0) -.L70005CE4: -/* 0068E4 70005CE4 241E0004 */ li $fp, 4 -/* 0068E8 70005CE8 8C42218C */ lw $v0, 0x218c($v0) -.L70005CEC: -/* 0068EC 70005CEC 0440FED3 */ bltz $v0, .L7000583C -/* 0068F0 70005CF0 00000000 */ nop -/* 0068F4 70005CF4 17C0FED1 */ bnez $fp, .L7000583C -/* 0068F8 70005CF8 00000000 */ nop -.L70005CFC: -/* 0068FC 70005CFC 0FC2FBD9 */ jal lvlUnloadStageTextData -/* 006900 70005D00 00000000 */ nop -/* 006904 70005D04 0FC2FF5F */ jal stop_demo_playback -/* 006908 70005D08 00000000 */ nop -/* 00690C 70005D0C 0C002389 */ jal mempNullNextEntryInBank -/* 006910 70005D10 24040004 */ li $a0, 4 -/* 006914 70005D14 0FC2F15D */ jal obBlankResourcesLoadedInBank -/* 006918 70005D18 24040004 */ li $a0, 4 -/* 00691C 70005D1C 3C028002 */ lui $v0, %hi(g_MainStageNum) # $v0, 0x8002 -/* 006920 70005D20 2442218C */ addiu $v0, %lo(g_MainStageNum) # addiu $v0, $v0, 0x218c -/* 006924 70005D24 8C4B0000 */ lw $t3, ($v0) -/* 006928 70005D28 8FB901DC */ lw $t9, 0x1dc($sp) -/* 00692C 70005D2C 3C018002 */ lui $at, %hi(g_StageNum) # $at, 0x8002 -/* 006930 70005D30 2418FFFF */ li $t8, -1 -/* 006934 70005D34 AC2B2038 */ sw $t3, %lo(g_StageNum)($at) -/* 006938 70005D38 1320FE1C */ beqz $t9, .L700055AC -/* 00693C 70005D3C AC580000 */ sw $t8, ($v0) -/* 006940 70005D40 0FC343E7 */ jal sub_GAME_7F0D1A7C -/* 006944 70005D44 AFB301A8 */ sw $s3, 0x1a8($sp) -/* 006948 70005D48 8FBF003C */ lw $ra, 0x3c($sp) -/* 00694C 70005D4C 8FB00018 */ lw $s0, 0x18($sp) -/* 006950 70005D50 8FB1001C */ lw $s1, 0x1c($sp) -/* 006954 70005D54 8FB20020 */ lw $s2, 0x20($sp) -/* 006958 70005D58 8FB30024 */ lw $s3, 0x24($sp) -/* 00695C 70005D5C 8FB40028 */ lw $s4, 0x28($sp) -/* 006960 70005D60 8FB5002C */ lw $s5, 0x2c($sp) -/* 006964 70005D64 8FB60030 */ lw $s6, 0x30($sp) -/* 006968 70005D68 8FB70034 */ lw $s7, 0x34($sp) -/* 00696C 70005D6C 8FBE0038 */ lw $fp, 0x38($sp) -/* 006970 70005D70 03E00008 */ jr $ra -/* 006974 70005D74 27BD01E0 */ addiu $sp, $sp, 0x1e0 -) -#endif /** * 7530 70006930 @@ -1354,6 +712,6 @@ s32 bossGetDebugParseFlag(void) { * 75C0 700069C0 * V0= p->debug.notice.list entry for boss_c_debug using data at 800241A0 */ -void bossInitDebugNoticeList(void) { +void bossInit(void) { debTryAdd(&g_BossDebugNoticeEntry, "boss_c_debug"); } diff --git a/src/boss.h b/src/boss.h index c06b1827..02e80277 100644 --- a/src/boss.h +++ b/src/boss.h @@ -11,7 +11,7 @@ struct memallocstring LEVELID bossGetStageNum(); void bossSetLoadedStage(LEVELID stage); -void bossInitDebugNoticeList(void); +void bossInit(void); void bossEnableShowMemUseFlag(void); void bossMemBarsFlagToggle(void); void bossRunTitleStage(void); diff --git a/src/crash.c b/src/crash.c index 23a06d15..1fb6a61d 100644 --- a/src/crash.c +++ b/src/crash.c @@ -140,7 +140,7 @@ // bss - TLB section OSThread g_tlbThread; -u8 g_tlbUnused[0x500]; +u8 g_CrashMessage[0x500]; char g_tlbStack[0x2300]; OSMesgQueue g_faultMesgQ; OSMesg *g_faultMesgBuf; @@ -150,7 +150,7 @@ OSMesg *g_faultMesgBuf; */ // Padding -u32 D_80023300 = 0; +u32 g_CrashEnabled = FALSE; //The following regDesc's are similar to PR/Tools/Gload/Server.c /* @@ -313,6 +313,7 @@ u32 D_80024184[4] = {0}; void crashMain(void* arg0); +void crashPrintDescription(u32 mask, char *label, struct regDesc_t *description); // end forward declarations /** @@ -605,45 +606,35 @@ u8 *crashIndyFileGetAddressSubsequentData(u8 *arg0) */ s32 crashIndyScanLoadResourceIdFromBuffer(u32 arg0) { - u32 *temp_v1; - u8 *phi_s0 = (u8 *)0xE00004; - u8 *v0; - u32 a0 = arg0; - u8 *phi_s3; + u32 this = 0x00e00004; + u32 prev = 0x00e00004; - phi_s3 = phi_s0; + while (TRUE) { + u32 next = crashIndyFileGetAddressSubsequentData(this); - while (1) - { - v0 = crashIndyFileGetAddressSubsequentData(phi_s0); - - temp_v1 = g_indyCurrentReadBufferResourceId; - - if (a0 < (u32)temp_v1) - { - break; - } + if (arg0 >= (u32)g_indyCurrentReadBufferResourceId) { + prev = this; - phi_s3 = phi_s0; + if (g_indyCurrentReadBufferResourceId == 0) { + return FALSE; + } - if (temp_v1 == NULL) - { - return 0; - } - - phi_s0 = v0; - } + this = next; + } else { + break; + } + } - crashIndyFileGetAddressSubsequentData(phi_s3); + crashIndyFileGetAddressSubsequentData(prev); - return 1; + return TRUE; } /** * 5FC8 700053C8 * V0= TRUE if valid indy.read.buf.resourceID [matches 826475BE] */ -u32 crashIidyIsValidReadBufferResourceId(void) +u32 crashIndyIsValidReadBufferResourceId(void) { crashIndyFileGetAddressSubsequentData((u8*)0xe00000); return ((u32)g_indyCurrentReadBufferResourceId ^ 0x826475be) == 0; diff --git a/src/crash.h b/src/crash.h index d48ce17f..c8b3c6f2 100644 --- a/src/crash.h +++ b/src/crash.h @@ -7,7 +7,7 @@ #define STACK_POINTER_COUNT 5 -typedef struct +typedef struct regDesc_t { u32 mask; u32 value; diff --git a/src/debugmenu.c b/src/debugmenu.c index 350118ea..09e18fea 100644 --- a/src/debugmenu.c +++ b/src/debugmenu.c @@ -119,6 +119,7 @@ Gfx g_DebugMenuEndDisplayList = gsSPEndDisplayList(); Gfx g_DebugMenuNoOp = gsDPNoOp(); Gfx g_DebugMenuPrimitiveColor = gsDPSetPrimColor(0, 0, 255, 255, 255, 0); Gfx g_DebugMenuEnvironmentColor = gsDPSetEnvColor(0, 0, 0, 0); +u32 g_DebugMenuPercentage = 0xFF; // Static? #endif /** @@ -214,89 +215,33 @@ void debmenu7000AF84(s32 x1, s32 y1, s32 x2, s32 y2) { } #endif -#ifdef NONMATCHING -#ifndef LEFTOVERDEBUG + void debmenu7000AF98(s32 height) { - s32 x; s32 y; +#ifdef LEFTOVERDEBUG + s32 x; + s32 y; - for (y = 33, height = height + 33; y != 0; y--, height--) + for (y = 34, height += y - 1; y--; height-- ) { - if ((height >= 0) && (height < 35)) { + if ((height >= 0) && (height < 35)) + { for ( x = 0; x != 80; x++) { debmenu7000AF84(x, height, x, y); } - - } else { + } + else + { for (x = 0; x != 80; x++) { debmenuWriteCharAtPos(x, y, 0); - } - + } } } -} #endif -#else -#ifndef LEFTOVERDEBUG -s32 debmenu7000AF98(s32 height) { - } -#else -GLOBAL_ASM( -.text -glabel debmenu7000AF98 -/* 00BB98 7000AF98 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 00BB9C 7000AF9C AFB30020 */ sw $s3, 0x20($sp) -/* 00BBA0 7000AFA0 AFB2001C */ sw $s2, 0x1c($sp) -/* 00BBA4 7000AFA4 AFB10018 */ sw $s1, 0x18($sp) -/* 00BBA8 7000AFA8 AFBF0024 */ sw $ra, 0x24($sp) -/* 00BBAC 7000AFAC AFB00014 */ sw $s0, 0x14($sp) -/* 00BBB0 7000AFB0 24110021 */ li $s1, 33 -/* 00BBB4 7000AFB4 24120050 */ li $s2, 80 -/* 00BBB8 7000AFB8 24930021 */ addiu $s3, $a0, 0x21 -.L7000AFBC: -/* 00BBBC 7000AFBC 0660000D */ bltz $s3, .L7000AFF4 -/* 00BBC0 7000AFC0 2A610023 */ slti $at, $s3, 0x23 -/* 00BBC4 7000AFC4 1020000B */ beqz $at, .L7000AFF4 -/* 00BBC8 7000AFC8 00008025 */ move $s0, $zero -/* 00BBCC 7000AFCC 02002025 */ move $a0, $s0 -.L7000AFD0: -/* 00BBD0 7000AFD0 02602825 */ move $a1, $s3 -/* 00BBD4 7000AFD4 02003025 */ move $a2, $s0 -/* 00BBD8 7000AFD8 0C002BE1 */ jal debmenu7000AF84 -/* 00BBDC 7000AFDC 02203825 */ move $a3, $s1 -/* 00BBE0 7000AFE0 26100001 */ addiu $s0, $s0, 1 -/* 00BBE4 7000AFE4 5612FFFA */ bnel $s0, $s2, .L7000AFD0 -/* 00BBE8 7000AFE8 02002025 */ move $a0, $s0 -/* 00BBEC 7000AFEC 1000000A */ b .L7000B018 -/* 00BBF0 7000AFF0 02201025 */ move $v0, $s1 -.L7000AFF4: -/* 00BBF4 7000AFF4 00008025 */ move $s0, $zero -/* 00BBF8 7000AFF8 02002025 */ move $a0, $s0 -.L7000AFFC: -/* 00BBFC 7000AFFC 02202825 */ move $a1, $s1 -/* 00BC00 7000B000 0C002B74 */ jal debmenuWriteCharAtPos -/* 00BC04 7000B004 00003025 */ move $a2, $zero -/* 00BC08 7000B008 26100001 */ addiu $s0, $s0, 1 -/* 00BC0C 7000B00C 5612FFFB */ bnel $s0, $s2, .L7000AFFC -/* 00BC10 7000B010 02002025 */ move $a0, $s0 -/* 00BC14 7000B014 02201025 */ move $v0, $s1 -.L7000B018: -/* 00BC18 7000B018 2673FFFF */ addiu $s3, $s3, -1 -/* 00BC1C 7000B01C 1620FFE7 */ bnez $s1, .L7000AFBC -/* 00BC20 7000B020 2631FFFF */ addiu $s1, $s1, -1 -/* 00BC24 7000B024 8FBF0024 */ lw $ra, 0x24($sp) -/* 00BC28 7000B028 8FB00014 */ lw $s0, 0x14($sp) -/* 00BC2C 7000B02C 8FB10018 */ lw $s1, 0x18($sp) -/* 00BC30 7000B030 8FB2001C */ lw $s2, 0x1c($sp) -/* 00BC34 7000B034 8FB30020 */ lw $s3, 0x20($sp) -/* 00BC38 7000B038 03E00008 */ jr $ra -/* 00BC3C 7000B03C 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif -#endif + void debmenuSetPos(s32 x, s32 y) { #ifdef LEFTOVERDEBUG @@ -362,320 +307,141 @@ void debmenuSetPositionAndWriteString(s32 x, s32 y, const unsigned char *str) { #endif } -//hacky hack for DEBUGMENU until properly decompiled -#if !defined(DEBUGMENU) && defined(LEFTOVERDEBUG) -u32 percentage = 0xFF; // Static? -#endif -#ifdef DEBUGMENU -u32 get_random_value(void); -// very close gSPTextureRectangle has some reordering issues + + Gfx *debmenuDraw(Gfx *gdl) { - #if defined(LEFTOVERDEBUG) - s32 x; +#if defined(LEFTOVERDEBUG) + s32 y; + s32 x; s32 appliedpaletteindex; - s32 available; s32 needed; + s32 available; Gfx *gdl2; - static u32 percentage = 255; + // Calculate how much space is needed in the display list // based on the number of characters to draw and the number // of times the colours will be changed. gdl2 = gdl; appliedpaletteindex = -1; - for (y = 0; y < 35; y++) { - for (x = 0; x < 80; x++) { + + for (y = 0; y < 35; y++) + { + for (x = 0; x < 80; x++) + { u32 c = g_DebugMenuTextBuffer[x][y].chr; s32 paletteindex = g_DebugMenuTextBuffer[x][y].color; - if (c != '\0') { - if (paletteindex != appliedpaletteindex) { + + if (c != '\0') + { + if (paletteindex != appliedpaletteindex) + { gdl2 += 2; appliedpaletteindex = paletteindex; } - if (1); - gdl2 += 3; + + if (1) + { + gdl2 += 3; + } } } } + // Make sure there'll be a least 256 GBI commands free (2KB) available = dynGetFreeGfx(gdl) - 256 * sizeof(Gfx); needed = (u32)gdl2 - (u32)gdl; + if (needed <= 0) { // shouldn't be possible return gdl; } + + if(1) { - s32 x; s32 appliedpaletteindex = -1; - // Write a "percentage" (out of 255) into a global variable + + // Write a "g_DebugMenuPercentage" (out of 255) into a global variable // which shows how much of the displaylist will be committed, - // provided 2KB is kept free. - if (available <= 0) { + // provided 2KB is kept free. + if (available <= 0) + { // There's already less than 2KB free in the display list - percentage = 0; - } else if (needed > available) { + g_DebugMenuPercentage = 0; + } + else if (needed > available) + { // The display list would end with less than 2KB free, - // so calculate the percentage - percentage = available * 255 / needed; - } else { + // so calculate the g_DebugMenuPercentage + g_DebugMenuPercentage = available * 255 / needed; + } + else + { // The display list would end with at least 2KB free, // so the displaylist can be committed in full - percentage = 256; + g_DebugMenuPercentage = 256; } + gSPDisplayList(gdl++, g_DebugMenuTextureDisplayList); - // Build the display list for real this time. + + // Build the display list for real this time. // Regardless of the availability checks above, just stop when // there's less than 1KB of free space... sort of. It still writes // the colour change commands, but the debug HUD doesn't exactly // draw rainbows so it's no big deal. - for (y = 0; y < 35; y++) { - for (x = 0; x < 80; x++) { + for (y = 0; y < 35; y++) + { + s32 x; + for (x = 0; x < 80; x++) + { u32 c = g_DebugMenuTextBuffer[x][y].chr; s32 paletteindex = g_DebugMenuTextBuffer[x][y].color; - if (c != '\0') { - if (paletteindex != appliedpaletteindex) { - *gdl = g_DHudFgGbiPtrs[paletteindex]; gdl++; - *gdl = g_DHudBgGbiPtrs[paletteindex]; gdl++; + + if(x == 80); + + if (c != '\0') + { + if (paletteindex != appliedpaletteindex) + { + *gdl = g_DHudFgGbiPtrs[paletteindex]; + gdl++; + *gdl = g_DHudBgGbiPtrs[paletteindex]; + gdl++; appliedpaletteindex = paletteindex; } - #ifndef DEBUGMENU - if ((randomGetNext() & 0xFF) < percentage) { - #else - if(1) { - #endif - if (dynGetFreeGfx(gdl) >= 1024) { + +#ifndef DEBUGMENU + if ((randomGetNext() & 0xFF) < g_DebugMenuPercentage ) +#else + if(1) +#endif + { + if (dynGetFreeGfx(gdl) >= 1024) + { + gSPTextureRectangle(gdl++, - // Screen coords to draw at - x * 4 * 4, - y * 7 * 4, - x * 4 * 4 + 4 * 4, - y * 7 * 4 + 7 * 4, - 0, - // Sprite X and Y positions - ((c - ' ') % 32) * 4 * 32, - ((s32)(c - ' ') >> 5) * 7 * 32, - 1024, 1024); + // Screen coords to draw at + x * 4 * 4, + y * 7 * 4, + x * 4 * 4 + 4 * 4, + y * 7 * 4 + 7 * 4, + G_TX_RENDERTILE, + // Sprite X and Y positions + ((c - ' ') % 32) * 4 * 32, + ((s32)(c - ' ') >> 5) * 7 * 32, + 1024, + 1024); } } } + + if (appliedpaletteindex == 1); + if(y); } } } - #endif - return gdl; -} - - -#else - -#ifndef VERSION_EU -GLOBAL_ASM( -.text -glabel debmenuDraw -/* 00BE7C 7000B27C 27BDFF78 */ addiu $sp, $sp, -0x88 -/* 00BE80 7000B280 AFB5002C */ sw $s5, 0x2c($sp) -/* 00BE84 7000B284 AFB1001C */ sw $s1, 0x1c($sp) -/* 00BE88 7000B288 AFB00018 */ sw $s0, 0x18($sp) -/* 00BE8C 7000B28C 3C078002 */ lui $a3, %hi(g_DHudFgGbiPtrs) -/* 00BE90 7000B290 00808025 */ move $s0, $a0 -/* 00BE94 7000B294 AFBF003C */ sw $ra, 0x3c($sp) -/* 00BE98 7000B298 AFBE0038 */ sw $fp, 0x38($sp) -/* 00BE9C 7000B29C AFB70034 */ sw $s7, 0x34($sp) -/* 00BEA0 7000B2A0 AFB60030 */ sw $s6, 0x30($sp) -/* 00BEA4 7000B2A4 AFB40028 */ sw $s4, 0x28($sp) -/* 00BEA8 7000B2A8 AFB30024 */ sw $s3, 0x24($sp) -/* 00BEAC 7000B2AC AFB20020 */ sw $s2, 0x20($sp) -/* 00BEB0 7000B2B0 00808825 */ move $s1, $a0 -/* 00BEB4 7000B2B4 2406FFFF */ li $a2, -1 -/* 00BEB8 7000B2B8 24E76610 */ addiu $a3, %lo(g_DHudFgGbiPtrs) # addiu $a3, $a3, 0x6610 -/* 00BEBC 7000B2BC 0000A825 */ move $s5, $zero -/* 00BEC0 7000B2C0 00004025 */ move $t0, $zero -.L7000B2C4: -/* 00BEC4 7000B2C4 3C0E8002 */ lui $t6, %hi(g_DebugMenuTextBuffer) -/* 00BEC8 7000B2C8 25C55030 */ addiu $a1, $t6, %lo(g_DebugMenuTextBuffer) -/* 00BECC 7000B2CC 01052021 */ addu $a0, $t0, $a1 -.L7000B2D0: -/* 00BED0 7000B2D0 90820000 */ lbu $v0, ($a0) -/* 00BED4 7000B2D4 24A50046 */ addiu $a1, $a1, 0x46 -/* 00BED8 7000B2D8 90830001 */ lbu $v1, 1($a0) -/* 00BEDC 7000B2DC 10400006 */ beqz $v0, .L7000B2F8 -/* 00BEE0 7000B2E0 00000000 */ nop -/* 00BEE4 7000B2E4 50660004 */ beql $v1, $a2, .L7000B2F8 -/* 00BEE8 7000B2E8 26310018 */ addiu $s1, $s1, 0x18 -/* 00BEEC 7000B2EC 26310010 */ addiu $s1, $s1, 0x10 -/* 00BEF0 7000B2F0 00603025 */ move $a2, $v1 -/* 00BEF4 7000B2F4 26310018 */ addiu $s1, $s1, 0x18 -.L7000B2F8: -/* 00BEF8 7000B2F8 14A7FFF5 */ bne $a1, $a3, .L7000B2D0 -/* 00BEFC 7000B2FC 24840046 */ addiu $a0, $a0, 0x46 -/* 00BF00 7000B300 25080002 */ addiu $t0, $t0, 2 -/* 00BF04 7000B304 29010046 */ slti $at, $t0, 0x46 -/* 00BF08 7000B308 1420FFEE */ bnez $at, .L7000B2C4 -/* 00BF0C 7000B30C 00000000 */ nop -/* 00BF10 7000B310 0FC2F5DF */ jal dynGetFreeGfx -/* 00BF14 7000B314 02002025 */ move $a0, $s0 -/* 00BF18 7000B318 02302023 */ subu $a0, $s1, $s0 -/* 00BF1C 7000B31C 1C800003 */ bgtz $a0, .L7000B32C -/* 00BF20 7000B320 2443F800 */ addiu $v1, $v0, -0x800 -/* 00BF24 7000B324 10000080 */ b .L7000B528 -/* 00BF28 7000B328 02001025 */ move $v0, $s0 -.L7000B32C: -/* 00BF2C 7000B32C 1C600004 */ bgtz $v1, .L7000B340 -/* 00BF30 7000B330 2414FFFF */ li $s4, -1 -/* 00BF34 7000B334 3C018002 */ lui $at, %hi(percentage) -/* 00BF38 7000B338 10000017 */ b .L7000B398 -/* 00BF3C 7000B33C AC2068B8 */ sw $zero, %lo(percentage)($at) -.L7000B340: -/* 00BF40 7000B340 0064082A */ slt $at, $v1, $a0 -/* 00BF44 7000B344 10200011 */ beqz $at, .L7000B38C -/* 00BF48 7000B348 00037A00 */ sll $t7, $v1, 8 -/* 00BF4C 7000B34C 01E37823 */ subu $t7, $t7, $v1 -/* 00BF50 7000B350 01E4001A */ div $zero, $t7, $a0 -/* 00BF54 7000B354 14800002 */ bnez $a0, .L7000B360 -/* 00BF58 7000B358 00000000 */ nop -/* 00BF5C 7000B35C 0007000D */ break 7 -.L7000B360: -/* 00BF60 7000B360 2401FFFF */ li $at, -1 -/* 00BF64 7000B364 14810004 */ bne $a0, $at, .L7000B378 -/* 00BF68 7000B368 3C018000 */ lui $at, 0x8000 -/* 00BF6C 7000B36C 15E10002 */ bne $t7, $at, .L7000B378 -/* 00BF70 7000B370 00000000 */ nop -/* 00BF74 7000B374 0006000D */ break 6 -.L7000B378: -/* 00BF78 7000B378 3C018002 */ lui $at, %hi(percentage) -/* 00BF7C 7000B37C 0000C012 */ mflo $t8 -/* 00BF80 7000B380 AC3868B8 */ sw $t8, %lo(percentage)($at) -/* 00BF84 7000B384 10000005 */ b .L7000B39C -/* 00BF88 7000B388 02001025 */ move $v0, $s0 -.L7000B38C: -/* 00BF8C 7000B38C 24190100 */ li $t9, 256 -/* 00BF90 7000B390 3C018002 */ lui $at, %hi(percentage) -/* 00BF94 7000B394 AC3968B8 */ sw $t9, %lo(percentage)($at) -.L7000B398: -/* 00BF98 7000B398 02001025 */ move $v0, $s0 -.L7000B39C: -/* 00BF9C 7000B39C 3C0A8002 */ lui $t2, %hi(g_DebugMenuTextureDisplayList) -/* 00BFA0 7000B3A0 254A4FB0 */ addiu $t2, %lo(g_DebugMenuTextureDisplayList) # addiu $t2, $t2, 0x4fb0 -/* 00BFA4 7000B3A4 3C090600 */ lui $t1, 0x600 -/* 00BFA8 7000B3A8 AC490000 */ sw $t1, ($v0) -/* 00BFAC 7000B3AC AC4A0004 */ sw $t2, 4($v0) -/* 00BFB0 7000B3B0 3C1E8002 */ lui $fp, %hi(g_DHudBgGbiPtrs) -/* 00BFB4 7000B3B4 3C178002 */ lui $s7, %hi(g_DHudFgGbiPtrs) -/* 00BFB8 7000B3B8 26100008 */ addiu $s0, $s0, 8 -/* 00BFBC 7000B3BC 26F76610 */ addiu $s7, %lo(g_DHudFgGbiPtrs) # addiu $s7, $s7, 0x6610 -/* 00BFC0 7000B3C0 27DE6710 */ addiu $fp, %lo(g_DHudBgGbiPtrs) # addiu $fp, $fp, 0x6710 -/* 00BFC4 7000B3C4 AFA00040 */ sw $zero, 0x40($sp) -/* 00BFC8 7000B3C8 0000A825 */ move $s5, $zero -/* 00BFCC 7000B3CC 24160050 */ li $s6, 80 -.L7000B3D0: -/* 00BFD0 7000B3D0 8FAB0040 */ lw $t3, 0x40($sp) -/* 00BFD4 7000B3D4 3C0C8002 */ lui $t4, %hi(g_DebugMenuTextBuffer) -/* 00BFD8 7000B3D8 258C5030 */ addiu $t4, %lo(g_DebugMenuTextBuffer) # addiu $t4, $t4, 0x5030 -/* 00BFDC 7000B3DC 00008825 */ move $s1, $zero -/* 00BFE0 7000B3E0 016C9021 */ addu $s2, $t3, $t4 -.L7000B3E4: -/* 00BFE4 7000B3E4 92530000 */ lbu $s3, ($s2) -/* 00BFE8 7000B3E8 92430001 */ lbu $v1, 1($s2) -/* 00BFEC 7000B3EC 52600045 */ beql $s3, $zero, .L7000B504 -/* 00BFF0 7000B3F0 26310001 */ addiu $s1, $s1, 1 -/* 00BFF4 7000B3F4 1074000D */ beq $v1, $s4, .L7000B42C -/* 00BFF8 7000B3F8 000310C0 */ sll $v0, $v1, 3 -/* 00BFFC 7000B3FC 02E26821 */ addu $t5, $s7, $v0 -/* 00C000 7000B400 8DA10000 */ lw $at, ($t5) -/* 00C004 7000B404 03C2C021 */ addu $t8, $fp, $v0 -/* 00C008 7000B408 26100010 */ addiu $s0, $s0, 0x10 -/* 00C00C 7000B40C AE01FFF0 */ sw $at, -0x10($s0) -/* 00C010 7000B410 8DAF0004 */ lw $t7, 4($t5) -/* 00C014 7000B414 0060A025 */ move $s4, $v1 -/* 00C018 7000B418 AE0FFFF4 */ sw $t7, -0xc($s0) -/* 00C01C 7000B41C 8F010000 */ lw $at, ($t8) -/* 00C020 7000B420 AE01FFF8 */ sw $at, -8($s0) -/* 00C024 7000B424 8F090004 */ lw $t1, 4($t8) -/* 00C028 7000B428 AE09FFFC */ sw $t1, -4($s0) -.L7000B42C: -/* 00C02C 7000B42C 0C002914 */ jal randomGetNext -/* 00C030 7000B430 00000000 */ nop -/* 00C034 7000B434 3C0B8002 */ lui $t3, %hi(percentage) -/* 00C038 7000B438 8D6B68B8 */ lw $t3, %lo(percentage)($t3) -/* 00C03C 7000B43C 304A00FF */ andi $t2, $v0, 0xff -/* 00C040 7000B440 014B082B */ sltu $at, $t2, $t3 -/* 00C044 7000B444 5020002F */ beql $at, $zero, .L7000B504 -/* 00C048 7000B448 26310001 */ addiu $s1, $s1, 1 -/* 00C04C 7000B44C 0FC2F5DF */ jal dynGetFreeGfx -/* 00C050 7000B450 02002025 */ move $a0, $s0 -/* 00C054 7000B454 28410400 */ slti $at, $v0, 0x400 -/* 00C058 7000B458 14200029 */ bnez $at, .L7000B500 -/* 00C05C 7000B45C 02001025 */ move $v0, $s0 -/* 00C060 7000B460 00111900 */ sll $v1, $s1, 4 -/* 00C064 7000B464 001520C0 */ sll $a0, $s5, 3 -/* 00C068 7000B468 00952023 */ subu $a0, $a0, $s5 -/* 00C06C 7000B46C 246C0010 */ addiu $t4, $v1, 0x10 -/* 00C070 7000B470 318E0FFF */ andi $t6, $t4, 0xfff -/* 00C074 7000B474 00042080 */ sll $a0, $a0, 2 -/* 00C078 7000B478 306A0FFF */ andi $t2, $v1, 0xfff -/* 00C07C 7000B47C 000A5B00 */ sll $t3, $t2, 0xc -/* 00C080 7000B480 000E6B00 */ sll $t5, $t6, 0xc -/* 00C084 7000B484 2499001C */ addiu $t9, $a0, 0x1c -/* 00C088 7000B488 308C0FFF */ andi $t4, $a0, 0xfff -/* 00C08C 7000B48C 3C01E400 */ lui $at, 0xe400 -/* 00C090 7000B490 2666FFE0 */ addiu $a2, $s3, -0x20 -/* 00C094 7000B494 00065143 */ sra $t2, $a2, 5 -/* 00C098 7000B498 01A17825 */ or $t7, $t5, $at -/* 00C09C 7000B49C 016C7025 */ or $t6, $t3, $t4 -/* 00C0A0 7000B4A0 33380FFF */ andi $t8, $t9, 0xfff -/* 00C0A4 7000B4A4 01F84825 */ or $t1, $t7, $t8 -/* 00C0A8 7000B4A8 000A58C0 */ sll $t3, $t2, 3 -/* 00C0AC 7000B4AC 016A5823 */ subu $t3, $t3, $t2 -/* 00C0B0 7000B4B0 26100008 */ addiu $s0, $s0, 8 -/* 00C0B4 7000B4B4 02002825 */ move $a1, $s0 -/* 00C0B8 7000B4B8 000B5940 */ sll $t3, $t3, 5 -/* 00C0BC 7000B4BC AC490000 */ sw $t1, ($v0) -/* 00C0C0 7000B4C0 30D8001F */ andi $t8, $a2, 0x1f -/* 00C0C4 7000B4C4 AC4E0004 */ sw $t6, 4($v0) -/* 00C0C8 7000B4C8 00184DC0 */ sll $t1, $t8, 0x17 -/* 00C0CC 7000B4CC 316CFFFF */ andi $t4, $t3, 0xffff -/* 00C0D0 7000B4D0 26100008 */ addiu $s0, $s0, 8 -/* 00C0D4 7000B4D4 3C0DB400 */ lui $t5, 0xb400 -/* 00C0D8 7000B4D8 ACAD0000 */ sw $t5, ($a1) -/* 00C0DC 7000B4DC 02003825 */ move $a3, $s0 -/* 00C0E0 7000B4E0 012C7025 */ or $t6, $t1, $t4 -/* 00C0E4 7000B4E4 ACAE0004 */ sw $t6, 4($a1) -/* 00C0E8 7000B4E8 3C190400 */ lui $t9, (0x04000400 >> 16) # lui $t9, 0x400 -/* 00C0EC 7000B4EC 37390400 */ ori $t9, (0x04000400 & 0xFFFF) # ori $t9, $t9, 0x400 -/* 00C0F0 7000B4F0 3C0DB300 */ lui $t5, 0xb300 -/* 00C0F4 7000B4F4 ACED0000 */ sw $t5, ($a3) -/* 00C0F8 7000B4F8 ACF90004 */ sw $t9, 4($a3) -/* 00C0FC 7000B4FC 26100008 */ addiu $s0, $s0, 8 -.L7000B500: -/* 00C100 7000B500 26310001 */ addiu $s1, $s1, 1 -.L7000B504: -/* 00C104 7000B504 1636FFB7 */ bne $s1, $s6, .L7000B3E4 -/* 00C108 7000B508 26520046 */ addiu $s2, $s2, 0x46 -/* 00C10C 7000B50C 8FAF0040 */ lw $t7, 0x40($sp) -/* 00C110 7000B510 26B50001 */ addiu $s5, $s5, 1 -/* 00C114 7000B514 24010023 */ li $at, 35 -/* 00C118 7000B518 25F80002 */ addiu $t8, $t7, 2 -/* 00C11C 7000B51C 16A1FFAC */ bne $s5, $at, .L7000B3D0 -/* 00C120 7000B520 AFB80040 */ sw $t8, 0x40($sp) -/* 00C124 7000B524 02001025 */ move $v0, $s0 -.L7000B528: -/* 00C128 7000B528 8FBF003C */ lw $ra, 0x3c($sp) -/* 00C12C 7000B52C 8FB00018 */ lw $s0, 0x18($sp) -/* 00C130 7000B530 8FB1001C */ lw $s1, 0x1c($sp) -/* 00C134 7000B534 8FB20020 */ lw $s2, 0x20($sp) -/* 00C138 7000B538 8FB30024 */ lw $s3, 0x24($sp) -/* 00C13C 7000B53C 8FB40028 */ lw $s4, 0x28($sp) -/* 00C140 7000B540 8FB5002C */ lw $s5, 0x2c($sp) -/* 00C144 7000B544 8FB60030 */ lw $s6, 0x30($sp) -/* 00C148 7000B548 8FB70034 */ lw $s7, 0x34($sp) -/* 00C14C 7000B54C 8FBE0038 */ lw $fp, 0x38($sp) -/* 00C150 7000B550 03E00008 */ jr $ra -/* 00C154 7000B554 27BD0088 */ addiu $sp, $sp, 0x88 -) -#else -Gfx *debmenuDraw(Gfx *gdl) -{ + +#endif // defined(LEFTOVERDEBUG) + return gdl; -} -#endif -#endif +} \ No newline at end of file diff --git a/src/fr.c b/src/fr.c index 1d126c10..e1f9a003 100644 --- a/src/fr.c +++ b/src/fr.c @@ -57,8 +57,8 @@ struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] = #else struct VideoSettings_s g_ViDataArray[NUM_VIDEO_SETTINGS] = { - {0, 0, 0, 0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL}, - {0, 0, 0, 0, 320, 240, 60.0f, 1.3333334f, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL} + {0, 0, 0, 0, 320, 240, 60.0f, ASPECT_RATIO_SD, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL}, + {0, 0, 0, 0, 320, 240, 60.0f, ASPECT_RATIO_SD, 30.0f, 10000.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 320, 240, 0, 0, 1, NULL} }; #endif @@ -284,6 +284,8 @@ void viVsyncRelated(void) * 3E98 70003298 * Some code (and defines) based on n64devkit\ultra\usr\src\pr\demos\blockmonkey\block.c * + * https://decomp.me/scratch/0yXle 98.52% + * * decomp status: * - compiles: yes * - stack resize: ok @@ -492,11 +494,9 @@ void video_related_8(void) g_ViFrontIndex = (g_ViFrontIndex + 1) % NUM_VIDEO_SETTINGS; g_ViBackIndex = (g_ViBackIndex + 1) % NUM_VIDEO_SETTINGS; - // first li 44, needs to be signed. (sizeof(VideoSettings) == 44) - g_ViFrontData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViFrontIndex * (s32)sizeof(VideoSettings))); - g_ViBackData = (VideoSettings*)((u8*)&g_ViDataArray + (g_ViBackIndex * (s32)sizeof(VideoSettings))); + g_ViFrontData = g_ViDataArray + g_ViFrontIndex; + g_ViBackData = g_ViDataArray + g_ViBackIndex; - // second li 44, can be signed or unsigned. bcopy(settings, g_ViBackData, sizeof(VideoSettings)); g_ViBackData->framebuf = cfb_16[g_ViBackIndex]; } @@ -1114,7 +1114,7 @@ glabel video_related_8 /* 003A44 70002E44 3C188002 */ lui $t8, %hi(g_viColorOutputMode) # $t8, 0x8002 /* 003A48 70002E48 24010002 */ li $at, 2 /* 003A4C 70002E4C 10610043 */ beq $v1, $at, .L70002F5C -/* 003A50 70002E50 3C0E8002 */ lui $t6, 0x8002 +/* 003A50 70002E50 3C0E8002 */ lui $t6, 0x8002 # fixme? /* 003A54 70002E54 10000050 */ b .L70002F98 /* 003A58 70002E58 00000000 */ nop .L70002E5C: @@ -1227,7 +1227,7 @@ glabel video_related_8 /* 003BE4 70002FE4 3C0D8002 */ lui $t5, %hi(g_viColorOutputMode) # $t5, 0x8002 /* 003BE8 70002FE8 340AFFFF */ li $t2, 65535 /* 003BEC 70002FEC 468084A0 */ cvt.s.w $f18, $f16 -/* 003BF0 70002FF0 3C088002 */ lui $t0, 0x8002 +/* 003BF0 70002FF0 3C088002 */ lui $t0, %hi(D_800232A0) /* 003BF4 70002FF4 46802220 */ cvt.s.w $f8, $f4 /* 003BF8 70002FF8 460A3083 */ div.s $f2, $f6, $f10 /* 003BFC 70002FFC 14600003 */ bnez $v1, .L7000300C @@ -1236,22 +1236,22 @@ glabel video_related_8 /* 003C08 70003008 00000000 */ nop .L7000300C: /* 003C0C 7000300C 8FFF1160 */ lw $ra, %lo(D_800232C0)($ra) -/* 003C10 70003010 3C018002 */ lui $at, 0x8002 +/* 003C10 70003010 3C018002 */ lui $at, %hi(g_ViXScales) /* 003C14 70003014 001F6080 */ sll $t4, $ra, 2 /* 003C18 70003018 002C0821 */ addu $at, $at, $t4 -/* 003C1C 7000301C E4220F74 */ swc1 $f2, 0xf74($at) -/* 003C20 70003020 3C018002 */ lui $at, 0x8002 +/* 003C1C 7000301C E4220F74 */ swc1 $f2, %lo(g_ViXScales)($at) +/* 003C20 70003020 3C018002 */ lui $at, %hi(g_ViYScales) /* 003C24 70003024 002C0821 */ addu $at, $at, $t4 -/* 003C28 70003028 E4200F7C */ swc1 $f0, 0xf7c($at) +/* 003C28 70003028 E4200F7C */ swc1 $f0, %lo(g_ViYScales)($at) /* 003C2C 7000302C 90EE0000 */ lbu $t6, ($a3) /* 003C30 70003030 24010001 */ li $at, 1 /* 003C34 70003034 15C100F2 */ bne $t6, $at, .L70003400 /* 003C38 70003038 00000000 */ nop /* 003C3C 7000303C 8DAD114C */ lw $t5, %lo(g_viColorOutputMode)($t5) -/* 003C40 70003040 3C018005 */ lui $at, 0x8005 +/* 003C40 70003040 3C018005 */ lui $at, %hi(g_ViModePtrs) /* 003C44 70003044 002C0821 */ addu $at, $at, $t4 /* 003C48 70003048 11A00019 */ beqz $t5, .L700030B0 -/* 003C4C 7000304C AC391FA0 */ sw $t9, 0x1fa0($at) +/* 003C4C 7000304C AC391FA0 */ sw $t9, %lo(g_ViModePtrs)($at) /* 003C50 70003050 001FC080 */ sll $t8, $ra, 2 /* 003C54 70003054 031FC021 */ addu $t8, $t8, $ra /* 003C58 70003058 3C0F8005 */ lui $t7, %hi(g_ViModes) # $t7, 0x8005 @@ -1415,7 +1415,7 @@ glabel video_related_8 /* 003E94 70003294 10000001 */ b .L7000329C /* 003E98 70003298 2403000E */ li $v1, 14 .L7000329C: -/* 003E9C 7000329C 8D081140 */ lw $t0, 0x1140($t0) +/* 003E9C 7000329C 8D081140 */ lw $t0, %lo(D_800232A0)($t0) /* 003EA0 700032A0 30D8FFFF */ andi $t8, $a2, 0xffff /* 003EA4 700032A4 00787821 */ addu $t7, $v1, $t8 /* 003EA8 700032A8 01E87021 */ addu $t6, $t7, $t0 @@ -1937,7 +1937,6 @@ Gfx *viSetFillColor(Gfx *gdl, s32 r, s32 g, s32 b) void indyGrabJpg16bit(void) { #ifdef LEFTOVERDEBUG - #ifndef ENABLE_USB s32 *pgrabnum = &g_indyJpg16BitGrabnum; char buffer[250]; s32 filesize; @@ -1970,10 +1969,6 @@ void indyGrabJpg16bit(void) sprintf(buffer, "imgview grab.%d.jpeg", *pgrabnum); indycommHostSendCmd((u8*)&buffer); - #else - //msg.msgtype -usb_write(DATATYPE_RAWBINARY , (u8*)g_ViBackData->framebuf, (viGetX() * viGetY() * 2)); - #endif #endif } @@ -1984,7 +1979,6 @@ usb_write(DATATYPE_RAWBINARY , (u8*)g_ViBackData->framebuf, (viGetX() * viGetY( void indyGrabJpg32bit(void) { #if defined(LEFTOVERDEBUG) - #if !defined(ENABLE_USB) s32 *pgrabnum = &g_indyJpg32BitGrabnum; char buffer[250]; s32 filesize; @@ -2017,9 +2011,6 @@ void indyGrabJpg32bit(void) sprintf(buffer, "imgview grab.%d.jpeg", *pgrabnum); indycommHostSendCmd((u8*)&buffer); - #else -usb_write(DATATYPE_RAWBINARY , (u8*)&cfb_16, (viGetX() * viGetY() * 4)); - #endif #endif } @@ -2029,8 +2020,7 @@ usb_write(DATATYPE_RAWBINARY , (u8*)&cfb_16, (viGetX() * viGetY() * 4)); */ void indyGrabRgb16bit(void) { - #if defined(LEFTOVERDEBUG) - #if !defined(ENABLE_USB) + #if defined(LEFTOVERDEBUG) s32 *pgrabnum = &g_indyRgb16BitGrabnum; char buffer[250]; s32 filesize; @@ -2060,11 +2050,7 @@ void indyGrabRgb16bit(void) sprintf(buffer, "imgview grab.%d.rgb", *pgrabnum); indycommHostSendCmd((u8*)&buffer); - #else - //msg.msgtype -usb_write(DATATYPE_RAWBINARY , (u8*)g_ViBackData->framebuf, (viGetX() * viGetY() * 2)); - #endif - #endif +#endif } /** @@ -2073,8 +2059,7 @@ usb_write(DATATYPE_RAWBINARY , (u8*)g_ViBackData->framebuf, (viGetX() * viGetY( */ void indyGrabRgb32bit(void) { - #if defined(LEFTOVERDEBUG) - #if !defined(ENABLE_USB) + #if defined(LEFTOVERDEBUG) s32 *pgrabnum = &g_indyRgb32BitGrabnum; char buffer[250]; s32 filesize; @@ -2104,9 +2089,5 @@ void indyGrabRgb32bit(void) sprintf(buffer, "imgview grab.%d.rgb", *pgrabnum); indycommHostSendCmd((u8*)&buffer); - #else - //msg.msgtype -usb_write(DATATYPE_RAWBINARY , (u8*)&cfb_16, (viGetX() * viGetY() * 4)); - #endif #endif } diff --git a/src/fr.h b/src/fr.h index 4efbba2b..313afb79 100644 --- a/src/fr.h +++ b/src/fr.h @@ -24,6 +24,8 @@ #define VIEWPORT_WIDTH_WIDESCREEN SCREEN_WIDTH_320 #define VIEWPORT_WIDTH_CINEMA SCREEN_WIDTH_320 +#define SCREEN_HALF_WIDTH (SCREEN_WIDTH_320 / 2) + /* 304 = 320 - 16 ?? */ #define VIEWPORT_HEIGHT_FULLSCREEN 304 #define VIEWPORT_HEIGHT_WIDESCREEN 248 @@ -84,6 +86,14 @@ #define Z_BUFFER_4_3_HEIGHT 330 #define Z_BUFFER_4_3_WIDTH 440 + +// 4:3 +#define ASPECT_RATIO_SD (1.3333334f) +#define ASPECT_RATIO_PAL (1.1764706f) + +#define ASPECT_RATIO_EU_400_330 (1.5873016119f) +#define ASPECT_RATIO_EU_320_272 (1.40056025982f) + #if defined(VERSION_EU) /* PAL */ #define SCREEN_HEIGHT SCREEN_HEIGHT_272 @@ -99,6 +109,7 @@ #define VIEWPORT_ULY_4P_PLAYER_34 VIEWPORT_ULY_4P_PLAYER_34_PAL #define VIEWPORT_ULY_WIDESCREEN_OFFSET VIEWPORT_ULY_WIDESCREEN_OFFSET_PAL #define Z_BUFFER_HEIGHT Z_BUFFER_HEIGHT_PAL +#define ASPECT_RATIO ASPECT_RATIO_PAL #else /* NTSC */ #define SCREEN_HEIGHT SCREEN_HEIGHT_240 @@ -114,13 +125,17 @@ #define VIEWPORT_ULY_4P_PLAYER_34 VIEWPORT_ULY_4P_PLAYER_34_NTSC #define VIEWPORT_ULY_WIDESCREEN_OFFSET VIEWPORT_ULY_WIDESCREEN_OFFSET_NTSC #define Z_BUFFER_HEIGHT Z_BUFFER_HEIGHT_NTSC +#define ASPECT_RATIO ASPECT_RATIO_SD #endif + #define SCREEN_WIDTH SCREEN_WIDTH_320 #define XSCALE_MAX 0x400 #define YSCALE_MAX 0x800 +#define FOV_Y_F 60.0f + typedef struct VideoSettings_s { /** * enum VIDEOMODE. @@ -187,7 +202,8 @@ s32 viGetHorizontalOffset(void); void video_related_8(void); void viSetBuf(s16 x, s16 y); void viSetXY(s16 x, s16 y); - +Gfx *viSetFillColor(Gfx *gdl, s32 r, s32 g, s32 b); +Gfx *viFillScreen(Gfx *gdl); Gfx *viSetupScreensForNumPlayers(Gfx *gdl); void indyGrabJpg16bit(void); diff --git a/src/game/bg.c b/src/game/bg.c index b32181f1..486b2f8f 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -18,7 +18,6 @@ #include "unk_0BC530.h" - #define BG_STACK_SIZE 20 // bss @@ -86,7 +85,7 @@ char dword_CODE_bss_8007C100[0x3e80]; * address 8007FF80 * EU .bss 8007B3C8 */ -bg_portal_data_entry* ptr_bgdata_portals; +bg_portal_data_entry* g_BgPortals; //CODE.bss:8007FF84 s32 ptr_bgdata_offsets; @@ -332,7 +331,7 @@ s32 g_BgStackCount = 0; s32 current_visibility = 0; //D:80044900 -s32 D_80044900 = 0; +f32 D_80044900 = 0; //D:80044904 s32 D_80044904 = 0x7F7FFFFF; @@ -368,9 +367,6 @@ void sub_GAME_7F0B6368(s32 room); Gfx *sub_GAME_7F0B677C(Gfx *arg0, s32 room_index); Gfx *sub_GAME_7F0B6898(Gfx *arg0, s32 room_index); -// second parameter is almost certainly a struct -void sub_GAME_7F0B96CC(f32 arg0, f32 *arg1); -s32 sub_GAME_7F0B993C(f32 arg0); Gfx *bgScissorCurrentPlayerView(Gfx *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); // end forward declarations @@ -406,14 +402,14 @@ Gfx *bgScissorCurrentPlayerView(Gfx *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg #define TLRGB_ATile1 TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, 1, 0, TEXEL1, 0 #endif //D:80044928 -Gfx D_80044928[] = { +Gfx DL_LUT_UNKNOWN[] = { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), gsDPSetCombineLERP(TEXEL1, 0, SCALE, 0, TEXEL1, 0, PRIM_LOD_FRAC, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), 0,0 }; //D:80044940 - Primary -Gfx FogDL_primary_80044940[] = { +Gfx DL_LUT_PRIMARY_ADDFOG[] = { //Add FOG to all rendermodes //Standard HiQuality Surface to Standard Fogable HiQuality Surface gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_SURF2), @@ -444,7 +440,7 @@ Gfx FogDL_primary_80044940[] = { }; //D:800449C8 - Secondary -Gfx FogDL_secondary_800449C8[] = { +Gfx DL_LUT_SECONDARY_ADDFOG[] = { //Add FOG to Rendermodes //Transparent DECAL to FOG Transparent DECAL gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_DECAL2), @@ -488,7 +484,7 @@ Gfx FogDL_secondary_800449C8[] = { //D:80044AB0 // Loaded once on first time entering level, only once ever // Swap all refrences to Shade in Alpha to Environment -Gfx D_80044AB0[] = { +Gfx DL_LUT_PRIMARY[] = { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, 0, COMBINED, 0, ENVIRONMENT, 0), gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0), @@ -515,7 +511,7 @@ Gfx D_80044AB0[] = { //D:80044B58 // Loaded once on first time entering level, only once ever // Swap all refrences to Shade in Alpha to Environment -Gfx D_80044B58[] = { +Gfx DL_LUT_SECONDARY[] = { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, 0, COMBINED, 0, ENVIRONMENT, 0), gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0), @@ -540,7 +536,7 @@ Gfx D_80044B58[] = { }; //D:80044C00 -Gfx BillboardDL_80044C00[] = { +Gfx DL_LUT_BILLBOARD[] = { //Transparent 1Cycle to BillBoard 1Cycle gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2), gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2), //Transparent Surface to Billboard @@ -550,7 +546,7 @@ Gfx BillboardDL_80044C00[] = { //D:80044C28 //water -Gfx ParticleDL_80044C28[] = { +Gfx DL_LUT_WATER[] = { 0xB900031D, 0x00552078, 0xB900031D, 0x00502078, 0xB900031D, 0x0C192078, 0xB900031D, 0x0C182078, /* @@ -563,7 +559,7 @@ Gfx ParticleDL_80044C28[] = { }; //D:80044C50 -Gfx transparent2cloudDL_80044C50[] = { +Gfx DL_LUT_CLOUD[] = { //Transparent to Cloud (Saves AA - Stops Jaggies from appearing behind BillBoard) gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2), gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), 0,0 @@ -571,7 +567,7 @@ Gfx transparent2cloudDL_80044C50[] = { //D:80044C68 //(Wallet Bond - Main Menu) -Gfx WalletBondDL_80044C68[] = { +Gfx DL_LUT_WALLETBOND[] = { gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetCycleType(G_CYC_2CYCLE), //1Cycle --> 2Cycle 0xB900031D, 0x00502048, @@ -588,7 +584,7 @@ Gfx WalletBondDL_80044C68[] = { }; //D:80044CA0 -Gfx D_80044CA0[] = { +Gfx DL_LUT_FIXFOGALPHA3[] = { gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE, TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE), gsDPSetCombineLERP(TEXEL0, 0, SCALE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SCALE, 0, 0, 0, 0, ENVIRONMENT), gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0), @@ -622,8 +618,8 @@ Gfx D_80044CA0[] = { //D:80044D88 s32 *ptrDynamic_CC_RM_LUT[] = { - &D_80044928, &FogDL_primary_80044940, &BillboardDL_80044C00, &ParticleDL_80044C28, &transparent2cloudDL_80044C50, - &FogDL_secondary_800449C8, &D_80044AB0, &D_80044B58, &WalletBondDL_80044C68, &D_80044CA0 + &DL_LUT_UNKNOWN, &DL_LUT_PRIMARY_ADDFOG, &DL_LUT_BILLBOARD, &DL_LUT_WATER, &DL_LUT_CLOUD, + &DL_LUT_SECONDARY_ADDFOG, &DL_LUT_PRIMARY, &DL_LUT_SECONDARY, &DL_LUT_WALLETBOND, &DL_LUT_FIXFOGALPHA3 }; enum CCRMLUT { @@ -647,7 +643,7 @@ s32 D_80044DB0 = 0; -void bgInitDebugNoticeList(void) { +void bgInit(void) { debTryAdd(&ptr_bg_c_debug_debug_notice_list, "bg_c_debug"); } @@ -669,7 +665,7 @@ void sub_GAME_7F0B37EC(void) portals = specialportalarray[i].portallist; for ( p=0; (portals[p] & 0xFF) != 0xFF; p++) { - ptr_bgdata_portals[portals[p] & 0xff].controlbytes1 |= 2; + g_BgPortals[portals[p] & 0xff].controlbytes1 |= 2; } } else { portals = specialportalarray[i].portallist; @@ -686,12 +682,12 @@ GLOBAL_ASM( glabel sub_GAME_7F0B37EC /* 0E831C 7F0B37EC 3C028004 */ lui $v0, %hi(specialportalarray) /* 0E8320 7F0B37F0 3C038004 */ lui $v1, %hi(g_BgCurrentRoom) -/* 0E8324 7F0B37F4 3C088008 */ lui $t0, %hi(ptr_bgdata_portals) +/* 0E8324 7F0B37F4 3C088008 */ lui $t0, %hi(g_BgPortals) /* 0E8328 7F0B37F8 3C078004 */ lui $a3, %hi(levelentry_index) /* 0E832C 7F0B37FC 24424824 */ addiu $v0, %lo(specialportalarray) # addiu $v0, $v0, 0x4824 /* 0E8330 7F0B3800 24634838 */ addiu $v1, %lo(g_BgCurrentRoom) # addiu $v1, $v1, 0x4838 /* 0E8334 7F0B3804 24E71400 */ addiu $a3, %lo(levelentry_index) # addiu $a3, $a3, 0x1400 -/* 0E8338 7F0B3808 2508FF80 */ addiu $t0, %lo(ptr_bgdata_portals) # addiu $t0, $t0, -0x80 +/* 0E8338 7F0B3808 2508FF80 */ addiu $t0, %lo(g_BgPortals) # addiu $t0, $t0, -0x80 /* 0E833C 7F0B380C 240900FF */ li $t1, 255 /* 0E8340 7F0B3810 8CEE0000 */ lw $t6, ($a3) .L7F0B3814: @@ -2116,7 +2112,7 @@ glabel load_bg_file /* 0E8DA8 7F0B4278 24070004 */ li $a3, 4 /* 0E8DAC 7F0B427C 00005012 */ mflo $t2 /* 0E8DB0 7F0B4280 022A5821 */ addu $t3, $s1, $t2 -/* 0E8DB4 7F0B4284 0FC2F341 */ jal _load_resource_named_to_membank +/* 0E8DB4 7F0B4284 0FC2F341 */ jal _fileNameLoadToBank /* 0E8DB8 7F0B4288 8D640008 */ lw $a0, 8($t3) /* 0E8DBC 7F0B428C 3C108008 */ lui $s0, %hi(gptr_stan) /* 0E8DC0 7F0B4290 2610BF94 */ addiu $s0, %lo(gptr_stan) # addiu $s0, $s0, -0x406c @@ -2197,8 +2193,8 @@ glabel load_bg_file /* 0E8EE8 7F0B43B8 8ECF0000 */ lw $t7, ($s6) .L7F0B43BC: /* 0E8EEC 7F0B43BC 8CA80008 */ lw $t0, 8($a1) -/* 0E8EF0 7F0B43C0 3C1E8008 */ lui $fp, %hi(ptr_bgdata_portals) -/* 0E8EF4 7F0B43C4 27DEFF80 */ addiu $fp, %lo(ptr_bgdata_portals) # addiu $fp, $fp, -0x80 +/* 0E8EF0 7F0B43C0 3C1E8008 */ lui $fp, %hi(g_BgPortals) +/* 0E8EF4 7F0B43C4 27DEFF80 */ addiu $fp, %lo(g_BgPortals) # addiu $fp, $fp, -0x80 /* 0E8EF8 7F0B43C8 01024821 */ addu $t1, $t0, $v0 /* 0E8EFC 7F0B43CC 01335021 */ addu $t2, $t1, $s3 /* 0E8F00 7F0B43D0 AFCA0000 */ sw $t2, ($fp) @@ -2587,7 +2583,7 @@ glabel load_bg_file /* 0E5FA4 7F0B35B4 24070004 */ li $a3, 4 /* 0E5FA8 7F0B35B8 00005012 */ mflo $t2 /* 0E5FAC 7F0B35BC 022A5821 */ addu $t3, $s1, $t2 -/* 0E5FB0 7F0B35C0 0FC2F053 */ jal _load_resource_named_to_membank +/* 0E5FB0 7F0B35C0 0FC2F053 */ jal _fileNameLoadToBank /* 0E5FB4 7F0B35C4 8D640008 */ lw $a0, 8($t3) /* 0E5FB8 7F0B35C8 3C108007 */ lui $s0, %hi(gptr_stan) # $s0, 0x8007 /* 0E5FBC 7F0B35CC 26109EE4 */ addiu $s0, %lo(gptr_stan) # addiu $s0, $s0, -0x611c @@ -2668,8 +2664,8 @@ glabel load_bg_file /* 0E60E4 7F0B36F4 8ECF0000 */ lw $t7, ($s6) .L7F0B36F8: /* 0E60E8 7F0B36F8 8CA80008 */ lw $t0, 8($a1) -/* 0E60EC 7F0B36FC 3C1E8007 */ lui $fp, %hi(ptr_bgdata_portals) # $fp, 0x8007 -/* 0E60F0 7F0B3700 27DEB3C8 */ addiu $fp, %lo(ptr_bgdata_portals) # addiu $fp, $fp, -0x4c38 +/* 0E60EC 7F0B36FC 3C1E8007 */ lui $fp, %hi(g_BgPortals) # $fp, 0x8007 +/* 0E60F0 7F0B3700 27DEB3C8 */ addiu $fp, %lo(g_BgPortals) # addiu $fp, $fp, -0x4c38 /* 0E60F4 7F0B3704 01024821 */ addu $t1, $t0, $v0 /* 0E60F8 7F0B3708 01335021 */ addu $t2, $t1, $s3 /* 0E60FC 7F0B370C AFCA0000 */ sw $t2, ($fp) @@ -2970,7 +2966,7 @@ glabel load_bg_file -void sub_GAME_7F0B47E0(void) { +void cleanup_rooms(void) { unload_rooms(); matrix_4x4_7F058C4C(1.0); } @@ -3083,9 +3079,9 @@ glabel sub_GAME_7F0B4884 /* 0E9460 7F0B4930 AC224838 */ sw $v0, %lo(g_BgCurrentRoom)($at) /* 0E9464 7F0B4934 0FC22800 */ jal bondviewGetCurrentPlayersPosition3 /* 0E9468 7F0B4938 0040A025 */ move $s4, $v0 -/* 0E946C 7F0B493C 3C038008 */ lui $v1, %hi(ptr_bgdata_portals) +/* 0E946C 7F0B493C 3C038008 */ lui $v1, %hi(g_BgPortals) /* 0E9470 7F0B4940 0040A825 */ move $s5, $v0 -/* 0E9474 7F0B4944 8C63FF80 */ lw $v1, %lo(ptr_bgdata_portals)($v1) +/* 0E9474 7F0B4944 8C63FF80 */ lw $v1, %lo(g_BgPortals)($v1) /* 0E9478 7F0B4948 0000B825 */ move $s7, $zero /* 0E947C 7F0B494C 241E000B */ li $fp, 11 /* 0E9480 7F0B4950 8C790000 */ lw $t9, ($v1) @@ -3114,8 +3110,8 @@ glabel sub_GAME_7F0B4884 /* 0E94D0 7F0B49A0 0FC2E7C5 */ jal sub_GAME_7F0B9F14 /* 0E94D4 7F0B49A4 02A03025 */ move $a2, $s5 /* 0E94D8 7F0B49A8 10400009 */ beqz $v0, .L7F0B49D0 -/* 0E94DC 7F0B49AC 3C038008 */ lui $v1, %hi(ptr_bgdata_portals) -/* 0E94E0 7F0B49B0 8C63FF80 */ lw $v1, %lo(ptr_bgdata_portals)($v1) +/* 0E94DC 7F0B49AC 3C038008 */ lui $v1, %hi(g_BgPortals) +/* 0E94E0 7F0B49B0 8C63FF80 */ lw $v1, %lo(g_BgPortals)($v1) /* 0E94E4 7F0B49B4 0200B025 */ move $s6, $s0 /* 0E94E8 7F0B49B8 00711021 */ addu $v0, $v1, $s1 /* 0E94EC 7F0B49BC 904C0004 */ lbu $t4, 4($v0) @@ -3124,8 +3120,8 @@ glabel sub_GAME_7F0B4884 /* 0E94F8 7F0B49C8 1000000A */ b .L7F0B49F4 /* 0E94FC 7F0B49CC 016D9826 */ xor $s3, $t3, $t5 .L7F0B49D0: -/* 0E9500 7F0B49D0 3C038008 */ lui $v1, %hi(ptr_bgdata_portals) -/* 0E9504 7F0B49D4 8C63FF80 */ lw $v1, %lo(ptr_bgdata_portals)($v1) +/* 0E9500 7F0B49D0 3C038008 */ lui $v1, %hi(g_BgPortals) +/* 0E9504 7F0B49D4 8C63FF80 */ lw $v1, %lo(g_BgPortals)($v1) /* 0E9508 7F0B49D8 00711021 */ addu $v0, $v1, $s1 /* 0E950C 7F0B49DC 8C4E0008 */ lw $t6, 8($v0) .L7F0B49E0: @@ -3194,8 +3190,8 @@ GLOBAL_ASM( glabel sub_GAME_7F0B4AB4 /* 0E95E4 7F0B4AB4 27BDFEA0 */ addiu $sp, $sp, -0x160 /* 0E95E8 7F0B4AB8 AFB5002C */ sw $s5, 0x2c($sp) -/* 0E95EC 7F0B4ABC 3C158008 */ lui $s5, %hi(ptr_bgdata_portals) -/* 0E95F0 7F0B4AC0 26B5FF80 */ addiu $s5, %lo(ptr_bgdata_portals) # addiu $s5, $s5, -0x80 +/* 0E95EC 7F0B4ABC 3C158008 */ lui $s5, %hi(g_BgPortals) +/* 0E95F0 7F0B4AC0 26B5FF80 */ addiu $s5, %lo(g_BgPortals) # addiu $s5, $s5, -0x80 /* 0E95F4 7F0B4AC4 8EA80000 */ lw $t0, ($s5) /* 0E95F8 7F0B4AC8 AFBF003C */ sw $ra, 0x3c($sp) /* 0E95FC 7F0B4ACC AFBE0038 */ sw $fp, 0x38($sp) @@ -4007,11 +4003,11 @@ s32 sub_GAME_7F0B5488(coord3d* arg0, coord3d* arg1) Mtxf* temp_a0; s32 var_v0; - temp_a0 = currentPlayerGetMatrix10CC(); + temp_a0 = camGetWorldToScreenMtxf(); arg1->x = arg0->x * room_data_float2; arg1->y = arg0->y * room_data_float2; arg1->z = arg0->z * room_data_float2; - matrix_4x4_transform_vector_in_place(temp_a0, arg1->f); + mtx4TransformVecInPlace(temp_a0, arg1); sub_GAME_7F078060(arg1, arg1); @@ -4053,7 +4049,7 @@ glabel sub_GAME_7F0B5528 /* 0EA08C 7F0B555C AFB00030 */ sw $s0, 0x30($sp) /* 0EA090 7F0B5560 F7B80028 */ sdc1 $f24, 0x28($sp) /* 0EA094 7F0B5564 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 0EA098 7F0B5568 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0EA098 7F0B5568 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0EA09C 7F0B556C AFA400B0 */ sw $a0, 0xb0($sp) /* 0EA0A0 7F0B5570 AFA200AC */ sw $v0, 0xac($sp) /* 0EA0A4 7F0B5574 241E0001 */ li $fp, 1 @@ -4062,10 +4058,10 @@ glabel sub_GAME_7F0B5528 /* 0EA0B0 7F0B5580 3C018004 */ lui $at, %hi(mCurrentLevelVisibilityScale) /* 0EA0B4 7F0B5584 C42613FC */ lwc1 $f6, %lo(mCurrentLevelVisibilityScale)($at) /* 0EA0B8 7F0B5588 C7A4009C */ lwc1 $f4, 0x9c($sp) -/* 0EA0BC 7F0B558C 3C138008 */ lui $s3, %hi(ptr_bgdata_portals) +/* 0EA0BC 7F0B558C 3C138008 */ lui $s3, %hi(g_BgPortals) /* 0EA0C0 7F0B5590 8FB500B0 */ lw $s5, 0xb0($sp) /* 0EA0C4 7F0B5594 46062203 */ div.s $f8, $f4, $f6 -/* 0EA0C8 7F0B5598 2673FF80 */ addiu $s3, %lo(ptr_bgdata_portals) # addiu $s3, $s3, -0x80 +/* 0EA0C8 7F0B5598 2673FF80 */ addiu $s3, %lo(g_BgPortals) # addiu $s3, $s3, -0x80 /* 0EA0CC 7F0B559C 8E6F0000 */ lw $t7, ($s3) /* 0EA0D0 7F0B55A0 001570C0 */ sll $t6, $s5, 3 /* 0EA0D4 7F0B55A4 01C0A825 */ move $s5, $t6 @@ -4134,7 +4130,7 @@ glabel sub_GAME_7F0B5528 /* 0EA1C8 7F0B5698 C6920000 */ lwc1 $f18, ($s4) /* 0EA1CC 7F0B569C 46124102 */ mul.s $f4, $f8, $f18 /* 0EA1D0 7F0B56A0 E6040008 */ swc1 $f4, 8($s0) -/* 0EA1D4 7F0B56A4 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 0EA1D4 7F0B56A4 0FC1611D */ jal mtx4TransformVecInPlace /* 0EA1D8 7F0B56A8 8FA400AC */ lw $a0, 0xac($sp) /* 0EA1DC 7F0B56AC C7A6009C */ lwc1 $f6, 0x9c($sp) /* 0EA1E0 7F0B56B0 C6120008 */ lwc1 $f18, 8($s0) @@ -4215,7 +4211,7 @@ glabel sub_GAME_7F0B5528 /* 0EA2EC 7F0B57BC 46008107 */ neg.s $f4, $f16 /* 0EA2F0 7F0B57C0 00E60019 */ multu $a3, $a2 /* 0EA2F4 7F0B57C4 46062303 */ div.s $f12, $f4, $f6 -/* 0EA2F8 7F0B57C8 3C0B8008 */ lui $t3, %hi(ptr_bgdata_portals) +/* 0EA2F8 7F0B57C8 3C0B8008 */ lui $t3, %hi(g_BgPortals) /* 0EA2FC 7F0B57CC 24E70001 */ addiu $a3, $a3, 1 /* 0EA300 7F0B57D0 46005201 */ sub.s $f8, $f10, $f0 /* 0EA304 7F0B57D4 00005012 */ mflo $t2 @@ -4231,7 +4227,7 @@ glabel sub_GAME_7F0B5528 /* 0EA32C 7F0B57FC 460C5202 */ mul.s $f8, $f10, $f12 /* 0EA330 7F0B5800 46024480 */ add.s $f18, $f8, $f2 /* 0EA334 7F0B5804 E472FFF8 */ swc1 $f18, -8($v1) -/* 0EA338 7F0B5808 8D6BFF80 */ lw $t3, %lo(ptr_bgdata_portals)($t3) +/* 0EA338 7F0B5808 8D6BFF80 */ lw $t3, %lo(g_BgPortals)($t3) /* 0EA33C 7F0B580C 01756021 */ addu $t4, $t3, $s5 /* 0EA340 7F0B5810 8D8D0000 */ lw $t5, ($t4) /* 0EA344 7F0B5814 91A40000 */ lbu $a0, ($t5) @@ -4701,78 +4697,24 @@ void bgFillRectangleWithSides(Gfx *gdl, s32 ulx, s32 uly, s32 lrx, s32 lry) * * Address 0x7F0B5BDC. */ -s32 bgRectIntersect(struct bbox2d *arg0, struct bbox2d *arg1) +s32 bgRectIntersect(struct bbox2d *a, struct bbox2d *b) { - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f0_6; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - - temp_f0 = arg1->min.x; - temp_f2 = arg0->min.x; - if (temp_f0 < temp_f2) - { - arg0->min.x = temp_f2; - } - else - { - arg0->min.x = temp_f0; - } - - temp_f0_2 = arg1->min.y; - temp_f2_2 = arg0->min.y; - if (temp_f0_2 < temp_f2_2) - { - arg0->min.y = temp_f2_2; - } - else - { - arg0->min.y = temp_f0_2; - } - - temp_f0_3 = arg0->max.x; - temp_f2_3 = arg1->max.x; - if (temp_f0_3 < temp_f2_3) - { - arg0->max.x = temp_f0_3; - } - else - { - arg0->max.x = temp_f2_3; - } - - temp_f0_4 = arg0->max.y; - temp_f2_4 = arg1->max.y; - if (temp_f0_4 < temp_f2_4) - { - arg0->max.y = temp_f0_4; - } - else - { - arg0->max.y = temp_f2_4; - } - - temp_f0_5 = arg0->max.x; - if (temp_f0_5 <= arg0->min.x) - { - arg0->min.x = temp_f0_5; - return 0; - } - - temp_f0_6 = arg0->max.y; - if (temp_f0_6 <= arg0->min.y) - { - arg0->min.y = temp_f0_6; - return 0; - } - - return 1; + a->min.x = a->min.x > b->min.x ? a->min.x : b->min.x; + a->min.y = a->min.y > b->min.y ? a->min.y : b->min.y; + a->max.x = b->max.x > a->max.x ? a->max.x : b->max.x; + a->max.y = b->max.y > a->max.y ? a->max.y : b->max.y; + + if (a->min.x >= a->max.x) { + a->min.x = a->max.x; + return FALSE; + } + + if (a->max.y <= a->min.y) { + a->min.y = a->max.y; + return FALSE; + } + + return TRUE; } @@ -4930,9 +4872,9 @@ s32 getIndexOfPORTALID(s32 portalID) { s32 i; - for(i = 0; ptr_bgdata_portals[i].offset_portal != NULL; i++) + for(i = 0; g_BgPortals[i].offset_portal != NULL; i++) { - if (portalID == (s32)ptr_bgdata_portals[i].offset_portal) + if (portalID == (s32)g_BgPortals[i].offset_portal) { return i; } @@ -4944,7 +4886,8 @@ s32 getIndexOfPORTALID(s32 portalID) #ifdef NONMATCHING -void generate_room_load_string(void) { + +void roomsHandleStateDebugging(void) { ? sp29; ? temp_ret; void *phi_v1; @@ -4954,7 +4897,7 @@ void generate_room_load_string(void) { s32 phi_a0_3; // Node 0 - temp_ret = get_debug_prroomloads_flag(); + temp_ret = debugIsRoomStateDebugEnabled(); if (temp_ret != 0) { // Node 1 @@ -5000,10 +4943,10 @@ void generate_room_load_string(void) { #if defined(LEFTOVERDEBUG) GLOBAL_ASM( .text -glabel generate_room_load_string +glabel roomsHandleStateDebugging /* 0EAA08 7F0B5ED8 27BDFF40 */ addiu $sp, $sp, -0xc0 /* 0EAA0C 7F0B5EDC AFBF0014 */ sw $ra, 0x14($sp) -/* 0EAA10 7F0B5EE0 0FC243F4 */ jal get_debug_prroomloads_flag +/* 0EAA10 7F0B5EE0 0FC243F4 */ jal debugIsRoomStateDebugEnabled /* 0EAA14 7F0B5EE4 00000000 */ nop /* 0EAA18 7F0B5EE8 10400024 */ beqz $v0, .L7F0B5F7C /* 0EAA1C 7F0B5EEC 3C078004 */ lui $a3, %hi(MaxNumRooms) @@ -5059,10 +5002,10 @@ glabel generate_room_load_string #if !defined(LEFTOVERDEBUG) GLOBAL_ASM( .text -glabel generate_room_load_string +glabel roomsHandleStateDebugging /* 0E7C04 7F0B5214 27BDFF48 */ addiu $sp, $sp, -0xb8 /* 0E7C08 7F0B5218 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E7C0C 7F0B521C 0FC2411A */ jal get_debug_prroomloads_flag +/* 0E7C0C 7F0B521C 0FC2411A */ jal debugIsRoomStateDebugEnabled /* 0E7C10 7F0B5220 00000000 */ nop /* 0E7C14 7F0B5224 10400024 */ beqz $v0, .L7F0B52B8 /* 0E7C18 7F0B5228 3C078004 */ lui $a3, %hi(MaxNumRooms) # $a3, 0x8004 @@ -5130,11 +5073,14 @@ u32 bgDecompress(u8* source, u8 *target) #ifdef NONMATCHING -s32 sub_GAME_7F0B5FAC(int roomID, int* data, int size) +void* sub_GAME_7F0B5FAC(int roomID, int* data, int size) { - s32 dest; - u8 *source; - u32 len; + void *source; + void* dest; + + s32 len; + + len = array_room_info[roomID].csize_point_index_binary + 0xfU & 0xfffffff0; if (size < len + 0x20) { @@ -5143,7 +5089,7 @@ s32 sub_GAME_7F0B5FAC(int roomID, int* data, int size) else { source = (size - len) + data; obLoadBGFileBytesAtOffset(levelinfotable[levelentry_index].bg_seg_filename, source, - &ptr_bgdata_room_fileposition_list[roomID] + -0xf000000, len); + (ptr_bg_data+ &ptr_bgdata_room_fileposition_list[roomID] - ptr_bg_data) + 0xF1000000, len); dest = bgDecompress(source,data); array_room_info[roomID].usize_point_index_binary = dest; array_room_info[roomID].ptr_point_index = data; @@ -5791,11 +5737,11 @@ void sub_GAME_7F0B6368(s32 rooms) { { // Node 5 sp1C = temp_v1; - sp2C = memaGetLargestAllocSize(0); + sp2C = memaGetLongestFree(0); } // Node 6 sp1C = (void *) temp_v1; - temp_ret = memaFree(sp2C, sp28); + temp_ret = memaAlloc(sp2C, sp28); temp_v1_2 = temp_v1; sp20 = temp_ret; if (temp_ret != 0) @@ -5870,7 +5816,7 @@ void sub_GAME_7F0B6368(s32 rooms) { { // Node 19 sp1C = (void *) phi_v1_2; - memaResize(sp20, sp2C, temp_t1, phi_a3_2); + memaRealloc(sp20, sp2C, temp_t1, phi_a3_2); phi_v1_3 = phi_v1_2; } // Node 20 @@ -5902,7 +5848,7 @@ void sub_GAME_7F0B6368(s32 rooms) { } // Node 25 sub_GAME_7F0B6994(rooms); - generate_room_load_string(); + roomsHandleStateDebugging(); } } } @@ -5947,7 +5893,7 @@ glabel sub_GAME_7F0B6368 /* 0EAF10 7F0B63E0 AFAB002C */ sw $t3, 0x2c($sp) /* 0EAF14 7F0B63E4 AFA3001C */ sw $v1, 0x1c($sp) .L7F0B63E8: -/* 0EAF18 7F0B63E8 0C0028DC */ jal memaGetLargestAllocSize +/* 0EAF18 7F0B63E8 0C0028DC */ jal memaGetLongestFree /* 0EAF1C 7F0B63EC AFA70028 */ sw $a3, 0x28($sp) /* 0EAF20 7F0B63F0 8FA3001C */ lw $v1, 0x1c($sp) /* 0EAF24 7F0B63F4 8FA70028 */ lw $a3, 0x28($sp) @@ -5955,7 +5901,7 @@ glabel sub_GAME_7F0B6368 .L7F0B63FC: /* 0EAF2C 7F0B63FC 8FA4002C */ lw $a0, 0x2c($sp) /* 0EAF30 7F0B6400 AFA3001C */ sw $v1, 0x1c($sp) -/* 0EAF34 7F0B6404 0C00278D */ jal memaFree +/* 0EAF34 7F0B6404 0C00278D */ jal memaAlloc /* 0EAF38 7F0B6408 AFA70028 */ sw $a3, 0x28($sp) /* 0EAF3C 7F0B640C 8FA3001C */ lw $v1, 0x1c($sp) /* 0EAF40 7F0B6410 8FA70028 */ lw $a3, 0x28($sp) @@ -6027,7 +5973,7 @@ glabel sub_GAME_7F0B6368 /* 0EB034 7F0B6504 8FA40020 */ lw $a0, 0x20($sp) /* 0EB038 7F0B6508 01602825 */ move $a1, $t3 /* 0EB03C 7F0B650C 01203025 */ move $a2, $t1 -/* 0EB040 7F0B6510 0C0028F7 */ jal memaResize +/* 0EB040 7F0B6510 0C0028F7 */ jal memaRealloc /* 0EB044 7F0B6514 AFA3001C */ sw $v1, 0x1c($sp) /* 0EB048 7F0B6518 8FA3001C */ lw $v1, 0x1c($sp) .L7F0B651C: @@ -6069,7 +6015,7 @@ glabel sub_GAME_7F0B6368 .L7F0B65A4: /* 0EB0D4 7F0B65A4 0FC2DA65 */ jal sub_GAME_7F0B6994 /* 0EB0D8 7F0B65A8 8FA40030 */ lw $a0, 0x30($sp) -/* 0EB0DC 7F0B65AC 0FC2D7B6 */ jal generate_room_load_string +/* 0EB0DC 7F0B65AC 0FC2D7B6 */ jal roomsHandleStateDebugging /* 0EB0E0 7F0B65B0 00000000 */ nop .L7F0B65B4: /* 0EB0E4 7F0B65B4 8FBF0014 */ lw $ra, 0x14($sp) @@ -6117,7 +6063,7 @@ glabel sub_GAME_7F0B6368 /* 0E810C 7F0B571C AFAB002C */ sw $t3, 0x2c($sp) /* 0E8110 7F0B5720 AFA3001C */ sw $v1, 0x1c($sp) .L7F0B5724: -/* 0E8114 7F0B5724 0C0025F4 */ jal memaGetLargestAllocSize +/* 0E8114 7F0B5724 0C0025F4 */ jal memaGetLongestFree /* 0E8118 7F0B5728 AFA70028 */ sw $a3, 0x28($sp) /* 0E811C 7F0B572C 8FA3001C */ lw $v1, 0x1c($sp) /* 0E8120 7F0B5730 8FA70028 */ lw $a3, 0x28($sp) @@ -6125,7 +6071,7 @@ glabel sub_GAME_7F0B6368 .L7F0B5738: /* 0E8128 7F0B5738 8FA4002C */ lw $a0, 0x2c($sp) /* 0E812C 7F0B573C AFA3001C */ sw $v1, 0x1c($sp) -/* 0E8130 7F0B5740 0C0024A5 */ jal memaFree +/* 0E8130 7F0B5740 0C0024A5 */ jal memaAlloc /* 0E8134 7F0B5744 AFA70028 */ sw $a3, 0x28($sp) /* 0E8138 7F0B5748 8FA3001C */ lw $v1, 0x1c($sp) /* 0E813C 7F0B574C 8FA70028 */ lw $a3, 0x28($sp) @@ -6197,7 +6143,7 @@ glabel sub_GAME_7F0B6368 /* 0E8230 7F0B5840 8FA40020 */ lw $a0, 0x20($sp) /* 0E8234 7F0B5844 01602825 */ move $a1, $t3 /* 0E8238 7F0B5848 01203025 */ move $a2, $t1 -/* 0E823C 7F0B584C 0C00260F */ jal memaResize +/* 0E823C 7F0B584C 0C00260F */ jal memaRealloc /* 0E8240 7F0B5850 AFA3001C */ sw $v1, 0x1c($sp) /* 0E8244 7F0B5854 8FA3001C */ lw $v1, 0x1c($sp) .L7F0B5858: @@ -6239,7 +6185,7 @@ glabel sub_GAME_7F0B6368 .L7F0B58E0: /* 0E82D0 7F0B58E0 0FC2D734 */ jal sub_GAME_7F0B6994 /* 0E82D4 7F0B58E4 8FA40030 */ lw $a0, 0x30($sp) -/* 0E82D8 7F0B58E8 0FC2D485 */ jal generate_room_load_string +/* 0E82D8 7F0B58E8 0FC2D485 */ jal roomsHandleStateDebugging /* 0E82DC 7F0B58EC 00000000 */ nop .L7F0B58F0: /* 0E82E0 7F0B58F0 8FBF0014 */ lw $ra, 0x14($sp) @@ -6254,12 +6200,12 @@ glabel sub_GAME_7F0B6368 #ifdef NONMATCHING -void sub_GAME_7F0B65C4(s32 roomID) +void delete_room_data(s32 roomID) { if (array_room_info[roomID].ptr_unique_collision_points) { - memaRegister(array_room_info[roomID].ptr_unique_collision_points, (((s16)array_room_info[roomID].bitflags3 * 0x1C) + 0xF) & ~0xF); + memaFree(array_room_info[roomID].ptr_unique_collision_points, (((s16)array_room_info[roomID].bitflags3 * 0x1C) + 0xF) & ~0xF); array_room_info[roomID].ptr_unique_collision_points = 0; } @@ -6267,23 +6213,23 @@ void sub_GAME_7F0B65C4(s32 roomID) { if (array_room_info[roomID].ptr_point_index) { - memaRegister(array_room_info[roomID].ptr_point_index, array_room_info[roomID].cur_room_totalsize); + memaFree(array_room_info[roomID].ptr_point_index, array_room_info[roomID].cur_room_totalsize); } else { - memaRegister(array_room_info[roomID].ptr_expanded_mapping_info, array_room_info[roomID].cur_room_totalsize); + memaFree(array_room_info[roomID].ptr_expanded_mapping_info, array_room_info[roomID].cur_room_totalsize); } array_room_info[roomID].ptr_point_index = 0; array_room_info[roomID].ptr_expanded_mapping_info = 0; array_room_info[roomID].ptr_secondary_expanded_mapping_info = 0; } array_room_info[roomID].model_bin_loaded = 0; - generate_room_load_string(); + roomsHandleStateDebugging(); } #else GLOBAL_ASM( .text -glabel sub_GAME_7F0B65C4 +glabel delete_room_data /* 0EB0F4 7F0B65C4 00047080 */ sll $t6, $a0, 2 /* 0EB0F8 7F0B65C8 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0EB0FC 7F0B65CC 01C47021 */ addu $t6, $t6, $a0 @@ -6304,7 +6250,7 @@ glabel sub_GAME_7F0B65C4 /* 0EB138 7F0B6608 0018C080 */ sll $t8, $t8, 2 /* 0EB13C 7F0B660C 2705000F */ addiu $a1, $t8, 0xf /* 0EB140 7F0B6610 00A1C824 */ and $t9, $a1, $at -/* 0EB144 7F0B6614 0C002808 */ jal memaRegister +/* 0EB144 7F0B6614 0C002808 */ jal memaFree /* 0EB148 7F0B6618 03202825 */ move $a1, $t9 /* 0EB14C 7F0B661C AE00002C */ sw $zero, 0x2c($s0) /* 0EB150 7F0B6620 8E020028 */ lw $v0, 0x28($s0) @@ -6315,19 +6261,19 @@ glabel sub_GAME_7F0B65C4 /* 0EB160 7F0B6630 00402825 */ move $a1, $v0 /* 0EB164 7F0B6634 10800005 */ beqz $a0, .L7F0B664C /* 0EB168 7F0B6638 00000000 */ nop -/* 0EB16C 7F0B663C 0C002808 */ jal memaRegister +/* 0EB16C 7F0B663C 0C002808 */ jal memaFree /* 0EB170 7F0B6640 00402825 */ move $a1, $v0 /* 0EB174 7F0B6644 10000004 */ b .L7F0B6658 /* 0EB178 7F0B6648 AE000004 */ sw $zero, 4($s0) .L7F0B664C: -/* 0EB17C 7F0B664C 0C002808 */ jal memaRegister +/* 0EB17C 7F0B664C 0C002808 */ jal memaFree /* 0EB180 7F0B6650 8E040008 */ lw $a0, 8($s0) /* 0EB184 7F0B6654 AE000004 */ sw $zero, 4($s0) .L7F0B6658: /* 0EB188 7F0B6658 AE000008 */ sw $zero, 8($s0) /* 0EB18C 7F0B665C AE00000C */ sw $zero, 0xc($s0) .L7F0B6660: -/* 0EB190 7F0B6660 0FC2D7B6 */ jal generate_room_load_string +/* 0EB190 7F0B6660 0FC2D7B6 */ jal roomsHandleStateDebugging /* 0EB194 7F0B6664 A2000002 */ sb $zero, 2($s0) /* 0EB198 7F0B6668 8FBF001C */ lw $ra, 0x1c($sp) /* 0EB19C 7F0B666C 8FB00018 */ lw $s0, 0x18($sp) @@ -6350,7 +6296,7 @@ void unload_rooms(void) { if (array_room_info[i].model_bin_loaded) { - sub_GAME_7F0B65C4(i); + delete_room_data(i); } } } @@ -6367,7 +6313,7 @@ void sub_GAME_7F0B66E8(void) { if (array_room_info[i].model_bin_loaded == 4) { - sub_GAME_7F0B65C4(i); + delete_room_data(i); } else if (array_room_info[i].model_bin_loaded != 0) { @@ -6530,7 +6476,7 @@ void sub_GAME_7F0B6994(s32 arg0) { temp_t8 = (((((phi_t5 * 8) - phi_t5) * 4) + 0xf) & -0x10); sp24 = temp_t8; sp3C = (s32) phi_t5; - temp_ret = memaFree(temp_t8, temp_a1, temp_a1->unk8); + temp_ret = memaAlloc(temp_t8, temp_a1, temp_a1->unk8); if (temp_ret != 0) { // Node 7 @@ -6715,7 +6661,7 @@ glabel sub_GAME_7F0B6994 /* 0EB55C 7F0B6A2C AFB80024 */ sw $t8, 0x24($sp) /* 0EB560 7F0B6A30 AFA50028 */ sw $a1, 0x28($sp) /* 0EB564 7F0B6A34 AFA60048 */ sw $a2, 0x48($sp) -/* 0EB568 7F0B6A38 0C00278D */ jal memaFree +/* 0EB568 7F0B6A38 0C00278D */ jal memaAlloc /* 0EB56C 7F0B6A3C AFAD003C */ sw $t5, 0x3c($sp) /* 0EB570 7F0B6A40 8FA50028 */ lw $a1, 0x28($sp) /* 0EB574 7F0B6A44 8FA60048 */ lw $a2, 0x48($sp) @@ -6907,450 +6853,160 @@ glabel sub_GAME_7F0B6994 #endif +bool bgTestLineIntersectsBbox(coord3d *arg0, coord3d *arg1, s32 *arg2, s32 *arg3) +{ + coord3d arg2f; + coord3d arg3f; + u32 stack[4]; + f32 f0; + f32 f0_2; + f32 f2; + f32 f2_2; + f32 f6; + f32 f10; + f32 sp34; + f32 sp30; + f32 f16; + f32 f18; + f32 f18_2; + f32 sp20; + f32 f12; + f32 f12_2; + f32 f14; + f32 f14_2; + arg2f.f[0] = arg2[0]; + arg2f.f[1] = arg2[1]; + arg2f.f[2] = arg2[2]; + arg3f.f[0] = arg3[0]; + arg3f.f[1] = arg3[1]; + arg3f.f[2] = arg3[2]; -#ifdef NONMATCHING -void sub_GAME_7F0B6CEC(void *arg0, void *arg1, void *arg2, void *arg3) { - f32 sp0; - f32 sp4; - f32 sp20; - f32 sp30; - f32 sp34; - f32 sp60; - f32 sp64; - f32 sp68; - f32 sp6C; - f32 sp70; - f32 sp74; - f32 temp_f6; - f32 temp_f16_2; - f32 temp_f14; - f32 temp_f2; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f18; - f32 temp_f12; - f32 temp_f16; - f32 phi_f14; - f32 phi_f16; - f32 phi_f0; - f32 phi_f2; - f32 phi_f14_2; - f32 phi_f12; - f32 phi_f0_2; - f32 phi_f18; - f32 phi_f2_2; - f32 phi_f16_2; - f32 phi_f0_3; - f32 phi_f18_2; - f32 phi_f12_2; - f32 phi_f2_3; - f32 phi_f18_3; - f32 phi_f0_4; - f32 phi_f14_3; - f32 phi_f12_3; + // x + f18 = arg1->x; + f16 = arg3f.x - arg0->x; + f14 = arg2f.x - arg0->x; - // Node 0 - temp_f6 = (f32) *arg2; - sp6C = temp_f6; - sp70 = (f32) arg2->unk4; - sp74 = (f32) arg2->unk8; - sp60 = (f32) *arg3; - sp64 = (f32) arg3->unk4; - sp68 = (f32) arg3->unk8; - temp_f16_2 = (sp60 - *arg0); - temp_f14 = (temp_f6 - *arg0); - phi_f14 = temp_f14; - phi_f16 = temp_f16_2; - phi_f18 = *arg1; - if (*arg1 < 0.0f) + if (f18 < 0.0f) { - // Node 1 - phi_f14 = -temp_f14; - phi_f16 = -temp_f16_2; - phi_f18 = -*arg1; + f18 = -f18; + f14 = -f14; + f16 = -f16; } - // Node 2 - if (phi_f14 < 0.0f) + + if (f14 < 0.0f && f16 < 0.0f) { - // Node 3 - if (phi_f16 < 0.0f) - { - // Node 4 - return 1; - } + return FALSE; } - // Node 5 - phi_f14_2 = phi_f14; - phi_f16_2 = phi_f16; - if (phi_f16 < phi_f14) + + if (f16 < f14) { - // Node 6 - phi_f14_2 = phi_f16; - phi_f16_2 = phi_f14; + f32 tmp = f14; + f14 = f16; + f16 = tmp; } - // Node 7 - sp4 = (f32) arg0->unk4; - temp_f2 = (sp64 - sp4); - temp_f0 = (sp70 - sp4); - phi_f0 = temp_f0; - phi_f2 = temp_f2; - phi_f12 = arg1->unk4; - if (arg1->unk4 < 0.0f) + + // y + f12 = arg1->y; + f2 = arg3f.y - arg0->y; + f0 = arg2f.y - arg0->y; + + if (f12 < 0.0f) { - // Node 8 - phi_f0 = -temp_f0; - phi_f2 = -temp_f2; - phi_f12 = -arg1->unk4; + f12 = -f12; + f0 = -f0; + f2 = -f2; } - // Node 9 - if (phi_f0 < 0.0f) + + if (f0 < 0.0f && f2 < 0.0f) { - // Node 10 - if (phi_f2 < 0.0f) - { - // Node 11 - return 1; - } + return FALSE; } - // Node 12 - phi_f0_2 = phi_f0; - phi_f2_2 = phi_f2; - if (phi_f2 < phi_f0) + + if (f2 < f0) { - // Node 13 - sp20 = (f32) phi_f0; - phi_f0_2 = phi_f2; - phi_f2_2 = sp20; + sp20 = f0; + f0 = f2; + f2 = sp20; } - // Node 14 - sp4 = (f32) (phi_f14_2 * phi_f12); - sp0 = (f32) (phi_f0_2 * phi_f18); - if (sp0 < sp4) + + f6 = f14 * f12; + f10 = f0 * f18; + + if (f10 < f6) { - // Node 15 - temp_f0_2 = (phi_f2_2 * phi_f18); - if (temp_f0_2 < sp4) + if (f2 * f18 < f6) { - // Node 16 - return 1; + return FALSE; } - // Node 17 - sp30 = (f32) phi_f18; - sp4 = (f32) (phi_f16_2 * phi_f12); - phi_f0_3 = temp_f0_2; + + sp34 = f14; + sp30 = f18; } else { - // Node 18 - if ((phi_f16_2 * phi_f12) < sp0) + if (f16 * f12 < f10) { - // Node 19 - return 1; + return FALSE; } - // Node 20 - sp34 = (f32) phi_f0_2; - sp0 = (f32) (phi_f2_2 * phi_f18); - phi_f0_3 = sp0; + + sp34 = f0; + sp30 = f12; } - // Node 21 - if (sp4 < phi_f0_3) + + if (f16 * f12 < f2 * f18) { - // Node 22 - phi_f0_4 = phi_f16_2; - phi_f14_3 = phi_f18; + f0_2 = f16; + f14_2 = f18; } else { - // Node 23 - phi_f0_4 = phi_f2_2; - phi_f14_3 = phi_f12; + f0_2 = f2; + f14_2 = f12; } - // Node 24 - temp_f18 = (sp74 - arg0->unk8); - temp_f12 = (sp68 - arg0->unk8); - phi_f18_2 = temp_f18; - phi_f12_2 = temp_f12; - phi_f2_3 = arg1->unk8; - if (arg1->unk8 < 0.0f) + + // z + f2_2 = arg1->z; + f12_2 = arg3f.z - arg0->z; + f18_2 = arg2f.z - arg0->z; + + if (f2_2 < 0.0f) { - // Node 25 - phi_f18_2 = -temp_f18; - phi_f12_2 = -temp_f12; - phi_f2_3 = -arg1->unk8; + f2_2 = -f2_2; + f18_2 = -f18_2; + f12_2 = -f12_2; } - // Node 26 - if (phi_f18_2 < 0.0f) + + if (f18_2 < 0.0f && f12_2 < 0.0f) { - // Node 27 - if (phi_f12_2 < 0.0f) - { - // Node 28 - return 1; - } + return FALSE; } - // Node 29 - phi_f18_3 = phi_f18_2; - phi_f12_3 = phi_f12_2; - if (phi_f12_2 < phi_f18_2) + + if (f12_2 < f18_2) { - // Node 30 - phi_f18_3 = phi_f12_2; - phi_f12_3 = phi_f18_2; + f32 tmp = f18_2; + f18_2 = f12_2; + f12_2 = tmp; } - // Node 31 - temp_f16 = (sp34 * phi_f2_3); - if (temp_f16 < (phi_f18_3 * sp30)) + + if (sp34 * f2_2 < f18_2 * sp30) { - // Node 32 - if ((phi_f0_4 * phi_f2_3) >= (phi_f18_3 * phi_f14_3)) + if (f0_2 * f2_2 < f18_2 * f14_2) { - // Node 36 - // Node 37 - return 1; + return FALSE; } - // Node 33 - return 1; } - // Node 34 - if ((phi_f12_3 * sp30) >= temp_f16) + else { - // Node 36 - // Node 37 - return 1; + if (f12_2 * sp30 < sp34 * f2_2) + { + return FALSE; + } } - // Node 35 - return 1; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B6CEC -/* 0EB81C 7F0B6CEC 8CCE0000 */ lw $t6, ($a2) -/* 0EB820 7F0B6CF0 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 0EB824 7F0B6CF4 448E2000 */ mtc1 $t6, $f4 -/* 0EB828 7F0B6CF8 00000000 */ nop -/* 0EB82C 7F0B6CFC 468021A0 */ cvt.s.w $f6, $f4 -/* 0EB830 7F0B6D00 E7A6006C */ swc1 $f6, 0x6c($sp) -/* 0EB834 7F0B6D04 8CCF0004 */ lw $t7, 4($a2) -/* 0EB838 7F0B6D08 448F4000 */ mtc1 $t7, $f8 -/* 0EB83C 7F0B6D0C 00000000 */ nop -/* 0EB840 7F0B6D10 468042A0 */ cvt.s.w $f10, $f8 -/* 0EB844 7F0B6D14 E7AA0070 */ swc1 $f10, 0x70($sp) -/* 0EB848 7F0B6D18 8CD80008 */ lw $t8, 8($a2) -/* 0EB84C 7F0B6D1C 44982000 */ mtc1 $t8, $f4 -/* 0EB850 7F0B6D20 00000000 */ nop -/* 0EB854 7F0B6D24 468021A0 */ cvt.s.w $f6, $f4 -/* 0EB858 7F0B6D28 E7A60074 */ swc1 $f6, 0x74($sp) -/* 0EB85C 7F0B6D2C 8CF90000 */ lw $t9, ($a3) -/* 0EB860 7F0B6D30 44994000 */ mtc1 $t9, $f8 -/* 0EB864 7F0B6D34 00000000 */ nop -/* 0EB868 7F0B6D38 468042A0 */ cvt.s.w $f10, $f8 -/* 0EB86C 7F0B6D3C E7AA0060 */ swc1 $f10, 0x60($sp) -/* 0EB870 7F0B6D40 8CE80004 */ lw $t0, 4($a3) -/* 0EB874 7F0B6D44 44882000 */ mtc1 $t0, $f4 -/* 0EB878 7F0B6D48 00000000 */ nop -/* 0EB87C 7F0B6D4C 468021A0 */ cvt.s.w $f6, $f4 -/* 0EB880 7F0B6D50 C7A40060 */ lwc1 $f4, 0x60($sp) -/* 0EB884 7F0B6D54 E7A60064 */ swc1 $f6, 0x64($sp) -/* 0EB888 7F0B6D58 8CE90008 */ lw $t1, 8($a3) -/* 0EB88C 7F0B6D5C C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 0EB890 7F0B6D60 44894000 */ mtc1 $t1, $f8 -/* 0EB894 7F0B6D64 00000000 */ nop -/* 0EB898 7F0B6D68 468042A0 */ cvt.s.w $f10, $f8 -/* 0EB89C 7F0B6D6C 44804000 */ mtc1 $zero, $f8 -/* 0EB8A0 7F0B6D70 E7AA0068 */ swc1 $f10, 0x68($sp) -/* 0EB8A4 7F0B6D74 C4B20000 */ lwc1 $f18, ($a1) -/* 0EB8A8 7F0B6D78 C4800000 */ lwc1 $f0, ($a0) -/* 0EB8AC 7F0B6D7C 44805000 */ mtc1 $zero, $f10 -/* 0EB8B0 7F0B6D80 4608903C */ c.lt.s $f18, $f8 -/* 0EB8B4 7F0B6D84 46002401 */ sub.s $f16, $f4, $f0 -/* 0EB8B8 7F0B6D88 45000004 */ bc1f .L7F0B6D9C -/* 0EB8BC 7F0B6D8C 46003381 */ sub.s $f14, $f6, $f0 -/* 0EB8C0 7F0B6D90 46009487 */ neg.s $f18, $f18 -/* 0EB8C4 7F0B6D94 46007387 */ neg.s $f14, $f14 -/* 0EB8C8 7F0B6D98 46008407 */ neg.s $f16, $f16 -.L7F0B6D9C: -/* 0EB8CC 7F0B6D9C 460A703C */ c.lt.s $f14, $f10 -/* 0EB8D0 7F0B6DA0 00000000 */ nop -/* 0EB8D4 7F0B6DA4 4502000A */ bc1fl .L7F0B6DD0 -/* 0EB8D8 7F0B6DA8 460E803C */ c.lt.s $f16, $f14 -/* 0EB8DC 7F0B6DAC 44802000 */ mtc1 $zero, $f4 -/* 0EB8E0 7F0B6DB0 00000000 */ nop -/* 0EB8E4 7F0B6DB4 4604803C */ c.lt.s $f16, $f4 -/* 0EB8E8 7F0B6DB8 00000000 */ nop -/* 0EB8EC 7F0B6DBC 45020004 */ bc1fl .L7F0B6DD0 -/* 0EB8F0 7F0B6DC0 460E803C */ c.lt.s $f16, $f14 -/* 0EB8F4 7F0B6DC4 10000090 */ b .L7F0B7008 -/* 0EB8F8 7F0B6DC8 00001025 */ move $v0, $zero -/* 0EB8FC 7F0B6DCC 460E803C */ c.lt.s $f16, $f14 -.L7F0B6DD0: -/* 0EB900 7F0B6DD0 00000000 */ nop -/* 0EB904 7F0B6DD4 45020005 */ bc1fl .L7F0B6DEC -/* 0EB908 7F0B6DD8 C4860004 */ lwc1 $f6, 4($a0) -/* 0EB90C 7F0B6DDC 46007006 */ mov.s $f0, $f14 -/* 0EB910 7F0B6DE0 46008386 */ mov.s $f14, $f16 -/* 0EB914 7F0B6DE4 46000406 */ mov.s $f16, $f0 -/* 0EB918 7F0B6DE8 C4860004 */ lwc1 $f6, 4($a0) -.L7F0B6DEC: -/* 0EB91C 7F0B6DEC C4AC0004 */ lwc1 $f12, 4($a1) -/* 0EB920 7F0B6DF0 C7A80064 */ lwc1 $f8, 0x64($sp) -/* 0EB924 7F0B6DF4 E7A60004 */ swc1 $f6, 4($sp) -/* 0EB928 7F0B6DF8 44803000 */ mtc1 $zero, $f6 -/* 0EB92C 7F0B6DFC C7AA0004 */ lwc1 $f10, 4($sp) -/* 0EB930 7F0B6E00 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 0EB934 7F0B6E04 4606603C */ c.lt.s $f12, $f6 -/* 0EB938 7F0B6E08 460A4081 */ sub.s $f2, $f8, $f10 -/* 0EB93C 7F0B6E0C 44804000 */ mtc1 $zero, $f8 -/* 0EB940 7F0B6E10 45000004 */ bc1f .L7F0B6E24 -/* 0EB944 7F0B6E14 460A2001 */ sub.s $f0, $f4, $f10 -/* 0EB948 7F0B6E18 46006307 */ neg.s $f12, $f12 -/* 0EB94C 7F0B6E1C 46000007 */ neg.s $f0, $f0 -/* 0EB950 7F0B6E20 46001087 */ neg.s $f2, $f2 -.L7F0B6E24: -/* 0EB954 7F0B6E24 4608003C */ c.lt.s $f0, $f8 -/* 0EB958 7F0B6E28 00000000 */ nop -/* 0EB95C 7F0B6E2C 4502000A */ bc1fl .L7F0B6E58 -/* 0EB960 7F0B6E30 4600103C */ c.lt.s $f2, $f0 -/* 0EB964 7F0B6E34 44802000 */ mtc1 $zero, $f4 -/* 0EB968 7F0B6E38 00000000 */ nop -/* 0EB96C 7F0B6E3C 4604103C */ c.lt.s $f2, $f4 -/* 0EB970 7F0B6E40 00000000 */ nop -/* 0EB974 7F0B6E44 45020004 */ bc1fl .L7F0B6E58 -/* 0EB978 7F0B6E48 4600103C */ c.lt.s $f2, $f0 -/* 0EB97C 7F0B6E4C 1000006E */ b .L7F0B7008 -/* 0EB980 7F0B6E50 00001025 */ move $v0, $zero -/* 0EB984 7F0B6E54 4600103C */ c.lt.s $f2, $f0 -.L7F0B6E58: -/* 0EB988 7F0B6E58 460C7182 */ mul.s $f6, $f14, $f12 -/* 0EB98C 7F0B6E5C 45000004 */ bc1f .L7F0B6E70 -/* 0EB990 7F0B6E60 00000000 */ nop -/* 0EB994 7F0B6E64 E7A00020 */ swc1 $f0, 0x20($sp) -/* 0EB998 7F0B6E68 46001006 */ mov.s $f0, $f2 -/* 0EB99C 7F0B6E6C C7A20020 */ lwc1 $f2, 0x20($sp) -.L7F0B6E70: -/* 0EB9A0 7F0B6E70 46120282 */ mul.s $f10, $f0, $f18 -/* 0EB9A4 7F0B6E74 E7A60004 */ swc1 $f6, 4($sp) -/* 0EB9A8 7F0B6E78 C7A40004 */ lwc1 $f4, 4($sp) -/* 0EB9AC 7F0B6E7C E7AA0000 */ swc1 $f10, ($sp) -/* 0EB9B0 7F0B6E80 C7A80000 */ lwc1 $f8, ($sp) -/* 0EB9B4 7F0B6E84 4604403C */ c.lt.s $f8, $f4 -/* 0EB9B8 7F0B6E88 00000000 */ nop -/* 0EB9BC 7F0B6E8C 4500000D */ bc1f .L7F0B6EC4 -/* 0EB9C0 7F0B6E90 00000000 */ nop -/* 0EB9C4 7F0B6E94 46121002 */ mul.s $f0, $f2, $f18 -/* 0EB9C8 7F0B6E98 4604003C */ c.lt.s $f0, $f4 -/* 0EB9CC 7F0B6E9C 00000000 */ nop -/* 0EB9D0 7F0B6EA0 45000003 */ bc1f .L7F0B6EB0 -/* 0EB9D4 7F0B6EA4 00000000 */ nop -/* 0EB9D8 7F0B6EA8 10000057 */ b .L7F0B7008 -/* 0EB9DC 7F0B6EAC 00001025 */ move $v0, $zero -.L7F0B6EB0: -/* 0EB9E0 7F0B6EB0 460C8282 */ mul.s $f10, $f16, $f12 -/* 0EB9E4 7F0B6EB4 E7AE0034 */ swc1 $f14, 0x34($sp) -/* 0EB9E8 7F0B6EB8 E7B20030 */ swc1 $f18, 0x30($sp) -/* 0EB9EC 7F0B6EBC 1000000F */ b .L7F0B6EFC -/* 0EB9F0 7F0B6EC0 E7AA0004 */ swc1 $f10, 4($sp) -.L7F0B6EC4: -/* 0EB9F4 7F0B6EC4 460C8382 */ mul.s $f14, $f16, $f12 -/* 0EB9F8 7F0B6EC8 C7A60000 */ lwc1 $f6, ($sp) -/* 0EB9FC 7F0B6ECC 4606703C */ c.lt.s $f14, $f6 -/* 0EBA00 7F0B6ED0 00000000 */ nop -/* 0EBA04 7F0B6ED4 45000003 */ bc1f .L7F0B6EE4 -/* 0EBA08 7F0B6ED8 00000000 */ nop -/* 0EBA0C 7F0B6EDC 1000004A */ b .L7F0B7008 -/* 0EBA10 7F0B6EE0 00001025 */ move $v0, $zero -.L7F0B6EE4: -/* 0EBA14 7F0B6EE4 46121202 */ mul.s $f8, $f2, $f18 -/* 0EBA18 7F0B6EE8 E7A00034 */ swc1 $f0, 0x34($sp) -/* 0EBA1C 7F0B6EEC E7AC0030 */ swc1 $f12, 0x30($sp) -/* 0EBA20 7F0B6EF0 E7AE0004 */ swc1 $f14, 4($sp) -/* 0EBA24 7F0B6EF4 E7A80000 */ swc1 $f8, ($sp) -/* 0EBA28 7F0B6EF8 C7A00000 */ lwc1 $f0, ($sp) -.L7F0B6EFC: -/* 0EBA2C 7F0B6EFC C7A40004 */ lwc1 $f4, 4($sp) -/* 0EBA30 7F0B6F00 44804000 */ mtc1 $zero, $f8 -/* 0EBA34 7F0B6F04 4600203C */ c.lt.s $f4, $f0 -/* 0EBA38 7F0B6F08 44802000 */ mtc1 $zero, $f4 -/* 0EBA3C 7F0B6F0C 45020005 */ bc1fl .L7F0B6F24 -/* 0EBA40 7F0B6F10 46001006 */ mov.s $f0, $f2 -/* 0EBA44 7F0B6F14 46008006 */ mov.s $f0, $f16 -/* 0EBA48 7F0B6F18 10000003 */ b .L7F0B6F28 -/* 0EBA4C 7F0B6F1C 46009386 */ mov.s $f14, $f18 -/* 0EBA50 7F0B6F20 46001006 */ mov.s $f0, $f2 -.L7F0B6F24: -/* 0EBA54 7F0B6F24 46006386 */ mov.s $f14, $f12 -.L7F0B6F28: -/* 0EBA58 7F0B6F28 C4A20008 */ lwc1 $f2, 8($a1) -/* 0EBA5C 7F0B6F2C C4900008 */ lwc1 $f16, 8($a0) -/* 0EBA60 7F0B6F30 C7A60074 */ lwc1 $f6, 0x74($sp) -/* 0EBA64 7F0B6F34 4608103C */ c.lt.s $f2, $f8 -/* 0EBA68 7F0B6F38 C7AA0068 */ lwc1 $f10, 0x68($sp) -/* 0EBA6C 7F0B6F3C 46103481 */ sub.s $f18, $f6, $f16 -/* 0EBA70 7F0B6F40 C7A60034 */ lwc1 $f6, 0x34($sp) -/* 0EBA74 7F0B6F44 45000004 */ bc1f .L7F0B6F58 -/* 0EBA78 7F0B6F48 46105301 */ sub.s $f12, $f10, $f16 -/* 0EBA7C 7F0B6F4C 46001087 */ neg.s $f2, $f2 -/* 0EBA80 7F0B6F50 46009487 */ neg.s $f18, $f18 -/* 0EBA84 7F0B6F54 46006307 */ neg.s $f12, $f12 -.L7F0B6F58: -/* 0EBA88 7F0B6F58 4604903C */ c.lt.s $f18, $f4 -/* 0EBA8C 7F0B6F5C C7A80030 */ lwc1 $f8, 0x30($sp) -/* 0EBA90 7F0B6F60 4502000A */ bc1fl .L7F0B6F8C -/* 0EBA94 7F0B6F64 4612603C */ c.lt.s $f12, $f18 -/* 0EBA98 7F0B6F68 44805000 */ mtc1 $zero, $f10 -/* 0EBA9C 7F0B6F6C 00000000 */ nop -/* 0EBAA0 7F0B6F70 460A603C */ c.lt.s $f12, $f10 -/* 0EBAA4 7F0B6F74 00000000 */ nop -/* 0EBAA8 7F0B6F78 45020004 */ bc1fl .L7F0B6F8C -/* 0EBAAC 7F0B6F7C 4612603C */ c.lt.s $f12, $f18 -/* 0EBAB0 7F0B6F80 10000021 */ b .L7F0B7008 -/* 0EBAB4 7F0B6F84 00001025 */ move $v0, $zero -/* 0EBAB8 7F0B6F88 4612603C */ c.lt.s $f12, $f18 -.L7F0B6F8C: -/* 0EBABC 7F0B6F8C 00000000 */ nop -/* 0EBAC0 7F0B6F90 45000004 */ bc1f .L7F0B6FA4 -/* 0EBAC4 7F0B6F94 00000000 */ nop -/* 0EBAC8 7F0B6F98 46009406 */ mov.s $f16, $f18 -/* 0EBACC 7F0B6F9C 46006486 */ mov.s $f18, $f12 -/* 0EBAD0 7F0B6FA0 46008306 */ mov.s $f12, $f16 -.L7F0B6FA4: -/* 0EBAD4 7F0B6FA4 46023402 */ mul.s $f16, $f6, $f2 -/* 0EBAD8 7F0B6FA8 00000000 */ nop -/* 0EBADC 7F0B6FAC 46089102 */ mul.s $f4, $f18, $f8 -/* 0EBAE0 7F0B6FB0 C7A80030 */ lwc1 $f8, 0x30($sp) -/* 0EBAE4 7F0B6FB4 4604803C */ c.lt.s $f16, $f4 -/* 0EBAE8 7F0B6FB8 00000000 */ nop -/* 0EBAEC 7F0B6FBC 4500000A */ bc1f .L7F0B6FE8 -/* 0EBAF0 7F0B6FC0 00000000 */ nop -/* 0EBAF4 7F0B6FC4 46020282 */ mul.s $f10, $f0, $f2 -/* 0EBAF8 7F0B6FC8 00000000 */ nop -/* 0EBAFC 7F0B6FCC 460E9182 */ mul.s $f6, $f18, $f14 -/* 0EBB00 7F0B6FD0 4606503C */ c.lt.s $f10, $f6 -/* 0EBB04 7F0B6FD4 00000000 */ nop -/* 0EBB08 7F0B6FD8 4500000A */ bc1f .L7F0B7004 -/* 0EBB0C 7F0B6FDC 00000000 */ nop -/* 0EBB10 7F0B6FE0 10000009 */ b .L7F0B7008 -/* 0EBB14 7F0B6FE4 00001025 */ move $v0, $zero -.L7F0B6FE8: -/* 0EBB18 7F0B6FE8 46086102 */ mul.s $f4, $f12, $f8 -/* 0EBB1C 7F0B6FEC 4610203C */ c.lt.s $f4, $f16 -/* 0EBB20 7F0B6FF0 00000000 */ nop -/* 0EBB24 7F0B6FF4 45020004 */ bc1fl .L7F0B7008 -/* 0EBB28 7F0B6FF8 24020001 */ li $v0, 1 -/* 0EBB2C 7F0B6FFC 10000002 */ b .L7F0B7008 -/* 0EBB30 7F0B7000 00001025 */ move $v0, $zero -.L7F0B7004: -/* 0EBB34 7F0B7004 24020001 */ li $v0, 1 -.L7F0B7008: -/* 0EBB38 7F0B7008 03E00008 */ jr $ra -/* 0EBB3C 7F0B700C 27BD0078 */ addiu $sp, $sp, 0x78 -) -#endif - - + return TRUE; +} #ifdef NONMATCHING @@ -7496,7 +7152,7 @@ glabel sub_GAME_7F0B6CEC spCC = (s32) (spCC + (s32) temp_v0->unk10); spD0 = (s32) (spD0 + (s32) temp_v0->unk14); phi_t0_2 = &spA8; - if (sub_GAME_7F0B6CEC(arg0, arg2, &spD4, &spC8) != 0) + if (bgTestLineIntersectsBbox(arg0, arg2, &spD4, &spC8) != 0) { // Node 19 phi_t0_2 = &spA8; @@ -7681,7 +7337,7 @@ glabel sub_GAME_7F0B6CEC sp80 = (s32) (sp80 + (s32) temp_v0_2->unkC); sp84 = (s32) (sp84 + (s32) temp_v0_2->unk10); sp88 = (s32) (sp88 + (s32) temp_v0_2->unk14); - if (sub_GAME_7F0B6CEC(arg0, arg2, &sp8C, &sp80) != 0) + if (bgTestLineIntersectsBbox(arg0, arg2, &sp8C, &sp80) != 0) { // Node 56 if (sub_GAME_7F092890((temp_s1 + (sp9C * 0x10)), (temp_s1 + (spA0 * 0x10)), (temp_s1 + (spA4 * 0x10)), ((sp54 + ptr_bgdata_room_fileposition_list) + 0xc), arg0, arg1, arg2, &spF8) != 0) @@ -8006,7 +7662,7 @@ glabel sub_GAME_7F0B7010 /* 0EBE74 7F0B7344 44199000 */ mfc1 $t9, $f18 /* 0EBE78 7F0B7348 00000000 */ nop /* 0EBE7C 7F0B734C 01395021 */ addu $t2, $t1, $t9 -/* 0EBE80 7F0B7350 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 0EBE80 7F0B7350 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 0EBE84 7F0B7354 AFAA00D0 */ sw $t2, 0xd0($sp) /* 0EBE88 7F0B7358 104001B3 */ beqz $v0, .L7F0B7A28 /* 0EBE8C 7F0B735C 27A800A8 */ addiu $t0, $sp, 0xa8 @@ -8330,7 +7986,7 @@ glabel sub_GAME_7F0B7010 /* 0EC338 7F0B7808 44189000 */ mfc1 $t8, $f18 /* 0EC33C 7F0B780C 00000000 */ nop /* 0EC340 7F0B7810 01385021 */ addu $t2, $t1, $t8 -/* 0EC344 7F0B7814 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 0EC344 7F0B7814 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 0EC348 7F0B7818 AFAA0088 */ sw $t2, 0x88($sp) /* 0EC34C 7F0B781C 1040007E */ beqz $v0, .L7F0B7A18 /* 0EC350 7F0B7820 27A800A8 */ addiu $t0, $sp, 0xa8 @@ -8583,7 +8239,7 @@ glabel sub_GAME_7F0B7A78 /* 0EC6BC 7F0B7B8C 02E02025 */ move $a0, $s7 /* 0EC6C0 7F0B7B90 03C02825 */ move $a1, $fp /* 0EC6C4 7F0B7B94 02A03025 */ move $a2, $s5 -/* 0EC6C8 7F0B7B98 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 0EC6C8 7F0B7B98 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 0EC6CC 7F0B7B9C 02C03825 */ move $a3, $s6 /* 0EC6D0 7F0B7BA0 10400047 */ beqz $v0, .L7F0B7CC0 /* 0EC6D4 7F0B7BA4 02E02025 */ move $a0, $s7 @@ -8733,54 +8389,26 @@ void sub_GAME_7F0B7D94(void) { } +u8 sub_GAME_7F0B7DA8(s32 arg0) +{ + s_room_info* room_info; + u8 tmp_flags; + u8 bitflags; + u8 out; + room_info = &array_room_info[arg0]; + bitflags = room_info->bitflags2; + out = bitflags; - - -#ifdef NONMATCHING -s8 sub_GAME_7F0B7DA8(s32 arg0) { - void *temp_v0; - s8 temp_t8; - s8 phi_a1; - - // Node 0 - temp_v0 = ((arg0 * 0x50) + &array_room_info); - phi_a1 = temp_v0->unk3; - if (temp_v0->unk3 < 0xff) + if ((s32) bitflags < 0xFF) { - // Node 1 - temp_t8 = (temp_v0->unk3 + 1); - temp_v0->unk3 = temp_t8; - phi_a1 = (temp_t8 & 0xff); + tmp_flags = bitflags + 1; + room_info->bitflags2 = tmp_flags; + out = tmp_flags & 0xFF; } - // Node 2 - return phi_a1; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B7DA8 -/* 0EC8D8 7F0B7DA8 00047080 */ sll $t6, $a0, 2 -/* 0EC8DC 7F0B7DAC 01C47021 */ addu $t6, $t6, $a0 -/* 0EC8E0 7F0B7DB0 3C0F8004 */ lui $t7, %hi(array_room_info) -/* 0EC8E4 7F0B7DB4 25EF1414 */ addiu $t7, %lo(array_room_info) # addiu $t7, $t7, 0x1414 -/* 0EC8E8 7F0B7DB8 000E7100 */ sll $t6, $t6, 4 -/* 0EC8EC 7F0B7DBC 01CF1021 */ addu $v0, $t6, $t7 -/* 0EC8F0 7F0B7DC0 90430003 */ lbu $v1, 3($v0) -/* 0EC8F4 7F0B7DC4 286100FF */ slti $at, $v1, 0xff -/* 0EC8F8 7F0B7DC8 10200004 */ beqz $at, .L7F0B7DDC -/* 0EC8FC 7F0B7DCC 00602825 */ move $a1, $v1 -/* 0EC900 7F0B7DD0 24780001 */ addiu $t8, $v1, 1 -/* 0EC904 7F0B7DD4 A0580003 */ sb $t8, 3($v0) -/* 0EC908 7F0B7DD8 330500FF */ andi $a1, $t8, 0xff -.L7F0B7DDC: -/* 0EC90C 7F0B7DDC 03E00008 */ jr $ra -/* 0EC910 7F0B7DE0 00A01025 */ move $v0, $a1 -) -#endif - - + return out; +} #ifdef NONMATCHING @@ -8847,8 +8475,8 @@ glabel sub_GAME_7F0B7DE4 /* 0EC940 7F0B7E10 AFA60028 */ sw $a2, 0x28($sp) /* 0EC944 7F0B7E14 14200012 */ bnez $at, .L7F0B7E60 /* 0EC948 7F0B7E18 01F81821 */ addu $v1, $t7, $t8 -/* 0EC94C 7F0B7E1C 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) -/* 0EC950 7F0B7E20 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0EC94C 7F0B7E1C 3C198008 */ lui $t9, %hi(g_BgPortals) +/* 0EC950 7F0B7E20 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0EC954 7F0B7E24 000650C0 */ sll $t2, $a2, 3 /* 0EC958 7F0B7E28 032A1021 */ addu $v0, $t9, $t2 /* 0EC95C 7F0B7E2C 904B0004 */ lbu $t3, 4($v0) @@ -8923,8 +8551,8 @@ glabel sub_GAME_7F0B7DE4 /* 0E9B40 7F0B7150 AFA50024 */ sw $a1, 0x24($sp) /* 0E9B44 7F0B7154 14200014 */ bnez $at, .L7F0B71A8 /* 0E9B48 7F0B7158 01F81821 */ addu $v1, $t7, $t8 -/* 0E9B4C 7F0B715C 3C198007 */ lui $t9, %hi(ptr_bgdata_portals) # $t9, 0x8007 -/* 0E9B50 7F0B7160 8F39B3C8 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0E9B4C 7F0B715C 3C198007 */ lui $t9, %hi(g_BgPortals) # $t9, 0x8007 +/* 0E9B50 7F0B7160 8F39B3C8 */ lw $t9, %lo(g_BgPortals)($t9) /* 0E9B54 7F0B7164 000550C0 */ sll $t2, $a1, 3 /* 0E9B58 7F0B7168 032A1021 */ addu $v0, $t9, $t2 /* 0E9B5C 7F0B716C 904B0004 */ lbu $t3, 4($v0) @@ -9131,11 +8759,11 @@ glabel sub_GAME_7F0B7F84 /* 0ECB20 7F0B7FF0 2A610010 */ slti $at, $s3, 0x10 .L7F0B7FF4: /* 0ECB24 7F0B7FF4 14200003 */ bnez $at, .L7F0B8004 -/* 0ECB28 7F0B7FF8 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) +/* 0ECB28 7F0B7FF8 3C198008 */ lui $t9, %hi(g_BgPortals) /* 0ECB2C 7F0B7FFC 100000D5 */ b .L7F0B8354 /* 0ECB30 7F0B8000 02401025 */ move $v0, $s2 .L7F0B8004: -/* 0ECB34 7F0B8004 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0ECB34 7F0B8004 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0ECB38 7F0B8008 001410C0 */ sll $v0, $s4, 3 /* 0ECB3C 7F0B800C 3C0B8004 */ lui $t3, %hi(D_800442FC) /* 0ECB40 7F0B8010 03224021 */ addu $t0, $t9, $v0 @@ -9172,8 +8800,8 @@ glabel sub_GAME_7F0B7F84 /* 0ECBB8 7F0B8088 46124082 */ mul.s $f2, $f8, $f18 /* 0ECBBC 7F0B808C 0FC2E664 */ jal sub_GAME_7F0B9990 /* 0ECBC0 7F0B8090 E7A20050 */ swc1 $f2, 0x50($sp) -/* 0ECBC4 7F0B8094 3C0C8008 */ lui $t4, %hi(ptr_bgdata_portals) -/* 0ECBC8 7F0B8098 8D8CFF80 */ lw $t4, %lo(ptr_bgdata_portals)($t4) +/* 0ECBC4 7F0B8094 3C0C8008 */ lui $t4, %hi(g_BgPortals) +/* 0ECBC8 7F0B8098 8D8CFF80 */ lw $t4, %lo(g_BgPortals)($t4) /* 0ECBCC 7F0B809C 8FAD0044 */ lw $t5, 0x44($sp) /* 0ECBD0 7F0B80A0 8FAE0084 */ lw $t6, 0x84($sp) /* 0ECBD4 7F0B80A4 C7A20050 */ lwc1 $f2, 0x50($sp) @@ -9234,11 +8862,11 @@ glabel sub_GAME_7F0B7F84 /* 0ECCA4 7F0B8174 0FC2D619 */ jal sub_GAME_7F0B5864 /* 0ECCA8 7F0B8178 02802025 */ move $a0, $s4 /* 0ECCAC 7F0B817C 14400003 */ bnez $v0, .L7F0B818C -/* 0ECCB0 7F0B8180 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) +/* 0ECCB0 7F0B8180 3C198008 */ lui $t9, %hi(g_BgPortals) /* 0ECCB4 7F0B8184 10000073 */ b .L7F0B8354 /* 0ECCB8 7F0B8188 02401025 */ move $v0, $s2 .L7F0B818C: -/* 0ECCBC 7F0B818C 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0ECCBC 7F0B818C 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0ECCC0 7F0B8190 8FA80044 */ lw $t0, 0x44($sp) /* 0ECCC4 7F0B8194 8FAC0084 */ lw $t4, 0x84($sp) /* 0ECCC8 7F0B8198 27A50070 */ addiu $a1, $sp, 0x70 @@ -9309,11 +8937,11 @@ glabel sub_GAME_7F0B7F84 /* 0ECDB0 7F0B8280 45000013 */ bc1f .L7F0B82D0 /* 0ECDB4 7F0B8284 00000000 */ nop /* 0ECDB8 7F0B8288 4612403C */ c.lt.s $f8, $f18 -/* 0ECDBC 7F0B828C 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) +/* 0ECDBC 7F0B828C 3C0E8008 */ lui $t6, %hi(g_BgPortals) /* 0ECDC0 7F0B8290 8FAF0044 */ lw $t7, 0x44($sp) /* 0ECDC4 7F0B8294 4500000E */ bc1f .L7F0B82D0 /* 0ECDC8 7F0B8298 00000000 */ nop -/* 0ECDCC 7F0B829C 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0ECDCC 7F0B829C 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0ECDD0 7F0B82A0 02202025 */ move $a0, $s1 /* 0ECDD4 7F0B82A4 02602825 */ move $a1, $s3 /* 0ECDD8 7F0B82A8 01CFC021 */ addu $t8, $t6, $t7 @@ -9323,14 +8951,14 @@ glabel sub_GAME_7F0B7F84 /* 0ECDE8 7F0B82B8 0FC2CE6F */ jal sub_GAME_7F0B39BC /* 0ECDEC 7F0B82BC 03203825 */ move $a3, $t9 /* 0ECDF0 7F0B82C0 10400005 */ beqz $v0, .L7F0B82D8 -/* 0ECDF4 7F0B82C4 3C048008 */ lui $a0, %hi(ptr_bgdata_portals) +/* 0ECDF4 7F0B82C4 3C048008 */ lui $a0, %hi(g_BgPortals) /* 0ECDF8 7F0B82C8 10000022 */ b .L7F0B8354 /* 0ECDFC 7F0B82CC 02401025 */ move $v0, $s2 .L7F0B82D0: /* 0ECE00 7F0B82D0 10000020 */ b .L7F0B8354 /* 0ECE04 7F0B82D4 02401025 */ move $v0, $s2 .L7F0B82D8: -/* 0ECE08 7F0B82D8 8C84FF80 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0ECE08 7F0B82D8 8C84FF80 */ lw $a0, %lo(g_BgPortals)($a0) /* 0ECE0C 7F0B82DC 00008025 */ move $s0, $zero /* 0ECE10 7F0B82E0 00001825 */ move $v1, $zero /* 0ECE14 7F0B82E4 8C880000 */ lw $t0, ($a0) @@ -9353,8 +8981,8 @@ glabel sub_GAME_7F0B7F84 /* 0ECE50 7F0B8320 26670001 */ addiu $a3, $s3, 1 /* 0ECE54 7F0B8324 0FC2DF79 */ jal sub_GAME_7F0B7DE4 /* 0ECE58 7F0B8328 AFA30040 */ sw $v1, 0x40($sp) -/* 0ECE5C 7F0B832C 3C0C8008 */ lui $t4, %hi(ptr_bgdata_portals) -/* 0ECE60 7F0B8330 8D8CFF80 */ lw $t4, %lo(ptr_bgdata_portals)($t4) +/* 0ECE5C 7F0B832C 3C0C8008 */ lui $t4, %hi(g_BgPortals) +/* 0ECE60 7F0B8330 8D8CFF80 */ lw $t4, %lo(g_BgPortals)($t4) /* 0ECE64 7F0B8334 8FA30040 */ lw $v1, 0x40($sp) /* 0ECE68 7F0B8338 01831021 */ addu $v0, $t4, $v1 .L7F0B833C: @@ -9404,8 +9032,8 @@ glabel sub_GAME_7F0B7F84 /* 0E9CE8 7F0B72F8 142000C3 */ bnez $at, .L7F0B7608 /* 0E9CEC 7F0B72FC 28C10010 */ slti $at, $a2, 0x10 /* 0E9CF0 7F0B7300 102000C1 */ beqz $at, .L7F0B7608 -/* 0E9CF4 7F0B7304 3C198007 */ lui $t9, %hi(ptr_bgdata_portals) # $t9, 0x8007 -/* 0E9CF8 7F0B7308 8F39B3C8 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0E9CF4 7F0B7304 3C198007 */ lui $t9, %hi(g_BgPortals) # $t9, 0x8007 +/* 0E9CF8 7F0B7308 8F39B3C8 */ lw $t9, %lo(g_BgPortals)($t9) /* 0E9CFC 7F0B730C 000510C0 */ sll $v0, $a1, 3 /* 0E9D00 7F0B7310 3C0B8004 */ lui $t3, %hi(D_800442FC) # $t3, 0x8004 /* 0E9D04 7F0B7314 03224021 */ addu $t0, $t9, $v0 @@ -9439,8 +9067,8 @@ glabel sub_GAME_7F0B7F84 /* 0E9D74 7F0B7384 46124082 */ mul.s $f2, $f8, $f18 /* 0E9D78 7F0B7388 0FC2E30B */ jal sub_GAME_7F0B9990 /* 0E9D7C 7F0B738C E7A20040 */ swc1 $f2, 0x40($sp) -/* 0E9D80 7F0B7390 3C0C8007 */ lui $t4, %hi(ptr_bgdata_portals) # $t4, 0x8007 -/* 0E9D84 7F0B7394 8D8CB3C8 */ lw $t4, %lo(ptr_bgdata_portals)($t4) +/* 0E9D80 7F0B7390 3C0C8007 */ lui $t4, %hi(g_BgPortals) # $t4, 0x8007 +/* 0E9D84 7F0B7394 8D8CB3C8 */ lw $t4, %lo(g_BgPortals)($t4) /* 0E9D88 7F0B7398 8FAD0034 */ lw $t5, 0x34($sp) /* 0E9D8C 7F0B739C 8FAE0070 */ lw $t6, 0x70($sp) /* 0E9D90 7F0B73A0 C7A20040 */ lwc1 $f2, 0x40($sp) @@ -9499,8 +9127,8 @@ glabel sub_GAME_7F0B7F84 /* 0E9E58 7F0B7468 0FC2D2E8 */ jal sub_GAME_7F0B5864 /* 0E9E5C 7F0B746C 02602025 */ move $a0, $s3 /* 0E9E60 7F0B7470 10400065 */ beqz $v0, .L7F0B7608 -/* 0E9E64 7F0B7474 3C198007 */ lui $t9, %hi(ptr_bgdata_portals) # $t9, 0x8007 -/* 0E9E68 7F0B7478 8F39B3C8 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0E9E64 7F0B7474 3C198007 */ lui $t9, %hi(g_BgPortals) # $t9, 0x8007 +/* 0E9E68 7F0B7478 8F39B3C8 */ lw $t9, %lo(g_BgPortals)($t9) /* 0E9E6C 7F0B747C 8FA80034 */ lw $t0, 0x34($sp) /* 0E9E70 7F0B7480 8FAC0070 */ lw $t4, 0x70($sp) /* 0E9E74 7F0B7484 27A50060 */ addiu $a1, $sp, 0x60 @@ -9560,11 +9188,11 @@ glabel sub_GAME_7F0B7F84 /* 0E9F40 7F0B7550 4502002E */ bc1fl .L7F0B760C /* 0E9F44 7F0B7554 8FBF0024 */ lw $ra, 0x24($sp) /* 0E9F48 7F0B7558 4612403C */ c.lt.s $f8, $f18 -/* 0E9F4C 7F0B755C 3C0E8007 */ lui $t6, %hi(ptr_bgdata_portals) # $t6, 0x8007 +/* 0E9F4C 7F0B755C 3C0E8007 */ lui $t6, %hi(g_BgPortals) # $t6, 0x8007 /* 0E9F50 7F0B7560 8FAF0034 */ lw $t7, 0x34($sp) /* 0E9F54 7F0B7564 45020029 */ bc1fl .L7F0B760C /* 0E9F58 7F0B7568 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E9F5C 7F0B756C 8DCEB3C8 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0E9F5C 7F0B756C 8DCEB3C8 */ lw $t6, %lo(g_BgPortals)($t6) /* 0E9F60 7F0B7570 02202025 */ move $a0, $s1 /* 0E9F64 7F0B7574 02402825 */ move $a1, $s2 /* 0E9F68 7F0B7578 01CFC021 */ addu $t8, $t6, $t7 @@ -9574,8 +9202,8 @@ glabel sub_GAME_7F0B7F84 /* 0E9F78 7F0B7588 0FC2CB1F */ jal sub_GAME_7F0B39BC /* 0E9F7C 7F0B758C 03203825 */ move $a3, $t9 /* 0E9F80 7F0B7590 1440001D */ bnez $v0, .L7F0B7608 -/* 0E9F84 7F0B7594 3C048007 */ lui $a0, %hi(ptr_bgdata_portals) # $a0, 0x8007 -/* 0E9F88 7F0B7598 8C84B3C8 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0E9F84 7F0B7594 3C048007 */ lui $a0, %hi(g_BgPortals) # $a0, 0x8007 +/* 0E9F88 7F0B7598 8C84B3C8 */ lw $a0, %lo(g_BgPortals)($a0) /* 0E9F8C 7F0B759C 00008025 */ move $s0, $zero /* 0E9F90 7F0B75A0 00001825 */ move $v1, $zero /* 0E9F94 7F0B75A4 8C880000 */ lw $t0, ($a0) @@ -9596,8 +9224,8 @@ glabel sub_GAME_7F0B7F84 /* 0E9FC8 7F0B75D8 27A70060 */ addiu $a3, $sp, 0x60 /* 0E9FCC 7F0B75DC 0FC2DC48 */ jal sub_GAME_7F0B7DE4 /* 0E9FD0 7F0B75E0 AFA30030 */ sw $v1, 0x30($sp) -/* 0E9FD4 7F0B75E4 3C0B8007 */ lui $t3, %hi(ptr_bgdata_portals) # $t3, 0x8007 -/* 0E9FD8 7F0B75E8 8D6BB3C8 */ lw $t3, %lo(ptr_bgdata_portals)($t3) +/* 0E9FD4 7F0B75E4 3C0B8007 */ lui $t3, %hi(g_BgPortals) # $t3, 0x8007 +/* 0E9FD8 7F0B75E8 8D6BB3C8 */ lw $t3, %lo(g_BgPortals)($t3) /* 0E9FDC 7F0B75EC 8FA30030 */ lw $v1, 0x30($sp) /* 0E9FE0 7F0B75F0 01631021 */ addu $v0, $t3, $v1 .Leu7F0B75F4: @@ -10790,10 +10418,10 @@ glabel sub_GAME_7F0B8A6C /* 0ED678 7F0B8B48 3C028004 */ lui $v0, %hi(levelentry_index) /* 0ED67C 7F0B8B4C 8C421400 */ lw $v0, %lo(levelentry_index)($v0) /* 0ED680 7F0B8B50 24030015 */ li $v1, 21 -/* 0ED684 7F0B8B54 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) +/* 0ED684 7F0B8B54 3C198008 */ lui $t9, %hi(g_BgPortals) /* 0ED688 7F0B8B58 10620005 */ beq $v1, $v0, .L7F0B8B70 /* 0ED68C 7F0B8B5C 00000000 */ nop -/* 0ED690 7F0B8B60 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0ED690 7F0B8B60 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0ED694 7F0B8B64 8F2A0000 */ lw $t2, ($t9) /* 0ED698 7F0B8B68 15400023 */ bnez $t2, .L7F0B8BF8 /* 0ED69C 7F0B8B6C 00000000 */ nop @@ -10832,8 +10460,8 @@ glabel sub_GAME_7F0B8A6C /* 0ED710 7F0B8BE0 5420FFF1 */ bnezl $at, .L7F0B8BA8 /* 0ED714 7F0B8BE4 8E250000 */ lw $a1, ($s1) .L7F0B8BE8: -/* 0ED718 7F0B8BE8 3C048008 */ lui $a0, %hi(ptr_bgdata_portals) -/* 0ED71C 7F0B8BEC 8C84FF80 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0ED718 7F0B8BE8 3C048008 */ lui $a0, %hi(g_BgPortals) +/* 0ED71C 7F0B8BEC 8C84FF80 */ lw $a0, %lo(g_BgPortals)($a0) /* 0ED720 7F0B8BF0 10000039 */ b .L7F0B8CD8 /* 0ED724 7F0B8BF4 8C820000 */ lw $v0, ($a0) .L7F0B8BF8: @@ -10852,8 +10480,8 @@ glabel sub_GAME_7F0B8A6C /* 0ED754 7F0B8C24 24070001 */ li $a3, 1 /* 0ED758 7F0B8C28 0FC2CE6F */ jal sub_GAME_7F0B39BC /* 0ED75C 7F0B8C2C 24C61118 */ addiu $a2, $a2, 0x1118 -/* 0ED760 7F0B8C30 3C048008 */ lui $a0, %hi(ptr_bgdata_portals) -/* 0ED764 7F0B8C34 8C84FF80 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0ED760 7F0B8C30 3C048008 */ lui $a0, %hi(g_BgPortals) +/* 0ED764 7F0B8C34 8C84FF80 */ lw $a0, %lo(g_BgPortals)($a0) /* 0ED768 7F0B8C38 00008025 */ move $s0, $zero /* 0ED76C 7F0B8C3C 00001825 */ move $v1, $zero /* 0ED770 7F0B8C40 8C8D0000 */ lw $t5, ($a0) @@ -10874,8 +10502,8 @@ glabel sub_GAME_7F0B8A6C /* 0ED7A4 7F0B8C74 AFB80010 */ sw $t8, 0x10($sp) /* 0ED7A8 7F0B8C78 0FC2DF79 */ jal sub_GAME_7F0B7DE4 /* 0ED7AC 7F0B8C7C AFA30034 */ sw $v1, 0x34($sp) -/* 0ED7B0 7F0B8C80 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) -/* 0ED7B4 7F0B8C84 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0ED7B0 7F0B8C80 3C198008 */ lui $t9, %hi(g_BgPortals) +/* 0ED7B4 7F0B8C84 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0ED7B8 7F0B8C88 8FA30034 */ lw $v1, 0x34($sp) /* 0ED7BC 7F0B8C8C 03231021 */ addu $v0, $t9, $v1 .L7F0B8C90: @@ -10897,8 +10525,8 @@ glabel sub_GAME_7F0B8A6C /* 0ED7F4 7F0B8CC4 1440FFFD */ bnez $v0, .L7F0B8CBC /* 0ED7F8 7F0B8CC8 00000000 */ nop .L7F0B8CCC: -/* 0ED7FC 7F0B8CCC 3C048008 */ lui $a0, %hi(ptr_bgdata_portals) -/* 0ED800 7F0B8CD0 8C84FF80 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0ED7FC 7F0B8CCC 3C048008 */ lui $a0, %hi(g_BgPortals) +/* 0ED800 7F0B8CD0 8C84FF80 */ lw $a0, %lo(g_BgPortals)($a0) /* 0ED804 7F0B8CD4 8C820000 */ lw $v0, ($a0) .L7F0B8CD8: /* 0ED808 7F0B8CD8 10400022 */ beqz $v0, .L7F0B8D64 @@ -11013,10 +10641,10 @@ glabel sub_GAME_7F0B8A6C /* 0EA7E8 7F0B7DF8 3C028004 */ lui $v0, %hi(levelentry_index) # $v0, 0x8004 /* 0EA7EC 7F0B7DFC 8C42AC50 */ lw $v0, %lo(levelentry_index)($v0) /* 0EA7F0 7F0B7E00 24030015 */ li $v1, 21 -/* 0EA7F4 7F0B7E04 3C198007 */ lui $t9, %hi(ptr_bgdata_portals) # $t9, 0x8007 +/* 0EA7F4 7F0B7E04 3C198007 */ lui $t9, %hi(g_BgPortals) # $t9, 0x8007 /* 0EA7F8 7F0B7E08 10620005 */ beq $v1, $v0, .L7F0B7E20 /* 0EA7FC 7F0B7E0C 00000000 */ nop -/* 0EA800 7F0B7E10 8F39B3C8 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0EA800 7F0B7E10 8F39B3C8 */ lw $t9, %lo(g_BgPortals)($t9) /* 0EA804 7F0B7E14 8F2A0000 */ lw $t2, ($t9) /* 0EA808 7F0B7E18 15400021 */ bnez $t2, .L7F0B7EA0 /* 0EA80C 7F0B7E1C 00000000 */ nop @@ -11073,8 +10701,8 @@ glabel sub_GAME_7F0B8A6C /* 0EA8BC 7F0B7ECC 24070001 */ li $a3, 1 /* 0EA8C0 7F0B7ED0 0FC2CB1F */ jal sub_GAME_7F0B39BC /* 0EA8C4 7F0B7ED4 24C61110 */ addiu $a2, $a2, 0x1110 -/* 0EA8C8 7F0B7ED8 3C048007 */ lui $a0, %hi(ptr_bgdata_portals) # $a0, 0x8007 -/* 0EA8CC 7F0B7EDC 8C84B3C8 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0EA8C8 7F0B7ED8 3C048007 */ lui $a0, %hi(g_BgPortals) # $a0, 0x8007 +/* 0EA8CC 7F0B7EDC 8C84B3C8 */ lw $a0, %lo(g_BgPortals)($a0) /* 0EA8D0 7F0B7EE0 00008025 */ move $s0, $zero /* 0EA8D4 7F0B7EE4 00001825 */ move $v1, $zero /* 0EA8D8 7F0B7EE8 8C8D0000 */ lw $t5, ($a0) @@ -11094,8 +10722,8 @@ glabel sub_GAME_7F0B8A6C .L7F0B7F1C: /* 0EA90C 7F0B7F1C 0FC2DC48 */ jal sub_GAME_7F0B7DE4 /* 0EA910 7F0B7F20 AFA30028 */ sw $v1, 0x28($sp) -/* 0EA914 7F0B7F24 3C188007 */ lui $t8, %hi(ptr_bgdata_portals) # $t8, 0x8007 -/* 0EA918 7F0B7F28 8F18B3C8 */ lw $t8, %lo(ptr_bgdata_portals)($t8) +/* 0EA914 7F0B7F24 3C188007 */ lui $t8, %hi(g_BgPortals) # $t8, 0x8007 +/* 0EA918 7F0B7F28 8F18B3C8 */ lw $t8, %lo(g_BgPortals)($t8) /* 0EA91C 7F0B7F2C 8FA30028 */ lw $v1, 0x28($sp) /* 0EA920 7F0B7F30 03031021 */ addu $v0, $t8, $v1 /* 0EA924 7F0B7F34 8C590008 */ lw $t9, 8($v0) @@ -11115,8 +10743,8 @@ glabel sub_GAME_7F0B8A6C /* 0EA950 7F0B7F60 1440FFFD */ bnez $v0, .L7F0B7F58 /* 0EA954 7F0B7F64 00000000 */ nop .L7F0B7F68: -/* 0EA958 7F0B7F68 3C048007 */ lui $a0, %hi(ptr_bgdata_portals) # $a0, 0x8007 -/* 0EA95C 7F0B7F6C 8C84B3C8 */ lw $a0, %lo(ptr_bgdata_portals)($a0) +/* 0EA958 7F0B7F68 3C048007 */ lui $a0, %hi(g_BgPortals) # $a0, 0x8007 +/* 0EA95C 7F0B7F6C 8C84B3C8 */ lw $a0, %lo(g_BgPortals)($a0) /* 0EA960 7F0B7F70 3C078004 */ lui $a3, %hi(array_room_info) # $a3, 0x8004 /* 0EA964 7F0B7F74 24E7AC64 */ addiu $a3, %lo(array_room_info) # addiu $a3, $a3, -0x539c /* 0EA968 7F0B7F78 8C8A0000 */ lw $t2, ($a0) @@ -11206,8 +10834,8 @@ void sub_GAME_7F0B8DF4(void) { GLOBAL_ASM( .text glabel sub_GAME_7F0B8DF4 -/* 0ED924 7F0B8DF4 3C088008 */ lui $t0, %hi(ptr_bgdata_portals) -/* 0ED928 7F0B8DF8 2508FF80 */ addiu $t0, %lo(ptr_bgdata_portals) # addiu $t0, $t0, -0x80 +/* 0ED924 7F0B8DF4 3C088008 */ lui $t0, %hi(g_BgPortals) +/* 0ED928 7F0B8DF8 2508FF80 */ addiu $t0, %lo(g_BgPortals) # addiu $t0, $t0, -0x80 /* 0ED92C 7F0B8DFC 8D070000 */ lw $a3, ($t0) /* 0ED930 7F0B8E00 27BDFFF0 */ addiu $sp, $sp, -0x10 /* 0ED934 7F0B8E04 AFB1000C */ sw $s1, 0xc($sp) @@ -11353,8 +10981,8 @@ GLOBAL_ASM( .text glabel sub_GAME_7F0B8EFC /* 0EDA2C 7F0B8EFC 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 0EDA30 7F0B8F00 3C078008 */ lui $a3, %hi(ptr_bgdata_portals) -/* 0EDA34 7F0B8F04 8CE7FF80 */ lw $a3, %lo(ptr_bgdata_portals)($a3) +/* 0EDA30 7F0B8F00 3C078008 */ lui $a3, %hi(g_BgPortals) +/* 0EDA34 7F0B8F04 8CE7FF80 */ lw $a3, %lo(g_BgPortals)($a3) /* 0EDA38 7F0B8F08 AFB2000C */ sw $s2, 0xc($sp) /* 0EDA3C 7F0B8F0C AFB10008 */ sw $s1, 8($sp) /* 0EDA40 7F0B8F10 AFB00004 */ sw $s0, 4($sp) @@ -11396,8 +11024,8 @@ glabel sub_GAME_7F0B8EFC /* 0EDAC0 7F0B8F90 1000000A */ b .L7F0B8FBC /* 0EDAC4 7F0B8F94 00601025 */ move $v0, $v1 .L7F0B8F98: -/* 0EDAC8 7F0B8F98 3C088008 */ lui $t0, %hi(ptr_bgdata_portals) -/* 0EDACC 7F0B8F9C 8D08FF80 */ lw $t0, %lo(ptr_bgdata_portals)($t0) +/* 0EDAC8 7F0B8F98 3C088008 */ lui $t0, %hi(g_BgPortals) +/* 0EDACC 7F0B8F9C 8D08FF80 */ lw $t0, %lo(g_BgPortals)($t0) /* 0EDAD0 7F0B8FA0 01042821 */ addu $a1, $t0, $a0 /* 0EDAD4 7F0B8FA4 8CA90008 */ lw $t1, 8($a1) .L7F0B8FA8: @@ -11427,8 +11055,8 @@ void sub_GAME_7F0B8FD0(s32 arg0, s32 arg1) { void *phi_a0; // Node 0 - phi_a0 = ptr_bgdata_portals; - if (*ptr_bgdata_portals != 0) + phi_a0 = g_BgPortals; + if (*g_BgPortals != 0) { loop_1: // Node 1 @@ -11467,8 +11095,8 @@ void sub_GAME_7F0B8FD0(s32 arg0, s32 arg1) { GLOBAL_ASM( .text glabel sub_GAME_7F0B8FD0 -/* 0EDB00 7F0B8FD0 3C038008 */ lui $v1, %hi(ptr_bgdata_portals) -/* 0EDB04 7F0B8FD4 8C63FF80 */ lw $v1, %lo(ptr_bgdata_portals)($v1) +/* 0EDB00 7F0B8FD0 3C038008 */ lui $v1, %hi(g_BgPortals) +/* 0EDB04 7F0B8FD4 8C63FF80 */ lw $v1, %lo(g_BgPortals)($v1) /* 0EDB08 7F0B8FD8 00803025 */ move $a2, $a0 /* 0EDB0C 7F0B8FDC 8C6E0000 */ lw $t6, ($v1) /* 0EDB10 7F0B8FE0 00602025 */ move $a0, $v1 @@ -11870,7 +11498,7 @@ glabel sub_GAME_7F0B9338 /* 0EE0E0 7F0B95B0 46105480 */ add.s $f18, $f10, $f16 /* 0EE0E4 7F0B95B4 15400003 */ bnez $t2, .L7F0B95C4 /* 0EE0E8 7F0B95B8 E512004C */ swc1 $f18, 0x4c($t0) -/* 0EE0EC 7F0B95BC 0FC2D971 */ jal sub_GAME_7F0B65C4 +/* 0EE0EC 7F0B95BC 0FC2D971 */ jal delete_room_data /* 0EE0F0 7F0B95C0 02002025 */ move $a0, $s0 .L7F0B95C4: /* 0EE0F4 7F0B95C4 8FBF001C */ lw $ra, 0x1c($sp) @@ -11900,8 +11528,8 @@ void sub_GAME_7F0B95D8(s32 arg0) { void *phi_t2; // Node 0 - phi_v1 = ptr_bgdata_portals; - if (*ptr_bgdata_portals != 0) + phi_v1 = g_BgPortals; + if (*g_BgPortals != 0) { loop_1: // Node 1 @@ -11970,8 +11598,8 @@ void sub_GAME_7F0B95D8(s32 arg0) { GLOBAL_ASM( .text glabel sub_GAME_7F0B95D8 -/* 0EE108 7F0B95D8 3C058008 */ lui $a1, %hi(ptr_bgdata_portals) -/* 0EE10C 7F0B95DC 8CA5FF80 */ lw $a1, %lo(ptr_bgdata_portals)($a1) +/* 0EE108 7F0B95D8 3C058008 */ lui $a1, %hi(g_BgPortals) +/* 0EE10C 7F0B95DC 8CA5FF80 */ lw $a1, %lo(g_BgPortals)($a1) /* 0EE110 7F0B95E0 00001025 */ move $v0, $zero /* 0EE114 7F0B95E4 240B000C */ li $t3, 12 /* 0EE118 7F0B95E8 8CAE0000 */ lw $t6, ($a1) @@ -12061,8 +11689,8 @@ glabel D_80058D58 .text glabel sub_GAME_7F0B96CC /* 0EE1FC 7F0B96CC 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 0EE200 7F0B96D0 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EE204 7F0B96D4 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EE200 7F0B96D0 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EE204 7F0B96D4 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EE208 7F0B96D8 000440C0 */ sll $t0, $a0, 3 /* 0EE20C 7F0B96DC AFB00020 */ sw $s0, 0x20($sp) /* 0EE210 7F0B96E0 00A08025 */ move $s0, $a1 @@ -12168,7 +11796,7 @@ glabel sub_GAME_7F0B96CC /* 0EE390 7F0B9860 C6060000 */ lwc1 $f6, ($s0) .L7F0B9864: /* 0EE394 7F0B9864 C6080004 */ lwc1 $f8, 4($s0) -/* 0EE398 7F0B9868 3C198008 */ lui $t9, %hi(ptr_bgdata_portals) +/* 0EE398 7F0B9868 3C198008 */ lui $t9, %hi(g_BgPortals) /* 0EE39C 7F0B986C 46143282 */ mul.s $f10, $f6, $f20 /* 0EE3A0 7F0B9870 C6060008 */ lwc1 $f6, 8($s0) /* 0EE3A4 7F0B9874 3C018006 */ lui $at, %hi(D_80058D54) @@ -12177,7 +11805,7 @@ glabel sub_GAME_7F0B96CC /* 0EE3B0 7F0B9880 46143282 */ mul.s $f10, $f6, $f20 /* 0EE3B4 7F0B9884 E6040004 */ swc1 $f4, 4($s0) /* 0EE3B8 7F0B9888 E60A0008 */ swc1 $f10, 8($s0) -/* 0EE3BC 7F0B988C 8F39FF80 */ lw $t9, %lo(ptr_bgdata_portals)($t9) +/* 0EE3BC 7F0B988C 8F39FF80 */ lw $t9, %lo(g_BgPortals)($t9) /* 0EE3C0 7F0B9890 C4228D54 */ lwc1 $f2, %lo(D_80058D54)($at) /* 0EE3C4 7F0B9894 3C018006 */ lui $at, %hi(D_80058D58) /* 0EE3C8 7F0B9898 03284821 */ addu $t1, $t9, $t0 @@ -12237,14 +11865,14 @@ glabel sub_GAME_7F0B96CC * * Address 0x7F0B993C. */ -s32 sub_GAME_7F0B993C(f32 arg0) +s32 sub_GAME_7F0B993C(s32 arg0) { - // probably a struct here. - f32 fp[6]; + struct PortalMetric metric; + s32 padding; - sub_GAME_7F0B96CC(arg0, &fp[1]); + sub_GAME_7F0B96CC(arg0, &metric); - if (((fp[1] * fp[1]) + (fp[3] * fp[3])) < 0.999f) + if (((metric.normal.f[0] * metric.normal.f[0]) + (metric.normal.f[2] * metric.normal.f[2])) < 0.999f) { return 0; } @@ -12277,7 +11905,7 @@ f32 sub_GAME_7F0B9990(s32 arg0) { f32 phi_f2_3; // Node 0 - temp_t8 = (ptr_bgdata_portals + (arg0 * 8)); + temp_t8 = (g_BgPortals + (arg0 * 8)); temp_t9 = (((s32) temp_t8->unk7 >> 4) & 0xf); temp_a0 = -(s32) (temp_t9 & 3); temp_f2 = ((f32) (temp_t8->unk7 & 0xf) * 0.25f); @@ -12318,8 +11946,8 @@ f32 sub_GAME_7F0B9990(s32 arg0) { GLOBAL_ASM( .text glabel sub_GAME_7F0B9990 -/* 0EE4C0 7F0B9990 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EE4C4 7F0B9994 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EE4C0 7F0B9990 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EE4C4 7F0B9994 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EE4C8 7F0B9998 000478C0 */ sll $t7, $a0, 3 /* 0EE4CC 7F0B999C 3C013E80 */ li $at, 0x3E800000 # 0.250000 /* 0EE4D0 7F0B99A0 01CFC021 */ addu $t8, $t6, $t7 @@ -12367,7 +11995,7 @@ glabel sub_GAME_7F0B9990 */ u8 bgGetDataPortalsControlBytes2(s32 arg0) { - return ptr_bgdata_portals[arg0].controlbytes2; + return g_BgPortals[arg0].controlbytes2; } @@ -12382,7 +12010,7 @@ s32 sub_GAME_7F0B9A2C(s32 arg0) { s8 phi_v0; // Node 0 - temp_v1 = (ptr_bgdata_portals + (arg0 * 8)); + temp_v1 = (g_BgPortals + (arg0 * 8)); temp_v0 = (temp_v1->unk7 + 1); if (temp_v1->unk7 >= 0xff) { @@ -12408,8 +12036,8 @@ s32 sub_GAME_7F0B9A2C(s32 arg0) { GLOBAL_ASM( .text glabel sub_GAME_7F0B9A2C -/* 0EE55C 7F0B9A2C 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EE560 7F0B9A30 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EE55C 7F0B9A2C 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EE560 7F0B9A30 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EE564 7F0B9A34 000478C0 */ sll $t7, $a0, 3 /* 0EE568 7F0B9A38 01CF1821 */ addu $v1, $t6, $t7 /* 0EE56C 7F0B9A3C 90620007 */ lbu $v0, 7($v1) @@ -12444,7 +12072,7 @@ s32 sub_GAME_7F0B9A7C(s32 arg0) { s8 phi_v0; // Node 0 - temp_v1 = (ptr_bgdata_portals + (arg0 * 8)); + temp_v1 = (g_BgPortals + (arg0 * 8)); if ((((s32) temp_v1->unk7 >> 4) & 0xf) == 0) { // Node 1 @@ -12474,8 +12102,8 @@ s32 sub_GAME_7F0B9A7C(s32 arg0) { GLOBAL_ASM( .text glabel sub_GAME_7F0B9A7C -/* 0EE5AC 7F0B9A7C 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EE5B0 7F0B9A80 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EE5AC 7F0B9A7C 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EE5B0 7F0B9A80 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EE5B4 7F0B9A84 000478C0 */ sll $t7, $a0, 3 /* 0EE5B8 7F0B9A88 01CF1821 */ addu $v1, $t6, $t7 /* 0EE5BC 7F0B9A8C 90620007 */ lbu $v0, 7($v1) @@ -12514,7 +12142,7 @@ glabel sub_GAME_7F0B9A7C */ s32 bgGetDataPortalsControlBytes1Bit1(s32 index) { - return ptr_bgdata_portals[index].controlbytes1 & 1; + return g_BgPortals[index].controlbytes1 & 1; } @@ -12526,7 +12154,7 @@ s32 bgGetDataPortalsControlBytes1Bit1(s32 index) */ s32 bgGetDataPortalsControlBytes1Bit2(s32 index) { - return ptr_bgdata_portals[index].controlbytes1 & 2; + return g_BgPortals[index].controlbytes1 & 2; } @@ -12538,7 +12166,7 @@ s32 bgGetDataPortalsControlBytes1Bit2(s32 index) */ void bgSetDataPortalsControlBytes1Bit2(s32 index) { - ptr_bgdata_portals[index].controlbytes1 |= 2; + g_BgPortals[index].controlbytes1 |= 2; } @@ -12550,7 +12178,7 @@ void bgSetDataPortalsControlBytes1Bit2(s32 index) */ void bgClearDataPortalsControlBytes1Low2Bits(s32 index) { - ptr_bgdata_portals[index].controlbytes1 &= 0xFD; + g_BgPortals[index].controlbytes1 &= 0xFD; } @@ -12566,9 +12194,9 @@ s8 bgSwapConnectedRooms(s32 index) { u8 t; - t = ptr_bgdata_portals[index].connectedRoom1; - ptr_bgdata_portals[index].connectedRoom1 = ptr_bgdata_portals[index].connectedRoom2; - ptr_bgdata_portals[index].connectedRoom2 = t; + t = g_BgPortals[index].connectedRoom1; + g_BgPortals[index].connectedRoom1 = g_BgPortals[index].connectedRoom2; + g_BgPortals[index].connectedRoom2 = t; } @@ -12594,7 +12222,7 @@ f32 sub_GAME_7F0B9B94(s32 arg0) { f32 phi_return; // Node 0 - temp_v0 = (ptr_bgdata_portals + (arg0 * 8)); + temp_v0 = (g_BgPortals + (arg0 * 8)); sp28 = (?32) temp_v0->unk5; sub_GAME_7F0B92B4(temp_v0->unk4, &sp54); sub_GAME_7F0B92B4(sp28, &sp48); @@ -12639,8 +12267,8 @@ f32 sub_GAME_7F0B9B94(s32 arg0) { GLOBAL_ASM( .text glabel sub_GAME_7F0B9B94 -/* 0EE6C4 7F0B9B94 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EE6C8 7F0B9B98 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EE6C4 7F0B9B94 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EE6C8 7F0B9B98 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EE6CC 7F0B9B9C 27BDFFA0 */ addiu $sp, $sp, -0x60 /* 0EE6D0 7F0B9BA0 0004C0C0 */ sll $t8, $a0, 3 /* 0EE6D4 7F0B9BA4 AFBF0014 */ sw $ra, 0x14($sp) @@ -12736,8 +12364,8 @@ GLOBAL_ASM( glabel sub_GAME_7F0B9CC8 /* 0EE7F8 7F0B9CC8 27BDFFC0 */ addiu $sp, $sp, -0x40 /* 0EE7FC 7F0B9CCC AFBE0038 */ sw $fp, 0x38($sp) -/* 0EE800 7F0B9CD0 3C1E8008 */ lui $fp, %hi(ptr_bgdata_portals) -/* 0EE804 7F0B9CD4 27DEFF80 */ addiu $fp, %lo(ptr_bgdata_portals) # addiu $fp, $fp, -0x80 +/* 0EE800 7F0B9CD0 3C1E8008 */ lui $fp, %hi(g_BgPortals) +/* 0EE804 7F0B9CD4 27DEFF80 */ addiu $fp, %lo(g_BgPortals) # addiu $fp, $fp, -0x80 /* 0EE808 7F0B9CD8 8FC30000 */ lw $v1, ($fp) /* 0EE80C 7F0B9CDC AFBF003C */ sw $ra, 0x3c($sp) /* 0EE810 7F0B9CE0 AFB70034 */ sw $s7, 0x34($sp) @@ -12818,7 +12446,7 @@ glabel sub_GAME_7F0B9CC8 */ void bgToggleDataPortalsContrlBytes1Bit1(s32 index, s32 toggle) { - ptr_bgdata_portals[index].controlbytes1 = (ptr_bgdata_portals[index].controlbytes1 | 1) ^ (toggle != 0); + g_BgPortals[index].controlbytes1 = (g_BgPortals[index].controlbytes1 | 1) ^ (toggle != 0); } @@ -12871,106 +12499,46 @@ void bgRemoved7F0B9DFC(s32 arg0) return; } +s32 sub_GAME_7F0B9E04(coord3d *arg0, coord3d *arg1) +{ + s32 bestportalnum = -1; + s32 count = 0; + f32 bestthing = MAXFLOAT; + f32 thisthing; + s32 i; + for (i = 0; g_BgPortals[i].offset_portal; i++) + { + if (sub_GAME_7F0B9F14(i, arg0, arg1) != 0) + { + thisthing = D_80044900; + if (thisthing < 0) + { + thisthing = -thisthing; + } + if (thisthing < bestthing) + { + if (count); + if (i); + bestportalnum = i; + bestthing = thisthing; + count++; + } + } + } - -#ifdef NONMATCHING -void sub_GAME_7F0B9E04(void) { - + return bestportalnum; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80058D60 -.word 0x7f7fffff /*3.4028235e38*/ -.text -glabel sub_GAME_7F0B9E04 -/* 0EE934 7F0B9E04 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0EE938 7F0B9E08 AFB6003C */ sw $s6, 0x3c($sp) -/* 0EE93C 7F0B9E0C 3C168008 */ lui $s6, %hi(ptr_bgdata_portals) -/* 0EE940 7F0B9E10 26D6FF80 */ addiu $s6, %lo(ptr_bgdata_portals) # addiu $s6, $s6, -0x80 -/* 0EE944 7F0B9E14 8ECE0000 */ lw $t6, ($s6) -/* 0EE948 7F0B9E18 AFBF0044 */ sw $ra, 0x44($sp) -/* 0EE94C 7F0B9E1C AFB70040 */ sw $s7, 0x40($sp) -/* 0EE950 7F0B9E20 AFB50038 */ sw $s5, 0x38($sp) -/* 0EE954 7F0B9E24 AFB40034 */ sw $s4, 0x34($sp) -/* 0EE958 7F0B9E28 AFB30030 */ sw $s3, 0x30($sp) -/* 0EE95C 7F0B9E2C AFB2002C */ sw $s2, 0x2c($sp) -/* 0EE960 7F0B9E30 AFB10028 */ sw $s1, 0x28($sp) -/* 0EE964 7F0B9E34 AFB00024 */ sw $s0, 0x24($sp) -/* 0EE968 7F0B9E38 F7B60018 */ sdc1 $f22, 0x18($sp) -/* 0EE96C 7F0B9E3C F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0EE970 7F0B9E40 8DCF0000 */ lw $t7, ($t6) -/* 0EE974 7F0B9E44 3C018006 */ lui $at, %hi(D_80058D60) -/* 0EE978 7F0B9E48 0080A025 */ move $s4, $a0 -/* 0EE97C 7F0B9E4C 00A0A825 */ move $s5, $a1 -/* 0EE980 7F0B9E50 2413FFFF */ li $s3, -1 -/* 0EE984 7F0B9E54 00008825 */ move $s1, $zero -/* 0EE988 7F0B9E58 C4348D60 */ lwc1 $f20, %lo(D_80058D60)($at) -/* 0EE98C 7F0B9E5C 11E0001F */ beqz $t7, .L7F0B9EDC -/* 0EE990 7F0B9E60 00008025 */ move $s0, $zero -/* 0EE994 7F0B9E64 3C178004 */ lui $s7, %hi(D_80044900) -/* 0EE998 7F0B9E68 4480B000 */ mtc1 $zero, $f22 -/* 0EE99C 7F0B9E6C 26F74900 */ addiu $s7, %lo(D_80044900) # addiu $s7, $s7, 0x4900 -/* 0EE9A0 7F0B9E70 00009025 */ move $s2, $zero -/* 0EE9A4 7F0B9E74 02002025 */ move $a0, $s0 -.L7F0B9E78: -/* 0EE9A8 7F0B9E78 02802825 */ move $a1, $s4 -/* 0EE9AC 7F0B9E7C 0FC2E7C5 */ jal sub_GAME_7F0B9F14 -/* 0EE9B0 7F0B9E80 02A03025 */ move $a2, $s5 -/* 0EE9B4 7F0B9E84 5040000F */ beql $v0, $zero, .L7F0B9EC4 -/* 0EE9B8 7F0B9E88 8ED80000 */ lw $t8, ($s6) -/* 0EE9BC 7F0B9E8C C6E00000 */ lwc1 $f0, ($s7) -/* 0EE9C0 7F0B9E90 4616003C */ c.lt.s $f0, $f22 -/* 0EE9C4 7F0B9E94 00000000 */ nop -/* 0EE9C8 7F0B9E98 45020003 */ bc1fl .L7F0B9EA8 -/* 0EE9CC 7F0B9E9C 4614003C */ c.lt.s $f0, $f20 -/* 0EE9D0 7F0B9EA0 46000007 */ neg.s $f0, $f0 -/* 0EE9D4 7F0B9EA4 4614003C */ c.lt.s $f0, $f20 -.L7F0B9EA8: -/* 0EE9D8 7F0B9EA8 00000000 */ nop -/* 0EE9DC 7F0B9EAC 45020005 */ bc1fl .L7F0B9EC4 -/* 0EE9E0 7F0B9EB0 8ED80000 */ lw $t8, ($s6) -/* 0EE9E4 7F0B9EB4 02009825 */ move $s3, $s0 -/* 0EE9E8 7F0B9EB8 46000506 */ mov.s $f20, $f0 -/* 0EE9EC 7F0B9EBC 26310001 */ addiu $s1, $s1, 1 -/* 0EE9F0 7F0B9EC0 8ED80000 */ lw $t8, ($s6) -.L7F0B9EC4: -/* 0EE9F4 7F0B9EC4 26520008 */ addiu $s2, $s2, 8 -/* 0EE9F8 7F0B9EC8 26100001 */ addiu $s0, $s0, 1 -/* 0EE9FC 7F0B9ECC 0312C821 */ addu $t9, $t8, $s2 -/* 0EEA00 7F0B9ED0 8F280000 */ lw $t0, ($t9) -/* 0EEA04 7F0B9ED4 5500FFE8 */ bnezl $t0, .L7F0B9E78 -/* 0EEA08 7F0B9ED8 02002025 */ move $a0, $s0 -.L7F0B9EDC: -/* 0EEA0C 7F0B9EDC 8FBF0044 */ lw $ra, 0x44($sp) -/* 0EEA10 7F0B9EE0 02601025 */ move $v0, $s3 -/* 0EEA14 7F0B9EE4 8FB30030 */ lw $s3, 0x30($sp) -/* 0EEA18 7F0B9EE8 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 0EEA1C 7F0B9EEC D7B60018 */ ldc1 $f22, 0x18($sp) -/* 0EEA20 7F0B9EF0 8FB00024 */ lw $s0, 0x24($sp) -/* 0EEA24 7F0B9EF4 8FB10028 */ lw $s1, 0x28($sp) -/* 0EEA28 7F0B9EF8 8FB2002C */ lw $s2, 0x2c($sp) -/* 0EEA2C 7F0B9EFC 8FB40034 */ lw $s4, 0x34($sp) -/* 0EEA30 7F0B9F00 8FB50038 */ lw $s5, 0x38($sp) -/* 0EEA34 7F0B9F04 8FB6003C */ lw $s6, 0x3c($sp) -/* 0EEA38 7F0B9F08 8FB70040 */ lw $s7, 0x40($sp) -/* 0EEA3C 7F0B9F0C 03E00008 */ jr $ra -/* 0EEA40 7F0B9F10 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif - - - #ifdef NONMATCHING -void sub_GAME_7F0B9F14(void) { +s32 sub_GAME_7F0B9F14(s32 portalnum, struct coord *arg1, struct coord *arg2) { } #else +s32 sub_GAME_7F0B9F14(s32 portalnum, struct coord *arg1, struct coord *arg2); GLOBAL_ASM( .text glabel sub_GAME_7F0B9F14 @@ -13051,8 +12619,8 @@ glabel sub_GAME_7F0B9F14 /* 0EEB60 7F0BA030 C7A4006C */ lwc1 $f4, 0x6c($sp) /* 0EEB64 7F0BA034 8FAE00A0 */ lw $t6, 0xa0($sp) /* 0EEB68 7F0BA038 46109202 */ mul.s $f8, $f18, $f16 -/* 0EEB6C 7F0BA03C 3C0F8008 */ lui $t7, %hi(ptr_bgdata_portals) -/* 0EEB70 7F0BA040 8DEFFF80 */ lw $t7, %lo(ptr_bgdata_portals)($t7) +/* 0EEB6C 7F0BA03C 3C0F8008 */ lui $t7, %hi(g_BgPortals) +/* 0EEB70 7F0BA040 8DEFFF80 */ lw $t7, %lo(g_BgPortals)($t7) /* 0EEB74 7F0BA044 3C018004 */ lui $at, %hi(D_80044900) /* 0EEB78 7F0BA048 000EC0C0 */ sll $t8, $t6, 3 /* 0EEB7C 7F0BA04C 01F84021 */ addu $t0, $t7, $t8 @@ -13276,8 +12844,8 @@ glabel sub_GAME_7F0BA2D4 /* 0EEEB0 7F0BA380 1020007C */ beqz $at, .L7F0BA574 /* 0EEEB4 7F0BA384 00087880 */ sll $t7, $t0, 2 /* 0EEEB8 7F0BA388 028FC021 */ addu $t8, $s4, $t7 -/* 0EEEBC 7F0BA38C 3C028008 */ lui $v0, %hi(ptr_bgdata_portals) -/* 0EEEC0 7F0BA390 8C42FF80 */ lw $v0, %lo(ptr_bgdata_portals)($v0) +/* 0EEEBC 7F0BA38C 3C028008 */ lui $v0, %hi(g_BgPortals) +/* 0EEEC0 7F0BA390 8C42FF80 */ lw $v0, %lo(g_BgPortals)($v0) /* 0EEEC4 7F0BA394 AFB8005C */ sw $t8, 0x5c($sp) .L7F0BA398: /* 0EEEC8 7F0BA398 8C490000 */ lw $t1, ($v0) @@ -13359,8 +12927,8 @@ glabel sub_GAME_7F0BA2D4 /* 0EEFDC 7F0BA4AC 0FC2E89B */ jal bgIsBboxOverlapping /* 0EEFE0 7F0BA4B0 27A70094 */ addiu $a3, $sp, 0x94 /* 0EEFE4 7F0BA4B4 1040001F */ beqz $v0, .L7F0BA534 -/* 0EEFE8 7F0BA4B8 3C0E8008 */ lui $t6, %hi(ptr_bgdata_portals) -/* 0EEFEC 7F0BA4BC 8DCEFF80 */ lw $t6, %lo(ptr_bgdata_portals)($t6) +/* 0EEFE8 7F0BA4B8 3C0E8008 */ lui $t6, %hi(g_BgPortals) +/* 0EEFEC 7F0BA4BC 8DCEFF80 */ lw $t6, %lo(g_BgPortals)($t6) /* 0EEFF0 7F0BA4C0 00004025 */ move $t0, $zero /* 0EEFF4 7F0BA4C4 0235082A */ slt $at, $s1, $s5 /* 0EEFF8 7F0BA4C8 01D23821 */ addu $a3, $t6, $s2 @@ -13395,8 +12963,8 @@ glabel sub_GAME_7F0BA2D4 /* 0EF05C 7F0BA52C 10000018 */ b .L7F0BA590 /* 0EF060 7F0BA530 AD310000 */ sw $s1, ($t1) .L7F0BA534: -/* 0EF064 7F0BA534 3C028008 */ lui $v0, %hi(ptr_bgdata_portals) -/* 0EF068 7F0BA538 8C42FF80 */ lw $v0, %lo(ptr_bgdata_portals)($v0) +/* 0EF064 7F0BA534 3C028008 */ lui $v0, %hi(g_BgPortals) +/* 0EF068 7F0BA538 8C42FF80 */ lw $v0, %lo(g_BgPortals)($v0) /* 0EF06C 7F0BA53C 00523821 */ addu $a3, $v0, $s2 /* 0EF070 7F0BA540 8CEA0008 */ lw $t2, 8($a3) .L7F0BA544: diff --git a/src/game/bg.h b/src/game/bg.h index 6bc1d93f..ece31770 100644 --- a/src/game/bg.h +++ b/src/game/bg.h @@ -109,14 +109,14 @@ extern bg_room_data * ptr_bgdata_room_fileposition_list; extern s_room_info array_room_info[]; -void bgInitDebugNoticeList(void); +void bgInit(void); // sub_GAME_7F033B38 requres arg be s32 s32 sub_GAME_7F0B8FD0(s32 roomA, u8 roomB); //f32 sub_GAME_7F0B4F9C(s32 room); // u8 not s32 for sub_GAME_7F0B2FE0 u32 bgDecompress(u8* source, u8 *target); -void sub_GAME_7F0B65C4(s32 roomID); +void delete_room_data(s32 roomID); void load_bg_file(LEVEL_INDEX stagenum); s32 bgDebugRemoved7F0B9DE4(s32 arg0, s32 arg1, s32 arg2); @@ -140,6 +140,8 @@ s32 bgGet2dBboxByRoomId(s32 room_id, struct bbox2d *result); f32 bgGetLevelVisibilityScale(void); void sub_GAME_7F0B5CC0(struct bbox2d *a, struct bbox2d *b); f32 get_room_data_float2(void); - +s32 sub_GAME_7F0B9CC8(s32 arg0, s32 arg1, struct coord3d *arg2, struct coord3d *arg3); +void sub_GAME_7F0B96CC(s32 arg0, struct PortalMetric *arg1); +void bgLoadFromDynamicCCRMLUT(s32 arg0, s32 arg1, s32 arg2); #endif diff --git a/src/game/bg2.c b/src/game/bg2.c index 9a5c3baf..a05b6262 100644 --- a/src/game/bg2.c +++ b/src/game/bg2.c @@ -33,11 +33,11 @@ u32 sub_GAME_7F0BA5C0(u32 arg0, u32 arg1) { phi_v0 = arg0; loop_2: // Node 2 - if (FogDL_primary_80044940 != 0) + if (DL_LUT_PRIMARY_ADDFOG != 0) { // Node 3 - phi_a0 = FogDL_primary_80044940; - phi_v1 = &FogDL_primary_80044940; + phi_a0 = DL_LUT_PRIMARY_ADDFOG; + phi_v1 = &DL_LUT_PRIMARY_ADDFOG; loop_4: // Node 4 if (*phi_v0 == phi_a0) @@ -77,12 +77,12 @@ glabel sub_GAME_7F0BA5C0 /* 0EF0F0 7F0BA5C0 0085082B */ sltu $at, $a0, $a1 /* 0EF0F4 7F0BA5C4 1020001C */ beqz $at, .L7F0BA638 /* 0EF0F8 7F0BA5C8 00801025 */ move $v0, $a0 -/* 0EF0FC 7F0BA5CC 3C068004 */ lui $a2, %hi(FogDL_primary_80044940) -/* 0EF100 7F0BA5D0 24C64940 */ addiu $a2, %lo(FogDL_primary_80044940) # addiu $a2, $a2, 0x4940 +/* 0EF0FC 7F0BA5CC 3C068004 */ lui $a2, %hi(DL_LUT_PRIMARY_ADDFOG) +/* 0EF100 7F0BA5D0 24C64940 */ addiu $a2, %lo(DL_LUT_PRIMARY_ADDFOG) # addiu $a2, $a2, 0x4940 /* 0EF104 7F0BA5D4 8CCE0000 */ lw $t6, ($a2) .L7F0BA5D8: -/* 0EF108 7F0BA5D8 3C0F8004 */ lui $t7, %hi(FogDL_primary_80044940) -/* 0EF10C 7F0BA5DC 25EF4940 */ addiu $t7, %lo(FogDL_primary_80044940) # addiu $t7, $t7, 0x4940 +/* 0EF108 7F0BA5D8 3C0F8004 */ lui $t7, %hi(DL_LUT_PRIMARY_ADDFOG) +/* 0EF10C 7F0BA5DC 25EF4940 */ addiu $t7, %lo(DL_LUT_PRIMARY_ADDFOG) # addiu $t7, $t7, 0x4940 /* 0EF110 7F0BA5E0 11C00011 */ beqz $t6, .L7F0BA628 /* 0EF114 7F0BA5E4 00C01825 */ move $v1, $a2 /* 0EF118 7F0BA5E8 8DE40000 */ lw $a0, ($t7) diff --git a/src/game/blood_decrypt.c b/src/game/blood_decrypt.c index 3cffdde2..42fd4cc4 100644 --- a/src/game/blood_decrypt.c +++ b/src/game/blood_decrypt.c @@ -1,138 +1,71 @@ #include "blood_decrypt.h" -#ifdef NONMATCHING -u8 *decrypt_bleeding_animation_data(u8*, s32, s32, u8*, s8*) { +// address 0x7F01CAE0 NTSC +u8 *decrypt_bleeding_animation_data(u8 *arg0, u8 arg1, u8 arg2, u8 *arg3, u8 *arg4) +{ + u8 var_a2; + u8 var_a3; + u8 temp_v0; + u8 var_v1; + u8 next; + temp_v0 = *arg0++; + *arg4 = temp_v0; + + do + { + s32 unused; + var_v1 = *arg0++; + unused = var_v1; + + var_a2 = 0xFF; + + if (var_v1 == 0xFF) + { + var_a3 = 0; + for (var_v1 = *arg0++; var_v1 != 0xFF; var_a2 ^= 0xff, var_v1 = *arg0++ ) + { + var_a3 += var_v1; + + while (var_v1-- > 0) + { + *arg3++ = var_a2; + } + } + + while (var_a3++ < arg1) + { + *arg3++ = var_a2; + } + + arg2--; + } + else + { + var_a3 = temp_v0 + (var_v1 & 0x1f); + var_v1 = (var_v1 >> 5) + 1; + arg2 -= var_v1; + + do + { + var_a2 = var_a3; + while (var_a2-- > 0) + { + *arg3++ = 0xff; + } + + var_a2 = arg1 - var_a3; + while (var_a2-- > 0) + { + *arg3++ = 0; + } + } while (--var_v1 > 0); + } + } while (arg2 > 0); + + return arg0; } -#else -GLOBAL_ASM( -.text -glabel decrypt_bleeding_animation_data -/* 051610 7F01CAE0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 051614 7F01CAE4 AFB30014 */ sw $s3, 0x14($sp) -/* 051618 7F01CAE8 AFB20010 */ sw $s2, 0x10($sp) -/* 05161C 7F01CAEC AFB1000C */ sw $s1, 0xc($sp) -/* 051620 7F01CAF0 AFB00008 */ sw $s0, 8($sp) -/* 051624 7F01CAF4 AFA5001C */ sw $a1, 0x1c($sp) -/* 051628 7F01CAF8 AFA60020 */ sw $a2, 0x20($sp) -/* 05162C 7F01CAFC 90820000 */ lbu $v0, ($a0) -/* 051630 7F01CB00 8FAF0028 */ lw $t7, 0x28($sp) -/* 051634 7F01CB04 00E08025 */ move $s0, $a3 -/* 051638 7F01CB08 30D100FF */ andi $s1, $a2, 0xff -/* 05163C 7F01CB0C 30A900FF */ andi $t1, $a1, 0xff -/* 051640 7F01CB10 24840001 */ addiu $a0, $a0, 1 -/* 051644 7F01CB14 241200FF */ li $s2, 255 -/* 051648 7F01CB18 241300FF */ li $s3, 255 -/* 05164C 7F01CB1C A1E20000 */ sb $v0, ($t7) -/* 051650 7F01CB20 90850000 */ lbu $a1, ($a0) -.L7F01CB24: -/* 051654 7F01CB24 24840001 */ addiu $a0, $a0, 1 -/* 051658 7F01CB28 326600FF */ andi $a2, $s3, 0xff -/* 05165C 7F01CB2C 1645002B */ bne $s2, $a1, .L7F01CBDC -/* 051660 7F01CB30 30B8001F */ andi $t8, $a1, 0x1f -/* 051664 7F01CB34 90830000 */ lbu $v1, ($a0) -/* 051668 7F01CB38 00003825 */ move $a3, $zero -/* 05166C 7F01CB3C 24840001 */ addiu $a0, $a0, 1 -/* 051670 7F01CB40 12430016 */ beq $s2, $v1, .L7F01CB9C -/* 051674 7F01CB44 00602825 */ move $a1, $v1 -.L7F01CB48: -/* 051678 7F01CB48 00E53821 */ addu $a3, $a3, $a1 -/* 05167C 7F01CB4C 2463FFFF */ addiu $v1, $v1, -1 -/* 051680 7F01CB50 30F800FF */ andi $t8, $a3, 0xff -/* 051684 7F01CB54 307900FF */ andi $t9, $v1, 0xff -/* 051688 7F01CB58 0005402A */ slt $t0, $zero, $a1 -/* 05168C 7F01CB5C 03003825 */ move $a3, $t8 -/* 051690 7F01CB60 11000008 */ beqz $t0, .L7F01CB84 -/* 051694 7F01CB64 03201825 */ move $v1, $t9 -.L7F01CB68: -/* 051698 7F01CB68 0003402A */ slt $t0, $zero, $v1 -/* 05169C 7F01CB6C 2463FFFF */ addiu $v1, $v1, -1 -/* 0516A0 7F01CB70 306E00FF */ andi $t6, $v1, 0xff -/* 0516A4 7F01CB74 01C01825 */ move $v1, $t6 -/* 0516A8 7F01CB78 A2060000 */ sb $a2, ($s0) -/* 0516AC 7F01CB7C 1500FFFA */ bnez $t0, .L7F01CB68 -/* 0516B0 7F01CB80 26100001 */ addiu $s0, $s0, 1 -.L7F01CB84: -/* 0516B4 7F01CB84 90830000 */ lbu $v1, ($a0) -/* 0516B8 7F01CB88 38CF00FF */ xori $t7, $a2, 0xff -/* 0516BC 7F01CB8C 31E600FF */ andi $a2, $t7, 0xff -/* 0516C0 7F01CB90 24840001 */ addiu $a0, $a0, 1 -/* 0516C4 7F01CB94 1643FFEC */ bne $s2, $v1, .L7F01CB48 -/* 0516C8 7F01CB98 00602825 */ move $a1, $v1 -.L7F01CB9C: -/* 0516CC 7F01CB9C 00E9402A */ slt $t0, $a3, $t1 -/* 0516D0 7F01CBA0 24E70001 */ addiu $a3, $a3, 1 -/* 0516D4 7F01CBA4 30F900FF */ andi $t9, $a3, 0xff -/* 0516D8 7F01CBA8 11000008 */ beqz $t0, .L7F01CBCC -/* 0516DC 7F01CBAC 03203825 */ move $a3, $t9 -.L7F01CBB0: -/* 0516E0 7F01CBB0 00E9402A */ slt $t0, $a3, $t1 -/* 0516E4 7F01CBB4 24E70001 */ addiu $a3, $a3, 1 -/* 0516E8 7F01CBB8 30EE00FF */ andi $t6, $a3, 0xff -/* 0516EC 7F01CBBC 01C03825 */ move $a3, $t6 -/* 0516F0 7F01CBC0 A2060000 */ sb $a2, ($s0) -/* 0516F4 7F01CBC4 1500FFFA */ bnez $t0, .L7F01CBB0 -/* 0516F8 7F01CBC8 26100001 */ addiu $s0, $s0, 1 -.L7F01CBCC: -/* 0516FC 7F01CBCC 2631FFFF */ addiu $s1, $s1, -1 -/* 051700 7F01CBD0 322F00FF */ andi $t7, $s1, 0xff -/* 051704 7F01CBD4 10000026 */ b .L7F01CC70 -/* 051708 7F01CBD8 01E08825 */ move $s1, $t7 -.L7F01CBDC: -/* 05170C 7F01CBDC 00583821 */ addu $a3, $v0, $t8 -/* 051710 7F01CBE0 00051943 */ sra $v1, $a1, 5 -/* 051714 7F01CBE4 30F900FF */ andi $t9, $a3, 0xff -/* 051718 7F01CBE8 24630001 */ addiu $v1, $v1, 1 -/* 05171C 7F01CBEC 306E00FF */ andi $t6, $v1, 0xff -/* 051720 7F01CBF0 01393023 */ subu $a2, $t1, $t9 -/* 051724 7F01CBF4 022E8823 */ subu $s1, $s1, $t6 -/* 051728 7F01CBF8 30D800FF */ andi $t8, $a2, 0xff -/* 05172C 7F01CBFC 322F00FF */ andi $t7, $s1, 0xff -/* 051730 7F01CC00 01C01825 */ move $v1, $t6 -/* 051734 7F01CC04 01E08825 */ move $s1, $t7 -/* 051738 7F01CC08 0018602A */ slt $t4, $zero, $t8 -/* 05173C 7F01CC0C 270DFFFF */ addiu $t5, $t8, -1 -/* 051740 7F01CC10 0019502A */ slt $t2, $zero, $t9 -/* 051744 7F01CC14 272BFFFF */ addiu $t3, $t9, -1 -.L7F01CC18: -/* 051748 7F01CC18 11400008 */ beqz $t2, .L7F01CC3C -/* 05174C 7F01CC1C 316600FF */ andi $a2, $t3, 0xff -.L7F01CC20: -/* 051750 7F01CC20 0006402A */ slt $t0, $zero, $a2 -/* 051754 7F01CC24 24C6FFFF */ addiu $a2, $a2, -1 -/* 051758 7F01CC28 30D900FF */ andi $t9, $a2, 0xff -/* 05175C 7F01CC2C 03203025 */ move $a2, $t9 -/* 051760 7F01CC30 A2130000 */ sb $s3, ($s0) -/* 051764 7F01CC34 1500FFFA */ bnez $t0, .L7F01CC20 -/* 051768 7F01CC38 26100001 */ addiu $s0, $s0, 1 -.L7F01CC3C: -/* 05176C 7F01CC3C 11800008 */ beqz $t4, .L7F01CC60 -/* 051770 7F01CC40 31A600FF */ andi $a2, $t5, 0xff -.L7F01CC44: -/* 051774 7F01CC44 0006402A */ slt $t0, $zero, $a2 -/* 051778 7F01CC48 24C6FFFF */ addiu $a2, $a2, -1 -/* 05177C 7F01CC4C 30CE00FF */ andi $t6, $a2, 0xff -/* 051780 7F01CC50 01C03025 */ move $a2, $t6 -/* 051784 7F01CC54 A2000000 */ sb $zero, ($s0) -/* 051788 7F01CC58 1500FFFA */ bnez $t0, .L7F01CC44 -/* 05178C 7F01CC5C 26100001 */ addiu $s0, $s0, 1 -.L7F01CC60: -/* 051790 7F01CC60 2463FFFF */ addiu $v1, $v1, -1 -/* 051794 7F01CC64 306F00FF */ andi $t7, $v1, 0xff -/* 051798 7F01CC68 1DE0FFEB */ bgtz $t7, .L7F01CC18 -/* 05179C 7F01CC6C 01E01825 */ move $v1, $t7 -.L7F01CC70: -/* 0517A0 7F01CC70 5E20FFAC */ bgtzl $s1, .L7F01CB24 -/* 0517A4 7F01CC74 90850000 */ lbu $a1, ($a0) -/* 0517A8 7F01CC78 8FB00008 */ lw $s0, 8($sp) -/* 0517AC 7F01CC7C 8FB1000C */ lw $s1, 0xc($sp) -/* 0517B0 7F01CC80 8FB20010 */ lw $s2, 0x10($sp) -/* 0517B4 7F01CC84 8FB30014 */ lw $s3, 0x14($sp) -/* 0517B8 7F01CC88 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0517BC 7F01CC8C 03E00008 */ jr $ra -/* 0517C0 7F01CC90 00801025 */ move $v0, $a0 -) -#endif + @@ -145,398 +78,134 @@ void sub_GAME_7F01CC94(u8* arg0, u16 arg1, u8* arg2) } } +// Address 0x7F01CCEC NTSC +void sub_GAME_7F01CCEC(u8 *arg0, u8 arg1, u8 arg2, u8 *arg3, u8 arg4) +{ + s16 i; + s16 j; -#ifdef NONMATCHING -void sub_GAME_7F01CCEC(void) { + u32 var_t0; + u32 var_t1; + + s16 var_t5; + s16 var_s4; + + u8 tempt9; + + for (i = 0; i < arg2; i++) + { + for (j = 0; j < arg1; j++) + { + var_t0 = 0; + var_t1 = 0; + + var_t5 = ((i - arg4) < 0) ? 0 : (i - arg4); + + while ((((arg2 - 1) < (i + arg4)) ? (arg2 - 1) : (i + arg4)) >= var_t5) + { + var_s4 = ((j - arg4) < 0) ? 0 : (j - arg4); + + while ((((arg1 - 1) < (j + arg4)) ? (arg1 - 1) : (j + arg4)) >= var_s4) + { + var_t1 += arg0[var_s4 + (var_t5 * arg1)]; + + var_s4 += 1; + var_t0 += 1; + } + + var_t5 += 1; + } + + tempt9 = (u8) ((u32) ((var_t0 >> 1) + var_t1) / var_t0); + arg3[j + (i * arg1)] = tempt9; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01CCEC -/* 05181C 7F01CCEC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 051820 7F01CCF0 30CF00FF */ andi $t7, $a2, 0xff -/* 051824 7F01CCF4 AFBE0024 */ sw $fp, 0x24($sp) -/* 051828 7F01CCF8 AFB70020 */ sw $s7, 0x20($sp) -/* 05182C 7F01CCFC AFB6001C */ sw $s6, 0x1c($sp) -/* 051830 7F01CD00 AFB50018 */ sw $s5, 0x18($sp) -/* 051834 7F01CD04 AFB40014 */ sw $s4, 0x14($sp) -/* 051838 7F01CD08 AFB30010 */ sw $s3, 0x10($sp) -/* 05183C 7F01CD0C AFB2000C */ sw $s2, 0xc($sp) -/* 051840 7F01CD10 AFB10008 */ sw $s1, 8($sp) -/* 051844 7F01CD14 AFB00004 */ sw $s0, 4($sp) -/* 051848 7F01CD18 AFA5002C */ sw $a1, 0x2c($sp) -/* 05184C 7F01CD1C AFA60030 */ sw $a2, 0x30($sp) -/* 051850 7F01CD20 30AE00FF */ andi $t6, $a1, 0xff -/* 051854 7F01CD24 01E01825 */ move $v1, $t7 -/* 051858 7F01CD28 19E00065 */ blez $t7, .L7F01CEC0 -/* 05185C 7F01CD2C 00001025 */ move $v0, $zero -/* 051860 7F01CD30 01C03025 */ move $a2, $t6 -/* 051864 7F01CD34 93AA003B */ lbu $t2, 0x3b($sp) -.L7F01CD38: -/* 051868 7F01CD38 18C0005B */ blez $a2, .L7F01CEA8 -/* 05186C 7F01CD3C 00002825 */ move $a1, $zero -/* 051870 7F01CD40 00460019 */ multu $v0, $a2 -/* 051874 7F01CD44 01405825 */ move $t3, $t2 -/* 051878 7F01CD48 004A6023 */ subu $t4, $v0, $t2 -/* 05187C 7F01CD4C 2470FFFF */ addiu $s0, $v1, -1 -/* 051880 7F01CD50 004A8821 */ addu $s1, $v0, $t2 -/* 051884 7F01CD54 0000F012 */ mflo $fp -/* 051888 7F01CD58 00000000 */ nop -/* 05188C 7F01CD5C 00000000 */ nop -/* 051890 7F01CD60 00004025 */ move $t0, $zero -.L7F01CD64: -/* 051894 7F01CD64 05810003 */ bgez $t4, .L7F01CD74 -/* 051898 7F01CD68 00004825 */ move $t1, $zero -/* 05189C 7F01CD6C 10000004 */ b .L7F01CD80 -/* 0518A0 7F01CD70 00006825 */ move $t5, $zero -.L7F01CD74: -/* 0518A4 7F01CD74 000C6C00 */ sll $t5, $t4, 0x10 -/* 0518A8 7F01CD78 000DC403 */ sra $t8, $t5, 0x10 -/* 0518AC 7F01CD7C 03006825 */ move $t5, $t8 -.L7F01CD80: -/* 0518B0 7F01CD80 0211082A */ slt $at, $s0, $s1 -/* 0518B4 7F01CD84 10200003 */ beqz $at, .L7F01CD94 -/* 0518B8 7F01CD88 02209025 */ move $s2, $s1 -/* 0518BC 7F01CD8C 10000001 */ b .L7F01CD94 -/* 0518C0 7F01CD90 02009025 */ move $s2, $s0 -.L7F01CD94: -/* 0518C4 7F01CD94 024D082A */ slt $at, $s2, $t5 -/* 0518C8 7F01CD98 54200033 */ bnezl $at, .L7F01CE68 -/* 0518CC 7F01CD9C 0008C842 */ srl $t9, $t0, 1 -/* 0518D0 7F01CDA0 00AB9823 */ subu $s3, $a1, $t3 -/* 0518D4 7F01CDA4 24D5FFFF */ addiu $s5, $a2, -1 -/* 0518D8 7F01CDA8 00ABB021 */ addu $s6, $a1, $t3 -.L7F01CDAC: -/* 0518DC 7F01CDAC 06610003 */ bgez $s3, .L7F01CDBC -/* 0518E0 7F01CDB0 02B6082A */ slt $at, $s5, $s6 -/* 0518E4 7F01CDB4 10000004 */ b .L7F01CDC8 -/* 0518E8 7F01CDB8 0000A025 */ move $s4, $zero -.L7F01CDBC: -/* 0518EC 7F01CDBC 0013A400 */ sll $s4, $s3, 0x10 -/* 0518F0 7F01CDC0 0014CC03 */ sra $t9, $s4, 0x10 -/* 0518F4 7F01CDC4 0320A025 */ move $s4, $t9 -.L7F01CDC8: -/* 0518F8 7F01CDC8 10200003 */ beqz $at, .L7F01CDD8 -/* 0518FC 7F01CDCC 02C09025 */ move $s2, $s6 -/* 051900 7F01CDD0 10000001 */ b .L7F01CDD8 -/* 051904 7F01CDD4 02A09025 */ move $s2, $s5 -.L7F01CDD8: -/* 051908 7F01CDD8 0254082A */ slt $at, $s2, $s4 -/* 05190C 7F01CDDC 54200016 */ bnezl $at, .L7F01CE38 -/* 051910 7F01CDE0 25AD0001 */ addiu $t5, $t5, 1 -/* 051914 7F01CDE4 01A60019 */ multu $t5, $a2 -/* 051918 7F01CDE8 0000B812 */ mflo $s7 -/* 05191C 7F01CDEC 00000000 */ nop -/* 051920 7F01CDF0 00000000 */ nop -/* 051924 7F01CDF4 00947021 */ addu $t6, $a0, $s4 -.L7F01CDF8: -/* 051928 7F01CDF8 01D77821 */ addu $t7, $t6, $s7 -/* 05192C 7F01CDFC 91F80000 */ lbu $t8, ($t7) -/* 051930 7F01CE00 26940001 */ addiu $s4, $s4, 1 -/* 051934 7F01CE04 0014CC00 */ sll $t9, $s4, 0x10 -/* 051938 7F01CE08 02B6082A */ slt $at, $s5, $s6 -/* 05193C 7F01CE0C 0019A403 */ sra $s4, $t9, 0x10 -/* 051940 7F01CE10 25080001 */ addiu $t0, $t0, 1 -/* 051944 7F01CE14 10200003 */ beqz $at, .L7F01CE24 -/* 051948 7F01CE18 01384821 */ addu $t1, $t1, $t8 -/* 05194C 7F01CE1C 10000002 */ b .L7F01CE28 -/* 051950 7F01CE20 02A09025 */ move $s2, $s5 -.L7F01CE24: -/* 051954 7F01CE24 02C09025 */ move $s2, $s6 -.L7F01CE28: -/* 051958 7F01CE28 0254082A */ slt $at, $s2, $s4 -/* 05195C 7F01CE2C 5020FFF2 */ beql $at, $zero, .L7F01CDF8 -/* 051960 7F01CE30 00947021 */ addu $t6, $a0, $s4 -/* 051964 7F01CE34 25AD0001 */ addiu $t5, $t5, 1 -.L7F01CE38: -/* 051968 7F01CE38 000D7C00 */ sll $t7, $t5, 0x10 -/* 05196C 7F01CE3C 000FC403 */ sra $t8, $t7, 0x10 -/* 051970 7F01CE40 0211082A */ slt $at, $s0, $s1 -/* 051974 7F01CE44 10200003 */ beqz $at, .L7F01CE54 -/* 051978 7F01CE48 03006825 */ move $t5, $t8 -/* 05197C 7F01CE4C 10000002 */ b .L7F01CE58 -/* 051980 7F01CE50 02009025 */ move $s2, $s0 -.L7F01CE54: -/* 051984 7F01CE54 02209025 */ move $s2, $s1 -.L7F01CE58: -/* 051988 7F01CE58 024D082A */ slt $at, $s2, $t5 -/* 05198C 7F01CE5C 1020FFD3 */ beqz $at, .L7F01CDAC -/* 051990 7F01CE60 00000000 */ nop -/* 051994 7F01CE64 0008C842 */ srl $t9, $t0, 1 -.L7F01CE68: -/* 051998 7F01CE68 03297021 */ addu $t6, $t9, $t1 -/* 05199C 7F01CE6C 01C8001B */ divu $zero, $t6, $t0 -/* 0519A0 7F01CE70 00E5C021 */ addu $t8, $a3, $a1 -/* 0519A4 7F01CE74 24A50001 */ addiu $a1, $a1, 1 -/* 0519A8 7F01CE78 00057400 */ sll $t6, $a1, 0x10 -/* 0519AC 7F01CE7C 031EC821 */ addu $t9, $t8, $fp -/* 0519B0 7F01CE80 000EC403 */ sra $t8, $t6, 0x10 -/* 0519B4 7F01CE84 0306082A */ slt $at, $t8, $a2 -/* 0519B8 7F01CE88 00007812 */ mflo $t7 -/* 0519BC 7F01CE8C 03002825 */ move $a1, $t8 -/* 0519C0 7F01CE90 15000002 */ bnez $t0, .L7F01CE9C -/* 0519C4 7F01CE94 00000000 */ nop -/* 0519C8 7F01CE98 0007000D */ break 7 -.L7F01CE9C: -/* 0519CC 7F01CE9C A32F0000 */ sb $t7, ($t9) -/* 0519D0 7F01CEA0 5420FFB0 */ bnezl $at, .L7F01CD64 -/* 0519D4 7F01CEA4 00004025 */ move $t0, $zero -.L7F01CEA8: -/* 0519D8 7F01CEA8 24420001 */ addiu $v0, $v0, 1 -/* 0519DC 7F01CEAC 00027C00 */ sll $t7, $v0, 0x10 -/* 0519E0 7F01CEB0 000F1403 */ sra $v0, $t7, 0x10 -/* 0519E4 7F01CEB4 0043082A */ slt $at, $v0, $v1 -/* 0519E8 7F01CEB8 1420FF9F */ bnez $at, .L7F01CD38 -/* 0519EC 7F01CEBC 00000000 */ nop -.L7F01CEC0: -/* 0519F0 7F01CEC0 8FB00004 */ lw $s0, 4($sp) -/* 0519F4 7F01CEC4 8FB10008 */ lw $s1, 8($sp) -/* 0519F8 7F01CEC8 8FB2000C */ lw $s2, 0xc($sp) -/* 0519FC 7F01CECC 8FB30010 */ lw $s3, 0x10($sp) -/* 051A00 7F01CED0 8FB40014 */ lw $s4, 0x14($sp) -/* 051A04 7F01CED4 8FB50018 */ lw $s5, 0x18($sp) -/* 051A08 7F01CED8 8FB6001C */ lw $s6, 0x1c($sp) -/* 051A0C 7F01CEDC 8FB70020 */ lw $s7, 0x20($sp) -/* 051A10 7F01CEE0 8FBE0024 */ lw $fp, 0x24($sp) -/* 051A14 7F01CEE4 03E00008 */ jr $ra -/* 051A18 7F01CEE8 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif -#ifdef NONMATCHING -void sub_GAME_7F01CEEC(u8*, s32, u8*) { +// Averages 4 pixel data, ending on "second" row. +// Address 0x7F01CEEC NTSC +void sub_GAME_7F01CEEC(u8 *arg0, s32 arg1, u8 *arg2) +{ + s32 i; + s32 j; + + arg0 += 0x61; + arg2 += 0x61; + for (i = 1; i < arg1 - 1; i++, arg2 += 2, arg0 += 2) { + for (j = 1; j < 0x5f; j++, arg2++, arg0++) { + *arg2 = (arg0[-1] + arg0[0] + arg0[-0x61] + arg0[-0x60] + 2) >> 2; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01CEEC -/* 051A1C 7F01CEEC 24A3FFFF */ addiu $v1, $a1, -1 -/* 051A20 7F01CEF0 28610002 */ slti $at, $v1, 2 -/* 051A24 7F01CEF4 24840061 */ addiu $a0, $a0, 0x61 -/* 051A28 7F01CEF8 24C60061 */ addiu $a2, $a2, 0x61 -/* 051A2C 7F01CEFC 14200049 */ bnez $at, .L7F01D024 -/* 051A30 7F01CF00 24020001 */ li $v0, 1 -/* 051A34 7F01CF04 2407005F */ li $a3, 95 -.L7F01CF08: -/* 051A38 7F01CF08 908EFFA0 */ lbu $t6, -0x60($a0) -/* 051A3C 7F01CF0C 908FFFFF */ lbu $t7, -1($a0) -/* 051A40 7F01CF10 90990000 */ lbu $t9, ($a0) -/* 051A44 7F01CF14 9089FF9F */ lbu $t1, -0x61($a0) -/* 051A48 7F01CF18 01CFC021 */ addu $t8, $t6, $t7 -/* 051A4C 7F01CF1C 03194021 */ addu $t0, $t8, $t9 -/* 051A50 7F01CF20 01095021 */ addu $t2, $t0, $t1 -/* 051A54 7F01CF24 254B0002 */ addiu $t3, $t2, 2 -/* 051A58 7F01CF28 000B6083 */ sra $t4, $t3, 2 -/* 051A5C 7F01CF2C A0CC0000 */ sb $t4, ($a2) -/* 051A60 7F01CF30 908E0000 */ lbu $t6, ($a0) -/* 051A64 7F01CF34 908DFFA1 */ lbu $t5, -0x5f($a0) -/* 051A68 7F01CF38 90980001 */ lbu $t8, 1($a0) -/* 051A6C 7F01CF3C 9088FFA0 */ lbu $t0, -0x60($a0) -/* 051A70 7F01CF40 01AE7821 */ addu $t7, $t5, $t6 -/* 051A74 7F01CF44 01F8C821 */ addu $t9, $t7, $t8 -/* 051A78 7F01CF48 03284821 */ addu $t1, $t9, $t0 -/* 051A7C 7F01CF4C 252A0002 */ addiu $t2, $t1, 2 -/* 051A80 7F01CF50 000A5883 */ sra $t3, $t2, 2 -/* 051A84 7F01CF54 A0CB0001 */ sb $t3, 1($a2) -/* 051A88 7F01CF58 24050003 */ li $a1, 3 -/* 051A8C 7F01CF5C 24C60002 */ addiu $a2, $a2, 2 -/* 051A90 7F01CF60 24840002 */ addiu $a0, $a0, 2 -.L7F01CF64: -/* 051A94 7F01CF64 908CFFA0 */ lbu $t4, -0x60($a0) -/* 051A98 7F01CF68 908DFFFF */ lbu $t5, -1($a0) -/* 051A9C 7F01CF6C 908F0000 */ lbu $t7, ($a0) -/* 051AA0 7F01CF70 9099FF9F */ lbu $t9, -0x61($a0) -/* 051AA4 7F01CF74 018D7021 */ addu $t6, $t4, $t5 -/* 051AA8 7F01CF78 01CFC021 */ addu $t8, $t6, $t7 -/* 051AAC 7F01CF7C 03194021 */ addu $t0, $t8, $t9 -/* 051AB0 7F01CF80 25090002 */ addiu $t1, $t0, 2 -/* 051AB4 7F01CF84 00095083 */ sra $t2, $t1, 2 -/* 051AB8 7F01CF88 A0CA0000 */ sb $t2, ($a2) -/* 051ABC 7F01CF8C 908BFFA1 */ lbu $t3, -0x5f($a0) -/* 051AC0 7F01CF90 908C0000 */ lbu $t4, ($a0) -/* 051AC4 7F01CF94 908E0001 */ lbu $t6, 1($a0) -/* 051AC8 7F01CF98 9098FFA0 */ lbu $t8, -0x60($a0) -/* 051ACC 7F01CF9C 016C6821 */ addu $t5, $t3, $t4 -/* 051AD0 7F01CFA0 01AE7821 */ addu $t7, $t5, $t6 -/* 051AD4 7F01CFA4 01F8C821 */ addu $t9, $t7, $t8 -/* 051AD8 7F01CFA8 27280002 */ addiu $t0, $t9, 2 -/* 051ADC 7F01CFAC 00084883 */ sra $t1, $t0, 2 -/* 051AE0 7F01CFB0 A0C90001 */ sb $t1, 1($a2) -/* 051AE4 7F01CFB4 908AFFA2 */ lbu $t2, -0x5e($a0) -/* 051AE8 7F01CFB8 908B0001 */ lbu $t3, 1($a0) -/* 051AEC 7F01CFBC 908D0002 */ lbu $t5, 2($a0) -/* 051AF0 7F01CFC0 908FFFA1 */ lbu $t7, -0x5f($a0) -/* 051AF4 7F01CFC4 014B6021 */ addu $t4, $t2, $t3 -/* 051AF8 7F01CFC8 018D7021 */ addu $t6, $t4, $t5 -/* 051AFC 7F01CFCC 01CFC021 */ addu $t8, $t6, $t7 -/* 051B00 7F01CFD0 27190002 */ addiu $t9, $t8, 2 -/* 051B04 7F01CFD4 00194083 */ sra $t0, $t9, 2 -/* 051B08 7F01CFD8 A0C80002 */ sb $t0, 2($a2) -/* 051B0C 7F01CFDC 908A0002 */ lbu $t2, 2($a0) -/* 051B10 7F01CFE0 9089FFA3 */ lbu $t1, -0x5d($a0) -/* 051B14 7F01CFE4 908C0003 */ lbu $t4, 3($a0) -/* 051B18 7F01CFE8 908EFFA2 */ lbu $t6, -0x5e($a0) -/* 051B1C 7F01CFEC 012A5821 */ addu $t3, $t1, $t2 -/* 051B20 7F01CFF0 016C6821 */ addu $t5, $t3, $t4 -/* 051B24 7F01CFF4 01AE7821 */ addu $t7, $t5, $t6 -/* 051B28 7F01CFF8 25F80002 */ addiu $t8, $t7, 2 -/* 051B2C 7F01CFFC 0018C883 */ sra $t9, $t8, 2 -/* 051B30 7F01D000 24A50004 */ addiu $a1, $a1, 4 -/* 051B34 7F01D004 A0D90003 */ sb $t9, 3($a2) -/* 051B38 7F01D008 24C60004 */ addiu $a2, $a2, 4 -/* 051B3C 7F01D00C 14A7FFD5 */ bne $a1, $a3, .L7F01CF64 -/* 051B40 7F01D010 24840004 */ addiu $a0, $a0, 4 -/* 051B44 7F01D014 24420001 */ addiu $v0, $v0, 1 -/* 051B48 7F01D018 24C60002 */ addiu $a2, $a2, 2 -/* 051B4C 7F01D01C 1443FFBA */ bne $v0, $v1, .L7F01CF08 -/* 051B50 7F01D020 24840002 */ addiu $a0, $a0, 2 -.L7F01D024: -/* 051B54 7F01D024 03E00008 */ jr $ra -/* 051B58 7F01D028 00000000 */ nop -) -#endif -#ifdef NONMATCHING -void sub_GAME_7F01D02C(u8*, s32, u8*) { +// Averages 4 pixel data, ending on "first" row. +// Address 0x7F01D02C NTSC +void sub_GAME_7F01D02C(u8 *arg0, s32 arg1, u8 *arg2) +{ + s32 i; + s32 j; + + arg0 += 0x61; + arg2 += 0x61; + for (i = 1; i < arg1 - 1; i++, arg2 += 2, arg0 += 2) { + for (j = 1; j < 0x5f; j++, arg2++, arg0++) { + *arg2 = (arg0[1] + arg0[0] + arg0[0x61] + arg0[0x60] + 2) >> 2; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01D02C -/* 051B5C 7F01D02C 24A3FFFF */ addiu $v1, $a1, -1 -/* 051B60 7F01D030 28610002 */ slti $at, $v1, 2 -/* 051B64 7F01D034 24840061 */ addiu $a0, $a0, 0x61 -/* 051B68 7F01D038 24C60061 */ addiu $a2, $a2, 0x61 -/* 051B6C 7F01D03C 14200049 */ bnez $at, .L7F01D164 -/* 051B70 7F01D040 24020001 */ li $v0, 1 -/* 051B74 7F01D044 2407005F */ li $a3, 95 -.L7F01D048: -/* 051B78 7F01D048 908E0060 */ lbu $t6, 0x60($a0) -/* 051B7C 7F01D04C 908F0001 */ lbu $t7, 1($a0) -/* 051B80 7F01D050 90990000 */ lbu $t9, ($a0) -/* 051B84 7F01D054 90890061 */ lbu $t1, 0x61($a0) -/* 051B88 7F01D058 01CFC021 */ addu $t8, $t6, $t7 -/* 051B8C 7F01D05C 03194021 */ addu $t0, $t8, $t9 -/* 051B90 7F01D060 01095021 */ addu $t2, $t0, $t1 -/* 051B94 7F01D064 254B0002 */ addiu $t3, $t2, 2 -/* 051B98 7F01D068 000B6083 */ sra $t4, $t3, 2 -/* 051B9C 7F01D06C A0CC0000 */ sb $t4, ($a2) -/* 051BA0 7F01D070 908E0002 */ lbu $t6, 2($a0) -/* 051BA4 7F01D074 908D0061 */ lbu $t5, 0x61($a0) -/* 051BA8 7F01D078 90980001 */ lbu $t8, 1($a0) -/* 051BAC 7F01D07C 90880062 */ lbu $t0, 0x62($a0) -/* 051BB0 7F01D080 01AE7821 */ addu $t7, $t5, $t6 -/* 051BB4 7F01D084 01F8C821 */ addu $t9, $t7, $t8 -/* 051BB8 7F01D088 03284821 */ addu $t1, $t9, $t0 -/* 051BBC 7F01D08C 252A0002 */ addiu $t2, $t1, 2 -/* 051BC0 7F01D090 000A5883 */ sra $t3, $t2, 2 -/* 051BC4 7F01D094 A0CB0001 */ sb $t3, 1($a2) -/* 051BC8 7F01D098 24050003 */ li $a1, 3 -/* 051BCC 7F01D09C 24C60002 */ addiu $a2, $a2, 2 -/* 051BD0 7F01D0A0 24840002 */ addiu $a0, $a0, 2 -.L7F01D0A4: -/* 051BD4 7F01D0A4 908C0060 */ lbu $t4, 0x60($a0) -/* 051BD8 7F01D0A8 908D0001 */ lbu $t5, 1($a0) -/* 051BDC 7F01D0AC 908F0000 */ lbu $t7, ($a0) -/* 051BE0 7F01D0B0 90990061 */ lbu $t9, 0x61($a0) -/* 051BE4 7F01D0B4 018D7021 */ addu $t6, $t4, $t5 -/* 051BE8 7F01D0B8 01CFC021 */ addu $t8, $t6, $t7 -/* 051BEC 7F01D0BC 03194021 */ addu $t0, $t8, $t9 -/* 051BF0 7F01D0C0 25090002 */ addiu $t1, $t0, 2 -/* 051BF4 7F01D0C4 00095083 */ sra $t2, $t1, 2 -/* 051BF8 7F01D0C8 A0CA0000 */ sb $t2, ($a2) -/* 051BFC 7F01D0CC 908C0002 */ lbu $t4, 2($a0) -/* 051C00 7F01D0D0 908B0061 */ lbu $t3, 0x61($a0) -/* 051C04 7F01D0D4 908E0001 */ lbu $t6, 1($a0) -/* 051C08 7F01D0D8 90980062 */ lbu $t8, 0x62($a0) -/* 051C0C 7F01D0DC 016C6821 */ addu $t5, $t3, $t4 -/* 051C10 7F01D0E0 01AE7821 */ addu $t7, $t5, $t6 -/* 051C14 7F01D0E4 01F8C821 */ addu $t9, $t7, $t8 -/* 051C18 7F01D0E8 27280002 */ addiu $t0, $t9, 2 -/* 051C1C 7F01D0EC 00084883 */ sra $t1, $t0, 2 -/* 051C20 7F01D0F0 A0C90001 */ sb $t1, 1($a2) -/* 051C24 7F01D0F4 908B0003 */ lbu $t3, 3($a0) -/* 051C28 7F01D0F8 908A0062 */ lbu $t2, 0x62($a0) -/* 051C2C 7F01D0FC 908D0002 */ lbu $t5, 2($a0) -/* 051C30 7F01D100 908F0063 */ lbu $t7, 0x63($a0) -/* 051C34 7F01D104 014B6021 */ addu $t4, $t2, $t3 -/* 051C38 7F01D108 018D7021 */ addu $t6, $t4, $t5 -/* 051C3C 7F01D10C 01CFC021 */ addu $t8, $t6, $t7 -/* 051C40 7F01D110 27190002 */ addiu $t9, $t8, 2 -/* 051C44 7F01D114 00194083 */ sra $t0, $t9, 2 -/* 051C48 7F01D118 A0C80002 */ sb $t0, 2($a2) -/* 051C4C 7F01D11C 908A0004 */ lbu $t2, 4($a0) -/* 051C50 7F01D120 90890063 */ lbu $t1, 0x63($a0) -/* 051C54 7F01D124 908C0003 */ lbu $t4, 3($a0) -/* 051C58 7F01D128 908E0064 */ lbu $t6, 0x64($a0) -/* 051C5C 7F01D12C 012A5821 */ addu $t3, $t1, $t2 -/* 051C60 7F01D130 016C6821 */ addu $t5, $t3, $t4 -/* 051C64 7F01D134 01AE7821 */ addu $t7, $t5, $t6 -/* 051C68 7F01D138 25F80002 */ addiu $t8, $t7, 2 -/* 051C6C 7F01D13C 0018C883 */ sra $t9, $t8, 2 -/* 051C70 7F01D140 24A50004 */ addiu $a1, $a1, 4 -/* 051C74 7F01D144 A0D90003 */ sb $t9, 3($a2) -/* 051C78 7F01D148 24C60004 */ addiu $a2, $a2, 4 -/* 051C7C 7F01D14C 14A7FFD5 */ bne $a1, $a3, .L7F01D0A4 -/* 051C80 7F01D150 24840004 */ addiu $a0, $a0, 4 -/* 051C84 7F01D154 24420001 */ addiu $v0, $v0, 1 -/* 051C88 7F01D158 24C60002 */ addiu $a2, $a2, 2 -/* 051C8C 7F01D15C 1443FFBA */ bne $v0, $v1, .L7F01D048 -/* 051C90 7F01D160 24840002 */ addiu $a0, $a0, 2 -.L7F01D164: -/* 051C94 7F01D164 03E00008 */ jr $ra -/* 051C98 7F01D168 00000000 */ nop -) -#endif +// Address 0x7F01D16C NTSC +void sub_GAME_7F01D16C(u8 *arg0, s32 arg1, s32 arg2, u8 *arg3) +{ + s32 temp_lo; + u32 temp_a0; + u32 var_t2; + u8 *var_t0; + u8 *var_v1; + u32 t1; + temp_lo = arg1 * arg2; + var_v1 = arg0; + var_t0 = arg3; + t1 = arg0 + temp_lo; + var_t2 = arg0 + arg1; -#ifdef NONMATCHING -void sub_GAME_7F01D16C(u8*, s32, s32, u8*) { + do + { + temp_a0 = var_t2; + + do + { + *var_t0 = *var_v1++; + var_t2 += 1; + var_t0 += arg2; + + } while ((u32) var_v1 < temp_a0); + var_t0 = (var_t0 - (temp_lo)) + 1; + + } while ((u32) var_v1 < (u32) t1); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01D16C -/* 051C9C 7F01D16C 00A60019 */ multu $a1, $a2 -/* 051CA0 7F01D170 00801825 */ move $v1, $a0 -/* 051CA4 7F01D174 00E04025 */ move $t0, $a3 -/* 051CA8 7F01D178 00855021 */ addu $t2, $a0, $a1 -/* 051CAC 7F01D17C 00001012 */ mflo $v0 -/* 051CB0 7F01D180 00824821 */ addu $t1, $a0, $v0 -/* 051CB4 7F01D184 00000000 */ nop -.L7F01D188: -/* 051CB8 7F01D188 01402025 */ move $a0, $t2 -.L7F01D18C: -/* 051CBC 7F01D18C 906E0000 */ lbu $t6, ($v1) -/* 051CC0 7F01D190 24630001 */ addiu $v1, $v1, 1 -/* 051CC4 7F01D194 0064082B */ sltu $at, $v1, $a0 -/* 051CC8 7F01D198 A10E0000 */ sb $t6, ($t0) -/* 051CCC 7F01D19C 254A0001 */ addiu $t2, $t2, 1 -/* 051CD0 7F01D1A0 1420FFFA */ bnez $at, .L7F01D18C -/* 051CD4 7F01D1A4 01064021 */ addu $t0, $t0, $a2 -/* 051CD8 7F01D1A8 01024023 */ subu $t0, $t0, $v0 -/* 051CDC 7F01D1AC 0069082B */ sltu $at, $v1, $t1 -/* 051CE0 7F01D1B0 1420FFF5 */ bnez $at, .L7F01D188 -/* 051CE4 7F01D1B4 25080001 */ addiu $t0, $t0, 1 -/* 051CE8 7F01D1B8 03E00008 */ jr $ra -/* 051CEC 7F01D1BC 00000000 */ nop -) -#endif #ifdef NONMATCHING -void sub_GAME_7F01D1C0(void) { +// Unreferenced. +// Address 0x7F01D1C0 NTSC. +u8 *sub_GAME_7F01D1C0(u8 *arg0, s32 arg1, s32 arg2, u8 *arg3) +{ + // mips2c output makes this look like `decrypt_bleeding_animation_data`, but without + // u8 variables, and without arg4. But I can't get it to generate anything + // close to matching. + // https://decomp.me/scratch/ptG72 0% } #else GLOBAL_ASM( diff --git a/src/game/blood_decrypt.h b/src/game/blood_decrypt.h index faa5b77e..8322fcfe 100644 --- a/src/game/blood_decrypt.h +++ b/src/game/blood_decrypt.h @@ -3,7 +3,8 @@ #include -u8 *decrypt_bleeding_animation_data(u8*, s32, s32, u8*, s8*); +u8 *decrypt_bleeding_animation_data(u8 *arg0, u8 arg1, u8 arg2, u8 *arg3, u8 *arg4); + void sub_GAME_7F01D16C(u8*, s32, s32, u8*); void sub_GAME_7F01D02C(u8*, s32, u8*); void sub_GAME_7F01CEEC(u8*, s32, u8*); diff --git a/src/game/bondhead.c b/src/game/bondhead.c index e6616dcd..34eb0ade 100644 --- a/src/game/bondhead.c +++ b/src/game/bondhead.c @@ -72,20 +72,20 @@ void bheadUpdateIdleRoll() { f32 mult = 1.0f / UINT_MAX; - g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt][0] = ((f32)randomGetNext() * mult - 0.5f) * 0.02f; - g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt][2] = 1; - g_CurrentPlayer->standup[g_CurrentPlayer->standcnt][0] = ((f32)randomGetNext() * mult - 0.5f) * 0.02f; - g_CurrentPlayer->standup[g_CurrentPlayer->standcnt][1] = 1; + g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt].f[0] = ((f32)randomGetNext() * mult - 0.5f) * 0.02f; + g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt].f[2] = 1; + g_CurrentPlayer->standup[g_CurrentPlayer->standcnt].f[0] = ((f32)randomGetNext() * mult - 0.5f) * 0.02f; + g_CurrentPlayer->standup[g_CurrentPlayer->standcnt].f[1] = 1; if (g_CurrentPlayer->standcnt) { - g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt][1] = (f32)randomGetNext() * mult * 0.01f; - g_CurrentPlayer->standup[g_CurrentPlayer->standcnt][2] = (f32)randomGetNext() * mult * -0.01f; + g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt].f[1] = (f32)randomGetNext() * mult * 0.01f; + g_CurrentPlayer->standup[g_CurrentPlayer->standcnt].f[2] = (f32)randomGetNext() * mult * -0.01f; } else { - g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt][1] = (f32)randomGetNext() * mult * -0.01f; - g_CurrentPlayer->standup[g_CurrentPlayer->standcnt][2] = (f32)randomGetNext() * mult * 0.01f; + g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt].f[1] = (f32)randomGetNext() * mult * -0.01f; + g_CurrentPlayer->standup[g_CurrentPlayer->standcnt].f[2] = (f32)randomGetNext() * mult * 0.01f; } g_CurrentPlayer->standcnt = 1 - g_CurrentPlayer->standcnt; @@ -102,23 +102,23 @@ void bheadUpdatePos(coord3d *vel) if (g_CurrentPlayer->resetheadpos) { - g_CurrentPlayer->headpossum[0] = 0.0f; - g_CurrentPlayer->headpossum[1] = (vel->f[1] / (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); - g_CurrentPlayer->headpossum[2] = 0.0f; + g_CurrentPlayer->headpossum.f[0] = 0.0f; + g_CurrentPlayer->headpossum.f[1] = (vel->f[1] / (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); + g_CurrentPlayer->headpossum.f[2] = 0.0f; g_CurrentPlayer->resetheadpos = FALSE; } for (i = 0; i < g_ClockTimer; i++) { - g_CurrentPlayer->headpossum[0] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum[0]) + vel->f[0]); - g_CurrentPlayer->headpossum[1] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum[1]) + vel->f[1]); - g_CurrentPlayer->headpossum[2] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum[2]) + vel->f[2]); + g_CurrentPlayer->headpossum.f[0] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum.f[0]) + vel->f[0]); + g_CurrentPlayer->headpossum.f[1] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum.f[1]) + vel->f[1]); + g_CurrentPlayer->headpossum.f[2] = ((CURRENTPLAYERUPDATEHEADPOS_SCALE * g_CurrentPlayer->headpossum.f[2]) + vel->f[2]); } - g_CurrentPlayer->headpos[0] = (g_CurrentPlayer->headpossum[0] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); - g_CurrentPlayer->headpos[1] = (g_CurrentPlayer->headpossum[1] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); - g_CurrentPlayer->headpos[2] = (g_CurrentPlayer->headpossum[2] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); + g_CurrentPlayer->headpos.f[0] = (g_CurrentPlayer->headpossum.f[0] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); + g_CurrentPlayer->headpos.f[1] = (g_CurrentPlayer->headpossum.f[1] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); + g_CurrentPlayer->headpos.f[2] = (g_CurrentPlayer->headpossum.f[2] * (1.0f - CURRENTPLAYERUPDATEHEADPOS_SCALE)); #undef CURRENTPLAYERUPDATEHEADPOS_SCALE } @@ -128,32 +128,35 @@ void bheadUpdateRot(coord3d *lookvel, coord3d *upvel) if (g_CurrentPlayer->resetheadrot) { - g_CurrentPlayer->headlooksum[0] = lookvel->f[0] / (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headlooksum[1] = lookvel->f[1] / (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headlooksum[2] = lookvel->f[2] / (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headupsum[0] = upvel->f[0] / (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headupsum[1] = upvel->f[1] / (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headupsum[2] = upvel->f[2] / (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlooksum.f[0] = lookvel->f[0] / (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlooksum.f[1] = lookvel->f[1] / (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlooksum.f[2] = lookvel->f[2] / (1.0f - g_CurrentPlayer->headdamp); + + g_CurrentPlayer->headupsum.f[0] = upvel->f[0] / (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headupsum.f[1] = upvel->f[1] / (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headupsum.f[2] = upvel->f[2] / (1.0f - g_CurrentPlayer->headdamp); g_CurrentPlayer->resetheadrot = FALSE; } for (i = 0; i < g_ClockTimer; i++) { - g_CurrentPlayer->headlooksum[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum[0] + lookvel->f[0]; - g_CurrentPlayer->headlooksum[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum[1] + lookvel->f[1]; - g_CurrentPlayer->headlooksum[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum[2] + lookvel->f[2]; - g_CurrentPlayer->headupsum[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum[0] + upvel->f[0]; - g_CurrentPlayer->headupsum[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum[1] + upvel->f[1]; - g_CurrentPlayer->headupsum[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum[2] + upvel->f[2]; + g_CurrentPlayer->headlooksum.f[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[0] + lookvel->f[0]; + g_CurrentPlayer->headlooksum.f[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[1] + lookvel->f[1]; + g_CurrentPlayer->headlooksum.f[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headlooksum.f[2] + lookvel->f[2]; + + g_CurrentPlayer->headupsum.f[0] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[0] + upvel->f[0]; + g_CurrentPlayer->headupsum.f[1] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[1] + upvel->f[1]; + g_CurrentPlayer->headupsum.f[2] = g_CurrentPlayer->headdamp * g_CurrentPlayer->headupsum.f[2] + upvel->f[2]; } - g_CurrentPlayer->headlook[0] = g_CurrentPlayer->headlooksum[0] * (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headlook[1] = g_CurrentPlayer->headlooksum[1] * (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headlook[2] = g_CurrentPlayer->headlooksum[2] * (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headup[0] = g_CurrentPlayer->headupsum[0] * (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headup[1] = g_CurrentPlayer->headupsum[1] * (1.0f - g_CurrentPlayer->headdamp); - g_CurrentPlayer->headup[2] = g_CurrentPlayer->headupsum[2] * (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlook.f[0] = g_CurrentPlayer->headlooksum.f[0] * (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlook.f[1] = g_CurrentPlayer->headlooksum.f[1] * (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headlook.f[2] = g_CurrentPlayer->headlooksum.f[2] * (1.0f - g_CurrentPlayer->headdamp); + + g_CurrentPlayer->headup.f[0] = g_CurrentPlayer->headupsum.f[0] * (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headup.f[1] = g_CurrentPlayer->headupsum.f[1] * (1.0f - g_CurrentPlayer->headdamp); + g_CurrentPlayer->headup.f[2] = g_CurrentPlayer->headupsum.f[2] * (1.0f - g_CurrentPlayer->headdamp); } void bheadSetdamp(f32 headdamp) @@ -161,22 +164,25 @@ void bheadSetdamp(f32 headdamp) if (headdamp != g_CurrentPlayer->headdamp) { f32 divisor = 1.0f - headdamp; - g_CurrentPlayer->headlooksum[0] = (g_CurrentPlayer->headlooksum[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headlooksum[1] = (g_CurrentPlayer->headlooksum[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headlooksum[2] = (g_CurrentPlayer->headlooksum[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headupsum[0] = (g_CurrentPlayer->headupsum[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headupsum[1] = (g_CurrentPlayer->headupsum[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headupsum[2] = (g_CurrentPlayer->headupsum[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; - g_CurrentPlayer->headdamp = headdamp; + + g_CurrentPlayer->headlooksum.f[0] = (g_CurrentPlayer->headlooksum.f[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + g_CurrentPlayer->headlooksum.f[1] = (g_CurrentPlayer->headlooksum.f[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + g_CurrentPlayer->headlooksum.f[2] = (g_CurrentPlayer->headlooksum.f[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + + g_CurrentPlayer->headupsum.f[0] = (g_CurrentPlayer->headupsum.f[0] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + g_CurrentPlayer->headupsum.f[1] = (g_CurrentPlayer->headupsum.f[1] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + g_CurrentPlayer->headupsum.f[2] = (g_CurrentPlayer->headupsum.f[2] * (1.0f - g_CurrentPlayer->headdamp)) / divisor; + + g_CurrentPlayer->headdamp = headdamp; } } -void bheadUpdate(f32 arg0, f32 arg1) +void bheadUpdate(f32 percent_speed, f32 speedsideways) { coord3d headpos; coord3d lookvel; coord3d upvel; - f32 spC0; + f32 abs_anim_speed; struct unk_joint_list sp80; Mtxf sp40; coord3d sp34; @@ -186,17 +192,17 @@ void bheadUpdate(f32 arg0, f32 arg1) lookvel = D_80036B0C; upvel = D_80036B18; - spC0 = modelGetAbsAnimSpeed(&g_CurrentPlayer->model); + abs_anim_speed = modelGetAbsAnimSpeed(&g_CurrentPlayer->model); if (g_CurrentPlayer->headanim == 0) { - if (spC0 > 0.7f) + if (abs_anim_speed > 0.7f) { g_CurrentPlayer->headamplitude = 1.0f; } - else if (spC0 > 0.1f) + else if (abs_anim_speed > 0.1f) { - g_CurrentPlayer->headamplitude = (((spC0 - 0.1f) * 0.6f) / 0.59999996f) + 0.4f; + g_CurrentPlayer->headamplitude = (((abs_anim_speed - 0.1f) * 0.6f) / 0.59999996f) + 0.4f; } else { @@ -217,16 +223,15 @@ void bheadUpdate(f32 arg0, f32 arg1) } sp80 = D_80036B24; - sp34 = D_80036B64; - sp30 = sub_GAME_7F0701E0(); + sp30 = modelIsAnimMergingEnabled(); g_CurrentPlayer->resetheadtick = 0; - sub_GAME_7F0701D4(0); - sub_GAME_7F070AEC(&g_CurrentPlayer->model, g_ClockTimer, 1); - sub_GAME_7F0701D4((s32) sp30); + modelSetAnimMergingEnabled(0); + modelTickAnimQuarterSpeed(&g_CurrentPlayer->model, g_ClockTimer, 1); + modelSetAnimMergingEnabled((s32) sp30); subcalcpos(&g_CurrentPlayer->model); matrix_4x4_set_identity(&sp40); @@ -236,9 +241,9 @@ void bheadUpdate(f32 arg0, f32 arg1) subcalcmatrices(&sp80, &g_CurrentPlayer->model); - g_CurrentPlayer->headbodyoffset[0] = g_CurrentPlayer->standbodyoffset.x; - g_CurrentPlayer->headbodyoffset[1] = g_CurrentPlayer->standbodyoffset.y; - g_CurrentPlayer->headbodyoffset[2] = g_CurrentPlayer->standbodyoffset.z; + g_CurrentPlayer->headbodyoffset.f[0] = g_CurrentPlayer->standbodyoffset.x; + g_CurrentPlayer->headbodyoffset.f[1] = g_CurrentPlayer->standbodyoffset.y; + g_CurrentPlayer->headbodyoffset.f[2] = g_CurrentPlayer->standbodyoffset.z; getsuboffset(&g_CurrentPlayer->model, (struct float3 *) &sp34); @@ -247,10 +252,10 @@ void bheadUpdate(f32 arg0, f32 arg1) setsuboffset(&g_CurrentPlayer->model, (coord3d *) &sp34); - if (spC0 > 0.0f) + if (abs_anim_speed > 0.0f) { - g_CurrentPlayer->bondheadmatrices[0].m[3][0] += arg1; - g_CurrentPlayer->bondheadmatrices[0].m[3][2] *= arg0; + g_CurrentPlayer->bondheadmatrices[0].m[3][0] += speedsideways; + g_CurrentPlayer->bondheadmatrices[0].m[3][2] *= percent_speed; if (g_ClockTimer > 0) { @@ -258,9 +263,9 @@ void bheadUpdate(f32 arg0, f32 arg1) g_CurrentPlayer->bondheadmatrices[0].m[3][2] /= g_GlobalTimerDelta; } - headpos.f[0] = g_CurrentPlayer->bondheadmatrices[0].m[3][0] * g_CurrentPlayer->headamplitude; + headpos.f[0] = g_CurrentPlayer->bondheadmatrices[0].m[3][0] * g_CurrentPlayer->headamplitude; headpos.f[1] = ((g_CurrentPlayer->bondheadmatrices[0].m[3][1] - g_CurrentPlayer->standheight) * g_CurrentPlayer->headamplitude) + g_CurrentPlayer->standheight; - headpos.f[2] = g_CurrentPlayer->bondheadmatrices[0].m[3][2] * g_CurrentPlayer->headamplitude; + headpos.f[2] = g_CurrentPlayer->bondheadmatrices[0].m[3][2] * g_CurrentPlayer->headamplitude; if (g_CurrentPlayer->headanim >= 0) { @@ -275,7 +280,7 @@ void bheadUpdate(f32 arg0, f32 arg1) g_CurrentPlayer->headwalkingtime60 += g_ClockTimer; #if defined(VERSION_EU) - if (g_CurrentPlayer->headwalkingtime60 >= 0x33) + if (g_CurrentPlayer->headwalkingtime60 > TICKS_PER_SECOND) { bheadSetdamp(0.916599988937f); } @@ -284,7 +289,7 @@ void bheadUpdate(f32 arg0, f32 arg1) bheadSetdamp(0.987999975681f); } #else - if (g_CurrentPlayer->headwalkingtime60 >= 0x3D) + if (g_CurrentPlayer->headwalkingtime60 > TICKS_PER_SECOND) { bheadSetdamp(0.93f); } @@ -309,9 +314,9 @@ void bheadUpdate(f32 arg0, f32 arg1) } else { - g_CurrentPlayer->headbodyoffset[0] = g_CurrentPlayer->standbodyoffset.x; - g_CurrentPlayer->headbodyoffset[1] = g_CurrentPlayer->standbodyoffset.y; - g_CurrentPlayer->headbodyoffset[2] = g_CurrentPlayer->standbodyoffset.z; + g_CurrentPlayer->headbodyoffset.f[0] = g_CurrentPlayer->standbodyoffset.x; + g_CurrentPlayer->headbodyoffset.f[1] = g_CurrentPlayer->standbodyoffset.y; + g_CurrentPlayer->headbodyoffset.f[2] = g_CurrentPlayer->standbodyoffset.z; headpos.f[0] = 0.0f; headpos.f[1] = g_CurrentPlayer->standheight; @@ -331,18 +336,22 @@ void bheadUpdate(f32 arg0, f32 arg1) g_CurrentPlayer->standfrac -= 1.0f; } + // result = x vector plus ((y - x vector) * scaler) + // lookvel = ... sub_GAME_7F05AE00( - &g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt][0], - &g_CurrentPlayer->standlook[1 - g_CurrentPlayer->standcnt][0], + &g_CurrentPlayer->standlook[g_CurrentPlayer->standcnt].f[0], + &g_CurrentPlayer->standlook[1 - g_CurrentPlayer->standcnt].f[0], g_CurrentPlayer->standfrac, &lookvel); lookvel.f[0] *= (1.0f + (5.0f * bondviewGetBondBreathing())); lookvel.f[1] *= (1.0f + (5.0f * bondviewGetBondBreathing())); + // result = x vector plus ((y - x vector) * scaler) + // upvel = ... sub_GAME_7F05AE00( - &g_CurrentPlayer->standup[g_CurrentPlayer->standcnt][0], - &g_CurrentPlayer->standup[1 - g_CurrentPlayer->standcnt][0], + &g_CurrentPlayer->standup[g_CurrentPlayer->standcnt].f[0], + &g_CurrentPlayer->standup[1 - g_CurrentPlayer->standcnt].f[0], g_CurrentPlayer->standfrac, &upvel); @@ -357,6 +366,8 @@ void bheadUpdate(f32 arg0, f32 arg1) /** + * Adjust Bond model based on speed (speedforwards). + * Toggle the currently selected headanim index. * Address 0x7F08E8BC. */ void bheadAdjustAnimation(f32 speed) @@ -435,6 +446,7 @@ void bheadSetSpeed(f32 speed) f32 bheadGetBreathingValue(void) { if (g_CurrentPlayer->headanim >= 0) { + // bondviewGetBondBreathing() * (1/80) + (1/240) f32 a = bondviewGetBondBreathing() * 0.012500001f + 0.004166667f; f32 b = modelGetAbsAnimSpeed(&g_CurrentPlayer->model); diff --git a/src/game/bondhead.h b/src/game/bondhead.h index 5d5b86fa..2209248f 100644 --- a/src/game/bondhead.h +++ b/src/game/bondhead.h @@ -20,7 +20,7 @@ s32 waypointFindRoute(waypoint *, waypoint *, waypoint ** arr, s32 arr_len); waypoint * sub_GAME_7F08FB90(waypoint *, waypoint *); void bheadFlipAnimation(); void bheadUpdateIdleRoll(); -void bheadUpdate(f32 arg0, f32 arg1); +void bheadUpdate(f32 percent_speed, f32 speedsideways); void bheadAdjustAnimation(f32 arg0); void bheadStartDeathAnimation(struct ModelAnimation *arg0, s32 arg1, f32 arg2, f32 arg3); void bheadSetSpeed(f32 arg0); diff --git a/src/game/bondinv.c b/src/game/bondinv.c index a900b94c..50dc00cb 100644 --- a/src/game/bondinv.c +++ b/src/game/bondinv.c @@ -274,7 +274,7 @@ int bondinvItemAvailableForHand(ITEM_IDS right, ITEM_IDS left) right < ITEM_BOMBCASE && right == left && getPlayerCount() == 1 && - bondwalkItemCheckBitflags(right, 0x100000)) + bondwalkItemCheckBitflags(right, WEAPONSTATBITFLAG_CAN_DUAL_WIELD)) { return TRUE; } @@ -289,7 +289,7 @@ int bondinvItemAvailableForHand(ITEM_IDS right, ITEM_IDS left) right < ITEM_BOMBCASE && right == left && getPlayerCount() == 1 && - bondwalkItemCheckBitflags(right, 0x100000) && + bondwalkItemCheckBitflags(right, WEAPONSTATBITFLAG_CAN_DUAL_WIELD) && (j_text_trigger == FALSE || (right != ITEM_KNIFE))) { return TRUE; @@ -561,7 +561,7 @@ void bondinvCycleForward(s32 *nextright, s32 *nextleft, s32 requireammo) { s32 candidate = *nextright; - if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(*nextright, 0x100000) && (*nextleft < *nextright) && (requireammo == FALSE || bondwalkItemHasAmmo(*nextright)) && (weapon1 != *nextright || *nextright < weapon2) + if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(*nextright, WEAPONSTATBITFLAG_CAN_DUAL_WIELD) && (*nextleft < *nextright) && (requireammo == FALSE || bondwalkItemHasAmmo(*nextright)) && (weapon1 != *nextright || *nextright < weapon2) #ifdef BUGFIX_R1 && (!j_text_trigger || *nextright != ITEM_KNIFE) #endif @@ -671,7 +671,7 @@ void bondinvCycleBackward(s32 *nextright, s32 *nextleft, s32 requireammo) { if (candidate == weapon1) { - if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(candidate, 0x100000) && (requireammo == FALSE || bondwalkItemHasAmmo(candidate)) && (candidate != *nextright || candidate < *nextleft) && (weapon2 < candidate) + if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(candidate, WEAPONSTATBITFLAG_CAN_DUAL_WIELD) && (requireammo == FALSE || bondwalkItemHasAmmo(candidate)) && (candidate != *nextright || candidate < *nextleft) && (weapon2 < candidate) #ifdef BUGFIX_R1 && (!j_text_trigger || candidate != ITEM_KNIFE) #endif @@ -690,7 +690,7 @@ void bondinvCycleBackward(s32 *nextright, s32 *nextleft, s32 requireammo) #endif ) { - if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(candidate, 0x100000) && (candidate != *nextright || candidate < *nextleft)) + if (getPlayerCount() == 1 && bondwalkItemCheckBitflags(candidate, WEAPONSTATBITFLAG_CAN_DUAL_WIELD) && (candidate != *nextright || candidate < *nextleft)) { weapon1 = candidate; weapon2 = candidate; @@ -1389,9 +1389,9 @@ u8 *bondinvGetActivatedTextObject(ObjectRecord *obj) { textoverride *override = bondinvGetTextbyObj(obj); - if (override && override->unk8) + if (override && override->pickuptext) { - return langGet(override->unk8); + return langGet(override->pickuptext); } return NULL; @@ -1401,9 +1401,9 @@ u8 *bondinvGetActivatedTextWeapon(ITEM_IDS weaponnum) { textoverride *override = bondinvGetTextbyWeaponID(weaponnum); - if (override && override->unk8) + if (override && override->pickuptext) { - return langGet(override->unk8); + return langGet(override->pickuptext); } return NULL; @@ -1415,7 +1415,7 @@ void bondinvIncrementHeldTime(s32 weapon1, s32 weapon2) s32 leastusedindex; s32 i; - if (!bondwalkItemCheckBitflags(weapon1, 0x20000)) + if (!bondwalkItemCheckBitflags(weapon1, WEAPONSTATBITFLAG_USE_HOLD_TIME)) { return; } @@ -1423,7 +1423,7 @@ void bondinvIncrementHeldTime(s32 weapon1, s32 weapon2) leastusedtime = 0x7fffffff; leastusedindex = 0; - if (!bondwalkItemCheckBitflags(weapon2, 0x20000)) + if (!bondwalkItemCheckBitflags(weapon2, WEAPONSTATBITFLAG_USE_HOLD_TIME)) { weapon2 = ITEM_UNARMED; } diff --git a/src/game/bondview.c b/src/game/bondview.c index 819367c5..e86bcae0 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -28,6 +28,7 @@ #include "math_atan2f.h" #include "matrixmath.h" #include "mp_music.h" +#include "mp_watch.h" #include "objecthandler.h" #include "player.h" #include "player_2.h" @@ -38,30 +39,35 @@ #include "unk_0C0A70.h" #include "unk_0BC530.h" #include "unk_0A1DA0.h" +#include "explosions.h" +#include "os_extension.h" +#include "unk_0B3200.h" #ifdef VERSION_EU -#define BONDVIEW_AUTOAIM_TIME 0x19 /* 25 */ + #define BONDVIEW_AUTOAIM_TIME 0x19 /* 25 */ -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_A 0x1a -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_B 0x19 -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_C 0x64 + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_A 0x1a + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_B 0x19 + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_C 0x64 -#define BONDVIEW_UPPER_TEXT_TIMER_A 0x33 -#define BONDVIEW_UPPER_TEXT_TIMER_B 0x32 -#define BONDVIEW_UPPER_TEXT_TIMER_C 0xc8 + #define BONDVIEW_UPPER_TEXT_TIMER_A 0x33 + #define BONDVIEW_UPPER_TEXT_TIMER_B 0x32 + #define BONDVIEW_UPPER_TEXT_TIMER_C 0xc8 + + #define EU_CAMERA_8003642C_ASPECT 1.19047617912f #else -#define BONDVIEW_AUTOAIM_TIME 0x1e /* 30 */ + #define BONDVIEW_AUTOAIM_TIME 0x1e /* 30 */ -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_A 0x1f -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_B 0x1e -#define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_C 0x78 + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_A 0x1f + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_B 0x1e + #define BONDVIEW_INTRO_CAMERA_BONDMESSCNT_C 0x78 -#define BONDVIEW_UPPER_TEXT_TIMER_A 0x3d -#define BONDVIEW_UPPER_TEXT_TIMER_B 0x3c -#define BONDVIEW_UPPER_TEXT_TIMER_C 0xf0 + #define BONDVIEW_UPPER_TEXT_TIMER_A 0x3d + #define BONDVIEW_UPPER_TEXT_TIMER_B 0x3c + #define BONDVIEW_UPPER_TEXT_TIMER_C 0xf0 #endif @@ -70,24 +76,79 @@ #if defined(VERSION_US) -#define BONDVIEW_2ND_FONTTABLE(_param) copy_2ndfonttable -#define BONDVIEW_1ST_FONTTABLE(_param) copy_1stfonttable + #define BONDVIEW_2ND_FONTTABLE(_param) copy_2ndfonttable + #define BONDVIEW_1ST_FONTTABLE(_param) copy_1stfonttable #elif defined(VERSION_JP) || defined(VERSION_EU) -#define BONDVIEW_2ND_FONTTABLE(_param) dword_CODE_bss_jp80079CEC[_param] -#define BONDVIEW_1ST_FONTTABLE(_param) dword_CODE_bss_jp80079Cd8[_param] + #define BONDVIEW_2ND_FONTTABLE(_param) dword_CODE_bss_jp80079CEC[_param] + #define BONDVIEW_1ST_FONTTABLE(_param) dword_CODE_bss_jp80079Cd8[_param] #endif #if defined(VERSION_US) || defined(VERSION_JP) -#define BONDVIEW_VIEW_TOP_OFFSET_1 0x0C -#define BONDVIEW_VIEW_TOP_OFFSET_2 0x28 -#define BONDVIEW_VIEW_TOP_OFFSET_3 0x10 + #define BONDVIEW_VIEW_TOP_OFFSET_1 0x0C + #define BONDVIEW_VIEW_TOP_OFFSET_2 0x28 + #define BONDVIEW_VIEW_TOP_OFFSET_3 0x10 #elif defined(VERSION_EU) -#define BONDVIEW_VIEW_TOP_OFFSET_1 0x16 -#define BONDVIEW_VIEW_TOP_OFFSET_2 0x32 -#define BONDVIEW_VIEW_TOP_OFFSET_3 0x14 + #define BONDVIEW_VIEW_TOP_OFFSET_1 0x16 + #define BONDVIEW_VIEW_TOP_OFFSET_2 0x32 + #define BONDVIEW_VIEW_TOP_OFFSET_3 0x14 +#endif + + +#if defined(VERSION_EU) + #define TANKUPDATEROTATION_SCALE 0.904799997807f + #define TANKTURRETVERTICALANGLERELATED_SCALE 0.928399980068f + #define TANK_UNKD0_SCALE 0.79960000515f + #define CHR_OBJ_ACCEL_SPEED_FACTOR 0.6f + #define CHR_OBJ_MAXSPEED 6.0f + #define MAX_SPEED_FACTOR 0.8f + #define TANK_DAMAGE_PENTALTY_TICKS 75 + + #define TANK_VERT_ANGLE_FACTOR 0.0716000199318f + #define TANK_VERT_ANGLE_RAD_FACTOR 0.0952f + + #define MAX_AIMLOCK_SPEED_DEFAULT 0.8344f + + #define THREE_SECOND_TICKS 150 + #define PLAYER_TICKEXPLODE_FACTOR 12 + + #define CLIPPING_CLOCK_FACTOR 0.765100002289f + #define CLIPPING_FIELD88_FACTOR 0.234899997711f + #define CLIPPING_FIELD8C_VALUE 12 + #define CLIPPING_FIELD90_VALUE -5.625f +#else + #define TANKUPDATEROTATION_SCALE 0.92f + #define TANKTURRETVERTICALANGLERELATED_SCALE 0.94f + #define TANK_UNKD0_SCALE 0.83f + #define CHR_OBJ_ACCEL_SPEED_FACTOR 0.5f + #define CHR_OBJ_MAXSPEED 5.0f + #define MAX_SPEED_FACTOR 0.8f + #define TANK_DAMAGE_PENTALTY_TICKS 90 + + #define TANK_VERT_ANGLE_FACTOR 0.0600000023842f + #define TANK_VERT_ANGLE_RAD_FACTOR 0.0799999833107f + #define MAX_AIMLOCK_SPEED_DEFAULT 0.86f + + #define THREE_SECOND_TICKS 180 + #define PLAYER_TICKEXPLODE_FACTOR 15 + + #define CLIPPING_CLOCK_FACTOR 0.8f + #define CLIPPING_FIELD88_FACTOR 0.19999999f + #define CLIPPING_FIELD8C_VALUE 15 + #define CLIPPING_FIELD90_VALUE -4.5f #endif +#define FULL_CROUCH_OFFSET -100.0f + +#define SPEED_REGULAR_MAX 1.0f +#define SPEED_RUN_MAX 1.25f +#define SPEED_TICK_ADJUST 0.01f +#define TANK_MAX_SPEED 15.0f + + +#define FLOAT_TEN_A 10.0f +#define FLOAT_TEN_B 10.00f + // bss coord3d flt_CODE_bss_80079940; @@ -108,21 +169,21 @@ f32 flt_CODE_bss_80079988; f32 flt_CODE_bss_8007998C; //CODE.bss:80079990 -vec3d flt_CODE_bss_80079990; +vec3d g_ForceBondMoveOffset; // //CODE.bss:80079994 // f32 flt_CODE_bss_80079994; // //CODE.bss:80079998 // f32 flt_CODE_bss_80079998; //CODE.bss:8007999C -s32 dword_CODE_bss_8007999C; +s32 g_SurroundBondWithExplosionsTicks; //CODE.bss:800799A0 -s32 dword_CODE_bss_800799A0; +s32 g_PlayerTickExplodeCreatePosition; //CODE.bss:800799A4 s32 dword_CODE_bss_800799A4; //CODE.bss:800799A8 -struct coord3d flt_CODE_bss_800799A8; +struct coord3d g_TankModelPositionOffset; //CODE.bss:800799B4 s32 g_TankEngineSfxVolume; @@ -167,14 +228,13 @@ f32 flt_CODE_bss_800799DC; s32 starting_right_weapon; //CODE.bss:800799E4 s32 starting_left_weapon; + //CODE.bss:800799E8 -f32 flt_CODE_bss_800799E8; -//CODE.bss:800799EC -f32 flt_CODE_bss_800799EC; -//CODE.bss:800799F0 -f32 flt_CODE_bss_800799F0; +struct coord3d flt_CODE_bss_800799E8; + //CODE.bss:800799F4 -s32 dword_CODE_bss_800799F4; +struct PropRecord* dword_CODE_bss_800799F4; + //CODE.bss:800799F8 PadRecord * dword_CODE_bss_800799F8; //CODE.bss:800799FC @@ -192,7 +252,7 @@ f32 flt_CODE_bss_80079A10; //CODE.bss:80079A14 s32 dword_CODE_bss_80079A14; //CODE.bss:80079A18 -s32 dword_CODE_bss_80079A18; +enum CAMERAMODE dword_CODE_bss_80079A18; //CODE.bss:80079A1C s32 dword_CODE_bss_80079A1C; //CODE.bss:80079A20 @@ -257,13 +317,13 @@ char dword_CODE_bss_80079EF6[0x3C]; #endif //CODE.bss:80079E04 -s32 flt_CODE_bss_80079E04; +f32 g_MpSwirlRotateSpeed; //CODE.bss:80079E08 -s32 flt_CODE_bss_80079E08; +f32 g_MpSwirlAngleDegrees; //CODE.bss:80079E0C -s32 flt_CODE_bss_80079E0C; +f32 g_MpSwirlForwardSpeed; //CODE.bss:80079E10 -s32 flt_CODE_bss_80079E10; +f32 g_MpSwirlDistance; // data @@ -292,25 +352,27 @@ s32 D_8003643C = 0; //D:80036440 CreditsEntry *D_80036440 = NULL; //D:80036444 -s32 D_80036444 = 0; +s32 g_SurroundBondWithExplosionsFlag = 0; //D:80036448 s32 in_tank_flag = 0; //D:8003644C -struct PropRecord * D_8003644C = NULL; +struct PropRecord *g_WorldTankProp = NULL; //D:80036450 -struct PropRecord *ptr_playerstank = NULL; +struct PropRecord *g_PlayerTankProp = NULL; /** - * Related to ptr_playerstank. + * Related to g_PlayerTankProp. * Address 0x80036454. */ f32 g_PlayerTankYOffset = 0; -//D:80036458 -ALSoundState * SFX_80036458[2] = { NULL, NULL }; +/** + * US address 80036458. +*/ +ALSoundState * g_TankSfxState[2] = { NULL, NULL }; /** * min -3.749999, max +3.749999 @@ -366,13 +428,13 @@ f32 g_TankTurretAngle = 0; f32 g_TankTurretTurn = 0; //D:8003648C -s32 D_8003648C = 0; +s32 g_ExplodeTankOnDeathFlag = 0; //D:80036490 -s32 D_80036490 = 0; +s32 g_TankDamagePenaltyTicks = 0; //D:80036494 -s32 g_CameraMode = CAMERAMODE_NONE; +enum CAMERAMODE g_CameraMode = CAMERAMODE_NONE; //D:80036498 -s32 enable_move_after_cinema = 0; +enum CAMERAMODE g_CameraAfterCinema = CAMERAMODE_NONE; //D:8003649C s32 D_8003649C = 0; //D:800364A0 @@ -437,7 +499,7 @@ s32 g_bondviewBondDeathAnimations[] = { s32 g_bondviewBondDeathAnimationsCount = 0; //D:80036510 -s32 D_80036510 = 0; +enum CAMERAMODE D_80036510 = CAMERAMODE_NONE; //D:80036514 s32 g_IntroAnimationIndex = 0; @@ -458,97 +520,95 @@ struct struct_4 stage_intro_anim_table[] = { f32 watch_transition_time = 0.90909088; //D:800365AC -u32 dummy_08_pp7_obj[] = { - 0x01000008, 0x00bf4000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x3f800000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x3f800000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x3f800000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x3f800000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x447a0000, 0xffffff00, 0xffffff00, - 0x04ffffff +WeaponObjRecord dummy_08_pp7_obj[] = { + 0x0100, + 0x00, + 0x08, + PROP_CHRWPPK, + 0x4000, + 0x00000000, + 0x00000000, + NULL, + NULL, + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, + {0.0f, 0.0f, 0.0f}, + {0x00000000}, + NULL, + NULL, + 0.0f, + 1000.0f, + {0xff, 0xff, 0xff, 0x00}, + 0xff, + 0xff, + 0xff, + 0x00, + ITEM_WPPK, + -1, + -1, + NULL }; -//D:80036630 -u32 D_80036630 = 0; //D:80036634 -bondstruct_unk_80036634 D_80036634[] = { - { 0x0, 10.0, 60.0, 0.600000023842, - 0x0, 5.0, 40.0, 1.0, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 60.0, 0.600000023842, - 0x0, 5.0, 40.0, 1.0, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 50.0, 0.600000023842, - 0x0, 5.0, 30.0, 0.800000011921, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 40.0, 0.600000023842, - 0x0, 5.0, 25.0, 0.600000023842, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 35.0, 0.600000023842, - 0x0, 5.0, 22.0, 0.550000011921, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 30.0, 0.600000023842, - 0x0, 5.0, 19.0, 0.5, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 30.0, 0.600000023842, - 0x0, 5.0, 17.0, 0.449999988079, - 0xFF, 0xFF, 0xFF}, - { 0x0, 10.0, 30.0, 0.600000023842, - 0x0, 5.0, 15.0, 0.40000000596, - 0xFF, 0xFF, 0xFF} +struct DamageType g_DamageTypes[] = { + { 0, 10.0, 60.0, 0.6, 0, 5.0, 40.0, 1.0, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 60.0, 0.6, 0, 5.0, 40.0, 1.0, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 50.0, 0.6, 0, 5.0, 30.0, 0.800000011921, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 40.0, 0.6, 0, 5.0, 25.0, 0.600000023842, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 35.0, 0.6, 0, 5.0, 22.0, 0.550000011921, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 30.0, 0.6, 0, 5.0, 19.0, 0.5, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 30.0, 0.6, 0, 5.0, 17.0, 0.449999988079, 0xFF, 0xFF, 0xFF}, + { 0, 10.0, 30.0, 0.6, 0, 5.0, 15.0, 0.40000000596, 0xFF, 0xFF, 0xFF} }; //D:80036794 -bondstruct_unk_80036794 D_80036794[8] = { - { 0x00000000, 0x00000028, 0x00000064 }, - { 0x00000000, 0x0000001E, 0x00000050 }, - { 0x00000000, 0x00000014, 0x0000003C }, - { 0x00000000, 0x00000014, 0x0000003C }, - { 0x00000000, 0x00000014, 0x0000003C }, - { 0x00000000, 0x00000014, 0x00000032 }, - { 0x00000000, 0x00000014, 0x00000032 }, - { 0x00000000, 0x00000014, 0x00000032 } +struct HealthDamageType g_HealthDamageTypes[8] = { + { 0, 40, 100 }, + { 0, 30, 80 }, + { 0, 20, 60 }, + { 0, 20, 60 }, + { 0, 20, 60 }, + { 0, 20, 50 }, + { 0, 20, 50 }, + { 0, 20, 50 } }; -// //D:800367F4 -// s32 D_800367F4 = 0; -// //D:800367F8 -// s32 D_800367F8 = 0; -// //D:800367FC -// s32 D_800367FC = 0; - -// Address 0x800367F4 -struct coord3d D_800367F4 = { 0 }; - - -//D:80036800 -s32 D_80036800 = 0; -//D:80036804 -s32 D_80036804 = 0; -//D:80036808 -s32 D_80036808 = 0; -//D:8003680C -s32 D_8003680C = 0; -//D:80036810 -s32 D_80036810 = 0; -//D:80036814 -s32 D_80036814 = 0x3F800000; -//D:80036818 -s32 D_80036818 = 0; -//D:8003681C -s32 D_8003681C = 0x3F800000; -//D:80036820 -s32 D_80036820 = 0; -//D:80036824 -s32 D_80036824 = 0; -//D:80036828 -s32 D_80036828 = 0; -//D:8003682C -s32 D_8003682C = 0; +/** + * US Address 0x800367F4. +*/ +struct coord3d g_DefaultMoveBondOffset = { 0 }; + + +/** + * struct player property `pos` . + * US address 80036800. + */ +struct coord3d g_DefaultFrozenPlayerPos = { 0 }; + +/** + * struct player property `pos2`. + * US address 8003680C. + */ +struct coord3d g_DefaultFrozenPlayerPos2 = { 0, 0, 1.0f }; + +/** + * struct player property `offset`. + * US address 80036818. + */ +struct coord3d g_DefaultFrozenPlayerOffset = { 0, 1.0f, 0 }; + +/** + * struct player property `offset`. + * US address 80036824. + */ +struct coord3d g_DefaultFrozenMoveOffset = { 0 }; + //D:80036830 s32 D_80036830 = 0; //D:80036834 @@ -589,7 +649,7 @@ s32 upper_text_buffer_index = 0; s32 display_upper_text_window = 0; //D:800368B0 s32 upper_text_window_timer = 0xFFFFFFFF; -s32 D_800368B4 = 0; +s32 g_UpperTextDisplayFlag = 0; //D:800368B8 u8 D_800368B8[10][3] = {"n", "ne", "e", "se", "s", "sw", "w", "nw", "n", "" }; @@ -651,35 +711,48 @@ s16 getHeight330or240(void); void sub_GAME_7F07B1A4(void); bool currentPlayerIsFadeComplete(void); s16 get_curplayer_viewport_ulx(void); -void sub_GAME_7F086990(s8, s8, u16, u16); +void bondviewFrozenMoveBond(s8, s8, u16, u16); void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2); void bondviewUpdateCurrentRoomPosition(s32 arg0); void trigger_solo_watch_menu(s32 arg0); void bondviewUpdatePlayerCollisionBounds(void); -void bondviewTankCollisionRelated(struct rect4f *, coord3d *, f32); +void bondviewGetTankCollisionBounds(struct rect4f *, coord3d *, f32); void bondviewIntroCameraTextTick(void); void bondviewUpperTextWindowTimerTick(void); void sub_GAME_7F07DEFC(void); void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3); -void controller_gameplay_interaction(s8 arg0, s8 arg1, u16 arg2, u16 arg3); -void sub_GAME_7F083FC8(void); -void sub_GAME_7F084360(void); -void sub_GAME_7F07EAF0(void); -void sub_GAME_7F07EC54(void); +void bondviewProcessInput(s8 arg0, s8 arg1, u16 arg2, u16 arg3); +void bondviewPlayerTickDamageAndHealth(void); +void bondviewPlayerTickExplode(void); +void bondviewPlayerStopAudioForPause(void); +void bondviewWatchAnimationTick(void); void bondviewUpdatePlayerCollisionPositionFields(void); -void sub_GAME_7F07C7B4(void); -s32 bondviewTankCollisionStatus(struct coord3d *arg0, struct StandTile *arg1, f32 arg2, struct coord3d *arg3, struct coord3d *arg4); +void bondviewTankModelRotationRelated(void); +s32 bondviewTankCollisionStatus(struct coord3d *collision_position, StandTile *arg1, f32 tank_orientation_angle, struct coord3d *arg3, struct coord3d *arg4); s32 bondviewCallTankCollisionStatus(struct coord3d *arg0, struct StandTile *arg1, f32 arg2); s32 sub_GAME_7F07CDD4(struct coord3d *arg0, f32 arg1, struct StandTile **arg2); -s32 cal_player_collision(struct coord3d *arg0, struct StandTile **stan); +s32 bondviewTryMoveToStan(struct coord3d *arg0, struct StandTile **stan); s32 bondviewTestLineUnobstructed(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, s32 objFlags, struct coord3d *coord_p, struct coord3d *coord_dest); -s32 sub_GAME_7F07D2B4(f32 *arg0, struct coord3d *arg1, struct coord3d *arg2, struct coord3d *arg3, struct coord3d *arg4); -s32 sub_GAME_7F07D4C0(struct coord3d *arg0, struct coord3d *arg1, struct coord3d *arg2); -s32 sub_GAME_7F07D61C(struct coord3d *arg0, struct coord3d *arg1, struct coord3d *arg2); +s32 bondviewTryFractionMovePlayerCollision(struct coord3d *next_pos, struct coord3d *collision1_pt0, struct coord3d *collision1_pt1, struct coord3d *collision2_pt0, struct coord3d *collision2_pt1); +s32 bondviewTryEdgeMovePlayerCollision(struct coord3d *prior_next_pos, struct coord3d *collision_pt0, struct coord3d *collision_pt1); +s32 bondviewTryEndHopPlayerCollision(struct coord3d *prior_next_pos, struct coord3d *collision_pt0, struct coord3d *collision_pt1); void bondviewApplyVertaTheta(void); f32 bheadGetBreathingValue(void); +void bondviewMoveAnimationTick(f32 speed, f32 speedforwards, f32 speedsideways); +void bondviewCalcUpdatePlayerCollision(struct coord3d *offset, s32 allow_scoot); +f32 bondviewPauseAngleRelated(s32 arg0); +void sub_GAME_7F07E010(f32 arg0); +void sub_GAME_7F07E03C(f32 arg0); +s32 sub_GAME_7F07E068(void); +f32 sub_GAME_7F080228(f32 arg0); +void currentPlayerSetSwayTarget(s32 value); +void currentPlayerAdjustCrouchPos(s32 value); +void bondviewUpdateSpeedSideways(s32 arg0); +void bondviewUpdateSpeedForwards(s32 arg0); +void bondviewFrozenCameraTick(u16 buttons, u16 oldbuttons, struct coord3d *pos, struct coord3d *pos2, struct coord3d *offset, struct StandTile **stan, struct coord3d *arg6); +void sub_GAME_7F07B2A0(s32, f32, struct coord3d *, struct coord3d *); // end forward declarations @@ -858,7 +931,7 @@ void *currentPlayerSetMatrix10CC(Mtxf *matrix) { g_CurrentPlayer->field_10CC = matrix; } -Mtxf *currentPlayerGetMatrix10CC(void) { +Mtxf *camGetWorldToScreenMtxf(void) { return g_CurrentPlayer->field_10CC; } @@ -977,51 +1050,52 @@ f32 getPlayer_c_perspnear(void) return g_CurrentPlayer->c_perspnear; } -#ifdef NONMATCHING -// Regalloc mostly void sub_GAME_7F0785DC() { - f32 unused1; - f32 unused2; - f32 h_mul; f32 h_div; + f32 h2; f32 h; + f32 nh_div; + f32 nh2_div; + f32 h2_div; h = g_CurrentPlayer->c_halfheight * g_CurrentPlayer->c_scaley; h_div = 1.0f / sqrtf((h * h) + 1.0f); - h_mul = h * h_div; + h *= h_div; + nh_div = -h_div; - flt_CODE_bss_80079940.x = (h_div * g_CurrentPlayer->field_10D4->m[1][0]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][0]); - flt_CODE_bss_80079940.y = (h_div * g_CurrentPlayer->field_10D4->m[1][1]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][1]); - flt_CODE_bss_80079940.z = (h_div * g_CurrentPlayer->field_10D4->m[1][2]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][2]); + flt_CODE_bss_80079940.x = (-nh_div * g_CurrentPlayer->field_10D4->m[1][0]) + (h * g_CurrentPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079940.y = (-nh_div * g_CurrentPlayer->field_10D4->m[1][1]) + (h * g_CurrentPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079940.z = (-nh_div * g_CurrentPlayer->field_10D4->m[1][2]) + (h * g_CurrentPlayer->field_10D4->m[2][2]); flt_CODE_bss_8007994C = (flt_CODE_bss_80079940.x * g_CurrentPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079940.y * g_CurrentPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079940.z * g_CurrentPlayer->field_10D4->m[3][2]); - flt_CODE_bss_80079950.x = (-h_div * g_CurrentPlayer->field_10D4->m[1][0]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][0]); - flt_CODE_bss_80079950.y = (-h_div * g_CurrentPlayer->field_10D4->m[1][1]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][1]); - flt_CODE_bss_80079950.z = (-h_div * g_CurrentPlayer->field_10D4->m[1][2]) + (h_mul * g_CurrentPlayer->field_10D4->m[2][2]); + flt_CODE_bss_80079950.x = (nh_div * g_CurrentPlayer->field_10D4->m[1][0]) + (h * g_CurrentPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079950.y = (nh_div * g_CurrentPlayer->field_10D4->m[1][1]) + (h * g_CurrentPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079950.z = (nh_div * g_CurrentPlayer->field_10D4->m[1][2]) + (h * g_CurrentPlayer->field_10D4->m[2][2]); flt_CODE_bss_8007995C = (flt_CODE_bss_80079950.x * g_CurrentPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079950.y * g_CurrentPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079950.z * g_CurrentPlayer->field_10D4->m[3][2]); - h = (-g_CurrentPlayer->c_halfwidth) * g_CurrentPlayer->c_scalex; - h_div = 1.0f / sqrtf((h * h) + 1.0f); - h_mul = h * h_div; + h2 = (-g_CurrentPlayer->c_halfwidth) * g_CurrentPlayer->c_scalex; + h2_div = 1.0f / sqrtf((h2 * h2) + 1.0f); + h2 *= h2_div; + nh2_div = -h2_div; - flt_CODE_bss_80079960.x = (-h_div * g_CurrentPlayer->field_10D4->m[0][0]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][0]); - flt_CODE_bss_80079960.y = (-h_div * g_CurrentPlayer->field_10D4->m[0][1]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][1]); - flt_CODE_bss_80079960.z = (-h_div * g_CurrentPlayer->field_10D4->m[0][2]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][2]); + flt_CODE_bss_80079960.x = (nh2_div * g_CurrentPlayer->field_10D4->m[0][0]) - (h2 * g_CurrentPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079960.y = (nh2_div * g_CurrentPlayer->field_10D4->m[0][1]) - (h2 * g_CurrentPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079960.z = (nh2_div * g_CurrentPlayer->field_10D4->m[0][2]) - (h2 * g_CurrentPlayer->field_10D4->m[2][2]); flt_CODE_bss_8007996C = (flt_CODE_bss_80079960.x * g_CurrentPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079960.y * g_CurrentPlayer->field_10D4->m[3][1]) + (flt_CODE_bss_80079960.z * g_CurrentPlayer->field_10D4->m[3][2]); - flt_CODE_bss_80079970.x = (h_div * g_CurrentPlayer->field_10D4->m[0][0]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][0]); - flt_CODE_bss_80079970.y = (h_div * g_CurrentPlayer->field_10D4->m[0][1]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][1]); - flt_CODE_bss_80079970.z = (h_div * g_CurrentPlayer->field_10D4->m[0][2]) - (h_mul * g_CurrentPlayer->field_10D4->m[2][2]); + flt_CODE_bss_80079970.x = (-nh2_div * g_CurrentPlayer->field_10D4->m[0][0]) - (h2 * g_CurrentPlayer->field_10D4->m[2][0]); + flt_CODE_bss_80079970.y = (-nh2_div * g_CurrentPlayer->field_10D4->m[0][1]) - (h2 * g_CurrentPlayer->field_10D4->m[2][1]); + flt_CODE_bss_80079970.z = (-nh2_div * g_CurrentPlayer->field_10D4->m[0][2]) - (h2 * g_CurrentPlayer->field_10D4->m[2][2]); flt_CODE_bss_8007997C = (flt_CODE_bss_80079970.x * g_CurrentPlayer->field_10D4->m[3][0]) + (flt_CODE_bss_80079970.y * g_CurrentPlayer->field_10D4->m[3][1]) @@ -1032,466 +1106,6 @@ void sub_GAME_7F0785DC() + (g_CurrentPlayer->field_10D4->m[2][2] * g_CurrentPlayer->field_10D4->m[3][2]); } - -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F0785DC -/* 0AD10C 7F0785DC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0AD110 7F0785E0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AD114 7F0785E4 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0AD118 7F0785E8 AFBF001C */ sw $ra, 0x1c($sp) -/* 0AD11C 7F0785EC F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0AD120 7F0785F0 C46610B8 */ lwc1 $f6, 0x10b8($v1) -/* 0AD124 7F0785F4 C46410B0 */ lwc1 $f4, 0x10b0($v1) -/* 0AD128 7F0785F8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AD12C 7F0785FC 44815000 */ mtc1 $at, $f10 -/* 0AD130 7F078600 46062082 */ mul.s $f2, $f4, $f6 -/* 0AD134 7F078604 00000000 */ nop -/* 0AD138 7F078608 46021202 */ mul.s $f8, $f2, $f2 -/* 0AD13C 7F07860C E7A20024 */ swc1 $f2, 0x24($sp) -/* 0AD140 7F078610 0C007DF8 */ jal sqrtf -/* 0AD144 7F078614 460A4300 */ add.s $f12, $f8, $f10 -/* 0AD148 7F078618 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AD14C 7F07861C 44812000 */ mtc1 $at, $f4 -/* 0AD150 7F078620 C7A20024 */ lwc1 $f2, 0x24($sp) -/* 0AD154 7F078624 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0AD158 7F078628 46002503 */ div.s $f20, $f4, $f0 -/* 0AD15C 7F07862C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AD160 7F078630 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079940) -/* 0AD164 7F078634 24849940 */ addiu $a0, %lo(flt_CODE_bss_80079940) # addiu $a0, $a0, -0x66c0 -/* 0AD168 7F078638 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD16C 7F07863C 3C018008 */ lui $at, %hi(flt_CODE_bss_8007994C) -/* 0AD170 7F078640 3C058008 */ lui $a1, %hi(flt_CODE_bss_80079950) -/* 0AD174 7F078644 C4460020 */ lwc1 $f6, 0x20($v0) -/* 0AD178 7F078648 C44A0010 */ lwc1 $f10, 0x10($v0) -/* 0AD17C 7F07864C 24A59950 */ addiu $a1, %lo(flt_CODE_bss_80079950) # addiu $a1, $a1, -0x66b0 -/* 0AD180 7F078650 46141082 */ mul.s $f2, $f2, $f20 -/* 0AD184 7F078654 4600A407 */ neg.s $f16, $f20 -/* 0AD188 7F078658 46008487 */ neg.s $f18, $f16 -/* 0AD18C 7F07865C 46023202 */ mul.s $f8, $f6, $f2 -/* 0AD190 7F078660 00000000 */ nop -/* 0AD194 7F078664 460A9102 */ mul.s $f4, $f18, $f10 -/* 0AD198 7F078668 46044180 */ add.s $f6, $f8, $f4 -/* 0AD19C 7F07866C E4860000 */ swc1 $f6, ($a0) -/* 0AD1A0 7F078670 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD1A4 7F078674 C44A0024 */ lwc1 $f10, 0x24($v0) -/* 0AD1A8 7F078678 C4440014 */ lwc1 $f4, 0x14($v0) -/* 0AD1AC 7F07867C 46025202 */ mul.s $f8, $f10, $f2 -/* 0AD1B0 7F078680 00000000 */ nop -/* 0AD1B4 7F078684 46049182 */ mul.s $f6, $f18, $f4 -/* 0AD1B8 7F078688 46064280 */ add.s $f10, $f8, $f6 -/* 0AD1BC 7F07868C E48A0004 */ swc1 $f10, 4($a0) -/* 0AD1C0 7F078690 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD1C4 7F078694 C4440028 */ lwc1 $f4, 0x28($v0) -/* 0AD1C8 7F078698 C4460018 */ lwc1 $f6, 0x18($v0) -/* 0AD1CC 7F07869C 46022202 */ mul.s $f8, $f4, $f2 -/* 0AD1D0 7F0786A0 00000000 */ nop -/* 0AD1D4 7F0786A4 46069282 */ mul.s $f10, $f18, $f6 -/* 0AD1D8 7F0786A8 C4860000 */ lwc1 $f6, ($a0) -/* 0AD1DC 7F0786AC 460A4100 */ add.s $f4, $f8, $f10 -/* 0AD1E0 7F0786B0 E4840008 */ swc1 $f4, 8($a0) -/* 0AD1E4 7F0786B4 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD1E8 7F0786B8 C4840004 */ lwc1 $f4, 4($a0) -/* 0AD1EC 7F0786BC C4480030 */ lwc1 $f8, 0x30($v0) -/* 0AD1F0 7F0786C0 46083282 */ mul.s $f10, $f6, $f8 -/* 0AD1F4 7F0786C4 C4460034 */ lwc1 $f6, 0x34($v0) -/* 0AD1F8 7F0786C8 46062202 */ mul.s $f8, $f4, $f6 -/* 0AD1FC 7F0786CC C4460038 */ lwc1 $f6, 0x38($v0) -/* 0AD200 7F0786D0 46085100 */ add.s $f4, $f10, $f8 -/* 0AD204 7F0786D4 C48A0008 */ lwc1 $f10, 8($a0) -/* 0AD208 7F0786D8 460A3202 */ mul.s $f8, $f6, $f10 -/* 0AD20C 7F0786DC 46044180 */ add.s $f6, $f8, $f4 -/* 0AD210 7F0786E0 E426994C */ swc1 $f6, %lo(flt_CODE_bss_8007994C)($at) -/* 0AD214 7F0786E4 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD218 7F0786E8 3C018008 */ lui $at, %hi(flt_CODE_bss_8007995C) -/* 0AD21C 7F0786EC C44A0020 */ lwc1 $f10, 0x20($v0) -/* 0AD220 7F0786F0 C4440010 */ lwc1 $f4, 0x10($v0) -/* 0AD224 7F0786F4 46025202 */ mul.s $f8, $f10, $f2 -/* 0AD228 7F0786F8 00000000 */ nop -/* 0AD22C 7F0786FC 46048182 */ mul.s $f6, $f16, $f4 -/* 0AD230 7F078700 46064280 */ add.s $f10, $f8, $f6 -/* 0AD234 7F078704 E4AA0000 */ swc1 $f10, ($a1) -/* 0AD238 7F078708 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD23C 7F07870C C4440024 */ lwc1 $f4, 0x24($v0) -/* 0AD240 7F078710 C4460014 */ lwc1 $f6, 0x14($v0) -/* 0AD244 7F078714 46022202 */ mul.s $f8, $f4, $f2 -/* 0AD248 7F078718 00000000 */ nop -/* 0AD24C 7F07871C 46068282 */ mul.s $f10, $f16, $f6 -/* 0AD250 7F078720 460A4100 */ add.s $f4, $f8, $f10 -/* 0AD254 7F078724 E4A40004 */ swc1 $f4, 4($a1) -/* 0AD258 7F078728 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD25C 7F07872C C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AD260 7F078730 C44A0018 */ lwc1 $f10, 0x18($v0) -/* 0AD264 7F078734 46023202 */ mul.s $f8, $f6, $f2 -/* 0AD268 7F078738 00000000 */ nop -/* 0AD26C 7F07873C 460A8102 */ mul.s $f4, $f16, $f10 -/* 0AD270 7F078740 C4AA0000 */ lwc1 $f10, ($a1) -/* 0AD274 7F078744 46044180 */ add.s $f6, $f8, $f4 -/* 0AD278 7F078748 E4A60008 */ swc1 $f6, 8($a1) -/* 0AD27C 7F07874C 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD280 7F078750 C4A60004 */ lwc1 $f6, 4($a1) -/* 0AD284 7F078754 C4480030 */ lwc1 $f8, 0x30($v0) -/* 0AD288 7F078758 46085102 */ mul.s $f4, $f10, $f8 -/* 0AD28C 7F07875C C44A0034 */ lwc1 $f10, 0x34($v0) -/* 0AD290 7F078760 460A3202 */ mul.s $f8, $f6, $f10 -/* 0AD294 7F078764 C44A0038 */ lwc1 $f10, 0x38($v0) -/* 0AD298 7F078768 46082180 */ add.s $f6, $f4, $f8 -/* 0AD29C 7F07876C C4A40008 */ lwc1 $f4, 8($a1) -/* 0AD2A0 7F078770 46045202 */ mul.s $f8, $f10, $f4 -/* 0AD2A4 7F078774 46064280 */ add.s $f10, $f8, $f6 -/* 0AD2A8 7F078778 E42A995C */ swc1 $f10, %lo(flt_CODE_bss_8007995C)($at) -/* 0AD2AC 7F07877C C46410AC */ lwc1 $f4, 0x10ac($v1) -/* 0AD2B0 7F078780 C46610B4 */ lwc1 $f6, 0x10b4($v1) -/* 0AD2B4 7F078784 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AD2B8 7F078788 46002207 */ neg.s $f8, $f4 -/* 0AD2BC 7F07878C 44812000 */ mtc1 $at, $f4 -/* 0AD2C0 7F078790 46064382 */ mul.s $f14, $f8, $f6 -/* 0AD2C4 7F078794 00000000 */ nop -/* 0AD2C8 7F078798 460E7282 */ mul.s $f10, $f14, $f14 -/* 0AD2CC 7F07879C E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0AD2D0 7F0787A0 0C007DF8 */ jal sqrtf -/* 0AD2D4 7F0787A4 46045300 */ add.s $f12, $f10, $f4 -/* 0AD2D8 7F0787A8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AD2DC 7F0787AC 44814000 */ mtc1 $at, $f8 -/* 0AD2E0 7F0787B0 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0AD2E4 7F0787B4 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AD2E8 7F0787B8 46004503 */ div.s $f20, $f8, $f0 -/* 0AD2EC 7F0787BC C7AE0028 */ lwc1 $f14, 0x28($sp) -/* 0AD2F0 7F0787C0 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD2F4 7F0787C4 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079960) -/* 0AD2F8 7F0787C8 24849960 */ addiu $a0, %lo(flt_CODE_bss_80079960) # addiu $a0, $a0, -0x66a0 -/* 0AD2FC 7F0787CC C4460000 */ lwc1 $f6, ($v0) -/* 0AD300 7F0787D0 C4440020 */ lwc1 $f4, 0x20($v0) -/* 0AD304 7F0787D4 3C018008 */ lui $at, %hi(flt_CODE_bss_8007996C) -/* 0AD308 7F0787D8 3C058008 */ lui $a1, %hi(flt_CODE_bss_80079970) -/* 0AD30C 7F0787DC 24A59970 */ addiu $a1, %lo(flt_CODE_bss_80079970) # addiu $a1, $a1, -0x6690 -/* 0AD310 7F0787E0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0AD314 7F0787E4 46147382 */ mul.s $f14, $f14, $f20 -/* 0AD318 7F0787E8 4600A407 */ neg.s $f16, $f20 -/* 0AD31C 7F0787EC D7B40010 */ ldc1 $f20, 0x10($sp) -/* 0AD320 7F0787F0 46068282 */ mul.s $f10, $f16, $f6 -/* 0AD324 7F0787F4 46008487 */ neg.s $f18, $f16 -/* 0AD328 7F0787F8 460E2202 */ mul.s $f8, $f4, $f14 -/* 0AD32C 7F0787FC 46085181 */ sub.s $f6, $f10, $f8 -/* 0AD330 7F078800 E4860000 */ swc1 $f6, ($a0) -/* 0AD334 7F078804 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD338 7F078808 C4440004 */ lwc1 $f4, 4($v0) -/* 0AD33C 7F07880C C4480024 */ lwc1 $f8, 0x24($v0) -/* 0AD340 7F078810 46048282 */ mul.s $f10, $f16, $f4 -/* 0AD344 7F078814 00000000 */ nop -/* 0AD348 7F078818 460E4182 */ mul.s $f6, $f8, $f14 -/* 0AD34C 7F07881C 46065101 */ sub.s $f4, $f10, $f6 -/* 0AD350 7F078820 E4840004 */ swc1 $f4, 4($a0) -/* 0AD354 7F078824 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD358 7F078828 C4480008 */ lwc1 $f8, 8($v0) -/* 0AD35C 7F07882C C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AD360 7F078830 46088282 */ mul.s $f10, $f16, $f8 -/* 0AD364 7F078834 00000000 */ nop -/* 0AD368 7F078838 460E3102 */ mul.s $f4, $f6, $f14 -/* 0AD36C 7F07883C C4860000 */ lwc1 $f6, ($a0) -/* 0AD370 7F078840 46045201 */ sub.s $f8, $f10, $f4 -/* 0AD374 7F078844 E4880008 */ swc1 $f8, 8($a0) -/* 0AD378 7F078848 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD37C 7F07884C C4880004 */ lwc1 $f8, 4($a0) -/* 0AD380 7F078850 C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AD384 7F078854 460A3102 */ mul.s $f4, $f6, $f10 -/* 0AD388 7F078858 C4460034 */ lwc1 $f6, 0x34($v0) -/* 0AD38C 7F07885C 46064282 */ mul.s $f10, $f8, $f6 -/* 0AD390 7F078860 C4460038 */ lwc1 $f6, 0x38($v0) -/* 0AD394 7F078864 460A2200 */ add.s $f8, $f4, $f10 -/* 0AD398 7F078868 C4840008 */ lwc1 $f4, 8($a0) -/* 0AD39C 7F07886C 46043282 */ mul.s $f10, $f6, $f4 -/* 0AD3A0 7F078870 46085180 */ add.s $f6, $f10, $f8 -/* 0AD3A4 7F078874 E426996C */ swc1 $f6, %lo(flt_CODE_bss_8007996C)($at) -/* 0AD3A8 7F078878 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD3AC 7F07887C 3C018008 */ lui $at, %hi(flt_CODE_bss_8007997C) -/* 0AD3B0 7F078880 C4440000 */ lwc1 $f4, ($v0) -/* 0AD3B4 7F078884 C4480020 */ lwc1 $f8, 0x20($v0) -/* 0AD3B8 7F078888 46049282 */ mul.s $f10, $f18, $f4 -/* 0AD3BC 7F07888C 00000000 */ nop -/* 0AD3C0 7F078890 460E4182 */ mul.s $f6, $f8, $f14 -/* 0AD3C4 7F078894 46065101 */ sub.s $f4, $f10, $f6 -/* 0AD3C8 7F078898 E4A40000 */ swc1 $f4, ($a1) -/* 0AD3CC 7F07889C 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD3D0 7F0788A0 C4480004 */ lwc1 $f8, 4($v0) -/* 0AD3D4 7F0788A4 C4460024 */ lwc1 $f6, 0x24($v0) -/* 0AD3D8 7F0788A8 46089282 */ mul.s $f10, $f18, $f8 -/* 0AD3DC 7F0788AC 00000000 */ nop -/* 0AD3E0 7F0788B0 460E3102 */ mul.s $f4, $f6, $f14 -/* 0AD3E4 7F0788B4 46045201 */ sub.s $f8, $f10, $f4 -/* 0AD3E8 7F0788B8 E4A80004 */ swc1 $f8, 4($a1) -/* 0AD3EC 7F0788BC 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD3F0 7F0788C0 C4460008 */ lwc1 $f6, 8($v0) -/* 0AD3F4 7F0788C4 C4440028 */ lwc1 $f4, 0x28($v0) -/* 0AD3F8 7F0788C8 46069282 */ mul.s $f10, $f18, $f6 -/* 0AD3FC 7F0788CC 00000000 */ nop -/* 0AD400 7F0788D0 460E2202 */ mul.s $f8, $f4, $f14 -/* 0AD404 7F0788D4 C4A40000 */ lwc1 $f4, ($a1) -/* 0AD408 7F0788D8 46085181 */ sub.s $f6, $f10, $f8 -/* 0AD40C 7F0788DC E4A60008 */ swc1 $f6, 8($a1) -/* 0AD410 7F0788E0 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD414 7F0788E4 C4A60004 */ lwc1 $f6, 4($a1) -/* 0AD418 7F0788E8 C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AD41C 7F0788EC 460A2202 */ mul.s $f8, $f4, $f10 -/* 0AD420 7F0788F0 C4440034 */ lwc1 $f4, 0x34($v0) -/* 0AD424 7F0788F4 46043282 */ mul.s $f10, $f6, $f4 -/* 0AD428 7F0788F8 C4440038 */ lwc1 $f4, 0x38($v0) -/* 0AD42C 7F0788FC 460A4180 */ add.s $f6, $f8, $f10 -/* 0AD430 7F078900 C4A80008 */ lwc1 $f8, 8($a1) -/* 0AD434 7F078904 46082282 */ mul.s $f10, $f4, $f8 -/* 0AD438 7F078908 46065100 */ add.s $f4, $f10, $f6 -/* 0AD43C 7F07890C E424997C */ swc1 $f4, %lo(flt_CODE_bss_8007997C)($at) -/* 0AD440 7F078910 8C6210D4 */ lw $v0, 0x10d4($v1) -/* 0AD444 7F078914 3C018008 */ lui $at, %hi(flt_CODE_bss_80079980) -/* 0AD448 7F078918 C4480020 */ lwc1 $f8, 0x20($v0) -/* 0AD44C 7F07891C C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AD450 7F078920 C4440024 */ lwc1 $f4, 0x24($v0) -/* 0AD454 7F078924 460A4182 */ mul.s $f6, $f8, $f10 -/* 0AD458 7F078928 C4480034 */ lwc1 $f8, 0x34($v0) -/* 0AD45C 7F07892C 46082282 */ mul.s $f10, $f4, $f8 -/* 0AD460 7F078930 C4480038 */ lwc1 $f8, 0x38($v0) -/* 0AD464 7F078934 460A3100 */ add.s $f4, $f6, $f10 -/* 0AD468 7F078938 C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AD46C 7F07893C 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0AD470 7F078940 46064282 */ mul.s $f10, $f8, $f6 -/* 0AD474 7F078944 46045200 */ add.s $f8, $f10, $f4 -/* 0AD478 7F078948 03E00008 */ jr $ra -/* 0AD47C 7F07894C E4289980 */ swc1 $f8, %lo(flt_CODE_bss_80079980)($at) -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F0785DC -/* 0AB04C 7F07865C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AB050 7F078660 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AB054 7F078664 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0AB058 7F078668 AFBF001C */ sw $ra, 0x1c($sp) -/* 0AB05C 7F07866C F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0AB060 7F078670 C46610B0 */ lwc1 $f6, 0x10b0($v1) -/* 0AB064 7F078674 C46410A8 */ lwc1 $f4, 0x10a8($v1) -/* 0AB068 7F078678 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AB06C 7F07867C 44815000 */ mtc1 $at, $f10 -/* 0AB070 7F078680 46062082 */ mul.s $f2, $f4, $f6 -/* 0AB074 7F078684 00000000 */ nop -/* 0AB078 7F078688 46021202 */ mul.s $f8, $f2, $f2 -/* 0AB07C 7F07868C E7A20024 */ swc1 $f2, 0x24($sp) -/* 0AB080 7F078690 0C007614 */ jal sqrtf -/* 0AB084 7F078694 460A4300 */ add.s $f12, $f8, $f10 -/* 0AB088 7F078698 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AB08C 7F07869C 44812000 */ mtc1 $at, $f4 -/* 0AB090 7F0786A0 C7A20024 */ lwc1 $f2, 0x24($sp) -/* 0AB094 7F0786A4 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AB098 7F0786A8 46002503 */ div.s $f20, $f4, $f0 -/* 0AB09C 7F0786AC 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AB0A0 7F0786B0 3C048007 */ lui $a0, %hi(flt_CODE_bss_80079940) # $a0, 0x8007 -/* 0AB0A4 7F0786B4 24848420 */ addiu $a0, %lo(flt_CODE_bss_80079940) # addiu $a0, $a0, -0x7be0 -/* 0AB0A8 7F0786B8 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB0AC 7F0786BC 3C018007 */ lui $at, %hi(flt_CODE_bss_8007994C) # $at, 0x8007 -/* 0AB0B0 7F0786C0 3C058007 */ lui $a1, %hi(flt_CODE_bss_80079950) # $a1, 0x8007 -/* 0AB0B4 7F0786C4 C4460020 */ lwc1 $f6, 0x20($v0) -/* 0AB0B8 7F0786C8 C44A0010 */ lwc1 $f10, 0x10($v0) -/* 0AB0BC 7F0786CC 24A58430 */ addiu $a1, %lo(flt_CODE_bss_80079950) # addiu $a1, $a1, -0x7bd0 -/* 0AB0C0 7F0786D0 46141082 */ mul.s $f2, $f2, $f20 -/* 0AB0C4 7F0786D4 4600A407 */ neg.s $f16, $f20 -/* 0AB0C8 7F0786D8 46008487 */ neg.s $f18, $f16 -/* 0AB0CC 7F0786DC 46023202 */ mul.s $f8, $f6, $f2 -/* 0AB0D0 7F0786E0 00000000 */ nop -/* 0AB0D4 7F0786E4 460A9102 */ mul.s $f4, $f18, $f10 -/* 0AB0D8 7F0786E8 46044180 */ add.s $f6, $f8, $f4 -/* 0AB0DC 7F0786EC E4860000 */ swc1 $f6, ($a0) -/* 0AB0E0 7F0786F0 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB0E4 7F0786F4 C44A0024 */ lwc1 $f10, 0x24($v0) -/* 0AB0E8 7F0786F8 C4440014 */ lwc1 $f4, 0x14($v0) -/* 0AB0EC 7F0786FC 46025202 */ mul.s $f8, $f10, $f2 -/* 0AB0F0 7F078700 00000000 */ nop -/* 0AB0F4 7F078704 46049182 */ mul.s $f6, $f18, $f4 -/* 0AB0F8 7F078708 46064280 */ add.s $f10, $f8, $f6 -/* 0AB0FC 7F07870C E48A0004 */ swc1 $f10, 4($a0) -/* 0AB100 7F078710 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB104 7F078714 C4440028 */ lwc1 $f4, 0x28($v0) -/* 0AB108 7F078718 C4460018 */ lwc1 $f6, 0x18($v0) -/* 0AB10C 7F07871C 46022202 */ mul.s $f8, $f4, $f2 -/* 0AB110 7F078720 00000000 */ nop -/* 0AB114 7F078724 46069282 */ mul.s $f10, $f18, $f6 -/* 0AB118 7F078728 C4860000 */ lwc1 $f6, ($a0) -/* 0AB11C 7F07872C 460A4100 */ add.s $f4, $f8, $f10 -/* 0AB120 7F078730 E4840008 */ swc1 $f4, 8($a0) -/* 0AB124 7F078734 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB128 7F078738 C4840004 */ lwc1 $f4, 4($a0) -/* 0AB12C 7F07873C C4480030 */ lwc1 $f8, 0x30($v0) -/* 0AB130 7F078740 46083282 */ mul.s $f10, $f6, $f8 -/* 0AB134 7F078744 C4460034 */ lwc1 $f6, 0x34($v0) -/* 0AB138 7F078748 46062202 */ mul.s $f8, $f4, $f6 -/* 0AB13C 7F07874C C4460038 */ lwc1 $f6, 0x38($v0) -/* 0AB140 7F078750 46085100 */ add.s $f4, $f10, $f8 -/* 0AB144 7F078754 C48A0008 */ lwc1 $f10, 8($a0) -/* 0AB148 7F078758 460A3202 */ mul.s $f8, $f6, $f10 -/* 0AB14C 7F07875C 46044180 */ add.s $f6, $f8, $f4 -/* 0AB150 7F078760 E426842C */ swc1 $f6, %lo(flt_CODE_bss_8007994C)($at) -/* 0AB154 7F078764 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB158 7F078768 3C018007 */ lui $at, %hi(flt_CODE_bss_8007995C) # $at, 0x8007 -/* 0AB15C 7F07876C C44A0020 */ lwc1 $f10, 0x20($v0) -/* 0AB160 7F078770 C4440010 */ lwc1 $f4, 0x10($v0) -/* 0AB164 7F078774 46025202 */ mul.s $f8, $f10, $f2 -/* 0AB168 7F078778 00000000 */ nop -/* 0AB16C 7F07877C 46048182 */ mul.s $f6, $f16, $f4 -/* 0AB170 7F078780 46064280 */ add.s $f10, $f8, $f6 -/* 0AB174 7F078784 E4AA0000 */ swc1 $f10, ($a1) -/* 0AB178 7F078788 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB17C 7F07878C C4440024 */ lwc1 $f4, 0x24($v0) -/* 0AB180 7F078790 C4460014 */ lwc1 $f6, 0x14($v0) -/* 0AB184 7F078794 46022202 */ mul.s $f8, $f4, $f2 -/* 0AB188 7F078798 00000000 */ nop -/* 0AB18C 7F07879C 46068282 */ mul.s $f10, $f16, $f6 -/* 0AB190 7F0787A0 460A4100 */ add.s $f4, $f8, $f10 -/* 0AB194 7F0787A4 E4A40004 */ swc1 $f4, 4($a1) -/* 0AB198 7F0787A8 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB19C 7F0787AC C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AB1A0 7F0787B0 C44A0018 */ lwc1 $f10, 0x18($v0) -/* 0AB1A4 7F0787B4 46023202 */ mul.s $f8, $f6, $f2 -/* 0AB1A8 7F0787B8 00000000 */ nop -/* 0AB1AC 7F0787BC 460A8102 */ mul.s $f4, $f16, $f10 -/* 0AB1B0 7F0787C0 C4AA0000 */ lwc1 $f10, ($a1) -/* 0AB1B4 7F0787C4 46044180 */ add.s $f6, $f8, $f4 -/* 0AB1B8 7F0787C8 E4A60008 */ swc1 $f6, 8($a1) -/* 0AB1BC 7F0787CC 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB1C0 7F0787D0 C4A60004 */ lwc1 $f6, 4($a1) -/* 0AB1C4 7F0787D4 C4480030 */ lwc1 $f8, 0x30($v0) -/* 0AB1C8 7F0787D8 46085102 */ mul.s $f4, $f10, $f8 -/* 0AB1CC 7F0787DC C44A0034 */ lwc1 $f10, 0x34($v0) -/* 0AB1D0 7F0787E0 460A3202 */ mul.s $f8, $f6, $f10 -/* 0AB1D4 7F0787E4 C44A0038 */ lwc1 $f10, 0x38($v0) -/* 0AB1D8 7F0787E8 46082180 */ add.s $f6, $f4, $f8 -/* 0AB1DC 7F0787EC C4A40008 */ lwc1 $f4, 8($a1) -/* 0AB1E0 7F0787F0 46045202 */ mul.s $f8, $f10, $f4 -/* 0AB1E4 7F0787F4 46064280 */ add.s $f10, $f8, $f6 -/* 0AB1E8 7F0787F8 E42A843C */ swc1 $f10, %lo(flt_CODE_bss_8007995C)($at) -/* 0AB1EC 7F0787FC C46410A4 */ lwc1 $f4, 0x10a4($v1) -/* 0AB1F0 7F078800 C46610AC */ lwc1 $f6, 0x10ac($v1) -/* 0AB1F4 7F078804 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AB1F8 7F078808 46002207 */ neg.s $f8, $f4 -/* 0AB1FC 7F07880C 44812000 */ mtc1 $at, $f4 -/* 0AB200 7F078810 46064382 */ mul.s $f14, $f8, $f6 -/* 0AB204 7F078814 00000000 */ nop -/* 0AB208 7F078818 460E7282 */ mul.s $f10, $f14, $f14 -/* 0AB20C 7F07881C E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0AB210 7F078820 0C007614 */ jal sqrtf -/* 0AB214 7F078824 46045300 */ add.s $f12, $f10, $f4 -/* 0AB218 7F078828 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AB21C 7F07882C 44814000 */ mtc1 $at, $f8 -/* 0AB220 7F078830 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AB224 7F078834 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AB228 7F078838 46004503 */ div.s $f20, $f8, $f0 -/* 0AB22C 7F07883C C7AE0028 */ lwc1 $f14, 0x28($sp) -/* 0AB230 7F078840 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB234 7F078844 3C048007 */ lui $a0, %hi(flt_CODE_bss_80079960) # $a0, 0x8007 -/* 0AB238 7F078848 24848440 */ addiu $a0, %lo(flt_CODE_bss_80079960) # addiu $a0, $a0, -0x7bc0 -/* 0AB23C 7F07884C C4460000 */ lwc1 $f6, ($v0) -/* 0AB240 7F078850 C4440020 */ lwc1 $f4, 0x20($v0) -/* 0AB244 7F078854 3C018007 */ lui $at, %hi(flt_CODE_bss_8007996C) # $at, 0x8007 -/* 0AB248 7F078858 3C058007 */ lui $a1, %hi(flt_CODE_bss_80079970) # $a1, 0x8007 -/* 0AB24C 7F07885C 24A58450 */ addiu $a1, %lo(flt_CODE_bss_80079970) # addiu $a1, $a1, -0x7bb0 -/* 0AB250 7F078860 8FBF001C */ lw $ra, 0x1c($sp) -/* 0AB254 7F078864 46147382 */ mul.s $f14, $f14, $f20 -/* 0AB258 7F078868 4600A407 */ neg.s $f16, $f20 -/* 0AB25C 7F07886C D7B40010 */ ldc1 $f20, 0x10($sp) -/* 0AB260 7F078870 46068282 */ mul.s $f10, $f16, $f6 -/* 0AB264 7F078874 46008487 */ neg.s $f18, $f16 -/* 0AB268 7F078878 460E2202 */ mul.s $f8, $f4, $f14 -/* 0AB26C 7F07887C 46085181 */ sub.s $f6, $f10, $f8 -/* 0AB270 7F078880 E4860000 */ swc1 $f6, ($a0) -/* 0AB274 7F078884 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB278 7F078888 C4440004 */ lwc1 $f4, 4($v0) -/* 0AB27C 7F07888C C4480024 */ lwc1 $f8, 0x24($v0) -/* 0AB280 7F078890 46048282 */ mul.s $f10, $f16, $f4 -/* 0AB284 7F078894 00000000 */ nop -/* 0AB288 7F078898 460E4182 */ mul.s $f6, $f8, $f14 -/* 0AB28C 7F07889C 46065101 */ sub.s $f4, $f10, $f6 -/* 0AB290 7F0788A0 E4840004 */ swc1 $f4, 4($a0) -/* 0AB294 7F0788A4 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB298 7F0788A8 C4480008 */ lwc1 $f8, 8($v0) -/* 0AB29C 7F0788AC C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AB2A0 7F0788B0 46088282 */ mul.s $f10, $f16, $f8 -/* 0AB2A4 7F0788B4 00000000 */ nop -/* 0AB2A8 7F0788B8 460E3102 */ mul.s $f4, $f6, $f14 -/* 0AB2AC 7F0788BC C4860000 */ lwc1 $f6, ($a0) -/* 0AB2B0 7F0788C0 46045201 */ sub.s $f8, $f10, $f4 -/* 0AB2B4 7F0788C4 E4880008 */ swc1 $f8, 8($a0) -/* 0AB2B8 7F0788C8 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB2BC 7F0788CC C4880004 */ lwc1 $f8, 4($a0) -/* 0AB2C0 7F0788D0 C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AB2C4 7F0788D4 460A3102 */ mul.s $f4, $f6, $f10 -/* 0AB2C8 7F0788D8 C4460034 */ lwc1 $f6, 0x34($v0) -/* 0AB2CC 7F0788DC 46064282 */ mul.s $f10, $f8, $f6 -/* 0AB2D0 7F0788E0 C4460038 */ lwc1 $f6, 0x38($v0) -/* 0AB2D4 7F0788E4 460A2200 */ add.s $f8, $f4, $f10 -/* 0AB2D8 7F0788E8 C4840008 */ lwc1 $f4, 8($a0) -/* 0AB2DC 7F0788EC 46043282 */ mul.s $f10, $f6, $f4 -/* 0AB2E0 7F0788F0 46085180 */ add.s $f6, $f10, $f8 -/* 0AB2E4 7F0788F4 E426844C */ swc1 $f6, %lo(flt_CODE_bss_8007996C)($at) -/* 0AB2E8 7F0788F8 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB2EC 7F0788FC 3C018007 */ lui $at, %hi(flt_CODE_bss_8007997C) # $at, 0x8007 -/* 0AB2F0 7F078900 C4440000 */ lwc1 $f4, ($v0) -/* 0AB2F4 7F078904 C4480020 */ lwc1 $f8, 0x20($v0) -/* 0AB2F8 7F078908 46049282 */ mul.s $f10, $f18, $f4 -/* 0AB2FC 7F07890C 00000000 */ nop -/* 0AB300 7F078910 460E4182 */ mul.s $f6, $f8, $f14 -/* 0AB304 7F078914 46065101 */ sub.s $f4, $f10, $f6 -/* 0AB308 7F078918 E4A40000 */ swc1 $f4, ($a1) -/* 0AB30C 7F07891C 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB310 7F078920 C4480004 */ lwc1 $f8, 4($v0) -/* 0AB314 7F078924 C4460024 */ lwc1 $f6, 0x24($v0) -/* 0AB318 7F078928 46089282 */ mul.s $f10, $f18, $f8 -/* 0AB31C 7F07892C 00000000 */ nop -/* 0AB320 7F078930 460E3102 */ mul.s $f4, $f6, $f14 -/* 0AB324 7F078934 46045201 */ sub.s $f8, $f10, $f4 -/* 0AB328 7F078938 E4A80004 */ swc1 $f8, 4($a1) -/* 0AB32C 7F07893C 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB330 7F078940 C4460008 */ lwc1 $f6, 8($v0) -/* 0AB334 7F078944 C4440028 */ lwc1 $f4, 0x28($v0) -/* 0AB338 7F078948 46069282 */ mul.s $f10, $f18, $f6 -/* 0AB33C 7F07894C 00000000 */ nop -/* 0AB340 7F078950 460E2202 */ mul.s $f8, $f4, $f14 -/* 0AB344 7F078954 C4A40000 */ lwc1 $f4, ($a1) -/* 0AB348 7F078958 46085181 */ sub.s $f6, $f10, $f8 -/* 0AB34C 7F07895C E4A60008 */ swc1 $f6, 8($a1) -/* 0AB350 7F078960 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB354 7F078964 C4A60004 */ lwc1 $f6, 4($a1) -/* 0AB358 7F078968 C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AB35C 7F07896C 460A2202 */ mul.s $f8, $f4, $f10 -/* 0AB360 7F078970 C4440034 */ lwc1 $f4, 0x34($v0) -/* 0AB364 7F078974 46043282 */ mul.s $f10, $f6, $f4 -/* 0AB368 7F078978 C4440038 */ lwc1 $f4, 0x38($v0) -/* 0AB36C 7F07897C 460A4180 */ add.s $f6, $f8, $f10 -/* 0AB370 7F078980 C4A80008 */ lwc1 $f8, 8($a1) -/* 0AB374 7F078984 46082282 */ mul.s $f10, $f4, $f8 -/* 0AB378 7F078988 46065100 */ add.s $f4, $f10, $f6 -/* 0AB37C 7F07898C E424845C */ swc1 $f4, %lo(flt_CODE_bss_8007997C)($at) -/* 0AB380 7F078990 8C6210CC */ lw $v0, 0x10cc($v1) -/* 0AB384 7F078994 3C018007 */ lui $at, %hi(flt_CODE_bss_80079980) -/* 0AB388 7F078998 C4480020 */ lwc1 $f8, 0x20($v0) -/* 0AB38C 7F07899C C44A0030 */ lwc1 $f10, 0x30($v0) -/* 0AB390 7F0789A0 C4440024 */ lwc1 $f4, 0x24($v0) -/* 0AB394 7F0789A4 460A4182 */ mul.s $f6, $f8, $f10 -/* 0AB398 7F0789A8 C4480034 */ lwc1 $f8, 0x34($v0) -/* 0AB39C 7F0789AC 46082282 */ mul.s $f10, $f4, $f8 -/* 0AB3A0 7F0789B0 C4480038 */ lwc1 $f8, 0x38($v0) -/* 0AB3A4 7F0789B4 460A3100 */ add.s $f4, $f6, $f10 -/* 0AB3A8 7F0789B8 C4460028 */ lwc1 $f6, 0x28($v0) -/* 0AB3AC 7F0789BC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0AB3B0 7F0789C0 46064282 */ mul.s $f10, $f8, $f6 -/* 0AB3B4 7F0789C4 46045200 */ add.s $f8, $f10, $f4 -/* 0AB3B8 7F0789C8 03E00008 */ jr $ra -/* 0AB3BC 7F0789CC E4288460 */ swc1 $f8, %lo(flt_CODE_bss_80079980)($at) -) -#endif -#endif - void sub_GAME_7F078950(coord3d *arg0, f32 *arg1) { arg0->x = flt_CODE_bss_80079940.x; arg0->y = flt_CODE_bss_80079940.y; @@ -1789,12 +1403,12 @@ void init_player_BONDdata(void) g_CurrentPlayer->field_84 = 0.0f; g_CurrentPlayer->field_88 = 0.0f; g_CurrentPlayer->field_8C = 0; - g_CurrentPlayer->field_90 = 0.0f; + g_CurrentPlayer->vertical_bounce_adjust = 0.0f; g_CurrentPlayer->field_94 = 0; g_CurrentPlayer->field_98 = 0.0f; g_CurrentPlayer->swaytarget = 0.0f; - g_CurrentPlayer->field_1278 = 0.0f; - g_CurrentPlayer->field_127C = 0.0f; + g_CurrentPlayer->swayoffset0 = 0.0f; + g_CurrentPlayer->swayoffset2 = 0.0f; g_CurrentPlayer->crouchpos = CROUCH_STAND; g_CurrentPlayer->autocrouchpos = CROUCH_STAND; g_CurrentPlayer->ducking_height_offset = 0.0f; @@ -1849,11 +1463,11 @@ void init_player_BONDdata(void) g_CurrentPlayer->insightaimmode = 0; g_CurrentPlayer->autoyaimenabled = 1; g_CurrentPlayer->autoaimy = 0.0f; - g_CurrentPlayer->autoyaimtime = 0; + g_CurrentPlayer->autoaim_target_y = NULL; g_CurrentPlayer->autoyaimtime60 = -1; g_CurrentPlayer->autoxaimenabled = 1; g_CurrentPlayer->autoaimx = 0.0f; - g_CurrentPlayer->autoxaimtime = 0; + g_CurrentPlayer->autoaim_target_x = NULL; g_CurrentPlayer->autoxaimtime60 = -1; g_CurrentPlayer->colourscreenred = 0xff; g_CurrentPlayer->colourscreengreen = 0xff; @@ -1885,7 +1499,7 @@ void init_player_BONDdata(void) g_CurrentPlayer->pause_animation_counter = 0.0f; g_CurrentPlayer->pausing_flag = 0; g_CurrentPlayer->buttons_pressed = (u16)0; - g_CurrentPlayer->field_3B6 = (u16)0; + g_CurrentPlayer->prev_buttons_pressed = (u16)0; g_CurrentPlayer->field_29C0 = 15.0f; g_CurrentPlayer->field_2A04 = -1; g_CurrentPlayer->field_2A08 = 0.0f; @@ -1954,7 +1568,7 @@ void currentPlayerSetField00(s32 value) { * * Address 0x7F079A60. */ -void bondviewUpdateCurrentPlayerPosition(coord3d *pos, coord3d *pos2, coord3d *offset, StandTile *tile, coord3d *arg4) +void bondviewSetCurrentPlayerPosition(coord3d *pos, coord3d *pos2, coord3d *offset, StandTile *tile, coord3d *stan_walk_start) { StandTile *sp34; StandTile *sp30; @@ -1972,9 +1586,11 @@ void bondviewUpdateCurrentPlayerPosition(coord3d *pos, coord3d *pos2, coord3d *o || (g_CurrentPlayer->room_pointer == NULL)) { sp34 = tile; - if (walkTilesBetweenPoints_NoCallback((StandTile **) &sp34, arg4->f[0], arg4->f[2], pos->f[0], pos->f[2])) + if (walkTilesBetweenPoints_NoCallback((StandTile **) &sp34, stan_walk_start->f[0], stan_walk_start->f[2], pos->f[0], pos->f[2])) { - sub_GAME_7F0B0518(sp34, pos->f[0], pos->f[2]); + // @bug ...? This is either a bug or removed code, this function has no side effects. + // Return value should used to check if point is safe for stan. + stanTestPointWithinTileBoundsMaybe(sp34, pos->f[0], pos->f[2]); g_CurrentPlayer->room_pointer = sp34; } else @@ -2031,8 +1647,251 @@ void bondviewUpdateCurrentPlayerPosition(coord3d *pos, coord3d *pos2, coord3d *o ); } //*/ -void solo_char_load(void) { +#define ALIGN64_V3(val) (((val) | 0x3f) ^ 0x3f) +void solo_char_load(void) +{ + f32 hRot; + ModelFileHeader *pBody; + ModelFileHeader *pHead; + ModelFileHeader *p_leftHeader; + ModelFileHeader *bodyBuffer; + ModelFileHeader *headBuffer; + s32 totalsize; + s32 bodyBufSize; + s32 headBufSize; + WeaponObjRecord *p_rightHeader; + //? sp54; + s32 rhandweapID; + s32 body; + s32 head; + Model *model; + s32 numRecords; + ChrModelFileRecord *p_modelEntry; /* compiler-managed */ + ChrModelFileRecord *p_bodyEntry; + ChrModelFileRecord *p_headEntry; + ChrRecord *curChr; + ModelFileHeader *p_headHeader; + ModelFileHeader *p_headEntryHeader; + ModelFileHeader *p_rhandItemHeader; + ModelFileHeader *p_bodyEntryHeader; + ModelFileHeader *p_bodyHeader; + ModelFileHeader *p_lhandItemHeader; + s32 rhandPropID; + s32 bodyalignedSizeRemainPlus0x5F; + s32 bufferSizeRemain; + s32 folderBond; + //s32 numRecords; + s32 cuffId; + hRot = get_curplay_horizontal_rotation_in_degrees(); + curChr = g_CurrentPlayer->prop->chr; + if (curChr == NULL) + { + bodyBuffer = getPlayerWeaponBufferForHand(GUNRIGHT); + headBuffer = getPlayerWeaponBufferForHand(GUNLEFT); + totalsize = 0; + bodyBufSize = getSizeBufferWeaponInHand(GUNRIGHT); + headBufSize = getSizeBufferWeaponInHand(GUNLEFT); + //M2C_MEMCPY_ALIGNED(&sp54, &dummy_08_pp7_obj, 0x84); + //*(&sp54 + 0x84) = *(&dummy_08_pp7_obj + 0x84); + rhandweapID = get_item_in_hand_or_watch_menu(GUNRIGHT); + body = BODY_Formal_Wear; + head = HEAD_Male_Brosnan_Default; + model = NULL; + sub_GAME_7F07DE64(g_CurrentPlayer); + if (getPlayerCount() == 1) + { + folderBond = getSelectedFolderBond(); + cuffId = g_CurrentPlayer->bondtype; + switch (cuffId) /* switch 1 */ + { + case CUFF_BOILER: /* switch 1 */ + body = BODY_Special_Operations_Uniform; break; + case CUFF_JUNGLE: /* switch 1 */ + body = BODY_Jungle_Fatigues; break; + case CUFF_SNOW: /* switch 1 */ + body = BODY_Parka; break; + case CUFF_BROSNAN: /* switch 1 */ + body = BODY_Brosnan_Tuxedo; break; + case CUFF_CONNERY: /* switch 1 */ + body = BODY_Brosnan_Tuxedo; break; + case CUFF_DALTON: /* switch 1 */ + body = BODY_Brosnan_Tuxedo; break; + case CUFF_MOORE: /* switch 1 */ + body = BODY_Brosnan_Tuxedo; break; + case CUFF_FOLDER: /* switch 1 */ + switch (folderBond) /* switch 3; irregular */ + { + case 0: /* switch 3 */ + body = BODY_Brosnan_Tuxedo; break; + case 1: /* switch 3 */ + body = BODY_Brosnan_Tuxedo; break; + case 2: /* switch 3 */ + body = BODY_Brosnan_Tuxedo; break; + case 3: + body = BODY_Brosnan_Tuxedo; break; + } + break; + } + switch (folderBond) /* switch 4; irregular */ + { + case 0: /* switch 4 */ + switch (cuffId) /* switch 2 */ + { + case CUFF_BOILER: /* switch 2 */ + head = HEAD_Male_Brosnan_Boiler; break; + case CUFF_JUNGLE: /* switch 2 */ + head = HEAD_Male_Brosnan_Jungle; break; + case CUFF_BROSNAN: /* switch 2 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case CUFF_CONNERY: /* switch 2 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case CUFF_DALTON: /* switch 2 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case CUFF_MOORE: /* switch 2 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case CUFF_FOLDER: /* switch 2 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + } + break; + case 1: /* switch 4 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case 2: /* switch 4 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + case 3: /* switch 4 */ + head = HEAD_Male_Brosnan_Tuxedo; break; + } + } + else + { + head = get_player_mp_char_head(get_cur_playernum()); + body = get_player_mp_char_body(get_cur_playernum()); + } + if (g_CameraMode == CAMERAMODE_SWIRL) + { + rhandweapID = starting_right_weapon; + } + if (getPlayerCount() == 1) + { + remove_item_in_hand(GUNLEFT); + remove_item_in_hand(GUNRIGHT); + texInitPool(&texPool, headBuffer, headBufSize); + p_bodyHeader = get_ptr_itemheader_in_hand(GUNRIGHT); + + p_bodyEntry = &c_item_entries[body]; + p_bodyEntryHeader = p_bodyEntry->header; + + pBody = p_bodyHeader; + + p_bodyHeader->RootNode = p_bodyEntryHeader->RootNode; + p_bodyHeader->Skeleton = p_bodyEntryHeader->Skeleton; + p_bodyHeader->Switches = p_bodyEntryHeader->Switches; + p_bodyHeader->unkC = p_bodyEntryHeader->unkC; + p_bodyHeader->BoundingVolumeRadius = p_bodyEntryHeader->BoundingVolumeRadius; + p_bodyHeader->unk14 = p_bodyEntryHeader->unk14; + p_bodyHeader->Textures = p_bodyEntryHeader->Textures; + p_bodyHeader->isLoaded = p_bodyEntryHeader->isLoaded; + + p_modelEntry = p_bodyEntry; + load_object_fill_header(p_bodyHeader, p_bodyEntry->filename, bodyBuffer, bodyBufSize, &texPool); + + p_headEntry = &c_item_entries[head]; + p_headEntryHeader = p_headEntry->header; + + bufferSizeRemain = ALIGN64_V3(get_pc_buffer_remaining_value(p_modelEntry->filename) + 0x3F); + p_headHeader = bodyBuffer + bufferSizeRemain; + bodyalignedSizeRemainPlus0x5F = ALIGN64_V3(bufferSizeRemain + 0x5F); + + p_headHeader->RootNode = p_headEntryHeader->RootNode; + p_headHeader->Skeleton = p_headEntryHeader->Skeleton; + p_headHeader->Switches = p_headEntryHeader->Switches; + p_headHeader->unkC = p_headEntryHeader->unkC; + p_headHeader->BoundingVolumeRadius = p_headEntryHeader->BoundingVolumeRadius; + p_headHeader->unk14 = p_headEntryHeader->unk14; + p_headHeader->Textures = p_headEntryHeader->Textures; + p_headHeader->isLoaded = p_headEntryHeader->isLoaded; + + totalsize = bodyalignedSizeRemainPlus0x5F; + pHead = p_headHeader; + p_modelEntry = p_headEntry; + load_object_fill_header(p_headHeader, p_headEntry->filename, bodyBuffer + bodyalignedSizeRemainPlus0x5F, bodyBufSize - bodyalignedSizeRemainPlus0x5F, &texPool); + + bufferSizeRemain = ALIGN64_V3(get_pc_buffer_remaining_value(p_modelEntry->filename) + totalsize + 0x3F); + model = bodyBuffer + bufferSizeRemain; + totalsize = ALIGN64_V3(bufferSizeRemain + 0xFB); + + modelCalculateRwDataLen(pBody); + modelCalculateRwDataLen(pHead); + numRecords = pBody->numRecords + pHead->numRecords + 0xA; + + totalsize = ALIGN64_V3((numRecords * 4) + totalsize + 0x3F); + + animInit(model, pBody, bodyBuffer + totalsize); + model->Type = numRecords; //??? + //goto block_46; + //&c_item_entries[head]->header = pHead; + } + + pBody = &c_item_entries[body]->header; + if (&c_item_entries[body]->header->RootNode == NULL) + { + fileLoad(&c_item_entries[body]->header, &c_item_entries[body]->filename); + } + if (&c_item_entries[head]->header->RootNode == NULL) + { + pHead = &c_item_entries[head]->header; + fileLoad(&c_item_entries[head]->header, &c_item_entries[head]->filename); +//block_46: +// &c_item_entries[head]->header = pHead; + } + g_CurrentPlayer->ptr_char_objectinstance = makeonebody(body, head, pBody, &c_item_entries[head]->header/*pHead maybe?*/, 0, model); + + modelSetScale((Model *) g_CurrentPlayer->ptr_char_objectinstance, g_CurrentPlayer->ptr_char_objectinstance->unk14 * 0.97f); + init_GUARDdata_with_set_values(g_CurrentPlayer->prop, g_CurrentPlayer->ptr_char_objectinstance, &g_CurrentPlayer->prop->pos, hRot, g_CurrentPlayer->prop->stan, 0); + g_CurrentPlayer->prop->type = VIEWER; + g_CurrentPlayer->prop->chr->chrflags |= CHRFLAG_INIT; + setsuboffset(g_CurrentPlayer->ptr_char_objectinstance, &g_CurrentPlayer->prop->pos); + setsubroty(g_CurrentPlayer->ptr_char_objectinstance, hRot); + rhandPropID = getPropForHeldItem(rhandweapID); + if (rhandPropID >= 0) + { + if (getPlayerCount() == 1) + { + p_rightHeader = bodyBuffer + totalsize; + totalsize = ALIGN64_V3(totalsize + 0xC7); + p_lhandItemHeader = get_ptr_itemheader_in_hand(GUNLEFT); + p_rhandItemHeader = &PitemZ_entries[rhandPropID]->header; + p_leftHeader = p_lhandItemHeader; + p_lhandItemHeader->RootNode = p_rhandItemHeader->RootNode; + p_lhandItemHeader->Skeleton = p_rhandItemHeader->Skeleton; + p_lhandItemHeader->Switches = p_rhandItemHeader->Switches; + p_lhandItemHeader->unkC = p_rhandItemHeader->unkC; + p_lhandItemHeader->BoundingVolumeRadius = p_rhandItemHeader->BoundingVolumeRadius; + p_lhandItemHeader->unk14 = p_rhandItemHeader->unk14; + p_lhandItemHeader->Textures = p_rhandItemHeader->Textures; + p_lhandItemHeader->isLoaded = p_rhandItemHeader->isLoaded; + p_modelEntry = &PitemZ_entries[rhandPropID]; + load_object_fill_header(p_lhandItemHeader, &PitemZ_entries[rhandPropID]->filename, bodyBuffer + totalsize, bodyBufSize - totalsize, &texPool); + get_pc_buffer_remaining_value(p_modelEntry->filename); + modelCalculateRwDataLen(p_leftHeader); + } + else + { + p_rightHeader = NULL; + p_leftHeader = NULL; + } + something_with_generating_object(g_CurrentPlayer->prop->chr, rhandPropID, rhandweapID, 0, p_rightHeader, p_leftHeader); + } + chrlvIdleAnimationRelated7F023A94(g_CurrentPlayer->prop->chr, 0.0f); + return; + } + if (curChr->model->anim == NULL) + { + curChr->chrflags |= 1; + chrlvIdleAnimationRelated7F023A94(curChr, 0.0f); + setsuboffset(g_CurrentPlayer->ptr_char_objectinstance, &g_CurrentPlayer->prop->pos); + setsubroty(g_CurrentPlayer->ptr_char_objectinstance, hRot); + } } #else @@ -2424,7 +2283,7 @@ glabel solo_char_load /* 0AECC4 7F07A194 346B003F */ ori $t3, $v1, 0x3f /* 0AECC8 7F07A198 3979003F */ xori $t9, $t3, 0x3f /* 0AECCC 7F07A19C AFB900E8 */ sw $t9, 0xe8($sp) -/* 0AECD0 7F07A1A0 0FC1D7EB */ jal sub_GAME_7F075FAC +/* 0AECD0 7F07A1A0 0FC1D7EB */ jal animInit /* 0AECD4 7F07A1A4 AFA20030 */ sw $v0, 0x30($sp) /* 0AECD8 7F07A1A8 8FA20030 */ lw $v0, 0x30($sp) /* 0AECDC 7F07A1AC 8FAE0038 */ lw $t6, 0x38($sp) @@ -2518,7 +2377,7 @@ glabel solo_char_load /* 0AEE2C 7F07A2FC 8FA50114 */ lw $a1, 0x114($sp) /* 0AEE30 7F07A300 0FC1B34F */ jal setsubroty /* 0AEE34 7F07A304 8D6400D4 */ lw $a0, 0xd4($t3) -/* 0AEE38 7F07A308 0FC26C91 */ jal sub_GAME_7F09B244 +/* 0AEE38 7F07A308 0FC26C91 */ jal getPropForHeldItem /* 0AEE3C 7F07A30C 8FA40048 */ lw $a0, 0x48($sp) /* 0AEE40 7F07A310 04400045 */ bltz $v0, .L7F07A428 /* 0AEE44 7F07A314 AFA2004C */ sw $v0, 0x4c($sp) @@ -3016,7 +2875,7 @@ glabel solo_char_load /* 0AF2F4 7F07A784 346B003F */ ori $t3, $v1, 0x3f /* 0AF2F8 7F07A788 3979003F */ xori $t9, $t3, 0x3f /* 0AF2FC 7F07A78C AFB900E8 */ sw $t9, 0xe8($sp) -/* 0AF300 7F07A790 0FC1D967 */ jal sub_GAME_7F075FAC +/* 0AF300 7F07A790 0FC1D967 */ jal animInit /* 0AF304 7F07A794 AFA20030 */ sw $v0, 0x30($sp) /* 0AF308 7F07A798 8FA20030 */ lw $v0, 0x30($sp) /* 0AF30C 7F07A79C 8FAE0038 */ lw $t6, 0x38($sp) @@ -3123,7 +2982,7 @@ glabel solo_char_load /* 0AF48C 7F07A91C A0580006 */ sb $t8, 6($v0) /* 0AF490 7F07A920 8FAF0044 */ lw $t7, 0x44($sp) /* 0AF494 7F07A924 A04F000F */ sb $t7, 0xf($v0) -/* 0AF498 7F07A928 0FC26F79 */ jal sub_GAME_7F09B244 +/* 0AF498 7F07A928 0FC26F79 */ jal getPropForHeldItem /* 0AF49C 7F07A92C 8FA40048 */ lw $a0, 0x48($sp) /* 0AF4A0 7F07A930 04400045 */ bltz $v0, .Ljp7F07AA48 /* 0AF4A4 7F07A934 AFA2004C */ sw $v0, 0x4c($sp) @@ -3619,7 +3478,7 @@ glabel solo_char_load /* 0ACBF4 7F07A204 346B003F */ ori $t3, $v1, 0x3f /* 0ACBF8 7F07A208 3979003F */ xori $t9, $t3, 0x3f /* 0ACBFC 7F07A20C AFB900E8 */ sw $t9, 0xe8($sp) -/* 0ACC00 7F07A210 0FC1D80A */ jal sub_GAME_7F075FAC +/* 0ACC00 7F07A210 0FC1D80A */ jal animInit /* 0ACC04 7F07A214 AFA20030 */ sw $v0, 0x30($sp) /* 0ACC08 7F07A218 8FA20030 */ lw $v0, 0x30($sp) /* 0ACC0C 7F07A21C 8FAE0038 */ lw $t6, 0x38($sp) @@ -3726,7 +3585,7 @@ glabel solo_char_load /* 0ACD8C 7F07A39C A0580006 */ sb $t8, 6($v0) /* 0ACD90 7F07A3A0 8FAF0044 */ lw $t7, 0x44($sp) /* 0ACD94 7F07A3A4 A04F000F */ sb $t7, 0xf($v0) -/* 0ACD98 7F07A3A8 0FC269E1 */ jal sub_GAME_7F09B244 +/* 0ACD98 7F07A3A8 0FC269E1 */ jal getPropForHeldItem /* 0ACD9C 7F07A3AC 8FA40048 */ lw $a0, 0x48($sp) /* 0ACDA0 7F07A3B0 04400043 */ bltz $v0, .L7F07A4C0 /* 0ACDA4 7F07A3B4 AFA2004C */ sw $v0, 0x4c($sp) @@ -3993,7 +3852,7 @@ glabel sub_GAME_7F07A534 /* 0AF1FC 7F07A6CC E7BA0018 */ swc1 $f26, 0x18($sp) /* 0AF200 7F07A6D0 02A02025 */ move $a0, $s5 /* 0AF204 7F07A6D4 8FA700B0 */ lw $a3, 0xb0($sp) -/* 0AF208 7F07A6D8 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0AF208 7F07A6D8 0FC2C389 */ jal stanTestLineUnobstructed /* 0AF20C 7F07A6DC E7A60010 */ swc1 $f6, 0x10($sp) /* 0AF210 7F07A6E0 00408025 */ move $s0, $v0 /* 0AF214 7F07A6E4 02802025 */ move $a0, $s4 @@ -4078,7 +3937,7 @@ glabel sub_GAME_7F07A534 /* 0AF344 7F07A814 E7BA0018 */ swc1 $f26, 0x18($sp) /* 0AF348 7F07A818 02A02025 */ move $a0, $s5 /* 0AF34C 7F07A81C 8E270000 */ lw $a3, ($s1) -/* 0AF350 7F07A820 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0AF350 7F07A820 0FC2C389 */ jal stanTestLineUnobstructed /* 0AF354 7F07A824 E7A40010 */ swc1 $f4, 0x10($sp) /* 0AF358 7F07A828 00408025 */ move $s0, $v0 /* 0AF35C 7F07A82C 02802025 */ move $a0, $s4 @@ -4092,7 +3951,7 @@ glabel sub_GAME_7F07A534 /* 0AF37C 7F07A84C 8E250000 */ lw $a1, ($s1) /* 0AF380 7F07A850 8E260008 */ lw $a2, 8($s1) /* 0AF384 7F07A854 E7BA0014 */ swc1 $f26, 0x14($sp) -/* 0AF388 7F07A858 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 0AF388 7F07A858 0FC2C62E */ jal stanTestVolume /* 0AF38C 7F07A85C E7BE0018 */ swc1 $f30, 0x18($sp) /* 0AF390 7F07A860 04410029 */ bgez $v0, .L7F07A908 /* 0AF394 7F07A864 8FA400C8 */ lw $a0, 0xc8($sp) @@ -4235,7 +4094,7 @@ void set_camera_mode(s32 arg0) s32 phi_s0; g_CameraMode = arg0; - enable_move_after_cinema = 0; + g_CameraAfterCinema = 0; temp_v0 = g_CameraMode; if (temp_v0 == 1) { @@ -4259,10 +4118,10 @@ void set_camera_mode(s32 arg0) } if (temp_v0 == 9) { - flt_CODE_bss_80079E04 = 0.0f; - flt_CODE_bss_80079E08 = -90.0f; - flt_CODE_bss_80079E0C = 0.0f; - flt_CODE_bss_80079E10 = 80.0f; + g_MpSwirlRotateSpeed = 0.0f; + g_MpSwirlAngleDegrees = -90.0f; + g_MpSwirlForwardSpeed = 0.0f; + g_MpSwirlDistance = 80.0f; load_enviroment(bossGetStageNum(0), 0); return; } @@ -4325,9 +4184,9 @@ void set_camera_mode(s32 arg0) D_800364A8 = 1; currentPlayerSetFadeColour(0, 0, 0, 0x3F800000); currentPlayerSetFadeFrac(0x42700000, 0); - temp_v0_4 = D_8003648C; + temp_v0_4 = g_ExplodeTankOnDeathFlag; phi_v0 = temp_v0_4; - if ((temp_v0_4 != 0) && (ptr_playerstank != 0)) + if ((temp_v0_4 != 0) && (g_PlayerTankProp != 0)) { } else @@ -4372,9 +4231,9 @@ void set_camera_mode(s32 arg0) temp_v0_11 = pPlayer; setsuboffset(temp_v0_11->unkD4, temp_v0_11->unkA8 + 8); setsubroty(pPlayer->unkD4, get_curplay_horizontal_rotation_in_degrees()); - phi_v0 = D_8003648C; + phi_v0 = g_ExplodeTankOnDeathFlag; } - if ((phi_v0 != 0) && (temp_a0 = ptr_playerstank, (temp_a0 != 0))) + if ((phi_v0 != 0) && (temp_a0 = g_PlayerTankProp, (temp_a0 != 0))) { sp64 = temp_a0; sp58 = temp_a0->unk8; @@ -4403,14 +4262,14 @@ void set_camera_mode(s32 arg0) } if (sub_GAME_7F07A534(sp64, &sp58, phi_a2, &sp48, phi_v1, phi_f0) != 0) { - if (D_80036510 == 0) + if (D_80036510 == CAMERAMODE_NONE) { musicTrack1Play(M_INTROSWOOSH); sndSetScalerApplyVolumeAllSfxSlot(0x3F000000); } - if ((D_8003648C != 0) && (ptr_playerstank != 0)) + if ((g_ExplodeTankOnDeathFlag != 0) && (g_PlayerTankProp != 0)) { - temp_a0_2 = ptr_playerstank; + temp_a0_2 = g_PlayerTankProp; explosionCreate(temp_a0_2, temp_a0_2 + 8, temp_a0_2->unk14, 0xD, 0, get_cur_playernum(), temp_a0_2 + 0x2C, 0); return; } @@ -4464,8 +4323,8 @@ glabel set_camera_mode /* 0AF4F0 7F07A9C0 3C108003 */ lui $s0, %hi(g_CameraMode) /* 0AF4F4 7F07A9C4 26106494 */ addiu $s0, %lo(g_CameraMode) # addiu $s0, $s0, 0x6494 /* 0AF4F8 7F07A9C8 AE040000 */ sw $a0, ($s0) -/* 0AF4FC 7F07A9CC 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0AF500 7F07A9D0 AC206498 */ sw $zero, %lo(enable_move_after_cinema)($at) +/* 0AF4FC 7F07A9CC 3C018003 */ lui $at, %hi(g_CameraAfterCinema) +/* 0AF500 7F07A9D0 AC206498 */ sw $zero, %lo(g_CameraAfterCinema)($at) /* 0AF504 7F07A9D4 8E020000 */ lw $v0, ($s0) /* 0AF508 7F07A9D8 24030001 */ li $v1, 1 /* 0AF50C 7F07A9DC AFBF002C */ sw $ra, 0x2c($sp) @@ -4530,19 +4389,19 @@ glabel set_camera_mode /* 0AF5EC 7F07AABC 54410015 */ bnel $v0, $at, .L7F07AB14 /* 0AF5F0 7F07AAC0 24010003 */ li $at, 3 /* 0AF5F4 7F07AAC4 44800000 */ mtc1 $zero, $f0 -/* 0AF5F8 7F07AAC8 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E04) -/* 0AF5FC 7F07AACC E4209E04 */ swc1 $f0, %lo(flt_CODE_bss_80079E04)($at) +/* 0AF5F8 7F07AAC8 3C018008 */ lui $at, %hi(g_MpSwirlRotateSpeed) +/* 0AF5FC 7F07AACC E4209E04 */ swc1 $f0, %lo(g_MpSwirlRotateSpeed)($at) /* 0AF600 7F07AAD0 3C01C2B4 */ li $at, 0xC2B40000 # -90.000000 /* 0AF604 7F07AAD4 44813000 */ mtc1 $at, $f6 -/* 0AF608 7F07AAD8 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E08) -/* 0AF60C 7F07AADC E4269E08 */ swc1 $f6, %lo(flt_CODE_bss_80079E08)($at) -/* 0AF610 7F07AAE0 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E0C) -/* 0AF614 7F07AAE4 E4209E0C */ swc1 $f0, %lo(flt_CODE_bss_80079E0C)($at) +/* 0AF608 7F07AAD8 3C018008 */ lui $at, %hi(g_MpSwirlAngleDegrees) +/* 0AF60C 7F07AADC E4269E08 */ swc1 $f6, %lo(g_MpSwirlAngleDegrees)($at) +/* 0AF610 7F07AAE0 3C018008 */ lui $at, %hi(g_MpSwirlForwardSpeed) +/* 0AF614 7F07AAE4 E4209E0C */ swc1 $f0, %lo(g_MpSwirlForwardSpeed)($at) /* 0AF618 7F07AAE8 3C0142A0 */ li $at, 0x42A00000 # 80.000000 /* 0AF61C 7F07AAEC 44814000 */ mtc1 $at, $f8 -/* 0AF620 7F07AAF0 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E10) +/* 0AF620 7F07AAF0 3C018008 */ lui $at, %hi(g_MpSwirlDistance) /* 0AF624 7F07AAF4 0C001A57 */ jal bossGetStageNum -/* 0AF628 7F07AAF8 E4289E10 */ swc1 $f8, %lo(flt_CODE_bss_80079E10)($at) +/* 0AF628 7F07AAF8 E4289E10 */ swc1 $f8, %lo(g_MpSwirlDistance)($at) /* 0AF62C 7F07AAFC 00402025 */ move $a0, $v0 /* 0AF630 7F07AB00 0FC2EA99 */ jal fogLoadLevelEnvironment /* 0AF634 7F07AB04 00002825 */ move $a1, $zero @@ -4724,13 +4583,13 @@ glabel set_camera_mode /* 0AF8D0 7F07ADA0 44807000 */ mtc1 $zero, $f14 /* 0AF8D4 7F07ADA4 0FC20216 */ jal currentPlayerSetFadeFrac /* 0AF8D8 7F07ADA8 00000000 */ nop -/* 0AF8DC 7F07ADAC 3C028003 */ lui $v0, %hi(D_8003648C) -/* 0AF8E0 7F07ADB0 8C42648C */ lw $v0, %lo(D_8003648C)($v0) +/* 0AF8DC 7F07ADAC 3C028003 */ lui $v0, %hi(g_ExplodeTankOnDeathFlag) +/* 0AF8E0 7F07ADB0 8C42648C */ lw $v0, %lo(g_ExplodeTankOnDeathFlag)($v0) /* 0AF8E4 7F07ADB4 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 0AF8E8 7F07ADB8 3C0C8003 */ lui $t4, %hi(ptr_playerstank) +/* 0AF8E8 7F07ADB8 3C0C8003 */ lui $t4, %hi(g_PlayerTankProp) /* 0AF8EC 7F07ADBC 10400007 */ beqz $v0, .L7F07ADDC /* 0AF8F0 7F07ADC0 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 0AF8F4 7F07ADC4 8D8C6450 */ lw $t4, %lo(ptr_playerstank)($t4) +/* 0AF8F4 7F07ADC4 8D8C6450 */ lw $t4, %lo(g_PlayerTankProp)($t4) /* 0AF8F8 7F07ADC8 11800004 */ beqz $t4, .L7F07ADDC /* 0AF8FC 7F07ADCC 00000000 */ nop /* 0AF900 7F07ADD0 3C108008 */ lui $s0, %hi(g_CurrentPlayer) @@ -4827,13 +4686,13 @@ glabel set_camera_mode /* 0AFA64 7F07AF34 44050000 */ mfc1 $a1, $f0 /* 0AFA68 7F07AF38 0FC1B34F */ jal setsubroty /* 0AFA6C 7F07AF3C 8D2400D4 */ lw $a0, 0xd4($t1) -/* 0AFA70 7F07AF40 3C028003 */ lui $v0, %hi(D_8003648C) -/* 0AFA74 7F07AF44 8C42648C */ lw $v0, %lo(D_8003648C)($v0) +/* 0AFA70 7F07AF40 3C028003 */ lui $v0, %hi(g_ExplodeTankOnDeathFlag) +/* 0AFA74 7F07AF44 8C42648C */ lw $v0, %lo(g_ExplodeTankOnDeathFlag)($v0) .L7F07AF48: /* 0AFA78 7F07AF48 10400017 */ beqz $v0, .L7F07AFA8 /* 0AFA7C 7F07AF4C 27A50058 */ addiu $a1, $sp, 0x58 -/* 0AFA80 7F07AF50 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0AFA84 7F07AF54 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) +/* 0AFA80 7F07AF50 3C048003 */ lui $a0, %hi(g_PlayerTankProp) +/* 0AFA84 7F07AF54 8C846450 */ lw $a0, %lo(g_PlayerTankProp)($a0) /* 0AFA88 7F07AF58 50800014 */ beql $a0, $zero, .L7F07AFAC /* 0AFA8C 7F07AF5C 8E020000 */ lw $v0, ($s0) /* 0AFA90 7F07AF60 AFA40064 */ sw $a0, 0x64($sp) @@ -4893,18 +4752,18 @@ glabel set_camera_mode /* 0AFB5C 7F07B02C 0C00248E */ jal sndSetScalerApplyVolumeAllSfxSlot /* 0AFB60 7F07B030 00000000 */ nop .L7F07B034: -/* 0AFB64 7F07B034 3C0C8003 */ lui $t4, %hi(D_8003648C) -/* 0AFB68 7F07B038 8D8C648C */ lw $t4, %lo(D_8003648C)($t4) -/* 0AFB6C 7F07B03C 3C0E8003 */ lui $t6, %hi(ptr_playerstank) +/* 0AFB64 7F07B034 3C0C8003 */ lui $t4, %hi(g_ExplodeTankOnDeathFlag) +/* 0AFB68 7F07B038 8D8C648C */ lw $t4, %lo(g_ExplodeTankOnDeathFlag)($t4) +/* 0AFB6C 7F07B03C 3C0E8003 */ lui $t6, %hi(g_PlayerTankProp) /* 0AFB70 7F07B040 51800054 */ beql $t4, $zero, .L7F07B194 /* 0AFB74 7F07B044 8FBF002C */ lw $ra, 0x2c($sp) -/* 0AFB78 7F07B048 8DCE6450 */ lw $t6, %lo(ptr_playerstank)($t6) +/* 0AFB78 7F07B048 8DCE6450 */ lw $t6, %lo(g_PlayerTankProp)($t6) /* 0AFB7C 7F07B04C 51C00051 */ beql $t6, $zero, .L7F07B194 /* 0AFB80 7F07B050 8FBF002C */ lw $ra, 0x2c($sp) /* 0AFB84 7F07B054 0FC26C54 */ jal get_cur_playernum /* 0AFB88 7F07B058 00000000 */ nop -/* 0AFB8C 7F07B05C 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0AFB90 7F07B060 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) +/* 0AFB8C 7F07B05C 3C048003 */ lui $a0, %hi(g_PlayerTankProp) +/* 0AFB90 7F07B060 8C846450 */ lw $a0, %lo(g_PlayerTankProp)($a0) /* 0AFB94 7F07B064 2407000D */ li $a3, 13 /* 0AFB98 7F07B068 8C860014 */ lw $a2, 0x14($a0) /* 0AFB9C 7F07B06C 248D002C */ addiu $t5, $a0, 0x2c @@ -5013,8 +4872,8 @@ glabel sub_GAME_7F07B1A4 /* 0AFCD8 7F07B1A8 24636494 */ addiu $v1, %lo(g_CameraMode) # addiu $v1, $v1, 0x6494 /* 0AFCDC 7F07B1AC 8C620000 */ lw $v0, ($v1) /* 0AFCE0 7F07B1B0 AC600000 */ sw $zero, ($v1) -/* 0AFCE4 7F07B1B4 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0AFCE8 7F07B1B8 AC206498 */ sw $zero, %lo(enable_move_after_cinema)($at) +/* 0AFCE4 7F07B1B4 3C018003 */ lui $at, %hi(g_CameraAfterCinema) +/* 0AFCE8 7F07B1B8 AC206498 */ sw $zero, %lo(g_CameraAfterCinema)($at) /* 0AFCEC 7F07B1BC 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0AFCF0 7F07B1C0 24010001 */ li $at, 1 /* 0AFCF4 7F07B1C4 14410005 */ bne $v0, $at, .L7F07B1DC @@ -5292,3340 +5151,448 @@ glabel sub_GAME_7F07B2A0 -#ifdef NONMATCHING -void sub_GAME_7F07B56C(void) { -} +/** + * US address 7F07B56C. + * JP address 7F07BB8C. + * EU address 7F07B604. +*/ +void bondviewFrozenCameraTick(u16 buttons, u16 oldbuttons, struct coord3d *pos, struct coord3d *pos2, struct coord3d *offset, StandTile **stan, struct coord3d *arg6) +{ + s32 i; + f32 sp38; + s32 i2; + f32 sp30 = 0.0f; + s32 padding2; + f32 zero = 0.0f; + void *p; + struct PadRecord *setupPad; + + if ((g_CameraMode == CAMERAMODE_INTRO) || (g_CameraMode == CAMERAMODE_FADESWIRL)) + { + if (g_CameraMode == CAMERAMODE_INTRO) + { + if ((D_800364A4 < 120.0f) && ((D_800364A4 + g_GlobalTimerDelta) >= 120.0f)) + { +#if defined(VERSION_US) + setFontTables(ptrFontZurichBoldChars, ptrFontZurichBold); + hudmsgBottomShow(ptr_random06cam_entry->lang1c.lang_ptr); #else - -#ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_80055044 -.word 0x43338000 /*179.5*/ -glabel D_80055048 -.word 0x3dcccccd /*0.1*/ -glabel D_8005504C -.word 0x3c75c28f /*0.015*/ -glabel D_80055050 -.word 0x40490fdb /*3.1415927*/ -glabel D_80055054 -.word 0x3da3d70a /*0.079999998*/ -glabel D_80055058 -.word 0x3da3d70a /*0.079999998*/ -glabel D_8005505C -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F07B56C -/* 0B009C 7F07B56C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B00A0 7F07B570 3C028003 */ lui $v0, %hi(g_CameraMode) -/* 0B00A4 7F07B574 8C426494 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0B00A8 7F07B578 240B0001 */ li $t3, 1 -/* 0B00AC 7F07B57C AFBF0014 */ sw $ra, 0x14($sp) -/* 0B00B0 7F07B580 AFA40040 */ sw $a0, 0x40($sp) -/* 0B00B4 7F07B584 AFA50044 */ sw $a1, 0x44($sp) -/* 0B00B8 7F07B588 AFA60048 */ sw $a2, 0x48($sp) -/* 0B00BC 7F07B58C 11620004 */ beq $t3, $v0, .L7F07B5A0 -/* 0B00C0 7F07B590 AFA7004C */ sw $a3, 0x4c($sp) -/* 0B00C4 7F07B594 24050002 */ li $a1, 2 -/* 0B00C8 7F07B598 14A200AF */ bne $a1, $v0, .L7F07B858 -/* 0B00CC 7F07B59C 24010009 */ li $at, 9 -.L7F07B5A0: -/* 0B00D0 7F07B5A0 15620059 */ bne $t3, $v0, .L7F07B708 -/* 0B00D4 7F07B5A4 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B00D8 7F07B5A8 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B00DC 7F07B5AC 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B00E0 7F07B5B0 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 0B00E4 7F07B5B4 44810000 */ mtc1 $at, $f0 -/* 0B00E8 7F07B5B8 C5420000 */ lwc1 $f2, ($t2) -/* 0B00EC 7F07B5BC 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B00F0 7F07B5C0 4600103C */ c.lt.s $f2, $f0 -/* 0B00F4 7F07B5C4 00000000 */ nop -/* 0B00F8 7F07B5C8 45000014 */ bc1f .L7F07B61C -/* 0B00FC 7F07B5CC 00000000 */ nop -/* 0B0100 7F07B5D0 C4248378 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B0104 7F07B5D4 3C048004 */ lui $a0, %hi(ptrSecondFontTableLarge) -/* 0B0108 7F07B5D8 3C058004 */ lui $a1, %hi(ptrFirstFontTableLarge) -/* 0B010C 7F07B5DC 46041180 */ add.s $f6, $f2, $f4 -/* 0B0110 7F07B5E0 4606003E */ c.le.s $f0, $f6 -/* 0B0114 7F07B5E4 00000000 */ nop -/* 0B0118 7F07B5E8 4500000C */ bc1f .L7F07B61C -/* 0B011C 7F07B5EC 00000000 */ nop -/* 0B0120 7F07B5F0 8C840EB8 */ lw $a0, %lo(ptrSecondFontTableLarge)($a0) -/* 0B0124 7F07B5F4 0FC228ED */ jal setFontTables -/* 0B0128 7F07B5F8 8CA50EB4 */ lw $a1, %lo(ptrFirstFontTableLarge)($a1) -/* 0B012C 7F07B5FC 3C0E8003 */ lui $t6, %hi(ptr_random06cam_entry) -/* 0B0130 7F07B600 8DCE64C0 */ lw $t6, %lo(ptr_random06cam_entry)($t6) -/* 0B0134 7F07B604 0FC228F2 */ jal hudmsgBottomShow -/* 0B0138 7F07B608 8DC4001C */ lw $a0, 0x1c($t6) -/* 0B013C 7F07B60C 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B0140 7F07B610 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0144 7F07B614 C5420000 */ lwc1 $f2, ($t2) -/* 0B0148 7F07B618 240B0001 */ li $t3, 1 -.L7F07B61C: -/* 0B014C 7F07B61C 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) -/* 0B0150 7F07B620 8DEF64C0 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B0154 7F07B624 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B0158 7F07B628 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B015C 7F07B62C 8DE40020 */ lw $a0, 0x20($t7) -/* 0B0160 7F07B630 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B0164 7F07B634 46081000 */ add.s $f0, $f2, $f8 -/* 0B0168 7F07B638 5080001F */ beql $a0, $zero, .L7F07B6B8 -/* 0B016C 7F07B63C 44816000 */ mtc1 $at, $f12 -/* 0B0170 7F07B640 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B0174 7F07B644 44816000 */ mtc1 $at, $f12 -/* 0B0178 7F07B648 00000000 */ nop -/* 0B017C 7F07B64C 460C103C */ c.lt.s $f2, $f12 -/* 0B0180 7F07B650 00000000 */ nop -/* 0B0184 7F07B654 4502000F */ bc1fl .L7F07B694 -/* 0B0188 7F07B658 3C0143F0 */ lui $at, 0x43f0 -/* 0B018C 7F07B65C 4600603E */ c.le.s $f12, $f0 -/* 0B0190 7F07B660 00000000 */ nop -/* 0B0194 7F07B664 4502000B */ bc1fl .L7F07B694 -/* 0B0198 7F07B668 3C0143F0 */ lui $at, 0x43f0 -/* 0B019C 7F07B66C 0FC228F2 */ jal hudmsgBottomShow -/* 0B01A0 7F07B670 00000000 */ nop -/* 0B01A4 7F07B674 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B01A8 7F07B678 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B01AC 7F07B67C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B01B0 7F07B680 C42A8378 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0B01B4 7F07B684 C5420000 */ lwc1 $f2, ($t2) -/* 0B01B8 7F07B688 240B0001 */ li $t3, 1 -/* 0B01BC 7F07B68C 460A1000 */ add.s $f0, $f2, $f10 -/* 0B01C0 7F07B690 3C0143F0 */ li $at, 0x43F00000 # 480.000000 -.L7F07B694: -/* 0B01C4 7F07B694 44812000 */ mtc1 $at, $f4 -/* 0B01C8 7F07B698 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B01CC 7F07B69C 4602203C */ c.lt.s $f4, $f2 -/* 0B01D0 7F07B6A0 00000000 */ nop -/* 0B01D4 7F07B6A4 4500000A */ bc1f .L7F07B6D0 -/* 0B01D8 7F07B6A8 00000000 */ nop -/* 0B01DC 7F07B6AC 10000008 */ b .L7F07B6D0 -/* 0B01E0 7F07B6B0 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B01E4 7F07B6B4 44816000 */ mtc1 $at, $f12 -.L7F07B6B8: -/* 0B01E8 7F07B6B8 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B01EC 7F07B6BC 4602603C */ c.lt.s $f12, $f2 -/* 0B01F0 7F07B6C0 00000000 */ nop -/* 0B01F4 7F07B6C4 45000002 */ bc1f .L7F07B6D0 -/* 0B01F8 7F07B6C8 00000000 */ nop -/* 0B01FC 7F07B6CC AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07B6D0: -/* 0B0200 7F07B6D0 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0B0204 7F07B6D4 E5400000 */ swc1 $f0, ($t2) -/* 0B0208 7F07B6D8 14400015 */ bnez $v0, .L7F07B730 -/* 0B020C 7F07B6DC 240B0001 */ li $t3, 1 -/* 0B0210 7F07B6E0 97B90046 */ lhu $t9, 0x46($sp) -/* 0B0214 7F07B6E4 97B80042 */ lhu $t8, 0x42($sp) -/* 0B0218 7F07B6E8 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B021C 7F07B6EC 03206027 */ not $t4, $t9 -/* 0B0220 7F07B6F0 030C6824 */ and $t5, $t8, $t4 -/* 0B0224 7F07B6F4 31AEF030 */ andi $t6, $t5, 0xf030 -/* 0B0228 7F07B6F8 11C0000D */ beqz $t6, .L7F07B730 -/* 0B022C 7F07B6FC 00000000 */ nop -/* 0B0230 7F07B700 1000000B */ b .L7F07B730 -/* 0B0234 7F07B704 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07B708: -/* 0B0238 7F07B708 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B023C 7F07B70C 8D2F0000 */ lw $t7, ($t1) -/* 0B0240 7F07B710 44807000 */ mtc1 $zero, $f14 -/* 0B0244 7F07B714 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0248 7F07B718 C5E603E4 */ lwc1 $f6, 0x3e4($t7) -/* 0B024C 7F07B71C 460E303C */ c.lt.s $f6, $f14 -/* 0B0250 7F07B720 00000000 */ nop -/* 0B0254 7F07B724 45000002 */ bc1f .L7F07B730 -/* 0B0258 7F07B728 00000000 */ nop -/* 0B025C 7F07B72C AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07B730: -/* 0B0260 7F07B730 3C028003 */ lui $v0, %hi(ptr_random06cam_entry) -/* 0B0264 7F07B734 244264C0 */ addiu $v0, %lo(ptr_random06cam_entry) # addiu $v0, $v0, 0x64c0 -/* 0B0268 7F07B738 8C590000 */ lw $t9, ($v0) -/* 0B026C 7F07B73C 8FB80048 */ lw $t8, 0x48($sp) -/* 0B0270 7F07B740 C7280004 */ lwc1 $f8, 4($t9) -/* 0B0274 7F07B744 E7080000 */ swc1 $f8, ($t8) -/* 0B0278 7F07B748 8C4C0000 */ lw $t4, ($v0) -/* 0B027C 7F07B74C C58A0008 */ lwc1 $f10, 8($t4) -/* 0B0280 7F07B750 E70A0004 */ swc1 $f10, 4($t8) -/* 0B0284 7F07B754 8C4D0000 */ lw $t5, ($v0) -/* 0B0288 7F07B758 C5A4000C */ lwc1 $f4, 0xc($t5) -/* 0B028C 7F07B75C E7040008 */ swc1 $f4, 8($t8) -/* 0B0290 7F07B760 8C4E0000 */ lw $t6, ($v0) -/* 0B0294 7F07B764 0FC15FA8 */ jal cosf -/* 0B0298 7F07B768 C5CC0014 */ lwc1 $f12, 0x14($t6) -/* 0B029C 7F07B76C 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) -/* 0B02A0 7F07B770 8DEF64C0 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B02A4 7F07B774 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B02A8 7F07B778 0FC15FAB */ jal sinf -/* 0B02AC 7F07B77C C5EC0010 */ lwc1 $f12, 0x10($t7) -/* 0B02B0 7F07B780 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0B02B4 7F07B784 8FB90048 */ lw $t9, 0x48($sp) -/* 0B02B8 7F07B788 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B02BC 7F07B78C 46060202 */ mul.s $f8, $f0, $f6 -/* 0B02C0 7F07B790 C72A0000 */ lwc1 $f10, ($t9) -/* 0B02C4 7F07B794 3C0D8003 */ lui $t5, %hi(ptr_random06cam_entry) -/* 0B02C8 7F07B798 460A4100 */ add.s $f4, $f8, $f10 -/* 0B02CC 7F07B79C E5840000 */ swc1 $f4, ($t4) -/* 0B02D0 7F07B7A0 8DAD64C0 */ lw $t5, %lo(ptr_random06cam_entry)($t5) -/* 0B02D4 7F07B7A4 0FC15FAB */ jal sinf -/* 0B02D8 7F07B7A8 C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B02DC 7F07B7AC 8FB80048 */ lw $t8, 0x48($sp) -/* 0B02E0 7F07B7B0 8FAE004C */ lw $t6, 0x4c($sp) -/* 0B02E4 7F07B7B4 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) -/* 0B02E8 7F07B7B8 C7060004 */ lwc1 $f6, 4($t8) -/* 0B02EC 7F07B7BC 46060200 */ add.s $f8, $f0, $f6 -/* 0B02F0 7F07B7C0 E5C80004 */ swc1 $f8, 4($t6) -/* 0B02F4 7F07B7C4 8DEF64C0 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B02F8 7F07B7C8 0FC15FA8 */ jal cosf -/* 0B02FC 7F07B7CC C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0B0300 7F07B7D0 3C198003 */ lui $t9, %hi(ptr_random06cam_entry) -/* 0B0304 7F07B7D4 8F3964C0 */ lw $t9, %lo(ptr_random06cam_entry)($t9) -/* 0B0308 7F07B7D8 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B030C 7F07B7DC 0FC15FA8 */ jal cosf -/* 0B0310 7F07B7E0 C72C0010 */ lwc1 $f12, 0x10($t9) -/* 0B0314 7F07B7E4 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B0318 7F07B7E8 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B031C 7F07B7EC 8FAD004C */ lw $t5, 0x4c($sp) -/* 0B0320 7F07B7F0 46040182 */ mul.s $f6, $f0, $f4 -/* 0B0324 7F07B7F4 C58A0008 */ lwc1 $f10, 8($t4) -/* 0B0328 7F07B7F8 8FA30058 */ lw $v1, 0x58($sp) -/* 0B032C 7F07B7FC 3C188003 */ lui $t8, %hi(ptr_random06cam_entry) -/* 0B0330 7F07B800 3C198007 */ lui $t9, %hi(g_CurrentSetup+0x18) -/* 0B0334 7F07B804 46065201 */ sub.s $f8, $f10, $f6 -/* 0B0338 7F07B808 E5A80008 */ swc1 $f8, 8($t5) -/* 0B033C 7F07B80C 8F1864C0 */ lw $t8, %lo(ptr_random06cam_entry)($t8) -/* 0B0340 7F07B810 8F395D18 */ lw $t9, %lo(g_CurrentSetup+0x18)($t9) -/* 0B0344 7F07B814 8FAD0054 */ lw $t5, 0x54($sp) -/* 0B0348 7F07B818 8F0E0018 */ lw $t6, 0x18($t8) -/* 0B034C 7F07B81C 000E7880 */ sll $t7, $t6, 2 -/* 0B0350 7F07B820 01EE7823 */ subu $t7, $t7, $t6 -/* 0B0354 7F07B824 000F7880 */ sll $t7, $t7, 2 -/* 0B0358 7F07B828 01EE7823 */ subu $t7, $t7, $t6 -/* 0B035C 7F07B82C 000F7880 */ sll $t7, $t7, 2 -/* 0B0360 7F07B830 01F91021 */ addu $v0, $t7, $t9 -/* 0B0364 7F07B834 8C4C0028 */ lw $t4, 0x28($v0) -/* 0B0368 7F07B838 ADAC0000 */ sw $t4, ($t5) -/* 0B036C 7F07B83C C4440000 */ lwc1 $f4, ($v0) -/* 0B0370 7F07B840 E4640000 */ swc1 $f4, ($v1) -/* 0B0374 7F07B844 C44A0004 */ lwc1 $f10, 4($v0) -/* 0B0378 7F07B848 E46A0004 */ swc1 $f10, 4($v1) -/* 0B037C 7F07B84C C4460008 */ lwc1 $f6, 8($v0) -/* 0B0380 7F07B850 10000337 */ b .L7F07C530 -/* 0B0384 7F07B854 E4660008 */ swc1 $f6, 8($v1) -.L7F07B858: -/* 0B0388 7F07B858 544100B3 */ bnel $v0, $at, .L7F07BB28 -/* 0B038C 7F07B85C 24010003 */ li $at, 3 -/* 0B0390 7F07B860 0FC26C54 */ jal get_cur_playernum -/* 0B0394 7F07B864 00000000 */ nop -/* 0B0398 7F07B868 0FC26D36 */ jal sub_GAME_7F09B4D8 -/* 0B039C 7F07B86C 00402025 */ move $a0, $v0 -/* 0B03A0 7F07B870 14400054 */ bnez $v0, .L7F07B9C4 -/* 0B03A4 7F07B874 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B03A8 7F07B878 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B03AC 7F07B87C 8CE78374 */ lw $a3, %lo(g_ClockTimer)($a3) -/* 0B03B0 7F07B880 00001825 */ move $v1, $zero -/* 0B03B4 7F07B884 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E08) -/* 0B03B8 7F07B888 18E0004E */ blez $a3, .L7F07B9C4 -/* 0B03BC 7F07B88C 3C068008 */ lui $a2, %hi(flt_CODE_bss_80079E04) -/* 0B03C0 7F07B890 C42C9E08 */ lwc1 $f12, %lo(flt_CODE_bss_80079E08)($at) -/* 0B03C4 7F07B894 3C018005 */ lui $at, %hi(D_80055044) -/* 0B03C8 7F07B898 C4325044 */ lwc1 $f18, %lo(D_80055044)($at) -/* 0B03CC 7F07B89C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B03D0 7F07B8A0 44818000 */ mtc1 $at, $f16 -/* 0B03D4 7F07B8A4 3C018005 */ lui $at, %hi(D_80055048) -/* 0B03D8 7F07B8A8 3C058008 */ lui $a1, %hi(flt_CODE_bss_80079E0C) -/* 0B03DC 7F07B8AC 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079E08) -/* 0B03E0 7F07B8B0 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) -/* 0B03E4 7F07B8B4 24429E10 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x61f0 -/* 0B03E8 7F07B8B8 24849E08 */ addiu $a0, %lo(flt_CODE_bss_80079E08) # addiu $a0, $a0, -0x61f8 -/* 0B03EC 7F07B8BC 24A59E0C */ addiu $a1, %lo(flt_CODE_bss_80079E0C) # addiu $a1, $a1, -0x61f4 -/* 0B03F0 7F07B8C0 C42E5048 */ lwc1 $f14, %lo(D_80055048)($at) -/* 0B03F4 7F07B8C4 24C69E04 */ addiu $a2, %lo(flt_CODE_bss_80079E04) # addiu $a2, $a2, -0x61fc -/* 0B03F8 7F07B8C8 4612603C */ c.lt.s $f12, $f18 -.L7F07B8CC: -/* 0B03FC 7F07B8CC 24630001 */ addiu $v1, $v1, 1 -/* 0B0400 7F07B8D0 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B0404 7F07B8D4 45020017 */ bc1fl .L7F07B934 -/* 0B0408 7F07B8D8 44812000 */ mtc1 $at, $f4 -/* 0B040C 7F07B8DC 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B0410 7F07B8E0 44814000 */ mtc1 $at, $f8 -/* 0B0414 7F07B8E4 3C0142DC */ li $at, 0x42DC0000 # 110.000000 -/* 0B0418 7F07B8E8 44815000 */ mtc1 $at, $f10 -/* 0B041C 7F07B8EC 4608603C */ c.lt.s $f12, $f8 -/* 0B0420 7F07B8F0 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0424 7F07B8F4 45020005 */ bc1fl .L7F07B90C -/* 0B0428 7F07B8F8 460C503C */ c.lt.s $f10, $f12 -/* 0B042C 7F07B8FC 460E0100 */ add.s $f4, $f0, $f14 -/* 0B0430 7F07B900 E4C40000 */ swc1 $f4, ($a2) -/* 0B0434 7F07B904 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0438 7F07B908 460C503C */ c.lt.s $f10, $f12 -.L7F07B90C: -/* 0B043C 7F07B90C 00000000 */ nop -/* 0B0440 7F07B910 45020005 */ bc1fl .L7F07B928 -/* 0B0444 7F07B914 46006200 */ add.s $f8, $f12, $f0 -/* 0B0448 7F07B918 460E0181 */ sub.s $f6, $f0, $f14 -/* 0B044C 7F07B91C E4C60000 */ swc1 $f6, ($a2) -/* 0B0450 7F07B920 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0454 7F07B924 46006200 */ add.s $f8, $f12, $f0 -.L7F07B928: -/* 0B0458 7F07B928 10000004 */ b .L7F07B93C -/* 0B045C 7F07B92C E4880000 */ swc1 $f8, ($a0) -/* 0B0460 7F07B930 44812000 */ mtc1 $at, $f4 -.L7F07B934: -/* 0B0464 7F07B934 00000000 */ nop -/* 0B0468 7F07B938 E4840000 */ swc1 $f4, ($a0) -.L7F07B93C: -/* 0B046C 7F07B93C 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -/* 0B0470 7F07B940 44815000 */ mtc1 $at, $f10 -/* 0B0474 7F07B944 C48C0000 */ lwc1 $f12, ($a0) -/* 0B0478 7F07B948 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B047C 7F07B94C 460C503C */ c.lt.s $f10, $f12 -/* 0B0480 7F07B950 00000000 */ nop -/* 0B0484 7F07B954 45020019 */ bc1fl .L7F07B9BC -/* 0B0488 7F07B958 0067082A */ slt $at, $v1, $a3 -/* 0B048C 7F07B95C C4400000 */ lwc1 $f0, ($v0) -/* 0B0490 7F07B960 44813000 */ mtc1 $at, $f6 -/* 0B0494 7F07B964 C4A20000 */ lwc1 $f2, ($a1) -/* 0B0498 7F07B968 3C018005 */ lui $at, %hi(D_8005504C) -/* 0B049C 7F07B96C 4600303C */ c.lt.s $f6, $f0 -/* 0B04A0 7F07B970 00000000 */ nop -/* 0B04A4 7F07B974 45000004 */ bc1f .L7F07B988 -/* 0B04A8 7F07B978 00000000 */ nop -/* 0B04AC 7F07B97C 460E1201 */ sub.s $f8, $f2, $f14 -/* 0B04B0 7F07B980 10000004 */ b .L7F07B994 -/* 0B04B4 7F07B984 E4A80000 */ swc1 $f8, ($a1) -.L7F07B988: -/* 0B04B8 7F07B988 C424504C */ lwc1 $f4, %lo(D_8005504C)($at) -/* 0B04BC 7F07B98C 46041280 */ add.s $f10, $f2, $f4 -/* 0B04C0 7F07B990 E4AA0000 */ swc1 $f10, ($a1) -.L7F07B994: -/* 0B04C4 7F07B994 C4A60000 */ lwc1 $f6, ($a1) -/* 0B04C8 7F07B998 46060200 */ add.s $f8, $f0, $f6 -/* 0B04CC 7F07B99C E4480000 */ swc1 $f8, ($v0) -/* 0B04D0 7F07B9A0 C4440000 */ lwc1 $f4, ($v0) -/* 0B04D4 7F07B9A4 4610203C */ c.lt.s $f4, $f16 -/* 0B04D8 7F07B9A8 00000000 */ nop -/* 0B04DC 7F07B9AC 45020003 */ bc1fl .L7F07B9BC -/* 0B04E0 7F07B9B0 0067082A */ slt $at, $v1, $a3 -/* 0B04E4 7F07B9B4 E4500000 */ swc1 $f16, ($v0) -/* 0B04E8 7F07B9B8 0067082A */ slt $at, $v1, $a3 -.L7F07B9BC: -/* 0B04EC 7F07B9BC 5420FFC3 */ bnezl $at, .L7F07B8CC -/* 0B04F0 7F07B9C0 4612603C */ c.lt.s $f12, $f18 -.L7F07B9C4: -/* 0B04F4 7F07B9C4 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B04F8 7F07B9C8 8D380000 */ lw $t8, ($t1) -/* 0B04FC 7F07B9CC 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079E08) -/* 0B0500 7F07B9D0 24849E08 */ addiu $a0, %lo(flt_CODE_bss_80079E08) # addiu $a0, $a0, -0x61f8 -/* 0B0504 7F07B9D4 C48A0000 */ lwc1 $f10, ($a0) -/* 0B0508 7F07B9D8 C7060148 */ lwc1 $f6, 0x148($t8) -/* 0B050C 7F07B9DC 3C018005 */ lui $at, %hi(D_80055050) -/* 0B0510 7F07B9E0 C4245050 */ lwc1 $f4, %lo(D_80055050)($at) -/* 0B0514 7F07B9E4 46065201 */ sub.s $f8, $f10, $f6 -/* 0B0518 7F07B9E8 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B051C 7F07B9EC 44813000 */ mtc1 $at, $f6 -/* 0B0520 7F07B9F0 46044282 */ mul.s $f10, $f8, $f4 -/* 0B0524 7F07B9F4 46065303 */ div.s $f12, $f10, $f6 -/* 0B0528 7F07B9F8 0FC15FAB */ jal sinf -/* 0B052C 7F07B9FC E7AC0038 */ swc1 $f12, 0x38($sp) -/* 0B0530 7F07BA00 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) -/* 0B0534 7F07BA04 24429E10 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x61f0 -/* 0B0538 7F07BA08 C4480000 */ lwc1 $f8, ($v0) -/* 0B053C 7F07BA0C 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0540 7F07BA10 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0544 7F07BA14 46080102 */ mul.s $f4, $f0, $f8 -/* 0B0548 7F07BA18 8D2E0000 */ lw $t6, ($t1) -/* 0B054C 7F07BA1C 8FA30048 */ lw $v1, 0x48($sp) -/* 0B0550 7F07BA20 C7AC0038 */ lwc1 $f12, 0x38($sp) -/* 0B0554 7F07BA24 C5CA04B4 */ lwc1 $f10, 0x4b4($t6) -/* 0B0558 7F07BA28 3C018005 */ lui $at, %hi(D_80055054) -/* 0B055C 7F07BA2C 460A2180 */ add.s $f6, $f4, $f10 -/* 0B0560 7F07BA30 E4660000 */ swc1 $f6, ($v1) -/* 0B0564 7F07BA34 C4245054 */ lwc1 $f4, %lo(D_80055054)($at) -/* 0B0568 7F07BA38 C4480000 */ lwc1 $f8, ($v0) -/* 0B056C 7F07BA3C 8D2F0000 */ lw $t7, ($t1) -/* 0B0570 7F07BA40 46044282 */ mul.s $f10, $f8, $f4 -/* 0B0574 7F07BA44 C5E604B8 */ lwc1 $f6, 0x4b8($t7) -/* 0B0578 7F07BA48 460A3200 */ add.s $f8, $f6, $f10 -/* 0B057C 7F07BA4C 0FC15FA8 */ jal cosf -/* 0B0580 7F07BA50 E4680004 */ swc1 $f8, 4($v1) -/* 0B0584 7F07BA54 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) -/* 0B0588 7F07BA58 24429E10 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x61f0 -/* 0B058C 7F07BA5C C4440000 */ lwc1 $f4, ($v0) -/* 0B0590 7F07BA60 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0594 7F07BA64 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0598 7F07BA68 46040182 */ mul.s $f6, $f0, $f4 -/* 0B059C 7F07BA6C 8D390000 */ lw $t9, ($t1) -/* 0B05A0 7F07BA70 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B05A4 7F07BA74 8FA30058 */ lw $v1, 0x58($sp) -/* 0B05A8 7F07BA78 C72A04BC */ lwc1 $f10, 0x4bc($t9) -/* 0B05AC 7F07BA7C 8FA4004C */ lw $a0, 0x4c($sp) -/* 0B05B0 7F07BA80 3C018005 */ lui $at, %hi(D_80055058) -/* 0B05B4 7F07BA84 460A3200 */ add.s $f8, $f6, $f10 -/* 0B05B8 7F07BA88 240B0001 */ li $t3, 1 -/* 0B05BC 7F07BA8C E5880008 */ swc1 $f8, 8($t4) -/* 0B05C0 7F07BA90 8D2D0000 */ lw $t5, ($t1) -/* 0B05C4 7F07BA94 C5A404B4 */ lwc1 $f4, 0x4b4($t5) -/* 0B05C8 7F07BA98 E4840000 */ swc1 $f4, ($a0) -/* 0B05CC 7F07BA9C 8D380000 */ lw $t8, ($t1) -/* 0B05D0 7F07BAA0 C70604B8 */ lwc1 $f6, 0x4b8($t8) -/* 0B05D4 7F07BAA4 E4860004 */ swc1 $f6, 4($a0) -/* 0B05D8 7F07BAA8 8D2E0000 */ lw $t6, ($t1) -/* 0B05DC 7F07BAAC C5CA04BC */ lwc1 $f10, 0x4bc($t6) -/* 0B05E0 7F07BAB0 E48A0008 */ swc1 $f10, 8($a0) -/* 0B05E4 7F07BAB4 8D2F0000 */ lw $t7, ($t1) -/* 0B05E8 7F07BAB8 8FAD0054 */ lw $t5, 0x54($sp) -/* 0B05EC 7F07BABC 8DF900A8 */ lw $t9, 0xa8($t7) -/* 0B05F0 7F07BAC0 8F2C0014 */ lw $t4, 0x14($t9) -/* 0B05F4 7F07BAC4 ADAC0000 */ sw $t4, ($t5) -/* 0B05F8 7F07BAC8 8D380000 */ lw $t8, ($t1) -/* 0B05FC 7F07BACC C70804B4 */ lwc1 $f8, 0x4b4($t8) -/* 0B0600 7F07BAD0 E4680000 */ swc1 $f8, ($v1) -/* 0B0604 7F07BAD4 C4440000 */ lwc1 $f4, ($v0) -/* 0B0608 7F07BAD8 C4265058 */ lwc1 $f6, %lo(D_80055058)($at) -/* 0B060C 7F07BADC 8D2E0000 */ lw $t6, ($t1) -/* 0B0610 7F07BAE0 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B0614 7F07BAE4 46062282 */ mul.s $f10, $f4, $f6 -/* 0B0618 7F07BAE8 C5C804B8 */ lwc1 $f8, 0x4b8($t6) -/* 0B061C 7F07BAEC 460A4100 */ add.s $f4, $f8, $f10 -/* 0B0620 7F07BAF0 44815000 */ mtc1 $at, $f10 -/* 0B0624 7F07BAF4 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0628 7F07BAF8 E4640004 */ swc1 $f4, 4($v1) -/* 0B062C 7F07BAFC 8D2F0000 */ lw $t7, ($t1) -/* 0B0630 7F07BB00 C5E604BC */ lwc1 $f6, 0x4bc($t7) -/* 0B0634 7F07BB04 E4660008 */ swc1 $f6, 8($v1) -/* 0B0638 7F07BB08 C4480000 */ lwc1 $f8, ($v0) -/* 0B063C 7F07BB0C 460A403C */ c.lt.s $f8, $f10 -/* 0B0640 7F07BB10 00000000 */ nop -/* 0B0644 7F07BB14 45020287 */ bc1fl .L7F07C534 -/* 0B0648 7F07BB18 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B064C 7F07BB1C 10000284 */ b .L7F07C530 -/* 0B0650 7F07BB20 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0654 7F07BB24 24010003 */ li $at, 3 -.L7F07BB28: -/* 0B0658 7F07BB28 144100CB */ bne $v0, $at, .L7F07BE58 -/* 0B065C 7F07BB2C 24030005 */ li $v1, 5 -/* 0B0660 7F07BB30 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B0664 7F07BB34 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0668 7F07BB38 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B066C 7F07BB3C C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B0670 7F07BB40 C5440000 */ lwc1 $f4, ($t2) -/* 0B0674 7F07BB44 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B0678 7F07BB48 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -/* 0B067C 7F07BB4C 46122180 */ add.s $f6, $f4, $f18 -/* 0B0680 7F07BB50 8D030000 */ lw $v1, ($t0) -/* 0B0684 7F07BB54 3C048003 */ lui $a0, %hi(g_IntroSwirl) -/* 0B0688 7F07BB58 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B068C 7F07BB5C E5460000 */ swc1 $f6, ($t2) -/* 0B0690 7F07BB60 8C8464AC */ lw $a0, %lo(g_IntroSwirl)($a0) -/* 0B0694 7F07BB64 0003C940 */ sll $t9, $v1, 5 -/* 0B0698 7F07BB68 C5420000 */ lwc1 $f2, ($t2) -/* 0B069C 7F07BB6C 00991021 */ addu $v0, $a0, $t9 -/* 0B06A0 7F07BB70 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B06A4 7F07BB74 4602003E */ c.le.s $f0, $f2 -/* 0B06A8 7F07BB78 00000000 */ nop -/* 0B06AC 7F07BB7C 45020019 */ bc1fl .L7F07BBE4 -/* 0B06B0 7F07BB80 24650001 */ addiu $a1, $v1, 1 -/* 0B06B4 7F07BB84 8C4C0064 */ lw $t4, 0x64($v0) -.L7F07BB88: -/* 0B06B8 7F07BB88 318D0001 */ andi $t5, $t4, 1 -/* 0B06BC 7F07BB8C 55A00007 */ bnezl $t5, .L7F07BBAC -/* 0B06C0 7F07BB90 E5400000 */ swc1 $f0, ($t2) -/* 0B06C4 7F07BB94 46001201 */ sub.s $f8, $f2, $f0 -/* 0B06C8 7F07BB98 24780001 */ addiu $t8, $v1, 1 -/* 0B06CC 7F07BB9C AD180000 */ sw $t8, ($t0) -/* 0B06D0 7F07BBA0 10000006 */ b .L7F07BBBC -/* 0B06D4 7F07BBA4 E5480000 */ swc1 $f8, ($t2) -/* 0B06D8 7F07BBA8 E5400000 */ swc1 $f0, ($t2) -.L7F07BBAC: -/* 0B06DC 7F07BBAC AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B06E0 7F07BBB0 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B06E4 7F07BBB4 1000000A */ b .L7F07BBE0 -/* 0B06E8 7F07BBB8 C5420000 */ lwc1 $f2, ($t2) -.L7F07BBBC: -/* 0B06EC 7F07BBBC 8D030000 */ lw $v1, ($t0) -/* 0B06F0 7F07BBC0 C5420000 */ lwc1 $f2, ($t2) -/* 0B06F4 7F07BBC4 00037140 */ sll $t6, $v1, 5 -/* 0B06F8 7F07BBC8 008E1021 */ addu $v0, $a0, $t6 -/* 0B06FC 7F07BBCC C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B0700 7F07BBD0 4602003E */ c.le.s $f0, $f2 -/* 0B0704 7F07BBD4 00000000 */ nop -/* 0B0708 7F07BBD8 4503FFEB */ bc1tl .L7F07BB88 -/* 0B070C 7F07BBDC 8C4C0064 */ lw $t4, 0x64($v0) -.L7F07BBE0: -/* 0B0710 7F07BBE0 24650001 */ addiu $a1, $v1, 1 -.L7F07BBE4: -/* 0B0714 7F07BBE4 00057940 */ sll $t7, $a1, 5 -/* 0B0718 7F07BBE8 008F1021 */ addu $v0, $a0, $t7 -/* 0B071C 7F07BBEC 8C590044 */ lw $t9, 0x44($v0) -/* 0B0720 7F07BBF0 46020281 */ sub.s $f10, $f0, $f2 -/* 0B0724 7F07BBF4 44807000 */ mtc1 $zero, $f14 -/* 0B0728 7F07BBF8 332C0001 */ andi $t4, $t9, 1 -/* 0B072C 7F07BBFC 15800007 */ bnez $t4, .L7F07BC1C -/* 0B0730 7F07BC00 460A7400 */ add.s $f16, $f14, $f10 -.L7F07BC04: -/* 0B0734 7F07BC04 8C4D0064 */ lw $t5, 0x64($v0) -/* 0B0738 7F07BC08 C4440018 */ lwc1 $f4, 0x18($v0) -/* 0B073C 7F07BC0C 24420020 */ addiu $v0, $v0, 0x20 -/* 0B0740 7F07BC10 31B80001 */ andi $t8, $t5, 1 -/* 0B0744 7F07BC14 1300FFFB */ beqz $t8, .L7F07BC04 -/* 0B0748 7F07BC18 46048400 */ add.s $f16, $f16, $f4 -.L7F07BC1C: -/* 0B074C 7F07BC1C 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B0750 7F07BC20 44816000 */ mtc1 $at, $f12 -/* 0B0754 7F07BC24 00000000 */ nop -/* 0B0758 7F07BC28 460C803C */ c.lt.s $f16, $f12 -/* 0B075C 7F07BC2C 00000000 */ nop -/* 0B0760 7F07BC30 4500000D */ bc1f .L7F07BC68 -/* 0B0764 7F07BC34 00000000 */ nop -/* 0B0768 7F07BC38 46128180 */ add.s $f6, $f16, $f18 -/* 0B076C 7F07BC3C 4606603E */ c.le.s $f12, $f6 -/* 0B0770 7F07BC40 00000000 */ nop -/* 0B0774 7F07BC44 45000008 */ bc1f .L7F07BC68 -/* 0B0778 7F07BC48 00000000 */ nop -/* 0B077C 7F07BC4C 0FC20284 */ jal currentPlayerStartChrFade -/* 0B0780 7F07BC50 E7B00030 */ swc1 $f16, 0x30($sp) -/* 0B0784 7F07BC54 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B0788 7F07BC58 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B078C 7F07BC5C 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0790 7F07BC60 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -/* 0B0794 7F07BC64 C7B00030 */ lwc1 $f16, 0x30($sp) -.L7F07BC68: -/* 0B0798 7F07BC68 3C0E8003 */ lui $t6, %hi(D_8003649C) -/* 0B079C 7F07BC6C 8DCE649C */ lw $t6, %lo(D_8003649C)($t6) -/* 0B07A0 7F07BC70 51C0000D */ beql $t6, $zero, .L7F07BCA8 -/* 0B07A4 7F07BC74 3C014270 */ lui $at, 0x4270 -/* 0B07A8 7F07BC78 0FC20223 */ jal currentPlayerIsFadeComplete -/* 0B07AC 7F07BC7C E7B00030 */ swc1 $f16, 0x30($sp) -/* 0B07B0 7F07BC80 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B07B4 7F07BC84 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B07B8 7F07BC88 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B07BC 7F07BC8C 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -/* 0B07C0 7F07BC90 240B0001 */ li $t3, 1 -/* 0B07C4 7F07BC94 10400003 */ beqz $v0, .L7F07BCA4 -/* 0B07C8 7F07BC98 C7B00030 */ lwc1 $f16, 0x30($sp) -/* 0B07CC 7F07BC9C 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B07D0 7F07BCA0 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07BCA4: -/* 0B07D4 7F07BCA4 3C014270 */ li $at, 0x42700000 # 60.000000 -.L7F07BCA8: -/* 0B07D8 7F07BCA8 44814000 */ mtc1 $at, $f8 -/* 0B07DC 7F07BCAC 3C0F8003 */ lui $t7, %hi(D_8003649C) -/* 0B07E0 7F07BCB0 4610403C */ c.lt.s $f8, $f16 -/* 0B07E4 7F07BCB4 00000000 */ nop -/* 0B07E8 7F07BCB8 45020036 */ bc1fl .L7F07BD94 -/* 0B07EC 7F07BCBC 8D040000 */ lw $a0, ($t0) -/* 0B07F0 7F07BCC0 8DEF649C */ lw $t7, %lo(D_8003649C)($t7) -/* 0B07F4 7F07BCC4 55E00033 */ bnezl $t7, .L7F07BD94 -/* 0B07F8 7F07BCC8 8D040000 */ lw $a0, ($t0) -/* 0B07FC 7F07BCCC 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0B0800 7F07BCD0 00000000 */ nop -/* 0B0804 7F07BCD4 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B0808 7F07BCD8 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B080C 7F07BCDC 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0810 7F07BCE0 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -/* 0B0814 7F07BCE4 1440002A */ bnez $v0, .L7F07BD90 -/* 0B0818 7F07BCE8 240B0001 */ li $t3, 1 -/* 0B081C 7F07BCEC 97AC0046 */ lhu $t4, 0x46($sp) -/* 0B0820 7F07BCF0 97B90042 */ lhu $t9, 0x42($sp) -/* 0B0824 7F07BCF4 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0828 7F07BCF8 01806827 */ not $t5, $t4 -/* 0B082C 7F07BCFC 032DC024 */ and $t8, $t9, $t5 -/* 0B0830 7F07BD00 330EF030 */ andi $t6, $t8, 0xf030 -/* 0B0834 7F07BD04 11C00022 */ beqz $t6, .L7F07BD90 -/* 0B0838 7F07BD08 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B083C 7F07BD0C 3C018003 */ lui $at, %hi(D_8003649C) -/* 0B0840 7F07BD10 AC2B649C */ sw $t3, %lo(D_8003649C)($at) -/* 0B0844 7F07BD14 8D2F0000 */ lw $t7, ($t1) -/* 0B0848 7F07BD18 00002025 */ move $a0, $zero -/* 0B084C 7F07BD1C 00002825 */ move $a1, $zero -/* 0B0850 7F07BD20 00003025 */ move $a2, $zero -/* 0B0854 7F07BD24 0FC201EC */ jal currentPlayerSetFadeColour -/* 0B0858 7F07BD28 8DE703DC */ lw $a3, 0x3dc($t7) -/* 0B085C 7F07BD2C 0FC20223 */ jal currentPlayerIsFadeComplete -/* 0B0860 7F07BD30 00000000 */ nop -/* 0B0864 7F07BD34 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0868 7F07BD38 1040000C */ beqz $v0, .L7F07BD6C -/* 0B086C 7F07BD3C 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0870 7F07BD40 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B0874 7F07BD44 44816000 */ mtc1 $at, $f12 -/* 0B0878 7F07BD48 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B087C 7F07BD4C 44817000 */ mtc1 $at, $f14 -/* 0B0880 7F07BD50 0FC20216 */ jal currentPlayerSetFadeFrac -/* 0B0884 7F07BD54 00000000 */ nop -/* 0B0888 7F07BD58 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B088C 7F07BD5C 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B0890 7F07BD60 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0894 7F07BD64 1000000A */ b .L7F07BD90 -/* 0B0898 7F07BD68 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -.L7F07BD6C: -/* 0B089C 7F07BD6C 8D2C0000 */ lw $t4, ($t1) -/* 0B08A0 7F07BD70 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B08A4 7F07BD74 44817000 */ mtc1 $at, $f14 -/* 0B08A8 7F07BD78 0FC20216 */ jal currentPlayerSetFadeFrac -/* 0B08AC 7F07BD7C C58C03E0 */ lwc1 $f12, 0x3e0($t4) -/* 0B08B0 7F07BD80 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B08B4 7F07BD84 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B08B8 7F07BD88 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B08BC 7F07BD8C 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -.L7F07BD90: -/* 0B08C0 7F07BD90 8D040000 */ lw $a0, ($t0) -.L7F07BD94: -/* 0B08C4 7F07BD94 8D450000 */ lw $a1, ($t2) -/* 0B08C8 7F07BD98 8FA60048 */ lw $a2, 0x48($sp) -/* 0B08CC 7F07BD9C 0FC1ECA8 */ jal sub_GAME_7F07B2A0 -/* 0B08D0 7F07BDA0 8FA7004C */ lw $a3, 0x4c($sp) -/* 0B08D4 7F07BDA4 3C088003 */ lui $t0, %hi(D_800364A8) -/* 0B08D8 7F07BDA8 250864A8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64a8 -/* 0B08DC 7F07BDAC 8D0D0000 */ lw $t5, ($t0) -/* 0B08E0 7F07BDB0 3C198003 */ lui $t9, %hi(g_IntroSwirl) -/* 0B08E4 7F07BDB4 8F3964AC */ lw $t9, %lo(g_IntroSwirl)($t9) -/* 0B08E8 7F07BDB8 000DC140 */ sll $t8, $t5, 5 -/* 0B08EC 7F07BDBC 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B08F0 7F07BDC0 03387021 */ addu $t6, $t9, $t8 -/* 0B08F4 7F07BDC4 8DC4001C */ lw $a0, 0x1c($t6) -/* 0B08F8 7F07BDC8 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B08FC 7F07BDCC 3C0C8007 */ lui $t4, %hi(g_CurrentSetup+0x18) -/* 0B0900 7F07BDD0 04800012 */ bltz $a0, .L7F07BE1C -/* 0B0904 7F07BDD4 00047880 */ sll $t7, $a0, 2 -/* 0B0908 7F07BDD8 01E47823 */ subu $t7, $t7, $a0 -/* 0B090C 7F07BDDC 8D8C5D18 */ lw $t4, %lo(g_CurrentSetup+0x18)($t4) -/* 0B0910 7F07BDE0 000F7880 */ sll $t7, $t7, 2 -/* 0B0914 7F07BDE4 01E47823 */ subu $t7, $t7, $a0 -/* 0B0918 7F07BDE8 000F7880 */ sll $t7, $t7, 2 -/* 0B091C 7F07BDEC 01EC1021 */ addu $v0, $t7, $t4 -/* 0B0920 7F07BDF0 8C4D0028 */ lw $t5, 0x28($v0) -/* 0B0924 7F07BDF4 8FB90054 */ lw $t9, 0x54($sp) -/* 0B0928 7F07BDF8 8FA30058 */ lw $v1, 0x58($sp) -/* 0B092C 7F07BDFC AF2D0000 */ sw $t5, ($t9) -/* 0B0930 7F07BE00 C44A0000 */ lwc1 $f10, ($v0) -/* 0B0934 7F07BE04 E46A0000 */ swc1 $f10, ($v1) -/* 0B0938 7F07BE08 C4440004 */ lwc1 $f4, 4($v0) -/* 0B093C 7F07BE0C E4640004 */ swc1 $f4, 4($v1) -/* 0B0940 7F07BE10 C4460008 */ lwc1 $f6, 8($v0) -/* 0B0944 7F07BE14 100001C6 */ b .L7F07C530 -/* 0B0948 7F07BE18 E4660008 */ swc1 $f6, 8($v1) -.L7F07BE1C: -/* 0B094C 7F07BE1C 8D380000 */ lw $t8, ($t1) -/* 0B0950 7F07BE20 8FAF0054 */ lw $t7, 0x54($sp) -/* 0B0954 7F07BE24 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0958 7F07BE28 8F0E0488 */ lw $t6, 0x488($t8) -/* 0B095C 7F07BE2C ADEE0000 */ sw $t6, ($t7) -/* 0B0960 7F07BE30 8D2C0000 */ lw $t4, ($t1) -/* 0B0964 7F07BE34 C588048C */ lwc1 $f8, 0x48c($t4) -/* 0B0968 7F07BE38 E4680000 */ swc1 $f8, ($v1) -/* 0B096C 7F07BE3C 8D2D0000 */ lw $t5, ($t1) -/* 0B0970 7F07BE40 C5AA0490 */ lwc1 $f10, 0x490($t5) -/* 0B0974 7F07BE44 E46A0004 */ swc1 $f10, 4($v1) -/* 0B0978 7F07BE48 8D390000 */ lw $t9, ($t1) -/* 0B097C 7F07BE4C C7240494 */ lwc1 $f4, 0x494($t9) -/* 0B0980 7F07BE50 100001B7 */ b .L7F07C530 -/* 0B0984 7F07BE54 E4640008 */ swc1 $f4, 8($v1) -.L7F07BE58: -/* 0B0988 7F07BE58 10620003 */ beq $v1, $v0, .L7F07BE68 -/* 0B098C 7F07BE5C 24010006 */ li $at, 6 -/* 0B0990 7F07BE60 5441009C */ bnel $v0, $at, .L7F07C0D4 -/* 0B0994 7F07BE64 24010007 */ li $at, 7 -.L7F07BE68: -/* 0B0998 7F07BE68 1462003F */ bne $v1, $v0, .L7F07BF68 -/* 0B099C 7F07BE6C 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B09A0 7F07BE70 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B09A4 7F07BE74 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B09A8 7F07BE78 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B09AC 7F07BE7C C5460000 */ lwc1 $f6, ($t2) -/* 0B09B0 7F07BE80 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B09B4 7F07BE84 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B09B8 7F07BE88 46083280 */ add.s $f10, $f6, $f8 -/* 0B09BC 7F07BE8C 8D380000 */ lw $t8, ($t1) -/* 0B09C0 7F07BE90 3C014334 */ lui $at, 0x4334 -/* 0B09C4 7F07BE94 E54A0000 */ swc1 $f10, ($t2) -/* 0B09C8 7F07BE98 8F0400D4 */ lw $a0, 0xd4($t8) -/* 0B09CC 7F07BE9C 50800015 */ beql $a0, $zero, .L7F07BEF4 -/* 0B09D0 7F07BEA0 C5460000 */ lwc1 $f6, ($t2) -/* 0B09D4 7F07BEA4 0FC1BD6F */ jal objecthandlerGetModelField28 -/* 0B09D8 7F07BEA8 00000000 */ nop -/* 0B09DC 7F07BEAC 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B09E0 7F07BEB0 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B09E4 7F07BEB4 8D2E0000 */ lw $t6, ($t1) -/* 0B09E8 7F07BEB8 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B09EC 7F07BEBC 0FC1BD71 */ jal sub_GAME_7F06F5C4 -/* 0B09F0 7F07BEC0 8DC400D4 */ lw $a0, 0xd4($t6) -/* 0B09F4 7F07BEC4 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B09F8 7F07BEC8 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B09FC 7F07BECC 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0A00 7F07BED0 4604003E */ c.le.s $f0, $f4 -/* 0B0A04 7F07BED4 240B0001 */ li $t3, 1 -/* 0B0A08 7F07BED8 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0A0C 7F07BEDC 45000002 */ bc1f .L7F07BEE8 -/* 0B0A10 7F07BEE0 00000000 */ nop -/* 0B0A14 7F07BEE4 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07BEE8: -/* 0B0A18 7F07BEE8 10000009 */ b .L7F07BF10 -/* 0B0A1C 7F07BEEC 24050002 */ li $a1, 2 -/* 0B0A20 7F07BEF0 C5460000 */ lwc1 $f6, ($t2) -.L7F07BEF4: -/* 0B0A24 7F07BEF4 44814000 */ mtc1 $at, $f8 -/* 0B0A28 7F07BEF8 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0A2C 7F07BEFC 4606403E */ c.le.s $f8, $f6 -/* 0B0A30 7F07BF00 00000000 */ nop -/* 0B0A34 7F07BF04 45020003 */ bc1fl .L7F07BF14 -/* 0B0A38 7F07BF08 97AC0046 */ lhu $t4, 0x46($sp) -/* 0B0A3C 7F07BF0C AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07BF10: -/* 0B0A40 7F07BF10 97AC0046 */ lhu $t4, 0x46($sp) -.L7F07BF14: -/* 0B0A44 7F07BF14 97AF0042 */ lhu $t7, 0x42($sp) -/* 0B0A48 7F07BF18 01806827 */ not $t5, $t4 -/* 0B0A4C 7F07BF1C 01EDC824 */ and $t9, $t7, $t5 -/* 0B0A50 7F07BF20 3338F000 */ andi $t8, $t9, 0xf000 -/* 0B0A54 7F07BF24 13000036 */ beqz $t8, .L7F07C000 -/* 0B0A58 7F07BF28 00000000 */ nop -/* 0B0A5C 7F07BF2C 8D220000 */ lw $v0, ($t1) -/* 0B0A60 7F07BF30 8C4E00D8 */ lw $t6, 0xd8($v0) -/* 0B0A64 7F07BF34 11C00032 */ beqz $t6, .L7F07C000 -/* 0B0A68 7F07BF38 00000000 */ nop -/* 0B0A6C 7F07BF3C 8C4C0424 */ lw $t4, 0x424($v0) -/* 0B0A70 7F07BF40 1180002F */ beqz $t4, .L7F07C000 -/* 0B0A74 7F07BF44 00000000 */ nop -/* 0B0A78 7F07BF48 8C4F0428 */ lw $t7, 0x428($v0) -/* 0B0A7C 7F07BF4C 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0A80 7F07BF50 11E0002B */ beqz $t7, .L7F07C000 -/* 0B0A84 7F07BF54 00000000 */ nop -/* 0B0A88 7F07BF58 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0A8C 7F07BF5C 3C018003 */ lui $at, %hi(D_80036510) -/* 0B0A90 7F07BF60 10000027 */ b .L7F07C000 -/* 0B0A94 7F07BF64 AC256510 */ sw $a1, %lo(D_80036510)($at) -.L7F07BF68: -/* 0B0A98 7F07BF68 24010006 */ li $at, 6 -/* 0B0A9C 7F07BF6C 14410024 */ bne $v0, $at, .L7F07C000 -/* 0B0AA0 7F07BF70 3C0A8003 */ lui $t2, %hi(D_800364A4) -/* 0B0AA4 7F07BF74 254A64A4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64a4 -/* 0B0AA8 7F07BF78 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B0AAC 7F07BF7C C4248378 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B0AB0 7F07BF80 C54A0000 */ lwc1 $f10, ($t2) -/* 0B0AB4 7F07BF84 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0AB8 7F07BF88 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0ABC 7F07BF8C 46045180 */ add.s $f6, $f10, $f4 -/* 0B0AC0 7F07BF90 8D220000 */ lw $v0, ($t1) -/* 0B0AC4 7F07BF94 44807000 */ mtc1 $zero, $f14 -/* 0B0AC8 7F07BF98 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B0ACC 7F07BF9C E5460000 */ swc1 $f6, ($t2) -/* 0B0AD0 7F07BFA0 C44803E4 */ lwc1 $f8, 0x3e4($v0) -/* 0B0AD4 7F07BFA4 460E403C */ c.lt.s $f8, $f14 -/* 0B0AD8 7F07BFA8 00000000 */ nop -/* 0B0ADC 7F07BFAC 45020003 */ bc1fl .L7F07BFBC -/* 0B0AE0 7F07BFB0 97B90046 */ lhu $t9, 0x46($sp) -/* 0B0AE4 7F07BFB4 AC2B6498 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0AE8 7F07BFB8 97B90046 */ lhu $t9, 0x46($sp) -.L7F07BFBC: -/* 0B0AEC 7F07BFBC 97AD0042 */ lhu $t5, 0x42($sp) -/* 0B0AF0 7F07BFC0 0320C027 */ not $t8, $t9 -/* 0B0AF4 7F07BFC4 01B87024 */ and $t6, $t5, $t8 -/* 0B0AF8 7F07BFC8 31CCF000 */ andi $t4, $t6, 0xf000 -/* 0B0AFC 7F07BFCC 1180000C */ beqz $t4, .L7F07C000 -/* 0B0B00 7F07BFD0 00000000 */ nop -/* 0B0B04 7F07BFD4 8C4F00D8 */ lw $t7, 0xd8($v0) -/* 0B0B08 7F07BFD8 11E00009 */ beqz $t7, .L7F07C000 -/* 0B0B0C 7F07BFDC 00000000 */ nop -/* 0B0B10 7F07BFE0 8C590424 */ lw $t9, 0x424($v0) -/* 0B0B14 7F07BFE4 13200006 */ beqz $t9, .L7F07C000 -/* 0B0B18 7F07BFE8 00000000 */ nop -/* 0B0B1C 7F07BFEC 8C4D0428 */ lw $t5, 0x428($v0) -/* 0B0B20 7F07BFF0 3C018003 */ lui $at, %hi(D_80036510) -/* 0B0B24 7F07BFF4 11A00002 */ beqz $t5, .L7F07C000 -/* 0B0B28 7F07BFF8 00000000 */ nop -/* 0B0B2C 7F07BFFC AC256510 */ sw $a1, %lo(D_80036510)($at) -.L7F07C000: -/* 0B0B30 7F07C000 3C038008 */ lui $v1, %hi(flt_CODE_bss_800799E8) -/* 0B0B34 7F07C004 246399E8 */ addiu $v1, %lo(flt_CODE_bss_800799E8) # addiu $v1, $v1, -0x6618 -/* 0B0B38 7F07C008 C46A0000 */ lwc1 $f10, ($v1) -/* 0B0B3C 7F07C00C 8FB80048 */ lw $t8, 0x48($sp) -/* 0B0B40 7F07C010 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0B44 7F07C014 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0B48 7F07C018 E70A0000 */ swc1 $f10, ($t8) -/* 0B0B4C 7F07C01C C4640004 */ lwc1 $f4, 4($v1) -/* 0B0B50 7F07C020 3C058008 */ lui $a1, %hi(dword_CODE_bss_800799F4) -/* 0B0B54 7F07C024 24A599F4 */ addiu $a1, %lo(dword_CODE_bss_800799F4) # addiu $a1, $a1, -0x660c -/* 0B0B58 7F07C028 E7040004 */ swc1 $f4, 4($t8) -/* 0B0B5C 7F07C02C C4660008 */ lwc1 $f6, 8($v1) -/* 0B0B60 7F07C030 E7060008 */ swc1 $f6, 8($t8) -/* 0B0B64 7F07C034 8D220000 */ lw $v0, ($t1) -/* 0B0B68 7F07C038 8CA40000 */ lw $a0, ($a1) -/* 0B0B6C 7F07C03C 8C4E00A8 */ lw $t6, 0xa8($v0) -/* 0B0B70 7F07C040 548E000C */ bnel $a0, $t6, .L7F07C074 -/* 0B0B74 7F07C044 C4860008 */ lwc1 $f6, 8($a0) -/* 0B0B78 7F07C048 C44803C4 */ lwc1 $f8, 0x3c4($v0) -/* 0B0B7C 7F07C04C 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B0B80 7F07C050 E5880000 */ swc1 $f8, ($t4) -/* 0B0B84 7F07C054 8D2F0000 */ lw $t7, ($t1) -/* 0B0B88 7F07C058 C5EA03C8 */ lwc1 $f10, 0x3c8($t7) -/* 0B0B8C 7F07C05C E58A0004 */ swc1 $f10, 4($t4) -/* 0B0B90 7F07C060 8D390000 */ lw $t9, ($t1) -/* 0B0B94 7F07C064 C72403CC */ lwc1 $f4, 0x3cc($t9) -/* 0B0B98 7F07C068 1000000A */ b .L7F07C094 -/* 0B0B9C 7F07C06C E5840008 */ swc1 $f4, 8($t4) -/* 0B0BA0 7F07C070 C4860008 */ lwc1 $f6, 8($a0) -.L7F07C074: -/* 0B0BA4 7F07C074 8FAD004C */ lw $t5, 0x4c($sp) -/* 0B0BA8 7F07C078 E5A60000 */ swc1 $f6, ($t5) -/* 0B0BAC 7F07C07C 8CB80000 */ lw $t8, ($a1) -/* 0B0BB0 7F07C080 C708000C */ lwc1 $f8, 0xc($t8) -/* 0B0BB4 7F07C084 E5A80004 */ swc1 $f8, 4($t5) -/* 0B0BB8 7F07C088 8CAE0000 */ lw $t6, ($a1) -/* 0B0BBC 7F07C08C C5CA0010 */ lwc1 $f10, 0x10($t6) -/* 0B0BC0 7F07C090 E5AA0008 */ swc1 $f10, 8($t5) -.L7F07C094: -/* 0B0BC4 7F07C094 8D2F0000 */ lw $t7, ($t1) -/* 0B0BC8 7F07C098 8FAC0054 */ lw $t4, 0x54($sp) -/* 0B0BCC 7F07C09C 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0BD0 7F07C0A0 8DF90488 */ lw $t9, 0x488($t7) -/* 0B0BD4 7F07C0A4 AD990000 */ sw $t9, ($t4) -/* 0B0BD8 7F07C0A8 8D380000 */ lw $t8, ($t1) -/* 0B0BDC 7F07C0AC C704048C */ lwc1 $f4, 0x48c($t8) -/* 0B0BE0 7F07C0B0 E4640000 */ swc1 $f4, ($v1) -/* 0B0BE4 7F07C0B4 8D2E0000 */ lw $t6, ($t1) -/* 0B0BE8 7F07C0B8 C5C60490 */ lwc1 $f6, 0x490($t6) -/* 0B0BEC 7F07C0BC E4660004 */ swc1 $f6, 4($v1) -/* 0B0BF0 7F07C0C0 8D2D0000 */ lw $t5, ($t1) -/* 0B0BF4 7F07C0C4 C5A80494 */ lwc1 $f8, 0x494($t5) -/* 0B0BF8 7F07C0C8 10000119 */ b .L7F07C530 -/* 0B0BFC 7F07C0CC E4680008 */ swc1 $f8, 8($v1) -/* 0B0C00 7F07C0D0 24010007 */ li $at, 7 -.L7F07C0D4: -/* 0B0C04 7F07C0D4 14410116 */ bne $v0, $at, .L7F07C530 -/* 0B0C08 7F07C0D8 3C028008 */ lui $v0, %hi(dword_CODE_bss_800799F8) -/* 0B0C0C 7F07C0DC 244299F8 */ addiu $v0, %lo(dword_CODE_bss_800799F8) # addiu $v0, $v0, -0x6608 -/* 0B0C10 7F07C0E0 8C440000 */ lw $a0, ($v0) -/* 0B0C14 7F07C0E4 8FAF0048 */ lw $t7, 0x48($sp) -/* 0B0C18 7F07C0E8 10800024 */ beqz $a0, .L7F07C17C -/* 0B0C1C 7F07C0EC 00000000 */ nop -/* 0B0C20 7F07C0F0 C48A0000 */ lwc1 $f10, ($a0) -/* 0B0C24 7F07C0F4 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0C28 7F07C0F8 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0C2C 7F07C0FC E5EA0000 */ swc1 $f10, ($t7) -/* 0B0C30 7F07C100 8C590000 */ lw $t9, ($v0) -/* 0B0C34 7F07C104 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0C38 7F07C108 C7240004 */ lwc1 $f4, 4($t9) -/* 0B0C3C 7F07C10C E5E40004 */ swc1 $f4, 4($t7) -/* 0B0C40 7F07C110 8C4C0000 */ lw $t4, ($v0) -/* 0B0C44 7F07C114 C5860008 */ lwc1 $f6, 8($t4) -/* 0B0C48 7F07C118 E5E60008 */ swc1 $f6, 8($t7) -/* 0B0C4C 7F07C11C 8D380000 */ lw $t8, ($t1) -/* 0B0C50 7F07C120 8FAE004C */ lw $t6, 0x4c($sp) -/* 0B0C54 7F07C124 C70803C4 */ lwc1 $f8, 0x3c4($t8) -/* 0B0C58 7F07C128 E5C80000 */ swc1 $f8, ($t6) -/* 0B0C5C 7F07C12C 8D2D0000 */ lw $t5, ($t1) -/* 0B0C60 7F07C130 C5AA03C8 */ lwc1 $f10, 0x3c8($t5) -/* 0B0C64 7F07C134 E5CA0004 */ swc1 $f10, 4($t6) -/* 0B0C68 7F07C138 8D390000 */ lw $t9, ($t1) -/* 0B0C6C 7F07C13C C72403CC */ lwc1 $f4, 0x3cc($t9) -/* 0B0C70 7F07C140 E5C40008 */ swc1 $f4, 8($t6) -/* 0B0C74 7F07C144 8C4C0000 */ lw $t4, ($v0) -/* 0B0C78 7F07C148 8FB80054 */ lw $t8, 0x54($sp) -/* 0B0C7C 7F07C14C 8D8F0028 */ lw $t7, 0x28($t4) -/* 0B0C80 7F07C150 AF0F0000 */ sw $t7, ($t8) -/* 0B0C84 7F07C154 8C4D0000 */ lw $t5, ($v0) -/* 0B0C88 7F07C158 C5A60000 */ lwc1 $f6, ($t5) -/* 0B0C8C 7F07C15C E4660000 */ swc1 $f6, ($v1) -/* 0B0C90 7F07C160 8C590000 */ lw $t9, ($v0) -/* 0B0C94 7F07C164 C7280004 */ lwc1 $f8, 4($t9) -/* 0B0C98 7F07C168 E4680004 */ swc1 $f8, 4($v1) -/* 0B0C9C 7F07C16C 8C4E0000 */ lw $t6, ($v0) -/* 0B0CA0 7F07C170 C5CA0008 */ lwc1 $f10, 8($t6) -/* 0B0CA4 7F07C174 100000EE */ b .L7F07C530 -/* 0B0CA8 7F07C178 E46A0008 */ swc1 $f10, 8($v1) -.L7F07C17C: -/* 0B0CAC 7F07C17C 3C058008 */ lui $a1, %hi(gBondViewCutscene) -/* 0B0CB0 7F07C180 24A599FC */ addiu $a1, %lo(gBondViewCutscene) # addiu $a1, $a1, -0x6604 -/* 0B0CB4 7F07C184 8CA40000 */ lw $a0, ($a1) -/* 0B0CB8 7F07C188 10800063 */ beqz $a0, .L7F07C318 -/* 0B0CBC 7F07C18C 00000000 */ nop -/* 0B0CC0 7F07C190 8C830018 */ lw $v1, 0x18($a0) -/* 0B0CC4 7F07C194 3C0D8007 */ lui $t5, %hi(g_CurrentSetup+0x1C) -/* 0B0CC8 7F07C198 8FB90048 */ lw $t9, 0x48($sp) -/* 0B0CCC 7F07C19C 28612710 */ slti $at, $v1, 0x2710 -/* 0B0CD0 7F07C1A0 1020000A */ beqz $at, .L7F07C1CC -/* 0B0CD4 7F07C1A4 0003C100 */ sll $t8, $v1, 4 -/* 0B0CD8 7F07C1A8 00036080 */ sll $t4, $v1, 2 -/* 0B0CDC 7F07C1AC 01836023 */ subu $t4, $t4, $v1 -/* 0B0CE0 7F07C1B0 000C6080 */ sll $t4, $t4, 2 -/* 0B0CE4 7F07C1B4 3C0F8007 */ lui $t7, %hi(g_CurrentSetup+0x18) -/* 0B0CE8 7F07C1B8 8DEF5D18 */ lw $t7, %lo(g_CurrentSetup+0x18)($t7) -/* 0B0CEC 7F07C1BC 01836023 */ subu $t4, $t4, $v1 -/* 0B0CF0 7F07C1C0 000C6080 */ sll $t4, $t4, 2 -/* 0B0CF4 7F07C1C4 10000008 */ b .L7F07C1E8 -/* 0B0CF8 7F07C1C8 018F1021 */ addu $v0, $t4, $t7 -.L7F07C1CC: -/* 0B0CFC 7F07C1CC 8DAD5D1C */ lw $t5, %lo(g_CurrentSetup+0x1C)($t5) -/* 0B0D00 7F07C1D0 0303C021 */ addu $t8, $t8, $v1 -/* 0B0D04 7F07C1D4 0018C080 */ sll $t8, $t8, 2 -/* 0B0D08 7F07C1D8 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0B0D0C 7F07C1DC 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0B0D10 7F07C1E0 030D1021 */ addu $v0, $t8, $t5 -/* 0B0D14 7F07C1E4 00411021 */ addu $v0, $v0, $at -.L7F07C1E8: -/* 0B0D18 7F07C1E8 C4840004 */ lwc1 $f4, 4($a0) -/* 0B0D1C 7F07C1EC 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0D20 7F07C1F0 3C0D8008 */ lui $t5, %hi(dword_CODE_bss_80079A18) -/* 0B0D24 7F07C1F4 E7240000 */ swc1 $f4, ($t9) -/* 0B0D28 7F07C1F8 8CAE0000 */ lw $t6, ($a1) -/* 0B0D2C 7F07C1FC 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B0D30 7F07C200 2529A0B0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5f50 -/* 0B0D34 7F07C204 C5C60008 */ lwc1 $f6, 8($t6) -/* 0B0D38 7F07C208 E7260004 */ swc1 $f6, 4($t9) -/* 0B0D3C 7F07C20C 8CAC0000 */ lw $t4, ($a1) -/* 0B0D40 7F07C210 C588000C */ lwc1 $f8, 0xc($t4) -/* 0B0D44 7F07C214 E7280008 */ swc1 $f8, 8($t9) -/* 0B0D48 7F07C218 8FB80054 */ lw $t8, 0x54($sp) -/* 0B0D4C 7F07C21C 8C4F0028 */ lw $t7, 0x28($v0) -/* 0B0D50 7F07C220 AF0F0000 */ sw $t7, ($t8) -/* 0B0D54 7F07C224 C44A0000 */ lwc1 $f10, ($v0) -/* 0B0D58 7F07C228 E46A0000 */ swc1 $f10, ($v1) -/* 0B0D5C 7F07C22C C4440004 */ lwc1 $f4, 4($v0) -/* 0B0D60 7F07C230 E4640004 */ swc1 $f4, 4($v1) -/* 0B0D64 7F07C234 C4460008 */ lwc1 $f6, 8($v0) -/* 0B0D68 7F07C238 E4660008 */ swc1 $f6, 8($v1) -/* 0B0D6C 7F07C23C 8DAD9A18 */ lw $t5, %lo(dword_CODE_bss_80079A18)($t5) -/* 0B0D70 7F07C240 556D000D */ bnel $t3, $t5, .L7F07C278 -/* 0B0D74 7F07C244 8CB80000 */ lw $t8, ($a1) -/* 0B0D78 7F07C248 8D2E0000 */ lw $t6, ($t1) -/* 0B0D7C 7F07C24C 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B0D80 7F07C250 C5C803C4 */ lwc1 $f8, 0x3c4($t6) -/* 0B0D84 7F07C254 E5880000 */ swc1 $f8, ($t4) -/* 0B0D88 7F07C258 8D390000 */ lw $t9, ($t1) -/* 0B0D8C 7F07C25C C72A03C8 */ lwc1 $f10, 0x3c8($t9) -/* 0B0D90 7F07C260 E58A0004 */ swc1 $f10, 4($t4) -/* 0B0D94 7F07C264 8D2F0000 */ lw $t7, ($t1) -/* 0B0D98 7F07C268 C5E403CC */ lwc1 $f4, 0x3cc($t7) -/* 0B0D9C 7F07C26C 100000B0 */ b .L7F07C530 -/* 0B0DA0 7F07C270 E5840008 */ swc1 $f4, 8($t4) -/* 0B0DA4 7F07C274 8CB80000 */ lw $t8, ($a1) -.L7F07C278: -/* 0B0DA8 7F07C278 0FC15FA8 */ jal cosf -/* 0B0DAC 7F07C27C C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0B0DB0 7F07C280 3C0D8008 */ lui $t5, %hi(gBondViewCutscene) -/* 0B0DB4 7F07C284 8DAD99FC */ lw $t5, %lo(gBondViewCutscene)($t5) -/* 0B0DB8 7F07C288 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B0DBC 7F07C28C 0FC15FAB */ jal sinf -/* 0B0DC0 7F07C290 C5AC0010 */ lwc1 $f12, 0x10($t5) -/* 0B0DC4 7F07C294 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0B0DC8 7F07C298 8FAE0048 */ lw $t6, 0x48($sp) -/* 0B0DCC 7F07C29C 8FB9004C */ lw $t9, 0x4c($sp) -/* 0B0DD0 7F07C2A0 46060202 */ mul.s $f8, $f0, $f6 -/* 0B0DD4 7F07C2A4 C5CA0000 */ lwc1 $f10, ($t6) -/* 0B0DD8 7F07C2A8 3C0F8008 */ lui $t7, %hi(gBondViewCutscene) -/* 0B0DDC 7F07C2AC 460A4100 */ add.s $f4, $f8, $f10 -/* 0B0DE0 7F07C2B0 E7240000 */ swc1 $f4, ($t9) -/* 0B0DE4 7F07C2B4 8DEF99FC */ lw $t7, %lo(gBondViewCutscene)($t7) -/* 0B0DE8 7F07C2B8 0FC15FAB */ jal sinf -/* 0B0DEC 7F07C2BC C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0B0DF0 7F07C2C0 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B0DF4 7F07C2C4 8FB8004C */ lw $t8, 0x4c($sp) -/* 0B0DF8 7F07C2C8 3C0D8008 */ lui $t5, %hi(gBondViewCutscene) -/* 0B0DFC 7F07C2CC C5860004 */ lwc1 $f6, 4($t4) -/* 0B0E00 7F07C2D0 46060200 */ add.s $f8, $f0, $f6 -/* 0B0E04 7F07C2D4 E7080004 */ swc1 $f8, 4($t8) -/* 0B0E08 7F07C2D8 8DAD99FC */ lw $t5, %lo(gBondViewCutscene)($t5) -/* 0B0E0C 7F07C2DC 0FC15FA8 */ jal cosf -/* 0B0E10 7F07C2E0 C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B0E14 7F07C2E4 3C0E8008 */ lui $t6, %hi(gBondViewCutscene) -/* 0B0E18 7F07C2E8 8DCE99FC */ lw $t6, %lo(gBondViewCutscene)($t6) -/* 0B0E1C 7F07C2EC E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B0E20 7F07C2F0 0FC15FA8 */ jal cosf -/* 0B0E24 7F07C2F4 C5CC0010 */ lwc1 $f12, 0x10($t6) -/* 0B0E28 7F07C2F8 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B0E2C 7F07C2FC 8FB90048 */ lw $t9, 0x48($sp) -/* 0B0E30 7F07C300 8FAF004C */ lw $t7, 0x4c($sp) -/* 0B0E34 7F07C304 46040182 */ mul.s $f6, $f0, $f4 -/* 0B0E38 7F07C308 C72A0008 */ lwc1 $f10, 8($t9) -/* 0B0E3C 7F07C30C 46065201 */ sub.s $f8, $f10, $f6 -/* 0B0E40 7F07C310 10000087 */ b .L7F07C530 -/* 0B0E44 7F07C314 E5E80008 */ swc1 $f8, 8($t7) -.L7F07C318: -/* 0B0E48 7F07C318 3C028008 */ lui $v0, %hi(dword_CODE_bss_80079A14) -/* 0B0E4C 7F07C31C 8C429A14 */ lw $v0, %lo(dword_CODE_bss_80079A14)($v0) -/* 0B0E50 7F07C320 3C0E8007 */ lui $t6, %hi(g_CurrentSetup+0x1C) -/* 0B0E54 7F07C324 8FAF0054 */ lw $t7, 0x54($sp) -/* 0B0E58 7F07C328 28412710 */ slti $at, $v0, 0x2710 -/* 0B0E5C 7F07C32C 1020000A */ beqz $at, .L7F07C358 -/* 0B0E60 7F07C330 00026900 */ sll $t5, $v0, 4 -/* 0B0E64 7F07C334 00026080 */ sll $t4, $v0, 2 -/* 0B0E68 7F07C338 01826023 */ subu $t4, $t4, $v0 -/* 0B0E6C 7F07C33C 000C6080 */ sll $t4, $t4, 2 -/* 0B0E70 7F07C340 3C188007 */ lui $t8, %hi(g_CurrentSetup+0x18) -/* 0B0E74 7F07C344 8F185D18 */ lw $t8, %lo(g_CurrentSetup+0x18)($t8) -/* 0B0E78 7F07C348 01826023 */ subu $t4, $t4, $v0 -/* 0B0E7C 7F07C34C 000C6080 */ sll $t4, $t4, 2 -/* 0B0E80 7F07C350 10000008 */ b .L7F07C374 -/* 0B0E84 7F07C354 01982021 */ addu $a0, $t4, $t8 -.L7F07C358: -/* 0B0E88 7F07C358 8DCE5D1C */ lw $t6, %lo(g_CurrentSetup+0x1C)($t6) -/* 0B0E8C 7F07C35C 01A26821 */ addu $t5, $t5, $v0 -/* 0B0E90 7F07C360 000D6880 */ sll $t5, $t5, 2 -/* 0B0E94 7F07C364 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0B0E98 7F07C368 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0B0E9C 7F07C36C 01AE2021 */ addu $a0, $t5, $t6 -/* 0B0EA0 7F07C370 00812021 */ addu $a0, $a0, $at -.L7F07C374: -/* 0B0EA4 7F07C374 8C990028 */ lw $t9, 0x28($a0) -/* 0B0EA8 7F07C378 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0EAC 7F07C37C 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0EB0 7F07C380 ADF90000 */ sw $t9, ($t7) -/* 0B0EB4 7F07C384 C4840000 */ lwc1 $f4, ($a0) -/* 0B0EB8 7F07C388 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0EBC 7F07C38C E4640000 */ swc1 $f4, ($v1) -/* 0B0EC0 7F07C390 C48A0004 */ lwc1 $f10, 4($a0) -/* 0B0EC4 7F07C394 E46A0004 */ swc1 $f10, 4($v1) -/* 0B0EC8 7F07C398 C4860008 */ lwc1 $f6, 8($a0) -/* 0B0ECC 7F07C39C E4660008 */ swc1 $f6, 8($v1) -/* 0B0ED0 7F07C3A0 AFA40020 */ sw $a0, 0x20($sp) -/* 0B0ED4 7F07C3A4 0FC15FA8 */ jal cosf -/* 0B0ED8 7F07C3A8 C44C0000 */ lwc1 $f12, ($v0) -/* 0B0EDC 7F07C3AC 8FA40020 */ lw $a0, 0x20($sp) -/* 0B0EE0 7F07C3B0 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B0EE4 7F07C3B4 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A10) -/* 0B0EE8 7F07C3B8 C4880000 */ lwc1 $f8, ($a0) -/* 0B0EEC 7F07C3BC 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0EF0 7F07C3C0 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0EF4 7F07C3C4 E5880000 */ swc1 $f8, ($t4) -/* 0B0EF8 7F07C3C8 C42A9A10 */ lwc1 $f10, %lo(flt_CODE_bss_80079A10)($at) -/* 0B0EFC 7F07C3CC C4840004 */ lwc1 $f4, 4($a0) -/* 0B0F00 7F07C3D0 460A2180 */ add.s $f6, $f4, $f10 -/* 0B0F04 7F07C3D4 E5860004 */ swc1 $f6, 4($t4) -/* 0B0F08 7F07C3D8 0FC15FAB */ jal sinf -/* 0B0F0C 7F07C3DC C44C0000 */ lwc1 $f12, ($v0) -/* 0B0F10 7F07C3E0 8FA40020 */ lw $a0, 0x20($sp) -/* 0B0F14 7F07C3E4 8FB8004C */ lw $t8, 0x4c($sp) -/* 0B0F18 7F07C3E8 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0F1C 7F07C3EC C4880008 */ lwc1 $f8, 8($a0) -/* 0B0F20 7F07C3F0 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0F24 7F07C3F4 E7080008 */ swc1 $f8, 8($t8) -/* 0B0F28 7F07C3F8 0FC15FAB */ jal sinf -/* 0B0F2C 7F07C3FC C44C0000 */ lwc1 $f12, ($v0) -/* 0B0F30 7F07C400 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0F34 7F07C404 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0F38 7F07C408 C44C0000 */ lwc1 $f12, ($v0) -/* 0B0F3C 7F07C40C 0FC15FA8 */ jal cosf -/* 0B0F40 7F07C410 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B0F44 7F07C414 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A08) -/* 0B0F48 7F07C418 C42A9A08 */ lwc1 $f10, %lo(flt_CODE_bss_80079A08)($at) -/* 0B0F4C 7F07C41C C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B0F50 7F07C420 8FA40020 */ lw $a0, 0x20($sp) -/* 0B0F54 7F07C424 8FAD0048 */ lw $t5, 0x48($sp) -/* 0B0F58 7F07C428 460A2182 */ mul.s $f6, $f4, $f10 -/* 0B0F5C 7F07C42C C4880000 */ lwc1 $f8, ($a0) -/* 0B0F60 7F07C430 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A10) -/* 0B0F64 7F07C434 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0F68 7F07C438 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0F6C 7F07C43C 46064100 */ add.s $f4, $f8, $f6 -/* 0B0F70 7F07C440 E5A40000 */ swc1 $f4, ($t5) -/* 0B0F74 7F07C444 C4289A10 */ lwc1 $f8, %lo(flt_CODE_bss_80079A10)($at) -/* 0B0F78 7F07C448 C48A0004 */ lwc1 $f10, 4($a0) -/* 0B0F7C 7F07C44C 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A0C) -/* 0B0F80 7F07C450 C4249A0C */ lwc1 $f4, %lo(flt_CODE_bss_80079A0C)($at) -/* 0B0F84 7F07C454 46085180 */ add.s $f6, $f10, $f8 -/* 0B0F88 7F07C458 46043280 */ add.s $f10, $f6, $f4 -/* 0B0F8C 7F07C45C E5AA0004 */ swc1 $f10, 4($t5) -/* 0B0F90 7F07C460 0FC15FA8 */ jal cosf -/* 0B0F94 7F07C464 C44C0000 */ lwc1 $f12, ($v0) -/* 0B0F98 7F07C468 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0F9C 7F07C46C 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0FA0 7F07C470 C44C0000 */ lwc1 $f12, ($v0) -/* 0B0FA4 7F07C474 0FC15FAB */ jal sinf -/* 0B0FA8 7F07C478 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B0FAC 7F07C47C 3C018005 */ lui $at, %hi(D_8005505C) -/* 0B0FB0 7F07C480 C42C505C */ lwc1 $f12, %lo(D_8005505C)($at) -/* 0B0FB4 7F07C484 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A08) -/* 0B0FB8 7F07C488 C4269A08 */ lwc1 $f6, %lo(flt_CODE_bss_80079A08)($at) -/* 0B0FBC 7F07C48C C7A8001C */ lwc1 $f8, 0x1c($sp) -/* 0B0FC0 7F07C490 8FA40020 */ lw $a0, 0x20($sp) -/* 0B0FC4 7F07C494 8FAE0048 */ lw $t6, 0x48($sp) -/* 0B0FC8 7F07C498 46064102 */ mul.s $f4, $f8, $f6 -/* 0B0FCC 7F07C49C C48A0008 */ lwc1 $f10, 8($a0) -/* 0B0FD0 7F07C4A0 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A04) -/* 0B0FD4 7F07C4A4 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) -/* 0B0FD8 7F07C4A8 24429A00 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x6600 -/* 0B0FDC 7F07C4AC 44807000 */ mtc1 $zero, $f14 -/* 0B0FE0 7F07C4B0 46045200 */ add.s $f8, $f10, $f4 -/* 0B0FE4 7F07C4B4 E5C80008 */ swc1 $f8, 8($t6) -/* 0B0FE8 7F07C4B8 C4269A04 */ lwc1 $f6, %lo(flt_CODE_bss_80079A04)($at) -/* 0B0FEC 7F07C4BC 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B0FF0 7F07C4C0 C42A8378 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0B0FF4 7F07C4C4 C4480000 */ lwc1 $f8, ($v0) -/* 0B0FF8 7F07C4C8 460A3102 */ mul.s $f4, $f6, $f10 -/* 0B0FFC 7F07C4CC 46044180 */ add.s $f6, $f8, $f4 -/* 0B1000 7F07C4D0 E4460000 */ swc1 $f6, ($v0) -/* 0B1004 7F07C4D4 C4420000 */ lwc1 $f2, ($v0) -/* 0B1008 7F07C4D8 4602603E */ c.le.s $f12, $f2 -/* 0B100C 7F07C4DC 00000000 */ nop -/* 0B1010 7F07C4E0 45020009 */ bc1fl .L7F07C508 -/* 0B1014 7F07C4E4 460E103C */ c.lt.s $f2, $f14 -/* 0B1018 7F07C4E8 460C1281 */ sub.s $f10, $f2, $f12 -.L7F07C4EC: -/* 0B101C 7F07C4EC E44A0000 */ swc1 $f10, ($v0) -/* 0B1020 7F07C4F0 C4420000 */ lwc1 $f2, ($v0) -/* 0B1024 7F07C4F4 4602603E */ c.le.s $f12, $f2 -/* 0B1028 7F07C4F8 00000000 */ nop -/* 0B102C 7F07C4FC 4503FFFB */ bc1tl .L7F07C4EC -/* 0B1030 7F07C500 460C1281 */ sub.s $f10, $f2, $f12 -/* 0B1034 7F07C504 460E103C */ c.lt.s $f2, $f14 -.L7F07C508: -/* 0B1038 7F07C508 00000000 */ nop -/* 0B103C 7F07C50C 45020009 */ bc1fl .L7F07C534 -/* 0B1040 7F07C510 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B1044 7F07C514 460C1200 */ add.s $f8, $f2, $f12 -.L7F07C518: -/* 0B1048 7F07C518 E4480000 */ swc1 $f8, ($v0) -/* 0B104C 7F07C51C C4420000 */ lwc1 $f2, ($v0) -/* 0B1050 7F07C520 460E103C */ c.lt.s $f2, $f14 -/* 0B1054 7F07C524 00000000 */ nop -/* 0B1058 7F07C528 4503FFFB */ bc1tl .L7F07C518 -/* 0B105C 7F07C52C 460C1200 */ add.s $f8, $f2, $f12 -.L7F07C530: -/* 0B1060 7F07C530 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07C534: -/* 0B1064 7F07C534 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B1068 7F07C538 03E00008 */ jr $ra -/* 0B106C 7F07C53C 00000000 */ nop -) -#endif - -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata -glabel D_80055044 -.word 0x43338000 /*179.5*/ -glabel D_80055048 -.word 0x3dcccccd /*0.1*/ -glabel D_8005504C -.word 0x3c75c28f /*0.015*/ -glabel D_80055050 -.word 0x40490fdb /*3.1415927*/ -glabel D_80055054 -.word 0x3da3d70a /*0.079999998*/ -glabel D_80055058 -.word 0x3da3d70a /*0.079999998*/ -glabel D_8005505C -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F07B56C -/* 0B06FC 7F07BB8C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B0700 7F07BB90 3C028003 */ lui $v0, %hi(g_CameraMode) # $v0, 0x8003 -/* 0B0704 7F07BB94 8C4264D4 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0B0708 7F07BB98 240B0001 */ li $t3, 1 -/* 0B070C 7F07BB9C AFBF0014 */ sw $ra, 0x14($sp) -/* 0B0710 7F07BBA0 AFA40040 */ sw $a0, 0x40($sp) -/* 0B0714 7F07BBA4 AFA50044 */ sw $a1, 0x44($sp) -/* 0B0718 7F07BBA8 AFA60048 */ sw $a2, 0x48($sp) -/* 0B071C 7F07BBAC 11620004 */ beq $t3, $v0, .Ljp7F07BBC0 -/* 0B0720 7F07BBB0 AFA7004C */ sw $a3, 0x4c($sp) -/* 0B0724 7F07BBB4 24050002 */ li $a1, 2 -/* 0B0728 7F07BBB8 14A200B0 */ bne $a1, $v0, .Ljp7F07BE7C -/* 0B072C 7F07BBBC 24010009 */ li $at, 9 -.Ljp7F07BBC0: -/* 0B0730 7F07BBC0 1562005A */ bne $t3, $v0, .Ljp7F07BD2C -/* 0B0734 7F07BBC4 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0738 7F07BBC8 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B073C 7F07BBCC 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0740 7F07BBD0 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 0B0744 7F07BBD4 44810000 */ mtc1 $at, $f0 -/* 0B0748 7F07BBD8 C5420000 */ lwc1 $f2, ($t2) -/* 0B074C 7F07BBDC 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B0750 7F07BBE0 4600103C */ c.lt.s $f2, $f0 -/* 0B0754 7F07BBE4 00000000 */ nop -/* 0B0758 7F07BBE8 45000013 */ bc1f .Ljp7F07BC38 -/* 0B075C 7F07BBEC 00000000 */ nop -/* 0B0760 7F07BBF0 C42483B4 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B0764 7F07BBF4 3C0E8003 */ lui $t6, %hi(ptr_random06cam_entry) # $t6, 0x8003 -/* 0B0768 7F07BBF8 3C058004 */ lui $a1, %hi(ptrSecondFontTableLarge) # $a1, 0x8004 -/* 0B076C 7F07BBFC 46041180 */ add.s $f6, $f2, $f4 -/* 0B0770 7F07BC00 3C068004 */ lui $a2, %hi(ptrFirstFontTableLarge) # $a2, 0x8004 -/* 0B0774 7F07BC04 4606003E */ c.le.s $f0, $f6 -/* 0B0778 7F07BC08 00000000 */ nop -/* 0B077C 7F07BC0C 4500000A */ bc1f .Ljp7F07BC38 -/* 0B0780 7F07BC10 00000000 */ nop -/* 0B0784 7F07BC14 8DCE6500 */ lw $t6, %lo(ptr_random06cam_entry)($t6) -/* 0B0788 7F07BC18 8CA50EE8 */ lw $a1, %lo(ptrSecondFontTableLarge)($a1) -/* 0B078C 7F07BC1C 8CC60EE4 */ lw $a2, %lo(ptrFirstFontTableLarge)($a2) -/* 0B0790 7F07BC20 0FC22AB3 */ jal hudmsgBottomShow -/* 0B0794 7F07BC24 8DC4001C */ lw $a0, 0x1c($t6) -/* 0B0798 7F07BC28 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B079C 7F07BC2C 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B07A0 7F07BC30 C5420000 */ lwc1 $f2, ($t2) -/* 0B07A4 7F07BC34 240B0001 */ li $t3, 1 -.Ljp7F07BC38: -/* 0B07A8 7F07BC38 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) # $t7, 0x8003 -/* 0B07AC 7F07BC3C 8DEF6500 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B07B0 7F07BC40 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B07B4 7F07BC44 C42883B4 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B07B8 7F07BC48 8DE40020 */ lw $a0, 0x20($t7) -/* 0B07BC 7F07BC4C 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B07C0 7F07BC50 46081000 */ add.s $f0, $f2, $f8 -/* 0B07C4 7F07BC54 50800021 */ beql $a0, $zero, .Ljp7F07BCDC -/* 0B07C8 7F07BC58 44816000 */ mtc1 $at, $f12 -/* 0B07CC 7F07BC5C 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B07D0 7F07BC60 44816000 */ mtc1 $at, $f12 -/* 0B07D4 7F07BC64 00000000 */ nop -/* 0B07D8 7F07BC68 460C103C */ c.lt.s $f2, $f12 -/* 0B07DC 7F07BC6C 00000000 */ nop -/* 0B07E0 7F07BC70 45020011 */ bc1fl .Ljp7F07BCB8 -/* 0B07E4 7F07BC74 3C0143F0 */ lui $at, 0x43f0 -/* 0B07E8 7F07BC78 4600603E */ c.le.s $f12, $f0 -/* 0B07EC 7F07BC7C 3C058004 */ lui $a1, %hi(ptrSecondFontTableLarge) # $a1, 0x8004 -/* 0B07F0 7F07BC80 3C068004 */ lui $a2, %hi(ptrFirstFontTableLarge) # $a2, 0x8004 -/* 0B07F4 7F07BC84 4502000C */ bc1fl .Ljp7F07BCB8 -/* 0B07F8 7F07BC88 3C0143F0 */ lui $at, 0x43f0 -/* 0B07FC 7F07BC8C 8CA50EE8 */ lw $a1, %lo(ptrSecondFontTableLarge)($a1) -/* 0B0800 7F07BC90 0FC22AB3 */ jal hudmsgBottomShow -/* 0B0804 7F07BC94 8CC60EE4 */ lw $a2, %lo(ptrFirstFontTableLarge)($a2) -/* 0B0808 7F07BC98 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B080C 7F07BC9C 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0810 7F07BCA0 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B0814 7F07BCA4 C42A83B4 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0B0818 7F07BCA8 C5420000 */ lwc1 $f2, ($t2) -/* 0B081C 7F07BCAC 240B0001 */ li $t3, 1 -/* 0B0820 7F07BCB0 460A1000 */ add.s $f0, $f2, $f10 -/* 0B0824 7F07BCB4 3C0143F0 */ li $at, 0x43F00000 # 480.000000 -.Ljp7F07BCB8: -/* 0B0828 7F07BCB8 44812000 */ mtc1 $at, $f4 -/* 0B082C 7F07BCBC 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0830 7F07BCC0 4602203C */ c.lt.s $f4, $f2 -/* 0B0834 7F07BCC4 00000000 */ nop -/* 0B0838 7F07BCC8 4500000A */ bc1f .Ljp7F07BCF4 -/* 0B083C 7F07BCCC 00000000 */ nop -/* 0B0840 7F07BCD0 10000008 */ b .Ljp7F07BCF4 -/* 0B0844 7F07BCD4 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0848 7F07BCD8 44816000 */ mtc1 $at, $f12 -.Ljp7F07BCDC: -/* 0B084C 7F07BCDC 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0850 7F07BCE0 4602603C */ c.lt.s $f12, $f2 -/* 0B0854 7F07BCE4 00000000 */ nop -/* 0B0858 7F07BCE8 45000002 */ bc1f .Ljp7F07BCF4 -/* 0B085C 7F07BCEC 00000000 */ nop -/* 0B0860 7F07BCF0 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07BCF4: -/* 0B0864 7F07BCF4 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0B0868 7F07BCF8 E5400000 */ swc1 $f0, ($t2) -/* 0B086C 7F07BCFC 14400015 */ bnez $v0, .Ljp7F07BD54 -/* 0B0870 7F07BD00 240B0001 */ li $t3, 1 -/* 0B0874 7F07BD04 97B90046 */ lhu $t9, 0x46($sp) -/* 0B0878 7F07BD08 97B80042 */ lhu $t8, 0x42($sp) -/* 0B087C 7F07BD0C 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0880 7F07BD10 03206027 */ not $t4, $t9 -/* 0B0884 7F07BD14 030C6824 */ and $t5, $t8, $t4 -/* 0B0888 7F07BD18 31AEF030 */ andi $t6, $t5, 0xf030 -/* 0B088C 7F07BD1C 11C0000D */ beqz $t6, .Ljp7F07BD54 -/* 0B0890 7F07BD20 00000000 */ nop -/* 0B0894 7F07BD24 1000000B */ b .Ljp7F07BD54 -/* 0B0898 7F07BD28 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07BD2C: -/* 0B089C 7F07BD2C 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B08A0 7F07BD30 8D2F0000 */ lw $t7, ($t1) -/* 0B08A4 7F07BD34 44807000 */ mtc1 $zero, $f14 -/* 0B08A8 7F07BD38 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B08AC 7F07BD3C C5E603E4 */ lwc1 $f6, 0x3e4($t7) -/* 0B08B0 7F07BD40 460E303C */ c.lt.s $f6, $f14 -/* 0B08B4 7F07BD44 00000000 */ nop -/* 0B08B8 7F07BD48 45000002 */ bc1f .Ljp7F07BD54 -/* 0B08BC 7F07BD4C 00000000 */ nop -/* 0B08C0 7F07BD50 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07BD54: -/* 0B08C4 7F07BD54 3C028003 */ lui $v0, %hi(ptr_random06cam_entry) # $v0, 0x8003 -/* 0B08C8 7F07BD58 24426500 */ addiu $v0, %lo(ptr_random06cam_entry) # addiu $v0, $v0, 0x6500 -/* 0B08CC 7F07BD5C 8C590000 */ lw $t9, ($v0) -/* 0B08D0 7F07BD60 8FB80048 */ lw $t8, 0x48($sp) -/* 0B08D4 7F07BD64 C7280004 */ lwc1 $f8, 4($t9) -/* 0B08D8 7F07BD68 E7080000 */ swc1 $f8, ($t8) -/* 0B08DC 7F07BD6C 8C4C0000 */ lw $t4, ($v0) -/* 0B08E0 7F07BD70 C58A0008 */ lwc1 $f10, 8($t4) -/* 0B08E4 7F07BD74 E70A0004 */ swc1 $f10, 4($t8) -/* 0B08E8 7F07BD78 8C4D0000 */ lw $t5, ($v0) -/* 0B08EC 7F07BD7C C5A4000C */ lwc1 $f4, 0xc($t5) -/* 0B08F0 7F07BD80 E7040008 */ swc1 $f4, 8($t8) -/* 0B08F4 7F07BD84 8C4E0000 */ lw $t6, ($v0) -/* 0B08F8 7F07BD88 0FC160F0 */ jal cosf -/* 0B08FC 7F07BD8C C5CC0014 */ lwc1 $f12, 0x14($t6) -/* 0B0900 7F07BD90 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) # $t7, 0x8003 -/* 0B0904 7F07BD94 8DEF6500 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B0908 7F07BD98 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B090C 7F07BD9C 0FC160F3 */ jal sinf -/* 0B0910 7F07BDA0 C5EC0010 */ lwc1 $f12, 0x10($t7) -/* 0B0914 7F07BDA4 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0B0918 7F07BDA8 8FB90048 */ lw $t9, 0x48($sp) -/* 0B091C 7F07BDAC 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B0920 7F07BDB0 46060202 */ mul.s $f8, $f0, $f6 -/* 0B0924 7F07BDB4 C72A0000 */ lwc1 $f10, ($t9) -/* 0B0928 7F07BDB8 3C0D8003 */ lui $t5, %hi(ptr_random06cam_entry) # $t5, 0x8003 -/* 0B092C 7F07BDBC 460A4100 */ add.s $f4, $f8, $f10 -/* 0B0930 7F07BDC0 E5840000 */ swc1 $f4, ($t4) -/* 0B0934 7F07BDC4 8DAD6500 */ lw $t5, %lo(ptr_random06cam_entry)($t5) -/* 0B0938 7F07BDC8 0FC160F3 */ jal sinf -/* 0B093C 7F07BDCC C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B0940 7F07BDD0 8FB80048 */ lw $t8, 0x48($sp) -/* 0B0944 7F07BDD4 8FAE004C */ lw $t6, 0x4c($sp) -/* 0B0948 7F07BDD8 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) # $t7, 0x8003 -/* 0B094C 7F07BDDC C7060004 */ lwc1 $f6, 4($t8) -/* 0B0950 7F07BDE0 46060200 */ add.s $f8, $f0, $f6 -/* 0B0954 7F07BDE4 E5C80004 */ swc1 $f8, 4($t6) -/* 0B0958 7F07BDE8 8DEF6500 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0B095C 7F07BDEC 0FC160F0 */ jal cosf -/* 0B0960 7F07BDF0 C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0B0964 7F07BDF4 3C198003 */ lui $t9, %hi(ptr_random06cam_entry) # $t9, 0x8003 -/* 0B0968 7F07BDF8 8F396500 */ lw $t9, %lo(ptr_random06cam_entry)($t9) -/* 0B096C 7F07BDFC E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B0970 7F07BE00 0FC160F0 */ jal cosf -/* 0B0974 7F07BE04 C72C0010 */ lwc1 $f12, 0x10($t9) -/* 0B0978 7F07BE08 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B097C 7F07BE0C 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B0980 7F07BE10 8FAD004C */ lw $t5, 0x4c($sp) -/* 0B0984 7F07BE14 46040182 */ mul.s $f6, $f0, $f4 -/* 0B0988 7F07BE18 C58A0008 */ lwc1 $f10, 8($t4) -/* 0B098C 7F07BE1C 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0990 7F07BE20 3C188003 */ lui $t8, %hi(ptr_random06cam_entry) # $t8, 0x8003 -/* 0B0994 7F07BE24 3C198007 */ lui $t9, %hi(g_CurrentSetup+0x18) # $t9, 0x8007 -/* 0B0998 7F07BE28 46065201 */ sub.s $f8, $f10, $f6 -/* 0B099C 7F07BE2C E5A80008 */ swc1 $f8, 8($t5) -/* 0B09A0 7F07BE30 8F186500 */ lw $t8, %lo(ptr_random06cam_entry)($t8) -/* 0B09A4 7F07BE34 8F395D58 */ lw $t9, %lo(g_CurrentSetup+0x18)($t9) -/* 0B09A8 7F07BE38 8FAD0054 */ lw $t5, 0x54($sp) -/* 0B09AC 7F07BE3C 8F0E0018 */ lw $t6, 0x18($t8) -/* 0B09B0 7F07BE40 000E7880 */ sll $t7, $t6, 2 -/* 0B09B4 7F07BE44 01EE7823 */ subu $t7, $t7, $t6 -/* 0B09B8 7F07BE48 000F7880 */ sll $t7, $t7, 2 -/* 0B09BC 7F07BE4C 01EE7823 */ subu $t7, $t7, $t6 -/* 0B09C0 7F07BE50 000F7880 */ sll $t7, $t7, 2 -/* 0B09C4 7F07BE54 01F91021 */ addu $v0, $t7, $t9 -/* 0B09C8 7F07BE58 8C4C0028 */ lw $t4, 0x28($v0) -/* 0B09CC 7F07BE5C ADAC0000 */ sw $t4, ($t5) -/* 0B09D0 7F07BE60 C4440000 */ lwc1 $f4, ($v0) -/* 0B09D4 7F07BE64 E4640000 */ swc1 $f4, ($v1) -/* 0B09D8 7F07BE68 C44A0004 */ lwc1 $f10, 4($v0) -/* 0B09DC 7F07BE6C E46A0004 */ swc1 $f10, 4($v1) -/* 0B09E0 7F07BE70 C4460008 */ lwc1 $f6, 8($v0) -/* 0B09E4 7F07BE74 10000337 */ b .Ljp7F07CB54 -/* 0B09E8 7F07BE78 E4660008 */ swc1 $f6, 8($v1) -.Ljp7F07BE7C: -/* 0B09EC 7F07BE7C 544100B3 */ bnel $v0, $at, .Ljp7F07C14C -/* 0B09F0 7F07BE80 24010003 */ li $at, 3 -/* 0B09F4 7F07BE84 0FC26F3C */ jal get_cur_playernum -/* 0B09F8 7F07BE88 00000000 */ nop -/* 0B09FC 7F07BE8C 0FC2701E */ jal sub_GAME_7F09B4D8 -/* 0B0A00 7F07BE90 00402025 */ move $a0, $v0 -/* 0B0A04 7F07BE94 14400054 */ bnez $v0, .Ljp7F07BFE8 -/* 0B0A08 7F07BE98 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0A0C 7F07BE9C 3C078005 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8005 -/* 0B0A10 7F07BEA0 8CE783A4 */ lw $a3, %lo(g_ClockTimer)($a3) -/* 0B0A14 7F07BEA4 00001825 */ move $v1, $zero -/* 0B0A18 7F07BEA8 3C018008 */ lui $at, %hi(flt_CODE_bss_80079E08) # $at, 0x8008 -/* 0B0A1C 7F07BEAC 18E0004E */ blez $a3, .Ljp7F07BFE8 -/* 0B0A20 7F07BEB0 3C068008 */ lui $a2, %hi(flt_CODE_bss_80079E04) # $a2, 0x8008 -/* 0B0A24 7F07BEB4 C42C9E78 */ lwc1 $f12, %lo(flt_CODE_bss_80079E08)($at) -/* 0B0A28 7F07BEB8 3C018005 */ lui $at, %hi(D_80055044) # $at, 0x8005 -/* 0B0A2C 7F07BEBC C4325074 */ lwc1 $f18, %lo(D_80055044)($at) -/* 0B0A30 7F07BEC0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B0A34 7F07BEC4 44818000 */ mtc1 $at, $f16 -/* 0B0A38 7F07BEC8 3C018005 */ lui $at, %hi(D_80055048) -/* 0B0A3C 7F07BECC 3C058008 */ lui $a1, %hi(flt_CODE_bss_80079E0C) # $a1, 0x8008 -/* 0B0A40 7F07BED0 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079E08) # $a0, 0x8008 -/* 0B0A44 7F07BED4 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) # $v0, 0x8008 -/* 0B0A48 7F07BED8 24429E80 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x6180 -/* 0B0A4C 7F07BEDC 24849E78 */ addiu $a0, %lo(flt_CODE_bss_80079E08) # addiu $a0, $a0, -0x6188 -/* 0B0A50 7F07BEE0 24A59E7C */ addiu $a1, %lo(flt_CODE_bss_80079E0C) # addiu $a1, $a1, -0x6184 -/* 0B0A54 7F07BEE4 C42E5078 */ lwc1 $f14, %lo(D_80055048)($at) -/* 0B0A58 7F07BEE8 24C69E74 */ addiu $a2, %lo(flt_CODE_bss_80079E04) # addiu $a2, $a2, -0x618c -/* 0B0A5C 7F07BEEC 4612603C */ c.lt.s $f12, $f18 -.Ljp7F07BEF0: -/* 0B0A60 7F07BEF0 24630001 */ addiu $v1, $v1, 1 -/* 0B0A64 7F07BEF4 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B0A68 7F07BEF8 45020017 */ bc1fl .Ljp7F07BF58 -/* 0B0A6C 7F07BEFC 44812000 */ mtc1 $at, $f4 -/* 0B0A70 7F07BF00 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B0A74 7F07BF04 44814000 */ mtc1 $at, $f8 -/* 0B0A78 7F07BF08 3C0142DC */ li $at, 0x42DC0000 # 110.000000 -/* 0B0A7C 7F07BF0C 44815000 */ mtc1 $at, $f10 -/* 0B0A80 7F07BF10 4608603C */ c.lt.s $f12, $f8 -/* 0B0A84 7F07BF14 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0A88 7F07BF18 45020005 */ bc1fl .Ljp7F07BF30 -/* 0B0A8C 7F07BF1C 460C503C */ c.lt.s $f10, $f12 -/* 0B0A90 7F07BF20 460E0100 */ add.s $f4, $f0, $f14 -/* 0B0A94 7F07BF24 E4C40000 */ swc1 $f4, ($a2) -/* 0B0A98 7F07BF28 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0A9C 7F07BF2C 460C503C */ c.lt.s $f10, $f12 -.Ljp7F07BF30: -/* 0B0AA0 7F07BF30 00000000 */ nop -/* 0B0AA4 7F07BF34 45020005 */ bc1fl .Ljp7F07BF4C -/* 0B0AA8 7F07BF38 46006200 */ add.s $f8, $f12, $f0 -/* 0B0AAC 7F07BF3C 460E0181 */ sub.s $f6, $f0, $f14 -/* 0B0AB0 7F07BF40 E4C60000 */ swc1 $f6, ($a2) -/* 0B0AB4 7F07BF44 C4C00000 */ lwc1 $f0, ($a2) -/* 0B0AB8 7F07BF48 46006200 */ add.s $f8, $f12, $f0 -.Ljp7F07BF4C: -/* 0B0ABC 7F07BF4C 10000004 */ b .Ljp7F07BF60 -/* 0B0AC0 7F07BF50 E4880000 */ swc1 $f8, ($a0) -/* 0B0AC4 7F07BF54 44812000 */ mtc1 $at, $f4 -.Ljp7F07BF58: -/* 0B0AC8 7F07BF58 00000000 */ nop -/* 0B0ACC 7F07BF5C E4840000 */ swc1 $f4, ($a0) -.Ljp7F07BF60: -/* 0B0AD0 7F07BF60 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -/* 0B0AD4 7F07BF64 44815000 */ mtc1 $at, $f10 -/* 0B0AD8 7F07BF68 C48C0000 */ lwc1 $f12, ($a0) -/* 0B0ADC 7F07BF6C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B0AE0 7F07BF70 460C503C */ c.lt.s $f10, $f12 -/* 0B0AE4 7F07BF74 00000000 */ nop -/* 0B0AE8 7F07BF78 45020019 */ bc1fl .Ljp7F07BFE0 -/* 0B0AEC 7F07BF7C 0067082A */ slt $at, $v1, $a3 -/* 0B0AF0 7F07BF80 C4400000 */ lwc1 $f0, ($v0) -/* 0B0AF4 7F07BF84 44813000 */ mtc1 $at, $f6 -/* 0B0AF8 7F07BF88 C4A20000 */ lwc1 $f2, ($a1) -/* 0B0AFC 7F07BF8C 3C018005 */ lui $at, %hi(D_8005504C) # $at, 0x8005 -/* 0B0B00 7F07BF90 4600303C */ c.lt.s $f6, $f0 -/* 0B0B04 7F07BF94 00000000 */ nop -/* 0B0B08 7F07BF98 45000004 */ bc1f .Ljp7F07BFAC -/* 0B0B0C 7F07BF9C 00000000 */ nop -/* 0B0B10 7F07BFA0 460E1201 */ sub.s $f8, $f2, $f14 -/* 0B0B14 7F07BFA4 10000004 */ b .Ljp7F07BFB8 -/* 0B0B18 7F07BFA8 E4A80000 */ swc1 $f8, ($a1) -.Ljp7F07BFAC: -/* 0B0B1C 7F07BFAC C424507C */ lwc1 $f4, %lo(D_8005504C)($at) -/* 0B0B20 7F07BFB0 46041280 */ add.s $f10, $f2, $f4 -/* 0B0B24 7F07BFB4 E4AA0000 */ swc1 $f10, ($a1) -.Ljp7F07BFB8: -/* 0B0B28 7F07BFB8 C4A60000 */ lwc1 $f6, ($a1) -/* 0B0B2C 7F07BFBC 46060200 */ add.s $f8, $f0, $f6 -/* 0B0B30 7F07BFC0 E4480000 */ swc1 $f8, ($v0) -/* 0B0B34 7F07BFC4 C4440000 */ lwc1 $f4, ($v0) -/* 0B0B38 7F07BFC8 4610203C */ c.lt.s $f4, $f16 -/* 0B0B3C 7F07BFCC 00000000 */ nop -/* 0B0B40 7F07BFD0 45020003 */ bc1fl .Ljp7F07BFE0 -/* 0B0B44 7F07BFD4 0067082A */ slt $at, $v1, $a3 -/* 0B0B48 7F07BFD8 E4500000 */ swc1 $f16, ($v0) -/* 0B0B4C 7F07BFDC 0067082A */ slt $at, $v1, $a3 -.Ljp7F07BFE0: -/* 0B0B50 7F07BFE0 5420FFC3 */ bnezl $at, .Ljp7F07BEF0 -/* 0B0B54 7F07BFE4 4612603C */ c.lt.s $f12, $f18 -.Ljp7F07BFE8: -/* 0B0B58 7F07BFE8 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0B5C 7F07BFEC 8D380000 */ lw $t8, ($t1) -/* 0B0B60 7F07BFF0 3C048008 */ lui $a0, %hi(flt_CODE_bss_80079E08) # $a0, 0x8008 -/* 0B0B64 7F07BFF4 24849E78 */ addiu $a0, %lo(flt_CODE_bss_80079E08) # addiu $a0, $a0, -0x6188 -/* 0B0B68 7F07BFF8 C48A0000 */ lwc1 $f10, ($a0) -/* 0B0B6C 7F07BFFC C7060148 */ lwc1 $f6, 0x148($t8) -/* 0B0B70 7F07C000 3C018005 */ lui $at, %hi(D_80055050) # $at, 0x8005 -/* 0B0B74 7F07C004 C4245080 */ lwc1 $f4, %lo(D_80055050)($at) -/* 0B0B78 7F07C008 46065201 */ sub.s $f8, $f10, $f6 -/* 0B0B7C 7F07C00C 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B0B80 7F07C010 44813000 */ mtc1 $at, $f6 -/* 0B0B84 7F07C014 46044282 */ mul.s $f10, $f8, $f4 -/* 0B0B88 7F07C018 46065303 */ div.s $f12, $f10, $f6 -/* 0B0B8C 7F07C01C 0FC160F3 */ jal sinf -/* 0B0B90 7F07C020 E7AC0038 */ swc1 $f12, 0x38($sp) -/* 0B0B94 7F07C024 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) # $v0, 0x8008 -/* 0B0B98 7F07C028 24429E80 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x6180 -/* 0B0B9C 7F07C02C C4480000 */ lwc1 $f8, ($v0) -/* 0B0BA0 7F07C030 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0BA4 7F07C034 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0BA8 7F07C038 46080102 */ mul.s $f4, $f0, $f8 -/* 0B0BAC 7F07C03C 8D2E0000 */ lw $t6, ($t1) -/* 0B0BB0 7F07C040 8FA30048 */ lw $v1, 0x48($sp) -/* 0B0BB4 7F07C044 C7AC0038 */ lwc1 $f12, 0x38($sp) -/* 0B0BB8 7F07C048 C5CA04B4 */ lwc1 $f10, 0x4b4($t6) -/* 0B0BBC 7F07C04C 3C018005 */ lui $at, %hi(D_80055054) # $at, 0x8005 -/* 0B0BC0 7F07C050 460A2180 */ add.s $f6, $f4, $f10 -/* 0B0BC4 7F07C054 E4660000 */ swc1 $f6, ($v1) -/* 0B0BC8 7F07C058 C4245084 */ lwc1 $f4, %lo(D_80055054)($at) -/* 0B0BCC 7F07C05C C4480000 */ lwc1 $f8, ($v0) -/* 0B0BD0 7F07C060 8D2F0000 */ lw $t7, ($t1) -/* 0B0BD4 7F07C064 46044282 */ mul.s $f10, $f8, $f4 -/* 0B0BD8 7F07C068 C5E604B8 */ lwc1 $f6, 0x4b8($t7) -/* 0B0BDC 7F07C06C 460A3200 */ add.s $f8, $f6, $f10 -/* 0B0BE0 7F07C070 0FC160F0 */ jal cosf -/* 0B0BE4 7F07C074 E4680004 */ swc1 $f8, 4($v1) -/* 0B0BE8 7F07C078 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079E10) # $v0, 0x8008 -/* 0B0BEC 7F07C07C 24429E80 */ addiu $v0, %lo(flt_CODE_bss_80079E10) # addiu $v0, $v0, -0x6180 -/* 0B0BF0 7F07C080 C4440000 */ lwc1 $f4, ($v0) -/* 0B0BF4 7F07C084 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0BF8 7F07C088 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0BFC 7F07C08C 46040182 */ mul.s $f6, $f0, $f4 -/* 0B0C00 7F07C090 8D390000 */ lw $t9, ($t1) -/* 0B0C04 7F07C094 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B0C08 7F07C098 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0C0C 7F07C09C C72A04BC */ lwc1 $f10, 0x4bc($t9) -/* 0B0C10 7F07C0A0 8FA4004C */ lw $a0, 0x4c($sp) -/* 0B0C14 7F07C0A4 3C018005 */ lui $at, %hi(D_80055058) # $at, 0x8005 -/* 0B0C18 7F07C0A8 460A3200 */ add.s $f8, $f6, $f10 -/* 0B0C1C 7F07C0AC 240B0001 */ li $t3, 1 -/* 0B0C20 7F07C0B0 E5880008 */ swc1 $f8, 8($t4) -/* 0B0C24 7F07C0B4 8D2D0000 */ lw $t5, ($t1) -/* 0B0C28 7F07C0B8 C5A404B4 */ lwc1 $f4, 0x4b4($t5) -/* 0B0C2C 7F07C0BC E4840000 */ swc1 $f4, ($a0) -/* 0B0C30 7F07C0C0 8D380000 */ lw $t8, ($t1) -/* 0B0C34 7F07C0C4 C70604B8 */ lwc1 $f6, 0x4b8($t8) -/* 0B0C38 7F07C0C8 E4860004 */ swc1 $f6, 4($a0) -/* 0B0C3C 7F07C0CC 8D2E0000 */ lw $t6, ($t1) -/* 0B0C40 7F07C0D0 C5CA04BC */ lwc1 $f10, 0x4bc($t6) -/* 0B0C44 7F07C0D4 E48A0008 */ swc1 $f10, 8($a0) -/* 0B0C48 7F07C0D8 8D2F0000 */ lw $t7, ($t1) -/* 0B0C4C 7F07C0DC 8FAD0054 */ lw $t5, 0x54($sp) -/* 0B0C50 7F07C0E0 8DF900A8 */ lw $t9, 0xa8($t7) -/* 0B0C54 7F07C0E4 8F2C0014 */ lw $t4, 0x14($t9) -/* 0B0C58 7F07C0E8 ADAC0000 */ sw $t4, ($t5) -/* 0B0C5C 7F07C0EC 8D380000 */ lw $t8, ($t1) -/* 0B0C60 7F07C0F0 C70804B4 */ lwc1 $f8, 0x4b4($t8) -/* 0B0C64 7F07C0F4 E4680000 */ swc1 $f8, ($v1) -/* 0B0C68 7F07C0F8 C4440000 */ lwc1 $f4, ($v0) -/* 0B0C6C 7F07C0FC C4265088 */ lwc1 $f6, %lo(D_80055058)($at) -/* 0B0C70 7F07C100 8D2E0000 */ lw $t6, ($t1) -/* 0B0C74 7F07C104 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B0C78 7F07C108 46062282 */ mul.s $f10, $f4, $f6 -/* 0B0C7C 7F07C10C C5C804B8 */ lwc1 $f8, 0x4b8($t6) -/* 0B0C80 7F07C110 460A4100 */ add.s $f4, $f8, $f10 -/* 0B0C84 7F07C114 44815000 */ mtc1 $at, $f10 -/* 0B0C88 7F07C118 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0C8C 7F07C11C E4640004 */ swc1 $f4, 4($v1) -/* 0B0C90 7F07C120 8D2F0000 */ lw $t7, ($t1) -/* 0B0C94 7F07C124 C5E604BC */ lwc1 $f6, 0x4bc($t7) -/* 0B0C98 7F07C128 E4660008 */ swc1 $f6, 8($v1) -/* 0B0C9C 7F07C12C C4480000 */ lwc1 $f8, ($v0) -/* 0B0CA0 7F07C130 460A403C */ c.lt.s $f8, $f10 -/* 0B0CA4 7F07C134 00000000 */ nop -/* 0B0CA8 7F07C138 45020287 */ bc1fl .Ljp7F07CB58 -/* 0B0CAC 7F07C13C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B0CB0 7F07C140 10000284 */ b .Ljp7F07CB54 -/* 0B0CB4 7F07C144 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0CB8 7F07C148 24010003 */ li $at, 3 -.Ljp7F07C14C: -/* 0B0CBC 7F07C14C 144100CB */ bne $v0, $at, .Ljp7F07C47C -/* 0B0CC0 7F07C150 24030005 */ li $v1, 5 -/* 0B0CC4 7F07C154 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0CC8 7F07C158 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0CCC 7F07C15C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B0CD0 7F07C160 C43283B4 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B0CD4 7F07C164 C5440000 */ lwc1 $f4, ($t2) -/* 0B0CD8 7F07C168 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0CDC 7F07C16C 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -/* 0B0CE0 7F07C170 46122180 */ add.s $f6, $f4, $f18 -/* 0B0CE4 7F07C174 8D030000 */ lw $v1, ($t0) -/* 0B0CE8 7F07C178 3C048003 */ lui $a0, %hi(g_IntroSwirl) # $a0, 0x8003 -/* 0B0CEC 7F07C17C 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0CF0 7F07C180 E5460000 */ swc1 $f6, ($t2) -/* 0B0CF4 7F07C184 8C8464EC */ lw $a0, %lo(g_IntroSwirl)($a0) -/* 0B0CF8 7F07C188 0003C940 */ sll $t9, $v1, 5 -/* 0B0CFC 7F07C18C C5420000 */ lwc1 $f2, ($t2) -/* 0B0D00 7F07C190 00991021 */ addu $v0, $a0, $t9 -/* 0B0D04 7F07C194 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B0D08 7F07C198 4602003E */ c.le.s $f0, $f2 -/* 0B0D0C 7F07C19C 00000000 */ nop -/* 0B0D10 7F07C1A0 45020019 */ bc1fl .Ljp7F07C208 -/* 0B0D14 7F07C1A4 24650001 */ addiu $a1, $v1, 1 -/* 0B0D18 7F07C1A8 8C4C0064 */ lw $t4, 0x64($v0) -.Ljp7F07C1AC: -/* 0B0D1C 7F07C1AC 318D0001 */ andi $t5, $t4, 1 -/* 0B0D20 7F07C1B0 55A00007 */ bnezl $t5, .Ljp7F07C1D0 -/* 0B0D24 7F07C1B4 E5400000 */ swc1 $f0, ($t2) -/* 0B0D28 7F07C1B8 46001201 */ sub.s $f8, $f2, $f0 -/* 0B0D2C 7F07C1BC 24780001 */ addiu $t8, $v1, 1 -/* 0B0D30 7F07C1C0 AD180000 */ sw $t8, ($t0) -/* 0B0D34 7F07C1C4 10000006 */ b .Ljp7F07C1E0 -/* 0B0D38 7F07C1C8 E5480000 */ swc1 $f8, ($t2) -/* 0B0D3C 7F07C1CC E5400000 */ swc1 $f0, ($t2) -.Ljp7F07C1D0: -/* 0B0D40 7F07C1D0 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B0D44 7F07C1D4 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B0D48 7F07C1D8 1000000A */ b .Ljp7F07C204 -/* 0B0D4C 7F07C1DC C5420000 */ lwc1 $f2, ($t2) -.Ljp7F07C1E0: -/* 0B0D50 7F07C1E0 8D030000 */ lw $v1, ($t0) -/* 0B0D54 7F07C1E4 C5420000 */ lwc1 $f2, ($t2) -/* 0B0D58 7F07C1E8 00037140 */ sll $t6, $v1, 5 -/* 0B0D5C 7F07C1EC 008E1021 */ addu $v0, $a0, $t6 -/* 0B0D60 7F07C1F0 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0B0D64 7F07C1F4 4602003E */ c.le.s $f0, $f2 -/* 0B0D68 7F07C1F8 00000000 */ nop -/* 0B0D6C 7F07C1FC 4503FFEB */ bc1tl .Ljp7F07C1AC -/* 0B0D70 7F07C200 8C4C0064 */ lw $t4, 0x64($v0) -.Ljp7F07C204: -/* 0B0D74 7F07C204 24650001 */ addiu $a1, $v1, 1 -.Ljp7F07C208: -/* 0B0D78 7F07C208 00057940 */ sll $t7, $a1, 5 -/* 0B0D7C 7F07C20C 008F1021 */ addu $v0, $a0, $t7 -/* 0B0D80 7F07C210 8C590044 */ lw $t9, 0x44($v0) -/* 0B0D84 7F07C214 46020281 */ sub.s $f10, $f0, $f2 -/* 0B0D88 7F07C218 44807000 */ mtc1 $zero, $f14 -/* 0B0D8C 7F07C21C 332C0001 */ andi $t4, $t9, 1 -/* 0B0D90 7F07C220 15800007 */ bnez $t4, .Ljp7F07C240 -/* 0B0D94 7F07C224 460A7400 */ add.s $f16, $f14, $f10 -.Ljp7F07C228: -/* 0B0D98 7F07C228 8C4D0064 */ lw $t5, 0x64($v0) -/* 0B0D9C 7F07C22C C4440018 */ lwc1 $f4, 0x18($v0) -/* 0B0DA0 7F07C230 24420020 */ addiu $v0, $v0, 0x20 -/* 0B0DA4 7F07C234 31B80001 */ andi $t8, $t5, 1 -/* 0B0DA8 7F07C238 1300FFFB */ beqz $t8, .Ljp7F07C228 -/* 0B0DAC 7F07C23C 46048400 */ add.s $f16, $f16, $f4 -.Ljp7F07C240: -/* 0B0DB0 7F07C240 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B0DB4 7F07C244 44816000 */ mtc1 $at, $f12 -/* 0B0DB8 7F07C248 00000000 */ nop -/* 0B0DBC 7F07C24C 460C803C */ c.lt.s $f16, $f12 -/* 0B0DC0 7F07C250 00000000 */ nop -/* 0B0DC4 7F07C254 4500000D */ bc1f .Ljp7F07C28C -/* 0B0DC8 7F07C258 00000000 */ nop -/* 0B0DCC 7F07C25C 46128180 */ add.s $f6, $f16, $f18 -/* 0B0DD0 7F07C260 4606603E */ c.le.s $f12, $f6 -/* 0B0DD4 7F07C264 00000000 */ nop -/* 0B0DD8 7F07C268 45000008 */ bc1f .Ljp7F07C28C -/* 0B0DDC 7F07C26C 00000000 */ nop -/* 0B0DE0 7F07C270 0FC20408 */ jal currentPlayerStartChrFade -/* 0B0DE4 7F07C274 E7B00030 */ swc1 $f16, 0x30($sp) -/* 0B0DE8 7F07C278 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0DEC 7F07C27C 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0DF0 7F07C280 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0DF4 7F07C284 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -/* 0B0DF8 7F07C288 C7B00030 */ lwc1 $f16, 0x30($sp) -.Ljp7F07C28C: -/* 0B0DFC 7F07C28C 3C0E8003 */ lui $t6, %hi(D_8003649C) # $t6, 0x8003 -/* 0B0E00 7F07C290 8DCE64DC */ lw $t6, %lo(D_8003649C)($t6) -/* 0B0E04 7F07C294 51C0000D */ beql $t6, $zero, .Ljp7F07C2CC -/* 0B0E08 7F07C298 3C014270 */ lui $at, 0x4270 -/* 0B0E0C 7F07C29C 0FC203A7 */ jal currentPlayerIsFadeComplete -/* 0B0E10 7F07C2A0 E7B00030 */ swc1 $f16, 0x30($sp) -/* 0B0E14 7F07C2A4 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0E18 7F07C2A8 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0E1C 7F07C2AC 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0E20 7F07C2B0 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -/* 0B0E24 7F07C2B4 240B0001 */ li $t3, 1 -/* 0B0E28 7F07C2B8 10400003 */ beqz $v0, .Ljp7F07C2C8 -/* 0B0E2C 7F07C2BC C7B00030 */ lwc1 $f16, 0x30($sp) -/* 0B0E30 7F07C2C0 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B0E34 7F07C2C4 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07C2C8: -/* 0B0E38 7F07C2C8 3C014270 */ li $at, 0x42700000 # 60.000000 -.Ljp7F07C2CC: -/* 0B0E3C 7F07C2CC 44814000 */ mtc1 $at, $f8 -/* 0B0E40 7F07C2D0 3C0F8003 */ lui $t7, %hi(D_8003649C) # $t7, 0x8003 -/* 0B0E44 7F07C2D4 4610403C */ c.lt.s $f8, $f16 -/* 0B0E48 7F07C2D8 00000000 */ nop -/* 0B0E4C 7F07C2DC 45020036 */ bc1fl .Ljp7F07C3B8 -/* 0B0E50 7F07C2E0 8D040000 */ lw $a0, ($t0) -/* 0B0E54 7F07C2E4 8DEF64DC */ lw $t7, %lo(D_8003649C)($t7) -/* 0B0E58 7F07C2E8 55E00033 */ bnezl $t7, .Ljp7F07C3B8 -/* 0B0E5C 7F07C2EC 8D040000 */ lw $a0, ($t0) -/* 0B0E60 7F07C2F0 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0B0E64 7F07C2F4 00000000 */ nop -/* 0B0E68 7F07C2F8 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0E6C 7F07C2FC 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0E70 7F07C300 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0E74 7F07C304 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -/* 0B0E78 7F07C308 1440002A */ bnez $v0, .Ljp7F07C3B4 -/* 0B0E7C 7F07C30C 240B0001 */ li $t3, 1 -/* 0B0E80 7F07C310 97AC0046 */ lhu $t4, 0x46($sp) -/* 0B0E84 7F07C314 97B90042 */ lhu $t9, 0x42($sp) -/* 0B0E88 7F07C318 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0E8C 7F07C31C 01806827 */ not $t5, $t4 -/* 0B0E90 7F07C320 032DC024 */ and $t8, $t9, $t5 -/* 0B0E94 7F07C324 330EF030 */ andi $t6, $t8, 0xf030 -/* 0B0E98 7F07C328 11C00022 */ beqz $t6, .Ljp7F07C3B4 -/* 0B0E9C 7F07C32C 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0EA0 7F07C330 3C018003 */ lui $at, %hi(D_8003649C) # $at, 0x8003 -/* 0B0EA4 7F07C334 AC2B64DC */ sw $t3, %lo(D_8003649C)($at) -/* 0B0EA8 7F07C338 8D2F0000 */ lw $t7, ($t1) -/* 0B0EAC 7F07C33C 00002025 */ move $a0, $zero -/* 0B0EB0 7F07C340 00002825 */ move $a1, $zero -/* 0B0EB4 7F07C344 00003025 */ move $a2, $zero -/* 0B0EB8 7F07C348 0FC20370 */ jal currentPlayerSetFadeColour -/* 0B0EBC 7F07C34C 8DE703DC */ lw $a3, 0x3dc($t7) -/* 0B0EC0 7F07C350 0FC203A7 */ jal currentPlayerIsFadeComplete -/* 0B0EC4 7F07C354 00000000 */ nop -/* 0B0EC8 7F07C358 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0ECC 7F07C35C 1040000C */ beqz $v0, .Ljp7F07C390 -/* 0B0ED0 7F07C360 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0ED4 7F07C364 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B0ED8 7F07C368 44816000 */ mtc1 $at, $f12 -/* 0B0EDC 7F07C36C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B0EE0 7F07C370 44817000 */ mtc1 $at, $f14 -/* 0B0EE4 7F07C374 0FC2039A */ jal currentPlayerSetFadeFrac -/* 0B0EE8 7F07C378 00000000 */ nop -/* 0B0EEC 7F07C37C 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0EF0 7F07C380 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0EF4 7F07C384 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0EF8 7F07C388 1000000A */ b .Ljp7F07C3B4 -/* 0B0EFC 7F07C38C 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -.Ljp7F07C390: -/* 0B0F00 7F07C390 8D2C0000 */ lw $t4, ($t1) -/* 0B0F04 7F07C394 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B0F08 7F07C398 44817000 */ mtc1 $at, $f14 -/* 0B0F0C 7F07C39C 0FC2039A */ jal currentPlayerSetFadeFrac -/* 0B0F10 7F07C3A0 C58C03E0 */ lwc1 $f12, 0x3e0($t4) -/* 0B0F14 7F07C3A4 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0F18 7F07C3A8 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B0F1C 7F07C3AC 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B0F20 7F07C3B0 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -.Ljp7F07C3B4: -/* 0B0F24 7F07C3B4 8D040000 */ lw $a0, ($t0) -.Ljp7F07C3B8: -/* 0B0F28 7F07C3B8 8D450000 */ lw $a1, ($t2) -/* 0B0F2C 7F07C3BC 8FA60048 */ lw $a2, 0x48($sp) -/* 0B0F30 7F07C3C0 0FC1EE30 */ jal sub_GAME_7F07B2A0 -/* 0B0F34 7F07C3C4 8FA7004C */ lw $a3, 0x4c($sp) -/* 0B0F38 7F07C3C8 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0B0F3C 7F07C3CC 250864E8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x64e8 -/* 0B0F40 7F07C3D0 8D0D0000 */ lw $t5, ($t0) -/* 0B0F44 7F07C3D4 3C198003 */ lui $t9, %hi(g_IntroSwirl) # $t9, 0x8003 -/* 0B0F48 7F07C3D8 8F3964EC */ lw $t9, %lo(g_IntroSwirl)($t9) -/* 0B0F4C 7F07C3DC 000DC140 */ sll $t8, $t5, 5 -/* 0B0F50 7F07C3E0 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B0F54 7F07C3E4 03387021 */ addu $t6, $t9, $t8 -/* 0B0F58 7F07C3E8 8DC4001C */ lw $a0, 0x1c($t6) -/* 0B0F5C 7F07C3EC 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B0F60 7F07C3F0 3C0C8007 */ lui $t4, %hi(g_CurrentSetup+0x18) # $t4, 0x8007 -/* 0B0F64 7F07C3F4 04800012 */ bltz $a0, .Ljp7F07C440 -/* 0B0F68 7F07C3F8 00047880 */ sll $t7, $a0, 2 -/* 0B0F6C 7F07C3FC 01E47823 */ subu $t7, $t7, $a0 -/* 0B0F70 7F07C400 8D8C5D58 */ lw $t4, %lo(g_CurrentSetup+0x18)($t4) -/* 0B0F74 7F07C404 000F7880 */ sll $t7, $t7, 2 -/* 0B0F78 7F07C408 01E47823 */ subu $t7, $t7, $a0 -/* 0B0F7C 7F07C40C 000F7880 */ sll $t7, $t7, 2 -/* 0B0F80 7F07C410 01EC1021 */ addu $v0, $t7, $t4 -/* 0B0F84 7F07C414 8C4D0028 */ lw $t5, 0x28($v0) -/* 0B0F88 7F07C418 8FB90054 */ lw $t9, 0x54($sp) -/* 0B0F8C 7F07C41C 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0F90 7F07C420 AF2D0000 */ sw $t5, ($t9) -/* 0B0F94 7F07C424 C44A0000 */ lwc1 $f10, ($v0) -/* 0B0F98 7F07C428 E46A0000 */ swc1 $f10, ($v1) -/* 0B0F9C 7F07C42C C4440004 */ lwc1 $f4, 4($v0) -/* 0B0FA0 7F07C430 E4640004 */ swc1 $f4, 4($v1) -/* 0B0FA4 7F07C434 C4460008 */ lwc1 $f6, 8($v0) -/* 0B0FA8 7F07C438 100001C6 */ b .Ljp7F07CB54 -/* 0B0FAC 7F07C43C E4660008 */ swc1 $f6, 8($v1) -.Ljp7F07C440: -/* 0B0FB0 7F07C440 8D380000 */ lw $t8, ($t1) -/* 0B0FB4 7F07C444 8FAF0054 */ lw $t7, 0x54($sp) -/* 0B0FB8 7F07C448 8FA30058 */ lw $v1, 0x58($sp) -/* 0B0FBC 7F07C44C 8F0E0488 */ lw $t6, 0x488($t8) -/* 0B0FC0 7F07C450 ADEE0000 */ sw $t6, ($t7) -/* 0B0FC4 7F07C454 8D2C0000 */ lw $t4, ($t1) -/* 0B0FC8 7F07C458 C588048C */ lwc1 $f8, 0x48c($t4) -/* 0B0FCC 7F07C45C E4680000 */ swc1 $f8, ($v1) -/* 0B0FD0 7F07C460 8D2D0000 */ lw $t5, ($t1) -/* 0B0FD4 7F07C464 C5AA0490 */ lwc1 $f10, 0x490($t5) -/* 0B0FD8 7F07C468 E46A0004 */ swc1 $f10, 4($v1) -/* 0B0FDC 7F07C46C 8D390000 */ lw $t9, ($t1) -/* 0B0FE0 7F07C470 C7240494 */ lwc1 $f4, 0x494($t9) -/* 0B0FE4 7F07C474 100001B7 */ b .Ljp7F07CB54 -/* 0B0FE8 7F07C478 E4640008 */ swc1 $f4, 8($v1) -.Ljp7F07C47C: -/* 0B0FEC 7F07C47C 10620003 */ beq $v1, $v0, .Ljp7F07C48C -/* 0B0FF0 7F07C480 24010006 */ li $at, 6 -/* 0B0FF4 7F07C484 5441009C */ bnel $v0, $at, .Ljp7F07C6F8 -/* 0B0FF8 7F07C488 24010007 */ li $at, 7 -.Ljp7F07C48C: -/* 0B0FFC 7F07C48C 1462003F */ bne $v1, $v0, .Ljp7F07C58C -/* 0B1000 7F07C490 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B1004 7F07C494 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B1008 7F07C498 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B100C 7F07C49C C42883B4 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B1010 7F07C4A0 C5460000 */ lwc1 $f6, ($t2) -/* 0B1014 7F07C4A4 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B1018 7F07C4A8 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B101C 7F07C4AC 46083280 */ add.s $f10, $f6, $f8 -/* 0B1020 7F07C4B0 8D380000 */ lw $t8, ($t1) -/* 0B1024 7F07C4B4 3C014334 */ lui $at, 0x4334 -/* 0B1028 7F07C4B8 E54A0000 */ swc1 $f10, ($t2) -/* 0B102C 7F07C4BC 8F0400D4 */ lw $a0, 0xd4($t8) -/* 0B1030 7F07C4C0 50800015 */ beql $a0, $zero, .Ljp7F07C518 -/* 0B1034 7F07C4C4 C5460000 */ lwc1 $f6, ($t2) -/* 0B1038 7F07C4C8 0FC1BEEB */ jal objecthandlerGetModelField28 -/* 0B103C 7F07C4CC 00000000 */ nop -/* 0B1040 7F07C4D0 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B1044 7F07C4D4 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B1048 7F07C4D8 8D2E0000 */ lw $t6, ($t1) -/* 0B104C 7F07C4DC E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B1050 7F07C4E0 0FC1BEED */ jal sub_GAME_7F06F5C4 -/* 0B1054 7F07C4E4 8DC400D4 */ lw $a0, 0xd4($t6) -/* 0B1058 7F07C4E8 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B105C 7F07C4EC 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B1060 7F07C4F0 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B1064 7F07C4F4 4604003E */ c.le.s $f0, $f4 -/* 0B1068 7F07C4F8 240B0001 */ li $t3, 1 -/* 0B106C 7F07C4FC 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0B1070 7F07C500 45000002 */ bc1f .Ljp7F07C50C -/* 0B1074 7F07C504 00000000 */ nop -/* 0B1078 7F07C508 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07C50C: -/* 0B107C 7F07C50C 10000009 */ b .Ljp7F07C534 -/* 0B1080 7F07C510 24050002 */ li $a1, 2 -/* 0B1084 7F07C514 C5460000 */ lwc1 $f6, ($t2) -.Ljp7F07C518: -/* 0B1088 7F07C518 44814000 */ mtc1 $at, $f8 -/* 0B108C 7F07C51C 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B1090 7F07C520 4606403E */ c.le.s $f8, $f6 -/* 0B1094 7F07C524 00000000 */ nop -/* 0B1098 7F07C528 45020003 */ bc1fl .Ljp7F07C538 -/* 0B109C 7F07C52C 97AC0046 */ lhu $t4, 0x46($sp) -/* 0B10A0 7F07C530 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.Ljp7F07C534: -/* 0B10A4 7F07C534 97AC0046 */ lhu $t4, 0x46($sp) -.Ljp7F07C538: -/* 0B10A8 7F07C538 97AF0042 */ lhu $t7, 0x42($sp) -/* 0B10AC 7F07C53C 01806827 */ not $t5, $t4 -/* 0B10B0 7F07C540 01EDC824 */ and $t9, $t7, $t5 -/* 0B10B4 7F07C544 3338F000 */ andi $t8, $t9, 0xf000 -/* 0B10B8 7F07C548 13000036 */ beqz $t8, .Ljp7F07C624 -/* 0B10BC 7F07C54C 00000000 */ nop -/* 0B10C0 7F07C550 8D220000 */ lw $v0, ($t1) -/* 0B10C4 7F07C554 8C4E00D8 */ lw $t6, 0xd8($v0) -/* 0B10C8 7F07C558 11C00032 */ beqz $t6, .Ljp7F07C624 -/* 0B10CC 7F07C55C 00000000 */ nop -/* 0B10D0 7F07C560 8C4C0424 */ lw $t4, 0x424($v0) -/* 0B10D4 7F07C564 1180002F */ beqz $t4, .Ljp7F07C624 -/* 0B10D8 7F07C568 00000000 */ nop -/* 0B10DC 7F07C56C 8C4F0428 */ lw $t7, 0x428($v0) -/* 0B10E0 7F07C570 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B10E4 7F07C574 11E0002B */ beqz $t7, .Ljp7F07C624 -/* 0B10E8 7F07C578 00000000 */ nop -/* 0B10EC 7F07C57C AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B10F0 7F07C580 3C018003 */ lui $at, %hi(D_80036510) # $at, 0x8003 -/* 0B10F4 7F07C584 10000027 */ b .Ljp7F07C624 -/* 0B10F8 7F07C588 AC256550 */ sw $a1, %lo(D_80036510)($at) -.Ljp7F07C58C: -/* 0B10FC 7F07C58C 24010006 */ li $at, 6 -/* 0B1100 7F07C590 14410024 */ bne $v0, $at, .Ljp7F07C624 -/* 0B1104 7F07C594 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0B1108 7F07C598 254A64E4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x64e4 -/* 0B110C 7F07C59C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B1110 7F07C5A0 C42483B4 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B1114 7F07C5A4 C54A0000 */ lwc1 $f10, ($t2) -/* 0B1118 7F07C5A8 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B111C 7F07C5AC 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B1120 7F07C5B0 46045180 */ add.s $f6, $f10, $f4 -/* 0B1124 7F07C5B4 8D220000 */ lw $v0, ($t1) -/* 0B1128 7F07C5B8 44807000 */ mtc1 $zero, $f14 -/* 0B112C 7F07C5BC 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0B1130 7F07C5C0 E5460000 */ swc1 $f6, ($t2) -/* 0B1134 7F07C5C4 C44803E4 */ lwc1 $f8, 0x3e4($v0) -/* 0B1138 7F07C5C8 460E403C */ c.lt.s $f8, $f14 -/* 0B113C 7F07C5CC 00000000 */ nop -/* 0B1140 7F07C5D0 45020003 */ bc1fl .Ljp7F07C5E0 -/* 0B1144 7F07C5D4 97B90046 */ lhu $t9, 0x46($sp) -/* 0B1148 7F07C5D8 AC2B64D8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0B114C 7F07C5DC 97B90046 */ lhu $t9, 0x46($sp) -.Ljp7F07C5E0: -/* 0B1150 7F07C5E0 97AD0042 */ lhu $t5, 0x42($sp) -/* 0B1154 7F07C5E4 0320C027 */ not $t8, $t9 -/* 0B1158 7F07C5E8 01B87024 */ and $t6, $t5, $t8 -/* 0B115C 7F07C5EC 31CCF000 */ andi $t4, $t6, 0xf000 -/* 0B1160 7F07C5F0 1180000C */ beqz $t4, .Ljp7F07C624 -/* 0B1164 7F07C5F4 00000000 */ nop -/* 0B1168 7F07C5F8 8C4F00D8 */ lw $t7, 0xd8($v0) -/* 0B116C 7F07C5FC 11E00009 */ beqz $t7, .Ljp7F07C624 -/* 0B1170 7F07C600 00000000 */ nop -/* 0B1174 7F07C604 8C590424 */ lw $t9, 0x424($v0) -/* 0B1178 7F07C608 13200006 */ beqz $t9, .Ljp7F07C624 -/* 0B117C 7F07C60C 00000000 */ nop -/* 0B1180 7F07C610 8C4D0428 */ lw $t5, 0x428($v0) -/* 0B1184 7F07C614 3C018003 */ lui $at, %hi(D_80036510) # $at, 0x8003 -/* 0B1188 7F07C618 11A00002 */ beqz $t5, .Ljp7F07C624 -/* 0B118C 7F07C61C 00000000 */ nop -/* 0B1190 7F07C620 AC256550 */ sw $a1, %lo(D_80036510)($at) -.Ljp7F07C624: -/* 0B1194 7F07C624 3C038008 */ lui $v1, %hi(flt_CODE_bss_800799E8) # $v1, 0x8008 -/* 0B1198 7F07C628 24639A28 */ addiu $v1, %lo(flt_CODE_bss_800799E8) # addiu $v1, $v1, -0x65d8 -/* 0B119C 7F07C62C C46A0000 */ lwc1 $f10, ($v1) -/* 0B11A0 7F07C630 8FB80048 */ lw $t8, 0x48($sp) -/* 0B11A4 7F07C634 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B11A8 7F07C638 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B11AC 7F07C63C E70A0000 */ swc1 $f10, ($t8) -/* 0B11B0 7F07C640 C4640004 */ lwc1 $f4, 4($v1) -/* 0B11B4 7F07C644 3C058008 */ lui $a1, %hi(dword_CODE_bss_800799F4) # $a1, 0x8008 -/* 0B11B8 7F07C648 24A59A34 */ addiu $a1, %lo(dword_CODE_bss_800799F4) # addiu $a1, $a1, -0x65cc -/* 0B11BC 7F07C64C E7040004 */ swc1 $f4, 4($t8) -/* 0B11C0 7F07C650 C4660008 */ lwc1 $f6, 8($v1) -/* 0B11C4 7F07C654 E7060008 */ swc1 $f6, 8($t8) -/* 0B11C8 7F07C658 8D220000 */ lw $v0, ($t1) -/* 0B11CC 7F07C65C 8CA40000 */ lw $a0, ($a1) -/* 0B11D0 7F07C660 8C4E00A8 */ lw $t6, 0xa8($v0) -/* 0B11D4 7F07C664 548E000C */ bnel $a0, $t6, .Ljp7F07C698 -/* 0B11D8 7F07C668 C4860008 */ lwc1 $f6, 8($a0) -/* 0B11DC 7F07C66C C44803C4 */ lwc1 $f8, 0x3c4($v0) -/* 0B11E0 7F07C670 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B11E4 7F07C674 E5880000 */ swc1 $f8, ($t4) -/* 0B11E8 7F07C678 8D2F0000 */ lw $t7, ($t1) -/* 0B11EC 7F07C67C C5EA03C8 */ lwc1 $f10, 0x3c8($t7) -/* 0B11F0 7F07C680 E58A0004 */ swc1 $f10, 4($t4) -/* 0B11F4 7F07C684 8D390000 */ lw $t9, ($t1) -/* 0B11F8 7F07C688 C72403CC */ lwc1 $f4, 0x3cc($t9) -/* 0B11FC 7F07C68C 1000000A */ b .Ljp7F07C6B8 -/* 0B1200 7F07C690 E5840008 */ swc1 $f4, 8($t4) -/* 0B1204 7F07C694 C4860008 */ lwc1 $f6, 8($a0) -.Ljp7F07C698: -/* 0B1208 7F07C698 8FAD004C */ lw $t5, 0x4c($sp) -/* 0B120C 7F07C69C E5A60000 */ swc1 $f6, ($t5) -/* 0B1210 7F07C6A0 8CB80000 */ lw $t8, ($a1) -/* 0B1214 7F07C6A4 C708000C */ lwc1 $f8, 0xc($t8) -/* 0B1218 7F07C6A8 E5A80004 */ swc1 $f8, 4($t5) -/* 0B121C 7F07C6AC 8CAE0000 */ lw $t6, ($a1) -/* 0B1220 7F07C6B0 C5CA0010 */ lwc1 $f10, 0x10($t6) -/* 0B1224 7F07C6B4 E5AA0008 */ swc1 $f10, 8($t5) -.Ljp7F07C6B8: -/* 0B1228 7F07C6B8 8D2F0000 */ lw $t7, ($t1) -/* 0B122C 7F07C6BC 8FAC0054 */ lw $t4, 0x54($sp) -/* 0B1230 7F07C6C0 8FA30058 */ lw $v1, 0x58($sp) -/* 0B1234 7F07C6C4 8DF90488 */ lw $t9, 0x488($t7) -/* 0B1238 7F07C6C8 AD990000 */ sw $t9, ($t4) -/* 0B123C 7F07C6CC 8D380000 */ lw $t8, ($t1) -/* 0B1240 7F07C6D0 C704048C */ lwc1 $f4, 0x48c($t8) -/* 0B1244 7F07C6D4 E4640000 */ swc1 $f4, ($v1) -/* 0B1248 7F07C6D8 8D2E0000 */ lw $t6, ($t1) -/* 0B124C 7F07C6DC C5C60490 */ lwc1 $f6, 0x490($t6) -/* 0B1250 7F07C6E0 E4660004 */ swc1 $f6, 4($v1) -/* 0B1254 7F07C6E4 8D2D0000 */ lw $t5, ($t1) -/* 0B1258 7F07C6E8 C5A80494 */ lwc1 $f8, 0x494($t5) -/* 0B125C 7F07C6EC 10000119 */ b .Ljp7F07CB54 -/* 0B1260 7F07C6F0 E4680008 */ swc1 $f8, 8($v1) -/* 0B1264 7F07C6F4 24010007 */ li $at, 7 -.Ljp7F07C6F8: -/* 0B1268 7F07C6F8 14410116 */ bne $v0, $at, .Ljp7F07CB54 -/* 0B126C 7F07C6FC 3C028008 */ lui $v0, %hi(dword_CODE_bss_800799F8) # $v0, 0x8008 -/* 0B1270 7F07C700 24429A38 */ addiu $v0, %lo(dword_CODE_bss_800799F8) # addiu $v0, $v0, -0x65c8 -/* 0B1274 7F07C704 8C440000 */ lw $a0, ($v0) -/* 0B1278 7F07C708 8FAF0048 */ lw $t7, 0x48($sp) -/* 0B127C 7F07C70C 10800024 */ beqz $a0, .Ljp7F07C7A0 -/* 0B1280 7F07C710 00000000 */ nop -/* 0B1284 7F07C714 C48A0000 */ lwc1 $f10, ($a0) -/* 0B1288 7F07C718 8FA30058 */ lw $v1, 0x58($sp) -/* 0B128C 7F07C71C 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B1290 7F07C720 E5EA0000 */ swc1 $f10, ($t7) -/* 0B1294 7F07C724 8C590000 */ lw $t9, ($v0) -/* 0B1298 7F07C728 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B129C 7F07C72C C7240004 */ lwc1 $f4, 4($t9) -/* 0B12A0 7F07C730 E5E40004 */ swc1 $f4, 4($t7) -/* 0B12A4 7F07C734 8C4C0000 */ lw $t4, ($v0) -/* 0B12A8 7F07C738 C5860008 */ lwc1 $f6, 8($t4) -/* 0B12AC 7F07C73C E5E60008 */ swc1 $f6, 8($t7) -/* 0B12B0 7F07C740 8D380000 */ lw $t8, ($t1) -/* 0B12B4 7F07C744 8FAE004C */ lw $t6, 0x4c($sp) -/* 0B12B8 7F07C748 C70803C4 */ lwc1 $f8, 0x3c4($t8) -/* 0B12BC 7F07C74C E5C80000 */ swc1 $f8, ($t6) -/* 0B12C0 7F07C750 8D2D0000 */ lw $t5, ($t1) -/* 0B12C4 7F07C754 C5AA03C8 */ lwc1 $f10, 0x3c8($t5) -/* 0B12C8 7F07C758 E5CA0004 */ swc1 $f10, 4($t6) -/* 0B12CC 7F07C75C 8D390000 */ lw $t9, ($t1) -/* 0B12D0 7F07C760 C72403CC */ lwc1 $f4, 0x3cc($t9) -/* 0B12D4 7F07C764 E5C40008 */ swc1 $f4, 8($t6) -/* 0B12D8 7F07C768 8C4C0000 */ lw $t4, ($v0) -/* 0B12DC 7F07C76C 8FB80054 */ lw $t8, 0x54($sp) -/* 0B12E0 7F07C770 8D8F0028 */ lw $t7, 0x28($t4) -/* 0B12E4 7F07C774 AF0F0000 */ sw $t7, ($t8) -/* 0B12E8 7F07C778 8C4D0000 */ lw $t5, ($v0) -/* 0B12EC 7F07C77C C5A60000 */ lwc1 $f6, ($t5) -/* 0B12F0 7F07C780 E4660000 */ swc1 $f6, ($v1) -/* 0B12F4 7F07C784 8C590000 */ lw $t9, ($v0) -/* 0B12F8 7F07C788 C7280004 */ lwc1 $f8, 4($t9) -/* 0B12FC 7F07C78C E4680004 */ swc1 $f8, 4($v1) -/* 0B1300 7F07C790 8C4E0000 */ lw $t6, ($v0) -/* 0B1304 7F07C794 C5CA0008 */ lwc1 $f10, 8($t6) -/* 0B1308 7F07C798 100000EE */ b .Ljp7F07CB54 -/* 0B130C 7F07C79C E46A0008 */ swc1 $f10, 8($v1) -.Ljp7F07C7A0: -/* 0B1310 7F07C7A0 3C058008 */ lui $a1, %hi(gBondViewCutscene) # $a1, 0x8008 -/* 0B1314 7F07C7A4 24A59A3C */ addiu $a1, %lo(gBondViewCutscene) # addiu $a1, $a1, -0x65c4 -/* 0B1318 7F07C7A8 8CA40000 */ lw $a0, ($a1) -/* 0B131C 7F07C7AC 10800063 */ beqz $a0, .Ljp7F07C93C -/* 0B1320 7F07C7B0 00000000 */ nop -/* 0B1324 7F07C7B4 8C830018 */ lw $v1, 0x18($a0) -/* 0B1328 7F07C7B8 3C0D8007 */ lui $t5, %hi(g_CurrentSetup+0x1C) # $t5, 0x8007 -/* 0B132C 7F07C7BC 8FB90048 */ lw $t9, 0x48($sp) -/* 0B1330 7F07C7C0 28612710 */ slti $at, $v1, 0x2710 -/* 0B1334 7F07C7C4 1020000A */ beqz $at, .Ljp7F07C7F0 -/* 0B1338 7F07C7C8 0003C100 */ sll $t8, $v1, 4 -/* 0B133C 7F07C7CC 00036080 */ sll $t4, $v1, 2 -/* 0B1340 7F07C7D0 01836023 */ subu $t4, $t4, $v1 -/* 0B1344 7F07C7D4 000C6080 */ sll $t4, $t4, 2 -/* 0B1348 7F07C7D8 3C0F8007 */ lui $t7, %hi(g_CurrentSetup+0x18) # $t7, 0x8007 -/* 0B134C 7F07C7DC 8DEF5D58 */ lw $t7, %lo(g_CurrentSetup+0x18)($t7) -/* 0B1350 7F07C7E0 01836023 */ subu $t4, $t4, $v1 -/* 0B1354 7F07C7E4 000C6080 */ sll $t4, $t4, 2 -/* 0B1358 7F07C7E8 10000008 */ b .Ljp7F07C80C -/* 0B135C 7F07C7EC 018F1021 */ addu $v0, $t4, $t7 -.Ljp7F07C7F0: -/* 0B1360 7F07C7F0 8DAD5D5C */ lw $t5, %lo(g_CurrentSetup+0x1C)($t5) -/* 0B1364 7F07C7F4 0303C021 */ addu $t8, $t8, $v1 -/* 0B1368 7F07C7F8 0018C080 */ sll $t8, $t8, 2 -/* 0B136C 7F07C7FC 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0B1370 7F07C800 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0B1374 7F07C804 030D1021 */ addu $v0, $t8, $t5 -/* 0B1378 7F07C808 00411021 */ addu $v0, $v0, $at -.Ljp7F07C80C: -/* 0B137C 7F07C80C C4840004 */ lwc1 $f4, 4($a0) -/* 0B1380 7F07C810 8FA30058 */ lw $v1, 0x58($sp) -/* 0B1384 7F07C814 3C0D8008 */ lui $t5, %hi(dword_CODE_bss_80079A18) # $t5, 0x8008 -/* 0B1388 7F07C818 E7240000 */ swc1 $f4, ($t9) -/* 0B138C 7F07C81C 8CAE0000 */ lw $t6, ($a1) -/* 0B1390 7F07C820 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B1394 7F07C824 2529A120 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x5ee0 -/* 0B1398 7F07C828 C5C60008 */ lwc1 $f6, 8($t6) -/* 0B139C 7F07C82C E7260004 */ swc1 $f6, 4($t9) -/* 0B13A0 7F07C830 8CAC0000 */ lw $t4, ($a1) -/* 0B13A4 7F07C834 C588000C */ lwc1 $f8, 0xc($t4) -/* 0B13A8 7F07C838 E7280008 */ swc1 $f8, 8($t9) -/* 0B13AC 7F07C83C 8FB80054 */ lw $t8, 0x54($sp) -/* 0B13B0 7F07C840 8C4F0028 */ lw $t7, 0x28($v0) -/* 0B13B4 7F07C844 AF0F0000 */ sw $t7, ($t8) -/* 0B13B8 7F07C848 C44A0000 */ lwc1 $f10, ($v0) -/* 0B13BC 7F07C84C E46A0000 */ swc1 $f10, ($v1) -/* 0B13C0 7F07C850 C4440004 */ lwc1 $f4, 4($v0) -/* 0B13C4 7F07C854 E4640004 */ swc1 $f4, 4($v1) -/* 0B13C8 7F07C858 C4460008 */ lwc1 $f6, 8($v0) -/* 0B13CC 7F07C85C E4660008 */ swc1 $f6, 8($v1) -/* 0B13D0 7F07C860 8DAD9A58 */ lw $t5, %lo(dword_CODE_bss_80079A18)($t5) -/* 0B13D4 7F07C864 556D000D */ bnel $t3, $t5, .Ljp7F07C89C -/* 0B13D8 7F07C868 8CB80000 */ lw $t8, ($a1) -/* 0B13DC 7F07C86C 8D2E0000 */ lw $t6, ($t1) -/* 0B13E0 7F07C870 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B13E4 7F07C874 C5C803C4 */ lwc1 $f8, 0x3c4($t6) -/* 0B13E8 7F07C878 E5880000 */ swc1 $f8, ($t4) -/* 0B13EC 7F07C87C 8D390000 */ lw $t9, ($t1) -/* 0B13F0 7F07C880 C72A03C8 */ lwc1 $f10, 0x3c8($t9) -/* 0B13F4 7F07C884 E58A0004 */ swc1 $f10, 4($t4) -/* 0B13F8 7F07C888 8D2F0000 */ lw $t7, ($t1) -/* 0B13FC 7F07C88C C5E403CC */ lwc1 $f4, 0x3cc($t7) -/* 0B1400 7F07C890 100000B0 */ b .Ljp7F07CB54 -/* 0B1404 7F07C894 E5840008 */ swc1 $f4, 8($t4) -/* 0B1408 7F07C898 8CB80000 */ lw $t8, ($a1) -.Ljp7F07C89C: -/* 0B140C 7F07C89C 0FC160F0 */ jal cosf -/* 0B1410 7F07C8A0 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0B1414 7F07C8A4 3C0D8008 */ lui $t5, %hi(gBondViewCutscene) # $t5, 0x8008 -/* 0B1418 7F07C8A8 8DAD9A3C */ lw $t5, %lo(gBondViewCutscene)($t5) -/* 0B141C 7F07C8AC E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B1420 7F07C8B0 0FC160F3 */ jal sinf -/* 0B1424 7F07C8B4 C5AC0010 */ lwc1 $f12, 0x10($t5) -/* 0B1428 7F07C8B8 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0B142C 7F07C8BC 8FAE0048 */ lw $t6, 0x48($sp) -/* 0B1430 7F07C8C0 8FB9004C */ lw $t9, 0x4c($sp) -/* 0B1434 7F07C8C4 46060202 */ mul.s $f8, $f0, $f6 -/* 0B1438 7F07C8C8 C5CA0000 */ lwc1 $f10, ($t6) -/* 0B143C 7F07C8CC 3C0F8008 */ lui $t7, %hi(gBondViewCutscene) # $t7, 0x8008 -/* 0B1440 7F07C8D0 460A4100 */ add.s $f4, $f8, $f10 -/* 0B1444 7F07C8D4 E7240000 */ swc1 $f4, ($t9) -/* 0B1448 7F07C8D8 8DEF9A3C */ lw $t7, %lo(gBondViewCutscene)($t7) -/* 0B144C 7F07C8DC 0FC160F3 */ jal sinf -/* 0B1450 7F07C8E0 C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0B1454 7F07C8E4 8FAC0048 */ lw $t4, 0x48($sp) -/* 0B1458 7F07C8E8 8FB8004C */ lw $t8, 0x4c($sp) -/* 0B145C 7F07C8EC 3C0D8008 */ lui $t5, %hi(gBondViewCutscene) # $t5, 0x8008 -/* 0B1460 7F07C8F0 C5860004 */ lwc1 $f6, 4($t4) -/* 0B1464 7F07C8F4 46060200 */ add.s $f8, $f0, $f6 -/* 0B1468 7F07C8F8 E7080004 */ swc1 $f8, 4($t8) -/* 0B146C 7F07C8FC 8DAD9A3C */ lw $t5, %lo(gBondViewCutscene)($t5) -/* 0B1470 7F07C900 0FC160F0 */ jal cosf -/* 0B1474 7F07C904 C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B1478 7F07C908 3C0E8008 */ lui $t6, %hi(gBondViewCutscene) # $t6, 0x8008 -/* 0B147C 7F07C90C 8DCE9A3C */ lw $t6, %lo(gBondViewCutscene)($t6) -/* 0B1480 7F07C910 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B1484 7F07C914 0FC160F0 */ jal cosf -/* 0B1488 7F07C918 C5CC0010 */ lwc1 $f12, 0x10($t6) -/* 0B148C 7F07C91C C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B1490 7F07C920 8FB90048 */ lw $t9, 0x48($sp) -/* 0B1494 7F07C924 8FAF004C */ lw $t7, 0x4c($sp) -/* 0B1498 7F07C928 46040182 */ mul.s $f6, $f0, $f4 -/* 0B149C 7F07C92C C72A0008 */ lwc1 $f10, 8($t9) -/* 0B14A0 7F07C930 46065201 */ sub.s $f8, $f10, $f6 -/* 0B14A4 7F07C934 10000087 */ b .Ljp7F07CB54 -/* 0B14A8 7F07C938 E5E80008 */ swc1 $f8, 8($t7) -.Ljp7F07C93C: -/* 0B14AC 7F07C93C 3C028008 */ lui $v0, %hi(dword_CODE_bss_80079A14) # $v0, 0x8008 -/* 0B14B0 7F07C940 8C429A54 */ lw $v0, %lo(dword_CODE_bss_80079A14)($v0) -/* 0B14B4 7F07C944 3C0E8007 */ lui $t6, %hi(g_CurrentSetup+0x1C) # $t6, 0x8007 -/* 0B14B8 7F07C948 8FAF0054 */ lw $t7, 0x54($sp) -/* 0B14BC 7F07C94C 28412710 */ slti $at, $v0, 0x2710 -/* 0B14C0 7F07C950 1020000A */ beqz $at, .Ljp7F07C97C -/* 0B14C4 7F07C954 00026900 */ sll $t5, $v0, 4 -/* 0B14C8 7F07C958 00026080 */ sll $t4, $v0, 2 -/* 0B14CC 7F07C95C 01826023 */ subu $t4, $t4, $v0 -/* 0B14D0 7F07C960 000C6080 */ sll $t4, $t4, 2 -/* 0B14D4 7F07C964 3C188007 */ lui $t8, %hi(g_CurrentSetup+0x18) # $t8, 0x8007 -/* 0B14D8 7F07C968 8F185D58 */ lw $t8, %lo(g_CurrentSetup+0x18)($t8) -/* 0B14DC 7F07C96C 01826023 */ subu $t4, $t4, $v0 -/* 0B14E0 7F07C970 000C6080 */ sll $t4, $t4, 2 -/* 0B14E4 7F07C974 10000008 */ b .Ljp7F07C998 -/* 0B14E8 7F07C978 01982021 */ addu $a0, $t4, $t8 -.Ljp7F07C97C: -/* 0B14EC 7F07C97C 8DCE5D5C */ lw $t6, %lo(g_CurrentSetup+0x1C)($t6) -/* 0B14F0 7F07C980 01A26821 */ addu $t5, $t5, $v0 -/* 0B14F4 7F07C984 000D6880 */ sll $t5, $t5, 2 -/* 0B14F8 7F07C988 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0B14FC 7F07C98C 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0B1500 7F07C990 01AE2021 */ addu $a0, $t5, $t6 -/* 0B1504 7F07C994 00812021 */ addu $a0, $a0, $at -.Ljp7F07C998: -/* 0B1508 7F07C998 8C990028 */ lw $t9, 0x28($a0) -/* 0B150C 7F07C99C 8FA30058 */ lw $v1, 0x58($sp) -/* 0B1510 7F07C9A0 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B1514 7F07C9A4 ADF90000 */ sw $t9, ($t7) -/* 0B1518 7F07C9A8 C4840000 */ lwc1 $f4, ($a0) -/* 0B151C 7F07C9AC 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B1520 7F07C9B0 E4640000 */ swc1 $f4, ($v1) -/* 0B1524 7F07C9B4 C48A0004 */ lwc1 $f10, 4($a0) -/* 0B1528 7F07C9B8 E46A0004 */ swc1 $f10, 4($v1) -/* 0B152C 7F07C9BC C4860008 */ lwc1 $f6, 8($a0) -/* 0B1530 7F07C9C0 E4660008 */ swc1 $f6, 8($v1) -/* 0B1534 7F07C9C4 AFA40020 */ sw $a0, 0x20($sp) -/* 0B1538 7F07C9C8 0FC160F0 */ jal cosf -/* 0B153C 7F07C9CC C44C0000 */ lwc1 $f12, ($v0) -/* 0B1540 7F07C9D0 8FA40020 */ lw $a0, 0x20($sp) -/* 0B1544 7F07C9D4 8FAC004C */ lw $t4, 0x4c($sp) -/* 0B1548 7F07C9D8 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A10) # $at, 0x8008 -/* 0B154C 7F07C9DC C4880000 */ lwc1 $f8, ($a0) -/* 0B1550 7F07C9E0 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B1554 7F07C9E4 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B1558 7F07C9E8 E5880000 */ swc1 $f8, ($t4) -/* 0B155C 7F07C9EC C42A9A50 */ lwc1 $f10, %lo(flt_CODE_bss_80079A10)($at) -/* 0B1560 7F07C9F0 C4840004 */ lwc1 $f4, 4($a0) -/* 0B1564 7F07C9F4 460A2180 */ add.s $f6, $f4, $f10 -/* 0B1568 7F07C9F8 E5860004 */ swc1 $f6, 4($t4) -/* 0B156C 7F07C9FC 0FC160F3 */ jal sinf -/* 0B1570 7F07CA00 C44C0000 */ lwc1 $f12, ($v0) -/* 0B1574 7F07CA04 8FA40020 */ lw $a0, 0x20($sp) -/* 0B1578 7F07CA08 8FB8004C */ lw $t8, 0x4c($sp) -/* 0B157C 7F07CA0C 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B1580 7F07CA10 C4880008 */ lwc1 $f8, 8($a0) -/* 0B1584 7F07CA14 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B1588 7F07CA18 E7080008 */ swc1 $f8, 8($t8) -/* 0B158C 7F07CA1C 0FC160F3 */ jal sinf -/* 0B1590 7F07CA20 C44C0000 */ lwc1 $f12, ($v0) -/* 0B1594 7F07CA24 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B1598 7F07CA28 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B159C 7F07CA2C C44C0000 */ lwc1 $f12, ($v0) -/* 0B15A0 7F07CA30 0FC160F0 */ jal cosf -/* 0B15A4 7F07CA34 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B15A8 7F07CA38 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A08) # $at, 0x8008 -/* 0B15AC 7F07CA3C C42A9A48 */ lwc1 $f10, %lo(flt_CODE_bss_80079A08)($at) -/* 0B15B0 7F07CA40 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0B15B4 7F07CA44 8FA40020 */ lw $a0, 0x20($sp) -/* 0B15B8 7F07CA48 8FAD0048 */ lw $t5, 0x48($sp) -/* 0B15BC 7F07CA4C 460A2182 */ mul.s $f6, $f4, $f10 -/* 0B15C0 7F07CA50 C4880000 */ lwc1 $f8, ($a0) -/* 0B15C4 7F07CA54 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A10) # $at, 0x8008 -/* 0B15C8 7F07CA58 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B15CC 7F07CA5C 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B15D0 7F07CA60 46064100 */ add.s $f4, $f8, $f6 -/* 0B15D4 7F07CA64 E5A40000 */ swc1 $f4, ($t5) -/* 0B15D8 7F07CA68 C4289A50 */ lwc1 $f8, %lo(flt_CODE_bss_80079A10)($at) -/* 0B15DC 7F07CA6C C48A0004 */ lwc1 $f10, 4($a0) -/* 0B15E0 7F07CA70 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A0C) # $at, 0x8008 -/* 0B15E4 7F07CA74 C4249A4C */ lwc1 $f4, %lo(flt_CODE_bss_80079A0C)($at) -/* 0B15E8 7F07CA78 46085180 */ add.s $f6, $f10, $f8 -/* 0B15EC 7F07CA7C 46043280 */ add.s $f10, $f6, $f4 -/* 0B15F0 7F07CA80 E5AA0004 */ swc1 $f10, 4($t5) -/* 0B15F4 7F07CA84 0FC160F0 */ jal cosf -/* 0B15F8 7F07CA88 C44C0000 */ lwc1 $f12, ($v0) -/* 0B15FC 7F07CA8C 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B1600 7F07CA90 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B1604 7F07CA94 C44C0000 */ lwc1 $f12, ($v0) -/* 0B1608 7F07CA98 0FC160F3 */ jal sinf -/* 0B160C 7F07CA9C E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0B1610 7F07CAA0 3C018005 */ lui $at, %hi(D_8005505C) # $at, 0x8005 -/* 0B1614 7F07CAA4 C42C508C */ lwc1 $f12, %lo(D_8005505C)($at) -/* 0B1618 7F07CAA8 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A08) # $at, 0x8008 -/* 0B161C 7F07CAAC C4269A48 */ lwc1 $f6, %lo(flt_CODE_bss_80079A08)($at) -/* 0B1620 7F07CAB0 C7A8001C */ lwc1 $f8, 0x1c($sp) -/* 0B1624 7F07CAB4 8FA40020 */ lw $a0, 0x20($sp) -/* 0B1628 7F07CAB8 8FAE0048 */ lw $t6, 0x48($sp) -/* 0B162C 7F07CABC 46064102 */ mul.s $f4, $f8, $f6 -/* 0B1630 7F07CAC0 C48A0008 */ lwc1 $f10, 8($a0) -/* 0B1634 7F07CAC4 3C018008 */ lui $at, %hi(flt_CODE_bss_80079A04) # $at, 0x8008 -/* 0B1638 7F07CAC8 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8008 -/* 0B163C 7F07CACC 24429A40 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x65c0 -/* 0B1640 7F07CAD0 44807000 */ mtc1 $zero, $f14 -/* 0B1644 7F07CAD4 46045200 */ add.s $f8, $f10, $f4 -/* 0B1648 7F07CAD8 E5C80008 */ swc1 $f8, 8($t6) -/* 0B164C 7F07CADC C4269A44 */ lwc1 $f6, %lo(flt_CODE_bss_80079A04)($at) -/* 0B1650 7F07CAE0 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0B1654 7F07CAE4 C42A83B4 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0B1658 7F07CAE8 C4480000 */ lwc1 $f8, ($v0) -/* 0B165C 7F07CAEC 460A3102 */ mul.s $f4, $f6, $f10 -/* 0B1660 7F07CAF0 46044180 */ add.s $f6, $f8, $f4 -/* 0B1664 7F07CAF4 E4460000 */ swc1 $f6, ($v0) -/* 0B1668 7F07CAF8 C4420000 */ lwc1 $f2, ($v0) -/* 0B166C 7F07CAFC 4602603E */ c.le.s $f12, $f2 -/* 0B1670 7F07CB00 00000000 */ nop -/* 0B1674 7F07CB04 45020009 */ bc1fl .Ljp7F07CB2C -/* 0B1678 7F07CB08 460E103C */ c.lt.s $f2, $f14 -/* 0B167C 7F07CB0C 460C1281 */ sub.s $f10, $f2, $f12 -.Ljp7F07CB10: -/* 0B1680 7F07CB10 E44A0000 */ swc1 $f10, ($v0) -/* 0B1684 7F07CB14 C4420000 */ lwc1 $f2, ($v0) -/* 0B1688 7F07CB18 4602603E */ c.le.s $f12, $f2 -/* 0B168C 7F07CB1C 00000000 */ nop -/* 0B1690 7F07CB20 4503FFFB */ bc1tl .Ljp7F07CB10 -/* 0B1694 7F07CB24 460C1281 */ sub.s $f10, $f2, $f12 -/* 0B1698 7F07CB28 460E103C */ c.lt.s $f2, $f14 -.Ljp7F07CB2C: -/* 0B169C 7F07CB2C 00000000 */ nop -/* 0B16A0 7F07CB30 45020009 */ bc1fl .Ljp7F07CB58 -/* 0B16A4 7F07CB34 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B16A8 7F07CB38 460C1200 */ add.s $f8, $f2, $f12 -.Ljp7F07CB3C: -/* 0B16AC 7F07CB3C E4480000 */ swc1 $f8, ($v0) -/* 0B16B0 7F07CB40 C4420000 */ lwc1 $f2, ($v0) -/* 0B16B4 7F07CB44 460E103C */ c.lt.s $f2, $f14 -/* 0B16B8 7F07CB48 00000000 */ nop -/* 0B16BC 7F07CB4C 4503FFFB */ bc1tl .Ljp7F07CB3C -/* 0B16C0 7F07CB50 460C1200 */ add.s $f8, $f2, $f12 -.Ljp7F07CB54: -/* 0B16C4 7F07CB54 8FBF0014 */ lw $ra, 0x14($sp) -.Ljp7F07CB58: -/* 0B16C8 7F07CB58 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B16CC 7F07CB5C 03E00008 */ jr $ra -/* 0B16D0 7F07CB60 00000000 */ nop -) + hudmsgBottomShow(ptr_random06cam_entry->lang1c.lang_ptr, ptrFontZurichBoldChars, ptrFontZurichBold); #endif + } -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_80055044 -.word 0x43338000 /*179.5*/ -glabel D_80055048 -.word 0x3dcccccd /*0.1*/ -glabel D_8005504C -.word 0x3c75c28f /*0.015*/ -glabel D_80055050 -.word 0x40490fdb /*3.1415927*/ -glabel D_80055054 -.word 0x3da3d70a /*0.079999998*/ -glabel D_80055058 -.word 0x3da3d70a /*0.079999998*/ -glabel D_8005505C -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F07B56C -/* 0ADFF4 7F07B604 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0ADFF8 7F07B608 3C028003 */ lui $v0, %hi(g_CameraMode) # $v0, 0x8003 -/* 0ADFFC 7F07B60C 8C4219E4 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0AE000 7F07B610 240B0001 */ li $t3, 1 -/* 0AE004 7F07B614 AFBF0014 */ sw $ra, 0x14($sp) -/* 0AE008 7F07B618 AFA40040 */ sw $a0, 0x40($sp) -/* 0AE00C 7F07B61C AFA50044 */ sw $a1, 0x44($sp) -/* 0AE010 7F07B620 AFA60048 */ sw $a2, 0x48($sp) -/* 0AE014 7F07B624 11620004 */ beq $t3, $v0, .L7F07B638 -/* 0AE018 7F07B628 AFA7004C */ sw $a3, 0x4c($sp) -/* 0AE01C 7F07B62C 24050002 */ li $a1, 2 -/* 0AE020 7F07B630 14A200AF */ bne $a1, $v0, .L7F07B8F0 -/* 0AE024 7F07B634 24010009 */ li $at, 9 -.L7F07B638: -/* 0AE028 7F07B638 15620059 */ bne $t3, $v0, .L7F07B7A0 -/* 0AE02C 7F07B63C 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE030 7F07B640 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE034 7F07B644 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE038 7F07B648 3C0142F0 */ li $at, 0x42F00000 # 120.000000 -/* 0AE03C 7F07B64C 44810000 */ mtc1 $at, $f0 -/* 0AE040 7F07B650 C5420000 */ lwc1 $f2, ($t2) -/* 0AE044 7F07B654 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AE048 7F07B658 4600103C */ c.lt.s $f2, $f0 -/* 0AE04C 7F07B65C 00000000 */ nop -/* 0AE050 7F07B660 45000013 */ bc1f .L7F07B6B0 -/* 0AE054 7F07B664 00000000 */ nop -/* 0AE058 7F07B668 C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0AE05C 7F07B66C 3C0E8003 */ lui $t6, %hi(ptr_random06cam_entry) # $t6, 0x8003 -/* 0AE060 7F07B670 3C058004 */ lui $a1, %hi(ptrSecondFontTableLarge) # $a1, 0x8004 -/* 0AE064 7F07B674 46041180 */ add.s $f6, $f2, $f4 -/* 0AE068 7F07B678 3C068004 */ lui $a2, %hi(ptrFirstFontTableLarge) # $a2, 0x8004 -/* 0AE06C 7F07B67C 4606003E */ c.le.s $f0, $f6 -/* 0AE070 7F07B680 00000000 */ nop -/* 0AE074 7F07B684 4500000A */ bc1f .L7F07B6B0 -/* 0AE078 7F07B688 00000000 */ nop -/* 0AE07C 7F07B68C 8DCE1A10 */ lw $t6, %lo(ptr_random06cam_entry)($t6) -/* 0AE080 7F07B690 8CA5AB08 */ lw $a1, %lo(ptrSecondFontTableLarge)($a1) -/* 0AE084 7F07B694 8CC6AB04 */ lw $a2, %lo(ptrFirstFontTableLarge)($a2) -/* 0AE088 7F07B698 0FC22958 */ jal hudmsgBottomShow -/* 0AE08C 7F07B69C 8DC4001C */ lw $a0, 0x1c($t6) -/* 0AE090 7F07B6A0 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE094 7F07B6A4 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE098 7F07B6A8 C5420000 */ lwc1 $f2, ($t2) -/* 0AE09C 7F07B6AC 240B0001 */ li $t3, 1 -.L7F07B6B0: -/* 0AE0A0 7F07B6B0 3C0F8003 */ lui $t7, %hi(ptr_random06cam_entry) # $t7, 0x8003 -/* 0AE0A4 7F07B6B4 8DEF1A10 */ lw $t7, %lo(ptr_random06cam_entry)($t7) -/* 0AE0A8 7F07B6B8 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AE0AC 7F07B6BC C4281004 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0AE0B0 7F07B6C0 8DE40020 */ lw $a0, 0x20($t7) -/* 0AE0B4 7F07B6C4 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0AE0B8 7F07B6C8 46081000 */ add.s $f0, $f2, $f8 -/* 0AE0BC 7F07B6CC 50800021 */ beql $a0, $zero, .L7F07B754 -/* 0AE0C0 7F07B6D0 44816000 */ mtc1 $at, $f12 -/* 0AE0C4 7F07B6D4 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0AE0C8 7F07B6D8 44816000 */ mtc1 $at, $f12 -/* 0AE0CC 7F07B6DC 00000000 */ nop -/* 0AE0D0 7F07B6E0 460C103C */ c.lt.s $f2, $f12 -/* 0AE0D4 7F07B6E4 00000000 */ nop -/* 0AE0D8 7F07B6E8 45020011 */ bc1fl .L7F07B730 -/* 0AE0DC 7F07B6EC 3C0143F0 */ lui $at, 0x43f0 -/* 0AE0E0 7F07B6F0 4600603E */ c.le.s $f12, $f0 -/* 0AE0E4 7F07B6F4 3C058004 */ lui $a1, %hi(ptrSecondFontTableLarge) # $a1, 0x8004 -/* 0AE0E8 7F07B6F8 3C068004 */ lui $a2, %hi(ptrFirstFontTableLarge) # $a2, 0x8004 -/* 0AE0EC 7F07B6FC 4502000C */ bc1fl .L7F07B730 -/* 0AE0F0 7F07B700 3C0143F0 */ lui $at, 0x43f0 -/* 0AE0F4 7F07B704 8CA5AB08 */ lw $a1, %lo(ptrSecondFontTableLarge)($a1) -/* 0AE0F8 7F07B708 0FC22958 */ jal hudmsgBottomShow -/* 0AE0FC 7F07B70C 8CC6AB04 */ lw $a2, %lo(ptrFirstFontTableLarge)($a2) -/* 0AE100 7F07B710 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE104 7F07B714 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE108 7F07B718 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AE10C 7F07B71C C42A1004 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0AE110 7F07B720 C5420000 */ lwc1 $f2, ($t2) -/* 0AE114 7F07B724 240B0001 */ li $t3, 1 -/* 0AE118 7F07B728 460A1000 */ add.s $f0, $f2, $f10 -/* 0AE11C 7F07B72C 3C0143F0 */ li $at, 0x43F00000 # 480.000000 -.L7F07B730: -/* 0AE120 7F07B730 44812000 */ mtc1 $at, $f4 -/* 0AE124 7F07B734 3C018003 */ lui $at, %hi(enable_move_after_cinema) -/* 0AE128 7F07B738 4602203C */ c.lt.s $f4, $f2 -/* 0AE12C 7F07B73C 00000000 */ nop -/* 0AE130 7F07B740 4500000A */ bc1f .L7F07B76C -/* 0AE134 7F07B744 00000000 */ nop -/* 0AE138 7F07B748 10000008 */ b .L7F07B76C -/* 0AE13C 7F07B74C AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0AE140 7F07B750 44816000 */ mtc1 $at, $f12 -.L7F07B754: -/* 0AE144 7F07B754 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE148 7F07B758 4602603C */ c.lt.s $f12, $f2 -/* 0AE14C 7F07B75C 00000000 */ nop -/* 0AE150 7F07B760 45000002 */ bc1f .L7F07B76C -/* 0AE154 7F07B764 00000000 */ nop -/* 0AE158 7F07B768 AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07B76C: -/* 0AE15C 7F07B76C 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0AE160 7F07B770 E5400000 */ swc1 $f0, ($t2) -/* 0AE164 7F07B774 14400014 */ bnez $v0, .L7F07B7C8 -/* 0AE168 7F07B778 97B90046 */ lhu $t9, 0x46($sp) -/* 0AE16C 7F07B77C 97B80042 */ lhu $t8, 0x42($sp) -/* 0AE170 7F07B780 03206027 */ not $t4, $t9 -/* 0AE174 7F07B784 240F0001 */ li $t7, 1 -/* 0AE178 7F07B788 030C6824 */ and $t5, $t8, $t4 -/* 0AE17C 7F07B78C 31AEF030 */ andi $t6, $t5, 0xf030 -/* 0AE180 7F07B790 11C0000D */ beqz $t6, .L7F07B7C8 -/* 0AE184 7F07B794 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE188 7F07B798 1000000B */ b .L7F07B7C8 -/* 0AE18C 7F07B79C AC2F19E8 */ sw $t7, %lo(enable_move_after_cinema)($at) -.L7F07B7A0: -/* 0AE190 7F07B7A0 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE194 7F07B7A4 8D390000 */ lw $t9, ($t1) -/* 0AE198 7F07B7A8 44807000 */ mtc1 $zero, $f14 -/* 0AE19C 7F07B7AC 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE1A0 7F07B7B0 C72603E4 */ lwc1 $f6, 0x3e4($t9) -/* 0AE1A4 7F07B7B4 460E303C */ c.lt.s $f6, $f14 -/* 0AE1A8 7F07B7B8 00000000 */ nop -/* 0AE1AC 7F07B7BC 45000002 */ bc1f .L7F07B7C8 -/* 0AE1B0 7F07B7C0 00000000 */ nop -/* 0AE1B4 7F07B7C4 AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07B7C8: -/* 0AE1B8 7F07B7C8 3C028003 */ lui $v0, %hi(ptr_random06cam_entry) # $v0, 0x8003 -/* 0AE1BC 7F07B7CC 24421A10 */ addiu $v0, %lo(ptr_random06cam_entry) # addiu $v0, $v0, 0x1a10 -/* 0AE1C0 7F07B7D0 8C580000 */ lw $t8, ($v0) -/* 0AE1C4 7F07B7D4 8FAC0048 */ lw $t4, 0x48($sp) -/* 0AE1C8 7F07B7D8 C7080004 */ lwc1 $f8, 4($t8) -/* 0AE1CC 7F07B7DC E5880000 */ swc1 $f8, ($t4) -/* 0AE1D0 7F07B7E0 8C4D0000 */ lw $t5, ($v0) -/* 0AE1D4 7F07B7E4 C5AA0008 */ lwc1 $f10, 8($t5) -/* 0AE1D8 7F07B7E8 E58A0004 */ swc1 $f10, 4($t4) -/* 0AE1DC 7F07B7EC 8C4E0000 */ lw $t6, ($v0) -/* 0AE1E0 7F07B7F0 C5C4000C */ lwc1 $f4, 0xc($t6) -/* 0AE1E4 7F07B7F4 E5840008 */ swc1 $f4, 8($t4) -/* 0AE1E8 7F07B7F8 8C4F0000 */ lw $t7, ($v0) -/* 0AE1EC 7F07B7FC 0FC16068 */ jal cosf -/* 0AE1F0 7F07B800 C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0AE1F4 7F07B804 3C198003 */ lui $t9, %hi(ptr_random06cam_entry) # $t9, 0x8003 -/* 0AE1F8 7F07B808 8F391A10 */ lw $t9, %lo(ptr_random06cam_entry)($t9) -/* 0AE1FC 7F07B80C E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AE200 7F07B810 0FC1606B */ jal sinf -/* 0AE204 7F07B814 C72C0010 */ lwc1 $f12, 0x10($t9) -/* 0AE208 7F07B818 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0AE20C 7F07B81C 8FB80048 */ lw $t8, 0x48($sp) -/* 0AE210 7F07B820 8FAD004C */ lw $t5, 0x4c($sp) -/* 0AE214 7F07B824 46060202 */ mul.s $f8, $f0, $f6 -/* 0AE218 7F07B828 C70A0000 */ lwc1 $f10, ($t8) -/* 0AE21C 7F07B82C 3C0E8003 */ lui $t6, %hi(ptr_random06cam_entry) # $t6, 0x8003 -/* 0AE220 7F07B830 460A4100 */ add.s $f4, $f8, $f10 -/* 0AE224 7F07B834 E5A40000 */ swc1 $f4, ($t5) -/* 0AE228 7F07B838 8DCE1A10 */ lw $t6, %lo(ptr_random06cam_entry)($t6) -/* 0AE22C 7F07B83C 0FC1606B */ jal sinf -/* 0AE230 7F07B840 C5CC0014 */ lwc1 $f12, 0x14($t6) -/* 0AE234 7F07B844 8FAC0048 */ lw $t4, 0x48($sp) -/* 0AE238 7F07B848 8FAF004C */ lw $t7, 0x4c($sp) -/* 0AE23C 7F07B84C 3C198003 */ lui $t9, %hi(ptr_random06cam_entry) # $t9, 0x8003 -/* 0AE240 7F07B850 C5860004 */ lwc1 $f6, 4($t4) -/* 0AE244 7F07B854 46060200 */ add.s $f8, $f0, $f6 -/* 0AE248 7F07B858 E5E80004 */ swc1 $f8, 4($t7) -/* 0AE24C 7F07B85C 8F391A10 */ lw $t9, %lo(ptr_random06cam_entry)($t9) -/* 0AE250 7F07B860 0FC16068 */ jal cosf -/* 0AE254 7F07B864 C72C0014 */ lwc1 $f12, 0x14($t9) -/* 0AE258 7F07B868 3C188003 */ lui $t8, %hi(ptr_random06cam_entry) # $t8, 0x8003 -/* 0AE25C 7F07B86C 8F181A10 */ lw $t8, %lo(ptr_random06cam_entry)($t8) -/* 0AE260 7F07B870 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AE264 7F07B874 0FC16068 */ jal cosf -/* 0AE268 7F07B878 C70C0010 */ lwc1 $f12, 0x10($t8) -/* 0AE26C 7F07B87C C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0AE270 7F07B880 8FAD0048 */ lw $t5, 0x48($sp) -/* 0AE274 7F07B884 8FAE004C */ lw $t6, 0x4c($sp) -/* 0AE278 7F07B888 46040182 */ mul.s $f6, $f0, $f4 -/* 0AE27C 7F07B88C C5AA0008 */ lwc1 $f10, 8($t5) -/* 0AE280 7F07B890 8FA40058 */ lw $a0, 0x58($sp) -/* 0AE284 7F07B894 3C0C8003 */ lui $t4, %hi(ptr_random06cam_entry) # $t4, 0x8003 -/* 0AE288 7F07B898 3C188006 */ lui $t8, %hi(g_CurrentSetup+0x18) # $t8, 0x8006 -/* 0AE28C 7F07B89C 46065201 */ sub.s $f8, $f10, $f6 -/* 0AE290 7F07B8A0 E5C80008 */ swc1 $f8, 8($t6) -/* 0AE294 7F07B8A4 8D8C1A10 */ lw $t4, %lo(ptr_random06cam_entry)($t4) -/* 0AE298 7F07B8A8 8F184C58 */ lw $t8, %lo(g_CurrentSetup+0x18)($t8) -/* 0AE29C 7F07B8AC 8FAE0054 */ lw $t6, 0x54($sp) -/* 0AE2A0 7F07B8B0 8D8F0018 */ lw $t7, 0x18($t4) -/* 0AE2A4 7F07B8B4 000FC880 */ sll $t9, $t7, 2 -/* 0AE2A8 7F07B8B8 032FC823 */ subu $t9, $t9, $t7 -/* 0AE2AC 7F07B8BC 0019C880 */ sll $t9, $t9, 2 -/* 0AE2B0 7F07B8C0 032FC823 */ subu $t9, $t9, $t7 -/* 0AE2B4 7F07B8C4 0019C880 */ sll $t9, $t9, 2 -/* 0AE2B8 7F07B8C8 03381021 */ addu $v0, $t9, $t8 -/* 0AE2BC 7F07B8CC 8C4D0028 */ lw $t5, 0x28($v0) -/* 0AE2C0 7F07B8D0 ADCD0000 */ sw $t5, ($t6) -/* 0AE2C4 7F07B8D4 C4440000 */ lwc1 $f4, ($v0) -/* 0AE2C8 7F07B8D8 E4840000 */ swc1 $f4, ($a0) -/* 0AE2CC 7F07B8DC C44A0004 */ lwc1 $f10, 4($v0) -/* 0AE2D0 7F07B8E0 E48A0004 */ swc1 $f10, 4($a0) -/* 0AE2D4 7F07B8E4 C4460008 */ lwc1 $f6, 8($v0) -/* 0AE2D8 7F07B8E8 10000346 */ b .L7F07C604 -/* 0AE2DC 7F07B8EC E4860008 */ swc1 $f6, 8($a0) -.L7F07B8F0: -/* 0AE2E0 7F07B8F0 544100C0 */ bnel $v0, $at, .L7F07BBF4 -/* 0AE2E4 7F07B8F4 24010003 */ li $at, 3 -/* 0AE2E8 7F07B8F8 0FC269A4 */ jal get_cur_playernum -/* 0AE2EC 7F07B8FC 00000000 */ nop -/* 0AE2F0 7F07B900 0FC26A86 */ jal sub_GAME_7F09B4D8 -/* 0AE2F4 7F07B904 00402025 */ move $a0, $v0 -/* 0AE2F8 7F07B908 14400057 */ bnez $v0, .L7F07BA68 -/* 0AE2FC 7F07B90C 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE300 7F07B910 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0AE304 7F07B914 8CE70FF4 */ lw $a3, %lo(g_ClockTimer)($a3) -/* 0AE308 7F07B918 00001025 */ move $v0, $zero -/* 0AE30C 7F07B91C 3C018007 */ lui $at, %hi(flt_CODE_bss_80079E08) # $at, 0x8007 -/* 0AE310 7F07B920 18E00051 */ blez $a3, .L7F07BA68 -/* 0AE314 7F07B924 3C068007 */ lui $a2, %hi(flt_CODE_bss_80079E08) # $a2, 0x8007 -/* 0AE318 7F07B928 C4228918 */ lwc1 $f2, %lo(flt_CODE_bss_80079E08)($at) -/* 0AE31C 7F07B92C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AE320 7F07B930 44819000 */ mtc1 $at, $f18 -/* 0AE324 7F07B934 3C018005 */ lui $at, %hi(D_80055044) # $at, 0x8005 -/* 0AE328 7F07B938 C430AC14 */ lwc1 $f16, %lo(D_80055044)($at) -/* 0AE32C 7F07B93C 3C018005 */ lui $at, %hi(D_80055048) # $at, 0x8005 -/* 0AE330 7F07B940 3C058007 */ lui $a1, %hi(flt_CODE_bss_80079E04) # $a1, 0x8007 -/* 0AE334 7F07B944 3C048007 */ lui $a0, %hi(flt_CODE_bss_80079E0C) # $a0, 0x8007 -/* 0AE338 7F07B948 3C038007 */ lui $v1, %hi(flt_CODE_bss_80079E10) # $v1, 0x8007 -/* 0AE33C 7F07B94C 24638920 */ addiu $v1, %lo(flt_CODE_bss_80079E10) # addiu $v1, $v1, -0x76e0 -/* 0AE340 7F07B950 2484891C */ addiu $a0, %lo(flt_CODE_bss_80079E0C) # addiu $a0, $a0, -0x76e4 -/* 0AE344 7F07B954 24A58914 */ addiu $a1, %lo(flt_CODE_bss_80079E04) # addiu $a1, $a1, -0x76ec -/* 0AE348 7F07B958 C42EAC18 */ lwc1 $f14, %lo(D_80055048)($at) -/* 0AE34C 7F07B95C 24C68918 */ addiu $a2, %lo(flt_CODE_bss_80079E08) # addiu $a2, $a2, -0x76e8 -/* 0AE350 7F07B960 4610103C */ c.lt.s $f2, $f16 -.L7F07B964: -/* 0AE354 7F07B964 24420001 */ addiu $v0, $v0, 1 -/* 0AE358 7F07B968 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0AE35C 7F07B96C 45020016 */ bc1fl .L7F07B9C8 -/* 0AE360 7F07B970 4602803E */ c.le.s $f16, $f2 -/* 0AE364 7F07B974 44814000 */ mtc1 $at, $f8 -/* 0AE368 7F07B978 3C0142DC */ li $at, 0x42DC0000 # 110.000000 -/* 0AE36C 7F07B97C 44815000 */ mtc1 $at, $f10 -/* 0AE370 7F07B980 4608103C */ c.lt.s $f2, $f8 -/* 0AE374 7F07B984 C4A00000 */ lwc1 $f0, ($a1) -/* 0AE378 7F07B988 45020005 */ bc1fl .L7F07B9A0 -/* 0AE37C 7F07B98C 4602503C */ c.lt.s $f10, $f2 -/* 0AE380 7F07B990 460E0100 */ add.s $f4, $f0, $f14 -/* 0AE384 7F07B994 E4A40000 */ swc1 $f4, ($a1) -/* 0AE388 7F07B998 C4A00000 */ lwc1 $f0, ($a1) -/* 0AE38C 7F07B99C 4602503C */ c.lt.s $f10, $f2 -.L7F07B9A0: -/* 0AE390 7F07B9A0 00000000 */ nop -/* 0AE394 7F07B9A4 45020005 */ bc1fl .L7F07B9BC -/* 0AE398 7F07B9A8 46001200 */ add.s $f8, $f2, $f0 -/* 0AE39C 7F07B9AC 460E0181 */ sub.s $f6, $f0, $f14 -/* 0AE3A0 7F07B9B0 E4A60000 */ swc1 $f6, ($a1) -/* 0AE3A4 7F07B9B4 C4A00000 */ lwc1 $f0, ($a1) -/* 0AE3A8 7F07B9B8 46001200 */ add.s $f8, $f2, $f0 -.L7F07B9BC: -/* 0AE3AC 7F07B9BC E4C80000 */ swc1 $f8, ($a2) -/* 0AE3B0 7F07B9C0 C4C20000 */ lwc1 $f2, ($a2) -/* 0AE3B4 7F07B9C4 4602803E */ c.le.s $f16, $f2 -.L7F07B9C8: -/* 0AE3B8 7F07B9C8 3C014334 */ lui $at, 0x4334 -/* 0AE3BC 7F07B9CC 45020006 */ bc1fl .L7F07B9E8 -/* 0AE3C0 7F07B9D0 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -/* 0AE3C4 7F07B9D4 44812000 */ mtc1 $at, $f4 -/* 0AE3C8 7F07B9D8 00000000 */ nop -/* 0AE3CC 7F07B9DC E4C40000 */ swc1 $f4, ($a2) -/* 0AE3D0 7F07B9E0 C4C20000 */ lwc1 $f2, ($a2) -/* 0AE3D4 7F07B9E4 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -.L7F07B9E8: -/* 0AE3D8 7F07B9E8 44815000 */ mtc1 $at, $f10 -/* 0AE3DC 7F07B9EC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0AE3E0 7F07B9F0 4602503C */ c.lt.s $f10, $f2 -/* 0AE3E4 7F07B9F4 00000000 */ nop -/* 0AE3E8 7F07B9F8 45020019 */ bc1fl .L7F07BA60 -/* 0AE3EC 7F07B9FC 0047082A */ slt $at, $v0, $a3 -/* 0AE3F0 7F07BA00 C4600000 */ lwc1 $f0, ($v1) -/* 0AE3F4 7F07BA04 44813000 */ mtc1 $at, $f6 -/* 0AE3F8 7F07BA08 C48C0000 */ lwc1 $f12, ($a0) -/* 0AE3FC 7F07BA0C 3C018005 */ lui $at, %hi(D_8005504C) # $at, 0x8005 -/* 0AE400 7F07BA10 4600303C */ c.lt.s $f6, $f0 -/* 0AE404 7F07BA14 00000000 */ nop -/* 0AE408 7F07BA18 45000004 */ bc1f .L7F07BA2C -/* 0AE40C 7F07BA1C 00000000 */ nop -/* 0AE410 7F07BA20 460E6201 */ sub.s $f8, $f12, $f14 -/* 0AE414 7F07BA24 10000004 */ b .L7F07BA38 -/* 0AE418 7F07BA28 E4880000 */ swc1 $f8, ($a0) -.L7F07BA2C: -/* 0AE41C 7F07BA2C C424AC1C */ lwc1 $f4, %lo(D_8005504C)($at) -/* 0AE420 7F07BA30 46046280 */ add.s $f10, $f12, $f4 -/* 0AE424 7F07BA34 E48A0000 */ swc1 $f10, ($a0) -.L7F07BA38: -/* 0AE428 7F07BA38 C4860000 */ lwc1 $f6, ($a0) -/* 0AE42C 7F07BA3C 46060200 */ add.s $f8, $f0, $f6 -/* 0AE430 7F07BA40 E4680000 */ swc1 $f8, ($v1) -/* 0AE434 7F07BA44 C4640000 */ lwc1 $f4, ($v1) -/* 0AE438 7F07BA48 4612203C */ c.lt.s $f4, $f18 -/* 0AE43C 7F07BA4C 00000000 */ nop -/* 0AE440 7F07BA50 45020003 */ bc1fl .L7F07BA60 -/* 0AE444 7F07BA54 0047082A */ slt $at, $v0, $a3 -/* 0AE448 7F07BA58 E4720000 */ swc1 $f18, ($v1) -/* 0AE44C 7F07BA5C 0047082A */ slt $at, $v0, $a3 -.L7F07BA60: -/* 0AE450 7F07BA60 5420FFC0 */ bnezl $at, .L7F07B964 -/* 0AE454 7F07BA64 4610103C */ c.lt.s $f2, $f16 -.L7F07BA68: -/* 0AE458 7F07BA68 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE45C 7F07BA6C 8D2C0000 */ lw $t4, ($t1) -/* 0AE460 7F07BA70 3C068007 */ lui $a2, %hi(flt_CODE_bss_80079E08) # $a2, 0x8007 -/* 0AE464 7F07BA74 24C68918 */ addiu $a2, %lo(flt_CODE_bss_80079E08) # addiu $a2, $a2, -0x76e8 -/* 0AE468 7F07BA78 C4CA0000 */ lwc1 $f10, ($a2) -/* 0AE46C 7F07BA7C C5860148 */ lwc1 $f6, 0x148($t4) -/* 0AE470 7F07BA80 3C018005 */ lui $at, %hi(D_80055050) # $at, 0x8005 -/* 0AE474 7F07BA84 C424AC20 */ lwc1 $f4, %lo(D_80055050)($at) -/* 0AE478 7F07BA88 46065201 */ sub.s $f8, $f10, $f6 -/* 0AE47C 7F07BA8C 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0AE480 7F07BA90 44813000 */ mtc1 $at, $f6 -/* 0AE484 7F07BA94 46044282 */ mul.s $f10, $f8, $f4 -/* 0AE488 7F07BA98 46065303 */ div.s $f12, $f10, $f6 -/* 0AE48C 7F07BA9C 0FC1606B */ jal sinf -/* 0AE490 7F07BAA0 E7AC0038 */ swc1 $f12, 0x38($sp) -/* 0AE494 7F07BAA4 3C038007 */ lui $v1, %hi(flt_CODE_bss_80079E10) # $v1, 0x8007 -/* 0AE498 7F07BAA8 24638920 */ addiu $v1, %lo(flt_CODE_bss_80079E10) # addiu $v1, $v1, -0x76e0 -/* 0AE49C 7F07BAAC C4680000 */ lwc1 $f8, ($v1) -/* 0AE4A0 7F07BAB0 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE4A4 7F07BAB4 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE4A8 7F07BAB8 46080102 */ mul.s $f4, $f0, $f8 -/* 0AE4AC 7F07BABC 8D2F0000 */ lw $t7, ($t1) -/* 0AE4B0 7F07BAC0 8FA20048 */ lw $v0, 0x48($sp) -/* 0AE4B4 7F07BAC4 C7AC0038 */ lwc1 $f12, 0x38($sp) -/* 0AE4B8 7F07BAC8 C5EA04B4 */ lwc1 $f10, 0x4b4($t7) -/* 0AE4BC 7F07BACC 3C018005 */ lui $at, %hi(D_80055054) # $at, 0x8005 -/* 0AE4C0 7F07BAD0 460A2180 */ add.s $f6, $f4, $f10 -/* 0AE4C4 7F07BAD4 E4460000 */ swc1 $f6, ($v0) -/* 0AE4C8 7F07BAD8 C424AC24 */ lwc1 $f4, %lo(D_80055054)($at) -/* 0AE4CC 7F07BADC C4680000 */ lwc1 $f8, ($v1) -/* 0AE4D0 7F07BAE0 8D390000 */ lw $t9, ($t1) -/* 0AE4D4 7F07BAE4 46044282 */ mul.s $f10, $f8, $f4 -/* 0AE4D8 7F07BAE8 C72604B8 */ lwc1 $f6, 0x4b8($t9) -/* 0AE4DC 7F07BAEC 460A3200 */ add.s $f8, $f6, $f10 -/* 0AE4E0 7F07BAF0 0FC16068 */ jal cosf -/* 0AE4E4 7F07BAF4 E4480004 */ swc1 $f8, 4($v0) -/* 0AE4E8 7F07BAF8 3C038007 */ lui $v1, %hi(flt_CODE_bss_80079E10) # $v1, 0x8007 -/* 0AE4EC 7F07BAFC 24638920 */ addiu $v1, %lo(flt_CODE_bss_80079E10) # addiu $v1, $v1, -0x76e0 -/* 0AE4F0 7F07BB00 C4640000 */ lwc1 $f4, ($v1) -/* 0AE4F4 7F07BB04 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE4F8 7F07BB08 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE4FC 7F07BB0C 46040182 */ mul.s $f6, $f0, $f4 -/* 0AE500 7F07BB10 8D380000 */ lw $t8, ($t1) -/* 0AE504 7F07BB14 8FAD0048 */ lw $t5, 0x48($sp) -/* 0AE508 7F07BB18 8FA2004C */ lw $v0, 0x4c($sp) -/* 0AE50C 7F07BB1C C70A04BC */ lwc1 $f10, 0x4bc($t8) -/* 0AE510 7F07BB20 8FA40058 */ lw $a0, 0x58($sp) -/* 0AE514 7F07BB24 3C018005 */ lui $at, %hi(D_80055058) # $at, 0x8005 -/* 0AE518 7F07BB28 460A3200 */ add.s $f8, $f6, $f10 -/* 0AE51C 7F07BB2C E5A80008 */ swc1 $f8, 8($t5) -/* 0AE520 7F07BB30 8D2E0000 */ lw $t6, ($t1) -/* 0AE524 7F07BB34 C5C404B4 */ lwc1 $f4, 0x4b4($t6) -/* 0AE528 7F07BB38 E4440000 */ swc1 $f4, ($v0) -/* 0AE52C 7F07BB3C 8D2C0000 */ lw $t4, ($t1) -/* 0AE530 7F07BB40 C58604B8 */ lwc1 $f6, 0x4b8($t4) -/* 0AE534 7F07BB44 E4460004 */ swc1 $f6, 4($v0) -/* 0AE538 7F07BB48 8D2F0000 */ lw $t7, ($t1) -/* 0AE53C 7F07BB4C C5EA04BC */ lwc1 $f10, 0x4bc($t7) -/* 0AE540 7F07BB50 E44A0008 */ swc1 $f10, 8($v0) -/* 0AE544 7F07BB54 8D390000 */ lw $t9, ($t1) -/* 0AE548 7F07BB58 8FAE0054 */ lw $t6, 0x54($sp) -/* 0AE54C 7F07BB5C 8F3800A8 */ lw $t8, 0xa8($t9) -/* 0AE550 7F07BB60 8F0D0014 */ lw $t5, 0x14($t8) -/* 0AE554 7F07BB64 ADCD0000 */ sw $t5, ($t6) -/* 0AE558 7F07BB68 8D2C0000 */ lw $t4, ($t1) -/* 0AE55C 7F07BB6C C58804B4 */ lwc1 $f8, 0x4b4($t4) -/* 0AE560 7F07BB70 E4880000 */ swc1 $f8, ($a0) -/* 0AE564 7F07BB74 C426AC28 */ lwc1 $f6, %lo(D_80055058)($at) -/* 0AE568 7F07BB78 C4640000 */ lwc1 $f4, ($v1) -/* 0AE56C 7F07BB7C 8D2F0000 */ lw $t7, ($t1) -/* 0AE570 7F07BB80 46062282 */ mul.s $f10, $f4, $f6 -/* 0AE574 7F07BB84 C5E804B8 */ lwc1 $f8, 0x4b8($t7) -/* 0AE578 7F07BB88 460A4100 */ add.s $f4, $f8, $f10 -/* 0AE57C 7F07BB8C E4840004 */ swc1 $f4, 4($a0) -/* 0AE580 7F07BB90 8D390000 */ lw $t9, ($t1) -/* 0AE584 7F07BB94 C72604BC */ lwc1 $f6, 0x4bc($t9) -/* 0AE588 7F07BB98 0FC269A4 */ jal get_cur_playernum -/* 0AE58C 7F07BB9C E4860008 */ swc1 $f6, 8($a0) -/* 0AE590 7F07BBA0 0FC26A86 */ jal sub_GAME_7F09B4D8 -/* 0AE594 7F07BBA4 00402025 */ move $a0, $v0 -/* 0AE598 7F07BBA8 0FC26669 */ jal getPlayerCount -/* 0AE59C 7F07BBAC AFA20018 */ sw $v0, 0x18($sp) -/* 0AE5A0 7F07BBB0 8FB80018 */ lw $t8, 0x18($sp) -/* 0AE5A4 7F07BBB4 3C038007 */ lui $v1, %hi(flt_CODE_bss_80079E10) # $v1, 0x8007 -/* 0AE5A8 7F07BBB8 24638920 */ addiu $v1, %lo(flt_CODE_bss_80079E10) # addiu $v1, $v1, -0x76e0 -/* 0AE5AC 7F07BBBC 270D0001 */ addiu $t5, $t8, 1 -/* 0AE5B0 7F07BBC0 144D0290 */ bne $v0, $t5, .L7F07C604 -/* 0AE5B4 7F07BBC4 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0AE5B8 7F07BBC8 C4680000 */ lwc1 $f8, ($v1) -/* 0AE5BC 7F07BBCC 44815000 */ mtc1 $at, $f10 -/* 0AE5C0 7F07BBD0 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE5C4 7F07BBD4 240E0001 */ li $t6, 1 -/* 0AE5C8 7F07BBD8 460A403C */ c.lt.s $f8, $f10 -/* 0AE5CC 7F07BBDC 00000000 */ nop -/* 0AE5D0 7F07BBE0 45020289 */ bc1fl .L7F07C608 -/* 0AE5D4 7F07BBE4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AE5D8 7F07BBE8 10000286 */ b .L7F07C604 -/* 0AE5DC 7F07BBEC AC2E19E8 */ sw $t6, %lo(enable_move_after_cinema)($at) -/* 0AE5E0 7F07BBF0 24010003 */ li $at, 3 -.L7F07BBF4: -/* 0AE5E4 7F07BBF4 144100CB */ bne $v0, $at, .L7F07BF24 -/* 0AE5E8 7F07BBF8 24030005 */ li $v1, 5 -/* 0AE5EC 7F07BBFC 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE5F0 7F07BC00 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE5F4 7F07BC04 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AE5F8 7F07BC08 C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0AE5FC 7F07BC0C C5440000 */ lwc1 $f4, ($t2) -/* 0AE600 7F07BC10 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE604 7F07BC14 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -/* 0AE608 7F07BC18 46122180 */ add.s $f6, $f4, $f18 -/* 0AE60C 7F07BC1C 8D030000 */ lw $v1, ($t0) -/* 0AE610 7F07BC20 3C048003 */ lui $a0, %hi(g_IntroSwirl) # $a0, 0x8003 -/* 0AE614 7F07BC24 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE618 7F07BC28 E5460000 */ swc1 $f6, ($t2) -/* 0AE61C 7F07BC2C 8C8419FC */ lw $a0, %lo(g_IntroSwirl)($a0) -/* 0AE620 7F07BC30 00036140 */ sll $t4, $v1, 5 -/* 0AE624 7F07BC34 C5420000 */ lwc1 $f2, ($t2) -/* 0AE628 7F07BC38 008C1021 */ addu $v0, $a0, $t4 -/* 0AE62C 7F07BC3C C4400018 */ lwc1 $f0, 0x18($v0) -/* 0AE630 7F07BC40 4602003E */ c.le.s $f0, $f2 -/* 0AE634 7F07BC44 00000000 */ nop -/* 0AE638 7F07BC48 45020019 */ bc1fl .L7F07BCB0 -/* 0AE63C 7F07BC4C 24650001 */ addiu $a1, $v1, 1 -/* 0AE640 7F07BC50 8C4F0064 */ lw $t7, 0x64($v0) -.L7F07BC54: -/* 0AE644 7F07BC54 31F90001 */ andi $t9, $t7, 1 -/* 0AE648 7F07BC58 57200007 */ bnezl $t9, .L7F07BC78 -/* 0AE64C 7F07BC5C E5400000 */ swc1 $f0, ($t2) -/* 0AE650 7F07BC60 46001201 */ sub.s $f8, $f2, $f0 -/* 0AE654 7F07BC64 24780001 */ addiu $t8, $v1, 1 -/* 0AE658 7F07BC68 AD180000 */ sw $t8, ($t0) -/* 0AE65C 7F07BC6C 10000006 */ b .L7F07BC88 -/* 0AE660 7F07BC70 E5480000 */ swc1 $f8, ($t2) -/* 0AE664 7F07BC74 E5400000 */ swc1 $f0, ($t2) -.L7F07BC78: -/* 0AE668 7F07BC78 AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0AE66C 7F07BC7C C4400018 */ lwc1 $f0, 0x18($v0) -/* 0AE670 7F07BC80 1000000A */ b .L7F07BCAC -/* 0AE674 7F07BC84 C5420000 */ lwc1 $f2, ($t2) -.L7F07BC88: -/* 0AE678 7F07BC88 8D030000 */ lw $v1, ($t0) -/* 0AE67C 7F07BC8C C5420000 */ lwc1 $f2, ($t2) -/* 0AE680 7F07BC90 00036940 */ sll $t5, $v1, 5 -/* 0AE684 7F07BC94 008D1021 */ addu $v0, $a0, $t5 -/* 0AE688 7F07BC98 C4400018 */ lwc1 $f0, 0x18($v0) -/* 0AE68C 7F07BC9C 4602003E */ c.le.s $f0, $f2 -/* 0AE690 7F07BCA0 00000000 */ nop -/* 0AE694 7F07BCA4 4503FFEB */ bc1tl .L7F07BC54 -/* 0AE698 7F07BCA8 8C4F0064 */ lw $t7, 0x64($v0) -.L7F07BCAC: -/* 0AE69C 7F07BCAC 24650001 */ addiu $a1, $v1, 1 -.L7F07BCB0: -/* 0AE6A0 7F07BCB0 00057140 */ sll $t6, $a1, 5 -/* 0AE6A4 7F07BCB4 008E1021 */ addu $v0, $a0, $t6 -/* 0AE6A8 7F07BCB8 8C4C0044 */ lw $t4, 0x44($v0) -/* 0AE6AC 7F07BCBC 46020281 */ sub.s $f10, $f0, $f2 -/* 0AE6B0 7F07BCC0 44807000 */ mtc1 $zero, $f14 -/* 0AE6B4 7F07BCC4 318F0001 */ andi $t7, $t4, 1 -/* 0AE6B8 7F07BCC8 15E00007 */ bnez $t7, .L7F07BCE8 -/* 0AE6BC 7F07BCCC 460A7400 */ add.s $f16, $f14, $f10 -.L7F07BCD0: -/* 0AE6C0 7F07BCD0 8C590064 */ lw $t9, 0x64($v0) -/* 0AE6C4 7F07BCD4 C4440018 */ lwc1 $f4, 0x18($v0) -/* 0AE6C8 7F07BCD8 24420020 */ addiu $v0, $v0, 0x20 -/* 0AE6CC 7F07BCDC 33380001 */ andi $t8, $t9, 1 -/* 0AE6D0 7F07BCE0 1300FFFB */ beqz $t8, .L7F07BCD0 -/* 0AE6D4 7F07BCE4 46048400 */ add.s $f16, $f16, $f4 -.L7F07BCE8: -/* 0AE6D8 7F07BCE8 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0AE6DC 7F07BCEC 44816000 */ mtc1 $at, $f12 -/* 0AE6E0 7F07BCF0 00000000 */ nop -/* 0AE6E4 7F07BCF4 460C803C */ c.lt.s $f16, $f12 -/* 0AE6E8 7F07BCF8 00000000 */ nop -/* 0AE6EC 7F07BCFC 4500000D */ bc1f .L7F07BD34 -/* 0AE6F0 7F07BD00 00000000 */ nop -/* 0AE6F4 7F07BD04 46128180 */ add.s $f6, $f16, $f18 -/* 0AE6F8 7F07BD08 4606603E */ c.le.s $f12, $f6 -/* 0AE6FC 7F07BD0C 00000000 */ nop -/* 0AE700 7F07BD10 45000008 */ bc1f .L7F07BD34 -/* 0AE704 7F07BD14 00000000 */ nop -/* 0AE708 7F07BD18 0FC202AD */ jal currentPlayerStartChrFade -/* 0AE70C 7F07BD1C E7B00030 */ swc1 $f16, 0x30($sp) -/* 0AE710 7F07BD20 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE714 7F07BD24 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE718 7F07BD28 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE71C 7F07BD2C 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -/* 0AE720 7F07BD30 C7B00030 */ lwc1 $f16, 0x30($sp) -.L7F07BD34: -/* 0AE724 7F07BD34 3C0D8003 */ lui $t5, %hi(D_8003649C) # $t5, 0x8003 -/* 0AE728 7F07BD38 8DAD19EC */ lw $t5, %lo(D_8003649C)($t5) -/* 0AE72C 7F07BD3C 51A0000D */ beql $t5, $zero, .L7F07BD74 -/* 0AE730 7F07BD40 3C014270 */ lui $at, 0x4270 -/* 0AE734 7F07BD44 0FC2024C */ jal currentPlayerIsFadeComplete -/* 0AE738 7F07BD48 E7B00030 */ swc1 $f16, 0x30($sp) -/* 0AE73C 7F07BD4C 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE740 7F07BD50 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE744 7F07BD54 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE748 7F07BD58 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -/* 0AE74C 7F07BD5C 10400004 */ beqz $v0, .L7F07BD70 -/* 0AE750 7F07BD60 C7B00030 */ lwc1 $f16, 0x30($sp) -/* 0AE754 7F07BD64 240E0001 */ li $t6, 1 -/* 0AE758 7F07BD68 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE75C 7F07BD6C AC2E19E8 */ sw $t6, %lo(enable_move_after_cinema)($at) -.L7F07BD70: -/* 0AE760 7F07BD70 3C014270 */ li $at, 0x42700000 # 60.000000 -.L7F07BD74: -/* 0AE764 7F07BD74 44814000 */ mtc1 $at, $f8 -/* 0AE768 7F07BD78 3C0C8003 */ lui $t4, %hi(D_8003649C) # $t4, 0x8003 -/* 0AE76C 7F07BD7C 4610403C */ c.lt.s $f8, $f16 -/* 0AE770 7F07BD80 00000000 */ nop -/* 0AE774 7F07BD84 45020036 */ bc1fl .L7F07BE60 -/* 0AE778 7F07BD88 8D040000 */ lw $a0, ($t0) -/* 0AE77C 7F07BD8C 8D8C19EC */ lw $t4, %lo(D_8003649C)($t4) -/* 0AE780 7F07BD90 55800033 */ bnezl $t4, .L7F07BE60 -/* 0AE784 7F07BD94 8D040000 */ lw $a0, ($t0) -/* 0AE788 7F07BD98 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0AE78C 7F07BD9C 00000000 */ nop -/* 0AE790 7F07BDA0 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE794 7F07BDA4 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE798 7F07BDA8 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE79C 7F07BDAC 1440002B */ bnez $v0, .L7F07BE5C -/* 0AE7A0 7F07BDB0 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -/* 0AE7A4 7F07BDB4 97B90046 */ lhu $t9, 0x46($sp) -/* 0AE7A8 7F07BDB8 97AF0042 */ lhu $t7, 0x42($sp) -/* 0AE7AC 7F07BDBC 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE7B0 7F07BDC0 0320C027 */ not $t8, $t9 -/* 0AE7B4 7F07BDC4 01F86824 */ and $t5, $t7, $t8 -/* 0AE7B8 7F07BDC8 31AEF030 */ andi $t6, $t5, 0xf030 -/* 0AE7BC 7F07BDCC 11C00023 */ beqz $t6, .L7F07BE5C -/* 0AE7C0 7F07BDD0 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE7C4 7F07BDD4 240C0001 */ li $t4, 1 -/* 0AE7C8 7F07BDD8 3C018003 */ lui $at, %hi(D_8003649C) # $at, 0x8003 -/* 0AE7CC 7F07BDDC AC2C19EC */ sw $t4, %lo(D_8003649C)($at) -/* 0AE7D0 7F07BDE0 8D390000 */ lw $t9, ($t1) -/* 0AE7D4 7F07BDE4 00002025 */ move $a0, $zero -/* 0AE7D8 7F07BDE8 00002825 */ move $a1, $zero -/* 0AE7DC 7F07BDEC 00003025 */ move $a2, $zero -/* 0AE7E0 7F07BDF0 0FC20215 */ jal currentPlayerSetFadeColour -/* 0AE7E4 7F07BDF4 8F2703DC */ lw $a3, 0x3dc($t9) -/* 0AE7E8 7F07BDF8 0FC2024C */ jal currentPlayerIsFadeComplete -/* 0AE7EC 7F07BDFC 00000000 */ nop -/* 0AE7F0 7F07BE00 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE7F4 7F07BE04 1040000C */ beqz $v0, .L7F07BE38 -/* 0AE7F8 7F07BE08 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE7FC 7F07BE0C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0AE800 7F07BE10 44816000 */ mtc1 $at, $f12 -/* 0AE804 7F07BE14 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AE808 7F07BE18 44817000 */ mtc1 $at, $f14 -/* 0AE80C 7F07BE1C 0FC2023F */ jal currentPlayerSetFadeFrac -/* 0AE810 7F07BE20 00000000 */ nop -/* 0AE814 7F07BE24 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE818 7F07BE28 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE81C 7F07BE2C 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE820 7F07BE30 1000000A */ b .L7F07BE5C -/* 0AE824 7F07BE34 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -.L7F07BE38: -/* 0AE828 7F07BE38 8D2F0000 */ lw $t7, ($t1) -/* 0AE82C 7F07BE3C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AE830 7F07BE40 44817000 */ mtc1 $at, $f14 -/* 0AE834 7F07BE44 0FC2023F */ jal currentPlayerSetFadeFrac -/* 0AE838 7F07BE48 C5EC03E0 */ lwc1 $f12, 0x3e0($t7) -/* 0AE83C 7F07BE4C 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE840 7F07BE50 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE844 7F07BE54 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE848 7F07BE58 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -.L7F07BE5C: -/* 0AE84C 7F07BE5C 8D040000 */ lw $a0, ($t0) -.L7F07BE60: -/* 0AE850 7F07BE60 8D450000 */ lw $a1, ($t2) -/* 0AE854 7F07BE64 8FA60048 */ lw $a2, 0x48($sp) -/* 0AE858 7F07BE68 0FC1ECCE */ jal sub_GAME_7F07B2A0 -/* 0AE85C 7F07BE6C 8FA7004C */ lw $a3, 0x4c($sp) -/* 0AE860 7F07BE70 3C088003 */ lui $t0, %hi(D_800364A8) # $t0, 0x8003 -/* 0AE864 7F07BE74 250819F8 */ addiu $t0, %lo(D_800364A8) # addiu $t0, $t0, 0x19f8 -/* 0AE868 7F07BE78 8D0D0000 */ lw $t5, ($t0) -/* 0AE86C 7F07BE7C 3C188003 */ lui $t8, %hi(g_IntroSwirl) # $t8, 0x8003 -/* 0AE870 7F07BE80 8F1819FC */ lw $t8, %lo(g_IntroSwirl)($t8) -/* 0AE874 7F07BE84 000D7140 */ sll $t6, $t5, 5 -/* 0AE878 7F07BE88 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE87C 7F07BE8C 030E6021 */ addu $t4, $t8, $t6 -/* 0AE880 7F07BE90 8D83001C */ lw $v1, 0x1c($t4) -/* 0AE884 7F07BE94 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE888 7F07BE98 3C0F8006 */ lui $t7, %hi(g_CurrentSetup+0x18) # $t7, 0x8006 -/* 0AE88C 7F07BE9C 04600012 */ bltz $v1, .L7F07BEE8 -/* 0AE890 7F07BEA0 0003C880 */ sll $t9, $v1, 2 -/* 0AE894 7F07BEA4 0323C823 */ subu $t9, $t9, $v1 -/* 0AE898 7F07BEA8 8DEF4C58 */ lw $t7, %lo(g_CurrentSetup+0x18)($t7) -/* 0AE89C 7F07BEAC 0019C880 */ sll $t9, $t9, 2 -/* 0AE8A0 7F07BEB0 0323C823 */ subu $t9, $t9, $v1 -/* 0AE8A4 7F07BEB4 0019C880 */ sll $t9, $t9, 2 -/* 0AE8A8 7F07BEB8 032F1021 */ addu $v0, $t9, $t7 -/* 0AE8AC 7F07BEBC 8C4D0028 */ lw $t5, 0x28($v0) -/* 0AE8B0 7F07BEC0 8FB80054 */ lw $t8, 0x54($sp) -/* 0AE8B4 7F07BEC4 8FA40058 */ lw $a0, 0x58($sp) -/* 0AE8B8 7F07BEC8 AF0D0000 */ sw $t5, ($t8) -/* 0AE8BC 7F07BECC C44A0000 */ lwc1 $f10, ($v0) -/* 0AE8C0 7F07BED0 E48A0000 */ swc1 $f10, ($a0) -/* 0AE8C4 7F07BED4 C4440004 */ lwc1 $f4, 4($v0) -/* 0AE8C8 7F07BED8 E4840004 */ swc1 $f4, 4($a0) -/* 0AE8CC 7F07BEDC C4460008 */ lwc1 $f6, 8($v0) -/* 0AE8D0 7F07BEE0 100001C8 */ b .L7F07C604 -/* 0AE8D4 7F07BEE4 E4860008 */ swc1 $f6, 8($a0) -.L7F07BEE8: -/* 0AE8D8 7F07BEE8 8D2E0000 */ lw $t6, ($t1) -/* 0AE8DC 7F07BEEC 8FB90054 */ lw $t9, 0x54($sp) -/* 0AE8E0 7F07BEF0 8FA40058 */ lw $a0, 0x58($sp) -/* 0AE8E4 7F07BEF4 8DCC0488 */ lw $t4, 0x488($t6) -/* 0AE8E8 7F07BEF8 AF2C0000 */ sw $t4, ($t9) -/* 0AE8EC 7F07BEFC 8D2F0000 */ lw $t7, ($t1) -/* 0AE8F0 7F07BF00 C5E8048C */ lwc1 $f8, 0x48c($t7) -/* 0AE8F4 7F07BF04 E4880000 */ swc1 $f8, ($a0) -/* 0AE8F8 7F07BF08 8D2D0000 */ lw $t5, ($t1) -/* 0AE8FC 7F07BF0C C5AA0490 */ lwc1 $f10, 0x490($t5) -/* 0AE900 7F07BF10 E48A0004 */ swc1 $f10, 4($a0) -/* 0AE904 7F07BF14 8D380000 */ lw $t8, ($t1) -/* 0AE908 7F07BF18 C7040494 */ lwc1 $f4, 0x494($t8) -/* 0AE90C 7F07BF1C 100001B9 */ b .L7F07C604 -/* 0AE910 7F07BF20 E4840008 */ swc1 $f4, 8($a0) -.L7F07BF24: -/* 0AE914 7F07BF24 10620003 */ beq $v1, $v0, .L7F07BF34 -/* 0AE918 7F07BF28 24010006 */ li $at, 6 -/* 0AE91C 7F07BF2C 5441009D */ bnel $v0, $at, .L7F07C1A4 -/* 0AE920 7F07BF30 24010007 */ li $at, 7 -.L7F07BF34: -/* 0AE924 7F07BF34 14620040 */ bne $v1, $v0, .L7F07C038 -/* 0AE928 7F07BF38 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AE92C 7F07BF3C 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AE930 7F07BF40 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AE934 7F07BF44 C4281004 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0AE938 7F07BF48 C5460000 */ lwc1 $f6, ($t2) -/* 0AE93C 7F07BF4C 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE940 7F07BF50 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE944 7F07BF54 46083280 */ add.s $f10, $f6, $f8 -/* 0AE948 7F07BF58 8D2E0000 */ lw $t6, ($t1) -/* 0AE94C 7F07BF5C 3C014334 */ lui $at, 0x4334 -/* 0AE950 7F07BF60 E54A0000 */ swc1 $f10, ($t2) -/* 0AE954 7F07BF64 8DC400D4 */ lw $a0, 0xd4($t6) -/* 0AE958 7F07BF68 50800016 */ beql $a0, $zero, .L7F07BFC4 -/* 0AE95C 7F07BF6C C5460000 */ lwc1 $f6, ($t2) -/* 0AE960 7F07BF70 0FC1BDD7 */ jal objecthandlerGetModelField28 -/* 0AE964 7F07BF74 00000000 */ nop -/* 0AE968 7F07BF78 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE96C 7F07BF7C 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE970 7F07BF80 8D2C0000 */ lw $t4, ($t1) -/* 0AE974 7F07BF84 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AE978 7F07BF88 0FC1BDD9 */ jal sub_GAME_7F06F5C4 -/* 0AE97C 7F07BF8C 8D8400D4 */ lw $a0, 0xd4($t4) -/* 0AE980 7F07BF90 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0AE984 7F07BF94 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AE988 7F07BF98 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AE98C 7F07BF9C 4604003E */ c.le.s $f0, $f4 -/* 0AE990 7F07BFA0 240B0001 */ li $t3, 1 -/* 0AE994 7F07BFA4 24190001 */ li $t9, 1 -/* 0AE998 7F07BFA8 3C018003 */ li $at, 0x80030000 # -0.000000 -/* 0AE99C 7F07BFAC 45000002 */ bc1f .L7F07BFB8 -/* 0AE9A0 7F07BFB0 00000000 */ nop -/* 0AE9A4 7F07BFB4 AC3919E8 */ sw $t9, %lo(enable_move_after_cinema)($at) -.L7F07BFB8: -/* 0AE9A8 7F07BFB8 10000009 */ b .L7F07BFE0 -/* 0AE9AC 7F07BFBC 24050002 */ li $a1, 2 -/* 0AE9B0 7F07BFC0 C5460000 */ lwc1 $f6, ($t2) -.L7F07BFC4: -/* 0AE9B4 7F07BFC4 44814000 */ mtc1 $at, $f8 -/* 0AE9B8 7F07BFC8 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AE9BC 7F07BFCC 4606403E */ c.le.s $f8, $f6 -/* 0AE9C0 7F07BFD0 00000000 */ nop -/* 0AE9C4 7F07BFD4 45020003 */ bc1fl .L7F07BFE4 -/* 0AE9C8 7F07BFD8 97AD0046 */ lhu $t5, 0x46($sp) -/* 0AE9CC 7F07BFDC AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -.L7F07BFE0: -/* 0AE9D0 7F07BFE0 97AD0046 */ lhu $t5, 0x46($sp) -.L7F07BFE4: -/* 0AE9D4 7F07BFE4 97AF0042 */ lhu $t7, 0x42($sp) -/* 0AE9D8 7F07BFE8 01A0C027 */ not $t8, $t5 -/* 0AE9DC 7F07BFEC 01F87024 */ and $t6, $t7, $t8 -/* 0AE9E0 7F07BFF0 31CCF000 */ andi $t4, $t6, 0xf000 -/* 0AE9E4 7F07BFF4 11800036 */ beqz $t4, .L7F07C0D0 -/* 0AE9E8 7F07BFF8 00000000 */ nop -/* 0AE9EC 7F07BFFC 8D220000 */ lw $v0, ($t1) -/* 0AE9F0 7F07C000 8C5900D8 */ lw $t9, 0xd8($v0) -/* 0AE9F4 7F07C004 13200032 */ beqz $t9, .L7F07C0D0 -/* 0AE9F8 7F07C008 00000000 */ nop -/* 0AE9FC 7F07C00C 8C4D0424 */ lw $t5, 0x424($v0) -/* 0AEA00 7F07C010 11A0002F */ beqz $t5, .L7F07C0D0 -/* 0AEA04 7F07C014 00000000 */ nop -/* 0AEA08 7F07C018 8C4F0428 */ lw $t7, 0x428($v0) -/* 0AEA0C 7F07C01C 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AEA10 7F07C020 11E0002B */ beqz $t7, .L7F07C0D0 -/* 0AEA14 7F07C024 00000000 */ nop -/* 0AEA18 7F07C028 AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0AEA1C 7F07C02C 3C018003 */ lui $at, %hi(D_80036510) # $at, 0x8003 -/* 0AEA20 7F07C030 10000027 */ b .L7F07C0D0 -/* 0AEA24 7F07C034 AC251A60 */ sw $a1, %lo(D_80036510)($at) -.L7F07C038: -/* 0AEA28 7F07C038 24010006 */ li $at, 6 -/* 0AEA2C 7F07C03C 14410024 */ bne $v0, $at, .L7F07C0D0 -/* 0AEA30 7F07C040 3C0A8003 */ lui $t2, %hi(D_800364A4) # $t2, 0x8003 -/* 0AEA34 7F07C044 254A19F4 */ addiu $t2, %lo(D_800364A4) # addiu $t2, $t2, 0x19f4 -/* 0AEA38 7F07C048 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AEA3C 7F07C04C C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0AEA40 7F07C050 C54A0000 */ lwc1 $f10, ($t2) -/* 0AEA44 7F07C054 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AEA48 7F07C058 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AEA4C 7F07C05C 46045180 */ add.s $f6, $f10, $f4 -/* 0AEA50 7F07C060 8D220000 */ lw $v0, ($t1) -/* 0AEA54 7F07C064 44807000 */ mtc1 $zero, $f14 -/* 0AEA58 7F07C068 3C018003 */ lui $at, %hi(enable_move_after_cinema) # $at, 0x8003 -/* 0AEA5C 7F07C06C E5460000 */ swc1 $f6, ($t2) -/* 0AEA60 7F07C070 C44803E4 */ lwc1 $f8, 0x3e4($v0) -/* 0AEA64 7F07C074 460E403C */ c.lt.s $f8, $f14 -/* 0AEA68 7F07C078 00000000 */ nop -/* 0AEA6C 7F07C07C 45020003 */ bc1fl .L7F07C08C -/* 0AEA70 7F07C080 97AE0046 */ lhu $t6, 0x46($sp) -/* 0AEA74 7F07C084 AC2B19E8 */ sw $t3, %lo(enable_move_after_cinema)($at) -/* 0AEA78 7F07C088 97AE0046 */ lhu $t6, 0x46($sp) -.L7F07C08C: -/* 0AEA7C 7F07C08C 97B80042 */ lhu $t8, 0x42($sp) -/* 0AEA80 7F07C090 01C06027 */ not $t4, $t6 -/* 0AEA84 7F07C094 030CC824 */ and $t9, $t8, $t4 -/* 0AEA88 7F07C098 332DF000 */ andi $t5, $t9, 0xf000 -/* 0AEA8C 7F07C09C 11A0000C */ beqz $t5, .L7F07C0D0 -/* 0AEA90 7F07C0A0 00000000 */ nop -/* 0AEA94 7F07C0A4 8C4F00D8 */ lw $t7, 0xd8($v0) -/* 0AEA98 7F07C0A8 11E00009 */ beqz $t7, .L7F07C0D0 -/* 0AEA9C 7F07C0AC 00000000 */ nop -/* 0AEAA0 7F07C0B0 8C4E0424 */ lw $t6, 0x424($v0) -/* 0AEAA4 7F07C0B4 11C00006 */ beqz $t6, .L7F07C0D0 -/* 0AEAA8 7F07C0B8 00000000 */ nop -/* 0AEAAC 7F07C0BC 8C580428 */ lw $t8, 0x428($v0) -/* 0AEAB0 7F07C0C0 3C018003 */ lui $at, %hi(D_80036510) # $at, 0x8003 -/* 0AEAB4 7F07C0C4 13000002 */ beqz $t8, .L7F07C0D0 -/* 0AEAB8 7F07C0C8 00000000 */ nop -/* 0AEABC 7F07C0CC AC251A60 */ sw $a1, %lo(D_80036510)($at) -.L7F07C0D0: -/* 0AEAC0 7F07C0D0 3C038007 */ lui $v1, %hi(flt_CODE_bss_800799E8) # $v1, 0x8007 -/* 0AEAC4 7F07C0D4 246384C8 */ addiu $v1, %lo(flt_CODE_bss_800799E8) # addiu $v1, $v1, -0x7b38 -/* 0AEAC8 7F07C0D8 C46A0000 */ lwc1 $f10, ($v1) -/* 0AEACC 7F07C0DC 8FAC0048 */ lw $t4, 0x48($sp) -/* 0AEAD0 7F07C0E0 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AEAD4 7F07C0E4 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AEAD8 7F07C0E8 E58A0000 */ swc1 $f10, ($t4) -/* 0AEADC 7F07C0EC C4640004 */ lwc1 $f4, 4($v1) -/* 0AEAE0 7F07C0F0 3C058007 */ lui $a1, %hi(dword_CODE_bss_800799F4) # $a1, 0x8007 -/* 0AEAE4 7F07C0F4 24A584D4 */ addiu $a1, %lo(dword_CODE_bss_800799F4) # addiu $a1, $a1, -0x7b2c -/* 0AEAE8 7F07C0F8 E5840004 */ swc1 $f4, 4($t4) -/* 0AEAEC 7F07C0FC C4660008 */ lwc1 $f6, 8($v1) -/* 0AEAF0 7F07C100 E5860008 */ swc1 $f6, 8($t4) -/* 0AEAF4 7F07C104 8D220000 */ lw $v0, ($t1) -/* 0AEAF8 7F07C108 8CA40000 */ lw $a0, ($a1) -/* 0AEAFC 7F07C10C 8C5900A8 */ lw $t9, 0xa8($v0) -/* 0AEB00 7F07C110 5499000C */ bnel $a0, $t9, .L7F07C144 -/* 0AEB04 7F07C114 C4860008 */ lwc1 $f6, 8($a0) -/* 0AEB08 7F07C118 C44803C4 */ lwc1 $f8, 0x3c4($v0) -/* 0AEB0C 7F07C11C 8FAD004C */ lw $t5, 0x4c($sp) -/* 0AEB10 7F07C120 E5A80000 */ swc1 $f8, ($t5) -/* 0AEB14 7F07C124 8D2F0000 */ lw $t7, ($t1) -/* 0AEB18 7F07C128 C5EA03C8 */ lwc1 $f10, 0x3c8($t7) -/* 0AEB1C 7F07C12C E5AA0004 */ swc1 $f10, 4($t5) -/* 0AEB20 7F07C130 8D2E0000 */ lw $t6, ($t1) -/* 0AEB24 7F07C134 C5C403CC */ lwc1 $f4, 0x3cc($t6) -/* 0AEB28 7F07C138 1000000A */ b .L7F07C164 -/* 0AEB2C 7F07C13C E5A40008 */ swc1 $f4, 8($t5) -/* 0AEB30 7F07C140 C4860008 */ lwc1 $f6, 8($a0) -.L7F07C144: -/* 0AEB34 7F07C144 8FB8004C */ lw $t8, 0x4c($sp) -/* 0AEB38 7F07C148 E7060000 */ swc1 $f6, ($t8) -/* 0AEB3C 7F07C14C 8CAC0000 */ lw $t4, ($a1) -/* 0AEB40 7F07C150 C588000C */ lwc1 $f8, 0xc($t4) -/* 0AEB44 7F07C154 E7080004 */ swc1 $f8, 4($t8) -/* 0AEB48 7F07C158 8CB90000 */ lw $t9, ($a1) -/* 0AEB4C 7F07C15C C72A0010 */ lwc1 $f10, 0x10($t9) -/* 0AEB50 7F07C160 E70A0008 */ swc1 $f10, 8($t8) -.L7F07C164: -/* 0AEB54 7F07C164 8D2F0000 */ lw $t7, ($t1) -/* 0AEB58 7F07C168 8FAD0054 */ lw $t5, 0x54($sp) -/* 0AEB5C 7F07C16C 8FA40058 */ lw $a0, 0x58($sp) -/* 0AEB60 7F07C170 8DEE0488 */ lw $t6, 0x488($t7) -/* 0AEB64 7F07C174 ADAE0000 */ sw $t6, ($t5) -/* 0AEB68 7F07C178 8D2C0000 */ lw $t4, ($t1) -/* 0AEB6C 7F07C17C C584048C */ lwc1 $f4, 0x48c($t4) -/* 0AEB70 7F07C180 E4840000 */ swc1 $f4, ($a0) -/* 0AEB74 7F07C184 8D390000 */ lw $t9, ($t1) -/* 0AEB78 7F07C188 C7260490 */ lwc1 $f6, 0x490($t9) -/* 0AEB7C 7F07C18C E4860004 */ swc1 $f6, 4($a0) -/* 0AEB80 7F07C190 8D380000 */ lw $t8, ($t1) -/* 0AEB84 7F07C194 C7080494 */ lwc1 $f8, 0x494($t8) -/* 0AEB88 7F07C198 1000011A */ b .L7F07C604 -/* 0AEB8C 7F07C19C E4880008 */ swc1 $f8, 8($a0) -/* 0AEB90 7F07C1A0 24010007 */ li $at, 7 -.L7F07C1A4: -/* 0AEB94 7F07C1A4 14410117 */ bne $v0, $at, .L7F07C604 -/* 0AEB98 7F07C1A8 3C028007 */ lui $v0, %hi(dword_CODE_bss_800799F8) # $v0, 0x8007 -/* 0AEB9C 7F07C1AC 244284D8 */ addiu $v0, %lo(dword_CODE_bss_800799F8) # addiu $v0, $v0, -0x7b28 -/* 0AEBA0 7F07C1B0 8C430000 */ lw $v1, ($v0) -/* 0AEBA4 7F07C1B4 8FAF0048 */ lw $t7, 0x48($sp) -/* 0AEBA8 7F07C1B8 10600024 */ beqz $v1, .L7F07C24C -/* 0AEBAC 7F07C1BC 00000000 */ nop -/* 0AEBB0 7F07C1C0 C46A0000 */ lwc1 $f10, ($v1) -/* 0AEBB4 7F07C1C4 8FA40058 */ lw $a0, 0x58($sp) -/* 0AEBB8 7F07C1C8 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AEBBC 7F07C1CC E5EA0000 */ swc1 $f10, ($t7) -/* 0AEBC0 7F07C1D0 8C4E0000 */ lw $t6, ($v0) -/* 0AEBC4 7F07C1D4 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AEBC8 7F07C1D8 C5C40004 */ lwc1 $f4, 4($t6) -/* 0AEBCC 7F07C1DC E5E40004 */ swc1 $f4, 4($t7) -/* 0AEBD0 7F07C1E0 8C4D0000 */ lw $t5, ($v0) -/* 0AEBD4 7F07C1E4 C5A60008 */ lwc1 $f6, 8($t5) -/* 0AEBD8 7F07C1E8 E5E60008 */ swc1 $f6, 8($t7) -/* 0AEBDC 7F07C1EC 8D2C0000 */ lw $t4, ($t1) -/* 0AEBE0 7F07C1F0 8FB9004C */ lw $t9, 0x4c($sp) -/* 0AEBE4 7F07C1F4 C58803C4 */ lwc1 $f8, 0x3c4($t4) -/* 0AEBE8 7F07C1F8 E7280000 */ swc1 $f8, ($t9) -/* 0AEBEC 7F07C1FC 8D380000 */ lw $t8, ($t1) -/* 0AEBF0 7F07C200 C70A03C8 */ lwc1 $f10, 0x3c8($t8) -/* 0AEBF4 7F07C204 E72A0004 */ swc1 $f10, 4($t9) -/* 0AEBF8 7F07C208 8D2E0000 */ lw $t6, ($t1) -/* 0AEBFC 7F07C20C C5C403CC */ lwc1 $f4, 0x3cc($t6) -/* 0AEC00 7F07C210 E7240008 */ swc1 $f4, 8($t9) -/* 0AEC04 7F07C214 8C4D0000 */ lw $t5, ($v0) -/* 0AEC08 7F07C218 8FAC0054 */ lw $t4, 0x54($sp) -/* 0AEC0C 7F07C21C 8DAF0028 */ lw $t7, 0x28($t5) -/* 0AEC10 7F07C220 AD8F0000 */ sw $t7, ($t4) -/* 0AEC14 7F07C224 8C580000 */ lw $t8, ($v0) -/* 0AEC18 7F07C228 C7060000 */ lwc1 $f6, ($t8) -/* 0AEC1C 7F07C22C E4860000 */ swc1 $f6, ($a0) -/* 0AEC20 7F07C230 8C4E0000 */ lw $t6, ($v0) -/* 0AEC24 7F07C234 C5C80004 */ lwc1 $f8, 4($t6) -/* 0AEC28 7F07C238 E4880004 */ swc1 $f8, 4($a0) -/* 0AEC2C 7F07C23C 8C590000 */ lw $t9, ($v0) -/* 0AEC30 7F07C240 C72A0008 */ lwc1 $f10, 8($t9) -/* 0AEC34 7F07C244 100000EF */ b .L7F07C604 -/* 0AEC38 7F07C248 E48A0008 */ swc1 $f10, 8($a0) -.L7F07C24C: -/* 0AEC3C 7F07C24C 3C058007 */ lui $a1, %hi(gBondViewCutscene) # $a1, 0x8007 -/* 0AEC40 7F07C250 24A584DC */ addiu $a1, %lo(gBondViewCutscene) # addiu $a1, $a1, -0x7b24 -/* 0AEC44 7F07C254 8CA30000 */ lw $v1, ($a1) -/* 0AEC48 7F07C258 10600064 */ beqz $v1, .L7F07C3EC -/* 0AEC4C 7F07C25C 00000000 */ nop -/* 0AEC50 7F07C260 8C640018 */ lw $a0, 0x18($v1) -/* 0AEC54 7F07C264 3C188006 */ lui $t8, %hi(g_CurrentSetup+0x1C) # $t8, 0x8006 -/* 0AEC58 7F07C268 8FAE0048 */ lw $t6, 0x48($sp) -/* 0AEC5C 7F07C26C 28812710 */ slti $at, $a0, 0x2710 -/* 0AEC60 7F07C270 1020000A */ beqz $at, .L7F07C29C -/* 0AEC64 7F07C274 00046100 */ sll $t4, $a0, 4 -/* 0AEC68 7F07C278 00046880 */ sll $t5, $a0, 2 -/* 0AEC6C 7F07C27C 01A46823 */ subu $t5, $t5, $a0 -/* 0AEC70 7F07C280 000D6880 */ sll $t5, $t5, 2 -/* 0AEC74 7F07C284 3C0F8006 */ lui $t7, %hi(g_CurrentSetup+0x18) # $t7, 0x8006 -/* 0AEC78 7F07C288 8DEF4C58 */ lw $t7, %lo(g_CurrentSetup+0x18)($t7) -/* 0AEC7C 7F07C28C 01A46823 */ subu $t5, $t5, $a0 -/* 0AEC80 7F07C290 000D6880 */ sll $t5, $t5, 2 -/* 0AEC84 7F07C294 10000008 */ b .L7F07C2B8 -/* 0AEC88 7F07C298 01AF1021 */ addu $v0, $t5, $t7 -.L7F07C29C: -/* 0AEC8C 7F07C29C 8F184C5C */ lw $t8, %lo(g_CurrentSetup+0x1C)($t8) -/* 0AEC90 7F07C2A0 01846021 */ addu $t4, $t4, $a0 -/* 0AEC94 7F07C2A4 000C6080 */ sll $t4, $t4, 2 -/* 0AEC98 7F07C2A8 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0AEC9C 7F07C2AC 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0AECA0 7F07C2B0 01981021 */ addu $v0, $t4, $t8 -/* 0AECA4 7F07C2B4 00411021 */ addu $v0, $v0, $at -.L7F07C2B8: -/* 0AECA8 7F07C2B8 C4640004 */ lwc1 $f4, 4($v1) -/* 0AECAC 7F07C2BC 8FA40058 */ lw $a0, 0x58($sp) -/* 0AECB0 7F07C2C0 3C188007 */ lui $t8, %hi(dword_CODE_bss_80079A18) # $t8, 0x8007 -/* 0AECB4 7F07C2C4 E5C40000 */ swc1 $f4, ($t6) -/* 0AECB8 7F07C2C8 8CB90000 */ lw $t9, ($a1) -/* 0AECBC 7F07C2CC 24010001 */ li $at, 1 -/* 0AECC0 7F07C2D0 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AECC4 7F07C2D4 C7260008 */ lwc1 $f6, 8($t9) -/* 0AECC8 7F07C2D8 25298BC0 */ addiu $t1, %lo(g_CurrentPlayer) # addiu $t1, $t1, -0x7440 -/* 0AECCC 7F07C2DC E5C60004 */ swc1 $f6, 4($t6) -/* 0AECD0 7F07C2E0 8CAD0000 */ lw $t5, ($a1) -/* 0AECD4 7F07C2E4 C5A8000C */ lwc1 $f8, 0xc($t5) -/* 0AECD8 7F07C2E8 E5C80008 */ swc1 $f8, 8($t6) -/* 0AECDC 7F07C2EC 8FAC0054 */ lw $t4, 0x54($sp) -/* 0AECE0 7F07C2F0 8C4F0028 */ lw $t7, 0x28($v0) -/* 0AECE4 7F07C2F4 AD8F0000 */ sw $t7, ($t4) -/* 0AECE8 7F07C2F8 C44A0000 */ lwc1 $f10, ($v0) -/* 0AECEC 7F07C2FC E48A0000 */ swc1 $f10, ($a0) -/* 0AECF0 7F07C300 C4440004 */ lwc1 $f4, 4($v0) -/* 0AECF4 7F07C304 E4840004 */ swc1 $f4, 4($a0) -/* 0AECF8 7F07C308 C4460008 */ lwc1 $f6, 8($v0) -/* 0AECFC 7F07C30C E4860008 */ swc1 $f6, 8($a0) -/* 0AED00 7F07C310 8F1884F8 */ lw $t8, %lo(dword_CODE_bss_80079A18)($t8) -/* 0AED04 7F07C314 5701000D */ bnel $t8, $at, .L7F07C34C -/* 0AED08 7F07C318 8CAC0000 */ lw $t4, ($a1) -/* 0AED0C 7F07C31C 8D390000 */ lw $t9, ($t1) -/* 0AED10 7F07C320 8FAD004C */ lw $t5, 0x4c($sp) -/* 0AED14 7F07C324 C72803C4 */ lwc1 $f8, 0x3c4($t9) -/* 0AED18 7F07C328 E5A80000 */ swc1 $f8, ($t5) -/* 0AED1C 7F07C32C 8D2E0000 */ lw $t6, ($t1) -/* 0AED20 7F07C330 C5CA03C8 */ lwc1 $f10, 0x3c8($t6) -/* 0AED24 7F07C334 E5AA0004 */ swc1 $f10, 4($t5) -/* 0AED28 7F07C338 8D2F0000 */ lw $t7, ($t1) -/* 0AED2C 7F07C33C C5E403CC */ lwc1 $f4, 0x3cc($t7) -/* 0AED30 7F07C340 100000B0 */ b .L7F07C604 -/* 0AED34 7F07C344 E5A40008 */ swc1 $f4, 8($t5) -/* 0AED38 7F07C348 8CAC0000 */ lw $t4, ($a1) -.L7F07C34C: -/* 0AED3C 7F07C34C 0FC16068 */ jal cosf -/* 0AED40 7F07C350 C58C0014 */ lwc1 $f12, 0x14($t4) -/* 0AED44 7F07C354 3C188007 */ lui $t8, %hi(gBondViewCutscene) # $t8, 0x8007 -/* 0AED48 7F07C358 8F1884DC */ lw $t8, %lo(gBondViewCutscene)($t8) -/* 0AED4C 7F07C35C E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AED50 7F07C360 0FC1606B */ jal sinf -/* 0AED54 7F07C364 C70C0010 */ lwc1 $f12, 0x10($t8) -/* 0AED58 7F07C368 C7A6001C */ lwc1 $f6, 0x1c($sp) -/* 0AED5C 7F07C36C 8FB90048 */ lw $t9, 0x48($sp) -/* 0AED60 7F07C370 8FAE004C */ lw $t6, 0x4c($sp) -/* 0AED64 7F07C374 46060202 */ mul.s $f8, $f0, $f6 -/* 0AED68 7F07C378 C72A0000 */ lwc1 $f10, ($t9) -/* 0AED6C 7F07C37C 3C0F8007 */ lui $t7, %hi(gBondViewCutscene) # $t7, 0x8007 -/* 0AED70 7F07C380 460A4100 */ add.s $f4, $f8, $f10 -/* 0AED74 7F07C384 E5C40000 */ swc1 $f4, ($t6) -/* 0AED78 7F07C388 8DEF84DC */ lw $t7, %lo(gBondViewCutscene)($t7) -/* 0AED7C 7F07C38C 0FC1606B */ jal sinf -/* 0AED80 7F07C390 C5EC0014 */ lwc1 $f12, 0x14($t7) -/* 0AED84 7F07C394 8FAD0048 */ lw $t5, 0x48($sp) -/* 0AED88 7F07C398 8FAC004C */ lw $t4, 0x4c($sp) -/* 0AED8C 7F07C39C 3C188007 */ lui $t8, %hi(gBondViewCutscene) # $t8, 0x8007 -/* 0AED90 7F07C3A0 C5A60004 */ lwc1 $f6, 4($t5) -/* 0AED94 7F07C3A4 46060200 */ add.s $f8, $f0, $f6 -/* 0AED98 7F07C3A8 E5880004 */ swc1 $f8, 4($t4) -/* 0AED9C 7F07C3AC 8F1884DC */ lw $t8, %lo(gBondViewCutscene)($t8) -/* 0AEDA0 7F07C3B0 0FC16068 */ jal cosf -/* 0AEDA4 7F07C3B4 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0AEDA8 7F07C3B8 3C198007 */ lui $t9, %hi(gBondViewCutscene) # $t9, 0x8007 -/* 0AEDAC 7F07C3BC 8F3984DC */ lw $t9, %lo(gBondViewCutscene)($t9) -/* 0AEDB0 7F07C3C0 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AEDB4 7F07C3C4 0FC16068 */ jal cosf -/* 0AEDB8 7F07C3C8 C72C0010 */ lwc1 $f12, 0x10($t9) -/* 0AEDBC 7F07C3CC C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0AEDC0 7F07C3D0 8FAE0048 */ lw $t6, 0x48($sp) -/* 0AEDC4 7F07C3D4 8FAF004C */ lw $t7, 0x4c($sp) -/* 0AEDC8 7F07C3D8 46040182 */ mul.s $f6, $f0, $f4 -/* 0AEDCC 7F07C3DC C5CA0008 */ lwc1 $f10, 8($t6) -/* 0AEDD0 7F07C3E0 46065201 */ sub.s $f8, $f10, $f6 -/* 0AEDD4 7F07C3E4 10000087 */ b .L7F07C604 -/* 0AEDD8 7F07C3E8 E5E80008 */ swc1 $f8, 8($t7) -.L7F07C3EC: -/* 0AEDDC 7F07C3EC 3C028007 */ lui $v0, %hi(dword_CODE_bss_80079A14) # $v0, 0x8007 -/* 0AEDE0 7F07C3F0 8C4284F4 */ lw $v0, %lo(dword_CODE_bss_80079A14)($v0) -/* 0AEDE4 7F07C3F4 3C198006 */ lui $t9, %hi(g_CurrentSetup+0x1C) # $t9, 0x8006 -/* 0AEDE8 7F07C3F8 8FAF0054 */ lw $t7, 0x54($sp) -/* 0AEDEC 7F07C3FC 28412710 */ slti $at, $v0, 0x2710 -/* 0AEDF0 7F07C400 1020000A */ beqz $at, .L7F07C42C -/* 0AEDF4 7F07C404 0002C100 */ sll $t8, $v0, 4 -/* 0AEDF8 7F07C408 00026880 */ sll $t5, $v0, 2 -/* 0AEDFC 7F07C40C 01A26823 */ subu $t5, $t5, $v0 -/* 0AEE00 7F07C410 000D6880 */ sll $t5, $t5, 2 -/* 0AEE04 7F07C414 3C0C8006 */ lui $t4, %hi(g_CurrentSetup+0x18) # $t4, 0x8006 -/* 0AEE08 7F07C418 8D8C4C58 */ lw $t4, %lo(g_CurrentSetup+0x18)($t4) -/* 0AEE0C 7F07C41C 01A26823 */ subu $t5, $t5, $v0 -/* 0AEE10 7F07C420 000D6880 */ sll $t5, $t5, 2 -/* 0AEE14 7F07C424 10000008 */ b .L7F07C448 -/* 0AEE18 7F07C428 01AC1821 */ addu $v1, $t5, $t4 -.L7F07C42C: -/* 0AEE1C 7F07C42C 8F394C5C */ lw $t9, %lo(g_CurrentSetup+0x1C)($t9) -/* 0AEE20 7F07C430 0302C021 */ addu $t8, $t8, $v0 -/* 0AEE24 7F07C434 0018C080 */ sll $t8, $t8, 2 -/* 0AEE28 7F07C438 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0AEE2C 7F07C43C 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0AEE30 7F07C440 03191821 */ addu $v1, $t8, $t9 -/* 0AEE34 7F07C444 00611821 */ addu $v1, $v1, $at -.L7F07C448: -/* 0AEE38 7F07C448 8C6E0028 */ lw $t6, 0x28($v1) -/* 0AEE3C 7F07C44C 8FA40058 */ lw $a0, 0x58($sp) -/* 0AEE40 7F07C450 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEE44 7F07C454 ADEE0000 */ sw $t6, ($t7) -/* 0AEE48 7F07C458 C4640000 */ lwc1 $f4, ($v1) -/* 0AEE4C 7F07C45C 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEE50 7F07C460 E4840000 */ swc1 $f4, ($a0) -/* 0AEE54 7F07C464 C46A0004 */ lwc1 $f10, 4($v1) -/* 0AEE58 7F07C468 E48A0004 */ swc1 $f10, 4($a0) -/* 0AEE5C 7F07C46C C4660008 */ lwc1 $f6, 8($v1) -/* 0AEE60 7F07C470 E4860008 */ swc1 $f6, 8($a0) -/* 0AEE64 7F07C474 AFA30020 */ sw $v1, 0x20($sp) -/* 0AEE68 7F07C478 0FC16068 */ jal cosf -/* 0AEE6C 7F07C47C C44C0000 */ lwc1 $f12, ($v0) -/* 0AEE70 7F07C480 8FA30020 */ lw $v1, 0x20($sp) -/* 0AEE74 7F07C484 8FAD004C */ lw $t5, 0x4c($sp) -/* 0AEE78 7F07C488 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A10) # $at, 0x8007 -/* 0AEE7C 7F07C48C C4680000 */ lwc1 $f8, ($v1) -/* 0AEE80 7F07C490 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEE84 7F07C494 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEE88 7F07C498 E5A80000 */ swc1 $f8, ($t5) -/* 0AEE8C 7F07C49C C42A84F0 */ lwc1 $f10, %lo(flt_CODE_bss_80079A10)($at) -/* 0AEE90 7F07C4A0 C4640004 */ lwc1 $f4, 4($v1) -/* 0AEE94 7F07C4A4 460A2180 */ add.s $f6, $f4, $f10 -/* 0AEE98 7F07C4A8 E5A60004 */ swc1 $f6, 4($t5) -/* 0AEE9C 7F07C4AC 0FC1606B */ jal sinf -/* 0AEEA0 7F07C4B0 C44C0000 */ lwc1 $f12, ($v0) -/* 0AEEA4 7F07C4B4 8FA30020 */ lw $v1, 0x20($sp) -/* 0AEEA8 7F07C4B8 8FAC004C */ lw $t4, 0x4c($sp) -/* 0AEEAC 7F07C4BC 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEEB0 7F07C4C0 C4680008 */ lwc1 $f8, 8($v1) -/* 0AEEB4 7F07C4C4 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEEB8 7F07C4C8 E5880008 */ swc1 $f8, 8($t4) -/* 0AEEBC 7F07C4CC 0FC1606B */ jal sinf -/* 0AEEC0 7F07C4D0 C44C0000 */ lwc1 $f12, ($v0) -/* 0AEEC4 7F07C4D4 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEEC8 7F07C4D8 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEECC 7F07C4DC C44C0000 */ lwc1 $f12, ($v0) -/* 0AEED0 7F07C4E0 0FC16068 */ jal cosf -/* 0AEED4 7F07C4E4 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AEED8 7F07C4E8 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A08) # $at, 0x8007 -/* 0AEEDC 7F07C4EC C42A84E8 */ lwc1 $f10, %lo(flt_CODE_bss_80079A08)($at) -/* 0AEEE0 7F07C4F0 C7A4001C */ lwc1 $f4, 0x1c($sp) -/* 0AEEE4 7F07C4F4 8FA30020 */ lw $v1, 0x20($sp) -/* 0AEEE8 7F07C4F8 8FB80048 */ lw $t8, 0x48($sp) -/* 0AEEEC 7F07C4FC 460A2182 */ mul.s $f6, $f4, $f10 -/* 0AEEF0 7F07C500 C4680000 */ lwc1 $f8, ($v1) -/* 0AEEF4 7F07C504 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A10) # $at, 0x8007 -/* 0AEEF8 7F07C508 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEEFC 7F07C50C 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEF00 7F07C510 46064100 */ add.s $f4, $f8, $f6 -/* 0AEF04 7F07C514 E7040000 */ swc1 $f4, ($t8) -/* 0AEF08 7F07C518 C42884F0 */ lwc1 $f8, %lo(flt_CODE_bss_80079A10)($at) -/* 0AEF0C 7F07C51C C46A0004 */ lwc1 $f10, 4($v1) -/* 0AEF10 7F07C520 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A0C) # $at, 0x8007 -/* 0AEF14 7F07C524 C42484EC */ lwc1 $f4, %lo(flt_CODE_bss_80079A0C)($at) -/* 0AEF18 7F07C528 46085180 */ add.s $f6, $f10, $f8 -/* 0AEF1C 7F07C52C 46043280 */ add.s $f10, $f6, $f4 -/* 0AEF20 7F07C530 E70A0004 */ swc1 $f10, 4($t8) -/* 0AEF24 7F07C534 0FC16068 */ jal cosf -/* 0AEF28 7F07C538 C44C0000 */ lwc1 $f12, ($v0) -/* 0AEF2C 7F07C53C 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEF30 7F07C540 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEF34 7F07C544 C44C0000 */ lwc1 $f12, ($v0) -/* 0AEF38 7F07C548 0FC1606B */ jal sinf -/* 0AEF3C 7F07C54C E7A0001C */ swc1 $f0, 0x1c($sp) -/* 0AEF40 7F07C550 3C018005 */ lui $at, %hi(D_8005505C) # $at, 0x8005 -/* 0AEF44 7F07C554 C42CAC2C */ lwc1 $f12, %lo(D_8005505C)($at) -/* 0AEF48 7F07C558 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A08) # $at, 0x8007 -/* 0AEF4C 7F07C55C C42684E8 */ lwc1 $f6, %lo(flt_CODE_bss_80079A08)($at) -/* 0AEF50 7F07C560 C7A8001C */ lwc1 $f8, 0x1c($sp) -/* 0AEF54 7F07C564 8FA30020 */ lw $v1, 0x20($sp) -/* 0AEF58 7F07C568 8FB90048 */ lw $t9, 0x48($sp) -/* 0AEF5C 7F07C56C 46064102 */ mul.s $f4, $f8, $f6 -/* 0AEF60 7F07C570 C46A0008 */ lwc1 $f10, 8($v1) -/* 0AEF64 7F07C574 3C018007 */ lui $at, %hi(flt_CODE_bss_80079A04) # $at, 0x8007 -/* 0AEF68 7F07C578 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079A00) # $v0, 0x8007 -/* 0AEF6C 7F07C57C 244284E0 */ addiu $v0, %lo(flt_CODE_bss_80079A00) # addiu $v0, $v0, -0x7b20 -/* 0AEF70 7F07C580 44807000 */ mtc1 $zero, $f14 -/* 0AEF74 7F07C584 46045200 */ add.s $f8, $f10, $f4 -/* 0AEF78 7F07C588 E7280008 */ swc1 $f8, 8($t9) -/* 0AEF7C 7F07C58C C42684E4 */ lwc1 $f6, %lo(flt_CODE_bss_80079A04)($at) -/* 0AEF80 7F07C590 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0AEF84 7F07C594 C42A1004 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 0AEF88 7F07C598 C4480000 */ lwc1 $f8, ($v0) -/* 0AEF8C 7F07C59C 460A3102 */ mul.s $f4, $f6, $f10 -/* 0AEF90 7F07C5A0 46044180 */ add.s $f6, $f8, $f4 -/* 0AEF94 7F07C5A4 E4460000 */ swc1 $f6, ($v0) -/* 0AEF98 7F07C5A8 C4420000 */ lwc1 $f2, ($v0) -/* 0AEF9C 7F07C5AC 4602603E */ c.le.s $f12, $f2 -/* 0AEFA0 7F07C5B0 00000000 */ nop -/* 0AEFA4 7F07C5B4 45020009 */ bc1fl .L7F07C5DC -/* 0AEFA8 7F07C5B8 460E103C */ c.lt.s $f2, $f14 -/* 0AEFAC 7F07C5BC 460C1281 */ sub.s $f10, $f2, $f12 -.L7F07C5C0: -/* 0AEFB0 7F07C5C0 E44A0000 */ swc1 $f10, ($v0) -/* 0AEFB4 7F07C5C4 C4420000 */ lwc1 $f2, ($v0) -/* 0AEFB8 7F07C5C8 4602603E */ c.le.s $f12, $f2 -/* 0AEFBC 7F07C5CC 00000000 */ nop -/* 0AEFC0 7F07C5D0 4503FFFB */ bc1tl .L7F07C5C0 -/* 0AEFC4 7F07C5D4 460C1281 */ sub.s $f10, $f2, $f12 -/* 0AEFC8 7F07C5D8 460E103C */ c.lt.s $f2, $f14 -.L7F07C5DC: -/* 0AEFCC 7F07C5DC 00000000 */ nop -/* 0AEFD0 7F07C5E0 45020009 */ bc1fl .L7F07C608 -/* 0AEFD4 7F07C5E4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0AEFD8 7F07C5E8 460C1200 */ add.s $f8, $f2, $f12 -.L7F07C5EC: -/* 0AEFDC 7F07C5EC E4480000 */ swc1 $f8, ($v0) -/* 0AEFE0 7F07C5F0 C4420000 */ lwc1 $f2, ($v0) -/* 0AEFE4 7F07C5F4 460E103C */ c.lt.s $f2, $f14 -/* 0AEFE8 7F07C5F8 00000000 */ nop -/* 0AEFEC 7F07C5FC 4503FFFB */ bc1tl .L7F07C5EC -/* 0AEFF0 7F07C600 460C1200 */ add.s $f8, $f2, $f12 -.L7F07C604: -/* 0AEFF4 7F07C604 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07C608: -/* 0AEFF8 7F07C608 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0AEFFC 7F07C60C 03E00008 */ jr $ra -/* 0AF000 7F07C610 00000000 */ nop -) + if (ptr_random06cam_entry->lang20.lang_ptr != NULL) + { + if ((D_800364A4 < 300.0f) && ((D_800364A4 + g_GlobalTimerDelta) >= 300.0f)) + { +#if defined(VERSION_US) + hudmsgBottomShow(ptr_random06cam_entry->lang20.lang_ptr); +#else + hudmsgBottomShow(ptr_random06cam_entry->lang20.lang_ptr, ptrFontZurichBoldChars, ptrFontZurichBold); #endif + } + + if (D_800364A4 > 480.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + } + else if (D_800364A4 > 300.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + D_800364A4 += g_GlobalTimerDelta; -#endif - + if ((lvlGetControlsLockedFlag() == 0) + && (buttons & ~oldbuttons & (CONT_A | B_BUTTON | Z_TRIG | START_BUTTON | CONT_R | CONT_L))) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + } + else if (g_CurrentPlayer->colourfadetimemax60 < 0.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } -//being bondmove.c per pd + pos->f[0] = ptr_random06cam_entry->unk04.fval; + pos->f[1] = ptr_random06cam_entry->unk08.fval; + pos->f[2] = ptr_random06cam_entry->unk0C.fval; -void sub_GAME_7F07C540(s32 arg0) -{ - g_CurrentPlayer->field_42c = arg0; -} + pos2->f[0] = pos->f[0] + (cosf(ptr_random06cam_entry->unk14.fval) * sinf(ptr_random06cam_entry->unk10.fval)); + pos2->f[1] = pos->f[1] + sinf(ptr_random06cam_entry->unk14.fval); + pos2->f[2] = pos->f[2] - (cosf(ptr_random06cam_entry->unk14.fval) * cosf(ptr_random06cam_entry->unk10.fval)); + + p = &g_CurrentSetup.pads[ptr_random06cam_entry->unk18]; + setupPad = p; + *stan = setupPad->stan; + + arg6->f[0] = setupPad->pos.f[0]; + arg6->f[1] = setupPad->pos.f[1]; + arg6->f[2] = setupPad->pos.f[2]; + } + else if (g_CameraMode == CAMERAMODE_MP) + { + /** + * CAMERAMODE_MP: Perfect Dark method playerTickMpSwirl + */ + if (sub_GAME_7F09B4D8(get_cur_playernum()) == 0) + { + for (i2=0; i2 110.0f) + { + g_MpSwirlRotateSpeed -= 0.1f; + } + + g_MpSwirlAngleDegrees += g_MpSwirlRotateSpeed; + } +#if defined(VERSION_EU) + if (g_MpSwirlAngleDegrees >= 179.5f) +#else + else +#endif + { + g_MpSwirlAngleDegrees = 180.0f; + } + + if (g_MpSwirlAngleDegrees > 80.0f) + { + if (g_MpSwirlDistance > 60.0f) + { + g_MpSwirlForwardSpeed -= 0.1f; + } + else + { + g_MpSwirlForwardSpeed += 0.015f; + } + + g_MpSwirlDistance += g_MpSwirlForwardSpeed; + + if (g_MpSwirlDistance < 1.0f) + { + g_MpSwirlDistance = 1.0f; + } + } + } + } -void set_BONDdata_lookahead_setting(s32 arg0) -{ - g_CurrentPlayer->automovecentreenabled = arg0; -} + sp38 = ((g_MpSwirlAngleDegrees - g_CurrentPlayer->vv_theta) * M_PI_F) / 180.0f; + + pos->f[0] = g_CurrentPlayer->field_488.pos.f[0] + (sinf(sp38) * g_MpSwirlDistance); + pos->f[1] = g_CurrentPlayer->field_488.pos.f[1] + (g_MpSwirlDistance * 0.08f); + pos->f[2] = g_CurrentPlayer->field_488.pos.f[2] + (cosf(sp38) * g_MpSwirlDistance); -s32 get_BONDdata_lookahead_setting(void) -{ - return g_CurrentPlayer->automovecentreenabled; -} + pos2->f[0] = g_CurrentPlayer->field_488.pos.f[0]; + pos2->f[1] = g_CurrentPlayer->field_488.pos.f[1]; + pos2->f[2] = g_CurrentPlayer->field_488.pos.f[2]; + + *stan = g_CurrentPlayer->prop->stan; + + arg6->f[0] = g_CurrentPlayer->field_488.pos.f[0]; + arg6->f[1] = g_CurrentPlayer->field_488.pos.f[1] + (g_MpSwirlDistance * 0.08f); + arg6->f[2] = g_CurrentPlayer->field_488.pos.f[2]; -void set_BONDdata_autoaim_y(s32 param_1) -{ - g_CurrentPlayer->autoyaimenabled = param_1; -} +#if defined(VERSION_EU) + if (((sub_GAME_7F09B4D8(get_cur_playernum()) + 1) == getPlayerCount()) && (g_MpSwirlDistance < 5.0f)) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } +#else + if (g_MpSwirlDistance < 5.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } +#endif + } + else if (g_CameraMode == CAMERAMODE_SWIRL) + { + D_800364A4 += g_GlobalTimerDelta; + + while (g_IntroSwirl[D_800364A8].unk18.fval <= D_800364A4) + { + if (!(g_IntroSwirl[D_800364A8 + 3].unk04 & 1)) + { + D_800364A4 -= g_IntroSwirl[D_800364A8].unk18.fval; + D_800364A8++; + } + else + { + D_800364A4 = g_IntroSwirl[D_800364A8].unk18.fval; + g_CameraAfterCinema = CAMERAMODE_INTRO; + break; + } + } + + sp30 += (g_IntroSwirl[D_800364A8].unk18.fval - D_800364A4); + for (i = D_800364A8 + 1; !(g_IntroSwirl[i+2].unk04 & 1); i++) + { + sp30 += g_IntroSwirl[i].unk18.fval; + } + if ((sp30 < 30.0f) && ((sp30 + g_GlobalTimerDelta) >= 30.0f)) + { + currentPlayerStartChrFade(30.0f, 0.0f); + } + if (D_8003649C != 0) + { + if (currentPlayerIsFadeComplete() != 0) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + } + if ((sp30 > 60.0f) && (D_8003649C == 0)) + { + if ((lvlGetControlsLockedFlag() == 0) + && (buttons & ~oldbuttons & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON | L_TRIG | R_TRIG))) + { + D_8003649C = 1; + currentPlayerSetFadeColour(0, 0, 0, g_CurrentPlayer->colourscreenfrac); + + if (currentPlayerIsFadeComplete() != 0) + { + currentPlayerSetFadeFrac(60.0f, 1.0f); + } + else + { + currentPlayerSetFadeFrac(g_CurrentPlayer->colourfadetime60, 1.0f); + } + } + } + sub_GAME_7F07B2A0(D_800364A8, D_800364A4, pos, pos2); -/** - * Address 0x7F07C580. - */ -s32 get_BONDdata_autoaim_y(void) -{ - if (getPlayerCount() == 1) - { - return g_CurrentPlayer->autoyaimenabled; + if (g_IntroSwirl[D_800364A8].unk1C >= 0) + { + p = &g_CurrentSetup.pads[g_IntroSwirl[D_800364A8].unk1C]; + setupPad = p; + *stan = setupPad->stan; + + arg6->f[0] = setupPad->pos.f[0]; + arg6->f[1] = setupPad->pos.f[1]; + arg6->f[2] = setupPad->pos.f[2]; + } + else + { + *stan = g_CurrentPlayer->field_488.current_tile_ptr; + arg6->f[0] = g_CurrentPlayer->field_488.collision_position.f[0]; + arg6->f[1] = g_CurrentPlayer->field_488.collision_position.f[1]; + arg6->f[2] = g_CurrentPlayer->field_488.collision_position.f[2]; + } + } + else if ((g_CameraMode == CAMERAMODE_DEATH_CAM_FIRST) || (g_CameraMode == CAMERAMODE_DEATH_CAM_SECOND)) + { + if (g_CameraMode == CAMERAMODE_DEATH_CAM_FIRST) + { + D_800364A4 += g_GlobalTimerDelta; + + if (g_CurrentPlayer->ptr_char_objectinstance != NULL) + { + if (objecthandlerGetModelField28((Model *) g_CurrentPlayer->ptr_char_objectinstance) + >= sub_GAME_7F06F5C4((Model *) g_CurrentPlayer->ptr_char_objectinstance)) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + } + else if (D_800364A4 >= 180.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + + if ((buttons & ~oldbuttons & (CONT_A | B_BUTTON | Z_TRIG | START_BUTTON)) + && (g_CurrentPlayer->bonddead != 0) + && (g_CurrentPlayer->redbloodfinished != 0) + && (g_CurrentPlayer->deathanimfinished != 0)) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + D_80036510 = CAMERAMODE_FADESWIRL; + } + } + else if (g_CameraMode == CAMERAMODE_DEATH_CAM_SECOND) + { + D_800364A4 += g_GlobalTimerDelta; + + if (g_CurrentPlayer->colourfadetimemax60 < 0.0f) + { + g_CameraAfterCinema = CAMERAMODE_INTRO; + } + + if ((buttons & ~oldbuttons & (CONT_A | B_BUTTON | Z_TRIG | START_BUTTON)) + && (g_CurrentPlayer->bonddead != 0) + && (g_CurrentPlayer->redbloodfinished != 0) + && (g_CurrentPlayer->deathanimfinished != 0)) + { + D_80036510 = CAMERAMODE_FADESWIRL; + } + } + + pos->f[0] = flt_CODE_bss_800799E8.f[0]; + pos->f[1] = flt_CODE_bss_800799E8.f[1]; + pos->f[2] = flt_CODE_bss_800799E8.f[2]; + + if (dword_CODE_bss_800799F4 == g_CurrentPlayer->prop) + { + pos2->f[0] = g_CurrentPlayer->field_3C4; + pos2->f[1] = g_CurrentPlayer->field_3C8; + pos2->f[2] = g_CurrentPlayer->field_3CC; + } + else + { + pos2->f[0] = dword_CODE_bss_800799F4->pos.f[0]; + pos2->f[1] = dword_CODE_bss_800799F4->pos.f[1]; + pos2->f[2] = dword_CODE_bss_800799F4->pos.f[2]; + } + + *stan = g_CurrentPlayer->field_488.current_tile_ptr; + + arg6->f[0] = g_CurrentPlayer->field_488.collision_position.f[0]; + arg6->f[1] = g_CurrentPlayer->field_488.collision_position.f[1]; + arg6->f[2] = g_CurrentPlayer->field_488.collision_position.f[2]; + } + else if (g_CameraMode == CAMERAMODE_POSEND) + { + if (dword_CODE_bss_800799F8 != NULL) + { + pos->f[0] = dword_CODE_bss_800799F8->pos.f[0]; + pos->f[1] = dword_CODE_bss_800799F8->pos.f[1]; + pos->f[2] = dword_CODE_bss_800799F8->pos.f[2]; + + pos2->f[0] = g_CurrentPlayer->field_3C4; + pos2->f[1] = g_CurrentPlayer->field_3C8; + pos2->f[2] = g_CurrentPlayer->field_3CC; + + *stan = dword_CODE_bss_800799F8->stan; + + arg6->f[0] = dword_CODE_bss_800799F8->pos.f[0]; + arg6->f[1] = dword_CODE_bss_800799F8->pos.f[1]; + arg6->f[2] = dword_CODE_bss_800799F8->pos.f[2]; + + return; + } + + if (gBondViewCutscene != NULL) + { + if (isNotBoundPad(gBondViewCutscene->pad)) + { + p = &g_CurrentSetup.pads[gBondViewCutscene->pad]; + } + else + { + p = &g_CurrentSetup.boundpads[getBoundPadNum(gBondViewCutscene->pad)]; + } + + pos->f[0] = gBondViewCutscene->pos.f[0]; + pos->f[1] = gBondViewCutscene->pos.f[1]; + pos->f[2] = gBondViewCutscene->pos.f[2]; + + setupPad = p; + *stan = setupPad->stan; + + arg6->f[0] = setupPad->pos.f[0]; + arg6->f[1] = setupPad->pos.f[1]; + arg6->f[2] = setupPad->pos.f[2]; + + if (dword_CODE_bss_80079A18 == CAMERAMODE_INTRO) + { + pos2->f[0] = g_CurrentPlayer->field_3C4; + pos2->f[1] = g_CurrentPlayer->field_3C8; + pos2->f[2] = g_CurrentPlayer->field_3CC; + } + else + { + pos2->f[0] = pos->f[0] + (cosf(gBondViewCutscene->verta) * sinf(gBondViewCutscene->theta)); + pos2->f[1] = pos->f[1] + sinf(gBondViewCutscene->verta); + pos2->f[2] = pos->f[2] - (cosf(gBondViewCutscene->verta) * cosf(gBondViewCutscene->theta)); + } + + return; + } + + if (isNotBoundPad(dword_CODE_bss_80079A14)) + { + setupPad = &g_CurrentSetup.pads[dword_CODE_bss_80079A14]; + } + else + { + setupPad = (struct PadRecord*)&g_CurrentSetup.boundpads[getBoundPadNum(dword_CODE_bss_80079A14)]; + } + + *stan = setupPad->stan; + + arg6->f[0] = setupPad->pos.f[0]; + arg6->f[1] = setupPad->pos.f[1]; + arg6->f[2] = setupPad->pos.f[2]; + + pos2->f[0] = setupPad->pos.f[0] + cosf(flt_CODE_bss_80079A00) * 0.0f; + pos2->f[1] = setupPad->pos.f[1] + flt_CODE_bss_80079A10; + pos2->f[2] = setupPad->pos.f[2] + sinf(flt_CODE_bss_80079A00) * 0.0f; + + pos->f[0] = setupPad->pos.f[0] + (sinf(flt_CODE_bss_80079A00) * flt_CODE_bss_80079A08) + cosf(flt_CODE_bss_80079A00) * 0.0f; + pos->f[1] = setupPad->pos.f[1] + flt_CODE_bss_80079A10 + flt_CODE_bss_80079A0C; + pos->f[2] = setupPad->pos.f[2] + (cosf(flt_CODE_bss_80079A00) * flt_CODE_bss_80079A08) + sinf(flt_CODE_bss_80079A00) * 0.0f; + + flt_CODE_bss_80079A00 += flt_CODE_bss_80079A04 * g_GlobalTimerDelta; + + while (flt_CODE_bss_80079A00 >= M_TAU_F) + { + flt_CODE_bss_80079A00 -= M_TAU_F; + } + + while (flt_CODE_bss_80079A00 < 0.0f) + { + flt_CODE_bss_80079A00 += M_TAU_F; + } + } +} + + + +//begin bondmove.c per pd + +void sub_GAME_7F07C540(s32 arg0) +{ + g_CurrentPlayer->field_42c = arg0; +} + +void set_BONDdata_lookahead_setting(s32 arg0) +{ + g_CurrentPlayer->automovecentreenabled = arg0; +} + +s32 get_BONDdata_lookahead_setting(void) +{ + return g_CurrentPlayer->automovecentreenabled; +} + +void set_BONDdata_autoaim_y(s32 param_1) +{ + g_CurrentPlayer->autoyaimenabled = param_1; +} + + + + + + +/** + * Address 0x7F07C580. + */ +s32 get_BONDdata_autoaim_y(void) +{ + if (getPlayerCount() == 1) + { + return g_CurrentPlayer->autoyaimenabled; } return (s32) g_playerPerm->autoaim; } @@ -8649,23 +5616,23 @@ s32 get_BONDdata_is_aiming(void) { /** * Updates autoyaimtime60 by g_ClockTimer. - * Will update player->autoaimy if new autoyaimtime60 < 0 or auto_aim_time != g_CurrentPlayer->autoyaimtime. + * Will update player->autoaimy if new autoyaimtime60 < 0 or autoaim_target != g_CurrentPlayer->autoaim_target_y. * * Address 0x7F07C5F0. */ -void bondviewUpdateYAutoAimTime(s32 auto_aim_time, f32 auto_aim_y) +void bondviewUpdateYAutoAimTime(struct PropRecord *autoaim_target, f32 auto_aim_y) { if (g_CurrentPlayer->autoyaimtime60 >= 0) { g_CurrentPlayer->autoyaimtime60 = g_CurrentPlayer->autoyaimtime60 - g_ClockTimer; } - if (auto_aim_time != g_CurrentPlayer->autoyaimtime) + if (autoaim_target != g_CurrentPlayer->autoaim_target_y) { if (g_CurrentPlayer->autoyaimtime60 < 0) { g_CurrentPlayer->autoyaimtime60 = BONDVIEW_AUTOAIM_TIME; - g_CurrentPlayer->autoyaimtime = auto_aim_time; + g_CurrentPlayer->autoaim_target_y = autoaim_target; } else { @@ -8717,23 +5684,23 @@ int redirect_get_BONDdata_autoaim_x(void) { /** * Updates autoxaimtime60 by g_ClockTimer. - * Will update player->autoaimx if new autoxaimtime60 < 0 or auto_aim_time != g_CurrentPlayer->autoxaimtime. + * Will update player->autoaimx if new autoxaimtime60 < 0 or autoaim_target_x != g_CurrentPlayer->autoaim_target_x. * * Address 0x7F07C6C8. */ -void bondviewUpdateXAutoAimTime(s32 auto_aim_time, f32 auto_aim_x) +void bondviewUpdateXAutoAimTime(struct PropRecord *autoaim_target, f32 auto_aim_x) { if (g_CurrentPlayer->autoxaimtime60 >= 0) { g_CurrentPlayer->autoxaimtime60 = g_CurrentPlayer->autoxaimtime60 - g_ClockTimer; } - if (auto_aim_time != g_CurrentPlayer->autoxaimtime) + if (autoaim_target != g_CurrentPlayer->autoaim_target_x) { if (g_CurrentPlayer->autoxaimtime60 < 0) { g_CurrentPlayer->autoxaimtime60 = BONDVIEW_AUTOAIM_TIME; - g_CurrentPlayer->autoxaimtime = auto_aim_time; + g_CurrentPlayer->autoaim_target_x = autoaim_target; } else { @@ -8765,13 +5732,13 @@ void change_player_pos_to_target(struct collision434 *col, coord3d *pos, StandTi col->applied_view.z = 0.0f; col->applied_view2.x = 0.0f; col->applied_view2.z = store_x2 * 0.0f; - col->field_10.x = 0.0f; - col->field_10.y = 0.0f; + col->theta_transform.x = 0.0f; + col->theta_transform.y = 0.0f; col->pos.x = store_x; col->pos3.x = store_x; col->applied_view.x = 1.0f; col->applied_view2.y = 1.0f; - col->field_10.z = 1.0f; + col->theta_transform.z = 1.0f; col->pos.y = store_y; col->pos3.y = store_y; col->pos.z = store_z; @@ -8780,98 +5747,41 @@ void change_player_pos_to_target(struct collision434 *col, coord3d *pos, StandTi } -#ifdef NONMATCHING -void sub_GAME_7F07C7B4(void) { - ? sp24; - - // Node 0 - if (ptr_playerstank != 0) +/** + * US address 7F07C7B4. +*/ +void bondviewTankModelRotationRelated(void) { + struct ObjectRecord *obj; + struct coord3d *sp68; + struct coord3d *sp64; + Mtxf sp24; + ModelNode **temp_v0; + + if (g_PlayerTankProp != NULL) { - // Node 1 - matrix_4x4_set_rotation_around_y((D_80055060 - g_TankTurretOrientationAngleRad), ptr_playerstank, &sp24, ptr_playerstank->unk4->unk14->unk8->unk8->unk8->unk4, ptr_playerstank->unk4->unk14->unk8->unk8->unk4->unk4); - flt_CODE_bss_800799A8 = (f32) *sp68; - flt_CODE_bss_800799A8.unk4 = (f32) sp68->unk4; - flt_CODE_bss_800799A8.unk8 = (f32) sp68->unk8; - matrix_4x4_rotate_vector_in_place(&sp24, &flt_CODE_bss_800799A8, sp68); - flt_CODE_bss_800799A8 = (f32) (flt_CODE_bss_800799A8 + *sp64); - flt_CODE_bss_800799A8.unk4 = (f32) (flt_CODE_bss_800799A8.unk4 + sp64->unk4); - flt_CODE_bss_800799A8.unk8 = (f32) (flt_CODE_bss_800799A8.unk8 + sp64->unk8); + obj = g_PlayerTankProp->obj; + + /// TODO: Fix Model struct Data type. + temp_v0 = obj->model->obj->Switches; + sp68 = (struct coord3d *)temp_v0[2]->Data; + sp64 = (struct coord3d *)temp_v0[1]->Data; + matrix_4x4_set_rotation_around_y(M_TAU_F - g_TankTurretOrientationAngleRad, &sp24); + g_TankModelPositionOffset.f[0] = sp68->f[0]; + g_TankModelPositionOffset.f[1] = sp68->f[1]; + g_TankModelPositionOffset.f[2] = sp68->f[2]; + mtx4RotateVecInPlace(&sp24, g_TankModelPositionOffset.f); + g_TankModelPositionOffset.f[0] += sp64->f[0]; + g_TankModelPositionOffset.f[1] += sp64->f[1]; + g_TankModelPositionOffset.f[2] += sp64->f[2]; } - // Node 2 - return; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80055060 -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F07C7B4 -/* 0B12E4 7F07C7B4 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0B12E8 7F07C7B8 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) -/* 0B12EC 7F07C7BC 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0B12F0 7F07C7C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B12F4 7F07C7C4 5080002D */ beql $a0, $zero, .L7F07C87C -/* 0B12F8 7F07C7C8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B12FC 7F07C7CC 8C830004 */ lw $v1, 4($a0) -/* 0B1300 7F07C7D0 3C018005 */ lui $at, %hi(D_80055060) -/* 0B1304 7F07C7D4 C4245060 */ lwc1 $f4, %lo(D_80055060)($at) -/* 0B1308 7F07C7D8 8C6E0014 */ lw $t6, 0x14($v1) -/* 0B130C 7F07C7DC 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0B1310 7F07C7E0 C4266474 */ lwc1 $f6, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B1314 7F07C7E4 8DCF0008 */ lw $t7, 8($t6) -/* 0B1318 7F07C7E8 27A50024 */ addiu $a1, $sp, 0x24 -/* 0B131C 7F07C7EC 46062301 */ sub.s $f12, $f4, $f6 -/* 0B1320 7F07C7F0 8DE20008 */ lw $v0, 8($t7) -/* 0B1324 7F07C7F4 8C580008 */ lw $t8, 8($v0) -/* 0B1328 7F07C7F8 8C590004 */ lw $t9, 4($v0) -/* 0B132C 7F07C7FC 8F060004 */ lw $a2, 4($t8) -/* 0B1330 7F07C800 8F270004 */ lw $a3, 4($t9) -/* 0B1334 7F07C804 AFA60068 */ sw $a2, 0x68($sp) -/* 0B1338 7F07C808 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0B133C 7F07C80C AFA70064 */ sw $a3, 0x64($sp) -/* 0B1340 7F07C810 8FA60068 */ lw $a2, 0x68($sp) -/* 0B1344 7F07C814 3C058008 */ lui $a1, %hi(flt_CODE_bss_800799A8) -/* 0B1348 7F07C818 24A599A8 */ addiu $a1, %lo(flt_CODE_bss_800799A8) # addiu $a1, $a1, -0x6658 -/* 0B134C 7F07C81C C4C80000 */ lwc1 $f8, ($a2) -/* 0B1350 7F07C820 27A40024 */ addiu $a0, $sp, 0x24 -/* 0B1354 7F07C824 E4A80000 */ swc1 $f8, ($a1) -/* 0B1358 7F07C828 C4CA0004 */ lwc1 $f10, 4($a2) -/* 0B135C 7F07C82C E4AA0004 */ swc1 $f10, 4($a1) -/* 0B1360 7F07C830 C4D00008 */ lwc1 $f16, 8($a2) -/* 0B1364 7F07C834 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0B1368 7F07C838 E4B00008 */ swc1 $f16, 8($a1) -/* 0B136C 7F07C83C 8FA70064 */ lw $a3, 0x64($sp) -/* 0B1370 7F07C840 3C058008 */ lui $a1, %hi(flt_CODE_bss_800799A8) -/* 0B1374 7F07C844 24A599A8 */ addiu $a1, %lo(flt_CODE_bss_800799A8) # addiu $a1, $a1, -0x6658 -/* 0B1378 7F07C848 C4B20000 */ lwc1 $f18, ($a1) -/* 0B137C 7F07C84C C4E40000 */ lwc1 $f4, ($a3) -/* 0B1380 7F07C850 C4A80004 */ lwc1 $f8, 4($a1) -/* 0B1384 7F07C854 46049180 */ add.s $f6, $f18, $f4 -/* 0B1388 7F07C858 C4B20008 */ lwc1 $f18, 8($a1) -/* 0B138C 7F07C85C E4A60000 */ swc1 $f6, ($a1) -/* 0B1390 7F07C860 C4EA0004 */ lwc1 $f10, 4($a3) -/* 0B1394 7F07C864 460A4400 */ add.s $f16, $f8, $f10 -/* 0B1398 7F07C868 E4B00004 */ swc1 $f16, 4($a1) -/* 0B139C 7F07C86C C4E40008 */ lwc1 $f4, 8($a3) -/* 0B13A0 7F07C870 46049180 */ add.s $f6, $f18, $f4 -/* 0B13A4 7F07C874 E4A60008 */ swc1 $f6, 8($a1) -/* 0B13A8 7F07C878 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07C87C: -/* 0B13AC 7F07C87C 27BD0070 */ addiu $sp, $sp, 0x70 -/* 0B13B0 7F07C880 03E00008 */ jr $ra -/* 0B13B4 7F07C884 00000000 */ nop -) -#endif - - /** * Address 0x7F07C888. */ -void bondviewTankCollisionRelated(struct rect4f *arg0, struct coord3d *arg1, f32 arg2) +void bondviewGetTankCollisionBounds(struct rect4f *tank_collision_bounds, struct coord3d *collision_position, f32 tank_orientation_angle) { ObjectRecord *sp4C; f32 sp48; @@ -8880,32 +5790,32 @@ void bondviewTankCollisionRelated(struct rect4f *arg0, struct coord3d *arg1, f32 f32 sp3C; f32 sp38; f32 sp34; - struct modeldata_unk_pos *temp_v0; + struct ModelRoData_BoundingBoxRecord *bbox; - sp4C = ptr_playerstank->obj; + sp4C = g_PlayerTankProp->obj; - temp_v0 = sub_GAME_7F040078(sp4C); + bbox = chrobjGetBboxFromObjectRecord(sp4C); - sp44 = temp_v0->p1[0] - flt_CODE_bss_800799A8.f[0]; - sp40 = temp_v0->p1[1] - flt_CODE_bss_800799A8.f[0]; + sp44 = bbox->Bounds.xmin - g_TankModelPositionOffset.f[0]; + sp40 = bbox->Bounds.xmax - g_TankModelPositionOffset.f[0]; - sp3C = temp_v0->p3[0] - flt_CODE_bss_800799A8.f[2]; - sp38 = temp_v0->p3[1] - flt_CODE_bss_800799A8.f[2]; + sp3C = bbox->Bounds.zmin - g_TankModelPositionOffset.f[2]; + sp38 = bbox->Bounds.zmax - g_TankModelPositionOffset.f[2]; - sp34 = sp4C->model->scale * cosf(arg2); - sp48 = sp4C->model->scale * sinf(arg2); + sp34 = sp4C->model->scale * cosf(tank_orientation_angle); + sp48 = sp4C->model->scale * sinf(tank_orientation_angle); - arg0->points[0].f[0] = arg1->f[0] + (-sp3C * sp48) + (sp44 * sp34); - arg0->points[0].f[1] = arg1->f[2] + (sp3C * sp34) + (sp44 * sp48); + tank_collision_bounds->points[0].f[0] = collision_position->f[0] + (-sp3C * sp48) + (sp44 * sp34); + tank_collision_bounds->points[0].f[1] = collision_position->f[2] + (sp3C * sp34) + (sp44 * sp48); - arg0->points[1].f[0] = arg1->f[0] + (-sp3C * sp48) + (sp40 * sp34); - arg0->points[1].f[1] = arg1->f[2] + (sp3C * sp34) + (sp40 * sp48); + tank_collision_bounds->points[1].f[0] = collision_position->f[0] + (-sp3C * sp48) + (sp40 * sp34); + tank_collision_bounds->points[1].f[1] = collision_position->f[2] + (sp3C * sp34) + (sp40 * sp48); - arg0->points[2].f[0] = arg1->f[0] + (-sp38 * sp48) + (sp40 * sp34); - arg0->points[2].f[1] = arg1->f[2] + (sp38 * sp34) + (sp40 * sp48); + tank_collision_bounds->points[2].f[0] = collision_position->f[0] + (-sp38 * sp48) + (sp40 * sp34); + tank_collision_bounds->points[2].f[1] = collision_position->f[2] + (sp38 * sp34) + (sp40 * sp48); - arg0->points[3].f[0] = arg1->f[0] + (-sp38 * sp48) + (sp44 * sp34); - arg0->points[3].f[1] = arg1->f[2] + (sp38 * sp34) + (sp44 * sp48); + tank_collision_bounds->points[3].f[0] = collision_position->f[0] + (-sp38 * sp48) + (sp44 * sp34); + tank_collision_bounds->points[3].f[1] = collision_position->f[2] + (sp38 * sp34) + (sp44 * sp48); } @@ -8917,7 +5827,7 @@ s32 bondviewTestLineUnobstructed(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x { s32 temp_v0; - temp_v0 = sub_GAME_7F0B0E24(pTile, p_x, p_z, dest_x, dest_z, objFlags, 0.0f, 1.0f, 0.0f, 1.0f); + temp_v0 = stanTestLineUnobstructed(pTile, p_x, p_z, dest_x, dest_z, objFlags, 0.0f, 1.0f, 0.0f, 1.0f); if ((temp_v0 == 0) && (coord_p != NULL)) { coord_p->f[0] = p_x; @@ -8935,30 +5845,20 @@ s32 bondviewTestLineUnobstructed(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x -#ifdef NONMATCHING /** * Address 0x7F07CAC8. - * - * Decomp status: - * - compiles: yes - * - stack resize: yes - * - identical instructions: yes - * - identical registers: no - * - * notes: Everything matches except two registers are swapped near the ModelFileHeader dereference. - * - * https://decomp.me/scratch/GKM23 - * 99.89% */ -s32 bondviewTankCollisionStatus(struct coord3d *arg0, StandTile *arg1, f32 arg2, struct coord3d *arg3, struct coord3d *arg4) +s32 bondviewTankCollisionStatus(struct coord3d *collision_position, StandTile *arg1, f32 tank_orientation_angle, struct coord3d *arg3, struct coord3d *arg4) { StandTile *spBC; - ModelFileHeader *mfh; - struct rect4f sp98; + s32 stack_padding; + struct rect4f tank_collision_bounds; s32 sp94; f32 temp_f0; + Model *sp8C; - ModelNode *model_node; + + ModelNode **switches; struct coord3d *temp_a1; struct coord3d *temp_a2; struct coord3d sp74; @@ -8968,35 +5868,36 @@ s32 bondviewTankCollisionStatus(struct coord3d *arg0, StandTile *arg1, f32 arg2, spBC = arg1; sp94 = 0; - bondviewTankCollisionRelated(&sp98, arg0, arg2); + bondviewGetTankCollisionBounds(&tank_collision_bounds, collision_position, tank_orientation_angle); - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - sub_GAME_7F03D058(ptr_playerstank, 0); + sub_GAME_7F03D058(g_PlayerTankProp, 0); } - if ((bondviewTestLineUnobstructed(&spBC, arg0->f[0], arg0->f[2], sp98.points[0].f[0], sp98.points[0].f[1], 0x213, arg3, arg4) != 0) - && (bondviewTestLineUnobstructed(&spBC, sp98.points[0].f[0], sp98.points[0].f[1], sp98.points[1].f[0], sp98.points[1].f[1], 0x213, arg3, arg4) != 0) - && (bondviewTestLineUnobstructed(&spBC, sp98.points[1].f[0], sp98.points[1].f[1], sp98.points[2].f[0], sp98.points[2].f[1], 0x213, arg3, arg4) != 0) - && (bondviewTestLineUnobstructed(&spBC, sp98.points[2].f[0], sp98.points[2].f[1], sp98.points[3].f[0], sp98.points[3].f[1], 0x213, arg3, arg4) != 0) - && (bondviewTestLineUnobstructed(&spBC, sp98.points[3].f[0], sp98.points[3].f[1], sp98.points[0].f[0], sp98.points[0].f[1], 0x213, arg3, arg4) != 0)) + if ((bondviewTestLineUnobstructed(&spBC, collision_position->f[0], collision_position->f[2], tank_collision_bounds.points[0].f[0], tank_collision_bounds.points[0].f[1], 0x213, arg3, arg4) != 0) + && (bondviewTestLineUnobstructed(&spBC, tank_collision_bounds.points[0].f[0], tank_collision_bounds.points[0].f[1], tank_collision_bounds.points[1].f[0], tank_collision_bounds.points[1].f[1], 0x213, arg3, arg4) != 0) + && (bondviewTestLineUnobstructed(&spBC, tank_collision_bounds.points[1].f[0], tank_collision_bounds.points[1].f[1], tank_collision_bounds.points[2].f[0], tank_collision_bounds.points[2].f[1], 0x213, arg3, arg4) != 0) + && (bondviewTestLineUnobstructed(&spBC, tank_collision_bounds.points[2].f[0], tank_collision_bounds.points[2].f[1], tank_collision_bounds.points[3].f[0], tank_collision_bounds.points[3].f[1], 0x213, arg3, arg4) != 0) + && (bondviewTestLineUnobstructed(&spBC, tank_collision_bounds.points[3].f[0], tank_collision_bounds.points[3].f[1], tank_collision_bounds.points[0].f[0], tank_collision_bounds.points[0].f[1], 0x213, arg3, arg4) != 0)) { sp94 = 1; - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - sp8C = ptr_playerstank->obj->model; - mfh = sp8C->obj; - model_node = &mfh->Switches[0]; - temp_v1 = model_node->Next->Data; - temp_a1 = model_node->Prev->Data; - temp_a2 = model_node->Parent->Data; + ObjectRecord *obj = g_PlayerTankProp->obj; + sp8C = obj->model; + switches = sp8C->obj->Switches; + + temp_v1 = switches[3]->Data; + temp_a1 = switches[4]->Data; + temp_a2 = switches[2]->Data; sp74.f[0] = temp_a1->f[0] + temp_v1->f[0] - temp_a2->f[0]; sp74.f[1] = 0.0f; sp74.f[2] = temp_a1->f[2] + temp_v1->f[2] - temp_a2->f[2]; - temp_f0 = arg2 + g_TankTurretOrientationAngleRad; + temp_f0 = tank_orientation_angle + g_TankTurretOrientationAngleRad; if (temp_f0 >= M_TAU_F) { @@ -9009,229 +5910,31 @@ s32 bondviewTankCollisionStatus(struct coord3d *arg0, StandTile *arg1, f32 arg2, } matrix_4x4_set_rotation_around_y(M_TAU_F - temp_f0, &sp34); - matrix_4x4_rotate_vector_in_place(&sp34, (f32*)&sp74); + mtx4RotateVecInPlace(&sp34, (f32*)&sp74); sp74.f[0] *= sp8C->scale; sp74.f[2] *= sp8C->scale; - sp74.f[0] += arg0->f[0]; - sp74.f[2] += arg0->f[2]; + sp74.f[0] += collision_position->f[0]; + sp74.f[2] += collision_position->f[2]; spBC = arg1; - if (bondviewTestLineUnobstructed(&spBC, arg0->f[0], arg0->f[2], sp74.f[0], sp74.f[2], 0x213, arg3, arg4) == 0) + if (bondviewTestLineUnobstructed(&spBC, collision_position->f[0], collision_position->f[2], sp74.f[0], sp74.f[2], 0x213, arg3, arg4) == 0) { sp94 = 0; } + } } - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - sub_GAME_7F03D058(ptr_playerstank, 1); + sub_GAME_7F03D058(g_PlayerTankProp, 1); } return sp94; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80055064 -.word 0x40c90fdb /*6.2831855*/ -.text -glabel bondviewTankCollisionStatus -/* 0B15F8 7F07CAC8 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0B15FC 7F07CACC AFBF0024 */ sw $ra, 0x24($sp) -/* 0B1600 7F07CAD0 AFA400C0 */ sw $a0, 0xc0($sp) -/* 0B1604 7F07CAD4 AFA500C4 */ sw $a1, 0xc4($sp) -/* 0B1608 7F07CAD8 AFA500BC */ sw $a1, 0xbc($sp) -/* 0B160C 7F07CADC AFA600C8 */ sw $a2, 0xc8($sp) -/* 0B1610 7F07CAE0 AFA700CC */ sw $a3, 0xcc($sp) -/* 0B1614 7F07CAE4 AFA00094 */ sw $zero, 0x94($sp) -/* 0B1618 7F07CAE8 8FA500C0 */ lw $a1, 0xc0($sp) -/* 0B161C 7F07CAEC 0FC1F222 */ jal bondviewTankCollisionRelated -/* 0B1620 7F07CAF0 27A40098 */ addiu $a0, $sp, 0x98 -/* 0B1624 7F07CAF4 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0B1628 7F07CAF8 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) -/* 0B162C 7F07CAFC 50800004 */ beql $a0, $zero, .L7F07CB10 -/* 0B1630 7F07CB00 8FA200C0 */ lw $v0, 0xc0($sp) -/* 0B1634 7F07CB04 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B1638 7F07CB08 00002825 */ move $a1, $zero -/* 0B163C 7F07CB0C 8FA200C0 */ lw $v0, 0xc0($sp) -.L7F07CB10: -/* 0B1640 7F07CB10 C7A4009C */ lwc1 $f4, 0x9c($sp) -/* 0B1644 7F07CB14 8FB800CC */ lw $t8, 0xcc($sp) -/* 0B1648 7F07CB18 8C450000 */ lw $a1, ($v0) -/* 0B164C 7F07CB1C 8C460008 */ lw $a2, 8($v0) -/* 0B1650 7F07CB20 8FB900D0 */ lw $t9, 0xd0($sp) -/* 0B1654 7F07CB24 240F0213 */ li $t7, 531 -/* 0B1658 7F07CB28 AFAF0014 */ sw $t7, 0x14($sp) -/* 0B165C 7F07CB2C 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B1660 7F07CB30 8FA70098 */ lw $a3, 0x98($sp) -/* 0B1664 7F07CB34 E7A40010 */ swc1 $f4, 0x10($sp) -/* 0B1668 7F07CB38 AFB80018 */ sw $t8, 0x18($sp) -/* 0B166C 7F07CB3C 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B1670 7F07CB40 AFB9001C */ sw $t9, 0x1c($sp) -/* 0B1674 7F07CB44 1040008D */ beqz $v0, .L7F07CD7C -/* 0B1678 7F07CB48 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B167C 7F07CB4C C7A600A4 */ lwc1 $f6, 0xa4($sp) -/* 0B1680 7F07CB50 8FAA00CC */ lw $t2, 0xcc($sp) -/* 0B1684 7F07CB54 8FAB00D0 */ lw $t3, 0xd0($sp) -/* 0B1688 7F07CB58 24090213 */ li $t1, 531 -/* 0B168C 7F07CB5C AFA90014 */ sw $t1, 0x14($sp) -/* 0B1690 7F07CB60 8FA50098 */ lw $a1, 0x98($sp) -/* 0B1694 7F07CB64 8FA6009C */ lw $a2, 0x9c($sp) -/* 0B1698 7F07CB68 8FA700A0 */ lw $a3, 0xa0($sp) -/* 0B169C 7F07CB6C E7A60010 */ swc1 $f6, 0x10($sp) -/* 0B16A0 7F07CB70 AFAA0018 */ sw $t2, 0x18($sp) -/* 0B16A4 7F07CB74 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B16A8 7F07CB78 AFAB001C */ sw $t3, 0x1c($sp) -/* 0B16AC 7F07CB7C 1040007F */ beqz $v0, .L7F07CD7C -/* 0B16B0 7F07CB80 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B16B4 7F07CB84 C7A800AC */ lwc1 $f8, 0xac($sp) -/* 0B16B8 7F07CB88 8FAD00CC */ lw $t5, 0xcc($sp) -/* 0B16BC 7F07CB8C 8FAE00D0 */ lw $t6, 0xd0($sp) -/* 0B16C0 7F07CB90 240C0213 */ li $t4, 531 -/* 0B16C4 7F07CB94 AFAC0014 */ sw $t4, 0x14($sp) -/* 0B16C8 7F07CB98 8FA500A0 */ lw $a1, 0xa0($sp) -/* 0B16CC 7F07CB9C 8FA600A4 */ lw $a2, 0xa4($sp) -/* 0B16D0 7F07CBA0 8FA700A8 */ lw $a3, 0xa8($sp) -/* 0B16D4 7F07CBA4 E7A80010 */ swc1 $f8, 0x10($sp) -/* 0B16D8 7F07CBA8 AFAD0018 */ sw $t5, 0x18($sp) -/* 0B16DC 7F07CBAC 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B16E0 7F07CBB0 AFAE001C */ sw $t6, 0x1c($sp) -/* 0B16E4 7F07CBB4 10400071 */ beqz $v0, .L7F07CD7C -/* 0B16E8 7F07CBB8 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B16EC 7F07CBBC C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* 0B16F0 7F07CBC0 8FB800CC */ lw $t8, 0xcc($sp) -/* 0B16F4 7F07CBC4 8FB900D0 */ lw $t9, 0xd0($sp) -/* 0B16F8 7F07CBC8 240F0213 */ li $t7, 531 -/* 0B16FC 7F07CBCC AFAF0014 */ sw $t7, 0x14($sp) -/* 0B1700 7F07CBD0 8FA500A8 */ lw $a1, 0xa8($sp) -/* 0B1704 7F07CBD4 8FA600AC */ lw $a2, 0xac($sp) -/* 0B1708 7F07CBD8 8FA700B0 */ lw $a3, 0xb0($sp) -/* 0B170C 7F07CBDC E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0B1710 7F07CBE0 AFB80018 */ sw $t8, 0x18($sp) -/* 0B1714 7F07CBE4 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B1718 7F07CBE8 AFB9001C */ sw $t9, 0x1c($sp) -/* 0B171C 7F07CBEC 10400063 */ beqz $v0, .L7F07CD7C -/* 0B1720 7F07CBF0 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B1724 7F07CBF4 C7B0009C */ lwc1 $f16, 0x9c($sp) -/* 0B1728 7F07CBF8 8FAA00CC */ lw $t2, 0xcc($sp) -/* 0B172C 7F07CBFC 8FAB00D0 */ lw $t3, 0xd0($sp) -/* 0B1730 7F07CC00 24090213 */ li $t1, 531 -/* 0B1734 7F07CC04 AFA90014 */ sw $t1, 0x14($sp) -/* 0B1738 7F07CC08 8FA500B0 */ lw $a1, 0xb0($sp) -/* 0B173C 7F07CC0C 8FA600B4 */ lw $a2, 0xb4($sp) -/* 0B1740 7F07CC10 8FA70098 */ lw $a3, 0x98($sp) -/* 0B1744 7F07CC14 E7B00010 */ swc1 $f16, 0x10($sp) -/* 0B1748 7F07CC18 AFAA0018 */ sw $t2, 0x18($sp) -/* 0B174C 7F07CC1C 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B1750 7F07CC20 AFAB001C */ sw $t3, 0x1c($sp) -/* 0B1754 7F07CC24 10400055 */ beqz $v0, .L7F07CD7C -/* 0B1758 7F07CC28 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0B175C 7F07CC2C 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) -/* 0B1760 7F07CC30 240C0001 */ li $t4, 1 -/* 0B1764 7F07CC34 AFAC0094 */ sw $t4, 0x94($sp) -/* 0B1768 7F07CC38 10800050 */ beqz $a0, .L7F07CD7C -/* 0B176C 7F07CC3C 00000000 */ nop -/* 0B1770 7F07CC40 8C870004 */ lw $a3, 4($a0) -/* 0B1774 7F07CC44 44806000 */ mtc1 $zero, $f12 -/* 0B1778 7F07CC48 3C018005 */ lui $at, %hi(D_80055064) -/* 0B177C 7F07CC4C 8CE80014 */ lw $t0, 0x14($a3) -/* 0B1780 7F07CC50 C4225064 */ lwc1 $f2, %lo(D_80055064)($at) -/* 0B1784 7F07CC54 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0B1788 7F07CC58 8D0D0008 */ lw $t5, 8($t0) -/* 0B178C 7F07CC5C 8DA20008 */ lw $v0, 8($t5) -/* 0B1790 7F07CC60 8C4E000C */ lw $t6, 0xc($v0) -/* 0B1794 7F07CC64 8C4F0010 */ lw $t7, 0x10($v0) -/* 0B1798 7F07CC68 8C580008 */ lw $t8, 8($v0) -/* 0B179C 7F07CC6C 8DC30004 */ lw $v1, 4($t6) -/* 0B17A0 7F07CC70 8DE50004 */ lw $a1, 4($t7) -/* 0B17A4 7F07CC74 8F060004 */ lw $a2, 4($t8) -/* 0B17A8 7F07CC78 C4640000 */ lwc1 $f4, ($v1) -/* 0B17AC 7F07CC7C C4B20000 */ lwc1 $f18, ($a1) -/* 0B17B0 7F07CC80 C4C80000 */ lwc1 $f8, ($a2) -/* 0B17B4 7F07CC84 E7AC0078 */ swc1 $f12, 0x78($sp) -/* 0B17B8 7F07CC88 46049180 */ add.s $f6, $f18, $f4 -/* 0B17BC 7F07CC8C 46083281 */ sub.s $f10, $f6, $f8 -/* 0B17C0 7F07CC90 E7AA0074 */ swc1 $f10, 0x74($sp) -/* 0B17C4 7F07CC94 C4720008 */ lwc1 $f18, 8($v1) -/* 0B17C8 7F07CC98 C4B00008 */ lwc1 $f16, 8($a1) -/* 0B17CC 7F07CC9C C7AA00C8 */ lwc1 $f10, 0xc8($sp) -/* 0B17D0 7F07CCA0 C4C60008 */ lwc1 $f6, 8($a2) -/* 0B17D4 7F07CCA4 46128100 */ add.s $f4, $f16, $f18 -/* 0B17D8 7F07CCA8 C4306474 */ lwc1 $f16, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B17DC 7F07CCAC 27A50034 */ addiu $a1, $sp, 0x34 -/* 0B17E0 7F07CCB0 46105000 */ add.s $f0, $f10, $f16 -/* 0B17E4 7F07CCB4 46062201 */ sub.s $f8, $f4, $f6 -/* 0B17E8 7F07CCB8 4600103E */ c.le.s $f2, $f0 -/* 0B17EC 7F07CCBC E7A8007C */ swc1 $f8, 0x7c($sp) -/* 0B17F0 7F07CCC0 45020003 */ bc1fl .L7F07CCD0 -/* 0B17F4 7F07CCC4 460C003C */ c.lt.s $f0, $f12 -/* 0B17F8 7F07CCC8 46020001 */ sub.s $f0, $f0, $f2 -/* 0B17FC 7F07CCCC 460C003C */ c.lt.s $f0, $f12 -.L7F07CCD0: -/* 0B1800 7F07CCD0 00000000 */ nop -/* 0B1804 7F07CCD4 45020003 */ bc1fl .L7F07CCE4 -/* 0B1808 7F07CCD8 46001301 */ sub.s $f12, $f2, $f0 -/* 0B180C 7F07CCDC 46020000 */ add.s $f0, $f0, $f2 -/* 0B1810 7F07CCE0 46001301 */ sub.s $f12, $f2, $f0 -.L7F07CCE4: -/* 0B1814 7F07CCE4 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0B1818 7F07CCE8 AFA8008C */ sw $t0, 0x8c($sp) -/* 0B181C 7F07CCEC 27A40034 */ addiu $a0, $sp, 0x34 -/* 0B1820 7F07CCF0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0B1824 7F07CCF4 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B1828 7F07CCF8 8FA8008C */ lw $t0, 0x8c($sp) -/* 0B182C 7F07CCFC C7B20074 */ lwc1 $f18, 0x74($sp) -/* 0B1830 7F07CD00 C7A8007C */ lwc1 $f8, 0x7c($sp) -/* 0B1834 7F07CD04 C5040014 */ lwc1 $f4, 0x14($t0) -/* 0B1838 7F07CD08 8FA200C0 */ lw $v0, 0xc0($sp) -/* 0B183C 7F07CD0C 8FB900C4 */ lw $t9, 0xc4($sp) -/* 0B1840 7F07CD10 46049182 */ mul.s $f6, $f18, $f4 -/* 0B1844 7F07CD14 8FAA00CC */ lw $t2, 0xcc($sp) -/* 0B1848 7F07CD18 8FAB00D0 */ lw $t3, 0xd0($sp) -/* 0B184C 7F07CD1C 24090213 */ li $t1, 531 -/* 0B1850 7F07CD20 27A400BC */ addiu $a0, $sp, 0xbc -/* 0B1854 7F07CD24 E7A60074 */ swc1 $f6, 0x74($sp) -/* 0B1858 7F07CD28 C50A0014 */ lwc1 $f10, 0x14($t0) -/* 0B185C 7F07CD2C 460A4402 */ mul.s $f16, $f8, $f10 -/* 0B1860 7F07CD30 E7B0007C */ swc1 $f16, 0x7c($sp) -/* 0B1864 7F07CD34 C4520000 */ lwc1 $f18, ($v0) -/* 0B1868 7F07CD38 46123100 */ add.s $f4, $f6, $f18 -/* 0B186C 7F07CD3C E7A40074 */ swc1 $f4, 0x74($sp) -/* 0B1870 7F07CD40 C4480008 */ lwc1 $f8, 8($v0) -/* 0B1874 7F07CD44 AFB900BC */ sw $t9, 0xbc($sp) -/* 0B1878 7F07CD48 44072000 */ mfc1 $a3, $f4 -/* 0B187C 7F07CD4C 46088280 */ add.s $f10, $f16, $f8 -/* 0B1880 7F07CD50 E7AA007C */ swc1 $f10, 0x7c($sp) -/* 0B1884 7F07CD54 8C460008 */ lw $a2, 8($v0) -/* 0B1888 7F07CD58 8C450000 */ lw $a1, ($v0) -/* 0B188C 7F07CD5C AFA90014 */ sw $t1, 0x14($sp) -/* 0B1890 7F07CD60 E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0B1894 7F07CD64 AFAA0018 */ sw $t2, 0x18($sp) -/* 0B1898 7F07CD68 0FC1F28B */ jal bondviewTestLineUnobstructed -/* 0B189C 7F07CD6C AFAB001C */ sw $t3, 0x1c($sp) -/* 0B18A0 7F07CD70 14400002 */ bnez $v0, .L7F07CD7C -/* 0B18A4 7F07CD74 00000000 */ nop -/* 0B18A8 7F07CD78 AFA00094 */ sw $zero, 0x94($sp) -.L7F07CD7C: -/* 0B18AC 7F07CD7C 3C048003 */ lui $a0, %hi(ptr_playerstank) -/* 0B18B0 7F07CD80 8C846450 */ lw $a0, %lo(ptr_playerstank)($a0) -/* 0B18B4 7F07CD84 50800004 */ beql $a0, $zero, .L7F07CD98 -/* 0B18B8 7F07CD88 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B18BC 7F07CD8C 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B18C0 7F07CD90 24050001 */ li $a1, 1 -/* 0B18C4 7F07CD94 8FBF0024 */ lw $ra, 0x24($sp) -.L7F07CD98: -/* 0B18C8 7F07CD98 8FA20094 */ lw $v0, 0x94($sp) -/* 0B18CC 7F07CD9C 27BD00C0 */ addiu $sp, $sp, 0xc0 -/* 0B18D0 7F07CDA0 03E00008 */ jr $ra -/* 0B18D4 7F07CDA4 00000000 */ nop -) -#endif - @@ -9239,9 +5942,9 @@ glabel bondviewTankCollisionStatus /** * Address 0x7F07CDA8. */ -s32 bondviewCallTankCollisionStatus(struct coord3d *arg0, StandTile *arg1, f32 arg2) +s32 bondviewCallTankCollisionStatus(struct coord3d *collision_position, StandTile *arg1, f32 tank_orientation_angle) { - return bondviewTankCollisionStatus(arg0, arg1, arg2, NULL, NULL); + return bondviewTankCollisionStatus(collision_position, arg1, tank_orientation_angle, NULL, NULL); } @@ -9259,7 +5962,7 @@ s32 sub_GAME_7F07CDD4(struct coord3d *arg0, f32 arg1, StandTile **arg2) sp3C = g_CurrentPlayer->field_488.current_tile_ptr; if (( - sub_GAME_7F0B0E24( + stanTestLineUnobstructed( &sp3C, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], @@ -9297,7 +6000,7 @@ struct PropRecord *get_ptr_for_players_tank(void) { if (in_tank_flag == 1) { - return ptr_playerstank; + return g_PlayerTankProp; } return 0; @@ -9352,41 +6055,25 @@ f32 bondviewGet8003646CRad(void) - - -#ifdef NONMATCHING - -struct cal_player_collision_unk_stan -{ - s32 data[16]; -}; - /** * Address 0x7F07CF8C. - * - * decomp notes: - * compiles: yes - * stack resize: match - * instructions match: false - * resgisters match: false - * - * decomp notes: The branch in the `if` logic is not behaving well, the instructions - * in the area are not in the correct order, and there's some regalloc before and after. */ -s32 cal_player_collision(struct coord3d *arg0, StandTile **stan) +s32 bondviewTryMoveToStan(struct coord3d *arg0, StandTile **stan) { s32 sp94; StandTile *sp90; s32 sp8C; - f32 sp88; - f32 sp84; - f32 sp80; + f32 height; + f32 always_30; + f32 collision_radius; s32 sp7C; - struct cal_player_collision_unk_stan sp3C; + struct TankRecord *tank; + s32 stack_padding[11]; + struct StandTileLocusCallbackRecord sp3C; sp94 = 0; - if ((in_tank_flag == 1) && (g_EnterTankAudioState != 0)) + if ((in_tank_flag == 1) && (g_EnterTankAudioState != TANK_RUN_STATE_NOT_RUNNING)) { sp94 = sub_GAME_7F07CDD4(arg0, g_TankOrientationAngle, stan); } @@ -9403,1024 +6090,359 @@ s32 cal_player_collision(struct coord3d *arg0, StandTile **stan) sp8C = 0; } - bondviewCollisionRadiusRelated(g_CurrentPlayer->prop, &sp80, &sp88, &sp84); + bondviewGetCollisionRadius(g_CurrentPlayer->prop, &collision_radius, &height, &always_30); - if (D_8003644C != NULL) + if (g_WorldTankProp != NULL) { - sub_GAME_7F03D058(D_8003644C, 0); + sub_GAME_7F03D058(g_WorldTankProp, 0); } sub_GAME_7F03D058(g_CurrentPlayer->prop, 0); - sp7C = stanTileDistanceRelated(&sp90, arg0->f[0], arg0->f[2], sp80, &sp3C); + sp7C = stanTileDistanceRelated(&sp90, arg0->f[0], arg0->f[2], collision_radius, &sp3C); if (stanGetLocusField0(&sp3C) != 0) { g_CurrentPlayer->autocrouchpos = 0; } - - do { - if ((sub_GAME_7F0B0E24( + + if ((stanTestLineUnobstructed( &sp90, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], arg0->f[0], arg0->f[2], sp8C, - sp88, - sp84, + height, + always_30, 0.0f, 1.0f) != 0) -// begin decomp problem area - && (sub_GAME_7F0B18B8(&sp90, arg0->f[0], arg0->f[2], sp80, sp8C, sp88, sp84) < 0)) + && stanTestVolume(&sp90, arg0->f[0], arg0->f[2], collision_radius, sp8C, height, always_30) < 0) { - if ((g_CurrentPlayer->ducking_height_offset == -100.0f) || (sp7C < 0)) + if (g_CurrentPlayer->ducking_height_offset == FULL_CROUCH_OFFSET || sp7C < 0) { - if ((stanGetLocusCount(&sp3C) == 0) - && (sub_GAME_7F0B26B8(&sp90, arg0->f[0], arg0->f[2], sp80, g_CurrentPlayer->field_488.collision_position.f[1] + 175.0f) >= 0)) + if (stanGetLocusCount(&sp3C) == 0 && sub_GAME_7F0B26B8(&sp90, arg0->f[0], arg0->f[2], collision_radius, g_CurrentPlayer->field_488.collision_position.f[1] + 175.0f) >= 0) { - // don't break + goto block_20; } else { *stan = sp90; - sp94 = 1; - - if (g_CurrentPlayer) - {} - - // skip check to set D_8003644C - break; + sp94 = 1; } } + else + { + goto block_20; + } } - - if (ptr_playerstank == NULL) + else { - if ((stanSavedColl_posData != NULL) - && (stanSavedColl_posData->type == PROP_TYPE_OBJ) - && (stanSavedColl_posData->obj->type == PROPDEF_TANK)) +block_20: + /* I'm sorry, this is the only way I could make it match. */ + if (g_PlayerTankProp == NULL + && (stanSavedColl_posData != NULL) + && (stanSavedColl_posData->type == PROP_TYPE_OBJ)) { - D_8003644C = stanSavedColl_posData; + tank = (struct TankRecord *)stanSavedColl_posData->obj; + if (tank->type == PROPDEF_TANK) + { + g_WorldTankProp = stanSavedColl_posData; + } } } - } while (0); - -// end decomp problem area - sub_GAME_7F03D058(g_CurrentPlayer->prop, 1); - if (D_8003644C != 0) + if (g_WorldTankProp != NULL) { - sub_GAME_7F03D058(D_8003644C, 1); + sub_GAME_7F03D058(g_WorldTankProp, 1); } } return sp94; } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel cal_player_collision -/* 0B1ABC 7F07CF8C 3C0E8003 */ lui $t6, %hi(in_tank_flag) -/* 0B1AC0 7F07CF90 8DCE6448 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B1AC4 7F07CF94 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 0B1AC8 7F07CF98 24010001 */ li $at, 1 -/* 0B1ACC 7F07CF9C AFBF002C */ sw $ra, 0x2c($sp) -/* 0B1AD0 7F07CFA0 AFA40098 */ sw $a0, 0x98($sp) -/* 0B1AD4 7F07CFA4 AFA5009C */ sw $a1, 0x9c($sp) -/* 0B1AD8 7F07CFA8 15C1000B */ bne $t6, $at, .L7F07CFD8 -/* 0B1ADC 7F07CFAC AFA00094 */ sw $zero, 0x94($sp) -/* 0B1AE0 7F07CFB0 3C0F8008 */ lui $t7, %hi(g_EnterTankAudioState) -/* 0B1AE4 7F07CFB4 8DEF99B8 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0B1AE8 7F07CFB8 3C058003 */ lui $a1, %hi(g_TankOrientationAngle) -/* 0B1AEC 7F07CFBC 8FA6009C */ lw $a2, 0x9c($sp) -/* 0B1AF0 7F07CFC0 11E00005 */ beqz $t7, .L7F07CFD8 -/* 0B1AF4 7F07CFC4 00000000 */ nop -/* 0B1AF8 7F07CFC8 0FC1F375 */ jal sub_GAME_7F07CDD4 -/* 0B1AFC 7F07CFCC 8CA56464 */ lw $a1, %lo(g_TankOrientationAngle)($a1) -/* 0B1B00 7F07CFD0 10000093 */ b .L7F07D220 -/* 0B1B04 7F07CFD4 AFA20094 */ sw $v0, 0x94($sp) -.L7F07CFD8: -/* 0B1B08 7F07CFD8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1B0C 7F07CFDC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1B10 7F07CFE0 3C198003 */ lui $t9, %hi(obj_collision_flag) -/* 0B1B14 7F07CFE4 8F3964C8 */ lw $t9, %lo(obj_collision_flag)($t9) -/* 0B1B18 7F07CFE8 8C780488 */ lw $t8, 0x488($v1) -/* 0B1B1C 7F07CFEC 27A50080 */ addiu $a1, $sp, 0x80 -/* 0B1B20 7F07CFF0 13200004 */ beqz $t9, .L7F07D004 -/* 0B1B24 7F07CFF4 AFB80090 */ sw $t8, 0x90($sp) -/* 0B1B28 7F07CFF8 2408001F */ li $t0, 31 -/* 0B1B2C 7F07CFFC 10000002 */ b .L7F07D008 -/* 0B1B30 7F07D000 AFA8008C */ sw $t0, 0x8c($sp) -.L7F07D004: -/* 0B1B34 7F07D004 AFA0008C */ sw $zero, 0x8c($sp) -.L7F07D008: -/* 0B1B38 7F07D008 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0B1B3C 7F07D00C 27A60088 */ addiu $a2, $sp, 0x88 -/* 0B1B40 7F07D010 0FC2289D */ jal bondviewCollisionRadiusRelated -/* 0B1B44 7F07D014 27A70084 */ addiu $a3, $sp, 0x84 -/* 0B1B48 7F07D018 3C048003 */ lui $a0, %hi(D_8003644C) -/* 0B1B4C 7F07D01C 8C84644C */ lw $a0, %lo(D_8003644C)($a0) -/* 0B1B50 7F07D020 10800003 */ beqz $a0, .L7F07D030 -/* 0B1B54 7F07D024 00000000 */ nop -/* 0B1B58 7F07D028 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B1B5C 7F07D02C 00002825 */ move $a1, $zero -.L7F07D030: -/* 0B1B60 7F07D030 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B1B64 7F07D034 8D29A0B0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B1B68 7F07D038 00002825 */ move $a1, $zero -/* 0B1B6C 7F07D03C 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B1B70 7F07D040 8D2400A8 */ lw $a0, 0xa8($t1) -/* 0B1B74 7F07D044 8FA20098 */ lw $v0, 0x98($sp) -/* 0B1B78 7F07D048 27AA003C */ addiu $t2, $sp, 0x3c -/* 0B1B7C 7F07D04C 27A40090 */ addiu $a0, $sp, 0x90 -/* 0B1B80 7F07D050 8C450000 */ lw $a1, ($v0) -/* 0B1B84 7F07D054 8C460008 */ lw $a2, 8($v0) -/* 0B1B88 7F07D058 AFAA0010 */ sw $t2, 0x10($sp) -/* 0B1B8C 7F07D05C 0FC2C8C5 */ jal stanTileDistanceRelated -/* 0B1B90 7F07D060 8FA70080 */ lw $a3, 0x80($sp) -/* 0B1B94 7F07D064 AFA2007C */ sw $v0, 0x7c($sp) -/* 0B1B98 7F07D068 0FC2C8E7 */ jal stanGetLocusField0 -/* 0B1B9C 7F07D06C 27A4003C */ addiu $a0, $sp, 0x3c -/* 0B1BA0 7F07D070 10400004 */ beqz $v0, .L7F07D084 -/* 0B1BA4 7F07D074 27A40090 */ addiu $a0, $sp, 0x90 -/* 0B1BA8 7F07D078 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) -/* 0B1BAC 7F07D07C 8D6BA0B0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B1BB0 7F07D080 AD6029FC */ sw $zero, 0x29fc($t3) -.L7F07D084: -/* 0B1BB4 7F07D084 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1BB8 7F07D088 8FA20098 */ lw $v0, 0x98($sp) -/* 0B1BBC 7F07D08C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1BC0 7F07D090 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B1BC4 7F07D094 C4440008 */ lwc1 $f4, 8($v0) -/* 0B1BC8 7F07D098 8C470000 */ lw $a3, ($v0) -/* 0B1BCC 7F07D09C 8C65048C */ lw $a1, 0x48c($v1) -/* 0B1BD0 7F07D0A0 8C660494 */ lw $a2, 0x494($v1) -/* 0B1BD4 7F07D0A4 44818000 */ mtc1 $at, $f16 -/* 0B1BD8 7F07D0A8 8FAC008C */ lw $t4, 0x8c($sp) -/* 0B1BDC 7F07D0AC C7A60088 */ lwc1 $f6, 0x88($sp) -/* 0B1BE0 7F07D0B0 C7A80084 */ lwc1 $f8, 0x84($sp) -/* 0B1BE4 7F07D0B4 44805000 */ mtc1 $zero, $f10 -/* 0B1BE8 7F07D0B8 E7A40010 */ swc1 $f4, 0x10($sp) -/* 0B1BEC 7F07D0BC AFAC0014 */ sw $t4, 0x14($sp) -/* 0B1BF0 7F07D0C0 E7B00024 */ swc1 $f16, 0x24($sp) -/* 0B1BF4 7F07D0C4 E7A60018 */ swc1 $f6, 0x18($sp) -/* 0B1BF8 7F07D0C8 E7A8001C */ swc1 $f8, 0x1c($sp) -/* 0B1BFC 7F07D0CC 0FC2C389 */ jal sub_GAME_7F0B0E24 -/* 0B1C00 7F07D0D0 E7AA0020 */ swc1 $f10, 0x20($sp) -/* 0B1C04 7F07D0D4 10400035 */ beqz $v0, .L7F07D1AC -/* 0B1C08 7F07D0D8 27A40090 */ addiu $a0, $sp, 0x90 -/* 0B1C0C 7F07D0DC 8FA20098 */ lw $v0, 0x98($sp) -/* 0B1C10 7F07D0E0 8FAD008C */ lw $t5, 0x8c($sp) -/* 0B1C14 7F07D0E4 C7B20088 */ lwc1 $f18, 0x88($sp) -/* 0B1C18 7F07D0E8 C7A40084 */ lwc1 $f4, 0x84($sp) -/* 0B1C1C 7F07D0EC 8C450000 */ lw $a1, ($v0) -/* 0B1C20 7F07D0F0 8C460008 */ lw $a2, 8($v0) -/* 0B1C24 7F07D0F4 8FA70080 */ lw $a3, 0x80($sp) -/* 0B1C28 7F07D0F8 AFAD0010 */ sw $t5, 0x10($sp) -/* 0B1C2C 7F07D0FC E7B20014 */ swc1 $f18, 0x14($sp) -/* 0B1C30 7F07D100 0FC2C62E */ jal sub_GAME_7F0B18B8 -/* 0B1C34 7F07D104 E7A40018 */ swc1 $f4, 0x18($sp) -/* 0B1C38 7F07D108 04410028 */ bgez $v0, .L7F07D1AC -/* 0B1C3C 7F07D10C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1C40 7F07D110 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1C44 7F07D114 3C01C2C8 */ li $at, 0xC2C80000 # -100.000000 -/* 0B1C48 7F07D118 44813000 */ mtc1 $at, $f6 -/* 0B1C4C 7F07D11C C46800A0 */ lwc1 $f8, 0xa0($v1) -/* 0B1C50 7F07D120 8FAE007C */ lw $t6, 0x7c($sp) -/* 0B1C54 7F07D124 46083032 */ c.eq.s $f6, $f8 -/* 0B1C58 7F07D128 00000000 */ nop -/* 0B1C5C 7F07D12C 45010003 */ bc1t .L7F07D13C -/* 0B1C60 7F07D130 00000000 */ nop -/* 0B1C64 7F07D134 05C1001F */ bgez $t6, .L7F07D1B4 -/* 0B1C68 7F07D138 00000000 */ nop -.L7F07D13C: -/* 0B1C6C 7F07D13C 0FC2C8E9 */ jal stanGetLocusCount -/* 0B1C70 7F07D140 27A4003C */ addiu $a0, $sp, 0x3c -/* 0B1C74 7F07D144 14400011 */ bnez $v0, .L7F07D18C -/* 0B1C78 7F07D148 27A40090 */ addiu $a0, $sp, 0x90 -/* 0B1C7C 7F07D14C 3C188008 */ lui $t8, %hi(g_CurrentPlayer) -/* 0B1C80 7F07D150 8F18A0B0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1C84 7F07D154 3C01432F */ li $at, 0x432F0000 # 175.000000 -/* 0B1C88 7F07D158 44818000 */ mtc1 $at, $f16 -/* 0B1C8C 7F07D15C C70A0490 */ lwc1 $f10, 0x490($t8) -/* 0B1C90 7F07D160 8FAF0098 */ lw $t7, 0x98($sp) -/* 0B1C94 7F07D164 8FA70080 */ lw $a3, 0x80($sp) -/* 0B1C98 7F07D168 46105480 */ add.s $f18, $f10, $f16 -/* 0B1C9C 7F07D16C 8DE50000 */ lw $a1, ($t7) -/* 0B1CA0 7F07D170 8DE60008 */ lw $a2, 8($t7) -/* 0B1CA4 7F07D174 0FC2C9AE */ jal sub_GAME_7F0B26B8 -/* 0B1CA8 7F07D178 E7B20010 */ swc1 $f18, 0x10($sp) -/* 0B1CAC 7F07D17C 04400003 */ bltz $v0, .L7F07D18C -/* 0B1CB0 7F07D180 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1CB4 7F07D184 1000000B */ b .L7F07D1B4 -/* 0B1CB8 7F07D188 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07D18C: -/* 0B1CBC 7F07D18C 8FB90090 */ lw $t9, 0x90($sp) -/* 0B1CC0 7F07D190 8FA8009C */ lw $t0, 0x9c($sp) -/* 0B1CC4 7F07D194 24090001 */ li $t1, 1 -/* 0B1CC8 7F07D198 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1CCC 7F07D19C AD190000 */ sw $t9, ($t0) -/* 0B1CD0 7F07D1A0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1CD4 7F07D1A4 10000015 */ b .L7F07D1FC -/* 0B1CD8 7F07D1A8 AFA90094 */ sw $t1, 0x94($sp) -.L7F07D1AC: -/* 0B1CDC 7F07D1AC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1CE0 7F07D1B0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07D1B4: -/* 0B1CE4 7F07D1B4 3C0A8003 */ lui $t2, %hi(ptr_playerstank) -/* 0B1CE8 7F07D1B8 8D4A6450 */ lw $t2, %lo(ptr_playerstank)($t2) -/* 0B1CEC 7F07D1BC 3C028008 */ lui $v0, %hi(stanSavedColl_posData) -/* 0B1CF0 7F07D1C0 5540000F */ bnezl $t2, .L7F07D200 -/* 0B1CF4 7F07D1C4 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0B1CF8 7F07D1C8 8C42BA04 */ lw $v0, %lo(stanSavedColl_posData)($v0) -/* 0B1CFC 7F07D1CC 5040000C */ beql $v0, $zero, .L7F07D200 -/* 0B1D00 7F07D1D0 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0B1D04 7F07D1D4 904B0000 */ lbu $t3, ($v0) -/* 0B1D08 7F07D1D8 24010001 */ li $at, 1 -/* 0B1D0C 7F07D1DC 55610008 */ bnel $t3, $at, .L7F07D200 -/* 0B1D10 7F07D1E0 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0B1D14 7F07D1E4 8C440004 */ lw $a0, 4($v0) -/* 0B1D18 7F07D1E8 2401002D */ li $at, 45 -/* 0B1D1C 7F07D1EC 908C0003 */ lbu $t4, 3($a0) -/* 0B1D20 7F07D1F0 15810002 */ bne $t4, $at, .L7F07D1FC -/* 0B1D24 7F07D1F4 3C018003 */ lui $at, %hi(D_8003644C) -/* 0B1D28 7F07D1F8 AC22644C */ sw $v0, %lo(D_8003644C)($at) -.L7F07D1FC: -/* 0B1D2C 7F07D1FC 8C6400A8 */ lw $a0, 0xa8($v1) -.L7F07D200: -/* 0B1D30 7F07D200 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B1D34 7F07D204 24050001 */ li $a1, 1 -/* 0B1D38 7F07D208 3C048003 */ lui $a0, %hi(D_8003644C) -/* 0B1D3C 7F07D20C 8C84644C */ lw $a0, %lo(D_8003644C)($a0) -/* 0B1D40 7F07D210 50800004 */ beql $a0, $zero, .L7F07D224 -/* 0B1D44 7F07D214 8FBF002C */ lw $ra, 0x2c($sp) -/* 0B1D48 7F07D218 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0B1D4C 7F07D21C 24050001 */ li $a1, 1 -.L7F07D220: -/* 0B1D50 7F07D220 8FBF002C */ lw $ra, 0x2c($sp) -.L7F07D224: -/* 0B1D54 7F07D224 8FA20094 */ lw $v0, 0x94($sp) -/* 0B1D58 7F07D228 27BD0098 */ addiu $sp, $sp, 0x98 -/* 0B1D5C 7F07D22C 03E00008 */ jr $ra -/* 0B1D60 7F07D230 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel cal_player_collision -/* 0AFA50 7F07D060 3C0E8003 */ lui $t6, %hi(in_tank_flag) # $t6, 0x8003 -/* 0AFA54 7F07D064 8DCE1998 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0AFA58 7F07D068 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 0AFA5C 7F07D06C 24010001 */ li $at, 1 -/* 0AFA60 7F07D070 AFBF002C */ sw $ra, 0x2c($sp) -/* 0AFA64 7F07D074 AFA40098 */ sw $a0, 0x98($sp) -/* 0AFA68 7F07D078 AFA5009C */ sw $a1, 0x9c($sp) -/* 0AFA6C 7F07D07C 15C1000B */ bne $t6, $at, .L7F07D0AC -/* 0AFA70 7F07D080 AFA00094 */ sw $zero, 0x94($sp) -/* 0AFA74 7F07D084 3C0F8007 */ lui $t7, %hi(g_EnterTankAudioState) # $t7, 0x8007 -/* 0AFA78 7F07D088 8DEF8498 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0AFA7C 7F07D08C 3C058003 */ lui $a1, %hi(g_TankOrientationAngle) # $a1, 0x8003 -/* 0AFA80 7F07D090 8FA6009C */ lw $a2, 0x9c($sp) -/* 0AFA84 7F07D094 11E00005 */ beqz $t7, .L7F07D0AC -/* 0AFA88 7F07D098 00000000 */ nop -/* 0AFA8C 7F07D09C 0FC1F3AA */ jal sub_GAME_7F07CDD4 -/* 0AFA90 7F07D0A0 8CA519B4 */ lw $a1, %lo(g_TankOrientationAngle)($a1) -/* 0AFA94 7F07D0A4 10000093 */ b .L7F07D2F4 -/* 0AFA98 7F07D0A8 AFA20094 */ sw $v0, 0x94($sp) -.L7F07D0AC: -/* 0AFA9C 7F07D0AC 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFAA0 7F07D0B0 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AFAA4 7F07D0B4 3C198003 */ lui $t9, %hi(obj_collision_flag) # $t9, 0x8003 -/* 0AFAA8 7F07D0B8 8F391A18 */ lw $t9, %lo(obj_collision_flag)($t9) -/* 0AFAAC 7F07D0BC 8C780488 */ lw $t8, 0x488($v1) -/* 0AFAB0 7F07D0C0 27A50080 */ addiu $a1, $sp, 0x80 -/* 0AFAB4 7F07D0C4 13200004 */ beqz $t9, .L7F07D0D8 -/* 0AFAB8 7F07D0C8 AFB80090 */ sw $t8, 0x90($sp) -/* 0AFABC 7F07D0CC 2408001F */ li $t0, 31 -/* 0AFAC0 7F07D0D0 10000002 */ b .L7F07D0DC -/* 0AFAC4 7F07D0D4 AFA8008C */ sw $t0, 0x8c($sp) -.L7F07D0D8: -/* 0AFAC8 7F07D0D8 AFA0008C */ sw $zero, 0x8c($sp) -.L7F07D0DC: -/* 0AFACC 7F07D0DC 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0AFAD0 7F07D0E0 27A60088 */ addiu $a2, $sp, 0x88 -/* 0AFAD4 7F07D0E4 0FC22910 */ jal bondviewCollisionRadiusRelated -/* 0AFAD8 7F07D0E8 27A70084 */ addiu $a3, $sp, 0x84 -/* 0AFADC 7F07D0EC 3C048003 */ lui $a0, %hi(D_8003644C) # $a0, 0x8003 -/* 0AFAE0 7F07D0F0 8C84199C */ lw $a0, %lo(D_8003644C)($a0) -/* 0AFAE4 7F07D0F4 10800003 */ beqz $a0, .L7F07D104 -/* 0AFAE8 7F07D0F8 00000000 */ nop -/* 0AFAEC 7F07D0FC 0FC0F446 */ jal sub_GAME_7F03D058 -/* 0AFAF0 7F07D100 00002825 */ move $a1, $zero -.L7F07D104: -/* 0AFAF4 7F07D104 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0AFAF8 7F07D108 8D298BC0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0AFAFC 7F07D10C 00002825 */ move $a1, $zero -/* 0AFB00 7F07D110 0FC0F446 */ jal sub_GAME_7F03D058 -/* 0AFB04 7F07D114 8D2400A8 */ lw $a0, 0xa8($t1) -/* 0AFB08 7F07D118 8FA20098 */ lw $v0, 0x98($sp) -/* 0AFB0C 7F07D11C 27AA003C */ addiu $t2, $sp, 0x3c -/* 0AFB10 7F07D120 27A40090 */ addiu $a0, $sp, 0x90 -/* 0AFB14 7F07D124 8C450000 */ lw $a1, ($v0) -/* 0AFB18 7F07D128 8C460008 */ lw $a2, 8($v0) -/* 0AFB1C 7F07D12C AFAA0010 */ sw $t2, 0x10($sp) -/* 0AFB20 7F07D130 0FC2C575 */ jal stanTileDistanceRelated -/* 0AFB24 7F07D134 8FA70080 */ lw $a3, 0x80($sp) -/* 0AFB28 7F07D138 AFA2007C */ sw $v0, 0x7c($sp) -/* 0AFB2C 7F07D13C 0FC2C597 */ jal stanGetLocusField0 -/* 0AFB30 7F07D140 27A4003C */ addiu $a0, $sp, 0x3c -/* 0AFB34 7F07D144 10400004 */ beqz $v0, .L7F07D158 -/* 0AFB38 7F07D148 27A40090 */ addiu $a0, $sp, 0x90 -/* 0AFB3C 7F07D14C 3C0B8007 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8007 -/* 0AFB40 7F07D150 8D6B8BC0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0AFB44 7F07D154 AD6029F4 */ sw $zero, 0x29f4($t3) -.L7F07D158: -/* 0AFB48 7F07D158 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFB4C 7F07D15C 8FA20098 */ lw $v0, 0x98($sp) -/* 0AFB50 7F07D160 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AFB54 7F07D164 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0AFB58 7F07D168 C4440008 */ lwc1 $f4, 8($v0) -/* 0AFB5C 7F07D16C 8C470000 */ lw $a3, ($v0) -/* 0AFB60 7F07D170 8C65048C */ lw $a1, 0x48c($v1) -/* 0AFB64 7F07D174 8C660494 */ lw $a2, 0x494($v1) -/* 0AFB68 7F07D178 44818000 */ mtc1 $at, $f16 -/* 0AFB6C 7F07D17C 8FAC008C */ lw $t4, 0x8c($sp) -/* 0AFB70 7F07D180 C7A60088 */ lwc1 $f6, 0x88($sp) -/* 0AFB74 7F07D184 C7A80084 */ lwc1 $f8, 0x84($sp) -/* 0AFB78 7F07D188 44805000 */ mtc1 $zero, $f10 -/* 0AFB7C 7F07D18C E7A40010 */ swc1 $f4, 0x10($sp) -/* 0AFB80 7F07D190 AFAC0014 */ sw $t4, 0x14($sp) -/* 0AFB84 7F07D194 E7B00024 */ swc1 $f16, 0x24($sp) -/* 0AFB88 7F07D198 E7A60018 */ swc1 $f6, 0x18($sp) -/* 0AFB8C 7F07D19C E7A8001C */ swc1 $f8, 0x1c($sp) -/* 0AFB90 7F07D1A0 0FC2C039 */ jal sub_GAME_7F0B0E24 -/* 0AFB94 7F07D1A4 E7AA0020 */ swc1 $f10, 0x20($sp) -/* 0AFB98 7F07D1A8 10400035 */ beqz $v0, .L7F07D280 -/* 0AFB9C 7F07D1AC 27A40090 */ addiu $a0, $sp, 0x90 -/* 0AFBA0 7F07D1B0 8FA20098 */ lw $v0, 0x98($sp) -/* 0AFBA4 7F07D1B4 8FAD008C */ lw $t5, 0x8c($sp) -/* 0AFBA8 7F07D1B8 C7B20088 */ lwc1 $f18, 0x88($sp) -/* 0AFBAC 7F07D1BC C7A40084 */ lwc1 $f4, 0x84($sp) -/* 0AFBB0 7F07D1C0 8C450000 */ lw $a1, ($v0) -/* 0AFBB4 7F07D1C4 8C460008 */ lw $a2, 8($v0) -/* 0AFBB8 7F07D1C8 8FA70080 */ lw $a3, 0x80($sp) -/* 0AFBBC 7F07D1CC AFAD0010 */ sw $t5, 0x10($sp) -/* 0AFBC0 7F07D1D0 E7B20014 */ swc1 $f18, 0x14($sp) -/* 0AFBC4 7F07D1D4 0FC2C2DE */ jal sub_GAME_7F0B18B8 -/* 0AFBC8 7F07D1D8 E7A40018 */ swc1 $f4, 0x18($sp) -/* 0AFBCC 7F07D1DC 04410028 */ bgez $v0, .L7F07D280 -/* 0AFBD0 7F07D1E0 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFBD4 7F07D1E4 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AFBD8 7F07D1E8 3C01C2C8 */ li $at, 0xC2C80000 # -100.000000 -/* 0AFBDC 7F07D1EC 44813000 */ mtc1 $at, $f6 -/* 0AFBE0 7F07D1F0 C46800A0 */ lwc1 $f8, 0xa0($v1) -/* 0AFBE4 7F07D1F4 8FAE007C */ lw $t6, 0x7c($sp) -/* 0AFBE8 7F07D1F8 46083032 */ c.eq.s $f6, $f8 -/* 0AFBEC 7F07D1FC 00000000 */ nop -/* 0AFBF0 7F07D200 45010003 */ bc1t .L7F07D210 -/* 0AFBF4 7F07D204 00000000 */ nop -/* 0AFBF8 7F07D208 05C1001F */ bgez $t6, .L7F07D288 -/* 0AFBFC 7F07D20C 00000000 */ nop -.L7F07D210: -/* 0AFC00 7F07D210 0FC2C599 */ jal stanGetLocusCount -/* 0AFC04 7F07D214 27A4003C */ addiu $a0, $sp, 0x3c -/* 0AFC08 7F07D218 14400011 */ bnez $v0, .L7F07D260 -/* 0AFC0C 7F07D21C 27A40090 */ addiu $a0, $sp, 0x90 -/* 0AFC10 7F07D220 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0AFC14 7F07D224 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0AFC18 7F07D228 3C01432F */ li $at, 0x432F0000 # 175.000000 -/* 0AFC1C 7F07D22C 44818000 */ mtc1 $at, $f16 -/* 0AFC20 7F07D230 C70A0490 */ lwc1 $f10, 0x490($t8) -/* 0AFC24 7F07D234 8FAF0098 */ lw $t7, 0x98($sp) -/* 0AFC28 7F07D238 8FA70080 */ lw $a3, 0x80($sp) -/* 0AFC2C 7F07D23C 46105480 */ add.s $f18, $f10, $f16 -/* 0AFC30 7F07D240 8DE50000 */ lw $a1, ($t7) -/* 0AFC34 7F07D244 8DE60008 */ lw $a2, 8($t7) -/* 0AFC38 7F07D248 0FC2C65E */ jal sub_GAME_7F0B26B8 -/* 0AFC3C 7F07D24C E7B20010 */ swc1 $f18, 0x10($sp) -/* 0AFC40 7F07D250 04400003 */ bltz $v0, .L7F07D260 -/* 0AFC44 7F07D254 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFC48 7F07D258 1000000B */ b .L7F07D288 -/* 0AFC4C 7F07D25C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07D260: -/* 0AFC50 7F07D260 8FB90090 */ lw $t9, 0x90($sp) -/* 0AFC54 7F07D264 8FA8009C */ lw $t0, 0x9c($sp) -/* 0AFC58 7F07D268 24090001 */ li $t1, 1 -/* 0AFC5C 7F07D26C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFC60 7F07D270 AD190000 */ sw $t9, ($t0) -/* 0AFC64 7F07D274 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0AFC68 7F07D278 10000015 */ b .L7F07D2D0 -/* 0AFC6C 7F07D27C AFA90094 */ sw $t1, 0x94($sp) -.L7F07D280: -/* 0AFC70 7F07D280 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0AFC74 7F07D284 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07D288: -/* 0AFC78 7F07D288 3C0A8003 */ lui $t2, %hi(ptr_playerstank) # $t2, 0x8003 -/* 0AFC7C 7F07D28C 8D4A19A0 */ lw $t2, %lo(ptr_playerstank)($t2) -/* 0AFC80 7F07D290 3C028007 */ lui $v0, %hi(stanSavedColl_posData) # $v0, 0x8007 -/* 0AFC84 7F07D294 5540000F */ bnezl $t2, .L7F07D2D4 -/* 0AFC88 7F07D298 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0AFC8C 7F07D29C 8C429954 */ lw $v0, %lo(stanSavedColl_posData)($v0) -/* 0AFC90 7F07D2A0 5040000C */ beql $v0, $zero, .L7F07D2D4 -/* 0AFC94 7F07D2A4 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0AFC98 7F07D2A8 904B0000 */ lbu $t3, ($v0) -/* 0AFC9C 7F07D2AC 24010001 */ li $at, 1 -/* 0AFCA0 7F07D2B0 55610008 */ bnel $t3, $at, .L7F07D2D4 -/* 0AFCA4 7F07D2B4 8C6400A8 */ lw $a0, 0xa8($v1) -/* 0AFCA8 7F07D2B8 8C440004 */ lw $a0, 4($v0) -/* 0AFCAC 7F07D2BC 2401002D */ li $at, 45 -/* 0AFCB0 7F07D2C0 908C0003 */ lbu $t4, 3($a0) -/* 0AFCB4 7F07D2C4 15810002 */ bne $t4, $at, .L7F07D2D0 -/* 0AFCB8 7F07D2C8 3C018003 */ lui $at, %hi(D_8003644C) # $at, 0x8003 -/* 0AFCBC 7F07D2CC AC22199C */ sw $v0, %lo(D_8003644C)($at) -.L7F07D2D0: -/* 0AFCC0 7F07D2D0 8C6400A8 */ lw $a0, 0xa8($v1) -.L7F07D2D4: -/* 0AFCC4 7F07D2D4 0FC0F446 */ jal sub_GAME_7F03D058 -/* 0AFCC8 7F07D2D8 24050001 */ li $a1, 1 -/* 0AFCCC 7F07D2DC 3C048003 */ lui $a0, %hi(D_8003644C) # $a0, 0x8003 -/* 0AFCD0 7F07D2E0 8C84199C */ lw $a0, %lo(D_8003644C)($a0) -/* 0AFCD4 7F07D2E4 50800004 */ beql $a0, $zero, .L7F07D2F8 -/* 0AFCD8 7F07D2E8 8FBF002C */ lw $ra, 0x2c($sp) -/* 0AFCDC 7F07D2EC 0FC0F446 */ jal sub_GAME_7F03D058 -/* 0AFCE0 7F07D2F0 24050001 */ li $a1, 1 -.L7F07D2F4: -/* 0AFCE4 7F07D2F4 8FBF002C */ lw $ra, 0x2c($sp) -.L7F07D2F8: -/* 0AFCE8 7F07D2F8 8FA20094 */ lw $v0, 0x94($sp) -/* 0AFCEC 7F07D2FC 27BD0098 */ addiu $sp, $sp, 0x98 -/* 0AFCF0 7F07D300 03E00008 */ jr $ra -/* 0AFCF4 7F07D304 00000000 */ nop -) -#endif -#endif - - /** * Calculates collision with current player. * + * @param next_pos: 3d coordinate to attempt to move to. + * @param collision_pt0: Out parameter. Will set {x,0,z} position of first point (from line edge) if Bond is in collision, otherwise {0}. + * @param collision_pt1: Out parameter. Will set {x,0,z} position of second point (from line edge) if Bond is in collision, otherwise ... Bond's look angle? + * + * @return 1 if able to update stan and collision position, zero otherwise. + * * Address 0x7F07D234. */ -s32 bondviewUpdatePlayerCollision(coord3d *arg0, coord3d *arg1, coord3d *arg2) +s32 bondviewTrySimpleMovePlayerCollision(coord3d *next_pos, coord3d *collision_pt0, coord3d *collision_pt1) { - struct StandTile *sp1C; + struct StandTile *stan; // resets stan global collision variables sub_GAME_7F0B1CC4(); - if (cal_player_collision(arg0, &sp1C) != 0) + if (bondviewTryMoveToStan(next_pos, &stan) != 0) { - g_CurrentPlayer->field_488.current_tile_ptr = sp1C; - g_CurrentPlayer->field_488.collision_position.f[0] = arg0->f[0]; - g_CurrentPlayer->field_488.collision_position.f[2] = arg0->f[2]; + g_CurrentPlayer->field_488.current_tile_ptr = stan; + g_CurrentPlayer->field_488.collision_position.f[0] = next_pos->f[0]; + g_CurrentPlayer->field_488.collision_position.f[2] = next_pos->f[2]; return 1; } - // unused? - getCollisionEdge_maybe(arg1, arg2); + getCollisionEdge_maybe(collision_pt0, collision_pt1); return 0; } - -#ifdef NONMATCHING -void sub_GAME_7F07D2B4(void) { - +/** + * This is a fallback method used when bondviewTrySimpleMovePlayerCollision fails. + * Instead of moving to the full coordinate specified by `next_pos`, it will + * scale the position using `unkGeometry7F0B33DC` and try to move to that position. + * + * @param next_pos: 3d coordinate to attempt to move to. + * @param collision1_pt0: Prior collision point 0. + * @param collision1_pt1: Prior collision point 1. + * @param collision2_pt0: Out parameter. Will set {x,0,z} position of first point (from line edge) if Bond is in collision, otherwise {0}. + * @param collision2_pt1: Out parameter. Will set {x,0,z} position of second point (from line edge) if Bond is in collision, otherwise ... Bond's look angle? + * + * @return 1 if able to update stan and collision position, zero if still unable to move by failing on the same collision edge, -1 otherwise (still unable to move). + * + * US address 7F07D2B4. + * Perfect Dark, see bondwalk.c bwalk0f0c47d0, bondbike.c bbike0f0d36d4. +*/ +s32 bondviewTryFractionMovePlayerCollision( + struct coord3d *next_pos, + struct coord3d *collision1_pt0, + struct coord3d *collision1_pt1, + struct coord3d *collision2_pt0, + struct coord3d *collision2_pt1) +{ + StandTile *stan; + f32 height; + f32 always_30; + struct coord3d try_next_pos; + struct coord3d delta_pos; + struct coord3d sp50; + struct coord2d sp48; + struct coord2d sp40; + struct coord2d sp38; + f32 temp_f0; + f32 collision_radius; + + bondviewGetCollisionRadius(g_CurrentPlayer->prop, &collision_radius, &height, &always_30); + + delta_pos.f[0] = next_pos->f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + delta_pos.f[2] = next_pos->f[2] - g_CurrentPlayer->field_488.collision_position.f[2]; + + sp50.f[0] = collision_radius; + sp50.f[1] = g_CurrentPlayer->field_488.collision_position.f[0]; + sp50.f[2] = g_CurrentPlayer->field_488.collision_position.f[2]; + + sp48.f[0] = collision1_pt0->f[0]; + sp48.f[1] = collision1_pt0->f[2]; + + sp40.f[0] = collision1_pt1->f[0]; + sp40.f[1] = collision1_pt1->f[2]; + + sp38.f[0] = delta_pos.f[0]; + sp38.f[1] = delta_pos.f[2]; + + temp_f0 = unkGeometry7F0B33DC(&sp50, &sp48, &sp40, &sp38); + + try_next_pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + (delta_pos.f[0] * temp_f0 * 0.25f); + try_next_pos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + (delta_pos.f[2] * temp_f0 * 0.25f); + + if (bondviewTryMoveToStan(&try_next_pos, &stan) != 0) + { + g_CurrentPlayer->field_488.current_tile_ptr = stan; + g_CurrentPlayer->field_488.collision_position.f[0] = try_next_pos.f[0]; + g_CurrentPlayer->field_488.collision_position.f[2] = try_next_pos.f[2]; + + return 1; + } + + getCollisionEdge_maybe(collision2_pt0, collision2_pt1); + + if (collision2_pt0->f[0] != collision1_pt0->f[0] + || collision2_pt0->f[1] != collision1_pt0->f[1] + || collision2_pt0->f[2] != collision1_pt0->f[2] + || collision2_pt1->f[0] != collision1_pt1->f[0] + || collision2_pt1->f[1] != collision1_pt1->f[1] + || collision2_pt1->f[2] != collision1_pt1->f[2]) + { + return 0; + } + + return -1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F07D2B4 -/* 0B1DE4 7F07D2B4 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 0B1DE8 7F07D2B8 AFB00018 */ sw $s0, 0x18($sp) -/* 0B1DEC 7F07D2BC 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 0B1DF0 7F07D2C0 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 0B1DF4 7F07D2C4 8E0E0000 */ lw $t6, ($s0) -/* 0B1DF8 7F07D2C8 AFB20020 */ sw $s2, 0x20($sp) -/* 0B1DFC 7F07D2CC AFB1001C */ sw $s1, 0x1c($sp) -/* 0B1E00 7F07D2D0 00A08825 */ move $s1, $a1 -/* 0B1E04 7F07D2D4 00C09025 */ move $s2, $a2 -/* 0B1E08 7F07D2D8 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B1E0C 7F07D2DC AFA40080 */ sw $a0, 0x80($sp) -/* 0B1E10 7F07D2E0 AFA7008C */ sw $a3, 0x8c($sp) -/* 0B1E14 7F07D2E4 27A70074 */ addiu $a3, $sp, 0x74 -/* 0B1E18 7F07D2E8 27A60078 */ addiu $a2, $sp, 0x78 -/* 0B1E1C 7F07D2EC 27A50030 */ addiu $a1, $sp, 0x30 -/* 0B1E20 7F07D2F0 0FC2289D */ jal bondviewCollisionRadiusRelated -/* 0B1E24 7F07D2F4 8DC400A8 */ lw $a0, 0xa8($t6) -/* 0B1E28 7F07D2F8 8FA30080 */ lw $v1, 0x80($sp) -/* 0B1E2C 7F07D2FC 8E020000 */ lw $v0, ($s0) -/* 0B1E30 7F07D300 27A40050 */ addiu $a0, $sp, 0x50 -/* 0B1E34 7F07D304 C4640000 */ lwc1 $f4, ($v1) -/* 0B1E38 7F07D308 C446048C */ lwc1 $f6, 0x48c($v0) -/* 0B1E3C 7F07D30C 27A50048 */ addiu $a1, $sp, 0x48 -/* 0B1E40 7F07D310 27A60040 */ addiu $a2, $sp, 0x40 -/* 0B1E44 7F07D314 46062201 */ sub.s $f8, $f4, $f6 -/* 0B1E48 7F07D318 C7A40030 */ lwc1 $f4, 0x30($sp) -/* 0B1E4C 7F07D31C 27A70038 */ addiu $a3, $sp, 0x38 -/* 0B1E50 7F07D320 E7A8005C */ swc1 $f8, 0x5c($sp) -/* 0B1E54 7F07D324 C46A0008 */ lwc1 $f10, 8($v1) -/* 0B1E58 7F07D328 C4500494 */ lwc1 $f16, 0x494($v0) -/* 0B1E5C 7F07D32C E7A40050 */ swc1 $f4, 0x50($sp) -/* 0B1E60 7F07D330 46105481 */ sub.s $f18, $f10, $f16 -/* 0B1E64 7F07D334 E7B20064 */ swc1 $f18, 0x64($sp) -/* 0B1E68 7F07D338 C446048C */ lwc1 $f6, 0x48c($v0) -/* 0B1E6C 7F07D33C E7A60054 */ swc1 $f6, 0x54($sp) -/* 0B1E70 7F07D340 C4480494 */ lwc1 $f8, 0x494($v0) -/* 0B1E74 7F07D344 C7A6005C */ lwc1 $f6, 0x5c($sp) -/* 0B1E78 7F07D348 E7A80058 */ swc1 $f8, 0x58($sp) -/* 0B1E7C 7F07D34C C62A0000 */ lwc1 $f10, ($s1) -/* 0B1E80 7F07D350 C7A80064 */ lwc1 $f8, 0x64($sp) -/* 0B1E84 7F07D354 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 0B1E88 7F07D358 C6300008 */ lwc1 $f16, 8($s1) -/* 0B1E8C 7F07D35C E7B0004C */ swc1 $f16, 0x4c($sp) -/* 0B1E90 7F07D360 C6520000 */ lwc1 $f18, ($s2) -/* 0B1E94 7F07D364 E7B20040 */ swc1 $f18, 0x40($sp) -/* 0B1E98 7F07D368 C6440008 */ lwc1 $f4, 8($s2) -/* 0B1E9C 7F07D36C E7A60038 */ swc1 $f6, 0x38($sp) -/* 0B1EA0 7F07D370 E7A8003C */ swc1 $f8, 0x3c($sp) -/* 0B1EA4 7F07D374 0FC2CCF7 */ jal sub_GAME_7F0B33DC -/* 0B1EA8 7F07D378 E7A40044 */ swc1 $f4, 0x44($sp) -/* 0B1EAC 7F07D37C C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 0B1EB0 7F07D380 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B1EB4 7F07D384 44811000 */ mtc1 $at, $f2 -/* 0B1EB8 7F07D388 46005402 */ mul.s $f16, $f10, $f0 -/* 0B1EBC 7F07D38C C7A80064 */ lwc1 $f8, 0x64($sp) -/* 0B1EC0 7F07D390 8E020000 */ lw $v0, ($s0) -/* 0B1EC4 7F07D394 27A40068 */ addiu $a0, $sp, 0x68 -/* 0B1EC8 7F07D398 27A5007C */ addiu $a1, $sp, 0x7c -/* 0B1ECC 7F07D39C C444048C */ lwc1 $f4, 0x48c($v0) -/* 0B1ED0 7F07D3A0 46028482 */ mul.s $f18, $f16, $f2 -/* 0B1ED4 7F07D3A4 00000000 */ nop -/* 0B1ED8 7F07D3A8 46004282 */ mul.s $f10, $f8, $f0 -/* 0B1EDC 7F07D3AC 46049180 */ add.s $f6, $f18, $f4 -/* 0B1EE0 7F07D3B0 46025402 */ mul.s $f16, $f10, $f2 -/* 0B1EE4 7F07D3B4 E7A60068 */ swc1 $f6, 0x68($sp) -/* 0B1EE8 7F07D3B8 C4520494 */ lwc1 $f18, 0x494($v0) -/* 0B1EEC 7F07D3BC 46128100 */ add.s $f4, $f16, $f18 -/* 0B1EF0 7F07D3C0 0FC1F3E3 */ jal cal_player_collision -/* 0B1EF4 7F07D3C4 E7A40070 */ swc1 $f4, 0x70($sp) -/* 0B1EF8 7F07D3C8 1040000B */ beqz $v0, .L7F07D3F8 -/* 0B1EFC 7F07D3CC 8FAF007C */ lw $t7, 0x7c($sp) -/* 0B1F00 7F07D3D0 8E180000 */ lw $t8, ($s0) -/* 0B1F04 7F07D3D4 24020001 */ li $v0, 1 -/* 0B1F08 7F07D3D8 AF0F0488 */ sw $t7, 0x488($t8) -/* 0B1F0C 7F07D3DC 8E190000 */ lw $t9, ($s0) -/* 0B1F10 7F07D3E0 C7A60068 */ lwc1 $f6, 0x68($sp) -/* 0B1F14 7F07D3E4 E726048C */ swc1 $f6, 0x48c($t9) -/* 0B1F18 7F07D3E8 8E080000 */ lw $t0, ($s0) -/* 0B1F1C 7F07D3EC C7A80070 */ lwc1 $f8, 0x70($sp) -/* 0B1F20 7F07D3F0 1000002D */ b .L7F07D4A8 -/* 0B1F24 7F07D3F4 E5080494 */ swc1 $f8, 0x494($t0) -.L7F07D3F8: -/* 0B1F28 7F07D3F8 8FB00090 */ lw $s0, 0x90($sp) -/* 0B1F2C 7F07D3FC 8FA4008C */ lw $a0, 0x8c($sp) -/* 0B1F30 7F07D400 0FC2CA2C */ jal getCollisionEdge_maybe -/* 0B1F34 7F07D404 02002825 */ move $a1, $s0 -/* 0B1F38 7F07D408 8FA3008C */ lw $v1, 0x8c($sp) -/* 0B1F3C 7F07D40C C6300000 */ lwc1 $f16, ($s1) -/* 0B1F40 7F07D410 C46A0000 */ lwc1 $f10, ($v1) -/* 0B1F44 7F07D414 46105032 */ c.eq.s $f10, $f16 -/* 0B1F48 7F07D418 00000000 */ nop -/* 0B1F4C 7F07D41C 45000020 */ bc1f .L7F07D4A0 -/* 0B1F50 7F07D420 00000000 */ nop -/* 0B1F54 7F07D424 C4720004 */ lwc1 $f18, 4($v1) -/* 0B1F58 7F07D428 C6240004 */ lwc1 $f4, 4($s1) -/* 0B1F5C 7F07D42C 46049032 */ c.eq.s $f18, $f4 -/* 0B1F60 7F07D430 00000000 */ nop -/* 0B1F64 7F07D434 4500001A */ bc1f .L7F07D4A0 -/* 0B1F68 7F07D438 00000000 */ nop -/* 0B1F6C 7F07D43C C4660008 */ lwc1 $f6, 8($v1) -/* 0B1F70 7F07D440 C6280008 */ lwc1 $f8, 8($s1) -/* 0B1F74 7F07D444 46083032 */ c.eq.s $f6, $f8 -/* 0B1F78 7F07D448 00000000 */ nop -/* 0B1F7C 7F07D44C 45000014 */ bc1f .L7F07D4A0 -/* 0B1F80 7F07D450 00000000 */ nop -/* 0B1F84 7F07D454 C60A0000 */ lwc1 $f10, ($s0) -/* 0B1F88 7F07D458 C6500000 */ lwc1 $f16, ($s2) -/* 0B1F8C 7F07D45C 46105032 */ c.eq.s $f10, $f16 -/* 0B1F90 7F07D460 00000000 */ nop -/* 0B1F94 7F07D464 4500000E */ bc1f .L7F07D4A0 -/* 0B1F98 7F07D468 00000000 */ nop -/* 0B1F9C 7F07D46C C6120004 */ lwc1 $f18, 4($s0) -/* 0B1FA0 7F07D470 C6440004 */ lwc1 $f4, 4($s2) -/* 0B1FA4 7F07D474 46049032 */ c.eq.s $f18, $f4 -/* 0B1FA8 7F07D478 00000000 */ nop -/* 0B1FAC 7F07D47C 45000008 */ bc1f .L7F07D4A0 -/* 0B1FB0 7F07D480 00000000 */ nop -/* 0B1FB4 7F07D484 C6060008 */ lwc1 $f6, 8($s0) -/* 0B1FB8 7F07D488 C6480008 */ lwc1 $f8, 8($s2) -/* 0B1FBC 7F07D48C 2402FFFF */ li $v0, -1 -/* 0B1FC0 7F07D490 46083032 */ c.eq.s $f6, $f8 -/* 0B1FC4 7F07D494 00000000 */ nop -/* 0B1FC8 7F07D498 45010003 */ bc1t .L7F07D4A8 -/* 0B1FCC 7F07D49C 00000000 */ nop -.L7F07D4A0: -/* 0B1FD0 7F07D4A0 10000001 */ b .L7F07D4A8 -/* 0B1FD4 7F07D4A4 00001025 */ move $v0, $zero -.L7F07D4A8: -/* 0B1FD8 7F07D4A8 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B1FDC 7F07D4AC 8FB00018 */ lw $s0, 0x18($sp) -/* 0B1FE0 7F07D4B0 8FB1001C */ lw $s1, 0x1c($sp) -/* 0B1FE4 7F07D4B4 8FB20020 */ lw $s2, 0x20($sp) -/* 0B1FE8 7F07D4B8 03E00008 */ jr $ra -/* 0B1FEC 7F07D4BC 27BD0080 */ addiu $sp, $sp, 0x80 -) -#endif +/** + * This is a fallback method used when bondviewTrySimpleMovePlayerCollision fails. + * Instead of moving to the full coordinate specified by `next_pos`, it will + * attempt to move along the collision edge. + * + * @param prior_next_pos: Prior 3d coordinate that Bond failed to move to. + * @param collision1_pt0: Prior collision point 0. + * @param collision1_pt1: Prior collision point 1. + * + * @return -1 if either x or z coordinates are the same for the collision points, 1 if able to update stan and collision position, zero otherwise. + * + * US address 7F07D4C0. + */ +s32 bondviewTryEdgeMovePlayerCollision(struct coord3d *prior_next_pos, struct coord3d *collision_pt0, struct coord3d *collision_pt1) +{ + struct coord3d delta_pos; + f32 tempf; + struct coord3d norm_collision_edge; + struct coord3d try_next_pos; + StandTile *stan; -#ifdef NONMATCHING -void sub_GAME_7F07D4C0(void *arg0, void *arg1, void *arg2) { - ?32 sp24; - f32 sp28; - f32 sp30; - f32 sp34; - f32 sp3C; - f32 sp44; - f32 sp4C; - f32 temp_f8; - f32 temp_f2; - f32 temp_f4; - f32 temp_f6; - f32 temp_f12; - ? phi_return; + delta_pos.f[0] = prior_next_pos->f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + delta_pos.f[2] = prior_next_pos->f[2] - g_CurrentPlayer->field_488.collision_position.f[2]; - // Node 0 - sp44 = (f32) (*arg0 - g_CurrentPlayer->field_48C); - sp4C = (f32) (arg0->unk8 - g_CurrentPlayer->field_494); - if (*arg1 == *arg2) + if (collision_pt0->f[0] != collision_pt1->f[0] || collision_pt0->f[2] != collision_pt1->f[2]) { - // Node 1 - phi_return = -1; - if (arg1->unk8 == arg2->unk8) + norm_collision_edge.f[0] = collision_pt1->f[0] - collision_pt0->f[0]; + norm_collision_edge.f[2] = collision_pt1->f[2] - collision_pt0->f[2]; + + tempf = (norm_collision_edge.f[0] * norm_collision_edge.f[0]) + (norm_collision_edge.f[2] * norm_collision_edge.f[2]); + tempf = 1.0f / sqrtf(tempf); + norm_collision_edge.f[0] *= tempf; + norm_collision_edge.f[2] *= tempf; + + /** + * Normalizing gives you the direction vector of the wall, so the dot product in the assignment to + * tempf gives you the distance moved along the direction of the wall. + * Then try_next_pos is simply the point of the collision with the wall, plus the + * length moved along the wall times the direction vector of the wall. + **/ + tempf = (delta_pos.f[0] * norm_collision_edge.f[0]) + (delta_pos.f[2] * norm_collision_edge.f[2]); + try_next_pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + (tempf * norm_collision_edge.f[0]); + try_next_pos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + (tempf * norm_collision_edge.f[2]); + + if (bondviewTryMoveToStan(&try_next_pos, &stan)) { - // Node 5 - return phi_return; + g_CurrentPlayer->field_488.current_tile_ptr = stan; + g_CurrentPlayer->field_488.collision_position.f[0] = try_next_pos.f[0]; + g_CurrentPlayer->field_488.collision_position.f[2] = try_next_pos.f[2]; + + return 1; } + + return 0; } - // Node 2 - temp_f8 = (*arg2 - *arg1); - sp34 = temp_f8; - sp3C = (f32) (arg2->unk8 - arg1->unk8); - temp_f2 = (1.0f / sqrtf(((sp3C * sp3C) + (temp_f8 * temp_f8)))); - temp_f4 = (sp34 * temp_f2); - temp_f6 = (sp3C * temp_f2); - sp34 = temp_f4; - sp3C = temp_f6; - temp_f12 = ((temp_f6 * sp4C) + (sp44 * temp_f4)); - sp28 = (f32) ((temp_f4 * temp_f12) + g_CurrentPlayer->field_48C); - sp30 = (f32) ((temp_f6 * temp_f12) + g_CurrentPlayer->field_494); - if (cal_player_collision(temp_f12, &sp28, &sp24) == 0) - { - // Node 4 - phi_return = 0; - // Node 5 - return phi_return; - } - // Node 3 - g_CurrentPlayer->field_488 = sp24; - g_CurrentPlayer->field_48C = sp28; - g_CurrentPlayer->field_494 = sp30; - return phi_return; + + return -1; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F07D4C0 -/* 0B1FF0 7F07D4C0 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B1FF4 7F07D4C4 2463A0B0 */ addiu $v1, %lo(g_CurrentPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B1FF8 7F07D4C8 8C620000 */ lw $v0, ($v1) -/* 0B1FFC 7F07D4CC 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 0B2000 7F07D4D0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B2004 7F07D4D4 C4840000 */ lwc1 $f4, ($a0) -/* 0B2008 7F07D4D8 C446048C */ lwc1 $f6, 0x48c($v0) -/* 0B200C 7F07D4DC 46062201 */ sub.s $f8, $f4, $f6 -/* 0B2010 7F07D4E0 E7A80044 */ swc1 $f8, 0x44($sp) -/* 0B2014 7F07D4E4 C48A0008 */ lwc1 $f10, 8($a0) -/* 0B2018 7F07D4E8 C4500494 */ lwc1 $f16, 0x494($v0) -/* 0B201C 7F07D4EC 46105481 */ sub.s $f18, $f10, $f16 -/* 0B2020 7F07D4F0 E7B2004C */ swc1 $f18, 0x4c($sp) -/* 0B2024 7F07D4F4 C4C20000 */ lwc1 $f2, ($a2) -/* 0B2028 7F07D4F8 C4A00000 */ lwc1 $f0, ($a1) -/* 0B202C 7F07D4FC 46020032 */ c.eq.s $f0, $f2 -/* 0B2030 7F07D500 00000000 */ nop -/* 0B2034 7F07D504 45020009 */ bc1fl .L7F07D52C -/* 0B2038 7F07D508 46001201 */ sub.s $f8, $f2, $f0 -/* 0B203C 7F07D50C C4A40008 */ lwc1 $f4, 8($a1) -/* 0B2040 7F07D510 C4C60008 */ lwc1 $f6, 8($a2) -/* 0B2044 7F07D514 2402FFFF */ li $v0, -1 -/* 0B2048 7F07D518 46062032 */ c.eq.s $f4, $f6 -/* 0B204C 7F07D51C 00000000 */ nop -/* 0B2050 7F07D520 4501003A */ bc1t .L7F07D60C -/* 0B2054 7F07D524 00000000 */ nop -/* 0B2058 7F07D528 46001201 */ sub.s $f8, $f2, $f0 -.L7F07D52C: -/* 0B205C 7F07D52C E7A80034 */ swc1 $f8, 0x34($sp) -/* 0B2060 7F07D530 C4B00008 */ lwc1 $f16, 8($a1) -/* 0B2064 7F07D534 C4CA0008 */ lwc1 $f10, 8($a2) -/* 0B2068 7F07D538 C7A80034 */ lwc1 $f8, 0x34($sp) -/* 0B206C 7F07D53C 46105481 */ sub.s $f18, $f10, $f16 -/* 0B2070 7F07D540 E7B2003C */ swc1 $f18, 0x3c($sp) -/* 0B2074 7F07D544 C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 0B2078 7F07D548 46042182 */ mul.s $f6, $f4, $f4 -/* 0B207C 7F07D54C 00000000 */ nop -/* 0B2080 7F07D550 46084282 */ mul.s $f10, $f8, $f8 -/* 0B2084 7F07D554 0C007DF8 */ jal sqrtf -/* 0B2088 7F07D558 460A3300 */ add.s $f12, $f6, $f10 -/* 0B208C 7F07D55C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B2090 7F07D560 44818000 */ mtc1 $at, $f16 -/* 0B2094 7F07D564 C7B20034 */ lwc1 $f18, 0x34($sp) -/* 0B2098 7F07D568 C7A8003C */ lwc1 $f8, 0x3c($sp) -/* 0B209C 7F07D56C 46008083 */ div.s $f2, $f16, $f0 -/* 0B20A0 7F07D570 C7AA004C */ lwc1 $f10, 0x4c($sp) -/* 0B20A4 7F07D574 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B20A8 7F07D578 2463A0B0 */ addiu $v1, %lo(g_CurrentPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B20AC 7F07D57C 8C620000 */ lw $v0, ($v1) -/* 0B20B0 7F07D580 27A40028 */ addiu $a0, $sp, 0x28 -/* 0B20B4 7F07D584 27A50024 */ addiu $a1, $sp, 0x24 -/* 0B20B8 7F07D588 46029102 */ mul.s $f4, $f18, $f2 -/* 0B20BC 7F07D58C C7B20044 */ lwc1 $f18, 0x44($sp) -/* 0B20C0 7F07D590 46024182 */ mul.s $f6, $f8, $f2 -/* 0B20C4 7F07D594 E7A40034 */ swc1 $f4, 0x34($sp) -/* 0B20C8 7F07D598 460A3402 */ mul.s $f16, $f6, $f10 -/* 0B20CC 7F07D59C E7A6003C */ swc1 $f6, 0x3c($sp) -/* 0B20D0 7F07D5A0 46049202 */ mul.s $f8, $f18, $f4 -/* 0B20D4 7F07D5A4 C452048C */ lwc1 $f18, 0x48c($v0) -/* 0B20D8 7F07D5A8 46088300 */ add.s $f12, $f16, $f8 -/* 0B20DC 7F07D5AC 460C2282 */ mul.s $f10, $f4, $f12 -/* 0B20E0 7F07D5B0 46125400 */ add.s $f16, $f10, $f18 -/* 0B20E4 7F07D5B4 460C3202 */ mul.s $f8, $f6, $f12 -/* 0B20E8 7F07D5B8 E7B00028 */ swc1 $f16, 0x28($sp) -/* 0B20EC 7F07D5BC C4440494 */ lwc1 $f4, 0x494($v0) -/* 0B20F0 7F07D5C0 46044280 */ add.s $f10, $f8, $f4 -/* 0B20F4 7F07D5C4 0FC1F3E3 */ jal cal_player_collision -/* 0B20F8 7F07D5C8 E7AA0030 */ swc1 $f10, 0x30($sp) -/* 0B20FC 7F07D5CC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B2100 7F07D5D0 1040000C */ beqz $v0, .L7F07D604 -/* 0B2104 7F07D5D4 2463A0B0 */ addiu $v1, %lo(g_CurrentPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B2108 7F07D5D8 8FAE0024 */ lw $t6, 0x24($sp) -/* 0B210C 7F07D5DC 8C6F0000 */ lw $t7, ($v1) -/* 0B2110 7F07D5E0 24020001 */ li $v0, 1 -/* 0B2114 7F07D5E4 ADEE0488 */ sw $t6, 0x488($t7) -/* 0B2118 7F07D5E8 8C780000 */ lw $t8, ($v1) -/* 0B211C 7F07D5EC C7B20028 */ lwc1 $f18, 0x28($sp) -/* 0B2120 7F07D5F0 E712048C */ swc1 $f18, 0x48c($t8) -/* 0B2124 7F07D5F4 8C790000 */ lw $t9, ($v1) -/* 0B2128 7F07D5F8 C7B00030 */ lwc1 $f16, 0x30($sp) -/* 0B212C 7F07D5FC 10000003 */ b .L7F07D60C -/* 0B2130 7F07D600 E7300494 */ swc1 $f16, 0x494($t9) -.L7F07D604: -/* 0B2134 7F07D604 10000001 */ b .L7F07D60C -/* 0B2138 7F07D608 00001025 */ move $v0, $zero -.L7F07D60C: -/* 0B213C 7F07D60C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B2140 7F07D610 27BD0050 */ addiu $sp, $sp, 0x50 -/* 0B2144 7F07D614 03E00008 */ jr $ra -/* 0B2148 7F07D618 00000000 */ nop -) -#endif +/** + * This is a fallback method used when bondviewTrySimpleMovePlayerCollision fails. + * If Bond previously failed to move because of a collision, this will check + * if Bond is near the end point of the collision edge. If within the collision + * radius of Bond to the edge endpoint, then allow movement. + * + * @param prior_next_pos: Prior 3d coordinate that Bond failed to move to. + * @param collision1_pt0: Prior collision point 0. + * @param collision1_pt1: Prior collision point 1. + * + * @return 1 if able to update stan and collision position, zero otherwise. + * + * US address 7F07D61C. + * + * Perfect Dark bwalk0f0c4a5c. +*/ +s32 bondviewTryEndHopPlayerCollision(struct coord3d *prior_next_pos, struct coord3d *collision_pt0, struct coord3d *collision_pt1) +{ + struct coord3d delta_pos; + struct coord3d sp50; + struct coord3d try_next_pos; + f32 height; + f32 always_30; + f32 tempf; + StandTile *stan; + f32 collision_radius; + bondviewGetCollisionRadius(g_CurrentPlayer->prop, &collision_radius, &height, &always_30); + + delta_pos.f[0] = prior_next_pos->f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + delta_pos.f[2] = prior_next_pos->f[2] - g_CurrentPlayer->field_488.collision_position.f[2]; -#ifdef NONMATCHING -void sub_GAME_7F07D61C(void) { + sp50.f[0] = collision_pt0->f[0] - prior_next_pos->f[0]; + sp50.f[2] = collision_pt0->f[2] - prior_next_pos->f[2]; + if (((sp50.f[0] * sp50.f[0]) + (sp50.f[2] * sp50.f[2])) <= (collision_radius * collision_radius)) + { + if (collision_pt0->f[0] != g_CurrentPlayer->field_488.collision_position.f[0] || collision_pt0->f[2] != g_CurrentPlayer->field_488.collision_position.f[2]) + { + sp50.f[0] = -(collision_pt0->f[2] - g_CurrentPlayer->field_488.collision_position.f[2]); + sp50.f[2] = collision_pt0->f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + + tempf = (sp50.f[0] * sp50.f[0]) + (sp50.f[2] * sp50.f[2]); + tempf = 1.0f / sqrtf(tempf); + sp50.f[0] *= tempf; + sp50.f[2] *= tempf; + + tempf = (delta_pos.f[0] * sp50.f[0]) + (delta_pos.f[2] * sp50.f[2]); + sp50.f[0] *= tempf; + sp50.f[2] *= tempf; + try_next_pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + (sp50.f[0]); + try_next_pos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + (sp50.f[2]); + + if (bondviewTryMoveToStan(&try_next_pos, &stan)) + { + g_CurrentPlayer->field_488.current_tile_ptr = stan; + g_CurrentPlayer->field_488.collision_position.f[0] = try_next_pos.f[0]; + g_CurrentPlayer->field_488.collision_position.f[2] = try_next_pos.f[2]; + + return 1; + } + } + } + else + { + sp50.f[0] = collision_pt1->f[0] - prior_next_pos->f[0]; + sp50.f[2] = collision_pt1->f[2] - prior_next_pos->f[2]; + + if (((sp50.f[0] * sp50.f[0]) + (sp50.f[2] * sp50.f[2])) <= (collision_radius * collision_radius)) + { + if (collision_pt1->f[0] != g_CurrentPlayer->field_488.collision_position.f[0] || collision_pt1->f[2] != g_CurrentPlayer->field_488.collision_position.f[2]) + { + sp50.f[0] = -(collision_pt1->f[2] - g_CurrentPlayer->field_488.collision_position.f[2]); + sp50.f[2] = collision_pt1->f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + + tempf = (sp50.f[0] * sp50.f[0]) + (sp50.f[2] * sp50.f[2]); + tempf = 1.0f / sqrtf(tempf); + sp50.f[0] *= tempf; + sp50.f[2] *= tempf; + + tempf = (delta_pos.f[0] * sp50.f[0]) + (delta_pos.f[2] * sp50.f[2]); + sp50.f[0] *= tempf; + sp50.f[2] *= tempf; + try_next_pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + (sp50.f[0]); + try_next_pos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + (sp50.f[2]); + + if (bondviewTryMoveToStan(&try_next_pos, &stan)) + { + g_CurrentPlayer->field_488.current_tile_ptr = stan; + g_CurrentPlayer->field_488.collision_position.f[0] = try_next_pos.f[0]; + g_CurrentPlayer->field_488.collision_position.f[2] = try_next_pos.f[2]; + + return 1; + } + } + } + } + + return 0; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F07D61C -/* 0B214C 7F07D61C 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0B2150 7F07D620 AFB30020 */ sw $s3, 0x20($sp) -/* 0B2154 7F07D624 3C138008 */ lui $s3, %hi(g_CurrentPlayer) -/* 0B2158 7F07D628 2673A0B0 */ addiu $s3, %lo(g_CurrentPlayer) # addiu $s3, $s3, -0x5f50 -/* 0B215C 7F07D62C 8E6E0000 */ lw $t6, ($s3) -/* 0B2160 7F07D630 AFB2001C */ sw $s2, 0x1c($sp) -/* 0B2164 7F07D634 AFB10018 */ sw $s1, 0x18($sp) -/* 0B2168 7F07D638 AFB00014 */ sw $s0, 0x14($sp) -/* 0B216C 7F07D63C 00808025 */ move $s0, $a0 -/* 0B2170 7F07D640 00A08825 */ move $s1, $a1 -/* 0B2174 7F07D644 00C09025 */ move $s2, $a2 -/* 0B2178 7F07D648 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B217C 7F07D64C 27A60040 */ addiu $a2, $sp, 0x40 -/* 0B2180 7F07D650 27A50030 */ addiu $a1, $sp, 0x30 -/* 0B2184 7F07D654 27A7003C */ addiu $a3, $sp, 0x3c -/* 0B2188 7F07D658 0FC2289D */ jal bondviewCollisionRadiusRelated -/* 0B218C 7F07D65C 8DC400A8 */ lw $a0, 0xa8($t6) -/* 0B2190 7F07D660 8E620000 */ lw $v0, ($s3) -/* 0B2194 7F07D664 C6040000 */ lwc1 $f4, ($s0) -/* 0B2198 7F07D668 C446048C */ lwc1 $f6, 0x48c($v0) -/* 0B219C 7F07D66C 46062201 */ sub.s $f8, $f4, $f6 -/* 0B21A0 7F07D670 E7A8005C */ swc1 $f8, 0x5c($sp) -/* 0B21A4 7F07D674 C60A0008 */ lwc1 $f10, 8($s0) -/* 0B21A8 7F07D678 C4500494 */ lwc1 $f16, 0x494($v0) -/* 0B21AC 7F07D67C 46105481 */ sub.s $f18, $f10, $f16 -/* 0B21B0 7F07D680 E7B20064 */ swc1 $f18, 0x64($sp) -/* 0B21B4 7F07D684 C6060000 */ lwc1 $f6, ($s0) -/* 0B21B8 7F07D688 C6240000 */ lwc1 $f4, ($s1) -/* 0B21BC 7F07D68C 46062201 */ sub.s $f8, $f4, $f6 -/* 0B21C0 7F07D690 C7A40030 */ lwc1 $f4, 0x30($sp) -/* 0B21C4 7F07D694 E7A80050 */ swc1 $f8, 0x50($sp) -/* 0B21C8 7F07D698 C6100008 */ lwc1 $f16, 8($s0) -/* 0B21CC 7F07D69C C62A0008 */ lwc1 $f10, 8($s1) -/* 0B21D0 7F07D6A0 46042002 */ mul.s $f0, $f4, $f4 -/* 0B21D4 7F07D6A4 46105481 */ sub.s $f18, $f10, $f16 -/* 0B21D8 7F07D6A8 C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 0B21DC 7F07D6AC E7B20058 */ swc1 $f18, 0x58($sp) -/* 0B21E0 7F07D6B0 C7A60058 */ lwc1 $f6, 0x58($sp) -/* 0B21E4 7F07D6B4 46063202 */ mul.s $f8, $f6, $f6 -/* 0B21E8 7F07D6B8 00000000 */ nop -/* 0B21EC 7F07D6BC 460A5402 */ mul.s $f16, $f10, $f10 -/* 0B21F0 7F07D6C0 46104480 */ add.s $f18, $f8, $f16 -/* 0B21F4 7F07D6C4 4600903E */ c.le.s $f18, $f0 -/* 0B21F8 7F07D6C8 00000000 */ nop -/* 0B21FC 7F07D6CC 45000044 */ bc1f .L7F07D7E0 -/* 0B2200 7F07D6D0 00000000 */ nop -/* 0B2204 7F07D6D4 C6240000 */ lwc1 $f4, ($s1) -/* 0B2208 7F07D6D8 C446048C */ lwc1 $f6, 0x48c($v0) -/* 0B220C 7F07D6DC 46062032 */ c.eq.s $f4, $f6 -/* 0B2210 7F07D6E0 00000000 */ nop -/* 0B2214 7F07D6E4 45020008 */ bc1fl .L7F07D708 -/* 0B2218 7F07D6E8 C6300008 */ lwc1 $f16, 8($s1) -/* 0B221C 7F07D6EC C62A0008 */ lwc1 $f10, 8($s1) -/* 0B2220 7F07D6F0 C4480494 */ lwc1 $f8, 0x494($v0) -/* 0B2224 7F07D6F4 46085032 */ c.eq.s $f10, $f8 -/* 0B2228 7F07D6F8 00000000 */ nop -/* 0B222C 7F07D6FC 4503008E */ bc1tl .L7F07D938 -/* 0B2230 7F07D700 00001025 */ move $v0, $zero -/* 0B2234 7F07D704 C6300008 */ lwc1 $f16, 8($s1) -.L7F07D708: -/* 0B2238 7F07D708 C4520494 */ lwc1 $f18, 0x494($v0) -/* 0B223C 7F07D70C 46128101 */ sub.s $f4, $f16, $f18 -/* 0B2240 7F07D710 46002187 */ neg.s $f6, $f4 -/* 0B2244 7F07D714 E7A60050 */ swc1 $f6, 0x50($sp) -/* 0B2248 7F07D718 C448048C */ lwc1 $f8, 0x48c($v0) -/* 0B224C 7F07D71C C62A0000 */ lwc1 $f10, ($s1) -/* 0B2250 7F07D720 46063482 */ mul.s $f18, $f6, $f6 -/* 0B2254 7F07D724 46085401 */ sub.s $f16, $f10, $f8 -/* 0B2258 7F07D728 E7B00058 */ swc1 $f16, 0x58($sp) -/* 0B225C 7F07D72C C7A40058 */ lwc1 $f4, 0x58($sp) -/* 0B2260 7F07D730 46042282 */ mul.s $f10, $f4, $f4 -/* 0B2264 7F07D734 0C007DF8 */ jal sqrtf -/* 0B2268 7F07D738 46125300 */ add.s $f12, $f10, $f18 -/* 0B226C 7F07D73C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B2270 7F07D740 44814000 */ mtc1 $at, $f8 -/* 0B2274 7F07D744 C7B00050 */ lwc1 $f16, 0x50($sp) -/* 0B2278 7F07D748 C7A40058 */ lwc1 $f4, 0x58($sp) -/* 0B227C 7F07D74C 46004083 */ div.s $f2, $f8, $f0 -/* 0B2280 7F07D750 C7B20064 */ lwc1 $f18, 0x64($sp) -/* 0B2284 7F07D754 8E620000 */ lw $v0, ($s3) -/* 0B2288 7F07D758 27A40044 */ addiu $a0, $sp, 0x44 -/* 0B228C 7F07D75C 27A50034 */ addiu $a1, $sp, 0x34 -/* 0B2290 7F07D760 46028182 */ mul.s $f6, $f16, $f2 -/* 0B2294 7F07D764 C7B0005C */ lwc1 $f16, 0x5c($sp) -/* 0B2298 7F07D768 46022282 */ mul.s $f10, $f4, $f2 -/* 0B229C 7F07D76C E7A60050 */ swc1 $f6, 0x50($sp) -/* 0B22A0 7F07D770 46125202 */ mul.s $f8, $f10, $f18 -/* 0B22A4 7F07D774 E7AA0058 */ swc1 $f10, 0x58($sp) -/* 0B22A8 7F07D778 46068102 */ mul.s $f4, $f16, $f6 -/* 0B22AC 7F07D77C 46044300 */ add.s $f12, $f8, $f4 -/* 0B22B0 7F07D780 460C3482 */ mul.s $f18, $f6, $f12 -/* 0B22B4 7F07D784 00000000 */ nop -/* 0B22B8 7F07D788 460C5402 */ mul.s $f16, $f10, $f12 -/* 0B22BC 7F07D78C E7B20050 */ swc1 $f18, 0x50($sp) -/* 0B22C0 7F07D790 E7B00058 */ swc1 $f16, 0x58($sp) -/* 0B22C4 7F07D794 C448048C */ lwc1 $f8, 0x48c($v0) -/* 0B22C8 7F07D798 46089100 */ add.s $f4, $f18, $f8 -/* 0B22CC 7F07D79C E7A40044 */ swc1 $f4, 0x44($sp) -/* 0B22D0 7F07D7A0 C4460494 */ lwc1 $f6, 0x494($v0) -/* 0B22D4 7F07D7A4 46068280 */ add.s $f10, $f16, $f6 -/* 0B22D8 7F07D7A8 0FC1F3E3 */ jal cal_player_collision -/* 0B22DC 7F07D7AC E7AA004C */ swc1 $f10, 0x4c($sp) -/* 0B22E0 7F07D7B0 10400060 */ beqz $v0, .L7F07D934 -/* 0B22E4 7F07D7B4 8FAF0034 */ lw $t7, 0x34($sp) -/* 0B22E8 7F07D7B8 8E780000 */ lw $t8, ($s3) -/* 0B22EC 7F07D7BC 24020001 */ li $v0, 1 -/* 0B22F0 7F07D7C0 AF0F0488 */ sw $t7, 0x488($t8) -/* 0B22F4 7F07D7C4 8E790000 */ lw $t9, ($s3) -/* 0B22F8 7F07D7C8 C7B20044 */ lwc1 $f18, 0x44($sp) -/* 0B22FC 7F07D7CC E732048C */ swc1 $f18, 0x48c($t9) -/* 0B2300 7F07D7D0 8E680000 */ lw $t0, ($s3) -/* 0B2304 7F07D7D4 C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 0B2308 7F07D7D8 10000057 */ b .L7F07D938 -/* 0B230C 7F07D7DC E5080494 */ swc1 $f8, 0x494($t0) -.L7F07D7E0: -/* 0B2310 7F07D7E0 C6440000 */ lwc1 $f4, ($s2) -/* 0B2314 7F07D7E4 C6100000 */ lwc1 $f16, ($s0) -/* 0B2318 7F07D7E8 46102181 */ sub.s $f6, $f4, $f16 -/* 0B231C 7F07D7EC E7A60050 */ swc1 $f6, 0x50($sp) -/* 0B2320 7F07D7F0 C6120008 */ lwc1 $f18, 8($s0) -/* 0B2324 7F07D7F4 C64A0008 */ lwc1 $f10, 8($s2) -/* 0B2328 7F07D7F8 C7A60050 */ lwc1 $f6, 0x50($sp) -/* 0B232C 7F07D7FC 46125201 */ sub.s $f8, $f10, $f18 -/* 0B2330 7F07D800 E7A80058 */ swc1 $f8, 0x58($sp) -/* 0B2334 7F07D804 C7A40058 */ lwc1 $f4, 0x58($sp) -/* 0B2338 7F07D808 46042402 */ mul.s $f16, $f4, $f4 -/* 0B233C 7F07D80C 00000000 */ nop -/* 0B2340 7F07D810 46063282 */ mul.s $f10, $f6, $f6 -/* 0B2344 7F07D814 460A8480 */ add.s $f18, $f16, $f10 -/* 0B2348 7F07D818 4600903E */ c.le.s $f18, $f0 -/* 0B234C 7F07D81C 00000000 */ nop -/* 0B2350 7F07D820 45000044 */ bc1f .L7F07D934 -/* 0B2354 7F07D824 00000000 */ nop -/* 0B2358 7F07D828 C6480000 */ lwc1 $f8, ($s2) -/* 0B235C 7F07D82C C444048C */ lwc1 $f4, 0x48c($v0) -/* 0B2360 7F07D830 46044032 */ c.eq.s $f8, $f4 -/* 0B2364 7F07D834 00000000 */ nop -/* 0B2368 7F07D838 45020008 */ bc1fl .L7F07D85C -/* 0B236C 7F07D83C C64A0008 */ lwc1 $f10, 8($s2) -/* 0B2370 7F07D840 C6460008 */ lwc1 $f6, 8($s2) -/* 0B2374 7F07D844 C4500494 */ lwc1 $f16, 0x494($v0) -/* 0B2378 7F07D848 46103032 */ c.eq.s $f6, $f16 -/* 0B237C 7F07D84C 00000000 */ nop -/* 0B2380 7F07D850 45030039 */ bc1tl .L7F07D938 -/* 0B2384 7F07D854 00001025 */ move $v0, $zero -/* 0B2388 7F07D858 C64A0008 */ lwc1 $f10, 8($s2) -.L7F07D85C: -/* 0B238C 7F07D85C C4520494 */ lwc1 $f18, 0x494($v0) -/* 0B2390 7F07D860 46125201 */ sub.s $f8, $f10, $f18 -/* 0B2394 7F07D864 46004107 */ neg.s $f4, $f8 -/* 0B2398 7F07D868 E7A40050 */ swc1 $f4, 0x50($sp) -/* 0B239C 7F07D86C C450048C */ lwc1 $f16, 0x48c($v0) -/* 0B23A0 7F07D870 C6460000 */ lwc1 $f6, ($s2) -/* 0B23A4 7F07D874 46042482 */ mul.s $f18, $f4, $f4 -/* 0B23A8 7F07D878 46103281 */ sub.s $f10, $f6, $f16 -/* 0B23AC 7F07D87C E7AA0058 */ swc1 $f10, 0x58($sp) -/* 0B23B0 7F07D880 C7A80058 */ lwc1 $f8, 0x58($sp) -/* 0B23B4 7F07D884 46084182 */ mul.s $f6, $f8, $f8 -/* 0B23B8 7F07D888 0C007DF8 */ jal sqrtf -/* 0B23BC 7F07D88C 46123300 */ add.s $f12, $f6, $f18 -/* 0B23C0 7F07D890 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B23C4 7F07D894 44818000 */ mtc1 $at, $f16 -/* 0B23C8 7F07D898 C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 0B23CC 7F07D89C C7A80058 */ lwc1 $f8, 0x58($sp) -/* 0B23D0 7F07D8A0 46008083 */ div.s $f2, $f16, $f0 -/* 0B23D4 7F07D8A4 C7B20064 */ lwc1 $f18, 0x64($sp) -/* 0B23D8 7F07D8A8 8E620000 */ lw $v0, ($s3) -/* 0B23DC 7F07D8AC 27A40044 */ addiu $a0, $sp, 0x44 -/* 0B23E0 7F07D8B0 27A50034 */ addiu $a1, $sp, 0x34 -/* 0B23E4 7F07D8B4 46025102 */ mul.s $f4, $f10, $f2 -/* 0B23E8 7F07D8B8 C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 0B23EC 7F07D8BC 46024182 */ mul.s $f6, $f8, $f2 -/* 0B23F0 7F07D8C0 E7A40050 */ swc1 $f4, 0x50($sp) -/* 0B23F4 7F07D8C4 46123402 */ mul.s $f16, $f6, $f18 -/* 0B23F8 7F07D8C8 E7A60058 */ swc1 $f6, 0x58($sp) -/* 0B23FC 7F07D8CC 46045202 */ mul.s $f8, $f10, $f4 -/* 0B2400 7F07D8D0 46088300 */ add.s $f12, $f16, $f8 -/* 0B2404 7F07D8D4 460C2482 */ mul.s $f18, $f4, $f12 -/* 0B2408 7F07D8D8 00000000 */ nop -/* 0B240C 7F07D8DC 460C3282 */ mul.s $f10, $f6, $f12 -/* 0B2410 7F07D8E0 E7B20050 */ swc1 $f18, 0x50($sp) -/* 0B2414 7F07D8E4 E7AA0058 */ swc1 $f10, 0x58($sp) -/* 0B2418 7F07D8E8 C450048C */ lwc1 $f16, 0x48c($v0) -/* 0B241C 7F07D8EC 46109200 */ add.s $f8, $f18, $f16 -/* 0B2420 7F07D8F0 E7A80044 */ swc1 $f8, 0x44($sp) -/* 0B2424 7F07D8F4 C4440494 */ lwc1 $f4, 0x494($v0) -/* 0B2428 7F07D8F8 46045180 */ add.s $f6, $f10, $f4 -/* 0B242C 7F07D8FC 0FC1F3E3 */ jal cal_player_collision -/* 0B2430 7F07D900 E7A6004C */ swc1 $f6, 0x4c($sp) -/* 0B2434 7F07D904 1040000B */ beqz $v0, .L7F07D934 -/* 0B2438 7F07D908 8FA90034 */ lw $t1, 0x34($sp) -/* 0B243C 7F07D90C 8E6A0000 */ lw $t2, ($s3) -/* 0B2440 7F07D910 24020001 */ li $v0, 1 -/* 0B2444 7F07D914 AD490488 */ sw $t1, 0x488($t2) -/* 0B2448 7F07D918 8E6B0000 */ lw $t3, ($s3) -/* 0B244C 7F07D91C C7B20044 */ lwc1 $f18, 0x44($sp) -/* 0B2450 7F07D920 E572048C */ swc1 $f18, 0x48c($t3) -/* 0B2454 7F07D924 8E6C0000 */ lw $t4, ($s3) -/* 0B2458 7F07D928 C7B0004C */ lwc1 $f16, 0x4c($sp) -/* 0B245C 7F07D92C 10000002 */ b .L7F07D938 -/* 0B2460 7F07D930 E5900494 */ swc1 $f16, 0x494($t4) -.L7F07D934: -/* 0B2464 7F07D934 00001025 */ move $v0, $zero -.L7F07D938: -/* 0B2468 7F07D938 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B246C 7F07D93C 8FB00014 */ lw $s0, 0x14($sp) -/* 0B2470 7F07D940 8FB10018 */ lw $s1, 0x18($sp) -/* 0B2474 7F07D944 8FB2001C */ lw $s2, 0x1c($sp) -/* 0B2478 7F07D948 8FB30020 */ lw $s3, 0x20($sp) -/* 0B247C 7F07D94C 03E00008 */ jr $ra -/* 0B2480 7F07D950 27BD0068 */ addiu $sp, $sp, 0x68 -) -#endif - - /** @@ -10438,968 +6460,222 @@ f32 bondviewBitconvertIntToFloat(s32 arg0) -#ifdef NONMATCHING - - -struct model_node_unk_b { - s32 unk00; - s32 unk04; - s32 unk08; - f32 unk0C; - f32 unk10; -}; - -struct model_node_unk_a { - s32 unk00; - struct model_node_unk_b *b; -}; - -struct model_node_unk_base { +struct dummy_struct { s32 unk00; s32 unk04; - s32 unk08; - s32 unk0C; - s32 unk10; - struct model_node_unk_a *p14; - struct model_node_unk_a *p18; }; /** - * decomp status: - * - compiles: barely - * - stack resize: fail - * - identical instructions: fail - * - identical registers: fail + * Sets Bond bondprevpos, attempts to move by `offset`. * - * notes: no where close to matching, but code should be roughly in the same logical outline. + * @param offset: Attempt to move Bond by {x,0,z} amount. + * @param allow_scoot: If movement causes collision, when set will allow Bond to scoot along the collision edge and to bump around corner edges. Otherwise, any collision will stop movement. * - * https://decomp.me/scratch/GxY5L - * 26.93% -*/ -void bondviewCalcUpdatePlayerCollision(struct coord3d *arg0, s32 arg1) + * US address 7F07D960. + * JP address 7F07DA34 (maybe). + */ +void bondviewCalcUpdatePlayerCollision(struct coord3d *offset, s32 allow_scoot) { - struct coord3d spB4; - struct coord3d spA8; - struct coord3d sp9C; - struct rect4f *sp98; - s32 sp94; - struct model_node_unk_b *sp84; - f32 sp80; - struct coord3d sp74; - struct coord3d sp68; - struct coord3d sp58; - struct coord3d sp4C; - s32 sp48; - s32 sp44; - u32 sp3C; - struct model_node_unk_base *tank_model_node; - struct TankRecord *tank_objrecord; - struct model_node_unk_a *temp_a3; - PropRecord *tank_prop; - StandTile *temp_v0_10; - f32 tank_model_scale; - f32 g_PlayerTankYOffset; - f32 temp_f18; - f32 temp_f2; - s32 temp_t0; - s32 temp_t4; - s32 temp_t8; - s32 temp_v0_7; - s32 temp_v1_2; - s32 temp_v1_3; - s32 temp_v1_4; - u16 temp_a1; - struct model_node_unk_a *temp_t3; - struct model_node_unk_b *temp_v1; - f32 phi_f2; - StandTile *phi_s0; - StandTile *stan; - StandTile *phi_v0; - s32 phi_v1; - u32 phi_a0; - s32 phi_t0; - StandTile *phi_v0_2; - u32 phi_a0_2; - s32 phi_v1_2; - StandTile *phi_s0_2; - f32 phi_f0; - u32 phi_a0_3; - u32 phi_a0_4; - s32 i; - s32 tile_count; + struct coord3d next_pos; // spb4 + struct coord3d collision1_pt0; // spa8 + struct coord3d collision1_pt1; // sp9c + struct rect4f *sp98; // sp98 + s32 sp94; // sp94 + struct TankRecord *tank_objrecord; // no stack + struct ObjectRecord *obj; + f32 *farr5; + f32 *farr6; + f32 temp_f2; // sp80 + struct coord3d collision2_pt0; // sp74 + struct coord3d collision2_pt1; // sp68 + StandTile *stan; // no stack + struct coord3d collision3_pt0; // sp58 + struct coord3d collision3_pt1; // sp4c + s32 tile_count; // sp48 + s32 i; // sp44 + s32 temp_a3; // no stack + s32 phi_a0_3; // sp3c + s32 temp_v0_7; // no stack + g_CurrentPlayer->bondprevpos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0]; g_CurrentPlayer->bondprevpos.f[1] = g_CurrentPlayer->field_488.collision_position.f[1]; g_CurrentPlayer->bondprevpos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2]; - spB4.f[0] = arg0->f[0] + g_CurrentPlayer->field_488.collision_position.f[0]; + next_pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + offset->f[0]; + next_pos.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + offset->f[2]; + g_BondCanEnterTank = 0; - spB4.f[2] = arg0->f[2] + g_CurrentPlayer->field_488.collision_position.f[2]; g_CurrentPlayer->autocrouchpos = CROUCH_STAND; - if (D_8003644C != 0) + if (g_WorldTankProp != NULL) { - chraiGetCollisionBoundsWithoutY(D_8003644C, &sp98, &sp94); + chraiGetCollisionBoundsWithoutY(g_WorldTankProp, &sp98, &sp94); if ((in_tank_flag == 1) || (chrpropTestPointInPolygon(&g_CurrentPlayer->field_488.collision_position, sp98, sp94) != 0) || ((chrobjTestPointPolygonCollision(&g_CurrentPlayer->field_488.collision_position, g_CurrentPlayer->field_488.collision_radius, sp98, sp94) != 0))) { - tank_prop = D_8003644C; - tank_objrecord = tank_prop->obj; - tank_model_node = (struct model_node_unk_base *)tank_objrecord->model->obj->Switches; - temp_t3 = tank_model_node->p18; - temp_v1 = tank_model_node->p14->b; + + obj = g_WorldTankProp->obj; + tank_objrecord = (struct TankRecord *)g_WorldTankProp->obj; + + /// TODO: replace with ModelNode structs + farr5 = (f32*)obj->model->obj->Switches[5]->Data; + farr6 = (f32*)obj->model->obj->Switches[6]->Data; + g_PlayerTankProp = g_WorldTankProp; - ptr_playerstank = tank_prop; - temp_f18 = temp_v1->unk10 - temp_v1->unk0C; - tank_model_scale = tank_objrecord->model->scale; - temp_f2 = temp_f18 * tank_model_scale; - phi_f0 = tank_model_scale; + temp_f2 = (farr5[4] - farr5[3]) * obj->model->scale; - if (in_tank_flag != 1) - { - sp80 = temp_f2; - sp84 = temp_t3->b; - phi_f2 = temp_f2; - if (chrpropTestPointInPolygon(&g_CurrentPlayer->field_488.collision_position, tank_objrecord->rect, tank_objrecord->unk80) != 0) - { - phi_f0 = tank_objrecord->model->scale; - } - } - else + if (in_tank_flag == 1 + || (chrpropTestPointInPolygon(&g_CurrentPlayer->field_488.collision_position, &tank_objrecord->rect, (s32)tank_objrecord->unk80) != 0)) { + temp_f2 += (farr6[4] - farr6[3]) * obj->model->scale; g_BondCanEnterTank = 1; - phi_f2 = (temp_f18 * tank_model_scale) + ((temp_t3->b->unk10 - temp_t3->b->unk0C) * phi_f0); } - if ((in_tank_flag == 0) && (g_PlayerTankYOffset < phi_f2)) + if ((in_tank_flag == 0) && (g_PlayerTankYOffset < temp_f2)) { g_PlayerTankYOffset += (20.0f * g_GlobalTimerDelta); - if (phi_f2 < g_PlayerTankYOffset) + if ((temp_f2 < g_PlayerTankYOffset)) { - // + //empty; } + else + { + return; + } + + g_PlayerTankYOffset = temp_f2; } else { - g_PlayerTankYOffset = phi_f2; - if (in_tank_flag == 1) + g_PlayerTankYOffset = temp_f2; + } + + if (in_tank_flag == 1) + { + if (g_EnterTankAudioState == TANK_RUN_STATE_NOT_RUNNING) { - if (g_EnterTankAudioState == 0) - { - g_PlayerTankYOffset += -37.0f * (1.0f - g_TankEnteringSitHeightRemain); - } - else - { - g_PlayerTankYOffset += -37.0f; - } + g_PlayerTankYOffset += -37.0f * (1.0f - g_TankEnteringSitHeightRemain); + } + else + { + g_PlayerTankYOffset += -37.0f; } } } else { - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - D_8003644C = NULL; - ptr_playerstank = NULL; + g_WorldTankProp = NULL; + g_PlayerTankProp = NULL; g_PlayerTankYOffset = 0.0f; } } } - else + + // This `if` block looks like Perfect Dark bbike0f0d3c60 + if (bondviewTrySimpleMovePlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1) == 0) { + // return values are: + // 1 if able to update stan and collision position + // zero if still unable to move by failing on the same collision edge + // -1 otherwise (still unable to move). + temp_v0_7 = bondviewTryFractionMovePlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1, &collision2_pt0, &collision2_pt1); - if (bondviewUpdatePlayerCollision(&spB4, &spA8, &sp9C) == 0) + if ((temp_v0_7 > 0) || (temp_v0_7 < 0)) { - temp_v0_7 = sub_GAME_7F07D2B4(&spB4, &spA8, &sp9C, &sp74, &sp68); - - if ((temp_v0_7 > 0) || (temp_v0_7 < 0)) + if ((allow_scoot != 0) + && (bondviewTryEdgeMovePlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1) <= 0) + && (bondviewTryEndHopPlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1) == 0)) { - if ((arg1 != 0) - && (sub_GAME_7F07D4C0(&spB4, &spA8, &sp9C) <= 0) - && (sub_GAME_7F07D61C(&spB4, &spA8, &sp9C) == 0)) - { - // - } + // empty } - else if (temp_v0_7 == 0) + } + else if (temp_v0_7 == 0) + { + bondviewTryFractionMovePlayerCollision(&next_pos, &collision2_pt0, &collision2_pt1, &collision3_pt0, &collision3_pt1); + + if ((allow_scoot != 0) + && (bondviewTryEdgeMovePlayerCollision(&next_pos, &collision2_pt0, &collision2_pt1) <= 0) + && (bondviewTryEdgeMovePlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1) <= 0) + && (bondviewTryEndHopPlayerCollision(&next_pos, &collision2_pt0, &collision2_pt1) == 0)) { - sub_GAME_7F07D2B4(&spB4, &sp74, &sp68, &sp58, &sp4C); - if ((arg1 != 0) - && (sub_GAME_7F07D4C0(&spB4, &sp74, &sp68) <= 0) - && (sub_GAME_7F07D4C0(&spB4, &spA8, &sp9C) <= 0) - && (sub_GAME_7F07D61C(&spB4, &sp74, &sp68) == 0)) - { - sub_GAME_7F07D61C(&spB4, &spA8, &sp9C); - } + bondviewTryEndHopPlayerCollision(&next_pos, &collision1_pt0, &collision1_pt1); } } + } - if (sub_GAME_7F0B0518( + /** + * This block seems to be some error checking code, this will only occur when Bond + * goes out of bounds. + */ + if (stanTestPointWithinTileBoundsMaybe( g_CurrentPlayer->field_488.current_tile_ptr, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2]) == 0) + { + if(1); + + stan = g_CurrentPlayer->field_488.current_tile_ptr; + + for (tile_count=0; tile_count<5; tile_count++) { - for (tile_count=0; tile_count<5; tile_count++) - { - stan = &g_CurrentPlayer->field_488.current_tile_ptr[tile_count]; - - phi_s0_2 = stan; + /// TODO: fix the horrible casts below. - temp_t8 = ((s32) stan->tail.half >> 0xC) & 0xF; - - phi_a0_3 = 0; - phi_a0_2 = 0; - - for (i=0; itail.half >> 0xC) & 0xF); i++) + { + // maybe: if (( stan->points[i+1].link >> 4) != 0) + if (( ((struct StandTilePoint*)stan) [i+1].link >> 4) != 0) { - if (((s32) stan->points[i].link >> 4) != 0) - { - phi_a0_3++; - } + if(1); + phi_a0_3++; } + } - temp_t8 = ((s32) stan->tail.half >> 0xC) & 0xF; + temp_a3 = randomGetNext() % (u32)phi_a0_3; - for (i=0; itail.half >> 0xC) & 0xF); i++) + { + // maybe: if (( stan->points[i+1].link >> 4) != 0) + if (( ((struct StandTilePoint*)stan) [i+1].link >> 4) != 0) { - temp_a1 = stan->points[i].link; - if (((s32) temp_a1 >> 4) != 0) + if (phi_a0_3 == temp_a3) { - if (phi_a0_2 == (randomGetNext() % phi_a0_3)) - { - phi_s0_2 = &standTileStart[temp_a1]; - } - else - { - phi_a0_2 += 1; - } + // note: no `>> 4` + // maybe: stan = &(standTileStart)[stan->points[i+1].link]; + stan = (struct StandTile*)&((struct dummy_struct*)standTileStart)[( ((struct StandTilePoint*)stan)[i+1].link)]; + break; } - } - if (sub_GAME_7F0B0518(phi_s0_2, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2]) != 0) - { - g_CurrentPlayer->field_488.current_tile_ptr = phi_s0_2; - break; + phi_a0_3++; } + } + + if(1); + if (stanTestPointWithinTileBoundsMaybe( + stan, + g_CurrentPlayer->field_488.collision_position.f[0], + g_CurrentPlayer->field_488.collision_position.f[2])) + { + g_CurrentPlayer->field_488.current_tile_ptr = stan; + break; } } + } - sub_GAME_7F07DE9C(g_CurrentPlayer); + sub_GAME_7F07DE9C(g_CurrentPlayer); - if (g_CurrentPlayer->field_488.current_tile_ptr != NULL) - { - sub_GAME_7F057744(g_CurrentPlayer->field_488.current_tile_ptr->room); - } + if (g_CurrentPlayer->field_488.current_tile_ptr != NULL) + { + objectivestatusCheckRoomEntered(g_CurrentPlayer->field_488.current_tile_ptr->room); } } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel bondviewCalcUpdatePlayerCollision -/* 0B2490 7F07D960 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B2494 7F07D964 2463A0B0 */ addiu $v1, %lo(g_CurrentPlayer) # addiu $v1, $v1, -0x5f50 -/* 0B2498 7F07D968 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0B249C 7F07D96C 8C620000 */ lw $v0, ($v1) -/* 0B24A0 7F07D970 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B24A4 7F07D974 AFB00020 */ sw $s0, 0x20($sp) -/* 0B24A8 7F07D978 AFA500C4 */ sw $a1, 0xc4($sp) -/* 0B24AC 7F07D97C C444048C */ lwc1 $f4, 0x48c($v0) -/* 0B24B0 7F07D980 3C018003 */ lui $at, %hi(g_BondCanEnterTank) -/* 0B24B4 7F07D984 240E0002 */ li $t6, 2 -/* 0B24B8 7F07D988 E4440408 */ swc1 $f4, 0x408($v0) -/* 0B24BC 7F07D98C 8C620000 */ lw $v0, ($v1) -/* 0B24C0 7F07D990 3C078003 */ lui $a3, %hi(D_8003644C) -/* 0B24C4 7F07D994 27A50098 */ addiu $a1, $sp, 0x98 -/* 0B24C8 7F07D998 C4460490 */ lwc1 $f6, 0x490($v0) -/* 0B24CC 7F07D99C E446040C */ swc1 $f6, 0x40c($v0) -/* 0B24D0 7F07D9A0 8C620000 */ lw $v0, ($v1) -/* 0B24D4 7F07D9A4 C4480494 */ lwc1 $f8, 0x494($v0) -/* 0B24D8 7F07D9A8 E4480410 */ swc1 $f8, 0x410($v0) -/* 0B24DC 7F07D9AC 8C620000 */ lw $v0, ($v1) -/* 0B24E0 7F07D9B0 C48A0000 */ lwc1 $f10, ($a0) -/* 0B24E4 7F07D9B4 C450048C */ lwc1 $f16, 0x48c($v0) -/* 0B24E8 7F07D9B8 46105480 */ add.s $f18, $f10, $f16 -/* 0B24EC 7F07D9BC E7B200B4 */ swc1 $f18, 0xb4($sp) -/* 0B24F0 7F07D9C0 C4840008 */ lwc1 $f4, 8($a0) -/* 0B24F4 7F07D9C4 C4460494 */ lwc1 $f6, 0x494($v0) -/* 0B24F8 7F07D9C8 AC206480 */ sw $zero, %lo(g_BondCanEnterTank)($at) -/* 0B24FC 7F07D9CC 46062200 */ add.s $f8, $f4, $f6 -/* 0B2500 7F07D9D0 E7A800BC */ swc1 $f8, 0xbc($sp) -/* 0B2504 7F07D9D4 AC4E29FC */ sw $t6, 0x29fc($v0) -/* 0B2508 7F07D9D8 8CE7644C */ lw $a3, %lo(D_8003644C)($a3) -/* 0B250C 7F07D9DC 10E00084 */ beqz $a3, .L7F07DBF0 -/* 0B2510 7F07D9E0 00E02025 */ move $a0, $a3 -/* 0B2514 7F07D9E4 0FC0F32C */ jal chraiGetCollisionBoundsWithoutY -/* 0B2518 7F07D9E8 27A60094 */ addiu $a2, $sp, 0x94 -/* 0B251C 7F07D9EC 3C0F8003 */ lui $t7, %hi(in_tank_flag) -/* 0B2520 7F07D9F0 8DEF6448 */ lw $t7, %lo(in_tank_flag)($t7) -/* 0B2524 7F07D9F4 24010001 */ li $at, 1 -/* 0B2528 7F07D9F8 3C048008 */ lui $a0, %hi(g_CurrentPlayer) -/* 0B252C 7F07D9FC 11E1000F */ beq $t7, $at, .L7F07DA3C -/* 0B2530 7F07DA00 8FA50098 */ lw $a1, 0x98($sp) -/* 0B2534 7F07DA04 8C84A0B0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B2538 7F07DA08 8FA60094 */ lw $a2, 0x94($sp) -/* 0B253C 7F07DA0C 0FC0F336 */ jal chrpropTestPointInPolygon -/* 0B2540 7F07DA10 2484048C */ addiu $a0, $a0, 0x48c -/* 0B2544 7F07DA14 14400009 */ bnez $v0, .L7F07DA3C -/* 0B2548 7F07DA18 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B254C 7F07DA1C 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B2550 7F07DA20 8FA60098 */ lw $a2, 0x98($sp) -/* 0B2554 7F07DA24 8FA70094 */ lw $a3, 0x94($sp) -/* 0B2558 7F07DA28 2444048C */ addiu $a0, $v0, 0x48c -/* 0B255C 7F07DA2C 0FC111C6 */ jal chrobjTestPointPolygonCollision -/* 0B2560 7F07DA30 8C4504B0 */ lw $a1, 0x4b0($v0) -/* 0B2564 7F07DA34 10400064 */ beqz $v0, .L7F07DBC8 -/* 0B2568 7F07DA38 3C058003 */ lui $a1, %hi(ptr_playerstank) -.L7F07DA3C: -/* 0B256C 7F07DA3C 3C078003 */ lui $a3, %hi(D_8003644C) -/* 0B2570 7F07DA40 8CE7644C */ lw $a3, %lo(D_8003644C)($a3) -/* 0B2574 7F07DA44 3C058003 */ lui $a1, %hi(ptr_playerstank) -/* 0B2578 7F07DA48 24A56450 */ addiu $a1, %lo(ptr_playerstank) # addiu $a1, $a1, 0x6450 -/* 0B257C 7F07DA4C 8CE20004 */ lw $v0, 4($a3) -/* 0B2580 7F07DA50 3C0D8003 */ lui $t5, %hi(in_tank_flag) -/* 0B2584 7F07DA54 24010001 */ li $at, 1 -/* 0B2588 7F07DA58 8C580014 */ lw $t8, 0x14($v0) -/* 0B258C 7F07DA5C 00408025 */ move $s0, $v0 -/* 0B2590 7F07DA60 8F190008 */ lw $t9, 8($t8) -/* 0B2594 7F07DA64 8F240008 */ lw $a0, 8($t9) -/* 0B2598 7F07DA68 8C8A0014 */ lw $t2, 0x14($a0) -/* 0B259C 7F07DA6C 8C8B0018 */ lw $t3, 0x18($a0) -/* 0B25A0 7F07DA70 3C048008 */ lui $a0, %hi(g_CurrentPlayer) -/* 0B25A4 7F07DA74 8D430004 */ lw $v1, 4($t2) -/* 0B25A8 7F07DA78 8D690004 */ lw $t1, 4($t3) -/* 0B25AC 7F07DA7C ACA70000 */ sw $a3, ($a1) -/* 0B25B0 7F07DA80 C470000C */ lwc1 $f16, 0xc($v1) -/* 0B25B4 7F07DA84 C46A0010 */ lwc1 $f10, 0x10($v1) -/* 0B25B8 7F07DA88 8C4C0014 */ lw $t4, 0x14($v0) -/* 0B25BC 7F07DA8C 8DAD6448 */ lw $t5, %lo(in_tank_flag)($t5) -/* 0B25C0 7F07DA90 46105481 */ sub.s $f18, $f10, $f16 -/* 0B25C4 7F07DA94 C5800014 */ lwc1 $f0, 0x14($t4) -/* 0B25C8 7F07DA98 24450084 */ addiu $a1, $v0, 0x84 -/* 0B25CC 7F07DA9C 46009082 */ mul.s $f2, $f18, $f0 -/* 0B25D0 7F07DAA0 51A1000D */ beql $t5, $at, .L7F07DAD8 -/* 0B25D4 7F07DAA4 C5240010 */ lwc1 $f4, 0x10($t1) -/* 0B25D8 7F07DAA8 8C84A0B0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B25DC 7F07DAAC 8C460080 */ lw $a2, 0x80($v0) -/* 0B25E0 7F07DAB0 E7A20080 */ swc1 $f2, 0x80($sp) -/* 0B25E4 7F07DAB4 AFA90084 */ sw $t1, 0x84($sp) -/* 0B25E8 7F07DAB8 0FC0F336 */ jal chrpropTestPointInPolygon -/* 0B25EC 7F07DABC 2484048C */ addiu $a0, $a0, 0x48c -/* 0B25F0 7F07DAC0 8FA90084 */ lw $t1, 0x84($sp) -/* 0B25F4 7F07DAC4 1040000B */ beqz $v0, .L7F07DAF4 -/* 0B25F8 7F07DAC8 C7A20080 */ lwc1 $f2, 0x80($sp) -/* 0B25FC 7F07DACC 8E0E0014 */ lw $t6, 0x14($s0) -/* 0B2600 7F07DAD0 C5C00014 */ lwc1 $f0, 0x14($t6) -/* 0B2604 7F07DAD4 C5240010 */ lwc1 $f4, 0x10($t1) -.L7F07DAD8: -/* 0B2608 7F07DAD8 C526000C */ lwc1 $f6, 0xc($t1) -/* 0B260C 7F07DADC 240F0001 */ li $t7, 1 -/* 0B2610 7F07DAE0 3C018003 */ lui $at, %hi(g_BondCanEnterTank) -/* 0B2614 7F07DAE4 46062201 */ sub.s $f8, $f4, $f6 -/* 0B2618 7F07DAE8 AC2F6480 */ sw $t7, %lo(g_BondCanEnterTank)($at) -/* 0B261C 7F07DAEC 46004282 */ mul.s $f10, $f8, $f0 -/* 0B2620 7F07DAF0 460A1080 */ add.s $f2, $f2, $f10 -.L7F07DAF4: -/* 0B2624 7F07DAF4 3C038003 */ lui $v1, %hi(in_tank_flag) -/* 0B2628 7F07DAF8 8C636448 */ lw $v1, %lo(in_tank_flag)($v1) -/* 0B262C 7F07DAFC 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) -/* 0B2630 7F07DB00 24426454 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x6454 -/* 0B2634 7F07DB04 14600014 */ bnez $v1, .L7F07DB58 -/* 0B2638 7F07DB08 00000000 */ nop -/* 0B263C 7F07DB0C C4400000 */ lwc1 $f0, ($v0) -/* 0B2640 7F07DB10 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B2644 7F07DB14 4602003C */ c.lt.s $f0, $f2 -/* 0B2648 7F07DB18 00000000 */ nop -/* 0B264C 7F07DB1C 4500000E */ bc1f .L7F07DB58 -/* 0B2650 7F07DB20 00000000 */ nop -/* 0B2654 7F07DB24 44818000 */ mtc1 $at, $f16 -/* 0B2658 7F07DB28 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B265C 7F07DB2C C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B2660 7F07DB30 46128102 */ mul.s $f4, $f16, $f18 -/* 0B2664 7F07DB34 46040180 */ add.s $f6, $f0, $f4 -/* 0B2668 7F07DB38 E4460000 */ swc1 $f6, ($v0) -/* 0B266C 7F07DB3C C4480000 */ lwc1 $f8, ($v0) -/* 0B2670 7F07DB40 4608103C */ c.lt.s $f2, $f8 -/* 0B2674 7F07DB44 00000000 */ nop -/* 0B2678 7F07DB48 450200C2 */ bc1fl .L7F07DE54 -/* 0B267C 7F07DB4C 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B2680 7F07DB50 10000004 */ b .L7F07DB64 -/* 0B2684 7F07DB54 E4420000 */ swc1 $f2, ($v0) -.L7F07DB58: -/* 0B2688 7F07DB58 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) -/* 0B268C 7F07DB5C 24426454 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x6454 -/* 0B2690 7F07DB60 E4420000 */ swc1 $f2, ($v0) -.L7F07DB64: -/* 0B2694 7F07DB64 24010001 */ li $at, 1 -/* 0B2698 7F07DB68 14610021 */ bne $v1, $at, .L7F07DBF0 -/* 0B269C 7F07DB6C 3C188008 */ lui $t8, %hi(g_EnterTankAudioState) -/* 0B26A0 7F07DB70 8F1899B8 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B26A4 7F07DB74 3C01C214 */ lui $at, 0xc214 -/* 0B26A8 7F07DB78 5700000E */ bnezl $t8, .L7F07DBB4 -/* 0B26AC 7F07DB7C C4500000 */ lwc1 $f16, ($v0) -/* 0B26B0 7F07DB80 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B26B4 7F07DB84 44815000 */ mtc1 $at, $f10 -/* 0B26B8 7F07DB88 3C018008 */ lui $at, %hi(g_TankEnteringSitHeightRemain) -/* 0B26BC 7F07DB8C C43099C0 */ lwc1 $f16, %lo(g_TankEnteringSitHeightRemain)($at) -/* 0B26C0 7F07DB90 3C01C214 */ li $at, 0xC2140000 # -37.000000 -/* 0B26C4 7F07DB94 44812000 */ mtc1 $at, $f4 -/* 0B26C8 7F07DB98 46105481 */ sub.s $f18, $f10, $f16 -/* 0B26CC 7F07DB9C C4480000 */ lwc1 $f8, ($v0) -/* 0B26D0 7F07DBA0 46122182 */ mul.s $f6, $f4, $f18 -/* 0B26D4 7F07DBA4 46064280 */ add.s $f10, $f8, $f6 -/* 0B26D8 7F07DBA8 10000011 */ b .L7F07DBF0 -/* 0B26DC 7F07DBAC E44A0000 */ swc1 $f10, ($v0) -/* 0B26E0 7F07DBB0 C4500000 */ lwc1 $f16, ($v0) -.L7F07DBB4: -/* 0B26E4 7F07DBB4 44812000 */ mtc1 $at, $f4 -/* 0B26E8 7F07DBB8 00000000 */ nop -/* 0B26EC 7F07DBBC 46048480 */ add.s $f18, $f16, $f4 -/* 0B26F0 7F07DBC0 1000000B */ b .L7F07DBF0 -/* 0B26F4 7F07DBC4 E4520000 */ swc1 $f18, ($v0) -.L7F07DBC8: -/* 0B26F8 7F07DBC8 24A56450 */ addiu $a1, $a1, %lo(ptr_playerstank) -/* 0B26FC 7F07DBCC 8CB90000 */ lw $t9, ($a1) -/* 0B2700 7F07DBD0 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) -/* 0B2704 7F07DBD4 24426454 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x6454 -/* 0B2708 7F07DBD8 13200005 */ beqz $t9, .L7F07DBF0 -/* 0B270C 7F07DBDC 3C018003 */ lui $at, %hi(D_8003644C) -/* 0B2710 7F07DBE0 44804000 */ mtc1 $zero, $f8 -/* 0B2714 7F07DBE4 AC20644C */ sw $zero, %lo(D_8003644C)($at) -/* 0B2718 7F07DBE8 ACA00000 */ sw $zero, ($a1) -/* 0B271C 7F07DBEC E4480000 */ swc1 $f8, ($v0) -.L7F07DBF0: -/* 0B2720 7F07DBF0 27B000B4 */ addiu $s0, $sp, 0xb4 -/* 0B2724 7F07DBF4 02002025 */ move $a0, $s0 -/* 0B2728 7F07DBF8 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B272C 7F07DBFC 0FC1F48D */ jal bondviewUpdatePlayerCollision -/* 0B2730 7F07DC00 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B2734 7F07DC04 14400037 */ bnez $v0, .L7F07DCE4 -/* 0B2738 7F07DC08 02002025 */ move $a0, $s0 -/* 0B273C 7F07DC0C 27AA0068 */ addiu $t2, $sp, 0x68 -/* 0B2740 7F07DC10 AFAA0010 */ sw $t2, 0x10($sp) -/* 0B2744 7F07DC14 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B2748 7F07DC18 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B274C 7F07DC1C 0FC1F4AD */ jal sub_GAME_7F07D2B4 -/* 0B2750 7F07DC20 27A70074 */ addiu $a3, $sp, 0x74 -/* 0B2754 7F07DC24 1C400003 */ bgtz $v0, .L7F07DC34 -/* 0B2758 7F07DC28 8FAB00C4 */ lw $t3, 0xc4($sp) -/* 0B275C 7F07DC2C 0441000F */ bgez $v0, .L7F07DC6C -/* 0B2760 7F07DC30 00000000 */ nop -.L7F07DC34: -/* 0B2764 7F07DC34 1160002B */ beqz $t3, .L7F07DCE4 -/* 0B2768 7F07DC38 02002025 */ move $a0, $s0 -/* 0B276C 7F07DC3C 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B2770 7F07DC40 0FC1F530 */ jal sub_GAME_7F07D4C0 -/* 0B2774 7F07DC44 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B2778 7F07DC48 1C400026 */ bgtz $v0, .L7F07DCE4 -/* 0B277C 7F07DC4C 02002025 */ move $a0, $s0 -/* 0B2780 7F07DC50 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B2784 7F07DC54 0FC1F587 */ jal sub_GAME_7F07D61C -/* 0B2788 7F07DC58 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B278C 7F07DC5C 14400021 */ bnez $v0, .L7F07DCE4 -/* 0B2790 7F07DC60 00000000 */ nop -/* 0B2794 7F07DC64 1000001F */ b .L7F07DCE4 -/* 0B2798 7F07DC68 00000000 */ nop -.L7F07DC6C: -/* 0B279C 7F07DC6C 1440001D */ bnez $v0, .L7F07DCE4 -/* 0B27A0 7F07DC70 02002025 */ move $a0, $s0 -/* 0B27A4 7F07DC74 27AC004C */ addiu $t4, $sp, 0x4c -/* 0B27A8 7F07DC78 AFAC0010 */ sw $t4, 0x10($sp) -/* 0B27AC 7F07DC7C 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B27B0 7F07DC80 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B27B4 7F07DC84 0FC1F4AD */ jal sub_GAME_7F07D2B4 -/* 0B27B8 7F07DC88 27A70058 */ addiu $a3, $sp, 0x58 -/* 0B27BC 7F07DC8C 8FAD00C4 */ lw $t5, 0xc4($sp) -/* 0B27C0 7F07DC90 02002025 */ move $a0, $s0 -/* 0B27C4 7F07DC94 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B27C8 7F07DC98 11A00012 */ beqz $t5, .L7F07DCE4 -/* 0B27CC 7F07DC9C 00000000 */ nop -/* 0B27D0 7F07DCA0 0FC1F530 */ jal sub_GAME_7F07D4C0 -/* 0B27D4 7F07DCA4 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B27D8 7F07DCA8 1C40000E */ bgtz $v0, .L7F07DCE4 -/* 0B27DC 7F07DCAC 02002025 */ move $a0, $s0 -/* 0B27E0 7F07DCB0 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B27E4 7F07DCB4 0FC1F530 */ jal sub_GAME_7F07D4C0 -/* 0B27E8 7F07DCB8 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B27EC 7F07DCBC 1C400009 */ bgtz $v0, .L7F07DCE4 -/* 0B27F0 7F07DCC0 02002025 */ move $a0, $s0 -/* 0B27F4 7F07DCC4 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B27F8 7F07DCC8 0FC1F587 */ jal sub_GAME_7F07D61C -/* 0B27FC 7F07DCCC 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B2800 7F07DCD0 14400004 */ bnez $v0, .L7F07DCE4 -/* 0B2804 7F07DCD4 02002025 */ move $a0, $s0 -/* 0B2808 7F07DCD8 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B280C 7F07DCDC 0FC1F587 */ jal sub_GAME_7F07D61C -/* 0B2810 7F07DCE0 27A6009C */ addiu $a2, $sp, 0x9c -.L7F07DCE4: -/* 0B2814 7F07DCE4 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B2818 7F07DCE8 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B281C 7F07DCEC 8C440488 */ lw $a0, 0x488($v0) -/* 0B2820 7F07DCF0 8C45048C */ lw $a1, 0x48c($v0) -/* 0B2824 7F07DCF4 0FC2C146 */ jal sub_GAME_7F0B0518 -/* 0B2828 7F07DCF8 8C460494 */ lw $a2, 0x494($v0) -/* 0B282C 7F07DCFC 1440004A */ bnez $v0, .L7F07DE28 -/* 0B2830 7F07DD00 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B2834 7F07DD04 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B2838 7F07DD08 00004025 */ move $t0, $zero -/* 0B283C 7F07DD0C 8DD00488 */ lw $s0, 0x488($t6) -/* 0B2840 7F07DD10 86060006 */ lh $a2, 6($s0) -.L7F07DD14: -/* 0B2844 7F07DD14 00001825 */ move $v1, $zero -/* 0B2848 7F07DD18 00002025 */ move $a0, $zero -/* 0B284C 7F07DD1C 00067B03 */ sra $t7, $a2, 0xc -/* 0B2850 7F07DD20 31F8000F */ andi $t8, $t7, 0xf -/* 0B2854 7F07DD24 1B00000D */ blez $t8, .L7F07DD5C -/* 0B2858 7F07DD28 02001025 */ move $v0, $s0 -/* 0B285C 7F07DD2C 00001825 */ move $v1, $zero -/* 0B2860 7F07DD30 001828C0 */ sll $a1, $t8, 3 -.L7F07DD34: -/* 0B2864 7F07DD34 9459000E */ lhu $t9, 0xe($v0) -/* 0B2868 7F07DD38 24630008 */ addiu $v1, $v1, 8 -/* 0B286C 7F07DD3C 0065082A */ slt $at, $v1, $a1 -/* 0B2870 7F07DD40 00195103 */ sra $t2, $t9, 4 -/* 0B2874 7F07DD44 11400002 */ beqz $t2, .L7F07DD50 -/* 0B2878 7F07DD48 00000000 */ nop -/* 0B287C 7F07DD4C 24840001 */ addiu $a0, $a0, 1 -.L7F07DD50: -/* 0B2880 7F07DD50 1420FFF8 */ bnez $at, .L7F07DD34 -/* 0B2884 7F07DD54 24420008 */ addiu $v0, $v0, 8 -/* 0B2888 7F07DD58 00001825 */ move $v1, $zero -.L7F07DD5C: -/* 0B288C 7F07DD5C AFA30044 */ sw $v1, 0x44($sp) -/* 0B2890 7F07DD60 AFA4003C */ sw $a0, 0x3c($sp) -/* 0B2894 7F07DD64 0C002914 */ jal randomGetNext -/* 0B2898 7F07DD68 AFA80048 */ sw $t0, 0x48($sp) -/* 0B289C 7F07DD6C 8FA4003C */ lw $a0, 0x3c($sp) -/* 0B28A0 7F07DD70 86060006 */ lh $a2, 6($s0) -/* 0B28A4 7F07DD74 8FA30044 */ lw $v1, 0x44($sp) -/* 0B28A8 7F07DD78 0044001B */ divu $zero, $v0, $a0 -/* 0B28AC 7F07DD7C 00065B03 */ sra $t3, $a2, 0xc -/* 0B28B0 7F07DD80 00003810 */ mfhi $a3 -/* 0B28B4 7F07DD84 316C000F */ andi $t4, $t3, 0xf -/* 0B28B8 7F07DD88 8FA80048 */ lw $t0, 0x48($sp) -/* 0B28BC 7F07DD8C 14800002 */ bnez $a0, .L7F07DD98 -/* 0B28C0 7F07DD90 00000000 */ nop -/* 0B28C4 7F07DD94 0007000D */ break 7 -.L7F07DD98: -/* 0B28C8 7F07DD98 00002025 */ move $a0, $zero -/* 0B28CC 7F07DD9C 19800011 */ blez $t4, .L7F07DDE4 -/* 0B28D0 7F07DDA0 01803025 */ move $a2, $t4 -/* 0B28D4 7F07DDA4 02001025 */ move $v0, $s0 -.L7F07DDA8: -/* 0B28D8 7F07DDA8 9445000E */ lhu $a1, 0xe($v0) -/* 0B28DC 7F07DDAC 24630001 */ addiu $v1, $v1, 1 -/* 0B28E0 7F07DDB0 0066082A */ slt $at, $v1, $a2 -/* 0B28E4 7F07DDB4 00056903 */ sra $t5, $a1, 4 -/* 0B28E8 7F07DDB8 11A00008 */ beqz $t5, .L7F07DDDC -/* 0B28EC 7F07DDBC 00000000 */ nop -/* 0B28F0 7F07DDC0 14870005 */ bne $a0, $a3, .L7F07DDD8 -/* 0B28F4 7F07DDC4 3C0F8004 */ lui $t7, %hi(standTileStart) -/* 0B28F8 7F07DDC8 8DEF0F58 */ lw $t7, %lo(standTileStart)($t7) -/* 0B28FC 7F07DDCC 000570C0 */ sll $t6, $a1, 3 -/* 0B2900 7F07DDD0 10000004 */ b .L7F07DDE4 -/* 0B2904 7F07DDD4 01CF8021 */ addu $s0, $t6, $t7 -.L7F07DDD8: -/* 0B2908 7F07DDD8 24840001 */ addiu $a0, $a0, 1 -.L7F07DDDC: -/* 0B290C 7F07DDDC 1420FFF2 */ bnez $at, .L7F07DDA8 -/* 0B2910 7F07DDE0 24420008 */ addiu $v0, $v0, 8 -.L7F07DDE4: -/* 0B2914 7F07DDE4 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B2918 7F07DDE8 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B291C 7F07DDEC 02002025 */ move $a0, $s0 -/* 0B2920 7F07DDF0 8C45048C */ lw $a1, 0x48c($v0) -/* 0B2924 7F07DDF4 8C460494 */ lw $a2, 0x494($v0) -/* 0B2928 7F07DDF8 0FC2C146 */ jal sub_GAME_7F0B0518 -/* 0B292C 7F07DDFC AFA80048 */ sw $t0, 0x48($sp) -/* 0B2930 7F07DE00 10400005 */ beqz $v0, .L7F07DE18 -/* 0B2934 7F07DE04 8FA80048 */ lw $t0, 0x48($sp) -/* 0B2938 7F07DE08 3C188008 */ lui $t8, %hi(g_CurrentPlayer) -/* 0B293C 7F07DE0C 8F18A0B0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B2940 7F07DE10 10000005 */ b .L7F07DE28 -/* 0B2944 7F07DE14 AF100488 */ sw $s0, 0x488($t8) -.L7F07DE18: -/* 0B2948 7F07DE18 25080001 */ addiu $t0, $t0, 1 -/* 0B294C 7F07DE1C 24010005 */ li $at, 5 -/* 0B2950 7F07DE20 5501FFBC */ bnel $t0, $at, .L7F07DD14 -/* 0B2954 7F07DE24 86060006 */ lh $a2, 6($s0) -.L7F07DE28: -/* 0B2958 7F07DE28 3C048008 */ lui $a0, %hi(g_CurrentPlayer) -/* 0B295C 7F07DE2C 0FC1F7A7 */ jal sub_GAME_7F07DE9C -/* 0B2960 7F07DE30 8C84A0B0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B2964 7F07DE34 3C198008 */ lui $t9, %hi(g_CurrentPlayer) -/* 0B2968 7F07DE38 8F39A0B0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B296C 7F07DE3C 8F220488 */ lw $v0, 0x488($t9) -/* 0B2970 7F07DE40 50400004 */ beql $v0, $zero, .L7F07DE54 -/* 0B2974 7F07DE44 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B2978 7F07DE48 0FC15DD1 */ jal sub_GAME_7F057744 -/* 0B297C 7F07DE4C 90440003 */ lbu $a0, 3($v0) -/* 0B2980 7F07DE50 8FBF0024 */ lw $ra, 0x24($sp) -.L7F07DE54: -/* 0B2984 7F07DE54 8FB00020 */ lw $s0, 0x20($sp) -/* 0B2988 7F07DE58 27BD00C0 */ addiu $sp, $sp, 0xc0 -/* 0B298C 7F07DE5C 03E00008 */ jr $ra -/* 0B2990 7F07DE60 00000000 */ nop -) -#endif -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel bondviewCalcUpdatePlayerCollision -/* 0B0424 7F07DA34 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B0428 7F07DA38 24638BC0 */ addiu $v1, %lo(g_CurrentPlayer) # addiu $v1, $v1, -0x7440 -/* 0B042C 7F07DA3C 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 0B0430 7F07DA40 8C620000 */ lw $v0, ($v1) -/* 0B0434 7F07DA44 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B0438 7F07DA48 AFB00020 */ sw $s0, 0x20($sp) -/* 0B043C 7F07DA4C AFA500C4 */ sw $a1, 0xc4($sp) -/* 0B0440 7F07DA50 C444048C */ lwc1 $f4, 0x48c($v0) -/* 0B0444 7F07DA54 3C018003 */ lui $at, %hi(g_BondCanEnterTank) # $at, 0x8003 -/* 0B0448 7F07DA58 240E0002 */ li $t6, 2 -/* 0B044C 7F07DA5C E4440408 */ swc1 $f4, 0x408($v0) -/* 0B0450 7F07DA60 8C620000 */ lw $v0, ($v1) -/* 0B0454 7F07DA64 3C078003 */ lui $a3, %hi(D_8003644C) # $a3, 0x8003 -/* 0B0458 7F07DA68 27A50098 */ addiu $a1, $sp, 0x98 -/* 0B045C 7F07DA6C C4460490 */ lwc1 $f6, 0x490($v0) -/* 0B0460 7F07DA70 E446040C */ swc1 $f6, 0x40c($v0) -/* 0B0464 7F07DA74 8C620000 */ lw $v0, ($v1) -/* 0B0468 7F07DA78 C4480494 */ lwc1 $f8, 0x494($v0) -/* 0B046C 7F07DA7C E4480410 */ swc1 $f8, 0x410($v0) -/* 0B0470 7F07DA80 8C620000 */ lw $v0, ($v1) -/* 0B0474 7F07DA84 C48A0000 */ lwc1 $f10, ($a0) -/* 0B0478 7F07DA88 C450048C */ lwc1 $f16, 0x48c($v0) -/* 0B047C 7F07DA8C 46105480 */ add.s $f18, $f10, $f16 -/* 0B0480 7F07DA90 E7B200B4 */ swc1 $f18, 0xb4($sp) -/* 0B0484 7F07DA94 C4840008 */ lwc1 $f4, 8($a0) -/* 0B0488 7F07DA98 C4460494 */ lwc1 $f6, 0x494($v0) -/* 0B048C 7F07DA9C AC2019D0 */ sw $zero, %lo(g_BondCanEnterTank)($at) -/* 0B0490 7F07DAA0 46062200 */ add.s $f8, $f4, $f6 -/* 0B0494 7F07DAA4 E7A800BC */ swc1 $f8, 0xbc($sp) -/* 0B0498 7F07DAA8 AC4E29F4 */ sw $t6, 0x29f4($v0) -/* 0B049C 7F07DAAC 8CE7199C */ lw $a3, %lo(D_8003644C)($a3) -/* 0B04A0 7F07DAB0 10E00084 */ beqz $a3, .L7F07DCC4 -/* 0B04A4 7F07DAB4 00E02025 */ move $a0, $a3 -/* 0B04A8 7F07DAB8 0FC0F35C */ jal chraiGetCollisionBoundsWithoutY -/* 0B04AC 7F07DABC 27A60094 */ addiu $a2, $sp, 0x94 -/* 0B04B0 7F07DAC0 3C0F8003 */ lui $t7, %hi(in_tank_flag) # $t7, 0x8003 -/* 0B04B4 7F07DAC4 8DEF1998 */ lw $t7, %lo(in_tank_flag)($t7) -/* 0B04B8 7F07DAC8 24010001 */ li $at, 1 -/* 0B04BC 7F07DACC 3C048007 */ lui $a0, %hi(g_CurrentPlayer) # $a0, 0x8007 -/* 0B04C0 7F07DAD0 11E1000F */ beq $t7, $at, .L7F07DB10 -/* 0B04C4 7F07DAD4 8FA50098 */ lw $a1, 0x98($sp) -/* 0B04C8 7F07DAD8 8C848BC0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B04CC 7F07DADC 8FA60094 */ lw $a2, 0x94($sp) -/* 0B04D0 7F07DAE0 0FC0F366 */ jal chrpropTestPointInPolygon -/* 0B04D4 7F07DAE4 2484048C */ addiu $a0, $a0, 0x48c -/* 0B04D8 7F07DAE8 14400009 */ bnez $v0, .L7F07DB10 -/* 0B04DC 7F07DAEC 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B04E0 7F07DAF0 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B04E4 7F07DAF4 8FA60098 */ lw $a2, 0x98($sp) -/* 0B04E8 7F07DAF8 8FA70094 */ lw $a3, 0x94($sp) -/* 0B04EC 7F07DAFC 2444048C */ addiu $a0, $v0, 0x48c -/* 0B04F0 7F07DB00 0FC1122B */ jal chrobjTestPointPolygonCollision -/* 0B04F4 7F07DB04 8C4504B0 */ lw $a1, 0x4b0($v0) -/* 0B04F8 7F07DB08 10400064 */ beqz $v0, .L7F07DC9C -/* 0B04FC 7F07DB0C 3C058003 */ lui $a1, %hi(ptr_playerstank) -.L7F07DB10: -/* 0B0500 7F07DB10 3C078003 */ lui $a3, %hi(D_8003644C) # $a3, 0x8003 -/* 0B0504 7F07DB14 8CE7199C */ lw $a3, %lo(D_8003644C)($a3) -/* 0B0508 7F07DB18 3C058003 */ lui $a1, %hi(ptr_playerstank) # $a1, 0x8003 -/* 0B050C 7F07DB1C 24A519A0 */ addiu $a1, %lo(ptr_playerstank) # addiu $a1, $a1, 0x19a0 -/* 0B0510 7F07DB20 8CE20004 */ lw $v0, 4($a3) -/* 0B0514 7F07DB24 3C0D8003 */ lui $t5, %hi(in_tank_flag) # $t5, 0x8003 -/* 0B0518 7F07DB28 24010001 */ li $at, 1 -/* 0B051C 7F07DB2C 8C580014 */ lw $t8, 0x14($v0) -/* 0B0520 7F07DB30 00408025 */ move $s0, $v0 -/* 0B0524 7F07DB34 8F190008 */ lw $t9, 8($t8) -/* 0B0528 7F07DB38 8F240008 */ lw $a0, 8($t9) -/* 0B052C 7F07DB3C 8C8A0014 */ lw $t2, 0x14($a0) -/* 0B0530 7F07DB40 8C8B0018 */ lw $t3, 0x18($a0) -/* 0B0534 7F07DB44 3C048007 */ lui $a0, %hi(g_CurrentPlayer) # $a0, 0x8007 -/* 0B0538 7F07DB48 8D430004 */ lw $v1, 4($t2) -/* 0B053C 7F07DB4C 8D690004 */ lw $t1, 4($t3) -/* 0B0540 7F07DB50 ACA70000 */ sw $a3, ($a1) -/* 0B0544 7F07DB54 C470000C */ lwc1 $f16, 0xc($v1) -/* 0B0548 7F07DB58 C46A0010 */ lwc1 $f10, 0x10($v1) -/* 0B054C 7F07DB5C 8C4C0014 */ lw $t4, 0x14($v0) -/* 0B0550 7F07DB60 8DAD1998 */ lw $t5, %lo(in_tank_flag)($t5) -/* 0B0554 7F07DB64 46105481 */ sub.s $f18, $f10, $f16 -/* 0B0558 7F07DB68 C5800014 */ lwc1 $f0, 0x14($t4) -/* 0B055C 7F07DB6C 24450084 */ addiu $a1, $v0, 0x84 -/* 0B0560 7F07DB70 46009082 */ mul.s $f2, $f18, $f0 -/* 0B0564 7F07DB74 51A1000D */ beql $t5, $at, .L7F07DBAC -/* 0B0568 7F07DB78 C5240010 */ lwc1 $f4, 0x10($t1) -/* 0B056C 7F07DB7C 8C848BC0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B0570 7F07DB80 8C460080 */ lw $a2, 0x80($v0) -/* 0B0574 7F07DB84 E7A20080 */ swc1 $f2, 0x80($sp) -/* 0B0578 7F07DB88 AFA90084 */ sw $t1, 0x84($sp) -/* 0B057C 7F07DB8C 0FC0F366 */ jal chrpropTestPointInPolygon -/* 0B0580 7F07DB90 2484048C */ addiu $a0, $a0, 0x48c -/* 0B0584 7F07DB94 8FA90084 */ lw $t1, 0x84($sp) -/* 0B0588 7F07DB98 1040000B */ beqz $v0, .L7F07DBC8 -/* 0B058C 7F07DB9C C7A20080 */ lwc1 $f2, 0x80($sp) -/* 0B0590 7F07DBA0 8E0E0014 */ lw $t6, 0x14($s0) -/* 0B0594 7F07DBA4 C5C00014 */ lwc1 $f0, 0x14($t6) -/* 0B0598 7F07DBA8 C5240010 */ lwc1 $f4, 0x10($t1) -.L7F07DBAC: -/* 0B059C 7F07DBAC C526000C */ lwc1 $f6, 0xc($t1) -/* 0B05A0 7F07DBB0 240F0001 */ li $t7, 1 -/* 0B05A4 7F07DBB4 3C018003 */ lui $at, %hi(g_BondCanEnterTank) # $at, 0x8003 -/* 0B05A8 7F07DBB8 46062201 */ sub.s $f8, $f4, $f6 -/* 0B05AC 7F07DBBC AC2F19D0 */ sw $t7, %lo(g_BondCanEnterTank)($at) -/* 0B05B0 7F07DBC0 46004282 */ mul.s $f10, $f8, $f0 -/* 0B05B4 7F07DBC4 460A1080 */ add.s $f2, $f2, $f10 -.L7F07DBC8: -/* 0B05B8 7F07DBC8 3C038003 */ lui $v1, %hi(in_tank_flag) # $v1, 0x8003 -/* 0B05BC 7F07DBCC 8C631998 */ lw $v1, %lo(in_tank_flag)($v1) -/* 0B05C0 7F07DBD0 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) # $v0, 0x8003 -/* 0B05C4 7F07DBD4 244219A4 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x19a4 -/* 0B05C8 7F07DBD8 14600014 */ bnez $v1, .L7F07DC2C -/* 0B05CC 7F07DBDC 00000000 */ nop -/* 0B05D0 7F07DBE0 C4400000 */ lwc1 $f0, ($v0) -/* 0B05D4 7F07DBE4 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B05D8 7F07DBE8 4602003C */ c.lt.s $f0, $f2 -/* 0B05DC 7F07DBEC 00000000 */ nop -/* 0B05E0 7F07DBF0 4500000E */ bc1f .L7F07DC2C -/* 0B05E4 7F07DBF4 00000000 */ nop -/* 0B05E8 7F07DBF8 44818000 */ mtc1 $at, $f16 -/* 0B05EC 7F07DBFC 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B05F0 7F07DC00 C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B05F4 7F07DC04 46128102 */ mul.s $f4, $f16, $f18 -/* 0B05F8 7F07DC08 46040180 */ add.s $f6, $f0, $f4 -/* 0B05FC 7F07DC0C E4460000 */ swc1 $f6, ($v0) -/* 0B0600 7F07DC10 C4480000 */ lwc1 $f8, ($v0) -/* 0B0604 7F07DC14 4608103C */ c.lt.s $f2, $f8 -/* 0B0608 7F07DC18 00000000 */ nop -/* 0B060C 7F07DC1C 450200C2 */ bc1fl .L7F07DF28 -/* 0B0610 7F07DC20 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B0614 7F07DC24 10000004 */ b .L7F07DC38 -/* 0B0618 7F07DC28 E4420000 */ swc1 $f2, ($v0) -.L7F07DC2C: -/* 0B061C 7F07DC2C 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) # $v0, 0x8003 -/* 0B0620 7F07DC30 244219A4 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x19a4 -/* 0B0624 7F07DC34 E4420000 */ swc1 $f2, ($v0) -.L7F07DC38: -/* 0B0628 7F07DC38 24010001 */ li $at, 1 -/* 0B062C 7F07DC3C 14610021 */ bne $v1, $at, .L7F07DCC4 -/* 0B0630 7F07DC40 3C188007 */ lui $t8, %hi(g_EnterTankAudioState) # $t8, 0x8007 -/* 0B0634 7F07DC44 8F188498 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B0638 7F07DC48 3C01C214 */ lui $at, 0xc214 -/* 0B063C 7F07DC4C 5700000E */ bnezl $t8, .L7F07DC88 -/* 0B0640 7F07DC50 C4500000 */ lwc1 $f16, ($v0) -/* 0B0644 7F07DC54 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B0648 7F07DC58 44815000 */ mtc1 $at, $f10 -/* 0B064C 7F07DC5C 3C018007 */ lui $at, %hi(g_TankEnteringSitHeightRemain) -/* 0B0650 7F07DC60 C43084A0 */ lwc1 $f16, %lo(g_TankEnteringSitHeightRemain)($at) -/* 0B0654 7F07DC64 3C01C214 */ li $at, 0xC2140000 # -37.000000 -/* 0B0658 7F07DC68 44812000 */ mtc1 $at, $f4 -/* 0B065C 7F07DC6C 46105481 */ sub.s $f18, $f10, $f16 -/* 0B0660 7F07DC70 C4480000 */ lwc1 $f8, ($v0) -/* 0B0664 7F07DC74 46122182 */ mul.s $f6, $f4, $f18 -/* 0B0668 7F07DC78 46064280 */ add.s $f10, $f8, $f6 -/* 0B066C 7F07DC7C 10000011 */ b .L7F07DCC4 -/* 0B0670 7F07DC80 E44A0000 */ swc1 $f10, ($v0) -/* 0B0674 7F07DC84 C4500000 */ lwc1 $f16, ($v0) -.L7F07DC88: -/* 0B0678 7F07DC88 44812000 */ mtc1 $at, $f4 -/* 0B067C 7F07DC8C 00000000 */ nop -/* 0B0680 7F07DC90 46048480 */ add.s $f18, $f16, $f4 -/* 0B0684 7F07DC94 1000000B */ b .L7F07DCC4 -/* 0B0688 7F07DC98 E4520000 */ swc1 $f18, ($v0) -.L7F07DC9C: -/* 0B068C 7F07DC9C 24A519A0 */ addiu $a1, $a1, %lo(ptr_playerstank) -/* 0B0690 7F07DCA0 8CB90000 */ lw $t9, ($a1) -/* 0B0694 7F07DCA4 3C028003 */ lui $v0, %hi(g_PlayerTankYOffset) # $v0, 0x8003 -/* 0B0698 7F07DCA8 244219A4 */ addiu $v0, %lo(g_PlayerTankYOffset) # addiu $v0, $v0, 0x19a4 -/* 0B069C 7F07DCAC 13200005 */ beqz $t9, .L7F07DCC4 -/* 0B06A0 7F07DCB0 3C018003 */ lui $at, %hi(D_8003644C) # $at, 0x8003 -/* 0B06A4 7F07DCB4 44804000 */ mtc1 $zero, $f8 -/* 0B06A8 7F07DCB8 AC20199C */ sw $zero, %lo(D_8003644C)($at) -/* 0B06AC 7F07DCBC ACA00000 */ sw $zero, ($a1) -/* 0B06B0 7F07DCC0 E4480000 */ swc1 $f8, ($v0) -.L7F07DCC4: -/* 0B06B4 7F07DCC4 27B000B4 */ addiu $s0, $sp, 0xb4 -/* 0B06B8 7F07DCC8 02002025 */ move $a0, $s0 -/* 0B06BC 7F07DCCC 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B06C0 7F07DCD0 0FC1F4C2 */ jal bondviewUpdatePlayerCollision -/* 0B06C4 7F07DCD4 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B06C8 7F07DCD8 14400037 */ bnez $v0, .L7F07DDB8 -/* 0B06CC 7F07DCDC 02002025 */ move $a0, $s0 -/* 0B06D0 7F07DCE0 27AA0068 */ addiu $t2, $sp, 0x68 -/* 0B06D4 7F07DCE4 AFAA0010 */ sw $t2, 0x10($sp) -/* 0B06D8 7F07DCE8 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B06DC 7F07DCEC 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B06E0 7F07DCF0 0FC1F4E2 */ jal sub_GAME_7F07D2B4 -/* 0B06E4 7F07DCF4 27A70074 */ addiu $a3, $sp, 0x74 -/* 0B06E8 7F07DCF8 1C400003 */ bgtz $v0, .L7F07DD08 -/* 0B06EC 7F07DCFC 8FAB00C4 */ lw $t3, 0xc4($sp) -/* 0B06F0 7F07DD00 0441000F */ bgez $v0, .L7F07DD40 -/* 0B06F4 7F07DD04 00000000 */ nop -.L7F07DD08: -/* 0B06F8 7F07DD08 1160002B */ beqz $t3, .L7F07DDB8 -/* 0B06FC 7F07DD0C 02002025 */ move $a0, $s0 -/* 0B0700 7F07DD10 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B0704 7F07DD14 0FC1F565 */ jal sub_GAME_7F07D4C0 -/* 0B0708 7F07DD18 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B070C 7F07DD1C 1C400026 */ bgtz $v0, .L7F07DDB8 -/* 0B0710 7F07DD20 02002025 */ move $a0, $s0 -/* 0B0714 7F07DD24 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B0718 7F07DD28 0FC1F5BC */ jal sub_GAME_7F07D61C -/* 0B071C 7F07DD2C 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B0720 7F07DD30 14400021 */ bnez $v0, .L7F07DDB8 -/* 0B0724 7F07DD34 00000000 */ nop -/* 0B0728 7F07DD38 1000001F */ b .L7F07DDB8 -/* 0B072C 7F07DD3C 00000000 */ nop -.L7F07DD40: -/* 0B0730 7F07DD40 1440001D */ bnez $v0, .L7F07DDB8 -/* 0B0734 7F07DD44 02002025 */ move $a0, $s0 -/* 0B0738 7F07DD48 27AC004C */ addiu $t4, $sp, 0x4c -/* 0B073C 7F07DD4C AFAC0010 */ sw $t4, 0x10($sp) -/* 0B0740 7F07DD50 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B0744 7F07DD54 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B0748 7F07DD58 0FC1F4E2 */ jal sub_GAME_7F07D2B4 -/* 0B074C 7F07DD5C 27A70058 */ addiu $a3, $sp, 0x58 -/* 0B0750 7F07DD60 8FAD00C4 */ lw $t5, 0xc4($sp) -/* 0B0754 7F07DD64 02002025 */ move $a0, $s0 -/* 0B0758 7F07DD68 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B075C 7F07DD6C 11A00012 */ beqz $t5, .L7F07DDB8 -/* 0B0760 7F07DD70 00000000 */ nop -/* 0B0764 7F07DD74 0FC1F565 */ jal sub_GAME_7F07D4C0 -/* 0B0768 7F07DD78 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B076C 7F07DD7C 1C40000E */ bgtz $v0, .L7F07DDB8 -/* 0B0770 7F07DD80 02002025 */ move $a0, $s0 -/* 0B0774 7F07DD84 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B0778 7F07DD88 0FC1F565 */ jal sub_GAME_7F07D4C0 -/* 0B077C 7F07DD8C 27A6009C */ addiu $a2, $sp, 0x9c -/* 0B0780 7F07DD90 1C400009 */ bgtz $v0, .L7F07DDB8 -/* 0B0784 7F07DD94 02002025 */ move $a0, $s0 -/* 0B0788 7F07DD98 27A50074 */ addiu $a1, $sp, 0x74 -/* 0B078C 7F07DD9C 0FC1F5BC */ jal sub_GAME_7F07D61C -/* 0B0790 7F07DDA0 27A60068 */ addiu $a2, $sp, 0x68 -/* 0B0794 7F07DDA4 14400004 */ bnez $v0, .L7F07DDB8 -/* 0B0798 7F07DDA8 02002025 */ move $a0, $s0 -/* 0B079C 7F07DDAC 27A500A8 */ addiu $a1, $sp, 0xa8 -/* 0B07A0 7F07DDB0 0FC1F5BC */ jal sub_GAME_7F07D61C -/* 0B07A4 7F07DDB4 27A6009C */ addiu $a2, $sp, 0x9c -.L7F07DDB8: -/* 0B07A8 7F07DDB8 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B07AC 7F07DDBC 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B07B0 7F07DDC0 8C440488 */ lw $a0, 0x488($v0) -/* 0B07B4 7F07DDC4 8C45048C */ lw $a1, 0x48c($v0) -/* 0B07B8 7F07DDC8 0FC2BDF6 */ jal sub_GAME_7F0B0518 -/* 0B07BC 7F07DDCC 8C460494 */ lw $a2, 0x494($v0) -/* 0B07C0 7F07DDD0 1440004A */ bnez $v0, .L7F07DEFC -/* 0B07C4 7F07DDD4 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B07C8 7F07DDD8 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B07CC 7F07DDDC 00004025 */ move $t0, $zero -/* 0B07D0 7F07DDE0 8DD00488 */ lw $s0, 0x488($t6) -/* 0B07D4 7F07DDE4 86060006 */ lh $a2, 6($s0) -.L7F07DDE8: -/* 0B07D8 7F07DDE8 00001825 */ move $v1, $zero -/* 0B07DC 7F07DDEC 00002025 */ move $a0, $zero -/* 0B07E0 7F07DDF0 00067B03 */ sra $t7, $a2, 0xc -/* 0B07E4 7F07DDF4 31F8000F */ andi $t8, $t7, 0xf -/* 0B07E8 7F07DDF8 1B00000D */ blez $t8, .L7F07DE30 -/* 0B07EC 7F07DDFC 02001025 */ move $v0, $s0 -/* 0B07F0 7F07DE00 00001825 */ move $v1, $zero -/* 0B07F4 7F07DE04 001828C0 */ sll $a1, $t8, 3 -.L7F07DE08: -/* 0B07F8 7F07DE08 9459000E */ lhu $t9, 0xe($v0) -/* 0B07FC 7F07DE0C 24630008 */ addiu $v1, $v1, 8 -/* 0B0800 7F07DE10 0065082A */ slt $at, $v1, $a1 -/* 0B0804 7F07DE14 00195103 */ sra $t2, $t9, 4 -/* 0B0808 7F07DE18 11400002 */ beqz $t2, .L7F07DE24 -/* 0B080C 7F07DE1C 00000000 */ nop -/* 0B0810 7F07DE20 24840001 */ addiu $a0, $a0, 1 -.L7F07DE24: -/* 0B0814 7F07DE24 1420FFF8 */ bnez $at, .L7F07DE08 -/* 0B0818 7F07DE28 24420008 */ addiu $v0, $v0, 8 -/* 0B081C 7F07DE2C 00001825 */ move $v1, $zero -.L7F07DE30: -/* 0B0820 7F07DE30 AFA30044 */ sw $v1, 0x44($sp) -/* 0B0824 7F07DE34 AFA4003C */ sw $a0, 0x3c($sp) -/* 0B0828 7F07DE38 0C00262C */ jal randomGetNext -/* 0B082C 7F07DE3C AFA80048 */ sw $t0, 0x48($sp) -/* 0B0830 7F07DE40 8FA4003C */ lw $a0, 0x3c($sp) -/* 0B0834 7F07DE44 86060006 */ lh $a2, 6($s0) -/* 0B0838 7F07DE48 8FA30044 */ lw $v1, 0x44($sp) -/* 0B083C 7F07DE4C 0044001B */ divu $zero, $v0, $a0 -/* 0B0840 7F07DE50 00065B03 */ sra $t3, $a2, 0xc -/* 0B0844 7F07DE54 00003810 */ mfhi $a3 -/* 0B0848 7F07DE58 316C000F */ andi $t4, $t3, 0xf -/* 0B084C 7F07DE5C 8FA80048 */ lw $t0, 0x48($sp) -/* 0B0850 7F07DE60 14800002 */ bnez $a0, .L7F07DE6C -/* 0B0854 7F07DE64 00000000 */ nop -/* 0B0858 7F07DE68 0007000D */ break 7 -.L7F07DE6C: -/* 0B085C 7F07DE6C 00002025 */ move $a0, $zero -/* 0B0860 7F07DE70 19800011 */ blez $t4, .L7F07DEB8 -/* 0B0864 7F07DE74 01803025 */ move $a2, $t4 -/* 0B0868 7F07DE78 02001025 */ move $v0, $s0 -.L7F07DE7C: -/* 0B086C 7F07DE7C 9445000E */ lhu $a1, 0xe($v0) -/* 0B0870 7F07DE80 24630001 */ addiu $v1, $v1, 1 -/* 0B0874 7F07DE84 0066082A */ slt $at, $v1, $a2 -/* 0B0878 7F07DE88 00056903 */ sra $t5, $a1, 4 -/* 0B087C 7F07DE8C 11A00008 */ beqz $t5, .L7F07DEB0 -/* 0B0880 7F07DE90 00000000 */ nop -/* 0B0884 7F07DE94 14870005 */ bne $a0, $a3, .L7F07DEAC -/* 0B0888 7F07DE98 3C0F8004 */ lui $t7, %hi(standTileStart) # $t7, 0x8004 -/* 0B088C 7F07DE9C 8DEFABA8 */ lw $t7, %lo(standTileStart)($t7) -/* 0B0890 7F07DEA0 000570C0 */ sll $t6, $a1, 3 -/* 0B0894 7F07DEA4 10000004 */ b .L7F07DEB8 -/* 0B0898 7F07DEA8 01CF8021 */ addu $s0, $t6, $t7 -.L7F07DEAC: -/* 0B089C 7F07DEAC 24840001 */ addiu $a0, $a0, 1 -.L7F07DEB0: -/* 0B08A0 7F07DEB0 1420FFF2 */ bnez $at, .L7F07DE7C -/* 0B08A4 7F07DEB4 24420008 */ addiu $v0, $v0, 8 -.L7F07DEB8: -/* 0B08A8 7F07DEB8 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B08AC 7F07DEBC 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B08B0 7F07DEC0 02002025 */ move $a0, $s0 -/* 0B08B4 7F07DEC4 8C45048C */ lw $a1, 0x48c($v0) -/* 0B08B8 7F07DEC8 8C460494 */ lw $a2, 0x494($v0) -/* 0B08BC 7F07DECC 0FC2BDF6 */ jal sub_GAME_7F0B0518 -/* 0B08C0 7F07DED0 AFA80048 */ sw $t0, 0x48($sp) -/* 0B08C4 7F07DED4 10400005 */ beqz $v0, .L7F07DEEC -/* 0B08C8 7F07DED8 8FA80048 */ lw $t0, 0x48($sp) -/* 0B08CC 7F07DEDC 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B08D0 7F07DEE0 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B08D4 7F07DEE4 10000005 */ b .L7F07DEFC -/* 0B08D8 7F07DEE8 AF100488 */ sw $s0, 0x488($t8) -.L7F07DEEC: -/* 0B08DC 7F07DEEC 25080001 */ addiu $t0, $t0, 1 -/* 0B08E0 7F07DEF0 24010005 */ li $at, 5 -/* 0B08E4 7F07DEF4 5501FFBC */ bnel $t0, $at, .L7F07DDE8 -/* 0B08E8 7F07DEF8 86060006 */ lh $a2, 6($s0) -.L7F07DEFC: -/* 0B08EC 7F07DEFC 3C048007 */ lui $a0, %hi(g_CurrentPlayer) # $a0, 0x8007 -/* 0B08F0 7F07DF00 0FC1F7DC */ jal sub_GAME_7F07DE9C -/* 0B08F4 7F07DF04 8C848BC0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 0B08F8 7F07DF08 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B08FC 7F07DF0C 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B0900 7F07DF10 8F220488 */ lw $v0, 0x488($t9) -/* 0B0904 7F07DF14 50400004 */ beql $v0, $zero, .L7F07DF28 -/* 0B0908 7F07DF18 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B090C 7F07DF1C 0FC15E90 */ jal sub_GAME_7F057744 -/* 0B0910 7F07DF20 90440003 */ lbu $a0, 3($v0) -/* 0B0914 7F07DF24 8FBF0024 */ lw $ra, 0x24($sp) -.L7F07DF28: -/* 0B0918 7F07DF28 8FB00020 */ lw $s0, 0x20($sp) -/* 0B091C 7F07DF2C 27BD00C0 */ addiu $sp, $sp, 0xc0 -/* 0B0920 7F07DF30 03E00008 */ jr $ra -/* 0B0924 7F07DF34 00000000 */ nop -) -#endif -#endif void sub_GAME_7F07DE64(struct player *player) { @@ -11978,7 +7254,7 @@ glabel sub_GAME_7F07E7CC /* 0B3338 7F07E808 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) /* 0B333C 7F07E80C 8FA50024 */ lw $a1, 0x24($sp) /* 0B3340 7F07E810 24440230 */ addiu $a0, $v0, 0x230 -/* 0B3344 7F07E814 0FC1D7EB */ jal sub_GAME_7F075FAC +/* 0B3344 7F07E814 0FC1D7EB */ jal animInit /* 0B3348 7F07E818 244602EC */ addiu $a2, $v0, 0x2ec /* 0B334C 7F07E81C 3C018004 */ lui $at, %hi(c_item_entries+0x33C) /* 0B3350 7F07E820 C424E14C */ lwc1 $f4, %lo(c_item_entries+0x33C)($at) @@ -12037,7 +7313,7 @@ glabel sub_GAME_7F07E7CC /* 0B1298 7F07E8A8 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) /* 0B129C 7F07E8AC 8FA50024 */ lw $a1, 0x24($sp) /* 0B12A0 7F07E8B0 24440230 */ addiu $a0, $v0, 0x230 -/* 0B12A4 7F07E8B4 0FC1D80A */ jal sub_GAME_7F075FAC +/* 0B12A4 7F07E8B4 0FC1D80A */ jal animInit /* 0B12A8 7F07E8B8 244602EC */ addiu $a2, $v0, 0x2ec /* 0B12AC 7F07E8BC 3C018003 */ lui $at, %hi(c_item_entries+0x33C) # $at, 0x8003 /* 0B12B0 7F07E8C0 C4247D9C */ lwc1 $f4, %lo(c_item_entries+0x33C)($at) @@ -12155,7 +7431,7 @@ void bondviewStepWatchAnimation(void) } } - sub_GAME_7F070090((void*)&g_CurrentPlayer->something_with_watch_object_instance, g_CurrentPlayer->pause_animation_counter, 0.0f); + modelSetAnimFrame2((void*)&g_CurrentPlayer->something_with_watch_object_instance, g_CurrentPlayer->pause_animation_counter, 0.0f); } } @@ -12197,2832 +7473,555 @@ s32 get_BONDdata_outside_watch_menu_flag(void) { -#ifdef NONMATCHING -void sub_GAME_7F07EAF0(void) { - -} -#else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F07EAF0 -/* 0B3620 7F07EAF0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0B3624 7F07EAF4 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B3628 7F07EAF8 AFB10018 */ sw $s1, 0x18($sp) -/* 0B362C 7F07EAFC 0FC1577B */ jal deactivate_alarm_sound_effect -/* 0B3630 7F07EB00 AFB00014 */ sw $s0, 0x14($sp) -/* 0B3634 7F07EB04 0FC157BE */ jal check_deactivate_gas_sound -/* 0B3638 7F07EB08 00000000 */ nop -/* 0B363C 7F07EB0C 00008825 */ move $s1, $zero -.L7F07EB10: -/* 0B3640 7F07EB10 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3644 7F07EB14 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3648 7F07EB18 01D18021 */ addu $s0, $t6, $s1 -/* 0B364C 7F07EB1C 8E040A44 */ lw $a0, 0xa44($s0) -/* 0B3650 7F07EB20 26100870 */ addiu $s0, $s0, 0x870 -/* 0B3654 7F07EB24 50800008 */ beql $a0, $zero, .L7F07EB48 -/* 0B3658 7F07EB28 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 0B365C 7F07EB2C 0C00237C */ jal sndGetPlayingState -/* 0B3660 7F07EB30 00000000 */ nop -/* 0B3664 7F07EB34 50400004 */ beql $v0, $zero, .L7F07EB48 -/* 0B3668 7F07EB38 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 0B366C 7F07EB3C 0C002408 */ jal sndDeactivate -/* 0B3670 7F07EB40 8E0401D4 */ lw $a0, 0x1d4($s0) -/* 0B3674 7F07EB44 263103A8 */ addiu $s1, $s1, 0x3a8 -.L7F07EB48: -/* 0B3678 7F07EB48 2A210750 */ slti $at, $s1, 0x750 -/* 0B367C 7F07EB4C 1420FFF0 */ bnez $at, .L7F07EB10 -/* 0B3680 7F07EB50 00000000 */ nop -/* 0B3684 7F07EB54 3C108003 */ lui $s0, %hi(SFX_80036458) -/* 0B3688 7F07EB58 3C118003 */ lui $s1, %hi(g_TankTurnSpeed) -/* 0B368C 7F07EB5C 26316460 */ addiu $s1, %lo(g_TankTurnSpeed) # addiu $s1, $s1, 0x6460 -/* 0B3690 7F07EB60 26106458 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6458 -/* 0B3694 7F07EB64 8E040000 */ lw $a0, ($s0) -.L7F07EB68: -/* 0B3698 7F07EB68 50800008 */ beql $a0, $zero, .L7F07EB8C -/* 0B369C 7F07EB6C 26100004 */ addiu $s0, $s0, 4 -/* 0B36A0 7F07EB70 0C00237C */ jal sndGetPlayingState -/* 0B36A4 7F07EB74 00000000 */ nop -/* 0B36A8 7F07EB78 50400004 */ beql $v0, $zero, .L7F07EB8C -/* 0B36AC 7F07EB7C 26100004 */ addiu $s0, $s0, 4 -/* 0B36B0 7F07EB80 0C002408 */ jal sndDeactivate -/* 0B36B4 7F07EB84 8E040000 */ lw $a0, ($s0) -/* 0B36B8 7F07EB88 26100004 */ addiu $s0, $s0, 4 -.L7F07EB8C: -/* 0B36BC 7F07EB8C 5611FFF6 */ bnel $s0, $s1, .L7F07EB68 -/* 0B36C0 7F07EB90 8E040000 */ lw $a0, ($s0) -/* 0B36C4 7F07EB94 0FC0E909 */ jal get_ptr_obj_pos_list_current_entry -/* 0B36C8 7F07EB98 00000000 */ nop -/* 0B36CC 7F07EB9C 10400028 */ beqz $v0, .L7F07EC40 -/* 0B36D0 7F07EBA0 00408825 */ move $s1, $v0 -/* 0B36D4 7F07EBA4 92220000 */ lbu $v0, ($s1) -.L7F07EBA8: -/* 0B36D8 7F07EBA8 24010002 */ li $at, 2 -/* 0B36DC 7F07EBAC 10410021 */ beq $v0, $at, .L7F07EC34 -/* 0B36E0 7F07EBB0 24010001 */ li $at, 1 -/* 0B36E4 7F07EBB4 54410020 */ bnel $v0, $at, .L7F07EC38 -/* 0B36E8 7F07EBB8 8E310024 */ lw $s1, 0x24($s1) -/* 0B36EC 7F07EBBC 8E230004 */ lw $v1, 4($s1) -/* 0B36F0 7F07EBC0 24010027 */ li $at, 39 -/* 0B36F4 7F07EBC4 90640003 */ lbu $a0, 3($v1) -/* 0B36F8 7F07EBC8 5481000E */ bnel $a0, $at, .L7F07EC04 -/* 0B36FC 7F07EBCC 24010028 */ li $at, 40 -/* 0B3700 7F07EBD0 8C6400AC */ lw $a0, 0xac($v1) -/* 0B3704 7F07EBD4 00608025 */ move $s0, $v1 -/* 0B3708 7F07EBD8 50800017 */ beql $a0, $zero, .L7F07EC38 -/* 0B370C 7F07EBDC 8E310024 */ lw $s1, 0x24($s1) -/* 0B3710 7F07EBE0 0C00237C */ jal sndGetPlayingState -/* 0B3714 7F07EBE4 00000000 */ nop -/* 0B3718 7F07EBE8 50400013 */ beql $v0, $zero, .L7F07EC38 -/* 0B371C 7F07EBEC 8E310024 */ lw $s1, 0x24($s1) -/* 0B3720 7F07EBF0 0C002408 */ jal sndDeactivate -/* 0B3724 7F07EBF4 8E0400AC */ lw $a0, 0xac($s0) -/* 0B3728 7F07EBF8 1000000F */ b .L7F07EC38 -/* 0B372C 7F07EBFC 8E310024 */ lw $s1, 0x24($s1) -/* 0B3730 7F07EC00 24010028 */ li $at, 40 -.L7F07EC04: -/* 0B3734 7F07EC04 5481000C */ bnel $a0, $at, .L7F07EC38 -/* 0B3738 7F07EC08 8E310024 */ lw $s1, 0x24($s1) -/* 0B373C 7F07EC0C 8C6400B0 */ lw $a0, 0xb0($v1) -/* 0B3740 7F07EC10 00608025 */ move $s0, $v1 -/* 0B3744 7F07EC14 50800008 */ beql $a0, $zero, .L7F07EC38 -/* 0B3748 7F07EC18 8E310024 */ lw $s1, 0x24($s1) -/* 0B374C 7F07EC1C 0C00237C */ jal sndGetPlayingState -/* 0B3750 7F07EC20 00000000 */ nop -/* 0B3754 7F07EC24 50400004 */ beql $v0, $zero, .L7F07EC38 -/* 0B3758 7F07EC28 8E310024 */ lw $s1, 0x24($s1) -/* 0B375C 7F07EC2C 0C002408 */ jal sndDeactivate -/* 0B3760 7F07EC30 8E0400B0 */ lw $a0, 0xb0($s0) -.L7F07EC34: -/* 0B3764 7F07EC34 8E310024 */ lw $s1, 0x24($s1) -.L7F07EC38: -/* 0B3768 7F07EC38 5620FFDB */ bnezl $s1, .L7F07EBA8 -/* 0B376C 7F07EC3C 92220000 */ lbu $v0, ($s1) -.L7F07EC40: -/* 0B3770 7F07EC40 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B3774 7F07EC44 8FB00014 */ lw $s0, 0x14($sp) -/* 0B3778 7F07EC48 8FB10018 */ lw $s1, 0x18($sp) -/* 0B377C 7F07EC4C 03E00008 */ jr $ra -/* 0B3780 7F07EC50 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F07EAF0 -/* 0B1580 7F07EB90 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0B1584 7F07EB94 AFBF001C */ sw $ra, 0x1c($sp) -/* 0B1588 7F07EB98 AFB10018 */ sw $s1, 0x18($sp) -/* 0B158C 7F07EB9C 0FC15833 */ jal deactivate_alarm_sound_effect -/* 0B1590 7F07EBA0 AFB00014 */ sw $s0, 0x14($sp) -/* 0B1594 7F07EBA4 0FC15876 */ jal check_deactivate_gas_sound -/* 0B1598 7F07EBA8 00000000 */ nop -/* 0B159C 7F07EBAC 00008825 */ move $s1, $zero -.L7F07EBB0: -/* 0B15A0 7F07EBB0 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B15A4 7F07EBB4 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B15A8 7F07EBB8 01D18021 */ addu $s0, $t6, $s1 -/* 0B15AC 7F07EBBC 8E040A3C */ lw $a0, 0xa3c($s0) -/* 0B15B0 7F07EBC0 26100868 */ addiu $s0, $s0, 0x868 -/* 0B15B4 7F07EBC4 50800008 */ beql $a0, $zero, .L7F07EBE8 -/* 0B15B8 7F07EBC8 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 0B15BC 7F07EBCC 0C002094 */ jal sndGetPlayingState -/* 0B15C0 7F07EBD0 00000000 */ nop -/* 0B15C4 7F07EBD4 50400004 */ beql $v0, $zero, .L7F07EBE8 -/* 0B15C8 7F07EBD8 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 0B15CC 7F07EBDC 0C002120 */ jal sndDeactivate -/* 0B15D0 7F07EBE0 8E0401D4 */ lw $a0, 0x1d4($s0) -/* 0B15D4 7F07EBE4 263103A8 */ addiu $s1, $s1, 0x3a8 -.L7F07EBE8: -/* 0B15D8 7F07EBE8 2A210750 */ slti $at, $s1, 0x750 -/* 0B15DC 7F07EBEC 1420FFF0 */ bnez $at, .L7F07EBB0 -/* 0B15E0 7F07EBF0 00000000 */ nop -/* 0B15E4 7F07EBF4 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0B15E8 7F07EBF8 3C118003 */ lui $s1, %hi(g_TankTurnSpeed) # $s1, 0x8003 -/* 0B15EC 7F07EBFC 263119B0 */ addiu $s1, %lo(g_TankTurnSpeed) # addiu $s1, $s1, 0x19b0 -/* 0B15F0 7F07EC00 261019A8 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x19a8 -/* 0B15F4 7F07EC04 8E040000 */ lw $a0, ($s0) -.L7F07EC08: -/* 0B15F8 7F07EC08 50800008 */ beql $a0, $zero, .L7F07EC2C -/* 0B15FC 7F07EC0C 26100004 */ addiu $s0, $s0, 4 -/* 0B1600 7F07EC10 0C002094 */ jal sndGetPlayingState -/* 0B1604 7F07EC14 00000000 */ nop -/* 0B1608 7F07EC18 50400004 */ beql $v0, $zero, .L7F07EC2C -/* 0B160C 7F07EC1C 26100004 */ addiu $s0, $s0, 4 -/* 0B1610 7F07EC20 0C002120 */ jal sndDeactivate -/* 0B1614 7F07EC24 8E040000 */ lw $a0, ($s0) -/* 0B1618 7F07EC28 26100004 */ addiu $s0, $s0, 4 -.L7F07EC2C: -/* 0B161C 7F07EC2C 5611FFF6 */ bnel $s0, $s1, .L7F07EC08 -/* 0B1620 7F07EC30 8E040000 */ lw $a0, ($s0) -/* 0B1624 7F07EC34 0FC0E939 */ jal get_ptr_obj_pos_list_current_entry -/* 0B1628 7F07EC38 00000000 */ nop -/* 0B162C 7F07EC3C 10400028 */ beqz $v0, .L7F07ECE0 -/* 0B1630 7F07EC40 00408825 */ move $s1, $v0 -/* 0B1634 7F07EC44 92220000 */ lbu $v0, ($s1) -.L7F07EC48: -/* 0B1638 7F07EC48 24010002 */ li $at, 2 -/* 0B163C 7F07EC4C 10410021 */ beq $v0, $at, .L7F07ECD4 -/* 0B1640 7F07EC50 24010001 */ li $at, 1 -/* 0B1644 7F07EC54 54410020 */ bnel $v0, $at, .L7F07ECD8 -/* 0B1648 7F07EC58 8E310024 */ lw $s1, 0x24($s1) -/* 0B164C 7F07EC5C 8E230004 */ lw $v1, 4($s1) -/* 0B1650 7F07EC60 24010027 */ li $at, 39 -/* 0B1654 7F07EC64 90640003 */ lbu $a0, 3($v1) -/* 0B1658 7F07EC68 5481000E */ bnel $a0, $at, .L7F07ECA4 -/* 0B165C 7F07EC6C 24010028 */ li $at, 40 -/* 0B1660 7F07EC70 8C6400AC */ lw $a0, 0xac($v1) -/* 0B1664 7F07EC74 00608025 */ move $s0, $v1 -/* 0B1668 7F07EC78 50800017 */ beql $a0, $zero, .L7F07ECD8 -/* 0B166C 7F07EC7C 8E310024 */ lw $s1, 0x24($s1) -/* 0B1670 7F07EC80 0C002094 */ jal sndGetPlayingState -/* 0B1674 7F07EC84 00000000 */ nop -/* 0B1678 7F07EC88 50400013 */ beql $v0, $zero, .L7F07ECD8 -/* 0B167C 7F07EC8C 8E310024 */ lw $s1, 0x24($s1) -/* 0B1680 7F07EC90 0C002120 */ jal sndDeactivate -/* 0B1684 7F07EC94 8E0400AC */ lw $a0, 0xac($s0) -/* 0B1688 7F07EC98 1000000F */ b .L7F07ECD8 -/* 0B168C 7F07EC9C 8E310024 */ lw $s1, 0x24($s1) -/* 0B1690 7F07ECA0 24010028 */ li $at, 40 -.L7F07ECA4: -/* 0B1694 7F07ECA4 5481000C */ bnel $a0, $at, .L7F07ECD8 -/* 0B1698 7F07ECA8 8E310024 */ lw $s1, 0x24($s1) -/* 0B169C 7F07ECAC 8C6400B0 */ lw $a0, 0xb0($v1) -/* 0B16A0 7F07ECB0 00608025 */ move $s0, $v1 -/* 0B16A4 7F07ECB4 50800008 */ beql $a0, $zero, .L7F07ECD8 -/* 0B16A8 7F07ECB8 8E310024 */ lw $s1, 0x24($s1) -/* 0B16AC 7F07ECBC 0C002094 */ jal sndGetPlayingState -/* 0B16B0 7F07ECC0 00000000 */ nop -/* 0B16B4 7F07ECC4 50400004 */ beql $v0, $zero, .L7F07ECD8 -/* 0B16B8 7F07ECC8 8E310024 */ lw $s1, 0x24($s1) -/* 0B16BC 7F07ECCC 0C002120 */ jal sndDeactivate -/* 0B16C0 7F07ECD0 8E0400B0 */ lw $a0, 0xb0($s0) -.L7F07ECD4: -/* 0B16C4 7F07ECD4 8E310024 */ lw $s1, 0x24($s1) -.L7F07ECD8: -/* 0B16C8 7F07ECD8 5620FFDB */ bnezl $s1, .L7F07EC48 -/* 0B16CC 7F07ECDC 92220000 */ lbu $v0, ($s1) -.L7F07ECE0: -/* 0B16D0 7F07ECE0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0B16D4 7F07ECE4 8FB00014 */ lw $s0, 0x14($sp) -/* 0B16D8 7F07ECE8 8FB10018 */ lw $s1, 0x18($sp) -/* 0B16DC 7F07ECEC 03E00008 */ jr $ra -/* 0B16E0 7F07ECF0 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif -#endif +void bondviewPlayerStopAudioForPause(void) +{ + struct hand *hand; + s32 i; + ObjectRecord *obj; + PropRecord *prop; + + deactivate_alarm_sound_effect(); + check_deactivate_gas_sound(); + for (i = 0; i < 2; i++) + { + hand = &g_CurrentPlayer->hands[i]; + if (hand->audioHandle && sndGetPlayingState(hand->audioHandle) != AL_STOPPED) { + sndDeactivate(hand->audioHandle); + } + } + for (i = 0; i < 2; i++) + { + if (g_TankSfxState[i] && sndGetPlayingState(g_TankSfxState[i]) != AL_STOPPED) { + sndDeactivate(g_TankSfxState[i]); + } + } + for (prop = get_ptr_obj_pos_list_current_entry(); prop; prop = prop->prev) + { + if (prop->type != PROP_TYPE_DOOR && prop->type == PROP_TYPE_OBJ) + { + obj = prop->obj; + + if (obj->type == PROPDEF_VEHICHLE) + { + VehichleRecord *vehicle = (VehichleRecord *)prop->obj; + if (vehicle->Sound && sndGetPlayingState(vehicle->Sound) != AL_STOPPED) { + sndDeactivate(vehicle->Sound); + } + } + else if (obj->type == PROPDEF_AIRCRAFT) + { + AircraftRecord *aircraft = (AircraftRecord *)prop->obj; + if (aircraft->Sound && sndGetPlayingState(aircraft->Sound) != AL_STOPPED) { + sndDeactivate(aircraft->Sound); + } + } + + if(1); + } + } +} -#ifdef NONMATCHING -void sub_GAME_7F07EC54(void) { -} -#else -#ifdef VERSION_US -GLOBAL_ASM( -.text -glabel sub_GAME_7F07EC54 -/* 0B3784 7F07EC54 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3788 7F07EC58 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B378C 7F07EC5C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B3790 7F07EC60 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B3794 7F07EC64 8DC201C8 */ lw $v0, 0x1c8($t6) -/* 0B3798 7F07EC68 504002E8 */ beql $v0, $zero, .L7F07F80C -/* 0B379C 7F07EC6C 24010005 */ li $at, 5 -/* 0B37A0 7F07EC70 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B37A4 7F07EC74 00002025 */ move $a0, $zero -/* 0B37A8 7F07EC78 3843001E */ xori $v1, $v0, 0x1e -/* 0B37AC 7F07EC7C 2C630001 */ sltiu $v1, $v1, 1 -/* 0B37B0 7F07EC80 14600006 */ bnez $v1, .L7F07EC9C -/* 0B37B4 7F07EC84 AFA3001C */ sw $v1, 0x1c($sp) -/* 0B37B8 7F07EC88 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B37BC 7F07EC8C 00002025 */ move $a0, $zero -/* 0B37C0 7F07EC90 384F0017 */ xori $t7, $v0, 0x17 -/* 0B37C4 7F07EC94 2DEF0001 */ sltiu $t7, $t7, 1 -/* 0B37C8 7F07EC98 AFAF001C */ sw $t7, 0x1c($sp) -.L7F07EC9C: -/* 0B37CC 7F07EC9C 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B37D0 7F07ECA0 24050011 */ li $a1, 17 -/* 0B37D4 7F07ECA4 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B37D8 7F07ECA8 13000002 */ beqz $t8, .L7F07ECB4 -/* 0B37DC 7F07ECAC AFB8003C */ sw $t8, 0x3c($sp) -/* 0B37E0 7F07ECB0 24050023 */ li $a1, 35 -.L7F07ECB4: -/* 0B37E4 7F07ECB4 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B37E8 7F07ECB8 3C088005 */ lui $t0, %hi(g_ClockTimer) -/* 0B37EC 7F07ECBC 8D088374 */ lw $t0, %lo(g_ClockTimer)($t0) -/* 0B37F0 7F07ECC0 8C7901C4 */ lw $t9, 0x1c4($v1) -/* 0B37F4 7F07ECC4 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B37F8 7F07ECC8 24010001 */ li $at, 1 -/* 0B37FC 7F07ECCC 03284821 */ addu $t1, $t9, $t0 -/* 0B3800 7F07ECD0 AC6901C4 */ sw $t1, 0x1c4($v1) -/* 0B3804 7F07ECD4 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3808 7F07ECD8 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B380C 7F07ECDC 8C6A01C0 */ lw $t2, 0x1c0($v1) -/* 0B3810 7F07ECE0 254B0001 */ addiu $t3, $t2, 1 -/* 0B3814 7F07ECE4 AC6B01C0 */ sw $t3, 0x1c0($v1) -/* 0B3818 7F07ECE8 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B381C 7F07ECEC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3820 7F07ECF0 AD800200 */ sw $zero, 0x200($t4) -/* 0B3824 7F07ECF4 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3828 7F07ECF8 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B382C 7F07ECFC 15A1003A */ bne $t5, $at, .L7F07EDE8 -/* 0B3830 7F07ED00 00000000 */ nop -/* 0B3834 7F07ED04 AC600200 */ sw $zero, 0x200($v1) -/* 0B3838 7F07ED08 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B383C 7F07ED0C 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3840 7F07ED10 24010001 */ li $at, 1 -/* 0B3844 7F07ED14 24040001 */ li $a0, 1 -/* 0B3848 7F07ED18 8DC201C0 */ lw $v0, 0x1c0($t6) -/* 0B384C 7F07ED1C 54410006 */ bnel $v0, $at, .L7F07ED38 -/* 0B3850 7F07ED20 24010002 */ li $at, 2 -/* 0B3854 7F07ED24 0FC17680 */ jal draw_item_in_hand -/* 0B3858 7F07ED28 24050054 */ li $a1, 84 -/* 0B385C 7F07ED2C 1000002E */ b .L7F07EDE8 -/* 0B3860 7F07ED30 00000000 */ nop -/* 0B3864 7F07ED34 24010002 */ li $at, 2 -.L7F07ED38: -/* 0B3868 7F07ED38 14410009 */ bne $v0, $at, .L7F07ED60 -/* 0B386C 7F07ED3C 24040001 */ li $a0, 1 -/* 0B3870 7F07ED40 8FAF001C */ lw $t7, 0x1c($sp) -/* 0B3874 7F07ED44 00002025 */ move $a0, $zero -/* 0B3878 7F07ED48 11E00027 */ beqz $t7, .L7F07EDE8 -/* 0B387C 7F07ED4C 00000000 */ nop -/* 0B3880 7F07ED50 0FC17680 */ jal draw_item_in_hand -/* 0B3884 7F07ED54 00002825 */ move $a1, $zero -/* 0B3888 7F07ED58 10000023 */ b .L7F07EDE8 -/* 0B388C 7F07ED5C 00000000 */ nop -.L7F07ED60: -/* 0B3890 7F07ED60 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B3894 7F07ED64 AFA50038 */ sw $a1, 0x38($sp) -/* 0B3898 7F07ED68 24010054 */ li $at, 84 -/* 0B389C 7F07ED6C 1441001E */ bne $v0, $at, .L7F07EDE8 -/* 0B38A0 7F07ED70 00000000 */ nop -/* 0B38A4 7F07ED74 0FC173AF */ jal Gun_hand_without_item -/* 0B38A8 7F07ED78 24040001 */ li $a0, 1 -/* 0B38AC 7F07ED7C 1040001A */ beqz $v0, .L7F07EDE8 -/* 0B38B0 7F07ED80 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B38B4 7F07ED84 13000008 */ beqz $t8, .L7F07EDA8 -/* 0B38B8 7F07ED88 00000000 */ nop -/* 0B38BC 7F07ED8C 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B38C0 7F07ED90 00002025 */ move $a0, $zero -/* 0B38C4 7F07ED94 14400014 */ bnez $v0, .L7F07EDE8 -/* 0B38C8 7F07ED98 00000000 */ nop -/* 0B38CC 7F07ED9C 0FC173AF */ jal Gun_hand_without_item -/* 0B38D0 7F07EDA0 00002025 */ move $a0, $zero -/* 0B38D4 7F07EDA4 10400010 */ beqz $v0, .L7F07EDE8 -.L7F07EDA8: -/* 0B38D8 7F07EDA8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B38DC 7F07EDAC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B38E0 7F07EDB0 8FA80038 */ lw $t0, 0x38($sp) -/* 0B38E4 7F07EDB4 24090002 */ li $t1, 2 -/* 0B38E8 7F07EDB8 8C7901C4 */ lw $t9, 0x1c4($v1) -/* 0B38EC 7F07EDBC 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) -/* 0B38F0 7F07EDC0 0328082A */ slt $at, $t9, $t0 -/* 0B38F4 7F07EDC4 14200008 */ bnez $at, .L7F07EDE8 -/* 0B38F8 7F07EDC8 00000000 */ nop -/* 0B38FC 7F07EDCC AC6901C8 */ sw $t1, 0x1c8($v1) -/* 0B3900 7F07EDD0 8D6BA0B0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B3904 7F07EDD4 240A0001 */ li $t2, 1 -/* 0B3908 7F07EDD8 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B390C 7F07EDDC AD6A01C0 */ sw $t2, 0x1c0($t3) -/* 0B3910 7F07EDE0 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B3914 7F07EDE4 AD8001C4 */ sw $zero, 0x1c4($t4) -.L7F07EDE8: -/* 0B3918 7F07EDE8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B391C 7F07EDEC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3920 7F07EDF0 24010002 */ li $at, 2 -/* 0B3924 7F07EDF4 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B3928 7F07EDF8 55A10043 */ bnel $t5, $at, .L7F07EF08 -/* 0B392C 7F07EDFC 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B3930 7F07EE00 AC600200 */ sw $zero, 0x200($v1) -/* 0B3934 7F07EE04 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3938 7F07EE08 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B393C 7F07EE0C 24010001 */ li $at, 1 -/* 0B3940 7F07EE10 24040008 */ li $a0, 8 -/* 0B3944 7F07EE14 8C6E01C0 */ lw $t6, 0x1c0($v1) -/* 0B3948 7F07EE18 55C10026 */ bnel $t6, $at, .L7F07EEB4 -/* 0B394C 7F07EE1C C4640214 */ lwc1 $f4, 0x214($v1) -/* 0B3950 7F07EE20 0FC1A96A */ jal set_unset_bitflags -/* 0B3954 7F07EE24 00002825 */ move $a1, $zero -/* 0B3958 7F07EE28 24040004 */ li $a0, 4 -/* 0B395C 7F07EE2C 0FC1A43D */ jal set_unset_ammo_on_screen_setting -/* 0B3960 7F07EE30 00002825 */ move $a1, $zero -/* 0B3964 7F07EE34 0FC228E7 */ jal hudmsgsSetOff -/* 0B3968 7F07EE38 24040001 */ li $a0, 1 -/* 0B396C 7F07EE3C 0FC22A51 */ jal sub_GAME_7F08A944 -/* 0B3970 7F07EE40 24040001 */ li $a0, 1 -/* 0B3974 7F07EE44 24040004 */ li $a0, 4 -/* 0B3978 7F07EE48 0FC15858 */ jal countdownTimerSetVisible -/* 0B397C 7F07EE4C 00002825 */ move $a1, $zero -/* 0B3980 7F07EE50 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3984 7F07EE54 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3988 7F07EE58 24010002 */ li $at, 2 -/* 0B398C 7F07EE5C 8C640218 */ lw $a0, 0x218($v1) -/* 0B3990 7F07EE60 10800005 */ beqz $a0, .L7F07EE78 -/* 0B3994 7F07EE64 00000000 */ nop -/* 0B3998 7F07EE68 10810003 */ beq $a0, $at, .L7F07EE78 -/* 0B399C 7F07EE6C 24010003 */ li $at, 3 -/* 0B39A0 7F07EE70 54810010 */ bnel $a0, $at, .L7F07EEB4 -/* 0B39A4 7F07EE74 C4640214 */ lwc1 $f4, 0x214($v1) -.L7F07EE78: -/* 0B39A8 7F07EE78 0FC1F7CA */ jal bondviewPauseAngleRelated -/* 0B39AC 7F07EE7C 24040001 */ li $a0, 1 -/* 0B39B0 7F07EE80 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B39B4 7F07EE84 44811000 */ mtc1 $at, $f2 -/* 0B39B8 7F07EE88 46000306 */ mov.s $f12, $f0 -/* 0B39BC 7F07EE8C 4602003C */ c.lt.s $f0, $f2 -/* 0B39C0 7F07EE90 00000000 */ nop -/* 0B39C4 7F07EE94 45000002 */ bc1f .L7F07EEA0 -/* 0B39C8 7F07EE98 00000000 */ nop -/* 0B39CC 7F07EE9C 46001306 */ mov.s $f12, $f2 -.L7F07EEA0: -/* 0B39D0 7F07EEA0 0FC1F804 */ jal sub_GAME_7F07E010 -/* 0B39D4 7F07EEA4 00000000 */ nop -/* 0B39D8 7F07EEA8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B39DC 7F07EEAC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B39E0 7F07EEB0 C4640214 */ lwc1 $f4, 0x214($v1) -.L7F07EEB4: -/* 0B39E4 7F07EEB4 C4660210 */ lwc1 $f6, 0x210($v1) -/* 0B39E8 7F07EEB8 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B39EC 7F07EEBC 44815000 */ mtc1 $at, $f10 -/* 0B39F0 7F07EEC0 46062201 */ sub.s $f8, $f4, $f6 -/* 0B39F4 7F07EEC4 240F0003 */ li $t7, 3 -/* 0B39F8 7F07EEC8 3C198008 */ lui $t9, %hi(g_CurrentPlayer) -/* 0B39FC 7F07EECC 460A403C */ c.lt.s $f8, $f10 -/* 0B3A00 7F07EED0 00000000 */ nop -/* 0B3A04 7F07EED4 4502000C */ bc1fl .L7F07EF08 -/* 0B3A08 7F07EED8 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B3A0C 7F07EEDC AC6F01C8 */ sw $t7, 0x1c8($v1) -/* 0B3A10 7F07EEE0 8F39A0B0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B3A14 7F07EEE4 24180001 */ li $t8, 1 -/* 0B3A18 7F07EEE8 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B3A1C 7F07EEEC AF3801C0 */ sw $t8, 0x1c0($t9) -/* 0B3A20 7F07EEF0 8D08A0B0 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B3A24 7F07EEF4 0FC1F9F3 */ jal sub_GAME_7F07E7CC -/* 0B3A28 7F07EEF8 AD0001C4 */ sw $zero, 0x1c4($t0) -/* 0B3A2C 7F07EEFC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3A30 7F07EF00 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3A34 7F07EF04 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07EF08: -/* 0B3A38 7F07EF08 24010003 */ li $at, 3 -/* 0B3A3C 7F07EF0C 54410059 */ bnel $v0, $at, .L7F07F074 -/* 0B3A40 7F07EF10 24010004 */ li $at, 4 -/* 0B3A44 7F07EF14 8C6901C0 */ lw $t1, 0x1c0($v1) -/* 0B3A48 7F07EF18 24010001 */ li $at, 1 -/* 0B3A4C 7F07EF1C 55210036 */ bnel $t1, $at, .L7F07EFF8 -/* 0B3A50 7F07EF20 8C620220 */ lw $v0, 0x220($v1) -/* 0B3A54 7F07EF24 8C620220 */ lw $v0, 0x220($v1) -/* 0B3A58 7F07EF28 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B3A5C 7F07EF2C 44817000 */ mtc1 $at, $f14 -/* 0B3A60 7F07EF30 1040000D */ beqz $v0, .L7F07EF68 -/* 0B3A64 7F07EF34 8C640218 */ lw $a0, 0x218($v1) -/* 0B3A68 7F07EF38 24010003 */ li $at, 3 -/* 0B3A6C 7F07EF3C 1041000A */ beq $v0, $at, .L7F07EF68 -/* 0B3A70 7F07EF40 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B3A74 7F07EF44 44818000 */ mtc1 $at, $f16 -/* 0B3A78 7F07EF48 C4720258 */ lwc1 $f18, 0x258($v1) -/* 0B3A7C 7F07EF4C 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B3A80 7F07EF50 44813000 */ mtc1 $at, $f6 -/* 0B3A84 7F07EF54 46128101 */ sub.s $f4, $f16, $f18 -/* 0B3A88 7F07EF58 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B3A8C 7F07EF5C 44815000 */ mtc1 $at, $f10 -/* 0B3A90 7F07EF60 46062202 */ mul.s $f8, $f4, $f6 -/* 0B3A94 7F07EF64 460A4383 */ div.s $f14, $f8, $f10 -.L7F07EF68: -/* 0B3A98 7F07EF68 10800004 */ beqz $a0, .L7F07EF7C -/* 0B3A9C 7F07EF6C 24010002 */ li $at, 2 -/* 0B3AA0 7F07EF70 10810002 */ beq $a0, $at, .L7F07EF7C -/* 0B3AA4 7F07EF74 24010003 */ li $at, 3 -/* 0B3AA8 7F07EF78 1481001A */ bne $a0, $at, .L7F07EFE4 -.L7F07EF7C: -/* 0B3AAC 7F07EF7C 24040001 */ li $a0, 1 -/* 0B3AB0 7F07EF80 0FC1F7CA */ jal bondviewPauseAngleRelated -/* 0B3AB4 7F07EF84 E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B3AB8 7F07EF88 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B3ABC 7F07EF8C C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B3AC0 7F07EF90 44818000 */ mtc1 $at, $f16 -/* 0B3AC4 7F07EF94 46000306 */ mov.s $f12, $f0 -/* 0B3AC8 7F07EF98 46107081 */ sub.s $f2, $f14, $f16 -/* 0B3ACC 7F07EF9C 4602003C */ c.lt.s $f0, $f2 -/* 0B3AD0 7F07EFA0 00000000 */ nop -/* 0B3AD4 7F07EFA4 45020003 */ bc1fl .L7F07EFB4 -/* 0B3AD8 7F07EFA8 E7AC002C */ swc1 $f12, 0x2c($sp) -/* 0B3ADC 7F07EFAC 46001306 */ mov.s $f12, $f2 -/* 0B3AE0 7F07EFB0 E7AC002C */ swc1 $f12, 0x2c($sp) -.L7F07EFB4: -/* 0B3AE4 7F07EFB4 0FC1F804 */ jal sub_GAME_7F07E010 -/* 0B3AE8 7F07EFB8 E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B3AEC 7F07EFBC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B3AF0 7F07EFC0 C7AC002C */ lwc1 $f12, 0x2c($sp) -/* 0B3AF4 7F07EFC4 44819000 */ mtc1 $at, $f18 -/* 0B3AF8 7F07EFC8 C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B3AFC 7F07EFCC 46126000 */ add.s $f0, $f12, $f18 -/* 0B3B00 7F07EFD0 4600703C */ c.lt.s $f14, $f0 -/* 0B3B04 7F07EFD4 00000000 */ nop -/* 0B3B08 7F07EFD8 45000002 */ bc1f .L7F07EFE4 -/* 0B3B0C 7F07EFDC 00000000 */ nop -/* 0B3B10 7F07EFE0 46000386 */ mov.s $f14, $f0 -.L7F07EFE4: -/* 0B3B14 7F07EFE4 0FC1FA2C */ jal bondviewSetPauseWatchRelated -/* 0B3B18 7F07EFE8 46007306 */ mov.s $f12, $f14 -/* 0B3B1C 7F07EFEC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3B20 7F07EFF0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3B24 7F07EFF4 8C620220 */ lw $v0, 0x220($v1) -.L7F07EFF8: -/* 0B3B28 7F07EFF8 24010003 */ li $at, 3 -/* 0B3B2C 7F07EFFC 10400003 */ beqz $v0, .L7F07F00C -/* 0B3B30 7F07F000 00000000 */ nop -/* 0B3B34 7F07F004 54410008 */ bnel $v0, $at, .L7F07F028 -/* 0B3B38 7F07F008 240A0001 */ li $t2, 1 -.L7F07F00C: -/* 0B3B3C 7F07F00C 0FC1F81A */ jal sub_GAME_7F07E068 -/* 0B3B40 7F07F010 00000000 */ nop -/* 0B3B44 7F07F014 10400009 */ beqz $v0, .L7F07F03C -/* 0B3B48 7F07F018 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B3B4C 7F07F01C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3B50 7F07F020 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3B54 7F07F024 240A0001 */ li $t2, 1 -.L7F07F028: -/* 0B3B58 7F07F028 AC6A0200 */ sw $t2, 0x200($v1) -/* 0B3B5C 7F07F02C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3B60 7F07F030 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3B64 7F07F034 1000000E */ b .L7F07F070 -/* 0B3B68 7F07F038 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F03C: -/* 0B3B6C 7F07F03C 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B3B70 7F07F040 240B0004 */ li $t3, 4 -/* 0B3B74 7F07F044 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3B78 7F07F048 AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B3B7C 7F07F04C 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3B80 7F07F050 240D0001 */ li $t5, 1 -/* 0B3B84 7F07F054 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) -/* 0B3B88 7F07F058 ADCD01C0 */ sw $t5, 0x1c0($t6) -/* 0B3B8C 7F07F05C 8DEFA0B0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B3B90 7F07F060 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3B94 7F07F064 ADE001C4 */ sw $zero, 0x1c4($t7) -/* 0B3B98 7F07F068 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3B9C 7F07F06C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F070: -/* 0B3BA0 7F07F070 24010004 */ li $at, 4 -.L7F07F074: -/* 0B3BA4 7F07F074 5441002F */ bnel $v0, $at, .L7F07F134 -/* 0B3BA8 7F07F078 24010005 */ li $at, 5 -/* 0B3BAC 7F07F07C 8C7801C0 */ lw $t8, 0x1c0($v1) -/* 0B3BB0 7F07F080 24010001 */ li $at, 1 -/* 0B3BB4 7F07F084 1701000B */ bne $t8, $at, .L7F07F0B4 -/* 0B3BB8 7F07F088 00000000 */ nop -/* 0B3BBC 7F07F08C 8C79021C */ lw $t9, 0x21c($v1) -/* 0B3BC0 7F07F090 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0B3BC4 7F07F094 240500ED */ li $a1, 237 -/* 0B3BC8 7F07F098 13200006 */ beqz $t9, .L7F07F0B4 -/* 0B3BCC 7F07F09C 00003025 */ move $a2, $zero -/* 0B3BD0 7F07F0A0 0C002382 */ jal sndPlaySfx -/* 0B3BD4 7F07F0A4 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B3BD8 7F07F0A8 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B3BDC 7F07F0AC 8D08A0B0 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B3BE0 7F07F0B0 AD00021C */ sw $zero, 0x21c($t0) -.L7F07F0B4: -/* 0B3BE4 7F07F0B4 0FC1F94B */ jal bondviewZoomToWatchOnOpen -/* 0B3BE8 7F07F0B8 00000000 */ nop -/* 0B3BEC 7F07F0BC 0FC1F97F */ jal check_watch_page_transistion_running -/* 0B3BF0 7F07F0C0 00000000 */ nop -/* 0B3BF4 7F07F0C4 10400009 */ beqz $v0, .L7F07F0EC -/* 0B3BF8 7F07F0C8 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B3BFC 7F07F0CC 3C0A8008 */ lui $t2, %hi(g_CurrentPlayer) -/* 0B3C00 7F07F0D0 8D4AA0B0 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B3C04 7F07F0D4 24090001 */ li $t1, 1 -/* 0B3C08 7F07F0D8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3C0C 7F07F0DC AD490200 */ sw $t1, 0x200($t2) -/* 0B3C10 7F07F0E0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3C14 7F07F0E4 10000012 */ b .L7F07F130 -/* 0B3C18 7F07F0E8 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F0EC: -/* 0B3C1C 7F07F0EC 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B3C20 7F07F0F0 240B0005 */ li $t3, 5 -/* 0B3C24 7F07F0F4 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3C28 7F07F0F8 AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B3C2C 7F07F0FC 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3C30 7F07F100 240D0001 */ li $t5, 1 -/* 0B3C34 7F07F104 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) -/* 0B3C38 7F07F108 ADCD01C0 */ sw $t5, 0x1c0($t6) -/* 0B3C3C 7F07F10C 8DEFA0B0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B3C40 7F07F110 3C198008 */ lui $t9, %hi(g_CurrentPlayer) -/* 0B3C44 7F07F114 24180001 */ li $t8, 1 -/* 0B3C48 7F07F118 ADE001C4 */ sw $zero, 0x1c4($t7) -/* 0B3C4C 7F07F11C 8F39A0B0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B3C50 7F07F120 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3C54 7F07F124 AF38021C */ sw $t8, 0x21c($t9) -/* 0B3C58 7F07F128 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3C5C 7F07F12C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F130: -/* 0B3C60 7F07F130 24010005 */ li $at, 5 -.L7F07F134: -/* 0B3C64 7F07F134 5441000F */ bnel $v0, $at, .L7F07F174 -/* 0B3C68 7F07F138 2401000C */ li $at, 12 -/* 0B3C6C 7F07F13C 8C6801C0 */ lw $t0, 0x1c0($v1) -/* 0B3C70 7F07F140 24010001 */ li $at, 1 -/* 0B3C74 7F07F144 55010006 */ bnel $t0, $at, .L7F07F160 -/* 0B3C78 7F07F148 24090001 */ li $t1, 1 -/* 0B3C7C 7F07F14C 0FC304C4 */ jal sub_GAME_7F0C1310 -/* 0B3C80 7F07F150 00000000 */ nop -/* 0B3C84 7F07F154 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3C88 7F07F158 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3C8C 7F07F15C 24090001 */ li $t1, 1 -.L7F07F160: -/* 0B3C90 7F07F160 AC690200 */ sw $t1, 0x200($v1) -/* 0B3C94 7F07F164 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3C98 7F07F168 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3C9C 7F07F16C 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B3CA0 7F07F170 2401000C */ li $at, 12 -.L7F07F174: -/* 0B3CA4 7F07F174 14410018 */ bne $v0, $at, .L7F07F1D8 -/* 0B3CA8 7F07F178 240A0001 */ li $t2, 1 -/* 0B3CAC 7F07F17C AC6A0200 */ sw $t2, 0x200($v1) -/* 0B3CB0 7F07F180 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3CB4 7F07F184 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3CB8 7F07F188 240C0006 */ li $t4, 6 -/* 0B3CBC 7F07F18C 240D0001 */ li $t5, 1 -/* 0B3CC0 7F07F190 8C6B01C0 */ lw $t3, 0x1c0($v1) -/* 0B3CC4 7F07F194 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3CC8 7F07F198 29610003 */ slti $at, $t3, 3 -/* 0B3CCC 7F07F19C 5420000F */ bnezl $at, .L7F07F1DC -/* 0B3CD0 7F07F1A0 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B3CD4 7F07F1A4 AC6C01C8 */ sw $t4, 0x1c8($v1) -/* 0B3CD8 7F07F1A8 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3CDC 7F07F1AC 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) -/* 0B3CE0 7F07F1B0 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0B3CE4 7F07F1B4 ADCD01C0 */ sw $t5, 0x1c0($t6) -/* 0B3CE8 7F07F1B8 8DEFA0B0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B3CEC 7F07F1BC 240500EE */ li $a1, 238 -/* 0B3CF0 7F07F1C0 00003025 */ move $a2, $zero -/* 0B3CF4 7F07F1C4 ADE001C4 */ sw $zero, 0x1c4($t7) -/* 0B3CF8 7F07F1C8 0C002382 */ jal sndPlaySfx -/* 0B3CFC 7F07F1CC 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B3D00 7F07F1D0 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3D04 7F07F1D4 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07F1D8: -/* 0B3D08 7F07F1D8 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F1DC: -/* 0B3D0C 7F07F1DC 24010006 */ li $at, 6 -/* 0B3D10 7F07F1E0 5441002F */ bnel $v0, $at, .L7F07F2A0 -/* 0B3D14 7F07F1E4 24010007 */ li $at, 7 -/* 0B3D18 7F07F1E8 8C7801C0 */ lw $t8, 0x1c0($v1) -/* 0B3D1C 7F07F1EC 24010001 */ li $at, 1 -/* 0B3D20 7F07F1F0 1701000D */ bne $t8, $at, .L7F07F228 -/* 0B3D24 7F07F1F4 00000000 */ nop -/* 0B3D28 7F07F1F8 0FC1F965 */ jal bondviewZoomFromWatchOnExit -/* 0B3D2C 7F07F1FC 00000000 */ nop -/* 0B3D30 7F07F200 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B3D34 7F07F204 00002025 */ move $a0, $zero -/* 0B3D38 7F07F208 13200005 */ beqz $t9, .L7F07F220 -/* 0B3D3C 7F07F20C 00000000 */ nop -/* 0B3D40 7F07F210 0FC17680 */ jal draw_item_in_hand -/* 0B3D44 7F07F214 00002825 */ move $a1, $zero -/* 0B3D48 7F07F218 10000003 */ b .L7F07F228 -/* 0B3D4C 7F07F21C 00000000 */ nop -.L7F07F220: -/* 0B3D50 7F07F220 0FC176B9 */ jal sub_GAME_7F05DAE4 -/* 0B3D54 7F07F224 00002025 */ move $a0, $zero -.L7F07F228: -/* 0B3D58 7F07F228 0FC1F97F */ jal check_watch_page_transistion_running -/* 0B3D5C 7F07F22C 00000000 */ nop -/* 0B3D60 7F07F230 10400009 */ beqz $v0, .L7F07F258 -/* 0B3D64 7F07F234 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) -/* 0B3D68 7F07F238 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B3D6C 7F07F23C 8D29A0B0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B3D70 7F07F240 24080001 */ li $t0, 1 -/* 0B3D74 7F07F244 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3D78 7F07F248 AD280200 */ sw $t0, 0x200($t1) -/* 0B3D7C 7F07F24C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3D80 7F07F250 10000012 */ b .L7F07F29C -/* 0B3D84 7F07F254 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F258: -/* 0B3D88 7F07F258 8D6BA0B0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B3D8C 7F07F25C 240A0007 */ li $t2, 7 -/* 0B3D90 7F07F260 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) -/* 0B3D94 7F07F264 AD6A01C8 */ sw $t2, 0x1c8($t3) -/* 0B3D98 7F07F268 8DADA0B0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B3D9C 7F07F26C 240C0001 */ li $t4, 1 -/* 0B3DA0 7F07F270 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B3DA4 7F07F274 ADAC01C0 */ sw $t4, 0x1c0($t5) -/* 0B3DA8 7F07F278 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3DAC 7F07F27C 3C188008 */ lui $t8, %hi(g_CurrentPlayer) -/* 0B3DB0 7F07F280 240F0001 */ li $t7, 1 -/* 0B3DB4 7F07F284 ADC001C4 */ sw $zero, 0x1c4($t6) -/* 0B3DB8 7F07F288 8F18A0B0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B3DBC 7F07F28C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3DC0 7F07F290 AF0F021C */ sw $t7, 0x21c($t8) -/* 0B3DC4 7F07F294 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3DC8 7F07F298 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F29C: -/* 0B3DCC 7F07F29C 24010007 */ li $at, 7 -.L7F07F2A0: -/* 0B3DD0 7F07F2A0 5441003F */ bnel $v0, $at, .L7F07F3A0 -/* 0B3DD4 7F07F2A4 24010008 */ li $at, 8 -/* 0B3DD8 7F07F2A8 8C7901C0 */ lw $t9, 0x1c0($v1) -/* 0B3DDC 7F07F2AC 24010001 */ li $at, 1 -/* 0B3DE0 7F07F2B0 17210024 */ bne $t9, $at, .L7F07F344 -/* 0B3DE4 7F07F2B4 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B3DE8 7F07F2B8 44817000 */ mtc1 $at, $f14 -/* 0B3DEC 7F07F2BC 00002025 */ move $a0, $zero -/* 0B3DF0 7F07F2C0 0FC1F7CA */ jal bondviewPauseAngleRelated -/* 0B3DF4 7F07F2C4 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B3DF8 7F07F2C8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3DFC 7F07F2CC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3E00 7F07F2D0 C7AE0028 */ lwc1 $f14, 0x28($sp) -/* 0B3E04 7F07F2D4 46000306 */ mov.s $f12, $f0 -/* 0B3E08 7F07F2D8 8C620220 */ lw $v0, 0x220($v1) -/* 0B3E0C 7F07F2DC 24010003 */ li $at, 3 -/* 0B3E10 7F07F2E0 5040000A */ beql $v0, $zero, .L7F07F30C -/* 0B3E14 7F07F2E4 3C0141A0 */ lui $at, 0x41a0 -/* 0B3E18 7F07F2E8 10410007 */ beq $v0, $at, .L7F07F308 -/* 0B3E1C 7F07F2EC 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B3E20 7F07F2F0 44813000 */ mtc1 $at, $f6 -/* 0B3E24 7F07F2F4 C4640258 */ lwc1 $f4, 0x258($v1) -/* 0B3E28 7F07F2F8 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B3E2C 7F07F2FC 44815000 */ mtc1 $at, $f10 -/* 0B3E30 7F07F300 46062202 */ mul.s $f8, $f4, $f6 -/* 0B3E34 7F07F304 460A4383 */ div.s $f14, $f8, $f10 -.L7F07F308: -/* 0B3E38 7F07F308 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -.L7F07F30C: -/* 0B3E3C 7F07F30C 44818000 */ mtc1 $at, $f16 -/* 0B3E40 7F07F310 00000000 */ nop -/* 0B3E44 7F07F314 46107080 */ add.s $f2, $f14, $f16 -/* 0B3E48 7F07F318 4602003C */ c.lt.s $f0, $f2 -/* 0B3E4C 7F07F31C 00000000 */ nop -/* 0B3E50 7F07F320 45000002 */ bc1f .L7F07F32C -/* 0B3E54 7F07F324 00000000 */ nop -/* 0B3E58 7F07F328 46001306 */ mov.s $f12, $f2 -.L7F07F32C: -/* 0B3E5C 7F07F32C 0FC1F80F */ jal sub_GAME_7F07E03C -/* 0B3E60 7F07F330 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B3E64 7F07F334 0FC1FA44 */ jal bondviewSetPauseWatchRelatedAlt -/* 0B3E68 7F07F338 C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 0B3E6C 7F07F33C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3E70 7F07F340 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07F344: -/* 0B3E74 7F07F344 8C620220 */ lw $v0, 0x220($v1) -/* 0B3E78 7F07F348 24010003 */ li $at, 3 -/* 0B3E7C 7F07F34C 24090008 */ li $t1, 8 -/* 0B3E80 7F07F350 10400008 */ beqz $v0, .L7F07F374 -/* 0B3E84 7F07F354 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) -/* 0B3E88 7F07F358 10410006 */ beq $v0, $at, .L7F07F374 -/* 0B3E8C 7F07F35C 24080001 */ li $t0, 1 -/* 0B3E90 7F07F360 AC680200 */ sw $t0, 0x200($v1) -/* 0B3E94 7F07F364 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3E98 7F07F368 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3E9C 7F07F36C 1000000B */ b .L7F07F39C -/* 0B3EA0 7F07F370 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F374: -/* 0B3EA4 7F07F374 AC6901C8 */ sw $t1, 0x1c8($v1) -/* 0B3EA8 7F07F378 8D6BA0B0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B3EAC 7F07F37C 240A0001 */ li $t2, 1 -/* 0B3EB0 7F07F380 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B3EB4 7F07F384 AD6A01C0 */ sw $t2, 0x1c0($t3) -/* 0B3EB8 7F07F388 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B3EBC 7F07F38C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B3EC0 7F07F390 AD8001C4 */ sw $zero, 0x1c4($t4) -/* 0B3EC4 7F07F394 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3EC8 7F07F398 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F39C: -/* 0B3ECC 7F07F39C 24010008 */ li $at, 8 -.L7F07F3A0: -/* 0B3ED0 7F07F3A0 14410069 */ bne $v0, $at, .L7F07F548 -/* 0B3ED4 7F07F3A4 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) -/* 0B3ED8 7F07F3A8 AC600200 */ sw $zero, 0x200($v1) -/* 0B3EDC 7F07F3AC 8DADA0B0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B3EE0 7F07F3B0 24010001 */ li $at, 1 -/* 0B3EE4 7F07F3B4 8DAE01C0 */ lw $t6, 0x1c0($t5) -/* 0B3EE8 7F07F3B8 15C10028 */ bne $t6, $at, .L7F07F45C -/* 0B3EEC 7F07F3BC 00000000 */ nop -/* 0B3EF0 7F07F3C0 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B3EF4 7F07F3C4 24040001 */ li $a0, 1 -/* 0B3EF8 7F07F3C8 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B3EFC 7F07F3CC 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3F00 7F07F3D0 24040001 */ li $a0, 1 -/* 0B3F04 7F07F3D4 8FAF001C */ lw $t7, 0x1c($sp) -/* 0B3F08 7F07F3D8 504F000B */ beql $v0, $t7, .L7F07F408 -/* 0B3F0C 7F07F3DC 8FB8003C */ lw $t8, 0x3c($sp) -/* 0B3F10 7F07F3E0 0FC173AF */ jal Gun_hand_without_item -/* 0B3F14 7F07F3E4 24040001 */ li $a0, 1 -/* 0B3F18 7F07F3E8 50400007 */ beql $v0, $zero, .L7F07F408 -/* 0B3F1C 7F07F3EC 8FB8003C */ lw $t8, 0x3c($sp) -/* 0B3F20 7F07F3F0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3F24 7F07F3F4 24040001 */ li $a0, 1 -/* 0B3F28 7F07F3F8 24040001 */ li $a0, 1 -/* 0B3F2C 7F07F3FC 0FC17680 */ jal draw_item_in_hand -/* 0B3F30 7F07F400 00402825 */ move $a1, $v0 -/* 0B3F34 7F07F404 8FB8003C */ lw $t8, 0x3c($sp) -.L7F07F408: -/* 0B3F38 7F07F408 1300004F */ beqz $t8, .L7F07F548 -/* 0B3F3C 7F07F40C 00000000 */ nop -/* 0B3F40 7F07F410 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B3F44 7F07F414 00002025 */ move $a0, $zero -/* 0B3F48 7F07F418 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B3F4C 7F07F41C 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3F50 7F07F420 00002025 */ move $a0, $zero -/* 0B3F54 7F07F424 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B3F58 7F07F428 10590047 */ beq $v0, $t9, .L7F07F548 -/* 0B3F5C 7F07F42C 00000000 */ nop -/* 0B3F60 7F07F430 0FC173AF */ jal Gun_hand_without_item -/* 0B3F64 7F07F434 00002025 */ move $a0, $zero -/* 0B3F68 7F07F438 10400043 */ beqz $v0, .L7F07F548 -/* 0B3F6C 7F07F43C 00000000 */ nop -/* 0B3F70 7F07F440 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3F74 7F07F444 00002025 */ move $a0, $zero -/* 0B3F78 7F07F448 00002025 */ move $a0, $zero -/* 0B3F7C 7F07F44C 0FC17680 */ jal draw_item_in_hand -/* 0B3F80 7F07F450 00402825 */ move $a1, $v0 -/* 0B3F84 7F07F454 1000003C */ b .L7F07F548 -/* 0B3F88 7F07F458 00000000 */ nop -.L7F07F45C: -/* 0B3F8C 7F07F45C 0FC1F81A */ jal sub_GAME_7F07E068 -/* 0B3F90 7F07F460 00000000 */ nop -/* 0B3F94 7F07F464 14400038 */ bnez $v0, .L7F07F548 -/* 0B3F98 7F07F468 00000000 */ nop -/* 0B3F9C 7F07F46C 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B3FA0 7F07F470 24040001 */ li $a0, 1 -/* 0B3FA4 7F07F474 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B3FA8 7F07F478 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3FAC 7F07F47C 24040001 */ li $a0, 1 -/* 0B3FB0 7F07F480 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B3FB4 7F07F484 14480030 */ bne $v0, $t0, .L7F07F548 -/* 0B3FB8 7F07F488 00000000 */ nop -/* 0B3FBC 7F07F48C 0FC173AF */ jal Gun_hand_without_item -/* 0B3FC0 7F07F490 24040001 */ li $a0, 1 -/* 0B3FC4 7F07F494 1040002C */ beqz $v0, .L7F07F548 -/* 0B3FC8 7F07F498 8FA9003C */ lw $t1, 0x3c($sp) -/* 0B3FCC 7F07F49C 1120000D */ beqz $t1, .L7F07F4D4 -/* 0B3FD0 7F07F4A0 00000000 */ nop -/* 0B3FD4 7F07F4A4 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B3FD8 7F07F4A8 00002025 */ move $a0, $zero -/* 0B3FDC 7F07F4AC AFA20018 */ sw $v0, 0x18($sp) -/* 0B3FE0 7F07F4B0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B3FE4 7F07F4B4 00002025 */ move $a0, $zero -/* 0B3FE8 7F07F4B8 8FAA0018 */ lw $t2, 0x18($sp) -/* 0B3FEC 7F07F4BC 144A0022 */ bne $v0, $t2, .L7F07F548 -/* 0B3FF0 7F07F4C0 00000000 */ nop -/* 0B3FF4 7F07F4C4 0FC173AF */ jal Gun_hand_without_item -/* 0B3FF8 7F07F4C8 00002025 */ move $a0, $zero -/* 0B3FFC 7F07F4CC 1040001E */ beqz $v0, .L7F07F548 -/* 0B4000 7F07F4D0 00000000 */ nop -.L7F07F4D4: -/* 0B4004 7F07F4D4 0FC176B9 */ jal sub_GAME_7F05DAE4 -/* 0B4008 7F07F4D8 24040001 */ li $a0, 1 -/* 0B400C 7F07F4DC 8FAB003C */ lw $t3, 0x3c($sp) -/* 0B4010 7F07F4E0 51600004 */ beql $t3, $zero, .L7F07F4F4 -/* 0B4014 7F07F4E4 24040008 */ li $a0, 8 -/* 0B4018 7F07F4E8 0FC176B9 */ jal sub_GAME_7F05DAE4 -/* 0B401C 7F07F4EC 00002025 */ move $a0, $zero -/* 0B4020 7F07F4F0 24040008 */ li $a0, 8 -.L7F07F4F4: -/* 0B4024 7F07F4F4 0FC1A96A */ jal set_unset_bitflags -/* 0B4028 7F07F4F8 24050001 */ li $a1, 1 -/* 0B402C 7F07F4FC 24040004 */ li $a0, 4 -/* 0B4030 7F07F500 0FC1A43D */ jal set_unset_ammo_on_screen_setting -/* 0B4034 7F07F504 24050001 */ li $a1, 1 -/* 0B4038 7F07F508 0FC228E0 */ jal hudmsgsSetOn -/* 0B403C 7F07F50C 24040001 */ li $a0, 1 -/* 0B4040 7F07F510 0FC22A4A */ jal sub_GAME_7F08A928 -/* 0B4044 7F07F514 24040001 */ li $a0, 1 -/* 0B4048 7F07F518 24040004 */ li $a0, 4 -/* 0B404C 7F07F51C 0FC15858 */ jal countdownTimerSetVisible -/* 0B4050 7F07F520 24050001 */ li $a1, 1 -/* 0B4054 7F07F524 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) -/* 0B4058 7F07F528 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B405C 7F07F52C 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) -/* 0B4060 7F07F530 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B4064 7F07F534 AD8001C8 */ sw $zero, 0x1c8($t4) -/* 0B4068 7F07F538 8DADA0B0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B406C 7F07F53C ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B4070 7F07F540 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B4074 7F07F544 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07F548: -/* 0B4078 7F07F548 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B407C 7F07F54C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4080 7F07F550 24010009 */ li $at, 9 -/* 0B4084 7F07F554 24040001 */ li $a0, 1 -/* 0B4088 7F07F558 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B408C 7F07F55C 15E10023 */ bne $t7, $at, .L7F07F5EC -/* 0B4090 7F07F560 00000000 */ nop -/* 0B4094 7F07F564 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B4098 7F07F568 AC600200 */ sw $zero, 0x200($v1) -/* 0B409C 7F07F56C AFA2001C */ sw $v0, 0x1c($sp) -/* 0B40A0 7F07F570 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B40A4 7F07F574 24040001 */ li $a0, 1 -/* 0B40A8 7F07F578 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B40AC 7F07F57C 1058001B */ beq $v0, $t8, .L7F07F5EC -/* 0B40B0 7F07F580 00000000 */ nop -/* 0B40B4 7F07F584 0FC173AF */ jal Gun_hand_without_item -/* 0B40B8 7F07F588 24040001 */ li $a0, 1 -/* 0B40BC 7F07F58C 10400017 */ beqz $v0, .L7F07F5EC -/* 0B40C0 7F07F590 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B40C4 7F07F594 1320000C */ beqz $t9, .L7F07F5C8 -/* 0B40C8 7F07F598 00000000 */ nop -/* 0B40CC 7F07F59C 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B40D0 7F07F5A0 00002025 */ move $a0, $zero -/* 0B40D4 7F07F5A4 AFA20018 */ sw $v0, 0x18($sp) -/* 0B40D8 7F07F5A8 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B40DC 7F07F5AC 00002025 */ move $a0, $zero -/* 0B40E0 7F07F5B0 8FA80018 */ lw $t0, 0x18($sp) -/* 0B40E4 7F07F5B4 1048000D */ beq $v0, $t0, .L7F07F5EC -/* 0B40E8 7F07F5B8 00000000 */ nop -/* 0B40EC 7F07F5BC 0FC173AF */ jal Gun_hand_without_item -/* 0B40F0 7F07F5C0 00002025 */ move $a0, $zero -/* 0B40F4 7F07F5C4 10400009 */ beqz $v0, .L7F07F5EC -.L7F07F5C8: -/* 0B40F8 7F07F5C8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B40FC 7F07F5CC 2442A0B0 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x5f50 -/* 0B4100 7F07F5D0 8C4A0000 */ lw $t2, ($v0) -/* 0B4104 7F07F5D4 24090008 */ li $t1, 8 -/* 0B4108 7F07F5D8 AD4901C8 */ sw $t1, 0x1c8($t2) -/* 0B410C 7F07F5DC 8C4B0000 */ lw $t3, ($v0) -/* 0B4110 7F07F5E0 AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B4114 7F07F5E4 8C4C0000 */ lw $t4, ($v0) -/* 0B4118 7F07F5E8 AD8001C4 */ sw $zero, 0x1c4($t4) -.L7F07F5EC: -/* 0B411C 7F07F5EC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B4120 7F07F5F0 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4124 7F07F5F4 2401000A */ li $at, 10 -/* 0B4128 7F07F5F8 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B412C 7F07F5FC 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B4130 7F07F600 15A1002D */ bne $t5, $at, .L7F07F6B8 -/* 0B4134 7F07F604 00000000 */ nop -/* 0B4138 7F07F608 AC600200 */ sw $zero, 0x200($v1) -/* 0B413C 7F07F60C 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B4140 7F07F610 24010001 */ li $at, 1 -/* 0B4144 7F07F614 8DCF01C0 */ lw $t7, 0x1c0($t6) -/* 0B4148 7F07F618 15E10005 */ bne $t7, $at, .L7F07F630 -/* 0B414C 7F07F61C 00000000 */ nop -/* 0B4150 7F07F620 0FC1F7CA */ jal bondviewPauseAngleRelated -/* 0B4154 7F07F624 00002025 */ move $a0, $zero -/* 0B4158 7F07F628 0FC1F80F */ jal sub_GAME_7F07E03C -/* 0B415C 7F07F62C 46000306 */ mov.s $f12, $f0 -.L7F07F630: -/* 0B4160 7F07F630 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B4164 7F07F634 24040001 */ li $a0, 1 -/* 0B4168 7F07F638 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B416C 7F07F63C 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B4170 7F07F640 24040001 */ li $a0, 1 -/* 0B4174 7F07F644 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B4178 7F07F648 1058001B */ beq $v0, $t8, .L7F07F6B8 -/* 0B417C 7F07F64C 00000000 */ nop -/* 0B4180 7F07F650 0FC173AF */ jal Gun_hand_without_item -/* 0B4184 7F07F654 24040001 */ li $a0, 1 -/* 0B4188 7F07F658 10400017 */ beqz $v0, .L7F07F6B8 -/* 0B418C 7F07F65C 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B4190 7F07F660 1320000C */ beqz $t9, .L7F07F694 -/* 0B4194 7F07F664 00000000 */ nop -/* 0B4198 7F07F668 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B419C 7F07F66C 00002025 */ move $a0, $zero -/* 0B41A0 7F07F670 AFA20018 */ sw $v0, 0x18($sp) -/* 0B41A4 7F07F674 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B41A8 7F07F678 00002025 */ move $a0, $zero -/* 0B41AC 7F07F67C 8FA80018 */ lw $t0, 0x18($sp) -/* 0B41B0 7F07F680 1048000D */ beq $v0, $t0, .L7F07F6B8 -/* 0B41B4 7F07F684 00000000 */ nop -/* 0B41B8 7F07F688 0FC173AF */ jal Gun_hand_without_item -/* 0B41BC 7F07F68C 00002025 */ move $a0, $zero -/* 0B41C0 7F07F690 10400009 */ beqz $v0, .L7F07F6B8 -.L7F07F694: -/* 0B41C4 7F07F694 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B41C8 7F07F698 2442A0B0 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x5f50 -/* 0B41CC 7F07F69C 8C4A0000 */ lw $t2, ($v0) -/* 0B41D0 7F07F6A0 24090008 */ li $t1, 8 -/* 0B41D4 7F07F6A4 AD4901C8 */ sw $t1, 0x1c8($t2) -/* 0B41D8 7F07F6A8 8C4B0000 */ lw $t3, ($v0) -/* 0B41DC 7F07F6AC AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B41E0 7F07F6B0 8C4C0000 */ lw $t4, ($v0) -/* 0B41E4 7F07F6B4 AD8001C4 */ sw $zero, 0x1c4($t4) -.L7F07F6B8: -/* 0B41E8 7F07F6B8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B41EC 7F07F6BC 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B41F0 7F07F6C0 2401000B */ li $at, 11 -/* 0B41F4 7F07F6C4 24040001 */ li $a0, 1 -/* 0B41F8 7F07F6C8 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B41FC 7F07F6CC 15A10024 */ bne $t5, $at, .L7F07F760 -/* 0B4200 7F07F6D0 00000000 */ nop -/* 0B4204 7F07F6D4 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B4208 7F07F6D8 AC600200 */ sw $zero, 0x200($v1) -/* 0B420C 7F07F6DC AFA2001C */ sw $v0, 0x1c($sp) -/* 0B4210 7F07F6E0 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B4214 7F07F6E4 24040001 */ li $a0, 1 -/* 0B4218 7F07F6E8 8FAE001C */ lw $t6, 0x1c($sp) -/* 0B421C 7F07F6EC 144E001C */ bne $v0, $t6, .L7F07F760 -/* 0B4220 7F07F6F0 00000000 */ nop -/* 0B4224 7F07F6F4 0FC173AF */ jal Gun_hand_without_item -/* 0B4228 7F07F6F8 24040001 */ li $a0, 1 -/* 0B422C 7F07F6FC 10400018 */ beqz $v0, .L7F07F760 -/* 0B4230 7F07F700 8FAF003C */ lw $t7, 0x3c($sp) -/* 0B4234 7F07F704 11E0000C */ beqz $t7, .L7F07F738 -/* 0B4238 7F07F708 00000000 */ nop -/* 0B423C 7F07F70C 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B4240 7F07F710 00002025 */ move $a0, $zero -/* 0B4244 7F07F714 AFA20018 */ sw $v0, 0x18($sp) -/* 0B4248 7F07F718 0FC17691 */ jal get_item_in_hand_or_watch_menu -/* 0B424C 7F07F71C 00002025 */ move $a0, $zero -/* 0B4250 7F07F720 8FB80018 */ lw $t8, 0x18($sp) -/* 0B4254 7F07F724 1458000E */ bne $v0, $t8, .L7F07F760 -/* 0B4258 7F07F728 00000000 */ nop -/* 0B425C 7F07F72C 0FC173AF */ jal Gun_hand_without_item -/* 0B4260 7F07F730 00002025 */ move $a0, $zero -/* 0B4264 7F07F734 1040000A */ beqz $v0, .L7F07F760 -.L7F07F738: -/* 0B4268 7F07F738 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B426C 7F07F73C 8D08A0B0 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B4270 7F07F740 24190001 */ li $t9, 1 -/* 0B4274 7F07F744 3C098008 */ lui $t1, %hi(g_CurrentPlayer) -/* 0B4278 7F07F748 AD1901C8 */ sw $t9, 0x1c8($t0) -/* 0B427C 7F07F74C 8D29A0B0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B4280 7F07F750 3C0A8008 */ lui $t2, %hi(g_CurrentPlayer) -/* 0B4284 7F07F754 AD2001C0 */ sw $zero, 0x1c0($t1) -/* 0B4288 7F07F758 8D4AA0B0 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B428C 7F07F75C AD4001C4 */ sw $zero, 0x1c4($t2) -.L7F07F760: -/* 0B4290 7F07F760 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B4294 7F07F764 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4298 7F07F768 2401000D */ li $at, 13 -/* 0B429C 7F07F76C 24040001 */ li $a0, 1 -/* 0B42A0 7F07F770 8C6B01C8 */ lw $t3, 0x1c8($v1) -/* 0B42A4 7F07F774 1561001B */ bne $t3, $at, .L7F07F7E4 -/* 0B42A8 7F07F778 00000000 */ nop -/* 0B42AC 7F07F77C 0FC173AF */ jal Gun_hand_without_item -/* 0B42B0 7F07F780 AC600200 */ sw $zero, 0x200($v1) -/* 0B42B4 7F07F784 10400017 */ beqz $v0, .L7F07F7E4 -/* 0B42B8 7F07F788 00000000 */ nop -/* 0B42BC 7F07F78C 0FC173AF */ jal Gun_hand_without_item -/* 0B42C0 7F07F790 00002025 */ move $a0, $zero -/* 0B42C4 7F07F794 10400013 */ beqz $v0, .L7F07F7E4 -/* 0B42C8 7F07F798 3C038008 */ lui $v1, %hi(g_CurrentPlayer) -/* 0B42CC 7F07F79C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B42D0 7F07F7A0 24010005 */ li $at, 5 -/* 0B42D4 7F07F7A4 8C620C3C */ lw $v0, 0xc3c($v1) -/* 0B42D8 7F07F7A8 1041000E */ beq $v0, $at, .L7F07F7E4 -/* 0B42DC 7F07F7AC 24010006 */ li $at, 6 -/* 0B42E0 7F07F7B0 1041000C */ beq $v0, $at, .L7F07F7E4 -/* 0B42E4 7F07F7B4 24010007 */ li $at, 7 -/* 0B42E8 7F07F7B8 1041000A */ beq $v0, $at, .L7F07F7E4 -/* 0B42EC 7F07F7BC 24010008 */ li $at, 8 -/* 0B42F0 7F07F7C0 10410008 */ beq $v0, $at, .L7F07F7E4 -/* 0B42F4 7F07F7C4 240C0001 */ li $t4, 1 -/* 0B42F8 7F07F7C8 AC6C01C8 */ sw $t4, 0x1c8($v1) -/* 0B42FC 7F07F7CC 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) -/* 0B4300 7F07F7D0 8DADA0B0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B4304 7F07F7D4 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B4308 7F07F7D8 ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B430C 7F07F7DC 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B4310 7F07F7E0 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07F7E4: -/* 0B4314 7F07F7E4 0FC1F824 */ jal sub_GAME_7F07E090 -/* 0B4318 7F07F7E8 00000000 */ nop -/* 0B431C 7F07F7EC 0FC1FA59 */ jal bondviewStepWatchAnimation -/* 0B4320 7F07F7F0 00000000 */ nop -/* 0B4324 7F07F7F4 0FC1F98B */ jal bondviewUpdateWatchZoomIn -/* 0B4328 7F07F7F8 00000000 */ nop -/* 0B432C 7F07F7FC 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) -/* 0B4330 7F07F800 8DEFA0B0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B4334 7F07F804 8DE201C8 */ lw $v0, 0x1c8($t7) -/* 0B4338 7F07F808 24010005 */ li $at, 5 -.L7F07F80C: -/* 0B433C 7F07F80C 54410008 */ bnel $v0, $at, .L7F07F830 -/* 0B4340 7F07F810 2401000C */ li $at, 12 -/* 0B4344 7F07F814 0FC2FEFE */ jal lvlSetControlsLockedFlag -/* 0B4348 7F07F818 24040001 */ li $a0, 1 -/* 0B434C 7F07F81C 0FC29AA0 */ jal sub_GAME_7F0A6A80 -/* 0B4350 7F07F820 00000000 */ nop -/* 0B4354 7F07F824 1000000B */ b .L7F07F854 -/* 0B4358 7F07F828 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B435C 7F07F82C 2401000C */ li $at, 12 -.L7F07F830: -/* 0B4360 7F07F830 14410005 */ bne $v0, $at, .L7F07F848 -/* 0B4364 7F07F834 00000000 */ nop -/* 0B4368 7F07F838 0FC2FEFE */ jal lvlSetControlsLockedFlag -/* 0B436C 7F07F83C 24040001 */ li $a0, 1 -/* 0B4370 7F07F840 10000004 */ b .L7F07F854 -/* 0B4374 7F07F844 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07F848: -/* 0B4378 7F07F848 0FC2FEFE */ jal lvlSetControlsLockedFlag -/* 0B437C 7F07F84C 00002025 */ move $a0, $zero -/* 0B4380 7F07F850 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07F854: -/* 0B4384 7F07F854 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B4388 7F07F858 03E00008 */ jr $ra -/* 0B438C 7F07F85C 00000000 */ nop -) -#endif -#ifdef VERSION_JP -GLOBAL_ASM( -.text -glabel sub_GAME_7F07EC54 -/* 0B3DD0 7F07F260 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B3DD4 7F07F264 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3DD8 7F07F268 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B3DDC 7F07F26C AFBF0014 */ sw $ra, 0x14($sp) -/* 0B3DE0 7F07F270 8DC201C8 */ lw $v0, 0x1c8($t6) -/* 0B3DE4 7F07F274 504002E9 */ beql $v0, $zero, .Ljp7F07FE1C -/* 0B3DE8 7F07F278 24010005 */ li $at, 5 -/* 0B3DEC 7F07F27C 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B3DF0 7F07F280 00002025 */ move $a0, $zero -/* 0B3DF4 7F07F284 3843001E */ xori $v1, $v0, 0x1e -/* 0B3DF8 7F07F288 2C630001 */ sltiu $v1, $v1, 1 -/* 0B3DFC 7F07F28C 14600006 */ bnez $v1, .Ljp7F07F2A8 -/* 0B3E00 7F07F290 AFA3001C */ sw $v1, 0x1c($sp) -/* 0B3E04 7F07F294 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B3E08 7F07F298 00002025 */ move $a0, $zero -/* 0B3E0C 7F07F29C 384F0017 */ xori $t7, $v0, 0x17 -/* 0B3E10 7F07F2A0 2DEF0001 */ sltiu $t7, $t7, 1 -/* 0B3E14 7F07F2A4 AFAF001C */ sw $t7, 0x1c($sp) -.Ljp7F07F2A8: -/* 0B3E18 7F07F2A8 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B3E1C 7F07F2AC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3E20 7F07F2B0 13000004 */ beqz $t8, .Ljp7F07F2C4 -/* 0B3E24 7F07F2B4 AFB8003C */ sw $t8, 0x3c($sp) -/* 0B3E28 7F07F2B8 24190023 */ li $t9, 35 -/* 0B3E2C 7F07F2BC 10000003 */ b .Ljp7F07F2CC -/* 0B3E30 7F07F2C0 AFB90038 */ sw $t9, 0x38($sp) -.Ljp7F07F2C4: -/* 0B3E34 7F07F2C4 24080011 */ li $t0, 17 -/* 0B3E38 7F07F2C8 AFA80038 */ sw $t0, 0x38($sp) -.Ljp7F07F2CC: -/* 0B3E3C 7F07F2CC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3E40 7F07F2D0 3C0A8005 */ lui $t2, %hi(g_ClockTimer) # $t2, 0x8005 -/* 0B3E44 7F07F2D4 8D4A83A4 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 0B3E48 7F07F2D8 8C6901C4 */ lw $t1, 0x1c4($v1) -/* 0B3E4C 7F07F2DC 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B3E50 7F07F2E0 24010001 */ li $at, 1 -/* 0B3E54 7F07F2E4 012A5821 */ addu $t3, $t1, $t2 -/* 0B3E58 7F07F2E8 AC6B01C4 */ sw $t3, 0x1c4($v1) -/* 0B3E5C 7F07F2EC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3E60 7F07F2F0 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3E64 7F07F2F4 8C6C01C0 */ lw $t4, 0x1c0($v1) -/* 0B3E68 7F07F2F8 258D0001 */ addiu $t5, $t4, 1 -/* 0B3E6C 7F07F2FC AC6D01C0 */ sw $t5, 0x1c0($v1) -/* 0B3E70 7F07F300 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3E74 7F07F304 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3E78 7F07F308 ADC00200 */ sw $zero, 0x200($t6) -/* 0B3E7C 7F07F30C 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3E80 7F07F310 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B3E84 7F07F314 15E10038 */ bne $t7, $at, .Ljp7F07F3F8 -/* 0B3E88 7F07F318 00000000 */ nop -/* 0B3E8C 7F07F31C AC600200 */ sw $zero, 0x200($v1) -/* 0B3E90 7F07F320 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B3E94 7F07F324 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B3E98 7F07F328 24010001 */ li $at, 1 -/* 0B3E9C 7F07F32C 24040001 */ li $a0, 1 -/* 0B3EA0 7F07F330 8F0201C0 */ lw $v0, 0x1c0($t8) -/* 0B3EA4 7F07F334 54410006 */ bnel $v0, $at, .Ljp7F07F350 -/* 0B3EA8 7F07F338 24010002 */ li $at, 2 -/* 0B3EAC 7F07F33C 0FC177C8 */ jal draw_item_in_hand -/* 0B3EB0 7F07F340 24050054 */ li $a1, 84 -/* 0B3EB4 7F07F344 1000002C */ b .Ljp7F07F3F8 -/* 0B3EB8 7F07F348 00000000 */ nop -/* 0B3EBC 7F07F34C 24010002 */ li $at, 2 -.Ljp7F07F350: -/* 0B3EC0 7F07F350 14410007 */ bne $v0, $at, .Ljp7F07F370 -/* 0B3EC4 7F07F354 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B3EC8 7F07F358 13200027 */ beqz $t9, .Ljp7F07F3F8 -/* 0B3ECC 7F07F35C 00002025 */ move $a0, $zero -/* 0B3ED0 7F07F360 0FC177C8 */ jal draw_item_in_hand -/* 0B3ED4 7F07F364 00002825 */ move $a1, $zero -/* 0B3ED8 7F07F368 10000023 */ b .Ljp7F07F3F8 -/* 0B3EDC 7F07F36C 00000000 */ nop -.Ljp7F07F370: -/* 0B3EE0 7F07F370 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B3EE4 7F07F374 24040001 */ li $a0, 1 -/* 0B3EE8 7F07F378 24010054 */ li $at, 84 -/* 0B3EEC 7F07F37C 1441001E */ bne $v0, $at, .Ljp7F07F3F8 -/* 0B3EF0 7F07F380 00000000 */ nop -/* 0B3EF4 7F07F384 0FC174F7 */ jal Gun_hand_without_item -/* 0B3EF8 7F07F388 24040001 */ li $a0, 1 -/* 0B3EFC 7F07F38C 1040001A */ beqz $v0, .Ljp7F07F3F8 -/* 0B3F00 7F07F390 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B3F04 7F07F394 11000008 */ beqz $t0, .Ljp7F07F3B8 -/* 0B3F08 7F07F398 00000000 */ nop -/* 0B3F0C 7F07F39C 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B3F10 7F07F3A0 00002025 */ move $a0, $zero -/* 0B3F14 7F07F3A4 14400014 */ bnez $v0, .Ljp7F07F3F8 -/* 0B3F18 7F07F3A8 00000000 */ nop -/* 0B3F1C 7F07F3AC 0FC174F7 */ jal Gun_hand_without_item -/* 0B3F20 7F07F3B0 00002025 */ move $a0, $zero -/* 0B3F24 7F07F3B4 10400010 */ beqz $v0, .Ljp7F07F3F8 -.Ljp7F07F3B8: -/* 0B3F28 7F07F3B8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3F2C 7F07F3BC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3F30 7F07F3C0 8FAA0038 */ lw $t2, 0x38($sp) -/* 0B3F34 7F07F3C4 240B0002 */ li $t3, 2 -/* 0B3F38 7F07F3C8 8C6901C4 */ lw $t1, 0x1c4($v1) -/* 0B3F3C 7F07F3CC 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8008 -/* 0B3F40 7F07F3D0 012A082A */ slt $at, $t1, $t2 -/* 0B3F44 7F07F3D4 14200008 */ bnez $at, .Ljp7F07F3F8 -/* 0B3F48 7F07F3D8 00000000 */ nop -/* 0B3F4C 7F07F3DC AC6B01C8 */ sw $t3, 0x1c8($v1) -/* 0B3F50 7F07F3E0 8DADA120 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B3F54 7F07F3E4 240C0001 */ li $t4, 1 -/* 0B3F58 7F07F3E8 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B3F5C 7F07F3EC ADAC01C0 */ sw $t4, 0x1c0($t5) -/* 0B3F60 7F07F3F0 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B3F64 7F07F3F4 ADC001C4 */ sw $zero, 0x1c4($t6) -.Ljp7F07F3F8: -/* 0B3F68 7F07F3F8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3F6C 7F07F3FC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3F70 7F07F400 24010002 */ li $at, 2 -/* 0B3F74 7F07F404 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B3F78 7F07F408 55E10043 */ bnel $t7, $at, .Ljp7F07F518 -/* 0B3F7C 7F07F40C 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B3F80 7F07F410 AC600200 */ sw $zero, 0x200($v1) -/* 0B3F84 7F07F414 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3F88 7F07F418 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3F8C 7F07F41C 24010001 */ li $at, 1 -/* 0B3F90 7F07F420 24040008 */ li $a0, 8 -/* 0B3F94 7F07F424 8C7801C0 */ lw $t8, 0x1c0($v1) -/* 0B3F98 7F07F428 57010026 */ bnel $t8, $at, .Ljp7F07F4C4 -/* 0B3F9C 7F07F42C C4640214 */ lwc1 $f4, 0x214($v1) -/* 0B3FA0 7F07F430 0FC1AAE5 */ jal set_unset_bitflags -/* 0B3FA4 7F07F434 00002825 */ move $a1, $zero -/* 0B3FA8 7F07F438 24040004 */ li $a0, 4 -/* 0B3FAC 7F07F43C 0FC1A5B8 */ jal set_unset_ammo_on_screen_setting -/* 0B3FB0 7F07F440 00002825 */ move $a1, $zero -/* 0B3FB4 7F07F444 0FC22AAD */ jal hudmsgsSetOff -/* 0B3FB8 7F07F448 24040001 */ li $a0, 1 -/* 0B3FBC 7F07F44C 0FC22C48 */ jal sub_GAME_7F08A944 -/* 0B3FC0 7F07F450 24040001 */ li $a0, 1 -/* 0B3FC4 7F07F454 24040004 */ li $a0, 4 -/* 0B3FC8 7F07F458 0FC15997 */ jal countdownTimerSetVisible -/* 0B3FCC 7F07F45C 00002825 */ move $a1, $zero -/* 0B3FD0 7F07F460 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B3FD4 7F07F464 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B3FD8 7F07F468 24010002 */ li $at, 2 -/* 0B3FDC 7F07F46C 8C640218 */ lw $a0, 0x218($v1) -/* 0B3FE0 7F07F470 10800005 */ beqz $a0, .Ljp7F07F488 -/* 0B3FE4 7F07F474 00000000 */ nop -/* 0B3FE8 7F07F478 10810003 */ beq $a0, $at, .Ljp7F07F488 -/* 0B3FEC 7F07F47C 24010003 */ li $at, 3 -/* 0B3FF0 7F07F480 54810010 */ bnel $a0, $at, .Ljp7F07F4C4 -/* 0B3FF4 7F07F484 C4640214 */ lwc1 $f4, 0x214($v1) -.Ljp7F07F488: -/* 0B3FF8 7F07F488 0FC1F953 */ jal bondviewPauseAngleRelated -/* 0B3FFC 7F07F48C 24040001 */ li $a0, 1 -/* 0B4000 7F07F490 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B4004 7F07F494 44811000 */ mtc1 $at, $f2 -/* 0B4008 7F07F498 46000306 */ mov.s $f12, $f0 -/* 0B400C 7F07F49C 4602003C */ c.lt.s $f0, $f2 -/* 0B4010 7F07F4A0 00000000 */ nop -/* 0B4014 7F07F4A4 45000002 */ bc1f .Ljp7F07F4B0 -/* 0B4018 7F07F4A8 00000000 */ nop -/* 0B401C 7F07F4AC 46001306 */ mov.s $f12, $f2 -.Ljp7F07F4B0: -/* 0B4020 7F07F4B0 0FC1F98D */ jal sub_GAME_7F07E010 -/* 0B4024 7F07F4B4 00000000 */ nop -/* 0B4028 7F07F4B8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B402C 7F07F4BC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4030 7F07F4C0 C4640214 */ lwc1 $f4, 0x214($v1) -.Ljp7F07F4C4: -/* 0B4034 7F07F4C4 C4660210 */ lwc1 $f6, 0x210($v1) -/* 0B4038 7F07F4C8 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B403C 7F07F4CC 44815000 */ mtc1 $at, $f10 -/* 0B4040 7F07F4D0 46062201 */ sub.s $f8, $f4, $f6 -/* 0B4044 7F07F4D4 24190003 */ li $t9, 3 -/* 0B4048 7F07F4D8 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B404C 7F07F4DC 460A403C */ c.lt.s $f8, $f10 -/* 0B4050 7F07F4E0 00000000 */ nop -/* 0B4054 7F07F4E4 4502000C */ bc1fl .Ljp7F07F518 -/* 0B4058 7F07F4E8 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B405C 7F07F4EC AC7901C8 */ sw $t9, 0x1c8($v1) -/* 0B4060 7F07F4F0 8D29A120 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B4064 7F07F4F4 24080001 */ li $t0, 1 -/* 0B4068 7F07F4F8 3C0A8008 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8008 -/* 0B406C 7F07F4FC AD2801C0 */ sw $t0, 0x1c0($t1) -/* 0B4070 7F07F500 8D4AA120 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B4074 7F07F504 0FC1FB76 */ jal sub_GAME_7F07E7CC -/* 0B4078 7F07F508 AD4001C4 */ sw $zero, 0x1c4($t2) -/* 0B407C 7F07F50C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4080 7F07F510 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4084 7F07F514 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F518: -/* 0B4088 7F07F518 24010003 */ li $at, 3 -/* 0B408C 7F07F51C 54410059 */ bnel $v0, $at, .Ljp7F07F684 -/* 0B4090 7F07F520 24010004 */ li $at, 4 -/* 0B4094 7F07F524 8C6B01C0 */ lw $t3, 0x1c0($v1) -/* 0B4098 7F07F528 24010001 */ li $at, 1 -/* 0B409C 7F07F52C 55610036 */ bnel $t3, $at, .Ljp7F07F608 -/* 0B40A0 7F07F530 8C620220 */ lw $v0, 0x220($v1) -/* 0B40A4 7F07F534 8C620220 */ lw $v0, 0x220($v1) -/* 0B40A8 7F07F538 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B40AC 7F07F53C 44817000 */ mtc1 $at, $f14 -/* 0B40B0 7F07F540 1040000D */ beqz $v0, .Ljp7F07F578 -/* 0B40B4 7F07F544 8C640218 */ lw $a0, 0x218($v1) -/* 0B40B8 7F07F548 24010003 */ li $at, 3 -/* 0B40BC 7F07F54C 1041000A */ beq $v0, $at, .Ljp7F07F578 -/* 0B40C0 7F07F550 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B40C4 7F07F554 44818000 */ mtc1 $at, $f16 -/* 0B40C8 7F07F558 C4720258 */ lwc1 $f18, 0x258($v1) -/* 0B40CC 7F07F55C 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B40D0 7F07F560 44813000 */ mtc1 $at, $f6 -/* 0B40D4 7F07F564 46128101 */ sub.s $f4, $f16, $f18 -/* 0B40D8 7F07F568 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B40DC 7F07F56C 44815000 */ mtc1 $at, $f10 -/* 0B40E0 7F07F570 46062202 */ mul.s $f8, $f4, $f6 -/* 0B40E4 7F07F574 460A4383 */ div.s $f14, $f8, $f10 -.Ljp7F07F578: -/* 0B40E8 7F07F578 10800004 */ beqz $a0, .Ljp7F07F58C -/* 0B40EC 7F07F57C 24010002 */ li $at, 2 -/* 0B40F0 7F07F580 10810002 */ beq $a0, $at, .Ljp7F07F58C -/* 0B40F4 7F07F584 24010003 */ li $at, 3 -/* 0B40F8 7F07F588 1481001A */ bne $a0, $at, .Ljp7F07F5F4 -.Ljp7F07F58C: -/* 0B40FC 7F07F58C 24040001 */ li $a0, 1 -/* 0B4100 7F07F590 0FC1F953 */ jal bondviewPauseAngleRelated -/* 0B4104 7F07F594 E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B4108 7F07F598 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B410C 7F07F59C C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B4110 7F07F5A0 44818000 */ mtc1 $at, $f16 -/* 0B4114 7F07F5A4 46000306 */ mov.s $f12, $f0 -/* 0B4118 7F07F5A8 46107081 */ sub.s $f2, $f14, $f16 -/* 0B411C 7F07F5AC 4602003C */ c.lt.s $f0, $f2 -/* 0B4120 7F07F5B0 00000000 */ nop -/* 0B4124 7F07F5B4 45020003 */ bc1fl .Ljp7F07F5C4 -/* 0B4128 7F07F5B8 E7AC002C */ swc1 $f12, 0x2c($sp) -/* 0B412C 7F07F5BC 46001306 */ mov.s $f12, $f2 -/* 0B4130 7F07F5C0 E7AC002C */ swc1 $f12, 0x2c($sp) -.Ljp7F07F5C4: -/* 0B4134 7F07F5C4 0FC1F98D */ jal sub_GAME_7F07E010 -/* 0B4138 7F07F5C8 E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B413C 7F07F5CC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B4140 7F07F5D0 C7AC002C */ lwc1 $f12, 0x2c($sp) -/* 0B4144 7F07F5D4 44819000 */ mtc1 $at, $f18 -/* 0B4148 7F07F5D8 C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B414C 7F07F5DC 46126000 */ add.s $f0, $f12, $f18 -/* 0B4150 7F07F5E0 4600703C */ c.lt.s $f14, $f0 -/* 0B4154 7F07F5E4 00000000 */ nop -/* 0B4158 7F07F5E8 45000002 */ bc1f .Ljp7F07F5F4 -/* 0B415C 7F07F5EC 00000000 */ nop -/* 0B4160 7F07F5F0 46000386 */ mov.s $f14, $f0 -.Ljp7F07F5F4: -/* 0B4164 7F07F5F4 0FC1FBAF */ jal bondviewSetPauseWatchRelated -/* 0B4168 7F07F5F8 46007306 */ mov.s $f12, $f14 -/* 0B416C 7F07F5FC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4170 7F07F600 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4174 7F07F604 8C620220 */ lw $v0, 0x220($v1) -.Ljp7F07F608: -/* 0B4178 7F07F608 24010003 */ li $at, 3 -/* 0B417C 7F07F60C 10400003 */ beqz $v0, .Ljp7F07F61C -/* 0B4180 7F07F610 00000000 */ nop -/* 0B4184 7F07F614 54410008 */ bnel $v0, $at, .Ljp7F07F638 -/* 0B4188 7F07F618 240C0001 */ li $t4, 1 -.Ljp7F07F61C: -/* 0B418C 7F07F61C 0FC1F9A3 */ jal sub_GAME_7F07E068 -/* 0B4190 7F07F620 00000000 */ nop -/* 0B4194 7F07F624 10400009 */ beqz $v0, .Ljp7F07F64C -/* 0B4198 7F07F628 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B419C 7F07F62C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B41A0 7F07F630 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B41A4 7F07F634 240C0001 */ li $t4, 1 -.Ljp7F07F638: -/* 0B41A8 7F07F638 AC6C0200 */ sw $t4, 0x200($v1) -/* 0B41AC 7F07F63C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B41B0 7F07F640 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B41B4 7F07F644 1000000E */ b .Ljp7F07F680 -/* 0B41B8 7F07F648 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F64C: -/* 0B41BC 7F07F64C 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B41C0 7F07F650 240D0004 */ li $t5, 4 -/* 0B41C4 7F07F654 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B41C8 7F07F658 ADCD01C8 */ sw $t5, 0x1c8($t6) -/* 0B41CC 7F07F65C 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B41D0 7F07F660 240F0001 */ li $t7, 1 -/* 0B41D4 7F07F664 3C198008 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8008 -/* 0B41D8 7F07F668 AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B41DC 7F07F66C 8F39A120 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B41E0 7F07F670 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B41E4 7F07F674 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B41E8 7F07F678 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B41EC 7F07F67C 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F680: -/* 0B41F0 7F07F680 24010004 */ li $at, 4 -.Ljp7F07F684: -/* 0B41F4 7F07F684 5441002F */ bnel $v0, $at, .Ljp7F07F744 -/* 0B41F8 7F07F688 24010005 */ li $at, 5 -/* 0B41FC 7F07F68C 8C6801C0 */ lw $t0, 0x1c0($v1) -/* 0B4200 7F07F690 24010001 */ li $at, 1 -/* 0B4204 7F07F694 1501000B */ bne $t0, $at, .Ljp7F07F6C4 -/* 0B4208 7F07F698 00000000 */ nop -/* 0B420C 7F07F69C 8C69021C */ lw $t1, 0x21c($v1) -/* 0B4210 7F07F6A0 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0B4214 7F07F6A4 240500ED */ li $a1, 237 -/* 0B4218 7F07F6A8 11200006 */ beqz $t1, .Ljp7F07F6C4 -/* 0B421C 7F07F6AC 00003025 */ move $a2, $zero -/* 0B4220 7F07F6B0 0C002386 */ jal sndPlaySfx -/* 0B4224 7F07F6B4 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B4228 7F07F6B8 3C0A8008 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8008 -/* 0B422C 7F07F6BC 8D4AA120 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B4230 7F07F6C0 AD40021C */ sw $zero, 0x21c($t2) -.Ljp7F07F6C4: -/* 0B4234 7F07F6C4 0FC1FAD4 */ jal bondviewZoomToWatchOnOpen -/* 0B4238 7F07F6C8 00000000 */ nop -/* 0B423C 7F07F6CC 0FC1FB08 */ jal check_watch_page_transistion_running -/* 0B4240 7F07F6D0 00000000 */ nop -/* 0B4244 7F07F6D4 10400009 */ beqz $v0, .Ljp7F07F6FC -/* 0B4248 7F07F6D8 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B424C 7F07F6DC 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) # $t4, 0x8008 -/* 0B4250 7F07F6E0 8D8CA120 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B4254 7F07F6E4 240B0001 */ li $t3, 1 -/* 0B4258 7F07F6E8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B425C 7F07F6EC AD8B0200 */ sw $t3, 0x200($t4) -/* 0B4260 7F07F6F0 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4264 7F07F6F4 10000012 */ b .Ljp7F07F740 -/* 0B4268 7F07F6F8 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F6FC: -/* 0B426C 7F07F6FC 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B4270 7F07F700 240D0005 */ li $t5, 5 -/* 0B4274 7F07F704 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B4278 7F07F708 ADCD01C8 */ sw $t5, 0x1c8($t6) -/* 0B427C 7F07F70C 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B4280 7F07F710 240F0001 */ li $t7, 1 -/* 0B4284 7F07F714 3C198008 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8008 -/* 0B4288 7F07F718 AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B428C 7F07F71C 8F39A120 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B4290 7F07F720 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 -/* 0B4294 7F07F724 24080001 */ li $t0, 1 -/* 0B4298 7F07F728 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B429C 7F07F72C 8D29A120 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B42A0 7F07F730 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B42A4 7F07F734 AD28021C */ sw $t0, 0x21c($t1) -/* 0B42A8 7F07F738 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B42AC 7F07F73C 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F740: -/* 0B42B0 7F07F740 24010005 */ li $at, 5 -.Ljp7F07F744: -/* 0B42B4 7F07F744 5441000F */ bnel $v0, $at, .Ljp7F07F784 -/* 0B42B8 7F07F748 2401000C */ li $at, 12 -/* 0B42BC 7F07F74C 8C6A01C0 */ lw $t2, 0x1c0($v1) -/* 0B42C0 7F07F750 24010001 */ li $at, 1 -/* 0B42C4 7F07F754 55410006 */ bnel $t2, $at, .Ljp7F07F770 -/* 0B42C8 7F07F758 240B0001 */ li $t3, 1 -/* 0B42CC 7F07F75C 0FC307F0 */ jal sub_GAME_7F0C1310 -/* 0B42D0 7F07F760 00000000 */ nop -/* 0B42D4 7F07F764 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B42D8 7F07F768 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B42DC 7F07F76C 240B0001 */ li $t3, 1 -.Ljp7F07F770: -/* 0B42E0 7F07F770 AC6B0200 */ sw $t3, 0x200($v1) -/* 0B42E4 7F07F774 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B42E8 7F07F778 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B42EC 7F07F77C 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B42F0 7F07F780 2401000C */ li $at, 12 -.Ljp7F07F784: -/* 0B42F4 7F07F784 14410018 */ bne $v0, $at, .Ljp7F07F7E8 -/* 0B42F8 7F07F788 240C0001 */ li $t4, 1 -/* 0B42FC 7F07F78C AC6C0200 */ sw $t4, 0x200($v1) -/* 0B4300 7F07F790 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4304 7F07F794 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4308 7F07F798 240E0006 */ li $t6, 6 -/* 0B430C 7F07F79C 240F0001 */ li $t7, 1 -/* 0B4310 7F07F7A0 8C6D01C0 */ lw $t5, 0x1c0($v1) -/* 0B4314 7F07F7A4 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B4318 7F07F7A8 29A10003 */ slti $at, $t5, 3 -/* 0B431C 7F07F7AC 5420000F */ bnezl $at, .Ljp7F07F7EC -/* 0B4320 7F07F7B0 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B4324 7F07F7B4 AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B4328 7F07F7B8 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B432C 7F07F7BC 3C198008 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8008 -/* 0B4330 7F07F7C0 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0B4334 7F07F7C4 AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B4338 7F07F7C8 8F39A120 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B433C 7F07F7CC 240500EE */ li $a1, 238 -/* 0B4340 7F07F7D0 00003025 */ move $a2, $zero -/* 0B4344 7F07F7D4 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B4348 7F07F7D8 0C002386 */ jal sndPlaySfx -/* 0B434C 7F07F7DC 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B4350 7F07F7E0 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4354 7F07F7E4 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.Ljp7F07F7E8: -/* 0B4358 7F07F7E8 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F7EC: -/* 0B435C 7F07F7EC 24010006 */ li $at, 6 -/* 0B4360 7F07F7F0 5441002F */ bnel $v0, $at, .Ljp7F07F8B0 -/* 0B4364 7F07F7F4 24010007 */ li $at, 7 -/* 0B4368 7F07F7F8 8C6801C0 */ lw $t0, 0x1c0($v1) -/* 0B436C 7F07F7FC 24010001 */ li $at, 1 -/* 0B4370 7F07F800 1501000D */ bne $t0, $at, .Ljp7F07F838 -/* 0B4374 7F07F804 00000000 */ nop -/* 0B4378 7F07F808 0FC1FAEE */ jal bondviewZoomFromWatchOnExit -/* 0B437C 7F07F80C 00000000 */ nop -/* 0B4380 7F07F810 8FA9001C */ lw $t1, 0x1c($sp) -/* 0B4384 7F07F814 00002025 */ move $a0, $zero -/* 0B4388 7F07F818 11200005 */ beqz $t1, .Ljp7F07F830 -/* 0B438C 7F07F81C 00000000 */ nop -/* 0B4390 7F07F820 0FC177C8 */ jal draw_item_in_hand -/* 0B4394 7F07F824 00002825 */ move $a1, $zero -/* 0B4398 7F07F828 10000003 */ b .Ljp7F07F838 -/* 0B439C 7F07F82C 00000000 */ nop -.Ljp7F07F830: -/* 0B43A0 7F07F830 0FC17801 */ jal sub_GAME_7F05DAE4 -/* 0B43A4 7F07F834 00002025 */ move $a0, $zero -.Ljp7F07F838: -/* 0B43A8 7F07F838 0FC1FB08 */ jal check_watch_page_transistion_running -/* 0B43AC 7F07F83C 00000000 */ nop -/* 0B43B0 7F07F840 10400009 */ beqz $v0, .Ljp7F07F868 -/* 0B43B4 7F07F844 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8008 -/* 0B43B8 7F07F848 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8008 -/* 0B43BC 7F07F84C 8D6BA120 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B43C0 7F07F850 240A0001 */ li $t2, 1 -/* 0B43C4 7F07F854 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B43C8 7F07F858 AD6A0200 */ sw $t2, 0x200($t3) -/* 0B43CC 7F07F85C 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B43D0 7F07F860 10000012 */ b .Ljp7F07F8AC -/* 0B43D4 7F07F864 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F868: -/* 0B43D8 7F07F868 8DADA120 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B43DC 7F07F86C 240C0007 */ li $t4, 7 -/* 0B43E0 7F07F870 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8008 -/* 0B43E4 7F07F874 ADAC01C8 */ sw $t4, 0x1c8($t5) -/* 0B43E8 7F07F878 8DEFA120 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B43EC 7F07F87C 240E0001 */ li $t6, 1 -/* 0B43F0 7F07F880 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B43F4 7F07F884 ADEE01C0 */ sw $t6, 0x1c0($t7) -/* 0B43F8 7F07F888 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B43FC 7F07F88C 3C088008 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8008 -/* 0B4400 7F07F890 24190001 */ li $t9, 1 -/* 0B4404 7F07F894 AF0001C4 */ sw $zero, 0x1c4($t8) -/* 0B4408 7F07F898 8D08A120 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B440C 7F07F89C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4410 7F07F8A0 AD19021C */ sw $t9, 0x21c($t0) -/* 0B4414 7F07F8A4 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4418 7F07F8A8 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F8AC: -/* 0B441C 7F07F8AC 24010007 */ li $at, 7 -.Ljp7F07F8B0: -/* 0B4420 7F07F8B0 5441003F */ bnel $v0, $at, .Ljp7F07F9B0 -/* 0B4424 7F07F8B4 24010008 */ li $at, 8 -/* 0B4428 7F07F8B8 8C6901C0 */ lw $t1, 0x1c0($v1) -/* 0B442C 7F07F8BC 24010001 */ li $at, 1 -/* 0B4430 7F07F8C0 15210024 */ bne $t1, $at, .Ljp7F07F954 -/* 0B4434 7F07F8C4 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B4438 7F07F8C8 44817000 */ mtc1 $at, $f14 -/* 0B443C 7F07F8CC 00002025 */ move $a0, $zero -/* 0B4440 7F07F8D0 0FC1F953 */ jal bondviewPauseAngleRelated -/* 0B4444 7F07F8D4 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B4448 7F07F8D8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B444C 7F07F8DC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4450 7F07F8E0 C7AE0028 */ lwc1 $f14, 0x28($sp) -/* 0B4454 7F07F8E4 46000306 */ mov.s $f12, $f0 -/* 0B4458 7F07F8E8 8C620220 */ lw $v0, 0x220($v1) -/* 0B445C 7F07F8EC 24010003 */ li $at, 3 -/* 0B4460 7F07F8F0 5040000A */ beql $v0, $zero, .Ljp7F07F91C -/* 0B4464 7F07F8F4 3C0141A0 */ lui $at, 0x41a0 -/* 0B4468 7F07F8F8 10410007 */ beq $v0, $at, .Ljp7F07F918 -/* 0B446C 7F07F8FC 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B4470 7F07F900 44813000 */ mtc1 $at, $f6 -/* 0B4474 7F07F904 C4640258 */ lwc1 $f4, 0x258($v1) -/* 0B4478 7F07F908 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B447C 7F07F90C 44815000 */ mtc1 $at, $f10 -/* 0B4480 7F07F910 46062202 */ mul.s $f8, $f4, $f6 -/* 0B4484 7F07F914 460A4383 */ div.s $f14, $f8, $f10 -.Ljp7F07F918: -/* 0B4488 7F07F918 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -.Ljp7F07F91C: -/* 0B448C 7F07F91C 44818000 */ mtc1 $at, $f16 -/* 0B4490 7F07F920 00000000 */ nop -/* 0B4494 7F07F924 46107080 */ add.s $f2, $f14, $f16 -/* 0B4498 7F07F928 4602003C */ c.lt.s $f0, $f2 -/* 0B449C 7F07F92C 00000000 */ nop -/* 0B44A0 7F07F930 45000002 */ bc1f .Ljp7F07F93C -/* 0B44A4 7F07F934 00000000 */ nop -/* 0B44A8 7F07F938 46001306 */ mov.s $f12, $f2 -.Ljp7F07F93C: -/* 0B44AC 7F07F93C 0FC1F998 */ jal sub_GAME_7F07E03C -/* 0B44B0 7F07F940 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B44B4 7F07F944 0FC1FBC7 */ jal bondviewSetPauseWatchRelatedAlt -/* 0B44B8 7F07F948 C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 0B44BC 7F07F94C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B44C0 7F07F950 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.Ljp7F07F954: -/* 0B44C4 7F07F954 8C620220 */ lw $v0, 0x220($v1) -/* 0B44C8 7F07F958 24010003 */ li $at, 3 -/* 0B44CC 7F07F95C 240B0008 */ li $t3, 8 -/* 0B44D0 7F07F960 10400008 */ beqz $v0, .Ljp7F07F984 -/* 0B44D4 7F07F964 3C0D8008 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8008 -/* 0B44D8 7F07F968 10410006 */ beq $v0, $at, .Ljp7F07F984 -/* 0B44DC 7F07F96C 240A0001 */ li $t2, 1 -/* 0B44E0 7F07F970 AC6A0200 */ sw $t2, 0x200($v1) -/* 0B44E4 7F07F974 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B44E8 7F07F978 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B44EC 7F07F97C 1000000B */ b .Ljp7F07F9AC -/* 0B44F0 7F07F980 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F984: -/* 0B44F4 7F07F984 AC6B01C8 */ sw $t3, 0x1c8($v1) -/* 0B44F8 7F07F988 8DADA120 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B44FC 7F07F98C 240C0001 */ li $t4, 1 -/* 0B4500 7F07F990 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B4504 7F07F994 ADAC01C0 */ sw $t4, 0x1c0($t5) -/* 0B4508 7F07F998 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B450C 7F07F99C 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4510 7F07F9A0 ADC001C4 */ sw $zero, 0x1c4($t6) -/* 0B4514 7F07F9A4 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4518 7F07F9A8 8C6201C8 */ lw $v0, 0x1c8($v1) -.Ljp7F07F9AC: -/* 0B451C 7F07F9AC 24010008 */ li $at, 8 -.Ljp7F07F9B0: -/* 0B4520 7F07F9B0 14410069 */ bne $v0, $at, .Ljp7F07FB58 -/* 0B4524 7F07F9B4 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8008 -/* 0B4528 7F07F9B8 AC600200 */ sw $zero, 0x200($v1) -/* 0B452C 7F07F9BC 8DEFA120 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B4530 7F07F9C0 24010001 */ li $at, 1 -/* 0B4534 7F07F9C4 8DF801C0 */ lw $t8, 0x1c0($t7) -/* 0B4538 7F07F9C8 17010028 */ bne $t8, $at, .Ljp7F07FA6C -/* 0B453C 7F07F9CC 00000000 */ nop -/* 0B4540 7F07F9D0 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B4544 7F07F9D4 24040001 */ li $a0, 1 -/* 0B4548 7F07F9D8 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B454C 7F07F9DC 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4550 7F07F9E0 24040001 */ li $a0, 1 -/* 0B4554 7F07F9E4 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B4558 7F07F9E8 5059000B */ beql $v0, $t9, .Ljp7F07FA18 -/* 0B455C 7F07F9EC 8FA8003C */ lw $t0, 0x3c($sp) -/* 0B4560 7F07F9F0 0FC174F7 */ jal Gun_hand_without_item -/* 0B4564 7F07F9F4 24040001 */ li $a0, 1 -/* 0B4568 7F07F9F8 50400007 */ beql $v0, $zero, .Ljp7F07FA18 -/* 0B456C 7F07F9FC 8FA8003C */ lw $t0, 0x3c($sp) -/* 0B4570 7F07FA00 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4574 7F07FA04 24040001 */ li $a0, 1 -/* 0B4578 7F07FA08 24040001 */ li $a0, 1 -/* 0B457C 7F07FA0C 0FC177C8 */ jal draw_item_in_hand -/* 0B4580 7F07FA10 00402825 */ move $a1, $v0 -/* 0B4584 7F07FA14 8FA8003C */ lw $t0, 0x3c($sp) -.Ljp7F07FA18: -/* 0B4588 7F07FA18 1100004F */ beqz $t0, .Ljp7F07FB58 -/* 0B458C 7F07FA1C 00000000 */ nop -/* 0B4590 7F07FA20 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B4594 7F07FA24 00002025 */ move $a0, $zero -/* 0B4598 7F07FA28 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B459C 7F07FA2C 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B45A0 7F07FA30 00002025 */ move $a0, $zero -/* 0B45A4 7F07FA34 8FA9001C */ lw $t1, 0x1c($sp) -/* 0B45A8 7F07FA38 10490047 */ beq $v0, $t1, .Ljp7F07FB58 -/* 0B45AC 7F07FA3C 00000000 */ nop -/* 0B45B0 7F07FA40 0FC174F7 */ jal Gun_hand_without_item -/* 0B45B4 7F07FA44 00002025 */ move $a0, $zero -/* 0B45B8 7F07FA48 10400043 */ beqz $v0, .Ljp7F07FB58 -/* 0B45BC 7F07FA4C 00000000 */ nop -/* 0B45C0 7F07FA50 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B45C4 7F07FA54 00002025 */ move $a0, $zero -/* 0B45C8 7F07FA58 00002025 */ move $a0, $zero -/* 0B45CC 7F07FA5C 0FC177C8 */ jal draw_item_in_hand -/* 0B45D0 7F07FA60 00402825 */ move $a1, $v0 -/* 0B45D4 7F07FA64 1000003C */ b .Ljp7F07FB58 -/* 0B45D8 7F07FA68 00000000 */ nop -.Ljp7F07FA6C: -/* 0B45DC 7F07FA6C 0FC1F9A3 */ jal sub_GAME_7F07E068 -/* 0B45E0 7F07FA70 00000000 */ nop -/* 0B45E4 7F07FA74 14400038 */ bnez $v0, .Ljp7F07FB58 -/* 0B45E8 7F07FA78 00000000 */ nop -/* 0B45EC 7F07FA7C 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B45F0 7F07FA80 24040001 */ li $a0, 1 -/* 0B45F4 7F07FA84 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B45F8 7F07FA88 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B45FC 7F07FA8C 24040001 */ li $a0, 1 -/* 0B4600 7F07FA90 8FAA001C */ lw $t2, 0x1c($sp) -/* 0B4604 7F07FA94 144A0030 */ bne $v0, $t2, .Ljp7F07FB58 -/* 0B4608 7F07FA98 00000000 */ nop -/* 0B460C 7F07FA9C 0FC174F7 */ jal Gun_hand_without_item -/* 0B4610 7F07FAA0 24040001 */ li $a0, 1 -/* 0B4614 7F07FAA4 1040002C */ beqz $v0, .Ljp7F07FB58 -/* 0B4618 7F07FAA8 8FAB003C */ lw $t3, 0x3c($sp) -/* 0B461C 7F07FAAC 1160000D */ beqz $t3, .Ljp7F07FAE4 -/* 0B4620 7F07FAB0 00000000 */ nop -/* 0B4624 7F07FAB4 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B4628 7F07FAB8 00002025 */ move $a0, $zero -/* 0B462C 7F07FABC AFA20018 */ sw $v0, 0x18($sp) -/* 0B4630 7F07FAC0 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4634 7F07FAC4 00002025 */ move $a0, $zero -/* 0B4638 7F07FAC8 8FAC0018 */ lw $t4, 0x18($sp) -/* 0B463C 7F07FACC 144C0022 */ bne $v0, $t4, .Ljp7F07FB58 -/* 0B4640 7F07FAD0 00000000 */ nop -/* 0B4644 7F07FAD4 0FC174F7 */ jal Gun_hand_without_item -/* 0B4648 7F07FAD8 00002025 */ move $a0, $zero -/* 0B464C 7F07FADC 1040001E */ beqz $v0, .Ljp7F07FB58 -/* 0B4650 7F07FAE0 00000000 */ nop -.Ljp7F07FAE4: -/* 0B4654 7F07FAE4 0FC17801 */ jal sub_GAME_7F05DAE4 -/* 0B4658 7F07FAE8 24040001 */ li $a0, 1 -/* 0B465C 7F07FAEC 8FAD003C */ lw $t5, 0x3c($sp) -/* 0B4660 7F07FAF0 51A00004 */ beql $t5, $zero, .Ljp7F07FB04 -/* 0B4664 7F07FAF4 24040008 */ li $a0, 8 -/* 0B4668 7F07FAF8 0FC17801 */ jal sub_GAME_7F05DAE4 -/* 0B466C 7F07FAFC 00002025 */ move $a0, $zero -/* 0B4670 7F07FB00 24040008 */ li $a0, 8 -.Ljp7F07FB04: -/* 0B4674 7F07FB04 0FC1AAE5 */ jal set_unset_bitflags -/* 0B4678 7F07FB08 24050001 */ li $a1, 1 -/* 0B467C 7F07FB0C 24040004 */ li $a0, 4 -/* 0B4680 7F07FB10 0FC1A5B8 */ jal set_unset_ammo_on_screen_setting -/* 0B4684 7F07FB14 24050001 */ li $a1, 1 -/* 0B4688 7F07FB18 0FC22AA6 */ jal hudmsgsSetOn -/* 0B468C 7F07FB1C 24040001 */ li $a0, 1 -/* 0B4690 7F07FB20 0FC22C41 */ jal sub_GAME_7F08A928 -/* 0B4694 7F07FB24 24040001 */ li $a0, 1 -/* 0B4698 7F07FB28 24040004 */ li $a0, 4 -/* 0B469C 7F07FB2C 0FC15997 */ jal countdownTimerSetVisible -/* 0B46A0 7F07FB30 24050001 */ li $a1, 1 -/* 0B46A4 7F07FB34 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8008 -/* 0B46A8 7F07FB38 8DCEA120 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B46AC 7F07FB3C 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8008 -/* 0B46B0 7F07FB40 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B46B4 7F07FB44 ADC001C8 */ sw $zero, 0x1c8($t6) -/* 0B46B8 7F07FB48 8DEFA120 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B46BC 7F07FB4C ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B46C0 7F07FB50 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B46C4 7F07FB54 AF0001C4 */ sw $zero, 0x1c4($t8) -.Ljp7F07FB58: -/* 0B46C8 7F07FB58 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B46CC 7F07FB5C 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B46D0 7F07FB60 24010009 */ li $at, 9 -/* 0B46D4 7F07FB64 24040001 */ li $a0, 1 -/* 0B46D8 7F07FB68 8C7901C8 */ lw $t9, 0x1c8($v1) -/* 0B46DC 7F07FB6C 17210023 */ bne $t9, $at, .Ljp7F07FBFC -/* 0B46E0 7F07FB70 00000000 */ nop -/* 0B46E4 7F07FB74 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B46E8 7F07FB78 AC600200 */ sw $zero, 0x200($v1) -/* 0B46EC 7F07FB7C AFA2001C */ sw $v0, 0x1c($sp) -/* 0B46F0 7F07FB80 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B46F4 7F07FB84 24040001 */ li $a0, 1 -/* 0B46F8 7F07FB88 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B46FC 7F07FB8C 1048001B */ beq $v0, $t0, .Ljp7F07FBFC -/* 0B4700 7F07FB90 00000000 */ nop -/* 0B4704 7F07FB94 0FC174F7 */ jal Gun_hand_without_item -/* 0B4708 7F07FB98 24040001 */ li $a0, 1 -/* 0B470C 7F07FB9C 10400017 */ beqz $v0, .Ljp7F07FBFC -/* 0B4710 7F07FBA0 8FA9003C */ lw $t1, 0x3c($sp) -/* 0B4714 7F07FBA4 1120000C */ beqz $t1, .Ljp7F07FBD8 -/* 0B4718 7F07FBA8 00000000 */ nop -/* 0B471C 7F07FBAC 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4720 7F07FBB0 00002025 */ move $a0, $zero -/* 0B4724 7F07FBB4 AFA20018 */ sw $v0, 0x18($sp) -/* 0B4728 7F07FBB8 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B472C 7F07FBBC 00002025 */ move $a0, $zero -/* 0B4730 7F07FBC0 8FAA0018 */ lw $t2, 0x18($sp) -/* 0B4734 7F07FBC4 104A000D */ beq $v0, $t2, .Ljp7F07FBFC -/* 0B4738 7F07FBC8 00000000 */ nop -/* 0B473C 7F07FBCC 0FC174F7 */ jal Gun_hand_without_item -/* 0B4740 7F07FBD0 00002025 */ move $a0, $zero -/* 0B4744 7F07FBD4 10400009 */ beqz $v0, .Ljp7F07FBFC -.Ljp7F07FBD8: -/* 0B4748 7F07FBD8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B474C 7F07FBDC 2442A120 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x5ee0 -/* 0B4750 7F07FBE0 8C4C0000 */ lw $t4, ($v0) -/* 0B4754 7F07FBE4 240B0008 */ li $t3, 8 -/* 0B4758 7F07FBE8 AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B475C 7F07FBEC 8C4D0000 */ lw $t5, ($v0) -/* 0B4760 7F07FBF0 ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B4764 7F07FBF4 8C4E0000 */ lw $t6, ($v0) -/* 0B4768 7F07FBF8 ADC001C4 */ sw $zero, 0x1c4($t6) -.Ljp7F07FBFC: -/* 0B476C 7F07FBFC 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B4770 7F07FC00 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4774 7F07FC04 2401000A */ li $at, 10 -/* 0B4778 7F07FC08 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B477C 7F07FC0C 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B4780 7F07FC10 15E1002D */ bne $t7, $at, .Ljp7F07FCC8 -/* 0B4784 7F07FC14 00000000 */ nop -/* 0B4788 7F07FC18 AC600200 */ sw $zero, 0x200($v1) -/* 0B478C 7F07FC1C 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B4790 7F07FC20 24010001 */ li $at, 1 -/* 0B4794 7F07FC24 8F1901C0 */ lw $t9, 0x1c0($t8) -/* 0B4798 7F07FC28 17210005 */ bne $t9, $at, .Ljp7F07FC40 -/* 0B479C 7F07FC2C 00000000 */ nop -/* 0B47A0 7F07FC30 0FC1F953 */ jal bondviewPauseAngleRelated -/* 0B47A4 7F07FC34 00002025 */ move $a0, $zero -/* 0B47A8 7F07FC38 0FC1F998 */ jal sub_GAME_7F07E03C -/* 0B47AC 7F07FC3C 46000306 */ mov.s $f12, $f0 -.Ljp7F07FC40: -/* 0B47B0 7F07FC40 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B47B4 7F07FC44 24040001 */ li $a0, 1 -/* 0B47B8 7F07FC48 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B47BC 7F07FC4C 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B47C0 7F07FC50 24040001 */ li $a0, 1 -/* 0B47C4 7F07FC54 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B47C8 7F07FC58 1048001B */ beq $v0, $t0, .Ljp7F07FCC8 -/* 0B47CC 7F07FC5C 00000000 */ nop -/* 0B47D0 7F07FC60 0FC174F7 */ jal Gun_hand_without_item -/* 0B47D4 7F07FC64 24040001 */ li $a0, 1 -/* 0B47D8 7F07FC68 10400017 */ beqz $v0, .Ljp7F07FCC8 -/* 0B47DC 7F07FC6C 8FA9003C */ lw $t1, 0x3c($sp) -/* 0B47E0 7F07FC70 1120000C */ beqz $t1, .Ljp7F07FCA4 -/* 0B47E4 7F07FC74 00000000 */ nop -/* 0B47E8 7F07FC78 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B47EC 7F07FC7C 00002025 */ move $a0, $zero -/* 0B47F0 7F07FC80 AFA20018 */ sw $v0, 0x18($sp) -/* 0B47F4 7F07FC84 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B47F8 7F07FC88 00002025 */ move $a0, $zero -/* 0B47FC 7F07FC8C 8FAA0018 */ lw $t2, 0x18($sp) -/* 0B4800 7F07FC90 104A000D */ beq $v0, $t2, .Ljp7F07FCC8 -/* 0B4804 7F07FC94 00000000 */ nop -/* 0B4808 7F07FC98 0FC174F7 */ jal Gun_hand_without_item -/* 0B480C 7F07FC9C 00002025 */ move $a0, $zero -/* 0B4810 7F07FCA0 10400009 */ beqz $v0, .Ljp7F07FCC8 -.Ljp7F07FCA4: -/* 0B4814 7F07FCA4 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B4818 7F07FCA8 2442A120 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x5ee0 -/* 0B481C 7F07FCAC 8C4C0000 */ lw $t4, ($v0) -/* 0B4820 7F07FCB0 240B0008 */ li $t3, 8 -/* 0B4824 7F07FCB4 AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B4828 7F07FCB8 8C4D0000 */ lw $t5, ($v0) -/* 0B482C 7F07FCBC ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B4830 7F07FCC0 8C4E0000 */ lw $t6, ($v0) -/* 0B4834 7F07FCC4 ADC001C4 */ sw $zero, 0x1c4($t6) -.Ljp7F07FCC8: -/* 0B4838 7F07FCC8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B483C 7F07FCCC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4840 7F07FCD0 2401000B */ li $at, 11 -/* 0B4844 7F07FCD4 24040001 */ li $a0, 1 -/* 0B4848 7F07FCD8 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B484C 7F07FCDC 15E10024 */ bne $t7, $at, .Ljp7F07FD70 -/* 0B4850 7F07FCE0 00000000 */ nop -/* 0B4854 7F07FCE4 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4858 7F07FCE8 AC600200 */ sw $zero, 0x200($v1) -/* 0B485C 7F07FCEC AFA2001C */ sw $v0, 0x1c($sp) -/* 0B4860 7F07FCF0 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B4864 7F07FCF4 24040001 */ li $a0, 1 -/* 0B4868 7F07FCF8 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B486C 7F07FCFC 1458001C */ bne $v0, $t8, .Ljp7F07FD70 -/* 0B4870 7F07FD00 00000000 */ nop -/* 0B4874 7F07FD04 0FC174F7 */ jal Gun_hand_without_item -/* 0B4878 7F07FD08 24040001 */ li $a0, 1 -/* 0B487C 7F07FD0C 10400018 */ beqz $v0, .Ljp7F07FD70 -/* 0B4880 7F07FD10 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B4884 7F07FD14 1320000C */ beqz $t9, .Ljp7F07FD48 -/* 0B4888 7F07FD18 00000000 */ nop -/* 0B488C 7F07FD1C 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B4890 7F07FD20 00002025 */ move $a0, $zero -/* 0B4894 7F07FD24 AFA20018 */ sw $v0, 0x18($sp) -/* 0B4898 7F07FD28 0FC177D9 */ jal get_item_in_hand_or_watch_menu -/* 0B489C 7F07FD2C 00002025 */ move $a0, $zero -/* 0B48A0 7F07FD30 8FA80018 */ lw $t0, 0x18($sp) -/* 0B48A4 7F07FD34 1448000E */ bne $v0, $t0, .Ljp7F07FD70 -/* 0B48A8 7F07FD38 00000000 */ nop -/* 0B48AC 7F07FD3C 0FC174F7 */ jal Gun_hand_without_item -/* 0B48B0 7F07FD40 00002025 */ move $a0, $zero -/* 0B48B4 7F07FD44 1040000A */ beqz $v0, .Ljp7F07FD70 -.Ljp7F07FD48: -/* 0B48B8 7F07FD48 3C0A8008 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8008 -/* 0B48BC 7F07FD4C 8D4AA120 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B48C0 7F07FD50 24090001 */ li $t1, 1 -/* 0B48C4 7F07FD54 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8008 -/* 0B48C8 7F07FD58 AD4901C8 */ sw $t1, 0x1c8($t2) -/* 0B48CC 7F07FD5C 8D6BA120 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B48D0 7F07FD60 3C0C8008 */ lui $t4, %hi(g_CurrentPlayer) # $t4, 0x8008 -/* 0B48D4 7F07FD64 AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B48D8 7F07FD68 8D8CA120 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B48DC 7F07FD6C AD8001C4 */ sw $zero, 0x1c4($t4) -.Ljp7F07FD70: -/* 0B48E0 7F07FD70 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B48E4 7F07FD74 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B48E8 7F07FD78 2401000D */ li $at, 13 -/* 0B48EC 7F07FD7C 24040001 */ li $a0, 1 -/* 0B48F0 7F07FD80 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B48F4 7F07FD84 15A1001B */ bne $t5, $at, .Ljp7F07FDF4 -/* 0B48F8 7F07FD88 00000000 */ nop -/* 0B48FC 7F07FD8C 0FC174F7 */ jal Gun_hand_without_item -/* 0B4900 7F07FD90 AC600200 */ sw $zero, 0x200($v1) -/* 0B4904 7F07FD94 10400017 */ beqz $v0, .Ljp7F07FDF4 -/* 0B4908 7F07FD98 00000000 */ nop -/* 0B490C 7F07FD9C 0FC174F7 */ jal Gun_hand_without_item -/* 0B4910 7F07FDA0 00002025 */ move $a0, $zero -/* 0B4914 7F07FDA4 10400013 */ beqz $v0, .Ljp7F07FDF4 -/* 0B4918 7F07FDA8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 -/* 0B491C 7F07FDAC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B4920 7F07FDB0 24010005 */ li $at, 5 -/* 0B4924 7F07FDB4 8C620C3C */ lw $v0, 0xc3c($v1) -/* 0B4928 7F07FDB8 1041000E */ beq $v0, $at, .Ljp7F07FDF4 -/* 0B492C 7F07FDBC 24010006 */ li $at, 6 -/* 0B4930 7F07FDC0 1041000C */ beq $v0, $at, .Ljp7F07FDF4 -/* 0B4934 7F07FDC4 24010007 */ li $at, 7 -/* 0B4938 7F07FDC8 1041000A */ beq $v0, $at, .Ljp7F07FDF4 -/* 0B493C 7F07FDCC 24010008 */ li $at, 8 -/* 0B4940 7F07FDD0 10410008 */ beq $v0, $at, .Ljp7F07FDF4 -/* 0B4944 7F07FDD4 240E0001 */ li $t6, 1 -/* 0B4948 7F07FDD8 AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B494C 7F07FDDC 3C0F8008 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8008 -/* 0B4950 7F07FDE0 8DEFA120 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B4954 7F07FDE4 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B4958 7F07FDE8 ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B495C 7F07FDEC 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B4960 7F07FDF0 AF0001C4 */ sw $zero, 0x1c4($t8) -.Ljp7F07FDF4: -/* 0B4964 7F07FDF4 0FC1F9AD */ jal sub_GAME_7F07E090 -/* 0B4968 7F07FDF8 00000000 */ nop -/* 0B496C 7F07FDFC 0FC1FBDC */ jal bondviewStepWatchAnimation -/* 0B4970 7F07FE00 00000000 */ nop -/* 0B4974 7F07FE04 0FC1FB14 */ jal bondviewUpdateWatchZoomIn -/* 0B4978 7F07FE08 00000000 */ nop -/* 0B497C 7F07FE0C 3C198008 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8008 -/* 0B4980 7F07FE10 8F39A120 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B4984 7F07FE14 8F2201C8 */ lw $v0, 0x1c8($t9) -/* 0B4988 7F07FE18 24010005 */ li $at, 5 -.Ljp7F07FE1C: -/* 0B498C 7F07FE1C 54410008 */ bnel $v0, $at, .Ljp7F07FE40 -/* 0B4990 7F07FE20 2401000C */ li $at, 12 -/* 0B4994 7F07FE24 0FC3020C */ jal lvlSetControlsLockedFlag -/* 0B4998 7F07FE28 24040001 */ li $a0, 1 -/* 0B499C 7F07FE2C 0FC29D88 */ jal sub_GAME_7F0A6A80 -/* 0B49A0 7F07FE30 00000000 */ nop -/* 0B49A4 7F07FE34 1000000B */ b .Ljp7F07FE64 -/* 0B49A8 7F07FE38 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B49AC 7F07FE3C 2401000C */ li $at, 12 -.Ljp7F07FE40: -/* 0B49B0 7F07FE40 14410005 */ bne $v0, $at, .Ljp7F07FE58 -/* 0B49B4 7F07FE44 00000000 */ nop -/* 0B49B8 7F07FE48 0FC3020C */ jal lvlSetControlsLockedFlag -/* 0B49BC 7F07FE4C 24040001 */ li $a0, 1 -/* 0B49C0 7F07FE50 10000004 */ b .Ljp7F07FE64 -/* 0B49C4 7F07FE54 8FBF0014 */ lw $ra, 0x14($sp) -.Ljp7F07FE58: -/* 0B49C8 7F07FE58 0FC3020C */ jal lvlSetControlsLockedFlag -/* 0B49CC 7F07FE5C 00002025 */ move $a0, $zero -/* 0B49D0 7F07FE60 8FBF0014 */ lw $ra, 0x14($sp) -.Ljp7F07FE64: -/* 0B49D4 7F07FE64 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B49D8 7F07FE68 03E00008 */ jr $ra -/* 0B49DC 7F07FE6C 00000000 */ nop -) -#endif +/** + * US address 7F07EC54. + * JP address 7F07F260. + * EU address 7F07ECF4. +*/ +void bondviewWatchAnimationTick(void) +{ #if defined(VERSION_EU) -GLOBAL_ASM( -.text -glabel sub_GAME_7F07EC54 -/* 0B16E4 7F07ECF4 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B16E8 7F07ECF8 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B16EC 7F07ECFC 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B16F0 7F07ED00 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B16F4 7F07ED04 8DC201C8 */ lw $v0, 0x1c8($t6) -/* 0B16F8 7F07ED08 504002E9 */ beql $v0, $zero, .L7F07F8B0 -/* 0B16FC 7F07ED0C 24010005 */ li $at, 5 -/* 0B1700 7F07ED10 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1704 7F07ED14 00002025 */ move $a0, $zero -/* 0B1708 7F07ED18 3843001E */ xori $v1, $v0, 0x1e -/* 0B170C 7F07ED1C 2C630001 */ sltiu $v1, $v1, 1 -/* 0B1710 7F07ED20 14600006 */ bnez $v1, .L7F07ED3C -/* 0B1714 7F07ED24 AFA3001C */ sw $v1, 0x1c($sp) -/* 0B1718 7F07ED28 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B171C 7F07ED2C 00002025 */ move $a0, $zero -/* 0B1720 7F07ED30 384F0017 */ xori $t7, $v0, 0x17 -/* 0B1724 7F07ED34 2DEF0001 */ sltiu $t7, $t7, 1 -/* 0B1728 7F07ED38 AFAF001C */ sw $t7, 0x1c($sp) -.L7F07ED3C: -/* 0B172C 7F07ED3C 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B1730 7F07ED40 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1734 7F07ED44 13000004 */ beqz $t8, .L7F07ED58 -/* 0B1738 7F07ED48 AFB8003C */ sw $t8, 0x3c($sp) -/* 0B173C 7F07ED4C 2419001D */ li $t9, 29 -/* 0B1740 7F07ED50 10000003 */ b .L7F07ED60 -/* 0B1744 7F07ED54 AFB90038 */ sw $t9, 0x38($sp) -.L7F07ED58: -/* 0B1748 7F07ED58 2408000E */ li $t0, 14 -/* 0B174C 7F07ED5C AFA80038 */ sw $t0, 0x38($sp) -.L7F07ED60: -/* 0B1750 7F07ED60 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1754 7F07ED64 3C0A8004 */ lui $t2, %hi(g_ClockTimer) # $t2, 0x8004 -/* 0B1758 7F07ED68 8D4A0FF4 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 0B175C 7F07ED6C 8C6901C4 */ lw $t1, 0x1c4($v1) -/* 0B1760 7F07ED70 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1764 7F07ED74 24010001 */ li $at, 1 -/* 0B1768 7F07ED78 012A5821 */ addu $t3, $t1, $t2 -/* 0B176C 7F07ED7C AC6B01C4 */ sw $t3, 0x1c4($v1) -/* 0B1770 7F07ED80 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1774 7F07ED84 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1778 7F07ED88 8C6C01C0 */ lw $t4, 0x1c0($v1) -/* 0B177C 7F07ED8C 258D0001 */ addiu $t5, $t4, 1 -/* 0B1780 7F07ED90 AC6D01C0 */ sw $t5, 0x1c0($v1) -/* 0B1784 7F07ED94 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1788 7F07ED98 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B178C 7F07ED9C ADC00200 */ sw $zero, 0x200($t6) -/* 0B1790 7F07EDA0 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1794 7F07EDA4 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B1798 7F07EDA8 15E10038 */ bne $t7, $at, .L7F07EE8C -/* 0B179C 7F07EDAC 00000000 */ nop -/* 0B17A0 7F07EDB0 AC600200 */ sw $zero, 0x200($v1) -/* 0B17A4 7F07EDB4 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B17A8 7F07EDB8 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B17AC 7F07EDBC 24010001 */ li $at, 1 -/* 0B17B0 7F07EDC0 24040001 */ li $a0, 1 -/* 0B17B4 7F07EDC4 8F0201C0 */ lw $v0, 0x1c0($t8) -/* 0B17B8 7F07EDC8 54410006 */ bnel $v0, $at, .L7F07EDE4 -/* 0B17BC 7F07EDCC 24010002 */ li $at, 2 -/* 0B17C0 7F07EDD0 0FC177AE */ jal draw_item_in_hand -/* 0B17C4 7F07EDD4 24050054 */ li $a1, 84 -/* 0B17C8 7F07EDD8 1000002C */ b .L7F07EE8C -/* 0B17CC 7F07EDDC 00000000 */ nop -/* 0B17D0 7F07EDE0 24010002 */ li $at, 2 -.L7F07EDE4: -/* 0B17D4 7F07EDE4 14410007 */ bne $v0, $at, .L7F07EE04 -/* 0B17D8 7F07EDE8 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B17DC 7F07EDEC 13200027 */ beqz $t9, .L7F07EE8C -/* 0B17E0 7F07EDF0 00002025 */ move $a0, $zero -/* 0B17E4 7F07EDF4 0FC177AE */ jal draw_item_in_hand -/* 0B17E8 7F07EDF8 00002825 */ move $a1, $zero -/* 0B17EC 7F07EDFC 10000023 */ b .L7F07EE8C -/* 0B17F0 7F07EE00 00000000 */ nop -.L7F07EE04: -/* 0B17F4 7F07EE04 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B17F8 7F07EE08 24040001 */ li $a0, 1 -/* 0B17FC 7F07EE0C 24010054 */ li $at, 84 -/* 0B1800 7F07EE10 1441001E */ bne $v0, $at, .L7F07EE8C -/* 0B1804 7F07EE14 00000000 */ nop -/* 0B1808 7F07EE18 0FC174DB */ jal Gun_hand_without_item -/* 0B180C 7F07EE1C 24040001 */ li $a0, 1 -/* 0B1810 7F07EE20 1040001A */ beqz $v0, .L7F07EE8C -/* 0B1814 7F07EE24 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B1818 7F07EE28 11000008 */ beqz $t0, .L7F07EE4C -/* 0B181C 7F07EE2C 00000000 */ nop -/* 0B1820 7F07EE30 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B1824 7F07EE34 00002025 */ move $a0, $zero -/* 0B1828 7F07EE38 14400014 */ bnez $v0, .L7F07EE8C -/* 0B182C 7F07EE3C 00000000 */ nop -/* 0B1830 7F07EE40 0FC174DB */ jal Gun_hand_without_item -/* 0B1834 7F07EE44 00002025 */ move $a0, $zero -/* 0B1838 7F07EE48 10400010 */ beqz $v0, .L7F07EE8C -.L7F07EE4C: -/* 0B183C 7F07EE4C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1840 7F07EE50 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1844 7F07EE54 8FAA0038 */ lw $t2, 0x38($sp) -/* 0B1848 7F07EE58 240B0002 */ li $t3, 2 -/* 0B184C 7F07EE5C 8C6901C4 */ lw $t1, 0x1c4($v1) -/* 0B1850 7F07EE60 3C0D8007 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8007 -/* 0B1854 7F07EE64 012A082A */ slt $at, $t1, $t2 -/* 0B1858 7F07EE68 14200008 */ bnez $at, .L7F07EE8C -/* 0B185C 7F07EE6C 00000000 */ nop -/* 0B1860 7F07EE70 AC6B01C8 */ sw $t3, 0x1c8($v1) -/* 0B1864 7F07EE74 8DAD8BC0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B1868 7F07EE78 240C0001 */ li $t4, 1 -/* 0B186C 7F07EE7C 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1870 7F07EE80 ADAC01C0 */ sw $t4, 0x1c0($t5) -/* 0B1874 7F07EE84 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1878 7F07EE88 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07EE8C: -/* 0B187C 7F07EE8C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1880 7F07EE90 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1884 7F07EE94 24010002 */ li $at, 2 -/* 0B1888 7F07EE98 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B188C 7F07EE9C 55E10043 */ bnel $t7, $at, .L7F07EFAC -/* 0B1890 7F07EEA0 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B1894 7F07EEA4 AC600200 */ sw $zero, 0x200($v1) -/* 0B1898 7F07EEA8 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B189C 7F07EEAC 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B18A0 7F07EEB0 24010001 */ li $at, 1 -/* 0B18A4 7F07EEB4 24040008 */ li $a0, 8 -/* 0B18A8 7F07EEB8 8C7801C0 */ lw $t8, 0x1c0($v1) -/* 0B18AC 7F07EEBC 57010026 */ bnel $t8, $at, .L7F07EF58 -/* 0B18B0 7F07EEC0 C4640214 */ lwc1 $f4, 0x214($v1) -/* 0B18B4 7F07EEC4 0FC1AB4F */ jal set_unset_bitflags -/* 0B18B8 7F07EEC8 00002825 */ move $a1, $zero -/* 0B18BC 7F07EECC 24040004 */ li $a0, 4 -/* 0B18C0 7F07EED0 0FC1A622 */ jal set_unset_ammo_on_screen_setting -/* 0B18C4 7F07EED4 00002825 */ move $a1, $zero -/* 0B18C8 7F07EED8 0FC22952 */ jal hudmsgsSetOff -/* 0B18CC 7F07EEDC 24040001 */ li $a0, 1 -/* 0B18D0 7F07EEE0 0FC22AE3 */ jal sub_GAME_7F08A944 -/* 0B18D4 7F07EEE4 24040001 */ li $a0, 1 -/* 0B18D8 7F07EEE8 24040004 */ li $a0, 4 -/* 0B18DC 7F07EEEC 0FC15910 */ jal countdownTimerSetVisible -/* 0B18E0 7F07EEF0 00002825 */ move $a1, $zero -/* 0B18E4 7F07EEF4 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B18E8 7F07EEF8 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B18EC 7F07EEFC 24010002 */ li $at, 2 -/* 0B18F0 7F07EF00 8C640218 */ lw $a0, 0x218($v1) -/* 0B18F4 7F07EF04 10800005 */ beqz $a0, .L7F07EF1C -/* 0B18F8 7F07EF08 00000000 */ nop -/* 0B18FC 7F07EF0C 10810003 */ beq $a0, $at, .L7F07EF1C -/* 0B1900 7F07EF10 24010003 */ li $at, 3 -/* 0B1904 7F07EF14 54810010 */ bnel $a0, $at, .L7F07EF58 -/* 0B1908 7F07EF18 C4640214 */ lwc1 $f4, 0x214($v1) -.L7F07EF1C: -/* 0B190C 7F07EF1C 0FC1F7FF */ jal bondviewPauseAngleRelated -/* 0B1910 7F07EF20 24040001 */ li $a0, 1 -/* 0B1914 7F07EF24 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B1918 7F07EF28 44811000 */ mtc1 $at, $f2 -/* 0B191C 7F07EF2C 46000306 */ mov.s $f12, $f0 -/* 0B1920 7F07EF30 4602003C */ c.lt.s $f0, $f2 -/* 0B1924 7F07EF34 00000000 */ nop -/* 0B1928 7F07EF38 45000002 */ bc1f .L7F07EF44 -/* 0B192C 7F07EF3C 00000000 */ nop -/* 0B1930 7F07EF40 46001306 */ mov.s $f12, $f2 -.L7F07EF44: -/* 0B1934 7F07EF44 0FC1F839 */ jal sub_GAME_7F07E010 -/* 0B1938 7F07EF48 00000000 */ nop -/* 0B193C 7F07EF4C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1940 7F07EF50 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1944 7F07EF54 C4640214 */ lwc1 $f4, 0x214($v1) -.L7F07EF58: -/* 0B1948 7F07EF58 C4660210 */ lwc1 $f6, 0x210($v1) -/* 0B194C 7F07EF5C 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 0B1950 7F07EF60 44815000 */ mtc1 $at, $f10 -/* 0B1954 7F07EF64 46062201 */ sub.s $f8, $f4, $f6 -/* 0B1958 7F07EF68 24190003 */ li $t9, 3 -/* 0B195C 7F07EF6C 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0B1960 7F07EF70 460A403C */ c.lt.s $f8, $f10 -/* 0B1964 7F07EF74 00000000 */ nop -/* 0B1968 7F07EF78 4502000C */ bc1fl .L7F07EFAC -/* 0B196C 7F07EF7C 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B1970 7F07EF80 AC7901C8 */ sw $t9, 0x1c8($v1) -/* 0B1974 7F07EF84 8D298BC0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B1978 7F07EF88 24080001 */ li $t0, 1 -/* 0B197C 7F07EF8C 3C0A8007 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8007 -/* 0B1980 7F07EF90 AD2801C0 */ sw $t0, 0x1c0($t1) -/* 0B1984 7F07EF94 8D4A8BC0 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B1988 7F07EF98 0FC1FA22 */ jal sub_GAME_7F07E7CC -/* 0B198C 7F07EF9C AD4001C4 */ sw $zero, 0x1c4($t2) -/* 0B1990 7F07EFA0 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1994 7F07EFA4 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1998 7F07EFA8 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07EFAC: -/* 0B199C 7F07EFAC 24010003 */ li $at, 3 -/* 0B19A0 7F07EFB0 54410059 */ bnel $v0, $at, .L7F07F118 -/* 0B19A4 7F07EFB4 24010004 */ li $at, 4 -/* 0B19A8 7F07EFB8 8C6B01C0 */ lw $t3, 0x1c0($v1) -/* 0B19AC 7F07EFBC 24010001 */ li $at, 1 -/* 0B19B0 7F07EFC0 55610036 */ bnel $t3, $at, .L7F07F09C -/* 0B19B4 7F07EFC4 8C620220 */ lw $v0, 0x220($v1) -/* 0B19B8 7F07EFC8 8C620220 */ lw $v0, 0x220($v1) -/* 0B19BC 7F07EFCC 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B19C0 7F07EFD0 44817000 */ mtc1 $at, $f14 -/* 0B19C4 7F07EFD4 1040000D */ beqz $v0, .L7F07F00C -/* 0B19C8 7F07EFD8 8C640218 */ lw $a0, 0x218($v1) -/* 0B19CC 7F07EFDC 24010003 */ li $at, 3 -/* 0B19D0 7F07EFE0 1041000A */ beq $v0, $at, .L7F07F00C -/* 0B19D4 7F07EFE4 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B19D8 7F07EFE8 44818000 */ mtc1 $at, $f16 -/* 0B19DC 7F07EFEC C4720258 */ lwc1 $f18, 0x258($v1) -/* 0B19E0 7F07EFF0 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B19E4 7F07EFF4 44813000 */ mtc1 $at, $f6 -/* 0B19E8 7F07EFF8 46128101 */ sub.s $f4, $f16, $f18 -/* 0B19EC 7F07EFFC 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B19F0 7F07F000 44815000 */ mtc1 $at, $f10 -/* 0B19F4 7F07F004 46062202 */ mul.s $f8, $f4, $f6 -/* 0B19F8 7F07F008 460A4383 */ div.s $f14, $f8, $f10 -.L7F07F00C: -/* 0B19FC 7F07F00C 10800004 */ beqz $a0, .L7F07F020 -/* 0B1A00 7F07F010 24010002 */ li $at, 2 -/* 0B1A04 7F07F014 10810002 */ beq $a0, $at, .L7F07F020 -/* 0B1A08 7F07F018 24010003 */ li $at, 3 -/* 0B1A0C 7F07F01C 1481001A */ bne $a0, $at, .L7F07F088 -.L7F07F020: -/* 0B1A10 7F07F020 24040001 */ li $a0, 1 -/* 0B1A14 7F07F024 0FC1F7FF */ jal bondviewPauseAngleRelated -/* 0B1A18 7F07F028 E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B1A1C 7F07F02C 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B1A20 7F07F030 C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B1A24 7F07F034 44818000 */ mtc1 $at, $f16 -/* 0B1A28 7F07F038 46000306 */ mov.s $f12, $f0 -/* 0B1A2C 7F07F03C 46107081 */ sub.s $f2, $f14, $f16 -/* 0B1A30 7F07F040 4602003C */ c.lt.s $f0, $f2 -/* 0B1A34 7F07F044 00000000 */ nop -/* 0B1A38 7F07F048 45020003 */ bc1fl .L7F07F058 -/* 0B1A3C 7F07F04C E7AC002C */ swc1 $f12, 0x2c($sp) -/* 0B1A40 7F07F050 46001306 */ mov.s $f12, $f2 -/* 0B1A44 7F07F054 E7AC002C */ swc1 $f12, 0x2c($sp) -.L7F07F058: -/* 0B1A48 7F07F058 0FC1F839 */ jal sub_GAME_7F07E010 -/* 0B1A4C 7F07F05C E7AE0030 */ swc1 $f14, 0x30($sp) -/* 0B1A50 7F07F060 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B1A54 7F07F064 C7AC002C */ lwc1 $f12, 0x2c($sp) -/* 0B1A58 7F07F068 44819000 */ mtc1 $at, $f18 -/* 0B1A5C 7F07F06C C7AE0030 */ lwc1 $f14, 0x30($sp) -/* 0B1A60 7F07F070 46126000 */ add.s $f0, $f12, $f18 -/* 0B1A64 7F07F074 4600703C */ c.lt.s $f14, $f0 -/* 0B1A68 7F07F078 00000000 */ nop -/* 0B1A6C 7F07F07C 45000002 */ bc1f .L7F07F088 -/* 0B1A70 7F07F080 00000000 */ nop -/* 0B1A74 7F07F084 46000386 */ mov.s $f14, $f0 -.L7F07F088: -/* 0B1A78 7F07F088 0FC1FA54 */ jal bondviewSetPauseWatchRelated -/* 0B1A7C 7F07F08C 46007306 */ mov.s $f12, $f14 -/* 0B1A80 7F07F090 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1A84 7F07F094 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1A88 7F07F098 8C620220 */ lw $v0, 0x220($v1) -.L7F07F09C: -/* 0B1A8C 7F07F09C 24010003 */ li $at, 3 -/* 0B1A90 7F07F0A0 10400003 */ beqz $v0, .L7F07F0B0 -/* 0B1A94 7F07F0A4 00000000 */ nop -/* 0B1A98 7F07F0A8 54410008 */ bnel $v0, $at, .L7F07F0CC -/* 0B1A9C 7F07F0AC 240C0001 */ li $t4, 1 -.L7F07F0B0: -/* 0B1AA0 7F07F0B0 0FC1F84F */ jal sub_GAME_7F07E068 -/* 0B1AA4 7F07F0B4 00000000 */ nop -/* 0B1AA8 7F07F0B8 10400009 */ beqz $v0, .L7F07F0E0 -/* 0B1AAC 7F07F0BC 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1AB0 7F07F0C0 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1AB4 7F07F0C4 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1AB8 7F07F0C8 240C0001 */ li $t4, 1 -.L7F07F0CC: -/* 0B1ABC 7F07F0CC AC6C0200 */ sw $t4, 0x200($v1) -/* 0B1AC0 7F07F0D0 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1AC4 7F07F0D4 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1AC8 7F07F0D8 1000000E */ b .L7F07F114 -/* 0B1ACC 7F07F0DC 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F0E0: -/* 0B1AD0 7F07F0E0 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1AD4 7F07F0E4 240D0004 */ li $t5, 4 -/* 0B1AD8 7F07F0E8 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B1ADC 7F07F0EC ADCD01C8 */ sw $t5, 0x1c8($t6) -/* 0B1AE0 7F07F0F0 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1AE4 7F07F0F4 240F0001 */ li $t7, 1 -/* 0B1AE8 7F07F0F8 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B1AEC 7F07F0FC AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B1AF0 7F07F100 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B1AF4 7F07F104 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1AF8 7F07F108 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B1AFC 7F07F10C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1B00 7F07F110 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F114: -/* 0B1B04 7F07F114 24010004 */ li $at, 4 -.L7F07F118: -/* 0B1B08 7F07F118 5441002F */ bnel $v0, $at, .L7F07F1D8 -/* 0B1B0C 7F07F11C 24010005 */ li $at, 5 -/* 0B1B10 7F07F120 8C6801C0 */ lw $t0, 0x1c0($v1) -/* 0B1B14 7F07F124 24010001 */ li $at, 1 -/* 0B1B18 7F07F128 1501000B */ bne $t0, $at, .L7F07F158 -/* 0B1B1C 7F07F12C 00000000 */ nop -/* 0B1B20 7F07F130 8C69021C */ lw $t1, 0x21c($v1) -/* 0B1B24 7F07F134 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B1B28 7F07F138 240500ED */ li $a1, 237 -/* 0B1B2C 7F07F13C 11200006 */ beqz $t1, .L7F07F158 -/* 0B1B30 7F07F140 00003025 */ move $a2, $zero -/* 0B1B34 7F07F144 0C00209A */ jal sndPlaySfx -/* 0B1B38 7F07F148 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B1B3C 7F07F14C 3C0A8007 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8007 -/* 0B1B40 7F07F150 8D4A8BC0 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B1B44 7F07F154 AD40021C */ sw $zero, 0x21c($t2) -.L7F07F158: -/* 0B1B48 7F07F158 0FC1F980 */ jal bondviewZoomToWatchOnOpen -/* 0B1B4C 7F07F15C 00000000 */ nop -/* 0B1B50 7F07F160 0FC1F9B4 */ jal check_watch_page_transistion_running -/* 0B1B54 7F07F164 00000000 */ nop -/* 0B1B58 7F07F168 10400009 */ beqz $v0, .L7F07F190 -/* 0B1B5C 7F07F16C 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1B60 7F07F170 3C0C8007 */ lui $t4, %hi(g_CurrentPlayer) # $t4, 0x8007 -/* 0B1B64 7F07F174 8D8C8BC0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B1B68 7F07F178 240B0001 */ li $t3, 1 -/* 0B1B6C 7F07F17C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1B70 7F07F180 AD8B0200 */ sw $t3, 0x200($t4) -/* 0B1B74 7F07F184 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1B78 7F07F188 10000012 */ b .L7F07F1D4 -/* 0B1B7C 7F07F18C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F190: -/* 0B1B80 7F07F190 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1B84 7F07F194 240D0005 */ li $t5, 5 -/* 0B1B88 7F07F198 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B1B8C 7F07F19C ADCD01C8 */ sw $t5, 0x1c8($t6) -/* 0B1B90 7F07F1A0 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1B94 7F07F1A4 240F0001 */ li $t7, 1 -/* 0B1B98 7F07F1A8 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B1B9C 7F07F1AC AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B1BA0 7F07F1B0 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B1BA4 7F07F1B4 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0B1BA8 7F07F1B8 24080001 */ li $t0, 1 -/* 0B1BAC 7F07F1BC AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B1BB0 7F07F1C0 8D298BC0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B1BB4 7F07F1C4 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1BB8 7F07F1C8 AD28021C */ sw $t0, 0x21c($t1) -/* 0B1BBC 7F07F1CC 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1BC0 7F07F1D0 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F1D4: -/* 0B1BC4 7F07F1D4 24010005 */ li $at, 5 -.L7F07F1D8: -/* 0B1BC8 7F07F1D8 5441000F */ bnel $v0, $at, .L7F07F218 -/* 0B1BCC 7F07F1DC 2401000C */ li $at, 12 -/* 0B1BD0 7F07F1E0 8C6A01C0 */ lw $t2, 0x1c0($v1) -/* 0B1BD4 7F07F1E4 24010001 */ li $at, 1 -/* 0B1BD8 7F07F1E8 55410006 */ bnel $t2, $at, .L7F07F204 -/* 0B1BDC 7F07F1EC 240B0001 */ li $t3, 1 -/* 0B1BE0 7F07F1F0 0FC301FC */ jal sub_GAME_7F0C1310 -/* 0B1BE4 7F07F1F4 00000000 */ nop -/* 0B1BE8 7F07F1F8 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1BEC 7F07F1FC 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1BF0 7F07F200 240B0001 */ li $t3, 1 -.L7F07F204: -/* 0B1BF4 7F07F204 AC6B0200 */ sw $t3, 0x200($v1) -/* 0B1BF8 7F07F208 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1BFC 7F07F20C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1C00 7F07F210 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B1C04 7F07F214 2401000C */ li $at, 12 -.L7F07F218: -/* 0B1C08 7F07F218 14410018 */ bne $v0, $at, .L7F07F27C -/* 0B1C0C 7F07F21C 240C0001 */ li $t4, 1 -/* 0B1C10 7F07F220 AC6C0200 */ sw $t4, 0x200($v1) -/* 0B1C14 7F07F224 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1C18 7F07F228 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1C1C 7F07F22C 240E0006 */ li $t6, 6 -/* 0B1C20 7F07F230 240F0001 */ li $t7, 1 -/* 0B1C24 7F07F234 8C6D01C0 */ lw $t5, 0x1c0($v1) -/* 0B1C28 7F07F238 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B1C2C 7F07F23C 29A10003 */ slti $at, $t5, 3 -/* 0B1C30 7F07F240 5420000F */ bnezl $at, .L7F07F280 -/* 0B1C34 7F07F244 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B1C38 7F07F248 AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B1C3C 7F07F24C 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1C40 7F07F250 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B1C44 7F07F254 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B1C48 7F07F258 AF0F01C0 */ sw $t7, 0x1c0($t8) -/* 0B1C4C 7F07F25C 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B1C50 7F07F260 240500EE */ li $a1, 238 -/* 0B1C54 7F07F264 00003025 */ move $a2, $zero -/* 0B1C58 7F07F268 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B1C5C 7F07F26C 0C00209A */ jal sndPlaySfx -/* 0B1C60 7F07F270 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B1C64 7F07F274 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1C68 7F07F278 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07F27C: -/* 0B1C6C 7F07F27C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F280: -/* 0B1C70 7F07F280 24010006 */ li $at, 6 -/* 0B1C74 7F07F284 5441002F */ bnel $v0, $at, .L7F07F344 -/* 0B1C78 7F07F288 24010007 */ li $at, 7 -/* 0B1C7C 7F07F28C 8C6801C0 */ lw $t0, 0x1c0($v1) -/* 0B1C80 7F07F290 24010001 */ li $at, 1 -/* 0B1C84 7F07F294 1501000D */ bne $t0, $at, .L7F07F2CC -/* 0B1C88 7F07F298 00000000 */ nop -/* 0B1C8C 7F07F29C 0FC1F99A */ jal bondviewZoomFromWatchOnExit -/* 0B1C90 7F07F2A0 00000000 */ nop -/* 0B1C94 7F07F2A4 8FA9001C */ lw $t1, 0x1c($sp) -/* 0B1C98 7F07F2A8 00002025 */ move $a0, $zero -/* 0B1C9C 7F07F2AC 11200005 */ beqz $t1, .L7F07F2C4 -/* 0B1CA0 7F07F2B0 00000000 */ nop -/* 0B1CA4 7F07F2B4 0FC177AE */ jal draw_item_in_hand -/* 0B1CA8 7F07F2B8 00002825 */ move $a1, $zero -/* 0B1CAC 7F07F2BC 10000003 */ b .L7F07F2CC -/* 0B1CB0 7F07F2C0 00000000 */ nop -.L7F07F2C4: -/* 0B1CB4 7F07F2C4 0FC177E7 */ jal sub_GAME_7F05DAE4 -/* 0B1CB8 7F07F2C8 00002025 */ move $a0, $zero -.L7F07F2CC: -/* 0B1CBC 7F07F2CC 0FC1F9B4 */ jal check_watch_page_transistion_running -/* 0B1CC0 7F07F2D0 00000000 */ nop -/* 0B1CC4 7F07F2D4 10400009 */ beqz $v0, .L7F07F2FC -/* 0B1CC8 7F07F2D8 3C0D8007 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8007 -/* 0B1CCC 7F07F2DC 3C0B8007 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8007 -/* 0B1CD0 7F07F2E0 8D6B8BC0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B1CD4 7F07F2E4 240A0001 */ li $t2, 1 -/* 0B1CD8 7F07F2E8 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1CDC 7F07F2EC AD6A0200 */ sw $t2, 0x200($t3) -/* 0B1CE0 7F07F2F0 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1CE4 7F07F2F4 10000012 */ b .L7F07F340 -/* 0B1CE8 7F07F2F8 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F2FC: -/* 0B1CEC 7F07F2FC 8DAD8BC0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B1CF0 7F07F300 240C0007 */ li $t4, 7 -/* 0B1CF4 7F07F304 3C0F8007 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8007 -/* 0B1CF8 7F07F308 ADAC01C8 */ sw $t4, 0x1c8($t5) -/* 0B1CFC 7F07F30C 8DEF8BC0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B1D00 7F07F310 240E0001 */ li $t6, 1 -/* 0B1D04 7F07F314 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B1D08 7F07F318 ADEE01C0 */ sw $t6, 0x1c0($t7) -/* 0B1D0C 7F07F31C 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1D10 7F07F320 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B1D14 7F07F324 24190001 */ li $t9, 1 -/* 0B1D18 7F07F328 AF0001C4 */ sw $zero, 0x1c4($t8) -/* 0B1D1C 7F07F32C 8D088BC0 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B1D20 7F07F330 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1D24 7F07F334 AD19021C */ sw $t9, 0x21c($t0) -/* 0B1D28 7F07F338 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1D2C 7F07F33C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F340: -/* 0B1D30 7F07F340 24010007 */ li $at, 7 -.L7F07F344: -/* 0B1D34 7F07F344 5441003F */ bnel $v0, $at, .L7F07F444 -/* 0B1D38 7F07F348 24010008 */ li $at, 8 -/* 0B1D3C 7F07F34C 8C6901C0 */ lw $t1, 0x1c0($v1) -/* 0B1D40 7F07F350 24010001 */ li $at, 1 -/* 0B1D44 7F07F354 15210024 */ bne $t1, $at, .L7F07F3E8 -/* 0B1D48 7F07F358 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B1D4C 7F07F35C 44817000 */ mtc1 $at, $f14 -/* 0B1D50 7F07F360 00002025 */ move $a0, $zero -/* 0B1D54 7F07F364 0FC1F7FF */ jal bondviewPauseAngleRelated -/* 0B1D58 7F07F368 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B1D5C 7F07F36C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1D60 7F07F370 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1D64 7F07F374 C7AE0028 */ lwc1 $f14, 0x28($sp) -/* 0B1D68 7F07F378 46000306 */ mov.s $f12, $f0 -/* 0B1D6C 7F07F37C 8C620220 */ lw $v0, 0x220($v1) -/* 0B1D70 7F07F380 24010003 */ li $at, 3 -/* 0B1D74 7F07F384 5040000A */ beql $v0, $zero, .L7F07F3B0 -/* 0B1D78 7F07F388 3C0141A0 */ lui $at, 0x41a0 -/* 0B1D7C 7F07F38C 10410007 */ beq $v0, $at, .L7F07F3AC -/* 0B1D80 7F07F390 3C014220 */ li $at, 0x42200000 # 40.000000 -/* 0B1D84 7F07F394 44813000 */ mtc1 $at, $f6 -/* 0B1D88 7F07F398 C4640258 */ lwc1 $f4, 0x258($v1) -/* 0B1D8C 7F07F39C 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -/* 0B1D90 7F07F3A0 44815000 */ mtc1 $at, $f10 -/* 0B1D94 7F07F3A4 46062202 */ mul.s $f8, $f4, $f6 -/* 0B1D98 7F07F3A8 460A4383 */ div.s $f14, $f8, $f10 -.L7F07F3AC: -/* 0B1D9C 7F07F3AC 3C0141A0 */ li $at, 0x41A00000 # 20.000000 -.L7F07F3B0: -/* 0B1DA0 7F07F3B0 44818000 */ mtc1 $at, $f16 -/* 0B1DA4 7F07F3B4 00000000 */ nop -/* 0B1DA8 7F07F3B8 46107080 */ add.s $f2, $f14, $f16 -/* 0B1DAC 7F07F3BC 4602003C */ c.lt.s $f0, $f2 -/* 0B1DB0 7F07F3C0 00000000 */ nop -/* 0B1DB4 7F07F3C4 45000002 */ bc1f .L7F07F3D0 -/* 0B1DB8 7F07F3C8 00000000 */ nop -/* 0B1DBC 7F07F3CC 46001306 */ mov.s $f12, $f2 -.L7F07F3D0: -/* 0B1DC0 7F07F3D0 0FC1F844 */ jal sub_GAME_7F07E03C -/* 0B1DC4 7F07F3D4 E7AE0028 */ swc1 $f14, 0x28($sp) -/* 0B1DC8 7F07F3D8 0FC1FA6C */ jal bondviewSetPauseWatchRelatedAlt -/* 0B1DCC 7F07F3DC C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 0B1DD0 7F07F3E0 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1DD4 7F07F3E4 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -.L7F07F3E8: -/* 0B1DD8 7F07F3E8 8C620220 */ lw $v0, 0x220($v1) -/* 0B1DDC 7F07F3EC 24010003 */ li $at, 3 -/* 0B1DE0 7F07F3F0 240B0008 */ li $t3, 8 -/* 0B1DE4 7F07F3F4 10400008 */ beqz $v0, .L7F07F418 -/* 0B1DE8 7F07F3F8 3C0D8007 */ lui $t5, %hi(g_CurrentPlayer) # $t5, 0x8007 -/* 0B1DEC 7F07F3FC 10410006 */ beq $v0, $at, .L7F07F418 -/* 0B1DF0 7F07F400 240A0001 */ li $t2, 1 -/* 0B1DF4 7F07F404 AC6A0200 */ sw $t2, 0x200($v1) -/* 0B1DF8 7F07F408 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1DFC 7F07F40C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1E00 7F07F410 1000000B */ b .L7F07F440 -/* 0B1E04 7F07F414 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F418: -/* 0B1E08 7F07F418 AC6B01C8 */ sw $t3, 0x1c8($v1) -/* 0B1E0C 7F07F41C 8DAD8BC0 */ lw $t5, %lo(g_CurrentPlayer)($t5) -/* 0B1E10 7F07F420 240C0001 */ li $t4, 1 -/* 0B1E14 7F07F424 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1E18 7F07F428 ADAC01C0 */ sw $t4, 0x1c0($t5) -/* 0B1E1C 7F07F42C 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1E20 7F07F430 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1E24 7F07F434 ADC001C4 */ sw $zero, 0x1c4($t6) -/* 0B1E28 7F07F438 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1E2C 7F07F43C 8C6201C8 */ lw $v0, 0x1c8($v1) -.L7F07F440: -/* 0B1E30 7F07F440 24010008 */ li $at, 8 -.L7F07F444: -/* 0B1E34 7F07F444 14410069 */ bne $v0, $at, .L7F07F5EC -/* 0B1E38 7F07F448 3C0F8007 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8007 -/* 0B1E3C 7F07F44C AC600200 */ sw $zero, 0x200($v1) -/* 0B1E40 7F07F450 8DEF8BC0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B1E44 7F07F454 24010001 */ li $at, 1 -/* 0B1E48 7F07F458 8DF801C0 */ lw $t8, 0x1c0($t7) -/* 0B1E4C 7F07F45C 17010028 */ bne $t8, $at, .L7F07F500 -/* 0B1E50 7F07F460 00000000 */ nop -/* 0B1E54 7F07F464 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B1E58 7F07F468 24040001 */ li $a0, 1 -/* 0B1E5C 7F07F46C AFA2001C */ sw $v0, 0x1c($sp) -/* 0B1E60 7F07F470 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1E64 7F07F474 24040001 */ li $a0, 1 -/* 0B1E68 7F07F478 8FB9001C */ lw $t9, 0x1c($sp) -/* 0B1E6C 7F07F47C 5059000B */ beql $v0, $t9, .L7F07F4AC -/* 0B1E70 7F07F480 8FA8003C */ lw $t0, 0x3c($sp) -/* 0B1E74 7F07F484 0FC174DB */ jal Gun_hand_without_item -/* 0B1E78 7F07F488 24040001 */ li $a0, 1 -/* 0B1E7C 7F07F48C 50400007 */ beql $v0, $zero, .L7F07F4AC -/* 0B1E80 7F07F490 8FA8003C */ lw $t0, 0x3c($sp) -/* 0B1E84 7F07F494 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1E88 7F07F498 24040001 */ li $a0, 1 -/* 0B1E8C 7F07F49C 24040001 */ li $a0, 1 -/* 0B1E90 7F07F4A0 0FC177AE */ jal draw_item_in_hand -/* 0B1E94 7F07F4A4 00402825 */ move $a1, $v0 -/* 0B1E98 7F07F4A8 8FA8003C */ lw $t0, 0x3c($sp) -.L7F07F4AC: -/* 0B1E9C 7F07F4AC 1100004F */ beqz $t0, .L7F07F5EC -/* 0B1EA0 7F07F4B0 00000000 */ nop -/* 0B1EA4 7F07F4B4 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B1EA8 7F07F4B8 00002025 */ move $a0, $zero -/* 0B1EAC 7F07F4BC AFA2001C */ sw $v0, 0x1c($sp) -/* 0B1EB0 7F07F4C0 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1EB4 7F07F4C4 00002025 */ move $a0, $zero -/* 0B1EB8 7F07F4C8 8FA9001C */ lw $t1, 0x1c($sp) -/* 0B1EBC 7F07F4CC 10490047 */ beq $v0, $t1, .L7F07F5EC -/* 0B1EC0 7F07F4D0 00000000 */ nop -/* 0B1EC4 7F07F4D4 0FC174DB */ jal Gun_hand_without_item -/* 0B1EC8 7F07F4D8 00002025 */ move $a0, $zero -/* 0B1ECC 7F07F4DC 10400043 */ beqz $v0, .L7F07F5EC -/* 0B1ED0 7F07F4E0 00000000 */ nop -/* 0B1ED4 7F07F4E4 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1ED8 7F07F4E8 00002025 */ move $a0, $zero -/* 0B1EDC 7F07F4EC 00002025 */ move $a0, $zero -/* 0B1EE0 7F07F4F0 0FC177AE */ jal draw_item_in_hand -/* 0B1EE4 7F07F4F4 00402825 */ move $a1, $v0 -/* 0B1EE8 7F07F4F8 1000003C */ b .L7F07F5EC -/* 0B1EEC 7F07F4FC 00000000 */ nop -.L7F07F500: -/* 0B1EF0 7F07F500 0FC1F84F */ jal sub_GAME_7F07E068 -/* 0B1EF4 7F07F504 00000000 */ nop -/* 0B1EF8 7F07F508 14400038 */ bnez $v0, .L7F07F5EC -/* 0B1EFC 7F07F50C 00000000 */ nop -/* 0B1F00 7F07F510 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B1F04 7F07F514 24040001 */ li $a0, 1 -/* 0B1F08 7F07F518 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B1F0C 7F07F51C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1F10 7F07F520 24040001 */ li $a0, 1 -/* 0B1F14 7F07F524 8FAA001C */ lw $t2, 0x1c($sp) -/* 0B1F18 7F07F528 144A0030 */ bne $v0, $t2, .L7F07F5EC -/* 0B1F1C 7F07F52C 00000000 */ nop -/* 0B1F20 7F07F530 0FC174DB */ jal Gun_hand_without_item -/* 0B1F24 7F07F534 24040001 */ li $a0, 1 -/* 0B1F28 7F07F538 1040002C */ beqz $v0, .L7F07F5EC -/* 0B1F2C 7F07F53C 8FAB003C */ lw $t3, 0x3c($sp) -/* 0B1F30 7F07F540 1160000D */ beqz $t3, .L7F07F578 -/* 0B1F34 7F07F544 00000000 */ nop -/* 0B1F38 7F07F548 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B1F3C 7F07F54C 00002025 */ move $a0, $zero -/* 0B1F40 7F07F550 AFA20018 */ sw $v0, 0x18($sp) -/* 0B1F44 7F07F554 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1F48 7F07F558 00002025 */ move $a0, $zero -/* 0B1F4C 7F07F55C 8FAC0018 */ lw $t4, 0x18($sp) -/* 0B1F50 7F07F560 144C0022 */ bne $v0, $t4, .L7F07F5EC -/* 0B1F54 7F07F564 00000000 */ nop -/* 0B1F58 7F07F568 0FC174DB */ jal Gun_hand_without_item -/* 0B1F5C 7F07F56C 00002025 */ move $a0, $zero -/* 0B1F60 7F07F570 1040001E */ beqz $v0, .L7F07F5EC -/* 0B1F64 7F07F574 00000000 */ nop -.L7F07F578: -/* 0B1F68 7F07F578 0FC177E7 */ jal sub_GAME_7F05DAE4 -/* 0B1F6C 7F07F57C 24040001 */ li $a0, 1 -/* 0B1F70 7F07F580 8FAD003C */ lw $t5, 0x3c($sp) -/* 0B1F74 7F07F584 51A00004 */ beql $t5, $zero, .L7F07F598 -/* 0B1F78 7F07F588 24040008 */ li $a0, 8 -/* 0B1F7C 7F07F58C 0FC177E7 */ jal sub_GAME_7F05DAE4 -/* 0B1F80 7F07F590 00002025 */ move $a0, $zero -/* 0B1F84 7F07F594 24040008 */ li $a0, 8 -.L7F07F598: -/* 0B1F88 7F07F598 0FC1AB4F */ jal set_unset_bitflags -/* 0B1F8C 7F07F59C 24050001 */ li $a1, 1 -/* 0B1F90 7F07F5A0 24040004 */ li $a0, 4 -/* 0B1F94 7F07F5A4 0FC1A622 */ jal set_unset_ammo_on_screen_setting -/* 0B1F98 7F07F5A8 24050001 */ li $a1, 1 -/* 0B1F9C 7F07F5AC 0FC2294B */ jal hudmsgsSetOn -/* 0B1FA0 7F07F5B0 24040001 */ li $a0, 1 -/* 0B1FA4 7F07F5B4 0FC22ADC */ jal sub_GAME_7F08A928 -/* 0B1FA8 7F07F5B8 24040001 */ li $a0, 1 -/* 0B1FAC 7F07F5BC 24040004 */ li $a0, 4 -/* 0B1FB0 7F07F5C0 0FC15910 */ jal countdownTimerSetVisible -/* 0B1FB4 7F07F5C4 24050001 */ li $a1, 1 -/* 0B1FB8 7F07F5C8 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B1FBC 7F07F5CC 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B1FC0 7F07F5D0 3C0F8007 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8007 -/* 0B1FC4 7F07F5D4 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B1FC8 7F07F5D8 ADC001C8 */ sw $zero, 0x1c8($t6) -/* 0B1FCC 7F07F5DC 8DEF8BC0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B1FD0 7F07F5E0 ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B1FD4 7F07F5E4 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B1FD8 7F07F5E8 AF0001C4 */ sw $zero, 0x1c4($t8) -.L7F07F5EC: -/* 0B1FDC 7F07F5EC 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B1FE0 7F07F5F0 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B1FE4 7F07F5F4 24010009 */ li $at, 9 -/* 0B1FE8 7F07F5F8 24040001 */ li $a0, 1 -/* 0B1FEC 7F07F5FC 8C7901C8 */ lw $t9, 0x1c8($v1) -/* 0B1FF0 7F07F600 17210023 */ bne $t9, $at, .L7F07F690 -/* 0B1FF4 7F07F604 00000000 */ nop -/* 0B1FF8 7F07F608 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B1FFC 7F07F60C AC600200 */ sw $zero, 0x200($v1) -/* 0B2000 7F07F610 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B2004 7F07F614 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B2008 7F07F618 24040001 */ li $a0, 1 -/* 0B200C 7F07F61C 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B2010 7F07F620 1048001B */ beq $v0, $t0, .L7F07F690 -/* 0B2014 7F07F624 00000000 */ nop -/* 0B2018 7F07F628 0FC174DB */ jal Gun_hand_without_item -/* 0B201C 7F07F62C 24040001 */ li $a0, 1 -/* 0B2020 7F07F630 10400017 */ beqz $v0, .L7F07F690 -/* 0B2024 7F07F634 8FA9003C */ lw $t1, 0x3c($sp) -/* 0B2028 7F07F638 1120000C */ beqz $t1, .L7F07F66C -/* 0B202C 7F07F63C 00000000 */ nop -/* 0B2030 7F07F640 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B2034 7F07F644 00002025 */ move $a0, $zero -/* 0B2038 7F07F648 AFA20018 */ sw $v0, 0x18($sp) -/* 0B203C 7F07F64C 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B2040 7F07F650 00002025 */ move $a0, $zero -/* 0B2044 7F07F654 8FAA0018 */ lw $t2, 0x18($sp) -/* 0B2048 7F07F658 104A000D */ beq $v0, $t2, .L7F07F690 -/* 0B204C 7F07F65C 00000000 */ nop -/* 0B2050 7F07F660 0FC174DB */ jal Gun_hand_without_item -/* 0B2054 7F07F664 00002025 */ move $a0, $zero -/* 0B2058 7F07F668 10400009 */ beqz $v0, .L7F07F690 -.L7F07F66C: -/* 0B205C 7F07F66C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B2060 7F07F670 24428BC0 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x7440 -/* 0B2064 7F07F674 8C4C0000 */ lw $t4, ($v0) -/* 0B2068 7F07F678 240B0008 */ li $t3, 8 -/* 0B206C 7F07F67C AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B2070 7F07F680 8C4D0000 */ lw $t5, ($v0) -/* 0B2074 7F07F684 ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B2078 7F07F688 8C4E0000 */ lw $t6, ($v0) -/* 0B207C 7F07F68C ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07F690: -/* 0B2080 7F07F690 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B2084 7F07F694 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B2088 7F07F698 2401000A */ li $at, 10 -/* 0B208C 7F07F69C 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B2090 7F07F6A0 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B2094 7F07F6A4 15E1002D */ bne $t7, $at, .L7F07F75C -/* 0B2098 7F07F6A8 00000000 */ nop -/* 0B209C 7F07F6AC AC600200 */ sw $zero, 0x200($v1) -/* 0B20A0 7F07F6B0 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B20A4 7F07F6B4 24010001 */ li $at, 1 -/* 0B20A8 7F07F6B8 8F1901C0 */ lw $t9, 0x1c0($t8) -/* 0B20AC 7F07F6BC 17210005 */ bne $t9, $at, .L7F07F6D4 -/* 0B20B0 7F07F6C0 00000000 */ nop -/* 0B20B4 7F07F6C4 0FC1F7FF */ jal bondviewPauseAngleRelated -/* 0B20B8 7F07F6C8 00002025 */ move $a0, $zero -/* 0B20BC 7F07F6CC 0FC1F844 */ jal sub_GAME_7F07E03C -/* 0B20C0 7F07F6D0 46000306 */ mov.s $f12, $f0 -.L7F07F6D4: -/* 0B20C4 7F07F6D4 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B20C8 7F07F6D8 24040001 */ li $a0, 1 -/* 0B20CC 7F07F6DC AFA2001C */ sw $v0, 0x1c($sp) -/* 0B20D0 7F07F6E0 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B20D4 7F07F6E4 24040001 */ li $a0, 1 -/* 0B20D8 7F07F6E8 8FA8001C */ lw $t0, 0x1c($sp) -/* 0B20DC 7F07F6EC 1048001B */ beq $v0, $t0, .L7F07F75C -/* 0B20E0 7F07F6F0 00000000 */ nop -/* 0B20E4 7F07F6F4 0FC174DB */ jal Gun_hand_without_item -/* 0B20E8 7F07F6F8 24040001 */ li $a0, 1 -/* 0B20EC 7F07F6FC 10400017 */ beqz $v0, .L7F07F75C -/* 0B20F0 7F07F700 8FA9003C */ lw $t1, 0x3c($sp) -/* 0B20F4 7F07F704 1120000C */ beqz $t1, .L7F07F738 -/* 0B20F8 7F07F708 00000000 */ nop -/* 0B20FC 7F07F70C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B2100 7F07F710 00002025 */ move $a0, $zero -/* 0B2104 7F07F714 AFA20018 */ sw $v0, 0x18($sp) -/* 0B2108 7F07F718 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B210C 7F07F71C 00002025 */ move $a0, $zero -/* 0B2110 7F07F720 8FAA0018 */ lw $t2, 0x18($sp) -/* 0B2114 7F07F724 104A000D */ beq $v0, $t2, .L7F07F75C -/* 0B2118 7F07F728 00000000 */ nop -/* 0B211C 7F07F72C 0FC174DB */ jal Gun_hand_without_item -/* 0B2120 7F07F730 00002025 */ move $a0, $zero -/* 0B2124 7F07F734 10400009 */ beqz $v0, .L7F07F75C -.L7F07F738: -/* 0B2128 7F07F738 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B212C 7F07F73C 24428BC0 */ addiu $v0, %lo(g_CurrentPlayer) # addiu $v0, $v0, -0x7440 -/* 0B2130 7F07F740 8C4C0000 */ lw $t4, ($v0) -/* 0B2134 7F07F744 240B0008 */ li $t3, 8 -/* 0B2138 7F07F748 AD8B01C8 */ sw $t3, 0x1c8($t4) -/* 0B213C 7F07F74C 8C4D0000 */ lw $t5, ($v0) -/* 0B2140 7F07F750 ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B2144 7F07F754 8C4E0000 */ lw $t6, ($v0) -/* 0B2148 7F07F758 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07F75C: -/* 0B214C 7F07F75C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B2150 7F07F760 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B2154 7F07F764 2401000B */ li $at, 11 -/* 0B2158 7F07F768 24040001 */ li $a0, 1 -/* 0B215C 7F07F76C 8C6F01C8 */ lw $t7, 0x1c8($v1) -/* 0B2160 7F07F770 15E10024 */ bne $t7, $at, .L7F07F804 -/* 0B2164 7F07F774 00000000 */ nop -/* 0B2168 7F07F778 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B216C 7F07F77C AC600200 */ sw $zero, 0x200($v1) -/* 0B2170 7F07F780 AFA2001C */ sw $v0, 0x1c($sp) -/* 0B2174 7F07F784 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B2178 7F07F788 24040001 */ li $a0, 1 -/* 0B217C 7F07F78C 8FB8001C */ lw $t8, 0x1c($sp) -/* 0B2180 7F07F790 1458001C */ bne $v0, $t8, .L7F07F804 -/* 0B2184 7F07F794 00000000 */ nop -/* 0B2188 7F07F798 0FC174DB */ jal Gun_hand_without_item -/* 0B218C 7F07F79C 24040001 */ li $a0, 1 -/* 0B2190 7F07F7A0 10400018 */ beqz $v0, .L7F07F804 -/* 0B2194 7F07F7A4 8FB9003C */ lw $t9, 0x3c($sp) -/* 0B2198 7F07F7A8 1320000C */ beqz $t9, .L7F07F7DC -/* 0B219C 7F07F7AC 00000000 */ nop -/* 0B21A0 7F07F7B0 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B21A4 7F07F7B4 00002025 */ move $a0, $zero -/* 0B21A8 7F07F7B8 AFA20018 */ sw $v0, 0x18($sp) -/* 0B21AC 7F07F7BC 0FC177BF */ jal get_item_in_hand_or_watch_menu -/* 0B21B0 7F07F7C0 00002025 */ move $a0, $zero -/* 0B21B4 7F07F7C4 8FA80018 */ lw $t0, 0x18($sp) -/* 0B21B8 7F07F7C8 1448000E */ bne $v0, $t0, .L7F07F804 -/* 0B21BC 7F07F7CC 00000000 */ nop -/* 0B21C0 7F07F7D0 0FC174DB */ jal Gun_hand_without_item -/* 0B21C4 7F07F7D4 00002025 */ move $a0, $zero -/* 0B21C8 7F07F7D8 1040000A */ beqz $v0, .L7F07F804 -.L7F07F7DC: -/* 0B21CC 7F07F7DC 3C0A8007 */ lui $t2, %hi(g_CurrentPlayer) # $t2, 0x8007 -/* 0B21D0 7F07F7E0 8D4A8BC0 */ lw $t2, %lo(g_CurrentPlayer)($t2) -/* 0B21D4 7F07F7E4 24090001 */ li $t1, 1 -/* 0B21D8 7F07F7E8 3C0B8007 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8007 -/* 0B21DC 7F07F7EC AD4901C8 */ sw $t1, 0x1c8($t2) -/* 0B21E0 7F07F7F0 8D6B8BC0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B21E4 7F07F7F4 3C0C8007 */ lui $t4, %hi(g_CurrentPlayer) # $t4, 0x8007 -/* 0B21E8 7F07F7F8 AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B21EC 7F07F7FC 8D8C8BC0 */ lw $t4, %lo(g_CurrentPlayer)($t4) -/* 0B21F0 7F07F800 AD8001C4 */ sw $zero, 0x1c4($t4) -.L7F07F804: -/* 0B21F4 7F07F804 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B21F8 7F07F808 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B21FC 7F07F80C 2401000D */ li $at, 13 -/* 0B2200 7F07F810 24040001 */ li $a0, 1 -/* 0B2204 7F07F814 8C6D01C8 */ lw $t5, 0x1c8($v1) -/* 0B2208 7F07F818 15A1001B */ bne $t5, $at, .L7F07F888 -/* 0B220C 7F07F81C 00000000 */ nop -/* 0B2210 7F07F820 0FC174DB */ jal Gun_hand_without_item -/* 0B2214 7F07F824 AC600200 */ sw $zero, 0x200($v1) -/* 0B2218 7F07F828 10400017 */ beqz $v0, .L7F07F888 -/* 0B221C 7F07F82C 00000000 */ nop -/* 0B2220 7F07F830 0FC174DB */ jal Gun_hand_without_item -/* 0B2224 7F07F834 00002025 */ move $a0, $zero -/* 0B2228 7F07F838 10400013 */ beqz $v0, .L7F07F888 -/* 0B222C 7F07F83C 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 -/* 0B2230 7F07F840 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) -/* 0B2234 7F07F844 24010005 */ li $at, 5 -/* 0B2238 7F07F848 8C620C34 */ lw $v0, 0xc34($v1) -/* 0B223C 7F07F84C 1041000E */ beq $v0, $at, .L7F07F888 -/* 0B2240 7F07F850 24010006 */ li $at, 6 -/* 0B2244 7F07F854 1041000C */ beq $v0, $at, .L7F07F888 -/* 0B2248 7F07F858 24010007 */ li $at, 7 -/* 0B224C 7F07F85C 1041000A */ beq $v0, $at, .L7F07F888 -/* 0B2250 7F07F860 24010008 */ li $at, 8 -/* 0B2254 7F07F864 10410008 */ beq $v0, $at, .L7F07F888 -/* 0B2258 7F07F868 240E0001 */ li $t6, 1 -/* 0B225C 7F07F86C AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B2260 7F07F870 3C0F8007 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8007 -/* 0B2264 7F07F874 8DEF8BC0 */ lw $t7, %lo(g_CurrentPlayer)($t7) -/* 0B2268 7F07F878 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B226C 7F07F87C ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B2270 7F07F880 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B2274 7F07F884 AF0001C4 */ sw $zero, 0x1c4($t8) -.L7F07F888: -/* 0B2278 7F07F888 0FC1F859 */ jal sub_GAME_7F07E090 -/* 0B227C 7F07F88C 00000000 */ nop -/* 0B2280 7F07F890 0FC1FA81 */ jal bondviewStepWatchAnimation -/* 0B2284 7F07F894 00000000 */ nop -/* 0B2288 7F07F898 0FC1F9C0 */ jal bondviewUpdateWatchZoomIn -/* 0B228C 7F07F89C 00000000 */ nop -/* 0B2290 7F07F8A0 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B2294 7F07F8A4 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B2298 7F07F8A8 8F2201C8 */ lw $v0, 0x1c8($t9) -/* 0B229C 7F07F8AC 24010005 */ li $at, 5 -.L7F07F8B0: -/* 0B22A0 7F07F8B0 54410008 */ bnel $v0, $at, .L7F07F8D4 -/* 0B22A4 7F07F8B4 2401000C */ li $at, 12 -/* 0B22A8 7F07F8B8 0FC2FC0F */ jal lvlSetControlsLockedFlag -/* 0B22AC 7F07F8BC 24040001 */ li $a0, 1 -/* 0B22B0 7F07F8C0 0FC29768 */ jal sub_GAME_7F0A6A80 -/* 0B22B4 7F07F8C4 00000000 */ nop -/* 0B22B8 7F07F8C8 1000000B */ b .L7F07F8F8 -/* 0B22BC 7F07F8CC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B22C0 7F07F8D0 2401000C */ li $at, 12 -.L7F07F8D4: -/* 0B22C4 7F07F8D4 14410005 */ bne $v0, $at, .Leu7F07F8EC -/* 0B22C8 7F07F8D8 00000000 */ nop -/* 0B22CC 7F07F8DC 0FC2FC0F */ jal lvlSetControlsLockedFlag -/* 0B22D0 7F07F8E0 24040001 */ li $a0, 1 -/* 0B22D4 7F07F8E4 10000004 */ b .L7F07F8F8 -/* 0B22D8 7F07F8E8 8FBF0014 */ lw $ra, 0x14($sp) -.Leu7F07F8EC: -/* 0B22DC 7F07F8EC 0FC2FC0F */ jal lvlSetControlsLockedFlag -/* 0B22E0 7F07F8F0 00002025 */ move $a0, $zero -/* 0B22E4 7F07F8F4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F07F8F8: -/* 0B22E8 7F07F8F8 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B22EC 7F07F8FC 03E00008 */ jr $ra -/* 0B22F0 7F07F900 00000000 */ nop -) -#endif - + #define WATCH_VAR_LOWER 14 + #define WATCH_VAR_UPPER 29 +#else + #define WATCH_VAR_LOWER 17 + #define WATCH_VAR_UPPER 35 #endif + s32 sp3c; + s32 sp38; + s32 sp34; + f32 sp30; + f32 sp2c; + f32 sp28; + f32 sp24; + f32 sp20; -void set_open_close_solo_watch_menu_to1(void) { - g_CurrentPlayer->open_close_solo_watch_menu = 1; -} - - - - - + if (g_CurrentPlayer->watch_animation_state) + { + sp34 = getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TRIGGER || getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_WATCHLASER; + sp3c = sp34; -#ifdef NONMATCHING +#if defined (VERSION_US) + sp38 = WATCH_VAR_LOWER; -/** - * decomp status: - * - compiles: yes - * - stack resize: ok - * - identical instructions: no - * - identical registers: fail - * - * Notes: Problem area is in the for loop. There is a single assigment at the end of the - * loop that needs to be at the beginning. - * There is some regalloc issues in the same area. -*/ -void trigger_solo_watch_menu(s32 arg0) -{ - s32 *ptr_a; - Gfx *ptr_b; - s32 *next; - s32 *ptr_copy; - int i; + if (sp34) + { + sp38 = WATCH_VAR_UPPER; + } +#else + sp38 = (sp34) ? WATCH_VAR_UPPER : WATCH_VAR_LOWER; +#endif + + g_CurrentPlayer->field_1C4 += g_ClockTimer; + g_CurrentPlayer->watch_pause_time += 1; + g_CurrentPlayer->pausing_flag = 0; - if (g_CurrentPlayer->watch_animation_state == 0) - { - if (arg0 == 0) + if (g_CurrentPlayer->watch_animation_state == 1) { - watch_transition_time *= 1.1f; - if (watch_transition_time > 1.7f) + g_CurrentPlayer->pausing_flag = 0; + + if (g_CurrentPlayer->watch_pause_time == 1) { - watch_transition_time = 1.7f; + draw_item_in_hand(GUNLEFT, ITEM_SUIT_LF_HAND); } - - if ((Gun_hand_without_item(1) != 0) - && (Gun_hand_without_item(0) != 0) - && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 5) - && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 6) - && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 7) - && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 8)) + else if (g_CurrentPlayer->watch_pause_time == 2) { - g_CurrentPlayer->watch_animation_state = 1; + if (sp34) + { + draw_item_in_hand(GUNRIGHT, ITEM_UNARMED); + } } else { - g_CurrentPlayer->watch_animation_state = 0xD; + if ( + (get_item_in_hand_or_watch_menu(1) == ITEM_SUIT_LF_HAND) + && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && ( + (sp34 == 0) + || ( + (get_item_in_hand_or_watch_menu(0) == ITEM_UNARMED) + && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED))) + && (g_CurrentPlayer->field_1C4 >= sp38)) + { + g_CurrentPlayer->watch_animation_state = 2; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + } } + } + + if (g_CurrentPlayer->watch_animation_state == 2) + { + g_CurrentPlayer->pausing_flag = 0; - g_CurrentPlayer->watch_pause_time = 0; - g_CurrentPlayer->field_1C4 = 0; - - sub_GAME_7F07DEFC(); - bondviewTriggerWatchZoomDefault(); - - sub_GAME_7F0A2F30(&g_CurrentPlayer->healthdamagetype, 0x2E, 1, get_BONDdata_watch_armor()); - sub_GAME_7F0A3330(&g_CurrentPlayer->watch_body_armor_bar_gdl, OS_K0_TO_PHYSICAL(&g_CurrentPlayer->healthdamagetype), 0x2E); + if (g_CurrentPlayer->watch_pause_time == 1) + { + gunSetSightVisible(GUNAMMOREASON_DAMAGE, FALSE); + gunSetGunAmmoVisible(GUNSIGHTREASON_NOCONTROL, FALSE); + hudmsgsSetOff(PLAYERFLAG_LOCKCONTROLS); + bondviewSetUpperTextDisplayFlag(PLAYERFLAG_LOCKCONTROLS); + countdownTimerSetVisible(4, 0); + + if ((g_CurrentPlayer->field_218 == 0) || (g_CurrentPlayer->field_218 == 2) || (g_CurrentPlayer->field_218 == 3)) + { + sp20 = bondviewPauseAngleRelated(1); + + if (sp20 < 30.0f) + { + sp20 = 30.0f; + } + + sub_GAME_7F07E010(sp20); + } + } + + if ((g_CurrentPlayer->field_214 - g_CurrentPlayer->field_210) < 30.0f) + { + g_CurrentPlayer->watch_animation_state = 3; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + + sub_GAME_7F07E7CC(); + } + } + + if (g_CurrentPlayer->watch_animation_state == 3) + { + if (g_CurrentPlayer->watch_pause_time == 1) + { + sp30 = 40.0f; + + if ((g_CurrentPlayer->step_in_view_watch_animation != 0) && (g_CurrentPlayer->step_in_view_watch_animation != 3)) + { + sp30 = ((20.0f - g_CurrentPlayer->pause_watch_related_adjust) * 40.0f) / 20.0f; + } + + if ((g_CurrentPlayer->field_218 == 0) || (g_CurrentPlayer->field_218 == 2) || (g_CurrentPlayer->field_218 == 3)) + { + sp2c = bondviewPauseAngleRelated(1); + sp20 = sp30 - 10.0f; + + if (sp2c < sp20) + { + sp2c = sp20; + } + + sub_GAME_7F07E010(sp2c); + + sp20 = sp2c + 10.0f; + + if (sp30 < sp20) + { + sp30 = sp20; + } + } + + bondviewSetPauseWatchRelated(sp30); + } + + if ( + ((g_CurrentPlayer->step_in_view_watch_animation != 0) && (g_CurrentPlayer->step_in_view_watch_animation != 3)) + || + sub_GAME_7F07E068() != 0 + ) + { + g_CurrentPlayer->pausing_flag = 1; + } + else + { + g_CurrentPlayer->watch_animation_state = 4; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + } + } + + if (g_CurrentPlayer->watch_animation_state == 4) + { + if ((g_CurrentPlayer->watch_pause_time == 1) && (g_CurrentPlayer->field_21C != 0)) + { + sndPlaySfx(g_musicSfxBufferPtr, 0xED, NULL); + g_CurrentPlayer->field_21C = 0; + } + + bondviewZoomToWatchOnOpen(); + + if (check_watch_page_transistion_running() != 0) + { + g_CurrentPlayer->pausing_flag = 1; + } + else + { + g_CurrentPlayer->watch_animation_state = 5; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + g_CurrentPlayer->field_21C = 1; + } + } + + if (g_CurrentPlayer->watch_animation_state == 5) + { + if (g_CurrentPlayer->watch_pause_time == 1) + { + sub_GAME_7F0C1310(); + } + + g_CurrentPlayer->pausing_flag = 1; + } + + if (g_CurrentPlayer->watch_animation_state == 12) + { + g_CurrentPlayer->pausing_flag = 1; + + if (g_CurrentPlayer->watch_pause_time >= 3) + { + g_CurrentPlayer->watch_animation_state = 6; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + sndPlaySfx(g_musicSfxBufferPtr, 0xEE, NULL); + } + } + + if (g_CurrentPlayer->watch_animation_state == 6) + { + if (g_CurrentPlayer->watch_pause_time == 1) + { + bondviewZoomFromWatchOnExit(); + if (sp34) + { + draw_item_in_hand(GUNRIGHT, ITEM_UNARMED); + } + else + { + sub_GAME_7F05DAE4(0); + } + } + if (check_watch_page_transistion_running()) + { + g_CurrentPlayer->pausing_flag = 1; + } + else + { + g_CurrentPlayer->watch_animation_state = 7; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + g_CurrentPlayer->field_21C = 1; + } + } + + if (g_CurrentPlayer->watch_animation_state == 7) + { + if (g_CurrentPlayer->watch_pause_time == 1) + { + sp28 = 40.0f; + sp24 = bondviewPauseAngleRelated(0); + + if ((g_CurrentPlayer->step_in_view_watch_animation != 0) && (g_CurrentPlayer->step_in_view_watch_animation != 3)) + { + sp28 = (g_CurrentPlayer->pause_watch_related_adjust * 40.0f) / 20.0f; + } + + sp20 = sp28 + 20.0f; + + if (sp24 < sp20) + { + sp24 = sp20; + } + + sub_GAME_7F07E03C(sp24); + bondviewSetPauseWatchRelatedAlt(sp28); + } - sub_GAME_7F0A2F30(&g_CurrentPlayer->related_to_health_display, 0x2E, -1, bondviewGetCurrentPlayerHealth()); - sub_GAME_7F0A3330(&g_CurrentPlayer->watch_health_bar_gdl, OS_K0_TO_PHYSICAL(&g_CurrentPlayer->related_to_health_display), 0x2E); + if ((g_CurrentPlayer->step_in_view_watch_animation != 0) && (g_CurrentPlayer->step_in_view_watch_animation != 3)) + { + g_CurrentPlayer->pausing_flag = 1; + } + else + { + g_CurrentPlayer->watch_animation_state = 8; + g_CurrentPlayer->watch_pause_time = 1; + g_CurrentPlayer->field_1C4 = 0; + } + } + + if (g_CurrentPlayer->watch_animation_state == 8) + { + g_CurrentPlayer->pausing_flag = 0; - sub_GAME_7F0A69A8(); + if (g_CurrentPlayer->watch_pause_time == 1) + { + + if ((get_item_in_hand_or_watch_menu(GUNLEFT) != getCurrentPlayerWeaponId(GUNLEFT)) && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED)) + { + draw_item_in_hand(GUNLEFT, getCurrentPlayerWeaponId(GUNLEFT)); + } + + if (sp3c) + { + if ((get_item_in_hand_or_watch_menu(GUNRIGHT) != getCurrentPlayerWeaponId(GUNRIGHT)) && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED)) + { + draw_item_in_hand(GUNRIGHT, getCurrentPlayerWeaponId(GUNRIGHT)); + } + } + } + else if (sub_GAME_7F07E068() == 0) + { + if ( + (get_item_in_hand_or_watch_menu(GUNLEFT) == getCurrentPlayerWeaponId(GUNLEFT)) + && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && ( + (sp3c == 0) + || (((get_item_in_hand_or_watch_menu(GUNRIGHT) == getCurrentPlayerWeaponId(GUNRIGHT))) && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED)))) + { + sub_GAME_7F05DAE4(1); + + if (sp3c) + { + sub_GAME_7F05DAE4(0); + } + + gunSetSightVisible(GUNAMMOREASON_DAMAGE, TRUE); + gunSetGunAmmoVisible(GUNSIGHTREASON_NOCONTROL, TRUE); + hudmsgsSetOn(1); + bondviewClearUpperTextDisplayFlag(1); + countdownTimerSetVisible(4, 1); + + g_CurrentPlayer->watch_animation_state = 0; + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + } + } + } + + if (g_CurrentPlayer->watch_animation_state == 9) + { + g_CurrentPlayer->pausing_flag = 0; + + if ( + (getCurrentPlayerWeaponId(GUNLEFT) != get_item_in_hand_or_watch_menu(GUNLEFT)) + && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && ( + (sp3c == 0) + || (((getCurrentPlayerWeaponId(GUNRIGHT) != get_item_in_hand_or_watch_menu(GUNRIGHT))) && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED)))) + { + g_CurrentPlayer->watch_animation_state = 8; + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + } + } + + if (g_CurrentPlayer->watch_animation_state == 10) + { + g_CurrentPlayer->pausing_flag = 0; + + if (g_CurrentPlayer->watch_pause_time == 1) + { + sub_GAME_7F07E03C(bondviewPauseAngleRelated(0)); + } + + if ( + (getCurrentPlayerWeaponId(GUNLEFT) != get_item_in_hand_or_watch_menu(GUNLEFT)) + && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && ( + (sp3c == 0) + || (((getCurrentPlayerWeaponId(GUNRIGHT) != get_item_in_hand_or_watch_menu(GUNRIGHT))) && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED)))) + { + g_CurrentPlayer->watch_animation_state = 8; + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + } + } + + if (g_CurrentPlayer->watch_animation_state == 11) + { + g_CurrentPlayer->pausing_flag = 0; + + if ( + (getCurrentPlayerWeaponId(GUNLEFT) == get_item_in_hand_or_watch_menu(GUNLEFT)) + && (Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && ( + (sp3c == 0) + || ( + ( (getCurrentPlayerWeaponId(GUNRIGHT) == get_item_in_hand_or_watch_menu(GUNRIGHT))) + && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED)))) + { + g_CurrentPlayer->watch_animation_state = 1; + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + } + } + + if (g_CurrentPlayer->watch_animation_state == 13) + { + g_CurrentPlayer->pausing_flag = 0; + + if (Gun_hand_without_item(GUNLEFT) + && Gun_hand_without_item(GUNRIGHT)) + { + if ((g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 5) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 6) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 7) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 8)) + { + g_CurrentPlayer->watch_animation_state = 1; + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + } + } + } + + sub_GAME_7F07E090(); + bondviewStepWatchAnimation(); + bondviewUpdateWatchZoomIn(); + } + + if (g_CurrentPlayer->watch_animation_state == 5) + { + lvlSetControlsLockedFlag(TRUE); + sub_GAME_7F0A6A80(); + } + else if (g_CurrentPlayer->watch_animation_state == 12) + { + lvlSetControlsLockedFlag(TRUE); + } + else + { + lvlSetControlsLockedFlag(FALSE); + } + +#undef WATCH_VAR_LOWER +#undef WATCH_VAR_UPPER +} + + + +void set_open_close_solo_watch_menu_to1(void) { + g_CurrentPlayer->open_close_solo_watch_menu = 1; +} + + + + /** - * Horizontal spacing between watch menu screen select rectangles. - * Default = 125. + * US address 7F07F874. + * EU address 7F07F918. */ -#define WATCH_SCREEN_SELECT_RECTANGLE_HSTEP (WATCH_SCREEN_SELECT_RECTANGLE_WIDTH + WATCH_SCREEN_SELECT_SPACER_WIDTH) +void trigger_solo_watch_menu(s32 arg0) +{ + struct WatchVertex *ptr_a; + Gfx *ptr_b; + struct WatchVertex *next; + struct WatchVertex *ptr_copy; + int i; + + if (g_CurrentPlayer->watch_animation_state == 0) + { + if (arg0 == 0) + { + watch_transition_time *= 1.1f; + if (watch_transition_time > 1.7f) + { + watch_transition_time = 1.7f; + } + + if ((Gun_hand_without_item(GUNLEFT) != ITEM_UNARMED) + && (Gun_hand_without_item(GUNRIGHT) != ITEM_UNARMED) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 5) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 6) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 7) + && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 8)) + { + g_CurrentPlayer->watch_animation_state = 1; + } + else + { + g_CurrentPlayer->watch_animation_state = 0xD; + } + + g_CurrentPlayer->watch_pause_time = 0; + g_CurrentPlayer->field_1C4 = 0; + + sub_GAME_7F07DEFC(); + bondviewTriggerWatchZoomDefault(); + + sub_GAME_7F0A2F30(&g_CurrentPlayer->healthdamagetype, 0x2E, 1, get_BONDdata_watch_armor()); + sub_GAME_7F0A3330(&g_CurrentPlayer->watch_body_armor_bar_gdl, OS_K0_TO_PHYSICAL(&g_CurrentPlayer->healthdamagetype), 0x2E); + + sub_GAME_7F0A2F30(&g_CurrentPlayer->related_to_health_display, 0x2E, -1, bondviewGetCurrentPlayerHealth()); + sub_GAME_7F0A3330(&g_CurrentPlayer->watch_health_bar_gdl, OS_K0_TO_PHYSICAL(&g_CurrentPlayer->related_to_health_display), 0x2E); + + sub_GAME_7F0A69A8(); /** * This section is for rendering the selected screen rectangles. */ - ptr_b = g_CurrentPlayer->buffer_for_watch_greenbackdrop_DL; - ptr_a = g_CurrentPlayer->buffer_for_watch_greenbackdrop_vertices; + ptr_b = g_CurrentPlayer->buffer_for_watch_greenbackdrop_DL; // Gfx + ptr_a = &g_CurrentPlayer->buffer_for_watch_greenbackdrop_vertices->vtx[0]; // struct WatchRectangle for (i=0; i<(WATCH_NUMBER_SCREENS * WATCH_SCREEN_SELECT_RECTANGLE_HSTEP); - i+=WATCH_SCREEN_SELECT_RECTANGLE_HSTEP, - ptr_a = next) + i+=WATCH_SCREEN_SELECT_RECTANGLE_HSTEP) { - ptr_copy = ptr_a; // Note: colors are set here but overwritten in watch.c set_page_rectangle_colors - next = setup_watch_rectangles(ptr_a, i, 0, 0x64, 0x14, -0x12B, 0x136); + ptr_copy = ptr_a; + ptr_a = setup_watch_rectangles(ptr_a, i, 0, 0x64, 0x14, -0x12B, 0x136); ptr_b = sub_GAME_7F0A3B40(ptr_b, OS_K0_TO_PHYSICAL(ptr_copy)); } @@ -15035,10 +8034,10 @@ void trigger_solo_watch_menu(s32 arg0) * This section is related to rendering static on the watch menu. * Static is defined by a horizontal bar in the middle of the screen. */ - ptr_a = g_CurrentPlayer->buffer_for_watch_static_vertices; - ptr_b = g_CurrentPlayer->buffer_for_watch_static_DL; + ptr_a = &g_CurrentPlayer->buffer_for_watch_static_vertices->vtx[0]; // struct WatchRectangle + ptr_b = g_CurrentPlayer->buffer_for_watch_static_DL; // Gfx - ptr_copy = g_CurrentPlayer->buffer_for_watch_static_vertices; + ptr_copy = &g_CurrentPlayer->buffer_for_watch_static_vertices->vtx[0]; next = setup_watch_rectangles(ptr_a, 0, 0, 0x398, 0x14, -0x1CC, 0); ptr_b = sub_GAME_7F0A3B40(ptr_b, OS_K0_TO_PHYSICAL(ptr_copy)); @@ -15144,623 +8143,12 @@ void trigger_solo_watch_menu(s32 arg0) g_CurrentPlayer->watch_animation_state = 0; } } -#else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_8005508C -.word 0x3fd9999a /*1.7*/ -glabel D_80055090 -.word 0x3f8ccccd /*1.1*/ -.text -glabel trigger_solo_watch_menu -/* 0B43A4 7F07F874 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B43A8 7F07F878 AFB40038 */ sw $s4, 0x38($sp) -/* 0B43AC 7F07F87C 3C148008 */ lui $s4, %hi(g_CurrentPlayer) -/* 0B43B0 7F07F880 2694A0B0 */ addiu $s4, %lo(g_CurrentPlayer) # addiu $s4, $s4, -0x5f50 -/* 0B43B4 7F07F884 8E830000 */ lw $v1, ($s4) -/* 0B43B8 7F07F888 AFBF003C */ sw $ra, 0x3c($sp) -/* 0B43BC 7F07F88C AFB30034 */ sw $s3, 0x34($sp) -/* 0B43C0 7F07F890 AFB20030 */ sw $s2, 0x30($sp) -/* 0B43C4 7F07F894 AFB1002C */ sw $s1, 0x2c($sp) -/* 0B43C8 7F07F898 AFB00028 */ sw $s0, 0x28($sp) -/* 0B43CC 7F07F89C 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B43D0 7F07F8A0 24050001 */ li $a1, 1 -/* 0B43D4 7F07F8A4 14400080 */ bnez $v0, .L7F07FAA8 -/* 0B43D8 7F07F8A8 00000000 */ nop -/* 0B43DC 7F07F8AC 148000FD */ bnez $a0, .L7F07FCA4 -/* 0B43E0 7F07F8B0 3C028003 */ lui $v0, %hi(watch_transition_time) -/* 0B43E4 7F07F8B4 3C018005 */ lui $at, %hi(D_8005508C) -/* 0B43E8 7F07F8B8 C420508C */ lwc1 $f0, %lo(D_8005508C)($at) -/* 0B43EC 7F07F8BC 244265A8 */ addiu $v0, %lo(watch_transition_time) # addiu $v0, $v0, 0x65a8 -/* 0B43F0 7F07F8C0 3C018005 */ lui $at, %hi(D_80055090) -/* 0B43F4 7F07F8C4 C4265090 */ lwc1 $f6, %lo(D_80055090)($at) -/* 0B43F8 7F07F8C8 C4440000 */ lwc1 $f4, ($v0) -/* 0B43FC 7F07F8CC 46062202 */ mul.s $f8, $f4, $f6 -/* 0B4400 7F07F8D0 E4480000 */ swc1 $f8, ($v0) -/* 0B4404 7F07F8D4 C44A0000 */ lwc1 $f10, ($v0) -/* 0B4408 7F07F8D8 460A003C */ c.lt.s $f0, $f10 -/* 0B440C 7F07F8DC 00000000 */ nop -/* 0B4410 7F07F8E0 45000002 */ bc1f .L7F07F8EC -/* 0B4414 7F07F8E4 00000000 */ nop -/* 0B4418 7F07F8E8 E4400000 */ swc1 $f0, ($v0) -.L7F07F8EC: -/* 0B441C 7F07F8EC 0FC173AF */ jal Gun_hand_without_item -/* 0B4420 7F07F8F0 24040001 */ li $a0, 1 -/* 0B4424 7F07F8F4 50400013 */ beql $v0, $zero, .L7F07F944 -/* 0B4428 7F07F8F8 8E8F0000 */ lw $t7, ($s4) -/* 0B442C 7F07F8FC 0FC173AF */ jal Gun_hand_without_item -/* 0B4430 7F07F900 00002025 */ move $a0, $zero -/* 0B4434 7F07F904 5040000F */ beql $v0, $zero, .L7F07F944 -/* 0B4438 7F07F908 8E8F0000 */ lw $t7, ($s4) -/* 0B443C 7F07F90C 8E830000 */ lw $v1, ($s4) -/* 0B4440 7F07F910 24010005 */ li $at, 5 -/* 0B4444 7F07F914 8C620C3C */ lw $v0, 0xc3c($v1) -/* 0B4448 7F07F918 10410009 */ beq $v0, $at, .L7F07F940 -/* 0B444C 7F07F91C 24010006 */ li $at, 6 -/* 0B4450 7F07F920 10410007 */ beq $v0, $at, .L7F07F940 -/* 0B4454 7F07F924 24010007 */ li $at, 7 -/* 0B4458 7F07F928 10410005 */ beq $v0, $at, .L7F07F940 -/* 0B445C 7F07F92C 24060008 */ li $a2, 8 -/* 0B4460 7F07F930 10C20003 */ beq $a2, $v0, .L7F07F940 -/* 0B4464 7F07F934 24050001 */ li $a1, 1 -/* 0B4468 7F07F938 10000004 */ b .L7F07F94C -/* 0B446C 7F07F93C AC6501C8 */ sw $a1, 0x1c8($v1) -.L7F07F940: -/* 0B4470 7F07F940 8E8F0000 */ lw $t7, ($s4) -.L7F07F944: -/* 0B4474 7F07F944 240E000D */ li $t6, 13 -/* 0B4478 7F07F948 ADEE01C8 */ sw $t6, 0x1c8($t7) -.L7F07F94C: -/* 0B447C 7F07F94C 8E980000 */ lw $t8, ($s4) -/* 0B4480 7F07F950 AF0001C0 */ sw $zero, 0x1c0($t8) -/* 0B4484 7F07F954 8E990000 */ lw $t9, ($s4) -/* 0B4488 7F07F958 0FC1F7BF */ jal sub_GAME_7F07DEFC -/* 0B448C 7F07F95C AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B4490 7F07F960 0FC1F941 */ jal bondviewTriggerWatchZoomDefault -/* 0B4494 7F07F964 00000000 */ nop -/* 0B4498 7F07F968 0FC228BF */ jal get_BONDdata_watch_armor -/* 0B449C 7F07F96C 00000000 */ nop -/* 0B44A0 7F07F970 8E840000 */ lw $a0, ($s4) -/* 0B44A4 7F07F974 44070000 */ mfc1 $a3, $f0 -/* 0B44A8 7F07F978 2405002E */ li $a1, 46 -/* 0B44AC 7F07F97C 24060001 */ li $a2, 1 -/* 0B44B0 7F07F980 0FC28BCC */ jal sub_GAME_7F0A2F30 -/* 0B44B4 7F07F984 248412B8 */ addiu $a0, $a0, 0x12b8 -/* 0B44B8 7F07F988 8E830000 */ lw $v1, ($s4) -/* 0B44BC 7F07F98C 3C018000 */ lui $at, (0x800012B8 >> 16) -/* 0B44C0 7F07F990 342112B8 */ ori $at, (0x800012B8 & 0xFFFF) # ori $at, $at, 0x12b8 -/* 0B44C4 7F07F994 2406002E */ li $a2, 46 -/* 0B44C8 7F07F998 00612821 */ addu $a1, $v1, $at -/* 0B44CC 7F07F99C 0FC28CCC */ jal sub_GAME_7F0A3330 -/* 0B44D0 7F07F9A0 246419F8 */ addiu $a0, $v1, 0x19f8 -/* 0B44D4 7F07F9A4 0FC228BB */ jal bondviewGetCurrentPlayerHealth -/* 0B44D8 7F07F9A8 00000000 */ nop -/* 0B44DC 7F07F9AC 8E840000 */ lw $a0, ($s4) -/* 0B44E0 7F07F9B0 44070000 */ mfc1 $a3, $f0 -/* 0B44E4 7F07F9B4 2405002E */ li $a1, 46 -/* 0B44E8 7F07F9B8 2406FFFF */ li $a2, -1 -/* 0B44EC 7F07F9BC 0FC28BCC */ jal sub_GAME_7F0A2F30 -/* 0B44F0 7F07F9C0 24841598 */ addiu $a0, $a0, 0x1598 -/* 0B44F4 7F07F9C4 8E830000 */ lw $v1, ($s4) -/* 0B44F8 7F07F9C8 3C018000 */ lui $at, (0x80001598 >> 16) -/* 0B44FC 7F07F9CC 34211598 */ ori $at, (0x80001598 & 0xFFFF) # ori $at, $at, 0x1598 -/* 0B4500 7F07F9D0 2406002E */ li $a2, 46 -/* 0B4504 7F07F9D4 00612821 */ addu $a1, $v1, $at -/* 0B4508 7F07F9D8 0FC28CCC */ jal sub_GAME_7F0A3330 -/* 0B450C 7F07F9DC 24642128 */ addiu $a0, $v1, 0x2128 -/* 0B4510 7F07F9E0 0FC29A6A */ jal sub_GAME_7F0A69A8 -/* 0B4514 7F07F9E4 00000000 */ nop -/* 0B4518 7F07F9E8 8E830000 */ lw $v1, ($s4) -/* 0B451C 7F07F9EC 00008025 */ move $s0, $zero -/* 0B4520 7F07F9F0 24732858 */ addiu $s3, $v1, 0x2858 -/* 0B4524 7F07F9F4 24711878 */ addiu $s1, $v1, 0x1878 -.L7F07F9F8: -/* 0B4528 7F07F9F8 24080014 */ li $t0, 20 -/* 0B452C 7F07F9FC 2409FED5 */ li $t1, -299 -/* 0B4530 7F07FA00 240A0136 */ li $t2, 310 -/* 0B4534 7F07FA04 02209025 */ move $s2, $s1 -/* 0B4538 7F07FA08 AFAA0018 */ sw $t2, 0x18($sp) -/* 0B453C 7F07FA0C AFA90014 */ sw $t1, 0x14($sp) -/* 0B4540 7F07FA10 AFA80010 */ sw $t0, 0x10($sp) -/* 0B4544 7F07FA14 02202025 */ move $a0, $s1 -/* 0B4548 7F07FA18 02002825 */ move $a1, $s0 -/* 0B454C 7F07FA1C 00003025 */ move $a2, $zero -/* 0B4550 7F07FA20 0FC28EAE */ jal setup_watch_rectangles -/* 0B4554 7F07FA24 24070064 */ li $a3, 100 -/* 0B4558 7F07FA28 3C018000 */ lui $at, 0x8000 -/* 0B455C 7F07FA2C 00408825 */ move $s1, $v0 -/* 0B4560 7F07FA30 02412821 */ addu $a1, $s2, $at -/* 0B4564 7F07FA34 0FC28ED0 */ jal sub_GAME_7F0A3B40 -/* 0B4568 7F07FA38 02602025 */ move $a0, $s3 -/* 0B456C 7F07FA3C 2610007D */ addiu $s0, $s0, 0x7d -/* 0B4570 7F07FA40 24010271 */ li $at, 625 -/* 0B4574 7F07FA44 1601FFEC */ bne $s0, $at, .L7F07F9F8 -/* 0B4578 7F07FA48 00409825 */ move $s3, $v0 -/* 0B457C 7F07FA4C 3C10B800 */ lui $s0, 0xb800 -/* 0B4580 7F07FA50 AC500000 */ sw $s0, ($v0) -/* 0B4584 7F07FA54 AC400004 */ sw $zero, 4($v0) -/* 0B4588 7F07FA58 8E830000 */ lw $v1, ($s4) -/* 0B458C 7F07FA5C 240B0014 */ li $t3, 20 -/* 0B4590 7F07FA60 240CFE34 */ li $t4, -460 -/* 0B4594 7F07FA64 246419B8 */ addiu $a0, $v1, 0x19b8 -/* 0B4598 7F07FA68 00809025 */ move $s2, $a0 -/* 0B459C 7F07FA6C AFAC0014 */ sw $t4, 0x14($sp) -/* 0B45A0 7F07FA70 AFAB0010 */ sw $t3, 0x10($sp) -/* 0B45A4 7F07FA74 AFA00018 */ sw $zero, 0x18($sp) -/* 0B45A8 7F07FA78 00002825 */ move $a1, $zero -/* 0B45AC 7F07FA7C 00003025 */ move $a2, $zero -/* 0B45B0 7F07FA80 24070398 */ li $a3, 920 -/* 0B45B4 7F07FA84 0FC28EAE */ jal setup_watch_rectangles -/* 0B45B8 7F07FA88 24732998 */ addiu $s3, $v1, 0x2998 -/* 0B45BC 7F07FA8C 3C018000 */ lui $at, 0x8000 -/* 0B45C0 7F07FA90 02412821 */ addu $a1, $s2, $at -/* 0B45C4 7F07FA94 0FC28ED0 */ jal sub_GAME_7F0A3B40 -/* 0B45C8 7F07FA98 02602025 */ move $a0, $s3 -/* 0B45CC 7F07FA9C AC500000 */ sw $s0, ($v0) -/* 0B45D0 7F07FAA0 10000080 */ b .L7F07FCA4 -/* 0B45D4 7F07FAA4 AC400004 */ sw $zero, 4($v0) -.L7F07FAA8: -/* 0B45D8 7F07FAA8 14A20008 */ bne $a1, $v0, .L7F07FACC -/* 0B45DC 7F07FAAC 24010002 */ li $at, 2 -/* 0B45E0 7F07FAB0 240D0009 */ li $t5, 9 -/* 0B45E4 7F07FAB4 AC6D01C8 */ sw $t5, 0x1c8($v1) -/* 0B45E8 7F07FAB8 8E8E0000 */ lw $t6, ($s4) -/* 0B45EC 7F07FABC ADC001C0 */ sw $zero, 0x1c0($t6) -/* 0B45F0 7F07FAC0 8E8F0000 */ lw $t7, ($s4) -/* 0B45F4 7F07FAC4 10000077 */ b .L7F07FCA4 -/* 0B45F8 7F07FAC8 ADE001C4 */ sw $zero, 0x1c4($t7) -.L7F07FACC: -/* 0B45FC 7F07FACC 14410008 */ bne $v0, $at, .L7F07FAF0 -/* 0B4600 7F07FAD0 24060003 */ li $a2, 3 -/* 0B4604 7F07FAD4 2418000A */ li $t8, 10 -/* 0B4608 7F07FAD8 AC7801C8 */ sw $t8, 0x1c8($v1) -/* 0B460C 7F07FADC 8E990000 */ lw $t9, ($s4) -/* 0B4610 7F07FAE0 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B4614 7F07FAE4 8E880000 */ lw $t0, ($s4) -/* 0B4618 7F07FAE8 1000006E */ b .L7F07FCA4 -/* 0B461C 7F07FAEC AD0001C4 */ sw $zero, 0x1c4($t0) -.L7F07FAF0: -/* 0B4620 7F07FAF0 14C20008 */ bne $a2, $v0, .L7F07FB14 -/* 0B4624 7F07FAF4 24070004 */ li $a3, 4 -/* 0B4628 7F07FAF8 24090007 */ li $t1, 7 -/* 0B462C 7F07FAFC AC6901C8 */ sw $t1, 0x1c8($v1) -/* 0B4630 7F07FB00 8E8A0000 */ lw $t2, ($s4) -/* 0B4634 7F07FB04 AD4001C0 */ sw $zero, 0x1c0($t2) -/* 0B4638 7F07FB08 8E8B0000 */ lw $t3, ($s4) -/* 0B463C 7F07FB0C 10000065 */ b .L7F07FCA4 -/* 0B4640 7F07FB10 AD6001C4 */ sw $zero, 0x1c4($t3) -.L7F07FB14: -/* 0B4644 7F07FB14 14E20008 */ bne $a3, $v0, .L7F07FB38 -/* 0B4648 7F07FB18 24010005 */ li $at, 5 -/* 0B464C 7F07FB1C 240C0006 */ li $t4, 6 -/* 0B4650 7F07FB20 AC6C01C8 */ sw $t4, 0x1c8($v1) -/* 0B4654 7F07FB24 8E8D0000 */ lw $t5, ($s4) -/* 0B4658 7F07FB28 ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B465C 7F07FB2C 8E8E0000 */ lw $t6, ($s4) -/* 0B4660 7F07FB30 1000005C */ b .L7F07FCA4 -/* 0B4664 7F07FB34 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07FB38: -/* 0B4668 7F07FB38 54410010 */ bnel $v0, $at, .L7F07FB7C -/* 0B466C 7F07FB3C 2401000C */ li $at, 12 -/* 0B4670 7F07FB40 0FC07549 */ jal deleteCurrentSelectedFolder -/* 0B4674 7F07FB44 00000000 */ nop -/* 0B4678 7F07FB48 0FC304D0 */ jal sub_GAME_7F0C1340 -/* 0B467C 7F07FB4C 00000000 */ nop -/* 0B4680 7F07FB50 8E980000 */ lw $t8, ($s4) -/* 0B4684 7F07FB54 240F000C */ li $t7, 12 -/* 0B4688 7F07FB58 AF0F01C8 */ sw $t7, 0x1c8($t8) -/* 0B468C 7F07FB5C 8E990000 */ lw $t9, ($s4) -/* 0B4690 7F07FB60 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B4694 7F07FB64 8E880000 */ lw $t0, ($s4) -/* 0B4698 7F07FB68 AD0001C4 */ sw $zero, 0x1c4($t0) -/* 0B469C 7F07FB6C 8E890000 */ lw $t1, ($s4) -/* 0B46A0 7F07FB70 1000004C */ b .L7F07FCA4 -/* 0B46A4 7F07FB74 AD2001D0 */ sw $zero, 0x1d0($t1) -/* 0B46A8 7F07FB78 2401000C */ li $at, 12 -.L7F07FB7C: -/* 0B46AC 7F07FB7C 10410049 */ beq $v0, $at, .L7F07FCA4 -/* 0B46B0 7F07FB80 24010006 */ li $at, 6 -/* 0B46B4 7F07FB84 5441000C */ bnel $v0, $at, .L7F07FBB8 -/* 0B46B8 7F07FB88 24010007 */ li $at, 7 -/* 0B46BC 7F07FB8C 54800046 */ bnezl $a0, .L7F07FCA8 -/* 0B46C0 7F07FB90 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B46C4 7F07FB94 AC6701C8 */ sw $a3, 0x1c8($v1) -/* 0B46C8 7F07FB98 8E8A0000 */ lw $t2, ($s4) -/* 0B46CC 7F07FB9C AD4001C0 */ sw $zero, 0x1c0($t2) -/* 0B46D0 7F07FBA0 8E8B0000 */ lw $t3, ($s4) -/* 0B46D4 7F07FBA4 0FC29A6A */ jal sub_GAME_7F0A69A8 -/* 0B46D8 7F07FBA8 AD6001C4 */ sw $zero, 0x1c4($t3) -/* 0B46DC 7F07FBAC 1000003E */ b .L7F07FCA8 -/* 0B46E0 7F07FBB0 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B46E4 7F07FBB4 24010007 */ li $at, 7 -.L7F07FBB8: -/* 0B46E8 7F07FBB8 5441000C */ bnel $v0, $at, .L7F07FBEC -/* 0B46EC 7F07FBBC 24060008 */ li $a2, 8 -/* 0B46F0 7F07FBC0 54800039 */ bnezl $a0, .L7F07FCA8 -/* 0B46F4 7F07FBC4 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B46F8 7F07FBC8 AC6601C8 */ sw $a2, 0x1c8($v1) -/* 0B46FC 7F07FBCC 8E8C0000 */ lw $t4, ($s4) -/* 0B4700 7F07FBD0 AD8001C0 */ sw $zero, 0x1c0($t4) -/* 0B4704 7F07FBD4 8E8D0000 */ lw $t5, ($s4) -/* 0B4708 7F07FBD8 0FC29A6A */ jal sub_GAME_7F0A69A8 -/* 0B470C 7F07FBDC ADA001C4 */ sw $zero, 0x1c4($t5) -/* 0B4710 7F07FBE0 10000031 */ b .L7F07FCA8 -/* 0B4714 7F07FBE4 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B4718 7F07FBE8 24060008 */ li $a2, 8 -.L7F07FBEC: -/* 0B471C 7F07FBEC 14C2000B */ bne $a2, $v0, .L7F07FC1C -/* 0B4720 7F07FBF0 24010009 */ li $at, 9 -/* 0B4724 7F07FBF4 1480002B */ bnez $a0, .L7F07FCA4 -/* 0B4728 7F07FBF8 240E000B */ li $t6, 11 -/* 0B472C 7F07FBFC AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B4730 7F07FC00 8E8F0000 */ lw $t7, ($s4) -/* 0B4734 7F07FC04 ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B4738 7F07FC08 8E980000 */ lw $t8, ($s4) -/* 0B473C 7F07FC0C 0FC29A6A */ jal sub_GAME_7F0A69A8 -/* 0B4740 7F07FC10 AF0001C4 */ sw $zero, 0x1c4($t8) -/* 0B4744 7F07FC14 10000024 */ b .L7F07FCA8 -/* 0B4748 7F07FC18 8FBF003C */ lw $ra, 0x3c($sp) -.L7F07FC1C: -/* 0B474C 7F07FC1C 5441000A */ bnel $v0, $at, .L7F07FC48 -/* 0B4750 7F07FC20 2401000A */ li $at, 10 -/* 0B4754 7F07FC24 54800020 */ bnezl $a0, .L7F07FCA8 -/* 0B4758 7F07FC28 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B475C 7F07FC2C AC6501C8 */ sw $a1, 0x1c8($v1) -/* 0B4760 7F07FC30 8E990000 */ lw $t9, ($s4) -/* 0B4764 7F07FC34 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B4768 7F07FC38 8E880000 */ lw $t0, ($s4) -/* 0B476C 7F07FC3C 10000019 */ b .L7F07FCA4 -/* 0B4770 7F07FC40 AD0001C4 */ sw $zero, 0x1c4($t0) -/* 0B4774 7F07FC44 2401000A */ li $at, 10 -.L7F07FC48: -/* 0B4778 7F07FC48 5441000A */ bnel $v0, $at, .L7F07FC74 -/* 0B477C 7F07FC4C 2401000B */ li $at, 11 -/* 0B4780 7F07FC50 54800015 */ bnezl $a0, .L7F07FCA8 -/* 0B4784 7F07FC54 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B4788 7F07FC58 AC6501C8 */ sw $a1, 0x1c8($v1) -/* 0B478C 7F07FC5C 8E890000 */ lw $t1, ($s4) -/* 0B4790 7F07FC60 AD2001C0 */ sw $zero, 0x1c0($t1) -/* 0B4794 7F07FC64 8E8A0000 */ lw $t2, ($s4) -/* 0B4798 7F07FC68 1000000E */ b .L7F07FCA4 -/* 0B479C 7F07FC6C AD4001C4 */ sw $zero, 0x1c4($t2) -/* 0B47A0 7F07FC70 2401000B */ li $at, 11 -.L7F07FC74: -/* 0B47A4 7F07FC74 54410008 */ bnel $v0, $at, .L7F07FC98 -/* 0B47A8 7F07FC78 2401000D */ li $at, 13 -/* 0B47AC 7F07FC7C AC6601C8 */ sw $a2, 0x1c8($v1) -/* 0B47B0 7F07FC80 8E8B0000 */ lw $t3, ($s4) -/* 0B47B4 7F07FC84 AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B47B8 7F07FC88 8E8C0000 */ lw $t4, ($s4) -/* 0B47BC 7F07FC8C 10000005 */ b .L7F07FCA4 -/* 0B47C0 7F07FC90 AD8001C4 */ sw $zero, 0x1c4($t4) -/* 0B47C4 7F07FC94 2401000D */ li $at, 13 -.L7F07FC98: -/* 0B47C8 7F07FC98 54410003 */ bnel $v0, $at, .L7F07FCA8 -/* 0B47CC 7F07FC9C 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B47D0 7F07FCA0 AC6001C8 */ sw $zero, 0x1c8($v1) -.L7F07FCA4: -/* 0B47D4 7F07FCA4 8FBF003C */ lw $ra, 0x3c($sp) -.L7F07FCA8: -/* 0B47D8 7F07FCA8 8FB00028 */ lw $s0, 0x28($sp) -/* 0B47DC 7F07FCAC 8FB1002C */ lw $s1, 0x2c($sp) -/* 0B47E0 7F07FCB0 8FB20030 */ lw $s2, 0x30($sp) -/* 0B47E4 7F07FCB4 8FB30034 */ lw $s3, 0x34($sp) -/* 0B47E8 7F07FCB8 8FB40038 */ lw $s4, 0x38($sp) -/* 0B47EC 7F07FCBC 03E00008 */ jr $ra -/* 0B47F0 7F07FCC0 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_8005508C -.word 0x3fd9999a /*1.7*/ -glabel D_80055090 -.word 0x3f8ccccd /*1.1*/ -.text -glabel trigger_solo_watch_menu -/* 0B2308 7F07F918 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B230C 7F07F91C AFB40038 */ sw $s4, 0x38($sp) -/* 0B2310 7F07F920 3C148007 */ lui $s4, %hi(g_CurrentPlayer) # $s4, 0x8007 -/* 0B2314 7F07F924 26948BC0 */ addiu $s4, %lo(g_CurrentPlayer) # addiu $s4, $s4, -0x7440 -/* 0B2318 7F07F928 8E830000 */ lw $v1, ($s4) -/* 0B231C 7F07F92C AFBF003C */ sw $ra, 0x3c($sp) -/* 0B2320 7F07F930 AFB30034 */ sw $s3, 0x34($sp) -/* 0B2324 7F07F934 AFB20030 */ sw $s2, 0x30($sp) -/* 0B2328 7F07F938 AFB1002C */ sw $s1, 0x2c($sp) -/* 0B232C 7F07F93C AFB00028 */ sw $s0, 0x28($sp) -/* 0B2330 7F07F940 8C6201C8 */ lw $v0, 0x1c8($v1) -/* 0B2334 7F07F944 24050001 */ li $a1, 1 -/* 0B2338 7F07F948 14400080 */ bnez $v0, .L7F07FB4C -/* 0B233C 7F07F94C 00000000 */ nop -/* 0B2340 7F07F950 148000FD */ bnez $a0, .L7F07FD48 -/* 0B2344 7F07F954 3C028003 */ lui $v0, %hi(watch_transition_time) # $v0, 0x8003 -/* 0B2348 7F07F958 3C018005 */ lui $at, %hi(D_8005508C) # $at, 0x8005 -/* 0B234C 7F07F95C C420AC5C */ lwc1 $f0, %lo(D_8005508C)($at) -/* 0B2350 7F07F960 24421AF8 */ addiu $v0, %lo(watch_transition_time) # addiu $v0, $v0, 0x1af8 -/* 0B2354 7F07F964 3C018005 */ lui $at, %hi(D_80055090) # $at, 0x8005 -/* 0B2358 7F07F968 C426AC60 */ lwc1 $f6, %lo(D_80055090)($at) -/* 0B235C 7F07F96C C4440000 */ lwc1 $f4, ($v0) -/* 0B2360 7F07F970 46062202 */ mul.s $f8, $f4, $f6 -/* 0B2364 7F07F974 E4480000 */ swc1 $f8, ($v0) -/* 0B2368 7F07F978 C44A0000 */ lwc1 $f10, ($v0) -/* 0B236C 7F07F97C 460A003C */ c.lt.s $f0, $f10 -/* 0B2370 7F07F980 00000000 */ nop -/* 0B2374 7F07F984 45000002 */ bc1f .L7F07F990 -/* 0B2378 7F07F988 00000000 */ nop -/* 0B237C 7F07F98C E4400000 */ swc1 $f0, ($v0) -.L7F07F990: -/* 0B2380 7F07F990 0FC174DB */ jal Gun_hand_without_item -/* 0B2384 7F07F994 24040001 */ li $a0, 1 -/* 0B2388 7F07F998 50400013 */ beql $v0, $zero, .L7F07F9E8 -/* 0B238C 7F07F99C 8E8F0000 */ lw $t7, ($s4) -/* 0B2390 7F07F9A0 0FC174DB */ jal Gun_hand_without_item -/* 0B2394 7F07F9A4 00002025 */ move $a0, $zero -/* 0B2398 7F07F9A8 5040000F */ beql $v0, $zero, .L7F07F9E8 -/* 0B239C 7F07F9AC 8E8F0000 */ lw $t7, ($s4) -/* 0B23A0 7F07F9B0 8E830000 */ lw $v1, ($s4) -/* 0B23A4 7F07F9B4 24010005 */ li $at, 5 -/* 0B23A8 7F07F9B8 8C620C34 */ lw $v0, 0xc34($v1) -/* 0B23AC 7F07F9BC 10410009 */ beq $v0, $at, .L7F07F9E4 -/* 0B23B0 7F07F9C0 24010006 */ li $at, 6 -/* 0B23B4 7F07F9C4 10410007 */ beq $v0, $at, .L7F07F9E4 -/* 0B23B8 7F07F9C8 24010007 */ li $at, 7 -/* 0B23BC 7F07F9CC 10410005 */ beq $v0, $at, .L7F07F9E4 -/* 0B23C0 7F07F9D0 24060008 */ li $a2, 8 -/* 0B23C4 7F07F9D4 10C20003 */ beq $a2, $v0, .L7F07F9E4 -/* 0B23C8 7F07F9D8 24050001 */ li $a1, 1 -/* 0B23CC 7F07F9DC 10000004 */ b .L7F07F9F0 -/* 0B23D0 7F07F9E0 AC6501C8 */ sw $a1, 0x1c8($v1) -.L7F07F9E4: -/* 0B23D4 7F07F9E4 8E8F0000 */ lw $t7, ($s4) -.L7F07F9E8: -/* 0B23D8 7F07F9E8 240E000D */ li $t6, 13 -/* 0B23DC 7F07F9EC ADEE01C8 */ sw $t6, 0x1c8($t7) -.L7F07F9F0: -/* 0B23E0 7F07F9F0 8E980000 */ lw $t8, ($s4) -/* 0B23E4 7F07F9F4 AF0001C0 */ sw $zero, 0x1c0($t8) -/* 0B23E8 7F07F9F8 8E990000 */ lw $t9, ($s4) -/* 0B23EC 7F07F9FC 0FC1F7F4 */ jal sub_GAME_7F07DEFC -/* 0B23F0 7F07FA00 AF2001C4 */ sw $zero, 0x1c4($t9) -/* 0B23F4 7F07FA04 0FC1F976 */ jal bondviewTriggerWatchZoomDefault -/* 0B23F8 7F07FA08 00000000 */ nop -/* 0B23FC 7F07FA0C 0FC22932 */ jal get_BONDdata_watch_armor -/* 0B2400 7F07FA10 00000000 */ nop -/* 0B2404 7F07FA14 8E840000 */ lw $a0, ($s4) -/* 0B2408 7F07FA18 44070000 */ mfc1 $a3, $f0 -/* 0B240C 7F07FA1C 2405002E */ li $a1, 46 -/* 0B2410 7F07FA20 24060001 */ li $a2, 1 -/* 0B2414 7F07FA24 0FC2891C */ jal sub_GAME_7F0A2F30 -/* 0B2418 7F07FA28 248412B0 */ addiu $a0, $a0, 0x12b0 -/* 0B241C 7F07FA2C 8E830000 */ lw $v1, ($s4) -/* 0B2420 7F07FA30 3C018000 */ lui $at, (0x800012B0 >> 16) # lui $at, 0x8000 -/* 0B2424 7F07FA34 342112B0 */ ori $at, (0x800012B0 & 0xFFFF) # ori $at, $at, 0x12b0 -/* 0B2428 7F07FA38 2406002E */ li $a2, 46 -/* 0B242C 7F07FA3C 00612821 */ addu $a1, $v1, $at -/* 0B2430 7F07FA40 0FC28A1C */ jal sub_GAME_7F0A3330 -/* 0B2434 7F07FA44 246419F0 */ addiu $a0, $v1, 0x19f0 -/* 0B2438 7F07FA48 0FC2292E */ jal bondviewGetCurrentPlayerHealth -/* 0B243C 7F07FA4C 00000000 */ nop -/* 0B2440 7F07FA50 8E840000 */ lw $a0, ($s4) -/* 0B2444 7F07FA54 44070000 */ mfc1 $a3, $f0 -/* 0B2448 7F07FA58 2405002E */ li $a1, 46 -/* 0B244C 7F07FA5C 2406FFFF */ li $a2, -1 -/* 0B2450 7F07FA60 0FC2891C */ jal sub_GAME_7F0A2F30 -/* 0B2454 7F07FA64 24841590 */ addiu $a0, $a0, 0x1590 -/* 0B2458 7F07FA68 8E830000 */ lw $v1, ($s4) -/* 0B245C 7F07FA6C 3C018000 */ lui $at, (0x80001590 >> 16) # lui $at, 0x8000 -/* 0B2460 7F07FA70 34211590 */ ori $at, (0x80001590 & 0xFFFF) # ori $at, $at, 0x1590 -/* 0B2464 7F07FA74 2406002E */ li $a2, 46 -/* 0B2468 7F07FA78 00612821 */ addu $a1, $v1, $at -/* 0B246C 7F07FA7C 0FC28A1C */ jal sub_GAME_7F0A3330 -/* 0B2470 7F07FA80 24642120 */ addiu $a0, $v1, 0x2120 -/* 0B2474 7F07FA84 0FC29732 */ jal sub_GAME_7F0A69A8 -/* 0B2478 7F07FA88 00000000 */ nop -/* 0B247C 7F07FA8C 8E830000 */ lw $v1, ($s4) -/* 0B2480 7F07FA90 00008025 */ move $s0, $zero -/* 0B2484 7F07FA94 24732850 */ addiu $s3, $v1, 0x2850 -/* 0B2488 7F07FA98 24711870 */ addiu $s1, $v1, 0x1870 -.L7F07FA9C: -/* 0B248C 7F07FA9C 24080014 */ li $t0, 20 -/* 0B2490 7F07FAA0 2409FED5 */ li $t1, -299 -/* 0B2494 7F07FAA4 240A0136 */ li $t2, 310 -/* 0B2498 7F07FAA8 02209025 */ move $s2, $s1 -/* 0B249C 7F07FAAC AFAA0018 */ sw $t2, 0x18($sp) -/* 0B24A0 7F07FAB0 AFA90014 */ sw $t1, 0x14($sp) -/* 0B24A4 7F07FAB4 AFA80010 */ sw $t0, 0x10($sp) -/* 0B24A8 7F07FAB8 02202025 */ move $a0, $s1 -/* 0B24AC 7F07FABC 02002825 */ move $a1, $s0 -/* 0B24B0 7F07FAC0 00003025 */ move $a2, $zero -/* 0B24B4 7F07FAC4 0FC28BFE */ jal setup_watch_rectangles -/* 0B24B8 7F07FAC8 24070064 */ li $a3, 100 -/* 0B24BC 7F07FACC 3C018000 */ lui $at, 0x8000 -/* 0B24C0 7F07FAD0 00408825 */ move $s1, $v0 -/* 0B24C4 7F07FAD4 02412821 */ addu $a1, $s2, $at -/* 0B24C8 7F07FAD8 0FC28C20 */ jal sub_GAME_7F0A3B40 -/* 0B24CC 7F07FADC 02602025 */ move $a0, $s3 -/* 0B24D0 7F07FAE0 2610007D */ addiu $s0, $s0, 0x7d -/* 0B24D4 7F07FAE4 24010271 */ li $at, 625 -/* 0B24D8 7F07FAE8 1601FFEC */ bne $s0, $at, .L7F07FA9C -/* 0B24DC 7F07FAEC 00409825 */ move $s3, $v0 -/* 0B24E0 7F07FAF0 3C10B800 */ lui $s0, 0xb800 -/* 0B24E4 7F07FAF4 AC500000 */ sw $s0, ($v0) -/* 0B24E8 7F07FAF8 AC400004 */ sw $zero, 4($v0) -/* 0B24EC 7F07FAFC 8E830000 */ lw $v1, ($s4) -/* 0B24F0 7F07FB00 240B0014 */ li $t3, 20 -/* 0B24F4 7F07FB04 240CFE34 */ li $t4, -460 -/* 0B24F8 7F07FB08 246419B0 */ addiu $a0, $v1, 0x19b0 -/* 0B24FC 7F07FB0C 00809025 */ move $s2, $a0 -/* 0B2500 7F07FB10 AFAC0014 */ sw $t4, 0x14($sp) -/* 0B2504 7F07FB14 AFAB0010 */ sw $t3, 0x10($sp) -/* 0B2508 7F07FB18 AFA00018 */ sw $zero, 0x18($sp) -/* 0B250C 7F07FB1C 00002825 */ move $a1, $zero -/* 0B2510 7F07FB20 00003025 */ move $a2, $zero -/* 0B2514 7F07FB24 24070398 */ li $a3, 920 -/* 0B2518 7F07FB28 0FC28BFE */ jal setup_watch_rectangles -/* 0B251C 7F07FB2C 24732990 */ addiu $s3, $v1, 0x2990 -/* 0B2520 7F07FB30 3C018000 */ lui $at, 0x8000 -/* 0B2524 7F07FB34 02412821 */ addu $a1, $s2, $at -/* 0B2528 7F07FB38 0FC28C20 */ jal sub_GAME_7F0A3B40 -/* 0B252C 7F07FB3C 02602025 */ move $a0, $s3 -/* 0B2530 7F07FB40 AC500000 */ sw $s0, ($v0) -/* 0B2534 7F07FB44 10000080 */ b .L7F07FD48 -/* 0B2538 7F07FB48 AC400004 */ sw $zero, 4($v0) -.L7F07FB4C: -/* 0B253C 7F07FB4C 14A20008 */ bne $a1, $v0, .L7F07FB70 -/* 0B2540 7F07FB50 24010002 */ li $at, 2 -/* 0B2544 7F07FB54 240D0009 */ li $t5, 9 -/* 0B2548 7F07FB58 AC6D01C8 */ sw $t5, 0x1c8($v1) -/* 0B254C 7F07FB5C 8E8E0000 */ lw $t6, ($s4) -/* 0B2550 7F07FB60 ADC001C0 */ sw $zero, 0x1c0($t6) -/* 0B2554 7F07FB64 8E8F0000 */ lw $t7, ($s4) -/* 0B2558 7F07FB68 10000077 */ b .L7F07FD48 -/* 0B255C 7F07FB6C ADE001C4 */ sw $zero, 0x1c4($t7) -.L7F07FB70: -/* 0B2560 7F07FB70 14410008 */ bne $v0, $at, .L7F07FB94 -/* 0B2564 7F07FB74 24060003 */ li $a2, 3 -/* 0B2568 7F07FB78 2418000A */ li $t8, 10 -/* 0B256C 7F07FB7C AC7801C8 */ sw $t8, 0x1c8($v1) -/* 0B2570 7F07FB80 8E990000 */ lw $t9, ($s4) -/* 0B2574 7F07FB84 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B2578 7F07FB88 8E880000 */ lw $t0, ($s4) -/* 0B257C 7F07FB8C 1000006E */ b .L7F07FD48 -/* 0B2580 7F07FB90 AD0001C4 */ sw $zero, 0x1c4($t0) -.L7F07FB94: -/* 0B2584 7F07FB94 14C20008 */ bne $a2, $v0, .L7F07FBB8 -/* 0B2588 7F07FB98 24070004 */ li $a3, 4 -/* 0B258C 7F07FB9C 24090007 */ li $t1, 7 -/* 0B2590 7F07FBA0 AC6901C8 */ sw $t1, 0x1c8($v1) -/* 0B2594 7F07FBA4 8E8A0000 */ lw $t2, ($s4) -/* 0B2598 7F07FBA8 AD4001C0 */ sw $zero, 0x1c0($t2) -/* 0B259C 7F07FBAC 8E8B0000 */ lw $t3, ($s4) -/* 0B25A0 7F07FBB0 10000065 */ b .L7F07FD48 -/* 0B25A4 7F07FBB4 AD6001C4 */ sw $zero, 0x1c4($t3) -.L7F07FBB8: -/* 0B25A8 7F07FBB8 14E20008 */ bne $a3, $v0, .L7F07FBDC -/* 0B25AC 7F07FBBC 24010005 */ li $at, 5 -/* 0B25B0 7F07FBC0 240C0006 */ li $t4, 6 -/* 0B25B4 7F07FBC4 AC6C01C8 */ sw $t4, 0x1c8($v1) -/* 0B25B8 7F07FBC8 8E8D0000 */ lw $t5, ($s4) -/* 0B25BC 7F07FBCC ADA001C0 */ sw $zero, 0x1c0($t5) -/* 0B25C0 7F07FBD0 8E8E0000 */ lw $t6, ($s4) -/* 0B25C4 7F07FBD4 1000005C */ b .L7F07FD48 -/* 0B25C8 7F07FBD8 ADC001C4 */ sw $zero, 0x1c4($t6) -.L7F07FBDC: -/* 0B25CC 7F07FBDC 54410010 */ bnel $v0, $at, .L7F07FC20 -/* 0B25D0 7F07FBE0 2401000C */ li $at, 12 -/* 0B25D4 7F07FBE4 0FC074DE */ jal deleteCurrentSelectedFolder -/* 0B25D8 7F07FBE8 00000000 */ nop -/* 0B25DC 7F07FBEC 0FC30208 */ jal sub_GAME_7F0C1340 -/* 0B25E0 7F07FBF0 00000000 */ nop -/* 0B25E4 7F07FBF4 8E980000 */ lw $t8, ($s4) -/* 0B25E8 7F07FBF8 240F000C */ li $t7, 12 -/* 0B25EC 7F07FBFC AF0F01C8 */ sw $t7, 0x1c8($t8) -/* 0B25F0 7F07FC00 8E990000 */ lw $t9, ($s4) -/* 0B25F4 7F07FC04 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B25F8 7F07FC08 8E880000 */ lw $t0, ($s4) -/* 0B25FC 7F07FC0C AD0001C4 */ sw $zero, 0x1c4($t0) -/* 0B2600 7F07FC10 8E890000 */ lw $t1, ($s4) -/* 0B2604 7F07FC14 1000004C */ b .L7F07FD48 -/* 0B2608 7F07FC18 AD2001D0 */ sw $zero, 0x1d0($t1) -/* 0B260C 7F07FC1C 2401000C */ li $at, 12 -.L7F07FC20: -/* 0B2610 7F07FC20 10410049 */ beq $v0, $at, .L7F07FD48 -/* 0B2614 7F07FC24 24010006 */ li $at, 6 -/* 0B2618 7F07FC28 5441000C */ bnel $v0, $at, .L7F07FC5C -/* 0B261C 7F07FC2C 24010007 */ li $at, 7 -/* 0B2620 7F07FC30 54800046 */ bnezl $a0, .L7F07FD4C -/* 0B2624 7F07FC34 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B2628 7F07FC38 AC6701C8 */ sw $a3, 0x1c8($v1) -/* 0B262C 7F07FC3C 8E8A0000 */ lw $t2, ($s4) -/* 0B2630 7F07FC40 AD4001C0 */ sw $zero, 0x1c0($t2) -/* 0B2634 7F07FC44 8E8B0000 */ lw $t3, ($s4) -/* 0B2638 7F07FC48 0FC29732 */ jal sub_GAME_7F0A69A8 -/* 0B263C 7F07FC4C AD6001C4 */ sw $zero, 0x1c4($t3) -/* 0B2640 7F07FC50 1000003E */ b .L7F07FD4C -/* 0B2644 7F07FC54 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B2648 7F07FC58 24010007 */ li $at, 7 -.L7F07FC5C: -/* 0B264C 7F07FC5C 5441000C */ bnel $v0, $at, .L7F07FC90 -/* 0B2650 7F07FC60 24060008 */ li $a2, 8 -/* 0B2654 7F07FC64 54800039 */ bnezl $a0, .L7F07FD4C -/* 0B2658 7F07FC68 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B265C 7F07FC6C AC6601C8 */ sw $a2, 0x1c8($v1) -/* 0B2660 7F07FC70 8E8C0000 */ lw $t4, ($s4) -/* 0B2664 7F07FC74 AD8001C0 */ sw $zero, 0x1c0($t4) -/* 0B2668 7F07FC78 8E8D0000 */ lw $t5, ($s4) -/* 0B266C 7F07FC7C 0FC29732 */ jal sub_GAME_7F0A69A8 -/* 0B2670 7F07FC80 ADA001C4 */ sw $zero, 0x1c4($t5) -/* 0B2674 7F07FC84 10000031 */ b .L7F07FD4C -/* 0B2678 7F07FC88 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B267C 7F07FC8C 24060008 */ li $a2, 8 -.L7F07FC90: -/* 0B2680 7F07FC90 14C2000B */ bne $a2, $v0, .L7F07FCC0 -/* 0B2684 7F07FC94 24010009 */ li $at, 9 -/* 0B2688 7F07FC98 1480002B */ bnez $a0, .L7F07FD48 -/* 0B268C 7F07FC9C 240E000B */ li $t6, 11 -/* 0B2690 7F07FCA0 AC6E01C8 */ sw $t6, 0x1c8($v1) -/* 0B2694 7F07FCA4 8E8F0000 */ lw $t7, ($s4) -/* 0B2698 7F07FCA8 ADE001C0 */ sw $zero, 0x1c0($t7) -/* 0B269C 7F07FCAC 8E980000 */ lw $t8, ($s4) -/* 0B26A0 7F07FCB0 0FC29732 */ jal sub_GAME_7F0A69A8 -/* 0B26A4 7F07FCB4 AF0001C4 */ sw $zero, 0x1c4($t8) -/* 0B26A8 7F07FCB8 10000024 */ b .L7F07FD4C -/* 0B26AC 7F07FCBC 8FBF003C */ lw $ra, 0x3c($sp) -.L7F07FCC0: -/* 0B26B0 7F07FCC0 5441000A */ bnel $v0, $at, .L7F07FCEC -/* 0B26B4 7F07FCC4 2401000A */ li $at, 10 -/* 0B26B8 7F07FCC8 54800020 */ bnezl $a0, .L7F07FD4C -/* 0B26BC 7F07FCCC 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B26C0 7F07FCD0 AC6501C8 */ sw $a1, 0x1c8($v1) -/* 0B26C4 7F07FCD4 8E990000 */ lw $t9, ($s4) -/* 0B26C8 7F07FCD8 AF2001C0 */ sw $zero, 0x1c0($t9) -/* 0B26CC 7F07FCDC 8E880000 */ lw $t0, ($s4) -/* 0B26D0 7F07FCE0 10000019 */ b .L7F07FD48 -/* 0B26D4 7F07FCE4 AD0001C4 */ sw $zero, 0x1c4($t0) -/* 0B26D8 7F07FCE8 2401000A */ li $at, 10 -.L7F07FCEC: -/* 0B26DC 7F07FCEC 5441000A */ bnel $v0, $at, .L7F07FD18 -/* 0B26E0 7F07FCF0 2401000B */ li $at, 11 -/* 0B26E4 7F07FCF4 54800015 */ bnezl $a0, .L7F07FD4C -/* 0B26E8 7F07FCF8 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B26EC 7F07FCFC AC6501C8 */ sw $a1, 0x1c8($v1) -/* 0B26F0 7F07FD00 8E890000 */ lw $t1, ($s4) -/* 0B26F4 7F07FD04 AD2001C0 */ sw $zero, 0x1c0($t1) -/* 0B26F8 7F07FD08 8E8A0000 */ lw $t2, ($s4) -/* 0B26FC 7F07FD0C 1000000E */ b .L7F07FD48 -/* 0B2700 7F07FD10 AD4001C4 */ sw $zero, 0x1c4($t2) -/* 0B2704 7F07FD14 2401000B */ li $at, 11 -.L7F07FD18: -/* 0B2708 7F07FD18 54410008 */ bnel $v0, $at, .L7F07FD3C -/* 0B270C 7F07FD1C 2401000D */ li $at, 13 -/* 0B2710 7F07FD20 AC6601C8 */ sw $a2, 0x1c8($v1) -/* 0B2714 7F07FD24 8E8B0000 */ lw $t3, ($s4) -/* 0B2718 7F07FD28 AD6001C0 */ sw $zero, 0x1c0($t3) -/* 0B271C 7F07FD2C 8E8C0000 */ lw $t4, ($s4) -/* 0B2720 7F07FD30 10000005 */ b .L7F07FD48 -/* 0B2724 7F07FD34 AD8001C4 */ sw $zero, 0x1c4($t4) -/* 0B2728 7F07FD38 2401000D */ li $at, 13 -.L7F07FD3C: -/* 0B272C 7F07FD3C 54410003 */ bnel $v0, $at, .L7F07FD4C -/* 0B2730 7F07FD40 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B2734 7F07FD44 AC6001C8 */ sw $zero, 0x1c8($v1) -.L7F07FD48: -/* 0B2738 7F07FD48 8FBF003C */ lw $ra, 0x3c($sp) -.L7F07FD4C: -/* 0B273C 7F07FD4C 8FB00028 */ lw $s0, 0x28($sp) -/* 0B2740 7F07FD50 8FB1002C */ lw $s1, 0x2c($sp) -/* 0B2744 7F07FD54 8FB20030 */ lw $s2, 0x30($sp) -/* 0B2748 7F07FD58 8FB30034 */ lw $s3, 0x34($sp) -/* 0B274C 7F07FD5C 8FB40038 */ lw $s4, 0x38($sp) -/* 0B2750 7F07FD60 03E00008 */ jr $ra -/* 0B2754 7F07FD64 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif -#endif - -void sub_GAME_7F07FCC4(s32 arg0) { +/** + * US address 7F07FCC4. + * Perfect Dark bwalkUpdateSpeedSideways. +*/ +void bondviewUpdateSpeedSideways(s32 arg0) { if (arg0 == -1) { g_CurrentPlayer->speedstrafe = (g_CurrentPlayer->speedstrafe - g_GlobalTimerDelta); if (g_CurrentPlayer->speedstrafe < -1.0f) { @@ -15790,7 +8178,11 @@ void sub_GAME_7F07FCC4(s32 arg0) { g_CurrentPlayer->speedsideways = g_CurrentPlayer->speedstrafe; } -void sub_GAME_7F07FE1C(s32 arg0) { +/** + * US address 7F07FE1C. + * Perfect Dark bwalkUpdateSpeedForwards. +*/ +void bondviewUpdateSpeedForwards(s32 arg0) { if (arg0 == 1) { g_CurrentPlayer->field_2A4C = (g_CurrentPlayer->field_2A4C + g_GlobalTimerDelta); if (1.0f < g_CurrentPlayer->field_2A4C) { @@ -15819,13 +8211,17 @@ void sub_GAME_7F07FE1C(s32 arg0) { g_CurrentPlayer->speedforwards = g_CurrentPlayer->field_2A4C; } +/** + * US address 7F07FF74. + * Duplicate of sub_GAME_7F080228. +*/ f32 sub_GAME_7F07FF74(f32 value) { if (value > 0) { - return (viGetFovY() * value * -0.7f) / 60.0f; + return (viGetFovY() * value * -0.7f) / FOV_Y_F; } if (value < 0) { - return (viGetFovY() * -value * 0.7f) / 60.0f; + return (viGetFovY() * -value * 0.7f) / FOV_Y_F; } return 0; @@ -15837,7 +8233,7 @@ f32 sub_GAME_7F07FF74(f32 value) { */ void bondviewCurrentPlayerUpdateSpeedVerta(f32 value) { - f32 mult = viGetFovY() / 60.0f; + f32 mult = viGetFovY() / FOV_Y_F; f32 limit = sub_GAME_7F07FF74(value); if (value > 0.0f) @@ -15897,12 +8293,15 @@ void bondviewCurrentPlayerUpdateSpeedVerta(f32 value) - +/** + * US address 7F080228. + * Duplicate of sub_GAME_7F07FF74. +*/ f32 sub_GAME_7F080228(f32 arg0) { if (0.0f < arg0) { - return (viGetFovY() * arg0 * -0.7f) / 60.0f; + return (viGetFovY() * arg0 * -0.7f) / FOV_Y_F; } else if (arg0 < 0.0f) { - return (viGetFovY() * -arg0 * 0.7f) / 60.0f; + return (viGetFovY() * -arg0 * 0.7f) / FOV_Y_F; } else { return 0.0f; } @@ -15913,7 +8312,7 @@ f32 sub_GAME_7F080228(f32 arg0) { */ void bondviewCurrentPlayerUpdateSpeedTheta(f32 value) { - f32 mult = viGetFovY() / 60.0f; + f32 mult = viGetFovY() / FOV_Y_F; f32 limit = sub_GAME_7F080228(value); if (value > 0.0f) @@ -16103,26 +8502,26 @@ void currentPlayerTickChrFade(void) /** * Will apply a move animation update. The pass through call to bheadUpdate is * what allows Bond to move. This will also trigger the death animation once - * Bond dies. + * Bond dies. This chooses a random death animation from g_bondviewBondDeathAnimations. * Address 0x7F080B34. */ -void bondviewMoveAnimationTick(f32 arg0, f32 arg1, f32 arg2) +void bondviewMoveAnimationTick(f32 speed, f32 speedforwards, f32 speedsideways) { - f32 spCC; + f32 percent_speed; Mtxf sp8C; Mtxf sp4C; - spCC = 0.0f; + percent_speed = 0.0f; if (g_CurrentPlayer->bonddead == 0) { - bheadAdjustAnimation(arg0); + bheadAdjustAnimation(speed); - if (arg0 != 0.0f) + if (speed != 0.0f) { - spCC = arg1 / arg0; + percent_speed = speedforwards / speed; } - else if (arg1 == 0.0f) + else if (speedforwards == 0.0f) { // } @@ -16139,19 +8538,21 @@ void bondviewMoveAnimationTick(f32 arg0, f32 arg1, f32 arg2) } bheadSetSpeed(0.5f); - arg2 = 0.0f; + speedsideways = 0.0f; } - bheadUpdate(spCC, arg2); + bheadUpdate(percent_speed, speedsideways); - matrix_4x4_set_rotation_around_x((360.0f - g_CurrentPlayer->vv_verta360) * 0.017453292f, &sp8C); - matrix_4x4_7F059908(&sp4C, 0.0f, 0.0f, 0.0f, -g_CurrentPlayer->headlook[0], -g_CurrentPlayer->headlook[1], -g_CurrentPlayer->headlook[2], g_CurrentPlayer->headup[0], g_CurrentPlayer->headup[1], g_CurrentPlayer->headup[2]); + matrix_4x4_set_rotation_around_x((360.0f - g_CurrentPlayer->vv_verta360) * DegToRad1Fact(1), &sp8C); + matrix_4x4_7F059908(&sp4C, 0.0f, 0.0f, 0.0f, -g_CurrentPlayer->headlook.f[0], -g_CurrentPlayer->headlook.f[1], -g_CurrentPlayer->headlook.f[2], g_CurrentPlayer->headup.f[0], g_CurrentPlayer->headup.f[1], g_CurrentPlayer->headup.f[2]); matrix_4x4_multiply_in_place(&sp4C, &sp8C); - matrix_4x4_set_rotation_around_y((360.0f - g_CurrentPlayer->vv_theta) * 0.017453292f, &sp4C); + matrix_4x4_set_rotation_around_y((360.0f - g_CurrentPlayer->vv_theta) * DegToRad1Fact(1), &sp4C); matrix_4x4_multiply_in_place(&sp4C, &sp8C); + g_CurrentPlayer->field_488.applied_view.f[0] = sp8C.m[2][0]; g_CurrentPlayer->field_488.applied_view.f[1] = sp8C.m[2][1]; g_CurrentPlayer->field_488.applied_view.f[2] = sp8C.m[2][2]; + g_CurrentPlayer->field_488.applied_view2.f[0] = sp8C.m[1][0]; g_CurrentPlayer->field_488.applied_view2.f[1] = sp8C.m[1][1]; g_CurrentPlayer->field_488.applied_view2.f[2] = sp8C.m[1][2]; @@ -16166,9 +8567,9 @@ f32 bondviewYPositionRelated(StandTile *arg0, f32 arg1, f32 arg2) { f32 ret; - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - ObjectRecord * obj = ((PropRecord *)ptr_playerstank)->obj; + ObjectRecord * obj = ((PropRecord *)g_PlayerTankProp)->obj; PropRecord *p = obj->prop; ret = stanGetPositionYValue(p->stan, p->pos.x, p->pos.z); @@ -16192,31 +8593,26 @@ f32 bondviewYPositionRelated(StandTile *arg0, f32 arg1, f32 arg2) -#ifdef NONMATCHING /** - * Address 0x7F080DF8. - * - * decomp status: - * - compiles: yes - * - stack resize: wrong - * - identical instructions: fail - * - identical registers: fail - * - * notes: one large wrong section. There's a load that's swapped near the beginning. - * Rest of the function just has regalloc issues. + * US Address 0x7F080DF8. + * EU Address 0x7F080E9C. */ -void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) +void bondviewUpdatePlayerY(s32 use_stanHeight, f32 stanHeight_offset) { - s32 i; - f32 temp_f0; - f32 sp5C; - f32 sp58; - f32 sp54; - f32 new_field_7c; - f32 new_field_70; - f32 sp40; + s32 i; // sp6c + f32 unused; f32 sp64; - f32 save_field_7C; + StandTile *stan; //sp60 + f32 collision_radius; //sp5c + f32 height; //sp58 + f32 always_30; //sp54 + f32 temp_f0; // no stack + f32 new_field_70; // sp4c + f32 new_field_7c; //sp48 + f32 ftemp2; + f32 sp40; + + if (1); if (in_tank_flag == 1) { @@ -16225,17 +8621,14 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2]); - if(0){} - if(1){} - - g_CurrentPlayer->field_6C = g_CurrentPlayer->field_70 / 0.17f; + g_CurrentPlayer->field_6C = g_CurrentPlayer->field_70 / (1.0f - TANK_UNKD0_SCALE); for (i=0; ifield_6C = (g_CurrentPlayer->field_6C * 0.83f) + g_CurrentPlayer->stanHeight; + g_CurrentPlayer->field_6C = (g_CurrentPlayer->field_6C * TANK_UNKD0_SCALE) + g_CurrentPlayer->stanHeight; } - g_CurrentPlayer->field_70 = g_CurrentPlayer->field_6C * 0.17f; + g_CurrentPlayer->field_70 = g_CurrentPlayer->field_6C * (1.0f - TANK_UNKD0_SCALE); } else { @@ -16255,20 +8648,21 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) } else { - StandTile *st = g_CurrentPlayer->field_488.current_tile_ptr; + stan = g_CurrentPlayer->field_488.current_tile_ptr; - bondviewCollisionRadiusRelated(g_CurrentPlayer->prop, &sp5C, &sp58, &sp54); + bondviewGetCollisionRadius(g_CurrentPlayer->prop, &collision_radius, &height, &always_30); sp64 = bondviewYPositionRelated( g_CurrentPlayer->field_488.current_tile_ptr, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2]); + // Another error checking block, it seems this condition is almost never triggered in the game. if (sub_GAME_7F0B26B8( - &st, + &stan, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], - sp5C, + collision_radius, bondviewGetPlayerDuckingHeightRelated(g_CurrentPlayer) + sp64) >= 0) { if (sp64 < g_CurrentPlayer->stanHeight) @@ -16289,45 +8683,42 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) if ((g_CurrentPlayer->field_7C >= 0.0f) || (g_CurrentPlayer->field_70 < g_CurrentPlayer->stanHeight)) { - g_CurrentPlayer->field_6C = g_CurrentPlayer->field_70 / 0.17f; + g_CurrentPlayer->field_6C = g_CurrentPlayer->field_70 / (1.0f - TANK_UNKD0_SCALE); for (i=0; ifield_6C = (g_CurrentPlayer->field_6C * 0.83f) + g_CurrentPlayer->stanHeight; + g_CurrentPlayer->field_6C = (g_CurrentPlayer->field_6C * TANK_UNKD0_SCALE) + g_CurrentPlayer->stanHeight; } if (g_CurrentPlayer->field_70 < g_CurrentPlayer->stanHeight) { - g_CurrentPlayer->field_70 = g_CurrentPlayer->field_6C * 0.17f; + g_CurrentPlayer->field_70 = g_CurrentPlayer->field_6C * (1.0f - TANK_UNKD0_SCALE); } } - // decomp issue: begin very wrong section - save_field_7C = g_CurrentPlayer->field_7C; - if (g_CurrentPlayer->stanHeight < g_CurrentPlayer->field_70) { - if ((get_debug_fast_bond_flag() != 0) && (flt_CODE_bss_80079990[0] == 0.0f) && (flt_CODE_bss_80079990[2] == 0.0f)) + new_field_7c = g_CurrentPlayer->field_7C; + new_field_70 = g_CurrentPlayer->field_70; + + if ((get_debug_fast_bond_flag() != 0) && (g_ForceBondMoveOffset.f[0] == 0.0f) && (g_ForceBondMoveOffset.f[2] == 0.0f)) { sp40 = 1.388889f; } else { - sp40 = 0.2777778f; + sp40 = 0.27777779f; } - - new_field_7c = save_field_7C - (g_GlobalTimerDelta * sp40); - new_field_70 = g_CurrentPlayer->field_70 + (g_GlobalTimerDelta * (save_field_7C + new_field_7c) * 0.5f); + + ftemp2 = new_field_7c - (g_GlobalTimerDelta * sp40); + new_field_70 += (g_GlobalTimerDelta * (new_field_7c + ftemp2) * 0.5f); + new_field_7c = ftemp2; if (new_field_70 < g_CurrentPlayer->stanHeight) { - f32 f_7c_square = (g_CurrentPlayer->field_7C * g_CurrentPlayer->field_7C); - f32 td = (g_CurrentPlayer->field_70 - g_CurrentPlayer->stanHeight); - f32 td2 = (2.0f * td * 0.2777778f); - f32 tsq = f_7c_square + ((td2 / 60.0f) * 60.0f); - new_field_7c = -sqrtf(tsq); - new_field_70 = g_CurrentPlayer->stanHeight; + new_field_7c = -sqrtf((g_CurrentPlayer->field_7C * g_CurrentPlayer->field_7C) + (((2.0f * (g_CurrentPlayer->field_70 - g_CurrentPlayer->stanHeight) * 0.27777779f) / 60.0f) * 60.0f)); + if (g_CurrentPlayer->field_2A6C != 0) { @@ -16339,22 +8730,19 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) g_CurrentPlayer->field_70 = new_field_70; g_CurrentPlayer->field_7C = new_field_7c; - save_field_7C = g_CurrentPlayer->field_7C; } - // end very wrong section - - if ((save_field_7C < 0.0f) && (g_CurrentPlayer->field_70 <= g_CurrentPlayer->stanHeight)) + if ((g_CurrentPlayer->field_7C < 0.0f) && (g_CurrentPlayer->field_70 <= g_CurrentPlayer->stanHeight)) { - if (save_field_7C < -13.333333f) + if (g_CurrentPlayer->field_7C < -13.333333f) { - g_CurrentPlayer->field_8C = 0xF; - g_CurrentPlayer->field_90 = -90.0f; + g_CurrentPlayer->field_8C = CLIPPING_FIELD8C_VALUE; + g_CurrentPlayer->vertical_bounce_adjust = -90.0f; } - else if (save_field_7C < -5.0f) + else if (g_CurrentPlayer->field_7C < -5.0f) { - g_CurrentPlayer->field_8C = 0xF; - g_CurrentPlayer->field_90 = ((-5.0f - g_CurrentPlayer->field_7C) * -90.0f) / 8.333333f; + g_CurrentPlayer->field_8C = CLIPPING_FIELD8C_VALUE; + g_CurrentPlayer->vertical_bounce_adjust = ((-5.0f - g_CurrentPlayer->field_7C) * -90.0f) / 8.333333f; } g_CurrentPlayer->field_7C = 0.0f; @@ -16362,7 +8750,11 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) if (g_CurrentPlayer->field_2A6C != 0) { - if ((g_CurrentPlayer->field_70 + bondviewGetPlayerDuckingHeightRelated(g_CurrentPlayer)) < stanGetPositionYValue(g_CurrentPlayer->field_488.current_tile_ptr, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2])) + if (g_CurrentPlayer->field_70 + bondviewGetPlayerDuckingHeightRelated(g_CurrentPlayer) + < stanGetPositionYValue( + g_CurrentPlayer->field_488.current_tile_ptr, + g_CurrentPlayer->field_488.collision_position.f[0], + g_CurrentPlayer->field_488.collision_position.f[2])) { g_CurrentPlayer->field_2A6C = 0; g_CurrentPlayer->field_488.current_tile_ptr = g_CurrentPlayer->field_2A70; @@ -16375,979 +8767,27 @@ void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset) { if (g_CurrentPlayer->field_8C > 0) { - g_CurrentPlayer->field_84 = (g_CurrentPlayer->field_84 * 0.8f) + g_CurrentPlayer->field_90; + g_CurrentPlayer->field_84 = (g_CurrentPlayer->field_84 * CLIPPING_CLOCK_FACTOR) + g_CurrentPlayer->vertical_bounce_adjust; g_CurrentPlayer->field_8C += -1; } else { - if (g_CurrentPlayer->field_90 < 0.0f) + if (g_CurrentPlayer->vertical_bounce_adjust < 0.0f) { - g_CurrentPlayer->field_90 -= -4.5f; - if (0.0f <= g_CurrentPlayer->field_90) + g_CurrentPlayer->vertical_bounce_adjust -= CLIPPING_FIELD90_VALUE; + + if (0.0f <= g_CurrentPlayer->vertical_bounce_adjust) { - g_CurrentPlayer->field_90 = 0.0f; + g_CurrentPlayer->vertical_bounce_adjust = 0.0f; } } - g_CurrentPlayer->field_84 = (g_CurrentPlayer->field_84 * 0.8f) + g_CurrentPlayer->field_90; + g_CurrentPlayer->field_84 = (g_CurrentPlayer->field_84 * CLIPPING_CLOCK_FACTOR) + g_CurrentPlayer->vertical_bounce_adjust; } } - g_CurrentPlayer->field_88 = g_CurrentPlayer->field_84 * 0.19999999f; + g_CurrentPlayer->field_88 = g_CurrentPlayer->field_84 * CLIPPING_FIELD88_FACTOR; } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_800550DC -.word 0x3e2e147c /*0.17000002*/ -glabel D_800550E0 -.word 0x3f547ae1 /*0.82999998*/ -glabel D_800550E4 -.word 0x3e2e147c /*0.17000002*/ -glabel D_800550E8 -.word 0x3f547ae1 /*0.82999998*/ -glabel D_800550EC -.word 0x3fb1c71d /*1.388889*/ -glabel player_gravity_modifier -.word 0x3e8e38e4 /*0.27777779*/ -glabel player_view_gravity_modifier -.word 0x3e8e38e4 /*0.27777779*/ -glabel D_800550F8 -.word 0xc1555555 /*-13.333333*/ -glabel D_800550FC -.word 0x41055555 /*8.333333*/ -glabel D_80055100 -.word 0x3f4ccccd /*0.80000001*/ -glabel D_80055104 -.word 0x3e4ccccc /*0.19999999*/ -.text -glabel bondviewUpdatePlayerClipping -/* 0B5928 7F080DF8 3C0E8003 */ lui $t6, %hi(in_tank_flag) -/* 0B592C 7F080DFC 8DCE6448 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B5930 7F080E00 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0B5934 7F080E04 44856000 */ mtc1 $a1, $f12 -/* 0B5938 7F080E08 24010001 */ li $at, 1 -/* 0B593C 7F080E0C AFBF0024 */ sw $ra, 0x24($sp) -/* 0B5940 7F080E10 15C1002C */ bne $t6, $at, .L7F080EC4 -/* 0B5944 7F080E14 AFB00020 */ sw $s0, 0x20($sp) -/* 0B5948 7F080E18 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B594C 7F080E1C 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5950 7F080E20 8D100000 */ lw $s0, ($t0) -/* 0B5954 7F080E24 8E040488 */ lw $a0, 0x488($s0) -/* 0B5958 7F080E28 8E05048C */ lw $a1, 0x48c($s0) -/* 0B595C 7F080E2C 0FC20358 */ jal bondviewYPositionRelated -/* 0B5960 7F080E30 8E060494 */ lw $a2, 0x494($s0) -/* 0B5964 7F080E34 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5968 7F080E38 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B596C 7F080E3C 8D0F0000 */ lw $t7, ($t0) -/* 0B5970 7F080E40 3C018005 */ lui $at, %hi(D_800550DC) -/* 0B5974 7F080E44 C42250DC */ lwc1 $f2, %lo(D_800550DC)($at) -/* 0B5978 7F080E48 E5E00074 */ swc1 $f0, 0x74($t7) -/* 0B597C 7F080E4C 8D100000 */ lw $s0, ($t0) -/* 0B5980 7F080E50 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5984 7F080E54 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5988 7F080E58 C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B598C 7F080E5C 3C018005 */ lui $at, %hi(D_800550E0) -/* 0B5990 7F080E60 00001825 */ move $v1, $zero -/* 0B5994 7F080E64 46022183 */ div.s $f6, $f4, $f2 -/* 0B5998 7F080E68 E606006C */ swc1 $f6, 0x6c($s0) -/* 0B599C 7F080E6C 8CF80000 */ lw $t8, ($a3) -/* 0B59A0 7F080E70 5B00000F */ blezl $t8, .L7F080EB0 -/* 0B59A4 7F080E74 8D100000 */ lw $s0, ($t0) -/* 0B59A8 7F080E78 C42050E0 */ lwc1 $f0, %lo(D_800550E0)($at) -/* 0B59AC 7F080E7C 8D100000 */ lw $s0, ($t0) -.L7F080E80: -/* 0B59B0 7F080E80 24630001 */ addiu $v1, $v1, 1 -/* 0B59B4 7F080E84 C608006C */ lwc1 $f8, 0x6c($s0) -/* 0B59B8 7F080E88 C6040074 */ lwc1 $f4, 0x74($s0) -/* 0B59BC 7F080E8C 46004282 */ mul.s $f10, $f8, $f0 -/* 0B59C0 7F080E90 46045180 */ add.s $f6, $f10, $f4 -/* 0B59C4 7F080E94 E606006C */ swc1 $f6, 0x6c($s0) -/* 0B59C8 7F080E98 8CF90000 */ lw $t9, ($a3) -/* 0B59CC 7F080E9C 0079082A */ slt $at, $v1, $t9 -/* 0B59D0 7F080EA0 5420FFF7 */ bnezl $at, .L7F080E80 -/* 0B59D4 7F080EA4 8D100000 */ lw $s0, ($t0) -/* 0B59D8 7F080EA8 00001825 */ move $v1, $zero -/* 0B59DC 7F080EAC 8D100000 */ lw $s0, ($t0) -.L7F080EB0: -/* 0B59E0 7F080EB0 44808000 */ mtc1 $zero, $f16 -/* 0B59E4 7F080EB4 C608006C */ lwc1 $f8, 0x6c($s0) -/* 0B59E8 7F080EB8 46024282 */ mul.s $f10, $f8, $f2 -/* 0B59EC 7F080EBC 10000136 */ b .L7F081398 -/* 0B59F0 7F080EC0 E60A0070 */ swc1 $f10, 0x70($s0) -.L7F080EC4: -/* 0B59F4 7F080EC4 10800016 */ beqz $a0, .L7F080F20 -/* 0B59F8 7F080EC8 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B59FC 7F080ECC 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5A00 7F080ED0 8D100000 */ lw $s0, ($t0) -/* 0B5A04 7F080ED4 C6040074 */ lwc1 $f4, 0x74($s0) -/* 0B5A08 7F080ED8 460C2180 */ add.s $f6, $f4, $f12 -/* 0B5A0C 7F080EDC E6060074 */ swc1 $f6, 0x74($s0) -/* 0B5A10 7F080EE0 8D100000 */ lw $s0, ($t0) -/* 0B5A14 7F080EE4 8E040488 */ lw $a0, 0x488($s0) -/* 0B5A18 7F080EE8 8E05048C */ lw $a1, 0x48c($s0) -/* 0B5A1C 7F080EEC 0FC20358 */ jal bondviewYPositionRelated -/* 0B5A20 7F080EF0 8E060494 */ lw $a2, 0x494($s0) -/* 0B5A24 7F080EF4 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5A28 7F080EF8 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5A2C 7F080EFC 8D100000 */ lw $s0, ($t0) -/* 0B5A30 7F080F00 C6080074 */ lwc1 $f8, 0x74($s0) -/* 0B5A34 7F080F04 4600403C */ c.lt.s $f8, $f0 -/* 0B5A38 7F080F08 00000000 */ nop -/* 0B5A3C 7F080F0C 45020034 */ bc1fl .L7F080FE0 -/* 0B5A40 7F080F10 8E0C2A6C */ lw $t4, 0x2a6c($s0) -/* 0B5A44 7F080F14 E6000074 */ swc1 $f0, 0x74($s0) -/* 0B5A48 7F080F18 10000030 */ b .L7F080FDC -/* 0B5A4C 7F080F1C 8D100000 */ lw $s0, ($t0) -.L7F080F20: -/* 0B5A50 7F080F20 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5A54 7F080F24 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5A58 7F080F28 8D100000 */ lw $s0, ($t0) -/* 0B5A5C 7F080F2C 27A5005C */ addiu $a1, $sp, 0x5c -/* 0B5A60 7F080F30 27A60058 */ addiu $a2, $sp, 0x58 -/* 0B5A64 7F080F34 8E090488 */ lw $t1, 0x488($s0) -/* 0B5A68 7F080F38 27A70054 */ addiu $a3, $sp, 0x54 -/* 0B5A6C 7F080F3C AFA90060 */ sw $t1, 0x60($sp) -/* 0B5A70 7F080F40 0FC2289D */ jal bondviewCollisionRadiusRelated -/* 0B5A74 7F080F44 8E0400A8 */ lw $a0, 0xa8($s0) -/* 0B5A78 7F080F48 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5A7C 7F080F4C 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5A80 7F080F50 8D100000 */ lw $s0, ($t0) -/* 0B5A84 7F080F54 8E040488 */ lw $a0, 0x488($s0) -/* 0B5A88 7F080F58 8E05048C */ lw $a1, 0x48c($s0) -/* 0B5A8C 7F080F5C 0FC20358 */ jal bondviewYPositionRelated -/* 0B5A90 7F080F60 8E060494 */ lw $a2, 0x494($s0) -/* 0B5A94 7F080F64 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5A98 7F080F68 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5A9C 7F080F6C 8D040000 */ lw $a0, ($t0) -/* 0B5AA0 7F080F70 0FC225E0 */ jal bondviewGetPlayerDuckingHeightRelated -/* 0B5AA4 7F080F74 E7A00064 */ swc1 $f0, 0x64($sp) -/* 0B5AA8 7F080F78 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5AAC 7F080F7C C7A20064 */ lwc1 $f2, 0x64($sp) -/* 0B5AB0 7F080F80 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5AB4 7F080F84 8D100000 */ lw $s0, ($t0) -/* 0B5AB8 7F080F88 46020280 */ add.s $f10, $f0, $f2 -/* 0B5ABC 7F080F8C 27A40060 */ addiu $a0, $sp, 0x60 -/* 0B5AC0 7F080F90 8E05048C */ lw $a1, 0x48c($s0) -/* 0B5AC4 7F080F94 8E060494 */ lw $a2, 0x494($s0) -/* 0B5AC8 7F080F98 E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0B5ACC 7F080F9C 0FC2C9AE */ jal sub_GAME_7F0B26B8 -/* 0B5AD0 7F080FA0 8FA7005C */ lw $a3, 0x5c($sp) -/* 0B5AD4 7F080FA4 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5AD8 7F080FA8 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5ADC 7F080FAC 04400008 */ bltz $v0, .L7F080FD0 -/* 0B5AE0 7F080FB0 C7A20064 */ lwc1 $f2, 0x64($sp) -/* 0B5AE4 7F080FB4 8D0A0000 */ lw $t2, ($t0) -/* 0B5AE8 7F080FB8 C5400074 */ lwc1 $f0, 0x74($t2) -/* 0B5AEC 7F080FBC 4600103C */ c.lt.s $f2, $f0 -/* 0B5AF0 7F080FC0 00000000 */ nop -/* 0B5AF4 7F080FC4 45020003 */ bc1fl .L7F080FD4 -/* 0B5AF8 7F080FC8 8D0B0000 */ lw $t3, ($t0) -/* 0B5AFC 7F080FCC 46000086 */ mov.s $f2, $f0 -.L7F080FD0: -/* 0B5B00 7F080FD0 8D0B0000 */ lw $t3, ($t0) -.L7F080FD4: -/* 0B5B04 7F080FD4 E5620074 */ swc1 $f2, 0x74($t3) -/* 0B5B08 7F080FD8 8D100000 */ lw $s0, ($t0) -.L7F080FDC: -/* 0B5B0C 7F080FDC 8E0C2A6C */ lw $t4, 0x2a6c($s0) -.L7F080FE0: -/* 0B5B10 7F080FE0 44808000 */ mtc1 $zero, $f16 -/* 0B5B14 7F080FE4 5180000F */ beql $t4, $zero, .L7F081024 -/* 0B5B18 7F080FE8 C608007C */ lwc1 $f8, 0x7c($s0) -/* 0B5B1C 7F080FEC C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B5B20 7F080FF0 C6060074 */ lwc1 $f6, 0x74($s0) -/* 0B5B24 7F080FF4 4606203C */ c.lt.s $f4, $f6 -/* 0B5B28 7F080FF8 00000000 */ nop -/* 0B5B2C 7F080FFC 45020009 */ bc1fl .L7F081024 -/* 0B5B30 7F081000 C608007C */ lwc1 $f8, 0x7c($s0) -/* 0B5B34 7F081004 AE002A6C */ sw $zero, 0x2a6c($s0) -/* 0B5B38 7F081008 8D100000 */ lw $s0, ($t0) -/* 0B5B3C 7F08100C 8E0D2A70 */ lw $t5, 0x2a70($s0) -/* 0B5B40 7F081010 AE0D0488 */ sw $t5, 0x488($s0) -/* 0B5B44 7F081014 8D0E0000 */ lw $t6, ($t0) -/* 0B5B48 7F081018 ADC02A70 */ sw $zero, 0x2a70($t6) -/* 0B5B4C 7F08101C 8D100000 */ lw $s0, ($t0) -/* 0B5B50 7F081020 C608007C */ lwc1 $f8, 0x7c($s0) -.L7F081024: -/* 0B5B54 7F081024 C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B5B58 7F081028 4608803E */ c.le.s $f16, $f8 -/* 0B5B5C 7F08102C 00000000 */ nop -/* 0B5B60 7F081030 45010005 */ bc1t .L7F081048 -/* 0B5B64 7F081034 00000000 */ nop -/* 0B5B68 7F081038 C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B5B6C 7F08103C 4600603C */ c.lt.s $f12, $f0 -/* 0B5B70 7F081040 00000000 */ nop -/* 0B5B74 7F081044 45000024 */ bc1f .L7F0810D8 -.L7F081048: -/* 0B5B78 7F081048 3C018005 */ lui $at, %hi(D_800550E4) -/* 0B5B7C 7F08104C C42250E4 */ lwc1 $f2, %lo(D_800550E4)($at) -/* 0B5B80 7F081050 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5B84 7F081054 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5B88 7F081058 46026283 */ div.s $f10, $f12, $f2 -/* 0B5B8C 7F08105C 3C018005 */ lui $at, %hi(D_800550E8) -/* 0B5B90 7F081060 00001825 */ move $v1, $zero -/* 0B5B94 7F081064 E60A006C */ swc1 $f10, 0x6c($s0) -/* 0B5B98 7F081068 8CEF0000 */ lw $t7, ($a3) -/* 0B5B9C 7F08106C 59E0000E */ blezl $t7, .L7F0810A8 -/* 0B5BA0 7F081070 8D100000 */ lw $s0, ($t0) -/* 0B5BA4 7F081074 C42050E8 */ lwc1 $f0, %lo(D_800550E8)($at) -/* 0B5BA8 7F081078 8D100000 */ lw $s0, ($t0) -.L7F08107C: -/* 0B5BAC 7F08107C 24630001 */ addiu $v1, $v1, 1 -/* 0B5BB0 7F081080 C604006C */ lwc1 $f4, 0x6c($s0) -/* 0B5BB4 7F081084 C6080074 */ lwc1 $f8, 0x74($s0) -/* 0B5BB8 7F081088 46002182 */ mul.s $f6, $f4, $f0 -/* 0B5BBC 7F08108C 46083280 */ add.s $f10, $f6, $f8 -/* 0B5BC0 7F081090 E60A006C */ swc1 $f10, 0x6c($s0) -/* 0B5BC4 7F081094 8CF80000 */ lw $t8, ($a3) -/* 0B5BC8 7F081098 0078082A */ slt $at, $v1, $t8 -/* 0B5BCC 7F08109C 5420FFF7 */ bnezl $at, .L7F08107C -/* 0B5BD0 7F0810A0 8D100000 */ lw $s0, ($t0) -/* 0B5BD4 7F0810A4 8D100000 */ lw $s0, ($t0) -.L7F0810A8: -/* 0B5BD8 7F0810A8 C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B5BDC 7F0810AC C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B5BE0 7F0810B0 4600603C */ c.lt.s $f12, $f0 -/* 0B5BE4 7F0810B4 00000000 */ nop -/* 0B5BE8 7F0810B8 45020008 */ bc1fl .L7F0810DC -/* 0B5BEC 7F0810BC 460C003C */ c.lt.s $f0, $f12 -/* 0B5BF0 7F0810C0 C604006C */ lwc1 $f4, 0x6c($s0) -/* 0B5BF4 7F0810C4 46022182 */ mul.s $f6, $f4, $f2 -/* 0B5BF8 7F0810C8 E6060070 */ swc1 $f6, 0x70($s0) -/* 0B5BFC 7F0810CC 8D100000 */ lw $s0, ($t0) -/* 0B5C00 7F0810D0 C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B5C04 7F0810D4 C6000074 */ lwc1 $f0, 0x74($s0) -.L7F0810D8: -/* 0B5C08 7F0810D8 460C003C */ c.lt.s $f0, $f12 -.L7F0810DC: -/* 0B5C0C 7F0810DC 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5C10 7F0810E0 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5C14 7F0810E4 00001825 */ move $v1, $zero -/* 0B5C18 7F0810E8 4500005D */ bc1f .L7F081260 -/* 0B5C1C 7F0810EC C602007C */ lwc1 $f2, 0x7c($s0) -/* 0B5C20 7F0810F0 AFA0006C */ sw $zero, 0x6c($sp) -/* 0B5C24 7F0810F4 E7A20048 */ swc1 $f2, 0x48($sp) -/* 0B5C28 7F0810F8 0FC24406 */ jal get_debug_fast_bond_flag -/* 0B5C2C 7F0810FC E7AC004C */ swc1 $f12, 0x4c($sp) -/* 0B5C30 7F081100 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5C34 7F081104 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5C38 7F081108 44808000 */ mtc1 $zero, $f16 -/* 0B5C3C 7F08110C 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5C40 7F081110 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5C44 7F081114 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B5C48 7F081118 C7AE0048 */ lwc1 $f14, 0x48($sp) -/* 0B5C4C 7F08111C 10400011 */ beqz $v0, .L7F081164 -/* 0B5C50 7F081120 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 0B5C54 7F081124 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079990) -/* 0B5C58 7F081128 24429990 */ addiu $v0, %lo(flt_CODE_bss_80079990) # addiu $v0, $v0, -0x6670 -/* 0B5C5C 7F08112C C4480000 */ lwc1 $f8, ($v0) -/* 0B5C60 7F081130 46088032 */ c.eq.s $f16, $f8 -/* 0B5C64 7F081134 00000000 */ nop -/* 0B5C68 7F081138 4500000A */ bc1f .L7F081164 -/* 0B5C6C 7F08113C 00000000 */ nop -/* 0B5C70 7F081140 C44A0008 */ lwc1 $f10, 8($v0) -/* 0B5C74 7F081144 3C018005 */ lui $at, %hi(D_800550EC) -/* 0B5C78 7F081148 460A8032 */ c.eq.s $f16, $f10 -/* 0B5C7C 7F08114C 00000000 */ nop -/* 0B5C80 7F081150 45000004 */ bc1f .L7F081164 -/* 0B5C84 7F081154 00000000 */ nop -/* 0B5C88 7F081158 C42450EC */ lwc1 $f4, %lo(D_800550EC)($at) -/* 0B5C8C 7F08115C 10000004 */ b .L7F081170 -/* 0B5C90 7F081160 E7A40040 */ swc1 $f4, 0x40($sp) -.L7F081164: -/* 0B5C94 7F081164 3C018005 */ lui $at, %hi(player_gravity_modifier) -/* 0B5C98 7F081168 C42650F0 */ lwc1 $f6, %lo(player_gravity_modifier)($at) -/* 0B5C9C 7F08116C E7A60040 */ swc1 $f6, 0x40($sp) -.L7F081170: -/* 0B5CA0 7F081170 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B5CA4 7F081174 C42C8378 */ lwc1 $f12, %lo(g_GlobalTimerDelta)($at) -/* 0B5CA8 7F081178 C7A80040 */ lwc1 $f8, 0x40($sp) -/* 0B5CAC 7F08117C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B5CB0 7F081180 8D100000 */ lw $s0, ($t0) -/* 0B5CB4 7F081184 46086282 */ mul.s $f10, $f12, $f8 -/* 0B5CB8 7F081188 44814000 */ mtc1 $at, $f8 -/* 0B5CBC 7F08118C C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B5CC0 7F081190 460A7081 */ sub.s $f2, $f14, $f10 -/* 0B5CC4 7F081194 46027100 */ add.s $f4, $f14, $f2 -/* 0B5CC8 7F081198 46001386 */ mov.s $f14, $f2 -/* 0B5CCC 7F08119C 46046182 */ mul.s $f6, $f12, $f4 -/* 0B5CD0 7F0811A0 00000000 */ nop -/* 0B5CD4 7F0811A4 46083282 */ mul.s $f10, $f6, $f8 -/* 0B5CD8 7F0811A8 460A9480 */ add.s $f18, $f18, $f10 -/* 0B5CDC 7F0811AC 4600903C */ c.lt.s $f18, $f0 -/* 0B5CE0 7F0811B0 00000000 */ nop -/* 0B5CE4 7F0811B4 45000025 */ bc1f .L7F08124C -/* 0B5CE8 7F0811B8 00000000 */ nop -/* 0B5CEC 7F0811BC C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B5CF0 7F0811C0 3C018005 */ lui $at, %hi(player_view_gravity_modifier) -/* 0B5CF4 7F0811C4 C42850F4 */ lwc1 $f8, %lo(player_view_gravity_modifier)($at) -/* 0B5CF8 7F0811C8 46002381 */ sub.s $f14, $f4, $f0 -/* 0B5CFC 7F0811CC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B5D00 7F0811D0 44812000 */ mtc1 $at, $f4 -/* 0B5D04 7F0811D4 C602007C */ lwc1 $f2, 0x7c($s0) -/* 0B5D08 7F0811D8 460E7180 */ add.s $f6, $f14, $f14 -/* 0B5D0C 7F0811DC E7A0004C */ swc1 $f0, 0x4c($sp) -/* 0B5D10 7F0811E0 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B5D14 7F0811E4 46083282 */ mul.s $f10, $f6, $f8 -/* 0B5D18 7F0811E8 44814000 */ mtc1 $at, $f8 -/* 0B5D1C 7F0811EC 46045183 */ div.s $f6, $f10, $f4 -/* 0B5D20 7F0811F0 46083282 */ mul.s $f10, $f6, $f8 -/* 0B5D24 7F0811F4 00000000 */ nop -/* 0B5D28 7F0811F8 46021102 */ mul.s $f4, $f2, $f2 -/* 0B5D2C 7F0811FC 0C007DF8 */ jal sqrtf -/* 0B5D30 7F081200 460A2300 */ add.s $f12, $f4, $f10 -/* 0B5D34 7F081204 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5D38 7F081208 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5D3C 7F08120C 8D100000 */ lw $s0, ($t0) -/* 0B5D40 7F081210 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5D44 7F081214 44808000 */ mtc1 $zero, $f16 -/* 0B5D48 7F081218 8E192A6C */ lw $t9, 0x2a6c($s0) -/* 0B5D4C 7F08121C 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5D50 7F081220 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B5D54 7F081224 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 0B5D58 7F081228 13200008 */ beqz $t9, .L7F08124C -/* 0B5D5C 7F08122C 46000387 */ neg.s $f14, $f0 -/* 0B5D60 7F081230 AE002A6C */ sw $zero, 0x2a6c($s0) -/* 0B5D64 7F081234 8D100000 */ lw $s0, ($t0) -/* 0B5D68 7F081238 8E092A70 */ lw $t1, 0x2a70($s0) -/* 0B5D6C 7F08123C AE090488 */ sw $t1, 0x488($s0) -/* 0B5D70 7F081240 8D0A0000 */ lw $t2, ($t0) -/* 0B5D74 7F081244 AD402A70 */ sw $zero, 0x2a70($t2) -/* 0B5D78 7F081248 8D100000 */ lw $s0, ($t0) -.L7F08124C: -/* 0B5D7C 7F08124C E6120070 */ swc1 $f18, 0x70($s0) -/* 0B5D80 7F081250 8D0B0000 */ lw $t3, ($t0) -/* 0B5D84 7F081254 E56E007C */ swc1 $f14, 0x7c($t3) -/* 0B5D88 7F081258 8D100000 */ lw $s0, ($t0) -/* 0B5D8C 7F08125C C602007C */ lwc1 $f2, 0x7c($s0) -.L7F081260: -/* 0B5D90 7F081260 4610103C */ c.lt.s $f2, $f16 -/* 0B5D94 7F081264 00000000 */ nop -/* 0B5D98 7F081268 4502002B */ bc1fl .L7F081318 -/* 0B5D9C 7F08126C 8E0F2A6C */ lw $t7, 0x2a6c($s0) -/* 0B5DA0 7F081270 C6060074 */ lwc1 $f6, 0x74($s0) -/* 0B5DA4 7F081274 C6080070 */ lwc1 $f8, 0x70($s0) -/* 0B5DA8 7F081278 3C018005 */ lui $at, %hi(D_800550F8) -/* 0B5DAC 7F08127C 4606403E */ c.le.s $f8, $f6 -/* 0B5DB0 7F081280 00000000 */ nop -/* 0B5DB4 7F081284 45020024 */ bc1fl .L7F081318 -/* 0B5DB8 7F081288 8E0F2A6C */ lw $t7, 0x2a6c($s0) -/* 0B5DBC 7F08128C C42450F8 */ lwc1 $f4, %lo(D_800550F8)($at) -/* 0B5DC0 7F081290 240C000F */ li $t4, 15 -/* 0B5DC4 7F081294 3C01C0A0 */ li $at, 0xC0A00000 # -5.000000 -/* 0B5DC8 7F081298 4604103C */ c.lt.s $f2, $f4 -/* 0B5DCC 7F08129C 00000000 */ nop -/* 0B5DD0 7F0812A0 45020009 */ bc1fl .L7F0812C8 -/* 0B5DD4 7F0812A4 44810000 */ mtc1 $at, $f0 -/* 0B5DD8 7F0812A8 AE0C008C */ sw $t4, 0x8c($s0) -/* 0B5DDC 7F0812AC 3C01C2B4 */ li $at, 0xC2B40000 # -90.000000 -/* 0B5DE0 7F0812B0 44815000 */ mtc1 $at, $f10 -/* 0B5DE4 7F0812B4 8D0D0000 */ lw $t5, ($t0) -/* 0B5DE8 7F0812B8 E5AA0090 */ swc1 $f10, 0x90($t5) -/* 0B5DEC 7F0812BC 10000013 */ b .L7F08130C -/* 0B5DF0 7F0812C0 8D100000 */ lw $s0, ($t0) -/* 0B5DF4 7F0812C4 44810000 */ mtc1 $at, $f0 -.L7F0812C8: -/* 0B5DF8 7F0812C8 240E000F */ li $t6, 15 -/* 0B5DFC 7F0812CC 4600103C */ c.lt.s $f2, $f0 -/* 0B5E00 7F0812D0 00000000 */ nop -/* 0B5E04 7F0812D4 4502000E */ bc1fl .L7F081310 -/* 0B5E08 7F0812D8 E610007C */ swc1 $f16, 0x7c($s0) -/* 0B5E0C 7F0812DC AE0E008C */ sw $t6, 0x8c($s0) -/* 0B5E10 7F0812E0 8D100000 */ lw $s0, ($t0) -/* 0B5E14 7F0812E4 3C01C2B4 */ li $at, 0xC2B40000 # -90.000000 -/* 0B5E18 7F0812E8 44812000 */ mtc1 $at, $f4 -/* 0B5E1C 7F0812EC C606007C */ lwc1 $f6, 0x7c($s0) -/* 0B5E20 7F0812F0 3C018005 */ lui $at, %hi(D_800550FC) -/* 0B5E24 7F0812F4 46060201 */ sub.s $f8, $f0, $f6 -/* 0B5E28 7F0812F8 C42650FC */ lwc1 $f6, %lo(D_800550FC)($at) -/* 0B5E2C 7F0812FC 46044282 */ mul.s $f10, $f8, $f4 -/* 0B5E30 7F081300 46065203 */ div.s $f8, $f10, $f6 -/* 0B5E34 7F081304 E6080090 */ swc1 $f8, 0x90($s0) -/* 0B5E38 7F081308 8D100000 */ lw $s0, ($t0) -.L7F08130C: -/* 0B5E3C 7F08130C E610007C */ swc1 $f16, 0x7c($s0) -.L7F081310: -/* 0B5E40 7F081310 8D100000 */ lw $s0, ($t0) -/* 0B5E44 7F081314 8E0F2A6C */ lw $t7, 0x2a6c($s0) -.L7F081318: -/* 0B5E48 7F081318 11E0001F */ beqz $t7, .L7F081398 -/* 0B5E4C 7F08131C 02002025 */ move $a0, $s0 -/* 0B5E50 7F081320 0FC225E0 */ jal bondviewGetPlayerDuckingHeightRelated -/* 0B5E54 7F081324 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B5E58 7F081328 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5E5C 7F08132C 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5E60 7F081330 8D100000 */ lw $s0, ($t0) -/* 0B5E64 7F081334 E7A0003C */ swc1 $f0, 0x3c($sp) -/* 0B5E68 7F081338 8E060494 */ lw $a2, 0x494($s0) -/* 0B5E6C 7F08133C 8E05048C */ lw $a1, 0x48c($s0) -/* 0B5E70 7F081340 0FC2CA5C */ jal stanGetPositionYValue -/* 0B5E74 7F081344 8E040488 */ lw $a0, 0x488($s0) -/* 0B5E78 7F081348 3C088008 */ lui $t0, %hi(g_CurrentPlayer) -/* 0B5E7C 7F08134C 2508A0B0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x5f50 -/* 0B5E80 7F081350 8D100000 */ lw $s0, ($t0) -/* 0B5E84 7F081354 C7AA003C */ lwc1 $f10, 0x3c($sp) -/* 0B5E88 7F081358 3C078005 */ lui $a3, %hi(g_ClockTimer) -/* 0B5E8C 7F08135C C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B5E90 7F081360 44808000 */ mtc1 $zero, $f16 -/* 0B5E94 7F081364 24E78374 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, -0x7c8c -/* 0B5E98 7F081368 460A2180 */ add.s $f6, $f4, $f10 -/* 0B5E9C 7F08136C 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B5EA0 7F081370 4600303C */ c.lt.s $f6, $f0 -/* 0B5EA4 7F081374 00000000 */ nop -/* 0B5EA8 7F081378 45020008 */ bc1fl .L7F08139C -/* 0B5EAC 7F08137C 8CE90000 */ lw $t1, ($a3) -/* 0B5EB0 7F081380 AE002A6C */ sw $zero, 0x2a6c($s0) -/* 0B5EB4 7F081384 8D100000 */ lw $s0, ($t0) -/* 0B5EB8 7F081388 8E182A70 */ lw $t8, 0x2a70($s0) -/* 0B5EBC 7F08138C AE180488 */ sw $t8, 0x488($s0) -/* 0B5EC0 7F081390 8D190000 */ lw $t9, ($t0) -/* 0B5EC4 7F081394 AF202A70 */ sw $zero, 0x2a70($t9) -.L7F081398: -/* 0B5EC8 7F081398 8CE90000 */ lw $t1, ($a3) -.L7F08139C: -/* 0B5ECC 7F08139C 1920002B */ blez $t1, .L7F08144C -/* 0B5ED0 7F0813A0 3C01C090 */ li $at, 0xC0900000 # -4.500000 -/* 0B5ED4 7F0813A4 44816000 */ mtc1 $at, $f12 -/* 0B5ED8 7F0813A8 3C018005 */ lui $at, %hi(D_80055100) -/* 0B5EDC 7F0813AC C4225100 */ lwc1 $f2, %lo(D_80055100)($at) -/* 0B5EE0 7F0813B0 8D100000 */ lw $s0, ($t0) -.L7F0813B4: -/* 0B5EE4 7F0813B4 8E0A008C */ lw $t2, 0x8c($s0) -/* 0B5EE8 7F0813B8 5940000C */ blezl $t2, .L7F0813EC -/* 0B5EEC 7F0813BC C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B5EF0 7F0813C0 C6080084 */ lwc1 $f8, 0x84($s0) -/* 0B5EF4 7F0813C4 C60A0090 */ lwc1 $f10, 0x90($s0) -/* 0B5EF8 7F0813C8 46024102 */ mul.s $f4, $f8, $f2 -/* 0B5EFC 7F0813CC 460A2180 */ add.s $f6, $f4, $f10 -/* 0B5F00 7F0813D0 E6060084 */ swc1 $f6, 0x84($s0) -/* 0B5F04 7F0813D4 8D100000 */ lw $s0, ($t0) -/* 0B5F08 7F0813D8 8E0B008C */ lw $t3, 0x8c($s0) -/* 0B5F0C 7F0813DC 256CFFFF */ addiu $t4, $t3, -1 -/* 0B5F10 7F0813E0 10000015 */ b .L7F081438 -/* 0B5F14 7F0813E4 AE0C008C */ sw $t4, 0x8c($s0) -/* 0B5F18 7F0813E8 C6000090 */ lwc1 $f0, 0x90($s0) -.L7F0813EC: -/* 0B5F1C 7F0813EC 4610003C */ c.lt.s $f0, $f16 -/* 0B5F20 7F0813F0 00000000 */ nop -/* 0B5F24 7F0813F4 4502000D */ bc1fl .L7F08142C -/* 0B5F28 7F0813F8 C6040084 */ lwc1 $f4, 0x84($s0) -/* 0B5F2C 7F0813FC 460C0201 */ sub.s $f8, $f0, $f12 -/* 0B5F30 7F081400 E6080090 */ swc1 $f8, 0x90($s0) -/* 0B5F34 7F081404 8D100000 */ lw $s0, ($t0) -/* 0B5F38 7F081408 C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B5F3C 7F08140C 4600803E */ c.le.s $f16, $f0 -/* 0B5F40 7F081410 00000000 */ nop -/* 0B5F44 7F081414 45020005 */ bc1fl .L7F08142C -/* 0B5F48 7F081418 C6040084 */ lwc1 $f4, 0x84($s0) -/* 0B5F4C 7F08141C E6100090 */ swc1 $f16, 0x90($s0) -/* 0B5F50 7F081420 8D100000 */ lw $s0, ($t0) -/* 0B5F54 7F081424 C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B5F58 7F081428 C6040084 */ lwc1 $f4, 0x84($s0) -.L7F08142C: -/* 0B5F5C 7F08142C 46022282 */ mul.s $f10, $f4, $f2 -/* 0B5F60 7F081430 46005180 */ add.s $f6, $f10, $f0 -/* 0B5F64 7F081434 E6060084 */ swc1 $f6, 0x84($s0) -.L7F081438: -/* 0B5F68 7F081438 8CED0000 */ lw $t5, ($a3) -/* 0B5F6C 7F08143C 24630001 */ addiu $v1, $v1, 1 -/* 0B5F70 7F081440 006D082A */ slt $at, $v1, $t5 -/* 0B5F74 7F081444 5420FFDB */ bnezl $at, .L7F0813B4 -/* 0B5F78 7F081448 8D100000 */ lw $s0, ($t0) -.L7F08144C: -/* 0B5F7C 7F08144C 8D100000 */ lw $s0, ($t0) -/* 0B5F80 7F081450 3C018005 */ lui $at, %hi(D_80055104) -/* 0B5F84 7F081454 C4245104 */ lwc1 $f4, %lo(D_80055104)($at) -/* 0B5F88 7F081458 C6080084 */ lwc1 $f8, 0x84($s0) -/* 0B5F8C 7F08145C 46044282 */ mul.s $f10, $f8, $f4 -/* 0B5F90 7F081460 E60A0088 */ swc1 $f10, 0x88($s0) -/* 0B5F94 7F081464 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B5F98 7F081468 8FB00020 */ lw $s0, 0x20($sp) -/* 0B5F9C 7F08146C 27BD0070 */ addiu $sp, $sp, 0x70 -/* 0B5FA0 7F081470 03E00008 */ jr $ra -/* 0B5FA4 7F081474 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_800550DC -.word 0x3E4D35A8 /* 0.200399994850159 */ -glabel D_800550E0 -.word 0x3F4CB296 /* 0.799600005149841 */ -glabel D_800550E4 -.word 0x3E4D35A8 /* 0.200399994850159 */ -glabel D_800550E8 -.word 0x3F4CB296 /* 0.799600005149841 */ -glabel D_800550EC -.word 0x3fb1c71d /*1.388889*/ -glabel player_gravity_modifier -.word 0x3e8e38e4 /*0.27777779*/ -glabel player_view_gravity_modifier -.word 0x3e8e38e4 /*0.27777779*/ -glabel D_800550F8 -.word 0xc1555555 /*-13.333333*/ -glabel D_800550FC -.word 0x41055555 /*8.333333*/ -glabel D_80055100 -.word 0x3F43DD98 /* 0.765100002288818 */ -glabel D_80055104 -.word 0x3E7089A0 /* 0.234899997711182 */ -.text -glabel bondviewUpdatePlayerClipping -/* 0B388C 7F080E9C 3C0E8003 */ lui $t6, %hi(in_tank_flag) # $t6, 0x8003 -/* 0B3890 7F080EA0 8DCE1998 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B3894 7F080EA4 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0B3898 7F080EA8 44856000 */ mtc1 $a1, $f12 -/* 0B389C 7F080EAC 24010001 */ li $at, 1 -/* 0B38A0 7F080EB0 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B38A4 7F080EB4 15C1002C */ bne $t6, $at, .L7F080F68 -/* 0B38A8 7F080EB8 AFB00020 */ sw $s0, 0x20($sp) -/* 0B38AC 7F080EBC 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B38B0 7F080EC0 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B38B4 7F080EC4 8D100000 */ lw $s0, ($t0) -/* 0B38B8 7F080EC8 8E040488 */ lw $a0, 0x488($s0) -/* 0B38BC 7F080ECC 8E05048C */ lw $a1, 0x48c($s0) -/* 0B38C0 7F080ED0 0FC20381 */ jal bondviewYPositionRelated -/* 0B38C4 7F080ED4 8E060494 */ lw $a2, 0x494($s0) -/* 0B38C8 7F080ED8 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B38CC 7F080EDC 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B38D0 7F080EE0 8D0F0000 */ lw $t7, ($t0) -/* 0B38D4 7F080EE4 3C018005 */ lui $at, %hi(D_800550DC) # $at, 0x8005 -/* 0B38D8 7F080EE8 C422ACAC */ lwc1 $f2, %lo(D_800550DC)($at) -/* 0B38DC 7F080EEC E5E00074 */ swc1 $f0, 0x74($t7) -/* 0B38E0 7F080EF0 8D100000 */ lw $s0, ($t0) -/* 0B38E4 7F080EF4 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B38E8 7F080EF8 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B38EC 7F080EFC C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B38F0 7F080F00 3C018005 */ lui $at, %hi(D_800550E0) # $at, 0x8005 -/* 0B38F4 7F080F04 00001825 */ move $v1, $zero -/* 0B38F8 7F080F08 46022183 */ div.s $f6, $f4, $f2 -/* 0B38FC 7F080F0C E606006C */ swc1 $f6, 0x6c($s0) -/* 0B3900 7F080F10 8CF80000 */ lw $t8, ($a3) -/* 0B3904 7F080F14 5B00000F */ blezl $t8, .L7F080F54 -/* 0B3908 7F080F18 8D100000 */ lw $s0, ($t0) -/* 0B390C 7F080F1C C420ACB0 */ lwc1 $f0, %lo(D_800550E0)($at) -/* 0B3910 7F080F20 8D100000 */ lw $s0, ($t0) -.L7F080F24: -/* 0B3914 7F080F24 24630001 */ addiu $v1, $v1, 1 -/* 0B3918 7F080F28 C608006C */ lwc1 $f8, 0x6c($s0) -/* 0B391C 7F080F2C C6040074 */ lwc1 $f4, 0x74($s0) -/* 0B3920 7F080F30 46004282 */ mul.s $f10, $f8, $f0 -/* 0B3924 7F080F34 46045180 */ add.s $f6, $f10, $f4 -/* 0B3928 7F080F38 E606006C */ swc1 $f6, 0x6c($s0) -/* 0B392C 7F080F3C 8CF90000 */ lw $t9, ($a3) -/* 0B3930 7F080F40 0079082A */ slt $at, $v1, $t9 -/* 0B3934 7F080F44 5420FFF7 */ bnezl $at, .L7F080F24 -/* 0B3938 7F080F48 8D100000 */ lw $s0, ($t0) -/* 0B393C 7F080F4C 00001825 */ move $v1, $zero -/* 0B3940 7F080F50 8D100000 */ lw $s0, ($t0) -.L7F080F54: -/* 0B3944 7F080F54 44808000 */ mtc1 $zero, $f16 -/* 0B3948 7F080F58 C608006C */ lwc1 $f8, 0x6c($s0) -/* 0B394C 7F080F5C 46024282 */ mul.s $f10, $f8, $f2 -/* 0B3950 7F080F60 10000136 */ b .L7F08143C -/* 0B3954 7F080F64 E60A0070 */ swc1 $f10, 0x70($s0) -.L7F080F68: -/* 0B3958 7F080F68 10800016 */ beqz $a0, .L7F080FC4 -/* 0B395C 7F080F6C 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3960 7F080F70 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3964 7F080F74 8D100000 */ lw $s0, ($t0) -/* 0B3968 7F080F78 C6040074 */ lwc1 $f4, 0x74($s0) -/* 0B396C 7F080F7C 460C2180 */ add.s $f6, $f4, $f12 -/* 0B3970 7F080F80 E6060074 */ swc1 $f6, 0x74($s0) -/* 0B3974 7F080F84 8D100000 */ lw $s0, ($t0) -/* 0B3978 7F080F88 8E040488 */ lw $a0, 0x488($s0) -/* 0B397C 7F080F8C 8E05048C */ lw $a1, 0x48c($s0) -/* 0B3980 7F080F90 0FC20381 */ jal bondviewYPositionRelated -/* 0B3984 7F080F94 8E060494 */ lw $a2, 0x494($s0) -/* 0B3988 7F080F98 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B398C 7F080F9C 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3990 7F080FA0 8D100000 */ lw $s0, ($t0) -/* 0B3994 7F080FA4 C6080074 */ lwc1 $f8, 0x74($s0) -/* 0B3998 7F080FA8 4600403C */ c.lt.s $f8, $f0 -/* 0B399C 7F080FAC 00000000 */ nop -/* 0B39A0 7F080FB0 45020034 */ bc1fl .L7F081084 -/* 0B39A4 7F080FB4 8E0C2A64 */ lw $t4, 0x2a64($s0) -/* 0B39A8 7F080FB8 E6000074 */ swc1 $f0, 0x74($s0) -/* 0B39AC 7F080FBC 10000030 */ b .L7F081080 -/* 0B39B0 7F080FC0 8D100000 */ lw $s0, ($t0) -.L7F080FC4: -/* 0B39B4 7F080FC4 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B39B8 7F080FC8 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B39BC 7F080FCC 8D100000 */ lw $s0, ($t0) -/* 0B39C0 7F080FD0 27A5005C */ addiu $a1, $sp, 0x5c -/* 0B39C4 7F080FD4 27A60058 */ addiu $a2, $sp, 0x58 -/* 0B39C8 7F080FD8 8E090488 */ lw $t1, 0x488($s0) -/* 0B39CC 7F080FDC 27A70054 */ addiu $a3, $sp, 0x54 -/* 0B39D0 7F080FE0 AFA90060 */ sw $t1, 0x60($sp) -/* 0B39D4 7F080FE4 0FC22910 */ jal bondviewCollisionRadiusRelated -/* 0B39D8 7F080FE8 8E0400A8 */ lw $a0, 0xa8($s0) -/* 0B39DC 7F080FEC 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B39E0 7F080FF0 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B39E4 7F080FF4 8D100000 */ lw $s0, ($t0) -/* 0B39E8 7F080FF8 8E040488 */ lw $a0, 0x488($s0) -/* 0B39EC 7F080FFC 8E05048C */ lw $a1, 0x48c($s0) -/* 0B39F0 7F081000 0FC20381 */ jal bondviewYPositionRelated -/* 0B39F4 7F081004 8E060494 */ lw $a2, 0x494($s0) -/* 0B39F8 7F081008 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B39FC 7F08100C 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3A00 7F081010 8D040000 */ lw $a0, ($t0) -/* 0B3A04 7F081014 0FC2263A */ jal bondviewGetPlayerDuckingHeightRelated -/* 0B3A08 7F081018 E7A00064 */ swc1 $f0, 0x64($sp) -/* 0B3A0C 7F08101C 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3A10 7F081020 C7A20064 */ lwc1 $f2, 0x64($sp) -/* 0B3A14 7F081024 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3A18 7F081028 8D100000 */ lw $s0, ($t0) -/* 0B3A1C 7F08102C 46020280 */ add.s $f10, $f0, $f2 -/* 0B3A20 7F081030 27A40060 */ addiu $a0, $sp, 0x60 -/* 0B3A24 7F081034 8E05048C */ lw $a1, 0x48c($s0) -/* 0B3A28 7F081038 8E060494 */ lw $a2, 0x494($s0) -/* 0B3A2C 7F08103C E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0B3A30 7F081040 0FC2C65E */ jal sub_GAME_7F0B26B8 -/* 0B3A34 7F081044 8FA7005C */ lw $a3, 0x5c($sp) -/* 0B3A38 7F081048 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3A3C 7F08104C 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3A40 7F081050 04400008 */ bltz $v0, .L7F081074 -/* 0B3A44 7F081054 C7A20064 */ lwc1 $f2, 0x64($sp) -/* 0B3A48 7F081058 8D0A0000 */ lw $t2, ($t0) -/* 0B3A4C 7F08105C C5400074 */ lwc1 $f0, 0x74($t2) -/* 0B3A50 7F081060 4600103C */ c.lt.s $f2, $f0 -/* 0B3A54 7F081064 00000000 */ nop -/* 0B3A58 7F081068 45020003 */ bc1fl .L7F081078 -/* 0B3A5C 7F08106C 8D0B0000 */ lw $t3, ($t0) -/* 0B3A60 7F081070 46000086 */ mov.s $f2, $f0 -.L7F081074: -/* 0B3A64 7F081074 8D0B0000 */ lw $t3, ($t0) -.L7F081078: -/* 0B3A68 7F081078 E5620074 */ swc1 $f2, 0x74($t3) -/* 0B3A6C 7F08107C 8D100000 */ lw $s0, ($t0) -.L7F081080: -/* 0B3A70 7F081080 8E0C2A64 */ lw $t4, 0x2a64($s0) -.L7F081084: -/* 0B3A74 7F081084 44808000 */ mtc1 $zero, $f16 -/* 0B3A78 7F081088 5180000F */ beql $t4, $zero, .L7F0810C8 -/* 0B3A7C 7F08108C C608007C */ lwc1 $f8, 0x7c($s0) -/* 0B3A80 7F081090 C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B3A84 7F081094 C6060074 */ lwc1 $f6, 0x74($s0) -/* 0B3A88 7F081098 4606203C */ c.lt.s $f4, $f6 -/* 0B3A8C 7F08109C 00000000 */ nop -/* 0B3A90 7F0810A0 45020009 */ bc1fl .L7F0810C8 -/* 0B3A94 7F0810A4 C608007C */ lwc1 $f8, 0x7c($s0) -/* 0B3A98 7F0810A8 AE002A64 */ sw $zero, 0x2a64($s0) -/* 0B3A9C 7F0810AC 8D100000 */ lw $s0, ($t0) -/* 0B3AA0 7F0810B0 8E0D2A68 */ lw $t5, 0x2a68($s0) -/* 0B3AA4 7F0810B4 AE0D0488 */ sw $t5, 0x488($s0) -/* 0B3AA8 7F0810B8 8D0E0000 */ lw $t6, ($t0) -/* 0B3AAC 7F0810BC ADC02A68 */ sw $zero, 0x2a68($t6) -/* 0B3AB0 7F0810C0 8D100000 */ lw $s0, ($t0) -/* 0B3AB4 7F0810C4 C608007C */ lwc1 $f8, 0x7c($s0) -.L7F0810C8: -/* 0B3AB8 7F0810C8 C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B3ABC 7F0810CC 4608803E */ c.le.s $f16, $f8 -/* 0B3AC0 7F0810D0 00000000 */ nop -/* 0B3AC4 7F0810D4 45010005 */ bc1t .L7F0810EC -/* 0B3AC8 7F0810D8 00000000 */ nop -/* 0B3ACC 7F0810DC C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B3AD0 7F0810E0 4600603C */ c.lt.s $f12, $f0 -/* 0B3AD4 7F0810E4 00000000 */ nop -/* 0B3AD8 7F0810E8 45000024 */ bc1f .L7F08117C -.L7F0810EC: -/* 0B3ADC 7F0810EC 3C018005 */ lui $at, %hi(D_800550E4) # $at, 0x8005 -/* 0B3AE0 7F0810F0 C422ACB4 */ lwc1 $f2, %lo(D_800550E4)($at) -/* 0B3AE4 7F0810F4 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B3AE8 7F0810F8 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B3AEC 7F0810FC 46026283 */ div.s $f10, $f12, $f2 -/* 0B3AF0 7F081100 3C018005 */ lui $at, %hi(D_800550E8) # $at, 0x8005 -/* 0B3AF4 7F081104 00001825 */ move $v1, $zero -/* 0B3AF8 7F081108 E60A006C */ swc1 $f10, 0x6c($s0) -/* 0B3AFC 7F08110C 8CEF0000 */ lw $t7, ($a3) -/* 0B3B00 7F081110 59E0000E */ blezl $t7, .L7F08114C -/* 0B3B04 7F081114 8D100000 */ lw $s0, ($t0) -/* 0B3B08 7F081118 C420ACB8 */ lwc1 $f0, %lo(D_800550E8)($at) -/* 0B3B0C 7F08111C 8D100000 */ lw $s0, ($t0) -.L7F081120: -/* 0B3B10 7F081120 24630001 */ addiu $v1, $v1, 1 -/* 0B3B14 7F081124 C604006C */ lwc1 $f4, 0x6c($s0) -/* 0B3B18 7F081128 C6080074 */ lwc1 $f8, 0x74($s0) -/* 0B3B1C 7F08112C 46002182 */ mul.s $f6, $f4, $f0 -/* 0B3B20 7F081130 46083280 */ add.s $f10, $f6, $f8 -/* 0B3B24 7F081134 E60A006C */ swc1 $f10, 0x6c($s0) -/* 0B3B28 7F081138 8CF80000 */ lw $t8, ($a3) -/* 0B3B2C 7F08113C 0078082A */ slt $at, $v1, $t8 -/* 0B3B30 7F081140 5420FFF7 */ bnezl $at, .L7F081120 -/* 0B3B34 7F081144 8D100000 */ lw $s0, ($t0) -/* 0B3B38 7F081148 8D100000 */ lw $s0, ($t0) -.L7F08114C: -/* 0B3B3C 7F08114C C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B3B40 7F081150 C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B3B44 7F081154 4600603C */ c.lt.s $f12, $f0 -/* 0B3B48 7F081158 00000000 */ nop -/* 0B3B4C 7F08115C 45020008 */ bc1fl .L7F081180 -/* 0B3B50 7F081160 460C003C */ c.lt.s $f0, $f12 -/* 0B3B54 7F081164 C604006C */ lwc1 $f4, 0x6c($s0) -/* 0B3B58 7F081168 46022182 */ mul.s $f6, $f4, $f2 -/* 0B3B5C 7F08116C E6060070 */ swc1 $f6, 0x70($s0) -/* 0B3B60 7F081170 8D100000 */ lw $s0, ($t0) -/* 0B3B64 7F081174 C60C0070 */ lwc1 $f12, 0x70($s0) -/* 0B3B68 7F081178 C6000074 */ lwc1 $f0, 0x74($s0) -.L7F08117C: -/* 0B3B6C 7F08117C 460C003C */ c.lt.s $f0, $f12 -.L7F081180: -/* 0B3B70 7F081180 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B3B74 7F081184 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B3B78 7F081188 00001825 */ move $v1, $zero -/* 0B3B7C 7F08118C 4500005D */ bc1f .L7F081304 -/* 0B3B80 7F081190 C602007C */ lwc1 $f2, 0x7c($s0) -/* 0B3B84 7F081194 AFA0006C */ sw $zero, 0x6c($sp) -/* 0B3B88 7F081198 E7A20048 */ swc1 $f2, 0x48($sp) -/* 0B3B8C 7F08119C 0FC24134 */ jal get_debug_fast_bond_flag -/* 0B3B90 7F0811A0 E7AC004C */ swc1 $f12, 0x4c($sp) -/* 0B3B94 7F0811A4 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B3B98 7F0811A8 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3B9C 7F0811AC 44808000 */ mtc1 $zero, $f16 -/* 0B3BA0 7F0811B0 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3BA4 7F0811B4 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B3BA8 7F0811B8 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B3BAC 7F0811BC C7AE0048 */ lwc1 $f14, 0x48($sp) -/* 0B3BB0 7F0811C0 10400011 */ beqz $v0, .L7F081208 -/* 0B3BB4 7F0811C4 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 0B3BB8 7F0811C8 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079990) # $v0, 0x8007 -/* 0B3BBC 7F0811CC 24428470 */ addiu $v0, %lo(flt_CODE_bss_80079990) # addiu $v0, $v0, -0x7b90 -/* 0B3BC0 7F0811D0 C4480000 */ lwc1 $f8, ($v0) -/* 0B3BC4 7F0811D4 46088032 */ c.eq.s $f16, $f8 -/* 0B3BC8 7F0811D8 00000000 */ nop -/* 0B3BCC 7F0811DC 4500000A */ bc1f .L7F081208 -/* 0B3BD0 7F0811E0 00000000 */ nop -/* 0B3BD4 7F0811E4 C44A0008 */ lwc1 $f10, 8($v0) -/* 0B3BD8 7F0811E8 3C018005 */ lui $at, %hi(D_800550EC) # $at, 0x8005 -/* 0B3BDC 7F0811EC 460A8032 */ c.eq.s $f16, $f10 -/* 0B3BE0 7F0811F0 00000000 */ nop -/* 0B3BE4 7F0811F4 45000004 */ bc1f .L7F081208 -/* 0B3BE8 7F0811F8 00000000 */ nop -/* 0B3BEC 7F0811FC C424ACBC */ lwc1 $f4, %lo(D_800550EC)($at) -/* 0B3BF0 7F081200 10000004 */ b .L7F081214 -/* 0B3BF4 7F081204 E7A40040 */ swc1 $f4, 0x40($sp) -.L7F081208: -/* 0B3BF8 7F081208 3C018005 */ lui $at, %hi(player_gravity_modifier) # $at, 0x8005 -/* 0B3BFC 7F08120C C426ACC0 */ lwc1 $f6, %lo(player_gravity_modifier)($at) -/* 0B3C00 7F081210 E7A60040 */ swc1 $f6, 0x40($sp) -.L7F081214: -/* 0B3C04 7F081214 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B3C08 7F081218 C42C1004 */ lwc1 $f12, %lo(g_GlobalTimerDelta)($at) -/* 0B3C0C 7F08121C C7A80040 */ lwc1 $f8, 0x40($sp) -/* 0B3C10 7F081220 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B3C14 7F081224 8D100000 */ lw $s0, ($t0) -/* 0B3C18 7F081228 46086282 */ mul.s $f10, $f12, $f8 -/* 0B3C1C 7F08122C 44814000 */ mtc1 $at, $f8 -/* 0B3C20 7F081230 C6000074 */ lwc1 $f0, 0x74($s0) -/* 0B3C24 7F081234 460A7081 */ sub.s $f2, $f14, $f10 -/* 0B3C28 7F081238 46027100 */ add.s $f4, $f14, $f2 -/* 0B3C2C 7F08123C 46001386 */ mov.s $f14, $f2 -/* 0B3C30 7F081240 46046182 */ mul.s $f6, $f12, $f4 -/* 0B3C34 7F081244 00000000 */ nop -/* 0B3C38 7F081248 46083282 */ mul.s $f10, $f6, $f8 -/* 0B3C3C 7F08124C 460A9480 */ add.s $f18, $f18, $f10 -/* 0B3C40 7F081250 4600903C */ c.lt.s $f18, $f0 -/* 0B3C44 7F081254 00000000 */ nop -/* 0B3C48 7F081258 45000025 */ bc1f .L7F0812F0 -/* 0B3C4C 7F08125C 00000000 */ nop -/* 0B3C50 7F081260 C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B3C54 7F081264 3C018005 */ lui $at, %hi(player_view_gravity_modifier) -/* 0B3C58 7F081268 C428ACC4 */ lwc1 $f8, %lo(player_view_gravity_modifier)($at) -/* 0B3C5C 7F08126C 46002381 */ sub.s $f14, $f4, $f0 -/* 0B3C60 7F081270 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B3C64 7F081274 44812000 */ mtc1 $at, $f4 -/* 0B3C68 7F081278 C602007C */ lwc1 $f2, 0x7c($s0) -/* 0B3C6C 7F08127C 460E7180 */ add.s $f6, $f14, $f14 -/* 0B3C70 7F081280 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 0B3C74 7F081284 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B3C78 7F081288 46083282 */ mul.s $f10, $f6, $f8 -/* 0B3C7C 7F08128C 44814000 */ mtc1 $at, $f8 -/* 0B3C80 7F081290 46045183 */ div.s $f6, $f10, $f4 -/* 0B3C84 7F081294 46083282 */ mul.s $f10, $f6, $f8 -/* 0B3C88 7F081298 00000000 */ nop -/* 0B3C8C 7F08129C 46021102 */ mul.s $f4, $f2, $f2 -/* 0B3C90 7F0812A0 0C007614 */ jal sqrtf -/* 0B3C94 7F0812A4 460A2300 */ add.s $f12, $f4, $f10 -/* 0B3C98 7F0812A8 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3C9C 7F0812AC 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3CA0 7F0812B0 8D100000 */ lw $s0, ($t0) -/* 0B3CA4 7F0812B4 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B3CA8 7F0812B8 44808000 */ mtc1 $zero, $f16 -/* 0B3CAC 7F0812BC 8E192A64 */ lw $t9, 0x2a64($s0) -/* 0B3CB0 7F0812C0 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B3CB4 7F0812C4 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B3CB8 7F0812C8 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 0B3CBC 7F0812CC 13200008 */ beqz $t9, .L7F0812F0 -/* 0B3CC0 7F0812D0 46000387 */ neg.s $f14, $f0 -/* 0B3CC4 7F0812D4 AE002A64 */ sw $zero, 0x2a64($s0) -/* 0B3CC8 7F0812D8 8D100000 */ lw $s0, ($t0) -/* 0B3CCC 7F0812DC 8E092A68 */ lw $t1, 0x2a68($s0) -/* 0B3CD0 7F0812E0 AE090488 */ sw $t1, 0x488($s0) -/* 0B3CD4 7F0812E4 8D0A0000 */ lw $t2, ($t0) -/* 0B3CD8 7F0812E8 AD402A68 */ sw $zero, 0x2a68($t2) -/* 0B3CDC 7F0812EC 8D100000 */ lw $s0, ($t0) -.L7F0812F0: -/* 0B3CE0 7F0812F0 E6120070 */ swc1 $f18, 0x70($s0) -/* 0B3CE4 7F0812F4 8D0B0000 */ lw $t3, ($t0) -/* 0B3CE8 7F0812F8 E56E007C */ swc1 $f14, 0x7c($t3) -/* 0B3CEC 7F0812FC 8D100000 */ lw $s0, ($t0) -/* 0B3CF0 7F081300 C602007C */ lwc1 $f2, 0x7c($s0) -.L7F081304: -/* 0B3CF4 7F081304 4610103C */ c.lt.s $f2, $f16 -/* 0B3CF8 7F081308 00000000 */ nop -/* 0B3CFC 7F08130C 4502002B */ bc1fl .L7F0813BC -/* 0B3D00 7F081310 8E0F2A64 */ lw $t7, 0x2a64($s0) -/* 0B3D04 7F081314 C6060074 */ lwc1 $f6, 0x74($s0) -/* 0B3D08 7F081318 C6080070 */ lwc1 $f8, 0x70($s0) -/* 0B3D0C 7F08131C 3C018005 */ li $at, 0x80050000 # -0.000000 -/* 0B3D10 7F081320 4606403E */ c.le.s $f8, $f6 -/* 0B3D14 7F081324 00000000 */ nop -/* 0B3D18 7F081328 45020024 */ bc1fl .L7F0813BC -/* 0B3D1C 7F08132C 8E0F2A64 */ lw $t7, 0x2a64($s0) -/* 0B3D20 7F081330 C424ACC8 */ lwc1 $f4, %lo(D_800550F8)($at) -/* 0B3D24 7F081334 240C000C */ li $t4, 12 -/* 0B3D28 7F081338 3C01C0A0 */ li $at, 0xC0A00000 # -5.000000 -/* 0B3D2C 7F08133C 4604103C */ c.lt.s $f2, $f4 -/* 0B3D30 7F081340 00000000 */ nop -/* 0B3D34 7F081344 45020009 */ bc1fl .L7F08136C -/* 0B3D38 7F081348 44810000 */ mtc1 $at, $f0 -/* 0B3D3C 7F08134C AE0C008C */ sw $t4, 0x8c($s0) -/* 0B3D40 7F081350 3C01C2B4 */ li $at, 0xC2B40000 # -90.000000 -/* 0B3D44 7F081354 44815000 */ mtc1 $at, $f10 -/* 0B3D48 7F081358 8D0D0000 */ lw $t5, ($t0) -/* 0B3D4C 7F08135C E5AA0090 */ swc1 $f10, 0x90($t5) -/* 0B3D50 7F081360 10000013 */ b .L7F0813B0 -/* 0B3D54 7F081364 8D100000 */ lw $s0, ($t0) -/* 0B3D58 7F081368 44810000 */ mtc1 $at, $f0 -.L7F08136C: -/* 0B3D5C 7F08136C 240E000C */ li $t6, 12 -/* 0B3D60 7F081370 4600103C */ c.lt.s $f2, $f0 -/* 0B3D64 7F081374 00000000 */ nop -/* 0B3D68 7F081378 4502000E */ bc1fl .L7F0813B4 -/* 0B3D6C 7F08137C E610007C */ swc1 $f16, 0x7c($s0) -/* 0B3D70 7F081380 AE0E008C */ sw $t6, 0x8c($s0) -/* 0B3D74 7F081384 8D100000 */ lw $s0, ($t0) -/* 0B3D78 7F081388 3C01C2B4 */ li $at, 0xC2B40000 # -90.000000 -/* 0B3D7C 7F08138C 44812000 */ mtc1 $at, $f4 -/* 0B3D80 7F081390 C606007C */ lwc1 $f6, 0x7c($s0) -/* 0B3D84 7F081394 3C018005 */ lui $at, %hi(D_800550FC) # $at, 0x8005 -/* 0B3D88 7F081398 46060201 */ sub.s $f8, $f0, $f6 -/* 0B3D8C 7F08139C C426ACCC */ lwc1 $f6, %lo(D_800550FC)($at) -/* 0B3D90 7F0813A0 46044282 */ mul.s $f10, $f8, $f4 -/* 0B3D94 7F0813A4 46065203 */ div.s $f8, $f10, $f6 -/* 0B3D98 7F0813A8 E6080090 */ swc1 $f8, 0x90($s0) -/* 0B3D9C 7F0813AC 8D100000 */ lw $s0, ($t0) -.L7F0813B0: -/* 0B3DA0 7F0813B0 E610007C */ swc1 $f16, 0x7c($s0) -.L7F0813B4: -/* 0B3DA4 7F0813B4 8D100000 */ lw $s0, ($t0) -/* 0B3DA8 7F0813B8 8E0F2A64 */ lw $t7, 0x2a64($s0) -.L7F0813BC: -/* 0B3DAC 7F0813BC 11E0001F */ beqz $t7, .L7F08143C -/* 0B3DB0 7F0813C0 02002025 */ move $a0, $s0 -/* 0B3DB4 7F0813C4 0FC2263A */ jal bondviewGetPlayerDuckingHeightRelated -/* 0B3DB8 7F0813C8 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B3DBC 7F0813CC 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3DC0 7F0813D0 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3DC4 7F0813D4 8D100000 */ lw $s0, ($t0) -/* 0B3DC8 7F0813D8 E7A0003C */ swc1 $f0, 0x3c($sp) -/* 0B3DCC 7F0813DC 8E060494 */ lw $a2, 0x494($s0) -/* 0B3DD0 7F0813E0 8E05048C */ lw $a1, 0x48c($s0) -/* 0B3DD4 7F0813E4 0FC2C70C */ jal stanGetPositionYValue -/* 0B3DD8 7F0813E8 8E040488 */ lw $a0, 0x488($s0) -/* 0B3DDC 7F0813EC 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B3DE0 7F0813F0 25088BC0 */ addiu $t0, %lo(g_CurrentPlayer) # addiu $t0, $t0, -0x7440 -/* 0B3DE4 7F0813F4 8D100000 */ lw $s0, ($t0) -/* 0B3DE8 7F0813F8 C7AA003C */ lwc1 $f10, 0x3c($sp) -/* 0B3DEC 7F0813FC 3C078004 */ lui $a3, %hi(g_ClockTimer) # $a3, 0x8004 -/* 0B3DF0 7F081400 C6040070 */ lwc1 $f4, 0x70($s0) -/* 0B3DF4 7F081404 44808000 */ mtc1 $zero, $f16 -/* 0B3DF8 7F081408 24E70FF4 */ addiu $a3, %lo(g_ClockTimer) # addiu $a3, $a3, 0xff4 -/* 0B3DFC 7F08140C 460A2180 */ add.s $f6, $f4, $f10 -/* 0B3E00 7F081410 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B3E04 7F081414 4600303C */ c.lt.s $f6, $f0 -/* 0B3E08 7F081418 00000000 */ nop -/* 0B3E0C 7F08141C 45020008 */ bc1fl .L7F081440 -/* 0B3E10 7F081420 8CE90000 */ lw $t1, ($a3) -/* 0B3E14 7F081424 AE002A64 */ sw $zero, 0x2a64($s0) -/* 0B3E18 7F081428 8D100000 */ lw $s0, ($t0) -/* 0B3E1C 7F08142C 8E182A68 */ lw $t8, 0x2a68($s0) -/* 0B3E20 7F081430 AE180488 */ sw $t8, 0x488($s0) -/* 0B3E24 7F081434 8D190000 */ lw $t9, ($t0) -/* 0B3E28 7F081438 AF202A68 */ sw $zero, 0x2a68($t9) -.L7F08143C: -/* 0B3E2C 7F08143C 8CE90000 */ lw $t1, ($a3) -.L7F081440: -/* 0B3E30 7F081440 1920002B */ blez $t1, .L7F0814F0 -/* 0B3E34 7F081444 3C01C0B4 */ li $at, 0xC0B40000 # -5.625000 -/* 0B3E38 7F081448 44816000 */ mtc1 $at, $f12 -/* 0B3E3C 7F08144C 3C018005 */ lui $at, %hi(D_80055100) # $at, 0x8005 -/* 0B3E40 7F081450 C422ACD0 */ lwc1 $f2, %lo(D_80055100)($at) -/* 0B3E44 7F081454 8D100000 */ lw $s0, ($t0) -.L7F081458: -/* 0B3E48 7F081458 8E0A008C */ lw $t2, 0x8c($s0) -/* 0B3E4C 7F08145C 5940000C */ blezl $t2, .L7F081490 -/* 0B3E50 7F081460 C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B3E54 7F081464 C6080084 */ lwc1 $f8, 0x84($s0) -/* 0B3E58 7F081468 C60A0090 */ lwc1 $f10, 0x90($s0) -/* 0B3E5C 7F08146C 46024102 */ mul.s $f4, $f8, $f2 -/* 0B3E60 7F081470 460A2180 */ add.s $f6, $f4, $f10 -/* 0B3E64 7F081474 E6060084 */ swc1 $f6, 0x84($s0) -/* 0B3E68 7F081478 8D100000 */ lw $s0, ($t0) -/* 0B3E6C 7F08147C 8E0B008C */ lw $t3, 0x8c($s0) -/* 0B3E70 7F081480 256CFFFF */ addiu $t4, $t3, -1 -/* 0B3E74 7F081484 10000015 */ b .L7F0814DC -/* 0B3E78 7F081488 AE0C008C */ sw $t4, 0x8c($s0) -/* 0B3E7C 7F08148C C6000090 */ lwc1 $f0, 0x90($s0) -.L7F081490: -/* 0B3E80 7F081490 4610003C */ c.lt.s $f0, $f16 -/* 0B3E84 7F081494 00000000 */ nop -/* 0B3E88 7F081498 4502000D */ bc1fl .L7F0814D0 -/* 0B3E8C 7F08149C C6040084 */ lwc1 $f4, 0x84($s0) -/* 0B3E90 7F0814A0 460C0201 */ sub.s $f8, $f0, $f12 -/* 0B3E94 7F0814A4 E6080090 */ swc1 $f8, 0x90($s0) -/* 0B3E98 7F0814A8 8D100000 */ lw $s0, ($t0) -/* 0B3E9C 7F0814AC C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B3EA0 7F0814B0 4600803E */ c.le.s $f16, $f0 -/* 0B3EA4 7F0814B4 00000000 */ nop -/* 0B3EA8 7F0814B8 45020005 */ bc1fl .L7F0814D0 -/* 0B3EAC 7F0814BC C6040084 */ lwc1 $f4, 0x84($s0) -/* 0B3EB0 7F0814C0 E6100090 */ swc1 $f16, 0x90($s0) -/* 0B3EB4 7F0814C4 8D100000 */ lw $s0, ($t0) -/* 0B3EB8 7F0814C8 C6000090 */ lwc1 $f0, 0x90($s0) -/* 0B3EBC 7F0814CC C6040084 */ lwc1 $f4, 0x84($s0) -.L7F0814D0: -/* 0B3EC0 7F0814D0 46022282 */ mul.s $f10, $f4, $f2 -/* 0B3EC4 7F0814D4 46005180 */ add.s $f6, $f10, $f0 -/* 0B3EC8 7F0814D8 E6060084 */ swc1 $f6, 0x84($s0) -.L7F0814DC: -/* 0B3ECC 7F0814DC 8CED0000 */ lw $t5, ($a3) -/* 0B3ED0 7F0814E0 24630001 */ addiu $v1, $v1, 1 -/* 0B3ED4 7F0814E4 006D082A */ slt $at, $v1, $t5 -/* 0B3ED8 7F0814E8 5420FFDB */ bnezl $at, .L7F081458 -/* 0B3EDC 7F0814EC 8D100000 */ lw $s0, ($t0) -.L7F0814F0: -/* 0B3EE0 7F0814F0 8D100000 */ lw $s0, ($t0) -/* 0B3EE4 7F0814F4 3C018005 */ lui $at, %hi(D_80055104) # $at, 0x8005 -/* 0B3EE8 7F0814F8 C424ACD4 */ lwc1 $f4, %lo(D_80055104)($at) -/* 0B3EEC 7F0814FC C6080084 */ lwc1 $f8, 0x84($s0) -/* 0B3EF0 7F081500 46044282 */ mul.s $f10, $f8, $f4 -/* 0B3EF4 7F081504 E60A0088 */ swc1 $f10, 0x88($s0) -/* 0B3EF8 7F081508 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B3EFC 7F08150C 8FB00020 */ lw $s0, 0x20($sp) -/* 0B3F00 7F081510 27BD0070 */ addiu $sp, $sp, 0x70 -/* 0B3F04 7F081514 03E00008 */ jr $ra -/* 0B3F08 7F081518 00000000 */ nop -) -#endif - -#endif @@ -17364,7 +8804,7 @@ void bondviewUpdatePlayerCollisionPositionFields(void) StandTile *sp2C; s32 sp28; - g_CurrentPlayer->field_29BC = (g_CurrentPlayer->headpos[1] * g_playerPerm->player_perspective_height) + 7.0f; + g_CurrentPlayer->field_29BC = (g_CurrentPlayer->headpos.f[1] * g_playerPerm->player_perspective_height) + 7.0f; phi_f0 = g_CurrentPlayer->field_29BC + ((g_CurrentPlayer->field_88 + g_CurrentPlayer->ducking_height_offset) * g_playerPerm->player_perspective_height); @@ -17376,7 +8816,7 @@ void bondviewUpdatePlayerCollisionPositionFields(void) g_CurrentPlayer->field_488.collision_position.f[1] = g_CurrentPlayer->field_70 + phi_f0; - if (((g_CameraMode != CAMERAMODE_UNK5) && (g_CameraMode != CAMERAMODE_UNK6) && (g_CameraMode != CAMERAMODE_POSEND)) + if (((g_CameraMode != CAMERAMODE_DEATH_CAM_FIRST) && (g_CameraMode != CAMERAMODE_DEATH_CAM_SECOND) && (g_CameraMode != CAMERAMODE_POSEND)) || (g_CurrentPlayer->ptr_char_objectinstance == 0)) { g_CurrentPlayer->field_488.pos.f[0] = g_CurrentPlayer->field_488.collision_position.f[0]; @@ -17459,8 +8899,10 @@ void bondviewUpdatePlayerCollisionPositionFields(void) /** * Fixes vv_verta within -90 and +90. - * Updates vv_costheta, vv_sintheta, vv_verta360, vv_cosverta, vv_sinverta, field_488.field_10. + * Updates vv_costheta, vv_sintheta, vv_verta360, vv_cosverta, vv_sinverta, field_488.theta_transform. * Address 0x7F081790. + * + * Perfect Dark function bmoveUpdateVerta. */ void bondviewApplyVertaTheta(void) { @@ -17483,8 +8925,8 @@ void bondviewApplyVertaTheta(void) g_CurrentPlayer->vv_verta = -90.0f; } - g_CurrentPlayer->vv_costheta = cosf(g_CurrentPlayer->vv_theta * 0.017453292f); - g_CurrentPlayer->vv_sintheta = sinf(g_CurrentPlayer->vv_theta * 0.017453292f); + g_CurrentPlayer->vv_costheta = cosf(g_CurrentPlayer->vv_theta * DegToRad1Fact(1)); + g_CurrentPlayer->vv_sintheta = sinf(g_CurrentPlayer->vv_theta * DegToRad1Fact(1)); g_CurrentPlayer->vv_verta360 = g_CurrentPlayer->vv_verta; if (g_CurrentPlayer->vv_verta360 < 0.0f) @@ -17492,6006 +8934,1503 @@ void bondviewApplyVertaTheta(void) g_CurrentPlayer->vv_verta360 += 360.0f; } - g_CurrentPlayer->vv_cosverta = cosf(g_CurrentPlayer->vv_verta360 * 0.017453292f); - g_CurrentPlayer->vv_sinverta = sinf(g_CurrentPlayer->vv_verta360 * 0.017453292f); - - g_CurrentPlayer->field_488.field_10.f[0] = -g_CurrentPlayer->vv_sintheta; - g_CurrentPlayer->field_488.field_10.f[1] = 0; - g_CurrentPlayer->field_488.field_10.f[2] = g_CurrentPlayer->vv_costheta; -} - - - -#ifdef NONMATCHING -void controller_gameplay_interaction(void) { + g_CurrentPlayer->vv_cosverta = cosf(g_CurrentPlayer->vv_verta360 * DegToRad1Fact(1)); + g_CurrentPlayer->vv_sinverta = sinf(g_CurrentPlayer->vv_verta360 * DegToRad1Fact(1)); + g_CurrentPlayer->field_488.theta_transform.f[0] = -g_CurrentPlayer->vv_sintheta; + g_CurrentPlayer->field_488.theta_transform.f[1] = 0; + g_CurrentPlayer->field_488.theta_transform.f[2] = g_CurrentPlayer->vv_costheta; } -#else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_80055120 -.word 0x3d75c290 /*0.060000002*/ -glabel D_80055124 -.word 0x3da3d708 /*0.079999983*/ -glabel D_80055128 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_8005512C -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055130 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055134 -.word 0x3f8a3d71 /*1.08*/ -glabel D_80055138 -.word 0x3c23d70a /*0.0099999998*/ -glabel D_8005513C -.word 0x3c23d70a /*0.0099999998*/ -glabel D_80055140 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055144 -.word 0x3f5dddde /*0.86666667*/ -glabel D_80055148 -.word 0x3d4ccccd /*0.050000001*/ -glabel D_8005514C -.word 0x3e99999a /*0.30000001*/ -glabel D_80055150 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055154 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055158 -.word 0x3f6b851f /*0.92000002*/ -glabel D_8005515C -.word 0x3da3d708 /*0.079999983*/ -glabel D_80055160 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055164 -.word 0x3dcccccd /*0.1*/ -glabel D_80055168 -.word 0x3f266666 /*0.64999998*/ -.text -glabel controller_gameplay_interaction -/* 0B64A4 7F081974 27BDFE40 */ addiu $sp, $sp, -0x1c0 -/* 0B64A8 7F081978 F7B40030 */ sdc1 $f20, 0x30($sp) -/* 0B64AC 7F08197C 4480A000 */ mtc1 $zero, $f20 -/* 0B64B0 7F081980 AFBF003C */ sw $ra, 0x3c($sp) -/* 0B64B4 7F081984 AFB00038 */ sw $s0, 0x38($sp) -/* 0B64B8 7F081988 AFA401C0 */ sw $a0, 0x1c0($sp) -/* 0B64BC 7F08198C AFA501C4 */ sw $a1, 0x1c4($sp) -/* 0B64C0 7F081990 AFA601C8 */ sw $a2, 0x1c8($sp) -/* 0B64C4 7F081994 AFA701CC */ sw $a3, 0x1cc($sp) -/* 0B64C8 7F081998 AFA001BC */ sw $zero, 0x1bc($sp) -/* 0B64CC 7F08199C AFA001B8 */ sw $zero, 0x1b8($sp) -/* 0B64D0 7F0819A0 AFA001B4 */ sw $zero, 0x1b4($sp) -/* 0B64D4 7F0819A4 AFA001B0 */ sw $zero, 0x1b0($sp) -/* 0B64D8 7F0819A8 AFA001AC */ sw $zero, 0x1ac($sp) -/* 0B64DC 7F0819AC AFA001A8 */ sw $zero, 0x1a8($sp) -/* 0B64E0 7F0819B0 AFA001A4 */ sw $zero, 0x1a4($sp) -/* 0B64E4 7F0819B4 AFA001A0 */ sw $zero, 0x1a0($sp) -/* 0B64E8 7F0819B8 AFA0019C */ sw $zero, 0x19c($sp) -/* 0B64EC 7F0819BC AFA00198 */ sw $zero, 0x198($sp) -/* 0B64F0 7F0819C0 AFA00194 */ sw $zero, 0x194($sp) -/* 0B64F4 7F0819C4 AFA00190 */ sw $zero, 0x190($sp) -/* 0B64F8 7F0819C8 AFA00174 */ sw $zero, 0x174($sp) -/* 0B64FC 7F0819CC AFA00170 */ sw $zero, 0x170($sp) -/* 0B6500 7F0819D0 AFA0016C */ sw $zero, 0x16c($sp) -/* 0B6504 7F0819D4 AFA00168 */ sw $zero, 0x168($sp) -/* 0B6508 7F0819D8 AFA0015C */ sw $zero, 0x15c($sp) -/* 0B650C 7F0819DC AFA00158 */ sw $zero, 0x158($sp) -/* 0B6510 7F0819E0 AFA00154 */ sw $zero, 0x154($sp) -/* 0B6514 7F0819E4 AFA00150 */ sw $zero, 0x150($sp) -/* 0B6518 7F0819E8 AFA0014C */ sw $zero, 0x14c($sp) -/* 0B651C 7F0819EC AFA00148 */ sw $zero, 0x148($sp) -/* 0B6520 7F0819F0 E7B4018C */ swc1 $f20, 0x18c($sp) -/* 0B6524 7F0819F4 E7B40188 */ swc1 $f20, 0x188($sp) -/* 0B6528 7F0819F8 E7B40184 */ swc1 $f20, 0x184($sp) -/* 0B652C 7F0819FC E7B40180 */ swc1 $f20, 0x180($sp) -/* 0B6530 7F081A00 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B6534 7F081A04 E7B40178 */ swc1 $f20, 0x178($sp) -/* 0B6538 7F081A08 E7B40164 */ swc1 $f20, 0x164($sp) -/* 0B653C 7F081A0C 0FC2938E */ jal get_cur_player_look_vertical_inverted -/* 0B6540 7F081A10 E7B40160 */ swc1 $f20, 0x160($sp) -/* 0B6544 7F081A14 83A401C3 */ lb $a0, 0x1c3($sp) -/* 0B6548 7F081A18 2C4E0001 */ sltiu $t6, $v0, 1 -/* 0B654C 7F081A1C AFAE0144 */ sw $t6, 0x144($sp) -/* 0B6550 7F081A20 2881FFFB */ slti $at, $a0, -5 -/* 0B6554 7F081A24 10200003 */ beqz $at, .L7F081A34 -/* 0B6558 7F081A28 AFA00140 */ sw $zero, 0x140($sp) -/* 0B655C 7F081A2C 10000006 */ b .L7F081A48 -/* 0B6560 7F081A30 24830005 */ addiu $v1, $a0, 5 -.L7F081A34: -/* 0B6564 7F081A34 28810006 */ slti $at, $a0, 6 -/* 0B6568 7F081A38 14200003 */ bnez $at, .L7F081A48 -/* 0B656C 7F081A3C 00001825 */ move $v1, $zero -/* 0B6570 7F081A40 10000001 */ b .L7F081A48 -/* 0B6574 7F081A44 2483FFFB */ addiu $v1, $a0, -5 -.L7F081A48: -/* 0B6578 7F081A48 83A501C7 */ lb $a1, 0x1c7($sp) -/* 0B657C 7F081A4C 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 0B6580 7F081A50 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 0B6584 7F081A54 28A1FFFB */ slti $at, $a1, -5 -/* 0B6588 7F081A58 10200003 */ beqz $at, .L7F081A68 -/* 0B658C 7F081A5C 83AF01C3 */ lb $t7, 0x1c3($sp) -/* 0B6590 7F081A60 10000006 */ b .L7F081A7C -/* 0B6594 7F081A64 24A20005 */ addiu $v0, $a1, 5 -.L7F081A68: -/* 0B6598 7F081A68 28A10006 */ slti $at, $a1, 6 -/* 0B659C 7F081A6C 14200003 */ bnez $at, .L7F081A7C -/* 0B65A0 7F081A70 00001025 */ move $v0, $zero -/* 0B65A4 7F081A74 10000001 */ b .L7F081A7C -/* 0B65A8 7F081A78 24A2FFFB */ addiu $v0, $a1, -5 -.L7F081A7C: -/* 0B65AC 7F081A7C 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B65B0 7F081A80 8E080000 */ lw $t0, ($s0) -/* 0B65B4 7F081A84 AFAF0134 */ sw $t7, 0x134($sp) -/* 0B65B8 7F081A88 AFA3012C */ sw $v1, 0x12c($sp) -/* 0B65BC 7F081A8C AFA20128 */ sw $v0, 0x128($sp) -/* 0B65C0 7F081A90 AFA30124 */ sw $v1, 0x124($sp) -/* 0B65C4 7F081A94 AFA20120 */ sw $v0, 0x120($sp) -/* 0B65C8 7F081A98 AFB80130 */ sw $t8, 0x130($sp) -/* 0B65CC 7F081A9C 8D1900D8 */ lw $t9, 0xd8($t0) -/* 0B65D0 7F081AA0 1720001B */ bnez $t9, .L7F081B10 -/* 0B65D4 7F081AA4 3C0A8003 */ lui $t2, %hi(g_bondviewForceDisarm) -/* 0B65D8 7F081AA8 8D4A6424 */ lw $t2, %lo(g_bondviewForceDisarm)($t2) -/* 0B65DC 7F081AAC 5D400019 */ bgtzl $t2, .L7F081B14 -/* 0B65E0 7F081AB0 8E080000 */ lw $t0, ($s0) -/* 0B65E4 7F081AB4 8D0201C8 */ lw $v0, 0x1c8($t0) -/* 0B65E8 7F081AB8 24010005 */ li $at, 5 -/* 0B65EC 7F081ABC 97AC01CE */ lhu $t4, 0x1ce($sp) -/* 0B65F0 7F081AC0 50410007 */ beql $v0, $at, .L7F081AE0 -/* 0B65F4 7F081AC4 24010005 */ li $at, 5 -/* 0B65F8 7F081AC8 97AB01CA */ lhu $t3, 0x1ca($sp) -/* 0B65FC 7F081ACC 01806827 */ not $t5, $t4 -/* 0B6600 7F081AD0 016D7024 */ and $t6, $t3, $t5 -/* 0B6604 7F081AD4 31CF1000 */ andi $t7, $t6, 0x1000 -/* 0B6608 7F081AD8 15E00006 */ bnez $t7, .L7F081AF4 -/* 0B660C 7F081ADC 24010005 */ li $at, 5 -.L7F081AE0: -/* 0B6610 7F081AE0 5441000C */ bnel $v0, $at, .L7F081B14 -/* 0B6614 7F081AE4 8E080000 */ lw $t0, ($s0) -/* 0B6618 7F081AE8 8D1801D0 */ lw $t8, 0x1d0($t0) -/* 0B661C 7F081AEC 53000009 */ beql $t8, $zero, .L7F081B14 -/* 0B6620 7F081AF0 8E080000 */ lw $t0, ($s0) -.L7F081AF4: -/* 0B6624 7F081AF4 0FC26919 */ jal getPlayerCount -/* 0B6628 7F081AF8 00000000 */ nop -/* 0B662C 7F081AFC 24010001 */ li $at, 1 -/* 0B6630 7F081B00 54410004 */ bnel $v0, $at, .L7F081B14 -/* 0B6634 7F081B04 8E080000 */ lw $t0, ($s0) -/* 0B6638 7F081B08 0FC1FE1D */ jal trigger_solo_watch_menu -/* 0B663C 7F081B0C 00002025 */ move $a0, $zero -.L7F081B10: -/* 0B6640 7F081B10 8E080000 */ lw $t0, ($s0) -.L7F081B14: -/* 0B6644 7F081B14 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B6648 7F081B18 572003AC */ bnezl $t9, .L7F0829CC -/* 0B664C 7F081B1C 8E0A0000 */ lw $t2, ($s0) -/* 0B6650 7F081B20 8D0A00D8 */ lw $t2, 0xd8($t0) -/* 0B6654 7F081B24 554003A9 */ bnezl $t2, .L7F0829CC -/* 0B6658 7F081B28 8E0A0000 */ lw $t2, ($s0) -/* 0B665C 7F081B2C 0FC26919 */ jal getPlayerCount -/* 0B6660 7F081B30 00000000 */ nop -/* 0B6664 7F081B34 24010001 */ li $at, 1 -/* 0B6668 7F081B38 10410008 */ beq $v0, $at, .L7F081B5C -/* 0B666C 7F081B3C 3C0C8009 */ lui $t4, %hi(g_stopPlayFlag) -/* 0B6670 7F081B40 8D8CC700 */ lw $t4, %lo(g_stopPlayFlag)($t4) -/* 0B6674 7F081B44 3C0B8009 */ lui $t3, %hi(g_gameOverFlag) -/* 0B6678 7F081B48 558003A0 */ bnezl $t4, .L7F0829CC -/* 0B667C 7F081B4C 8E0A0000 */ lw $t2, ($s0) -/* 0B6680 7F081B50 8D6BC704 */ lw $t3, %lo(g_gameOverFlag)($t3) -/* 0B6684 7F081B54 5560039D */ bnezl $t3, .L7F0829CC -/* 0B6688 7F081B58 8E0A0000 */ lw $t2, ($s0) -.L7F081B5C: -/* 0B668C 7F081B5C 97AD01CA */ lhu $t5, 0x1ca($sp) -/* 0B6690 7F081B60 0FC29370 */ jal cur_player_get_control_type -/* 0B6694 7F081B64 AFAD005C */ sw $t5, 0x5c($sp) -/* 0B6698 7F081B68 24010006 */ li $at, 6 -/* 0B669C 7F081B6C 50410011 */ beql $v0, $at, .L7F081BB4 -/* 0B66A0 7F081B70 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B66A4 7F081B74 0FC29370 */ jal cur_player_get_control_type -/* 0B66A8 7F081B78 00000000 */ nop -/* 0B66AC 7F081B7C 24010007 */ li $at, 7 -/* 0B66B0 7F081B80 5041000C */ beql $v0, $at, .L7F081BB4 -/* 0B66B4 7F081B84 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B66B8 7F081B88 0FC29370 */ jal cur_player_get_control_type -/* 0B66BC 7F081B8C 00000000 */ nop -/* 0B66C0 7F081B90 24010005 */ li $at, 5 -/* 0B66C4 7F081B94 50410007 */ beql $v0, $at, .L7F081BB4 -/* 0B66C8 7F081B98 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B66CC 7F081B9C 0FC29370 */ jal cur_player_get_control_type -/* 0B66D0 7F081BA0 00000000 */ nop -/* 0B66D4 7F081BA4 24010004 */ li $at, 4 -/* 0B66D8 7F081BA8 144101C3 */ bne $v0, $at, .L7F0822B8 -/* 0B66DC 7F081BAC 00000000 */ nop -/* 0B66E0 7F081BB0 97AF01CE */ lhu $t7, 0x1ce($sp) -.L7F081BB4: -/* 0B66E4 7F081BB4 8FAE005C */ lw $t6, 0x5c($sp) -/* 0B66E8 7F081BB8 01E0C027 */ not $t8, $t7 -/* 0B66EC 7F081BBC 01D8C824 */ and $t9, $t6, $t8 -/* 0B66F0 7F081BC0 0FC26C54 */ jal get_cur_playernum -/* 0B66F4 7F081BC4 AFB90060 */ sw $t9, 0x60($sp) -/* 0B66F8 7F081BC8 0FC26919 */ jal getPlayerCount -/* 0B66FC 7F081BCC AFA20064 */ sw $v0, 0x64($sp) -/* 0B6700 7F081BD0 8FAA0064 */ lw $t2, 0x64($sp) -/* 0B6704 7F081BD4 004A2021 */ addu $a0, $v0, $t2 -/* 0B6708 7F081BD8 00046600 */ sll $t4, $a0, 0x18 -/* 0B670C 7F081BDC 0C00303B */ jal joyGetStickX -/* 0B6710 7F081BE0 000C2603 */ sra $a0, $t4, 0x18 -/* 0B6714 7F081BE4 0FC26C54 */ jal get_cur_playernum -/* 0B6718 7F081BE8 A3A2011F */ sb $v0, 0x11f($sp) -/* 0B671C 7F081BEC 0FC26919 */ jal getPlayerCount -/* 0B6720 7F081BF0 AFA20064 */ sw $v0, 0x64($sp) -/* 0B6724 7F081BF4 8FAD0064 */ lw $t5, 0x64($sp) -/* 0B6728 7F081BF8 004D2021 */ addu $a0, $v0, $t5 -/* 0B672C 7F081BFC 00047E00 */ sll $t7, $a0, 0x18 -/* 0B6730 7F081C00 0C00307F */ jal joyGetStickY -/* 0B6734 7F081C04 000F2603 */ sra $a0, $t7, 0x18 -/* 0B6738 7F081C08 0FC26C54 */ jal get_cur_playernum -/* 0B673C 7F081C0C A3A2011E */ sb $v0, 0x11e($sp) -/* 0B6740 7F081C10 0FC26919 */ jal getPlayerCount -/* 0B6744 7F081C14 AFA20064 */ sw $v0, 0x64($sp) -/* 0B6748 7F081C18 8FB80064 */ lw $t8, 0x64($sp) -/* 0B674C 7F081C1C 3405FFFF */ li $a1, 65535 -/* 0B6750 7F081C20 00582021 */ addu $a0, $v0, $t8 -/* 0B6754 7F081C24 0004CE00 */ sll $t9, $a0, 0x18 -/* 0B6758 7F081C28 0C0030C3 */ jal joyGetButtons -/* 0B675C 7F081C2C 00192603 */ sra $a0, $t9, 0x18 -/* 0B6760 7F081C30 8E0B0000 */ lw $t3, ($s0) -/* 0B6764 7F081C34 83AC011F */ lb $t4, 0x11f($sp) -/* 0B6768 7F081C38 A7A2011C */ sh $v0, 0x11c($sp) -/* 0B676C 7F081C3C 956D03B6 */ lhu $t5, 0x3b6($t3) -/* 0B6770 7F081C40 2981FFFB */ slti $at, $t4, -5 -/* 0B6774 7F081C44 01801825 */ move $v1, $t4 -/* 0B6778 7F081C48 10200003 */ beqz $at, .L7F081C58 -/* 0B677C 7F081C4C A7AD011A */ sh $t5, 0x11a($sp) -/* 0B6780 7F081C50 10000007 */ b .L7F081C70 -/* 0B6784 7F081C54 25830005 */ addiu $v1, $t4, 5 -.L7F081C58: -/* 0B6788 7F081C58 28610006 */ slti $at, $v1, 6 -/* 0B678C 7F081C5C 14200004 */ bnez $at, .L7F081C70 -/* 0B6790 7F081C60 00001825 */ move $v1, $zero -/* 0B6794 7F081C64 83A3011F */ lb $v1, 0x11f($sp) -/* 0B6798 7F081C68 10000001 */ b .L7F081C70 -/* 0B679C 7F081C6C 2463FFFB */ addiu $v1, $v1, -5 -.L7F081C70: -/* 0B67A0 7F081C70 83A2011E */ lb $v0, 0x11e($sp) -/* 0B67A4 7F081C74 2841FFFB */ slti $at, $v0, -5 -/* 0B67A8 7F081C78 10200003 */ beqz $at, .L7F081C88 -/* 0B67AC 7F081C7C 244F0005 */ addiu $t7, $v0, 5 -/* 0B67B0 7F081C80 10000007 */ b .L7F081CA0 -/* 0B67B4 7F081C84 AFAF0110 */ sw $t7, 0x110($sp) -.L7F081C88: -/* 0B67B8 7F081C88 28410006 */ slti $at, $v0, 6 -/* 0B67BC 7F081C8C 14200003 */ bnez $at, .L7F081C9C -/* 0B67C0 7F081C90 244EFFFB */ addiu $t6, $v0, -5 -/* 0B67C4 7F081C94 10000002 */ b .L7F081CA0 -/* 0B67C8 7F081C98 AFAE0110 */ sw $t6, 0x110($sp) -.L7F081C9C: -/* 0B67CC 7F081C9C AFA00110 */ sw $zero, 0x110($sp) -.L7F081CA0: -/* 0B67D0 7F081CA0 0FC29370 */ jal cur_player_get_control_type -/* 0B67D4 7F081CA4 AFA30114 */ sw $v1, 0x114($sp) -/* 0B67D8 7F081CA8 24010004 */ li $at, 4 -/* 0B67DC 7F081CAC 10410006 */ beq $v0, $at, .L7F081CC8 -/* 0B67E0 7F081CB0 8FA30114 */ lw $v1, 0x114($sp) -/* 0B67E4 7F081CB4 0FC29370 */ jal cur_player_get_control_type -/* 0B67E8 7F081CB8 AFA30114 */ sw $v1, 0x114($sp) -/* 0B67EC 7F081CBC 24010006 */ li $at, 6 -/* 0B67F0 7F081CC0 14410005 */ bne $v0, $at, .L7F081CD8 -/* 0B67F4 7F081CC4 8FA30114 */ lw $v1, 0x114($sp) -.L7F081CC8: -/* 0B67F8 7F081CC8 8FB80110 */ lw $t8, 0x110($sp) -/* 0B67FC 7F081CCC AFA30124 */ sw $v1, 0x124($sp) -/* 0B6800 7F081CD0 1000000F */ b .L7F081D10 -/* 0B6804 7F081CD4 AFB80128 */ sw $t8, 0x128($sp) -.L7F081CD8: -/* 0B6808 7F081CD8 3C198003 */ lui $t9, %hi(in_tank_flag) -/* 0B680C 7F081CDC 8F396448 */ lw $t9, %lo(in_tank_flag)($t9) -/* 0B6810 7F081CE0 24010001 */ li $at, 1 -/* 0B6814 7F081CE4 57210008 */ bnel $t9, $at, .L7F081D08 -/* 0B6818 7F081CE8 AFA30124 */ sw $v1, 0x124($sp) -/* 0B681C 7F081CEC 8E0A0000 */ lw $t2, ($s0) -/* 0B6820 7F081CF0 8D4B0124 */ lw $t3, 0x124($t2) -/* 0B6824 7F081CF4 55600004 */ bnezl $t3, .L7F081D08 -/* 0B6828 7F081CF8 AFA30124 */ sw $v1, 0x124($sp) -/* 0B682C 7F081CFC 10000002 */ b .L7F081D08 -/* 0B6830 7F081D00 AFA3012C */ sw $v1, 0x12c($sp) -/* 0B6834 7F081D04 AFA30124 */ sw $v1, 0x124($sp) -.L7F081D08: -/* 0B6838 7F081D08 8FAD0110 */ lw $t5, 0x110($sp) -/* 0B683C 7F081D0C AFAD0120 */ sw $t5, 0x120($sp) -.L7F081D10: -/* 0B6840 7F081D10 0FC29370 */ jal cur_player_get_control_type -/* 0B6844 7F081D14 00000000 */ nop -/* 0B6848 7F081D18 24010004 */ li $at, 4 -/* 0B684C 7F081D1C 50410007 */ beql $v0, $at, .L7F081D3C -/* 0B6850 7F081D20 97A2011C */ lhu $v0, 0x11c($sp) -/* 0B6854 7F081D24 0FC29370 */ jal cur_player_get_control_type -/* 0B6858 7F081D28 00000000 */ nop -/* 0B685C 7F081D2C 24010005 */ li $at, 5 -/* 0B6860 7F081D30 14410016 */ bne $v0, $at, .L7F081D8C -/* 0B6864 7F081D34 8FB9005C */ lw $t9, 0x5c($sp) -/* 0B6868 7F081D38 97A2011C */ lhu $v0, 0x11c($sp) -.L7F081D3C: -/* 0B686C 7F081D3C 97AE011A */ lhu $t6, 0x11a($sp) -/* 0B6870 7F081D40 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B6874 7F081D44 304C2000 */ andi $t4, $v0, 0x2000 -/* 0B6878 7F081D48 000C782B */ sltu $t7, $zero, $t4 -/* 0B687C 7F081D4C AFAF0104 */ sw $t7, 0x104($sp) -/* 0B6880 7F081D50 8FAF0060 */ lw $t7, 0x60($sp) -/* 0B6884 7F081D54 01C0C027 */ not $t8, $t6 -/* 0B6888 7F081D58 00581824 */ and $v1, $v0, $t8 -/* 0B688C 7F081D5C 30792000 */ andi $t9, $v1, 0x2000 -/* 0B6890 7F081D60 316D2000 */ andi $t5, $t3, 0x2000 -/* 0B6894 7F081D64 31EE2000 */ andi $t6, $t7, 0x2000 -/* 0B6898 7F081D68 0019502B */ sltu $t2, $zero, $t9 -/* 0B689C 7F081D6C 000D602B */ sltu $t4, $zero, $t5 -/* 0B68A0 7F081D70 000EC02B */ sltu $t8, $zero, $t6 -/* 0B68A4 7F081D74 AFAA0100 */ sw $t2, 0x100($sp) -/* 0B68A8 7F081D78 AFAC010C */ sw $t4, 0x10c($sp) -/* 0B68AC 7F081D7C AFB80108 */ sw $t8, 0x108($sp) -/* 0B68B0 7F081D80 AFA30050 */ sw $v1, 0x50($sp) -/* 0B68B4 7F081D84 10000014 */ b .L7F081DD8 -/* 0B68B8 7F081D88 AFA20058 */ sw $v0, 0x58($sp) -.L7F081D8C: -/* 0B68BC 7F081D8C 332A2000 */ andi $t2, $t9, 0x2000 -/* 0B68C0 7F081D90 97B9011A */ lhu $t9, 0x11a($sp) -/* 0B68C4 7F081D94 8FAD0060 */ lw $t5, 0x60($sp) -/* 0B68C8 7F081D98 97A2011C */ lhu $v0, 0x11c($sp) -/* 0B68CC 7F081D9C 000A582B */ sltu $t3, $zero, $t2 -/* 0B68D0 7F081DA0 03205027 */ not $t2, $t9 -/* 0B68D4 7F081DA4 AFAB0104 */ sw $t3, 0x104($sp) -/* 0B68D8 7F081DA8 31AC2000 */ andi $t4, $t5, 0x2000 -/* 0B68DC 7F081DAC 004A1824 */ and $v1, $v0, $t2 -/* 0B68E0 7F081DB0 306B2000 */ andi $t3, $v1, 0x2000 -/* 0B68E4 7F081DB4 304E2000 */ andi $t6, $v0, 0x2000 -/* 0B68E8 7F081DB8 000C782B */ sltu $t7, $zero, $t4 -/* 0B68EC 7F081DBC 000EC02B */ sltu $t8, $zero, $t6 -/* 0B68F0 7F081DC0 000B682B */ sltu $t5, $zero, $t3 -/* 0B68F4 7F081DC4 AFAF0100 */ sw $t7, 0x100($sp) -/* 0B68F8 7F081DC8 AFB8010C */ sw $t8, 0x10c($sp) -/* 0B68FC 7F081DCC AFAD0108 */ sw $t5, 0x108($sp) -/* 0B6900 7F081DD0 AFA30050 */ sw $v1, 0x50($sp) -/* 0B6904 7F081DD4 AFA20058 */ sw $v0, 0x58($sp) -.L7F081DD8: -/* 0B6908 7F081DD8 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0B690C 7F081DDC 00000000 */ nop -/* 0B6910 7F081DE0 5440011F */ bnezl $v0, .L7F082260 -/* 0B6914 7F081DE4 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B6918 7F081DE8 0FC3092F */ jal sub_GAME_7F0C24BC -/* 0B691C 7F081DEC 00000000 */ nop -/* 0B6920 7F081DF0 5040011B */ beql $v0, $zero, .L7F082260 -/* 0B6924 7F081DF4 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B6928 7F081DF8 0FC293A0 */ jal cur_player_get_aim_control -/* 0B692C 7F081DFC 00000000 */ nop -/* 0B6930 7F081E00 54400006 */ bnezl $v0, .L7F081E1C -/* 0B6934 7F081E04 8FAE0100 */ lw $t6, 0x100($sp) -/* 0B6938 7F081E08 8FAC0104 */ lw $t4, 0x104($sp) -/* 0B693C 7F081E0C 8E0F0000 */ lw $t7, ($s0) -/* 0B6940 7F081E10 10000008 */ b .L7F081E34 -/* 0B6944 7F081E14 ADEC0124 */ sw $t4, 0x124($t7) -/* 0B6948 7F081E18 8FAE0100 */ lw $t6, 0x100($sp) -.L7F081E1C: -/* 0B694C 7F081E1C 51C00006 */ beql $t6, $zero, .L7F081E38 -/* 0B6950 7F081E20 8E190000 */ lw $t9, ($s0) -/* 0B6954 7F081E24 8E080000 */ lw $t0, ($s0) -/* 0B6958 7F081E28 8D050124 */ lw $a1, 0x124($t0) -/* 0B695C 7F081E2C 2CB80001 */ sltiu $t8, $a1, 1 -/* 0B6960 7F081E30 AD180124 */ sw $t8, 0x124($t0) -.L7F081E34: -/* 0B6964 7F081E34 8E190000 */ lw $t9, ($s0) -.L7F081E38: -/* 0B6968 7F081E38 8FA40060 */ lw $a0, 0x60($sp) -/* 0B696C 7F081E3C 240F0001 */ li $t7, 1 -/* 0B6970 7F081E40 8F230124 */ lw $v1, 0x124($t9) -/* 0B6974 7F081E44 308A4000 */ andi $t2, $a0, 0x4000 -/* 0B6978 7F081E48 000A582B */ sltu $t3, $zero, $t2 -/* 0B697C 7F081E4C 2C620001 */ sltiu $v0, $v1, 1 -/* 0B6980 7F081E50 AFA201BC */ sw $v0, 0x1bc($sp) -/* 0B6984 7F081E54 AFA20148 */ sw $v0, 0x148($sp) -/* 0B6988 7F081E58 01602825 */ move $a1, $t3 -/* 0B698C 7F081E5C AFAB0048 */ sw $t3, 0x48($sp) -/* 0B6990 7F081E60 15600005 */ bnez $t3, .L7F081E78 -/* 0B6994 7F081E64 AFA301B8 */ sw $v1, 0x1b8($sp) -/* 0B6998 7F081E68 8FA50050 */ lw $a1, 0x50($sp) -/* 0B699C 7F081E6C AFAB0048 */ sw $t3, 0x48($sp) -/* 0B69A0 7F081E70 30AD4000 */ andi $t5, $a1, 0x4000 -/* 0B69A4 7F081E74 000D282B */ sltu $a1, $zero, $t5 -.L7F081E78: -/* 0B69A8 7F081E78 AFA501B0 */ sw $a1, 0x1b0($sp) -/* 0B69AC 7F081E7C AFA201AC */ sw $v0, 0x1ac($sp) -/* 0B69B0 7F081E80 AFAF01A8 */ sw $t7, 0x1a8($sp) -/* 0B69B4 7F081E84 AFA201A4 */ sw $v0, 0x1a4($sp) -/* 0B69B8 7F081E88 10600012 */ beqz $v1, .L7F081ED4 -/* 0B69BC 7F081E8C AFA201A0 */ sw $v0, 0x1a0($sp) -/* 0B69C0 7F081E90 83A401C7 */ lb $a0, 0x1c7($sp) -/* 0B69C4 7F081E94 2881003D */ slti $at, $a0, 0x3d -/* 0B69C8 7F081E98 1420000E */ bnez $at, .L7F081ED4 -/* 0B69CC 7F081E9C 248EFFC4 */ addiu $t6, $a0, -0x3c -/* 0B69D0 7F081EA0 448E2000 */ mtc1 $t6, $f4 -/* 0B69D4 7F081EA4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B69D8 7F081EA8 44811000 */ mtc1 $at, $f2 -/* 0B69DC 7F081EAC 468021A0 */ cvt.s.w $f6, $f4 -/* 0B69E0 7F081EB0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B69E4 7F081EB4 44816000 */ mtc1 $at, $f12 -/* 0B69E8 7F081EB8 46023003 */ div.s $f0, $f6, $f2 -/* 0B69EC 7F081EBC 4600603C */ c.lt.s $f12, $f0 -/* 0B69F0 7F081EC0 E7A00184 */ swc1 $f0, 0x184($sp) -/* 0B69F4 7F081EC4 45000008 */ bc1f .L7F081EE8 -/* 0B69F8 7F081EC8 00000000 */ nop -/* 0B69FC 7F081ECC 10000006 */ b .L7F081EE8 -/* 0B6A00 7F081ED0 E7AC0184 */ swc1 $f12, 0x184($sp) -.L7F081ED4: -/* 0B6A04 7F081ED4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6A08 7F081ED8 44816000 */ mtc1 $at, $f12 -/* 0B6A0C 7F081EDC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B6A10 7F081EE0 44811000 */ mtc1 $at, $f2 -/* 0B6A14 7F081EE4 83A401C7 */ lb $a0, 0x1c7($sp) -.L7F081EE8: -/* 0B6A18 7F081EE8 1060000D */ beqz $v1, .L7F081F20 -/* 0B6A1C 7F081EEC 2881FFC4 */ slti $at, $a0, -0x3c -/* 0B6A20 7F081EF0 1020000B */ beqz $at, .L7F081F20 -/* 0B6A24 7F081EF4 2418FFC4 */ li $t8, -60 -/* 0B6A28 7F081EF8 0304C823 */ subu $t9, $t8, $a0 -/* 0B6A2C 7F081EFC 44994000 */ mtc1 $t9, $f8 -/* 0B6A30 7F081F00 00000000 */ nop -/* 0B6A34 7F081F04 468042A0 */ cvt.s.w $f10, $f8 -/* 0B6A38 7F081F08 46025003 */ div.s $f0, $f10, $f2 -/* 0B6A3C 7F081F0C 4600603C */ c.lt.s $f12, $f0 -/* 0B6A40 7F081F10 E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B6A44 7F081F14 45000002 */ bc1f .L7F081F20 -/* 0B6A48 7F081F18 00000000 */ nop -/* 0B6A4C 7F081F1C E7AC0180 */ swc1 $f12, 0x180($sp) -.L7F081F20: -/* 0B6A50 7F081F20 10600010 */ beqz $v1, .L7F081F64 -/* 0B6A54 7F081F24 00002025 */ move $a0, $zero -/* 0B6A58 7F081F28 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B6A5C 7F081F2C 240AFFC4 */ li $t2, -60 -/* 0B6A60 7F081F30 2841FFC4 */ slti $at, $v0, -0x3c -/* 0B6A64 7F081F34 1020000B */ beqz $at, .L7F081F64 -/* 0B6A68 7F081F38 01425823 */ subu $t3, $t2, $v0 -/* 0B6A6C 7F081F3C 448B9000 */ mtc1 $t3, $f18 -/* 0B6A70 7F081F40 00000000 */ nop -/* 0B6A74 7F081F44 46809120 */ cvt.s.w $f4, $f18 -/* 0B6A78 7F081F48 46022003 */ div.s $f0, $f4, $f2 -/* 0B6A7C 7F081F4C 4600603C */ c.lt.s $f12, $f0 -/* 0B6A80 7F081F50 E7A0017C */ swc1 $f0, 0x17c($sp) -/* 0B6A84 7F081F54 45000004 */ bc1f .L7F081F68 -/* 0B6A88 7F081F58 00000000 */ nop -/* 0B6A8C 7F081F5C 10000002 */ b .L7F081F68 -/* 0B6A90 7F081F60 E7AC017C */ swc1 $f12, 0x17c($sp) -.L7F081F64: -/* 0B6A94 7F081F64 83A201C3 */ lb $v0, 0x1c3($sp) -.L7F081F68: -/* 0B6A98 7F081F68 1060000C */ beqz $v1, .L7F081F9C -/* 0B6A9C 7F081F6C 2841003D */ slti $at, $v0, 0x3d -/* 0B6AA0 7F081F70 1420000A */ bnez $at, .L7F081F9C -/* 0B6AA4 7F081F74 244DFFC4 */ addiu $t5, $v0, -0x3c -/* 0B6AA8 7F081F78 448D3000 */ mtc1 $t5, $f6 -/* 0B6AAC 7F081F7C 00000000 */ nop -/* 0B6AB0 7F081F80 46803220 */ cvt.s.w $f8, $f6 -/* 0B6AB4 7F081F84 46024003 */ div.s $f0, $f8, $f2 -/* 0B6AB8 7F081F88 4600603C */ c.lt.s $f12, $f0 -/* 0B6ABC 7F081F8C E7A00178 */ swc1 $f0, 0x178($sp) -/* 0B6AC0 7F081F90 45020003 */ bc1fl .L7F081FA0 -/* 0B6AC4 7F081F94 8FAC005C */ lw $t4, 0x5c($sp) -/* 0B6AC8 7F081F98 E7AC0178 */ swc1 $f12, 0x178($sp) -.L7F081F9C: -/* 0B6ACC 7F081F9C 8FAC005C */ lw $t4, 0x5c($sp) -.L7F081FA0: -/* 0B6AD0 7F081FA0 318F8000 */ andi $t7, $t4, 0x8000 -/* 0B6AD4 7F081FA4 000F702B */ sltu $t6, $zero, $t7 -/* 0B6AD8 7F081FA8 15C00006 */ bnez $t6, .L7F081FC4 -/* 0B6ADC 7F081FAC AFAE004C */ sw $t6, 0x4c($sp) -/* 0B6AE0 7F081FB0 8FA20058 */ lw $v0, 0x58($sp) -/* 0B6AE4 7F081FB4 30588000 */ andi $t8, $v0, 0x8000 -/* 0B6AE8 7F081FB8 0018282B */ sltu $a1, $zero, $t8 -/* 0B6AEC 7F081FBC 50A00005 */ beql $a1, $zero, .L7F081FD4 -/* 0B6AF0 7F081FC0 8FAB0060 */ lw $t3, 0x60($sp) -.L7F081FC4: -/* 0B6AF4 7F081FC4 8FA50108 */ lw $a1, 0x108($sp) -/* 0B6AF8 7F081FC8 0005502B */ sltu $t2, $zero, $a1 -/* 0B6AFC 7F081FCC 01402825 */ move $a1, $t2 -/* 0B6B00 7F081FD0 8FAB0060 */ lw $t3, 0x60($sp) -.L7F081FD4: -/* 0B6B04 7F081FD4 AFA50174 */ sw $a1, 0x174($sp) -/* 0B6B08 7F081FD8 316D8000 */ andi $t5, $t3, 0x8000 -/* 0B6B0C 7F081FDC 000D602B */ sltu $t4, $zero, $t5 -/* 0B6B10 7F081FE0 15800006 */ bnez $t4, .L7F081FFC -/* 0B6B14 7F081FE4 AFAC0044 */ sw $t4, 0x44($sp) -/* 0B6B18 7F081FE8 8FA20050 */ lw $v0, 0x50($sp) -/* 0B6B1C 7F081FEC 304F8000 */ andi $t7, $v0, 0x8000 -/* 0B6B20 7F081FF0 000F282B */ sltu $a1, $zero, $t7 -/* 0B6B24 7F081FF4 50A00005 */ beql $a1, $zero, .L7F08200C -/* 0B6B28 7F081FF8 AFA50170 */ sw $a1, 0x170($sp) -.L7F081FFC: -/* 0B6B2C 7F081FFC 8FA5010C */ lw $a1, 0x10c($sp) -/* 0B6B30 7F082000 2CB80001 */ sltiu $t8, $a1, 1 -/* 0B6B34 7F082004 03002825 */ move $a1, $t8 -/* 0B6B38 7F082008 AFA50170 */ sw $a1, 0x170($sp) -.L7F08200C: -/* 0B6B3C 7F08200C AFA3016C */ sw $v1, 0x16c($sp) -/* 0B6B40 7F082010 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B6B44 7F082014 AFA30168 */ sw $v1, 0x168($sp) -/* 0B6B48 7F082018 00402025 */ move $a0, $v0 -/* 0B6B4C 7F08201C 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B6B50 7F082020 34058000 */ li $a1, 32768 -/* 0B6B54 7F082024 10400028 */ beqz $v0, .L7F0820C8 -/* 0B6B58 7F082028 00000000 */ nop -/* 0B6B5C 7F08202C 8E190000 */ lw $t9, ($s0) -/* 0B6B60 7F082030 8FA20110 */ lw $v0, 0x110($sp) -/* 0B6B64 7F082034 8F2A0124 */ lw $t2, 0x124($t9) -/* 0B6B68 7F082038 11400023 */ beqz $t2, .L7F0820C8 -/* 0B6B6C 7F08203C 00000000 */ nop -/* 0B6B70 7F082040 04410010 */ bgez $v0, .L7F082084 -/* 0B6B74 7F082044 00025823 */ negu $t3, $v0 -/* 0B6B78 7F082048 448B5000 */ mtc1 $t3, $f10 -/* 0B6B7C 7F08204C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6B80 7F082050 44811000 */ mtc1 $at, $f2 -/* 0B6B84 7F082054 468054A0 */ cvt.s.w $f18, $f10 -/* 0B6B88 7F082058 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B6B8C 7F08205C 44812000 */ mtc1 $at, $f4 -/* 0B6B90 7F082060 00000000 */ nop -/* 0B6B94 7F082064 46049303 */ div.s $f12, $f18, $f4 -/* 0B6B98 7F082068 460C103C */ c.lt.s $f2, $f12 -/* 0B6B9C 7F08206C 00000000 */ nop -/* 0B6BA0 7F082070 45020003 */ bc1fl .L7F082080 -/* 0B6BA4 7F082074 460C6300 */ add.s $f12, $f12, $f12 -/* 0B6BA8 7F082078 46001306 */ mov.s $f12, $f2 -/* 0B6BAC 7F08207C 460C6300 */ add.s $f12, $f12, $f12 -.L7F082080: -/* 0B6BB0 7F082080 E7AC0164 */ swc1 $f12, 0x164($sp) -.L7F082084: -/* 0B6BB4 7F082084 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6BB8 7F082088 44811000 */ mtc1 $at, $f2 -/* 0B6BBC 7F08208C 1840000E */ blez $v0, .L7F0820C8 -/* 0B6BC0 7F082090 C7AC0164 */ lwc1 $f12, 0x164($sp) -/* 0B6BC4 7F082094 44823000 */ mtc1 $v0, $f6 -/* 0B6BC8 7F082098 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B6BCC 7F08209C 44815000 */ mtc1 $at, $f10 -/* 0B6BD0 7F0820A0 46803220 */ cvt.s.w $f8, $f6 -/* 0B6BD4 7F0820A4 460A4383 */ div.s $f14, $f8, $f10 -/* 0B6BD8 7F0820A8 460E103C */ c.lt.s $f2, $f14 -/* 0B6BDC 7F0820AC 00000000 */ nop -/* 0B6BE0 7F0820B0 45020003 */ bc1fl .L7F0820C0 -/* 0B6BE4 7F0820B4 460E7380 */ add.s $f14, $f14, $f14 -/* 0B6BE8 7F0820B8 46001386 */ mov.s $f14, $f2 -/* 0B6BEC 7F0820BC 460E7380 */ add.s $f14, $f14, $f14 -.L7F0820C0: -/* 0B6BF0 7F0820C0 E7AC0164 */ swc1 $f12, 0x164($sp) -/* 0B6BF4 7F0820C4 E7AE0160 */ swc1 $f14, 0x160($sp) -.L7F0820C8: -/* 0B6BF8 7F0820C8 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B6BFC 7F0820CC 00002025 */ move $a0, $zero -/* 0B6C00 7F0820D0 00402025 */ move $a0, $v0 -/* 0B6C04 7F0820D4 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B6C08 7F0820D8 34058000 */ li $a1, 32768 -/* 0B6C0C 7F0820DC 2C450001 */ sltiu $a1, $v0, 1 -/* 0B6C10 7F0820E0 10A00009 */ beqz $a1, .L7F082108 -/* 0B6C14 7F0820E4 00002025 */ move $a0, $zero -/* 0B6C18 7F0820E8 8E0D0000 */ lw $t5, ($s0) -/* 0B6C1C 7F0820EC 8DA50124 */ lw $a1, 0x124($t5) -/* 0B6C20 7F0820F0 0005602B */ sltu $t4, $zero, $a1 -/* 0B6C24 7F0820F4 11800004 */ beqz $t4, .L7F082108 -/* 0B6C28 7F0820F8 01802825 */ move $a1, $t4 -/* 0B6C2C 7F0820FC 83A5011E */ lb $a1, 0x11e($sp) -/* 0B6C30 7F082100 28AFFFE2 */ slti $t7, $a1, -0x1e -/* 0B6C34 7F082104 01E02825 */ move $a1, $t7 -.L7F082108: -/* 0B6C38 7F082108 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B6C3C 7F08210C AFA5015C */ sw $a1, 0x15c($sp) -/* 0B6C40 7F082110 00402025 */ move $a0, $v0 -/* 0B6C44 7F082114 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B6C48 7F082118 34058000 */ li $a1, 32768 -/* 0B6C4C 7F08211C 2C450001 */ sltiu $a1, $v0, 1 -/* 0B6C50 7F082120 50A0000A */ beql $a1, $zero, .L7F08214C -/* 0B6C54 7F082124 8FAA004C */ lw $t2, 0x4c($sp) -/* 0B6C58 7F082128 8E0E0000 */ lw $t6, ($s0) -/* 0B6C5C 7F08212C 8DC50124 */ lw $a1, 0x124($t6) -/* 0B6C60 7F082130 0005C02B */ sltu $t8, $zero, $a1 -/* 0B6C64 7F082134 13000004 */ beqz $t8, .L7F082148 -/* 0B6C68 7F082138 03002825 */ move $a1, $t8 -/* 0B6C6C 7F08213C 83A5011E */ lb $a1, 0x11e($sp) -/* 0B6C70 7F082140 28B9001F */ slti $t9, $a1, 0x1f -/* 0B6C74 7F082144 3B250001 */ xori $a1, $t9, 1 -.L7F082148: -/* 0B6C78 7F082148 8FAA004C */ lw $t2, 0x4c($sp) -.L7F08214C: -/* 0B6C7C 7F08214C AFA50158 */ sw $a1, 0x158($sp) -/* 0B6C80 7F082150 8FAB0048 */ lw $t3, 0x48($sp) -/* 0B6C84 7F082154 11400002 */ beqz $t2, .L7F082160 -/* 0B6C88 7F082158 8FAD005C */ lw $t5, 0x5c($sp) -/* 0B6C8C 7F08215C 15600012 */ bnez $t3, .L7F0821A8 -.L7F082160: -/* 0B6C90 7F082160 31AC4000 */ andi $t4, $t5, 0x4000 -/* 0B6C94 7F082164 11800003 */ beqz $t4, .L7F082174 -/* 0B6C98 7F082168 8FAF0044 */ lw $t7, 0x44($sp) -/* 0B6C9C 7F08216C 15E0000E */ bnez $t7, .L7F0821A8 -/* 0B6CA0 7F082170 00000000 */ nop -.L7F082174: -/* 0B6CA4 7F082174 8FAE0058 */ lw $t6, 0x58($sp) -/* 0B6CA8 7F082178 8FB90050 */ lw $t9, 0x50($sp) -/* 0B6CAC 7F08217C 8FAB0058 */ lw $t3, 0x58($sp) -/* 0B6CB0 7F082180 31D88000 */ andi $t8, $t6, 0x8000 -/* 0B6CB4 7F082184 13000002 */ beqz $t8, .L7F082190 -/* 0B6CB8 7F082188 332A4000 */ andi $t2, $t9, 0x4000 -/* 0B6CBC 7F08218C 15400006 */ bnez $t2, .L7F0821A8 -.L7F082190: -/* 0B6CC0 7F082190 316D4000 */ andi $t5, $t3, 0x4000 -/* 0B6CC4 7F082194 11A0000D */ beqz $t5, .L7F0821CC -/* 0B6CC8 7F082198 8FAC0050 */ lw $t4, 0x50($sp) -/* 0B6CCC 7F08219C 318F8000 */ andi $t7, $t4, 0x8000 -/* 0B6CD0 7F0821A0 11E0000A */ beqz $t7, .L7F0821CC -/* 0B6CD4 7F0821A4 00000000 */ nop -.L7F0821A8: -/* 0B6CD8 7F0821A8 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B6CDC 7F0821AC 00002025 */ move $a0, $zero -/* 0B6CE0 7F0821B0 2401001D */ li $at, 29 -/* 0B6CE4 7F0821B4 14410005 */ bne $v0, $at, .L7F0821CC -/* 0B6CE8 7F0821B8 240E0001 */ li $t6, 1 -/* 0B6CEC 7F0821BC AFAE014C */ sw $t6, 0x14c($sp) -/* 0B6CF0 7F0821C0 AFA00174 */ sw $zero, 0x174($sp) -/* 0B6CF4 7F0821C4 AFA00170 */ sw $zero, 0x170($sp) -/* 0B6CF8 7F0821C8 AFA001B0 */ sw $zero, 0x1b0($sp) -.L7F0821CC: -/* 0B6CFC 7F0821CC 3C188003 */ lui $t8, %hi(in_tank_flag) -/* 0B6D00 7F0821D0 8F186448 */ lw $t8, %lo(in_tank_flag)($t8) -/* 0B6D04 7F0821D4 24010001 */ li $at, 1 -/* 0B6D08 7F0821D8 57010021 */ bnel $t8, $at, .L7F082260 -/* 0B6D0C 7F0821DC 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B6D10 7F0821E0 8E190000 */ lw $t9, ($s0) -/* 0B6D14 7F0821E4 8F2A0124 */ lw $t2, 0x124($t9) -/* 0B6D18 7F0821E8 5140001D */ beql $t2, $zero, .L7F082260 -/* 0B6D1C 7F0821EC 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B6D20 7F0821F0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B6D24 7F0821F4 00002025 */ move $a0, $zero -/* 0B6D28 7F0821F8 24010020 */ li $at, 32 -/* 0B6D2C 7F0821FC 14410008 */ bne $v0, $at, .L7F082220 -/* 0B6D30 7F082200 8FAC0124 */ lw $t4, 0x124($sp) -/* 0B6D34 7F082204 8FAB0124 */ lw $t3, 0x124($sp) -/* 0B6D38 7F082208 AFA00134 */ sw $zero, 0x134($sp) -/* 0B6D3C 7F08220C 8FAD012C */ lw $t5, 0x12c($sp) -/* 0B6D40 7F082210 55600011 */ bnezl $t3, .L7F082258 -/* 0B6D44 7F082214 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B6D48 7F082218 1000000E */ b .L7F082254 -/* 0B6D4C 7F08221C AFAD0124 */ sw $t5, 0x124($sp) -.L7F082220: -/* 0B6D50 7F082220 1580000C */ bnez $t4, .L7F082254 -/* 0B6D54 7F082224 C7B2017C */ lwc1 $f18, 0x17c($sp) -/* 0B6D58 7F082228 4612A03C */ c.lt.s $f20, $f18 -/* 0B6D5C 7F08222C 00000000 */ nop -/* 0B6D60 7F082230 45020003 */ bc1fl .L7F082240 -/* 0B6D64 7F082234 C7A40178 */ lwc1 $f4, 0x178($sp) -/* 0B6D68 7F082238 E7B2018C */ swc1 $f18, 0x18c($sp) -/* 0B6D6C 7F08223C C7A40178 */ lwc1 $f4, 0x178($sp) -.L7F082240: -/* 0B6D70 7F082240 4604A03C */ c.lt.s $f20, $f4 -/* 0B6D74 7F082244 00000000 */ nop -/* 0B6D78 7F082248 45020003 */ bc1fl .L7F082258 -/* 0B6D7C 7F08224C E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B6D80 7F082250 E7A40188 */ swc1 $f4, 0x188($sp) -.L7F082254: -/* 0B6D84 7F082254 E7B4017C */ swc1 $f20, 0x17c($sp) -.L7F082258: -/* 0B6D88 7F082258 E7B40178 */ swc1 $f20, 0x178($sp) -/* 0B6D8C 7F08225C 8FA2010C */ lw $v0, 0x10c($sp) -.L7F082260: -/* 0B6D90 7F082260 8E080000 */ lw $t0, ($s0) -/* 0B6D94 7F082264 240D0001 */ li $t5, 1 -/* 0B6D98 7F082268 0002282B */ sltu $a1, $zero, $v0 -/* 0B6D9C 7F08226C 50A0000E */ beql $a1, $zero, .L7F0822A8 -/* 0B6DA0 7F082270 97AC011C */ lhu $t4, 0x11c($sp) -/* 0B6DA4 7F082274 8D0501C8 */ lw $a1, 0x1c8($t0) -/* 0B6DA8 7F082278 8FA2005C */ lw $v0, 0x5c($sp) -/* 0B6DAC 7F08227C 2CAE0001 */ sltiu $t6, $a1, 1 -/* 0B6DB0 7F082280 11C00008 */ beqz $t6, .L7F0822A4 -/* 0B6DB4 7F082284 01C02825 */ move $a1, $t6 -/* 0B6DB8 7F082288 30588000 */ andi $t8, $v0, 0x8000 -/* 0B6DBC 7F08228C 2F050001 */ sltiu $a1, $t8, 1 -/* 0B6DC0 7F082290 50A00005 */ beql $a1, $zero, .L7F0822A8 -/* 0B6DC4 7F082294 97AC011C */ lhu $t4, 0x11c($sp) -/* 0B6DC8 7F082298 8FA50058 */ lw $a1, 0x58($sp) -/* 0B6DCC 7F08229C 30AA8000 */ andi $t2, $a1, 0x8000 -/* 0B6DD0 7F0822A0 2D450001 */ sltiu $a1, $t2, 1 -.L7F0822A4: -/* 0B6DD4 7F0822A4 97AC011C */ lhu $t4, 0x11c($sp) -.L7F0822A8: -/* 0B6DD8 7F0822A8 AFA501B4 */ sw $a1, 0x1b4($sp) -/* 0B6DDC 7F0822AC AFAD0140 */ sw $t5, 0x140($sp) -/* 0B6DE0 7F0822B0 100001C5 */ b .L7F0829C8 -/* 0B6DE4 7F0822B4 A50C03B6 */ sh $t4, 0x3b6($t0) -.L7F0822B8: -/* 0B6DE8 7F0822B8 0FC29370 */ jal cur_player_get_control_type -/* 0B6DEC 7F0822BC 00000000 */ nop -/* 0B6DF0 7F0822C0 24010002 */ li $at, 2 -/* 0B6DF4 7F0822C4 50410007 */ beql $v0, $at, .L7F0822E4 -/* 0B6DF8 7F0822C8 340F8000 */ li $t7, 32768 -/* 0B6DFC 7F0822CC 0FC29370 */ jal cur_player_get_control_type -/* 0B6E00 7F0822D0 00000000 */ nop -/* 0B6E04 7F0822D4 24010003 */ li $at, 3 -/* 0B6E08 7F0822D8 14410007 */ bne $v0, $at, .L7F0822F8 -/* 0B6E0C 7F0822DC 24182000 */ li $t8, 8192 -/* 0B6E10 7F0822E0 340F8000 */ li $t7, 32768 -.L7F0822E4: -/* 0B6E14 7F0822E4 240E0030 */ li $t6, 48 -/* 0B6E18 7F0822E8 A7AF00FE */ sh $t7, 0xfe($sp) -/* 0B6E1C 7F0822EC 24032000 */ li $v1, 8192 -/* 0B6E20 7F0822F0 10000005 */ b .L7F082308 -/* 0B6E24 7F0822F4 A7AE00FA */ sh $t6, 0xfa($sp) -.L7F0822F8: -/* 0B6E28 7F0822F8 34198000 */ li $t9, 32768 -/* 0B6E2C 7F0822FC A7B800FE */ sh $t8, 0xfe($sp) -/* 0B6E30 7F082300 24030030 */ li $v1, 48 -/* 0B6E34 7F082304 A7B900FA */ sh $t9, 0xfa($sp) -.L7F082308: -/* 0B6E38 7F082308 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0B6E3C 7F08230C A7A300FC */ sh $v1, 0xfc($sp) -/* 0B6E40 7F082310 14400193 */ bnez $v0, .L7F082960 -/* 0B6E44 7F082314 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B6E48 7F082318 0FC3092F */ jal sub_GAME_7F0C24BC -/* 0B6E4C 7F08231C A7A300FC */ sh $v1, 0xfc($sp) -/* 0B6E50 7F082320 1040018F */ beqz $v0, .L7F082960 -/* 0B6E54 7F082324 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B6E58 7F082328 97AB01CE */ lhu $t3, 0x1ce($sp) -/* 0B6E5C 7F08232C 8FAA005C */ lw $t2, 0x5c($sp) -/* 0B6E60 7F082330 A7A300FC */ sh $v1, 0xfc($sp) -/* 0B6E64 7F082334 01606827 */ not $t5, $t3 -/* 0B6E68 7F082338 014D6024 */ and $t4, $t2, $t5 -/* 0B6E6C 7F08233C 0FC293A0 */ jal cur_player_get_aim_control -/* 0B6E70 7F082340 AFAC0060 */ sw $t4, 0x60($sp) -/* 0B6E74 7F082344 14400007 */ bnez $v0, .L7F082364 -/* 0B6E78 7F082348 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B6E7C 7F08234C 8FAF005C */ lw $t7, 0x5c($sp) -/* 0B6E80 7F082350 8E190000 */ lw $t9, ($s0) -/* 0B6E84 7F082354 01E37024 */ and $t6, $t7, $v1 -/* 0B6E88 7F082358 000EC02B */ sltu $t8, $zero, $t6 -/* 0B6E8C 7F08235C 10000009 */ b .L7F082384 -/* 0B6E90 7F082360 AF380124 */ sw $t8, 0x124($t9) -.L7F082364: -/* 0B6E94 7F082364 8FAB0060 */ lw $t3, 0x60($sp) -/* 0B6E98 7F082368 01635024 */ and $t2, $t3, $v1 -/* 0B6E9C 7F08236C 51400006 */ beql $t2, $zero, .L7F082388 -/* 0B6EA0 7F082370 8E0C0000 */ lw $t4, ($s0) -/* 0B6EA4 7F082374 8E080000 */ lw $t0, ($s0) -/* 0B6EA8 7F082378 8D050124 */ lw $a1, 0x124($t0) -/* 0B6EAC 7F08237C 2CAD0001 */ sltiu $t5, $a1, 1 -/* 0B6EB0 7F082380 AD0D0124 */ sw $t5, 0x124($t0) -.L7F082384: -/* 0B6EB4 7F082384 8E0C0000 */ lw $t4, ($s0) -.L7F082388: -/* 0B6EB8 7F082388 8FA20060 */ lw $v0, 0x60($sp) -/* 0B6EBC 7F08238C 8D830124 */ lw $v1, 0x124($t4) -/* 0B6EC0 7F082390 304F4000 */ andi $t7, $v0, 0x4000 -/* 0B6EC4 7F082394 000F702B */ sltu $t6, $zero, $t7 -/* 0B6EC8 7F082398 2C650001 */ sltiu $a1, $v1, 1 -/* 0B6ECC 7F08239C AFA501BC */ sw $a1, 0x1bc($sp) -/* 0B6ED0 7F0823A0 AFA50148 */ sw $a1, 0x148($sp) -/* 0B6ED4 7F0823A4 AFAE01B0 */ sw $t6, 0x1b0($sp) -/* 0B6ED8 7F0823A8 AFAE0048 */ sw $t6, 0x48($sp) -/* 0B6EDC 7F0823AC 0FC29370 */ jal cur_player_get_control_type -/* 0B6EE0 7F0823B0 AFA301B8 */ sw $v1, 0x1b8($sp) -/* 0B6EE4 7F0823B4 24010001 */ li $at, 1 -/* 0B6EE8 7F0823B8 50410007 */ beql $v0, $at, .L7F0823D8 -/* 0B6EEC 7F0823BC 8FA2005C */ lw $v0, 0x5c($sp) -/* 0B6EF0 7F0823C0 0FC29370 */ jal cur_player_get_control_type -/* 0B6EF4 7F0823C4 00000000 */ nop -/* 0B6EF8 7F0823C8 24010003 */ li $at, 3 -/* 0B6EFC 7F0823CC 14410044 */ bne $v0, $at, .L7F0824E0 -/* 0B6F00 7F0823D0 8FA6005C */ lw $a2, 0x5c($sp) -/* 0B6F04 7F0823D4 8FA2005C */ lw $v0, 0x5c($sp) -.L7F0823D8: -/* 0B6F08 7F0823D8 3C048003 */ lui $a0, %hi(in_tank_flag) -/* 0B6F0C 7F0823DC 30460202 */ andi $a2, $v0, 0x202 -/* 0B6F10 7F0823E0 0006C02B */ sltu $t8, $zero, $a2 -/* 0B6F14 7F0823E4 13000014 */ beqz $t8, .L7F082438 -/* 0B6F18 7F0823E8 03003025 */ move $a2, $t8 -/* 0B6F1C 7F0823EC 8E190000 */ lw $t9, ($s0) -/* 0B6F20 7F0823F0 3C0A8003 */ lui $t2, %hi(in_tank_flag) -/* 0B6F24 7F0823F4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6F28 7F0823F8 8F2B0124 */ lw $t3, 0x124($t9) -/* 0B6F2C 7F0823FC 5560000C */ bnezl $t3, .L7F082430 -/* 0B6F30 7F082400 44814000 */ mtc1 $at, $f8 -/* 0B6F34 7F082404 8D4A6448 */ lw $t2, %lo(in_tank_flag)($t2) -/* 0B6F38 7F082408 24010001 */ li $at, 1 -/* 0B6F3C 7F08240C 240D0001 */ li $t5, 1 -/* 0B6F40 7F082410 15410004 */ bne $t2, $at, .L7F082424 -/* 0B6F44 7F082414 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6F48 7F082418 44813000 */ mtc1 $at, $f6 -/* 0B6F4C 7F08241C 10000006 */ b .L7F082438 -/* 0B6F50 7F082420 E7A6017C */ swc1 $f6, 0x17c($sp) -.L7F082424: -/* 0B6F54 7F082424 10000004 */ b .L7F082438 -/* 0B6F58 7F082428 AFAD0194 */ sw $t5, 0x194($sp) -/* 0B6F5C 7F08242C 44814000 */ mtc1 $at, $f8 -.L7F082430: -/* 0B6F60 7F082430 00000000 */ nop -/* 0B6F64 7F082434 E7A8018C */ swc1 $f8, 0x18c($sp) -.L7F082438: -/* 0B6F68 7F082438 304C0101 */ andi $t4, $v0, 0x101 -/* 0B6F6C 7F08243C 8E0E0000 */ lw $t6, ($s0) -/* 0B6F70 7F082440 000C782B */ sltu $t7, $zero, $t4 -/* 0B6F74 7F082444 AFAF0044 */ sw $t7, 0x44($sp) -/* 0B6F78 7F082448 8C846448 */ lw $a0, %lo(in_tank_flag)($a0) -/* 0B6F7C 7F08244C 11E0000F */ beqz $t7, .L7F08248C -/* 0B6F80 7F082450 8DC30124 */ lw $v1, 0x124($t6) -/* 0B6F84 7F082454 1460000A */ bnez $v1, .L7F082480 -/* 0B6F88 7F082458 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6F8C 7F08245C 24010001 */ li $at, 1 -/* 0B6F90 7F082460 14810005 */ bne $a0, $at, .L7F082478 -/* 0B6F94 7F082464 24180001 */ li $t8, 1 -/* 0B6F98 7F082468 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6F9C 7F08246C 44815000 */ mtc1 $at, $f10 -/* 0B6FA0 7F082470 10000006 */ b .L7F08248C -/* 0B6FA4 7F082474 E7AA0178 */ swc1 $f10, 0x178($sp) -.L7F082478: -/* 0B6FA8 7F082478 10000004 */ b .L7F08248C -/* 0B6FAC 7F08247C AFB80190 */ sw $t8, 0x190($sp) -.L7F082480: -/* 0B6FB0 7F082480 44819000 */ mtc1 $at, $f18 -/* 0B6FB4 7F082484 00000000 */ nop -/* 0B6FB8 7F082488 E7B20188 */ swc1 $f18, 0x188($sp) -.L7F08248C: -/* 0B6FBC 7F08248C 2C620001 */ sltiu $v0, $v1, 1 -/* 0B6FC0 7F082490 10400004 */ beqz $v0, .L7F0824A4 -/* 0B6FC4 7F082494 00402825 */ move $a1, $v0 -/* 0B6FC8 7F082498 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B6FCC 7F08249C 30B90808 */ andi $t9, $a1, 0x808 -/* 0B6FD0 7F0824A0 0019282B */ sltu $a1, $zero, $t9 -.L7F0824A4: -/* 0B6FD4 7F0824A4 AFA5019C */ sw $a1, 0x19c($sp) -/* 0B6FD8 7F0824A8 10400004 */ beqz $v0, .L7F0824BC -/* 0B6FDC 7F0824AC 00402825 */ move $a1, $v0 -/* 0B6FE0 7F0824B0 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B6FE4 7F0824B4 30AA0404 */ andi $t2, $a1, 0x404 -/* 0B6FE8 7F0824B8 000A282B */ sltu $a1, $zero, $t2 -.L7F0824BC: -/* 0B6FEC 7F0824BC AFA50198 */ sw $a1, 0x198($sp) -/* 0B6FF0 7F0824C0 24010001 */ li $at, 1 -/* 0B6FF4 7F0824C4 00402825 */ move $a1, $v0 -/* 0B6FF8 7F0824C8 14810003 */ bne $a0, $at, .L7F0824D8 -/* 0B6FFC 7F0824CC AFA201A0 */ sw $v0, 0x1a0($sp) -/* 0B7000 7F0824D0 10000034 */ b .L7F0825A4 -/* 0B7004 7F0824D4 AFA201A8 */ sw $v0, 0x1a8($sp) -.L7F0824D8: -/* 0B7008 7F0824D8 10000032 */ b .L7F0825A4 -/* 0B700C 7F0824DC AFA501A4 */ sw $a1, 0x1a4($sp) -.L7F0824E0: -/* 0B7010 7F0824E0 30CC0202 */ andi $t4, $a2, 0x202 -/* 0B7014 7F0824E4 000C302B */ sltu $a2, $zero, $t4 -/* 0B7018 7F0824E8 10C00004 */ beqz $a2, .L7F0824FC -/* 0B701C 7F0824EC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7020 7F0824F0 44812000 */ mtc1 $at, $f4 -/* 0B7024 7F0824F4 00000000 */ nop -/* 0B7028 7F0824F8 E7A4018C */ swc1 $f4, 0x18c($sp) -.L7F0824FC: -/* 0B702C 7F0824FC 8FA4005C */ lw $a0, 0x5c($sp) -/* 0B7030 7F082500 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7034 7F082504 308F0101 */ andi $t7, $a0, 0x101 -/* 0B7038 7F082508 000F202B */ sltu $a0, $zero, $t7 -/* 0B703C 7F08250C 50800005 */ beql $a0, $zero, .L7F082524 -/* 0B7040 7F082510 8E190000 */ lw $t9, ($s0) -/* 0B7044 7F082514 44813000 */ mtc1 $at, $f6 -/* 0B7048 7F082518 00000000 */ nop -/* 0B704C 7F08251C E7A60188 */ swc1 $f6, 0x188($sp) -/* 0B7050 7F082520 8E190000 */ lw $t9, ($s0) -.L7F082524: -/* 0B7054 7F082524 8F230124 */ lw $v1, 0x124($t9) -/* 0B7058 7F082528 2C620001 */ sltiu $v0, $v1, 1 -/* 0B705C 7F08252C 10400002 */ beqz $v0, .L7F082538 -/* 0B7060 7F082530 00402825 */ move $a1, $v0 -/* 0B7064 7F082534 00C02825 */ move $a1, $a2 -.L7F082538: -/* 0B7068 7F082538 AFA50194 */ sw $a1, 0x194($sp) -/* 0B706C 7F08253C 00402825 */ move $a1, $v0 -/* 0B7070 7F082540 10400003 */ beqz $v0, .L7F082550 -/* 0B7074 7F082544 AFA40044 */ sw $a0, 0x44($sp) -/* 0B7078 7F082548 00802825 */ move $a1, $a0 -/* 0B707C 7F08254C AFA40044 */ sw $a0, 0x44($sp) -.L7F082550: -/* 0B7080 7F082550 AFA50190 */ sw $a1, 0x190($sp) -/* 0B7084 7F082554 00402825 */ move $a1, $v0 -/* 0B7088 7F082558 14600009 */ bnez $v1, .L7F082580 -/* 0B708C 7F08255C AFA201AC */ sw $v0, 0x1ac($sp) -/* 0B7090 7F082560 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B7094 7F082564 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7098 7F082568 316A0808 */ andi $t2, $t3, 0x808 -/* 0B709C 7F08256C 11400004 */ beqz $t2, .L7F082580 -/* 0B70A0 7F082570 00000000 */ nop -/* 0B70A4 7F082574 44814000 */ mtc1 $at, $f8 -/* 0B70A8 7F082578 00000000 */ nop -/* 0B70AC 7F08257C E7A80184 */ swc1 $f8, 0x184($sp) -.L7F082580: -/* 0B70B0 7F082580 14600007 */ bnez $v1, .L7F0825A0 -/* 0B70B4 7F082584 8FAD005C */ lw $t5, 0x5c($sp) -/* 0B70B8 7F082588 31AC0404 */ andi $t4, $t5, 0x404 -/* 0B70BC 7F08258C 11800004 */ beqz $t4, .L7F0825A0 -/* 0B70C0 7F082590 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B70C4 7F082594 44815000 */ mtc1 $at, $f10 -/* 0B70C8 7F082598 00000000 */ nop -/* 0B70CC 7F08259C E7AA0180 */ swc1 $f10, 0x180($sp) -.L7F0825A0: -/* 0B70D0 7F0825A0 AFA501A4 */ sw $a1, 0x1a4($sp) -.L7F0825A4: -/* 0B70D4 7F0825A4 10600014 */ beqz $v1, .L7F0825F8 -/* 0B70D8 7F0825A8 00000000 */ nop -/* 0B70DC 7F0825AC 83AE01C7 */ lb $t6, 0x1c7($sp) -/* 0B70E0 7F0825B0 29C1003D */ slti $at, $t6, 0x3d -/* 0B70E4 7F0825B4 14200010 */ bnez $at, .L7F0825F8 -/* 0B70E8 7F0825B8 25CFFFC4 */ addiu $t7, $t6, -0x3c -/* 0B70EC 7F0825BC 448F9000 */ mtc1 $t7, $f18 -/* 0B70F0 7F0825C0 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B70F4 7F0825C4 44811000 */ mtc1 $at, $f2 -/* 0B70F8 7F0825C8 46809120 */ cvt.s.w $f4, $f18 -/* 0B70FC 7F0825CC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7100 7F0825D0 44813000 */ mtc1 $at, $f6 -/* 0B7104 7F0825D4 3C013F80 */ lui $at, 0x3f80 -/* 0B7108 7F0825D8 46022003 */ div.s $f0, $f4, $f2 -/* 0B710C 7F0825DC 4600303C */ c.lt.s $f6, $f0 -/* 0B7110 7F0825E0 E7A00184 */ swc1 $f0, 0x184($sp) -/* 0B7114 7F0825E4 4502001A */ bc1fl .L7F082650 -/* 0B7118 7F0825E8 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B711C 7F0825EC 44814000 */ mtc1 $at, $f8 -/* 0B7120 7F0825F0 10000016 */ b .L7F08264C -/* 0B7124 7F0825F4 E7A80184 */ swc1 $f8, 0x184($sp) -.L7F0825F8: -/* 0B7128 7F0825F8 10600014 */ beqz $v1, .L7F08264C -/* 0B712C 7F0825FC 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B7130 7F082600 2B01FFC4 */ slti $at, $t8, -0x3c -/* 0B7134 7F082604 10200011 */ beqz $at, .L7F08264C -/* 0B7138 7F082608 2419FFC4 */ li $t9, -60 -/* 0B713C 7F08260C 03385823 */ subu $t3, $t9, $t8 -/* 0B7140 7F082610 448B5000 */ mtc1 $t3, $f10 -/* 0B7144 7F082614 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B7148 7F082618 44811000 */ mtc1 $at, $f2 -/* 0B714C 7F08261C 468054A0 */ cvt.s.w $f18, $f10 -/* 0B7150 7F082620 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7154 7F082624 44812000 */ mtc1 $at, $f4 -/* 0B7158 7F082628 3C013F80 */ lui $at, 0x3f80 -/* 0B715C 7F08262C 46029003 */ div.s $f0, $f18, $f2 -/* 0B7160 7F082630 4600203C */ c.lt.s $f4, $f0 -/* 0B7164 7F082634 E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B7168 7F082638 45020005 */ bc1fl .L7F082650 -/* 0B716C 7F08263C 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B7170 7F082640 44813000 */ mtc1 $at, $f6 -/* 0B7174 7F082644 00000000 */ nop -/* 0B7178 7F082648 E7A60180 */ swc1 $f6, 0x180($sp) -.L7F08264C: -/* 0B717C 7F08264C 3C014120 */ li $at, 0x41200000 # 10.000000 -.L7F082650: -/* 0B7180 7F082650 44811000 */ mtc1 $at, $f2 -/* 0B7184 7F082654 10600013 */ beqz $v1, .L7F0826A4 -/* 0B7188 7F082658 00000000 */ nop -/* 0B718C 7F08265C 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B7190 7F082660 240AFFC4 */ li $t2, -60 -/* 0B7194 7F082664 2841FFC4 */ slti $at, $v0, -0x3c -/* 0B7198 7F082668 1020000E */ beqz $at, .L7F0826A4 -/* 0B719C 7F08266C 01426823 */ subu $t5, $t2, $v0 -/* 0B71A0 7F082670 448D4000 */ mtc1 $t5, $f8 -/* 0B71A4 7F082674 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B71A8 7F082678 44819000 */ mtc1 $at, $f18 -/* 0B71AC 7F08267C 468042A0 */ cvt.s.w $f10, $f8 -/* 0B71B0 7F082680 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B71B4 7F082684 46025003 */ div.s $f0, $f10, $f2 -/* 0B71B8 7F082688 4600903C */ c.lt.s $f18, $f0 -/* 0B71BC 7F08268C E7A0017C */ swc1 $f0, 0x17c($sp) -/* 0B71C0 7F082690 45000004 */ bc1f .L7F0826A4 -/* 0B71C4 7F082694 00000000 */ nop -/* 0B71C8 7F082698 44812000 */ mtc1 $at, $f4 -/* 0B71CC 7F08269C 00000000 */ nop -/* 0B71D0 7F0826A0 E7A4017C */ swc1 $f4, 0x17c($sp) -.L7F0826A4: -/* 0B71D4 7F0826A4 10600011 */ beqz $v1, .L7F0826EC -/* 0B71D8 7F0826A8 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B71DC 7F0826AC 2841003D */ slti $at, $v0, 0x3d -/* 0B71E0 7F0826B0 1420000E */ bnez $at, .L7F0826EC -/* 0B71E4 7F0826B4 244CFFC4 */ addiu $t4, $v0, -0x3c -/* 0B71E8 7F0826B8 448C3000 */ mtc1 $t4, $f6 -/* 0B71EC 7F0826BC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B71F0 7F0826C0 44815000 */ mtc1 $at, $f10 -/* 0B71F4 7F0826C4 46803220 */ cvt.s.w $f8, $f6 -/* 0B71F8 7F0826C8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B71FC 7F0826CC 46024003 */ div.s $f0, $f8, $f2 -/* 0B7200 7F0826D0 4600503C */ c.lt.s $f10, $f0 -/* 0B7204 7F0826D4 E7A00178 */ swc1 $f0, 0x178($sp) -/* 0B7208 7F0826D8 45020005 */ bc1fl .L7F0826F0 -/* 0B720C 7F0826DC 97A200FA */ lhu $v0, 0xfa($sp) -/* 0B7210 7F0826E0 44819000 */ mtc1 $at, $f18 -/* 0B7214 7F0826E4 00000000 */ nop -/* 0B7218 7F0826E8 E7B20178 */ swc1 $f18, 0x178($sp) -.L7F0826EC: -/* 0B721C 7F0826EC 97A200FA */ lhu $v0, 0xfa($sp) -.L7F0826F0: -/* 0B7220 7F0826F0 8FAE005C */ lw $t6, 0x5c($sp) -/* 0B7224 7F0826F4 01C22024 */ and $a0, $t6, $v0 -/* 0B7228 7F0826F8 0004282B */ sltu $a1, $zero, $a0 -/* 0B722C 7F0826FC 10A00006 */ beqz $a1, .L7F082718 -/* 0B7230 7F082700 AFA5004C */ sw $a1, 0x4c($sp) -/* 0B7234 7F082704 8FB90060 */ lw $t9, 0x60($sp) -/* 0B7238 7F082708 97B800FE */ lhu $t8, 0xfe($sp) -/* 0B723C 7F08270C 03382824 */ and $a1, $t9, $t8 -/* 0B7240 7F082710 0005582B */ sltu $t3, $zero, $a1 -/* 0B7244 7F082714 01602825 */ move $a1, $t3 -.L7F082718: -/* 0B7248 7F082718 8FAA0060 */ lw $t2, 0x60($sp) -/* 0B724C 7F08271C AFA50174 */ sw $a1, 0x174($sp) -/* 0B7250 7F082720 01422024 */ and $a0, $t2, $v0 -/* 0B7254 7F082724 0004282B */ sltu $a1, $zero, $a0 -/* 0B7258 7F082728 10A00006 */ beqz $a1, .L7F082744 -/* 0B725C 7F08272C AFA50040 */ sw $a1, 0x40($sp) -/* 0B7260 7F082730 8FAC005C */ lw $t4, 0x5c($sp) -/* 0B7264 7F082734 97AE00FE */ lhu $t6, 0xfe($sp) -/* 0B7268 7F082738 018E2824 */ and $a1, $t4, $t6 -/* 0B726C 7F08273C 2CAF0001 */ sltiu $t7, $a1, 1 -/* 0B7270 7F082740 01E02825 */ move $a1, $t7 -.L7F082744: -/* 0B7274 7F082744 AFA50170 */ sw $a1, 0x170($sp) -/* 0B7278 7F082748 AFA3016C */ sw $v1, 0x16c($sp) -/* 0B727C 7F08274C AFA30168 */ sw $v1, 0x168($sp) -/* 0B7280 7F082750 00002025 */ move $a0, $zero -/* 0B7284 7F082754 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B7288 7F082758 AFA60050 */ sw $a2, 0x50($sp) -/* 0B728C 7F08275C 00402025 */ move $a0, $v0 -/* 0B7290 7F082760 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B7294 7F082764 34058000 */ li $a1, 32768 -/* 0B7298 7F082768 10400013 */ beqz $v0, .L7F0827B8 -/* 0B729C 7F08276C 8FA60050 */ lw $a2, 0x50($sp) -/* 0B72A0 7F082770 8E190000 */ lw $t9, ($s0) -/* 0B72A4 7F082774 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B72A8 7F082778 8F380124 */ lw $t8, 0x124($t9) -/* 0B72AC 7F08277C 31620808 */ andi $v0, $t3, 0x808 -/* 0B72B0 7F082780 0002502B */ sltu $t2, $zero, $v0 -/* 0B72B4 7F082784 1300000C */ beqz $t8, .L7F0827B8 -/* 0B72B8 7F082788 316D0404 */ andi $t5, $t3, 0x404 -/* 0B72BC 7F08278C 11A00005 */ beqz $t5, .L7F0827A4 -/* 0B72C0 7F082790 01401025 */ move $v0, $t2 -/* 0B72C4 7F082794 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B72C8 7F082798 44812000 */ mtc1 $at, $f4 -/* 0B72CC 7F08279C 00000000 */ nop -/* 0B72D0 7F0827A0 E7A40164 */ swc1 $f4, 0x164($sp) -.L7F0827A4: -/* 0B72D4 7F0827A4 10400004 */ beqz $v0, .L7F0827B8 -/* 0B72D8 7F0827A8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B72DC 7F0827AC 44813000 */ mtc1 $at, $f6 -/* 0B72E0 7F0827B0 00000000 */ nop -/* 0B72E4 7F0827B4 E7A60160 */ swc1 $f6, 0x160($sp) -.L7F0827B8: -/* 0B72E8 7F0827B8 00002025 */ move $a0, $zero -/* 0B72EC 7F0827BC 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B72F0 7F0827C0 AFA60050 */ sw $a2, 0x50($sp) -/* 0B72F4 7F0827C4 00402025 */ move $a0, $v0 -/* 0B72F8 7F0827C8 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B72FC 7F0827CC 34058000 */ li $a1, 32768 -/* 0B7300 7F0827D0 2C450001 */ sltiu $a1, $v0, 1 -/* 0B7304 7F0827D4 10A00009 */ beqz $a1, .L7F0827FC -/* 0B7308 7F0827D8 8FA60050 */ lw $a2, 0x50($sp) -/* 0B730C 7F0827DC 8E0C0000 */ lw $t4, ($s0) -/* 0B7310 7F0827E0 8D850124 */ lw $a1, 0x124($t4) -/* 0B7314 7F0827E4 0005702B */ sltu $t6, $zero, $a1 -/* 0B7318 7F0827E8 11C00004 */ beqz $t6, .L7F0827FC -/* 0B731C 7F0827EC 01C02825 */ move $a1, $t6 -/* 0B7320 7F0827F0 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B7324 7F0827F4 30AF0404 */ andi $t7, $a1, 0x404 -/* 0B7328 7F0827F8 000F282B */ sltu $a1, $zero, $t7 -.L7F0827FC: -/* 0B732C 7F0827FC AFA5015C */ sw $a1, 0x15c($sp) -/* 0B7330 7F082800 00002025 */ move $a0, $zero -/* 0B7334 7F082804 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B7338 7F082808 AFA60050 */ sw $a2, 0x50($sp) -/* 0B733C 7F08280C 00402025 */ move $a0, $v0 -/* 0B7340 7F082810 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B7344 7F082814 34058000 */ li $a1, 32768 -/* 0B7348 7F082818 2C450001 */ sltiu $a1, $v0, 1 -/* 0B734C 7F08281C 10A0000A */ beqz $a1, .L7F082848 -/* 0B7350 7F082820 8FA60050 */ lw $a2, 0x50($sp) -/* 0B7354 7F082824 8E180000 */ lw $t8, ($s0) -/* 0B7358 7F082828 8F050124 */ lw $a1, 0x124($t8) -/* 0B735C 7F08282C 0005502B */ sltu $t2, $zero, $a1 -/* 0B7360 7F082830 11400005 */ beqz $t2, .L7F082848 -/* 0B7364 7F082834 01402825 */ move $a1, $t2 -/* 0B7368 7F082838 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B736C 7F08283C 00A02827 */ not $a1, $a1 -/* 0B7370 7F082840 30AB0808 */ andi $t3, $a1, 0x808 -/* 0B7374 7F082844 000B282B */ sltu $a1, $zero, $t3 -.L7F082848: -/* 0B7378 7F082848 8E0C0000 */ lw $t4, ($s0) -/* 0B737C 7F08284C AFA50158 */ sw $a1, 0x158($sp) -/* 0B7380 7F082850 8D820124 */ lw $v0, 0x124($t4) -/* 0B7384 7F082854 0002282B */ sltu $a1, $zero, $v0 -/* 0B7388 7F082858 10A00002 */ beqz $a1, .L7F082864 -/* 0B738C 7F08285C 00A01025 */ move $v0, $a1 -/* 0B7390 7F082860 00C02825 */ move $a1, $a2 -.L7F082864: -/* 0B7394 7F082864 AFA50154 */ sw $a1, 0x154($sp) -/* 0B7398 7F082868 10400002 */ beqz $v0, .L7F082874 -/* 0B739C 7F08286C 00402825 */ move $a1, $v0 -/* 0B73A0 7F082870 8FA50044 */ lw $a1, 0x44($sp) -.L7F082874: -/* 0B73A4 7F082874 8FAF004C */ lw $t7, 0x4c($sp) -/* 0B73A8 7F082878 AFA50150 */ sw $a1, 0x150($sp) -/* 0B73AC 7F08287C 8FB90048 */ lw $t9, 0x48($sp) -/* 0B73B0 7F082880 11E00002 */ beqz $t7, .L7F08288C -/* 0B73B4 7F082884 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B73B8 7F082888 17200005 */ bnez $t9, .L7F0828A0 -.L7F08288C: -/* 0B73BC 7F08288C 330A4000 */ andi $t2, $t8, 0x4000 -/* 0B73C0 7F082890 1140000C */ beqz $t2, .L7F0828C4 -/* 0B73C4 7F082894 8FAB0040 */ lw $t3, 0x40($sp) -/* 0B73C8 7F082898 1160000A */ beqz $t3, .L7F0828C4 -/* 0B73CC 7F08289C 00000000 */ nop -.L7F0828A0: -/* 0B73D0 7F0828A0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B73D4 7F0828A4 00002025 */ move $a0, $zero -/* 0B73D8 7F0828A8 2401001D */ li $at, 29 -/* 0B73DC 7F0828AC 14410005 */ bne $v0, $at, .L7F0828C4 -/* 0B73E0 7F0828B0 240D0001 */ li $t5, 1 -/* 0B73E4 7F0828B4 AFAD014C */ sw $t5, 0x14c($sp) -/* 0B73E8 7F0828B8 AFA00174 */ sw $zero, 0x174($sp) -/* 0B73EC 7F0828BC AFA00170 */ sw $zero, 0x170($sp) -/* 0B73F0 7F0828C0 AFA001B0 */ sw $zero, 0x1b0($sp) -.L7F0828C4: -/* 0B73F4 7F0828C4 3C0C8003 */ lui $t4, %hi(in_tank_flag) -/* 0B73F8 7F0828C8 8D8C6448 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B73FC 7F0828CC 24010001 */ li $at, 1 -/* 0B7400 7F0828D0 55810024 */ bnel $t4, $at, .L7F082964 -/* 0B7404 7F0828D4 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B7408 7F0828D8 8E0E0000 */ lw $t6, ($s0) -/* 0B740C 7F0828DC 8DCF0124 */ lw $t7, 0x124($t6) -/* 0B7410 7F0828E0 51E00020 */ beql $t7, $zero, .L7F082964 -/* 0B7414 7F0828E4 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B7418 7F0828E8 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B741C 7F0828EC 00002025 */ move $a0, $zero -/* 0B7420 7F0828F0 24010020 */ li $at, 32 -/* 0B7424 7F0828F4 14410005 */ bne $v0, $at, .L7F08290C -/* 0B7428 7F0828F8 C7A8018C */ lwc1 $f8, 0x18c($sp) -/* 0B742C 7F0828FC 24190001 */ li $t9, 1 -/* 0B7430 7F082900 AFA00134 */ sw $zero, 0x134($sp) -/* 0B7434 7F082904 10000014 */ b .L7F082958 -/* 0B7438 7F082908 AFB901A8 */ sw $t9, 0x1a8($sp) -.L7F08290C: -/* 0B743C 7F08290C 46144032 */ c.eq.s $f8, $f20 -/* 0B7440 7F082910 C7AA0188 */ lwc1 $f10, 0x188($sp) -/* 0B7444 7F082914 45020011 */ bc1fl .L7F08295C -/* 0B7448 7F082918 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B744C 7F08291C 46145032 */ c.eq.s $f10, $f20 -/* 0B7450 7F082920 C7B2017C */ lwc1 $f18, 0x17c($sp) -/* 0B7454 7F082924 4502000D */ bc1fl .L7F08295C -/* 0B7458 7F082928 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B745C 7F08292C 4612A03C */ c.lt.s $f20, $f18 -/* 0B7460 7F082930 00000000 */ nop -/* 0B7464 7F082934 45020003 */ bc1fl .L7F082944 -/* 0B7468 7F082938 C7A40178 */ lwc1 $f4, 0x178($sp) -/* 0B746C 7F08293C E7B2018C */ swc1 $f18, 0x18c($sp) -/* 0B7470 7F082940 C7A40178 */ lwc1 $f4, 0x178($sp) -.L7F082944: -/* 0B7474 7F082944 4604A03C */ c.lt.s $f20, $f4 -/* 0B7478 7F082948 00000000 */ nop -/* 0B747C 7F08294C 45020003 */ bc1fl .L7F08295C -/* 0B7480 7F082950 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B7484 7F082954 E7A40188 */ swc1 $f4, 0x188($sp) -.L7F082958: -/* 0B7488 7F082958 E7B4017C */ swc1 $f20, 0x17c($sp) -.L7F08295C: -/* 0B748C 7F08295C E7B40178 */ swc1 $f20, 0x178($sp) -.L7F082960: -/* 0B7490 7F082960 8FB8005C */ lw $t8, 0x5c($sp) -.L7F082964: -/* 0B7494 7F082964 97AA00FE */ lhu $t2, 0xfe($sp) -/* 0B7498 7F082968 030A1024 */ and $v0, $t8, $t2 -/* 0B749C 7F08296C 0002282B */ sltu $a1, $zero, $v0 -/* 0B74A0 7F082970 10A0000A */ beqz $a1, .L7F08299C -/* 0B74A4 7F082974 00000000 */ nop -/* 0B74A8 7F082978 8E0D0000 */ lw $t5, ($s0) -/* 0B74AC 7F08297C 97AE00FA */ lhu $t6, 0xfa($sp) -/* 0B74B0 7F082980 8DA501C8 */ lw $a1, 0x1c8($t5) -/* 0B74B4 7F082984 2CAC0001 */ sltiu $t4, $a1, 1 -/* 0B74B8 7F082988 11800004 */ beqz $t4, .L7F08299C -/* 0B74BC 7F08298C 01802825 */ move $a1, $t4 -/* 0B74C0 7F082990 030E2824 */ and $a1, $t8, $t6 -/* 0B74C4 7F082994 2CAF0001 */ sltiu $t7, $a1, 1 -/* 0B74C8 7F082998 01E02825 */ move $a1, $t7 -.L7F08299C: -/* 0B74CC 7F08299C 0FC29370 */ jal cur_player_get_control_type -/* 0B74D0 7F0829A0 AFA501B4 */ sw $a1, 0x1b4($sp) -/* 0B74D4 7F0829A4 24010001 */ li $at, 1 -/* 0B74D8 7F0829A8 50410006 */ beql $v0, $at, .L7F0829C4 -/* 0B74DC 7F0829AC 24190001 */ li $t9, 1 -/* 0B74E0 7F0829B0 0FC29370 */ jal cur_player_get_control_type -/* 0B74E4 7F0829B4 00000000 */ nop -/* 0B74E8 7F0829B8 24010003 */ li $at, 3 -/* 0B74EC 7F0829BC 14410002 */ bne $v0, $at, .L7F0829C8 -/* 0B74F0 7F0829C0 24190001 */ li $t9, 1 -.L7F0829C4: -/* 0B74F4 7F0829C4 AFB90140 */ sw $t9, 0x140($sp) -.L7F0829C8: -/* 0B74F8 7F0829C8 8E0A0000 */ lw $t2, ($s0) -.L7F0829CC: -/* 0B74FC 7F0829CC AD4000D0 */ sw $zero, 0xd0($t2) -/* 0B7500 7F0829D0 8FAB01B0 */ lw $t3, 0x1b0($sp) -/* 0B7504 7F0829D4 11600095 */ beqz $t3, .L7F082C2C -/* 0B7508 7F0829D8 3C0D8003 */ lui $t5, %hi(in_tank_flag) -/* 0B750C 7F0829DC 8DAD6448 */ lw $t5, %lo(in_tank_flag)($t5) -/* 0B7510 7F0829E0 24010001 */ li $at, 1 -/* 0B7514 7F0829E4 3C0C8003 */ lui $t4, %hi(ptr_playerstank) -/* 0B7518 7F0829E8 15A1002E */ bne $t5, $at, .L7F082AA4 -/* 0B751C 7F0829EC 3C028003 */ lui $v0, %hi(ptr_playerstank) -/* 0B7520 7F0829F0 8D8C6450 */ lw $t4, %lo(ptr_playerstank)($t4) -/* 0B7524 7F0829F4 24040020 */ li $a0, 32 -/* 0B7528 7F0829F8 8D980004 */ lw $t8, 4($t4) -/* 0B752C 7F0829FC 0FC1A514 */ jal get_ammo_count_for_weapon -/* 0B7530 7F082A00 AFB800F4 */ sw $t8, 0xf4($sp) -/* 0B7534 7F082A04 8FAE00F4 */ lw $t6, 0xf4($sp) -/* 0B7538 7F082A08 24040020 */ li $a0, 32 -/* 0B753C 7F082A0C 00002825 */ move $a1, $zero -/* 0B7540 7F082A10 0FC1A521 */ jal add_ammo_to_weapon -/* 0B7544 7F082A14 ADC200D8 */ sw $v0, 0xd8($t6) -/* 0B7548 7F082A18 0FC23187 */ jal bondinvRemoveItemByID -/* 0B754C 7F082A1C 24040020 */ li $a0, 32 -/* 0B7550 7F082A20 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B7554 7F082A24 00002025 */ move $a0, $zero -/* 0B7558 7F082A28 24010020 */ li $at, 32 -/* 0B755C 7F082A2C 54410009 */ bnel $v0, $at, .L7F082A54 -/* 0B7560 7F082A30 8FAA00F4 */ lw $t2, 0xf4($sp) -/* 0B7564 7F082A34 0FC1A4D1 */ jal get_ammo_in_hands_magazine -/* 0B7568 7F082A38 00002025 */ move $a0, $zero -/* 0B756C 7F082A3C 8FA300F4 */ lw $v1, 0xf4($sp) -/* 0B7570 7F082A40 8C6F00D8 */ lw $t7, 0xd8($v1) -/* 0B7574 7F082A44 01E2C821 */ addu $t9, $t7, $v0 -/* 0B7578 7F082A48 0FC17600 */ jal autoadvance_on_deplete_all_ammo -/* 0B757C 7F082A4C AC7900D8 */ sw $t9, 0xd8($v1) -/* 0B7580 7F082A50 8FAA00F4 */ lw $t2, 0xf4($sp) -.L7F082A54: -/* 0B7584 7F082A54 3C018003 */ lui $at, %hi(in_tank_flag) -/* 0B7588 7F082A58 00001025 */ move $v0, $zero -/* 0B758C 7F082A5C AD4000C4 */ sw $zero, 0xc4($t2) -/* 0B7590 7F082A60 AC206448 */ sw $zero, %lo(in_tank_flag)($at) -/* 0B7594 7F082A64 8E0B0000 */ lw $t3, ($s0) -/* 0B7598 7F082A68 2403000C */ li $v1, 12 -/* 0B759C 7F082A6C E574016C */ swc1 $f20, 0x16c($t3) -/* 0B75A0 7F082A70 8E0D0000 */ lw $t5, ($s0) -/* 0B75A4 7F082A74 E5B40174 */ swc1 $f20, 0x174($t5) -/* 0B75A8 7F082A78 8E0C0000 */ lw $t4, ($s0) -/* 0B75AC 7F082A7C E594014C */ swc1 $f20, 0x14c($t4) -.L7F082A80: -/* 0B75B0 7F082A80 8E180000 */ lw $t8, ($s0) -/* 0B75B4 7F082A84 03027021 */ addu $t6, $t8, $v0 -/* 0B75B8 7F082A88 24420004 */ addiu $v0, $v0, 4 -/* 0B75BC 7F082A8C 1443FFFC */ bne $v0, $v1, .L7F082A80 -/* 0B75C0 7F082A90 E5D40180 */ swc1 $f20, 0x180($t6) -/* 0B75C4 7F082A94 8E190000 */ lw $t9, ($s0) -/* 0B75C8 7F082A98 240F0002 */ li $t7, 2 -/* 0B75CC 7F082A9C 10000063 */ b .L7F082C2C -/* 0B75D0 7F082AA0 AF2F009C */ sw $t7, 0x9c($t9) -.L7F082AA4: -/* 0B75D4 7F082AA4 8C426450 */ lw $v0, %lo(ptr_playerstank)($v0) -/* 0B75D8 7F082AA8 5040005E */ beql $v0, $zero, .L7F082C24 -/* 0B75DC 7F082AAC 8E0D0000 */ lw $t5, ($s0) -/* 0B75E0 7F082AB0 904A0000 */ lbu $t2, ($v0) -/* 0B75E4 7F082AB4 24010001 */ li $at, 1 -/* 0B75E8 7F082AB8 5541005A */ bnel $t2, $at, .L7F082C24 -/* 0B75EC 7F082ABC 8E0D0000 */ lw $t5, ($s0) -/* 0B75F0 7F082AC0 8C450004 */ lw $a1, 4($v0) -/* 0B75F4 7F082AC4 2401002D */ li $at, 45 -/* 0B75F8 7F082AC8 3C0D8003 */ lui $t5, %hi(g_BondCanEnterTank) -/* 0B75FC 7F082ACC 90AB0003 */ lbu $t3, 3($a1) -/* 0B7600 7F082AD0 55610054 */ bnel $t3, $at, .L7F082C24 -/* 0B7604 7F082AD4 8E0D0000 */ lw $t5, ($s0) -/* 0B7608 7F082AD8 8DAD6480 */ lw $t5, %lo(g_BondCanEnterTank)($t5) -/* 0B760C 7F082ADC 24040020 */ li $a0, 32 -/* 0B7610 7F082AE0 51A00050 */ beql $t5, $zero, .L7F082C24 -/* 0B7614 7F082AE4 8E0D0000 */ lw $t5, ($s0) -/* 0B7618 7F082AE8 0FC23122 */ jal bondinvAddInvItem -/* 0B761C 7F082AEC AFA500EC */ sw $a1, 0xec($sp) -/* 0B7620 7F082AF0 8FA300EC */ lw $v1, 0xec($sp) -/* 0B7624 7F082AF4 24040020 */ li $a0, 32 -/* 0B7628 7F082AF8 0FC1A521 */ jal add_ammo_to_weapon -/* 0B762C 7F082AFC 8C6500D8 */ lw $a1, 0xd8($v1) -/* 0B7630 7F082B00 8FA300EC */ lw $v1, 0xec($sp) -/* 0B7634 7F082B04 3C048003 */ lui $a0, %hi(g_TankTurretVerticalAngle) -/* 0B7638 7F082B08 2484646C */ addiu $a0, %lo(g_TankTurretVerticalAngle) # addiu $a0, $a0, 0x646c -/* 0B763C 7F082B0C C46600C8 */ lwc1 $f6, 0xc8($v1) -/* 0B7640 7F082B10 AC6000D8 */ sw $zero, 0xd8($v1) -/* 0B7644 7F082B14 3C018005 */ lui $at, %hi(D_80055120) -/* 0B7648 7F082B18 E4860000 */ swc1 $f6, ($a0) -/* 0B764C 7F082B1C C42A5120 */ lwc1 $f10, %lo(D_80055120)($at) -/* 0B7650 7F082B20 C4880000 */ lwc1 $f8, ($a0) -/* 0B7654 7F082B24 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngleRelated) -/* 0B7658 7F082B28 3C058003 */ lui $a1, %hi(g_TankTurretOrientationAngleRad) -/* 0B765C 7F082B2C 460A4483 */ div.s $f18, $f8, $f10 -/* 0B7660 7F082B30 24A56474 */ addiu $a1, %lo(g_TankTurretOrientationAngleRad) # addiu $a1, $a1, 0x6474 -/* 0B7664 7F082B34 240C0001 */ li $t4, 1 -/* 0B7668 7F082B38 24190001 */ li $t9, 1 -/* 0B766C 7F082B3C 3C028008 */ lui $v0, %hi(g_EnterTankCoord) -/* 0B7670 7F082B40 244299D0 */ addiu $v0, %lo(g_EnterTankCoord) # addiu $v0, $v0, -0x6630 -/* 0B7674 7F082B44 E4326470 */ swc1 $f18, %lo(g_TankTurretVerticalAngleRelated)($at) -/* 0B7678 7F082B48 C46400CC */ lwc1 $f4, 0xcc($v1) -/* 0B767C 7F082B4C 3C018003 */ lui $at, %hi(g_TankTurretAngle) -/* 0B7680 7F082B50 E4246484 */ swc1 $f4, %lo(g_TankTurretAngle)($at) -/* 0B7684 7F082B54 C46600CC */ lwc1 $f6, 0xcc($v1) -/* 0B7688 7F082B58 3C018005 */ lui $at, %hi(D_80055124) -/* 0B768C 7F082B5C E4A60000 */ swc1 $f6, ($a1) -/* 0B7690 7F082B60 C42A5124 */ lwc1 $f10, %lo(D_80055124)($at) -/* 0B7694 7F082B64 C4A80000 */ lwc1 $f8, ($a1) -/* 0B7698 7F082B68 3C018003 */ lui $at, %hi(D_80036478) -/* 0B769C 7F082B6C 460A4483 */ div.s $f18, $f8, $f10 -/* 0B76A0 7F082B70 E4326478 */ swc1 $f18, %lo(D_80036478)($at) -/* 0B76A4 7F082B74 3C018003 */ lui $at, %hi(D_8003647C) -/* 0B76A8 7F082B78 E434647C */ swc1 $f20, %lo(D_8003647C)($at) -/* 0B76AC 7F082B7C C46400DC */ lwc1 $f4, 0xdc($v1) -/* 0B76B0 7F082B80 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B76B4 7F082B84 E4246464 */ swc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B76B8 7F082B88 3C018003 */ lui $at, %hi(g_TankTurnSpeed) -/* 0B76BC 7F082B8C E4346460 */ swc1 $f20, %lo(g_TankTurnSpeed)($at) -/* 0B76C0 7F082B90 3C018003 */ lui $at, %hi(in_tank_flag) -/* 0B76C4 7F082B94 AC2C6448 */ sw $t4, %lo(in_tank_flag)($at) -/* 0B76C8 7F082B98 3C018008 */ lui $at, %hi(g_EnterTankAudioState) -/* 0B76CC 7F082B9C AC2099B8 */ sw $zero, %lo(g_EnterTankAudioState)($at) -/* 0B76D0 7F082BA0 8E180000 */ lw $t8, ($s0) -/* 0B76D4 7F082BA4 3C018008 */ lui $at, %hi(g_TankEnteringSitHeight) -/* 0B76D8 7F082BA8 E714016C */ swc1 $f20, 0x16c($t8) -/* 0B76DC 7F082BAC 8E0E0000 */ lw $t6, ($s0) -/* 0B76E0 7F082BB0 E5D40174 */ swc1 $f20, 0x174($t6) -/* 0B76E4 7F082BB4 8E0F0000 */ lw $t7, ($s0) -/* 0B76E8 7F082BB8 E5F4014C */ swc1 $f20, 0x14c($t7) -/* 0B76EC 7F082BBC 8E0A0000 */ lw $t2, ($s0) -/* 0B76F0 7F082BC0 AD59009C */ sw $t9, 0x9c($t2) -/* 0B76F4 7F082BC4 E43499BC */ swc1 $f20, %lo(g_TankEnteringSitHeight)($at) -/* 0B76F8 7F082BC8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B76FC 7F082BCC 44813000 */ mtc1 $at, $f6 -/* 0B7700 7F082BD0 3C018008 */ lui $at, %hi(g_TankEnteringSitHeightRemain) -/* 0B7704 7F082BD4 E42699C0 */ swc1 $f6, %lo(g_TankEnteringSitHeightRemain)($at) -/* 0B7708 7F082BD8 8E080000 */ lw $t0, ($s0) -/* 0B770C 7F082BDC 3C018008 */ lui $at, %hi(g_TankEnterBondHorizAngleDeg) -/* 0B7710 7F082BE0 C5080148 */ lwc1 $f8, 0x148($t0) -/* 0B7714 7F082BE4 E42899C4 */ swc1 $f8, %lo(g_TankEnterBondHorizAngleDeg)($at) -/* 0B7718 7F082BE8 C50A0158 */ lwc1 $f10, 0x158($t0) -/* 0B771C 7F082BEC 3C018008 */ lui $at, %hi(g_TankEnterBondVertAngleDeg) -/* 0B7720 7F082BF0 E42A99C8 */ swc1 $f10, %lo(g_TankEnterBondVertAngleDeg)($at) -/* 0B7724 7F082BF4 C512048C */ lwc1 $f18, 0x48c($t0) -/* 0B7728 7F082BF8 3C018003 */ lui $at, %hi(D_80036490) -/* 0B772C 7F082BFC E4520000 */ swc1 $f18, ($v0) -/* 0B7730 7F082C00 C5040490 */ lwc1 $f4, 0x490($t0) -/* 0B7734 7F082C04 E4440004 */ swc1 $f4, 4($v0) -/* 0B7738 7F082C08 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B773C 7F082C0C E4460008 */ swc1 $f6, 8($v0) -/* 0B7740 7F082C10 0FC1F1ED */ jal sub_GAME_7F07C7B4 -/* 0B7744 7F082C14 AC206490 */ sw $zero, %lo(D_80036490)($at) -/* 0B7748 7F082C18 10000005 */ b .L7F082C30 -/* 0B774C 7F082C1C 8FAC0144 */ lw $t4, 0x144($sp) -/* 0B7750 7F082C20 8E0D0000 */ lw $t5, ($s0) -.L7F082C24: -/* 0B7754 7F082C24 240B0001 */ li $t3, 1 -/* 0B7758 7F082C28 ADAB00D0 */ sw $t3, 0xd0($t5) -.L7F082C2C: -/* 0B775C 7F082C2C 8FAC0144 */ lw $t4, 0x144($sp) -.L7F082C30: -/* 0B7760 7F082C30 1580000B */ bnez $t4, .L7F082C60 -/* 0B7764 7F082C34 00000000 */ nop -/* 0B7768 7F082C38 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B776C 7F082C3C 8FAF0128 */ lw $t7, 0x128($sp) -/* 0B7770 7F082C40 C7A00184 */ lwc1 $f0, 0x184($sp) -/* 0B7774 7F082C44 C7A80180 */ lwc1 $f8, 0x180($sp) -/* 0B7778 7F082C48 00187023 */ negu $t6, $t8 -/* 0B777C 7F082C4C 000FC823 */ negu $t9, $t7 -/* 0B7780 7F082C50 AFAE0130 */ sw $t6, 0x130($sp) -/* 0B7784 7F082C54 AFB90128 */ sw $t9, 0x128($sp) -/* 0B7788 7F082C58 E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B778C 7F082C5C E7A80184 */ swc1 $f8, 0x184($sp) -.L7F082C60: -/* 0B7790 7F082C60 0FC227A9 */ jal bondviewGetIfCurrentPlayerDamageShowTime -/* 0B7794 7F082C64 00000000 */ nop -/* 0B7798 7F082C68 10400007 */ beqz $v0, .L7F082C88 -/* 0B779C 7F082C6C 00000000 */ nop -/* 0B77A0 7F082C70 0FC26919 */ jal getPlayerCount -/* 0B77A4 7F082C74 00000000 */ nop -/* 0B77A8 7F082C78 24010001 */ li $at, 1 -/* 0B77AC 7F082C7C 14410002 */ bne $v0, $at, .L7F082C88 -/* 0B77B0 7F082C80 00000000 */ nop -/* 0B77B4 7F082C84 AFA001B4 */ sw $zero, 0x1b4($sp) -.L7F082C88: -/* 0B77B8 7F082C88 0FC19D08 */ jal sub_GAME_7F067420 -/* 0B77BC 7F082C8C 8FA401B4 */ lw $a0, 0x1b4($sp) -/* 0B77C0 7F082C90 0FC227DD */ jal bondviewGetVisibleToGuardsFlag -/* 0B77C4 7F082C94 00000000 */ nop -/* 0B77C8 7F082C98 50400028 */ beql $v0, $zero, .L7F082D3C -/* 0B77CC 7F082C9C 24040002 */ li $a0, 2 -/* 0B77D0 7F082CA0 0FC17722 */ jal get_hands_firing_status -/* 0B77D4 7F082CA4 00002025 */ move $a0, $zero -/* 0B77D8 7F082CA8 54400006 */ bnezl $v0, .L7F082CC4 -/* 0B77DC 7F082CAC E7B400E4 */ swc1 $f20, 0xe4($sp) -/* 0B77E0 7F082CB0 0FC17722 */ jal get_hands_firing_status -/* 0B77E4 7F082CB4 24040001 */ li $a0, 1 -/* 0B77E8 7F082CB8 50400020 */ beql $v0, $zero, .L7F082D3C -/* 0B77EC 7F082CBC 24040002 */ li $a0, 2 -/* 0B77F0 7F082CC0 E7B400E4 */ swc1 $f20, 0xe4($sp) -.L7F082CC4: -/* 0B77F4 7F082CC4 0FC17722 */ jal get_hands_firing_status -/* 0B77F8 7F082CC8 00002025 */ move $a0, $zero -/* 0B77FC 7F082CCC 1040000A */ beqz $v0, .L7F082CF8 -/* 0B7800 7F082CD0 00000000 */ nop -/* 0B7804 7F082CD4 0FC19C5D */ jal getCurrentPlayerNoise -/* 0B7808 7F082CD8 00002025 */ move $a0, $zero -/* 0B780C 7F082CDC 4600A03C */ c.lt.s $f20, $f0 -/* 0B7810 7F082CE0 00000000 */ nop -/* 0B7814 7F082CE4 45000004 */ bc1f .L7F082CF8 -/* 0B7818 7F082CE8 00000000 */ nop -/* 0B781C 7F082CEC 0FC19C5D */ jal getCurrentPlayerNoise -/* 0B7820 7F082CF0 00002025 */ move $a0, $zero -/* 0B7824 7F082CF4 E7A000E4 */ swc1 $f0, 0xe4($sp) -.L7F082CF8: -/* 0B7828 7F082CF8 0FC17722 */ jal get_hands_firing_status -/* 0B782C 7F082CFC 24040001 */ li $a0, 1 -/* 0B7830 7F082D00 1040000B */ beqz $v0, .L7F082D30 -/* 0B7834 7F082D04 00000000 */ nop -/* 0B7838 7F082D08 0FC19C5D */ jal getCurrentPlayerNoise -/* 0B783C 7F082D0C 24040001 */ li $a0, 1 -/* 0B7840 7F082D10 C7AA00E4 */ lwc1 $f10, 0xe4($sp) -/* 0B7844 7F082D14 4600503C */ c.lt.s $f10, $f0 -/* 0B7848 7F082D18 00000000 */ nop -/* 0B784C 7F082D1C 45000004 */ bc1f .L7F082D30 -/* 0B7850 7F082D20 00000000 */ nop -/* 0B7854 7F082D24 0FC19C5D */ jal getCurrentPlayerNoise -/* 0B7858 7F082D28 24040001 */ li $a0, 1 -/* 0B785C 7F082D2C E7A000E4 */ swc1 $f0, 0xe4($sp) -.L7F082D30: -/* 0B7860 7F082D30 0FC08BBB */ jal chrCheckGuardsHeardSound -/* 0B7864 7F082D34 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 0B7868 7F082D38 24040002 */ li $a0, 2 -.L7F082D3C: -/* 0B786C 7F082D3C 0FC1A96A */ jal set_unset_bitflags -/* 0B7870 7F082D40 8FA5016C */ lw $a1, 0x16c($sp) -/* 0B7874 7F082D44 C7B20164 */ lwc1 $f18, 0x164($sp) -/* 0B7878 7F082D48 4612A03C */ c.lt.s $f20, $f18 -/* 0B787C 7F082D4C 00000000 */ nop -/* 0B7880 7F082D50 45020004 */ bc1fl .L7F082D64 -/* 0B7884 7F082D54 C7A40160 */ lwc1 $f4, 0x160($sp) -/* 0B7888 7F082D58 0FC17769 */ jal camera_sniper_zoom_in -/* 0B788C 7F082D5C 46009306 */ mov.s $f12, $f18 -/* 0B7890 7F082D60 C7A40160 */ lwc1 $f4, 0x160($sp) -.L7F082D64: -/* 0B7894 7F082D64 4604A03C */ c.lt.s $f20, $f4 -/* 0B7898 7F082D68 00000000 */ nop -/* 0B789C 7F082D6C 45020004 */ bc1fl .L7F082D80 -/* 0B78A0 7F082D70 8E0A0000 */ lw $t2, ($s0) -/* 0B78A4 7F082D74 0FC177A5 */ jal camera_sniper_zoom_out -/* 0B78A8 7F082D78 46002306 */ mov.s $f12, $f4 -/* 0B78AC 7F082D7C 8E0A0000 */ lw $t2, ($s0) -.L7F082D80: -/* 0B78B0 7F082D80 8FAD0168 */ lw $t5, 0x168($sp) -/* 0B78B4 7F082D84 8D4B01C8 */ lw $t3, 0x1c8($t2) -/* 0B78B8 7F082D88 15600011 */ bnez $t3, .L7F082DD0 -/* 0B78BC 7F082D8C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B78C0 7F082D90 44816000 */ mtc1 $at, $f12 -/* 0B78C4 7F082D94 11A0000A */ beqz $t5, .L7F082DC0 -/* 0B78C8 7F082D98 00000000 */ nop -/* 0B78CC 7F082D9C 0FC1774E */ jal get_item_in_hand_zoom -/* 0B78D0 7F082DA0 00000000 */ nop -/* 0B78D4 7F082DA4 4614003E */ c.le.s $f0, $f20 -/* 0B78D8 7F082DA8 46000306 */ mov.s $f12, $f0 -/* 0B78DC 7F082DAC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B78E0 7F082DB0 45000003 */ bc1f .L7F082DC0 -/* 0B78E4 7F082DB4 00000000 */ nop -/* 0B78E8 7F082DB8 44816000 */ mtc1 $at, $f12 -/* 0B78EC 7F082DBC 00000000 */ nop -.L7F082DC0: -/* 0B78F0 7F082DC0 0FC1F91B */ jal bondviewTriggerWatchZoom -/* 0B78F4 7F082DC4 00000000 */ nop -/* 0B78F8 7F082DC8 0FC1F98B */ jal bondviewUpdateWatchZoomIn -/* 0B78FC 7F082DCC 00000000 */ nop -.L7F082DD0: -/* 0B7900 7F082DD0 3C0C8003 */ lui $t4, %hi(in_tank_flag) -/* 0B7904 7F082DD4 8D8C6448 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B7908 7F082DD8 24010001 */ li $at, 1 -/* 0B790C 7F082DDC 8FAE0194 */ lw $t6, 0x194($sp) -/* 0B7910 7F082DE0 158100C6 */ bne $t4, $at, .L7F0830FC -/* 0B7914 7F082DE4 3C028003 */ lui $v0, %hi(g_TankTurretTurn) -/* 0B7918 7F082DE8 24426488 */ addiu $v0, %lo(g_TankTurretTurn) # addiu $v0, $v0, 0x6488 -/* 0B791C 7F082DEC E4540000 */ swc1 $f20, ($v0) -/* 0B7920 7F082DF0 3C188008 */ lui $t8, %hi(g_EnterTankAudioState) -/* 0B7924 7F082DF4 8F1899B8 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B7928 7F082DF8 24010002 */ li $at, 2 -/* 0B792C 7F082DFC C7A60188 */ lwc1 $f6, 0x188($sp) -/* 0B7930 7F082E00 170100BC */ bne $t8, $at, .L7F0830F4 -/* 0B7934 7F082E04 00000000 */ nop -/* 0B7938 7F082E08 4606A03C */ c.lt.s $f20, $f6 -/* 0B793C 7F082E0C 8E080000 */ lw $t0, ($s0) -/* 0B7940 7F082E10 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7944 7F082E14 C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 0B7948 7F082E18 4502000B */ bc1fl .L7F082E48 -/* 0B794C 7F082E1C 460AA03C */ c.lt.s $f20, $f10 -/* 0B7950 7F082E20 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B7954 7F082E24 3C018005 */ lui $at, %hi(D_80055128) -/* 0B7958 7F082E28 C4325128 */ lwc1 $f18, %lo(D_80055128)($at) -/* 0B795C 7F082E2C 46064282 */ mul.s $f10, $f8, $f6 -/* 0B7960 7F082E30 C4480000 */ lwc1 $f8, ($v0) -/* 0B7964 7F082E34 46125102 */ mul.s $f4, $f10, $f18 -/* 0B7968 7F082E38 46044180 */ add.s $f6, $f8, $f4 -/* 0B796C 7F082E3C 10000031 */ b .L7F082F04 -/* 0B7970 7F082E40 E4460000 */ swc1 $f6, ($v0) -/* 0B7974 7F082E44 460AA03C */ c.lt.s $f20, $f10 -.L7F082E48: -/* 0B7978 7F082E48 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B797C 7F082E4C 8FAE01A8 */ lw $t6, 0x1a8($sp) -/* 0B7980 7F082E50 4500000A */ bc1f .L7F082E7C -/* 0B7984 7F082E54 00000000 */ nop -/* 0B7988 7F082E58 C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B798C 7F082E5C 3C018005 */ lui $at, %hi(D_8005512C) -/* 0B7990 7F082E60 C424512C */ lwc1 $f4, %lo(D_8005512C)($at) -/* 0B7994 7F082E64 460A9202 */ mul.s $f8, $f18, $f10 -/* 0B7998 7F082E68 C4520000 */ lwc1 $f18, ($v0) -/* 0B799C 7F082E6C 46044182 */ mul.s $f6, $f8, $f4 -/* 0B79A0 7F082E70 46069281 */ sub.s $f10, $f18, $f6 -/* 0B79A4 7F082E74 10000023 */ b .L7F082F04 -/* 0B79A8 7F082E78 E44A0000 */ swc1 $f10, ($v0) -.L7F082E7C: -/* 0B79AC 7F082E7C 11C00021 */ beqz $t6, .L7F082F04 -/* 0B79B0 7F082E80 8FAF0124 */ lw $t7, 0x124($sp) -/* 0B79B4 7F082E84 448F4000 */ mtc1 $t7, $f8 -/* 0B79B8 7F082E88 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B79BC 7F082E8C 44819000 */ mtc1 $at, $f18 -/* 0B79C0 7F082E90 46804120 */ cvt.s.w $f4, $f8 -/* 0B79C4 7F082E94 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B79C8 7F082E98 44813000 */ mtc1 $at, $f6 -/* 0B79CC 7F082E9C 3C013F80 */ lui $at, 0x3f80 -/* 0B79D0 7F082EA0 46122083 */ div.s $f2, $f4, $f18 -/* 0B79D4 7F082EA4 4602303C */ c.lt.s $f6, $f2 -/* 0B79D8 7F082EA8 00000000 */ nop -/* 0B79DC 7F082EAC 45020004 */ bc1fl .L7F082EC0 -/* 0B79E0 7F082EB0 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B79E4 7F082EB4 44811000 */ mtc1 $at, $f2 -/* 0B79E8 7F082EB8 00000000 */ nop -/* 0B79EC 7F082EBC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F082EC0: -/* 0B79F0 7F082EC0 44815000 */ mtc1 $at, $f10 -/* 0B79F4 7F082EC4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B79F8 7F082EC8 460A103C */ c.lt.s $f2, $f10 -/* 0B79FC 7F082ECC 00000000 */ nop -/* 0B7A00 7F082ED0 45000003 */ bc1f .L7F082EE0 -/* 0B7A04 7F082ED4 00000000 */ nop -/* 0B7A08 7F082ED8 44811000 */ mtc1 $at, $f2 -/* 0B7A0C 7F082EDC 00000000 */ nop -.L7F082EE0: -/* 0B7A10 7F082EE0 3C018005 */ lui $at, %hi(D_80055130) -/* 0B7A14 7F082EE4 C4285130 */ lwc1 $f8, %lo(D_80055130)($at) -/* 0B7A18 7F082EE8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7A1C 7F082EEC C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B7A20 7F082EF0 46024102 */ mul.s $f4, $f8, $f2 -/* 0B7A24 7F082EF4 C44A0000 */ lwc1 $f10, ($v0) -/* 0B7A28 7F082EF8 46122182 */ mul.s $f6, $f4, $f18 -/* 0B7A2C 7F082EFC 46065200 */ add.s $f8, $f10, $f6 -/* 0B7A30 7F082F00 E4480000 */ swc1 $f8, ($v0) -.L7F082F04: -/* 0B7A34 7F082F04 8D190124 */ lw $t9, 0x124($t0) -/* 0B7A38 7F082F08 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7A3C 7F082F0C 8FAA01AC */ lw $t2, 0x1ac($sp) -/* 0B7A40 7F082F10 17200078 */ bnez $t9, .L7F0830F4 -/* 0B7A44 7F082F14 00000000 */ nop -/* 0B7A48 7F082F18 44811000 */ mtc1 $at, $f2 -/* 0B7A4C 7F082F1C 4600A006 */ mov.s $f0, $f20 -/* 0B7A50 7F082F20 11400009 */ beqz $t2, .L7F082F48 -/* 0B7A54 7F082F24 46001386 */ mov.s $f14, $f2 -/* 0B7A58 7F082F28 8FA90120 */ lw $t1, 0x120($sp) -/* 0B7A5C 7F082F2C 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B7A60 7F082F30 44815000 */ mtc1 $at, $f10 -/* 0B7A64 7F082F34 44892000 */ mtc1 $t1, $f4 -/* 0B7A68 7F082F38 00000000 */ nop -/* 0B7A6C 7F082F3C 468024A0 */ cvt.s.w $f18, $f4 -/* 0B7A70 7F082F40 1000000B */ b .L7F082F70 -/* 0B7A74 7F082F44 460A9003 */ div.s $f0, $f18, $f10 -.L7F082F48: -/* 0B7A78 7F082F48 8FAB019C */ lw $t3, 0x19c($sp) -/* 0B7A7C 7F082F4C 8FAD0198 */ lw $t5, 0x198($sp) -/* 0B7A80 7F082F50 11600003 */ beqz $t3, .L7F082F60 -/* 0B7A84 7F082F54 00000000 */ nop -/* 0B7A88 7F082F58 10000005 */ b .L7F082F70 -/* 0B7A8C 7F082F5C 46001006 */ mov.s $f0, $f2 -.L7F082F60: -/* 0B7A90 7F082F60 11A00003 */ beqz $t5, .L7F082F70 -/* 0B7A94 7F082F64 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B7A98 7F082F68 44810000 */ mtc1 $at, $f0 -/* 0B7A9C 7F082F6C 00000000 */ nop -.L7F082F70: -/* 0B7AA0 7F082F70 4600103C */ c.lt.s $f2, $f0 -/* 0B7AA4 7F082F74 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B7AA8 7F082F78 3C0C8005 */ lui $t4, %hi(g_ClockTimer) -/* 0B7AAC 7F082F7C 45020004 */ bc1fl .L7F082F90 -/* 0B7AB0 7F082F80 44813000 */ mtc1 $at, $f6 -/* 0B7AB4 7F082F84 10000009 */ b .L7F082FAC -/* 0B7AB8 7F082F88 46001006 */ mov.s $f0, $f2 -/* 0B7ABC 7F082F8C 44813000 */ mtc1 $at, $f6 -.L7F082F90: -/* 0B7AC0 7F082F90 3C01BF80 */ lui $at, 0xbf80 -/* 0B7AC4 7F082F94 4606003C */ c.lt.s $f0, $f6 -/* 0B7AC8 7F082F98 00000000 */ nop -/* 0B7ACC 7F082F9C 45020004 */ bc1fl .L7F082FB0 -/* 0B7AD0 7F082FA0 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0B7AD4 7F082FA4 44810000 */ mtc1 $at, $f0 -/* 0B7AD8 7F082FA8 00000000 */ nop -.L7F082FAC: -/* 0B7ADC 7F082FAC 3C014170 */ li $at, 0x41700000 # 15.000000 -.L7F082FB0: -/* 0B7AE0 7F082FB0 44818000 */ mtc1 $at, $f16 -/* 0B7AE4 7F082FB4 3C038003 */ lui $v1, %hi(D_80036490) -/* 0B7AE8 7F082FB8 24636490 */ addiu $v1, %lo(D_80036490) # addiu $v1, $v1, 0x6490 -/* 0B7AEC 7F082FBC 46100302 */ mul.s $f12, $f0, $f16 -/* 0B7AF0 7F082FC0 8C620000 */ lw $v0, ($v1) -/* 0B7AF4 7F082FC4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B7AF8 7F082FC8 18400008 */ blez $v0, .L7F082FEC -/* 0B7AFC 7F082FCC 46006086 */ mov.s $f2, $f12 -/* 0B7B00 7F082FD0 44814000 */ mtc1 $at, $f8 -/* 0B7B04 7F082FD4 8D8C8374 */ lw $t4, %lo(g_ClockTimer)($t4) -/* 0B7B08 7F082FD8 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B7B0C 7F082FDC 44817000 */ mtc1 $at, $f14 -/* 0B7B10 7F082FE0 004CC023 */ subu $t8, $v0, $t4 -/* 0B7B14 7F082FE4 46086082 */ mul.s $f2, $f12, $f8 -/* 0B7B18 7F082FE8 AC780000 */ sw $t8, ($v1) -.L7F082FEC: -/* 0B7B1C 7F082FEC C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B7B20 7F082FF0 46001032 */ c.eq.s $f2, $f0 -/* 0B7B24 7F082FF4 00000000 */ nop -/* 0B7B28 7F082FF8 4501003E */ bc1t .L7F0830F4 -/* 0B7B2C 7F082FFC 00000000 */ nop -/* 0B7B30 7F083000 4602003C */ c.lt.s $f0, $f2 -/* 0B7B34 7F083004 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B7B38 7F083008 4502001D */ bc1fl .L7F083080 -/* 0B7B3C 7F08300C 4600103C */ c.lt.s $f2, $f0 -/* 0B7B40 7F083010 46001101 */ sub.s $f4, $f2, $f0 -/* 0B7B44 7F083014 44819000 */ mtc1 $at, $f18 -/* 0B7B48 7F083018 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B7B4C 7F08301C 44814000 */ mtc1 $at, $f8 -/* 0B7B50 7F083020 46122282 */ mul.s $f10, $f4, $f18 -/* 0B7B54 7F083024 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B7B58 7F083028 46105183 */ div.s $f6, $f10, $f16 -/* 0B7B5C 7F08302C 44815000 */ mtc1 $at, $f10 -/* 0B7B60 7F083030 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B7B64 7F083034 46083100 */ add.s $f4, $f6, $f8 -/* 0B7B68 7F083038 44814000 */ mtc1 $at, $f8 -/* 0B7B6C 7F08303C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7B70 7F083040 460E2482 */ mul.s $f18, $f4, $f14 -/* 0B7B74 7F083044 C4248378 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B7B78 7F083048 460A9182 */ mul.s $f6, $f18, $f10 -/* 0B7B7C 7F08304C 46083303 */ div.s $f12, $f6, $f8 -/* 0B7B80 7F083050 46046482 */ mul.s $f18, $f12, $f4 -/* 0B7B84 7F083054 46120280 */ add.s $f10, $f0, $f18 -/* 0B7B88 7F083058 E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B7B8C 7F08305C 8E080000 */ lw $t0, ($s0) -/* 0B7B90 7F083060 C5060174 */ lwc1 $f6, 0x174($t0) -/* 0B7B94 7F083064 4606103C */ c.lt.s $f2, $f6 -/* 0B7B98 7F083068 00000000 */ nop -/* 0B7B9C 7F08306C 45000021 */ bc1f .L7F0830F4 -/* 0B7BA0 7F083070 00000000 */ nop -/* 0B7BA4 7F083074 1000001F */ b .L7F0830F4 -/* 0B7BA8 7F083078 E5020174 */ swc1 $f2, 0x174($t0) -/* 0B7BAC 7F08307C 4600103C */ c.lt.s $f2, $f0 -.L7F083080: -/* 0B7BB0 7F083080 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B7BB4 7F083084 4500001B */ bc1f .L7F0830F4 -/* 0B7BB8 7F083088 00000000 */ nop -/* 0B7BBC 7F08308C 46020201 */ sub.s $f8, $f0, $f2 -/* 0B7BC0 7F083090 44812000 */ mtc1 $at, $f4 -/* 0B7BC4 7F083094 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B7BC8 7F083098 44813000 */ mtc1 $at, $f6 -/* 0B7BCC 7F08309C 46044482 */ mul.s $f18, $f8, $f4 -/* 0B7BD0 7F0830A0 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B7BD4 7F0830A4 46109283 */ div.s $f10, $f18, $f16 -/* 0B7BD8 7F0830A8 44819000 */ mtc1 $at, $f18 -/* 0B7BDC 7F0830AC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B7BE0 7F0830B0 46065200 */ add.s $f8, $f10, $f6 -/* 0B7BE4 7F0830B4 44813000 */ mtc1 $at, $f6 -/* 0B7BE8 7F0830B8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7BEC 7F0830BC 460E4102 */ mul.s $f4, $f8, $f14 -/* 0B7BF0 7F0830C0 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B7BF4 7F0830C4 46122282 */ mul.s $f10, $f4, $f18 -/* 0B7BF8 7F0830C8 46065303 */ div.s $f12, $f10, $f6 -/* 0B7BFC 7F0830CC 46086102 */ mul.s $f4, $f12, $f8 -/* 0B7C00 7F0830D0 46040480 */ add.s $f18, $f0, $f4 -/* 0B7C04 7F0830D4 E5120174 */ swc1 $f18, 0x174($t0) -/* 0B7C08 7F0830D8 8E080000 */ lw $t0, ($s0) -/* 0B7C0C 7F0830DC C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0B7C10 7F0830E0 4602503C */ c.lt.s $f10, $f2 -/* 0B7C14 7F0830E4 00000000 */ nop -/* 0B7C18 7F0830E8 45000002 */ bc1f .L7F0830F4 -/* 0B7C1C 7F0830EC 00000000 */ nop -/* 0B7C20 7F0830F0 E5020174 */ swc1 $f2, 0x174($t0) -.L7F0830F4: -/* 0B7C24 7F0830F4 100000A7 */ b .L7F083394 -/* 0B7C28 7F0830F8 8E080000 */ lw $t0, ($s0) -.L7F0830FC: -/* 0B7C2C 7F0830FC 11C00005 */ beqz $t6, .L7F083114 -/* 0B7C30 7F083100 8FAF0190 */ lw $t7, 0x190($sp) -/* 0B7C34 7F083104 0FC1FF31 */ jal sub_GAME_7F07FCC4 -/* 0B7C38 7F083108 2404FFFF */ li $a0, -1 -/* 0B7C3C 7F08310C 1000000A */ b .L7F083138 -/* 0B7C40 7F083110 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F083114: -/* 0B7C44 7F083114 11E00005 */ beqz $t7, .L7F08312C -/* 0B7C48 7F083118 00000000 */ nop -/* 0B7C4C 7F08311C 0FC1FF31 */ jal sub_GAME_7F07FCC4 -/* 0B7C50 7F083120 24040001 */ li $a0, 1 -/* 0B7C54 7F083124 10000004 */ b .L7F083138 -/* 0B7C58 7F083128 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F08312C: -/* 0B7C5C 7F08312C 0FC1FF31 */ jal sub_GAME_7F07FCC4 -/* 0B7C60 7F083130 00002025 */ move $a0, $zero -/* 0B7C64 7F083134 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F083138: -/* 0B7C68 7F083138 8FAA0124 */ lw $t2, 0x124($sp) -/* 0B7C6C 7F08313C 53200009 */ beql $t9, $zero, .L7F083164 -/* 0B7C70 7F083140 8FAD019C */ lw $t5, 0x19c($sp) -/* 0B7C74 7F083144 448A3000 */ mtc1 $t2, $f6 -/* 0B7C78 7F083148 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B7C7C 7F08314C 44812000 */ mtc1 $at, $f4 -/* 0B7C80 7F083150 46803220 */ cvt.s.w $f8, $f6 -/* 0B7C84 7F083154 8E0B0000 */ lw $t3, ($s0) -/* 0B7C88 7F083158 46044483 */ div.s $f18, $f8, $f4 -/* 0B7C8C 7F08315C E572016C */ swc1 $f18, 0x16c($t3) -/* 0B7C90 7F083160 8FAD019C */ lw $t5, 0x19c($sp) -.L7F083164: -/* 0B7C94 7F083164 8FAF0198 */ lw $t7, 0x198($sp) -/* 0B7C98 7F083168 11A0000A */ beqz $t5, .L7F083194 -/* 0B7C9C 7F08316C 00000000 */ nop -/* 0B7CA0 7F083170 0FC1FF87 */ jal sub_GAME_7F07FE1C -/* 0B7CA4 7F083174 24040001 */ li $a0, 1 -/* 0B7CA8 7F083178 8E080000 */ lw $t0, ($s0) -/* 0B7CAC 7F08317C 3C188005 */ lui $t8, %hi(g_ClockTimer) -/* 0B7CB0 7F083180 8F188374 */ lw $t8, %lo(g_ClockTimer)($t8) -/* 0B7CB4 7F083184 8D0C017C */ lw $t4, 0x17c($t0) -/* 0B7CB8 7F083188 01987021 */ addu $t6, $t4, $t8 -/* 0B7CBC 7F08318C 10000009 */ b .L7F0831B4 -/* 0B7CC0 7F083190 AD0E017C */ sw $t6, 0x17c($t0) -.L7F083194: -/* 0B7CC4 7F083194 11E00005 */ beqz $t7, .L7F0831AC -/* 0B7CC8 7F083198 00000000 */ nop -/* 0B7CCC 7F08319C 0FC1FF87 */ jal sub_GAME_7F07FE1C -/* 0B7CD0 7F0831A0 2404FFFF */ li $a0, -1 -/* 0B7CD4 7F0831A4 10000004 */ b .L7F0831B8 -/* 0B7CD8 7F0831A8 8FB901AC */ lw $t9, 0x1ac($sp) -.L7F0831AC: -/* 0B7CDC 7F0831AC 0FC1FF87 */ jal sub_GAME_7F07FE1C -/* 0B7CE0 7F0831B0 00002025 */ move $a0, $zero -.L7F0831B4: -/* 0B7CE4 7F0831B4 8FB901AC */ lw $t9, 0x1ac($sp) -.L7F0831B8: -/* 0B7CE8 7F0831B8 8FAA0120 */ lw $t2, 0x120($sp) -/* 0B7CEC 7F0831BC 53200016 */ beql $t9, $zero, .L7F083218 -/* 0B7CF0 7F0831C0 8E080000 */ lw $t0, ($s0) -/* 0B7CF4 7F0831C4 448A5000 */ mtc1 $t2, $f10 -/* 0B7CF8 7F0831C8 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B7CFC 7F0831CC 44814000 */ mtc1 $at, $f8 -/* 0B7D00 7F0831D0 468051A0 */ cvt.s.w $f6, $f10 -/* 0B7D04 7F0831D4 8E0B0000 */ lw $t3, ($s0) -/* 0B7D08 7F0831D8 46083103 */ div.s $f4, $f6, $f8 -/* 0B7D0C 7F0831DC E5640174 */ swc1 $f4, 0x174($t3) -/* 0B7D10 7F0831E0 8FAD0120 */ lw $t5, 0x120($sp) -/* 0B7D14 7F0831E4 29A1003D */ slti $at, $t5, 0x3d -/* 0B7D18 7F0831E8 54200009 */ bnezl $at, .L7F083210 -/* 0B7D1C 7F0831EC 8E0F0000 */ lw $t7, ($s0) -/* 0B7D20 7F0831F0 8E080000 */ lw $t0, ($s0) -/* 0B7D24 7F0831F4 3C188005 */ lui $t8, %hi(g_ClockTimer) -/* 0B7D28 7F0831F8 8F188374 */ lw $t8, %lo(g_ClockTimer)($t8) -/* 0B7D2C 7F0831FC 8D0C017C */ lw $t4, 0x17c($t0) -/* 0B7D30 7F083200 01987021 */ addu $t6, $t4, $t8 -/* 0B7D34 7F083204 10000003 */ b .L7F083214 -/* 0B7D38 7F083208 AD0E017C */ sw $t6, 0x17c($t0) -/* 0B7D3C 7F08320C 8E0F0000 */ lw $t7, ($s0) -.L7F083210: -/* 0B7D40 7F083210 ADE0017C */ sw $zero, 0x17c($t7) -.L7F083214: -/* 0B7D44 7F083214 8E080000 */ lw $t0, ($s0) -.L7F083218: -/* 0B7D48 7F083218 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7D4C 7F08321C 44819000 */ mtc1 $at, $f18 -/* 0B7D50 7F083220 C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B7D54 7F083224 3C013F80 */ lui $at, 0x3f80 -/* 0B7D58 7F083228 4600903C */ c.lt.s $f18, $f0 -/* 0B7D5C 7F08322C 00000000 */ nop -/* 0B7D60 7F083230 45020007 */ bc1fl .L7F083250 -/* 0B7D64 7F083234 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B7D68 7F083238 44815000 */ mtc1 $at, $f10 -/* 0B7D6C 7F08323C 00000000 */ nop -/* 0B7D70 7F083240 E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B7D74 7F083244 8E080000 */ lw $t0, ($s0) -/* 0B7D78 7F083248 C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B7D7C 7F08324C 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F083250: -/* 0B7D80 7F083250 44813000 */ mtc1 $at, $f6 -/* 0B7D84 7F083254 3C01BF80 */ lui $at, 0xbf80 -/* 0B7D88 7F083258 4606003C */ c.lt.s $f0, $f6 -/* 0B7D8C 7F08325C 00000000 */ nop -/* 0B7D90 7F083260 45020006 */ bc1fl .L7F08327C -/* 0B7D94 7F083264 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7D98 7F083268 44814000 */ mtc1 $at, $f8 -/* 0B7D9C 7F08326C 00000000 */ nop -/* 0B7DA0 7F083270 E5080174 */ swc1 $f8, 0x174($t0) -/* 0B7DA4 7F083274 8E080000 */ lw $t0, ($s0) -/* 0B7DA8 7F083278 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F08327C: -/* 0B7DAC 7F08327C 44812000 */ mtc1 $at, $f4 -/* 0B7DB0 7F083280 C500016C */ lwc1 $f0, 0x16c($t0) -/* 0B7DB4 7F083284 3C013F80 */ lui $at, 0x3f80 -/* 0B7DB8 7F083288 4600203C */ c.lt.s $f4, $f0 -/* 0B7DBC 7F08328C 00000000 */ nop -/* 0B7DC0 7F083290 45020007 */ bc1fl .L7F0832B0 -/* 0B7DC4 7F083294 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B7DC8 7F083298 44819000 */ mtc1 $at, $f18 -/* 0B7DCC 7F08329C 00000000 */ nop -/* 0B7DD0 7F0832A0 E512016C */ swc1 $f18, 0x16c($t0) -/* 0B7DD4 7F0832A4 8E080000 */ lw $t0, ($s0) -/* 0B7DD8 7F0832A8 C500016C */ lwc1 $f0, 0x16c($t0) -/* 0B7DDC 7F0832AC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F0832B0: -/* 0B7DE0 7F0832B0 44815000 */ mtc1 $at, $f10 -/* 0B7DE4 7F0832B4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B7DE8 7F0832B8 460A003C */ c.lt.s $f0, $f10 -/* 0B7DEC 7F0832BC 00000000 */ nop -/* 0B7DF0 7F0832C0 45000005 */ bc1f .L7F0832D8 -/* 0B7DF4 7F0832C4 00000000 */ nop -/* 0B7DF8 7F0832C8 44813000 */ mtc1 $at, $f6 -/* 0B7DFC 7F0832CC 00000000 */ nop -/* 0B7E00 7F0832D0 E506016C */ swc1 $f6, 0x16c($t0) -/* 0B7E04 7F0832D4 8E080000 */ lw $t0, ($s0) -.L7F0832D8: -/* 0B7E08 7F0832D8 3C018005 */ lui $at, %hi(D_80055134) -/* 0B7E0C 7F0832DC C4245134 */ lwc1 $f4, %lo(D_80055134)($at) -/* 0B7E10 7F0832E0 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B7E14 7F0832E4 46044482 */ mul.s $f18, $f8, $f4 -/* 0B7E18 7F0832E8 E5120174 */ swc1 $f18, 0x174($t0) -/* 0B7E1C 7F0832EC 8E080000 */ lw $t0, ($s0) -/* 0B7E20 7F0832F0 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0B7E24 7F0832F4 C5060178 */ lwc1 $f6, 0x178($t0) -/* 0B7E28 7F0832F8 46065202 */ mul.s $f8, $f10, $f6 -/* 0B7E2C 7F0832FC E5080174 */ swc1 $f8, 0x174($t0) -/* 0B7E30 7F083300 8FB901AC */ lw $t9, 0x1ac($sp) -/* 0B7E34 7F083304 8FAA019C */ lw $t2, 0x19c($sp) -/* 0B7E38 7F083308 57200006 */ bnezl $t9, .L7F083324 -/* 0B7E3C 7F08330C 8FAD0154 */ lw $t5, 0x154($sp) -/* 0B7E40 7F083310 55400004 */ bnezl $t2, .L7F083324 -/* 0B7E44 7F083314 8FAD0154 */ lw $t5, 0x154($sp) -/* 0B7E48 7F083318 8E0B0000 */ lw $t3, ($s0) -/* 0B7E4C 7F08331C AD60017C */ sw $zero, 0x17c($t3) -/* 0B7E50 7F083320 8FAD0154 */ lw $t5, 0x154($sp) -.L7F083324: -/* 0B7E54 7F083324 8FAC0150 */ lw $t4, 0x150($sp) -/* 0B7E58 7F083328 11A00005 */ beqz $t5, .L7F083340 -/* 0B7E5C 7F08332C 00000000 */ nop -/* 0B7E60 7F083330 0FC1E662 */ jal currentPlayerSetSwayTarget -/* 0B7E64 7F083334 2404FFFF */ li $a0, -1 -/* 0B7E68 7F083338 1000000A */ b .L7F083364 -/* 0B7E6C 7F08333C 8FB8015C */ lw $t8, 0x15c($sp) -.L7F083340: -/* 0B7E70 7F083340 11800005 */ beqz $t4, .L7F083358 -/* 0B7E74 7F083344 00000000 */ nop -/* 0B7E78 7F083348 0FC1E662 */ jal currentPlayerSetSwayTarget -/* 0B7E7C 7F08334C 24040001 */ li $a0, 1 -/* 0B7E80 7F083350 10000004 */ b .L7F083364 -/* 0B7E84 7F083354 8FB8015C */ lw $t8, 0x15c($sp) -.L7F083358: -/* 0B7E88 7F083358 0FC1E662 */ jal currentPlayerSetSwayTarget -/* 0B7E8C 7F08335C 00002025 */ move $a0, $zero -/* 0B7E90 7F083360 8FB8015C */ lw $t8, 0x15c($sp) -.L7F083364: -/* 0B7E94 7F083364 8FAE0158 */ lw $t6, 0x158($sp) -/* 0B7E98 7F083368 13000005 */ beqz $t8, .L7F083380 -/* 0B7E9C 7F08336C 00000000 */ nop -/* 0B7EA0 7F083370 0FC1E66B */ jal currentPlayerAdjustCrouchPos -/* 0B7EA4 7F083374 2404FFFE */ li $a0, -2 -/* 0B7EA8 7F083378 10000006 */ b .L7F083394 -/* 0B7EAC 7F08337C 8E080000 */ lw $t0, ($s0) -.L7F083380: -/* 0B7EB0 7F083380 51C00004 */ beql $t6, $zero, .L7F083394 -/* 0B7EB4 7F083384 8E080000 */ lw $t0, ($s0) -/* 0B7EB8 7F083388 0FC1E66B */ jal currentPlayerAdjustCrouchPos -/* 0B7EBC 7F08338C 24040002 */ li $a0, 2 -/* 0B7EC0 7F083390 8E080000 */ lw $t0, ($s0) -.L7F083394: -/* 0B7EC4 7F083394 8D0F017C */ lw $t7, 0x17c($t0) -/* 0B7EC8 7F083398 29E100B4 */ slti $at, $t7, 0xb4 -/* 0B7ECC 7F08339C 14200017 */ bnez $at, .L7F0833FC -/* 0B7ED0 7F0833A0 3C013FA0 */ li $at, 0x3FA00000 # 1.250000 -/* 0B7ED4 7F0833A4 44811000 */ mtc1 $at, $f2 -/* 0B7ED8 7F0833A8 C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B7EDC 7F0833AC 3C018005 */ lui $at, %hi(D_80055138) -/* 0B7EE0 7F0833B0 4602003C */ c.lt.s $f0, $f2 -/* 0B7EE4 7F0833B4 00000000 */ nop -/* 0B7EE8 7F0833B8 4502000A */ bc1fl .L7F0833E4 -/* 0B7EEC 7F0833BC 4600103C */ c.lt.s $f2, $f0 -/* 0B7EF0 7F0833C0 C4245138 */ lwc1 $f4, %lo(D_80055138)($at) -/* 0B7EF4 7F0833C4 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7EF8 7F0833C8 C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B7EFC 7F0833CC 46122282 */ mul.s $f10, $f4, $f18 -/* 0B7F00 7F0833D0 460A0180 */ add.s $f6, $f0, $f10 -/* 0B7F04 7F0833D4 E5060178 */ swc1 $f6, 0x178($t0) -/* 0B7F08 7F0833D8 8E080000 */ lw $t0, ($s0) -/* 0B7F0C 7F0833DC C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B7F10 7F0833E0 4600103C */ c.lt.s $f2, $f0 -.L7F0833E4: -/* 0B7F14 7F0833E4 00000000 */ nop -/* 0B7F18 7F0833E8 45020020 */ bc1fl .L7F08346C -/* 0B7F1C 7F0833EC 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B7F20 7F0833F0 E5020178 */ swc1 $f2, 0x178($t0) -/* 0B7F24 7F0833F4 1000001C */ b .L7F083468 -/* 0B7F28 7F0833F8 8E080000 */ lw $t0, ($s0) -.L7F0833FC: -/* 0B7F2C 7F0833FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7F30 7F083400 44814000 */ mtc1 $at, $f8 -/* 0B7F34 7F083404 C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B7F38 7F083408 3C018005 */ lui $at, %hi(D_8005513C) -/* 0B7F3C 7F08340C 4600403C */ c.lt.s $f8, $f0 -/* 0B7F40 7F083410 00000000 */ nop -/* 0B7F44 7F083414 4502000A */ bc1fl .L7F083440 -/* 0B7F48 7F083418 3C013F80 */ lui $at, %hi(0x3F800000) # $at, 0x3f80 -/* 0B7F4C 7F08341C C424513C */ lwc1 $f4, %lo(D_8005513C)($at) -/* 0B7F50 7F083420 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B7F54 7F083424 C4328378 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B7F58 7F083428 46122282 */ mul.s $f10, $f4, $f18 -/* 0B7F5C 7F08342C 460A0181 */ sub.s $f6, $f0, $f10 -/* 0B7F60 7F083430 E5060178 */ swc1 $f6, 0x178($t0) -/* 0B7F64 7F083434 8E080000 */ lw $t0, ($s0) -/* 0B7F68 7F083438 C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B7F6C 7F08343C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F083440: -/* 0B7F70 7F083440 44814000 */ mtc1 $at, $f8 -/* 0B7F74 7F083444 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7F78 7F083448 4608003C */ c.lt.s $f0, $f8 -/* 0B7F7C 7F08344C 00000000 */ nop -/* 0B7F80 7F083450 45020006 */ bc1fl .L7F08346C -/* 0B7F84 7F083454 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B7F88 7F083458 44812000 */ mtc1 $at, $f4 -/* 0B7F8C 7F08345C 00000000 */ nop -/* 0B7F90 7F083460 E5040178 */ swc1 $f4, 0x178($t0) -/* 0B7F94 7F083464 8E080000 */ lw $t0, ($s0) -.L7F083468: -/* 0B7F98 7F083468 8D1901C8 */ lw $t9, 0x1c8($t0) -.L7F08346C: -/* 0B7F9C 7F08346C 572001B4 */ bnezl $t9, .L7F083B40 -/* 0B7FA0 7F083470 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B7FA4 7F083474 8D0A0114 */ lw $t2, 0x114($t0) -/* 0B7FA8 7F083478 3C01C080 */ li $at, 0xC0800000 # -4.000000 -/* 0B7FAC 7F08347C 44817000 */ mtc1 $at, $f14 -/* 0B7FB0 7F083480 1140007F */ beqz $t2, .L7F083680 -/* 0B7FB4 7F083484 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B7FB8 7F083488 8D0B0488 */ lw $t3, 0x488($t0) -/* 0B7FBC 7F08348C 44819000 */ mtc1 $at, $f18 -/* 0B7FC0 7F083490 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 0B7FC4 7F083494 AFAB00C0 */ sw $t3, 0xc0($sp) -/* 0B7FC8 7F083498 E7B200BC */ swc1 $f18, 0xbc($sp) -/* 0B7FCC 7F08349C 8D0400A8 */ lw $a0, 0xa8($t0) -/* 0B7FD0 7F0834A0 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B7FD4 7F0834A4 27A600A8 */ addiu $a2, $sp, 0xa8 -/* 0B7FD8 7F0834A8 0FC2289D */ jal bondviewCollisionRadiusRelated -/* 0B7FDC 7F0834AC 27A700A4 */ addiu $a3, $sp, 0xa4 -/* 0B7FE0 7F0834B0 8E080000 */ lw $t0, ($s0) -/* 0B7FE4 7F0834B4 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B7FE8 7F0834B8 44810000 */ mtc1 $at, $f0 -/* 0B7FEC 7F0834BC C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0B7FF0 7F0834C0 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0B7FF4 7F0834C4 46005182 */ mul.s $f6, $f10, $f0 -/* 0B7FF8 7F0834C8 46083100 */ add.s $f4, $f6, $f8 -/* 0B7FFC 7F0834CC E7A400AC */ swc1 $f4, 0xac($sp) -/* 0B8000 7F0834D0 C5120490 */ lwc1 $f18, 0x490($t0) -/* 0B8004 7F0834D4 E7B200B0 */ swc1 $f18, 0xb0($sp) -/* 0B8008 7F0834D8 C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0B800C 7F0834DC C5080494 */ lwc1 $f8, 0x494($t0) -/* 0B8010 7F0834E0 46005182 */ mul.s $f6, $f10, $f0 -/* 0B8014 7F0834E4 46083100 */ add.s $f4, $f6, $f8 -/* 0B8018 7F0834E8 0FC2C731 */ jal sub_GAME_7F0B1CC4 -/* 0B801C 7F0834EC E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 0B8020 7F0834F0 8E080000 */ lw $t0, ($s0) -/* 0B8024 7F0834F4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8028 7F0834F8 44814000 */ mtc1 $at, $f8 -/* 0B802C 7F0834FC 8D05048C */ lw $a1, 0x48c($t0) -/* 0B8030 7F083500 8D060494 */ lw $a2, 0x494($t0) -/* 0B8034 7F083504 C7B200B4 */ lwc1 $f18, 0xb4($sp) -/* 0B8038 7F083508 C7AA00A8 */ lwc1 $f10, 0xa8($sp) -/* 0B803C 7F08350C C7A600A4 */ lwc1 $f6, 0xa4($sp) -/* 0B8040 7F083510 240D1000 */ li $t5, 4096 -/* 0B8044 7F083514 AFAD0014 */ sw $t5, 0x14($sp) -/* 0B8048 7F083518 E7B40020 */ swc1 $f20, 0x20($sp) -/* 0B804C 7F08351C 27A400C0 */ addiu $a0, $sp, 0xc0 -/* 0B8050 7F083520 8FA700AC */ lw $a3, 0xac($sp) -/* 0B8054 7F083524 E7A80024 */ swc1 $f8, 0x24($sp) -/* 0B8058 7F083528 E7B20010 */ swc1 $f18, 0x10($sp) -/* 0B805C 7F08352C E7AA0018 */ swc1 $f10, 0x18($sp) -/* 0B8060 7F083530 0FC2C389 */ jal sub_GAME_7F0B0E24 -/* 0B8064 7F083534 E7A6001C */ swc1 $f6, 0x1c($sp) -/* 0B8068 7F083538 10400009 */ beqz $v0, .L7F083560 -/* 0B806C 7F08353C C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B8070 7F083540 8FA400C0 */ lw $a0, 0xc0($sp) -/* 0B8074 7F083544 8FA500AC */ lw $a1, 0xac($sp) -/* 0B8078 7F083548 8FA600B4 */ lw $a2, 0xb4($sp) -/* 0B807C 7F08354C 0FC20358 */ jal bondviewYPositionRelated -/* 0B8080 7F083550 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B8084 7F083554 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B8088 7F083558 1000001A */ b .L7F0835C4 -/* 0B808C 7F08355C E7A000B0 */ swc1 $f0, 0xb0($sp) -.L7F083560: -/* 0B8090 7F083560 8E080000 */ lw $t0, ($s0) -/* 0B8094 7F083564 27A600AC */ addiu $a2, $sp, 0xac -/* 0B8098 7F083568 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B809C 7F08356C 2504048C */ addiu $a0, $t0, 0x48c -/* 0B80A0 7F083570 0FC098A6 */ jal chrlvStanPointPointIntersection -/* 0B80A4 7F083574 25050498 */ addiu $a1, $t0, 0x498 -/* 0B80A8 7F083578 8E080000 */ lw $t0, ($s0) -/* 0B80AC 7F08357C C7A400AC */ lwc1 $f4, 0xac($sp) -/* 0B80B0 7F083580 C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* 0B80B4 7F083584 C512048C */ lwc1 $f18, 0x48c($t0) -/* 0B80B8 7F083588 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B80BC 7F08358C 46122001 */ sub.s $f0, $f4, $f18 -/* 0B80C0 7F083590 46065081 */ sub.s $f2, $f10, $f6 -/* 0B80C4 7F083594 46000202 */ mul.s $f8, $f0, $f0 -/* 0B80C8 7F083598 00000000 */ nop -/* 0B80CC 7F08359C 46021102 */ mul.s $f4, $f2, $f2 -/* 0B80D0 7F0835A0 0C007DF8 */ jal sqrtf -/* 0B80D4 7F0835A4 46044300 */ add.s $f12, $f8, $f4 -/* 0B80D8 7F0835A8 E7A000BC */ swc1 $f0, 0xbc($sp) -/* 0B80DC 7F0835AC 8FA400C0 */ lw $a0, 0xc0($sp) -/* 0B80E0 7F0835B0 8FA500AC */ lw $a1, 0xac($sp) -/* 0B80E4 7F0835B4 0FC20358 */ jal bondviewYPositionRelated -/* 0B80E8 7F0835B8 8FA600B4 */ lw $a2, 0xb4($sp) -/* 0B80EC 7F0835BC C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B80F0 7F0835C0 E7A000B0 */ swc1 $f0, 0xb0($sp) -.L7F0835C4: -/* 0B80F4 7F0835C4 C7B200BC */ lwc1 $f18, 0xbc($sp) -/* 0B80F8 7F0835C8 4612A03C */ c.lt.s $f20, $f18 -/* 0B80FC 7F0835CC 00000000 */ nop -/* 0B8100 7F0835D0 4502002C */ bc1fl .L7F083684 -/* 0B8104 7F0835D4 8E080000 */ lw $t0, ($s0) -/* 0B8108 7F0835D8 8E0C0000 */ lw $t4, ($s0) -/* 0B810C 7F0835DC 3C01C396 */ li $at, 0xC3960000 # -300.000000 -/* 0B8110 7F0835E0 44813000 */ mtc1 $at, $f6 -/* 0B8114 7F0835E4 C58A0074 */ lwc1 $f10, 0x74($t4) -/* 0B8118 7F0835E8 3C0143FA */ li $at, 0x43FA0000 # 500.000000 -/* 0B811C 7F0835EC 460A0301 */ sub.s $f12, $f0, $f10 -/* 0B8120 7F0835F0 460C303C */ c.lt.s $f6, $f12 -/* 0B8124 7F0835F4 00000000 */ nop -/* 0B8128 7F0835F8 45020022 */ bc1fl .L7F083684 -/* 0B812C 7F0835FC 8E080000 */ lw $t0, ($s0) -/* 0B8130 7F083600 44814000 */ mtc1 $at, $f8 -/* 0B8134 7F083604 00000000 */ nop -/* 0B8138 7F083608 4608603C */ c.lt.s $f12, $f8 -/* 0B813C 7F08360C 00000000 */ nop -/* 0B8140 7F083610 4502001C */ bc1fl .L7F083684 -/* 0B8144 7F083614 8E080000 */ lw $t0, ($s0) -/* 0B8148 7F083618 0FC16A8C */ jal atan2f -/* 0B814C 7F08361C 46009386 */ mov.s $f14, $f18 -/* 0B8150 7F083620 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B8154 7F083624 44816000 */ mtc1 $at, $f12 -/* 0B8158 7F083628 3C018005 */ lui $at, %hi(D_80055140) -/* 0B815C 7F08362C C42A5140 */ lwc1 $f10, %lo(D_80055140)($at) -/* 0B8160 7F083630 460C0102 */ mul.s $f4, $f0, $f12 -/* 0B8164 7F083634 3C01C080 */ li $at, 0xC0800000 # -4.000000 -/* 0B8168 7F083638 44814000 */ mtc1 $at, $f8 -/* 0B816C 7F08363C 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B8170 7F083640 44819000 */ mtc1 $at, $f18 -/* 0B8174 7F083644 3C018005 */ lui $at, %hi(D_80055144) -/* 0B8178 7F083648 460A2183 */ div.s $f6, $f4, $f10 -/* 0B817C 7F08364C 46083080 */ add.s $f2, $f6, $f8 -/* 0B8180 7F083650 4602903E */ c.le.s $f18, $f2 -/* 0B8184 7F083654 46001386 */ mov.s $f14, $f2 -/* 0B8188 7F083658 45020003 */ bc1fl .L7F083668 -/* 0B818C 7F08365C 460EA03C */ c.lt.s $f20, $f14 -/* 0B8190 7F083660 460C1381 */ sub.s $f14, $f2, $f12 -/* 0B8194 7F083664 460EA03C */ c.lt.s $f20, $f14 -.L7F083668: -/* 0B8198 7F083668 00000000 */ nop -/* 0B819C 7F08366C 45020005 */ bc1fl .L7F083684 -/* 0B81A0 7F083670 8E080000 */ lw $t0, ($s0) -/* 0B81A4 7F083674 C4245144 */ lwc1 $f4, %lo(D_80055144)($at) -/* 0B81A8 7F083678 46047382 */ mul.s $f14, $f14, $f4 -/* 0B81AC 7F08367C 00000000 */ nop -.L7F083680: -/* 0B81B0 7F083680 8E080000 */ lw $t0, ($s0) -.L7F083684: -/* 0B81B4 7F083684 8FA90120 */ lw $t1, 0x120($sp) -/* 0B81B8 7F083688 3C0E8003 */ lui $t6, %hi(in_tank_flag) -/* 0B81BC 7F08368C 8D180110 */ lw $t8, 0x110($t0) -/* 0B81C0 7F083690 29210028 */ slti $at, $t1, 0x28 -/* 0B81C4 7F083694 13000007 */ beqz $t8, .L7F0836B4 -/* 0B81C8 7F083698 00000000 */ nop -/* 0B81CC 7F08369C 10200005 */ beqz $at, .L7F0836B4 -/* 0B81D0 7F0836A0 2921FFD9 */ slti $at, $t1, -0x27 -/* 0B81D4 7F0836A4 14200003 */ bnez $at, .L7F0836B4 -/* 0B81D8 7F0836A8 00000000 */ nop -/* 0B81DC 7F0836AC AD000110 */ sw $zero, 0x110($t0) -/* 0B81E0 7F0836B0 8E080000 */ lw $t0, ($s0) -.L7F0836B4: -/* 0B81E4 7F0836B4 8DCE6448 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B81E8 7F0836B8 C7AA0184 */ lwc1 $f10, 0x184($sp) -/* 0B81EC 7F0836BC 55C0005F */ bnezl $t6, .L7F08383C -/* 0B81F0 7F0836C0 8D180104 */ lw $t8, 0x104($t0) -/* 0B81F4 7F0836C4 460AA03C */ c.lt.s $f20, $f10 -/* 0B81F8 7F0836C8 C7A60180 */ lwc1 $f6, 0x180($sp) -/* 0B81FC 7F0836CC 45030006 */ bc1tl .L7F0836E8 -/* 0B8200 7F0836D0 AD000104 */ sw $zero, 0x104($t0) -/* 0B8204 7F0836D4 4606A03C */ c.lt.s $f20, $f6 -/* 0B8208 7F0836D8 8FAB0140 */ lw $t3, 0x140($sp) -/* 0B820C 7F0836DC 45000009 */ bc1f .L7F083704 -/* 0B8210 7F0836E0 00000000 */ nop -/* 0B8214 7F0836E4 AD000104 */ sw $zero, 0x104($t0) -.L7F0836E8: -/* 0B8218 7F0836E8 8E190000 */ lw $t9, ($s0) -/* 0B821C 7F0836EC 240F0001 */ li $t7, 1 -/* 0B8220 7F0836F0 AF2F010C */ sw $t7, 0x10c($t9) -/* 0B8224 7F0836F4 8E0A0000 */ lw $t2, ($s0) -/* 0B8228 7F0836F8 AD400120 */ sw $zero, 0x120($t2) -/* 0B822C 7F0836FC 1000004E */ b .L7F083838 -/* 0B8230 7F083700 8E080000 */ lw $t0, ($s0) -.L7F083704: -/* 0B8234 7F083704 51600005 */ beql $t3, $zero, .L7F08371C -/* 0B8238 7F083708 8D0D0118 */ lw $t5, 0x118($t0) -/* 0B823C 7F08370C AD000120 */ sw $zero, 0x120($t0) -/* 0B8240 7F083710 10000047 */ b .L7F083830 -/* 0B8244 7F083714 8E080000 */ lw $t0, ($s0) -/* 0B8248 7F083718 8D0D0118 */ lw $t5, 0x118($t0) -.L7F08371C: -/* 0B824C 7F08371C 8FAC01AC */ lw $t4, 0x1ac($sp) -/* 0B8250 7F083720 51A00025 */ beql $t5, $zero, .L7F0837B8 -/* 0B8254 7F083724 8D0A011C */ lw $t2, 0x11c($t0) -/* 0B8258 7F083728 11800008 */ beqz $t4, .L7F08374C -/* 0B825C 7F08372C 2921003D */ slti $at, $t1, 0x3d -/* 0B8260 7F083730 10200004 */ beqz $at, .L7F083744 -/* 0B8264 7F083734 24180001 */ li $t8, 1 -/* 0B8268 7F083738 2921FFC4 */ slti $at, $t1, -0x3c -/* 0B826C 7F08373C 50200004 */ beql $at, $zero, .L7F083750 -/* 0B8270 7F083740 8D0E0120 */ lw $t6, 0x120($t0) -.L7F083744: -/* 0B8274 7F083744 AD180120 */ sw $t8, 0x120($t0) -/* 0B8278 7F083748 8E080000 */ lw $t0, ($s0) -.L7F08374C: -/* 0B827C 7F08374C 8D0E0120 */ lw $t6, 0x120($t0) -.L7F083750: -/* 0B8280 7F083750 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B8284 7F083754 51C00037 */ beql $t6, $zero, .L7F083834 -/* 0B8288 7F083758 AD00010C */ sw $zero, 0x10c($t0) -/* 0B828C 7F08375C 44814000 */ mtc1 $at, $f8 -/* 0B8290 7F083760 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B8294 7F083764 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B8298 7F083768 46087480 */ add.s $f18, $f14, $f8 -/* 0B829C 7F08376C 4600903C */ c.lt.s $f18, $f0 -/* 0B82A0 7F083770 00000000 */ nop -/* 0B82A4 7F083774 45030009 */ bc1tl .L7F08379C -/* 0B82A8 7F083778 8D0F0110 */ lw $t7, 0x110($t0) -/* 0B82AC 7F08377C 44812000 */ mtc1 $at, $f4 -/* 0B82B0 7F083780 00000000 */ nop -/* 0B82B4 7F083784 46047280 */ add.s $f10, $f14, $f4 -/* 0B82B8 7F083788 460A003C */ c.lt.s $f0, $f10 -/* 0B82BC 7F08378C 00000000 */ nop -/* 0B82C0 7F083790 45020028 */ bc1fl .L7F083834 -/* 0B82C4 7F083794 AD00010C */ sw $zero, 0x10c($t0) -/* 0B82C8 7F083798 8D0F0110 */ lw $t7, 0x110($t0) -.L7F08379C: -/* 0B82CC 7F08379C 24190001 */ li $t9, 1 -/* 0B82D0 7F0837A0 55E00024 */ bnezl $t7, .L7F083834 -/* 0B82D4 7F0837A4 AD00010C */ sw $zero, 0x10c($t0) -/* 0B82D8 7F0837A8 AD190104 */ sw $t9, 0x104($t0) -/* 0B82DC 7F0837AC 10000020 */ b .L7F083830 -/* 0B82E0 7F0837B0 8E080000 */ lw $t0, ($s0) -/* 0B82E4 7F0837B4 8D0A011C */ lw $t2, 0x11c($t0) -.L7F0837B8: -/* 0B82E8 7F0837B8 8FAB01AC */ lw $t3, 0x1ac($sp) -/* 0B82EC 7F0837BC 5140001D */ beql $t2, $zero, .L7F083834 -/* 0B82F0 7F0837C0 AD00010C */ sw $zero, 0x10c($t0) -/* 0B82F4 7F0837C4 1160001A */ beqz $t3, .L7F083830 -/* 0B82F8 7F0837C8 2921003D */ slti $at, $t1, 0x3d -/* 0B82FC 7F0837CC 10200002 */ beqz $at, .L7F0837D8 -/* 0B8300 7F0837D0 2921FFC4 */ slti $at, $t1, -0x3c -/* 0B8304 7F0837D4 10200016 */ beqz $at, .L7F083830 -.L7F0837D8: -/* 0B8308 7F0837D8 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B830C 7F0837DC 44813000 */ mtc1 $at, $f6 -/* 0B8310 7F0837E0 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B8314 7F0837E4 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B8318 7F0837E8 46067200 */ add.s $f8, $f14, $f6 -/* 0B831C 7F0837EC 4600403C */ c.lt.s $f8, $f0 -/* 0B8320 7F0837F0 00000000 */ nop -/* 0B8324 7F0837F4 45030009 */ bc1tl .L7F08381C -/* 0B8328 7F0837F8 8D0D0110 */ lw $t5, 0x110($t0) -/* 0B832C 7F0837FC 44819000 */ mtc1 $at, $f18 -/* 0B8330 7F083800 00000000 */ nop -/* 0B8334 7F083804 46127100 */ add.s $f4, $f14, $f18 -/* 0B8338 7F083808 4604003C */ c.lt.s $f0, $f4 -/* 0B833C 7F08380C 00000000 */ nop -/* 0B8340 7F083810 45020008 */ bc1fl .L7F083834 -/* 0B8344 7F083814 AD00010C */ sw $zero, 0x10c($t0) -/* 0B8348 7F083818 8D0D0110 */ lw $t5, 0x110($t0) -.L7F08381C: -/* 0B834C 7F08381C 240C0001 */ li $t4, 1 -/* 0B8350 7F083820 55A00004 */ bnezl $t5, .L7F083834 -/* 0B8354 7F083824 AD00010C */ sw $zero, 0x10c($t0) -/* 0B8358 7F083828 AD0C0104 */ sw $t4, 0x104($t0) -/* 0B835C 7F08382C 8E080000 */ lw $t0, ($s0) -.L7F083830: -/* 0B8360 7F083830 AD00010C */ sw $zero, 0x10c($t0) -.L7F083834: -/* 0B8364 7F083834 8E080000 */ lw $t0, ($s0) -.L7F083838: -/* 0B8368 7F083838 8D180104 */ lw $t8, 0x104($t0) -.L7F08383C: -/* 0B836C 7F08383C 3C0E8003 */ lui $t6, %hi(in_tank_flag) -/* 0B8370 7F083840 8FAA01A0 */ lw $t2, 0x1a0($sp) -/* 0B8374 7F083844 1300004A */ beqz $t8, .L7F083970 -/* 0B8378 7F083848 00000000 */ nop -/* 0B837C 7F08384C 8DCE6448 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B8380 7F083850 55C000BB */ bnezl $t6, .L7F083B40 -/* 0B8384 7F083854 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B8388 7F083858 C5020160 */ lwc1 $f2, 0x160($t0) -/* 0B838C 7F08385C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B8390 7F083860 44813000 */ mtc1 $at, $f6 -/* 0B8394 7F083864 46021282 */ mul.s $f10, $f2, $f2 -/* 0B8398 7F083868 3C018005 */ lui $at, %hi(D_80055148) -/* 0B839C 7F08386C C4325148 */ lwc1 $f18, %lo(D_80055148)($at) -/* 0B83A0 7F083870 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B83A4 7F083874 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B83A8 7F083878 46065202 */ mul.s $f8, $f10, $f6 -/* 0B83AC 7F08387C 46124303 */ div.s $f12, $f8, $f18 -/* 0B83B0 7F083880 460C7100 */ add.s $f4, $f14, $f12 -/* 0B83B4 7F083884 4600203C */ c.lt.s $f4, $f0 -/* 0B83B8 7F083888 00000000 */ nop -/* 0B83BC 7F08388C 45020007 */ bc1fl .L7F0838AC -/* 0B83C0 7F083890 460C7281 */ sub.s $f10, $f14, $f12 -/* 0B83C4 7F083894 44816000 */ mtc1 $at, $f12 -/* 0B83C8 7F083898 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B83CC 7F08389C E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B83D0 7F0838A0 10000010 */ b .L7F0838E4 -/* 0B83D4 7F0838A4 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B83D8 7F0838A8 460C7281 */ sub.s $f10, $f14, $f12 -.L7F0838AC: -/* 0B83DC 7F0838AC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B83E0 7F0838B0 460A003C */ c.lt.s $f0, $f10 -/* 0B83E4 7F0838B4 00000000 */ nop -/* 0B83E8 7F0838B8 45020007 */ bc1fl .L7F0838D8 -/* 0B83EC 7F0838BC 4600A306 */ mov.s $f12, $f20 -/* 0B83F0 7F0838C0 44816000 */ mtc1 $at, $f12 -/* 0B83F4 7F0838C4 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B83F8 7F0838C8 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B83FC 7F0838CC 10000005 */ b .L7F0838E4 -/* 0B8400 7F0838D0 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B8404 7F0838D4 4600A306 */ mov.s $f12, $f20 -.L7F0838D8: -/* 0B8408 7F0838D8 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B840C 7F0838DC E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B8410 7F0838E0 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -.L7F0838E4: -/* 0B8414 7F0838E4 8E080000 */ lw $t0, ($s0) -/* 0B8418 7F0838E8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B841C 7F0838EC C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B8420 7F0838F0 C5060160 */ lwc1 $f6, 0x160($t0) -/* 0B8424 7F0838F4 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B8428 7F0838F8 46083082 */ mul.s $f2, $f6, $f8 -/* 0B842C 7F0838FC 4600703C */ c.lt.s $f14, $f0 -/* 0B8430 7F083900 46021480 */ add.s $f18, $f2, $f2 -/* 0B8434 7F083904 45000007 */ bc1f .L7F083924 -/* 0B8438 7F083908 46120300 */ add.s $f12, $f0, $f18 -/* 0B843C 7F08390C 460C703C */ c.lt.s $f14, $f12 -/* 0B8440 7F083910 00000000 */ nop -/* 0B8444 7F083914 45020004 */ bc1fl .L7F083928 -/* 0B8448 7F083918 460E003C */ c.lt.s $f0, $f14 -/* 0B844C 7F08391C 10000087 */ b .L7F083B3C -/* 0B8450 7F083920 E50C0158 */ swc1 $f12, 0x158($t0) -.L7F083924: -/* 0B8454 7F083924 460E003C */ c.lt.s $f0, $f14 -.L7F083928: -/* 0B8458 7F083928 00000000 */ nop -/* 0B845C 7F08392C 45020008 */ bc1fl .L7F083950 -/* 0B8460 7F083930 E50E0158 */ swc1 $f14, 0x158($t0) -/* 0B8464 7F083934 460E603C */ c.lt.s $f12, $f14 -/* 0B8468 7F083938 00000000 */ nop -/* 0B846C 7F08393C 45020004 */ bc1fl .L7F083950 -/* 0B8470 7F083940 E50E0158 */ swc1 $f14, 0x158($t0) -/* 0B8474 7F083944 1000007D */ b .L7F083B3C -/* 0B8478 7F083948 E50C0158 */ swc1 $f12, 0x158($t0) -/* 0B847C 7F08394C E50E0158 */ swc1 $f14, 0x158($t0) -.L7F083950: -/* 0B8480 7F083950 8E0F0000 */ lw $t7, ($s0) -/* 0B8484 7F083954 E5F40160 */ swc1 $f20, 0x160($t7) -/* 0B8488 7F083958 8E080000 */ lw $t0, ($s0) -/* 0B848C 7F08395C 8D19010C */ lw $t9, 0x10c($t0) -/* 0B8490 7F083960 57200077 */ bnezl $t9, .L7F083B40 -/* 0B8494 7F083964 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B8498 7F083968 10000074 */ b .L7F083B3C -/* 0B849C 7F08396C AD000104 */ sw $zero, 0x104($t0) -.L7F083970: -/* 0B84A0 7F083970 1140002E */ beqz $t2, .L7F083A2C -/* 0B84A4 7F083974 C7B20184 */ lwc1 $f18, 0x184($sp) -/* 0B84A8 7F083978 0C001177 */ jal viGetFovY -/* 0B84AC 7F08397C 00000000 */ nop -/* 0B84B0 7F083980 8FAB0128 */ lw $t3, 0x128($sp) -/* 0B84B4 7F083984 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B84B8 7F083988 44812000 */ mtc1 $at, $f4 -/* 0B84BC 7F08398C 448B5000 */ mtc1 $t3, $f10 -/* 0B84C0 7F083990 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B84C4 7F083994 44814000 */ mtc1 $at, $f8 -/* 0B84C8 7F083998 468051A0 */ cvt.s.w $f6, $f10 -/* 0B84CC 7F08399C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B84D0 7F0839A0 44819000 */ mtc1 $at, $f18 -/* 0B84D4 7F0839A4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B84D8 7F0839A8 46040383 */ div.s $f14, $f0, $f4 -/* 0B84DC 7F0839AC 46083303 */ div.s $f12, $f6, $f8 -/* 0B84E0 7F0839B0 460C903C */ c.lt.s $f18, $f12 -/* 0B84E4 7F0839B4 46006086 */ mov.s $f2, $f12 -/* 0B84E8 7F0839B8 45020006 */ bc1fl .L7F0839D4 -/* 0B84EC 7F0839BC 44812000 */ mtc1 $at, $f4 -/* 0B84F0 7F0839C0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B84F4 7F0839C4 44811000 */ mtc1 $at, $f2 -/* 0B84F8 7F0839C8 1000000A */ b .L7F0839F4 -/* 0B84FC 7F0839CC 4602A03E */ c.le.s $f20, $f2 -/* 0B8500 7F0839D0 44812000 */ mtc1 $at, $f4 -.L7F0839D4: -/* 0B8504 7F0839D4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B8508 7F0839D8 4604603C */ c.lt.s $f12, $f4 -/* 0B850C 7F0839DC 00000000 */ nop -/* 0B8510 7F0839E0 45020004 */ bc1fl .L7F0839F4 -/* 0B8514 7F0839E4 4602A03E */ c.le.s $f20, $f2 -/* 0B8518 7F0839E8 44811000 */ mtc1 $at, $f2 -/* 0B851C 7F0839EC 00000000 */ nop -/* 0B8520 7F0839F0 4602A03E */ c.le.s $f20, $f2 -.L7F0839F4: -/* 0B8524 7F0839F4 00000000 */ nop -/* 0B8528 7F0839F8 45020005 */ bc1fl .L7F083A10 -/* 0B852C 7F0839FC 46001287 */ neg.s $f10, $f2 -/* 0B8530 7F083A00 46021082 */ mul.s $f2, $f2, $f2 -/* 0B8534 7F083A04 10000005 */ b .L7F083A1C -/* 0B8538 7F083A08 46001187 */ neg.s $f6, $f2 -/* 0B853C 7F083A0C 46001287 */ neg.s $f10, $f2 -.L7F083A10: -/* 0B8540 7F083A10 460A1082 */ mul.s $f2, $f2, $f10 -/* 0B8544 7F083A14 00000000 */ nop -/* 0B8548 7F083A18 46001187 */ neg.s $f6, $f2 -.L7F083A1C: -/* 0B854C 7F083A1C 8E0D0000 */ lw $t5, ($s0) -/* 0B8550 7F083A20 460E3202 */ mul.s $f8, $f6, $f14 -/* 0B8554 7F083A24 10000027 */ b .L7F083AC4 -/* 0B8558 7F083A28 E5A80160 */ swc1 $f8, 0x160($t5) -.L7F083A2C: -/* 0B855C 7F083A2C 4612A03C */ c.lt.s $f20, $f18 -/* 0B8560 7F083A30 C7A40180 */ lwc1 $f4, 0x180($sp) -/* 0B8564 7F083A34 45020010 */ bc1fl .L7F083A78 -/* 0B8568 7F083A38 4604A03C */ c.lt.s $f20, $f4 -/* 0B856C 7F083A3C 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B8570 7F083A40 46009306 */ mov.s $f12, $f18 -/* 0B8574 7F083A44 8FAC01AC */ lw $t4, 0x1ac($sp) -/* 0B8578 7F083A48 8FB80120 */ lw $t8, 0x120($sp) -/* 0B857C 7F083A4C 1180001D */ beqz $t4, .L7F083AC4 -/* 0B8580 7F083A50 2B01003D */ slti $at, $t8, 0x3d -/* 0B8584 7F083A54 10200003 */ beqz $at, .L7F083A64 -/* 0B8588 7F083A58 2B01003C */ slti $at, $t8, 0x3c -/* 0B858C 7F083A5C 5020001A */ beql $at, $zero, .L7F083AC8 -/* 0B8590 7F083A60 8E080000 */ lw $t0, ($s0) -.L7F083A64: -/* 0B8594 7F083A64 8E0F0000 */ lw $t7, ($s0) -/* 0B8598 7F083A68 240E0001 */ li $t6, 1 -/* 0B859C 7F083A6C 10000015 */ b .L7F083AC4 -/* 0B85A0 7F083A70 ADEE0110 */ sw $t6, 0x110($t7) -/* 0B85A4 7F083A74 4604A03C */ c.lt.s $f20, $f4 -.L7F083A78: -/* 0B85A8 7F083A78 00000000 */ nop -/* 0B85AC 7F083A7C 4500000F */ bc1f .L7F083ABC -/* 0B85B0 7F083A80 00000000 */ nop -/* 0B85B4 7F083A84 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B85B8 7F083A88 46002307 */ neg.s $f12, $f4 -/* 0B85BC 7F083A8C 8FB901AC */ lw $t9, 0x1ac($sp) -/* 0B85C0 7F083A90 8FAA0120 */ lw $t2, 0x120($sp) -/* 0B85C4 7F083A94 1320000B */ beqz $t9, .L7F083AC4 -/* 0B85C8 7F083A98 2941003D */ slti $at, $t2, 0x3d -/* 0B85CC 7F083A9C 10200003 */ beqz $at, .L7F083AAC -/* 0B85D0 7F083AA0 2941003C */ slti $at, $t2, 0x3c -/* 0B85D4 7F083AA4 50200008 */ beql $at, $zero, .L7F083AC8 -/* 0B85D8 7F083AA8 8E080000 */ lw $t0, ($s0) -.L7F083AAC: -/* 0B85DC 7F083AAC 8E0D0000 */ lw $t5, ($s0) -/* 0B85E0 7F083AB0 240B0001 */ li $t3, 1 -/* 0B85E4 7F083AB4 10000003 */ b .L7F083AC4 -/* 0B85E8 7F083AB8 ADAB0110 */ sw $t3, 0x110($t5) -.L7F083ABC: -/* 0B85EC 7F083ABC 0FC20004 */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B85F0 7F083AC0 4600A306 */ mov.s $f12, $f20 -.L7F083AC4: -/* 0B85F4 7F083AC4 8E080000 */ lw $t0, ($s0) -.L7F083AC8: -/* 0B85F8 7F083AC8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B85FC 7F083ACC C4268378 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B8600 7F083AD0 C50A0160 */ lwc1 $f10, 0x160($t0) -/* 0B8604 7F083AD4 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B8608 7F083AD8 44819000 */ mtc1 $at, $f18 -/* 0B860C 7F083ADC 46065202 */ mul.s $f8, $f10, $f6 -/* 0B8610 7F083AE0 C50A0158 */ lwc1 $f10, 0x158($t0) -/* 0B8614 7F083AE4 3C0C8003 */ lui $t4, %hi(in_tank_flag) -/* 0B8618 7F083AE8 24010001 */ li $at, 1 -/* 0B861C 7F083AEC 3C188008 */ lui $t8, %hi(g_EnterTankAudioState) -/* 0B8620 7F083AF0 46124102 */ mul.s $f4, $f8, $f18 -/* 0B8624 7F083AF4 46045180 */ add.s $f6, $f10, $f4 -/* 0B8628 7F083AF8 E5060158 */ swc1 $f6, 0x158($t0) -/* 0B862C 7F083AFC 8D8C6448 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B8630 7F083B00 5581000F */ bnel $t4, $at, .L7F083B40 -/* 0B8634 7F083B04 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B8638 7F083B08 8F1899B8 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B863C 7F083B0C 24010002 */ li $at, 2 -/* 0B8640 7F083B10 5701000B */ bnel $t8, $at, .L7F083B40 -/* 0B8644 7F083B14 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B8648 7F083B18 8E080000 */ lw $t0, ($s0) -/* 0B864C 7F083B1C 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B8650 7F083B20 44810000 */ mtc1 $at, $f0 -/* 0B8654 7F083B24 C5080158 */ lwc1 $f8, 0x158($t0) -/* 0B8658 7F083B28 4600403C */ c.lt.s $f8, $f0 -/* 0B865C 7F083B2C 00000000 */ nop -/* 0B8660 7F083B30 45020003 */ bc1fl .L7F083B40 -/* 0B8664 7F083B34 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B8668 7F083B38 E5000158 */ swc1 $f0, 0x158($t0) -.L7F083B3C: -/* 0B866C 7F083B3C 8FAE01A4 */ lw $t6, 0x1a4($sp) -.L7F083B40: -/* 0B8670 7F083B40 C7A6017C */ lwc1 $f6, 0x17c($sp) -/* 0B8674 7F083B44 51C0002A */ beql $t6, $zero, .L7F083BF0 -/* 0B8678 7F083B48 4606A03C */ c.lt.s $f20, $f6 -/* 0B867C 7F083B4C 0C001177 */ jal viGetFovY -/* 0B8680 7F083B50 00000000 */ nop -/* 0B8684 7F083B54 8FAF012C */ lw $t7, 0x12c($sp) -/* 0B8688 7F083B58 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B868C 7F083B5C 44817000 */ mtc1 $at, $f14 -/* 0B8690 7F083B60 448F9000 */ mtc1 $t7, $f18 -/* 0B8694 7F083B64 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B8698 7F083B68 44812000 */ mtc1 $at, $f4 -/* 0B869C 7F083B6C 468092A0 */ cvt.s.w $f10, $f18 -/* 0B86A0 7F083B70 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B86A4 7F083B74 46045303 */ div.s $f12, $f10, $f4 -/* 0B86A8 7F083B78 460C703C */ c.lt.s $f14, $f12 -/* 0B86AC 7F083B7C 46006086 */ mov.s $f2, $f12 -/* 0B86B0 7F083B80 45020004 */ bc1fl .L7F083B94 -/* 0B86B4 7F083B84 44813000 */ mtc1 $at, $f6 -/* 0B86B8 7F083B88 10000009 */ b .L7F083BB0 -/* 0B86BC 7F083B8C 46007086 */ mov.s $f2, $f14 -/* 0B86C0 7F083B90 44813000 */ mtc1 $at, $f6 -.L7F083B94: -/* 0B86C4 7F083B94 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B86C8 7F083B98 4606603C */ c.lt.s $f12, $f6 -/* 0B86CC 7F083B9C 00000000 */ nop -/* 0B86D0 7F083BA0 45020004 */ bc1fl .L7F083BB4 -/* 0B86D4 7F083BA4 4602A03E */ c.le.s $f20, $f2 -/* 0B86D8 7F083BA8 44811000 */ mtc1 $at, $f2 -/* 0B86DC 7F083BAC 00000000 */ nop -.L7F083BB0: -/* 0B86E0 7F083BB0 4602A03E */ c.le.s $f20, $f2 -.L7F083BB4: -/* 0B86E4 7F083BB4 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B86E8 7F083BB8 44819000 */ mtc1 $at, $f18 -/* 0B86EC 7F083BBC 45000004 */ bc1f .L7F083BD0 -/* 0B86F0 7F083BC0 46120283 */ div.s $f10, $f0, $f18 -/* 0B86F4 7F083BC4 46021082 */ mul.s $f2, $f2, $f2 -/* 0B86F8 7F083BC8 10000004 */ b .L7F083BDC -/* 0B86FC 7F083BCC 00000000 */ nop -.L7F083BD0: -/* 0B8700 7F083BD0 46001207 */ neg.s $f8, $f2 -/* 0B8704 7F083BD4 46081082 */ mul.s $f2, $f2, $f8 -/* 0B8708 7F083BD8 00000000 */ nop -.L7F083BDC: -/* 0B870C 7F083BDC 460A1102 */ mul.s $f4, $f2, $f10 -/* 0B8710 7F083BE0 8E190000 */ lw $t9, ($s0) -/* 0B8714 7F083BE4 1000001A */ b .L7F083C50 -/* 0B8718 7F083BE8 E724014C */ swc1 $f4, 0x14c($t9) -/* 0B871C 7F083BEC 4606A03C */ c.lt.s $f20, $f6 -.L7F083BF0: -/* 0B8720 7F083BF0 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0B8724 7F083BF4 45020008 */ bc1fl .L7F083C18 -/* 0B8728 7F083BF8 4608A03C */ c.lt.s $f20, $f8 -/* 0B872C 7F083BFC 0FC200B1 */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B8730 7F083C00 46003306 */ mov.s $f12, $f6 -/* 0B8734 7F083C04 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8738 7F083C08 44817000 */ mtc1 $at, $f14 -/* 0B873C 7F083C0C 10000010 */ b .L7F083C50 -/* 0B8740 7F083C10 00000000 */ nop -/* 0B8744 7F083C14 4608A03C */ c.lt.s $f20, $f8 -.L7F083C18: -/* 0B8748 7F083C18 00000000 */ nop -/* 0B874C 7F083C1C 45000007 */ bc1f .L7F083C3C -/* 0B8750 7F083C20 00000000 */ nop -/* 0B8754 7F083C24 0FC200B1 */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B8758 7F083C28 46004307 */ neg.s $f12, $f8 -/* 0B875C 7F083C2C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8760 7F083C30 44817000 */ mtc1 $at, $f14 -/* 0B8764 7F083C34 10000006 */ b .L7F083C50 -/* 0B8768 7F083C38 00000000 */ nop -.L7F083C3C: -/* 0B876C 7F083C3C 0FC200B1 */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B8770 7F083C40 4600A306 */ mov.s $f12, $f20 -/* 0B8774 7F083C44 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8778 7F083C48 44817000 */ mtc1 $at, $f14 -/* 0B877C 7F083C4C 00000000 */ nop -.L7F083C50: -/* 0B8780 7F083C50 3C0A8003 */ lui $t2, %hi(in_tank_flag) -/* 0B8784 7F083C54 8D4A6448 */ lw $t2, %lo(in_tank_flag)($t2) -/* 0B8788 7F083C58 24010001 */ li $at, 1 -/* 0B878C 7F083C5C 3C0B8008 */ lui $t3, %hi(g_EnterTankAudioState) -/* 0B8790 7F083C60 5541004B */ bnel $t2, $at, .L7F083D90 -/* 0B8794 7F083C64 8FAE014C */ lw $t6, 0x14c($sp) -/* 0B8798 7F083C68 8D6B99B8 */ lw $t3, %lo(g_EnterTankAudioState)($t3) -/* 0B879C 7F083C6C 24010002 */ li $at, 2 -/* 0B87A0 7F083C70 8FAD01A4 */ lw $t5, 0x1a4($sp) -/* 0B87A4 7F083C74 55610044 */ bnel $t3, $at, .L7F083D88 -/* 0B87A8 7F083C78 8E180000 */ lw $t8, ($s0) -/* 0B87AC 7F083C7C 11A00008 */ beqz $t5, .L7F083CA0 -/* 0B87B0 7F083C80 4600A086 */ mov.s $f2, $f20 -/* 0B87B4 7F083C84 8E0C0000 */ lw $t4, ($s0) -/* 0B87B8 7F083C88 3C018005 */ lui $at, %hi(D_8005514C) -/* 0B87BC 7F083C8C C42A514C */ lwc1 $f10, %lo(D_8005514C)($at) -/* 0B87C0 7F083C90 C592014C */ lwc1 $f18, 0x14c($t4) -/* 0B87C4 7F083C94 460A9082 */ mul.s $f2, $f18, $f10 -/* 0B87C8 7F083C98 10000019 */ b .L7F083D00 -/* 0B87CC 7F083C9C 00000000 */ nop -.L7F083CA0: -/* 0B87D0 7F083CA0 C7A4017C */ lwc1 $f4, 0x17c($sp) -/* 0B87D4 7F083CA4 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0B87D8 7F083CA8 4604A03C */ c.lt.s $f20, $f4 -/* 0B87DC 7F083CAC 00000000 */ nop -/* 0B87E0 7F083CB0 45020009 */ bc1fl .L7F083CD8 -/* 0B87E4 7F083CB4 4608A03C */ c.lt.s $f20, $f8 -/* 0B87E8 7F083CB8 0FC2008A */ jal sub_GAME_7F080228 -/* 0B87EC 7F083CBC 46007306 */ mov.s $f12, $f14 -/* 0B87F0 7F083CC0 3C018005 */ lui $at, %hi(D_80055150) -/* 0B87F4 7F083CC4 C4265150 */ lwc1 $f6, %lo(D_80055150)($at) -/* 0B87F8 7F083CC8 46060082 */ mul.s $f2, $f0, $f6 -/* 0B87FC 7F083CCC 1000000C */ b .L7F083D00 -/* 0B8800 7F083CD0 00000000 */ nop -/* 0B8804 7F083CD4 4608A03C */ c.lt.s $f20, $f8 -.L7F083CD8: -/* 0B8808 7F083CD8 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B880C 7F083CDC 45000008 */ bc1f .L7F083D00 -/* 0B8810 7F083CE0 00000000 */ nop -/* 0B8814 7F083CE4 44816000 */ mtc1 $at, $f12 -/* 0B8818 7F083CE8 0FC2008A */ jal sub_GAME_7F080228 -/* 0B881C 7F083CEC 00000000 */ nop -/* 0B8820 7F083CF0 3C018005 */ lui $at, %hi(D_80055154) -/* 0B8824 7F083CF4 C4325154 */ lwc1 $f18, %lo(D_80055154)($at) -/* 0B8828 7F083CF8 46120082 */ mul.s $f2, $f0, $f18 -/* 0B882C 7F083CFC 00000000 */ nop -.L7F083D00: -/* 0B8830 7F083D00 3C038005 */ lui $v1, %hi(g_ClockTimer) -/* 0B8834 7F083D04 8C638374 */ lw $v1, %lo(g_ClockTimer)($v1) -/* 0B8838 7F083D08 00001025 */ move $v0, $zero -/* 0B883C 7F083D0C 8E080000 */ lw $t0, ($s0) -/* 0B8840 7F083D10 18600014 */ blez $v1, .L7F083D64 -/* 0B8844 7F083D14 3C018005 */ lui $at, %hi(D_80055158) -/* 0B8848 7F083D18 3C048003 */ lui $a0, %hi(g_TankTurnSpeed) -/* 0B884C 7F083D1C 24846460 */ addiu $a0, %lo(g_TankTurnSpeed) # addiu $a0, $a0, 0x6460 -/* 0B8850 7F083D20 C4205158 */ lwc1 $f0, %lo(D_80055158)($at) -/* 0B8854 7F083D24 C4920000 */ lwc1 $f18, ($a0) -/* 0B8858 7F083D28 24420001 */ addiu $v0, $v0, 1 -/* 0B885C 7F083D2C 0043082A */ slt $at, $v0, $v1 -/* 0B8860 7F083D30 46120502 */ mul.s $f20, $f0, $f18 -/* 0B8864 7F083D34 5020000A */ beql $at, $zero, .L7F083D60 -/* 0B8868 7F083D38 4602A480 */ add.s $f18, $f20, $f2 -/* 0B886C 7F083D3C 4602A480 */ add.s $f18, $f20, $f2 -.L7F083D40: -/* 0B8870 7F083D40 24420001 */ addiu $v0, $v0, 1 -/* 0B8874 7F083D44 0043082A */ slt $at, $v0, $v1 -/* 0B8878 7F083D48 E4920000 */ swc1 $f18, ($a0) -/* 0B887C 7F083D4C C4920000 */ lwc1 $f18, ($a0) -/* 0B8880 7F083D50 46120502 */ mul.s $f20, $f0, $f18 -/* 0B8884 7F083D54 5420FFFA */ bnezl $at, .L7F083D40 -/* 0B8888 7F083D58 4602A480 */ add.s $f18, $f20, $f2 -/* 0B888C 7F083D5C 4602A480 */ add.s $f18, $f20, $f2 -.L7F083D60: -/* 0B8890 7F083D60 E4920000 */ swc1 $f18, ($a0) -.L7F083D64: -/* 0B8894 7F083D64 3C048003 */ lui $a0, %hi(g_TankTurnSpeed) -/* 0B8898 7F083D68 24846460 */ addiu $a0, %lo(g_TankTurnSpeed) # addiu $a0, $a0, 0x6460 -/* 0B889C 7F083D6C 3C018005 */ lui $at, %hi(D_8005515C) -/* 0B88A0 7F083D70 C432515C */ lwc1 $f18, %lo(D_8005515C)($at) -/* 0B88A4 7F083D74 C4880000 */ lwc1 $f8, ($a0) -/* 0B88A8 7F083D78 46124282 */ mul.s $f10, $f8, $f18 -/* 0B88AC 7F083D7C 10000003 */ b .L7F083D8C -/* 0B88B0 7F083D80 E50A014C */ swc1 $f10, 0x14c($t0) -/* 0B88B4 7F083D84 8E180000 */ lw $t8, ($s0) -.L7F083D88: -/* 0B88B8 7F083D88 E714014C */ swc1 $f20, 0x14c($t8) -.L7F083D8C: -/* 0B88BC 7F083D8C 8FAE014C */ lw $t6, 0x14c($sp) -.L7F083D90: -/* 0B88C0 7F083D90 51C00007 */ beql $t6, $zero, .L7F083DB0 -/* 0B88C4 7F083D94 240A0001 */ li $t2, 1 -/* 0B88C8 7F083D98 8E0F0000 */ lw $t7, ($s0) -/* 0B88CC 7F083D9C ADE00894 */ sw $zero, 0x894($t7) -/* 0B88D0 7F083DA0 8E190000 */ lw $t9, ($s0) -/* 0B88D4 7F083DA4 0FC14686 */ jal trigger_remote_mine_detonation -/* 0B88D8 7F083DA8 AF200898 */ sw $zero, 0x898($t9) -/* 0B88DC 7F083DAC 240A0001 */ li $t2, 1 -.L7F083DB0: -/* 0B88E0 7F083DB0 0FC26919 */ jal getPlayerCount -/* 0B88E4 7F083DB4 AFAA0074 */ sw $t2, 0x74($sp) -/* 0B88E8 7F083DB8 28410002 */ slti $at, $v0, 2 -/* 0B88EC 7F083DBC 5420000C */ bnezl $at, .L7F083DF0 -/* 0B88F0 7F083DC0 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B88F4 7F083DC4 0FC051D6 */ jal get_scenario -/* 0B88F8 7F083DC8 00000000 */ nop -/* 0B88FC 7F083DCC 24010002 */ li $at, 2 -/* 0B8900 7F083DD0 54410007 */ bnel $v0, $at, .L7F083DF0 -/* 0B8904 7F083DD4 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B8908 7F083DD8 0FC233E0 */ jal bondinvIsAliveWithFlag -/* 0B890C 7F083DDC 00000000 */ nop -/* 0B8910 7F083DE0 50400003 */ beql $v0, $zero, .L7F083DF0 -/* 0B8914 7F083DE4 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B8918 7F083DE8 AFA00074 */ sw $zero, 0x74($sp) -/* 0B891C 7F083DEC 8FAB0074 */ lw $t3, 0x74($sp) -.L7F083DF0: -/* 0B8920 7F083DF0 5160000C */ beql $t3, $zero, .L7F083E24 -/* 0B8924 7F083DF4 8FB801BC */ lw $t8, 0x1bc($sp) -/* 0B8928 7F083DF8 8FAD0174 */ lw $t5, 0x174($sp) -/* 0B892C 7F083DFC 51A00004 */ beql $t5, $zero, .L7F083E10 -/* 0B8930 7F083E00 8FAC0170 */ lw $t4, 0x170($sp) -/* 0B8934 7F083E04 0FC175DA */ jal backstep_through_inventory -/* 0B8938 7F083E08 00000000 */ nop -/* 0B893C 7F083E0C 8FAC0170 */ lw $t4, 0x170($sp) -.L7F083E10: -/* 0B8940 7F083E10 51800004 */ beql $t4, $zero, .L7F083E24 -/* 0B8944 7F083E14 8FB801BC */ lw $t8, 0x1bc($sp) -/* 0B8948 7F083E18 0FC175B4 */ jal advance_through_inventory -/* 0B894C 7F083E1C 00000000 */ nop -/* 0B8950 7F083E20 8FB801BC */ lw $t8, 0x1bc($sp) -.L7F083E24: -/* 0B8954 7F083E24 53000005 */ beql $t8, $zero, .L7F083E3C -/* 0B8958 7F083E28 8FAF01B8 */ lw $t7, 0x1b8($sp) -/* 0B895C 7F083E2C 8E0E0000 */ lw $t6, ($s0) -/* 0B8960 7F083E30 10000007 */ b .L7F083E50 -/* 0B8964 7F083E34 ADC00430 */ sw $zero, 0x430($t6) -/* 0B8968 7F083E38 8FAF01B8 */ lw $t7, 0x1b8($sp) -.L7F083E3C: -/* 0B896C 7F083E3C 51E00005 */ beql $t7, $zero, .L7F083E54 -/* 0B8970 7F083E40 8E0B0000 */ lw $t3, ($s0) -/* 0B8974 7F083E44 8E0A0000 */ lw $t2, ($s0) -/* 0B8978 7F083E48 24190002 */ li $t9, 2 -/* 0B897C 7F083E4C AD590430 */ sw $t9, 0x430($t2) -.L7F083E50: -/* 0B8980 7F083E50 8E0B0000 */ lw $t3, ($s0) -.L7F083E54: -/* 0B8984 7F083E54 8D620430 */ lw $v0, 0x430($t3) -/* 0B8988 7F083E58 54400042 */ bnezl $v0, .L7F083F64 -/* 0B898C 7F083E5C 24010002 */ li $at, 2 -/* 0B8990 7F083E60 0FC19EA9 */ jal sub_GAME_7F067AA4 -/* 0B8994 7F083E64 00002025 */ move $a0, $zero -/* 0B8998 7F083E68 8FAD0148 */ lw $t5, 0x148($sp) -/* 0B899C 7F083E6C 51A00015 */ beql $t5, $zero, .L7F083EC4 -/* 0B89A0 7F083E70 8E0F0000 */ lw $t7, ($s0) -/* 0B89A4 7F083E74 0FC1F1AA */ jal redirect_get_BONDdata_autoaim_x -/* 0B89A8 7F083E78 00000000 */ nop -/* 0B89AC 7F083E7C 50400011 */ beql $v0, $zero, .L7F083EC4 -/* 0B89B0 7F083E80 8E0F0000 */ lw $t7, ($s0) -/* 0B89B4 7F083E84 8E0C0000 */ lw $t4, ($s0) -/* 0B89B8 7F083E88 8D980140 */ lw $t8, 0x140($t4) -/* 0B89BC 7F083E8C 5300000D */ beql $t8, $zero, .L7F083EC4 -/* 0B89C0 7F083E90 8E0F0000 */ lw $t7, ($s0) -/* 0B89C4 7F083E94 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B89C8 7F083E98 00002025 */ move $a0, $zero -/* 0B89CC 7F083E9C 00402025 */ move $a0, $v0 -/* 0B89D0 7F083EA0 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B89D4 7F083EA4 24050008 */ li $a1, 8 -/* 0B89D8 7F083EA8 50400006 */ beql $v0, $zero, .L7F083EC4 -/* 0B89DC 7F083EAC 8E0F0000 */ lw $t7, ($s0) -/* 0B89E0 7F083EB0 8E0E0000 */ lw $t6, ($s0) -/* 0B89E4 7F083EB4 C5C4013C */ lwc1 $f4, 0x13c($t6) -/* 0B89E8 7F083EB8 10000007 */ b .L7F083ED8 -/* 0B89EC 7F083EBC E7A40070 */ swc1 $f4, 0x70($sp) -/* 0B89F0 7F083EC0 8E0F0000 */ lw $t7, ($s0) -.L7F083EC4: -/* 0B89F4 7F083EC4 3C018005 */ lui $at, %hi(D_80055160) -/* 0B89F8 7F083EC8 C4285160 */ lwc1 $f8, %lo(D_80055160)($at) -/* 0B89FC 7F083ECC C5E6014C */ lwc1 $f6, 0x14c($t7) -/* 0B8A00 7F083ED0 46083482 */ mul.s $f18, $f6, $f8 -/* 0B8A04 7F083ED4 E7B20070 */ swc1 $f18, 0x70($sp) -.L7F083ED8: -/* 0B8A08 7F083ED8 8FB90148 */ lw $t9, 0x148($sp) -/* 0B8A0C 7F083EDC 53200014 */ beql $t9, $zero, .L7F083F30 -/* 0B8A10 7F083EE0 8E0C0000 */ lw $t4, ($s0) -/* 0B8A14 7F083EE4 0FC1F170 */ jal redirect_get_BONDdata_autoaim_y -/* 0B8A18 7F083EE8 00000000 */ nop -/* 0B8A1C 7F083EEC 50400010 */ beql $v0, $zero, .L7F083F30 -/* 0B8A20 7F083EF0 8E0C0000 */ lw $t4, ($s0) -/* 0B8A24 7F083EF4 8E0A0000 */ lw $t2, ($s0) -/* 0B8A28 7F083EF8 8D4B0130 */ lw $t3, 0x130($t2) -/* 0B8A2C 7F083EFC 5160000C */ beql $t3, $zero, .L7F083F30 -/* 0B8A30 7F083F00 8E0C0000 */ lw $t4, ($s0) -/* 0B8A34 7F083F04 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B8A38 7F083F08 00002025 */ move $a0, $zero -/* 0B8A3C 7F083F0C 00402025 */ move $a0, $v0 -/* 0B8A40 7F083F10 0FC1782D */ jal bondwalkItemCheckBitflags -/* 0B8A44 7F083F14 24050008 */ li $a1, 8 -/* 0B8A48 7F083F18 50400005 */ beql $v0, $zero, .L7F083F30 -/* 0B8A4C 7F083F1C 8E0C0000 */ lw $t4, ($s0) -/* 0B8A50 7F083F20 8E0D0000 */ lw $t5, ($s0) -/* 0B8A54 7F083F24 10000008 */ b .L7F083F48 -/* 0B8A58 7F083F28 C5AE012C */ lwc1 $f14, 0x12c($t5) -/* 0B8A5C 7F083F2C 8E0C0000 */ lw $t4, ($s0) -.L7F083F30: -/* 0B8A60 7F083F30 3C018005 */ lui $at, %hi(D_80055164) -/* 0B8A64 7F083F34 C4265164 */ lwc1 $f6, %lo(D_80055164)($at) -/* 0B8A68 7F083F38 C58A0160 */ lwc1 $f10, 0x160($t4) -/* 0B8A6C 7F083F3C 46005107 */ neg.s $f4, $f10 -/* 0B8A70 7F083F40 46062382 */ mul.s $f14, $f4, $f6 -/* 0B8A74 7F083F44 00000000 */ nop -.L7F083F48: -/* 0B8A78 7F083F48 3C063F5C */ lui $a2, (0x3F5C28F6 >> 16) # lui $a2, 0x3f5c -/* 0B8A7C 7F083F4C 34C628F6 */ ori $a2, (0x3F5C28F6 & 0xFFFF) # ori $a2, $a2, 0x28f6 -/* 0B8A80 7F083F50 0FC19FD6 */ jal sub_GAME_7F067F58 -/* 0B8A84 7F083F54 C7AC0070 */ lwc1 $f12, 0x70($sp) -/* 0B8A88 7F083F58 10000017 */ b .L7F083FB8 -/* 0B8A8C 7F083F5C 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B8A90 7F083F60 24010002 */ li $at, 2 -.L7F083F64: -/* 0B8A94 7F083F64 54410014 */ bnel $v0, $at, .L7F083FB8 -/* 0B8A98 7F083F68 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B8A9C 7F083F6C 0FC19EA9 */ jal sub_GAME_7F067AA4 -/* 0B8AA0 7F083F70 00002025 */ move $a0, $zero -/* 0B8AA4 7F083F74 8FB80134 */ lw $t8, 0x134($sp) -/* 0B8AA8 7F083F78 8FAE0130 */ lw $t6, 0x130($sp) -/* 0B8AAC 7F083F7C 3C018005 */ lui $at, %hi(D_80055168) -/* 0B8AB0 7F083F80 44984000 */ mtc1 $t8, $f8 -/* 0B8AB4 7F083F84 448E2000 */ mtc1 $t6, $f4 -/* 0B8AB8 7F083F88 C4205168 */ lwc1 $f0, %lo(D_80055168)($at) -/* 0B8ABC 7F083F8C 468044A0 */ cvt.s.w $f18, $f8 -/* 0B8AC0 7F083F90 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -/* 0B8AC4 7F083F94 44811000 */ mtc1 $at, $f2 -/* 0B8AC8 7F083F98 468021A0 */ cvt.s.w $f6, $f4 -/* 0B8ACC 7F083F9C 46009282 */ mul.s $f10, $f18, $f0 -/* 0B8AD0 7F083FA0 00000000 */ nop -/* 0B8AD4 7F083FA4 46003202 */ mul.s $f8, $f6, $f0 -/* 0B8AD8 7F083FA8 46025303 */ div.s $f12, $f10, $f2 -/* 0B8ADC 7F083FAC 0FC19FEF */ jal sub_GAME_7F067FBC -/* 0B8AE0 7F083FB0 46024383 */ div.s $f14, $f8, $f2 -/* 0B8AE4 7F083FB4 8FBF003C */ lw $ra, 0x3c($sp) -.L7F083FB8: -/* 0B8AE8 7F083FB8 D7B40030 */ ldc1 $f20, 0x30($sp) -/* 0B8AEC 7F083FBC 8FB00038 */ lw $s0, 0x38($sp) -/* 0B8AF0 7F083FC0 03E00008 */ jr $ra -/* 0B8AF4 7F083FC4 27BD01C0 */ addiu $sp, $sp, 0x1c0 -) -#endif -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_80055120 -.word 0x3d92a308 -glabel D_80055124 -.word 0x3dc2f838 -glabel D_80055128 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_8005512C -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055130 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055134 -.word 0x3f8a3d71 /*1.08*/ -glabel D_80055138 -.word 0x3c23d70a /*0.0099999998*/ -glabel D_8005513C -.word 0x3c23d70a /*0.0099999998*/ -glabel D_80055140 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055144 -.word 0x3f5dddde /*0.86666667*/ -glabel D_80055148 -.word 0x3d4ccccd /*0.050000001*/ -glabel D_8005514C -.word 0x3e99999a /*0.30000001*/ -glabel D_80055150 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055154 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055158 -.word 0x3f67a0f9 -glabel D_8005515C -.word 0x3dc2f838 -glabel D_80055160 -.word 0x3e99999a /*0.30000001*/ -glabel D_80055164 -.word 0x3dcccccd /*0.1*/ -glabel D_80055168 -.word 0x3f266666 /*0.64999998*/ -.text -glabel controller_gameplay_interaction -/* 0B4408 7F081A18 27BDFE40 */ addiu $sp, $sp, -0x1c0 -/* 0B440C 7F081A1C F7B40030 */ sdc1 $f20, 0x30($sp) -/* 0B4410 7F081A20 4480A000 */ mtc1 $zero, $f20 -/* 0B4414 7F081A24 AFBF003C */ sw $ra, 0x3c($sp) -/* 0B4418 7F081A28 AFB00038 */ sw $s0, 0x38($sp) -/* 0B441C 7F081A2C AFA401C0 */ sw $a0, 0x1c0($sp) -/* 0B4420 7F081A30 AFA501C4 */ sw $a1, 0x1c4($sp) -/* 0B4424 7F081A34 AFA601C8 */ sw $a2, 0x1c8($sp) -/* 0B4428 7F081A38 AFA701CC */ sw $a3, 0x1cc($sp) -/* 0B442C 7F081A3C AFA001BC */ sw $zero, 0x1bc($sp) -/* 0B4430 7F081A40 AFA001B8 */ sw $zero, 0x1b8($sp) -/* 0B4434 7F081A44 AFA001B4 */ sw $zero, 0x1b4($sp) -/* 0B4438 7F081A48 AFA001B0 */ sw $zero, 0x1b0($sp) -/* 0B443C 7F081A4C AFA001AC */ sw $zero, 0x1ac($sp) -/* 0B4440 7F081A50 AFA001A8 */ sw $zero, 0x1a8($sp) -/* 0B4444 7F081A54 AFA001A4 */ sw $zero, 0x1a4($sp) -/* 0B4448 7F081A58 AFA001A0 */ sw $zero, 0x1a0($sp) -/* 0B444C 7F081A5C AFA0019C */ sw $zero, 0x19c($sp) -/* 0B4450 7F081A60 AFA00198 */ sw $zero, 0x198($sp) -/* 0B4454 7F081A64 AFA00194 */ sw $zero, 0x194($sp) -/* 0B4458 7F081A68 AFA00190 */ sw $zero, 0x190($sp) -/* 0B445C 7F081A6C AFA00174 */ sw $zero, 0x174($sp) -/* 0B4460 7F081A70 AFA00170 */ sw $zero, 0x170($sp) -/* 0B4464 7F081A74 AFA0016C */ sw $zero, 0x16c($sp) -/* 0B4468 7F081A78 AFA00168 */ sw $zero, 0x168($sp) -/* 0B446C 7F081A7C AFA0015C */ sw $zero, 0x15c($sp) -/* 0B4470 7F081A80 AFA00158 */ sw $zero, 0x158($sp) -/* 0B4474 7F081A84 AFA00154 */ sw $zero, 0x154($sp) -/* 0B4478 7F081A88 AFA00150 */ sw $zero, 0x150($sp) -/* 0B447C 7F081A8C AFA0014C */ sw $zero, 0x14c($sp) -/* 0B4480 7F081A90 AFA00148 */ sw $zero, 0x148($sp) -/* 0B4484 7F081A94 E7B4018C */ swc1 $f20, 0x18c($sp) -/* 0B4488 7F081A98 E7B40188 */ swc1 $f20, 0x188($sp) -/* 0B448C 7F081A9C E7B40184 */ swc1 $f20, 0x184($sp) -/* 0B4490 7F081AA0 E7B40180 */ swc1 $f20, 0x180($sp) -/* 0B4494 7F081AA4 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B4498 7F081AA8 E7B40178 */ swc1 $f20, 0x178($sp) -/* 0B449C 7F081AAC E7B40164 */ swc1 $f20, 0x164($sp) -/* 0B44A0 7F081AB0 0FC29056 */ jal get_cur_player_look_vertical_inverted -/* 0B44A4 7F081AB4 E7B40160 */ swc1 $f20, 0x160($sp) -/* 0B44A8 7F081AB8 83A401C3 */ lb $a0, 0x1c3($sp) -/* 0B44AC 7F081ABC 2C4E0001 */ sltiu $t6, $v0, 1 -/* 0B44B0 7F081AC0 AFAE0144 */ sw $t6, 0x144($sp) -/* 0B44B4 7F081AC4 2881FFFB */ slti $at, $a0, -5 -/* 0B44B8 7F081AC8 10200003 */ beqz $at, .L7F081AD8 -/* 0B44BC 7F081ACC AFA00140 */ sw $zero, 0x140($sp) -/* 0B44C0 7F081AD0 10000006 */ b .L7F081AEC -/* 0B44C4 7F081AD4 24830005 */ addiu $v1, $a0, 5 -.L7F081AD8: -/* 0B44C8 7F081AD8 28810006 */ slti $at, $a0, 6 -/* 0B44CC 7F081ADC 14200003 */ bnez $at, .L7F081AEC -/* 0B44D0 7F081AE0 00001825 */ move $v1, $zero -/* 0B44D4 7F081AE4 10000001 */ b .L7F081AEC -/* 0B44D8 7F081AE8 2483FFFB */ addiu $v1, $a0, -5 -.L7F081AEC: -/* 0B44DC 7F081AEC 83A501C7 */ lb $a1, 0x1c7($sp) -/* 0B44E0 7F081AF0 3C108007 */ lui $s0, %hi(g_CurrentPlayer) # $s0, 0x8007 -/* 0B44E4 7F081AF4 26108BC0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x7440 -/* 0B44E8 7F081AF8 28A1FFFB */ slti $at, $a1, -5 -/* 0B44EC 7F081AFC 10200003 */ beqz $at, .L7F081B0C -/* 0B44F0 7F081B00 83AF01C3 */ lb $t7, 0x1c3($sp) -/* 0B44F4 7F081B04 10000006 */ b .L7F081B20 -/* 0B44F8 7F081B08 24A20005 */ addiu $v0, $a1, 5 -.L7F081B0C: -/* 0B44FC 7F081B0C 28A10006 */ slti $at, $a1, 6 -/* 0B4500 7F081B10 14200003 */ bnez $at, .L7F081B20 -/* 0B4504 7F081B14 00001025 */ move $v0, $zero -/* 0B4508 7F081B18 10000001 */ b .L7F081B20 -/* 0B450C 7F081B1C 24A2FFFB */ addiu $v0, $a1, -5 -.L7F081B20: -/* 0B4510 7F081B20 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B4514 7F081B24 8E080000 */ lw $t0, ($s0) -/* 0B4518 7F081B28 AFAF0134 */ sw $t7, 0x134($sp) -/* 0B451C 7F081B2C AFA3012C */ sw $v1, 0x12c($sp) -/* 0B4520 7F081B30 AFA20128 */ sw $v0, 0x128($sp) -/* 0B4524 7F081B34 AFA30124 */ sw $v1, 0x124($sp) -/* 0B4528 7F081B38 AFA20120 */ sw $v0, 0x120($sp) -/* 0B452C 7F081B3C AFB80130 */ sw $t8, 0x130($sp) -/* 0B4530 7F081B40 8D1900D8 */ lw $t9, 0xd8($t0) -/* 0B4534 7F081B44 1720001B */ bnez $t9, .L7F081BB4 -/* 0B4538 7F081B48 3C0A8003 */ lui $t2, %hi(g_bondviewForceDisarm) # $t2, 0x8003 -/* 0B453C 7F081B4C 8D4A1974 */ lw $t2, %lo(g_bondviewForceDisarm)($t2) -/* 0B4540 7F081B50 5D400019 */ bgtzl $t2, .L7F081BB8 -/* 0B4544 7F081B54 8E080000 */ lw $t0, ($s0) -/* 0B4548 7F081B58 8D0201C8 */ lw $v0, 0x1c8($t0) -/* 0B454C 7F081B5C 24010005 */ li $at, 5 -/* 0B4550 7F081B60 97AC01CE */ lhu $t4, 0x1ce($sp) -/* 0B4554 7F081B64 50410007 */ beql $v0, $at, .L7F081B84 -/* 0B4558 7F081B68 24010005 */ li $at, 5 -/* 0B455C 7F081B6C 97AB01CA */ lhu $t3, 0x1ca($sp) -/* 0B4560 7F081B70 01806827 */ not $t5, $t4 -/* 0B4564 7F081B74 016D7024 */ and $t6, $t3, $t5 -/* 0B4568 7F081B78 31CF1000 */ andi $t7, $t6, 0x1000 -/* 0B456C 7F081B7C 15E00006 */ bnez $t7, .L7F081B98 -/* 0B4570 7F081B80 24010005 */ li $at, 5 -.L7F081B84: -/* 0B4574 7F081B84 5441000C */ bnel $v0, $at, .L7F081BB8 -/* 0B4578 7F081B88 8E080000 */ lw $t0, ($s0) -/* 0B457C 7F081B8C 8D1801D0 */ lw $t8, 0x1d0($t0) -/* 0B4580 7F081B90 53000009 */ beql $t8, $zero, .L7F081BB8 -/* 0B4584 7F081B94 8E080000 */ lw $t0, ($s0) -.L7F081B98: -/* 0B4588 7F081B98 0FC26669 */ jal getPlayerCount -/* 0B458C 7F081B9C 00000000 */ nop -/* 0B4590 7F081BA0 24010001 */ li $at, 1 -/* 0B4594 7F081BA4 54410004 */ bnel $v0, $at, .L7F081BB8 -/* 0B4598 7F081BA8 8E080000 */ lw $t0, ($s0) -/* 0B459C 7F081BAC 0FC1FE46 */ jal trigger_solo_watch_menu -/* 0B45A0 7F081BB0 00002025 */ move $a0, $zero -.L7F081BB4: -/* 0B45A4 7F081BB4 8E080000 */ lw $t0, ($s0) -.L7F081BB8: -/* 0B45A8 7F081BB8 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B45AC 7F081BBC 572003AC */ bnezl $t9, .L7F082A70 -/* 0B45B0 7F081BC0 8E0A0000 */ lw $t2, ($s0) -/* 0B45B4 7F081BC4 8D0A00D8 */ lw $t2, 0xd8($t0) -/* 0B45B8 7F081BC8 554003A9 */ bnezl $t2, .L7F082A70 -/* 0B45BC 7F081BCC 8E0A0000 */ lw $t2, ($s0) -/* 0B45C0 7F081BD0 0FC26669 */ jal getPlayerCount -/* 0B45C4 7F081BD4 00000000 */ nop -/* 0B45C8 7F081BD8 24010001 */ li $at, 1 -/* 0B45CC 7F081BDC 10410008 */ beq $v0, $at, .L7F081C00 -/* 0B45D0 7F081BE0 3C0C8007 */ lui $t4, %hi(g_stopPlayFlag) # $t4, 0x8007 -/* 0B45D4 7F081BE4 8D8C3AE0 */ lw $t4, %lo(g_stopPlayFlag)($t4) -/* 0B45D8 7F081BE8 3C0B8007 */ lui $t3, %hi(g_gameOverFlag) # $t3, 0x8007 -/* 0B45DC 7F081BEC 558003A0 */ bnezl $t4, .L7F082A70 -/* 0B45E0 7F081BF0 8E0A0000 */ lw $t2, ($s0) -/* 0B45E4 7F081BF4 8D6B3AE4 */ lw $t3, %lo(g_gameOverFlag)($t3) -/* 0B45E8 7F081BF8 5560039D */ bnezl $t3, .L7F082A70 -/* 0B45EC 7F081BFC 8E0A0000 */ lw $t2, ($s0) -.L7F081C00: -/* 0B45F0 7F081C00 97AD01CA */ lhu $t5, 0x1ca($sp) -/* 0B45F4 7F081C04 0FC29038 */ jal cur_player_get_control_type -/* 0B45F8 7F081C08 AFAD005C */ sw $t5, 0x5c($sp) -/* 0B45FC 7F081C0C 24010006 */ li $at, 6 -/* 0B4600 7F081C10 50410011 */ beql $v0, $at, .L7F081C58 -/* 0B4604 7F081C14 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B4608 7F081C18 0FC29038 */ jal cur_player_get_control_type -/* 0B460C 7F081C1C 00000000 */ nop -/* 0B4610 7F081C20 24010007 */ li $at, 7 -/* 0B4614 7F081C24 5041000C */ beql $v0, $at, .L7F081C58 -/* 0B4618 7F081C28 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B461C 7F081C2C 0FC29038 */ jal cur_player_get_control_type -/* 0B4620 7F081C30 00000000 */ nop -/* 0B4624 7F081C34 24010005 */ li $at, 5 -/* 0B4628 7F081C38 50410007 */ beql $v0, $at, .L7F081C58 -/* 0B462C 7F081C3C 97AF01CE */ lhu $t7, 0x1ce($sp) -/* 0B4630 7F081C40 0FC29038 */ jal cur_player_get_control_type -/* 0B4634 7F081C44 00000000 */ nop -/* 0B4638 7F081C48 24010004 */ li $at, 4 -/* 0B463C 7F081C4C 144101C3 */ bne $v0, $at, .L7F08235C -/* 0B4640 7F081C50 00000000 */ nop -/* 0B4644 7F081C54 97AF01CE */ lhu $t7, 0x1ce($sp) -.L7F081C58: -/* 0B4648 7F081C58 8FAE005C */ lw $t6, 0x5c($sp) -/* 0B464C 7F081C5C 01E0C027 */ not $t8, $t7 -/* 0B4650 7F081C60 01D8C824 */ and $t9, $t6, $t8 -/* 0B4654 7F081C64 0FC269A4 */ jal get_cur_playernum -/* 0B4658 7F081C68 AFB90060 */ sw $t9, 0x60($sp) -/* 0B465C 7F081C6C 0FC26669 */ jal getPlayerCount -/* 0B4660 7F081C70 AFA20064 */ sw $v0, 0x64($sp) -/* 0B4664 7F081C74 8FAA0064 */ lw $t2, 0x64($sp) -/* 0B4668 7F081C78 004A2021 */ addu $a0, $v0, $t2 -/* 0B466C 7F081C7C 00046600 */ sll $t4, $a0, 0x18 -/* 0B4670 7F081C80 0C002B98 */ jal joyGetStickX -/* 0B4674 7F081C84 000C2603 */ sra $a0, $t4, 0x18 -/* 0B4678 7F081C88 0FC269A4 */ jal get_cur_playernum -/* 0B467C 7F081C8C A3A2011F */ sb $v0, 0x11f($sp) -/* 0B4680 7F081C90 0FC26669 */ jal getPlayerCount -/* 0B4684 7F081C94 AFA20064 */ sw $v0, 0x64($sp) -/* 0B4688 7F081C98 8FAD0064 */ lw $t5, 0x64($sp) -/* 0B468C 7F081C9C 004D2021 */ addu $a0, $v0, $t5 -/* 0B4690 7F081CA0 00047E00 */ sll $t7, $a0, 0x18 -/* 0B4694 7F081CA4 0C002BDC */ jal joyGetStickY -/* 0B4698 7F081CA8 000F2603 */ sra $a0, $t7, 0x18 -/* 0B469C 7F081CAC 0FC269A4 */ jal get_cur_playernum -/* 0B46A0 7F081CB0 A3A2011E */ sb $v0, 0x11e($sp) -/* 0B46A4 7F081CB4 0FC26669 */ jal getPlayerCount -/* 0B46A8 7F081CB8 AFA20064 */ sw $v0, 0x64($sp) -/* 0B46AC 7F081CBC 8FB80064 */ lw $t8, 0x64($sp) -/* 0B46B0 7F081CC0 3405FFFF */ li $a1, 65535 -/* 0B46B4 7F081CC4 00582021 */ addu $a0, $v0, $t8 -/* 0B46B8 7F081CC8 0004CE00 */ sll $t9, $a0, 0x18 -/* 0B46BC 7F081CCC 0C002C20 */ jal joyGetButtons -/* 0B46C0 7F081CD0 00192603 */ sra $a0, $t9, 0x18 -/* 0B46C4 7F081CD4 8E0B0000 */ lw $t3, ($s0) -/* 0B46C8 7F081CD8 83AC011F */ lb $t4, 0x11f($sp) -/* 0B46CC 7F081CDC A7A2011C */ sh $v0, 0x11c($sp) -/* 0B46D0 7F081CE0 956D03B6 */ lhu $t5, 0x3b6($t3) -/* 0B46D4 7F081CE4 2981FFFB */ slti $at, $t4, -5 -/* 0B46D8 7F081CE8 01801825 */ move $v1, $t4 -/* 0B46DC 7F081CEC 10200003 */ beqz $at, .L7F081CFC -/* 0B46E0 7F081CF0 A7AD011A */ sh $t5, 0x11a($sp) -/* 0B46E4 7F081CF4 10000007 */ b .L7F081D14 -/* 0B46E8 7F081CF8 25830005 */ addiu $v1, $t4, 5 -.L7F081CFC: -/* 0B46EC 7F081CFC 28610006 */ slti $at, $v1, 6 -/* 0B46F0 7F081D00 14200004 */ bnez $at, .L7F081D14 -/* 0B46F4 7F081D04 00001825 */ move $v1, $zero -/* 0B46F8 7F081D08 83A3011F */ lb $v1, 0x11f($sp) -/* 0B46FC 7F081D0C 10000001 */ b .L7F081D14 -/* 0B4700 7F081D10 2463FFFB */ addiu $v1, $v1, -5 -.L7F081D14: -/* 0B4704 7F081D14 83A2011E */ lb $v0, 0x11e($sp) -/* 0B4708 7F081D18 2841FFFB */ slti $at, $v0, -5 -/* 0B470C 7F081D1C 10200003 */ beqz $at, .L7F081D2C -/* 0B4710 7F081D20 244F0005 */ addiu $t7, $v0, 5 -/* 0B4714 7F081D24 10000007 */ b .L7F081D44 -/* 0B4718 7F081D28 AFAF0110 */ sw $t7, 0x110($sp) -.L7F081D2C: -/* 0B471C 7F081D2C 28410006 */ slti $at, $v0, 6 -/* 0B4720 7F081D30 14200003 */ bnez $at, .L7F081D40 -/* 0B4724 7F081D34 244EFFFB */ addiu $t6, $v0, -5 -/* 0B4728 7F081D38 10000002 */ b .L7F081D44 -/* 0B472C 7F081D3C AFAE0110 */ sw $t6, 0x110($sp) -.L7F081D40: -/* 0B4730 7F081D40 AFA00110 */ sw $zero, 0x110($sp) -.L7F081D44: -/* 0B4734 7F081D44 0FC29038 */ jal cur_player_get_control_type -/* 0B4738 7F081D48 AFA30114 */ sw $v1, 0x114($sp) -/* 0B473C 7F081D4C 24010004 */ li $at, 4 -/* 0B4740 7F081D50 10410006 */ beq $v0, $at, .L7F081D6C -/* 0B4744 7F081D54 8FA30114 */ lw $v1, 0x114($sp) -/* 0B4748 7F081D58 0FC29038 */ jal cur_player_get_control_type -/* 0B474C 7F081D5C AFA30114 */ sw $v1, 0x114($sp) -/* 0B4750 7F081D60 24010006 */ li $at, 6 -/* 0B4754 7F081D64 14410005 */ bne $v0, $at, .L7F081D7C -/* 0B4758 7F081D68 8FA30114 */ lw $v1, 0x114($sp) -.L7F081D6C: -/* 0B475C 7F081D6C 8FB80110 */ lw $t8, 0x110($sp) -/* 0B4760 7F081D70 AFA30124 */ sw $v1, 0x124($sp) -/* 0B4764 7F081D74 1000000F */ b .L7F081DB4 -/* 0B4768 7F081D78 AFB80128 */ sw $t8, 0x128($sp) -.L7F081D7C: -/* 0B476C 7F081D7C 3C198003 */ lui $t9, %hi(in_tank_flag) # $t9, 0x8003 -/* 0B4770 7F081D80 8F391998 */ lw $t9, %lo(in_tank_flag)($t9) -/* 0B4774 7F081D84 24010001 */ li $at, 1 -/* 0B4778 7F081D88 57210008 */ bnel $t9, $at, .L7F081DAC -/* 0B477C 7F081D8C AFA30124 */ sw $v1, 0x124($sp) -/* 0B4780 7F081D90 8E0A0000 */ lw $t2, ($s0) -/* 0B4784 7F081D94 8D4B0124 */ lw $t3, 0x124($t2) -/* 0B4788 7F081D98 55600004 */ bnezl $t3, .L7F081DAC -/* 0B478C 7F081D9C AFA30124 */ sw $v1, 0x124($sp) -/* 0B4790 7F081DA0 10000002 */ b .L7F081DAC -/* 0B4794 7F081DA4 AFA3012C */ sw $v1, 0x12c($sp) -/* 0B4798 7F081DA8 AFA30124 */ sw $v1, 0x124($sp) -.L7F081DAC: -/* 0B479C 7F081DAC 8FAD0110 */ lw $t5, 0x110($sp) -/* 0B47A0 7F081DB0 AFAD0120 */ sw $t5, 0x120($sp) -.L7F081DB4: -/* 0B47A4 7F081DB4 0FC29038 */ jal cur_player_get_control_type -/* 0B47A8 7F081DB8 00000000 */ nop -/* 0B47AC 7F081DBC 24010004 */ li $at, 4 -/* 0B47B0 7F081DC0 50410007 */ beql $v0, $at, .L7F081DE0 -/* 0B47B4 7F081DC4 97A2011C */ lhu $v0, 0x11c($sp) -/* 0B47B8 7F081DC8 0FC29038 */ jal cur_player_get_control_type -/* 0B47BC 7F081DCC 00000000 */ nop -/* 0B47C0 7F081DD0 24010005 */ li $at, 5 -/* 0B47C4 7F081DD4 14410016 */ bne $v0, $at, .L7F081E30 -/* 0B47C8 7F081DD8 8FB9005C */ lw $t9, 0x5c($sp) -/* 0B47CC 7F081DDC 97A2011C */ lhu $v0, 0x11c($sp) -.L7F081DE0: -/* 0B47D0 7F081DE0 97AE011A */ lhu $t6, 0x11a($sp) -/* 0B47D4 7F081DE4 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B47D8 7F081DE8 304C2000 */ andi $t4, $v0, 0x2000 -/* 0B47DC 7F081DEC 000C782B */ sltu $t7, $zero, $t4 -/* 0B47E0 7F081DF0 AFAF0104 */ sw $t7, 0x104($sp) -/* 0B47E4 7F081DF4 8FAF0060 */ lw $t7, 0x60($sp) -/* 0B47E8 7F081DF8 01C0C027 */ not $t8, $t6 -/* 0B47EC 7F081DFC 00581824 */ and $v1, $v0, $t8 -/* 0B47F0 7F081E00 30792000 */ andi $t9, $v1, 0x2000 -/* 0B47F4 7F081E04 316D2000 */ andi $t5, $t3, 0x2000 -/* 0B47F8 7F081E08 31EE2000 */ andi $t6, $t7, 0x2000 -/* 0B47FC 7F081E0C 0019502B */ sltu $t2, $zero, $t9 -/* 0B4800 7F081E10 000D602B */ sltu $t4, $zero, $t5 -/* 0B4804 7F081E14 000EC02B */ sltu $t8, $zero, $t6 -/* 0B4808 7F081E18 AFAA0100 */ sw $t2, 0x100($sp) -/* 0B480C 7F081E1C AFAC010C */ sw $t4, 0x10c($sp) -/* 0B4810 7F081E20 AFB80108 */ sw $t8, 0x108($sp) -/* 0B4814 7F081E24 AFA30050 */ sw $v1, 0x50($sp) -/* 0B4818 7F081E28 10000014 */ b .L7F081E7C -/* 0B481C 7F081E2C AFA20058 */ sw $v0, 0x58($sp) -.L7F081E30: -/* 0B4820 7F081E30 332A2000 */ andi $t2, $t9, 0x2000 -/* 0B4824 7F081E34 97B9011A */ lhu $t9, 0x11a($sp) -/* 0B4828 7F081E38 8FAD0060 */ lw $t5, 0x60($sp) -/* 0B482C 7F081E3C 97A2011C */ lhu $v0, 0x11c($sp) -/* 0B4830 7F081E40 000A582B */ sltu $t3, $zero, $t2 -/* 0B4834 7F081E44 03205027 */ not $t2, $t9 -/* 0B4838 7F081E48 AFAB0104 */ sw $t3, 0x104($sp) -/* 0B483C 7F081E4C 31AC2000 */ andi $t4, $t5, 0x2000 -/* 0B4840 7F081E50 004A1824 */ and $v1, $v0, $t2 -/* 0B4844 7F081E54 306B2000 */ andi $t3, $v1, 0x2000 -/* 0B4848 7F081E58 304E2000 */ andi $t6, $v0, 0x2000 -/* 0B484C 7F081E5C 000C782B */ sltu $t7, $zero, $t4 -/* 0B4850 7F081E60 000EC02B */ sltu $t8, $zero, $t6 -/* 0B4854 7F081E64 000B682B */ sltu $t5, $zero, $t3 -/* 0B4858 7F081E68 AFAF0100 */ sw $t7, 0x100($sp) -/* 0B485C 7F081E6C AFB8010C */ sw $t8, 0x10c($sp) -/* 0B4860 7F081E70 AFAD0108 */ sw $t5, 0x108($sp) -/* 0B4864 7F081E74 AFA30050 */ sw $v1, 0x50($sp) -/* 0B4868 7F081E78 AFA20058 */ sw $v0, 0x58($sp) -.L7F081E7C: -/* 0B486C 7F081E7C 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B4870 7F081E80 00000000 */ nop -/* 0B4874 7F081E84 5440011F */ bnezl $v0, .L7F082304 -/* 0B4878 7F081E88 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B487C 7F081E8C 0FC30667 */ jal sub_GAME_7F0C24BC -/* 0B4880 7F081E90 00000000 */ nop -/* 0B4884 7F081E94 5040011B */ beql $v0, $zero, .L7F082304 -/* 0B4888 7F081E98 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B488C 7F081E9C 0FC29068 */ jal cur_player_get_aim_control -/* 0B4890 7F081EA0 00000000 */ nop -/* 0B4894 7F081EA4 54400006 */ bnezl $v0, .L7F081EC0 -/* 0B4898 7F081EA8 8FAE0100 */ lw $t6, 0x100($sp) -/* 0B489C 7F081EAC 8FAC0104 */ lw $t4, 0x104($sp) -/* 0B48A0 7F081EB0 8E0F0000 */ lw $t7, ($s0) -/* 0B48A4 7F081EB4 10000008 */ b .L7F081ED8 -/* 0B48A8 7F081EB8 ADEC0124 */ sw $t4, 0x124($t7) -/* 0B48AC 7F081EBC 8FAE0100 */ lw $t6, 0x100($sp) -.L7F081EC0: -/* 0B48B0 7F081EC0 51C00006 */ beql $t6, $zero, .L7F081EDC -/* 0B48B4 7F081EC4 8E190000 */ lw $t9, ($s0) -/* 0B48B8 7F081EC8 8E080000 */ lw $t0, ($s0) -/* 0B48BC 7F081ECC 8D050124 */ lw $a1, 0x124($t0) -/* 0B48C0 7F081ED0 2CB80001 */ sltiu $t8, $a1, 1 -/* 0B48C4 7F081ED4 AD180124 */ sw $t8, 0x124($t0) -.L7F081ED8: -/* 0B48C8 7F081ED8 8E190000 */ lw $t9, ($s0) -.L7F081EDC: -/* 0B48CC 7F081EDC 8FA40060 */ lw $a0, 0x60($sp) -/* 0B48D0 7F081EE0 240F0001 */ li $t7, 1 -/* 0B48D4 7F081EE4 8F230124 */ lw $v1, 0x124($t9) -/* 0B48D8 7F081EE8 308A4000 */ andi $t2, $a0, 0x4000 -/* 0B48DC 7F081EEC 000A582B */ sltu $t3, $zero, $t2 -/* 0B48E0 7F081EF0 2C620001 */ sltiu $v0, $v1, 1 -/* 0B48E4 7F081EF4 AFA201BC */ sw $v0, 0x1bc($sp) -/* 0B48E8 7F081EF8 AFA20148 */ sw $v0, 0x148($sp) -/* 0B48EC 7F081EFC 01602825 */ move $a1, $t3 -/* 0B48F0 7F081F00 AFAB0048 */ sw $t3, 0x48($sp) -/* 0B48F4 7F081F04 15600005 */ bnez $t3, .L7F081F1C -/* 0B48F8 7F081F08 AFA301B8 */ sw $v1, 0x1b8($sp) -/* 0B48FC 7F081F0C 8FA50050 */ lw $a1, 0x50($sp) -/* 0B4900 7F081F10 AFAB0048 */ sw $t3, 0x48($sp) -/* 0B4904 7F081F14 30AD4000 */ andi $t5, $a1, 0x4000 -/* 0B4908 7F081F18 000D282B */ sltu $a1, $zero, $t5 -.L7F081F1C: -/* 0B490C 7F081F1C AFA501B0 */ sw $a1, 0x1b0($sp) -/* 0B4910 7F081F20 AFA201AC */ sw $v0, 0x1ac($sp) -/* 0B4914 7F081F24 AFAF01A8 */ sw $t7, 0x1a8($sp) -/* 0B4918 7F081F28 AFA201A4 */ sw $v0, 0x1a4($sp) -/* 0B491C 7F081F2C 10600012 */ beqz $v1, .L7F081F78 -/* 0B4920 7F081F30 AFA201A0 */ sw $v0, 0x1a0($sp) -/* 0B4924 7F081F34 83A401C7 */ lb $a0, 0x1c7($sp) -/* 0B4928 7F081F38 2881003D */ slti $at, $a0, 0x3d -/* 0B492C 7F081F3C 1420000E */ bnez $at, .L7F081F78 -/* 0B4930 7F081F40 248EFFC4 */ addiu $t6, $a0, -0x3c -/* 0B4934 7F081F44 448E2000 */ mtc1 $t6, $f4 -/* 0B4938 7F081F48 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B493C 7F081F4C 44811000 */ mtc1 $at, $f2 -/* 0B4940 7F081F50 468021A0 */ cvt.s.w $f6, $f4 -/* 0B4944 7F081F54 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4948 7F081F58 44816000 */ mtc1 $at, $f12 -/* 0B494C 7F081F5C 46023003 */ div.s $f0, $f6, $f2 -/* 0B4950 7F081F60 4600603C */ c.lt.s $f12, $f0 -/* 0B4954 7F081F64 E7A00184 */ swc1 $f0, 0x184($sp) -/* 0B4958 7F081F68 45000008 */ bc1f .L7F081F8C -/* 0B495C 7F081F6C 00000000 */ nop -/* 0B4960 7F081F70 10000006 */ b .L7F081F8C -/* 0B4964 7F081F74 E7AC0184 */ swc1 $f12, 0x184($sp) -.L7F081F78: -/* 0B4968 7F081F78 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B496C 7F081F7C 44816000 */ mtc1 $at, $f12 -/* 0B4970 7F081F80 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B4974 7F081F84 44811000 */ mtc1 $at, $f2 -/* 0B4978 7F081F88 83A401C7 */ lb $a0, 0x1c7($sp) -.L7F081F8C: -/* 0B497C 7F081F8C 1060000D */ beqz $v1, .L7F081FC4 -/* 0B4980 7F081F90 2881FFC4 */ slti $at, $a0, -0x3c -/* 0B4984 7F081F94 1020000B */ beqz $at, .L7F081FC4 -/* 0B4988 7F081F98 2418FFC4 */ li $t8, -60 -/* 0B498C 7F081F9C 0304C823 */ subu $t9, $t8, $a0 -/* 0B4990 7F081FA0 44994000 */ mtc1 $t9, $f8 -/* 0B4994 7F081FA4 00000000 */ nop -/* 0B4998 7F081FA8 468042A0 */ cvt.s.w $f10, $f8 -/* 0B499C 7F081FAC 46025003 */ div.s $f0, $f10, $f2 -/* 0B49A0 7F081FB0 4600603C */ c.lt.s $f12, $f0 -/* 0B49A4 7F081FB4 E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B49A8 7F081FB8 45000002 */ bc1f .L7F081FC4 -/* 0B49AC 7F081FBC 00000000 */ nop -/* 0B49B0 7F081FC0 E7AC0180 */ swc1 $f12, 0x180($sp) -.L7F081FC4: -/* 0B49B4 7F081FC4 10600010 */ beqz $v1, .L7F082008 -/* 0B49B8 7F081FC8 00002025 */ move $a0, $zero -/* 0B49BC 7F081FCC 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B49C0 7F081FD0 240AFFC4 */ li $t2, -60 -/* 0B49C4 7F081FD4 2841FFC4 */ slti $at, $v0, -0x3c -/* 0B49C8 7F081FD8 1020000B */ beqz $at, .L7F082008 -/* 0B49CC 7F081FDC 01425823 */ subu $t3, $t2, $v0 -/* 0B49D0 7F081FE0 448B9000 */ mtc1 $t3, $f18 -/* 0B49D4 7F081FE4 00000000 */ nop -/* 0B49D8 7F081FE8 46809120 */ cvt.s.w $f4, $f18 -/* 0B49DC 7F081FEC 46022003 */ div.s $f0, $f4, $f2 -/* 0B49E0 7F081FF0 4600603C */ c.lt.s $f12, $f0 -/* 0B49E4 7F081FF4 E7A0017C */ swc1 $f0, 0x17c($sp) -/* 0B49E8 7F081FF8 45000004 */ bc1f .L7F08200C -/* 0B49EC 7F081FFC 00000000 */ nop -/* 0B49F0 7F082000 10000002 */ b .L7F08200C -/* 0B49F4 7F082004 E7AC017C */ swc1 $f12, 0x17c($sp) -.L7F082008: -/* 0B49F8 7F082008 83A201C3 */ lb $v0, 0x1c3($sp) -.L7F08200C: -/* 0B49FC 7F08200C 1060000C */ beqz $v1, .L7F082040 -/* 0B4A00 7F082010 2841003D */ slti $at, $v0, 0x3d -/* 0B4A04 7F082014 1420000A */ bnez $at, .L7F082040 -/* 0B4A08 7F082018 244DFFC4 */ addiu $t5, $v0, -0x3c -/* 0B4A0C 7F08201C 448D3000 */ mtc1 $t5, $f6 -/* 0B4A10 7F082020 00000000 */ nop -/* 0B4A14 7F082024 46803220 */ cvt.s.w $f8, $f6 -/* 0B4A18 7F082028 46024003 */ div.s $f0, $f8, $f2 -/* 0B4A1C 7F08202C 4600603C */ c.lt.s $f12, $f0 -/* 0B4A20 7F082030 E7A00178 */ swc1 $f0, 0x178($sp) -/* 0B4A24 7F082034 45020003 */ bc1fl .L7F082044 -/* 0B4A28 7F082038 8FAC005C */ lw $t4, 0x5c($sp) -/* 0B4A2C 7F08203C E7AC0178 */ swc1 $f12, 0x178($sp) -.L7F082040: -/* 0B4A30 7F082040 8FAC005C */ lw $t4, 0x5c($sp) -.L7F082044: -/* 0B4A34 7F082044 318F8000 */ andi $t7, $t4, 0x8000 -/* 0B4A38 7F082048 000F702B */ sltu $t6, $zero, $t7 -/* 0B4A3C 7F08204C 15C00006 */ bnez $t6, .L7F082068 -/* 0B4A40 7F082050 AFAE004C */ sw $t6, 0x4c($sp) -/* 0B4A44 7F082054 8FA20058 */ lw $v0, 0x58($sp) -/* 0B4A48 7F082058 30588000 */ andi $t8, $v0, 0x8000 -/* 0B4A4C 7F08205C 0018282B */ sltu $a1, $zero, $t8 -/* 0B4A50 7F082060 50A00005 */ beql $a1, $zero, .L7F082078 -/* 0B4A54 7F082064 8FAB0060 */ lw $t3, 0x60($sp) -.L7F082068: -/* 0B4A58 7F082068 8FA50108 */ lw $a1, 0x108($sp) -/* 0B4A5C 7F08206C 0005502B */ sltu $t2, $zero, $a1 -/* 0B4A60 7F082070 01402825 */ move $a1, $t2 -/* 0B4A64 7F082074 8FAB0060 */ lw $t3, 0x60($sp) -.L7F082078: -/* 0B4A68 7F082078 AFA50174 */ sw $a1, 0x174($sp) -/* 0B4A6C 7F08207C 316D8000 */ andi $t5, $t3, 0x8000 -/* 0B4A70 7F082080 000D602B */ sltu $t4, $zero, $t5 -/* 0B4A74 7F082084 15800006 */ bnez $t4, .L7F0820A0 -/* 0B4A78 7F082088 AFAC0044 */ sw $t4, 0x44($sp) -/* 0B4A7C 7F08208C 8FA20050 */ lw $v0, 0x50($sp) -/* 0B4A80 7F082090 304F8000 */ andi $t7, $v0, 0x8000 -/* 0B4A84 7F082094 000F282B */ sltu $a1, $zero, $t7 -/* 0B4A88 7F082098 50A00005 */ beql $a1, $zero, .L7F0820B0 -/* 0B4A8C 7F08209C AFA50170 */ sw $a1, 0x170($sp) -.L7F0820A0: -/* 0B4A90 7F0820A0 8FA5010C */ lw $a1, 0x10c($sp) -/* 0B4A94 7F0820A4 2CB80001 */ sltiu $t8, $a1, 1 -/* 0B4A98 7F0820A8 03002825 */ move $a1, $t8 -/* 0B4A9C 7F0820AC AFA50170 */ sw $a1, 0x170($sp) -.L7F0820B0: -/* 0B4AA0 7F0820B0 AFA3016C */ sw $v1, 0x16c($sp) -/* 0B4AA4 7F0820B4 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B4AA8 7F0820B8 AFA30168 */ sw $v1, 0x168($sp) -/* 0B4AAC 7F0820BC 00402025 */ move $a0, $v0 -/* 0B4AB0 7F0820C0 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B4AB4 7F0820C4 34058000 */ li $a1, 32768 -/* 0B4AB8 7F0820C8 10400028 */ beqz $v0, .L7F08216C -/* 0B4ABC 7F0820CC 00000000 */ nop -/* 0B4AC0 7F0820D0 8E190000 */ lw $t9, ($s0) -/* 0B4AC4 7F0820D4 8FA20110 */ lw $v0, 0x110($sp) -/* 0B4AC8 7F0820D8 8F2A0124 */ lw $t2, 0x124($t9) -/* 0B4ACC 7F0820DC 11400023 */ beqz $t2, .L7F08216C -/* 0B4AD0 7F0820E0 00000000 */ nop -/* 0B4AD4 7F0820E4 04410010 */ bgez $v0, .L7F082128 -/* 0B4AD8 7F0820E8 00025823 */ negu $t3, $v0 -/* 0B4ADC 7F0820EC 448B5000 */ mtc1 $t3, $f10 -/* 0B4AE0 7F0820F0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4AE4 7F0820F4 44811000 */ mtc1 $at, $f2 -/* 0B4AE8 7F0820F8 468054A0 */ cvt.s.w $f18, $f10 -/* 0B4AEC 7F0820FC 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B4AF0 7F082100 44812000 */ mtc1 $at, $f4 -/* 0B4AF4 7F082104 00000000 */ nop -/* 0B4AF8 7F082108 46049303 */ div.s $f12, $f18, $f4 -/* 0B4AFC 7F08210C 460C103C */ c.lt.s $f2, $f12 -/* 0B4B00 7F082110 00000000 */ nop -/* 0B4B04 7F082114 45020003 */ bc1fl .L7F082124 -/* 0B4B08 7F082118 460C6300 */ add.s $f12, $f12, $f12 -/* 0B4B0C 7F08211C 46001306 */ mov.s $f12, $f2 -/* 0B4B10 7F082120 460C6300 */ add.s $f12, $f12, $f12 -.L7F082124: -/* 0B4B14 7F082124 E7AC0164 */ swc1 $f12, 0x164($sp) -.L7F082128: -/* 0B4B18 7F082128 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4B1C 7F08212C 44811000 */ mtc1 $at, $f2 -/* 0B4B20 7F082130 1840000E */ blez $v0, .L7F08216C -/* 0B4B24 7F082134 C7AC0164 */ lwc1 $f12, 0x164($sp) -/* 0B4B28 7F082138 44823000 */ mtc1 $v0, $f6 -/* 0B4B2C 7F08213C 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B4B30 7F082140 44815000 */ mtc1 $at, $f10 -/* 0B4B34 7F082144 46803220 */ cvt.s.w $f8, $f6 -/* 0B4B38 7F082148 460A4383 */ div.s $f14, $f8, $f10 -/* 0B4B3C 7F08214C 460E103C */ c.lt.s $f2, $f14 -/* 0B4B40 7F082150 00000000 */ nop -/* 0B4B44 7F082154 45020003 */ bc1fl .L7F082164 -/* 0B4B48 7F082158 460E7380 */ add.s $f14, $f14, $f14 -/* 0B4B4C 7F08215C 46001386 */ mov.s $f14, $f2 -/* 0B4B50 7F082160 460E7380 */ add.s $f14, $f14, $f14 -.L7F082164: -/* 0B4B54 7F082164 E7AC0164 */ swc1 $f12, 0x164($sp) -/* 0B4B58 7F082168 E7AE0160 */ swc1 $f14, 0x160($sp) -.L7F08216C: -/* 0B4B5C 7F08216C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B4B60 7F082170 00002025 */ move $a0, $zero -/* 0B4B64 7F082174 00402025 */ move $a0, $v0 -/* 0B4B68 7F082178 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B4B6C 7F08217C 34058000 */ li $a1, 32768 -/* 0B4B70 7F082180 2C450001 */ sltiu $a1, $v0, 1 -/* 0B4B74 7F082184 10A00009 */ beqz $a1, .L7F0821AC -/* 0B4B78 7F082188 00002025 */ move $a0, $zero -/* 0B4B7C 7F08218C 8E0D0000 */ lw $t5, ($s0) -/* 0B4B80 7F082190 8DA50124 */ lw $a1, 0x124($t5) -/* 0B4B84 7F082194 0005602B */ sltu $t4, $zero, $a1 -/* 0B4B88 7F082198 11800004 */ beqz $t4, .L7F0821AC -/* 0B4B8C 7F08219C 01802825 */ move $a1, $t4 -/* 0B4B90 7F0821A0 83A5011E */ lb $a1, 0x11e($sp) -/* 0B4B94 7F0821A4 28AFFFE2 */ slti $t7, $a1, -0x1e -/* 0B4B98 7F0821A8 01E02825 */ move $a1, $t7 -.L7F0821AC: -/* 0B4B9C 7F0821AC 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B4BA0 7F0821B0 AFA5015C */ sw $a1, 0x15c($sp) -/* 0B4BA4 7F0821B4 00402025 */ move $a0, $v0 -/* 0B4BA8 7F0821B8 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B4BAC 7F0821BC 34058000 */ li $a1, 32768 -/* 0B4BB0 7F0821C0 2C450001 */ sltiu $a1, $v0, 1 -/* 0B4BB4 7F0821C4 50A0000A */ beql $a1, $zero, .L7F0821F0 -/* 0B4BB8 7F0821C8 8FAA004C */ lw $t2, 0x4c($sp) -/* 0B4BBC 7F0821CC 8E0E0000 */ lw $t6, ($s0) -/* 0B4BC0 7F0821D0 8DC50124 */ lw $a1, 0x124($t6) -/* 0B4BC4 7F0821D4 0005C02B */ sltu $t8, $zero, $a1 -/* 0B4BC8 7F0821D8 13000004 */ beqz $t8, .L7F0821EC -/* 0B4BCC 7F0821DC 03002825 */ move $a1, $t8 -/* 0B4BD0 7F0821E0 83A5011E */ lb $a1, 0x11e($sp) -/* 0B4BD4 7F0821E4 28B9001F */ slti $t9, $a1, 0x1f -/* 0B4BD8 7F0821E8 3B250001 */ xori $a1, $t9, 1 -.L7F0821EC: -/* 0B4BDC 7F0821EC 8FAA004C */ lw $t2, 0x4c($sp) -.L7F0821F0: -/* 0B4BE0 7F0821F0 AFA50158 */ sw $a1, 0x158($sp) -/* 0B4BE4 7F0821F4 8FAB0048 */ lw $t3, 0x48($sp) -/* 0B4BE8 7F0821F8 11400002 */ beqz $t2, .L7F082204 -/* 0B4BEC 7F0821FC 8FAD005C */ lw $t5, 0x5c($sp) -/* 0B4BF0 7F082200 15600012 */ bnez $t3, .L7F08224C -.L7F082204: -/* 0B4BF4 7F082204 31AC4000 */ andi $t4, $t5, 0x4000 -/* 0B4BF8 7F082208 11800003 */ beqz $t4, .L7F082218 -/* 0B4BFC 7F08220C 8FAF0044 */ lw $t7, 0x44($sp) -/* 0B4C00 7F082210 15E0000E */ bnez $t7, .L7F08224C -/* 0B4C04 7F082214 00000000 */ nop -.L7F082218: -/* 0B4C08 7F082218 8FAE0058 */ lw $t6, 0x58($sp) -/* 0B4C0C 7F08221C 8FB90050 */ lw $t9, 0x50($sp) -/* 0B4C10 7F082220 8FAB0058 */ lw $t3, 0x58($sp) -/* 0B4C14 7F082224 31D88000 */ andi $t8, $t6, 0x8000 -/* 0B4C18 7F082228 13000002 */ beqz $t8, .L7F082234 -/* 0B4C1C 7F08222C 332A4000 */ andi $t2, $t9, 0x4000 -/* 0B4C20 7F082230 15400006 */ bnez $t2, .L7F08224C -.L7F082234: -/* 0B4C24 7F082234 316D4000 */ andi $t5, $t3, 0x4000 -/* 0B4C28 7F082238 11A0000D */ beqz $t5, .L7F082270 -/* 0B4C2C 7F08223C 8FAC0050 */ lw $t4, 0x50($sp) -/* 0B4C30 7F082240 318F8000 */ andi $t7, $t4, 0x8000 -/* 0B4C34 7F082244 11E0000A */ beqz $t7, .L7F082270 -/* 0B4C38 7F082248 00000000 */ nop -.L7F08224C: -/* 0B4C3C 7F08224C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B4C40 7F082250 00002025 */ move $a0, $zero -/* 0B4C44 7F082254 2401001D */ li $at, 29 -/* 0B4C48 7F082258 14410005 */ bne $v0, $at, .L7F082270 -/* 0B4C4C 7F08225C 240E0001 */ li $t6, 1 -/* 0B4C50 7F082260 AFAE014C */ sw $t6, 0x14c($sp) -/* 0B4C54 7F082264 AFA00174 */ sw $zero, 0x174($sp) -/* 0B4C58 7F082268 AFA00170 */ sw $zero, 0x170($sp) -/* 0B4C5C 7F08226C AFA001B0 */ sw $zero, 0x1b0($sp) -.L7F082270: -/* 0B4C60 7F082270 3C188003 */ lui $t8, %hi(in_tank_flag) # $t8, 0x8003 -/* 0B4C64 7F082274 8F181998 */ lw $t8, %lo(in_tank_flag)($t8) -/* 0B4C68 7F082278 24010001 */ li $at, 1 -/* 0B4C6C 7F08227C 57010021 */ bnel $t8, $at, .L7F082304 -/* 0B4C70 7F082280 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B4C74 7F082284 8E190000 */ lw $t9, ($s0) -/* 0B4C78 7F082288 8F2A0124 */ lw $t2, 0x124($t9) -/* 0B4C7C 7F08228C 5140001D */ beql $t2, $zero, .L7F082304 -/* 0B4C80 7F082290 8FA2010C */ lw $v0, 0x10c($sp) -/* 0B4C84 7F082294 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B4C88 7F082298 00002025 */ move $a0, $zero -/* 0B4C8C 7F08229C 24010020 */ li $at, 32 -/* 0B4C90 7F0822A0 14410008 */ bne $v0, $at, .L7F0822C4 -/* 0B4C94 7F0822A4 8FAC0124 */ lw $t4, 0x124($sp) -/* 0B4C98 7F0822A8 8FAB0124 */ lw $t3, 0x124($sp) -/* 0B4C9C 7F0822AC AFA00134 */ sw $zero, 0x134($sp) -/* 0B4CA0 7F0822B0 8FAD012C */ lw $t5, 0x12c($sp) -/* 0B4CA4 7F0822B4 55600011 */ bnezl $t3, .L7F0822FC -/* 0B4CA8 7F0822B8 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B4CAC 7F0822BC 1000000E */ b .L7F0822F8 -/* 0B4CB0 7F0822C0 AFAD0124 */ sw $t5, 0x124($sp) -.L7F0822C4: -/* 0B4CB4 7F0822C4 1580000C */ bnez $t4, .L7F0822F8 -/* 0B4CB8 7F0822C8 C7B2017C */ lwc1 $f18, 0x17c($sp) -/* 0B4CBC 7F0822CC 4612A03C */ c.lt.s $f20, $f18 -/* 0B4CC0 7F0822D0 00000000 */ nop -/* 0B4CC4 7F0822D4 45020003 */ bc1fl .L7F0822E4 -/* 0B4CC8 7F0822D8 C7A40178 */ lwc1 $f4, 0x178($sp) -/* 0B4CCC 7F0822DC E7B2018C */ swc1 $f18, 0x18c($sp) -/* 0B4CD0 7F0822E0 C7A40178 */ lwc1 $f4, 0x178($sp) -.L7F0822E4: -/* 0B4CD4 7F0822E4 4604A03C */ c.lt.s $f20, $f4 -/* 0B4CD8 7F0822E8 00000000 */ nop -/* 0B4CDC 7F0822EC 45020003 */ bc1fl .L7F0822FC -/* 0B4CE0 7F0822F0 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B4CE4 7F0822F4 E7A40188 */ swc1 $f4, 0x188($sp) -.L7F0822F8: -/* 0B4CE8 7F0822F8 E7B4017C */ swc1 $f20, 0x17c($sp) -.L7F0822FC: -/* 0B4CEC 7F0822FC E7B40178 */ swc1 $f20, 0x178($sp) -/* 0B4CF0 7F082300 8FA2010C */ lw $v0, 0x10c($sp) -.L7F082304: -/* 0B4CF4 7F082304 8E080000 */ lw $t0, ($s0) -/* 0B4CF8 7F082308 240D0001 */ li $t5, 1 -/* 0B4CFC 7F08230C 0002282B */ sltu $a1, $zero, $v0 -/* 0B4D00 7F082310 50A0000E */ beql $a1, $zero, .L7F08234C -/* 0B4D04 7F082314 97AC011C */ lhu $t4, 0x11c($sp) -/* 0B4D08 7F082318 8D0501C8 */ lw $a1, 0x1c8($t0) -/* 0B4D0C 7F08231C 8FA2005C */ lw $v0, 0x5c($sp) -/* 0B4D10 7F082320 2CAE0001 */ sltiu $t6, $a1, 1 -/* 0B4D14 7F082324 11C00008 */ beqz $t6, .L7F082348 -/* 0B4D18 7F082328 01C02825 */ move $a1, $t6 -/* 0B4D1C 7F08232C 30588000 */ andi $t8, $v0, 0x8000 -/* 0B4D20 7F082330 2F050001 */ sltiu $a1, $t8, 1 -/* 0B4D24 7F082334 50A00005 */ beql $a1, $zero, .L7F08234C -/* 0B4D28 7F082338 97AC011C */ lhu $t4, 0x11c($sp) -/* 0B4D2C 7F08233C 8FA50058 */ lw $a1, 0x58($sp) -/* 0B4D30 7F082340 30AA8000 */ andi $t2, $a1, 0x8000 -/* 0B4D34 7F082344 2D450001 */ sltiu $a1, $t2, 1 -.L7F082348: -/* 0B4D38 7F082348 97AC011C */ lhu $t4, 0x11c($sp) -.L7F08234C: -/* 0B4D3C 7F08234C AFA501B4 */ sw $a1, 0x1b4($sp) -/* 0B4D40 7F082350 AFAD0140 */ sw $t5, 0x140($sp) -/* 0B4D44 7F082354 100001C5 */ b .L7F082A6C -/* 0B4D48 7F082358 A50C03B6 */ sh $t4, 0x3b6($t0) -.L7F08235C: -/* 0B4D4C 7F08235C 0FC29038 */ jal cur_player_get_control_type -/* 0B4D50 7F082360 00000000 */ nop -/* 0B4D54 7F082364 24010002 */ li $at, 2 -/* 0B4D58 7F082368 50410007 */ beql $v0, $at, .L7F082388 -/* 0B4D5C 7F08236C 340F8000 */ li $t7, 32768 -/* 0B4D60 7F082370 0FC29038 */ jal cur_player_get_control_type -/* 0B4D64 7F082374 00000000 */ nop -/* 0B4D68 7F082378 24010003 */ li $at, 3 -/* 0B4D6C 7F08237C 14410007 */ bne $v0, $at, .L7F08239C -/* 0B4D70 7F082380 24182000 */ li $t8, 8192 -/* 0B4D74 7F082384 340F8000 */ li $t7, 32768 -.L7F082388: -/* 0B4D78 7F082388 240E0030 */ li $t6, 48 -/* 0B4D7C 7F08238C A7AF00FE */ sh $t7, 0xfe($sp) -/* 0B4D80 7F082390 24032000 */ li $v1, 8192 -/* 0B4D84 7F082394 10000005 */ b .L7F0823AC -/* 0B4D88 7F082398 A7AE00FA */ sh $t6, 0xfa($sp) -.L7F08239C: -/* 0B4D8C 7F08239C 34198000 */ li $t9, 32768 -/* 0B4D90 7F0823A0 A7B800FE */ sh $t8, 0xfe($sp) -/* 0B4D94 7F0823A4 24030030 */ li $v1, 48 -/* 0B4D98 7F0823A8 A7B900FA */ sh $t9, 0xfa($sp) -.L7F0823AC: -/* 0B4D9C 7F0823AC 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B4DA0 7F0823B0 A7A300FC */ sh $v1, 0xfc($sp) -/* 0B4DA4 7F0823B4 14400193 */ bnez $v0, .L7F082A04 -/* 0B4DA8 7F0823B8 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B4DAC 7F0823BC 0FC30667 */ jal sub_GAME_7F0C24BC -/* 0B4DB0 7F0823C0 A7A300FC */ sh $v1, 0xfc($sp) -/* 0B4DB4 7F0823C4 1040018F */ beqz $v0, .L7F082A04 -/* 0B4DB8 7F0823C8 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B4DBC 7F0823CC 97AB01CE */ lhu $t3, 0x1ce($sp) -/* 0B4DC0 7F0823D0 8FAA005C */ lw $t2, 0x5c($sp) -/* 0B4DC4 7F0823D4 A7A300FC */ sh $v1, 0xfc($sp) -/* 0B4DC8 7F0823D8 01606827 */ not $t5, $t3 -/* 0B4DCC 7F0823DC 014D6024 */ and $t4, $t2, $t5 -/* 0B4DD0 7F0823E0 0FC29068 */ jal cur_player_get_aim_control -/* 0B4DD4 7F0823E4 AFAC0060 */ sw $t4, 0x60($sp) -/* 0B4DD8 7F0823E8 14400007 */ bnez $v0, .L7F082408 -/* 0B4DDC 7F0823EC 97A300FC */ lhu $v1, 0xfc($sp) -/* 0B4DE0 7F0823F0 8FAF005C */ lw $t7, 0x5c($sp) -/* 0B4DE4 7F0823F4 8E190000 */ lw $t9, ($s0) -/* 0B4DE8 7F0823F8 01E37024 */ and $t6, $t7, $v1 -/* 0B4DEC 7F0823FC 000EC02B */ sltu $t8, $zero, $t6 -/* 0B4DF0 7F082400 10000009 */ b .L7F082428 -/* 0B4DF4 7F082404 AF380124 */ sw $t8, 0x124($t9) -.L7F082408: -/* 0B4DF8 7F082408 8FAB0060 */ lw $t3, 0x60($sp) -/* 0B4DFC 7F08240C 01635024 */ and $t2, $t3, $v1 -/* 0B4E00 7F082410 51400006 */ beql $t2, $zero, .L7F08242C -/* 0B4E04 7F082414 8E0C0000 */ lw $t4, ($s0) -/* 0B4E08 7F082418 8E080000 */ lw $t0, ($s0) -/* 0B4E0C 7F08241C 8D050124 */ lw $a1, 0x124($t0) -/* 0B4E10 7F082420 2CAD0001 */ sltiu $t5, $a1, 1 -/* 0B4E14 7F082424 AD0D0124 */ sw $t5, 0x124($t0) -.L7F082428: -/* 0B4E18 7F082428 8E0C0000 */ lw $t4, ($s0) -.L7F08242C: -/* 0B4E1C 7F08242C 8FA20060 */ lw $v0, 0x60($sp) -/* 0B4E20 7F082430 8D830124 */ lw $v1, 0x124($t4) -/* 0B4E24 7F082434 304F4000 */ andi $t7, $v0, 0x4000 -/* 0B4E28 7F082438 000F702B */ sltu $t6, $zero, $t7 -/* 0B4E2C 7F08243C 2C650001 */ sltiu $a1, $v1, 1 -/* 0B4E30 7F082440 AFA501BC */ sw $a1, 0x1bc($sp) -/* 0B4E34 7F082444 AFA50148 */ sw $a1, 0x148($sp) -/* 0B4E38 7F082448 AFAE01B0 */ sw $t6, 0x1b0($sp) -/* 0B4E3C 7F08244C AFAE0048 */ sw $t6, 0x48($sp) -/* 0B4E40 7F082450 0FC29038 */ jal cur_player_get_control_type -/* 0B4E44 7F082454 AFA301B8 */ sw $v1, 0x1b8($sp) -/* 0B4E48 7F082458 24010001 */ li $at, 1 -/* 0B4E4C 7F08245C 50410007 */ beql $v0, $at, .L7F08247C -/* 0B4E50 7F082460 8FA2005C */ lw $v0, 0x5c($sp) -/* 0B4E54 7F082464 0FC29038 */ jal cur_player_get_control_type -/* 0B4E58 7F082468 00000000 */ nop -/* 0B4E5C 7F08246C 24010003 */ li $at, 3 -/* 0B4E60 7F082470 14410044 */ bne $v0, $at, .L7F082584 -/* 0B4E64 7F082474 8FA6005C */ lw $a2, 0x5c($sp) -/* 0B4E68 7F082478 8FA2005C */ lw $v0, 0x5c($sp) -.L7F08247C: -/* 0B4E6C 7F08247C 3C048003 */ lui $a0, %hi(in_tank_flag) # $a0, 0x8003 -/* 0B4E70 7F082480 30460202 */ andi $a2, $v0, 0x202 -/* 0B4E74 7F082484 0006C02B */ sltu $t8, $zero, $a2 -/* 0B4E78 7F082488 13000014 */ beqz $t8, .L7F0824DC -/* 0B4E7C 7F08248C 03003025 */ move $a2, $t8 -/* 0B4E80 7F082490 8E190000 */ lw $t9, ($s0) -/* 0B4E84 7F082494 3C0A8003 */ lui $t2, %hi(in_tank_flag) # $t2, 0x8003 -/* 0B4E88 7F082498 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4E8C 7F08249C 8F2B0124 */ lw $t3, 0x124($t9) -/* 0B4E90 7F0824A0 5560000C */ bnezl $t3, .L7F0824D4 -/* 0B4E94 7F0824A4 44814000 */ mtc1 $at, $f8 -/* 0B4E98 7F0824A8 8D4A1998 */ lw $t2, %lo(in_tank_flag)($t2) -/* 0B4E9C 7F0824AC 24010001 */ li $at, 1 -/* 0B4EA0 7F0824B0 240D0001 */ li $t5, 1 -/* 0B4EA4 7F0824B4 15410004 */ bne $t2, $at, .L7F0824C8 -/* 0B4EA8 7F0824B8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4EAC 7F0824BC 44813000 */ mtc1 $at, $f6 -/* 0B4EB0 7F0824C0 10000006 */ b .L7F0824DC -/* 0B4EB4 7F0824C4 E7A6017C */ swc1 $f6, 0x17c($sp) -.L7F0824C8: -/* 0B4EB8 7F0824C8 10000004 */ b .L7F0824DC -/* 0B4EBC 7F0824CC AFAD0194 */ sw $t5, 0x194($sp) -/* 0B4EC0 7F0824D0 44814000 */ mtc1 $at, $f8 -.L7F0824D4: -/* 0B4EC4 7F0824D4 00000000 */ nop -/* 0B4EC8 7F0824D8 E7A8018C */ swc1 $f8, 0x18c($sp) -.L7F0824DC: -/* 0B4ECC 7F0824DC 304C0101 */ andi $t4, $v0, 0x101 -/* 0B4ED0 7F0824E0 8E0E0000 */ lw $t6, ($s0) -/* 0B4ED4 7F0824E4 000C782B */ sltu $t7, $zero, $t4 -/* 0B4ED8 7F0824E8 AFAF0044 */ sw $t7, 0x44($sp) -/* 0B4EDC 7F0824EC 8C841998 */ lw $a0, %lo(in_tank_flag)($a0) -/* 0B4EE0 7F0824F0 11E0000F */ beqz $t7, .L7F082530 -/* 0B4EE4 7F0824F4 8DC30124 */ lw $v1, 0x124($t6) -/* 0B4EE8 7F0824F8 1460000A */ bnez $v1, .L7F082524 -/* 0B4EEC 7F0824FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4EF0 7F082500 24010001 */ li $at, 1 -/* 0B4EF4 7F082504 14810005 */ bne $a0, $at, .L7F08251C -/* 0B4EF8 7F082508 24180001 */ li $t8, 1 -/* 0B4EFC 7F08250C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4F00 7F082510 44815000 */ mtc1 $at, $f10 -/* 0B4F04 7F082514 10000006 */ b .L7F082530 -/* 0B4F08 7F082518 E7AA0178 */ swc1 $f10, 0x178($sp) -.L7F08251C: -/* 0B4F0C 7F08251C 10000004 */ b .L7F082530 -/* 0B4F10 7F082520 AFB80190 */ sw $t8, 0x190($sp) -.L7F082524: -/* 0B4F14 7F082524 44819000 */ mtc1 $at, $f18 -/* 0B4F18 7F082528 00000000 */ nop -/* 0B4F1C 7F08252C E7B20188 */ swc1 $f18, 0x188($sp) -.L7F082530: -/* 0B4F20 7F082530 2C620001 */ sltiu $v0, $v1, 1 -/* 0B4F24 7F082534 10400004 */ beqz $v0, .L7F082548 -/* 0B4F28 7F082538 00402825 */ move $a1, $v0 -/* 0B4F2C 7F08253C 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B4F30 7F082540 30B90808 */ andi $t9, $a1, 0x808 -/* 0B4F34 7F082544 0019282B */ sltu $a1, $zero, $t9 -.L7F082548: -/* 0B4F38 7F082548 AFA5019C */ sw $a1, 0x19c($sp) -/* 0B4F3C 7F08254C 10400004 */ beqz $v0, .L7F082560 -/* 0B4F40 7F082550 00402825 */ move $a1, $v0 -/* 0B4F44 7F082554 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B4F48 7F082558 30AA0404 */ andi $t2, $a1, 0x404 -/* 0B4F4C 7F08255C 000A282B */ sltu $a1, $zero, $t2 -.L7F082560: -/* 0B4F50 7F082560 AFA50198 */ sw $a1, 0x198($sp) -/* 0B4F54 7F082564 24010001 */ li $at, 1 -/* 0B4F58 7F082568 00402825 */ move $a1, $v0 -/* 0B4F5C 7F08256C 14810003 */ bne $a0, $at, .L7F08257C -/* 0B4F60 7F082570 AFA201A0 */ sw $v0, 0x1a0($sp) -/* 0B4F64 7F082574 10000034 */ b .L7F082648 -/* 0B4F68 7F082578 AFA201A8 */ sw $v0, 0x1a8($sp) -.L7F08257C: -/* 0B4F6C 7F08257C 10000032 */ b .L7F082648 -/* 0B4F70 7F082580 AFA501A4 */ sw $a1, 0x1a4($sp) -.L7F082584: -/* 0B4F74 7F082584 30CC0202 */ andi $t4, $a2, 0x202 -/* 0B4F78 7F082588 000C302B */ sltu $a2, $zero, $t4 -/* 0B4F7C 7F08258C 10C00004 */ beqz $a2, .L7F0825A0 -/* 0B4F80 7F082590 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4F84 7F082594 44812000 */ mtc1 $at, $f4 -/* 0B4F88 7F082598 00000000 */ nop -/* 0B4F8C 7F08259C E7A4018C */ swc1 $f4, 0x18c($sp) -.L7F0825A0: -/* 0B4F90 7F0825A0 8FA4005C */ lw $a0, 0x5c($sp) -/* 0B4F94 7F0825A4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4F98 7F0825A8 308F0101 */ andi $t7, $a0, 0x101 -/* 0B4F9C 7F0825AC 000F202B */ sltu $a0, $zero, $t7 -/* 0B4FA0 7F0825B0 50800005 */ beql $a0, $zero, .L7F0825C8 -/* 0B4FA4 7F0825B4 8E190000 */ lw $t9, ($s0) -/* 0B4FA8 7F0825B8 44813000 */ mtc1 $at, $f6 -/* 0B4FAC 7F0825BC 00000000 */ nop -/* 0B4FB0 7F0825C0 E7A60188 */ swc1 $f6, 0x188($sp) -/* 0B4FB4 7F0825C4 8E190000 */ lw $t9, ($s0) -.L7F0825C8: -/* 0B4FB8 7F0825C8 8F230124 */ lw $v1, 0x124($t9) -/* 0B4FBC 7F0825CC 2C620001 */ sltiu $v0, $v1, 1 -/* 0B4FC0 7F0825D0 10400002 */ beqz $v0, .L7F0825DC -/* 0B4FC4 7F0825D4 00402825 */ move $a1, $v0 -/* 0B4FC8 7F0825D8 00C02825 */ move $a1, $a2 -.L7F0825DC: -/* 0B4FCC 7F0825DC AFA50194 */ sw $a1, 0x194($sp) -/* 0B4FD0 7F0825E0 00402825 */ move $a1, $v0 -/* 0B4FD4 7F0825E4 10400003 */ beqz $v0, .L7F0825F4 -/* 0B4FD8 7F0825E8 AFA40044 */ sw $a0, 0x44($sp) -/* 0B4FDC 7F0825EC 00802825 */ move $a1, $a0 -/* 0B4FE0 7F0825F0 AFA40044 */ sw $a0, 0x44($sp) -.L7F0825F4: -/* 0B4FE4 7F0825F4 AFA50190 */ sw $a1, 0x190($sp) -/* 0B4FE8 7F0825F8 00402825 */ move $a1, $v0 -/* 0B4FEC 7F0825FC 14600009 */ bnez $v1, .L7F082624 -/* 0B4FF0 7F082600 AFA201AC */ sw $v0, 0x1ac($sp) -/* 0B4FF4 7F082604 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B4FF8 7F082608 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B4FFC 7F08260C 316A0808 */ andi $t2, $t3, 0x808 -/* 0B5000 7F082610 11400004 */ beqz $t2, .L7F082624 -/* 0B5004 7F082614 00000000 */ nop -/* 0B5008 7F082618 44814000 */ mtc1 $at, $f8 -/* 0B500C 7F08261C 00000000 */ nop -/* 0B5010 7F082620 E7A80184 */ swc1 $f8, 0x184($sp) -.L7F082624: -/* 0B5014 7F082624 14600007 */ bnez $v1, .L7F082644 -/* 0B5018 7F082628 8FAD005C */ lw $t5, 0x5c($sp) -/* 0B501C 7F08262C 31AC0404 */ andi $t4, $t5, 0x404 -/* 0B5020 7F082630 11800004 */ beqz $t4, .L7F082644 -/* 0B5024 7F082634 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5028 7F082638 44815000 */ mtc1 $at, $f10 -/* 0B502C 7F08263C 00000000 */ nop -/* 0B5030 7F082640 E7AA0180 */ swc1 $f10, 0x180($sp) -.L7F082644: -/* 0B5034 7F082644 AFA501A4 */ sw $a1, 0x1a4($sp) -.L7F082648: -/* 0B5038 7F082648 10600014 */ beqz $v1, .L7F08269C -/* 0B503C 7F08264C 00000000 */ nop -/* 0B5040 7F082650 83AE01C7 */ lb $t6, 0x1c7($sp) -/* 0B5044 7F082654 29C1003D */ slti $at, $t6, 0x3d -/* 0B5048 7F082658 14200010 */ bnez $at, .L7F08269C -/* 0B504C 7F08265C 25CFFFC4 */ addiu $t7, $t6, -0x3c -/* 0B5050 7F082660 448F9000 */ mtc1 $t7, $f18 -/* 0B5054 7F082664 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B5058 7F082668 44811000 */ mtc1 $at, $f2 -/* 0B505C 7F08266C 46809120 */ cvt.s.w $f4, $f18 -/* 0B5060 7F082670 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5064 7F082674 44813000 */ mtc1 $at, $f6 -/* 0B5068 7F082678 3C013F80 */ lui $at, 0x3f80 -/* 0B506C 7F08267C 46022003 */ div.s $f0, $f4, $f2 -/* 0B5070 7F082680 4600303C */ c.lt.s $f6, $f0 -/* 0B5074 7F082684 E7A00184 */ swc1 $f0, 0x184($sp) -/* 0B5078 7F082688 4502001A */ bc1fl .L7F0826F4 -/* 0B507C 7F08268C 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B5080 7F082690 44814000 */ mtc1 $at, $f8 -/* 0B5084 7F082694 10000016 */ b .L7F0826F0 -/* 0B5088 7F082698 E7A80184 */ swc1 $f8, 0x184($sp) -.L7F08269C: -/* 0B508C 7F08269C 10600014 */ beqz $v1, .L7F0826F0 -/* 0B5090 7F0826A0 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B5094 7F0826A4 2B01FFC4 */ slti $at, $t8, -0x3c -/* 0B5098 7F0826A8 10200011 */ beqz $at, .L7F0826F0 -/* 0B509C 7F0826AC 2419FFC4 */ li $t9, -60 -/* 0B50A0 7F0826B0 03385823 */ subu $t3, $t9, $t8 -/* 0B50A4 7F0826B4 448B5000 */ mtc1 $t3, $f10 -/* 0B50A8 7F0826B8 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B50AC 7F0826BC 44811000 */ mtc1 $at, $f2 -/* 0B50B0 7F0826C0 468054A0 */ cvt.s.w $f18, $f10 -/* 0B50B4 7F0826C4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B50B8 7F0826C8 44812000 */ mtc1 $at, $f4 -/* 0B50BC 7F0826CC 3C013F80 */ lui $at, 0x3f80 -/* 0B50C0 7F0826D0 46029003 */ div.s $f0, $f18, $f2 -/* 0B50C4 7F0826D4 4600203C */ c.lt.s $f4, $f0 -/* 0B50C8 7F0826D8 E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B50CC 7F0826DC 45020005 */ bc1fl .L7F0826F4 -/* 0B50D0 7F0826E0 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B50D4 7F0826E4 44813000 */ mtc1 $at, $f6 -/* 0B50D8 7F0826E8 00000000 */ nop -/* 0B50DC 7F0826EC E7A60180 */ swc1 $f6, 0x180($sp) -.L7F0826F0: -/* 0B50E0 7F0826F0 3C014120 */ li $at, 0x41200000 # 10.000000 -.L7F0826F4: -/* 0B50E4 7F0826F4 44811000 */ mtc1 $at, $f2 -/* 0B50E8 7F0826F8 10600013 */ beqz $v1, .L7F082748 -/* 0B50EC 7F0826FC 00000000 */ nop -/* 0B50F0 7F082700 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B50F4 7F082704 240AFFC4 */ li $t2, -60 -/* 0B50F8 7F082708 2841FFC4 */ slti $at, $v0, -0x3c -/* 0B50FC 7F08270C 1020000E */ beqz $at, .L7F082748 -/* 0B5100 7F082710 01426823 */ subu $t5, $t2, $v0 -/* 0B5104 7F082714 448D4000 */ mtc1 $t5, $f8 -/* 0B5108 7F082718 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B510C 7F08271C 44819000 */ mtc1 $at, $f18 -/* 0B5110 7F082720 468042A0 */ cvt.s.w $f10, $f8 -/* 0B5114 7F082724 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5118 7F082728 46025003 */ div.s $f0, $f10, $f2 -/* 0B511C 7F08272C 4600903C */ c.lt.s $f18, $f0 -/* 0B5120 7F082730 E7A0017C */ swc1 $f0, 0x17c($sp) -/* 0B5124 7F082734 45000004 */ bc1f .L7F082748 -/* 0B5128 7F082738 00000000 */ nop -/* 0B512C 7F08273C 44812000 */ mtc1 $at, $f4 -/* 0B5130 7F082740 00000000 */ nop -/* 0B5134 7F082744 E7A4017C */ swc1 $f4, 0x17c($sp) -.L7F082748: -/* 0B5138 7F082748 10600011 */ beqz $v1, .L7F082790 -/* 0B513C 7F08274C 83A201C3 */ lb $v0, 0x1c3($sp) -/* 0B5140 7F082750 2841003D */ slti $at, $v0, 0x3d -/* 0B5144 7F082754 1420000E */ bnez $at, .L7F082790 -/* 0B5148 7F082758 244CFFC4 */ addiu $t4, $v0, -0x3c -/* 0B514C 7F08275C 448C3000 */ mtc1 $t4, $f6 -/* 0B5150 7F082760 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5154 7F082764 44815000 */ mtc1 $at, $f10 -/* 0B5158 7F082768 46803220 */ cvt.s.w $f8, $f6 -/* 0B515C 7F08276C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5160 7F082770 46024003 */ div.s $f0, $f8, $f2 -/* 0B5164 7F082774 4600503C */ c.lt.s $f10, $f0 -/* 0B5168 7F082778 E7A00178 */ swc1 $f0, 0x178($sp) -/* 0B516C 7F08277C 45020005 */ bc1fl .L7F082794 -/* 0B5170 7F082780 97A200FA */ lhu $v0, 0xfa($sp) -/* 0B5174 7F082784 44819000 */ mtc1 $at, $f18 -/* 0B5178 7F082788 00000000 */ nop -/* 0B517C 7F08278C E7B20178 */ swc1 $f18, 0x178($sp) -.L7F082790: -/* 0B5180 7F082790 97A200FA */ lhu $v0, 0xfa($sp) -.L7F082794: -/* 0B5184 7F082794 8FAE005C */ lw $t6, 0x5c($sp) -/* 0B5188 7F082798 01C22024 */ and $a0, $t6, $v0 -/* 0B518C 7F08279C 0004282B */ sltu $a1, $zero, $a0 -/* 0B5190 7F0827A0 10A00006 */ beqz $a1, .L7F0827BC -/* 0B5194 7F0827A4 AFA5004C */ sw $a1, 0x4c($sp) -/* 0B5198 7F0827A8 8FB90060 */ lw $t9, 0x60($sp) -/* 0B519C 7F0827AC 97B800FE */ lhu $t8, 0xfe($sp) -/* 0B51A0 7F0827B0 03382824 */ and $a1, $t9, $t8 -/* 0B51A4 7F0827B4 0005582B */ sltu $t3, $zero, $a1 -/* 0B51A8 7F0827B8 01602825 */ move $a1, $t3 -.L7F0827BC: -/* 0B51AC 7F0827BC 8FAA0060 */ lw $t2, 0x60($sp) -/* 0B51B0 7F0827C0 AFA50174 */ sw $a1, 0x174($sp) -/* 0B51B4 7F0827C4 01422024 */ and $a0, $t2, $v0 -/* 0B51B8 7F0827C8 0004282B */ sltu $a1, $zero, $a0 -/* 0B51BC 7F0827CC 10A00006 */ beqz $a1, .L7F0827E8 -/* 0B51C0 7F0827D0 AFA50040 */ sw $a1, 0x40($sp) -/* 0B51C4 7F0827D4 8FAC005C */ lw $t4, 0x5c($sp) -/* 0B51C8 7F0827D8 97AE00FE */ lhu $t6, 0xfe($sp) -/* 0B51CC 7F0827DC 018E2824 */ and $a1, $t4, $t6 -/* 0B51D0 7F0827E0 2CAF0001 */ sltiu $t7, $a1, 1 -/* 0B51D4 7F0827E4 01E02825 */ move $a1, $t7 -.L7F0827E8: -/* 0B51D8 7F0827E8 AFA50170 */ sw $a1, 0x170($sp) -/* 0B51DC 7F0827EC AFA3016C */ sw $v1, 0x16c($sp) -/* 0B51E0 7F0827F0 AFA30168 */ sw $v1, 0x168($sp) -/* 0B51E4 7F0827F4 00002025 */ move $a0, $zero -/* 0B51E8 7F0827F8 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B51EC 7F0827FC AFA60050 */ sw $a2, 0x50($sp) -/* 0B51F0 7F082800 00402025 */ move $a0, $v0 -/* 0B51F4 7F082804 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B51F8 7F082808 34058000 */ li $a1, 32768 -/* 0B51FC 7F08280C 10400013 */ beqz $v0, .L7F08285C -/* 0B5200 7F082810 8FA60050 */ lw $a2, 0x50($sp) -/* 0B5204 7F082814 8E190000 */ lw $t9, ($s0) -/* 0B5208 7F082818 8FAB005C */ lw $t3, 0x5c($sp) -/* 0B520C 7F08281C 8F380124 */ lw $t8, 0x124($t9) -/* 0B5210 7F082820 31620808 */ andi $v0, $t3, 0x808 -/* 0B5214 7F082824 0002502B */ sltu $t2, $zero, $v0 -/* 0B5218 7F082828 1300000C */ beqz $t8, .L7F08285C -/* 0B521C 7F08282C 316D0404 */ andi $t5, $t3, 0x404 -/* 0B5220 7F082830 11A00005 */ beqz $t5, .L7F082848 -/* 0B5224 7F082834 01401025 */ move $v0, $t2 -/* 0B5228 7F082838 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B522C 7F08283C 44812000 */ mtc1 $at, $f4 -/* 0B5230 7F082840 00000000 */ nop -/* 0B5234 7F082844 E7A40164 */ swc1 $f4, 0x164($sp) -.L7F082848: -/* 0B5238 7F082848 10400004 */ beqz $v0, .L7F08285C -/* 0B523C 7F08284C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5240 7F082850 44813000 */ mtc1 $at, $f6 -/* 0B5244 7F082854 00000000 */ nop -/* 0B5248 7F082858 E7A60160 */ swc1 $f6, 0x160($sp) -.L7F08285C: -/* 0B524C 7F08285C 00002025 */ move $a0, $zero -/* 0B5250 7F082860 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B5254 7F082864 AFA60050 */ sw $a2, 0x50($sp) -/* 0B5258 7F082868 00402025 */ move $a0, $v0 -/* 0B525C 7F08286C 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B5260 7F082870 34058000 */ li $a1, 32768 -/* 0B5264 7F082874 2C450001 */ sltiu $a1, $v0, 1 -/* 0B5268 7F082878 10A00009 */ beqz $a1, .L7F0828A0 -/* 0B526C 7F08287C 8FA60050 */ lw $a2, 0x50($sp) -/* 0B5270 7F082880 8E0C0000 */ lw $t4, ($s0) -/* 0B5274 7F082884 8D850124 */ lw $a1, 0x124($t4) -/* 0B5278 7F082888 0005702B */ sltu $t6, $zero, $a1 -/* 0B527C 7F08288C 11C00004 */ beqz $t6, .L7F0828A0 -/* 0B5280 7F082890 01C02825 */ move $a1, $t6 -/* 0B5284 7F082894 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B5288 7F082898 30AF0404 */ andi $t7, $a1, 0x404 -/* 0B528C 7F08289C 000F282B */ sltu $a1, $zero, $t7 -.L7F0828A0: -/* 0B5290 7F0828A0 AFA5015C */ sw $a1, 0x15c($sp) -/* 0B5294 7F0828A4 00002025 */ move $a0, $zero -/* 0B5298 7F0828A8 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B529C 7F0828AC AFA60050 */ sw $a2, 0x50($sp) -/* 0B52A0 7F0828B0 00402025 */ move $a0, $v0 -/* 0B52A4 7F0828B4 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B52A8 7F0828B8 34058000 */ li $a1, 32768 -/* 0B52AC 7F0828BC 2C450001 */ sltiu $a1, $v0, 1 -/* 0B52B0 7F0828C0 10A0000A */ beqz $a1, .L7F0828EC -/* 0B52B4 7F0828C4 8FA60050 */ lw $a2, 0x50($sp) -/* 0B52B8 7F0828C8 8E180000 */ lw $t8, ($s0) -/* 0B52BC 7F0828CC 8F050124 */ lw $a1, 0x124($t8) -/* 0B52C0 7F0828D0 0005502B */ sltu $t2, $zero, $a1 -/* 0B52C4 7F0828D4 11400005 */ beqz $t2, .L7F0828EC -/* 0B52C8 7F0828D8 01402825 */ move $a1, $t2 -/* 0B52CC 7F0828DC 8FA5005C */ lw $a1, 0x5c($sp) -/* 0B52D0 7F0828E0 00A02827 */ not $a1, $a1 -/* 0B52D4 7F0828E4 30AB0808 */ andi $t3, $a1, 0x808 -/* 0B52D8 7F0828E8 000B282B */ sltu $a1, $zero, $t3 -.L7F0828EC: -/* 0B52DC 7F0828EC 8E0C0000 */ lw $t4, ($s0) -/* 0B52E0 7F0828F0 AFA50158 */ sw $a1, 0x158($sp) -/* 0B52E4 7F0828F4 8D820124 */ lw $v0, 0x124($t4) -/* 0B52E8 7F0828F8 0002282B */ sltu $a1, $zero, $v0 -/* 0B52EC 7F0828FC 10A00002 */ beqz $a1, .L7F082908 -/* 0B52F0 7F082900 00A01025 */ move $v0, $a1 -/* 0B52F4 7F082904 00C02825 */ move $a1, $a2 -.L7F082908: -/* 0B52F8 7F082908 AFA50154 */ sw $a1, 0x154($sp) -/* 0B52FC 7F08290C 10400002 */ beqz $v0, .L7F082918 -/* 0B5300 7F082910 00402825 */ move $a1, $v0 -/* 0B5304 7F082914 8FA50044 */ lw $a1, 0x44($sp) -.L7F082918: -/* 0B5308 7F082918 8FAF004C */ lw $t7, 0x4c($sp) -/* 0B530C 7F08291C AFA50150 */ sw $a1, 0x150($sp) -/* 0B5310 7F082920 8FB90048 */ lw $t9, 0x48($sp) -/* 0B5314 7F082924 11E00002 */ beqz $t7, .L7F082930 -/* 0B5318 7F082928 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B531C 7F08292C 17200005 */ bnez $t9, .L7F082944 -.L7F082930: -/* 0B5320 7F082930 330A4000 */ andi $t2, $t8, 0x4000 -/* 0B5324 7F082934 1140000C */ beqz $t2, .L7F082968 -/* 0B5328 7F082938 8FAB0040 */ lw $t3, 0x40($sp) -/* 0B532C 7F08293C 1160000A */ beqz $t3, .L7F082968 -/* 0B5330 7F082940 00000000 */ nop -.L7F082944: -/* 0B5334 7F082944 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B5338 7F082948 00002025 */ move $a0, $zero -/* 0B533C 7F08294C 2401001D */ li $at, 29 -/* 0B5340 7F082950 14410005 */ bne $v0, $at, .L7F082968 -/* 0B5344 7F082954 240D0001 */ li $t5, 1 -/* 0B5348 7F082958 AFAD014C */ sw $t5, 0x14c($sp) -/* 0B534C 7F08295C AFA00174 */ sw $zero, 0x174($sp) -/* 0B5350 7F082960 AFA00170 */ sw $zero, 0x170($sp) -/* 0B5354 7F082964 AFA001B0 */ sw $zero, 0x1b0($sp) -.L7F082968: -/* 0B5358 7F082968 3C0C8003 */ lui $t4, %hi(in_tank_flag) # $t4, 0x8003 -/* 0B535C 7F08296C 8D8C1998 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B5360 7F082970 24010001 */ li $at, 1 -/* 0B5364 7F082974 55810024 */ bnel $t4, $at, .L7F082A08 -/* 0B5368 7F082978 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B536C 7F08297C 8E0E0000 */ lw $t6, ($s0) -/* 0B5370 7F082980 8DCF0124 */ lw $t7, 0x124($t6) -/* 0B5374 7F082984 51E00020 */ beql $t7, $zero, .L7F082A08 -/* 0B5378 7F082988 8FB8005C */ lw $t8, 0x5c($sp) -/* 0B537C 7F08298C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B5380 7F082990 00002025 */ move $a0, $zero -/* 0B5384 7F082994 24010020 */ li $at, 32 -/* 0B5388 7F082998 14410005 */ bne $v0, $at, .L7F0829B0 -/* 0B538C 7F08299C C7A8018C */ lwc1 $f8, 0x18c($sp) -/* 0B5390 7F0829A0 24190001 */ li $t9, 1 -/* 0B5394 7F0829A4 AFA00134 */ sw $zero, 0x134($sp) -/* 0B5398 7F0829A8 10000014 */ b .L7F0829FC -/* 0B539C 7F0829AC AFB901A8 */ sw $t9, 0x1a8($sp) -.L7F0829B0: -/* 0B53A0 7F0829B0 46144032 */ c.eq.s $f8, $f20 -/* 0B53A4 7F0829B4 C7AA0188 */ lwc1 $f10, 0x188($sp) -/* 0B53A8 7F0829B8 45020011 */ bc1fl .L7F082A00 -/* 0B53AC 7F0829BC E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B53B0 7F0829C0 46145032 */ c.eq.s $f10, $f20 -/* 0B53B4 7F0829C4 C7B2017C */ lwc1 $f18, 0x17c($sp) -/* 0B53B8 7F0829C8 4502000D */ bc1fl .L7F082A00 -/* 0B53BC 7F0829CC E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B53C0 7F0829D0 4612A03C */ c.lt.s $f20, $f18 -/* 0B53C4 7F0829D4 00000000 */ nop -/* 0B53C8 7F0829D8 45020003 */ bc1fl .L7F0829E8 -/* 0B53CC 7F0829DC C7A40178 */ lwc1 $f4, 0x178($sp) -/* 0B53D0 7F0829E0 E7B2018C */ swc1 $f18, 0x18c($sp) -/* 0B53D4 7F0829E4 C7A40178 */ lwc1 $f4, 0x178($sp) -.L7F0829E8: -/* 0B53D8 7F0829E8 4604A03C */ c.lt.s $f20, $f4 -/* 0B53DC 7F0829EC 00000000 */ nop -/* 0B53E0 7F0829F0 45020003 */ bc1fl .L7F082A00 -/* 0B53E4 7F0829F4 E7B4017C */ swc1 $f20, 0x17c($sp) -/* 0B53E8 7F0829F8 E7A40188 */ swc1 $f4, 0x188($sp) -.L7F0829FC: -/* 0B53EC 7F0829FC E7B4017C */ swc1 $f20, 0x17c($sp) -.L7F082A00: -/* 0B53F0 7F082A00 E7B40178 */ swc1 $f20, 0x178($sp) -.L7F082A04: -/* 0B53F4 7F082A04 8FB8005C */ lw $t8, 0x5c($sp) -.L7F082A08: -/* 0B53F8 7F082A08 97AA00FE */ lhu $t2, 0xfe($sp) -/* 0B53FC 7F082A0C 030A1024 */ and $v0, $t8, $t2 -/* 0B5400 7F082A10 0002282B */ sltu $a1, $zero, $v0 -/* 0B5404 7F082A14 10A0000A */ beqz $a1, .L7F082A40 -/* 0B5408 7F082A18 00000000 */ nop -/* 0B540C 7F082A1C 8E0D0000 */ lw $t5, ($s0) -/* 0B5410 7F082A20 97AE00FA */ lhu $t6, 0xfa($sp) -/* 0B5414 7F082A24 8DA501C8 */ lw $a1, 0x1c8($t5) -/* 0B5418 7F082A28 2CAC0001 */ sltiu $t4, $a1, 1 -/* 0B541C 7F082A2C 11800004 */ beqz $t4, .L7F082A40 -/* 0B5420 7F082A30 01802825 */ move $a1, $t4 -/* 0B5424 7F082A34 030E2824 */ and $a1, $t8, $t6 -/* 0B5428 7F082A38 2CAF0001 */ sltiu $t7, $a1, 1 -/* 0B542C 7F082A3C 01E02825 */ move $a1, $t7 -.L7F082A40: -/* 0B5430 7F082A40 0FC29038 */ jal cur_player_get_control_type -/* 0B5434 7F082A44 AFA501B4 */ sw $a1, 0x1b4($sp) -/* 0B5438 7F082A48 24010001 */ li $at, 1 -/* 0B543C 7F082A4C 50410006 */ beql $v0, $at, .L7F082A68 -/* 0B5440 7F082A50 24190001 */ li $t9, 1 -/* 0B5444 7F082A54 0FC29038 */ jal cur_player_get_control_type -/* 0B5448 7F082A58 00000000 */ nop -/* 0B544C 7F082A5C 24010003 */ li $at, 3 -/* 0B5450 7F082A60 14410002 */ bne $v0, $at, .L7F082A6C -/* 0B5454 7F082A64 24190001 */ li $t9, 1 -.L7F082A68: -/* 0B5458 7F082A68 AFB90140 */ sw $t9, 0x140($sp) -.L7F082A6C: -/* 0B545C 7F082A6C 8E0A0000 */ lw $t2, ($s0) -.L7F082A70: -/* 0B5460 7F082A70 AD4000D0 */ sw $zero, 0xd0($t2) -/* 0B5464 7F082A74 8FAB01B0 */ lw $t3, 0x1b0($sp) -/* 0B5468 7F082A78 11600095 */ beqz $t3, .L7F082CD0 -/* 0B546C 7F082A7C 3C0D8003 */ lui $t5, %hi(in_tank_flag) # $t5, 0x8003 -/* 0B5470 7F082A80 8DAD1998 */ lw $t5, %lo(in_tank_flag)($t5) -/* 0B5474 7F082A84 24010001 */ li $at, 1 -/* 0B5478 7F082A88 3C0C8003 */ lui $t4, %hi(ptr_playerstank) # $t4, 0x8003 -/* 0B547C 7F082A8C 15A1002E */ bne $t5, $at, .L7F082B48 -/* 0B5480 7F082A90 3C028003 */ lui $v0, 0x8003 # $v0, 0x8003 -/* 0B5484 7F082A94 8D8C19A0 */ lw $t4, %lo(ptr_playerstank)($t4) -/* 0B5488 7F082A98 24040020 */ li $a0, 32 -/* 0B548C 7F082A9C 8D980004 */ lw $t8, 4($t4) -/* 0B5490 7F082AA0 0FC1A6F9 */ jal get_ammo_count_for_weapon -/* 0B5494 7F082AA4 AFB800F4 */ sw $t8, 0xf4($sp) -/* 0B5498 7F082AA8 8FAE00F4 */ lw $t6, 0xf4($sp) -/* 0B549C 7F082AAC 24040020 */ li $a0, 32 -/* 0B54A0 7F082AB0 00002825 */ move $a1, $zero -/* 0B54A4 7F082AB4 0FC1A706 */ jal add_ammo_to_weapon -/* 0B54A8 7F082AB8 ADC200D8 */ sw $v0, 0xd8($t6) -/* 0B54AC 7F082ABC 0FC23265 */ jal bondinvRemoveItemByID -/* 0B54B0 7F082AC0 24040020 */ li $a0, 32 -/* 0B54B4 7F082AC4 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B54B8 7F082AC8 00002025 */ move $a0, $zero -/* 0B54BC 7F082ACC 24010020 */ li $at, 32 -/* 0B54C0 7F082AD0 54410009 */ bnel $v0, $at, .L7F082AF8 -/* 0B54C4 7F082AD4 8FAA00F4 */ lw $t2, 0xf4($sp) -/* 0B54C8 7F082AD8 0FC1A6B6 */ jal get_ammo_in_hands_magazine -/* 0B54CC 7F082ADC 00002025 */ move $a0, $zero -/* 0B54D0 7F082AE0 8FA300F4 */ lw $v1, 0xf4($sp) -/* 0B54D4 7F082AE4 8C6F00D8 */ lw $t7, 0xd8($v1) -/* 0B54D8 7F082AE8 01E2C821 */ addu $t9, $t7, $v0 -/* 0B54DC 7F082AEC 0FC1772E */ jal autoadvance_on_deplete_all_ammo -/* 0B54E0 7F082AF0 AC7900D8 */ sw $t9, 0xd8($v1) -/* 0B54E4 7F082AF4 8FAA00F4 */ lw $t2, 0xf4($sp) -.L7F082AF8: -/* 0B54E8 7F082AF8 3C018003 */ lui $at, %hi(in_tank_flag) # $at, 0x8003 -/* 0B54EC 7F082AFC 00001025 */ move $v0, $zero -/* 0B54F0 7F082B00 AD4000C4 */ sw $zero, 0xc4($t2) -/* 0B54F4 7F082B04 AC201998 */ sw $zero, %lo(in_tank_flag)($at) -/* 0B54F8 7F082B08 8E0B0000 */ lw $t3, ($s0) -/* 0B54FC 7F082B0C 2403000C */ li $v1, 12 -/* 0B5500 7F082B10 E574016C */ swc1 $f20, 0x16c($t3) -/* 0B5504 7F082B14 8E0D0000 */ lw $t5, ($s0) -/* 0B5508 7F082B18 E5B40174 */ swc1 $f20, 0x174($t5) -/* 0B550C 7F082B1C 8E0C0000 */ lw $t4, ($s0) -/* 0B5510 7F082B20 E594014C */ swc1 $f20, 0x14c($t4) -.L7F082B24: -/* 0B5514 7F082B24 8E180000 */ lw $t8, ($s0) -/* 0B5518 7F082B28 03027021 */ addu $t6, $t8, $v0 -/* 0B551C 7F082B2C 24420004 */ addiu $v0, $v0, 4 -/* 0B5520 7F082B30 1443FFFC */ bne $v0, $v1, .L7F082B24 -/* 0B5524 7F082B34 E5D40180 */ swc1 $f20, 0x180($t6) -/* 0B5528 7F082B38 8E190000 */ lw $t9, ($s0) -/* 0B552C 7F082B3C 240F0002 */ li $t7, 2 -/* 0B5530 7F082B40 10000063 */ b .L7F082CD0 -/* 0B5534 7F082B44 AF2F009C */ sw $t7, 0x9c($t9) -.L7F082B48: -/* 0B5538 7F082B48 8C4219A0 */ lw $v0, %lo(ptr_playerstank)($v0) -/* 0B553C 7F082B4C 5040005E */ beql $v0, $zero, .L7F082CC8 -/* 0B5540 7F082B50 8E0D0000 */ lw $t5, ($s0) -/* 0B5544 7F082B54 904A0000 */ lbu $t2, ($v0) -/* 0B5548 7F082B58 24010001 */ li $at, 1 -/* 0B554C 7F082B5C 5541005A */ bnel $t2, $at, .L7F082CC8 -/* 0B5550 7F082B60 8E0D0000 */ lw $t5, ($s0) -/* 0B5554 7F082B64 8C450004 */ lw $a1, 4($v0) -/* 0B5558 7F082B68 2401002D */ li $at, 45 -/* 0B555C 7F082B6C 3C0D8003 */ lui $t5, %hi(g_BondCanEnterTank) -/* 0B5560 7F082B70 90AB0003 */ lbu $t3, 3($a1) -/* 0B5564 7F082B74 55610054 */ bnel $t3, $at, .L7F082CC8 -/* 0B5568 7F082B78 8E0D0000 */ lw $t5, ($s0) -/* 0B556C 7F082B7C 8DAD19D0 */ lw $t5, %lo(g_BondCanEnterTank)($t5) -/* 0B5570 7F082B80 24040020 */ li $a0, 32 -/* 0B5574 7F082B84 51A00050 */ beql $t5, $zero, .L7F082CC8 -/* 0B5578 7F082B88 8E0D0000 */ lw $t5, ($s0) -/* 0B557C 7F082B8C 0FC231FA */ jal bondinvAddInvItem -/* 0B5580 7F082B90 AFA500EC */ sw $a1, 0xec($sp) -/* 0B5584 7F082B94 8FA300EC */ lw $v1, 0xec($sp) -/* 0B5588 7F082B98 24040020 */ li $a0, 32 -/* 0B558C 7F082B9C 0FC1A706 */ jal add_ammo_to_weapon -/* 0B5590 7F082BA0 8C6500D8 */ lw $a1, 0xd8($v1) -/* 0B5594 7F082BA4 8FA300EC */ lw $v1, 0xec($sp) -/* 0B5598 7F082BA8 3C048003 */ lui $a0, %hi(g_TankTurretVerticalAngle) # $a0, 0x8003 -/* 0B559C 7F082BAC 248419BC */ addiu $a0, %lo(g_TankTurretVerticalAngle) # addiu $a0, $a0, 0x19bc -/* 0B55A0 7F082BB0 C46600C8 */ lwc1 $f6, 0xc8($v1) -/* 0B55A4 7F082BB4 AC6000D8 */ sw $zero, 0xd8($v1) -/* 0B55A8 7F082BB8 3C018005 */ lui $at, %hi(D_80055120) # $at, 0x8005 -/* 0B55AC 7F082BBC E4860000 */ swc1 $f6, ($a0) -/* 0B55B0 7F082BC0 C42AACF0 */ lwc1 $f10, %lo(D_80055120)($at) -/* 0B55B4 7F082BC4 C4880000 */ lwc1 $f8, ($a0) -/* 0B55B8 7F082BC8 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngleRelated) # $at, 0x8003 -/* 0B55BC 7F082BCC 3C058003 */ lui $a1, %hi(g_TankTurretOrientationAngleRad) # $a1, 0x8003 -/* 0B55C0 7F082BD0 460A4483 */ div.s $f18, $f8, $f10 -/* 0B55C4 7F082BD4 24A519C4 */ addiu $a1, %lo(g_TankTurretOrientationAngleRad) # addiu $a1, $a1, 0x19c4 -/* 0B55C8 7F082BD8 240C0001 */ li $t4, 1 -/* 0B55CC 7F082BDC 24190001 */ li $t9, 1 -/* 0B55D0 7F082BE0 3C028007 */ lui $v0, %hi(g_EnterTankCoord) # $v0, 0x8007 -/* 0B55D4 7F082BE4 244284B0 */ addiu $v0, %lo(g_EnterTankCoord) # addiu $v0, $v0, -0x7b50 -/* 0B55D8 7F082BE8 E43219C0 */ swc1 $f18, %lo(g_TankTurretVerticalAngleRelated)($at) -/* 0B55DC 7F082BEC C46400CC */ lwc1 $f4, 0xcc($v1) -/* 0B55E0 7F082BF0 3C018003 */ lui $at, %hi(g_TankTurretAngle) # $at, 0x8003 -/* 0B55E4 7F082BF4 E42419D4 */ swc1 $f4, %lo(g_TankTurretAngle)($at) -/* 0B55E8 7F082BF8 C46600CC */ lwc1 $f6, 0xcc($v1) -/* 0B55EC 7F082BFC 3C018005 */ lui $at, %hi(D_80055124) # $at, 0x8005 -/* 0B55F0 7F082C00 E4A60000 */ swc1 $f6, ($a1) -/* 0B55F4 7F082C04 C42AACF4 */ lwc1 $f10, %lo(D_80055124)($at) -/* 0B55F8 7F082C08 C4A80000 */ lwc1 $f8, ($a1) -/* 0B55FC 7F082C0C 3C018003 */ lui $at, %hi(D_80036478) # $at, 0x8003 -/* 0B5600 7F082C10 460A4483 */ div.s $f18, $f8, $f10 -/* 0B5604 7F082C14 E43219C8 */ swc1 $f18, %lo(D_80036478)($at) -/* 0B5608 7F082C18 3C018003 */ lui $at, %hi(D_8003647C) # $at, 0x8003 -/* 0B560C 7F082C1C E43419CC */ swc1 $f20, %lo(D_8003647C)($at) -/* 0B5610 7F082C20 C46400DC */ lwc1 $f4, 0xdc($v1) -/* 0B5614 7F082C24 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B5618 7F082C28 E42419B4 */ swc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B561C 7F082C2C 3C018003 */ lui $at, %hi(g_TankTurnSpeed) # $at, 0x8003 -/* 0B5620 7F082C30 E43419B0 */ swc1 $f20, %lo(g_TankTurnSpeed)($at) -/* 0B5624 7F082C34 3C018003 */ lui $at, %hi(in_tank_flag) # $at, 0x8003 -/* 0B5628 7F082C38 AC2C1998 */ sw $t4, %lo(in_tank_flag)($at) -/* 0B562C 7F082C3C 3C018007 */ lui $at, %hi(g_EnterTankAudioState) # $at, 0x8007 -/* 0B5630 7F082C40 AC208498 */ sw $zero, %lo(g_EnterTankAudioState)($at) -/* 0B5634 7F082C44 8E180000 */ lw $t8, ($s0) -/* 0B5638 7F082C48 3C018007 */ lui $at, %hi(g_TankEnteringSitHeight) # $at, 0x8007 -/* 0B563C 7F082C4C E714016C */ swc1 $f20, 0x16c($t8) -/* 0B5640 7F082C50 8E0E0000 */ lw $t6, ($s0) -/* 0B5644 7F082C54 E5D40174 */ swc1 $f20, 0x174($t6) -/* 0B5648 7F082C58 8E0F0000 */ lw $t7, ($s0) -/* 0B564C 7F082C5C E5F4014C */ swc1 $f20, 0x14c($t7) -/* 0B5650 7F082C60 8E0A0000 */ lw $t2, ($s0) -/* 0B5654 7F082C64 AD59009C */ sw $t9, 0x9c($t2) -/* 0B5658 7F082C68 E434849C */ swc1 $f20, %lo(g_TankEnteringSitHeight)($at) -/* 0B565C 7F082C6C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5660 7F082C70 44813000 */ mtc1 $at, $f6 -/* 0B5664 7F082C74 3C018007 */ lui $at, %hi(g_TankEnteringSitHeightRemain) # $at, 0x8007 -/* 0B5668 7F082C78 E42684A0 */ swc1 $f6, %lo(g_TankEnteringSitHeightRemain)($at) -/* 0B566C 7F082C7C 8E080000 */ lw $t0, ($s0) -/* 0B5670 7F082C80 3C018007 */ lui $at, %hi(g_TankEnterBondHorizAngleDeg) # $at, 0x8007 -/* 0B5674 7F082C84 C5080148 */ lwc1 $f8, 0x148($t0) -/* 0B5678 7F082C88 E42884A4 */ swc1 $f8, %lo(g_TankEnterBondHorizAngleDeg)($at) -/* 0B567C 7F082C8C C50A0158 */ lwc1 $f10, 0x158($t0) -/* 0B5680 7F082C90 3C018007 */ lui $at, %hi(g_TankEnterBondVertAngleDeg) # $at, 0x8007 -/* 0B5684 7F082C94 E42A84A8 */ swc1 $f10, %lo(g_TankEnterBondVertAngleDeg)($at) -/* 0B5688 7F082C98 C512048C */ lwc1 $f18, 0x48c($t0) -/* 0B568C 7F082C9C 3C018003 */ lui $at, %hi(D_80036490) # $at, 0x8003 -/* 0B5690 7F082CA0 E4520000 */ swc1 $f18, ($v0) -/* 0B5694 7F082CA4 C5040490 */ lwc1 $f4, 0x490($t0) -/* 0B5698 7F082CA8 E4440004 */ swc1 $f4, 4($v0) -/* 0B569C 7F082CAC C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B56A0 7F082CB0 E4460008 */ swc1 $f6, 8($v0) -/* 0B56A4 7F082CB4 0FC1F222 */ jal sub_GAME_7F07C7B4 -/* 0B56A8 7F082CB8 AC2019E0 */ sw $zero, %lo(D_80036490)($at) -/* 0B56AC 7F082CBC 10000005 */ b .L7F082CD4 -/* 0B56B0 7F082CC0 8FAC0144 */ lw $t4, 0x144($sp) -/* 0B56B4 7F082CC4 8E0D0000 */ lw $t5, ($s0) -.L7F082CC8: -/* 0B56B8 7F082CC8 240B0001 */ li $t3, 1 -/* 0B56BC 7F082CCC ADAB00D0 */ sw $t3, 0xd0($t5) -.L7F082CD0: -/* 0B56C0 7F082CD0 8FAC0144 */ lw $t4, 0x144($sp) -.L7F082CD4: -/* 0B56C4 7F082CD4 1580000B */ bnez $t4, .L7F082D04 -/* 0B56C8 7F082CD8 00000000 */ nop -/* 0B56CC 7F082CDC 83B801C7 */ lb $t8, 0x1c7($sp) -/* 0B56D0 7F082CE0 8FAF0128 */ lw $t7, 0x128($sp) -/* 0B56D4 7F082CE4 C7A00184 */ lwc1 $f0, 0x184($sp) -/* 0B56D8 7F082CE8 C7A80180 */ lwc1 $f8, 0x180($sp) -/* 0B56DC 7F082CEC 00187023 */ negu $t6, $t8 -/* 0B56E0 7F082CF0 000FC823 */ negu $t9, $t7 -/* 0B56E4 7F082CF4 AFAE0130 */ sw $t6, 0x130($sp) -/* 0B56E8 7F082CF8 AFB90128 */ sw $t9, 0x128($sp) -/* 0B56EC 7F082CFC E7A00180 */ swc1 $f0, 0x180($sp) -/* 0B56F0 7F082D00 E7A80184 */ swc1 $f8, 0x184($sp) -.L7F082D04: -/* 0B56F4 7F082D04 0FC22810 */ jal bondviewGetIfCurrentPlayerDamageShowTime -/* 0B56F8 7F082D08 00000000 */ nop -/* 0B56FC 7F082D0C 10400007 */ beqz $v0, .L7F082D2C -/* 0B5700 7F082D10 00000000 */ nop -/* 0B5704 7F082D14 0FC26669 */ jal getPlayerCount -/* 0B5708 7F082D18 00000000 */ nop -/* 0B570C 7F082D1C 24010001 */ li $at, 1 -/* 0B5710 7F082D20 14410002 */ bne $v0, $at, .L7F082D2C -/* 0B5714 7F082D24 00000000 */ nop -/* 0B5718 7F082D28 AFA001B4 */ sw $zero, 0x1b4($sp) -.L7F082D2C: -/* 0B571C 7F082D2C 0FC19EF2 */ jal sub_GAME_7F067420 -/* 0B5720 7F082D30 8FA401B4 */ lw $a0, 0x1b4($sp) -/* 0B5724 7F082D34 0FC22850 */ jal bondviewGetVisibleToGuardsFlag -/* 0B5728 7F082D38 00000000 */ nop -/* 0B572C 7F082D3C 50400028 */ beql $v0, $zero, .L7F082DE0 -/* 0B5730 7F082D40 24040002 */ li $a0, 2 -/* 0B5734 7F082D44 0FC17850 */ jal get_hands_firing_status -/* 0B5738 7F082D48 00002025 */ move $a0, $zero -/* 0B573C 7F082D4C 54400006 */ bnezl $v0, .L7F082D68 -/* 0B5740 7F082D50 E7B400E4 */ swc1 $f20, 0xe4($sp) -/* 0B5744 7F082D54 0FC17850 */ jal get_hands_firing_status -/* 0B5748 7F082D58 24040001 */ li $a0, 1 -/* 0B574C 7F082D5C 50400020 */ beql $v0, $zero, .L7F082DE0 -/* 0B5750 7F082D60 24040002 */ li $a0, 2 -/* 0B5754 7F082D64 E7B400E4 */ swc1 $f20, 0xe4($sp) -.L7F082D68: -/* 0B5758 7F082D68 0FC17850 */ jal get_hands_firing_status -/* 0B575C 7F082D6C 00002025 */ move $a0, $zero -/* 0B5760 7F082D70 1040000A */ beqz $v0, .L7F082D9C -/* 0B5764 7F082D74 00000000 */ nop -/* 0B5768 7F082D78 0FC19E47 */ jal getCurrentPlayerNoise -/* 0B576C 7F082D7C 00002025 */ move $a0, $zero -/* 0B5770 7F082D80 4600A03C */ c.lt.s $f20, $f0 -/* 0B5774 7F082D84 00000000 */ nop -/* 0B5778 7F082D88 45000004 */ bc1f .L7F082D9C -/* 0B577C 7F082D8C 00000000 */ nop -/* 0B5780 7F082D90 0FC19E47 */ jal getCurrentPlayerNoise -/* 0B5784 7F082D94 00002025 */ move $a0, $zero -/* 0B5788 7F082D98 E7A000E4 */ swc1 $f0, 0xe4($sp) -.L7F082D9C: -/* 0B578C 7F082D9C 0FC17850 */ jal get_hands_firing_status -/* 0B5790 7F082DA0 24040001 */ li $a0, 1 -/* 0B5794 7F082DA4 1040000B */ beqz $v0, .L7F082DD4 -/* 0B5798 7F082DA8 00000000 */ nop -/* 0B579C 7F082DAC 0FC19E47 */ jal getCurrentPlayerNoise -/* 0B57A0 7F082DB0 24040001 */ li $a0, 1 -/* 0B57A4 7F082DB4 C7AA00E4 */ lwc1 $f10, 0xe4($sp) -/* 0B57A8 7F082DB8 4600503C */ c.lt.s $f10, $f0 -/* 0B57AC 7F082DBC 00000000 */ nop -/* 0B57B0 7F082DC0 45000004 */ bc1f .L7F082DD4 -/* 0B57B4 7F082DC4 00000000 */ nop -/* 0B57B8 7F082DC8 0FC19E47 */ jal getCurrentPlayerNoise -/* 0B57BC 7F082DCC 24040001 */ li $a0, 1 -/* 0B57C0 7F082DD0 E7A000E4 */ swc1 $f0, 0xe4($sp) -.L7F082DD4: -/* 0B57C4 7F082DD4 0FC08BAD */ jal chrCheckGuardsHeardSound -/* 0B57C8 7F082DD8 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 0B57CC 7F082DDC 24040002 */ li $a0, 2 -.L7F082DE0: -/* 0B57D0 7F082DE0 0FC1AB4F */ jal set_unset_bitflags -/* 0B57D4 7F082DE4 8FA5016C */ lw $a1, 0x16c($sp) -/* 0B57D8 7F082DE8 C7B20164 */ lwc1 $f18, 0x164($sp) -/* 0B57DC 7F082DEC 4612A03C */ c.lt.s $f20, $f18 -/* 0B57E0 7F082DF0 00000000 */ nop -/* 0B57E4 7F082DF4 45020004 */ bc1fl .L7F082E08 -/* 0B57E8 7F082DF8 C7A40160 */ lwc1 $f4, 0x160($sp) -/* 0B57EC 7F082DFC 0FC17897 */ jal camera_sniper_zoom_in -/* 0B57F0 7F082E00 46009306 */ mov.s $f12, $f18 -/* 0B57F4 7F082E04 C7A40160 */ lwc1 $f4, 0x160($sp) -.L7F082E08: -/* 0B57F8 7F082E08 4604A03C */ c.lt.s $f20, $f4 -/* 0B57FC 7F082E0C 00000000 */ nop -/* 0B5800 7F082E10 45020004 */ bc1fl .L7F082E24 -/* 0B5804 7F082E14 8E0A0000 */ lw $t2, ($s0) -/* 0B5808 7F082E18 0FC178D3 */ jal camera_sniper_zoom_out -/* 0B580C 7F082E1C 46002306 */ mov.s $f12, $f4 -/* 0B5810 7F082E20 8E0A0000 */ lw $t2, ($s0) -.L7F082E24: -/* 0B5814 7F082E24 8FAD0168 */ lw $t5, 0x168($sp) -/* 0B5818 7F082E28 8D4B01C8 */ lw $t3, 0x1c8($t2) -/* 0B581C 7F082E2C 15600011 */ bnez $t3, .L7F082E74 -/* 0B5820 7F082E30 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B5824 7F082E34 44816000 */ mtc1 $at, $f12 -/* 0B5828 7F082E38 11A0000A */ beqz $t5, .L7F082E64 -/* 0B582C 7F082E3C 00000000 */ nop -/* 0B5830 7F082E40 0FC1787C */ jal get_item_in_hand_zoom -/* 0B5834 7F082E44 00000000 */ nop -/* 0B5838 7F082E48 4614003E */ c.le.s $f0, $f20 -/* 0B583C 7F082E4C 46000306 */ mov.s $f12, $f0 -/* 0B5840 7F082E50 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B5844 7F082E54 45000003 */ bc1f .L7F082E64 -/* 0B5848 7F082E58 00000000 */ nop -/* 0B584C 7F082E5C 44816000 */ mtc1 $at, $f12 -/* 0B5850 7F082E60 00000000 */ nop -.L7F082E64: -/* 0B5854 7F082E64 0FC1F950 */ jal bondviewTriggerWatchZoom -/* 0B5858 7F082E68 00000000 */ nop -/* 0B585C 7F082E6C 0FC1F9C0 */ jal bondviewUpdateWatchZoomIn -/* 0B5860 7F082E70 00000000 */ nop -.L7F082E74: -/* 0B5864 7F082E74 3C0C8003 */ lui $t4, %hi(in_tank_flag) # $t4, 0x8003 -/* 0B5868 7F082E78 8D8C1998 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B586C 7F082E7C 24010001 */ li $at, 1 -/* 0B5870 7F082E80 8FAE0194 */ lw $t6, 0x194($sp) -/* 0B5874 7F082E84 158100C6 */ bne $t4, $at, .L7F0831A0 -/* 0B5878 7F082E88 3C028003 */ lui $v0, %hi(g_TankTurretTurn) # $v0, 0x8003 -/* 0B587C 7F082E8C 244219D8 */ addiu $v0, %lo(g_TankTurretTurn) # addiu $v0, $v0, 0x19d8 -/* 0B5880 7F082E90 E4540000 */ swc1 $f20, ($v0) -/* 0B5884 7F082E94 3C188007 */ lui $t8, %hi(g_EnterTankAudioState) # $t8, 0x8007 -/* 0B5888 7F082E98 8F188498 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B588C 7F082E9C 24010002 */ li $at, 2 -/* 0B5890 7F082EA0 C7A60188 */ lwc1 $f6, 0x188($sp) -/* 0B5894 7F082EA4 170100BC */ bne $t8, $at, .L7F083198 -/* 0B5898 7F082EA8 00000000 */ nop -/* 0B589C 7F082EAC 4606A03C */ c.lt.s $f20, $f6 -/* 0B58A0 7F082EB0 8E080000 */ lw $t0, ($s0) -/* 0B58A4 7F082EB4 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B58A8 7F082EB8 C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 0B58AC 7F082EBC 4502000B */ bc1fl .L7F082EEC -/* 0B58B0 7F082EC0 460AA03C */ c.lt.s $f20, $f10 -/* 0B58B4 7F082EC4 C4281004 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B58B8 7F082EC8 3C018005 */ lui $at, %hi(D_80055128) # $at, 0x8005 -/* 0B58BC 7F082ECC C432ACF8 */ lwc1 $f18, %lo(D_80055128)($at) -/* 0B58C0 7F082ED0 46064282 */ mul.s $f10, $f8, $f6 -/* 0B58C4 7F082ED4 C4480000 */ lwc1 $f8, ($v0) -/* 0B58C8 7F082ED8 46125102 */ mul.s $f4, $f10, $f18 -/* 0B58CC 7F082EDC 46044180 */ add.s $f6, $f8, $f4 -/* 0B58D0 7F082EE0 10000031 */ b .L7F082FA8 -/* 0B58D4 7F082EE4 E4460000 */ swc1 $f6, ($v0) -/* 0B58D8 7F082EE8 460AA03C */ c.lt.s $f20, $f10 -.L7F082EEC: -/* 0B58DC 7F082EEC 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B58E0 7F082EF0 8FAE01A8 */ lw $t6, 0x1a8($sp) -/* 0B58E4 7F082EF4 4500000A */ bc1f .L7F082F20 -/* 0B58E8 7F082EF8 00000000 */ nop -/* 0B58EC 7F082EFC C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B58F0 7F082F00 3C018005 */ lui $at, %hi(D_8005512C) # $at, 0x8005 -/* 0B58F4 7F082F04 C424ACFC */ lwc1 $f4, %lo(D_8005512C)($at) -/* 0B58F8 7F082F08 460A9202 */ mul.s $f8, $f18, $f10 -/* 0B58FC 7F082F0C C4520000 */ lwc1 $f18, ($v0) -/* 0B5900 7F082F10 46044182 */ mul.s $f6, $f8, $f4 -/* 0B5904 7F082F14 46069281 */ sub.s $f10, $f18, $f6 -/* 0B5908 7F082F18 10000023 */ b .L7F082FA8 -/* 0B590C 7F082F1C E44A0000 */ swc1 $f10, ($v0) -.L7F082F20: -/* 0B5910 7F082F20 11C00021 */ beqz $t6, .L7F082FA8 -/* 0B5914 7F082F24 8FAF0124 */ lw $t7, 0x124($sp) -/* 0B5918 7F082F28 448F4000 */ mtc1 $t7, $f8 -/* 0B591C 7F082F2C 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B5920 7F082F30 44819000 */ mtc1 $at, $f18 -/* 0B5924 7F082F34 46804120 */ cvt.s.w $f4, $f8 -/* 0B5928 7F082F38 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B592C 7F082F3C 44813000 */ mtc1 $at, $f6 -/* 0B5930 7F082F40 3C013F80 */ lui $at, 0x3f80 -/* 0B5934 7F082F44 46122083 */ div.s $f2, $f4, $f18 -/* 0B5938 7F082F48 4602303C */ c.lt.s $f6, $f2 -/* 0B593C 7F082F4C 00000000 */ nop -/* 0B5940 7F082F50 45020004 */ bc1fl .L7F082F64 -/* 0B5944 7F082F54 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5948 7F082F58 44811000 */ mtc1 $at, $f2 -/* 0B594C 7F082F5C 00000000 */ nop -/* 0B5950 7F082F60 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F082F64: -/* 0B5954 7F082F64 44815000 */ mtc1 $at, $f10 -/* 0B5958 7F082F68 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B595C 7F082F6C 460A103C */ c.lt.s $f2, $f10 -/* 0B5960 7F082F70 00000000 */ nop -/* 0B5964 7F082F74 45000003 */ bc1f .L7F082F84 -/* 0B5968 7F082F78 00000000 */ nop -/* 0B596C 7F082F7C 44811000 */ mtc1 $at, $f2 -/* 0B5970 7F082F80 00000000 */ nop -.L7F082F84: -/* 0B5974 7F082F84 3C018005 */ lui $at, %hi(D_80055130) # $at, 0x8005 -/* 0B5978 7F082F88 C428AD00 */ lwc1 $f8, %lo(D_80055130)($at) -/* 0B597C 7F082F8C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # -0.000000 -/* 0B5980 7F082F90 C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B5984 7F082F94 46024102 */ mul.s $f4, $f8, $f2 -/* 0B5988 7F082F98 C44A0000 */ lwc1 $f10, ($v0) -/* 0B598C 7F082F9C 46122182 */ mul.s $f6, $f4, $f18 -/* 0B5990 7F082FA0 46065200 */ add.s $f8, $f10, $f6 -/* 0B5994 7F082FA4 E4480000 */ swc1 $f8, ($v0) -.L7F082FA8: -/* 0B5998 7F082FA8 8D190124 */ lw $t9, 0x124($t0) -/* 0B599C 7F082FAC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B59A0 7F082FB0 8FAA01AC */ lw $t2, 0x1ac($sp) -/* 0B59A4 7F082FB4 17200078 */ bnez $t9, .L7F083198 -/* 0B59A8 7F082FB8 00000000 */ nop -/* 0B59AC 7F082FBC 44811000 */ mtc1 $at, $f2 -/* 0B59B0 7F082FC0 4600A006 */ mov.s $f0, $f20 -/* 0B59B4 7F082FC4 11400009 */ beqz $t2, .L7F082FEC -/* 0B59B8 7F082FC8 46001386 */ mov.s $f14, $f2 -/* 0B59BC 7F082FCC 8FA90120 */ lw $t1, 0x120($sp) -/* 0B59C0 7F082FD0 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B59C4 7F082FD4 44815000 */ mtc1 $at, $f10 -/* 0B59C8 7F082FD8 44892000 */ mtc1 $t1, $f4 -/* 0B59CC 7F082FDC 00000000 */ nop -/* 0B59D0 7F082FE0 468024A0 */ cvt.s.w $f18, $f4 -/* 0B59D4 7F082FE4 1000000B */ b .L7F083014 -/* 0B59D8 7F082FE8 460A9003 */ div.s $f0, $f18, $f10 -.L7F082FEC: -/* 0B59DC 7F082FEC 8FAB019C */ lw $t3, 0x19c($sp) -/* 0B59E0 7F082FF0 8FAD0198 */ lw $t5, 0x198($sp) -/* 0B59E4 7F082FF4 11600003 */ beqz $t3, .L7F083004 -/* 0B59E8 7F082FF8 00000000 */ nop -/* 0B59EC 7F082FFC 10000005 */ b .L7F083014 -/* 0B59F0 7F083000 46001006 */ mov.s $f0, $f2 -.L7F083004: -/* 0B59F4 7F083004 11A00003 */ beqz $t5, .L7F083014 -/* 0B59F8 7F083008 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B59FC 7F08300C 44810000 */ mtc1 $at, $f0 -/* 0B5A00 7F083010 00000000 */ nop -.L7F083014: -/* 0B5A04 7F083014 4600103C */ c.lt.s $f2, $f0 -/* 0B5A08 7F083018 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5A0C 7F08301C 3C0C8004 */ lui $t4, %hi(g_ClockTimer) # $t4, 0x8004 -/* 0B5A10 7F083020 45020004 */ bc1fl .L7F083034 -/* 0B5A14 7F083024 44813000 */ mtc1 $at, $f6 -/* 0B5A18 7F083028 10000009 */ b .L7F083050 -/* 0B5A1C 7F08302C 46001006 */ mov.s $f0, $f2 -/* 0B5A20 7F083030 44813000 */ mtc1 $at, $f6 -.L7F083034: -/* 0B5A24 7F083034 3C01BF80 */ lui $at, 0xbf80 -/* 0B5A28 7F083038 4606003C */ c.lt.s $f0, $f6 -/* 0B5A2C 7F08303C 00000000 */ nop -/* 0B5A30 7F083040 45020004 */ bc1fl .L7F083054 -/* 0B5A34 7F083044 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0B5A38 7F083048 44810000 */ mtc1 $at, $f0 -/* 0B5A3C 7F08304C 00000000 */ nop -.L7F083050: -/* 0B5A40 7F083050 3C014170 */ li $at, 0x41700000 # 15.000000 -.L7F083054: -/* 0B5A44 7F083054 44818000 */ mtc1 $at, $f16 -/* 0B5A48 7F083058 3C038003 */ lui $v1, %hi(D_80036490) # $v1, 0x8003 -/* 0B5A4C 7F08305C 246319E0 */ addiu $v1, %lo(D_80036490) # addiu $v1, $v1, 0x19e0 -/* 0B5A50 7F083060 46100302 */ mul.s $f12, $f0, $f16 -/* 0B5A54 7F083064 8C620000 */ lw $v0, ($v1) -/* 0B5A58 7F083068 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B5A5C 7F08306C 18400008 */ blez $v0, .L7F083090 -/* 0B5A60 7F083070 46006086 */ mov.s $f2, $f12 -/* 0B5A64 7F083074 44814000 */ mtc1 $at, $f8 -/* 0B5A68 7F083078 8D8C0FF4 */ lw $t4, %lo(g_ClockTimer)($t4) -/* 0B5A6C 7F08307C 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B5A70 7F083080 44817000 */ mtc1 $at, $f14 -/* 0B5A74 7F083084 004CC023 */ subu $t8, $v0, $t4 -/* 0B5A78 7F083088 46086082 */ mul.s $f2, $f12, $f8 -/* 0B5A7C 7F08308C AC780000 */ sw $t8, ($v1) -.L7F083090: -/* 0B5A80 7F083090 C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B5A84 7F083094 46001032 */ c.eq.s $f2, $f0 -/* 0B5A88 7F083098 00000000 */ nop -/* 0B5A8C 7F08309C 4501003E */ bc1t .L7F083198 -/* 0B5A90 7F0830A0 00000000 */ nop -/* 0B5A94 7F0830A4 4602003C */ c.lt.s $f0, $f2 -/* 0B5A98 7F0830A8 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B5A9C 7F0830AC 4502001D */ bc1fl .L7F083124 -/* 0B5AA0 7F0830B0 4600103C */ c.lt.s $f2, $f0 -/* 0B5AA4 7F0830B4 46001101 */ sub.s $f4, $f2, $f0 -/* 0B5AA8 7F0830B8 44819000 */ mtc1 $at, $f18 -/* 0B5AAC 7F0830BC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B5AB0 7F0830C0 44814000 */ mtc1 $at, $f8 -/* 0B5AB4 7F0830C4 46122282 */ mul.s $f10, $f4, $f18 -/* 0B5AB8 7F0830C8 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B5ABC 7F0830CC 46105183 */ div.s $f6, $f10, $f16 -/* 0B5AC0 7F0830D0 44815000 */ mtc1 $at, $f10 -/* 0B5AC4 7F0830D4 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B5AC8 7F0830D8 46083100 */ add.s $f4, $f6, $f8 -/* 0B5ACC 7F0830DC 44814000 */ mtc1 $at, $f8 -/* 0B5AD0 7F0830E0 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B5AD4 7F0830E4 460E2482 */ mul.s $f18, $f4, $f14 -/* 0B5AD8 7F0830E8 C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B5ADC 7F0830EC 460A9182 */ mul.s $f6, $f18, $f10 -/* 0B5AE0 7F0830F0 46083303 */ div.s $f12, $f6, $f8 -/* 0B5AE4 7F0830F4 46046482 */ mul.s $f18, $f12, $f4 -/* 0B5AE8 7F0830F8 46120280 */ add.s $f10, $f0, $f18 -/* 0B5AEC 7F0830FC E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B5AF0 7F083100 8E080000 */ lw $t0, ($s0) -/* 0B5AF4 7F083104 C5060174 */ lwc1 $f6, 0x174($t0) -/* 0B5AF8 7F083108 4606103C */ c.lt.s $f2, $f6 -/* 0B5AFC 7F08310C 00000000 */ nop -/* 0B5B00 7F083110 45000021 */ bc1f .L7F083198 -/* 0B5B04 7F083114 00000000 */ nop -/* 0B5B08 7F083118 1000001F */ b .L7F083198 -/* 0B5B0C 7F08311C E5020174 */ swc1 $f2, 0x174($t0) -/* 0B5B10 7F083120 4600103C */ c.lt.s $f2, $f0 -.L7F083124: -/* 0B5B14 7F083124 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B5B18 7F083128 4500001B */ bc1f .L7F083198 -/* 0B5B1C 7F08312C 00000000 */ nop -/* 0B5B20 7F083130 46020201 */ sub.s $f8, $f0, $f2 -/* 0B5B24 7F083134 44812000 */ mtc1 $at, $f4 -/* 0B5B28 7F083138 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B5B2C 7F08313C 44813000 */ mtc1 $at, $f6 -/* 0B5B30 7F083140 46044482 */ mul.s $f18, $f8, $f4 -/* 0B5B34 7F083144 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B5B38 7F083148 46109283 */ div.s $f10, $f18, $f16 -/* 0B5B3C 7F08314C 44819000 */ mtc1 $at, $f18 -/* 0B5B40 7F083150 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B5B44 7F083154 46065200 */ add.s $f8, $f10, $f6 -/* 0B5B48 7F083158 44813000 */ mtc1 $at, $f6 -/* 0B5B4C 7F08315C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B5B50 7F083160 460E4102 */ mul.s $f4, $f8, $f14 -/* 0B5B54 7F083164 C4281004 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B5B58 7F083168 46122282 */ mul.s $f10, $f4, $f18 -/* 0B5B5C 7F08316C 46065303 */ div.s $f12, $f10, $f6 -/* 0B5B60 7F083170 46086102 */ mul.s $f4, $f12, $f8 -/* 0B5B64 7F083174 46040480 */ add.s $f18, $f0, $f4 -/* 0B5B68 7F083178 E5120174 */ swc1 $f18, 0x174($t0) -/* 0B5B6C 7F08317C 8E080000 */ lw $t0, ($s0) -/* 0B5B70 7F083180 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0B5B74 7F083184 4602503C */ c.lt.s $f10, $f2 -/* 0B5B78 7F083188 00000000 */ nop -/* 0B5B7C 7F08318C 45000002 */ bc1f .L7F083198 -/* 0B5B80 7F083190 00000000 */ nop -/* 0B5B84 7F083194 E5020174 */ swc1 $f2, 0x174($t0) -.L7F083198: -/* 0B5B88 7F083198 100000A7 */ b .L7F083438 -/* 0B5B8C 7F08319C 8E080000 */ lw $t0, ($s0) -.L7F0831A0: -/* 0B5B90 7F0831A0 11C00005 */ beqz $t6, .L7F0831B8 -/* 0B5B94 7F0831A4 8FAF0190 */ lw $t7, 0x190($sp) -/* 0B5B98 7F0831A8 0FC1FF5A */ jal sub_GAME_7F07FCC4 -/* 0B5B9C 7F0831AC 2404FFFF */ li $a0, -1 -/* 0B5BA0 7F0831B0 1000000A */ b .L7F0831DC -/* 0B5BA4 7F0831B4 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F0831B8: -/* 0B5BA8 7F0831B8 11E00005 */ beqz $t7, .L7F0831D0 -/* 0B5BAC 7F0831BC 00000000 */ nop -/* 0B5BB0 7F0831C0 0FC1FF5A */ jal sub_GAME_7F07FCC4 -/* 0B5BB4 7F0831C4 24040001 */ li $a0, 1 -/* 0B5BB8 7F0831C8 10000004 */ b .L7F0831DC -/* 0B5BBC 7F0831CC 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F0831D0: -/* 0B5BC0 7F0831D0 0FC1FF5A */ jal sub_GAME_7F07FCC4 -/* 0B5BC4 7F0831D4 00002025 */ move $a0, $zero -/* 0B5BC8 7F0831D8 8FB901A8 */ lw $t9, 0x1a8($sp) -.L7F0831DC: -/* 0B5BCC 7F0831DC 8FAA0124 */ lw $t2, 0x124($sp) -/* 0B5BD0 7F0831E0 53200009 */ beql $t9, $zero, .L7F083208 -/* 0B5BD4 7F0831E4 8FAD019C */ lw $t5, 0x19c($sp) -/* 0B5BD8 7F0831E8 448A3000 */ mtc1 $t2, $f6 -/* 0B5BDC 7F0831EC 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B5BE0 7F0831F0 44812000 */ mtc1 $at, $f4 -/* 0B5BE4 7F0831F4 46803220 */ cvt.s.w $f8, $f6 -/* 0B5BE8 7F0831F8 8E0B0000 */ lw $t3, ($s0) -/* 0B5BEC 7F0831FC 46044483 */ div.s $f18, $f8, $f4 -/* 0B5BF0 7F083200 E572016C */ swc1 $f18, 0x16c($t3) -/* 0B5BF4 7F083204 8FAD019C */ lw $t5, 0x19c($sp) -.L7F083208: -/* 0B5BF8 7F083208 8FAF0198 */ lw $t7, 0x198($sp) -/* 0B5BFC 7F08320C 11A0000A */ beqz $t5, .L7F083238 -/* 0B5C00 7F083210 00000000 */ nop -/* 0B5C04 7F083214 0FC1FFB0 */ jal sub_GAME_7F07FE1C -/* 0B5C08 7F083218 24040001 */ li $a0, 1 -/* 0B5C0C 7F08321C 8E080000 */ lw $t0, ($s0) -/* 0B5C10 7F083220 3C188004 */ lui $t8, %hi(g_ClockTimer) # $t8, 0x8004 -/* 0B5C14 7F083224 8F180FF4 */ lw $t8, %lo(g_ClockTimer)($t8) -/* 0B5C18 7F083228 8D0C017C */ lw $t4, 0x17c($t0) -/* 0B5C1C 7F08322C 01987021 */ addu $t6, $t4, $t8 -/* 0B5C20 7F083230 10000009 */ b .L7F083258 -/* 0B5C24 7F083234 AD0E017C */ sw $t6, 0x17c($t0) -.L7F083238: -/* 0B5C28 7F083238 11E00005 */ beqz $t7, .L7F083250 -/* 0B5C2C 7F08323C 00000000 */ nop -/* 0B5C30 7F083240 0FC1FFB0 */ jal sub_GAME_7F07FE1C -/* 0B5C34 7F083244 2404FFFF */ li $a0, -1 -/* 0B5C38 7F083248 10000004 */ b .L7F08325C -/* 0B5C3C 7F08324C 8FB901AC */ lw $t9, 0x1ac($sp) -.L7F083250: -/* 0B5C40 7F083250 0FC1FFB0 */ jal sub_GAME_7F07FE1C -/* 0B5C44 7F083254 00002025 */ move $a0, $zero -.L7F083258: -/* 0B5C48 7F083258 8FB901AC */ lw $t9, 0x1ac($sp) -.L7F08325C: -/* 0B5C4C 7F08325C 8FAA0120 */ lw $t2, 0x120($sp) -/* 0B5C50 7F083260 53200016 */ beql $t9, $zero, .L7F0832BC -/* 0B5C54 7F083264 8E080000 */ lw $t0, ($s0) -/* 0B5C58 7F083268 448A5000 */ mtc1 $t2, $f10 -/* 0B5C5C 7F08326C 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B5C60 7F083270 44814000 */ mtc1 $at, $f8 -/* 0B5C64 7F083274 468051A0 */ cvt.s.w $f6, $f10 -/* 0B5C68 7F083278 8E0B0000 */ lw $t3, ($s0) -/* 0B5C6C 7F08327C 46083103 */ div.s $f4, $f6, $f8 -/* 0B5C70 7F083280 E5640174 */ swc1 $f4, 0x174($t3) -/* 0B5C74 7F083284 8FAD0120 */ lw $t5, 0x120($sp) -/* 0B5C78 7F083288 29A1003D */ slti $at, $t5, 0x3d -/* 0B5C7C 7F08328C 54200009 */ bnezl $at, .L7F0832B4 -/* 0B5C80 7F083290 8E0F0000 */ lw $t7, ($s0) -/* 0B5C84 7F083294 8E080000 */ lw $t0, ($s0) -/* 0B5C88 7F083298 3C188004 */ lui $t8, %hi(g_ClockTimer) # $t8, 0x8004 -/* 0B5C8C 7F08329C 8F180FF4 */ lw $t8, %lo(g_ClockTimer)($t8) -/* 0B5C90 7F0832A0 8D0C017C */ lw $t4, 0x17c($t0) -/* 0B5C94 7F0832A4 01987021 */ addu $t6, $t4, $t8 -/* 0B5C98 7F0832A8 10000003 */ b .L7F0832B8 -/* 0B5C9C 7F0832AC AD0E017C */ sw $t6, 0x17c($t0) -/* 0B5CA0 7F0832B0 8E0F0000 */ lw $t7, ($s0) -.L7F0832B4: -/* 0B5CA4 7F0832B4 ADE0017C */ sw $zero, 0x17c($t7) -.L7F0832B8: -/* 0B5CA8 7F0832B8 8E080000 */ lw $t0, ($s0) -.L7F0832BC: -/* 0B5CAC 7F0832BC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5CB0 7F0832C0 44819000 */ mtc1 $at, $f18 -/* 0B5CB4 7F0832C4 C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B5CB8 7F0832C8 3C013F80 */ lui $at, 0x3f80 -/* 0B5CBC 7F0832CC 4600903C */ c.lt.s $f18, $f0 -/* 0B5CC0 7F0832D0 00000000 */ nop -/* 0B5CC4 7F0832D4 45020007 */ bc1fl .L7F0832F4 -/* 0B5CC8 7F0832D8 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5CCC 7F0832DC 44815000 */ mtc1 $at, $f10 -/* 0B5CD0 7F0832E0 00000000 */ nop -/* 0B5CD4 7F0832E4 E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B5CD8 7F0832E8 8E080000 */ lw $t0, ($s0) -/* 0B5CDC 7F0832EC C5000174 */ lwc1 $f0, 0x174($t0) -/* 0B5CE0 7F0832F0 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F0832F4: -/* 0B5CE4 7F0832F4 44813000 */ mtc1 $at, $f6 -/* 0B5CE8 7F0832F8 3C01BF80 */ lui $at, 0xbf80 -/* 0B5CEC 7F0832FC 4606003C */ c.lt.s $f0, $f6 -/* 0B5CF0 7F083300 00000000 */ nop -/* 0B5CF4 7F083304 45020006 */ bc1fl .L7F083320 -/* 0B5CF8 7F083308 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5CFC 7F08330C 44814000 */ mtc1 $at, $f8 -/* 0B5D00 7F083310 00000000 */ nop -/* 0B5D04 7F083314 E5080174 */ swc1 $f8, 0x174($t0) -/* 0B5D08 7F083318 8E080000 */ lw $t0, ($s0) -/* 0B5D0C 7F08331C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F083320: -/* 0B5D10 7F083320 44812000 */ mtc1 $at, $f4 -/* 0B5D14 7F083324 C500016C */ lwc1 $f0, 0x16c($t0) -/* 0B5D18 7F083328 3C013F80 */ lui $at, 0x3f80 -/* 0B5D1C 7F08332C 4600203C */ c.lt.s $f4, $f0 -/* 0B5D20 7F083330 00000000 */ nop -/* 0B5D24 7F083334 45020007 */ bc1fl .L7F083354 -/* 0B5D28 7F083338 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5D2C 7F08333C 44819000 */ mtc1 $at, $f18 -/* 0B5D30 7F083340 00000000 */ nop -/* 0B5D34 7F083344 E512016C */ swc1 $f18, 0x16c($t0) -/* 0B5D38 7F083348 8E080000 */ lw $t0, ($s0) -/* 0B5D3C 7F08334C C500016C */ lwc1 $f0, 0x16c($t0) -/* 0B5D40 7F083350 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F083354: -/* 0B5D44 7F083354 44815000 */ mtc1 $at, $f10 -/* 0B5D48 7F083358 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B5D4C 7F08335C 460A003C */ c.lt.s $f0, $f10 -/* 0B5D50 7F083360 00000000 */ nop -/* 0B5D54 7F083364 45000005 */ bc1f .L7F08337C -/* 0B5D58 7F083368 00000000 */ nop -/* 0B5D5C 7F08336C 44813000 */ mtc1 $at, $f6 -/* 0B5D60 7F083370 00000000 */ nop -/* 0B5D64 7F083374 E506016C */ swc1 $f6, 0x16c($t0) -/* 0B5D68 7F083378 8E080000 */ lw $t0, ($s0) -.L7F08337C: -/* 0B5D6C 7F08337C 3C018005 */ lui $at, %hi(D_80055134) # $at, 0x8005 -/* 0B5D70 7F083380 C424AD04 */ lwc1 $f4, %lo(D_80055134)($at) -/* 0B5D74 7F083384 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B5D78 7F083388 46044482 */ mul.s $f18, $f8, $f4 -/* 0B5D7C 7F08338C E5120174 */ swc1 $f18, 0x174($t0) -/* 0B5D80 7F083390 8E080000 */ lw $t0, ($s0) -/* 0B5D84 7F083394 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0B5D88 7F083398 C5060178 */ lwc1 $f6, 0x178($t0) -/* 0B5D8C 7F08339C 46065202 */ mul.s $f8, $f10, $f6 -/* 0B5D90 7F0833A0 E5080174 */ swc1 $f8, 0x174($t0) -/* 0B5D94 7F0833A4 8FB901AC */ lw $t9, 0x1ac($sp) -/* 0B5D98 7F0833A8 8FAA019C */ lw $t2, 0x19c($sp) -/* 0B5D9C 7F0833AC 57200006 */ bnezl $t9, .L7F0833C8 -/* 0B5DA0 7F0833B0 8FAD0154 */ lw $t5, 0x154($sp) -/* 0B5DA4 7F0833B4 55400004 */ bnezl $t2, .L7F0833C8 -/* 0B5DA8 7F0833B8 8FAD0154 */ lw $t5, 0x154($sp) -/* 0B5DAC 7F0833BC 8E0B0000 */ lw $t3, ($s0) -/* 0B5DB0 7F0833C0 AD60017C */ sw $zero, 0x17c($t3) -/* 0B5DB4 7F0833C4 8FAD0154 */ lw $t5, 0x154($sp) -.L7F0833C8: -/* 0B5DB8 7F0833C8 8FAC0150 */ lw $t4, 0x150($sp) -/* 0B5DBC 7F0833CC 11A00005 */ beqz $t5, .L7F0833E4 -/* 0B5DC0 7F0833D0 00000000 */ nop -/* 0B5DC4 7F0833D4 0FC1E682 */ jal currentPlayerSetSwayTarget -/* 0B5DC8 7F0833D8 2404FFFF */ li $a0, -1 -/* 0B5DCC 7F0833DC 1000000A */ b .L7F083408 -/* 0B5DD0 7F0833E0 8FB8015C */ lw $t8, 0x15c($sp) -.L7F0833E4: -/* 0B5DD4 7F0833E4 11800005 */ beqz $t4, .L7F0833FC -/* 0B5DD8 7F0833E8 00000000 */ nop -/* 0B5DDC 7F0833EC 0FC1E682 */ jal currentPlayerSetSwayTarget -/* 0B5DE0 7F0833F0 24040001 */ li $a0, 1 -/* 0B5DE4 7F0833F4 10000004 */ b .L7F083408 -/* 0B5DE8 7F0833F8 8FB8015C */ lw $t8, 0x15c($sp) -.L7F0833FC: -/* 0B5DEC 7F0833FC 0FC1E682 */ jal currentPlayerSetSwayTarget -/* 0B5DF0 7F083400 00002025 */ move $a0, $zero -/* 0B5DF4 7F083404 8FB8015C */ lw $t8, 0x15c($sp) -.L7F083408: -/* 0B5DF8 7F083408 8FAE0158 */ lw $t6, 0x158($sp) -/* 0B5DFC 7F08340C 13000005 */ beqz $t8, .L7F083424 -/* 0B5E00 7F083410 00000000 */ nop -/* 0B5E04 7F083414 0FC1E68B */ jal currentPlayerAdjustCrouchPos -/* 0B5E08 7F083418 2404FFFE */ li $a0, -2 -/* 0B5E0C 7F08341C 10000006 */ b .L7F083438 -/* 0B5E10 7F083420 8E080000 */ lw $t0, ($s0) -.L7F083424: -/* 0B5E14 7F083424 51C00004 */ beql $t6, $zero, .L7F083438 -/* 0B5E18 7F083428 8E080000 */ lw $t0, ($s0) -/* 0B5E1C 7F08342C 0FC1E68B */ jal currentPlayerAdjustCrouchPos -/* 0B5E20 7F083430 24040002 */ li $a0, 2 -/* 0B5E24 7F083434 8E080000 */ lw $t0, ($s0) -.L7F083438: -/* 0B5E28 7F083438 8D0F017C */ lw $t7, 0x17c($t0) -/* 0B5E2C 7F08343C 29E10096 */ slti $at, $t7, 0x96 -/* 0B5E30 7F083440 14200017 */ bnez $at, .L7F0834A0 -/* 0B5E34 7F083444 3C013FA0 */ li $at, 0x3FA00000 # 1.250000 -/* 0B5E38 7F083448 44811000 */ mtc1 $at, $f2 -/* 0B5E3C 7F08344C C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B5E40 7F083450 3C018005 */ lui $at, %hi(D_80055138) # $at, 0x8005 -/* 0B5E44 7F083454 4602003C */ c.lt.s $f0, $f2 -/* 0B5E48 7F083458 00000000 */ nop -/* 0B5E4C 7F08345C 4502000A */ bc1fl .L7F083488 -/* 0B5E50 7F083460 4600103C */ c.lt.s $f2, $f0 -/* 0B5E54 7F083464 C424AD08 */ lwc1 $f4, %lo(D_80055138)($at) -/* 0B5E58 7F083468 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B5E5C 7F08346C C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B5E60 7F083470 46122282 */ mul.s $f10, $f4, $f18 -/* 0B5E64 7F083474 460A0180 */ add.s $f6, $f0, $f10 -/* 0B5E68 7F083478 E5060178 */ swc1 $f6, 0x178($t0) -/* 0B5E6C 7F08347C 8E080000 */ lw $t0, ($s0) -/* 0B5E70 7F083480 C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B5E74 7F083484 4600103C */ c.lt.s $f2, $f0 -.L7F083488: -/* 0B5E78 7F083488 00000000 */ nop -/* 0B5E7C 7F08348C 45020020 */ bc1fl .L7F083510 -/* 0B5E80 7F083490 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B5E84 7F083494 E5020178 */ swc1 $f2, 0x178($t0) -/* 0B5E88 7F083498 1000001C */ b .L7F08350C -/* 0B5E8C 7F08349C 8E080000 */ lw $t0, ($s0) -.L7F0834A0: -/* 0B5E90 7F0834A0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5E94 7F0834A4 44814000 */ mtc1 $at, $f8 -/* 0B5E98 7F0834A8 C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B5E9C 7F0834AC 3C018005 */ lui $at, 0x8005 -/* 0B5EA0 7F0834B0 4600403C */ c.lt.s $f8, $f0 -/* 0B5EA4 7F0834B4 00000000 */ nop -/* 0B5EA8 7F0834B8 4502000A */ bc1fl .L7F0834E4 -/* 0B5EAC 7F0834BC 3C013F80 */ lui $at, %hi(0x3F800000) # $at, 0x3f80 -/* 0B5EB0 7F0834C0 C424AD0C */ lwc1 $f4, %lo(D_8005513C)($at) -/* 0B5EB4 7F0834C4 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B5EB8 7F0834C8 C4321004 */ lwc1 $f18, %lo(g_GlobalTimerDelta)($at) -/* 0B5EBC 7F0834CC 46122282 */ mul.s $f10, $f4, $f18 -/* 0B5EC0 7F0834D0 460A0181 */ sub.s $f6, $f0, $f10 -/* 0B5EC4 7F0834D4 E5060178 */ swc1 $f6, 0x178($t0) -/* 0B5EC8 7F0834D8 8E080000 */ lw $t0, ($s0) -/* 0B5ECC 7F0834DC C5000178 */ lwc1 $f0, 0x178($t0) -/* 0B5ED0 7F0834E0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F0834E4: -/* 0B5ED4 7F0834E4 44814000 */ mtc1 $at, $f8 -/* 0B5ED8 7F0834E8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5EDC 7F0834EC 4608003C */ c.lt.s $f0, $f8 -/* 0B5EE0 7F0834F0 00000000 */ nop -/* 0B5EE4 7F0834F4 45020006 */ bc1fl .L7F083510 -/* 0B5EE8 7F0834F8 8D1901C8 */ lw $t9, 0x1c8($t0) -/* 0B5EEC 7F0834FC 44812000 */ mtc1 $at, $f4 -/* 0B5EF0 7F083500 00000000 */ nop -/* 0B5EF4 7F083504 E5040178 */ swc1 $f4, 0x178($t0) -/* 0B5EF8 7F083508 8E080000 */ lw $t0, ($s0) -.L7F08350C: -/* 0B5EFC 7F08350C 8D1901C8 */ lw $t9, 0x1c8($t0) -.L7F083510: -/* 0B5F00 7F083510 572001B4 */ bnezl $t9, .L7F083BE4 -/* 0B5F04 7F083514 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B5F08 7F083518 8D0A0114 */ lw $t2, 0x114($t0) -/* 0B5F0C 7F08351C 3C01C080 */ li $at, 0xC0800000 # -4.000000 -/* 0B5F10 7F083520 44817000 */ mtc1 $at, $f14 -/* 0B5F14 7F083524 1140007F */ beqz $t2, .L7F083724 -/* 0B5F18 7F083528 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B5F1C 7F08352C 8D0B0488 */ lw $t3, 0x488($t0) -/* 0B5F20 7F083530 44819000 */ mtc1 $at, $f18 -/* 0B5F24 7F083534 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 0B5F28 7F083538 AFAB00C0 */ sw $t3, 0xc0($sp) -/* 0B5F2C 7F08353C E7B200BC */ swc1 $f18, 0xbc($sp) -/* 0B5F30 7F083540 8D0400A8 */ lw $a0, 0xa8($t0) -/* 0B5F34 7F083544 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B5F38 7F083548 27A600A8 */ addiu $a2, $sp, 0xa8 -/* 0B5F3C 7F08354C 0FC22910 */ jal bondviewCollisionRadiusRelated -/* 0B5F40 7F083550 27A700A4 */ addiu $a3, $sp, 0xa4 -/* 0B5F44 7F083554 8E080000 */ lw $t0, ($s0) -/* 0B5F48 7F083558 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0B5F4C 7F08355C 44810000 */ mtc1 $at, $f0 -/* 0B5F50 7F083560 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0B5F54 7F083564 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0B5F58 7F083568 46005182 */ mul.s $f6, $f10, $f0 -/* 0B5F5C 7F08356C 46083100 */ add.s $f4, $f6, $f8 -/* 0B5F60 7F083570 E7A400AC */ swc1 $f4, 0xac($sp) -/* 0B5F64 7F083574 C5120490 */ lwc1 $f18, 0x490($t0) -/* 0B5F68 7F083578 E7B200B0 */ swc1 $f18, 0xb0($sp) -/* 0B5F6C 7F08357C C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0B5F70 7F083580 C5080494 */ lwc1 $f8, 0x494($t0) -/* 0B5F74 7F083584 46005182 */ mul.s $f6, $f10, $f0 -/* 0B5F78 7F083588 46083100 */ add.s $f4, $f6, $f8 -/* 0B5F7C 7F08358C 0FC2C3E1 */ jal sub_GAME_7F0B1CC4 -/* 0B5F80 7F083590 E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 0B5F84 7F083594 8E080000 */ lw $t0, ($s0) -/* 0B5F88 7F083598 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B5F8C 7F08359C 44814000 */ mtc1 $at, $f8 -/* 0B5F90 7F0835A0 8D05048C */ lw $a1, 0x48c($t0) -/* 0B5F94 7F0835A4 8D060494 */ lw $a2, 0x494($t0) -/* 0B5F98 7F0835A8 C7B200B4 */ lwc1 $f18, 0xb4($sp) -/* 0B5F9C 7F0835AC C7AA00A8 */ lwc1 $f10, 0xa8($sp) -/* 0B5FA0 7F0835B0 C7A600A4 */ lwc1 $f6, 0xa4($sp) -/* 0B5FA4 7F0835B4 240D1000 */ li $t5, 4096 -/* 0B5FA8 7F0835B8 AFAD0014 */ sw $t5, 0x14($sp) -/* 0B5FAC 7F0835BC E7B40020 */ swc1 $f20, 0x20($sp) -/* 0B5FB0 7F0835C0 27A400C0 */ addiu $a0, $sp, 0xc0 -/* 0B5FB4 7F0835C4 8FA700AC */ lw $a3, 0xac($sp) -/* 0B5FB8 7F0835C8 E7A80024 */ swc1 $f8, 0x24($sp) -/* 0B5FBC 7F0835CC E7B20010 */ swc1 $f18, 0x10($sp) -/* 0B5FC0 7F0835D0 E7AA0018 */ swc1 $f10, 0x18($sp) -/* 0B5FC4 7F0835D4 0FC2C039 */ jal sub_GAME_7F0B0E24 -/* 0B5FC8 7F0835D8 E7A6001C */ swc1 $f6, 0x1c($sp) -/* 0B5FCC 7F0835DC 10400009 */ beqz $v0, .L7F083604 -/* 0B5FD0 7F0835E0 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B5FD4 7F0835E4 8FA400C0 */ lw $a0, 0xc0($sp) -/* 0B5FD8 7F0835E8 8FA500AC */ lw $a1, 0xac($sp) -/* 0B5FDC 7F0835EC 8FA600B4 */ lw $a2, 0xb4($sp) -/* 0B5FE0 7F0835F0 0FC20381 */ jal bondviewYPositionRelated -/* 0B5FE4 7F0835F4 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B5FE8 7F0835F8 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B5FEC 7F0835FC 1000001A */ b .L7F083668 -/* 0B5FF0 7F083600 E7A000B0 */ swc1 $f0, 0xb0($sp) -.L7F083604: -/* 0B5FF4 7F083604 8E080000 */ lw $t0, ($s0) -/* 0B5FF8 7F083608 27A600AC */ addiu $a2, $sp, 0xac -/* 0B5FFC 7F08360C E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B6000 7F083610 2504048C */ addiu $a0, $t0, 0x48c -/* 0B6004 7F083614 0FC098AC */ jal chrlvStanPointPointIntersection -/* 0B6008 7F083618 25050498 */ addiu $a1, $t0, 0x498 -/* 0B600C 7F08361C 8E080000 */ lw $t0, ($s0) -/* 0B6010 7F083620 C7A400AC */ lwc1 $f4, 0xac($sp) -/* 0B6014 7F083624 C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* 0B6018 7F083628 C512048C */ lwc1 $f18, 0x48c($t0) -/* 0B601C 7F08362C C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B6020 7F083630 46122001 */ sub.s $f0, $f4, $f18 -/* 0B6024 7F083634 46065081 */ sub.s $f2, $f10, $f6 -/* 0B6028 7F083638 46000202 */ mul.s $f8, $f0, $f0 -/* 0B602C 7F08363C 00000000 */ nop -/* 0B6030 7F083640 46021102 */ mul.s $f4, $f2, $f2 -/* 0B6034 7F083644 0C007614 */ jal sqrtf -/* 0B6038 7F083648 46044300 */ add.s $f12, $f8, $f4 -/* 0B603C 7F08364C E7A000BC */ swc1 $f0, 0xbc($sp) -/* 0B6040 7F083650 8FA400C0 */ lw $a0, 0xc0($sp) -/* 0B6044 7F083654 8FA500AC */ lw $a1, 0xac($sp) -/* 0B6048 7F083658 0FC20381 */ jal bondviewYPositionRelated -/* 0B604C 7F08365C 8FA600B4 */ lw $a2, 0xb4($sp) -/* 0B6050 7F083660 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B6054 7F083664 E7A000B0 */ swc1 $f0, 0xb0($sp) -.L7F083668: -/* 0B6058 7F083668 C7B200BC */ lwc1 $f18, 0xbc($sp) -/* 0B605C 7F08366C 4612A03C */ c.lt.s $f20, $f18 -/* 0B6060 7F083670 00000000 */ nop -/* 0B6064 7F083674 4502002C */ bc1fl .L7F083728 -/* 0B6068 7F083678 8E080000 */ lw $t0, ($s0) -/* 0B606C 7F08367C 8E0C0000 */ lw $t4, ($s0) -/* 0B6070 7F083680 3C01C396 */ li $at, 0xC3960000 # -300.000000 -/* 0B6074 7F083684 44813000 */ mtc1 $at, $f6 -/* 0B6078 7F083688 C58A0074 */ lwc1 $f10, 0x74($t4) -/* 0B607C 7F08368C 3C0143FA */ li $at, 0x43FA0000 # 500.000000 -/* 0B6080 7F083690 460A0301 */ sub.s $f12, $f0, $f10 -/* 0B6084 7F083694 460C303C */ c.lt.s $f6, $f12 -/* 0B6088 7F083698 00000000 */ nop -/* 0B608C 7F08369C 45020022 */ bc1fl .L7F083728 -/* 0B6090 7F0836A0 8E080000 */ lw $t0, ($s0) -/* 0B6094 7F0836A4 44814000 */ mtc1 $at, $f8 -/* 0B6098 7F0836A8 00000000 */ nop -/* 0B609C 7F0836AC 4608603C */ c.lt.s $f12, $f8 -/* 0B60A0 7F0836B0 00000000 */ nop -/* 0B60A4 7F0836B4 4502001C */ bc1fl .L7F083728 -/* 0B60A8 7F0836B8 8E080000 */ lw $t0, ($s0) -/* 0B60AC 7F0836BC 0FC16BB8 */ jal atan2f -/* 0B60B0 7F0836C0 46009386 */ mov.s $f14, $f18 -/* 0B60B4 7F0836C4 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B60B8 7F0836C8 44816000 */ mtc1 $at, $f12 -/* 0B60BC 7F0836CC 3C018005 */ lui $at, %hi(D_80055140) # $at, 0x8005 -/* 0B60C0 7F0836D0 C42AAD10 */ lwc1 $f10, %lo(D_80055140)($at) -/* 0B60C4 7F0836D4 460C0102 */ mul.s $f4, $f0, $f12 -/* 0B60C8 7F0836D8 3C01C080 */ li $at, 0xC0800000 # -4.000000 -/* 0B60CC 7F0836DC 44814000 */ mtc1 $at, $f8 -/* 0B60D0 7F0836E0 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B60D4 7F0836E4 44819000 */ mtc1 $at, $f18 -/* 0B60D8 7F0836E8 3C018005 */ lui $at, %hi(D_80055144) # $at, 0x8005 -/* 0B60DC 7F0836EC 460A2183 */ div.s $f6, $f4, $f10 -/* 0B60E0 7F0836F0 46083080 */ add.s $f2, $f6, $f8 -/* 0B60E4 7F0836F4 4602903E */ c.le.s $f18, $f2 -/* 0B60E8 7F0836F8 46001386 */ mov.s $f14, $f2 -/* 0B60EC 7F0836FC 45020003 */ bc1fl .L7F08370C -/* 0B60F0 7F083700 460EA03C */ c.lt.s $f20, $f14 -/* 0B60F4 7F083704 460C1381 */ sub.s $f14, $f2, $f12 -/* 0B60F8 7F083708 460EA03C */ c.lt.s $f20, $f14 -.L7F08370C: -/* 0B60FC 7F08370C 00000000 */ nop -/* 0B6100 7F083710 45020005 */ bc1fl .L7F083728 -/* 0B6104 7F083714 8E080000 */ lw $t0, ($s0) -/* 0B6108 7F083718 C424AD14 */ lwc1 $f4, %lo(D_80055144)($at) -/* 0B610C 7F08371C 46047382 */ mul.s $f14, $f14, $f4 -/* 0B6110 7F083720 00000000 */ nop -.L7F083724: -/* 0B6114 7F083724 8E080000 */ lw $t0, ($s0) -.L7F083728: -/* 0B6118 7F083728 8FA90120 */ lw $t1, 0x120($sp) -/* 0B611C 7F08372C 3C0E8003 */ lui $t6, %hi(in_tank_flag) # $t6, 0x8003 -/* 0B6120 7F083730 8D180110 */ lw $t8, 0x110($t0) -/* 0B6124 7F083734 29210028 */ slti $at, $t1, 0x28 -/* 0B6128 7F083738 13000007 */ beqz $t8, .L7F083758 -/* 0B612C 7F08373C 00000000 */ nop -/* 0B6130 7F083740 10200005 */ beqz $at, .L7F083758 -/* 0B6134 7F083744 2921FFD9 */ slti $at, $t1, -0x27 -/* 0B6138 7F083748 14200003 */ bnez $at, .L7F083758 -/* 0B613C 7F08374C 00000000 */ nop -/* 0B6140 7F083750 AD000110 */ sw $zero, 0x110($t0) -/* 0B6144 7F083754 8E080000 */ lw $t0, ($s0) -.L7F083758: -/* 0B6148 7F083758 8DCE1998 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B614C 7F08375C C7AA0184 */ lwc1 $f10, 0x184($sp) -/* 0B6150 7F083760 55C0005F */ bnezl $t6, .L7F0838E0 -/* 0B6154 7F083764 8D180104 */ lw $t8, 0x104($t0) -/* 0B6158 7F083768 460AA03C */ c.lt.s $f20, $f10 -/* 0B615C 7F08376C C7A60180 */ lwc1 $f6, 0x180($sp) -/* 0B6160 7F083770 45030006 */ bc1tl .L7F08378C -/* 0B6164 7F083774 AD000104 */ sw $zero, 0x104($t0) -/* 0B6168 7F083778 4606A03C */ c.lt.s $f20, $f6 -/* 0B616C 7F08377C 8FAB0140 */ lw $t3, 0x140($sp) -/* 0B6170 7F083780 45000009 */ bc1f .L7F0837A8 -/* 0B6174 7F083784 00000000 */ nop -/* 0B6178 7F083788 AD000104 */ sw $zero, 0x104($t0) -.L7F08378C: -/* 0B617C 7F08378C 8E190000 */ lw $t9, ($s0) -/* 0B6180 7F083790 240F0001 */ li $t7, 1 -/* 0B6184 7F083794 AF2F010C */ sw $t7, 0x10c($t9) -/* 0B6188 7F083798 8E0A0000 */ lw $t2, ($s0) -/* 0B618C 7F08379C AD400120 */ sw $zero, 0x120($t2) -/* 0B6190 7F0837A0 1000004E */ b .L7F0838DC -/* 0B6194 7F0837A4 8E080000 */ lw $t0, ($s0) -.L7F0837A8: -/* 0B6198 7F0837A8 51600005 */ beql $t3, $zero, .L7F0837C0 -/* 0B619C 7F0837AC 8D0D0118 */ lw $t5, 0x118($t0) -/* 0B61A0 7F0837B0 AD000120 */ sw $zero, 0x120($t0) -/* 0B61A4 7F0837B4 10000047 */ b .L7F0838D4 -/* 0B61A8 7F0837B8 8E080000 */ lw $t0, ($s0) -/* 0B61AC 7F0837BC 8D0D0118 */ lw $t5, 0x118($t0) -.L7F0837C0: -/* 0B61B0 7F0837C0 8FAC01AC */ lw $t4, 0x1ac($sp) -/* 0B61B4 7F0837C4 51A00025 */ beql $t5, $zero, .L7F08385C -/* 0B61B8 7F0837C8 8D0A011C */ lw $t2, 0x11c($t0) -/* 0B61BC 7F0837CC 11800008 */ beqz $t4, .L7F0837F0 -/* 0B61C0 7F0837D0 2921003D */ slti $at, $t1, 0x3d -/* 0B61C4 7F0837D4 10200004 */ beqz $at, .L7F0837E8 -/* 0B61C8 7F0837D8 24180001 */ li $t8, 1 -/* 0B61CC 7F0837DC 2921FFC4 */ slti $at, $t1, -0x3c -/* 0B61D0 7F0837E0 50200004 */ beql $at, $zero, .L7F0837F4 -/* 0B61D4 7F0837E4 8D0E0120 */ lw $t6, 0x120($t0) -.L7F0837E8: -/* 0B61D8 7F0837E8 AD180120 */ sw $t8, 0x120($t0) -/* 0B61DC 7F0837EC 8E080000 */ lw $t0, ($s0) -.L7F0837F0: -/* 0B61E0 7F0837F0 8D0E0120 */ lw $t6, 0x120($t0) -.L7F0837F4: -/* 0B61E4 7F0837F4 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B61E8 7F0837F8 51C00037 */ beql $t6, $zero, .L7F0838D8 -/* 0B61EC 7F0837FC AD00010C */ sw $zero, 0x10c($t0) -/* 0B61F0 7F083800 44814000 */ mtc1 $at, $f8 -/* 0B61F4 7F083804 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B61F8 7F083808 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B61FC 7F08380C 46087480 */ add.s $f18, $f14, $f8 -/* 0B6200 7F083810 4600903C */ c.lt.s $f18, $f0 -/* 0B6204 7F083814 00000000 */ nop -/* 0B6208 7F083818 45030009 */ bc1tl .L7F083840 -/* 0B620C 7F08381C 8D0F0110 */ lw $t7, 0x110($t0) -/* 0B6210 7F083820 44812000 */ mtc1 $at, $f4 -/* 0B6214 7F083824 00000000 */ nop -/* 0B6218 7F083828 46047280 */ add.s $f10, $f14, $f4 -/* 0B621C 7F08382C 460A003C */ c.lt.s $f0, $f10 -/* 0B6220 7F083830 00000000 */ nop -/* 0B6224 7F083834 45020028 */ bc1fl .L7F0838D8 -/* 0B6228 7F083838 AD00010C */ sw $zero, 0x10c($t0) -/* 0B622C 7F08383C 8D0F0110 */ lw $t7, 0x110($t0) -.L7F083840: -/* 0B6230 7F083840 24190001 */ li $t9, 1 -/* 0B6234 7F083844 55E00024 */ bnezl $t7, .L7F0838D8 -/* 0B6238 7F083848 AD00010C */ sw $zero, 0x10c($t0) -/* 0B623C 7F08384C AD190104 */ sw $t9, 0x104($t0) -/* 0B6240 7F083850 10000020 */ b .L7F0838D4 -/* 0B6244 7F083854 8E080000 */ lw $t0, ($s0) -/* 0B6248 7F083858 8D0A011C */ lw $t2, 0x11c($t0) -.L7F08385C: -/* 0B624C 7F08385C 8FAB01AC */ lw $t3, 0x1ac($sp) -/* 0B6250 7F083860 5140001D */ beql $t2, $zero, .L7F0838D8 -/* 0B6254 7F083864 AD00010C */ sw $zero, 0x10c($t0) -/* 0B6258 7F083868 1160001A */ beqz $t3, .L7F0838D4 -/* 0B625C 7F08386C 2921003D */ slti $at, $t1, 0x3d -/* 0B6260 7F083870 10200002 */ beqz $at, .L7F08387C -/* 0B6264 7F083874 2921FFC4 */ slti $at, $t1, -0x3c -/* 0B6268 7F083878 10200016 */ beqz $at, .L7F0838D4 -.L7F08387C: -/* 0B626C 7F08387C 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B6270 7F083880 44813000 */ mtc1 $at, $f6 -/* 0B6274 7F083884 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B6278 7F083888 3C01C120 */ li $at, 0xC1200000 # -10.000000 -/* 0B627C 7F08388C 46067200 */ add.s $f8, $f14, $f6 -/* 0B6280 7F083890 4600403C */ c.lt.s $f8, $f0 -/* 0B6284 7F083894 00000000 */ nop -/* 0B6288 7F083898 45030009 */ bc1tl .L7F0838C0 -/* 0B628C 7F08389C 8D0D0110 */ lw $t5, 0x110($t0) -/* 0B6290 7F0838A0 44819000 */ mtc1 $at, $f18 -/* 0B6294 7F0838A4 00000000 */ nop -/* 0B6298 7F0838A8 46127100 */ add.s $f4, $f14, $f18 -/* 0B629C 7F0838AC 4604003C */ c.lt.s $f0, $f4 -/* 0B62A0 7F0838B0 00000000 */ nop -/* 0B62A4 7F0838B4 45020008 */ bc1fl .L7F0838D8 -/* 0B62A8 7F0838B8 AD00010C */ sw $zero, 0x10c($t0) -/* 0B62AC 7F0838BC 8D0D0110 */ lw $t5, 0x110($t0) -.L7F0838C0: -/* 0B62B0 7F0838C0 240C0001 */ li $t4, 1 -/* 0B62B4 7F0838C4 55A00004 */ bnezl $t5, .L7F0838D8 -/* 0B62B8 7F0838C8 AD00010C */ sw $zero, 0x10c($t0) -/* 0B62BC 7F0838CC AD0C0104 */ sw $t4, 0x104($t0) -/* 0B62C0 7F0838D0 8E080000 */ lw $t0, ($s0) -.L7F0838D4: -/* 0B62C4 7F0838D4 AD00010C */ sw $zero, 0x10c($t0) -.L7F0838D8: -/* 0B62C8 7F0838D8 8E080000 */ lw $t0, ($s0) -.L7F0838DC: -/* 0B62CC 7F0838DC 8D180104 */ lw $t8, 0x104($t0) -.L7F0838E0: -/* 0B62D0 7F0838E0 3C0E8003 */ lui $t6, %hi(in_tank_flag) # $t6, 0x8003 -/* 0B62D4 7F0838E4 8FAA01A0 */ lw $t2, 0x1a0($sp) -/* 0B62D8 7F0838E8 1300004A */ beqz $t8, .L7F083A14 -/* 0B62DC 7F0838EC 00000000 */ nop -/* 0B62E0 7F0838F0 8DCE1998 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0B62E4 7F0838F4 55C000BB */ bnezl $t6, .L7F083BE4 -/* 0B62E8 7F0838F8 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B62EC 7F0838FC C5020160 */ lwc1 $f2, 0x160($t0) -/* 0B62F0 7F083900 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B62F4 7F083904 44813000 */ mtc1 $at, $f6 -/* 0B62F8 7F083908 46021282 */ mul.s $f10, $f2, $f2 -/* 0B62FC 7F08390C 3C018005 */ lui $at, %hi(D_80055148) # $at, 0x8005 -/* 0B6300 7F083910 C432AD18 */ lwc1 $f18, %lo(D_80055148)($at) -/* 0B6304 7F083914 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B6308 7F083918 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B630C 7F08391C 46065202 */ mul.s $f8, $f10, $f6 -/* 0B6310 7F083920 46124303 */ div.s $f12, $f8, $f18 -/* 0B6314 7F083924 460C7100 */ add.s $f4, $f14, $f12 -/* 0B6318 7F083928 4600203C */ c.lt.s $f4, $f0 -/* 0B631C 7F08392C 00000000 */ nop -/* 0B6320 7F083930 45020007 */ bc1fl .L7F083950 -/* 0B6324 7F083934 460C7281 */ sub.s $f10, $f14, $f12 -/* 0B6328 7F083938 44816000 */ mtc1 $at, $f12 -/* 0B632C 7F08393C 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B6330 7F083940 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B6334 7F083944 10000010 */ b .L7F083988 -/* 0B6338 7F083948 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B633C 7F08394C 460C7281 */ sub.s $f10, $f14, $f12 -.L7F083950: -/* 0B6340 7F083950 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6344 7F083954 460A003C */ c.lt.s $f0, $f10 -/* 0B6348 7F083958 00000000 */ nop -/* 0B634C 7F08395C 45020007 */ bc1fl .L7F08397C -/* 0B6350 7F083960 4600A306 */ mov.s $f12, $f20 -/* 0B6354 7F083964 44816000 */ mtc1 $at, $f12 -/* 0B6358 7F083968 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B635C 7F08396C E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B6360 7F083970 10000005 */ b .L7F083988 -/* 0B6364 7F083974 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -/* 0B6368 7F083978 4600A306 */ mov.s $f12, $f20 -.L7F08397C: -/* 0B636C 7F08397C 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B6370 7F083980 E7AE00C4 */ swc1 $f14, 0xc4($sp) -/* 0B6374 7F083984 C7AE00C4 */ lwc1 $f14, 0xc4($sp) -.L7F083988: -/* 0B6378 7F083988 8E080000 */ lw $t0, ($s0) -/* 0B637C 7F08398C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # -0.000000 -/* 0B6380 7F083990 C4281004 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0B6384 7F083994 C5060160 */ lwc1 $f6, 0x160($t0) -/* 0B6388 7F083998 C5000158 */ lwc1 $f0, 0x158($t0) -/* 0B638C 7F08399C 46083082 */ mul.s $f2, $f6, $f8 -/* 0B6390 7F0839A0 4600703C */ c.lt.s $f14, $f0 -/* 0B6394 7F0839A4 46021480 */ add.s $f18, $f2, $f2 -/* 0B6398 7F0839A8 45000007 */ bc1f .L7F0839C8 -/* 0B639C 7F0839AC 46120300 */ add.s $f12, $f0, $f18 -/* 0B63A0 7F0839B0 460C703C */ c.lt.s $f14, $f12 -/* 0B63A4 7F0839B4 00000000 */ nop -/* 0B63A8 7F0839B8 45020004 */ bc1fl .L7F0839CC -/* 0B63AC 7F0839BC 460E003C */ c.lt.s $f0, $f14 -/* 0B63B0 7F0839C0 10000087 */ b .L7F083BE0 -/* 0B63B4 7F0839C4 E50C0158 */ swc1 $f12, 0x158($t0) -.L7F0839C8: -/* 0B63B8 7F0839C8 460E003C */ c.lt.s $f0, $f14 -.L7F0839CC: -/* 0B63BC 7F0839CC 00000000 */ nop -/* 0B63C0 7F0839D0 45020008 */ bc1fl .L7F0839F4 -/* 0B63C4 7F0839D4 E50E0158 */ swc1 $f14, 0x158($t0) -/* 0B63C8 7F0839D8 460E603C */ c.lt.s $f12, $f14 -/* 0B63CC 7F0839DC 00000000 */ nop -/* 0B63D0 7F0839E0 45020004 */ bc1fl .L7F0839F4 -/* 0B63D4 7F0839E4 E50E0158 */ swc1 $f14, 0x158($t0) -/* 0B63D8 7F0839E8 1000007D */ b .L7F083BE0 -/* 0B63DC 7F0839EC E50C0158 */ swc1 $f12, 0x158($t0) -/* 0B63E0 7F0839F0 E50E0158 */ swc1 $f14, 0x158($t0) -.L7F0839F4: -/* 0B63E4 7F0839F4 8E0F0000 */ lw $t7, ($s0) -/* 0B63E8 7F0839F8 E5F40160 */ swc1 $f20, 0x160($t7) -/* 0B63EC 7F0839FC 8E080000 */ lw $t0, ($s0) -/* 0B63F0 7F083A00 8D19010C */ lw $t9, 0x10c($t0) -/* 0B63F4 7F083A04 57200077 */ bnezl $t9, .L7F083BE4 -/* 0B63F8 7F083A08 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B63FC 7F083A0C 10000074 */ b .L7F083BE0 -/* 0B6400 7F083A10 AD000104 */ sw $zero, 0x104($t0) -.L7F083A14: -/* 0B6404 7F083A14 1140002E */ beqz $t2, .L7F083AD0 -/* 0B6408 7F083A18 C7B20184 */ lwc1 $f18, 0x184($sp) -/* 0B640C 7F083A1C 0C00100B */ jal viGetFovY -/* 0B6410 7F083A20 00000000 */ nop -/* 0B6414 7F083A24 8FAB0128 */ lw $t3, 0x128($sp) -/* 0B6418 7F083A28 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B641C 7F083A2C 44812000 */ mtc1 $at, $f4 -/* 0B6420 7F083A30 448B5000 */ mtc1 $t3, $f10 -/* 0B6424 7F083A34 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B6428 7F083A38 44814000 */ mtc1 $at, $f8 -/* 0B642C 7F083A3C 468051A0 */ cvt.s.w $f6, $f10 -/* 0B6430 7F083A40 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6434 7F083A44 44819000 */ mtc1 $at, $f18 -/* 0B6438 7F083A48 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B643C 7F083A4C 46040383 */ div.s $f14, $f0, $f4 -/* 0B6440 7F083A50 46083303 */ div.s $f12, $f6, $f8 -/* 0B6444 7F083A54 460C903C */ c.lt.s $f18, $f12 -/* 0B6448 7F083A58 46006086 */ mov.s $f2, $f12 -/* 0B644C 7F083A5C 45020006 */ bc1fl .L7F083A78 -/* 0B6450 7F083A60 44812000 */ mtc1 $at, $f4 -/* 0B6454 7F083A64 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B6458 7F083A68 44811000 */ mtc1 $at, $f2 -/* 0B645C 7F083A6C 1000000A */ b .L7F083A98 -/* 0B6460 7F083A70 4602A03E */ c.le.s $f20, $f2 -/* 0B6464 7F083A74 44812000 */ mtc1 $at, $f4 -.L7F083A78: -/* 0B6468 7F083A78 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B646C 7F083A7C 4604603C */ c.lt.s $f12, $f4 -/* 0B6470 7F083A80 00000000 */ nop -/* 0B6474 7F083A84 45020004 */ bc1fl .L7F083A98 -/* 0B6478 7F083A88 4602A03E */ c.le.s $f20, $f2 -/* 0B647C 7F083A8C 44811000 */ mtc1 $at, $f2 -/* 0B6480 7F083A90 00000000 */ nop -/* 0B6484 7F083A94 4602A03E */ c.le.s $f20, $f2 -.L7F083A98: -/* 0B6488 7F083A98 00000000 */ nop -/* 0B648C 7F083A9C 45020005 */ bc1fl .L7F083AB4 -/* 0B6490 7F083AA0 46001287 */ neg.s $f10, $f2 -/* 0B6494 7F083AA4 46021082 */ mul.s $f2, $f2, $f2 -/* 0B6498 7F083AA8 10000005 */ b .L7F083AC0 -/* 0B649C 7F083AAC 46001187 */ neg.s $f6, $f2 -/* 0B64A0 7F083AB0 46001287 */ neg.s $f10, $f2 -.L7F083AB4: -/* 0B64A4 7F083AB4 460A1082 */ mul.s $f2, $f2, $f10 -/* 0B64A8 7F083AB8 00000000 */ nop -/* 0B64AC 7F083ABC 46001187 */ neg.s $f6, $f2 -.L7F083AC0: -/* 0B64B0 7F083AC0 8E0D0000 */ lw $t5, ($s0) -/* 0B64B4 7F083AC4 460E3202 */ mul.s $f8, $f6, $f14 -/* 0B64B8 7F083AC8 10000027 */ b .L7F083B68 -/* 0B64BC 7F083ACC E5A80160 */ swc1 $f8, 0x160($t5) -.L7F083AD0: -/* 0B64C0 7F083AD0 4612A03C */ c.lt.s $f20, $f18 -/* 0B64C4 7F083AD4 C7A40180 */ lwc1 $f4, 0x180($sp) -/* 0B64C8 7F083AD8 45020010 */ bc1fl .L7F083B1C -/* 0B64CC 7F083ADC 4604A03C */ c.lt.s $f20, $f4 -/* 0B64D0 7F083AE0 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B64D4 7F083AE4 46009306 */ mov.s $f12, $f18 -/* 0B64D8 7F083AE8 8FAC01AC */ lw $t4, 0x1ac($sp) -/* 0B64DC 7F083AEC 8FB80120 */ lw $t8, 0x120($sp) -/* 0B64E0 7F083AF0 1180001D */ beqz $t4, .L7F083B68 -/* 0B64E4 7F083AF4 2B01003D */ slti $at, $t8, 0x3d -/* 0B64E8 7F083AF8 10200003 */ beqz $at, .L7F083B08 -/* 0B64EC 7F083AFC 2B01003C */ slti $at, $t8, 0x3c -/* 0B64F0 7F083B00 5020001A */ beql $at, $zero, .L7F083B6C -/* 0B64F4 7F083B04 8E080000 */ lw $t0, ($s0) -.L7F083B08: -/* 0B64F8 7F083B08 8E0F0000 */ lw $t7, ($s0) -/* 0B64FC 7F083B0C 240E0001 */ li $t6, 1 -/* 0B6500 7F083B10 10000015 */ b .L7F083B68 -/* 0B6504 7F083B14 ADEE0110 */ sw $t6, 0x110($t7) -/* 0B6508 7F083B18 4604A03C */ c.lt.s $f20, $f4 -.L7F083B1C: -/* 0B650C 7F083B1C 00000000 */ nop -/* 0B6510 7F083B20 4500000F */ bc1f .L7F083B60 -/* 0B6514 7F083B24 00000000 */ nop -/* 0B6518 7F083B28 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B651C 7F083B2C 46002307 */ neg.s $f12, $f4 -/* 0B6520 7F083B30 8FB901AC */ lw $t9, 0x1ac($sp) -/* 0B6524 7F083B34 8FAA0120 */ lw $t2, 0x120($sp) -/* 0B6528 7F083B38 1320000B */ beqz $t9, .L7F083B68 -/* 0B652C 7F083B3C 2941003D */ slti $at, $t2, 0x3d -/* 0B6530 7F083B40 10200003 */ beqz $at, .L7F083B50 -/* 0B6534 7F083B44 2941003C */ slti $at, $t2, 0x3c -/* 0B6538 7F083B48 50200008 */ beql $at, $zero, .L7F083B6C -/* 0B653C 7F083B4C 8E080000 */ lw $t0, ($s0) -.L7F083B50: -/* 0B6540 7F083B50 8E0D0000 */ lw $t5, ($s0) -/* 0B6544 7F083B54 240B0001 */ li $t3, 1 -/* 0B6548 7F083B58 10000003 */ b .L7F083B68 -/* 0B654C 7F083B5C ADAB0110 */ sw $t3, 0x110($t5) -.L7F083B60: -/* 0B6550 7F083B60 0FC2002D */ jal bondviewCurrentPlayerUpdateSpeedVerta -/* 0B6554 7F083B64 4600A306 */ mov.s $f12, $f20 -.L7F083B68: -/* 0B6558 7F083B68 8E080000 */ lw $t0, ($s0) -.L7F083B6C: -/* 0B655C 7F083B6C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # -0.000000 -/* 0B6560 7F083B70 C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B6564 7F083B74 C50A0160 */ lwc1 $f10, 0x160($t0) -/* 0B6568 7F083B78 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B656C 7F083B7C 44819000 */ mtc1 $at, $f18 -/* 0B6570 7F083B80 46065202 */ mul.s $f8, $f10, $f6 -/* 0B6574 7F083B84 C50A0158 */ lwc1 $f10, 0x158($t0) -/* 0B6578 7F083B88 3C0C8003 */ lui $t4, %hi(in_tank_flag) # $t4, 0x8003 -/* 0B657C 7F083B8C 24010001 */ li $at, 1 -/* 0B6580 7F083B90 3C188007 */ lui $t8, %hi(g_EnterTankAudioState) # $t8, 0x8007 -/* 0B6584 7F083B94 46124102 */ mul.s $f4, $f8, $f18 -/* 0B6588 7F083B98 46045180 */ add.s $f6, $f10, $f4 -/* 0B658C 7F083B9C E5060158 */ swc1 $f6, 0x158($t0) -/* 0B6590 7F083BA0 8D8C1998 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B6594 7F083BA4 5581000F */ bnel $t4, $at, .L7F083BE4 -/* 0B6598 7F083BA8 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B659C 7F083BAC 8F188498 */ lw $t8, %lo(g_EnterTankAudioState)($t8) -/* 0B65A0 7F083BB0 24010002 */ li $at, 2 -/* 0B65A4 7F083BB4 5701000B */ bnel $t8, $at, .L7F083BE4 -/* 0B65A8 7F083BB8 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B65AC 7F083BBC 8E080000 */ lw $t0, ($s0) -/* 0B65B0 7F083BC0 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B65B4 7F083BC4 44810000 */ mtc1 $at, $f0 -/* 0B65B8 7F083BC8 C5080158 */ lwc1 $f8, 0x158($t0) -/* 0B65BC 7F083BCC 4600403C */ c.lt.s $f8, $f0 -/* 0B65C0 7F083BD0 00000000 */ nop -/* 0B65C4 7F083BD4 45020003 */ bc1fl .L7F083BE4 -/* 0B65C8 7F083BD8 8FAE01A4 */ lw $t6, 0x1a4($sp) -/* 0B65CC 7F083BDC E5000158 */ swc1 $f0, 0x158($t0) -.L7F083BE0: -/* 0B65D0 7F083BE0 8FAE01A4 */ lw $t6, 0x1a4($sp) -.L7F083BE4: -/* 0B65D4 7F083BE4 C7A6017C */ lwc1 $f6, 0x17c($sp) -/* 0B65D8 7F083BE8 51C0002A */ beql $t6, $zero, .L7F083C94 -/* 0B65DC 7F083BEC 4606A03C */ c.lt.s $f20, $f6 -/* 0B65E0 7F083BF0 0C00100B */ jal viGetFovY -/* 0B65E4 7F083BF4 00000000 */ nop -/* 0B65E8 7F083BF8 8FAF012C */ lw $t7, 0x12c($sp) -/* 0B65EC 7F083BFC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B65F0 7F083C00 44817000 */ mtc1 $at, $f14 -/* 0B65F4 7F083C04 448F9000 */ mtc1 $t7, $f18 -/* 0B65F8 7F083C08 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 0B65FC 7F083C0C 44812000 */ mtc1 $at, $f4 -/* 0B6600 7F083C10 468092A0 */ cvt.s.w $f10, $f18 -/* 0B6604 7F083C14 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6608 7F083C18 46045303 */ div.s $f12, $f10, $f4 -/* 0B660C 7F083C1C 460C703C */ c.lt.s $f14, $f12 -/* 0B6610 7F083C20 46006086 */ mov.s $f2, $f12 -/* 0B6614 7F083C24 45020004 */ bc1fl .L7F083C38 -/* 0B6618 7F083C28 44813000 */ mtc1 $at, $f6 -/* 0B661C 7F083C2C 10000009 */ b .L7F083C54 -/* 0B6620 7F083C30 46007086 */ mov.s $f2, $f14 -/* 0B6624 7F083C34 44813000 */ mtc1 $at, $f6 -.L7F083C38: -/* 0B6628 7F083C38 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B662C 7F083C3C 4606603C */ c.lt.s $f12, $f6 -/* 0B6630 7F083C40 00000000 */ nop -/* 0B6634 7F083C44 45020004 */ bc1fl .L7F083C58 -/* 0B6638 7F083C48 4602A03E */ c.le.s $f20, $f2 -/* 0B663C 7F083C4C 44811000 */ mtc1 $at, $f2 -/* 0B6640 7F083C50 00000000 */ nop -.L7F083C54: -/* 0B6644 7F083C54 4602A03E */ c.le.s $f20, $f2 -.L7F083C58: -/* 0B6648 7F083C58 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B664C 7F083C5C 44819000 */ mtc1 $at, $f18 -/* 0B6650 7F083C60 45000004 */ bc1f .L7F083C74 -/* 0B6654 7F083C64 46120283 */ div.s $f10, $f0, $f18 -/* 0B6658 7F083C68 46021082 */ mul.s $f2, $f2, $f2 -/* 0B665C 7F083C6C 10000004 */ b .L7F083C80 -/* 0B6660 7F083C70 00000000 */ nop -.L7F083C74: -/* 0B6664 7F083C74 46001207 */ neg.s $f8, $f2 -/* 0B6668 7F083C78 46081082 */ mul.s $f2, $f2, $f8 -/* 0B666C 7F083C7C 00000000 */ nop -.L7F083C80: -/* 0B6670 7F083C80 460A1102 */ mul.s $f4, $f2, $f10 -/* 0B6674 7F083C84 8E190000 */ lw $t9, ($s0) -/* 0B6678 7F083C88 1000001A */ b .L7F083CF4 -/* 0B667C 7F083C8C E724014C */ swc1 $f4, 0x14c($t9) -/* 0B6680 7F083C90 4606A03C */ c.lt.s $f20, $f6 -.L7F083C94: -/* 0B6684 7F083C94 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0B6688 7F083C98 45020008 */ bc1fl .L7F083CBC -/* 0B668C 7F083C9C 4608A03C */ c.lt.s $f20, $f8 -/* 0B6690 7F083CA0 0FC200DA */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B6694 7F083CA4 46003306 */ mov.s $f12, $f6 -/* 0B6698 7F083CA8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B669C 7F083CAC 44817000 */ mtc1 $at, $f14 -/* 0B66A0 7F083CB0 10000010 */ b .L7F083CF4 -/* 0B66A4 7F083CB4 00000000 */ nop -/* 0B66A8 7F083CB8 4608A03C */ c.lt.s $f20, $f8 -.L7F083CBC: -/* 0B66AC 7F083CBC 00000000 */ nop -/* 0B66B0 7F083CC0 45000007 */ bc1f .L7F083CE0 -/* 0B66B4 7F083CC4 00000000 */ nop -/* 0B66B8 7F083CC8 0FC200DA */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B66BC 7F083CCC 46004307 */ neg.s $f12, $f8 -/* 0B66C0 7F083CD0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B66C4 7F083CD4 44817000 */ mtc1 $at, $f14 -/* 0B66C8 7F083CD8 10000006 */ b .L7F083CF4 -/* 0B66CC 7F083CDC 00000000 */ nop -.L7F083CE0: -/* 0B66D0 7F083CE0 0FC200DA */ jal bondviewCurrentPlayerUpdateSpeedTheta -/* 0B66D4 7F083CE4 4600A306 */ mov.s $f12, $f20 -/* 0B66D8 7F083CE8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B66DC 7F083CEC 44817000 */ mtc1 $at, $f14 -/* 0B66E0 7F083CF0 00000000 */ nop -.L7F083CF4: -/* 0B66E4 7F083CF4 3C0A8003 */ lui $t2, %hi(in_tank_flag) # $t2, 0x8003 -/* 0B66E8 7F083CF8 8D4A1998 */ lw $t2, %lo(in_tank_flag)($t2) -/* 0B66EC 7F083CFC 24010001 */ li $at, 1 -/* 0B66F0 7F083D00 3C0B8007 */ lui $t3, %hi(g_EnterTankAudioState) # $t3, 0x8007 -/* 0B66F4 7F083D04 5541004B */ bnel $t2, $at, .L7F083E34 -/* 0B66F8 7F083D08 8FAE014C */ lw $t6, 0x14c($sp) -/* 0B66FC 7F083D0C 8D6B8498 */ lw $t3, %lo(g_EnterTankAudioState)($t3) -/* 0B6700 7F083D10 24010002 */ li $at, 2 -/* 0B6704 7F083D14 8FAD01A4 */ lw $t5, 0x1a4($sp) -/* 0B6708 7F083D18 55610044 */ bnel $t3, $at, .L7F083E2C -/* 0B670C 7F083D1C 8E180000 */ lw $t8, ($s0) -/* 0B6710 7F083D20 11A00008 */ beqz $t5, .L7F083D44 -/* 0B6714 7F083D24 4600A086 */ mov.s $f2, $f20 -/* 0B6718 7F083D28 8E0C0000 */ lw $t4, ($s0) -/* 0B671C 7F083D2C 3C018005 */ lui $at, %hi(D_8005514C) # $at, 0x8005 -/* 0B6720 7F083D30 C42AAD1C */ lwc1 $f10, %lo(D_8005514C)($at) -/* 0B6724 7F083D34 C592014C */ lwc1 $f18, 0x14c($t4) -/* 0B6728 7F083D38 460A9082 */ mul.s $f2, $f18, $f10 -/* 0B672C 7F083D3C 10000019 */ b .L7F083DA4 -/* 0B6730 7F083D40 00000000 */ nop -.L7F083D44: -/* 0B6734 7F083D44 C7A4017C */ lwc1 $f4, 0x17c($sp) -/* 0B6738 7F083D48 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0B673C 7F083D4C 4604A03C */ c.lt.s $f20, $f4 -/* 0B6740 7F083D50 00000000 */ nop -/* 0B6744 7F083D54 45020009 */ bc1fl .L7F083D7C -/* 0B6748 7F083D58 4608A03C */ c.lt.s $f20, $f8 -/* 0B674C 7F083D5C 0FC200B3 */ jal sub_GAME_7F080228 -/* 0B6750 7F083D60 46007306 */ mov.s $f12, $f14 -/* 0B6754 7F083D64 3C018005 */ lui $at, %hi(D_80055150) # $at, 0x8005 -/* 0B6758 7F083D68 C426AD20 */ lwc1 $f6, %lo(D_80055150)($at) -/* 0B675C 7F083D6C 46060082 */ mul.s $f2, $f0, $f6 -/* 0B6760 7F083D70 1000000C */ b .L7F083DA4 -/* 0B6764 7F083D74 00000000 */ nop -/* 0B6768 7F083D78 4608A03C */ c.lt.s $f20, $f8 -.L7F083D7C: -/* 0B676C 7F083D7C 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6770 7F083D80 45000008 */ bc1f .L7F083DA4 -/* 0B6774 7F083D84 00000000 */ nop -/* 0B6778 7F083D88 44816000 */ mtc1 $at, $f12 -/* 0B677C 7F083D8C 0FC200B3 */ jal sub_GAME_7F080228 -/* 0B6780 7F083D90 00000000 */ nop -/* 0B6784 7F083D94 3C018005 */ lui $at, %hi(D_80055154) # $at, 0x8005 -/* 0B6788 7F083D98 C432AD24 */ lwc1 $f18, %lo(D_80055154)($at) -/* 0B678C 7F083D9C 46120082 */ mul.s $f2, $f0, $f18 -/* 0B6790 7F083DA0 00000000 */ nop -.L7F083DA4: -/* 0B6794 7F083DA4 3C038004 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8004 -/* 0B6798 7F083DA8 8C630FF4 */ lw $v1, %lo(g_ClockTimer)($v1) -/* 0B679C 7F083DAC 00001025 */ move $v0, $zero -/* 0B67A0 7F083DB0 8E080000 */ lw $t0, ($s0) -/* 0B67A4 7F083DB4 18600014 */ blez $v1, .L7F083E08 -/* 0B67A8 7F083DB8 3C018005 */ lui $at, %hi(D_80055158) # $at, 0x8005 -/* 0B67AC 7F083DBC 3C048003 */ lui $a0, %hi(g_TankTurnSpeed) # $a0, 0x8003 -/* 0B67B0 7F083DC0 248419B0 */ addiu $a0, %lo(g_TankTurnSpeed) # addiu $a0, $a0, 0x19b0 -/* 0B67B4 7F083DC4 C420AD28 */ lwc1 $f0, %lo(D_80055158)($at) -/* 0B67B8 7F083DC8 C4920000 */ lwc1 $f18, ($a0) -/* 0B67BC 7F083DCC 24420001 */ addiu $v0, $v0, 1 -/* 0B67C0 7F083DD0 0043082A */ slt $at, $v0, $v1 -/* 0B67C4 7F083DD4 46120502 */ mul.s $f20, $f0, $f18 -/* 0B67C8 7F083DD8 5020000A */ beql $at, $zero, .L7F083E04 -/* 0B67CC 7F083DDC 4602A480 */ add.s $f18, $f20, $f2 -/* 0B67D0 7F083DE0 4602A480 */ add.s $f18, $f20, $f2 -.L7F083DE4: -/* 0B67D4 7F083DE4 24420001 */ addiu $v0, $v0, 1 -/* 0B67D8 7F083DE8 0043082A */ slt $at, $v0, $v1 -/* 0B67DC 7F083DEC E4920000 */ swc1 $f18, ($a0) -/* 0B67E0 7F083DF0 C4920000 */ lwc1 $f18, ($a0) -/* 0B67E4 7F083DF4 46120502 */ mul.s $f20, $f0, $f18 -/* 0B67E8 7F083DF8 5420FFFA */ bnezl $at, .L7F083DE4 -/* 0B67EC 7F083DFC 4602A480 */ add.s $f18, $f20, $f2 -/* 0B67F0 7F083E00 4602A480 */ add.s $f18, $f20, $f2 -.L7F083E04: -/* 0B67F4 7F083E04 E4920000 */ swc1 $f18, ($a0) -.L7F083E08: -/* 0B67F8 7F083E08 3C048003 */ lui $a0, %hi(g_TankTurnSpeed) # $a0, 0x8003 -/* 0B67FC 7F083E0C 248419B0 */ addiu $a0, %lo(g_TankTurnSpeed) # addiu $a0, $a0, 0x19b0 -/* 0B6800 7F083E10 3C018005 */ lui $at, %hi(D_8005515C) # $at, 0x8005 -/* 0B6804 7F083E14 C432AD2C */ lwc1 $f18, %lo(D_8005515C)($at) -/* 0B6808 7F083E18 C4880000 */ lwc1 $f8, ($a0) -/* 0B680C 7F083E1C 46124282 */ mul.s $f10, $f8, $f18 -/* 0B6810 7F083E20 10000003 */ b .L7F083E30 -/* 0B6814 7F083E24 E50A014C */ swc1 $f10, 0x14c($t0) -/* 0B6818 7F083E28 8E180000 */ lw $t8, ($s0) -.L7F083E2C: -/* 0B681C 7F083E2C E714014C */ swc1 $f20, 0x14c($t8) -.L7F083E30: -/* 0B6820 7F083E30 8FAE014C */ lw $t6, 0x14c($sp) -.L7F083E34: -/* 0B6824 7F083E34 51C00007 */ beql $t6, $zero, .L7F083E54 -/* 0B6828 7F083E38 240A0001 */ li $t2, 1 -/* 0B682C 7F083E3C 8E0F0000 */ lw $t7, ($s0) -/* 0B6830 7F083E40 ADE0088C */ sw $zero, 0x88c($t7) -/* 0B6834 7F083E44 8E190000 */ lw $t9, ($s0) -/* 0B6838 7F083E48 0FC1473E */ jal trigger_remote_mine_detonation -/* 0B683C 7F083E4C AF200890 */ sw $zero, 0x890($t9) -/* 0B6840 7F083E50 240A0001 */ li $t2, 1 -.L7F083E54: -/* 0B6844 7F083E54 0FC26669 */ jal getPlayerCount -/* 0B6848 7F083E58 AFAA0074 */ sw $t2, 0x74($sp) -/* 0B684C 7F083E5C 28410002 */ slti $at, $v0, 2 -/* 0B6850 7F083E60 5420000C */ bnezl $at, .L7F083E94 -/* 0B6854 7F083E64 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B6858 7F083E68 0FC051B2 */ jal get_scenario -/* 0B685C 7F083E6C 00000000 */ nop -/* 0B6860 7F083E70 24010002 */ li $at, 2 -/* 0B6864 7F083E74 54410007 */ bnel $v0, $at, .L7F083E94 -/* 0B6868 7F083E78 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B686C 7F083E7C 0FC234D9 */ jal bondinvIsAliveWithFlag -/* 0B6870 7F083E80 00000000 */ nop -/* 0B6874 7F083E84 50400003 */ beql $v0, $zero, .L7F083E94 -/* 0B6878 7F083E88 8FAB0074 */ lw $t3, 0x74($sp) -/* 0B687C 7F083E8C AFA00074 */ sw $zero, 0x74($sp) -/* 0B6880 7F083E90 8FAB0074 */ lw $t3, 0x74($sp) -.L7F083E94: -/* 0B6884 7F083E94 5160000C */ beql $t3, $zero, .L7F083EC8 -/* 0B6888 7F083E98 8FB801BC */ lw $t8, 0x1bc($sp) -/* 0B688C 7F083E9C 8FAD0174 */ lw $t5, 0x174($sp) -/* 0B6890 7F083EA0 51A00004 */ beql $t5, $zero, .L7F083EB4 -/* 0B6894 7F083EA4 8FAC0170 */ lw $t4, 0x170($sp) -/* 0B6898 7F083EA8 0FC17708 */ jal backstep_through_inventory -/* 0B689C 7F083EAC 00000000 */ nop -/* 0B68A0 7F083EB0 8FAC0170 */ lw $t4, 0x170($sp) -.L7F083EB4: -/* 0B68A4 7F083EB4 51800004 */ beql $t4, $zero, .L7F083EC8 -/* 0B68A8 7F083EB8 8FB801BC */ lw $t8, 0x1bc($sp) -/* 0B68AC 7F083EBC 0FC176E2 */ jal advance_through_inventory -/* 0B68B0 7F083EC0 00000000 */ nop -/* 0B68B4 7F083EC4 8FB801BC */ lw $t8, 0x1bc($sp) -.L7F083EC8: -/* 0B68B8 7F083EC8 53000005 */ beql $t8, $zero, .L7F083EE0 -/* 0B68BC 7F083ECC 8FAF01B8 */ lw $t7, 0x1b8($sp) -/* 0B68C0 7F083ED0 8E0E0000 */ lw $t6, ($s0) -/* 0B68C4 7F083ED4 10000007 */ b .L7F083EF4 -/* 0B68C8 7F083ED8 ADC00430 */ sw $zero, 0x430($t6) -/* 0B68CC 7F083EDC 8FAF01B8 */ lw $t7, 0x1b8($sp) -.L7F083EE0: -/* 0B68D0 7F083EE0 51E00005 */ beql $t7, $zero, .L7F083EF8 -/* 0B68D4 7F083EE4 8E0B0000 */ lw $t3, ($s0) -/* 0B68D8 7F083EE8 8E0A0000 */ lw $t2, ($s0) -/* 0B68DC 7F083EEC 24190002 */ li $t9, 2 -/* 0B68E0 7F083EF0 AD590430 */ sw $t9, 0x430($t2) -.L7F083EF4: -/* 0B68E4 7F083EF4 8E0B0000 */ lw $t3, ($s0) -.L7F083EF8: -/* 0B68E8 7F083EF8 8D620430 */ lw $v0, 0x430($t3) -/* 0B68EC 7F083EFC 54400042 */ bnezl $v0, .L7F084008 -/* 0B68F0 7F083F00 24010002 */ li $at, 2 -/* 0B68F4 7F083F04 0FC1A093 */ jal sub_GAME_7F067AA4 -/* 0B68F8 7F083F08 00002025 */ move $a0, $zero -/* 0B68FC 7F083F0C 8FAD0148 */ lw $t5, 0x148($sp) -/* 0B6900 7F083F10 51A00015 */ beql $t5, $zero, .L7F083F68 -/* 0B6904 7F083F14 8E0F0000 */ lw $t7, ($s0) -/* 0B6908 7F083F18 0FC1F1DF */ jal redirect_get_BONDdata_autoaim_x -/* 0B690C 7F083F1C 00000000 */ nop -/* 0B6910 7F083F20 50400011 */ beql $v0, $zero, .L7F083F68 -/* 0B6914 7F083F24 8E0F0000 */ lw $t7, ($s0) -/* 0B6918 7F083F28 8E0C0000 */ lw $t4, ($s0) -/* 0B691C 7F083F2C 8D980140 */ lw $t8, 0x140($t4) -/* 0B6920 7F083F30 5300000D */ beql $t8, $zero, .L7F083F68 -/* 0B6924 7F083F34 8E0F0000 */ lw $t7, ($s0) -/* 0B6928 7F083F38 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B692C 7F083F3C 00002025 */ move $a0, $zero -/* 0B6930 7F083F40 00402025 */ move $a0, $v0 -/* 0B6934 7F083F44 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B6938 7F083F48 24050008 */ li $a1, 8 -/* 0B693C 7F083F4C 50400006 */ beql $v0, $zero, .L7F083F68 -/* 0B6940 7F083F50 8E0F0000 */ lw $t7, ($s0) -/* 0B6944 7F083F54 8E0E0000 */ lw $t6, ($s0) -/* 0B6948 7F083F58 C5C4013C */ lwc1 $f4, 0x13c($t6) -/* 0B694C 7F083F5C 10000007 */ b .L7F083F7C -/* 0B6950 7F083F60 E7A40070 */ swc1 $f4, 0x70($sp) -/* 0B6954 7F083F64 8E0F0000 */ lw $t7, ($s0) -.L7F083F68: -/* 0B6958 7F083F68 3C018005 */ lui $at, %hi(D_80055160) # $at, 0x8005 -/* 0B695C 7F083F6C C428AD30 */ lwc1 $f8, %lo(D_80055160)($at) -/* 0B6960 7F083F70 C5E6014C */ lwc1 $f6, 0x14c($t7) -/* 0B6964 7F083F74 46083482 */ mul.s $f18, $f6, $f8 -/* 0B6968 7F083F78 E7B20070 */ swc1 $f18, 0x70($sp) -.L7F083F7C: -/* 0B696C 7F083F7C 8FB90148 */ lw $t9, 0x148($sp) -/* 0B6970 7F083F80 53200014 */ beql $t9, $zero, .L7F083FD4 -/* 0B6974 7F083F84 8E0C0000 */ lw $t4, ($s0) -/* 0B6978 7F083F88 0FC1F1A5 */ jal redirect_get_BONDdata_autoaim_y -/* 0B697C 7F083F8C 00000000 */ nop -/* 0B6980 7F083F90 50400010 */ beql $v0, $zero, .L7F083FD4 -/* 0B6984 7F083F94 8E0C0000 */ lw $t4, ($s0) -/* 0B6988 7F083F98 8E0A0000 */ lw $t2, ($s0) -/* 0B698C 7F083F9C 8D4B0130 */ lw $t3, 0x130($t2) -/* 0B6990 7F083FA0 5160000C */ beql $t3, $zero, .L7F083FD4 -/* 0B6994 7F083FA4 8E0C0000 */ lw $t4, ($s0) -/* 0B6998 7F083FA8 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B699C 7F083FAC 00002025 */ move $a0, $zero -/* 0B69A0 7F083FB0 00402025 */ move $a0, $v0 -/* 0B69A4 7F083FB4 0FC1795B */ jal bondwalkItemCheckBitflags -/* 0B69A8 7F083FB8 24050008 */ li $a1, 8 -/* 0B69AC 7F083FBC 50400005 */ beql $v0, $zero, .L7F083FD4 -/* 0B69B0 7F083FC0 8E0C0000 */ lw $t4, ($s0) -/* 0B69B4 7F083FC4 8E0D0000 */ lw $t5, ($s0) -/* 0B69B8 7F083FC8 10000008 */ b .L7F083FEC -/* 0B69BC 7F083FCC C5AE012C */ lwc1 $f14, 0x12c($t5) -/* 0B69C0 7F083FD0 8E0C0000 */ lw $t4, ($s0) -.L7F083FD4: -/* 0B69C4 7F083FD4 3C018005 */ lui $at, %hi(D_80055164) # $at, 0x8005 -/* 0B69C8 7F083FD8 C426AD34 */ lwc1 $f6, %lo(D_80055164)($at) -/* 0B69CC 7F083FDC C58A0160 */ lwc1 $f10, 0x160($t4) -/* 0B69D0 7F083FE0 46005107 */ neg.s $f4, $f10 -/* 0B69D4 7F083FE4 46062382 */ mul.s $f14, $f4, $f6 -/* 0B69D8 7F083FE8 00000000 */ nop -.L7F083FEC: -/* 0B69DC 7F083FEC 3C063F55 */ lui $a2, (0x3F559B3D >> 16) # lui $a2, 0x3f55 -/* 0B69E0 7F083FF0 34C69B3D */ ori $a2, (0x3F559B3D & 0xFFFF) # ori $a2, $a2, 0x9b3d -/* 0B69E4 7F083FF4 0FC1A1C0 */ jal sub_GAME_7F067F58 -/* 0B69E8 7F083FF8 C7AC0070 */ lwc1 $f12, 0x70($sp) -/* 0B69EC 7F083FFC 10000017 */ b .L7F08405C -/* 0B69F0 7F084000 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B69F4 7F084004 24010002 */ li $at, 2 -.L7F084008: -/* 0B69F8 7F084008 54410014 */ bnel $v0, $at, .L7F08405C -/* 0B69FC 7F08400C 8FBF003C */ lw $ra, 0x3c($sp) -/* 0B6A00 7F084010 0FC1A093 */ jal sub_GAME_7F067AA4 -/* 0B6A04 7F084014 00002025 */ move $a0, $zero -/* 0B6A08 7F084018 8FB80134 */ lw $t8, 0x134($sp) -/* 0B6A0C 7F08401C 8FAE0130 */ lw $t6, 0x130($sp) -/* 0B6A10 7F084020 3C018005 */ lui $at, %hi(D_80055168) # $at, 0x8005 -/* 0B6A14 7F084024 44984000 */ mtc1 $t8, $f8 -/* 0B6A18 7F084028 448E2000 */ mtc1 $t6, $f4 -/* 0B6A1C 7F08402C C420AD38 */ lwc1 $f0, %lo(D_80055168)($at) -/* 0B6A20 7F084030 468044A0 */ cvt.s.w $f18, $f8 -/* 0B6A24 7F084034 3C0142A0 */ li $at, 0x42A00000 # 80.000000 -/* 0B6A28 7F084038 44811000 */ mtc1 $at, $f2 -/* 0B6A2C 7F08403C 468021A0 */ cvt.s.w $f6, $f4 -/* 0B6A30 7F084040 46009282 */ mul.s $f10, $f18, $f0 -/* 0B6A34 7F084044 00000000 */ nop -/* 0B6A38 7F084048 46003202 */ mul.s $f8, $f6, $f0 -/* 0B6A3C 7F08404C 46025303 */ div.s $f12, $f10, $f2 -/* 0B6A40 7F084050 0FC1A1D9 */ jal sub_GAME_7F067FBC -/* 0B6A44 7F084054 46024383 */ div.s $f14, $f8, $f2 -/* 0B6A48 7F084058 8FBF003C */ lw $ra, 0x3c($sp) -.L7F08405C: -/* 0B6A4C 7F08405C D7B40030 */ ldc1 $f20, 0x30($sp) -/* 0B6A50 7F084060 8FB00038 */ lw $s0, 0x38($sp) -/* 0B6A54 7F084064 03E00008 */ jr $ra -/* 0B6A58 7F084068 27BD01C0 */ addiu $sp, $sp, 0x1c0 -) -#endif -#endif +/** + * US address 7F081974. + * EU address 7F081A18. + * Perfect Dark method bmoveProcessInput. +*/ +void bondviewProcessInput(s8 stick_x, s8 stick_y, u16 buttons, u16 oldbuttons) +{ + struct MoveData moveData; // sp120 + + s8 player_joyGetStickX; // sp11F + s8 player_joyGetStickY; // sp11E + u16 player_joyGetButtons; // sp11C + u16 copy_prev_buttons_pressed; // sp11A + s32 tmpc2stickx; + s32 tmpc2sticky; + s32 sp10C; + s32 sp108; + s32 sp104; + s32 sp100; + u16 shootButtons; // spFE + u16 aimButtons; // spFC + u16 invButtons; // spFA + // missing spF8 + TankRecord *spF4; + s32 i_0; // spF0 + TankRecord *spEC; + f32 ftemp_nostack_spE8; // unused + f32 noiseRadius; // spE4 + f32 ftemp_nostack_spE0; + f32 targetSpeed; + f32 ftemp_nostack_spD8; + f32 unadjustedTargetSpeed; + f32 ftemp_nostack_spD0; + f32 ftemp_nostack_spCC; + f32 ftemp_nostack_spC8; + f32 spC4; + StandTile *spC0; + f32 spBC; + f32 ftemp_nostack_spB8; + struct coord3d spAC; + struct coord3d spA0; + s32 stack_padding_sp9C; // unused + f32 ftemp_nostack_sp98; + f32 ftemp_nostack_sp94; + f32 ftemp_nostack_sp90; // unused + f32 ftemp_nostack_sp8C; + f32 ftemp_nostack_sp88; + f32 ftemp_nostack_sp84; + f32 ftemp_nostack_sp80; + s32 i_1; + f32 ftemp_nostack_sp78; + s32 canCycleWeapons; // sp74 + f32 sp70; + moveData.canSwivelGun = 0; + moveData.canManualAim = 0; + moveData.triggerOn = 0; + moveData.btap = 0; + moveData.canLookAhead = 0; + moveData.canTurnTank = 0; + moveData.canNaturalTurn = 0; + moveData.canNaturalPitch = 0; + moveData.digitalStepForward = 0; + moveData.digitalStepBack = 0; + moveData.digitalStepLeft = 0; + moveData.digitalStepRight = 0; + moveData.tankTurnLeftSpeed = 0; + moveData.tankTurnRightSpeed = 0; + moveData.speedVertaDown = 0; + moveData.speedVertaUp = 0; + moveData.aimTurnLeftSpeed = 0; + moveData.aimTurnRightSpeed = 0; + moveData.weaponBackOffset = 0; + moveData.weaponForwardOffset = 0; + moveData.aiming = 0; + moveData.zooming = 0; + moveData.zoomOutFovPersec = 0; + moveData.zoomInFovPersec = 0; + moveData.crouchDown = 0; + moveData.crouchUp = 0; + moveData.rLeanLeft = 0; + moveData.rLeanRight = 0; + moveData.detonating = 0; + moveData.canAutoAim = 0; + moveData.invertPitch = get_cur_player_look_vertical_inverted() == 0; + moveData.disableLookAhead = 0; + + if (stick_x < -5) { + moveData.controlStickXSafe = stick_x + 5; + } else if (stick_x > 5) { + moveData.controlStickXSafe = stick_x - 5; + } else { + moveData.controlStickXSafe = 0; + } -#ifdef VERSION_US + if (stick_y < -5) { + moveData.controlStickYSafe = stick_y + 5; + } else if (stick_y > 5) { + moveData.controlStickYSafe = stick_y - 5; + } else { + moveData.controlStickYSafe = 0; + } -void sub_GAME_7F083FC8(void) -{ - f32 frac; - s32 unk_field10; - s32 unk_field14; - s32 unk_field14_2; - s32 dmg_time_diff; - s32 unk_field18; - s32 unk_field_diff; - bondstruct_unk_80036794 * timerelated; - bondstruct_unk_80036634 * unknown; + moveData.controlStickXRaw = (s32)stick_x; + moveData.controlStickYRaw = (s32)stick_y; + + moveData.analogTurn = moveData.controlStickXSafe; + moveData.analogPitch = moveData.controlStickYSafe; + moveData.analogStrafe = moveData.controlStickXSafe; + moveData.analogWalk = moveData.controlStickYSafe; + + if (g_CurrentPlayer->bonddead == 0 + && g_bondviewForceDisarm <= 0 + && ( + (g_CurrentPlayer->watch_animation_state != 5 + && ((buttons & ~oldbuttons) & START_BUTTON) + ) + || + (g_CurrentPlayer->watch_animation_state == 5 + && g_CurrentPlayer->open_close_solo_watch_menu) + ) + && (getPlayerCount() == 1)) + { + trigger_solo_watch_menu(0); + } - // update damage showtime - if (g_CurrentPlayer->damageshowtime >= 0) + if (g_CurrentPlayer->watch_animation_state == 0 + && g_CurrentPlayer->bonddead == 0 + && ( + getPlayerCount() == 1 + || ( + g_stopPlayFlag == 0 + && g_gameOverFlag == 0))) { - if (g_CurrentPlayer->damageshowtime == 0) + if (cur_player_get_control_type() == CONTROLLER_CONFIG_DOMINO /* 2.3 */ + || cur_player_get_control_type() == CONTROLLER_CONFIG_GOODHEAD /* 2.4 */ + || cur_player_get_control_type() == CONTROLLER_CONFIG_GALORE /* 2.2 */ + || cur_player_get_control_type() == CONTROLLER_CONFIG_PLENTY /* 2.1 */ + ) { - set_unset_ammo_on_screen_setting(8, 0); - set_unset_bitflags(0x10, 0); - hudmsgsSetOff(4); - sub_GAME_7F08A944(PLAYERFLAG_NOTIMER); - countdownTimerSetVisible(8, 0); + player_joyGetStickX = joyGetStickX(get_cur_playernum() + getPlayerCount()); + player_joyGetStickY = joyGetStickY(get_cur_playernum() + getPlayerCount()); + player_joyGetButtons = joyGetButtons(get_cur_playernum() + getPlayerCount() , (u32)ANY_BUTTON); - g_CurrentPlayer->damagetype = (s32)(bondviewGetCurrentPlayerHealth() * 8.0f); - if (g_CurrentPlayer->damagetype >= 8) + copy_prev_buttons_pressed = g_CurrentPlayer->prev_buttons_pressed; + + if (player_joyGetStickX < -5) { - g_CurrentPlayer->damagetype = 7; + tmpc2stickx = player_joyGetStickX + 5; + } + else if (player_joyGetStickX > 5) + { + tmpc2stickx = player_joyGetStickX - 5; + } + else + { + tmpc2stickx = 0; + } + + if (player_joyGetStickY < -5) + { + tmpc2sticky = player_joyGetStickY + 5; + } + else if (player_joyGetStickY >= 6) + { + tmpc2sticky = player_joyGetStickY - 5; + } + else + { + tmpc2sticky = 0; } - } - unknown = &D_80036634[g_CurrentPlayer->damagetype]; - if ((unknown->field_0x8 >= g_CurrentPlayer->damageshowtime) || (unknown->field_0x18 >= g_CurrentPlayer->damageshowtime)) - { - if (!g_CurrentPlayer->bonddead) + /* 2.1 and 2.3 */ + if (cur_player_get_control_type() == CONTROLLER_CONFIG_PLENTY || (cur_player_get_control_type() == CONTROLLER_CONFIG_DOMINO)) + { + moveData.analogStrafe = tmpc2stickx; + moveData.analogPitch = tmpc2sticky; + } + else + { + if (in_tank_flag == 1 && !g_CurrentPlayer->insightaimmode) + { + moveData.analogTurn = tmpc2stickx; + } + else + { + moveData.analogStrafe = tmpc2stickx; + } + + moveData.analogWalk = tmpc2sticky; + } + + /* 2.1 and 2.2 */ + if (cur_player_get_control_type() == CONTROLLER_CONFIG_PLENTY || cur_player_get_control_type() == CONTROLLER_CONFIG_GALORE) { - unk_field10 = unknown->field_0x10; - if (g_CurrentPlayer->damageshowtime >= unk_field10) + sp104 = (player_joyGetButtons & Z_TRIG) != 0; + sp100 = ((player_joyGetButtons & ~copy_prev_buttons_pressed) & Z_TRIG) != 0; + sp10C = (buttons & Z_TRIG) != 0; + sp108 = ((buttons & ~oldbuttons) & Z_TRIG) != 0; + } + else + { + sp104 = (buttons & Z_TRIG) != 0; + sp100 = ((buttons & ~oldbuttons) & Z_TRIG) != 0; + sp10C = (player_joyGetButtons & Z_TRIG) != 0; + sp108 = ((player_joyGetButtons & ~copy_prev_buttons_pressed) & Z_TRIG) != 0; + } + + if (lvlGetControlsLockedFlag() == 0 && disablePlayerActionsWhenPausedOrInMpMenu()) + { + if (cur_player_get_aim_control() == 0) + { + g_CurrentPlayer->insightaimmode = sp104; + } + else if (sp100) + { + g_CurrentPlayer->insightaimmode = !g_CurrentPlayer->insightaimmode; + } + + moveData.canSwivelGun = !g_CurrentPlayer->insightaimmode; + moveData.canAutoAim = !g_CurrentPlayer->insightaimmode; + + moveData.canManualAim = g_CurrentPlayer->insightaimmode; + + moveData.btap = ( + (((buttons & ~oldbuttons) & B_BUTTON) != 0) + || + ((((player_joyGetButtons & ~copy_prev_buttons_pressed) & B_BUTTON)) != 0) + ); + + moveData.canLookAhead = !g_CurrentPlayer->insightaimmode; + moveData.canTurnTank = 1; + moveData.canNaturalTurn = !g_CurrentPlayer->insightaimmode; + moveData.canNaturalPitch = !g_CurrentPlayer->insightaimmode; + + if (g_CurrentPlayer->insightaimmode && (stick_y > 60)) { - unk_field18 = unknown->field_0x18; - if (unk_field18 >= g_CurrentPlayer->damageshowtime) + moveData.speedVertaDown = (f32) (stick_y - 60) / FLOAT_TEN_B; + if (moveData.speedVertaDown > 1.0f) { - unk_field14 = unknown->field_0x14; - dmg_time_diff = g_CurrentPlayer->damageshowtime; - dmg_time_diff = dmg_time_diff - unk_field10; - unk_field_diff = unk_field18 - unk_field10; - unk_field18 = dmg_time_diff; + moveData.speedVertaDown = 1.0f; + } + } + else + { + //moveData.speedVertaDown = 0; + } + + if (g_CurrentPlayer->insightaimmode && (stick_y < -60)) + { + moveData.speedVertaUp = (f32) (-60 - stick_y) / FLOAT_TEN_B; + if (moveData.speedVertaUp > 1.0f) + { + moveData.speedVertaUp = 1.0f; + } + } + else + { + //moveData.speedVertaUp = 0; + } - if (unk_field18 < unk_field14) + + if (g_CurrentPlayer->insightaimmode && (stick_x < -60)) + { + moveData.aimTurnLeftSpeed = (f32) (-60 - stick_x) / FLOAT_TEN_B; + if (moveData.aimTurnLeftSpeed > 1.0f) + { + moveData.aimTurnLeftSpeed = 1.0f; + } + } + else + { + //moveData.aimTurnLeftSpeed = 0; + } + + if (g_CurrentPlayer->insightaimmode && (stick_x > 60) ) + { + moveData.aimTurnRightSpeed = (f32) (stick_x - 60) / FLOAT_TEN_B; + if (moveData.aimTurnRightSpeed > 1.0f) + { + moveData.aimTurnRightSpeed = 1.0f; + } + } + else + { + //moveData.aimTurnRightSpeed = 0; + } + + moveData.weaponBackOffset = ( + ((buttons & A_BUTTON) != 0) + || + ((player_joyGetButtons & A_BUTTON) != 0) + ) + && (sp108); + + moveData.weaponForwardOffset = ( + ( + (((buttons & ~oldbuttons) & A_BUTTON) != 0) + || + (((player_joyGetButtons & ~copy_prev_buttons_pressed) & A_BUTTON) != 0) + )) + && (!sp10C); + + moveData.aiming = g_CurrentPlayer->insightaimmode; + moveData.zooming = g_CurrentPlayer->insightaimmode; + + if ((bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH)) + && g_CurrentPlayer->insightaimmode) + { + if (tmpc2sticky < 0) + { + moveData.zoomOutFovPersec = (f32) -tmpc2sticky / 70.0f; + if (moveData.zoomOutFovPersec > 1.0f) { - frac = (unknown->field_0x1c * ((f32) dmg_time_diff)) / ((f32) unk_field14); + moveData.zoomOutFovPersec = 1.0f; } - else + + moveData.zoomOutFovPersec *= 2.0f; + } + + if (tmpc2sticky > 0) + { + moveData.zoomInFovPersec = (f32) tmpc2sticky / 70.0f; + if (moveData.zoomInFovPersec > 1.0f) { - frac = (unknown->field_0x1c * ((f32)(unk_field_diff - unk_field18))) / ((f32)(unk_field_diff - unk_field14)); + moveData.zoomInFovPersec = 1.0f; + } + + moveData.zoomInFovPersec *= 2.0f; + } + } + + moveData.crouchDown = (bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH) == 0) + && (g_CurrentPlayer->insightaimmode) + && (player_joyGetStickY < -30); + + moveData.crouchUp = (bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH) == 0) + && (g_CurrentPlayer->insightaimmode) + && (player_joyGetStickY > 30); + + if (( + (((buttons & A_BUTTON) != 0) && (((buttons & ~oldbuttons) & B_BUTTON) != 0)) + || (((buttons & B_BUTTON) != 0) && (((buttons & ~oldbuttons) & A_BUTTON) != 0)) + || ((player_joyGetButtons & A_BUTTON) && ((player_joyGetButtons & ~copy_prev_buttons_pressed) & B_BUTTON)) + || ((player_joyGetButtons & B_BUTTON) && ((player_joyGetButtons & ~copy_prev_buttons_pressed) & A_BUTTON))) + && (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_REMOTEMINE)) + { + moveData.detonating = 1; + moveData.weaponBackOffset = 0; + moveData.weaponForwardOffset = 0; + moveData.btap = 0; + } + + if (in_tank_flag == 1 && g_CurrentPlayer->insightaimmode) + { + if (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TANKSHELLS) + { + moveData.controlStickXRaw = 0; + + if (moveData.analogStrafe == 0) + { + moveData.analogStrafe = moveData.analogTurn; + } + } + else if (moveData.analogStrafe == 0) + { + if (moveData.aimTurnLeftSpeed > 0) + { + moveData.tankTurnLeftSpeed = moveData.aimTurnLeftSpeed; + } + + if (moveData.aimTurnRightSpeed > 0) + { + moveData.tankTurnRightSpeed = moveData.aimTurnRightSpeed; } - - currentPlayerSetFadeColour(unknown->field_0x20, unknown->field_0x24, unknown->field_0x28, frac); } + + moveData.aimTurnLeftSpeed = 0; + moveData.aimTurnRightSpeed = 0; } } - if (g_CurrentPlayer->watch_animation_state == 0) + moveData.triggerOn = (sp10C) + && (g_CurrentPlayer->watch_animation_state == 0) + && ((buttons & A_BUTTON) == 0) + && ((player_joyGetButtons & A_BUTTON) == 0); + + moveData.disableLookAhead = 1; + g_CurrentPlayer->prev_buttons_pressed = player_joyGetButtons; + } + else + { + /* 1.3 and 1.4 */ + if (cur_player_get_control_type() == CONTROLLER_CONFIG_KISSY + || cur_player_get_control_type() == CONTROLLER_CONFIG_GOODNIGHT) { - g_CurrentPlayer->damageshowtime += g_ClockTimer; + shootButtons = A_BUTTON; + aimButtons = Z_TRIG; + invButtons = L_TRIG | R_TRIG; } else { - g_CurrentPlayer->damageshowtime += speedgraphframes; + shootButtons = Z_TRIG; + aimButtons = L_TRIG | R_TRIG; + invButtons = A_BUTTON; } - } - else /* (damage showtime is over) */ - { - g_CurrentPlayer->damageshowtime = -1; - currentPlayerSetFadeColour(0xFF, 0xFF, 0xFF, 0.0f); - if (!g_CurrentPlayer->bonddead) + if (lvlGetControlsLockedFlag() == 0) { - set_unset_ammo_on_screen_setting(8, 1); - set_unset_bitflags(0x10, 1); - hudmsgsSetOn(4); - sub_GAME_7F08A928(4); - countdownTimerSetVisible(8, 1); - } + if (disablePlayerActionsWhenPausedOrInMpMenu()) + { + if (cur_player_get_aim_control() == 0) + { + g_CurrentPlayer->insightaimmode = (buttons & aimButtons) != 0; + } + else if ((buttons & ~oldbuttons) & aimButtons) + { + g_CurrentPlayer->insightaimmode = !g_CurrentPlayer->insightaimmode; + } + + moveData.canSwivelGun = !g_CurrentPlayer->insightaimmode; + moveData.canAutoAim = !g_CurrentPlayer->insightaimmode; + moveData.btap = ((buttons & ~oldbuttons) & B_BUTTON) != 0; + moveData.canManualAim = g_CurrentPlayer->insightaimmode; + + /* 1.2 and 1.4 */ + if (cur_player_get_control_type() == CONTROLLER_CONFIG_SOLITARE + || cur_player_get_control_type() == CONTROLLER_CONFIG_GOODNIGHT) + { + if ((buttons & (L_JPAD | L_CBUTTONS)) != 0) + { + if (!g_CurrentPlayer->insightaimmode) + { + if (in_tank_flag == 1) + { + moveData.aimTurnLeftSpeed = 1.0f; + } + else + { + moveData.digitalStepLeft = 1; + } + } + else + { + moveData.tankTurnLeftSpeed = 1.0f; + } + } + + if ((buttons & (R_JPAD | R_CBUTTONS)) != 0) + { + if (!g_CurrentPlayer->insightaimmode) + { + if (in_tank_flag == 1) + { + moveData.aimTurnRightSpeed = 1.0f; + } + else + { + moveData.digitalStepRight = 1; + } + } + else + { + moveData.tankTurnRightSpeed = 1.0f; + } + } + + moveData.digitalStepForward = (!g_CurrentPlayer->insightaimmode) + && ((buttons & (U_JPAD | U_CBUTTONS)) ); + + moveData.digitalStepBack = (!g_CurrentPlayer->insightaimmode) + && ((buttons & (D_JPAD | D_CBUTTONS))); + + moveData.canNaturalPitch = !g_CurrentPlayer->insightaimmode; + + if (in_tank_flag == 1) + { + moveData.canTurnTank = !g_CurrentPlayer->insightaimmode; + } + else + { + moveData.canNaturalTurn = !g_CurrentPlayer->insightaimmode; + } + } + else + { + if ((buttons & (s32)(L_JPAD | L_CBUTTONS)) != 0) + { + moveData.tankTurnLeftSpeed = 1.0f; + } + /* optional else statement, matches with or without. */ + else + { + moveData.tankTurnLeftSpeed = 0; + } + + if ((buttons & (s32)(R_JPAD | R_CBUTTONS)) != 0) + { + moveData.tankTurnRightSpeed = 1.0f; + } + /* optional else statement, matches with or without. */ + else + { + moveData.tankTurnRightSpeed = 0; + } + + moveData.digitalStepLeft = (!g_CurrentPlayer->insightaimmode) + && ((buttons & (s32)(L_JPAD | L_CBUTTONS)) ); + + moveData.digitalStepRight = (!g_CurrentPlayer->insightaimmode) + && ((buttons & (s32)(R_JPAD | R_CBUTTONS))); + + moveData.canLookAhead = !g_CurrentPlayer->insightaimmode; + + if ((!g_CurrentPlayer->insightaimmode) && (buttons & (U_JPAD | U_CBUTTONS)) ) + { + moveData.speedVertaDown = 1.0f; + } + + if ((!g_CurrentPlayer->insightaimmode) && (buttons & (D_JPAD | D_CBUTTONS))) + { + moveData.speedVertaUp = 1.0f; + } + + moveData.canNaturalTurn = !g_CurrentPlayer->insightaimmode; + } + + if ((g_CurrentPlayer->insightaimmode) && (stick_y > 60)) + { + moveData.speedVertaDown = (f32) (stick_y - 60) / FLOAT_TEN_B; + if (moveData.speedVertaDown > 1.0f) + { + moveData.speedVertaDown = 1.0f; + } + } + else if ((g_CurrentPlayer->insightaimmode) && (stick_y < -60)) + { + moveData.speedVertaUp = (f32) (-60 - stick_y) / FLOAT_TEN_B; + if (moveData.speedVertaUp > 1.0f) + { + moveData.speedVertaUp = 1.0f; + } + } + + if ((g_CurrentPlayer->insightaimmode) && (stick_x < -60)) + { + moveData.aimTurnLeftSpeed = (f32) (-60 - stick_x) / FLOAT_TEN_B; + if (moveData.aimTurnLeftSpeed > 1.0f) + { + moveData.aimTurnLeftSpeed = 1.0f; + } + } + + if ((g_CurrentPlayer->insightaimmode) && (stick_x > 60)) + { + moveData.aimTurnRightSpeed = (f32) (stick_x - 60) / FLOAT_TEN_B; + if (moveData.aimTurnRightSpeed > 1.0f) + { + moveData.aimTurnRightSpeed = 1.0f; + } + } + + moveData.weaponBackOffset = + ((buttons & invButtons) != 0) + && + (((buttons & ~oldbuttons) & shootButtons) != 0) + ; + + moveData.weaponForwardOffset = + (((buttons & ~oldbuttons) & invButtons) != 0) + && + ((buttons & shootButtons) == 0) + ; + + moveData.aiming = g_CurrentPlayer->insightaimmode; + moveData.zooming = g_CurrentPlayer->insightaimmode; + + if ((bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH)) + && g_CurrentPlayer->insightaimmode + ) + { + /* down = 0x404 */ + if ((buttons & (D_JPAD | D_CBUTTONS)) != 0) + { + moveData.zoomOutFovPersec = 1.0f; + } + + if ((buttons & (U_JPAD | U_CBUTTONS)) != 0) + { + moveData.zoomInFovPersec = 1.0f; + } + } + + moveData.crouchDown = (bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH) == 0) + && (g_CurrentPlayer->insightaimmode) + && ((buttons & (D_JPAD | D_CBUTTONS))); + + moveData.crouchUp = (bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_DISABLE_CROUCH) == 0) + && (g_CurrentPlayer->insightaimmode) + && ((~buttons & (U_JPAD | U_CBUTTONS))); + + moveData.rLeanLeft = (g_CurrentPlayer->insightaimmode) + && ((buttons & (L_JPAD | L_CBUTTONS))); + + moveData.rLeanRight = (g_CurrentPlayer->insightaimmode) + && ((buttons & (R_JPAD | R_CBUTTONS))); + + if ( + ((((buttons & invButtons) != 0) && (((buttons & ~oldbuttons) & B_BUTTON) != 0)) + || ((buttons & B_BUTTON) && (((buttons & ~oldbuttons) & invButtons) != 0))) + && (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_REMOTEMINE)) + { + moveData.detonating = 1; + moveData.weaponBackOffset = 0; + moveData.weaponForwardOffset = 0; + moveData.btap = 0; + } + + if ((in_tank_flag == 1) && (g_CurrentPlayer->insightaimmode)) + { + if (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TANKSHELLS) + { + moveData.controlStickXRaw = 0; + moveData.canTurnTank = 1; + } + else if ((moveData.tankTurnLeftSpeed == 0) && (moveData.tankTurnRightSpeed == 0)) + { + if (moveData.aimTurnLeftSpeed > 0) + { + moveData.tankTurnLeftSpeed = moveData.aimTurnLeftSpeed; + } + + if (moveData.aimTurnRightSpeed > 0) + { + moveData.tankTurnRightSpeed = moveData.aimTurnRightSpeed; + } + } + + moveData.aimTurnLeftSpeed = 0; + moveData.aimTurnRightSpeed = 0; + } + } + } + + moveData.triggerOn = ((buttons & shootButtons) != 0) + && (g_CurrentPlayer->watch_animation_state == 0) + && ((buttons & invButtons) == 0); + + /* 1.2 and 1.4 */ + if (cur_player_get_control_type() == CONTROLLER_CONFIG_SOLITARE || cur_player_get_control_type() == CONTROLLER_CONFIG_GOODNIGHT) + { + moveData.disableLookAhead = 1; + } + } + } + + g_CurrentPlayer->field_D0 = 0; + + if (moveData.btap) + { + /* If Bond is in the tank and pressed B, then exit. */ + if (in_tank_flag == 1) + { + spF4 = (struct TankRecord *)g_PlayerTankProp->obj; + spF4->unkD8 = get_ammo_count_for_weapon(ITEM_TANKSHELLS); + + add_ammo_to_weapon(ITEM_TANKSHELLS, 0); + bondinvRemoveItemByID(ITEM_TANKSHELLS); + + if (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TANKSHELLS) + { + spF4->unkD8 += get_ammo_in_hands_magazine(GUNRIGHT); + autoadvance_on_deplete_all_ammo(); + } + + spF4->is_firing_tank = 0; + in_tank_flag = 0; + g_CurrentPlayer->speedsideways = 0; + g_CurrentPlayer->speedforwards = 0; + g_CurrentPlayer->speedtheta = 0; + + for (i_0=0; i_0<3; i_0++) + { + g_CurrentPlayer->bondshotspeed.f[i_0] = 0; + } + + g_CurrentPlayer->crouchpos = 2; + } + /* If Bond is standing on the tank and pressed B, enter the tank. */ + else if (g_PlayerTankProp != NULL + && g_PlayerTankProp->type == PROP_TYPE_OBJ + && g_PlayerTankProp->obj->type == PROPDEF_TANK + && g_BondCanEnterTank) + { + spEC = (struct TankRecord *)g_PlayerTankProp->obj; + + bondinvAddInvItem(ITEM_TANKSHELLS); + add_ammo_to_weapon(ITEM_TANKSHELLS, spEC->unkD8); + spEC->unkD8 = 0; + g_TankTurretVerticalAngle = spEC->turret_vertical_angle; + g_TankTurretVerticalAngleRelated = g_TankTurretVerticalAngle / TANK_VERT_ANGLE_FACTOR; + g_TankTurretAngle = spEC->turret_orientation_angle; + g_TankTurretOrientationAngleRad = spEC->turret_orientation_angle; + D_80036478 = g_TankTurretOrientationAngleRad / TANK_VERT_ANGLE_RAD_FACTOR; + D_8003647C = 0; + g_TankOrientationAngle = spEC->tank_orientation_angle; + g_TankTurnSpeed = 0; + in_tank_flag = 1; + g_EnterTankAudioState = TANK_RUN_STATE_NOT_RUNNING; + g_CurrentPlayer->speedsideways = 0; + g_CurrentPlayer->speedforwards = 0; + g_CurrentPlayer->speedtheta = 0; + g_CurrentPlayer->crouchpos = 1; + g_TankEnteringSitHeight = 0; + g_TankEnteringSitHeightRemain = 1.0f; + g_TankEnterBondHorizAngleDeg = g_CurrentPlayer->vv_theta; + g_TankEnterBondVertAngleDeg = g_CurrentPlayer->vv_verta; + g_EnterTankCoord.f[0] = g_CurrentPlayer->field_488.collision_position.f[0]; + g_EnterTankCoord.f[1] = g_CurrentPlayer->field_488.collision_position.f[1]; + g_EnterTankCoord.f[2] = g_CurrentPlayer->field_488.collision_position.f[2]; + g_TankDamagePenaltyTicks = 0; + + bondviewTankModelRotationRelated(); + } + else + { + g_CurrentPlayer->field_D0 = 1; + } + } + + if (moveData.invertPitch == 0) + { + f32 ftemp_nostack_spE8; + + moveData.controlStickYRaw = (s32) -stick_y; + moveData.analogPitch = -moveData.analogPitch; + ftemp_nostack_spE8 = moveData.speedVertaDown; + moveData.speedVertaDown = moveData.speedVertaUp; + moveData.speedVertaUp = ftemp_nostack_spE8; + } + + if (bondviewGetIfCurrentPlayerDamageShowTime() && getPlayerCount() == 1) + { + moveData.triggerOn = 0; + } + + gunTickGameplay(moveData.triggerOn); + + if (bondviewGetVisibleToGuardsFlag() + && (get_hands_firing_status(GUNRIGHT) + || get_hands_firing_status(GUNLEFT))) + { + noiseRadius = 0; + + if (get_hands_firing_status(GUNRIGHT) && getCurrentPlayerNoise(GUNRIGHT) > noiseRadius) + { + noiseRadius = getCurrentPlayerNoise(GUNRIGHT); + } + + if (get_hands_firing_status(GUNLEFT) && noiseRadius < getCurrentPlayerNoise(GUNLEFT)) + { + noiseRadius = getCurrentPlayerNoise(GUNLEFT); + } + + chrCheckGuardsHeardSound(noiseRadius); + } + + gunSetSightVisible(GUNSIGHTREASON_NOTAIMING, moveData.aiming); + + if (moveData.zoomOutFovPersec > 0) + { + camera_sniper_zoom_out(moveData.zoomOutFovPersec); + } + + if (moveData.zoomInFovPersec > 0) + { + camera_sniper_zoom_in(moveData.zoomInFovPersec); + } + + if (g_CurrentPlayer->watch_animation_state == 0) + { + ftemp_nostack_spE0 = 60.0f; + + if (moveData.zooming) + { + ftemp_nostack_spE0 = get_item_in_hand_zoom(); + + if (ftemp_nostack_spE0 <= 0) + { + ftemp_nostack_spE0 = 60.0f; + } + } + + bondviewTriggerWatchZoom(ftemp_nostack_spE0); + bondviewUpdateWatchZoomIn(); + } + + if (in_tank_flag == 1) + { + g_TankTurretTurn = 0; + + if (g_EnterTankAudioState == TANK_RUN_STATE_RUNNING) + { + if (moveData.tankTurnRightSpeed > 0) + { + g_TankTurretTurn += g_GlobalTimerDelta * moveData.tankTurnRightSpeed * DegToRad1Fact(1); + } + else if (moveData.tankTurnLeftSpeed > 0) + { + g_TankTurretTurn -= g_GlobalTimerDelta * moveData.tankTurnLeftSpeed * DegToRad1Fact(1); + } + else if (moveData.canTurnTank) + { + targetSpeed = (f32) moveData.analogStrafe / 70.0f; + + if (targetSpeed > 1.0f) + { + targetSpeed = 1.0f; + } + + if (targetSpeed < -1.0f) + { + targetSpeed = -1.0f; + } + + g_TankTurretTurn += DegToRad1Fact(1) * targetSpeed * g_GlobalTimerDelta; + } + + if (!g_CurrentPlayer->insightaimmode) + { + ftemp_nostack_spD8 = 0; + targetSpeed = 1.0f; + ftemp_nostack_spE8 = 1.0f; + + if (moveData.canLookAhead) + { + ftemp_nostack_spD8 = (f32) moveData.analogWalk / 70.0f; + } + else if (moveData.digitalStepForward) + { + ftemp_nostack_spD8 = 1.0f; + } + else if (moveData.digitalStepBack) + { + ftemp_nostack_spD8 = -1.0f; + } + + if (ftemp_nostack_spD8 > 1.0f) + { + ftemp_nostack_spD8 = 1.0f; + } + else if (ftemp_nostack_spD8 < -1.0f) + { + ftemp_nostack_spD8 = -1.0f; + } + + unadjustedTargetSpeed = ftemp_nostack_spD8 * TANK_MAX_SPEED; + targetSpeed = unadjustedTargetSpeed; + + if (g_TankDamagePenaltyTicks > 0) + { + targetSpeed = unadjustedTargetSpeed * 0.5f; + ftemp_nostack_spE8 = 4.0f; + g_TankDamagePenaltyTicks -= g_ClockTimer; + } + + if (targetSpeed != g_CurrentPlayer->speedforwards) + { + if (g_CurrentPlayer->speedforwards < targetSpeed) + { + unadjustedTargetSpeed = ((((((targetSpeed - g_CurrentPlayer->speedforwards) / 4.0f) / TANK_MAX_SPEED) + 0.5f) * ftemp_nostack_spE8 * FLOAT_TEN_A) / 60.0f); + + g_CurrentPlayer->speedforwards += (unadjustedTargetSpeed) * g_GlobalTimerDelta; + + if (targetSpeed < g_CurrentPlayer->speedforwards) + { + g_CurrentPlayer->speedforwards = targetSpeed; + } + } + else if (targetSpeed < g_CurrentPlayer->speedforwards) + { + unadjustedTargetSpeed = ((((((g_CurrentPlayer->speedforwards - targetSpeed) / 4.0f) / TANK_MAX_SPEED) + 0.5f) * ftemp_nostack_spE8 * -FLOAT_TEN_A) / 60.0f); + + g_CurrentPlayer->speedforwards += (unadjustedTargetSpeed) * g_GlobalTimerDelta; + + if (g_CurrentPlayer->speedforwards < targetSpeed) + { + g_CurrentPlayer->speedforwards = targetSpeed; + } + } + } + } + } + } + else + { + if (moveData.digitalStepLeft) + { + bondviewUpdateSpeedSideways(-1); + } + else if (moveData.digitalStepRight) + { + bondviewUpdateSpeedSideways(1); + } + else + { + bondviewUpdateSpeedSideways(0); + } + + if (moveData.canTurnTank) // ?? not sure why this tank property is used here. Is the name wrong? + { + g_CurrentPlayer->speedsideways = (f32) moveData.analogStrafe / 70.0f; + } + + if (moveData.digitalStepForward) + { + bondviewUpdateSpeedForwards(1); + g_CurrentPlayer->speedmaxtime60 += g_ClockTimer; + } + else if (moveData.digitalStepBack) + { + bondviewUpdateSpeedForwards(-1); + } + else + { + bondviewUpdateSpeedForwards(0); + } + + if (moveData.canLookAhead) + { + g_CurrentPlayer->speedforwards = (f32) moveData.analogWalk / 70.0f; + + if (moveData.analogWalk > 60) + { + g_CurrentPlayer->speedmaxtime60 += g_ClockTimer; + } + else + { + g_CurrentPlayer->speedmaxtime60 = 0; + } + } + + if (g_CurrentPlayer->speedforwards > 1.0f) + { + g_CurrentPlayer->speedforwards = 1; + } + + if (g_CurrentPlayer->speedforwards < -1.0f) + { + g_CurrentPlayer->speedforwards = -1.0f; + } + + if (g_CurrentPlayer->speedsideways > 1) + { + g_CurrentPlayer->speedsideways = 1; + } + + if (g_CurrentPlayer->speedsideways < -1) + { + g_CurrentPlayer->speedsideways = -1; + } + + g_CurrentPlayer->speedforwards *= 1.08f; + g_CurrentPlayer->speedforwards *= g_CurrentPlayer->speedboost; + + if ((moveData.canLookAhead == 0) && (moveData.digitalStepForward == 0)) + { + g_CurrentPlayer->speedmaxtime60 = 0; + } + + if (moveData.rLeanLeft) + { + currentPlayerSetSwayTarget(-1); + } + else if (moveData.rLeanRight) + { + currentPlayerSetSwayTarget(1); + } + else + { + currentPlayerSetSwayTarget(0); + } + + if (moveData.crouchDown) + { + currentPlayerAdjustCrouchPos(-2); + } + else if (moveData.crouchUp) + { + currentPlayerAdjustCrouchPos(2); + } + } + + if (g_CurrentPlayer->speedmaxtime60 >= THREE_SECOND_TICKS) + { + if (g_CurrentPlayer->speedboost < SPEED_RUN_MAX) + { + g_CurrentPlayer->speedboost += (SPEED_TICK_ADJUST * g_GlobalTimerDelta); + } + + if (g_CurrentPlayer->speedboost > SPEED_RUN_MAX) + { + g_CurrentPlayer->speedboost = SPEED_RUN_MAX; + } + } + else + { + if (g_CurrentPlayer->speedboost > SPEED_REGULAR_MAX) + { + g_CurrentPlayer->speedboost -= (SPEED_TICK_ADJUST * g_GlobalTimerDelta); + } + + if (g_CurrentPlayer->speedboost < SPEED_REGULAR_MAX) + { + g_CurrentPlayer->speedboost = SPEED_REGULAR_MAX; + } + } + + if (g_CurrentPlayer->watch_animation_state == 0) + { + spC4 = -4.0f; + + if (g_CurrentPlayer->lookaheadcentreenabled) + { + spC0 = g_CurrentPlayer->field_488.current_tile_ptr; + spBC = 300.0f; + + // prop, f32 *collision_radius, f32 *height, f32 *always_30 + bondviewGetCollisionRadius(g_CurrentPlayer->prop, &spA0.f[0], &spA0.f[2], &spA0.f[1]); + + spAC.f[0] = g_CurrentPlayer->field_488.collision_position.f[0] + (g_CurrentPlayer->field_488.theta_transform.f[0] * 300.0f); + spAC.f[1] = g_CurrentPlayer->field_488.collision_position.f[1]; + spAC.f[2] = g_CurrentPlayer->field_488.collision_position.f[2] + (g_CurrentPlayer->field_488.theta_transform.f[2] * 300.0f); + + sub_GAME_7F0B1CC4(); + + if (stanTestLineUnobstructed(&spC0, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], spAC.f[0], spAC.f[2], 0x1000, spA0.f[2], spA0.f[1], 0, 1.0f)) + { + spAC.f[1] = bondviewYPositionRelated(spC0, spAC.f[0], spAC.f[2]); + } + else + { + chrlvStanPointPointIntersection(&g_CurrentPlayer->field_488.collision_position, &g_CurrentPlayer->field_488.theta_transform, (struct coord3d *) &spAC); + ftemp_nostack_spD0 = spAC.f[0] - g_CurrentPlayer->field_488.collision_position.f[0]; + ftemp_nostack_spCC = spAC.f[2] - g_CurrentPlayer->field_488.collision_position.f[2]; + spBC = sqrtf((ftemp_nostack_spD0 * ftemp_nostack_spD0) + (ftemp_nostack_spCC * ftemp_nostack_spCC)); + spAC.f[1] = bondviewYPositionRelated(spC0, spAC.f[0], spAC.f[2]); + } + + if (spBC > 0) + { + ftemp_nostack_spC8 = spAC.f[1] - g_CurrentPlayer->stanHeight; + + if ((ftemp_nostack_spC8 > -300.0f) && (ftemp_nostack_spC8 < 500.0f)) + { + spC4 = ((atan2f(ftemp_nostack_spC8, spBC) * 360.0f) / M_TAU_F) + -4.0f; + + if (spC4 >= 180.0f) + { + spC4 -= 360.0f; + } + + if (spC4 > 0) + { + spC4 *= 0.8666667f; + } + } + } + } + + if ((g_CurrentPlayer->movecentrerelease) && (moveData.analogWalk < 40) && (moveData.analogWalk > -40)) + { + g_CurrentPlayer->movecentrerelease = 0; + } + + if (in_tank_flag == 0) + { + if ((moveData.speedVertaDown > 0) || (moveData.speedVertaUp > 0)) + { + g_CurrentPlayer->field_104 = 0; + g_CurrentPlayer->field_10C = 1; + g_CurrentPlayer->automovecentre = 0; + } + else + { + if (moveData.disableLookAhead) + { + g_CurrentPlayer->automovecentre = 0; + } + else if (g_CurrentPlayer->automovecentreenabled) + { + if ((moveData.canLookAhead) && ((moveData.analogWalk > 60) || (moveData.analogWalk < -60))) + { + g_CurrentPlayer->automovecentre = 1; + } + + if (( + g_CurrentPlayer->automovecentre) + && (( ((spC4 + 5.0f) < g_CurrentPlayer->vv_verta)) || (g_CurrentPlayer->vv_verta < (spC4 + -FLOAT_TEN_A))) + && (g_CurrentPlayer->movecentrerelease == 0)) + { + g_CurrentPlayer->field_104 = 1; + } + } + else if ( + (g_CurrentPlayer->fastmovecentreenabled) + && (moveData.canLookAhead) + && ( + (moveData.analogWalk > 60) + || (moveData.analogWalk < -60) + ) && ( + ( ((spC4 + 5.0f) < g_CurrentPlayer->vv_verta)) || (g_CurrentPlayer->vv_verta < (spC4 + -FLOAT_TEN_A)) + ) && (g_CurrentPlayer->movecentrerelease == 0)) + { + g_CurrentPlayer->field_104 = 1; + } + + g_CurrentPlayer->field_10C = 0; + } + } + + if (g_CurrentPlayer->field_104) + { + if (in_tank_flag == 0) + { + ftemp_nostack_spB8 = (g_CurrentPlayer->speedverta * g_CurrentPlayer->speedverta * 0.5f) / 0.05f; + + if ((spC4 + ftemp_nostack_spB8) < g_CurrentPlayer->vv_verta) + { + bondviewCurrentPlayerUpdateSpeedVerta(1.0f); + } + else if (g_CurrentPlayer->vv_verta < (spC4 - ftemp_nostack_spB8)) + { + bondviewCurrentPlayerUpdateSpeedVerta(-1.0f); + } + else + { + bondviewCurrentPlayerUpdateSpeedVerta(0); + } + + ftemp_nostack_spB8 = g_CurrentPlayer->vv_verta + (2.0f * (g_CurrentPlayer->speedverta * g_GlobalTimerDelta)); + + if ((spC4 < g_CurrentPlayer->vv_verta) && (spC4 < ftemp_nostack_spB8)) + { + g_CurrentPlayer->vv_verta = ftemp_nostack_spB8; + } + else if ((g_CurrentPlayer->vv_verta < spC4) && (ftemp_nostack_spB8 < spC4)) + { + g_CurrentPlayer->vv_verta = ftemp_nostack_spB8; + } + else + { + g_CurrentPlayer->vv_verta = spC4; + g_CurrentPlayer->speedverta = 0; + + if (g_CurrentPlayer->field_10C == 0) + { + g_CurrentPlayer->field_104 = 0; + } + } + } + } + else + { + if (moveData.canNaturalPitch) + { + ftemp_nostack_sp98 = viGetFovY() / 60.0f; + ftemp_nostack_sp94 = (f32) moveData.analogPitch / 70.0f; + + if (ftemp_nostack_sp94 > 1) + { + ftemp_nostack_sp94 = 1; + } + else if (ftemp_nostack_sp94 < -1) + { + ftemp_nostack_sp94 = -1; + } + + if (ftemp_nostack_sp94 >= 0) + { + ftemp_nostack_sp94 *= ftemp_nostack_sp94; + } + else + { + ftemp_nostack_sp94 *= -ftemp_nostack_sp94; + } + + g_CurrentPlayer->speedverta = -ftemp_nostack_sp94 * ftemp_nostack_sp98; + } + else if (moveData.speedVertaDown > 0) + { + bondviewCurrentPlayerUpdateSpeedVerta(moveData.speedVertaDown); + + if ((moveData.canLookAhead) && ((moveData.analogWalk > 60) || (moveData.analogWalk < 60))) + { + g_CurrentPlayer->movecentrerelease = 1; + } + } + else if (moveData.speedVertaUp > 0) + { + bondviewCurrentPlayerUpdateSpeedVerta(-moveData.speedVertaUp); + + if ((moveData.canLookAhead) && ((moveData.analogWalk > 60) || (moveData.analogWalk < 60))) + { + g_CurrentPlayer->movecentrerelease = 1; + } + } + else + { + bondviewCurrentPlayerUpdateSpeedVerta(0); + } + + g_CurrentPlayer->vv_verta += g_CurrentPlayer->speedverta * g_GlobalTimerDelta * 3.5f; + + if ((in_tank_flag == 1) && (g_EnterTankAudioState == TANK_RUN_STATE_RUNNING) && (g_CurrentPlayer->vv_verta < -20.0f)) + { + g_CurrentPlayer->vv_verta = -20.0f; + } + } + } + + if (moveData.canNaturalTurn) + { + ftemp_nostack_sp8C = viGetFovY(); + ftemp_nostack_sp84 = (f32) moveData.analogTurn / 70.0f; + + if (ftemp_nostack_sp84 > 1) + { + ftemp_nostack_sp84 = 1; + } + else if (ftemp_nostack_sp84 < -1) + { + ftemp_nostack_sp84 = -1; + } + + if (ftemp_nostack_sp84 >= 0) + { + ftemp_nostack_sp84 *= ftemp_nostack_sp84; + } + else + { + ftemp_nostack_sp84 *= -ftemp_nostack_sp84; + } + + ftemp_nostack_sp88 = (ftemp_nostack_sp8C / FOV_Y_F); + g_CurrentPlayer->speedtheta = ftemp_nostack_sp84 * ftemp_nostack_sp88; + } + else if (moveData.aimTurnLeftSpeed > 0) + { + bondviewCurrentPlayerUpdateSpeedTheta(moveData.aimTurnLeftSpeed); + } + else if (moveData.aimTurnRightSpeed > 0) + { + bondviewCurrentPlayerUpdateSpeedTheta(-moveData.aimTurnRightSpeed); + } + else + { + bondviewCurrentPlayerUpdateSpeedTheta(0); + } + + if (in_tank_flag == 1) + { + if (g_EnterTankAudioState == TANK_RUN_STATE_RUNNING) + { + ftemp_nostack_sp80 = 0; + + if (moveData.canNaturalTurn) + { + ftemp_nostack_sp80 = g_CurrentPlayer->speedtheta * 0.3f; + } + else if (moveData.aimTurnLeftSpeed > 0) + { + ftemp_nostack_sp80 = sub_GAME_7F080228(1) * 0.3f; + } + else if (moveData.aimTurnRightSpeed > 0) + { + ftemp_nostack_sp80 = sub_GAME_7F080228(-1) * 0.3f; + } + + for (i_1=0; i_1speedtheta = g_TankTurnSpeed * TANK_VERT_ANGLE_RAD_FACTOR; + } + else + { + g_CurrentPlayer->speedtheta = 0; + } + } + + if (moveData.detonating) + { + g_CurrentPlayer->hands[GUNRIGHT].when_detonating_mines_is_0 = 0; + g_CurrentPlayer->hands[GUNRIGHT].weapon_current_animation = 0; + trigger_remote_mine_detonation(); + } + + canCycleWeapons = 1; + + if ((getPlayerCount() >= 2) && (get_scenario() == 2) && (bondinvIsAliveWithFlag())) + { + canCycleWeapons = 0; + } + + if (canCycleWeapons) + { + if (moveData.weaponBackOffset) + { + backstep_through_inventory(); + } + + if (moveData.weaponForwardOffset) + { + advance_through_inventory(); } } - // update health showtime - if (g_CurrentPlayer->healthshowtime >= 0) + if (moveData.canSwivelGun) { - if (g_CurrentPlayer->healthshowtime == 0) + g_CurrentPlayer->controldef = 0; + } + else if (moveData.canManualAim) + { + g_CurrentPlayer->controldef = 2; + } + + if (g_CurrentPlayer->controldef == 0) + { + gunSetAimType(0); + + if (moveData.canAutoAim + && redirect_get_BONDdata_autoaim_x() + && g_CurrentPlayer->autoaim_target_x + && bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_HAS_AUTO_AIM)) { - g_CurrentPlayer->field_29B8 = (s32)(bondviewGetCurrentPlayerHealth() * 8.0f); - if (g_CurrentPlayer->field_29B8 >= 8) - { - g_CurrentPlayer->field_29B8 = 7; - } + sp70 = g_CurrentPlayer->autoaimx; + } + else + { + sp70 = g_CurrentPlayer->speedtheta * 0.3f; } - if (!g_CurrentPlayer->bonddead) + if (moveData.canAutoAim + && redirect_get_BONDdata_autoaim_y() + && g_CurrentPlayer->autoaim_target_y + && bondwalkItemCheckBitflags(getCurrentPlayerWeaponId(GUNRIGHT), WEAPONSTATBITFLAG_HAS_AUTO_AIM)) { - timerelated = &D_80036794[g_CurrentPlayer->field_29B8]; - unk_field14_2 = timerelated->unk0; - if ((g_CurrentPlayer->healthshowtime >= unk_field14_2) && (timerelated->unk4 >= g_CurrentPlayer->healthshowtime)) - { - g_CurrentPlayer->apparenthealth = g_CurrentPlayer->oldhealth; - g_CurrentPlayer->apparentarmour = g_CurrentPlayer->oldarmour; - g_CurrentPlayer->healthshowtime += g_ClockTimer; - return; - } - if ((g_CurrentPlayer->healthshowtime >= unk_field14_2) && (timerelated->unk8 >= g_CurrentPlayer->healthshowtime)) - { - g_CurrentPlayer->apparenthealth = g_CurrentPlayer->bondhealth; - g_CurrentPlayer->apparentarmour = g_CurrentPlayer->bondarmour; - g_CurrentPlayer->healthshowtime += g_ClockTimer; - return; - } - g_CurrentPlayer->healthshowtime = -1; - return; + ftemp_nostack_sp78 = g_CurrentPlayer->autoaimy; + } + else + { + ftemp_nostack_sp78 = -g_CurrentPlayer->speedverta * 0.1f; } - g_CurrentPlayer->healthshowtime = -1; + + sub_GAME_7F067F58(sp70, ftemp_nostack_sp78, MAX_AIMLOCK_SPEED_DEFAULT); + } + else if (g_CurrentPlayer->controldef == 2) + { + gunSetAimType(0); + sub_GAME_7F067FBC(((f32) moveData.controlStickXRaw * 0.65f) / 80.0f, ((f32) moveData.controlStickYRaw * 0.65f) / 80.0f); } } -#endif -#ifdef VERSION_JP -/* looks a lot like the EU version */ -GLOBAL_ASM( -.text -glabel sub_GAME_7F083FC8 -/* 0B9148 7F0845D8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B914C 7F0845DC 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9150 7F0845E0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0B9154 7F0845E4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B9158 7F0845E8 44802000 */ mtc1 $zero, $f4 -/* 0B915C 7F0845EC C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B9160 7F0845F0 4600203E */ c.le.s $f4, $f0 -/* 0B9164 7F0845F4 00000000 */ nop -/* 0B9168 7F0845F8 45020090 */ bc1fl .Ljp7F08483C -/* 0B916C 7F0845FC C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B9170 7F084600 44803000 */ mtc1 $zero, $f6 -/* 0B9174 7F084604 24040008 */ li $a0, 8 -/* 0B9178 7F084608 46003032 */ c.eq.s $f6, $f0 -/* 0B917C 7F08460C 00000000 */ nop -/* 0B9180 7F084610 45020027 */ bc1fl .Ljp7F0846B0 -/* 0B9184 7F084614 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B9188 7F084618 0FC1A5B8 */ jal set_unset_ammo_on_screen_setting -/* 0B918C 7F08461C 00002825 */ move $a1, $zero -/* 0B9190 7F084620 24040010 */ li $a0, 16 -/* 0B9194 7F084624 0FC1AAE5 */ jal set_unset_bitflags -/* 0B9198 7F084628 00002825 */ move $a1, $zero -/* 0B919C 7F08462C 0FC22AAD */ jal hudmsgsSetOff -/* 0B91A0 7F084630 24040004 */ li $a0, 4 -/* 0B91A4 7F084634 0FC22C48 */ jal sub_GAME_7F08A944 -/* 0B91A8 7F084638 24040004 */ li $a0, 4 -/* 0B91AC 7F08463C 24040008 */ li $a0, 8 -/* 0B91B0 7F084640 0FC15997 */ jal countdownTimerSetVisible -/* 0B91B4 7F084644 00002825 */ move $a1, $zero -/* 0B91B8 7F084648 0FC22A89 */ jal bondviewGetCurrentPlayerHealth -/* 0B91BC 7F08464C 00000000 */ nop -/* 0B91C0 7F084650 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 0B91C4 7F084654 44814000 */ mtc1 $at, $f8 -/* 0B91C8 7F084658 3C048008 */ lui $a0, %hi(g_CurrentPlayer) # $a0, 0x8008 -/* 0B91CC 7F08465C 2484A120 */ addiu $a0, %lo(g_CurrentPlayer) # addiu $a0, $a0, -0x5ee0 -/* 0B91D0 7F084660 46080282 */ mul.s $f10, $f0, $f8 -/* 0B91D4 7F084664 8C980000 */ lw $t8, ($a0) -/* 0B91D8 7F084668 24190007 */ li $t9, 7 -/* 0B91DC 7F08466C 4600510D */ trunc.w.s $f4, $f10 -/* 0B91E0 7F084670 440F2000 */ mfc1 $t7, $f4 -/* 0B91E4 7F084674 00000000 */ nop -/* 0B91E8 7F084678 AF0F29D4 */ sw $t7, 0x29d4($t8) -/* 0B91EC 7F08467C 8C820000 */ lw $v0, ($a0) -/* 0B91F0 7F084680 8C4329D4 */ lw $v1, 0x29d4($v0) -/* 0B91F4 7F084684 28610008 */ slti $at, $v1, 8 -/* 0B91F8 7F084688 14200004 */ bnez $at, .Ljp7F08469C -/* 0B91FC 7F08468C 00000000 */ nop -/* 0B9200 7F084690 AC5929D4 */ sw $t9, 0x29d4($v0) -/* 0B9204 7F084694 8C820000 */ lw $v0, ($a0) -/* 0B9208 7F084698 8C4329D4 */ lw $v1, 0x29d4($v0) -.Ljp7F08469C: -/* 0B920C 7F08469C 04630004 */ bgezl $v1, .Ljp7F0846B0 -/* 0B9210 7F0846A0 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B9214 7F0846A4 AC4029D4 */ sw $zero, 0x29d4($v0) -/* 0B9218 7F0846A8 8C820000 */ lw $v0, ($a0) -/* 0B921C 7F0846AC 8C4800D8 */ lw $t0, 0xd8($v0) -.Ljp7F0846B0: -/* 0B9220 7F0846B0 3C0B8003 */ lui $t3, %hi(D_80036634) # $t3, 0x8003 -/* 0B9224 7F0846B4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B9228 7F0846B8 15000045 */ bnez $t0, .Ljp7F0847D0 -/* 0B922C 7F0846BC 240400FF */ li $a0, 255 -/* 0B9230 7F0846C0 8C4929D4 */ lw $t1, 0x29d4($v0) -/* 0B9234 7F0846C4 256B6674 */ addiu $t3, %lo(D_80036634) # addiu $t3, $t3, 0x6674 -/* 0B9238 7F0846C8 C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B923C 7F0846CC 00095080 */ sll $t2, $t1, 2 -/* 0B9240 7F0846D0 01495023 */ subu $t2, $t2, $t1 -/* 0B9244 7F0846D4 000A5080 */ sll $t2, $t2, 2 -/* 0B9248 7F0846D8 01495023 */ subu $t2, $t2, $t1 -/* 0B924C 7F0846DC 000A5080 */ sll $t2, $t2, 2 -/* 0B9250 7F0846E0 014B1821 */ addu $v1, $t2, $t3 -/* 0B9254 7F0846E4 C4660008 */ lwc1 $f6, 8($v1) -/* 0B9258 7F0846E8 4606003E */ c.le.s $f0, $f6 -/* 0B925C 7F0846EC 00000000 */ nop -/* 0B9260 7F0846F0 45030007 */ bc1tl .Ljp7F084710 -/* 0B9264 7F0846F4 C4620010 */ lwc1 $f2, 0x10($v1) -/* 0B9268 7F0846F8 C4680018 */ lwc1 $f8, 0x18($v1) -/* 0B926C 7F0846FC 4608003E */ c.le.s $f0, $f8 -/* 0B9270 7F084700 00000000 */ nop -/* 0B9274 7F084704 45020033 */ bc1fl .Ljp7F0847D4 -/* 0B9278 7F084708 44813000 */ mtc1 $at, $f6 -/* 0B927C 7F08470C C4620010 */ lwc1 $f2, 0x10($v1) -.Ljp7F084710: -/* 0B9280 7F084710 4600103E */ c.le.s $f2, $f0 -/* 0B9284 7F084714 00000000 */ nop -/* 0B9288 7F084718 4502001F */ bc1fl .Ljp7F084798 -/* 0B928C 7F08471C 8C4C01C8 */ lw $t4, 0x1c8($v0) -/* 0B9290 7F084720 C4700018 */ lwc1 $f16, 0x18($v1) -/* 0B9294 7F084724 4610003E */ c.le.s $f0, $f16 -/* 0B9298 7F084728 00000000 */ nop -/* 0B929C 7F08472C 4502001A */ bc1fl .Ljp7F084798 -/* 0B92A0 7F084730 8C4C01C8 */ lw $t4, 0x1c8($v0) -/* 0B92A4 7F084734 46020301 */ sub.s $f12, $f0, $f2 -/* 0B92A8 7F084738 C46E0014 */ lwc1 $f14, 0x14($v1) -/* 0B92AC 7F08473C 46028481 */ sub.s $f18, $f16, $f2 -/* 0B92B0 7F084740 460E603C */ c.lt.s $f12, $f14 -/* 0B92B4 7F084744 00000000 */ nop -/* 0B92B8 7F084748 45020006 */ bc1fl .Ljp7F084764 -/* 0B92BC 7F08474C 460C9201 */ sub.s $f8, $f18, $f12 -/* 0B92C0 7F084750 C46A001C */ lwc1 $f10, 0x1c($v1) -/* 0B92C4 7F084754 460C5102 */ mul.s $f4, $f10, $f12 -/* 0B92C8 7F084758 10000006 */ b .Ljp7F084774 -/* 0B92CC 7F08475C 460E2003 */ div.s $f0, $f4, $f14 -/* 0B92D0 7F084760 460C9201 */ sub.s $f8, $f18, $f12 -.Ljp7F084764: -/* 0B92D4 7F084764 C466001C */ lwc1 $f6, 0x1c($v1) -/* 0B92D8 7F084768 460E9101 */ sub.s $f4, $f18, $f14 -/* 0B92DC 7F08476C 46083282 */ mul.s $f10, $f6, $f8 -/* 0B92E0 7F084770 46045003 */ div.s $f0, $f10, $f4 -.Ljp7F084774: -/* 0B92E4 7F084774 44070000 */ mfc1 $a3, $f0 -/* 0B92E8 7F084778 8C640020 */ lw $a0, 0x20($v1) -/* 0B92EC 7F08477C 8C650024 */ lw $a1, 0x24($v1) -/* 0B92F0 7F084780 0FC20370 */ jal currentPlayerSetFadeColour -/* 0B92F4 7F084784 8C660028 */ lw $a2, 0x28($v1) -/* 0B92F8 7F084788 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B92FC 7F08478C 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9300 7F084790 C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B9304 7F084794 8C4C01C8 */ lw $t4, 0x1c8($v0) -.Ljp7F084798: -/* 0B9308 7F084798 3C018005 */ lui $at, %hi(jpD_800484D0) # -0.000000 -/* 0B930C 7F08479C 15800006 */ bnez $t4, .Ljp7F0847B8 -/* 0B9310 7F0847A0 00000000 */ nop -/* 0B9314 7F0847A4 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # -0.000000 -/* 0B9318 7F0847A8 C42683B4 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B931C 7F0847AC 46060200 */ add.s $f8, $f0, $f6 -/* 0B9320 7F0847B0 10000004 */ b .Ljp7F0847C4 -/* 0B9324 7F0847B4 E44800F4 */ swc1 $f8, 0xf4($v0) -.Ljp7F0847B8: -/* 0B9328 7F0847B8 C42A84D0 */ lwc1 $f10, %lo(jpD_800484D0)($at) -/* 0B932C 7F0847BC 460A0100 */ add.s $f4, $f0, $f10 -/* 0B9330 7F0847C0 E44400F4 */ swc1 $f4, 0xf4($v0) -.Ljp7F0847C4: -/* 0B9334 7F0847C4 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B9338 7F0847C8 1000001B */ b .Ljp7F084838 -/* 0B933C 7F0847CC 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -.Ljp7F0847D0: -/* 0B9340 7F0847D0 44813000 */ mtc1 $at, $f6 -.Ljp7F0847D4: -/* 0B9344 7F0847D4 240500FF */ li $a1, 255 -/* 0B9348 7F0847D8 240600FF */ li $a2, 255 -/* 0B934C 7F0847DC 24070000 */ li $a3, 0 -/* 0B9350 7F0847E0 0FC20370 */ jal currentPlayerSetFadeColour -/* 0B9354 7F0847E4 E44600F4 */ swc1 $f6, 0xf4($v0) -/* 0B9358 7F0847E8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B935C 7F0847EC 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9360 7F0847F0 24040008 */ li $a0, 8 -/* 0B9364 7F0847F4 8C4D00D8 */ lw $t5, 0xd8($v0) -/* 0B9368 7F0847F8 55A00010 */ bnezl $t5, .Ljp7F08483C -/* 0B936C 7F0847FC C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B9370 7F084800 0FC1A5B8 */ jal set_unset_ammo_on_screen_setting -/* 0B9374 7F084804 24050001 */ li $a1, 1 -/* 0B9378 7F084808 24040010 */ li $a0, 16 -/* 0B937C 7F08480C 0FC1AAE5 */ jal set_unset_bitflags -/* 0B9380 7F084810 24050001 */ li $a1, 1 -/* 0B9384 7F084814 0FC22AA6 */ jal hudmsgsSetOn -/* 0B9388 7F084818 24040004 */ li $a0, 4 -/* 0B938C 7F08481C 0FC22C41 */ jal sub_GAME_7F08A928 -/* 0B9390 7F084820 24040004 */ li $a0, 4 -/* 0B9394 7F084824 24040008 */ li $a0, 8 -/* 0B9398 7F084828 0FC15997 */ jal countdownTimerSetVisible -/* 0B939C 7F08482C 24050001 */ li $a1, 1 -/* 0B93A0 7F084830 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B93A4 7F084834 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -.Ljp7F084838: -/* 0B93A8 7F084838 C44000F8 */ lwc1 $f0, 0xf8($v0) -.Ljp7F08483C: -/* 0B93AC 7F08483C 44804000 */ mtc1 $zero, $f8 -/* 0B93B0 7F084840 00000000 */ nop -/* 0B93B4 7F084844 4600403E */ c.le.s $f8, $f0 -/* 0B93B8 7F084848 00000000 */ nop -/* 0B93BC 7F08484C 4502006D */ bc1fl .Ljp7F084A04 -/* 0B93C0 7F084850 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B93C4 7F084854 44805000 */ mtc1 $zero, $f10 -/* 0B93C8 7F084858 00000000 */ nop -/* 0B93CC 7F08485C 46005032 */ c.eq.s $f10, $f0 -/* 0B93D0 7F084860 00000000 */ nop -/* 0B93D4 7F084864 4502001D */ bc1fl .Ljp7F0848DC -/* 0B93D8 7F084868 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B93DC 7F08486C 0FC22A89 */ jal bondviewGetCurrentPlayerHealth -/* 0B93E0 7F084870 00000000 */ nop -/* 0B93E4 7F084874 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 0B93E8 7F084878 44812000 */ mtc1 $at, $f4 -/* 0B93EC 7F08487C 3C188008 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8008 -/* 0B93F0 7F084880 8F18A120 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B93F4 7F084884 46040182 */ mul.s $f6, $f0, $f4 -/* 0B93F8 7F084888 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B93FC 7F08488C 24190007 */ li $t9, 7 -/* 0B9400 7F084890 4600320D */ trunc.w.s $f8, $f6 -/* 0B9404 7F084894 440F4000 */ mfc1 $t7, $f8 -/* 0B9408 7F084898 00000000 */ nop -/* 0B940C 7F08489C AF0F29B8 */ sw $t7, 0x29b8($t8) -/* 0B9410 7F0848A0 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9414 7F0848A4 8C4329B8 */ lw $v1, 0x29b8($v0) -/* 0B9418 7F0848A8 28610008 */ slti $at, $v1, 8 -/* 0B941C 7F0848AC 14200005 */ bnez $at, .Ljp7F0848C4 -/* 0B9420 7F0848B0 00000000 */ nop -/* 0B9424 7F0848B4 AC5929B8 */ sw $t9, 0x29b8($v0) -/* 0B9428 7F0848B8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B942C 7F0848BC 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9430 7F0848C0 8C4329B8 */ lw $v1, 0x29b8($v0) -.Ljp7F0848C4: -/* 0B9434 7F0848C4 04630005 */ bgezl $v1, .Ljp7F0848DC -/* 0B9438 7F0848C8 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B943C 7F0848CC AC4029B8 */ sw $zero, 0x29b8($v0) -/* 0B9440 7F0848D0 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B9444 7F0848D4 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9448 7F0848D8 8C4800D8 */ lw $t0, 0xd8($v0) -.Ljp7F0848DC: -/* 0B944C 7F0848DC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B9450 7F0848E0 55000045 */ bnezl $t0, .Ljp7F0849F8 -/* 0B9454 7F0848E4 44815000 */ mtc1 $at, $f10 -/* 0B9458 7F0848E8 8C4929B8 */ lw $t1, 0x29b8($v0) -/* 0B945C 7F0848EC 3C0B8003 */ lui $t3, %hi(D_80036794) # $t3, 0x8003 -/* 0B9460 7F0848F0 256B67D4 */ addiu $t3, %lo(D_80036794) # addiu $t3, $t3, 0x67d4 -/* 0B9464 7F0848F4 00095080 */ sll $t2, $t1, 2 -/* 0B9468 7F0848F8 01495023 */ subu $t2, $t2, $t1 -/* 0B946C 7F0848FC 000A5080 */ sll $t2, $t2, 2 -/* 0B9470 7F084900 014B1821 */ addu $v1, $t2, $t3 -/* 0B9474 7F084904 8C6C0000 */ lw $t4, ($v1) -/* 0B9478 7F084908 C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B947C 7F08490C 448C5000 */ mtc1 $t4, $f10 -/* 0B9480 7F084910 00000000 */ nop -/* 0B9484 7F084914 468050A0 */ cvt.s.w $f2, $f10 -/* 0B9488 7F084918 4600103E */ c.le.s $f2, $f0 -/* 0B948C 7F08491C 00000000 */ nop -/* 0B9490 7F084920 45020018 */ bc1fl .Ljp7F084984 -/* 0B9494 7F084924 4600103E */ c.le.s $f2, $f0 -/* 0B9498 7F084928 8C6D0004 */ lw $t5, 4($v1) -/* 0B949C 7F08492C 448D2000 */ mtc1 $t5, $f4 -/* 0B94A0 7F084930 00000000 */ nop -/* 0B94A4 7F084934 468021A0 */ cvt.s.w $f6, $f4 -/* 0B94A8 7F084938 4606003E */ c.le.s $f0, $f6 -/* 0B94AC 7F08493C 00000000 */ nop -/* 0B94B0 7F084940 45020010 */ bc1fl .Ljp7F084984 -/* 0B94B4 7F084944 4600103E */ c.le.s $f2, $f0 -/* 0B94B8 7F084948 C44800E4 */ lwc1 $f8, 0xe4($v0) -/* 0B94BC 7F08494C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B94C0 7F084950 E44800EC */ swc1 $f8, 0xec($v0) -/* 0B94C4 7F084954 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B94C8 7F084958 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B94CC 7F08495C C44A00E8 */ lwc1 $f10, 0xe8($v0) -/* 0B94D0 7F084960 E44A00F0 */ swc1 $f10, 0xf0($v0) -/* 0B94D4 7F084964 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B94D8 7F084968 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B94DC 7F08496C C42683B4 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B94E0 7F084970 C44400F8 */ lwc1 $f4, 0xf8($v0) -/* 0B94E4 7F084974 46062200 */ add.s $f8, $f4, $f6 -/* 0B94E8 7F084978 10000021 */ b .Ljp7F084A00 -/* 0B94EC 7F08497C E44800F8 */ swc1 $f8, 0xf8($v0) -/* 0B94F0 7F084980 4600103E */ c.le.s $f2, $f0 -.Ljp7F084984: -/* 0B94F4 7F084984 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B94F8 7F084988 45020018 */ bc1fl .Ljp7F0849EC -/* 0B94FC 7F08498C 44814000 */ mtc1 $at, $f8 -/* 0B9500 7F084990 8C6E0008 */ lw $t6, 8($v1) -/* 0B9504 7F084994 448E5000 */ mtc1 $t6, $f10 -/* 0B9508 7F084998 00000000 */ nop -/* 0B950C 7F08499C 46805120 */ cvt.s.w $f4, $f10 -/* 0B9510 7F0849A0 4604003E */ c.le.s $f0, $f4 -/* 0B9514 7F0849A4 00000000 */ nop -/* 0B9518 7F0849A8 45020010 */ bc1fl .Ljp7F0849EC -/* 0B951C 7F0849AC 44814000 */ mtc1 $at, $f8 -/* 0B9520 7F0849B0 C44600DC */ lwc1 $f6, 0xdc($v0) -/* 0B9524 7F0849B4 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B9528 7F0849B8 E44600EC */ swc1 $f6, 0xec($v0) -/* 0B952C 7F0849BC 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B9530 7F0849C0 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9534 7F0849C4 C44800E0 */ lwc1 $f8, 0xe0($v0) -/* 0B9538 7F0849C8 E44800F0 */ swc1 $f8, 0xf0($v0) -/* 0B953C 7F0849CC 3C028008 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8008 -/* 0B9540 7F0849D0 8C42A120 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9544 7F0849D4 C42483B4 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B9548 7F0849D8 C44A00F8 */ lwc1 $f10, 0xf8($v0) -/* 0B954C 7F0849DC 46045180 */ add.s $f6, $f10, $f4 -/* 0B9550 7F0849E0 10000007 */ b .Ljp7F084A00 -/* 0B9554 7F0849E4 E44600F8 */ swc1 $f6, 0xf8($v0) -/* 0B9558 7F0849E8 44814000 */ mtc1 $at, $f8 -.Ljp7F0849EC: -/* 0B955C 7F0849EC 10000004 */ b .Ljp7F084A00 -/* 0B9560 7F0849F0 E44800F8 */ swc1 $f8, 0xf8($v0) -/* 0B9564 7F0849F4 44815000 */ mtc1 $at, $f10 -.Ljp7F0849F8: -/* 0B9568 7F0849F8 00000000 */ nop -/* 0B956C 7F0849FC E44A00F8 */ swc1 $f10, 0xf8($v0) -.Ljp7F084A00: -/* 0B9570 7F084A00 8FBF0014 */ lw $ra, 0x14($sp) -.Ljp7F084A04: -/* 0B9574 7F084A04 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0B9578 7F084A08 03E00008 */ jr $ra -/* 0B957C 7F084A0C 00000000 */ nop -) -#endif -#ifdef VERSION_EU -#ifdef NONMATCHING -/* mostly regalloc failures */ -void sub_GAME_7F083FC8(void) -{ - f32 frac; - f32 unk_field10; - f32 unk_field14; - s32 unk_field14_2; - f32 dmg_time_diff; - f32 unk_field18; - f32 unk_field_diff; - bondstruct_unk_80036794 * timerelated; - bondstruct_unk_80036634 * unknown; + +/** + * Perfect Dark playerTickDamageAndHealth + * + * NTSC address 7F083FC8. + * NTSC-J address 7F0845D8. + * EU address 7F08406C. +*/ +void bondviewPlayerTickDamageAndHealth(void) +{ // update damage showtime if (g_CurrentPlayer->damageshowtime >= 0) { + // 0: This is the first frame of damage if (g_CurrentPlayer->damageshowtime == 0) { - set_unset_ammo_on_screen_setting(8, 0); - set_unset_bitflags(0x10, 0); + gunSetGunAmmoVisible(GUNAMMOREASON_DAMAGE, FALSE); + gunSetSightVisible(GUNSIGHTREASON_DAMAGE, FALSE); hudmsgsSetOff(4); - sub_GAME_7F08A944(PLAYERFLAG_NOTIMER); + bondviewSetUpperTextDisplayFlag(PLAYERFLAG_NOTIMER); countdownTimerSetVisible(8, 0); g_CurrentPlayer->damagetype = (s32)(bondviewGetCurrentPlayerHealth() * 8.0f); + if (g_CurrentPlayer->damagetype >= 8) { g_CurrentPlayer->damagetype = 7; } - if (g_CurrentPlayer->damagetype < 0) { + +#if defined(VERSION_EU) || defined(VERSION_JP) + if (g_CurrentPlayer->damagetype < 0) + { g_CurrentPlayer->damagetype = 0; } +#endif } - if ((!g_CurrentPlayer->bonddead) && ((D_80036634[g_CurrentPlayer->damagetype].field_0x8 >= g_CurrentPlayer->damageshowtime) || (D_80036634[g_CurrentPlayer->damagetype].field_0x18 >= g_CurrentPlayer->damageshowtime))) +#ifdef VERSION_US + if ( + (g_DamageTypes[g_CurrentPlayer->damagetype].field_0x8 >= g_CurrentPlayer->damageshowtime) + || (g_DamageTypes[g_CurrentPlayer->damagetype].flashEndFrame >= g_CurrentPlayer->damageshowtime)) { - unknown = &D_80036634[g_CurrentPlayer->damagetype]; - unk_field10 = unknown->field_0x10; - if (g_CurrentPlayer->damageshowtime >= unk_field10) + if (!g_CurrentPlayer->bonddead) { - unk_field18 = unknown->field_0x18; - if (unk_field18 >= g_CurrentPlayer->damageshowtime) - { - unk_field14 = unknown->field_0x14; - dmg_time_diff = g_CurrentPlayer->damageshowtime; - dmg_time_diff = dmg_time_diff - unk_field10; - unk_field_diff = unk_field18 - unk_field10; - unk_field18 = dmg_time_diff; - - if (unk_field18 < unk_field14) - { - frac = (unknown->field_0x1c * ((f32) dmg_time_diff)) / ((f32) unk_field14); - } - else - { - frac = (unknown->field_0x1c * ((f32)(unk_field_diff - unk_field18))) / ((f32)(unk_field_diff - unk_field14)); - } +#else + if (!g_CurrentPlayer->bonddead + && ( + (g_DamageTypes[g_CurrentPlayer->damagetype].field_0x8 >= g_CurrentPlayer->damageshowtime) + || (g_DamageTypes[g_CurrentPlayer->damagetype].flashEndFrame >= g_CurrentPlayer->damageshowtime))) + { +#endif + if (g_CurrentPlayer->damageshowtime >= g_DamageTypes[g_CurrentPlayer->damagetype].flashStartFrame + && g_CurrentPlayer->damageshowtime <= g_DamageTypes[g_CurrentPlayer->damagetype].flashEndFrame) + { + f32 frac; +#ifdef VERSION_US + s32 flashdoneframes; + s32 totalframes; + s32 flashfullframe; +#else + f32 flashdoneframes; + f32 totalframes; + f32 flashfullframe; +#endif + + flashdoneframes = g_CurrentPlayer->damageshowtime - g_DamageTypes[g_CurrentPlayer->damagetype].flashStartFrame; + flashfullframe = g_DamageTypes[g_CurrentPlayer->damagetype].flashFullFrame; + totalframes = g_DamageTypes[g_CurrentPlayer->damagetype].flashEndFrame - g_DamageTypes[g_CurrentPlayer->damagetype].flashStartFrame; - currentPlayerSetFadeColour(unknown->field_0x20, unknown->field_0x24, unknown->field_0x28, frac); + if (flashdoneframes < flashfullframe) + { + frac = (g_DamageTypes[g_CurrentPlayer->damagetype].maxAlpha * (f32)flashdoneframes) / (f32)flashfullframe; + } + else + { + frac = (g_DamageTypes[g_CurrentPlayer->damagetype].maxAlpha * (f32)(totalframes - flashdoneframes)) / (f32)(totalframes - flashfullframe); } + + currentPlayerSetFadeColour( + g_DamageTypes[g_CurrentPlayer->damagetype].red, + g_DamageTypes[g_CurrentPlayer->damagetype].green, + g_DamageTypes[g_CurrentPlayer->damagetype].blue, + frac); + } +#ifdef VERSION_US } +#endif if (g_CurrentPlayer->watch_animation_state == 0) { +#if defined(VERSION_US) + g_CurrentPlayer->damageshowtime += g_ClockTimer; +#else g_CurrentPlayer->damageshowtime += g_GlobalTimerDelta; +#endif } else { +#if defined(VERSION_US) + g_CurrentPlayer->damageshowtime += speedgraphframes; +#else g_CurrentPlayer->damageshowtime += jpD_800484D0; +#endif } - } - else // (damage showtime is over) + else /* (damage showtime is over) */ { g_CurrentPlayer->damageshowtime = -1; - currentPlayerSetFadeColour(0xFF, 0xFF, 0xFF, 0.0f); + currentPlayerSetFadeColour(0xFF, 0xFF, 0xFF, 0); + if (!g_CurrentPlayer->bonddead) { - set_unset_ammo_on_screen_setting(8, 1); - set_unset_bitflags(0x10, 1); + gunSetGunAmmoVisible(GUNAMMOREASON_DAMAGE, TRUE); + gunSetSightVisible(GUNSIGHTREASON_DAMAGE, TRUE); hudmsgsSetOn(4); - sub_GAME_7F08A928(4); + bondviewClearUpperTextDisplayFlag(PLAYERFLAG_NOTIMER); countdownTimerSetVisible(8, 1); } } @@ -23500,943 +10439,143 @@ void sub_GAME_7F083FC8(void) // update health showtime if (g_CurrentPlayer->healthshowtime >= 0) { + // 0: This is the first frame of damage if (g_CurrentPlayer->healthshowtime == 0) { - g_CurrentPlayer->field_29B8 = (s32)(bondviewGetCurrentPlayerHealth() * 8.0f); - if (g_CurrentPlayer->field_29B8 >= 8) + g_CurrentPlayer->healthDamageType = (s32)(bondviewGetCurrentPlayerHealth() * 8.0f); + + if (g_CurrentPlayer->healthDamageType >= 8) { - g_CurrentPlayer->field_29B8 = 7; + g_CurrentPlayer->healthDamageType = 7; } - if (g_CurrentPlayer->field_29B8 < 0) + +#if defined(VERSION_EU) || defined(VERSION_JP) + if (g_CurrentPlayer->healthDamageType < 0) { - g_CurrentPlayer->field_29B8 = 0; + g_CurrentPlayer->healthDamageType = 0; } +#endif } if (!g_CurrentPlayer->bonddead) { - timerelated = &D_80036794[g_CurrentPlayer->field_29B8]; - unk_field14_2 = timerelated->unk0; - if ((g_CurrentPlayer->healthshowtime >= unk_field14_2) && (timerelated->unk4 >= g_CurrentPlayer->healthshowtime)) + if ((g_CurrentPlayer->healthshowtime >= g_HealthDamageTypes[g_CurrentPlayer->healthDamageType].updateStartFrame) + && (g_HealthDamageTypes[g_CurrentPlayer->healthDamageType].updateEndFrame >= g_CurrentPlayer->healthshowtime)) { g_CurrentPlayer->apparenthealth = g_CurrentPlayer->oldhealth; g_CurrentPlayer->apparentarmour = g_CurrentPlayer->oldarmour; +#if defined(VERSION_US) + g_CurrentPlayer->healthshowtime += g_ClockTimer; +#else g_CurrentPlayer->healthshowtime += g_GlobalTimerDelta; - return; +#endif } - if ((g_CurrentPlayer->healthshowtime >= unk_field14_2) && (timerelated->unk8 >= g_CurrentPlayer->healthshowtime)) + else if ((g_CurrentPlayer->healthshowtime >= g_HealthDamageTypes[g_CurrentPlayer->healthDamageType].updateStartFrame) + && (g_HealthDamageTypes[g_CurrentPlayer->healthDamageType].otherEndFrame >= g_CurrentPlayer->healthshowtime)) { g_CurrentPlayer->apparenthealth = g_CurrentPlayer->bondhealth; g_CurrentPlayer->apparentarmour = g_CurrentPlayer->bondarmour; +#if defined(VERSION_US) + g_CurrentPlayer->healthshowtime += g_ClockTimer; +#else g_CurrentPlayer->healthshowtime += g_GlobalTimerDelta; - return; +#endif } + else + { + g_CurrentPlayer->healthshowtime = -1; + } + } + else + { g_CurrentPlayer->healthshowtime = -1; - return; } - g_CurrentPlayer->healthshowtime = -1; } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F083FC8 -/* 0B6A5C 7F08406C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6A60 7F084070 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6A64 7F084074 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0B6A68 7F084078 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B6A6C 7F08407C 44802000 */ mtc1 $zero, $f4 -/* 0B6A70 7F084080 C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B6A74 7F084084 4600203E */ c.le.s $f4, $f0 -/* 0B6A78 7F084088 00000000 */ nop -/* 0B6A7C 7F08408C 45020090 */ bc1fl .L7F0842D0 -/* 0B6A80 7F084090 C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B6A84 7F084094 44803000 */ mtc1 $zero, $f6 -/* 0B6A88 7F084098 24040008 */ li $a0, 8 -/* 0B6A8C 7F08409C 46003032 */ c.eq.s $f6, $f0 -/* 0B6A90 7F0840A0 00000000 */ nop -/* 0B6A94 7F0840A4 45020027 */ bc1fl .L7F084144 -/* 0B6A98 7F0840A8 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B6A9C 7F0840AC 0FC1A622 */ jal set_unset_ammo_on_screen_setting -/* 0B6AA0 7F0840B0 00002825 */ move $a1, $zero -/* 0B6AA4 7F0840B4 24040010 */ li $a0, 16 -/* 0B6AA8 7F0840B8 0FC1AB4F */ jal set_unset_bitflags -/* 0B6AAC 7F0840BC 00002825 */ move $a1, $zero -/* 0B6AB0 7F0840C0 0FC22952 */ jal hudmsgsSetOff -/* 0B6AB4 7F0840C4 24040004 */ li $a0, 4 -/* 0B6AB8 7F0840C8 0FC22AE3 */ jal sub_GAME_7F08A944 -/* 0B6ABC 7F0840CC 24040004 */ li $a0, 4 -/* 0B6AC0 7F0840D0 24040008 */ li $a0, 8 -/* 0B6AC4 7F0840D4 0FC15910 */ jal countdownTimerSetVisible -/* 0B6AC8 7F0840D8 00002825 */ move $a1, $zero -/* 0B6ACC 7F0840DC 0FC2292E */ jal bondviewGetCurrentPlayerHealth -/* 0B6AD0 7F0840E0 00000000 */ nop -/* 0B6AD4 7F0840E4 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 0B6AD8 7F0840E8 44814000 */ mtc1 $at, $f8 -/* 0B6ADC 7F0840EC 3C048007 */ lui $a0, %hi(g_CurrentPlayer) # $a0, 0x8007 -/* 0B6AE0 7F0840F0 24848BC0 */ addiu $a0, %lo(g_CurrentPlayer) # addiu $a0, $a0, -0x7440 -/* 0B6AE4 7F0840F4 46080282 */ mul.s $f10, $f0, $f8 -/* 0B6AE8 7F0840F8 8C980000 */ lw $t8, ($a0) -/* 0B6AEC 7F0840FC 24190007 */ li $t9, 7 -/* 0B6AF0 7F084100 4600510D */ trunc.w.s $f4, $f10 -/* 0B6AF4 7F084104 440F2000 */ mfc1 $t7, $f4 -/* 0B6AF8 7F084108 00000000 */ nop -/* 0B6AFC 7F08410C AF0F29CC */ sw $t7, 0x29cc($t8) -/* 0B6B00 7F084110 8C820000 */ lw $v0, ($a0) -/* 0B6B04 7F084114 8C4329CC */ lw $v1, 0x29cc($v0) -/* 0B6B08 7F084118 28610008 */ slti $at, $v1, 8 -/* 0B6B0C 7F08411C 14200004 */ bnez $at, .L7F084130 -/* 0B6B10 7F084120 00000000 */ nop -/* 0B6B14 7F084124 AC5929CC */ sw $t9, 0x29cc($v0) -/* 0B6B18 7F084128 8C820000 */ lw $v0, ($a0) -/* 0B6B1C 7F08412C 8C4329CC */ lw $v1, 0x29cc($v0) -.L7F084130: -/* 0B6B20 7F084130 04630004 */ bgezl $v1, .L7F084144 -/* 0B6B24 7F084134 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B6B28 7F084138 AC4029CC */ sw $zero, 0x29cc($v0) -/* 0B6B2C 7F08413C 8C820000 */ lw $v0, ($a0) -/* 0B6B30 7F084140 8C4800D8 */ lw $t0, 0xd8($v0) -.L7F084144: -/* 0B6B34 7F084144 3C0B8003 */ lui $t3, %hi(D_80036634) # $t3, 0x8003 -/* 0B6B38 7F084148 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6B3C 7F08414C 15000045 */ bnez $t0, .L7F084264 -/* 0B6B40 7F084150 240400FF */ li $a0, 255 -/* 0B6B44 7F084154 8C4929CC */ lw $t1, 0x29cc($v0) -/* 0B6B48 7F084158 256B1B84 */ addiu $t3, %lo(D_80036634) # addiu $t3, $t3, 0x1b84 -/* 0B6B4C 7F08415C C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B6B50 7F084160 00095080 */ sll $t2, $t1, 2 -/* 0B6B54 7F084164 01495023 */ subu $t2, $t2, $t1 -/* 0B6B58 7F084168 000A5080 */ sll $t2, $t2, 2 -/* 0B6B5C 7F08416C 01495023 */ subu $t2, $t2, $t1 -/* 0B6B60 7F084170 000A5080 */ sll $t2, $t2, 2 -/* 0B6B64 7F084174 014B1821 */ addu $v1, $t2, $t3 -/* 0B6B68 7F084178 C4660008 */ lwc1 $f6, 8($v1) -/* 0B6B6C 7F08417C 4606003E */ c.le.s $f0, $f6 -/* 0B6B70 7F084180 00000000 */ nop -/* 0B6B74 7F084184 45030007 */ bc1tl .L7F0841A4 -/* 0B6B78 7F084188 C4620010 */ lwc1 $f2, 0x10($v1) -/* 0B6B7C 7F08418C C4680018 */ lwc1 $f8, 0x18($v1) -/* 0B6B80 7F084190 4608003E */ c.le.s $f0, $f8 -/* 0B6B84 7F084194 00000000 */ nop -/* 0B6B88 7F084198 45020033 */ bc1fl .L7F084268 -/* 0B6B8C 7F08419C 44813000 */ mtc1 $at, $f6 -/* 0B6B90 7F0841A0 C4620010 */ lwc1 $f2, 0x10($v1) -.L7F0841A4: -/* 0B6B94 7F0841A4 4600103E */ c.le.s $f2, $f0 -/* 0B6B98 7F0841A8 00000000 */ nop -/* 0B6B9C 7F0841AC 4502001F */ bc1fl .L7F08422C -/* 0B6BA0 7F0841B0 8C4C01C8 */ lw $t4, 0x1c8($v0) -/* 0B6BA4 7F0841B4 C4700018 */ lwc1 $f16, 0x18($v1) -/* 0B6BA8 7F0841B8 4610003E */ c.le.s $f0, $f16 -/* 0B6BAC 7F0841BC 00000000 */ nop -/* 0B6BB0 7F0841C0 4502001A */ bc1fl .L7F08422C -/* 0B6BB4 7F0841C4 8C4C01C8 */ lw $t4, 0x1c8($v0) -/* 0B6BB8 7F0841C8 46020301 */ sub.s $f12, $f0, $f2 -/* 0B6BBC 7F0841CC C46E0014 */ lwc1 $f14, 0x14($v1) -/* 0B6BC0 7F0841D0 46028481 */ sub.s $f18, $f16, $f2 -/* 0B6BC4 7F0841D4 460E603C */ c.lt.s $f12, $f14 -/* 0B6BC8 7F0841D8 00000000 */ nop -/* 0B6BCC 7F0841DC 45020006 */ bc1fl .L7F0841F8 -/* 0B6BD0 7F0841E0 460C9201 */ sub.s $f8, $f18, $f12 -/* 0B6BD4 7F0841E4 C46A001C */ lwc1 $f10, 0x1c($v1) -/* 0B6BD8 7F0841E8 460C5102 */ mul.s $f4, $f10, $f12 -/* 0B6BDC 7F0841EC 10000006 */ b .L7F084208 -/* 0B6BE0 7F0841F0 460E2003 */ div.s $f0, $f4, $f14 -/* 0B6BE4 7F0841F4 460C9201 */ sub.s $f8, $f18, $f12 -.L7F0841F8: -/* 0B6BE8 7F0841F8 C466001C */ lwc1 $f6, 0x1c($v1) -/* 0B6BEC 7F0841FC 460E9101 */ sub.s $f4, $f18, $f14 -/* 0B6BF0 7F084200 46083282 */ mul.s $f10, $f6, $f8 -/* 0B6BF4 7F084204 46045003 */ div.s $f0, $f10, $f4 -.L7F084208: -/* 0B6BF8 7F084208 44070000 */ mfc1 $a3, $f0 -/* 0B6BFC 7F08420C 8C640020 */ lw $a0, 0x20($v1) -/* 0B6C00 7F084210 8C650024 */ lw $a1, 0x24($v1) -/* 0B6C04 7F084214 0FC20215 */ jal currentPlayerSetFadeColour -/* 0B6C08 7F084218 8C660028 */ lw $a2, 0x28($v1) -/* 0B6C0C 7F08421C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6C10 7F084220 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6C14 7F084224 C44000F4 */ lwc1 $f0, 0xf4($v0) -/* 0B6C18 7F084228 8C4C01C8 */ lw $t4, 0x1c8($v0) -.L7F08422C: -/* 0B6C1C 7F08422C 3C018004 */ li $at, 0x80040000 # -0.000000 -/* 0B6C20 7F084230 15800006 */ bnez $t4, .L7F08424C -/* 0B6C24 7F084234 00000000 */ nop -/* 0B6C28 7F084238 3C018004 */ li $at, 0x80040000 # -0.000000 -/* 0B6C2C 7F08423C C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B6C30 7F084240 46060200 */ add.s $f8, $f0, $f6 -/* 0B6C34 7F084244 10000004 */ b .L7F084258 -/* 0B6C38 7F084248 E44800F4 */ swc1 $f8, 0xf4($v0) -.L7F08424C: -/* 0B6C3C 7F08424C C42A1120 */ lwc1 $f10, %lo(jpD_800484D0)($at) -/* 0B6C40 7F084250 460A0100 */ add.s $f4, $f0, $f10 -/* 0B6C44 7F084254 E44400F4 */ swc1 $f4, 0xf4($v0) -.L7F084258: -/* 0B6C48 7F084258 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6C4C 7F08425C 1000001B */ b .L7F0842CC -/* 0B6C50 7F084260 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -.L7F084264: -/* 0B6C54 7F084264 44813000 */ mtc1 $at, $f6 -.L7F084268: -/* 0B6C58 7F084268 240500FF */ li $a1, 255 -/* 0B6C5C 7F08426C 240600FF */ li $a2, 255 -/* 0B6C60 7F084270 24070000 */ li $a3, 0 -/* 0B6C64 7F084274 0FC20215 */ jal currentPlayerSetFadeColour -/* 0B6C68 7F084278 E44600F4 */ swc1 $f6, 0xf4($v0) -/* 0B6C6C 7F08427C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6C70 7F084280 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6C74 7F084284 24040008 */ li $a0, 8 -/* 0B6C78 7F084288 8C4D00D8 */ lw $t5, 0xd8($v0) -/* 0B6C7C 7F08428C 55A00010 */ bnezl $t5, .L7F0842D0 -/* 0B6C80 7F084290 C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B6C84 7F084294 0FC1A622 */ jal set_unset_ammo_on_screen_setting -/* 0B6C88 7F084298 24050001 */ li $a1, 1 -/* 0B6C8C 7F08429C 24040010 */ li $a0, 16 -/* 0B6C90 7F0842A0 0FC1AB4F */ jal set_unset_bitflags -/* 0B6C94 7F0842A4 24050001 */ li $a1, 1 -/* 0B6C98 7F0842A8 0FC2294B */ jal hudmsgsSetOn -/* 0B6C9C 7F0842AC 24040004 */ li $a0, 4 -/* 0B6CA0 7F0842B0 0FC22ADC */ jal sub_GAME_7F08A928 -/* 0B6CA4 7F0842B4 24040004 */ li $a0, 4 -/* 0B6CA8 7F0842B8 24040008 */ li $a0, 8 -/* 0B6CAC 7F0842BC 0FC15910 */ jal countdownTimerSetVisible -/* 0B6CB0 7F0842C0 24050001 */ li $a1, 1 -/* 0B6CB4 7F0842C4 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6CB8 7F0842C8 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -.L7F0842CC: -/* 0B6CBC 7F0842CC C44000F8 */ lwc1 $f0, 0xf8($v0) -.L7F0842D0: -/* 0B6CC0 7F0842D0 44804000 */ mtc1 $zero, $f8 -/* 0B6CC4 7F0842D4 00000000 */ nop -/* 0B6CC8 7F0842D8 4600403E */ c.le.s $f8, $f0 -/* 0B6CCC 7F0842DC 00000000 */ nop -/* 0B6CD0 7F0842E0 4502006D */ bc1fl .L7F084498 -/* 0B6CD4 7F0842E4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0B6CD8 7F0842E8 44805000 */ mtc1 $zero, $f10 -/* 0B6CDC 7F0842EC 00000000 */ nop -/* 0B6CE0 7F0842F0 46005032 */ c.eq.s $f10, $f0 -/* 0B6CE4 7F0842F4 00000000 */ nop -/* 0B6CE8 7F0842F8 4502001D */ bc1fl .L7F084370 -/* 0B6CEC 7F0842FC 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B6CF0 7F084300 0FC2292E */ jal bondviewGetCurrentPlayerHealth -/* 0B6CF4 7F084304 00000000 */ nop -/* 0B6CF8 7F084308 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 0B6CFC 7F08430C 44812000 */ mtc1 $at, $f4 -/* 0B6D00 7F084310 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0B6D04 7F084314 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0B6D08 7F084318 46040182 */ mul.s $f6, $f0, $f4 -/* 0B6D0C 7F08431C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6D10 7F084320 24190007 */ li $t9, 7 -/* 0B6D14 7F084324 4600320D */ trunc.w.s $f8, $f6 -/* 0B6D18 7F084328 440F4000 */ mfc1 $t7, $f8 -/* 0B6D1C 7F08432C 00000000 */ nop -/* 0B6D20 7F084330 AF0F29B0 */ sw $t7, 0x29b0($t8) -/* 0B6D24 7F084334 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6D28 7F084338 8C4329B0 */ lw $v1, 0x29b0($v0) -/* 0B6D2C 7F08433C 28610008 */ slti $at, $v1, 8 -/* 0B6D30 7F084340 14200005 */ bnez $at, .L7F084358 -/* 0B6D34 7F084344 00000000 */ nop -/* 0B6D38 7F084348 AC5929B0 */ sw $t9, 0x29b0($v0) -/* 0B6D3C 7F08434C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6D40 7F084350 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6D44 7F084354 8C4329B0 */ lw $v1, 0x29b0($v0) -.L7F084358: -/* 0B6D48 7F084358 04630005 */ bgezl $v1, .L7F084370 -/* 0B6D4C 7F08435C 8C4800D8 */ lw $t0, 0xd8($v0) -/* 0B6D50 7F084360 AC4029B0 */ sw $zero, 0x29b0($v0) -/* 0B6D54 7F084364 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6D58 7F084368 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6D5C 7F08436C 8C4800D8 */ lw $t0, 0xd8($v0) -.L7F084370: -/* 0B6D60 7F084370 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6D64 7F084374 55000045 */ bnezl $t0, .L7F08448C -/* 0B6D68 7F084378 44815000 */ mtc1 $at, $f10 -/* 0B6D6C 7F08437C 8C4929B0 */ lw $t1, 0x29b0($v0) -/* 0B6D70 7F084380 3C0B8003 */ lui $t3, %hi(D_80036794) # $t3, 0x8003 -/* 0B6D74 7F084384 256B1CE4 */ addiu $t3, %lo(D_80036794) # addiu $t3, $t3, 0x1ce4 -/* 0B6D78 7F084388 00095080 */ sll $t2, $t1, 2 -/* 0B6D7C 7F08438C 01495023 */ subu $t2, $t2, $t1 -/* 0B6D80 7F084390 000A5080 */ sll $t2, $t2, 2 -/* 0B6D84 7F084394 014B1821 */ addu $v1, $t2, $t3 -/* 0B6D88 7F084398 8C6C0000 */ lw $t4, ($v1) -/* 0B6D8C 7F08439C C44000F8 */ lwc1 $f0, 0xf8($v0) -/* 0B6D90 7F0843A0 448C5000 */ mtc1 $t4, $f10 -/* 0B6D94 7F0843A4 00000000 */ nop -/* 0B6D98 7F0843A8 468050A0 */ cvt.s.w $f2, $f10 -/* 0B6D9C 7F0843AC 4600103E */ c.le.s $f2, $f0 -/* 0B6DA0 7F0843B0 00000000 */ nop -/* 0B6DA4 7F0843B4 45020018 */ bc1fl .L7F084418 -/* 0B6DA8 7F0843B8 4600103E */ c.le.s $f2, $f0 -/* 0B6DAC 7F0843BC 8C6D0004 */ lw $t5, 4($v1) -/* 0B6DB0 7F0843C0 448D2000 */ mtc1 $t5, $f4 -/* 0B6DB4 7F0843C4 00000000 */ nop -/* 0B6DB8 7F0843C8 468021A0 */ cvt.s.w $f6, $f4 -/* 0B6DBC 7F0843CC 4606003E */ c.le.s $f0, $f6 -/* 0B6DC0 7F0843D0 00000000 */ nop -/* 0B6DC4 7F0843D4 45020010 */ bc1fl .L7F084418 -/* 0B6DC8 7F0843D8 4600103E */ c.le.s $f2, $f0 -/* 0B6DCC 7F0843DC C44800E4 */ lwc1 $f8, 0xe4($v0) -/* 0B6DD0 7F0843E0 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B6DD4 7F0843E4 E44800EC */ swc1 $f8, 0xec($v0) -/* 0B6DD8 7F0843E8 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6DDC 7F0843EC 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6DE0 7F0843F0 C44A00E8 */ lwc1 $f10, 0xe8($v0) -/* 0B6DE4 7F0843F4 E44A00F0 */ swc1 $f10, 0xf0($v0) -/* 0B6DE8 7F0843F8 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6DEC 7F0843FC 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6DF0 7F084400 C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B6DF4 7F084404 C44400F8 */ lwc1 $f4, 0xf8($v0) -/* 0B6DF8 7F084408 46062200 */ add.s $f8, $f4, $f6 -/* 0B6DFC 7F08440C 10000021 */ b .L7F084494 -/* 0B6E00 7F084410 E44800F8 */ swc1 $f8, 0xf8($v0) -/* 0B6E04 7F084414 4600103E */ c.le.s $f2, $f0 -.L7F084418: -/* 0B6E08 7F084418 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B6E0C 7F08441C 45020018 */ bc1fl .L7F084480eu -/* 0B6E10 7F084420 44814000 */ mtc1 $at, $f8 -/* 0B6E14 7F084424 8C6E0008 */ lw $t6, 8($v1) -/* 0B6E18 7F084428 448E5000 */ mtc1 $t6, $f10 -/* 0B6E1C 7F08442C 00000000 */ nop -/* 0B6E20 7F084430 46805120 */ cvt.s.w $f4, $f10 -/* 0B6E24 7F084434 4604003E */ c.le.s $f0, $f4 -/* 0B6E28 7F084438 00000000 */ nop -/* 0B6E2C 7F08443C 45020010 */ bc1fl .L7F084480eu -/* 0B6E30 7F084440 44814000 */ mtc1 $at, $f8 -/* 0B6E34 7F084444 C44600DC */ lwc1 $f6, 0xdc($v0) -/* 0B6E38 7F084448 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B6E3C 7F08444C E44600EC */ swc1 $f6, 0xec($v0) -/* 0B6E40 7F084450 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6E44 7F084454 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6E48 7F084458 C44800E0 */ lwc1 $f8, 0xe0($v0) -/* 0B6E4C 7F08445C E44800F0 */ swc1 $f8, 0xf0($v0) -/* 0B6E50 7F084460 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6E54 7F084464 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6E58 7F084468 C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B6E5C 7F08446C C44A00F8 */ lwc1 $f10, 0xf8($v0) -/* 0B6E60 7F084470 46045180 */ add.s $f6, $f10, $f4 -/* 0B6E64 7F084474 10000007 */ b .L7F084494 -/* 0B6E68 7F084478 E44600F8 */ swc1 $f6, 0xf8($v0) -/* 0B6E6C 7F08447C 44814000 */ mtc1 $at, $f8 -.L7F084480eu: -/* 0B6E70 7F084480 10000004 */ b .L7F084494 -/* 0B6E74 7F084484 E44800F8 */ swc1 $f8, 0xf8($v0) -/* 0B6E78 7F084488 44815000 */ mtc1 $at, $f10 -.L7F08448C: -/* 0B6E7C 7F08448C 00000000 */ nop -/* 0B6E80 7F084490 E44A00F8 */ swc1 $f10, 0xf8($v0) -.L7F084494: -/* 0B6E84 7F084494 8FBF0014 */ lw $ra, 0x14($sp) -.L7F084498: -/* 0B6E88 7F084498 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0B6E8C 7F08449C 03E00008 */ jr $ra -/* 0B6E90 7F0844A0 00000000 */ nop -) -#endif -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F084360(void) { - -} -#else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F084360 -/* 0B8E90 7F084360 3C048008 */ lui $a0, %hi(dword_CODE_bss_800799A0) -/* 0B8E94 7F084364 248499A0 */ addiu $a0, %lo(dword_CODE_bss_800799A0) # addiu $a0, $a0, -0x6660 -/* 0B8E98 7F084368 8C8E0000 */ lw $t6, ($a0) -/* 0B8E9C 7F08436C 3C188003 */ lui $t8, %hi(D_80036444) -/* 0B8EA0 7F084370 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B8EA4 7F084374 25CF0001 */ addiu $t7, $t6, 1 -/* 0B8EA8 7F084378 AC8F0000 */ sw $t7, ($a0) -/* 0B8EAC 7F08437C 8F186444 */ lw $t8, %lo(D_80036444)($t8) -/* 0B8EB0 7F084380 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B8EB4 7F084384 3C198003 */ lui $t9, %hi(g_PlayerInvincible) -/* 0B8EB8 7F084388 530000AC */ beql $t8, $zero, .L7F08463C -/* 0B8EBC 7F08438C 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B8EC0 7F084390 8F3964B4 */ lw $t9, %lo(g_PlayerInvincible)($t9) -/* 0B8EC4 7F084394 3C088008 */ lui $t0, %hi(dword_CODE_bss_8007999C) -/* 0B8EC8 7F084398 3C098005 */ lui $t1, %hi(g_GlobalTimer) -/* 0B8ECC 7F08439C 572000A7 */ bnezl $t9, .L7F08463C -/* 0B8ED0 7F0843A0 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B8ED4 7F0843A4 8D08999C */ lw $t0, %lo(dword_CODE_bss_8007999C)($t0) -/* 0B8ED8 7F0843A8 8D29837C */ lw $t1, %lo(g_GlobalTimer)($t1) -/* 0B8EDC 7F0843AC 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0B8EE0 7F0843B0 0109082A */ slt $at, $t0, $t1 -/* 0B8EE4 7F0843B4 502000A1 */ beql $at, $zero, .L7F08463C -/* 0B8EE8 7F0843B8 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B8EEC 7F0843BC 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B8EF0 7F0843C0 01E01825 */ move $v1, $t7 -/* 0B8EF4 7F0843C4 24010001 */ li $at, 1 -/* 0B8EF8 7F0843C8 8C4A00A8 */ lw $t2, 0xa8($v0) -/* 0B8EFC 7F0843CC C5440008 */ lwc1 $f4, 8($t2) -/* 0B8F00 7F0843D0 E7A40034 */ swc1 $f4, 0x34($sp) -/* 0B8F04 7F0843D4 8C4B00A8 */ lw $t3, 0xa8($v0) -/* 0B8F08 7F0843D8 C566000C */ lwc1 $f6, 0xc($t3) -/* 0B8F0C 7F0843DC E7A60038 */ swc1 $f6, 0x38($sp) -/* 0B8F10 7F0843E0 8C4C00A8 */ lw $t4, 0xa8($v0) -/* 0B8F14 7F0843E4 C5880010 */ lwc1 $f8, 0x10($t4) -/* 0B8F18 7F0843E8 E7A8003C */ swc1 $f8, 0x3c($sp) -/* 0B8F1C 7F0843EC 04610004 */ bgez $v1, .L7F084400 -/* 0B8F20 7F0843F0 306D0003 */ andi $t5, $v1, 3 -/* 0B8F24 7F0843F4 11A00002 */ beqz $t5, .L7F084400 -/* 0B8F28 7F0843F8 00000000 */ nop -/* 0B8F2C 7F0843FC 25ADFFFC */ addiu $t5, $t5, -4 -.L7F084400: -/* 0B8F30 7F084400 11A00009 */ beqz $t5, .L7F084428 -/* 0B8F34 7F084404 00000000 */ nop -/* 0B8F38 7F084408 11A1001D */ beq $t5, $at, .L7F084480 -/* 0B8F3C 7F08440C 24010002 */ li $at, 2 -/* 0B8F40 7F084410 11A10031 */ beq $t5, $at, .L7F0844D8 -/* 0B8F44 7F084414 24010003 */ li $at, 3 -/* 0B8F48 7F084418 11A10045 */ beq $t5, $at, .L7F084530 -/* 0B8F4C 7F08441C 00000000 */ nop -/* 0B8F50 7F084420 10000058 */ b .L7F084584 -/* 0B8F54 7F084424 00000000 */ nop -.L7F084428: -/* 0B8F58 7F084428 0C002914 */ jal randomGetNext -/* 0B8F5C 7F08442C 00000000 */ nop -/* 0B8F60 7F084430 44825000 */ mtc1 $v0, $f10 -/* 0B8F64 7F084434 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B8F68 7F084438 04410004 */ bgez $v0, .L7F08444C -/* 0B8F6C 7F08443C 46805420 */ cvt.s.w $f16, $f10 -/* 0B8F70 7F084440 44819000 */ mtc1 $at, $f18 -/* 0B8F74 7F084444 00000000 */ nop -/* 0B8F78 7F084448 46128400 */ add.s $f16, $f16, $f18 -.L7F08444C: -/* 0B8F7C 7F08444C 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B8F80 7F084450 44812000 */ mtc1 $at, $f4 -/* 0B8F84 7F084454 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B8F88 7F084458 44814000 */ mtc1 $at, $f8 -/* 0B8F8C 7F08445C 46048182 */ mul.s $f6, $f16, $f4 -/* 0B8F90 7F084460 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B8F94 7F084464 44819000 */ mtc1 $at, $f18 -/* 0B8F98 7F084468 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0B8F9C 7F08446C 46064282 */ mul.s $f10, $f8, $f6 -/* 0B8FA0 7F084470 460A9400 */ add.s $f16, $f18, $f10 -/* 0B8FA4 7F084474 46102200 */ add.s $f8, $f4, $f16 -/* 0B8FA8 7F084478 10000042 */ b .L7F084584 -/* 0B8FAC 7F08447C E7A80034 */ swc1 $f8, 0x34($sp) -.L7F084480: -/* 0B8FB0 7F084480 0C002914 */ jal randomGetNext -/* 0B8FB4 7F084484 00000000 */ nop -/* 0B8FB8 7F084488 44823000 */ mtc1 $v0, $f6 -/* 0B8FBC 7F08448C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B8FC0 7F084490 04410004 */ bgez $v0, .L7F0844A4 -/* 0B8FC4 7F084494 468034A0 */ cvt.s.w $f18, $f6 -/* 0B8FC8 7F084498 44815000 */ mtc1 $at, $f10 -/* 0B8FCC 7F08449C 00000000 */ nop -/* 0B8FD0 7F0844A0 460A9480 */ add.s $f18, $f18, $f10 -.L7F0844A4: -/* 0B8FD4 7F0844A4 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B8FD8 7F0844A8 44812000 */ mtc1 $at, $f4 -/* 0B8FDC 7F0844AC 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B8FE0 7F0844B0 44814000 */ mtc1 $at, $f8 -/* 0B8FE4 7F0844B4 46049402 */ mul.s $f16, $f18, $f4 -/* 0B8FE8 7F0844B8 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B8FEC 7F0844BC 44815000 */ mtc1 $at, $f10 -/* 0B8FF0 7F0844C0 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0B8FF4 7F0844C4 46104182 */ mul.s $f6, $f8, $f16 -/* 0B8FF8 7F0844C8 46065480 */ add.s $f18, $f10, $f6 -/* 0B8FFC 7F0844CC 46122201 */ sub.s $f8, $f4, $f18 -/* 0B9000 7F0844D0 1000002C */ b .L7F084584 -/* 0B9004 7F0844D4 E7A80034 */ swc1 $f8, 0x34($sp) -.L7F0844D8: -/* 0B9008 7F0844D8 0C002914 */ jal randomGetNext -/* 0B900C 7F0844DC 00000000 */ nop -/* 0B9010 7F0844E0 44828000 */ mtc1 $v0, $f16 -/* 0B9014 7F0844E4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B9018 7F0844E8 04410004 */ bgez $v0, .L7F0844FC -/* 0B901C 7F0844EC 468082A0 */ cvt.s.w $f10, $f16 -/* 0B9020 7F0844F0 44813000 */ mtc1 $at, $f6 -/* 0B9024 7F0844F4 00000000 */ nop -/* 0B9028 7F0844F8 46065280 */ add.s $f10, $f10, $f6 -.L7F0844FC: -/* 0B902C 7F0844FC 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B9030 7F084500 44812000 */ mtc1 $at, $f4 -/* 0B9034 7F084504 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B9038 7F084508 44814000 */ mtc1 $at, $f8 -/* 0B903C 7F08450C 46045482 */ mul.s $f18, $f10, $f4 -/* 0B9040 7F084510 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B9044 7F084514 44813000 */ mtc1 $at, $f6 -/* 0B9048 7F084518 C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 0B904C 7F08451C 46124402 */ mul.s $f16, $f8, $f18 -/* 0B9050 7F084520 46103280 */ add.s $f10, $f6, $f16 -/* 0B9054 7F084524 460A2200 */ add.s $f8, $f4, $f10 -/* 0B9058 7F084528 10000016 */ b .L7F084584 -/* 0B905C 7F08452C E7A8003C */ swc1 $f8, 0x3c($sp) -.L7F084530: -/* 0B9060 7F084530 0C002914 */ jal randomGetNext -/* 0B9064 7F084534 00000000 */ nop -/* 0B9068 7F084538 44829000 */ mtc1 $v0, $f18 -/* 0B906C 7F08453C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B9070 7F084540 04410004 */ bgez $v0, .L7F084554 -/* 0B9074 7F084544 468091A0 */ cvt.s.w $f6, $f18 -/* 0B9078 7F084548 44818000 */ mtc1 $at, $f16 -/* 0B907C 7F08454C 00000000 */ nop -/* 0B9080 7F084550 46103180 */ add.s $f6, $f6, $f16 -.L7F084554: -/* 0B9084 7F084554 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B9088 7F084558 44812000 */ mtc1 $at, $f4 -/* 0B908C 7F08455C 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B9090 7F084560 44814000 */ mtc1 $at, $f8 -/* 0B9094 7F084564 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9098 7F084568 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B909C 7F08456C 44818000 */ mtc1 $at, $f16 -/* 0B90A0 7F084570 C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 0B90A4 7F084574 460A4482 */ mul.s $f18, $f8, $f10 -/* 0B90A8 7F084578 46128180 */ add.s $f6, $f16, $f18 -/* 0B90AC 7F08457C 46062201 */ sub.s $f8, $f4, $f6 -/* 0B90B0 7F084580 E7A8003C */ swc1 $f8, 0x3c($sp) -.L7F084584: -/* 0B90B4 7F084584 0C002914 */ jal randomGetNext -/* 0B90B8 7F084588 00000000 */ nop -/* 0B90BC 7F08458C 44825000 */ mtc1 $v0, $f10 -/* 0B90C0 7F084590 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B90C4 7F084594 04410004 */ bgez $v0, .L7F0845A8 -/* 0B90C8 7F084598 46805420 */ cvt.s.w $f16, $f10 -/* 0B90CC 7F08459C 44819000 */ mtc1 $at, $f18 -/* 0B90D0 7F0845A0 00000000 */ nop -/* 0B90D4 7F0845A4 46128400 */ add.s $f16, $f16, $f18 -.L7F0845A8: -/* 0B90D8 7F0845A8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B90DC 7F0845AC 44812000 */ mtc1 $at, $f4 -/* 0B90E0 7F0845B0 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0B90E4 7F0845B4 44814000 */ mtc1 $at, $f8 -/* 0B90E8 7F0845B8 46048182 */ mul.s $f6, $f16, $f4 -/* 0B90EC 7F0845BC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0B90F0 7F0845C0 44819000 */ mtc1 $at, $f18 -/* 0B90F4 7F0845C4 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 0B90F8 7F0845C8 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0B90FC 7F0845CC 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B9100 7F0845D0 00002025 */ move $a0, $zero -/* 0B9104 7F0845D4 46064282 */ mul.s $f10, $f8, $f6 -/* 0B9108 7F0845D8 27A50034 */ addiu $a1, $sp, 0x34 -/* 0B910C 7F0845DC 24070012 */ li $a3, 18 -/* 0B9110 7F0845E0 46125401 */ sub.s $f16, $f10, $f18 -/* 0B9114 7F0845E4 46102200 */ add.s $f8, $f4, $f16 -/* 0B9118 7F0845E8 E7A80038 */ swc1 $f8, 0x38($sp) -/* 0B911C 7F0845EC 8DC300A8 */ lw $v1, 0xa8($t6) -/* 0B9120 7F0845F0 8C660014 */ lw $a2, 0x14($v1) -/* 0B9124 7F0845F4 246F002C */ addiu $t7, $v1, 0x2c -/* 0B9128 7F0845F8 AFAF0018 */ sw $t7, 0x18($sp) -/* 0B912C 7F0845FC AFA0001C */ sw $zero, 0x1c($sp) -/* 0B9130 7F084600 AFA00014 */ sw $zero, 0x14($sp) -/* 0B9134 7F084604 0FC27094 */ jal explosionCreate -/* 0B9138 7F084608 AFA00010 */ sw $zero, 0x10($sp) -/* 0B913C 7F08460C 0C002914 */ jal randomGetNext -/* 0B9140 7F084610 00000000 */ nop -/* 0B9144 7F084614 2401000F */ li $at, 15 -/* 0B9148 7F084618 0041001B */ divu $zero, $v0, $at -/* 0B914C 7F08461C 3C198005 */ lui $t9, %hi(g_GlobalTimer) -/* 0B9150 7F084620 8F39837C */ lw $t9, %lo(g_GlobalTimer)($t9) -/* 0B9154 7F084624 0000C010 */ mfhi $t8 -/* 0B9158 7F084628 3C018008 */ lui $at, %hi(dword_CODE_bss_8007999C) -/* 0B915C 7F08462C 03194021 */ addu $t0, $t8, $t9 -/* 0B9160 7F084630 2509000F */ addiu $t1, $t0, 0xf -/* 0B9164 7F084634 AC29999C */ sw $t1, %lo(dword_CODE_bss_8007999C)($at) -/* 0B9168 7F084638 8FBF0024 */ lw $ra, 0x24($sp) -.L7F08463C: -/* 0B916C 7F08463C 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B9170 7F084640 03E00008 */ jr $ra -/* 0B9174 7F084644 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F084360 -/* 0B6E94 7F0844A4 3C048007 */ lui $a0, %hi(dword_CODE_bss_800799A0) # $a0, 0x8007 -/* 0B6E98 7F0844A8 24848480 */ addiu $a0, %lo(dword_CODE_bss_800799A0) # addiu $a0, $a0, -0x7b80 -/* 0B6E9C 7F0844AC 8C8E0000 */ lw $t6, ($a0) -/* 0B6EA0 7F0844B0 3C188003 */ lui $t8, %hi(D_80036444) # $t8, 0x8003 -/* 0B6EA4 7F0844B4 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0B6EA8 7F0844B8 25CF0001 */ addiu $t7, $t6, 1 -/* 0B6EAC 7F0844BC AC8F0000 */ sw $t7, ($a0) -/* 0B6EB0 7F0844C0 8F181994 */ lw $t8, %lo(D_80036444)($t8) -/* 0B6EB4 7F0844C4 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B6EB8 7F0844C8 3C198003 */ lui $t9, %hi(g_PlayerInvincible) # $t9, 0x8003 -/* 0B6EBC 7F0844CC 530000AC */ beql $t8, $zero, .L7F084780 -/* 0B6EC0 7F0844D0 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B6EC4 7F0844D4 8F391A04 */ lw $t9, %lo(g_PlayerInvincible)($t9) -/* 0B6EC8 7F0844D8 3C088007 */ lui $t0, %hi(dword_CODE_bss_8007999C) # $t0, 0x8007 -/* 0B6ECC 7F0844DC 3C098004 */ lui $t1, %hi(g_GlobalTimer) # $t1, 0x8004 -/* 0B6ED0 7F0844E0 572000A7 */ bnezl $t9, .L7F084780 -/* 0B6ED4 7F0844E4 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B6ED8 7F0844E8 8D08847C */ lw $t0, %lo(dword_CODE_bss_8007999C)($t0) -/* 0B6EDC 7F0844EC 8D290FFC */ lw $t1, %lo(g_GlobalTimer)($t1) -/* 0B6EE0 7F0844F0 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B6EE4 7F0844F4 0109082A */ slt $at, $t0, $t1 -/* 0B6EE8 7F0844F8 502000A1 */ beql $at, $zero, .L7F084780 -/* 0B6EEC 7F0844FC 8FBF0024 */ lw $ra, 0x24($sp) -/* 0B6EF0 7F084500 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B6EF4 7F084504 01E01825 */ move $v1, $t7 -/* 0B6EF8 7F084508 24010001 */ li $at, 1 -/* 0B6EFC 7F08450C 8C4A00A8 */ lw $t2, 0xa8($v0) -/* 0B6F00 7F084510 C5440008 */ lwc1 $f4, 8($t2) -/* 0B6F04 7F084514 E7A40034 */ swc1 $f4, 0x34($sp) -/* 0B6F08 7F084518 8C4B00A8 */ lw $t3, 0xa8($v0) -/* 0B6F0C 7F08451C C566000C */ lwc1 $f6, 0xc($t3) -/* 0B6F10 7F084520 E7A60038 */ swc1 $f6, 0x38($sp) -/* 0B6F14 7F084524 8C4C00A8 */ lw $t4, 0xa8($v0) -/* 0B6F18 7F084528 C5880010 */ lwc1 $f8, 0x10($t4) -/* 0B6F1C 7F08452C E7A8003C */ swc1 $f8, 0x3c($sp) -/* 0B6F20 7F084530 04610004 */ bgez $v1, .L7F084544 -/* 0B6F24 7F084534 306D0003 */ andi $t5, $v1, 3 -/* 0B6F28 7F084538 11A00002 */ beqz $t5, .L7F084544 -/* 0B6F2C 7F08453C 00000000 */ nop -/* 0B6F30 7F084540 25ADFFFC */ addiu $t5, $t5, -4 -.L7F084544: -/* 0B6F34 7F084544 11A00009 */ beqz $t5, .L7F08456C -/* 0B6F38 7F084548 00000000 */ nop -/* 0B6F3C 7F08454C 11A1001D */ beq $t5, $at, .L7F0845C4 -/* 0B6F40 7F084550 24010002 */ li $at, 2 -/* 0B6F44 7F084554 11A10031 */ beq $t5, $at, .L7F08461C -/* 0B6F48 7F084558 24010003 */ li $at, 3 -/* 0B6F4C 7F08455C 11A10045 */ beq $t5, $at, .L7F084674 -/* 0B6F50 7F084560 00000000 */ nop -/* 0B6F54 7F084564 10000058 */ b .L7F0846C8 -/* 0B6F58 7F084568 00000000 */ nop -.L7F08456C: -/* 0B6F5C 7F08456C 0C00262C */ jal randomGetNext -/* 0B6F60 7F084570 00000000 */ nop -/* 0B6F64 7F084574 44825000 */ mtc1 $v0, $f10 -/* 0B6F68 7F084578 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B6F6C 7F08457C 04410004 */ bgez $v0, .L7F084590 -/* 0B6F70 7F084580 46805420 */ cvt.s.w $f16, $f10 -/* 0B6F74 7F084584 44819000 */ mtc1 $at, $f18 -/* 0B6F78 7F084588 00000000 */ nop -/* 0B6F7C 7F08458C 46128400 */ add.s $f16, $f16, $f18 -.L7F084590: -/* 0B6F80 7F084590 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B6F84 7F084594 44812000 */ mtc1 $at, $f4 -/* 0B6F88 7F084598 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B6F8C 7F08459C 44814000 */ mtc1 $at, $f8 -/* 0B6F90 7F0845A0 46048182 */ mul.s $f6, $f16, $f4 -/* 0B6F94 7F0845A4 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B6F98 7F0845A8 44819000 */ mtc1 $at, $f18 -/* 0B6F9C 7F0845AC C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0B6FA0 7F0845B0 46064282 */ mul.s $f10, $f8, $f6 -/* 0B6FA4 7F0845B4 460A9400 */ add.s $f16, $f18, $f10 -/* 0B6FA8 7F0845B8 46102200 */ add.s $f8, $f4, $f16 -/* 0B6FAC 7F0845BC 10000042 */ b .L7F0846C8 -/* 0B6FB0 7F0845C0 E7A80034 */ swc1 $f8, 0x34($sp) -.L7F0845C4: -/* 0B6FB4 7F0845C4 0C00262C */ jal randomGetNext -/* 0B6FB8 7F0845C8 00000000 */ nop -/* 0B6FBC 7F0845CC 44823000 */ mtc1 $v0, $f6 -/* 0B6FC0 7F0845D0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B6FC4 7F0845D4 04410004 */ bgez $v0, .L7F0845E8 -/* 0B6FC8 7F0845D8 468034A0 */ cvt.s.w $f18, $f6 -/* 0B6FCC 7F0845DC 44815000 */ mtc1 $at, $f10 -/* 0B6FD0 7F0845E0 00000000 */ nop -/* 0B6FD4 7F0845E4 460A9480 */ add.s $f18, $f18, $f10 -.L7F0845E8: -/* 0B6FD8 7F0845E8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B6FDC 7F0845EC 44812000 */ mtc1 $at, $f4 -/* 0B6FE0 7F0845F0 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B6FE4 7F0845F4 44814000 */ mtc1 $at, $f8 -/* 0B6FE8 7F0845F8 46049402 */ mul.s $f16, $f18, $f4 -/* 0B6FEC 7F0845FC 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B6FF0 7F084600 44815000 */ mtc1 $at, $f10 -/* 0B6FF4 7F084604 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0B6FF8 7F084608 46104182 */ mul.s $f6, $f8, $f16 -/* 0B6FFC 7F08460C 46065480 */ add.s $f18, $f10, $f6 -/* 0B7000 7F084610 46122201 */ sub.s $f8, $f4, $f18 -/* 0B7004 7F084614 1000002C */ b .L7F0846C8 -/* 0B7008 7F084618 E7A80034 */ swc1 $f8, 0x34($sp) -.L7F08461C: -/* 0B700C 7F08461C 0C00262C */ jal randomGetNext -/* 0B7010 7F084620 00000000 */ nop -/* 0B7014 7F084624 44828000 */ mtc1 $v0, $f16 -/* 0B7018 7F084628 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B701C 7F08462C 04410004 */ bgez $v0, .L7F084640 -/* 0B7020 7F084630 468082A0 */ cvt.s.w $f10, $f16 -/* 0B7024 7F084634 44813000 */ mtc1 $at, $f6 -/* 0B7028 7F084638 00000000 */ nop -/* 0B702C 7F08463C 46065280 */ add.s $f10, $f10, $f6 -.L7F084640: -/* 0B7030 7F084640 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B7034 7F084644 44812000 */ mtc1 $at, $f4 -/* 0B7038 7F084648 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B703C 7F08464C 44814000 */ mtc1 $at, $f8 -/* 0B7040 7F084650 46045482 */ mul.s $f18, $f10, $f4 -/* 0B7044 7F084654 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B7048 7F084658 44813000 */ mtc1 $at, $f6 -/* 0B704C 7F08465C C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 0B7050 7F084660 46124402 */ mul.s $f16, $f8, $f18 -/* 0B7054 7F084664 46103280 */ add.s $f10, $f6, $f16 -/* 0B7058 7F084668 460A2200 */ add.s $f8, $f4, $f10 -/* 0B705C 7F08466C 10000016 */ b .L7F0846C8 -/* 0B7060 7F084670 E7A8003C */ swc1 $f8, 0x3c($sp) -.L7F084674: -/* 0B7064 7F084674 0C00262C */ jal randomGetNext -/* 0B7068 7F084678 00000000 */ nop -/* 0B706C 7F08467C 44829000 */ mtc1 $v0, $f18 -/* 0B7070 7F084680 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B7074 7F084684 04410004 */ bgez $v0, .L7F084698 -/* 0B7078 7F084688 468091A0 */ cvt.s.w $f6, $f18 -/* 0B707C 7F08468C 44818000 */ mtc1 $at, $f16 -/* 0B7080 7F084690 00000000 */ nop -/* 0B7084 7F084694 46103180 */ add.s $f6, $f6, $f16 -.L7F084698: -/* 0B7088 7F084698 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B708C 7F08469C 44812000 */ mtc1 $at, $f4 -/* 0B7090 7F0846A0 3C014316 */ li $at, 0x43160000 # 150.000000 -/* 0B7094 7F0846A4 44814000 */ mtc1 $at, $f8 -/* 0B7098 7F0846A8 46043282 */ mul.s $f10, $f6, $f4 -/* 0B709C 7F0846AC 3C01437A */ li $at, 0x437A0000 # 250.000000 -/* 0B70A0 7F0846B0 44818000 */ mtc1 $at, $f16 -/* 0B70A4 7F0846B4 C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 0B70A8 7F0846B8 460A4482 */ mul.s $f18, $f8, $f10 -/* 0B70AC 7F0846BC 46128180 */ add.s $f6, $f16, $f18 -/* 0B70B0 7F0846C0 46062201 */ sub.s $f8, $f4, $f6 -/* 0B70B4 7F0846C4 E7A8003C */ swc1 $f8, 0x3c($sp) -.L7F0846C8: -/* 0B70B8 7F0846C8 0C00262C */ jal randomGetNext -/* 0B70BC 7F0846CC 00000000 */ nop -/* 0B70C0 7F0846D0 44825000 */ mtc1 $v0, $f10 -/* 0B70C4 7F0846D4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0B70C8 7F0846D8 04410004 */ bgez $v0, .L7F0846EC -/* 0B70CC 7F0846DC 46805420 */ cvt.s.w $f16, $f10 -/* 0B70D0 7F0846E0 44819000 */ mtc1 $at, $f18 -/* 0B70D4 7F0846E4 00000000 */ nop -/* 0B70D8 7F0846E8 46128400 */ add.s $f16, $f16, $f18 -.L7F0846EC: -/* 0B70DC 7F0846EC 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0B70E0 7F0846F0 44812000 */ mtc1 $at, $f4 -/* 0B70E4 7F0846F4 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0B70E8 7F0846F8 44814000 */ mtc1 $at, $f8 -/* 0B70EC 7F0846FC 46048182 */ mul.s $f6, $f16, $f4 -/* 0B70F0 7F084700 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0B70F4 7F084704 44819000 */ mtc1 $at, $f18 -/* 0B70F8 7F084708 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 0B70FC 7F08470C 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 0B7100 7F084710 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0B7104 7F084714 00002025 */ move $a0, $zero -/* 0B7108 7F084718 46064282 */ mul.s $f10, $f8, $f6 -/* 0B710C 7F08471C 27A50034 */ addiu $a1, $sp, 0x34 -/* 0B7110 7F084720 24070012 */ li $a3, 18 -/* 0B7114 7F084724 46125401 */ sub.s $f16, $f10, $f18 -/* 0B7118 7F084728 46102200 */ add.s $f8, $f4, $f16 -/* 0B711C 7F08472C E7A80038 */ swc1 $f8, 0x38($sp) -/* 0B7120 7F084730 8DC300A8 */ lw $v1, 0xa8($t6) -/* 0B7124 7F084734 8C660014 */ lw $a2, 0x14($v1) -/* 0B7128 7F084738 246F002C */ addiu $t7, $v1, 0x2c -/* 0B712C 7F08473C AFAF0018 */ sw $t7, 0x18($sp) -/* 0B7130 7F084740 AFA0001C */ sw $zero, 0x1c($sp) -/* 0B7134 7F084744 AFA00014 */ sw $zero, 0x14($sp) -/* 0B7138 7F084748 0FC26DE4 */ jal explosionCreate -/* 0B713C 7F08474C AFA00010 */ sw $zero, 0x10($sp) -/* 0B7140 7F084750 0C00262C */ jal randomGetNext -/* 0B7144 7F084754 00000000 */ nop -/* 0B7148 7F084758 2401000C */ li $at, 12 -/* 0B714C 7F08475C 0041001B */ divu $zero, $v0, $at -/* 0B7150 7F084760 3C198004 */ lui $t9, %hi(g_GlobalTimer) # $t9, 0x8004 -/* 0B7154 7F084764 8F390FFC */ lw $t9, %lo(g_GlobalTimer)($t9) -/* 0B7158 7F084768 0000C010 */ mfhi $t8 -/* 0B715C 7F08476C 3C018007 */ lui $at, %hi(dword_CODE_bss_8007999C) # $at, 0x8007 -/* 0B7160 7F084770 03194021 */ addu $t0, $t8, $t9 -/* 0B7164 7F084774 2509000C */ addiu $t1, $t0, 0xc -/* 0B7168 7F084778 AC29847C */ sw $t1, %lo(dword_CODE_bss_8007999C)($at) -/* 0B716C 7F08477C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F084780: -/* 0B7170 7F084780 27BD0040 */ addiu $sp, $sp, 0x40 -/* 0B7174 7F084784 03E00008 */ jr $ra -/* 0B7178 7F084788 00000000 */ nop -) -#endif -#endif +/** + * If global flag g_SurroundBondWithExplosionsFlag is set then explosions + * will be randomly created around Bond. + * Perfect Dark method playerTickExplode. + * NTSC address 7F084360. + * EU address 7F0844A4. +*/ +void bondviewPlayerTickExplode(void) +{ + g_PlayerTickExplodeCreatePosition++; + if (g_SurroundBondWithExplosionsFlag + && g_PlayerInvincible == 0 + && g_SurroundBondWithExplosionsTicks < g_GlobalTimer) + { + struct coord3d pos; + pos.f[0] = g_CurrentPlayer->prop->pos.f[0]; + pos.f[1] = g_CurrentPlayer->prop->pos.f[1]; + pos.f[2] = g_CurrentPlayer->prop->pos.f[2]; + switch (g_PlayerTickExplodeCreatePosition % 4) + { + case 0: pos.x += 250.0f + 150.0f * RANDOMGETNEXT_F32(); break; + case 1: pos.x -= 250.0f + 150.0f * RANDOMGETNEXT_F32(); break; + case 2: pos.z += 250.0f + 150.0f * RANDOMGETNEXT_F32(); break; + case 3: pos.z -= 250.0f + 150.0f * RANDOMGETNEXT_F32(); break; + } + pos.y += 200.0f * RANDOMGETNEXT_F32() - 100.0f; -#ifdef NONMATCHING -//#if 1 + explosionCreate(0, &pos, g_CurrentPlayer->prop->stan, EXPLOSION_DEF_PLAYER, 0, 0, g_CurrentPlayer->prop->rooms, 0); -void bondviewCalcUpdatePlayerCollision(struct coord3d *arg0, s32 arg1); + g_SurroundBondWithExplosionsTicks = (randomGetNext() % (u32)PLAYER_TICKEXPLODE_FACTOR) + g_GlobalTimer + PLAYER_TICKEXPLODE_FACTOR; + } +} -// placeholder while matching -struct move_bond_temp_struct { - s32 unk00; - s32 unk04; -}; /** - * decomp status: - * - compiles: yes - * - stack resize: ok - * - identical instructions: fail - * - identical registers: fail + * NTSC Address 0x7F084648. + * NTSC-J address 0x7F084CF8. * - * Notes: Generally pretty close. There are few places with mis-ordered instructions. - * Test on emu, Bond will become unable to move once standing on tank, so obviously - * some other instructions are just wrong. But majority is just bad regalloc. + * Met by Saint Jon The Archangel in the writhing pits of hell, the beast was + * pinned, prone on the floor. He had taken many forms throughout the ages. + * From the creator of man to the far reaches of the universe, his perpetual + * reincarnations reigned throughout space and time... until now. His form was + * weak, the opposition strong. The time for atonement had finally come. * - * https://decomp.me/scratch/THz6d - * 95.24% -*/ -void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) + * Battered, torn, exposed, the beast slacked his gaping maw. + * + * "I'm sorry, Jon" he whispered. + * + * The archangel raised his flaming blade. + * + * "You are forgiven, Garfield" + * + * And the beast exhaled his last. + * + * 10 months of off and on work to match. + * Thanks Trevor. + * - Ben Burns + */ +void MoveBond(s8 stick_x, s8 stick_y, u16 buttons, u16 oldbuttons) { - struct coord3d sp3AC; - s32 more_padding[2]; - f32 sp3A0; - f32 phi_f12_8; - f32 sp398; - s32 sp394; - f32 sp390; - - // boost forwards - f32 shotboost_forward; // sp38C - - // boost sideways - f32 shotboost_sideways; // sp388 - f32 shotboost_norm; // sp384 - f32 temp_f0_12; // sp380 - struct coord3d check_collision_p1; // sp374 - struct coord3d check_collision_p2; // sp368 - struct coord3d *collision_ptr; // sp364 - f32 stack_padding_15; - f32 sp35C; - f32 sp358; - f32 sp354; - struct coord3d tank_collision_pt1; - struct coord3d tank_collision_pt2; - f32 tank_collision_dx; - f32 tank_collision_dz; - f32 sp330; - f32 sp32C; - f32 sp328; - f32 sp324; - f32 sp320; - f32 sp31C; - f32 sp318; - f32 sp314; - f32 sp310; - f32 sp30C; - f32 sp308; - f32 sp304; - // sp 0x300 - struct TankRecord *temp_tank; - struct coord3d sp2F4; - Mtxf sp2B4; - f32 sp2B0; - f32 sp2AC; - f32 sp2A8; - Mtxf sp268; - struct coord3d sp25C; - f32 sp258; - f32 sp254; - f32 sp250; - f32 sp24C; - f32 sp248; - f32 sp244_tank_engine_utilization; - f32 sp240; - f32 collision_pos_dz; - f32 collision_pos_dx; - f32 temp_f0_19; - f32 temp_f2_13; - f32 temp_f0_20; - f32 temp_f0_18; - f32 temp_f2_12; - f32 sp220; - f32 sp21C; - f32 sp218; - f32 tank_collision_norm; - f32 sp210; - f32 sp20C; - f32 start_collision_pos_x; - f32 start_collision_pos_z; - struct StandTile *sp200; - f32 sp1FC; - f32 sp1F8; - f32 tank_tick_increment; - f32 tank_tick_last; - s32 phi_a1; - s32 phi_a2; - f32 sp1E4; - f32 phi_f2_6; - f32 stack_padding_25; - f32 ftemp2; - f32 ftemp3; + struct coord3d move_offset; f32 ftemp; - struct TankRecord *tank_obj; - f32 stack_padding_2; - struct ModelNode *stack_padding_3; - f32 stack_padding_4; - s32 stack_padding_5; - struct move_bond_temp_struct sp1B4; - struct move_bond_collision sp184; - f32 sp180; - f32 sp17C; - f32 stack_padding_20; - struct StandTile *sp174; - struct StandTile *sp170; - f32 sp16C; - f32 sp168; - f32 sp164; - struct PropRecord *prop; - f32 stack_padding_26; - f32 stack_padding_6; - f32 sp14C_temp; - f32 stack_padding_11; + f32 stack_padding_9; + f32 sp3A0; s32 i; - s32 i_1; - f32 weapon_speed_verta; - struct TankRecord *sp140_tank_as_TankRecord; - f32 stack_padding_10; - struct ObjectRecord *sp138_tank_as_ObjectRecord; - s32 i_2; - struct ModelRoData_BoundingBoxRecord *sp130; - Mtxf spF0; - struct coord3d spE4; - s32 i_3; - s32 i_4; - s32 stemp; - void *temp_ptr; - struct rect4f spB4_tank_collision_bounds; - // roomids - s32 sp94[8]; - struct coord3d *pos_ptr; - s16 *lookup_index; - s32 sp88_collision_bound_height; - s32 sp84_collision_bound_z; - f32 sp80_collision_radius; - s32 sp7C; - struct coord3d sp70; - struct ChrRecord *sp6C; - f32 stack_padding_28; - struct rect4f *sp64; - s32 sp60; - f32 sp5C_out_unused; - //f32 stack_padding_27; - - - - - + f32 maxspeed; + s32 use_stanHeight; + f32 sp390; - sp3AC = D_800367F4; + move_offset = g_DefaultMoveBondOffset; - sp394 = 0; - sp398 = 0.0f; + use_stanHeight = 0; + maxspeed = 0.0f; sp390 = 0.0f; - if ((arg0 >= 0x64) || (arg0 < -0x63)) - { - return_null(); - } - - if ((*(s8*)&arg1 >= 0x64) || (*(s8*)&arg1 < -0x63)) - { - return_null(); - } + #if defined(VERSION_US) || defined(VERSION_JP) + if (stick_x >= 100 || stick_x <= -100) return_null(); // __LINE__ __FILE__ (#6414 bondview.c) "joystick x has value %d!\n" + if (stick_y >= 100 || stick_y <= -100) return_null(); // __LINE__ __FILE__ (#6415 bondview.c) "joystick y has value %d!\n" + #endif if (g_bondviewForceDisarm > 0) { @@ -24452,22 +10591,28 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) } currentPlayerSetField00(0); - sub_GAME_7F083FC8(); - sub_GAME_7F084360(); - controller_gameplay_interaction(arg0, arg1, *(u16*)&arg2, *(u16*)&arg3); + bondviewPlayerTickDamageAndHealth(); + bondviewPlayerTickExplode(); + bondviewProcessInput(stick_x, stick_y, buttons, oldbuttons); - if (lvlGetControlsLockedFlag() != 0) + if (lvlGetControlsLockedFlag()) { - sub_GAME_7F07EAF0(); + bondviewPlayerStopAudioForPause(); } - if (g_CurrentPlayer->watch_animation_state != 0) + if (g_CurrentPlayer->watch_animation_state) { - sub_GAME_7F07EC54(); + bondviewWatchAnimationTick(); } + /* + Apply bondshotspeed vector to speedforwards scalar and speedsideways scalar. + Crouching applies a 50% base speed reduction before applying boost. + Bond can't be boosted while in the tank. + */ if (in_tank_flag == 0) { + // This `if` block is Perfect Dark bwalkApplyCrouchSpeed. if (currentPlayerGetCrouchPos() == CROUCH_SQUAT) { g_CurrentPlayer->speedforwards *= 0.5f; @@ -24476,15 +10621,23 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) if ((g_CurrentPlayer->bondshotspeed.f[0] != 0.0f) || (g_CurrentPlayer->bondshotspeed.f[2] != 0.0f)) { - shotboost_forward = (-g_CurrentPlayer->bondshotspeed.f[0] * g_CurrentPlayer->vv_sintheta) + // boost forwards + f32 shotboost_forward; // sp38C + // boost sideways + f32 shotboost_sideways; // sp388 + f32 shotboost_norm; // sp384 + + // Assigning these two variables is done in Perfect Dark bmove0f0cba88. + shotboost_forward = + (-g_CurrentPlayer->bondshotspeed.f[0] * g_CurrentPlayer->vv_sintheta) + (g_CurrentPlayer->bondshotspeed.f[2] * g_CurrentPlayer->vv_costheta); - shotboost_sideways = (-g_CurrentPlayer->bondshotspeed.f[0] * g_CurrentPlayer->vv_costheta) + shotboost_sideways = + (-g_CurrentPlayer->bondshotspeed.f[0] * g_CurrentPlayer->vv_costheta) - (g_CurrentPlayer->bondshotspeed.f[2] * g_CurrentPlayer->vv_sintheta); - + shotboost_norm = sqrtf( (g_CurrentPlayer->bondshotspeed.f[0] * g_CurrentPlayer->bondshotspeed.f[0]) + - (g_CurrentPlayer->bondshotspeed.f[2] * g_CurrentPlayer->bondshotspeed.f[2]) - ); + (g_CurrentPlayer->bondshotspeed.f[2] * g_CurrentPlayer->bondshotspeed.f[2])); g_CurrentPlayer->speedforwards += shotboost_forward; g_CurrentPlayer->speedsideways += shotboost_sideways; @@ -24519,56 +10672,92 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) } } + /** + * This section updates the tank turret horizontal position (turning left and right), + * as well as turning the tank left and right. + */ if (in_tank_flag == 1) { - sp358 = g_CurrentPlayer->speedtheta * g_GlobalTimerDelta * 0.017453292f * 3.5f; - sp35C = g_TankOrientationAngle + sp358; + f32 ftemp2; + struct coord3d check_collision_p1; + struct coord3d check_collision_p2; + f32 stack_padding_1; + s32 i_1; + f32 curTankAngleRad; + f32 tankChangeInAngle; + f32 sp354; + struct coord3d tank_collision_pt1; + struct coord3d tank_collision_pt2; + f32 tank_collision_dx; + f32 tank_collision_dz; - if (sp35C >= M_TAU_F) + tankChangeInAngle = DegToRad1Fact(g_CurrentPlayer->speedtheta * g_GlobalTimerDelta) * 3.5f; + curTankAngleRad = g_TankOrientationAngle + tankChangeInAngle; + + if (curTankAngleRad >= M_TAU_F) { - sp35C -= M_TAU_F; + curTankAngleRad -= M_TAU_F; } - if (sp35C < 0.0f) + if (curTankAngleRad < 0.0f) { - sp35C += M_TAU_F; + curTankAngleRad += M_TAU_F; } if (bondviewTankCollisionStatus( &g_CurrentPlayer->field_488.collision_position, g_CurrentPlayer->field_488.current_tile_ptr, - sp35C, + curTankAngleRad, &check_collision_p1, &check_collision_p2)) { - g_TankOrientationAngle = sp35C; + g_TankOrientationAngle = curTankAngleRad; } else { - sp31C = -1.0f; - sp304 = -1.0f; + f32 sp1E4; //x + s32 stack_padding_1; //x + f32 sp1FC; //x + f32 sp324; + f32 sp320; + f32 sp31C; + f32 sp20C; //x + f32 tank_collision_norm; //x + f32 sp210; //x + f32 sp30C; + f32 sp308; + f32 sp304; + + sp31C = -1; //sp31C: scope within this block, used throughout + sp304 = -1; //sp304: scope within this block, used throughout getCollisionEdge_maybe(&tank_collision_pt1, &tank_collision_pt2); - tank_collision_dx = tank_collision_pt2.f[0] - tank_collision_pt1.f[0]; - tank_collision_dz = tank_collision_pt2.f[2] - tank_collision_pt1.f[2]; + + tank_collision_dx = (tank_collision_pt2.f[0] - tank_collision_pt1.f[0]); + tank_collision_dz = (tank_collision_pt2.f[2] - tank_collision_pt1.f[2]); tank_collision_norm = 1.0f / sqrtf((tank_collision_dx * tank_collision_dx) + (tank_collision_dz * tank_collision_dz)); - sp320 = (tank_collision_dx * tank_collision_norm); - sp320 = -sp320; - sp324 = tank_collision_dz * tank_collision_norm; + // sp320: scoped within this block, used throughout + // sp324: scoped within this block, used throughout + tank_collision_dx *= tank_collision_norm; + tank_collision_dz *= tank_collision_norm; + sp324 = tank_collision_dz; + sp320 = -tank_collision_dx; + // sp210: short lived variable sp210 = ((g_CurrentPlayer->field_488.collision_position.f[0] - check_collision_p2.f[0]) * sp324) + ((g_CurrentPlayer->field_488.collision_position.f[2] - check_collision_p2.f[2]) * sp320); - + if (sp210 < 0.0f) { + sp210 = -sp210; sp324 = -sp324; sp320 = -sp320; - sp210 = -sp210; } + // sp20C: very short lived variable sp20C = ((g_CurrentPlayer->field_488.collision_position.f[0] - tank_collision_pt1.f[0]) * sp324) + ((g_CurrentPlayer->field_488.collision_position.f[2] - tank_collision_pt1.f[2]) * sp320); @@ -24577,44 +10766,50 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) { sp31C = sp210 - sp20C; } - + tank_collision_dx = check_collision_p2.f[0] - check_collision_p1.f[0]; tank_collision_dz = check_collision_p2.f[2] - check_collision_p1.f[2]; tank_collision_norm = 1.0f / sqrtf((tank_collision_dx * tank_collision_dx) + (tank_collision_dz * tank_collision_dz)); - sp308 = (tank_collision_dx * tank_collision_norm); - sp308 = -sp308; - sp30C = tank_collision_dz * tank_collision_norm; + // sp308: scoped within this block, used throughout + // sp30C: scoped within this block, used throughout + tank_collision_dx *= tank_collision_norm; + tank_collision_dz *= tank_collision_norm; + sp30C = tank_collision_dz; + sp308 = -tank_collision_dx; - sp1F8 = + // sp1F8 -> sp210: short lived variable + sp210 = ((g_CurrentPlayer->field_488.collision_position.f[0] - check_collision_p2.f[0]) * sp30C) + ((g_CurrentPlayer->field_488.collision_position.f[2] - check_collision_p2.f[2]) * sp308); - if (sp1F8 < 0.0f) + if (sp210 < 0.0f) { + sp210 = -sp210; sp30C = -sp30C; sp308 = -sp308; - sp1F8 = -sp1F8; } + // sp1FC: very short lived variable + // sp1E4: very short lived variable sp1FC = ((g_CurrentPlayer->field_488.collision_position.f[0] - tank_collision_pt1.f[0]) * sp30C) + ((g_CurrentPlayer->field_488.collision_position.f[2] - tank_collision_pt1.f[2]) * sp308); sp1E4 = ((g_CurrentPlayer->field_488.collision_position.f[0] - tank_collision_pt2.f[0]) * sp30C) + ((g_CurrentPlayer->field_488.collision_position.f[2] - tank_collision_pt2.f[2]) * sp308); - + if (sp1E4 < sp1FC) { sp1FC = sp1E4; } - if (sp1FC < sp1F8) + if (sp1FC < sp210) { - sp304 = sp1F8 - sp1FC; + sp304 = sp210 - sp1FC; } - + if ((sp304 >= 0.0f) && ((sp304 < sp31C) || (sp31C < 0.0f))) { sp324 = sp30C; @@ -24624,31 +10819,31 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) if (sp31C >= 0.0f) { - sp3AC.f[0] = sp31C * sp324 * 1.01f; - sp3AC.f[2] = sp31C * sp320 * 1.01f; + move_offset.f[0] = sp31C * sp324 * 1.01f; + move_offset.f[2] = sp31C * sp320 * 1.01f; - bondviewCalcUpdatePlayerCollision(&sp3AC, 1); + bondviewCalcUpdatePlayerCollision(&move_offset, 1); - sp3AC.f[0] = 0.0f; - sp3AC.f[2] = 0.0f; + move_offset.f[0] = 0.0f; + move_offset.f[2] = 0.0f; if (bondviewTankCollisionStatus( &g_CurrentPlayer->field_488.collision_position, g_CurrentPlayer->field_488.current_tile_ptr, - sp35C, + curTankAngleRad, &check_collision_p1, &check_collision_p2)) { - g_TankOrientationAngle = sp35C; + g_TankOrientationAngle = curTankAngleRad; } else { - sp358 = 0.0f; + tankChangeInAngle = 0.0f; } } else { - sp358 = 0.0f; + tankChangeInAngle = 0.0f; } } @@ -24664,49 +10859,44 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_TankTurretAngle += M_TAU_F; } - tank_tick_increment = (g_CurrentPlayer->speedtheta * 3.5f * 0.017453292f * 4.0f) + g_TankTurretAngle; + ftemp = (DegToRad1Fact(g_CurrentPlayer->speedtheta * 3.5f) * 4.0f) + g_TankTurretAngle; - if (tank_tick_increment < 0.0f) + if (ftemp < 0.0f) { - tank_tick_increment += M_TAU_F; + ftemp += M_TAU_F; } - if (tank_tick_increment >= M_TAU_F) + if (ftemp >= M_TAU_F) { - tank_tick_increment -= M_TAU_F; + ftemp -= M_TAU_F; } - if ((tank_tick_increment - g_TankTurretOrientationAngleRad) >= 3.1415927f) + if ((ftemp - g_TankTurretOrientationAngleRad) >= M_PI_F) { - tank_tick_increment -= M_TAU_F; + ftemp -= M_TAU_F; } - else if ((tank_tick_increment - g_TankTurretOrientationAngleRad) < -3.1415927f) + else if ((ftemp - g_TankTurretOrientationAngleRad) < -M_PI_F) { - tank_tick_increment += M_TAU_F; + ftemp += M_TAU_F; } - do - { for (i_1=0; i_1 0); - g_TankTurretOrientationAngleRad = D_80036478 * 0.07999998f; + g_TankTurretOrientationAngleRad = D_80036478 * (1.0f - TANKUPDATEROTATION_SCALE); if (g_TankTurretOrientationAngleRad >= M_TAU_F) { g_TankTurretOrientationAngleRad -= M_TAU_F; - D_80036478 = g_TankTurretOrientationAngleRad / 0.07999998f; + D_80036478 = g_TankTurretOrientationAngleRad / (1.0f - TANKUPDATEROTATION_SCALE); } if (g_TankTurretOrientationAngleRad < 0.0f) { g_TankTurretOrientationAngleRad += M_TAU_F; - D_80036478 = g_TankTurretOrientationAngleRad / 0.07999998f; + D_80036478 = g_TankTurretOrientationAngleRad / (1.0f - TANKUPDATEROTATION_SCALE); } if (bondviewCallTankCollisionStatus( @@ -24715,47 +10905,54 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_TankOrientationAngle) == 0) { g_TankTurretOrientationAngleRad = sp354; - D_80036478 = g_TankTurretOrientationAngleRad / 0.07999998f; + D_80036478 = g_TankTurretOrientationAngleRad / (1.0f - TANKUPDATEROTATION_SCALE); g_TankTurretAngle = sp354; } - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - temp_tank = (struct TankRecord *)ptr_playerstank->obj; + // sp 0x300 + struct TankRecord *temp_tank; + struct coord3d tank_move_offset; + Mtxf sp2B4; + f32 stack_padding_4; - sp2F4.f[1] = 0.0f; - sp2F4.f[0] = flt_CODE_bss_800799A8.f[0]; - sp2F4.f[2] = flt_CODE_bss_800799A8.f[2]; - - matrix_4x4_set_rotation_around_y(sp358, &sp2B4); - matrix_4x4_rotate_vector_in_place(&sp2B4, &sp2F4); - sub_GAME_7F07C7B4(); + temp_tank = (struct TankRecord *)g_PlayerTankProp->obj; + + tank_move_offset.f[1] = 0.0f; + tank_move_offset.f[0] = g_TankModelPositionOffset.f[0]; + tank_move_offset.f[2] = g_TankModelPositionOffset.f[2]; - sp2F4.f[1] = 0.0f; - sp2F4.f[0] = flt_CODE_bss_800799A8.f[0] - sp2F4.f[0]; - sp2F4.f[2] = flt_CODE_bss_800799A8.f[2] - sp2F4.f[2]; + matrix_4x4_set_rotation_around_y(tankChangeInAngle, &sp2B4); + mtx4RotateVecInPlace(&sp2B4, &tank_move_offset); + bondviewTankModelRotationRelated(); + + if (0) { } + + tank_move_offset.f[1] = 0.0f; + tank_move_offset.f[0] = g_TankModelPositionOffset.f[0] - tank_move_offset.f[0]; + tank_move_offset.f[2] = g_TankModelPositionOffset.f[2] - tank_move_offset.f[2]; matrix_4x4_set_rotation_around_y(M_TAU_F - g_TankOrientationAngle, &sp2B4); matrix_scalar_multiply(temp_tank->model->scale, &sp2B4); - matrix_4x4_rotate_vector_in_place(&sp2B4, &sp2F4); - bondviewCalcUpdatePlayerCollision(&sp2F4, 1); + mtx4RotateVecInPlace(&sp2B4, &tank_move_offset); + bondviewCalcUpdatePlayerCollision(&tank_move_offset, 1); } - - if (g_ClockTimer > 0) - { - for (i_2=0; i_2 0) { + for (i=0; ispeedtheta * 3.5f * 0.017453292f; + ftemp = D_8003647C * (1.0f - TANKUPDATEROTATION_SCALE); + g_CurrentPlayer->vv_theta = ( - g_TankTurretOrientationAngleRad + - (ftemp3 * 4.0f )+ - g_TankOrientationAngle + - (ftemp2 * 4.0f) + g_TankOrientationAngle + + g_TankTurretOrientationAngleRad + + ((DegToRad1Fact(g_CurrentPlayer->speedtheta * 3.5f)) * (4.0f)) + + (ftemp * 4.0f) ) * 360.0f / M_TAU_F; while (g_CurrentPlayer->vv_theta < 0.0f) @@ -24769,61 +10966,96 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) } else { - ftemp = g_CurrentPlayer->vv_theta + (g_CurrentPlayer->speedtheta * g_GlobalTimerDelta * 3.5f); + stack_padding_9 = g_CurrentPlayer->vv_theta + (g_CurrentPlayer->speedtheta * g_GlobalTimerDelta * 3.5f); - while (ftemp < 0.0f) + while (stack_padding_9 < 0.0f) { - ftemp += 360.0f; + stack_padding_9 += 360.0f; } - while (ftemp >= 360.0f) + while (stack_padding_9 >= 360.0f) { - ftemp -= 360.0f; + stack_padding_9 -= 360.0f; } - g_CurrentPlayer->vv_theta = ftemp; + g_CurrentPlayer->vv_theta = stack_padding_9; } bondviewApplyVertaTheta(); - sp2AC = 0.0f; - if (currentPlayerGetCrouchPos() == CROUCH_SQUAT) - { - sp2AC = -100.0f; - } - else if (currentPlayerGetCrouchPos() == CROUCH_HALF) - { - sp2AC = -60.0f; - } - else - { - // removed? - currentPlayerGetCrouchPos(); - } - - if (sp2AC != g_CurrentPlayer->ducking_height_offset) + // Handle crouching, and animation between standing and crouching. + // Add basic block to declare local variables at the correct stack position. { - chrobjApplySpeed(&g_CurrentPlayer->ducking_height_offset, sp2AC, &g_CurrentPlayer->field_A4, 0.5f, 0.5f, 5.0f); - } + f32 sp2AC; + f32 stack_padding_15; + + sp2AC = 0.0f; + if (currentPlayerGetCrouchPos() == CROUCH_SQUAT) + { + sp2AC = FULL_CROUCH_OFFSET; + } + else if (currentPlayerGetCrouchPos() == CROUCH_HALF) + { + sp2AC = -60.0f; + } + else + { + // removed? + currentPlayerGetCrouchPos(); + } - if (sp2AC == g_CurrentPlayer->ducking_height_offset) - { - g_CurrentPlayer->field_A4 = 0.0f; + if (sp2AC != g_CurrentPlayer->ducking_height_offset) + { + chrobjApplySpeed( + &g_CurrentPlayer->ducking_height_offset, + sp2AC, + &g_CurrentPlayer->field_A4, + CHR_OBJ_ACCEL_SPEED_FACTOR, + CHR_OBJ_ACCEL_SPEED_FACTOR, + CHR_OBJ_MAXSPEED); + } + + if (sp2AC == g_CurrentPlayer->ducking_height_offset) + { + g_CurrentPlayer->field_A4 = 0.0f; + } } + /** + * Update forwards/backwards movement. + */ if (in_tank_flag == 1) { - if (g_EnterTankAudioState == 0) + /** + * This section handles the forward/backwards movement of the tank. + */ + + Mtxf sp268; + struct coord3d sp25C; + f32 sp258; + f32 sp254; + s32 stack_padding_14; + s32 i_3; + f32 ftemp_5; + f32 tank_engine_utilization_percent; + struct TankRecord *tank_obj; + + /** + * Check to see if Bond is just now entering the tank. + * If so, initialize the tank prop. + * This also handles spinning Bond around (if required) to face the same direction as the turret. + */ + if (g_EnterTankAudioState == TANK_RUN_STATE_NOT_RUNNING) { - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - tank_obj = ptr_playerstank->obj; + tank_obj = g_PlayerTankProp->obj; matrix_4x4_set_rotation_around_y(M_TAU_F - g_TankOrientationAngle, &sp268); matrix_scalar_multiply(tank_obj->model->scale, &sp268); - sp25C.f[0] = flt_CODE_bss_800799A8.f[0]; - sp25C.f[1] = flt_CODE_bss_800799A8.f[1]; - sp25C.f[2] = flt_CODE_bss_800799A8.f[2]; - matrix_4x4_rotate_vector_in_place(&sp268, (f32*)&sp25C); + sp25C.f[0] = g_TankModelPositionOffset.f[0]; + sp25C.f[1] = g_TankModelPositionOffset.f[1]; + sp25C.f[2] = g_TankModelPositionOffset.f[2]; + mtx4RotateVecInPlace(&sp268, (f32*)&sp25C); sp25C.f[0] += tank_obj->runtime_pos.f[0]; sp25C.f[1] += tank_obj->runtime_pos.f[1]; @@ -24844,26 +11076,23 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_TankEnteringSitHeightRemain = (cosf(g_TankEnteringSitHeight * M_TAU_F * 0.5f) + 1.0f) * 0.5f; - // sp17C is unused extra assignment - sp17C = g_CurrentPlayer->vv_verta = ( - ((1.0f - g_TankEnteringSitHeightRemain) * sp254) + + g_CurrentPlayer->vv_verta = (g_TankEnteringSitHeightRemain * g_TankEnterBondVertAngleDeg) - ); + + ((1.0f - g_TankEnteringSitHeightRemain) * sp254); - sp258 -= g_TankEnterBondHorizAngleDeg; - if (sp258 > 180.0f) + ftemp_5 = sp258 - g_TankEnterBondHorizAngleDeg; + if (ftemp_5 > 180.0f) { sp258 -= 360.0f; } - if (sp258 < -180.0f) + if (ftemp_5 < -180.0f) { sp258 += 360.0f; } - g_CurrentPlayer->vv_theta = ( - ((1.0f - g_TankEnteringSitHeightRemain) * sp258) + - (g_TankEnteringSitHeightRemain * g_TankEnterBondHorizAngleDeg) - ); + g_CurrentPlayer->vv_theta = + (g_TankEnteringSitHeightRemain * g_TankEnterBondHorizAngleDeg) + + ((1.0f - g_TankEnteringSitHeightRemain) * sp258); if (g_CurrentPlayer->vv_theta >= 360.0f) { @@ -24875,146 +11104,171 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_CurrentPlayer->vv_theta += 360.0f; } - sp3AC.f[0] = ( + move_offset.f[0] = ( (g_TankEnteringSitHeightRemain * g_EnterTankCoord.f[0]) + ((1.0f - g_TankEnteringSitHeightRemain) * sp25C.f[0]) ) - g_CurrentPlayer->field_488.collision_position.f[0]; - sp3AC.f[1] = 0.0f; + move_offset.f[1] = 0.0f; - sp3AC.f[2] = ( + move_offset.f[2] = ( (g_TankEnteringSitHeightRemain * g_EnterTankCoord.f[2]) + ((1.0f - g_TankEnteringSitHeightRemain) * sp25C.f[2]) ) - g_CurrentPlayer->field_488.collision_position.f[2]; } - if (g_TankEnteringSitHeight <= 1.0f) + if (!(g_TankEnteringSitHeight >= 1.0f)) + { + } + else { - g_EnterTankAudioState = 1; + g_EnterTankAudioState = TANK_RUN_STATE_STARTING; } } + /** + * Else, Bond has already entered the tank. + */ else { - if (g_EnterTankAudioState == 1) + /** + * There's an initial "starting" step. + */ + if (g_EnterTankAudioState == TANK_RUN_STATE_STARTING) { - g_EnterTankAudioState = 2; - if ((SFX_80036458[0] == NULL) && (lvlGetControlsLockedFlag() == 0)) + g_EnterTankAudioState = TANK_RUN_STATE_RUNNING; + if ((g_TankSfxState[0] == NULL) && (lvlGetControlsLockedFlag() == 0)) { - sndPlaySfx(g_musicSfxBufferPtr, TRUCK_START_SFX, &SFX_80036458[0]); + sndPlaySfx(g_musicSfxBufferPtr, TRUCK_START_SFX, &g_TankSfxState[0]); } - sndCreatePostEvent(SFX_80036458[0], 8, 0x61A8); + + sndCreatePostEvent(g_TankSfxState[0], 8, 0x61A8); g_TankEngineSfxVolume = 0x61A8; } + /** + * Else Bond has fully entered the tank, and the engine is running. + * Update turret vertical angle. + * Update engine sound effect volume based on current tank speed. + */ else { - temp_f0_18 = g_CurrentPlayer->speedforwards / 15.0f; - temp_f2_12 = g_CurrentPlayer->speedtheta / 0.3f; + f32 tank_scaled_speedforwards; + f32 tank_scaled_speedtheta; + f32 tank_vertical_angle; + + tank_scaled_speedforwards = g_CurrentPlayer->speedforwards / TANK_MAX_SPEED; + tank_scaled_speedtheta = g_CurrentPlayer->speedtheta / 0.3f; - if (temp_f0_18 < 0.0f) + if (tank_scaled_speedforwards < 0.0f) { - temp_f0_18 = -temp_f0_18; + tank_scaled_speedforwards = -tank_scaled_speedforwards; } - if (temp_f2_12 < 0.0f) + if (tank_scaled_speedtheta < 0.0f) { - temp_f2_12 = -temp_f2_12; + tank_scaled_speedtheta = -tank_scaled_speedtheta; } - sp244_tank_engine_utilization = temp_f0_18; - if (temp_f0_18 < temp_f2_12) + tank_engine_utilization_percent = tank_scaled_speedforwards; + if (tank_scaled_speedforwards < tank_scaled_speedtheta) { - sp244_tank_engine_utilization = temp_f2_12; + tank_engine_utilization_percent = tank_scaled_speedtheta; } - if (sp244_tank_engine_utilization > 0.0f) + if (tank_engine_utilization_percent > 0.0f) { - if (sp244_tank_engine_utilization > 1.0f) + if (tank_engine_utilization_percent > 1.0f) { - sp244_tank_engine_utilization = 1.0f; + tank_engine_utilization_percent = 1.0f; } - if (SFX_80036458[1] == NULL) + if (g_TankSfxState[1] == NULL) { if (lvlGetControlsLockedFlag() == 0) { - sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TANK_SFX, &SFX_80036458[1]); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TANK_SFX, &g_TankSfxState[1]); } } - if (SFX_80036458[1] != NULL) + if (g_TankSfxState[1] != NULL) { + s32 phi_a2; + phi_a2 = 0x7FFF; - if (sp244_tank_engine_utilization < 0.15f) + if (tank_engine_utilization_percent < 0.15f) { - phi_a2 = (s32) ((sp244_tank_engine_utilization * 20000.0f) / 0.15f); + phi_a2 = (s32) ((tank_engine_utilization_percent * 20000.0f) / 0.15f); } - else if (sp244_tank_engine_utilization < 0.9f) + else if (tank_engine_utilization_percent < 0.9f) { - phi_a2 = (s32) ((((sp244_tank_engine_utilization - 0.15f) * 12767.0f) / 0.75f) + 20000.0f); + phi_a2 = (s32) ((((tank_engine_utilization_percent - 0.15f) * 12767.0f) / 0.75f) + 20000.0f); } - sndCreatePostEvent(SFX_80036458[1], 8, phi_a2); + + sndCreatePostEvent(g_TankSfxState[1], 8, phi_a2); } } else { - if (SFX_80036458[1] != NULL) + if (g_TankSfxState[1] != NULL) { - if (sndGetPlayingState(SFX_80036458[1]) != 0) + if (sndGetPlayingState(g_TankSfxState[1]) != 0) { - sndDeactivate(SFX_80036458[1]); + sndDeactivate(g_TankSfxState[1]); } } } - if (SFX_80036458[0] == NULL) + if (g_TankSfxState[0] == NULL) { if (lvlGetControlsLockedFlag() == 0) { - sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TRUCK_RUN_SFX, &SFX_80036458[0]); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TRUCK_RUN_SFX, &g_TankSfxState[0]); } } - if (SFX_80036458[0] != NULL) + if (g_TankSfxState[0] != NULL) { g_TankEngineSfxVolume = 0x7FFF; - if (sp244_tank_engine_utilization < 0.9f) + if (tank_engine_utilization_percent < 0.9f) { - g_TankEngineSfxVolume = (s32) (((sp244_tank_engine_utilization * 7767.0f) / 0.9f) + 25000.0f); + g_TankEngineSfxVolume = (s32) (((tank_engine_utilization_percent * 7767.0f) / 0.9f) + 25000.0f); } - sndCreatePostEvent(SFX_80036458[0], 8, g_TankEngineSfxVolume); + sndCreatePostEvent(g_TankSfxState[0], 8, g_TankEngineSfxVolume); } if (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TANKSHELLS) { - phi_f2_6 = g_CurrentPlayer->field_2A08 + 0.17453294f; + tank_vertical_angle = g_CurrentPlayer->field_2A08; + tank_vertical_angle += 0.17453294f; /* should be DegToRad1Fact(10), but that yields 0.17453293f */ } else { - phi_f2_6 = g_TankTurretVerticalAngle; + tank_vertical_angle = g_TankTurretVerticalAngle; } - if (phi_f2_6 > 0.43633232f) + if (tank_vertical_angle > DegToRad1Fact(25)) { - phi_f2_6 = 0.43633232f; + tank_vertical_angle = DegToRad1Fact(25); } - if (phi_f2_6 < -0.08726647f) + /* -0.087266468f should be DegToRad1Fact(-5), but that yields -0.0872664600611 */ + if (tank_vertical_angle < -0.087266468f) { - phi_f2_6 = -0.08726647f; + tank_vertical_angle = -0.087266468f; } - for (i_4=0; i_4bondbreathing -= (0.75f * g_GlobalTimerDelta) / 2700.0f; + + g_CurrentPlayer->bondbreathing -= (0.750f * g_GlobalTimerDelta) / 2700.0f; if (g_CurrentPlayer->bondbreathing < 0.0f) { @@ -25023,113 +11277,171 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) bondviewMoveAnimationTick(0.0f, 0.0f, 0.0f); - sp3AC.f[0] += g_CurrentPlayer->speedforwards * sinf(M_TAU_F - g_TankOrientationAngle) * g_GlobalTimerDelta; - sp3AC.f[2] += g_CurrentPlayer->speedforwards * cosf(M_TAU_F - g_TankOrientationAngle) * g_GlobalTimerDelta; + move_offset.f[0] += g_CurrentPlayer->speedforwards * sinf(M_TAU_F - g_TankOrientationAngle) * g_GlobalTimerDelta; + move_offset.f[2] += g_CurrentPlayer->speedforwards * cosf(M_TAU_F - g_TankOrientationAngle) * g_GlobalTimerDelta; - bondviewCalcUpdatePlayerCollision(&sp3AC, 1); + bondviewCalcUpdatePlayerCollision(&move_offset, 1); - if ((g_EnterTankAudioState == 2) && (g_ClockTimer > 0)) + if ((g_EnterTankAudioState == TANK_RUN_STATE_RUNNING) && (g_ClockTimer > 0)) { - temp_f0_19 = (g_CurrentPlayer->field_488.collision_position.f[0] - g_CurrentPlayer->bondprevpos.f[0]) / g_GlobalTimerDelta; - temp_f2_13 = (g_CurrentPlayer->field_488.collision_position.f[2] - g_CurrentPlayer->bondprevpos.f[2]) / g_GlobalTimerDelta; - temp_f0_20 = sqrtf((temp_f0_19 * temp_f0_19) + (temp_f2_13 * temp_f2_13)); + f32 calc_x; + f32 calc_z; + f32 calc_speedforwards; + +#if defined(VERSION_EU) + // Divide by zero check. + if (g_GlobalTimerDelta == 0) + { + #if DEBUG + // unknown what went here. + return_null(); + #endif + } +#endif + + calc_x = (g_CurrentPlayer->field_488.collision_position.f[0] - g_CurrentPlayer->bondprevpos.f[0]) / g_GlobalTimerDelta; + calc_z = (g_CurrentPlayer->field_488.collision_position.f[2] - g_CurrentPlayer->bondprevpos.f[2]) / g_GlobalTimerDelta; + calc_speedforwards = sqrtf((calc_x * calc_x) + (calc_z * calc_z)); + if (g_CurrentPlayer->speedforwards < 0.0f) { - temp_f0_20 = -temp_f0_20; + calc_speedforwards = -calc_speedforwards; } - g_CurrentPlayer->speedforwards = temp_f0_20; + + g_CurrentPlayer->speedforwards = calc_speedforwards; } } - else + else // not in tank: in_tank_flag != 1 { - if ((SFX_80036458[0] != NULL) && (sndGetPlayingState(SFX_80036458[0]) != 0)) + f32 sp220; + f32 sp21C; + f32 dist; + f32 ftemp_col_x; + f32 ftemp_col_z; + f32 stack_padding_12; + f32 start_collision_pos_x; + f32 start_collision_pos_z; + struct StandTile *sp200; + f32 stack_padding_2; + s32 stack_padding_11; + f32 speedforwards; + f32 ftemp_11; + f32 speedsideways; + f32 speedtheta; + f32 stack_padding_25; + f32 stack_padding_5; + s32 stack_padding_6; + f32 sp164; + f32 sp2B0; + f32 stack_padding_3; + f32 stack_padding_111; + f32 ftemp_26; + f32 nd; // canonical name + f32 ftemp_7; + f32 sp240; + struct move_bond_temp_struct curLocus; + struct move_bond_collision bondCollision; + f32 shorten; // canonical name + f32 headpos_x; + f32 headpos_z; + struct StandTile *sp174; + struct StandTile *sp170; + f32 sp16C; + f32 sp168; + + if ((g_TankSfxState[0] != NULL) && (sndGetPlayingState(g_TankSfxState[0]) != 0)) { + #if defined(VERSION_US) g_TankEngineSfxVolume -= (g_ClockTimer * 1000); + #endif + + #if defined(VERSION_JP) || defined(VERSION_EU) + g_TankEngineSfxVolume -= (s32)(1000.0f * g_GlobalTimerDelta); + #endif + if (g_TankEngineSfxVolume > 0) { - sndCreatePostEvent(SFX_80036458[0], 8, g_TankEngineSfxVolume); + sndCreatePostEvent(g_TankSfxState[0], 8, g_TankEngineSfxVolume); } else { - sndDeactivate(SFX_80036458[0]); + sndDeactivate(g_TankSfxState[0]); } } - if ((SFX_80036458[1] != NULL) && (sndGetPlayingState(SFX_80036458[1]) != 0)) + if ((g_TankSfxState[1] != NULL) && (sndGetPlayingState(g_TankSfxState[1]) != 0)) { - sndDeactivate(SFX_80036458[1]); + sndDeactivate(g_TankSfxState[1]); } - stack_padding_25 = sp3A0 = g_CurrentPlayer->speedsideways; - if(0); - sp3A0 *= g_BondMoveAnimationSetup[1].unk0C * 0.5f * g_GlobalTimerDelta; - stack_padding_26 = g_CurrentPlayer->field_488.field_10.f[2]; - stack_padding_11 = g_CurrentPlayer->field_488.field_10.f[0]; - sp220 = (stack_padding_26 * -g_CurrentPlayer->swaytarget) - - g_CurrentPlayer->field_1278; + ftemp_7 = (g_BondMoveAnimationSetup[1].unk0C * 0.5f * g_GlobalTimerDelta); + sp3A0 = g_CurrentPlayer->speedsideways * ftemp_7; - sp21C = (stack_padding_11 * g_CurrentPlayer->swaytarget) - - g_CurrentPlayer->field_127C; + /* + The following is similar to a block of Perfect Dark bwalk0f0c69b8. + */ + + ftemp_26 = -g_CurrentPlayer->swaytarget * g_CurrentPlayer->field_488.theta_transform.f[2]; + ftemp_11 = g_CurrentPlayer->swaytarget * g_CurrentPlayer->field_488.theta_transform.f[0]; + + sp220 = (ftemp_26) - g_CurrentPlayer->swayoffset0; + sp21C = (ftemp_11) - g_CurrentPlayer->swayoffset2; - sp218 = (sp21C * sp21C) + (sp220 * sp220); + dist = (sp220 * sp220) + (sp21C * sp21C); - if (sp218 >= 100.0f) + if (dist >= 100.0f) { - sp220 *= 0.6f; - sp21C *= 0.6f; + sp220 *= 0.6f * 1.0f; + sp21C *= 0.6f * 1.0f; } - stack_padding_6 = g_CurrentPlayer->speedforwards; - stack_padding_25 = stack_padding_25 * 0.8f; - sp32C = g_CurrentPlayer->speedtheta * 0.8f; + speedsideways = g_CurrentPlayer->speedsideways * MAX_SPEED_FACTOR; + speedforwards = g_CurrentPlayer->speedforwards; + speedtheta = g_CurrentPlayer->speedtheta * MAX_SPEED_FACTOR; - if (stack_padding_25 < 0.0f) + if (speedsideways < 0.0f) { - stack_padding_25 = -stack_padding_25; + speedsideways = -speedsideways; } - if (sp32C < 0.0f) + if (speedforwards < 0.0f) { - sp32C = -sp32C; + speedforwards = -speedforwards; } - if (stack_padding_6 < 0.0f) + if (speedtheta < 0.0f) { - stack_padding_6 = -stack_padding_6; + speedtheta = -speedtheta; } - if(1); - - sp330 = stack_padding_25; - sp398 = stack_padding_6; - if (sp398 < sp330) + maxspeed = speedforwards; + +#if defined(VERSION_EU) + if (maxspeed < speedsideways && 1) +#else + if (maxspeed < speedsideways) +#endif { - sp398 = sp330; + maxspeed = speedsideways; } - if (sp398 < sp32C) + if (maxspeed < speedtheta) { - sp398 = sp32C; + maxspeed = speedtheta; } - if(sp398); - if(sp398); - - if ((sp218 >= 0.1f) && (sp398 < 0.8f)) + if (dist >= 0.1f && maxspeed < MAX_SPEED_FACTOR) { - sp398 = 0.8f; + maxspeed = MAX_SPEED_FACTOR; } - if (sp398 >= 0.75f); - if (sp398 >= 0.75f); - - if (sp398 >= 0.75f) + if (maxspeed >= 0.750f) { - g_CurrentPlayer->bondbreathing += ((sp398 - 0.75f) * g_GlobalTimerDelta) / 900.0f ; + g_CurrentPlayer->bondbreathing += (maxspeed - 0.750f) * g_GlobalTimerDelta / 900.0f ; } else { - g_CurrentPlayer->bondbreathing -= ((0.75f - sp398) * g_GlobalTimerDelta) / 2700.0f; + g_CurrentPlayer->bondbreathing -= (0.750f - maxspeed) * g_GlobalTimerDelta / 2700.0f; } - + if (g_CurrentPlayer->bondbreathing < 0.0f) { g_CurrentPlayer->bondbreathing = 0.0f; @@ -25138,27 +11450,28 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) { g_CurrentPlayer->bondbreathing = 1.0f; } + + // perfect dark call: bmove0f0cc654 + bondviewMoveAnimationTick(maxspeed, g_CurrentPlayer->speedforwards, sp3A0); - stack_padding_2 = g_CurrentPlayer->speedforwards; - bondviewMoveAnimationTick(sp398, stack_padding_2, sp3A0); + headpos_x = g_CurrentPlayer->headpos.f[0]; + headpos_z = g_CurrentPlayer->headpos.f[2]; - ftemp = g_CurrentPlayer->headpos[0]; - ftemp2 = g_CurrentPlayer->headpos[2]; - sp3AC.f[0] += + move_offset.f[0] += ( - (ftemp2 * g_CurrentPlayer->field_488.field_10.f[0]) - - (ftemp * g_CurrentPlayer->field_488.field_10.f[2]) + (headpos_z * g_CurrentPlayer->field_488.theta_transform.f[0]) - + (headpos_x * g_CurrentPlayer->field_488.theta_transform.f[2]) ) * g_GlobalTimerDelta; - sp3AC.f[2] += + move_offset.f[2] += ( - (ftemp2 * g_CurrentPlayer->field_488.field_10.f[2]) + - (ftemp * g_CurrentPlayer->field_488.field_10.f[0]) + (headpos_z * g_CurrentPlayer->field_488.theta_transform.f[2]) + + (headpos_x * g_CurrentPlayer->field_488.theta_transform.f[0]) ) * g_GlobalTimerDelta; - + - sp3AC.f[0] += sp220; - sp3AC.f[2] += sp21C; + move_offset.f[0] += sp220; + move_offset.f[2] += sp21C; start_collision_pos_x = g_CurrentPlayer->field_488.collision_position.f[0]; start_collision_pos_z = g_CurrentPlayer->field_488.collision_position.f[2]; @@ -25166,31 +11479,32 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) if (get_debug_fast_bond_flag()) { - sp3AC.f[0] += + move_offset.f[0] += ( - (g_CurrentPlayer->field_488.field_10.f[0] * g_CurrentPlayer->speedforwards) - - (g_CurrentPlayer->field_488.field_10.f[2] * g_CurrentPlayer->speedsideways) + (g_CurrentPlayer->field_488.theta_transform.f[0] * g_CurrentPlayer->speedforwards) - + (g_CurrentPlayer->field_488.theta_transform.f[2] * g_CurrentPlayer->speedsideways) ) * g_GlobalTimerDelta * 10.0f; - sp3AC.f[2] += + move_offset.f[2] += ( - (g_CurrentPlayer->field_488.field_10.f[2] * g_CurrentPlayer->speedforwards) + - (g_CurrentPlayer->field_488.field_10.f[0] * g_CurrentPlayer->speedsideways) + (g_CurrentPlayer->field_488.theta_transform.f[2] * g_CurrentPlayer->speedforwards) + + (g_CurrentPlayer->field_488.theta_transform.f[0] * g_CurrentPlayer->speedsideways) ) * g_GlobalTimerDelta * 10.0f; } - bondviewCalcUpdatePlayerCollision(&sp3AC, (g_CurrentPlayer->swaytarget == 0.0f)); + bondviewCalcUpdatePlayerCollision(&move_offset, (g_CurrentPlayer->swaytarget == 0.0f)); stanTileDistanceRelated( &sp200, start_collision_pos_x, start_collision_pos_z, g_CurrentPlayer->field_488.collision_radius * 1.16f, - &sp1B4); + &curLocus); - if (stanGetLocusCount(&sp1B4) != 0) + /* almost never true */ + if (stanGetLocusCount(&curLocus) != 0) { - sp394 = 1; + use_stanHeight = 1; } stanTileDistanceRelated( @@ -25198,11 +11512,12 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], g_CurrentPlayer->field_488.collision_radius * 1.01f, - &sp1B4); + &curLocus); - if (stanGetLocusCount(&sp1B4) != 0) + /* almost never true */ + if (stanGetLocusCount(&curLocus) != 0) { - sp394 = 1; + use_stanHeight = 1; } stanTileDistanceRelated( @@ -25210,39 +11525,52 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], g_CurrentPlayer->field_488.collision_radius, - &sp1B4); + &curLocus); - if (stanGetLocusCount(&sp1B4) == 0) + /* almost always true */ + if (stanGetLocusCount(&curLocus) == 0) { - stanTileDistanceRelated(&sp200, start_collision_pos_x, start_collision_pos_z, g_CurrentPlayer->field_488.collision_radius * 0.990099f, &sp1B4); + stanTileDistanceRelated( + &sp200, + start_collision_pos_x, + start_collision_pos_z, + g_CurrentPlayer->field_488.collision_radius * 0.990099f, + &curLocus); } - if (stanGetLocusCount(&sp1B4) != 0) + /* almost never true */ + if (stanGetLocusCount(&curLocus)) { - sp394 = 1; - stanGetMoveBondCollisionTiles(&sp174, &sp170, &sp184); + use_stanHeight = 1; + stanGetMoveBondCollisionTiles(&sp174, &sp170, &bondCollision); - if (g_CurrentPlayer->stanHeight <= sp184.sp19C.f[1]) + if (g_CurrentPlayer->stanHeight <= bondCollision.sp19C.f[1]) { - sp168 = sp184.sp184.f[0] - sp184.sp190.f[0]; - sp16C = sp184.sp190.f[2] - sp184.sp184.f[2]; + f32 sp2A8; + f32 sp24C; + f32 sp250; + f32 sp310; + f32 sp314; - sp328 = sqrtf((sp16C * sp16C) + (sp168 * sp168)); + sp168 = bondCollision.bondCollision.f[0] - bondCollision.sp190.f[0]; + sp16C = bondCollision.sp190.f[2] - bondCollision.bondCollision.f[2]; + + nd = sqrtf((sp16C * sp16C) + (sp168 * sp168)); - sp168 = sp168 / sp328; - sp16C = sp16C / sp328; + sp168 = sp168 / nd; + sp16C = sp16C / nd; sp164 = - ((start_collision_pos_x - sp184.sp184.f[0]) * sp16C) + - ((start_collision_pos_z - sp184.sp184.f[2]) * sp168); + ((start_collision_pos_x - bondCollision.bondCollision.f[0]) * sp16C) + + ((start_collision_pos_z - bondCollision.bondCollision.f[2]) * sp168); sp2B0 = - (((start_collision_pos_x + sp3AC.f[0]) - sp184.sp184.f[0]) * sp16C) + - (((start_collision_pos_z + sp3AC.f[2]) - sp184.sp184.f[2]) * sp168); + (((start_collision_pos_x + move_offset.f[0]) - bondCollision.bondCollision.f[0]) * sp16C) + + (((start_collision_pos_z + move_offset.f[2]) - bondCollision.bondCollision.f[2]) * sp168); if ((sp164 * sp2B0) <= 0.0f) { - sp180 = 0.0f; + shorten = 0.0f; } else { @@ -25254,98 +11582,138 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) if (sp164 <= sp2B0) { - sp180 = 0.0f; + shorten = 0.0f; } else if (g_CurrentPlayer->field_488.collision_radius < sp2B0) { - sp180 = 0.0f; + shorten = 0.0f; } else if (sp164 < g_CurrentPlayer->field_488.collision_radius) { - sp180 = 0.0f; + shorten = 0.0f; } else { - sp180 = (sp164 - g_CurrentPlayer->field_488.collision_radius) / (sp164 - sp2B0); + shorten = (sp164 - g_CurrentPlayer->field_488.collision_radius) / (sp164 - sp2B0); } } - sp2A8 = sqrtf((sp3AC.f[0] * sp3AC.f[0]) + (sp3AC.f[2] * sp3AC.f[2])); + sp2A8 = sqrtf((move_offset.f[0] * move_offset.f[0]) + (move_offset.f[2] * move_offset.f[2])); if (sp2A8 > 0.0f) { - sp318 = (1.0f - sp180) * sp2A8; - sp390 = sp318 * 0.25f; + f32 sp318; - if (sp184.sp19C.f[1] <= (g_CurrentPlayer->stanHeight + sp390)) + sp318 = (1.0f - shorten) * sp2A8; + sp390 = sp318 * 0.25f; + + if (bondCollision.sp19C.f[1] <= (g_CurrentPlayer->stanHeight + sp390)) { - sp390 = sp184.sp19C.f[1] - g_CurrentPlayer->stanHeight; - sp180 += ((sp318 - (sp390 / 0.25f)) / sp2A8); + sp390 = (bondCollision.sp19C.f[1] - g_CurrentPlayer->stanHeight); + sp318 -= (sp390 / 0.25f); + shorten += (sp318 / sp2A8); } } - sp314 = sp184.sp19C.f[0] - sp184.sp184.f[0]; - sp310 = sp184.sp19C.f[2] - sp184.sp184.f[2]; - sp250 = sp184.sp1A8.f[0] - sp184.sp184.f[0]; - sp24C = sp184.sp1A8.f[2] - sp184.sp184.f[2]; - + sp314 = bondCollision.sp19C.f[0] - bondCollision.bondCollision.f[0]; + sp310 = bondCollision.sp19C.f[2] - bondCollision.bondCollision.f[2]; + sp250 = bondCollision.sp1A8.f[0] - bondCollision.bondCollision.f[0]; + sp24C = bondCollision.sp1A8.f[2] - bondCollision.bondCollision.f[2]; + if (((sp250 * sp250) + (sp24C * sp24C)) < ((sp314 * sp314) + (sp310 * sp310))) { sp314 = sp250; sp310 = sp24C; } - - sp3AC.f[0] = (sp180 * sp3AC.f[0]) + (sp314 * (sp390 / (sp184.sp19C.f[1] - sp184.sp184.f[1]))); - sp3AC.f[2] = (sp180 * sp3AC.f[2]) + (sp310 * (sp390 / (sp184.sp19C.f[1] - sp184.sp184.f[1]))); + + move_offset.f[0] = (move_offset.f[0] * shorten) + (sp314 * (sp390 / (bondCollision.sp19C.f[1] - bondCollision.bondCollision.f[1]))); + move_offset.f[2] = (move_offset.f[2] * shorten) + (sp310 * (sp390 / (bondCollision.sp19C.f[1] - bondCollision.bondCollision.f[1]))); g_CurrentPlayer->field_488.collision_position.f[0] = start_collision_pos_x; g_CurrentPlayer->field_488.collision_position.f[2] = start_collision_pos_z; g_CurrentPlayer->field_488.current_tile_ptr = sp200; - bondviewCalcUpdatePlayerCollision(&sp3AC, (g_CurrentPlayer->swaytarget == 0.0f)); + bondviewCalcUpdatePlayerCollision(&move_offset, (g_CurrentPlayer->swaytarget == 0.0f)); } } - collision_pos_dx = g_CurrentPlayer->field_488.collision_position.f[0] - start_collision_pos_x; - collision_pos_dz = g_CurrentPlayer->field_488.collision_position.f[2] - start_collision_pos_z; - sp240 = (sp3AC.f[0] * sp3AC.f[0]) + (sp3AC.f[2] * sp3AC.f[2]); + ftemp_col_x = g_CurrentPlayer->field_488.collision_position.f[0] - start_collision_pos_x; + ftemp_col_z = g_CurrentPlayer->field_488.collision_position.f[2] - start_collision_pos_z; + sp240 = (move_offset.f[0] * move_offset.f[0]) + (move_offset.f[2] * move_offset.f[2]); if (sp240 != 0.0f) { - sp240 /= ((collision_pos_dx * collision_pos_dx) + (collision_pos_dz * collision_pos_dz)); + sp240 = ((ftemp_col_x * ftemp_col_x) + (ftemp_col_z * ftemp_col_z)) / sp240; } - sp248 = sqrtf(sp240); - g_CurrentPlayer->field_1278 += sp248 * sp220; - g_CurrentPlayer->field_127C += sp248 * sp21C; + sp240 = sqrtf(sp240); + g_CurrentPlayer->swayoffset0 += sp240 * sp220; + g_CurrentPlayer->swayoffset2 += sp240 * sp21C; } - - sp14C_temp = g_CurrentPlayer->speedtheta; - weapon_speed_verta = - (g_CurrentPlayer->speedverta / 0.7f) + - (g_CurrentPlayer->field_A4 / 5.0f); - phi_f12_8 = bheadGetBreathingValue(); - - if (weapon_speed_verta > 1.0f) - { - weapon_speed_verta = 1.0f; - } - else if (weapon_speed_verta < -1.0f) + // add basic block { - weapon_speed_verta = -1.0f; - } + f32 breathing; + f32 sp14C_temp; + f32 weapon_speed_verta; + + sp14C_temp = g_CurrentPlayer->speedtheta; + weapon_speed_verta = + (g_CurrentPlayer->speedverta / 0.7f) + + (g_CurrentPlayer->field_A4 / CHR_OBJ_MAXSPEED); + + /* + Following matches the end of Perfect Dark bwalk0f0c69b8 + */ + breathing = bheadGetBreathingValue(); + + if (weapon_speed_verta > 1.0f) + { + weapon_speed_verta = 1.0f; + } + else if (weapon_speed_verta < -1.0f) + { + weapon_speed_verta = -1.0f; + } + + if (g_CurrentPlayer->headanim == 1) + { + breathing *= 1.2f; + } + + // Perfect Dark call bgun0f09d8dc + gunSetBondWeaponSway(breathing, maxspeed, weapon_speed_verta, sp14C_temp); - if (g_CurrentPlayer->headanim == 1) - { - phi_f12_8 *= 1.2f; + // Perfect Dark call bgunSetAdjustPos + gunSetOffsetRelated(DegToRad1Fact(g_CurrentPlayer->vv_verta360)); } - gunSetBondWeaponSway(phi_f12_8, sp398, weapon_speed_verta, sp14C_temp); - gunSetOffsetRelated(g_CurrentPlayer->vv_verta360 * 0.017453292f); + // end perfect dark `void bwalk0f0c69b8(void)` - if ((ptr_playerstank != NULL) && (in_tank_flag == 1) && (g_EnterTankAudioState == 2)) + /** + * The following section updates the TankRecord fields, and handles prop collision detection + * with the tank. If colliding with character, play the "arrrhghhg" sound effect, or if + * colliding with prop then set tank movement penalty and create an explosion. + */ + if ((g_PlayerTankProp != NULL) && (in_tank_flag == 1) && (g_EnterTankAudioState == TANK_RUN_STATE_RUNNING)) { - sp140_tank_as_TankRecord = ((struct TankRecord *)ptr_playerstank->obj); - sp138_tank_as_ObjectRecord = (struct ObjectRecord*)ptr_playerstank->obj; - sp130 = (struct ModelRoData_BoundingBoxRecord *)((struct ModelNode *)sp138_tank_as_ObjectRecord->model->obj->Switches)->Child->Data; + struct PropRecord *prop; + struct TankRecord *sp140_tank_as_TankRecord; + struct ObjectRecord *sp138_tank_as_ObjectRecord; + f32 ftemp_12; + struct ModelNode_BoundingBoxRecord *sp130; + Mtxf spF0; + struct coord3d spE4; + s32 stack_padding_13; + s32 i_4; + s32 stemp; + void *stack_padding_8; + struct rect4f spB4_tank_collision_bounds; + // roomids + s32 sp94[8]; + s32 stanlineret; + s16 *lookup_index; + + sp140_tank_as_TankRecord = ((struct TankRecord *)g_PlayerTankProp->obj); + sp138_tank_as_ObjectRecord = (struct ObjectRecord*)g_PlayerTankProp->obj; + sp130 = (struct ModelNode_BoundingBoxRecord *)((struct ModelNode *)sp138_tank_as_ObjectRecord->model->obj->Switches)->Child->Data; sp140_tank_as_TankRecord->is_firing_tank = (getCurrentPlayerWeaponId(GUNRIGHT) == ITEM_TANKSHELLS) && get_hands_firing_status(GUNRIGHT); @@ -25356,48 +11724,53 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) matrix_4x4_set_rotation_around_y(M_TAU_F - g_TankOrientationAngle, &spF0); matrix_scalar_multiply(sp138_tank_as_ObjectRecord->model->scale, &spF0); - - spE4.f[0] = -flt_CODE_bss_800799A8.f[0]; - spE4.f[1] = -flt_CODE_bss_800799A8.f[1]; - spE4.f[2] = -flt_CODE_bss_800799A8.f[2]; - matrix_4x4_rotate_vector_in_place(&spF0, &spE4); + spE4.f[0] = -g_TankModelPositionOffset.f[0]; + spE4.f[1] = -g_TankModelPositionOffset.f[1]; + spE4.f[2] = -g_TankModelPositionOffset.f[2]; + + mtx4RotateVecInPlace(&spF0, &spE4); spE4.f[0] += g_CurrentPlayer->field_488.collision_position.f[0]; spE4.f[2] += g_CurrentPlayer->field_488.collision_position.f[2]; sp138_tank_as_ObjectRecord->prop->stan = g_CurrentPlayer->field_488.current_tile_ptr; - walkTilesBetweenPoints_NoCallback( + stanlineret = walkTilesBetweenPoints_NoCallback( &sp138_tank_as_ObjectRecord->prop->stan, g_CurrentPlayer->field_488.collision_position.f[0], g_CurrentPlayer->field_488.collision_position.f[2], spE4.f[0], spE4.f[2]); + #ifdef DEBUG + assert(stanlineret); // #7362 + #endif sp140_tank_as_TankRecord->stan_y = stanGetPositionYValue(sp138_tank_as_ObjectRecord->prop->stan, spE4.f[0], spE4.f[2]); - - for (i=0; iunkD0 = (sp140_tank_as_TankRecord->unkD0 * 0.83f) + sp140_tank_as_TankRecord->stan_y; + sp140_tank_as_TankRecord->unkD0 = (sp140_tank_as_TankRecord->unkD0 * TANK_UNKD0_SCALE) + sp140_tank_as_TankRecord->stan_y; } - - stack_padding_20 = (sp140_tank_as_TankRecord->unkD0 * 0.17000002f); - spE4.f[1] = stack_padding_20 - (chrpropBBOXGetYmin(sp130) * sp138_tank_as_ObjectRecord->model->scale) + 4.0f; + + ftemp_12 = (sp140_tank_as_TankRecord->unkD0 * (1.0f - TANK_UNKD0_SCALE)); + spE4.f[1] = ftemp_12 + - (chrpropBBOXGetYmin(sp130) * sp138_tank_as_ObjectRecord->model->scale) + + 4.0f; matrix_4x4_copy(&spF0, &sp138_tank_as_ObjectRecord->mtx); - + sp138_tank_as_ObjectRecord->runtime_pos.f[0] = sp138_tank_as_ObjectRecord->prop->pos.f[0] = spE4.f[0]; sp138_tank_as_ObjectRecord->runtime_pos.f[1] = sp138_tank_as_ObjectRecord->prop->pos.f[1] = spE4.f[1]; sp138_tank_as_ObjectRecord->runtime_pos.f[2] = sp138_tank_as_ObjectRecord->prop->pos.f[2] = spE4.f[2]; setupUpdateObjectRoomPosition(sp138_tank_as_ObjectRecord); chrobjCollisionRelated(sp138_tank_as_ObjectRecord); - bondviewTankCollisionRelated(&spB4_tank_collision_bounds, &g_CurrentPlayer->field_488.collision_position, g_TankOrientationAngle); + bondviewGetTankCollisionBounds(&spB4_tank_collision_bounds, &g_CurrentPlayer->field_488.collision_position, g_TankOrientationAngle); chraiGetPropRoomIds(sp138_tank_as_ObjectRecord->prop, &sp94); // update num_obj_position_data_entries - sub_GAME_7F03E3FC(&sp94); + roomGetProps(&sp94); for (lookup_index=ptr_list_object_lookup_indices; *lookup_index>=0; lookup_index++) { @@ -25406,32 +11779,45 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) { if (prop->type == PROP_TYPE_CHR) { + s32 sp88_collision_bound_height; + s32 sp84_collision_bound_z; + f32 sp80_collision_radius; + s32 sp7C; + struct coord3d sp70; + struct ChrRecord *sp6C; + f32 stack_padding_28; + sp7C = 1; sp6C = prop->chr; chrpropGetCollisionBounds(prop, &sp80_collision_radius, &sp88_collision_bound_height, &sp84_collision_bound_z); - if (chrpropTestPointInPolygon(&prop->pos, &spB4_tank_collision_bounds, 4) != 0) + if (chrpropTestPointInPolygon(&prop->pos, &spB4_tank_collision_bounds, 4)) { sp7C = 0; if (sp6C->actiontype == ACT_DIE) { +#if defined(VERSION_US) if ((sp6C->chrflags << 7) >= 0) +#endif +#if defined(VERSION_JP) || defined(VERSION_EU) + if ((sp6C->chrflags << 7) >= 0 && lvlGetControlsLockedFlag() == 0) +#endif { sp6C->chrflags |= CHRFLAG_01000000; if ((D_80048380 % 3) < 2) { - sub_GAME_7F053A10(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, CRUSHED_YELL_SFX, NULL), &prop->pos); + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, CRUSHED_YELL_SFX, NULL), &prop->pos); } if ((D_80048380 % 3) > 0) { - sub_GAME_7F053A10(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TANK_CRUSH_MAN_SFX, NULL), &prop->pos); + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TANK_CRUSH_MAN_SFX, NULL), &prop->pos); } } } } - if ((sp7C != 0) && (chrobjTestPointPolygonCollision(&prop->pos, sp80_collision_radius, &spB4_tank_collision_bounds, 4))) + if (sp7C && (chrobjTestPointPolygonCollision(&prop->pos, sp80_collision_radius, &spB4_tank_collision_bounds, 4))) { sp7C = 0; } @@ -25441,27 +11827,35 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) sp70.f[0] = sp138_tank_as_ObjectRecord->runtime_pos.f[0]; sp70.f[1] = prop->pos.f[1]; sp70.f[2] = sp138_tank_as_ObjectRecord->runtime_pos.f[2]; + chrlvExplosionDamage(prop->chr, &sp70, 3.0f, 1); } } else if (prop->type == PROP_TYPE_OBJ) { + struct rect4f *sp64; + s32 sp60; + chraiGetCollisionBoundsWithoutY(prop, &sp64, &sp60); - if ((sp60 > 0) && (sub_GAME_7F0446B8(sp64, sp60, &spB4_tank_collision_bounds, 4) != 0)) + if ((sp60 > 0) && sub_GAME_7F0446B8(sp64, sp60, &spB4_tank_collision_bounds, 4)) { - sub_GAME_7F04DEFC(prop, 10000.0f, &prop->obj->runtime_pos.f[0], 0x20, get_cur_playernum()); - D_80036490 = 0x5A; + // Explode destroyable props when the tank touches them + maybe_detonate_object_and_its_children(prop, 10000.0f, &prop->obj->runtime_pos, 0x20, get_cur_playernum()); + g_TankDamagePenaltyTicks = TANK_DAMAGE_PENTALTY_TICKS; } } } } } - bondviewUpdatePlayerClipping(sp394, sp390); + bondviewUpdatePlayerY(use_stanHeight, sp390); bondviewUpdatePlayerCollisionPositionFields(); bondviewUpdatePlayerCollisionBounds(); + if (get_debug_man_pos_flag() != 0) { + f32 sp5C_out_unused; + copy_tile_RGB_as_24bit( g_CurrentPlayer->field_488.current_tile_ptr, g_CurrentPlayer->field_488.collision_position.f[0], @@ -25469,8026 +11863,57 @@ void MoveBond(s8 arg0, s8 arg1, u16 arg2, u16 arg3) &sp5C_out_unused); } } -#else -#ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_8005516C -.word 0x3d888889 /*0.06666667*/ -glabel D_80055170 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055174 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055178 -.word 0x3f8147ae /*1.01*/ -glabel D_8005517C -.word 0x3f8147ae /*1.01*/ -glabel D_80055180 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055184 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055188 -.word 0x40490fdb /*3.1415927*/ -glabel D_8005518C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055190 -.word 0xc0490fdb /*-3.1415927*/ -glabel D_80055194 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055198 -.word 0x3f6b851f /*0.92000002*/ -glabel D_8005519C -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551A0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551A4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551A8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551AC -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551B0 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551B4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551B8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551BC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551C0 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551C4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551C8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551CC -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551D0 -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551D4 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_800551D8 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551DC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E4 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E8 -.word 0x3e99999a /*0.30000001*/ -glabel D_800551EC -.word 0x3e19999a /*0.15000001*/ -glabel D_800551F0 -.word 0x469c4000 /*20000.0*/ -glabel D_800551F4 -.word 0x3f666666 /*0.89999998*/ -glabel D_800551F8 -.word 0x46477c00 /*12767.0*/ -glabel D_800551FC -.word 0x469c4000 /*20000.0*/ -glabel D_80055200 -.word 0x3f666666 /*0.89999998*/ -glabel D_80055204 -.word 0x45f2b800 /*7767.0*/ -glabel D_80055208 -.word 0x3f666666 /*0.89999998*/ -glabel D_8005520C -.word 0x46c35000 /*25000.0;*/ -glabel D_80055210 -.word 0x3e32b8c3 /*0.17453294*/ -glabel D_80055214 -.word 0x3edf66f3 /*0.43633232*/ -glabel D_80055218 -.word 0xbdb2b8c3 /*-0.087266468*/ -glabel D_8005521C -.word 0x3f70a3d7 /*0.94*/ -glabel D_80055220 -.word 0x3d75c290 /*0.060000002*/ -glabel D_80055224 -.word 0x4528c000 /*2700.0*/ -glabel D_80055228 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005522C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055230 -.word 0x3f19999a /*0.60000002*/ -glabel D_80055234 -.word 0x3f4ccccd /*0.80000001*/ -glabel D_80055238 -.word 0x3dcccccd /*0.1*/ -glabel D_8005523C -.word 0x4528c000 /*2700.0*/ -glabel D_80055240 -.word 0x3f947ae1 /*1.16*/ -glabel D_80055244 -.word 0x3f8147ae /*1.01*/ -glabel D_80055248 -.word 0x3f7d7721 /*0.99009901*/ -glabel D_8005524C -.word 0x3f333333 /*0.69999999*/ -glabel D_80055250 -.word 0x3f99999a /*1.2*/ -glabel D_80055254 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055258 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005525C -.word 0x3f547ae1 /*0.82999998*/ -glabel D_80055260 -.word 0x3e2e147c /*0.17000002*/ -.text -glabel MoveBond -/* 0B9178 7F084648 27BDFC48 */ addiu $sp, $sp, -0x3b8 -/* 0B917C 7F08464C 3C0E8003 */ lui $t6, %hi(D_800367F4) -/* 0B9180 7F084650 AFBF002C */ sw $ra, 0x2c($sp) -/* 0B9184 7F084654 AFB10028 */ sw $s1, 0x28($sp) -/* 0B9188 7F084658 AFB00024 */ sw $s0, 0x24($sp) -/* 0B918C 7F08465C F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0B9190 7F084660 AFA403B8 */ sw $a0, 0x3b8($sp) -/* 0B9194 7F084664 AFA503BC */ sw $a1, 0x3bc($sp) -/* 0B9198 7F084668 AFA603C0 */ sw $a2, 0x3c0($sp) -/* 0B919C 7F08466C AFA703C4 */ sw $a3, 0x3c4($sp) -/* 0B91A0 7F084670 25CE67F4 */ addiu $t6, %lo(D_800367F4) # addiu $t6, $t6, 0x67f4 -/* 0B91A4 7F084674 8DC10000 */ lw $at, ($t6) -/* 0B91A8 7F084678 27AD03AC */ addiu $t5, $sp, 0x3ac -/* 0B91AC 7F08467C 8DCF0004 */ lw $t7, 4($t6) -/* 0B91B0 7F084680 ADA10000 */ sw $at, ($t5) -/* 0B91B4 7F084684 8DC10008 */ lw $at, 8($t6) -/* 0B91B8 7F084688 4480A000 */ mtc1 $zero, $f20 -/* 0B91BC 7F08468C 00048600 */ sll $s0, $a0, 0x18 -/* 0B91C0 7F084690 ADA10008 */ sw $at, 8($t5) -/* 0B91C4 7F084694 00106603 */ sra $t4, $s0, 0x18 -/* 0B91C8 7F084698 ADAF0004 */ sw $t7, 4($t5) -/* 0B91CC 7F08469C 29810064 */ slti $at, $t4, 0x64 -/* 0B91D0 7F0846A0 01808025 */ move $s0, $t4 -/* 0B91D4 7F0846A4 AFA00394 */ sw $zero, 0x394($sp) -/* 0B91D8 7F0846A8 E7B40398 */ swc1 $f20, 0x398($sp) -/* 0B91DC 7F0846AC 10200004 */ beqz $at, .L7F0846C0 -/* 0B91E0 7F0846B0 E7B40390 */ swc1 $f20, 0x390($sp) -/* 0B91E4 7F0846B4 2981FF9D */ slti $at, $t4, -0x63 -/* 0B91E8 7F0846B8 50200004 */ beql $at, $zero, .L7F0846CC -/* 0B91EC 7F0846BC 83AB03BF */ lb $t3, 0x3bf($sp) -.L7F0846C0: -/* 0B91F0 7F0846C0 0FC1B11B */ jal return_null -/* 0B91F4 7F0846C4 00000000 */ nop -/* 0B91F8 7F0846C8 83AB03BF */ lb $t3, 0x3bf($sp) -.L7F0846CC: -/* 0B91FC 7F0846CC 29610064 */ slti $at, $t3, 0x64 -/* 0B9200 7F0846D0 10200003 */ beqz $at, .L7F0846E0 -/* 0B9204 7F0846D4 2961FF9D */ slti $at, $t3, -0x63 -/* 0B9208 7F0846D8 10200003 */ beqz $at, .L7F0846E8 -/* 0B920C 7F0846DC 00000000 */ nop -.L7F0846E0: -/* 0B9210 7F0846E0 0FC1B11B */ jal return_null -/* 0B9214 7F0846E4 00000000 */ nop -.L7F0846E8: -/* 0B9218 7F0846E8 3C038003 */ lui $v1, %hi(g_bondviewForceDisarm) -/* 0B921C 7F0846EC 24636424 */ addiu $v1, %lo(g_bondviewForceDisarm) # addiu $v1, $v1, 0x6424 -/* 0B9220 7F0846F0 8C620000 */ lw $v0, ($v1) -/* 0B9224 7F0846F4 18400015 */ blez $v0, .L7F08474C -/* 0B9228 7F0846F8 24580001 */ addiu $t8, $v0, 1 -/* 0B922C 7F0846FC 2B010004 */ slti $at, $t8, 4 -/* 0B9230 7F084700 14200012 */ bnez $at, .L7F08474C -/* 0B9234 7F084704 AC780000 */ sw $t8, ($v1) -/* 0B9238 7F084708 3C118008 */ lui $s1, %hi(g_CurrentPlayer) -/* 0B923C 7F08470C 2631A0B0 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x5f50 -/* 0B9240 7F084710 8E390000 */ lw $t9, ($s1) -/* 0B9244 7F084714 AC600000 */ sw $zero, ($v1) -/* 0B9248 7F084718 24040001 */ li $a0, 1 -/* 0B924C 7F08471C AF202A54 */ sw $zero, 0x2a54($t9) -/* 0B9250 7F084720 8E2A0000 */ lw $t2, ($s1) -/* 0B9254 7F084724 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B9258 7F084728 AD402A50 */ sw $zero, 0x2a50($t2) -/* 0B925C 7F08472C 24040001 */ li $a0, 1 -/* 0B9260 7F084730 0FC176D5 */ jal currentPlayerUnEquipWeaponWrapper -/* 0B9264 7F084734 00402825 */ move $a1, $v0 -/* 0B9268 7F084738 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0B926C 7F08473C 00002025 */ move $a0, $zero -/* 0B9270 7F084740 00002025 */ move $a0, $zero -/* 0B9274 7F084744 0FC176D5 */ jal currentPlayerUnEquipWeaponWrapper -/* 0B9278 7F084748 00402825 */ move $a1, $v0 -.L7F08474C: -/* 0B927C 7F08474C 3C118008 */ lui $s1, %hi(g_CurrentPlayer) -/* 0B9280 7F084750 2631A0B0 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x5f50 -/* 0B9284 7F084754 0FC1E694 */ jal currentPlayerSetField00 -/* 0B9288 7F084758 00002025 */ move $a0, $zero -/* 0B928C 7F08475C 0FC20FF2 */ jal sub_GAME_7F083FC8 -/* 0B9290 7F084760 00000000 */ nop -/* 0B9294 7F084764 0FC210D8 */ jal sub_GAME_7F084360 -/* 0B9298 7F084768 00000000 */ nop -/* 0B929C 7F08476C 00102600 */ sll $a0, $s0, 0x18 -/* 0B92A0 7F084770 00046E03 */ sra $t5, $a0, 0x18 -/* 0B92A4 7F084774 01A02025 */ move $a0, $t5 -/* 0B92A8 7F084778 83A503BF */ lb $a1, 0x3bf($sp) -/* 0B92AC 7F08477C 97A603C2 */ lhu $a2, 0x3c2($sp) -/* 0B92B0 7F084780 0FC2065D */ jal controller_gameplay_interaction -/* 0B92B4 7F084784 97A703C6 */ lhu $a3, 0x3c6($sp) -/* 0B92B8 7F084788 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0B92BC 7F08478C 00000000 */ nop -/* 0B92C0 7F084790 50400004 */ beql $v0, $zero, .L7F0847A4 -/* 0B92C4 7F084794 8E2E0000 */ lw $t6, ($s1) -/* 0B92C8 7F084798 0FC1FABC */ jal sub_GAME_7F07EAF0 -/* 0B92CC 7F08479C 00000000 */ nop -/* 0B92D0 7F0847A0 8E2E0000 */ lw $t6, ($s1) -.L7F0847A4: -/* 0B92D4 7F0847A4 8DCF01C8 */ lw $t7, 0x1c8($t6) -/* 0B92D8 7F0847A8 11E00003 */ beqz $t7, .L7F0847B8 -/* 0B92DC 7F0847AC 00000000 */ nop -/* 0B92E0 7F0847B0 0FC1FB15 */ jal sub_GAME_7F07EC54 -/* 0B92E4 7F0847B4 00000000 */ nop -.L7F0847B8: -/* 0B92E8 7F0847B8 3C0B8003 */ lui $t3, %hi(in_tank_flag) -/* 0B92EC 7F0847BC 8D6B6448 */ lw $t3, %lo(in_tank_flag)($t3) -/* 0B92F0 7F0847C0 1560006E */ bnez $t3, .L7F08497C -/* 0B92F4 7F0847C4 00000000 */ nop -/* 0B92F8 7F0847C8 0FC1E67C */ jal currentPlayerGetCrouchPos -/* 0B92FC 7F0847CC 00000000 */ nop -/* 0B9300 7F0847D0 5440000D */ bnezl $v0, .L7F084808 -/* 0B9304 7F0847D4 8E280000 */ lw $t0, ($s1) -/* 0B9308 7F0847D8 8E280000 */ lw $t0, ($s1) -/* 0B930C 7F0847DC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B9310 7F0847E0 44815000 */ mtc1 $at, $f10 -/* 0B9314 7F0847E4 C5040174 */ lwc1 $f4, 0x174($t0) -/* 0B9318 7F0847E8 460A2182 */ mul.s $f6, $f4, $f10 -/* 0B931C 7F0847EC 44812000 */ mtc1 $at, $f4 -/* 0B9320 7F0847F0 E5060174 */ swc1 $f6, 0x174($t0) -/* 0B9324 7F0847F4 8E280000 */ lw $t0, ($s1) -/* 0B9328 7F0847F8 C508016C */ lwc1 $f8, 0x16c($t0) -/* 0B932C 7F0847FC 46044282 */ mul.s $f10, $f8, $f4 -/* 0B9330 7F084800 E50A016C */ swc1 $f10, 0x16c($t0) -/* 0B9334 7F084804 8E280000 */ lw $t0, ($s1) -.L7F084808: -/* 0B9338 7F084808 C5120180 */ lwc1 $f18, 0x180($t0) -/* 0B933C 7F08480C 4612A032 */ c.eq.s $f20, $f18 -/* 0B9340 7F084810 00000000 */ nop -/* 0B9344 7F084814 45020007 */ bc1fl .L7F084834 -/* 0B9348 7F084818 C5000188 */ lwc1 $f0, 0x188($t0) -/* 0B934C 7F08481C C5060188 */ lwc1 $f6, 0x188($t0) -/* 0B9350 7F084820 4606A032 */ c.eq.s $f20, $f6 -/* 0B9354 7F084824 00000000 */ nop -/* 0B9358 7F084828 45010054 */ bc1t .L7F08497C -/* 0B935C 7F08482C 00000000 */ nop -/* 0B9360 7F084830 C5000188 */ lwc1 $f0, 0x188($t0) -.L7F084834: -/* 0B9364 7F084834 C5020150 */ lwc1 $f2, 0x150($t0) -/* 0B9368 7F084838 C5100154 */ lwc1 $f16, 0x154($t0) -/* 0B936C 7F08483C 46009387 */ neg.s $f14, $f18 -/* 0B9370 7F084840 46020202 */ mul.s $f8, $f0, $f2 -/* 0B9374 7F084844 00000000 */ nop -/* 0B9378 7F084848 46107102 */ mul.s $f4, $f14, $f16 -/* 0B937C 7F08484C 46044280 */ add.s $f10, $f8, $f4 -/* 0B9380 7F084850 46027182 */ mul.s $f6, $f14, $f2 -/* 0B9384 7F084854 00000000 */ nop -/* 0B9388 7F084858 46100202 */ mul.s $f8, $f0, $f16 -/* 0B938C 7F08485C E7AA038C */ swc1 $f10, 0x38c($sp) -/* 0B9390 7F084860 46000282 */ mul.s $f10, $f0, $f0 -/* 0B9394 7F084864 46083101 */ sub.s $f4, $f6, $f8 -/* 0B9398 7F084868 46129182 */ mul.s $f6, $f18, $f18 -/* 0B939C 7F08486C E7A40388 */ swc1 $f4, 0x388($sp) -/* 0B93A0 7F084870 0C007DF8 */ jal sqrtf -/* 0B93A4 7F084874 46065300 */ add.s $f12, $f10, $f6 -/* 0B93A8 7F084878 8E280000 */ lw $t0, ($s1) -/* 0B93AC 7F08487C C7A4038C */ lwc1 $f4, 0x38c($sp) -/* 0B93B0 7F084880 3C018005 */ lui $at, %hi(D_8005516C) -/* 0B93B4 7F084884 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B93B8 7F084888 3C098005 */ lui $t1, %hi(g_GlobalTimerDelta) -/* 0B93BC 7F08488C 25298378 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, -0x7c88 -/* 0B93C0 7F084890 46044280 */ add.s $f10, $f8, $f4 -/* 0B93C4 7F084894 00001825 */ move $v1, $zero -/* 0B93C8 7F084898 2404000C */ li $a0, 12 -/* 0B93CC 7F08489C E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B93D0 7F0848A0 8E280000 */ lw $t0, ($s1) -/* 0B93D4 7F0848A4 C7A80388 */ lwc1 $f8, 0x388($sp) -/* 0B93D8 7F0848A8 C506016C */ lwc1 $f6, 0x16c($t0) -/* 0B93DC 7F0848AC 46083100 */ add.s $f4, $f6, $f8 -/* 0B93E0 7F0848B0 E504016C */ swc1 $f4, 0x16c($t0) -/* 0B93E4 7F0848B4 C42C516C */ lwc1 $f12, %lo(D_8005516C)($at) -/* 0B93E8 7F0848B8 8E380000 */ lw $t8, ($s1) -.L7F0848BC: -/* 0B93EC 7F0848BC 03031021 */ addu $v0, $t8, $v1 -/* 0B93F0 7F0848C0 C4420180 */ lwc1 $f2, 0x180($v0) -/* 0B93F4 7F0848C4 4602A032 */ c.eq.s $f20, $f2 -/* 0B93F8 7F0848C8 00000000 */ nop -/* 0B93FC 7F0848CC 45030029 */ bc1tl .L7F084974 -/* 0B9400 7F0848D0 24630004 */ addiu $v1, $v1, 4 -/* 0B9404 7F0848D4 4602A03C */ c.lt.s $f20, $f2 -/* 0B9408 7F0848D8 00000000 */ nop -/* 0B940C 7F0848DC 45020012 */ bc1fl .L7F084928 -/* 0B9410 7F0848E0 4614103C */ c.lt.s $f2, $f20 -/* 0B9414 7F0848E4 C52A0000 */ lwc1 $f10, ($t1) -/* 0B9418 7F0848E8 460A6182 */ mul.s $f6, $f12, $f10 -/* 0B941C 7F0848EC 00000000 */ nop -/* 0B9420 7F0848F0 46023202 */ mul.s $f8, $f6, $f2 -/* 0B9424 7F0848F4 46004103 */ div.s $f4, $f8, $f0 -/* 0B9428 7F0848F8 46041281 */ sub.s $f10, $f2, $f4 -/* 0B942C 7F0848FC E44A0180 */ swc1 $f10, 0x180($v0) -/* 0B9430 7F084900 8E2C0000 */ lw $t4, ($s1) -/* 0B9434 7F084904 01831021 */ addu $v0, $t4, $v1 -/* 0B9438 7F084908 C4460180 */ lwc1 $f6, 0x180($v0) -/* 0B943C 7F08490C 4614303C */ c.lt.s $f6, $f20 -/* 0B9440 7F084910 00000000 */ nop -/* 0B9444 7F084914 45000016 */ bc1f .L7F084970 -/* 0B9448 7F084918 00000000 */ nop -/* 0B944C 7F08491C 10000014 */ b .L7F084970 -/* 0B9450 7F084920 E4540180 */ swc1 $f20, 0x180($v0) -/* 0B9454 7F084924 4614103C */ c.lt.s $f2, $f20 -.L7F084928: -/* 0B9458 7F084928 00000000 */ nop -/* 0B945C 7F08492C 45020011 */ bc1fl .L7F084974 -/* 0B9460 7F084930 24630004 */ addiu $v1, $v1, 4 -/* 0B9464 7F084934 C5280000 */ lwc1 $f8, ($t1) -/* 0B9468 7F084938 46086102 */ mul.s $f4, $f12, $f8 -/* 0B946C 7F08493C 00000000 */ nop -/* 0B9470 7F084940 46022282 */ mul.s $f10, $f4, $f2 -/* 0B9474 7F084944 46005183 */ div.s $f6, $f10, $f0 -/* 0B9478 7F084948 46061201 */ sub.s $f8, $f2, $f6 -/* 0B947C 7F08494C E4480180 */ swc1 $f8, 0x180($v0) -/* 0B9480 7F084950 8E390000 */ lw $t9, ($s1) -/* 0B9484 7F084954 03231021 */ addu $v0, $t9, $v1 -/* 0B9488 7F084958 C4440180 */ lwc1 $f4, 0x180($v0) -/* 0B948C 7F08495C 4604A03C */ c.lt.s $f20, $f4 -/* 0B9490 7F084960 00000000 */ nop -/* 0B9494 7F084964 45000002 */ bc1f .L7F084970 -/* 0B9498 7F084968 00000000 */ nop -/* 0B949C 7F08496C E4540180 */ swc1 $f20, 0x180($v0) -.L7F084970: -/* 0B94A0 7F084970 24630004 */ addiu $v1, $v1, 4 -.L7F084974: -/* 0B94A4 7F084974 5464FFD1 */ bnel $v1, $a0, .L7F0848BC -/* 0B94A8 7F084978 8E380000 */ lw $t8, ($s1) -.L7F08497C: -/* 0B94AC 7F08497C 3C0A8003 */ lui $t2, %hi(in_tank_flag) -/* 0B94B0 7F084980 8D4A6448 */ lw $t2, %lo(in_tank_flag)($t2) -/* 0B94B4 7F084984 3C098005 */ lui $t1, %hi(g_GlobalTimerDelta) -/* 0B94B8 7F084988 24010001 */ li $at, 1 -/* 0B94BC 7F08498C 25298378 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, -0x7c88 -/* 0B94C0 7F084990 15410211 */ bne $t2, $at, .L7F0851D8 -/* 0B94C4 7F084994 8E280000 */ lw $t0, ($s1) -/* 0B94C8 7F084998 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0B94CC 7F08499C C5260000 */ lwc1 $f6, ($t1) -/* 0B94D0 7F0849A0 3C018005 */ lui $at, %hi(D_80055170) -/* 0B94D4 7F0849A4 C42C5170 */ lwc1 $f12, %lo(D_80055170)($at) -/* 0B94D8 7F0849A8 46065202 */ mul.s $f8, $f10, $f6 -/* 0B94DC 7F0849AC 3C018005 */ lui $at, %hi(D_80055174) -/* 0B94E0 7F0849B0 C4245174 */ lwc1 $f4, %lo(D_80055174)($at) -/* 0B94E4 7F0849B4 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B94E8 7F0849B8 44813000 */ mtc1 $at, $f6 -/* 0B94EC 7F0849BC 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B94F0 7F0849C0 27B00374 */ addiu $s0, $sp, 0x374 -/* 0B94F4 7F0849C4 46044282 */ mul.s $f10, $f8, $f4 -/* 0B94F8 7F0849C8 C4286464 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B94FC 7F0849CC 02003825 */ move $a3, $s0 -/* 0B9500 7F0849D0 2504048C */ addiu $a0, $t0, 0x48c -/* 0B9504 7F0849D4 27AD0368 */ addiu $t5, $sp, 0x368 -/* 0B9508 7F0849D8 46065082 */ mul.s $f2, $f10, $f6 -/* 0B950C 7F0849DC 46024000 */ add.s $f0, $f8, $f2 -/* 0B9510 7F0849E0 4600603E */ c.le.s $f12, $f0 -/* 0B9514 7F0849E4 00000000 */ nop -/* 0B9518 7F0849E8 45020003 */ bc1fl .L7F0849F8 -/* 0B951C 7F0849EC 4614003C */ c.lt.s $f0, $f20 -/* 0B9520 7F0849F0 460C0001 */ sub.s $f0, $f0, $f12 -/* 0B9524 7F0849F4 4614003C */ c.lt.s $f0, $f20 -.L7F0849F8: -/* 0B9528 7F0849F8 00000000 */ nop -/* 0B952C 7F0849FC 45020003 */ bc1fl .L7F084A0C -/* 0B9530 7F084A00 8D050488 */ lw $a1, 0x488($t0) -/* 0B9534 7F084A04 460C0000 */ add.s $f0, $f0, $f12 -/* 0B9538 7F084A08 8D050488 */ lw $a1, 0x488($t0) -.L7F084A0C: -/* 0B953C 7F084A0C 44060000 */ mfc1 $a2, $f0 -/* 0B9540 7F084A10 E7A20358 */ swc1 $f2, 0x358($sp) -/* 0B9544 7F084A14 E7A0035C */ swc1 $f0, 0x35c($sp) -/* 0B9548 7F084A18 0FC1F2B2 */ jal bondviewTankCollisionStatus -/* 0B954C 7F084A1C AFAD0010 */ sw $t5, 0x10($sp) -/* 0B9550 7F084A20 50400007 */ beql $v0, $zero, .L7F084A40 -/* 0B9554 7F084A24 3C01BF80 */ lui $at, 0xbf80 -/* 0B9558 7F084A28 C7A4035C */ lwc1 $f4, 0x35c($sp) -/* 0B955C 7F084A2C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B9560 7F084A30 E4246464 */ swc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B9564 7F084A34 100000CB */ b .L7F084D64 -/* 0B9568 7F084A38 8E280000 */ lw $t0, ($s1) -/* 0B956C 7F084A3C 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F084A40: -/* 0B9570 7F084A40 44815000 */ mtc1 $at, $f10 -/* 0B9574 7F084A44 44813000 */ mtc1 $at, $f6 -/* 0B9578 7F084A48 27A40348 */ addiu $a0, $sp, 0x348 -/* 0B957C 7F084A4C 27A5033C */ addiu $a1, $sp, 0x33c -/* 0B9580 7F084A50 E7AA031C */ swc1 $f10, 0x31c($sp) -/* 0B9584 7F084A54 0FC2CA2C */ jal getCollisionEdge_maybe -/* 0B9588 7F084A58 E7A60304 */ swc1 $f6, 0x304($sp) -/* 0B958C 7F084A5C C7A8033C */ lwc1 $f8, 0x33c($sp) -/* 0B9590 7F084A60 C7A40348 */ lwc1 $f4, 0x348($sp) -/* 0B9594 7F084A64 C7AA0344 */ lwc1 $f10, 0x344($sp) -/* 0B9598 7F084A68 C7A60350 */ lwc1 $f6, 0x350($sp) -/* 0B959C 7F084A6C 46044081 */ sub.s $f2, $f8, $f4 -/* 0B95A0 7F084A70 46065381 */ sub.s $f14, $f10, $f6 -/* 0B95A4 7F084A74 46021202 */ mul.s $f8, $f2, $f2 -/* 0B95A8 7F084A78 E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B95AC 7F084A7C 460E7102 */ mul.s $f4, $f14, $f14 -/* 0B95B0 7F084A80 E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B95B4 7F084A84 0C007DF8 */ jal sqrtf -/* 0B95B8 7F084A88 46044300 */ add.s $f12, $f8, $f4 -/* 0B95BC 7F084A8C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B95C0 7F084A90 44815000 */ mtc1 $at, $f10 -/* 0B95C4 7F084A94 C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B95C8 7F084A98 C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B95CC 7F084A9C 46005403 */ div.s $f16, $f10, $f0 -/* 0B95D0 7F084AA0 8E280000 */ lw $t0, ($s1) -/* 0B95D4 7F084AA4 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B95D8 7F084AA8 46101082 */ mul.s $f2, $f2, $f16 -/* 0B95DC 7F084AAC 00000000 */ nop -/* 0B95E0 7F084AB0 46107382 */ mul.s $f14, $f14, $f16 -/* 0B95E4 7F084AB4 46001307 */ neg.s $f12, $f2 -/* 0B95E8 7F084AB8 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B95EC 7F084ABC E7AE0324 */ swc1 $f14, 0x324($sp) -/* 0B95F0 7F084AC0 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B95F4 7F084AC4 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B95F8 7F084AC8 C7A40048 */ lwc1 $f4, 0x48($sp) -/* 0B95FC 7F084ACC C508048C */ lwc1 $f8, 0x48c($t0) -/* 0B9600 7F084AD0 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9604 7F084AD4 E7A80044 */ swc1 $f8, 0x44($sp) -/* 0B9608 7F084AD8 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B960C 7F084ADC C7AA0368 */ lwc1 $f10, 0x368($sp) -/* 0B9610 7F084AE0 460C3202 */ mul.s $f8, $f6, $f12 -/* 0B9614 7F084AE4 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9618 7F084AE8 460E3102 */ mul.s $f4, $f6, $f14 -/* 0B961C 7F084AEC 46044480 */ add.s $f18, $f8, $f4 -/* 0B9620 7F084AF0 4614903C */ c.lt.s $f18, $f20 -/* 0B9624 7F084AF4 00000000 */ nop -/* 0B9628 7F084AF8 45000006 */ bc1f .L7F084B14 -/* 0B962C 7F084AFC 00000000 */ nop -/* 0B9630 7F084B00 46007287 */ neg.s $f10, $f14 -/* 0B9634 7F084B04 46006187 */ neg.s $f6, $f12 -/* 0B9638 7F084B08 46009487 */ neg.s $f18, $f18 -/* 0B963C 7F084B0C E7AA0324 */ swc1 $f10, 0x324($sp) -/* 0B9640 7F084B10 E7A60320 */ swc1 $f6, 0x320($sp) -.L7F084B14: -/* 0B9644 7F084B14 C7A80048 */ lwc1 $f8, 0x48($sp) -/* 0B9648 7F084B18 C7A40350 */ lwc1 $f4, 0x350($sp) -/* 0B964C 7F084B1C C7A60320 */ lwc1 $f6, 0x320($sp) -/* 0B9650 7F084B20 46044281 */ sub.s $f10, $f8, $f4 -/* 0B9654 7F084B24 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B9658 7F084B28 46065202 */ mul.s $f8, $f10, $f6 -/* 0B965C 7F084B2C C7AA0348 */ lwc1 $f10, 0x348($sp) -/* 0B9660 7F084B30 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9664 7F084B34 C7A40324 */ lwc1 $f4, 0x324($sp) -/* 0B9668 7F084B38 46043282 */ mul.s $f10, $f6, $f4 -/* 0B966C 7F084B3C 460A4000 */ add.s $f0, $f8, $f10 -/* 0B9670 7F084B40 4612003C */ c.lt.s $f0, $f18 -/* 0B9674 7F084B44 00000000 */ nop -/* 0B9678 7F084B48 45020004 */ bc1fl .L7F084B5C -/* 0B967C 7F084B4C C7A40368 */ lwc1 $f4, 0x368($sp) -/* 0B9680 7F084B50 46009181 */ sub.s $f6, $f18, $f0 -/* 0B9684 7F084B54 E7A6031C */ swc1 $f6, 0x31c($sp) -/* 0B9688 7F084B58 C7A40368 */ lwc1 $f4, 0x368($sp) -.L7F084B5C: -/* 0B968C 7F084B5C C7A80374 */ lwc1 $f8, 0x374($sp) -/* 0B9690 7F084B60 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B9694 7F084B64 C7A6037C */ lwc1 $f6, 0x37c($sp) -/* 0B9698 7F084B68 46082081 */ sub.s $f2, $f4, $f8 -/* 0B969C 7F084B6C 46065381 */ sub.s $f14, $f10, $f6 -/* 0B96A0 7F084B70 46021102 */ mul.s $f4, $f2, $f2 -/* 0B96A4 7F084B74 E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B96A8 7F084B78 460E7202 */ mul.s $f8, $f14, $f14 -/* 0B96AC 7F084B7C E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B96B0 7F084B80 0C007DF8 */ jal sqrtf -/* 0B96B4 7F084B84 46082300 */ add.s $f12, $f4, $f8 -/* 0B96B8 7F084B88 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B96BC 7F084B8C 44815000 */ mtc1 $at, $f10 -/* 0B96C0 7F084B90 C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B96C4 7F084B94 C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B96C8 7F084B98 46005403 */ div.s $f16, $f10, $f0 -/* 0B96CC 7F084B9C 8E280000 */ lw $t0, ($s1) -/* 0B96D0 7F084BA0 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B96D4 7F084BA4 46101082 */ mul.s $f2, $f2, $f16 -/* 0B96D8 7F084BA8 00000000 */ nop -/* 0B96DC 7F084BAC 46107382 */ mul.s $f14, $f14, $f16 -/* 0B96E0 7F084BB0 46001307 */ neg.s $f12, $f2 -/* 0B96E4 7F084BB4 E7AC0308 */ swc1 $f12, 0x308($sp) -/* 0B96E8 7F084BB8 E7AE030C */ swc1 $f14, 0x30c($sp) -/* 0B96EC 7F084BBC C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B96F0 7F084BC0 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B96F4 7F084BC4 C7A80048 */ lwc1 $f8, 0x48($sp) -/* 0B96F8 7F084BC8 C504048C */ lwc1 $f4, 0x48c($t0) -/* 0B96FC 7F084BCC 460A4181 */ sub.s $f6, $f8, $f10 -/* 0B9700 7F084BD0 E7A40044 */ swc1 $f4, 0x44($sp) -/* 0B9704 7F084BD4 C7A80044 */ lwc1 $f8, 0x44($sp) -/* 0B9708 7F084BD8 C7AA0368 */ lwc1 $f10, 0x368($sp) -/* 0B970C 7F084BDC 460C3102 */ mul.s $f4, $f6, $f12 -/* 0B9710 7F084BE0 460A4181 */ sub.s $f6, $f8, $f10 -/* 0B9714 7F084BE4 460E3202 */ mul.s $f8, $f6, $f14 -/* 0B9718 7F084BE8 46082480 */ add.s $f18, $f4, $f8 -/* 0B971C 7F084BEC 4614903C */ c.lt.s $f18, $f20 -/* 0B9720 7F084BF0 00000000 */ nop -/* 0B9724 7F084BF4 45000006 */ bc1f .L7F084C10 -/* 0B9728 7F084BF8 00000000 */ nop -/* 0B972C 7F084BFC 46007407 */ neg.s $f16, $f14 -/* 0B9730 7F084C00 46006287 */ neg.s $f10, $f12 -/* 0B9734 7F084C04 46009487 */ neg.s $f18, $f18 -/* 0B9738 7F084C08 E7AA0308 */ swc1 $f10, 0x308($sp) -/* 0B973C 7F084C0C E7B0030C */ swc1 $f16, 0x30c($sp) -.L7F084C10: -/* 0B9740 7F084C10 C7A60048 */ lwc1 $f6, 0x48($sp) -/* 0B9744 7F084C14 C7A40350 */ lwc1 $f4, 0x350($sp) -/* 0B9748 7F084C18 C7AC0308 */ lwc1 $f12, 0x308($sp) -/* 0B974C 7F084C1C C7B0030C */ lwc1 $f16, 0x30c($sp) -/* 0B9750 7F084C20 46043201 */ sub.s $f8, $f6, $f4 -/* 0B9754 7F084C24 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B9758 7F084C28 460C4282 */ mul.s $f10, $f8, $f12 -/* 0B975C 7F084C2C C7A80348 */ lwc1 $f8, 0x348($sp) -/* 0B9760 7F084C30 46082201 */ sub.s $f8, $f4, $f8 -/* 0B9764 7F084C34 46104202 */ mul.s $f8, $f8, $f16 -/* 0B9768 7F084C38 46085000 */ add.s $f0, $f10, $f8 -/* 0B976C 7F084C3C C7AA0344 */ lwc1 $f10, 0x344($sp) -/* 0B9770 7F084C40 460A3201 */ sub.s $f8, $f6, $f10 -/* 0B9774 7F084C44 C7AA033C */ lwc1 $f10, 0x33c($sp) -/* 0B9778 7F084C48 460C4182 */ mul.s $f6, $f8, $f12 -/* 0B977C 7F084C4C 460A2201 */ sub.s $f8, $f4, $f10 -/* 0B9780 7F084C50 46104102 */ mul.s $f4, $f8, $f16 -/* 0B9784 7F084C54 46043080 */ add.s $f2, $f6, $f4 -/* 0B9788 7F084C58 4600103C */ c.lt.s $f2, $f0 -/* 0B978C 7F084C5C 00000000 */ nop -/* 0B9790 7F084C60 45020003 */ bc1fl .L7F084C70 -/* 0B9794 7F084C64 4612003C */ c.lt.s $f0, $f18 -/* 0B9798 7F084C68 46001006 */ mov.s $f0, $f2 -/* 0B979C 7F084C6C 4612003C */ c.lt.s $f0, $f18 -.L7F084C70: -/* 0B97A0 7F084C70 00000000 */ nop -/* 0B97A4 7F084C74 45020004 */ bc1fl .L7F084C88 -/* 0B97A8 7F084C78 C7A20304 */ lwc1 $f2, 0x304($sp) -/* 0B97AC 7F084C7C 46009081 */ sub.s $f2, $f18, $f0 -/* 0B97B0 7F084C80 E7A20304 */ swc1 $f2, 0x304($sp) -/* 0B97B4 7F084C84 C7A20304 */ lwc1 $f2, 0x304($sp) -.L7F084C88: -/* 0B97B8 7F084C88 C7AA031C */ lwc1 $f10, 0x31c($sp) -/* 0B97BC 7F084C8C 4602A03E */ c.le.s $f20, $f2 -/* 0B97C0 7F084C90 00000000 */ nop -/* 0B97C4 7F084C94 4502000D */ bc1fl .L7F084CCC -/* 0B97C8 7F084C98 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B97CC 7F084C9C 460A103C */ c.lt.s $f2, $f10 -/* 0B97D0 7F084CA0 00000000 */ nop -/* 0B97D4 7F084CA4 45030006 */ bc1tl .L7F084CC0 -/* 0B97D8 7F084CA8 E7B00324 */ swc1 $f16, 0x324($sp) -/* 0B97DC 7F084CAC 4614503C */ c.lt.s $f10, $f20 -/* 0B97E0 7F084CB0 00000000 */ nop -/* 0B97E4 7F084CB4 45020005 */ bc1fl .L7F084CCC -/* 0B97E8 7F084CB8 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B97EC 7F084CBC E7B00324 */ swc1 $f16, 0x324($sp) -.L7F084CC0: -/* 0B97F0 7F084CC0 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B97F4 7F084CC4 E7A2031C */ swc1 $f2, 0x31c($sp) -/* 0B97F8 7F084CC8 C7A0031C */ lwc1 $f0, 0x31c($sp) -.L7F084CCC: -/* 0B97FC 7F084CCC C7A80324 */ lwc1 $f8, 0x324($sp) -/* 0B9800 7F084CD0 4600A03E */ c.le.s $f20, $f0 -/* 0B9804 7F084CD4 00000000 */ nop -/* 0B9808 7F084CD8 45020022 */ bc1fl .L7F084D64 -/* 0B980C 7F084CDC E7B40358 */ swc1 $f20, 0x358($sp) -/* 0B9810 7F084CE0 46080182 */ mul.s $f6, $f0, $f8 -/* 0B9814 7F084CE4 3C018005 */ lui $at, %hi(D_80055178) -/* 0B9818 7F084CE8 C4245178 */ lwc1 $f4, %lo(D_80055178)($at) -/* 0B981C 7F084CEC C7A80320 */ lwc1 $f8, 0x320($sp) -/* 0B9820 7F084CF0 3C018005 */ lui $at, %hi(D_8005517C) -/* 0B9824 7F084CF4 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B9828 7F084CF8 24050001 */ li $a1, 1 -/* 0B982C 7F084CFC 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9830 7F084D00 C424517C */ lwc1 $f4, %lo(D_8005517C)($at) -/* 0B9834 7F084D04 46080182 */ mul.s $f6, $f0, $f8 -/* 0B9838 7F084D08 E7AA03AC */ swc1 $f10, 0x3ac($sp) -/* 0B983C 7F084D0C 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9840 7F084D10 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0B9844 7F084D14 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0B9848 7F084D18 8E280000 */ lw $t0, ($s1) -/* 0B984C 7F084D1C E7B403AC */ swc1 $f20, 0x3ac($sp) -/* 0B9850 7F084D20 E7B403B4 */ swc1 $f20, 0x3b4($sp) -/* 0B9854 7F084D24 27AE0368 */ addiu $t6, $sp, 0x368 -/* 0B9858 7F084D28 8D050488 */ lw $a1, 0x488($t0) -/* 0B985C 7F084D2C AFAE0010 */ sw $t6, 0x10($sp) -/* 0B9860 7F084D30 8FA6035C */ lw $a2, 0x35c($sp) -/* 0B9864 7F084D34 02003825 */ move $a3, $s0 -/* 0B9868 7F084D38 0FC1F2B2 */ jal bondviewTankCollisionStatus -/* 0B986C 7F084D3C 2504048C */ addiu $a0, $t0, 0x48c -/* 0B9870 7F084D40 10400004 */ beqz $v0, .L7F084D54 -/* 0B9874 7F084D44 C7A8035C */ lwc1 $f8, 0x35c($sp) -/* 0B9878 7F084D48 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B987C 7F084D4C 10000002 */ b .L7F084D58 -/* 0B9880 7F084D50 E4286464 */ swc1 $f8, %lo(g_TankOrientationAngle)($at) -.L7F084D54: -/* 0B9884 7F084D54 E7B40358 */ swc1 $f20, 0x358($sp) -.L7F084D58: -/* 0B9888 7F084D58 10000002 */ b .L7F084D64 -/* 0B988C 7F084D5C 8E280000 */ lw $t0, ($s1) -/* 0B9890 7F084D60 E7B40358 */ swc1 $f20, 0x358($sp) -.L7F084D64: -/* 0B9894 7F084D64 3C018005 */ lui $at, %hi(D_80055180) -/* 0B9898 7F084D68 C42E5180 */ lwc1 $f14, %lo(D_80055180)($at) -/* 0B989C 7F084D6C 3C038003 */ lui $v1, %hi(g_TankTurretAngle) -/* 0B98A0 7F084D70 24636484 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x6484 -/* 0B98A4 7F084D74 3C018003 */ lui $at, %hi(g_TankTurretTurn) -/* 0B98A8 7F084D78 C4246488 */ lwc1 $f4, %lo(g_TankTurretTurn)($at) -/* 0B98AC 7F084D7C C4660000 */ lwc1 $f6, ($v1) -/* 0B98B0 7F084D80 3C078003 */ lui $a3, %hi(g_TankTurretOrientationAngleRad) -/* 0B98B4 7F084D84 24E76474 */ addiu $a3, %lo(g_TankTurretOrientationAngleRad) # addiu $a3, $a3, 0x6474 -/* 0B98B8 7F084D88 46043280 */ add.s $f10, $f6, $f4 -/* 0B98BC 7F084D8C C4EC0000 */ lwc1 $f12, ($a3) -/* 0B98C0 7F084D90 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B98C4 7F084D94 3C048005 */ lui $a0, %hi(g_ClockTimer) -/* 0B98C8 7F084D98 E46A0000 */ swc1 $f10, ($v1) -/* 0B98CC 7F084D9C C4600000 */ lwc1 $f0, ($v1) -/* 0B98D0 7F084DA0 44815000 */ mtc1 $at, $f10 -/* 0B98D4 7F084DA4 46006406 */ mov.s $f16, $f12 -/* 0B98D8 7F084DA8 4600703E */ c.le.s $f14, $f0 -/* 0B98DC 7F084DAC 00000000 */ nop -/* 0B98E0 7F084DB0 45020005 */ bc1fl .L7F084DC8 -/* 0B98E4 7F084DB4 4614003C */ c.lt.s $f0, $f20 -/* 0B98E8 7F084DB8 460E0201 */ sub.s $f8, $f0, $f14 -/* 0B98EC 7F084DBC E4680000 */ swc1 $f8, ($v1) -/* 0B98F0 7F084DC0 C4600000 */ lwc1 $f0, ($v1) -/* 0B98F4 7F084DC4 4614003C */ c.lt.s $f0, $f20 -.L7F084DC8: -/* 0B98F8 7F084DC8 00000000 */ nop -/* 0B98FC 7F084DCC 45020005 */ bc1fl .L7F084DE4 -/* 0B9900 7F084DD0 C504014C */ lwc1 $f4, 0x14c($t0) -/* 0B9904 7F084DD4 460E0180 */ add.s $f6, $f0, $f14 -/* 0B9908 7F084DD8 E4660000 */ swc1 $f6, ($v1) -/* 0B990C 7F084DDC C4600000 */ lwc1 $f0, ($v1) -/* 0B9910 7F084DE0 C504014C */ lwc1 $f4, 0x14c($t0) -.L7F084DE4: -/* 0B9914 7F084DE4 3C018005 */ lui $at, %hi(D_80055184) -/* 0B9918 7F084DE8 C4265184 */ lwc1 $f6, %lo(D_80055184)($at) -/* 0B991C 7F084DEC 460A2202 */ mul.s $f8, $f4, $f10 -/* 0B9920 7F084DF0 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B9924 7F084DF4 44815000 */ mtc1 $at, $f10 -/* 0B9928 7F084DF8 3C018005 */ lui $at, %hi(D_80055188) -/* 0B992C 7F084DFC 46064102 */ mul.s $f4, $f8, $f6 -/* 0B9930 7F084E00 00000000 */ nop -/* 0B9934 7F084E04 460A2202 */ mul.s $f8, $f4, $f10 -/* 0B9938 7F084E08 46004080 */ add.s $f2, $f8, $f0 -/* 0B993C 7F084E0C 4614103C */ c.lt.s $f2, $f20 -/* 0B9940 7F084E10 00000000 */ nop -/* 0B9944 7F084E14 45000002 */ bc1f .L7F084E20 -/* 0B9948 7F084E18 00000000 */ nop -/* 0B994C 7F084E1C 460E1080 */ add.s $f2, $f2, $f14 -.L7F084E20: -/* 0B9950 7F084E20 4602703E */ c.le.s $f14, $f2 -/* 0B9954 7F084E24 00000000 */ nop -/* 0B9958 7F084E28 45020003 */ bc1fl .L7F084E38 -/* 0B995C 7F084E2C 460C1001 */ sub.s $f0, $f2, $f12 -/* 0B9960 7F084E30 460E1081 */ sub.s $f2, $f2, $f14 -/* 0B9964 7F084E34 460C1001 */ sub.s $f0, $f2, $f12 -.L7F084E38: -/* 0B9968 7F084E38 C4265188 */ lwc1 $f6, %lo(D_80055188)($at) -/* 0B996C 7F084E3C 3C018005 */ lui $at, %hi(D_80055190) -/* 0B9970 7F084E40 4600303E */ c.le.s $f6, $f0 -/* 0B9974 7F084E44 00000000 */ nop -/* 0B9978 7F084E48 45000005 */ bc1f .L7F084E60 -/* 0B997C 7F084E4C 00000000 */ nop -/* 0B9980 7F084E50 3C018005 */ lui $at, %hi(D_8005518C) -/* 0B9984 7F084E54 C424518C */ lwc1 $f4, %lo(D_8005518C)($at) -/* 0B9988 7F084E58 10000009 */ b .L7F084E80 -/* 0B998C 7F084E5C 46041081 */ sub.s $f2, $f2, $f4 -.L7F084E60: -/* 0B9990 7F084E60 C42A5190 */ lwc1 $f10, %lo(D_80055190)($at) -/* 0B9994 7F084E64 3C018005 */ lui $at, %hi(D_80055194) -/* 0B9998 7F084E68 460A003C */ c.lt.s $f0, $f10 -/* 0B999C 7F084E6C 00000000 */ nop -/* 0B99A0 7F084E70 45000003 */ bc1f .L7F084E80 -/* 0B99A4 7F084E74 00000000 */ nop -/* 0B99A8 7F084E78 C4285194 */ lwc1 $f8, %lo(D_80055194)($at) -/* 0B99AC 7F084E7C 46081080 */ add.s $f2, $f2, $f8 -.L7F084E80: -/* 0B99B0 7F084E80 8C848374 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0B99B4 7F084E84 00001025 */ move $v0, $zero -/* 0B99B8 7F084E88 3C018005 */ lui $at, %hi(D_80055198) -/* 0B99BC 7F084E8C 18800013 */ blez $a0, .L7F084EDC -/* 0B99C0 7F084E90 3C108003 */ lui $s0, %hi(D_80036478) -/* 0B99C4 7F084E94 C42E5198 */ lwc1 $f14, %lo(D_80055198)($at) -/* 0B99C8 7F084E98 26106478 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x6478 -/* 0B99CC 7F084E9C C60C0000 */ lwc1 $f12, ($s0) -/* 0B99D0 7F084EA0 24420001 */ addiu $v0, $v0, 1 -/* 0B99D4 7F084EA4 0044082A */ slt $at, $v0, $a0 -/* 0B99D8 7F084EA8 460C7482 */ mul.s $f18, $f14, $f12 -/* 0B99DC 7F084EAC 5020000A */ beql $at, $zero, .L7F084ED8 -/* 0B99E0 7F084EB0 46029300 */ add.s $f12, $f18, $f2 -/* 0B99E4 7F084EB4 46029300 */ add.s $f12, $f18, $f2 -.L7F084EB8: -/* 0B99E8 7F084EB8 24420001 */ addiu $v0, $v0, 1 -/* 0B99EC 7F084EBC 0044082A */ slt $at, $v0, $a0 -/* 0B99F0 7F084EC0 E60C0000 */ swc1 $f12, ($s0) -/* 0B99F4 7F084EC4 C60C0000 */ lwc1 $f12, ($s0) -/* 0B99F8 7F084EC8 460C7482 */ mul.s $f18, $f14, $f12 -/* 0B99FC 7F084ECC 5420FFFA */ bnezl $at, .L7F084EB8 -/* 0B9A00 7F084ED0 46029300 */ add.s $f12, $f18, $f2 -/* 0B9A04 7F084ED4 46029300 */ add.s $f12, $f18, $f2 -.L7F084ED8: -/* 0B9A08 7F084ED8 E60C0000 */ swc1 $f12, ($s0) -.L7F084EDC: -/* 0B9A0C 7F084EDC 3C108003 */ lui $s0, %hi(D_80036478) -/* 0B9A10 7F084EE0 26106478 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x6478 -/* 0B9A14 7F084EE4 3C018005 */ lui $at, %hi(D_8005519C) -/* 0B9A18 7F084EE8 C420519C */ lwc1 $f0, %lo(D_8005519C)($at) -/* 0B9A1C 7F084EEC C6080000 */ lwc1 $f8, ($s0) -/* 0B9A20 7F084EF0 3C018005 */ lui $at, %hi(D_800551A0) -/* 0B9A24 7F084EF4 C42251A0 */ lwc1 $f2, %lo(D_800551A0)($at) -/* 0B9A28 7F084EF8 46004182 */ mul.s $f6, $f8, $f0 -/* 0B9A2C 7F084EFC 2504048C */ addiu $a0, $t0, 0x48c -/* 0B9A30 7F084F00 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) -/* 0B9A34 7F084F04 E4E60000 */ swc1 $f6, ($a3) -/* 0B9A38 7F084F08 C4EC0000 */ lwc1 $f12, ($a3) -/* 0B9A3C 7F084F0C 460C103E */ c.le.s $f2, $f12 -/* 0B9A40 7F084F10 00000000 */ nop -/* 0B9A44 7F084F14 45020007 */ bc1fl .L7F084F34 -/* 0B9A48 7F084F18 4614603C */ c.lt.s $f12, $f20 -/* 0B9A4C 7F084F1C 46026101 */ sub.s $f4, $f12, $f2 -/* 0B9A50 7F084F20 E4E40000 */ swc1 $f4, ($a3) -/* 0B9A54 7F084F24 C4EC0000 */ lwc1 $f12, ($a3) -/* 0B9A58 7F084F28 46006283 */ div.s $f10, $f12, $f0 -/* 0B9A5C 7F084F2C E60A0000 */ swc1 $f10, ($s0) -/* 0B9A60 7F084F30 4614603C */ c.lt.s $f12, $f20 -.L7F084F34: -/* 0B9A64 7F084F34 00000000 */ nop -/* 0B9A68 7F084F38 45020007 */ bc1fl .L7F084F58 -/* 0B9A6C 7F084F3C 8D050488 */ lw $a1, 0x488($t0) -/* 0B9A70 7F084F40 46026200 */ add.s $f8, $f12, $f2 -/* 0B9A74 7F084F44 E4E80000 */ swc1 $f8, ($a3) -/* 0B9A78 7F084F48 C4E60000 */ lwc1 $f6, ($a3) -/* 0B9A7C 7F084F4C 46003103 */ div.s $f4, $f6, $f0 -/* 0B9A80 7F084F50 E6040000 */ swc1 $f4, ($s0) -/* 0B9A84 7F084F54 8D050488 */ lw $a1, 0x488($t0) -.L7F084F58: -/* 0B9A88 7F084F58 E7B00354 */ swc1 $f16, 0x354($sp) -/* 0B9A8C 7F084F5C 0FC1F36A */ jal bondviewCallTankCollisionStatus -/* 0B9A90 7F084F60 8CC66464 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0B9A94 7F084F64 3C038003 */ lui $v1, %hi(g_TankTurretAngle) -/* 0B9A98 7F084F68 3C018005 */ lui $at, %hi(D_800551A8) -/* 0B9A9C 7F084F6C C42E51A8 */ lwc1 $f14, %lo(D_800551A8)($at) -/* 0B9AA0 7F084F70 24636484 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x6484 -/* 0B9AA4 7F084F74 14400009 */ bnez $v0, .L7F084F9C -/* 0B9AA8 7F084F78 C7B00354 */ lwc1 $f16, 0x354($sp) -/* 0B9AAC 7F084F7C 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0B9AB0 7F084F80 E4306474 */ swc1 $f16, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B9AB4 7F084F84 C42A6474 */ lwc1 $f10, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B9AB8 7F084F88 3C018005 */ lui $at, %hi(D_800551AC) -/* 0B9ABC 7F084F8C C42851AC */ lwc1 $f8, %lo(D_800551AC)($at) -/* 0B9AC0 7F084F90 E4700000 */ swc1 $f16, ($v1) -/* 0B9AC4 7F084F94 46085183 */ div.s $f6, $f10, $f8 -/* 0B9AC8 7F084F98 E6060000 */ swc1 $f6, ($s0) -.L7F084F9C: -/* 0B9ACC 7F084F9C 3C038003 */ lui $v1, %hi(ptr_playerstank) -/* 0B9AD0 7F084FA0 8C636450 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0B9AD4 7F084FA4 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) -/* 0B9AD8 7F084FA8 244299A8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6658 -/* 0B9ADC 7F084FAC 1060002F */ beqz $v1, .L7F08506C -/* 0B9AE0 7F084FB0 27B002B4 */ addiu $s0, $sp, 0x2b4 -/* 0B9AE4 7F084FB4 8C6F0004 */ lw $t7, 4($v1) -/* 0B9AE8 7F084FB8 C4440000 */ lwc1 $f4, ($v0) -/* 0B9AEC 7F084FBC C44A0008 */ lwc1 $f10, 8($v0) -/* 0B9AF0 7F084FC0 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0B9AF4 7F084FC4 C7AC0358 */ lwc1 $f12, 0x358($sp) -/* 0B9AF8 7F084FC8 02002825 */ move $a1, $s0 -/* 0B9AFC 7F084FCC AFAF0300 */ sw $t7, 0x300($sp) -/* 0B9B00 7F084FD0 E7A402F4 */ swc1 $f4, 0x2f4($sp) -/* 0B9B04 7F084FD4 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0B9B08 7F084FD8 E7AA02FC */ swc1 $f10, 0x2fc($sp) -/* 0B9B0C 7F084FDC 02002025 */ move $a0, $s0 -/* 0B9B10 7F084FE0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0B9B14 7F084FE4 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0B9B18 7F084FE8 0FC1F1ED */ jal sub_GAME_7F07C7B4 -/* 0B9B1C 7F084FEC 00000000 */ nop -/* 0B9B20 7F084FF0 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) -/* 0B9B24 7F084FF4 244299A8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6658 -/* 0B9B28 7F084FF8 C4480000 */ lwc1 $f8, ($v0) -/* 0B9B2C 7F084FFC C7A602F4 */ lwc1 $f6, 0x2f4($sp) -/* 0B9B30 7F085000 C44A0008 */ lwc1 $f10, 8($v0) -/* 0B9B34 7F085004 3C018005 */ lui $at, %hi(D_800551BC) -/* 0B9B38 7F085008 46064101 */ sub.s $f4, $f8, $f6 -/* 0B9B3C 7F08500C C7A802FC */ lwc1 $f8, 0x2fc($sp) -/* 0B9B40 7F085010 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0B9B44 7F085014 02002825 */ move $a1, $s0 -/* 0B9B48 7F085018 E7A402F4 */ swc1 $f4, 0x2f4($sp) -/* 0B9B4C 7F08501C 46085181 */ sub.s $f6, $f10, $f8 -/* 0B9B50 7F085020 C42451BC */ lwc1 $f4, %lo(D_800551BC)($at) -/* 0B9B54 7F085024 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B9B58 7F085028 C42A6464 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0B9B5C 7F08502C E7A602FC */ swc1 $f6, 0x2fc($sp) -/* 0B9B60 7F085030 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0B9B64 7F085034 460A2301 */ sub.s $f12, $f4, $f10 -/* 0B9B68 7F085038 8FAB0300 */ lw $t3, 0x300($sp) -/* 0B9B6C 7F08503C 02002825 */ move $a1, $s0 -/* 0B9B70 7F085040 8D780014 */ lw $t8, 0x14($t3) -/* 0B9B74 7F085044 0FC1629F */ jal matrix_scalar_multiply -/* 0B9B78 7F085048 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0B9B7C 7F08504C 02002025 */ move $a0, $s0 -/* 0B9B80 7F085050 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0B9B84 7F085054 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0B9B88 7F085058 27A402F4 */ addiu $a0, $sp, 0x2f4 -/* 0B9B8C 7F08505C 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0B9B90 7F085060 24050001 */ li $a1, 1 -/* 0B9B94 7F085064 3C018005 */ lui $at, %hi(D_800551CC) -/* 0B9B98 7F085068 C42E51CC */ lwc1 $f14, %lo(D_800551CC)($at) -.L7F08506C: -/* 0B9B9C 7F08506C 3C048005 */ lui $a0, %hi(g_ClockTimer) -/* 0B9BA0 7F085070 8C848374 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0B9BA4 7F085074 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0B9BA8 7F085078 C42C6474 */ lwc1 $f12, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B9BAC 7F08507C 5880001B */ blezl $a0, .L7F0850EC -/* 0B9BB0 7F085080 3C0143B4 */ lui $at, 0x43b4 -/* 0B9BB4 7F085084 18800018 */ blez $a0, .L7F0850E8 -/* 0B9BB8 7F085088 00001025 */ move $v0, $zero -/* 0B9BBC 7F08508C 3C018003 */ lui $at, %hi(g_TankTurretTurn) -/* 0B9BC0 7F085090 C4286488 */ lwc1 $f8, %lo(g_TankTurretTurn)($at) -/* 0B9BC4 7F085094 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B9BC8 7F085098 C4268378 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B9BCC 7F08509C 3C038003 */ lui $v1, %hi(D_8003647C) -/* 0B9BD0 7F0850A0 2463647C */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x647c -/* 0B9BD4 7F0850A4 46064003 */ div.s $f0, $f8, $f6 -/* 0B9BD8 7F0850A8 C4700000 */ lwc1 $f16, ($v1) -/* 0B9BDC 7F0850AC 24420001 */ addiu $v0, $v0, 1 -/* 0B9BE0 7F0850B0 0044082A */ slt $at, $v0, $a0 -/* 0B9BE4 7F0850B4 46107482 */ mul.s $f18, $f14, $f16 -/* 0B9BE8 7F0850B8 5020000A */ beql $at, $zero, .L7F0850E4 -/* 0B9BEC 7F0850BC 46009400 */ add.s $f16, $f18, $f0 -/* 0B9BF0 7F0850C0 46009400 */ add.s $f16, $f18, $f0 -.L7F0850C4: -/* 0B9BF4 7F0850C4 24420001 */ addiu $v0, $v0, 1 -/* 0B9BF8 7F0850C8 0044082A */ slt $at, $v0, $a0 -/* 0B9BFC 7F0850CC E4700000 */ swc1 $f16, ($v1) -/* 0B9C00 7F0850D0 C4700000 */ lwc1 $f16, ($v1) -/* 0B9C04 7F0850D4 46107482 */ mul.s $f18, $f14, $f16 -/* 0B9C08 7F0850D8 5420FFFA */ bnezl $at, .L7F0850C4 -/* 0B9C0C 7F0850DC 46009400 */ add.s $f16, $f18, $f0 -/* 0B9C10 7F0850E0 46009400 */ add.s $f16, $f18, $f0 -.L7F0850E4: -/* 0B9C14 7F0850E4 E4700000 */ swc1 $f16, ($v1) -.L7F0850E8: -/* 0B9C18 7F0850E8 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.L7F0850EC: -/* 0B9C1C 7F0850EC 44817000 */ mtc1 $at, $f14 -/* 0B9C20 7F0850F0 3C038003 */ lui $v1, %hi(D_8003647C) -/* 0B9C24 7F0850F4 2463647C */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x647c -/* 0B9C28 7F0850F8 3C018005 */ lui $at, %hi(D_800551D0) -/* 0B9C2C 7F0850FC C42451D0 */ lwc1 $f4, %lo(D_800551D0)($at) -/* 0B9C30 7F085100 C4660000 */ lwc1 $f6, ($v1) -/* 0B9C34 7F085104 8E280000 */ lw $t0, ($s1) -/* 0B9C38 7F085108 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B9C3C 7F08510C 46043082 */ mul.s $f2, $f6, $f4 -/* 0B9C40 7F085110 44814000 */ mtc1 $at, $f8 -/* 0B9C44 7F085114 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0B9C48 7F085118 3C018005 */ lui $at, %hi(D_800551D4) -/* 0B9C4C 7F08511C C42451D4 */ lwc1 $f4, %lo(D_800551D4)($at) -/* 0B9C50 7F085120 46085182 */ mul.s $f6, $f10, $f8 -/* 0B9C54 7F085124 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B9C58 7F085128 44814000 */ mtc1 $at, $f8 -/* 0B9C5C 7F08512C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B9C60 7F085130 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9C64 7F085134 C4246464 */ lwc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B9C68 7F085138 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B9C6C 7F08513C 46085182 */ mul.s $f6, $f10, $f8 -/* 0B9C70 7F085140 460C2280 */ add.s $f10, $f4, $f12 -/* 0B9C74 7F085144 44812000 */ mtc1 $at, $f4 -/* 0B9C78 7F085148 3C018005 */ lui $at, %hi(D_800551D8) -/* 0B9C7C 7F08514C 46065200 */ add.s $f8, $f10, $f6 -/* 0B9C80 7F085150 46041282 */ mul.s $f10, $f2, $f4 -/* 0B9C84 7F085154 460A4180 */ add.s $f6, $f8, $f10 -/* 0B9C88 7F085158 C42851D8 */ lwc1 $f8, %lo(D_800551D8)($at) -/* 0B9C8C 7F08515C 460E3102 */ mul.s $f4, $f6, $f14 -/* 0B9C90 7F085160 46082283 */ div.s $f10, $f4, $f8 -/* 0B9C94 7F085164 E50A0148 */ swc1 $f10, 0x148($t0) -/* 0B9C98 7F085168 8E280000 */ lw $t0, ($s1) -/* 0B9C9C 7F08516C C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B9CA0 7F085170 4614003C */ c.lt.s $f0, $f20 -/* 0B9CA4 7F085174 00000000 */ nop -/* 0B9CA8 7F085178 4502000A */ bc1fl .L7F0851A4 -/* 0B9CAC 7F08517C 4600703E */ c.le.s $f14, $f0 -/* 0B9CB0 7F085180 460E0180 */ add.s $f6, $f0, $f14 -.L7F085184: -/* 0B9CB4 7F085184 E5060148 */ swc1 $f6, 0x148($t0) -/* 0B9CB8 7F085188 8E280000 */ lw $t0, ($s1) -/* 0B9CBC 7F08518C C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B9CC0 7F085190 4614003C */ c.lt.s $f0, $f20 -/* 0B9CC4 7F085194 00000000 */ nop -/* 0B9CC8 7F085198 4503FFFA */ bc1tl .L7F085184 -/* 0B9CCC 7F08519C 460E0180 */ add.s $f6, $f0, $f14 -/* 0B9CD0 7F0851A0 4600703E */ c.le.s $f14, $f0 -.L7F0851A4: -/* 0B9CD4 7F0851A4 00000000 */ nop -/* 0B9CD8 7F0851A8 45000009 */ bc1f .L7F0851D0 -/* 0B9CDC 7F0851AC 00000000 */ nop -/* 0B9CE0 7F0851B0 460E0101 */ sub.s $f4, $f0, $f14 -.L7F0851B4: -/* 0B9CE4 7F0851B4 E5040148 */ swc1 $f4, 0x148($t0) -/* 0B9CE8 7F0851B8 8E280000 */ lw $t0, ($s1) -/* 0B9CEC 7F0851BC C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B9CF0 7F0851C0 4600703E */ c.le.s $f14, $f0 -/* 0B9CF4 7F0851C4 00000000 */ nop -/* 0B9CF8 7F0851C8 4503FFFA */ bc1tl .L7F0851B4 -/* 0B9CFC 7F0851CC 460E0101 */ sub.s $f4, $f0, $f14 -.L7F0851D0: -/* 0B9D00 7F0851D0 10000022 */ b .L7F08525C -/* 0B9D04 7F0851D4 00000000 */ nop -.L7F0851D8: -/* 0B9D08 7F0851D8 C508014C */ lwc1 $f8, 0x14c($t0) -/* 0B9D0C 7F0851DC C52A0000 */ lwc1 $f10, ($t1) -/* 0B9D10 7F0851E0 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B9D14 7F0851E4 44812000 */ mtc1 $at, $f4 -/* 0B9D18 7F0851E8 460A4182 */ mul.s $f6, $f8, $f10 -/* 0B9D1C 7F0851EC C50A0148 */ lwc1 $f10, 0x148($t0) -/* 0B9D20 7F0851F0 3C0143B4 */ lui $at, 0x43b4 -/* 0B9D24 7F0851F4 46043202 */ mul.s $f8, $f6, $f4 -/* 0B9D28 7F0851F8 46085000 */ add.s $f0, $f10, $f8 -/* 0B9D2C 7F0851FC 4614003C */ c.lt.s $f0, $f20 -/* 0B9D30 7F085200 00000000 */ nop -/* 0B9D34 7F085204 45020009 */ bc1fl .L7F08522C -/* 0B9D38 7F085208 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B9D3C 7F08520C 44817000 */ mtc1 $at, $f14 -/* 0B9D40 7F085210 00000000 */ nop -/* 0B9D44 7F085214 460E0000 */ add.s $f0, $f0, $f14 -.L7F085218: -/* 0B9D48 7F085218 4614003C */ c.lt.s $f0, $f20 -/* 0B9D4C 7F08521C 00000000 */ nop -/* 0B9D50 7F085220 4503FFFD */ bc1tl .L7F085218 -/* 0B9D54 7F085224 460E0000 */ add.s $f0, $f0, $f14 -/* 0B9D58 7F085228 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.L7F08522C: -/* 0B9D5C 7F08522C 44817000 */ mtc1 $at, $f14 -/* 0B9D60 7F085230 00000000 */ nop -/* 0B9D64 7F085234 4600703E */ c.le.s $f14, $f0 -/* 0B9D68 7F085238 00000000 */ nop -/* 0B9D6C 7F08523C 45020007 */ bc1fl .L7F08525C -/* 0B9D70 7F085240 E5000148 */ swc1 $f0, 0x148($t0) -/* 0B9D74 7F085244 460E0001 */ sub.s $f0, $f0, $f14 -.L7F085248: -/* 0B9D78 7F085248 4600703E */ c.le.s $f14, $f0 -/* 0B9D7C 7F08524C 00000000 */ nop -/* 0B9D80 7F085250 4503FFFD */ bc1tl .L7F085248 -/* 0B9D84 7F085254 460E0001 */ sub.s $f0, $f0, $f14 -/* 0B9D88 7F085258 E5000148 */ swc1 $f0, 0x148($t0) -.L7F08525C: -/* 0B9D8C 7F08525C 0FC205E4 */ jal bondviewApplyVertaTheta -/* 0B9D90 7F085260 00000000 */ nop -/* 0B9D94 7F085264 0FC1E67C */ jal currentPlayerGetCrouchPos -/* 0B9D98 7F085268 E7B402AC */ swc1 $f20, 0x2ac($sp) -/* 0B9D9C 7F08526C 14400004 */ bnez $v0, .L7F085280 -/* 0B9DA0 7F085270 3C01C2C8 */ li $at, 0xC2C80000 # -100.000000 -/* 0B9DA4 7F085274 44813000 */ mtc1 $at, $f6 -/* 0B9DA8 7F085278 1000000B */ b .L7F0852A8 -/* 0B9DAC 7F08527C E7A602AC */ swc1 $f6, 0x2ac($sp) -.L7F085280: -/* 0B9DB0 7F085280 0FC1E67C */ jal currentPlayerGetCrouchPos -/* 0B9DB4 7F085284 00000000 */ nop -/* 0B9DB8 7F085288 24010001 */ li $at, 1 -/* 0B9DBC 7F08528C 14410004 */ bne $v0, $at, .L7F0852A0 -/* 0B9DC0 7F085290 3C01C270 */ li $at, 0xC2700000 # -60.000000 -/* 0B9DC4 7F085294 44812000 */ mtc1 $at, $f4 -/* 0B9DC8 7F085298 10000003 */ b .L7F0852A8 -/* 0B9DCC 7F08529C E7A402AC */ swc1 $f4, 0x2ac($sp) -.L7F0852A0: -/* 0B9DD0 7F0852A0 0FC1E67C */ jal currentPlayerGetCrouchPos -/* 0B9DD4 7F0852A4 00000000 */ nop -.L7F0852A8: -/* 0B9DD8 7F0852A8 8E280000 */ lw $t0, ($s1) -/* 0B9DDC 7F0852AC C7AA02AC */ lwc1 $f10, 0x2ac($sp) -/* 0B9DE0 7F0852B0 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B9DE4 7F0852B4 C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0B9DE8 7F0852B8 250400A0 */ addiu $a0, $t0, 0xa0 -/* 0B9DEC 7F0852BC 250600A4 */ addiu $a2, $t0, 0xa4 -/* 0B9DF0 7F0852C0 46005032 */ c.eq.s $f10, $f0 -/* 0B9DF4 7F0852C4 00000000 */ nop -/* 0B9DF8 7F0852C8 4503000C */ bc1tl .L7F0852FC -/* 0B9DFC 7F0852CC C7A602AC */ lwc1 $f6, 0x2ac($sp) -/* 0B9E00 7F0852D0 44810000 */ mtc1 $at, $f0 -/* 0B9E04 7F0852D4 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0B9E08 7F0852D8 44814000 */ mtc1 $at, $f8 -/* 0B9E0C 7F0852DC 44055000 */ mfc1 $a1, $f10 -/* 0B9E10 7F0852E0 44070000 */ mfc1 $a3, $f0 -/* 0B9E14 7F0852E4 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0B9E18 7F0852E8 0FC10BC6 */ jal chrobjApplySpeed -/* 0B9E1C 7F0852EC E7A80014 */ swc1 $f8, 0x14($sp) -/* 0B9E20 7F0852F0 8E280000 */ lw $t0, ($s1) -/* 0B9E24 7F0852F4 C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0B9E28 7F0852F8 C7A602AC */ lwc1 $f6, 0x2ac($sp) -.L7F0852FC: -/* 0B9E2C 7F0852FC 3C108003 */ lui $s0, %hi(SFX_80036458) -/* 0B9E30 7F085300 3C0C8003 */ lui $t4, %hi(in_tank_flag) -/* 0B9E34 7F085304 46003032 */ c.eq.s $f6, $f0 -/* 0B9E38 7F085308 26106458 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6458 -/* 0B9E3C 7F08530C 45000002 */ bc1f .L7F085318 -/* 0B9E40 7F085310 00000000 */ nop -/* 0B9E44 7F085314 E51400A4 */ swc1 $f20, 0xa4($t0) -.L7F085318: -/* 0B9E48 7F085318 8D8C6448 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B9E4C 7F08531C 24010001 */ li $at, 1 -/* 0B9E50 7F085320 15810209 */ bne $t4, $at, .L7F085B48 -/* 0B9E54 7F085324 3C028008 */ lui $v0, %hi(g_EnterTankAudioState) -/* 0B9E58 7F085328 8C4299B8 */ lw $v0, %lo(g_EnterTankAudioState)($v0) -/* 0B9E5C 7F08532C 3C038003 */ lui $v1, %hi(ptr_playerstank) -/* 0B9E60 7F085330 24010001 */ li $at, 1 -/* 0B9E64 7F085334 144000BF */ bnez $v0, .L7F085634 -/* 0B9E68 7F085338 00000000 */ nop -/* 0B9E6C 7F08533C 8C636450 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0B9E70 7F085340 3C018005 */ lui $at, %hi(D_800551DC) -/* 0B9E74 7F085344 27A50268 */ addiu $a1, $sp, 0x268 -/* 0B9E78 7F085348 106000AD */ beqz $v1, .L7F085600 -/* 0B9E7C 7F08534C 00000000 */ nop -/* 0B9E80 7F085350 C42451DC */ lwc1 $f4, %lo(D_800551DC)($at) -/* 0B9E84 7F085354 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B9E88 7F085358 C42A6464 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0B9E8C 7F08535C 8C700004 */ lw $s0, 4($v1) -/* 0B9E90 7F085360 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0B9E94 7F085364 460A2301 */ sub.s $f12, $f4, $f10 -/* 0B9E98 7F085368 8E190014 */ lw $t9, 0x14($s0) -/* 0B9E9C 7F08536C 27A50268 */ addiu $a1, $sp, 0x268 -/* 0B9EA0 7F085370 0FC1629F */ jal matrix_scalar_multiply -/* 0B9EA4 7F085374 C72C0014 */ lwc1 $f12, 0x14($t9) -/* 0B9EA8 7F085378 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) -/* 0B9EAC 7F08537C 244299A8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6658 -/* 0B9EB0 7F085380 C4480000 */ lwc1 $f8, ($v0) -/* 0B9EB4 7F085384 C4460004 */ lwc1 $f6, 4($v0) -/* 0B9EB8 7F085388 C4440008 */ lwc1 $f4, 8($v0) -/* 0B9EBC 7F08538C 27A40268 */ addiu $a0, $sp, 0x268 -/* 0B9EC0 7F085390 27A5025C */ addiu $a1, $sp, 0x25c -/* 0B9EC4 7F085394 E7A8025C */ swc1 $f8, 0x25c($sp) -/* 0B9EC8 7F085398 E7A60260 */ swc1 $f6, 0x260($sp) -/* 0B9ECC 7F08539C 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0B9ED0 7F0853A0 E7A40264 */ swc1 $f4, 0x264($sp) -/* 0B9ED4 7F0853A4 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 0B9ED8 7F0853A8 C6080058 */ lwc1 $f8, 0x58($s0) -/* 0B9EDC 7F0853AC C7A40260 */ lwc1 $f4, 0x260($sp) -/* 0B9EE0 7F0853B0 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B9EE4 7F0853B4 46085180 */ add.s $f6, $f10, $f8 -/* 0B9EE8 7F0853B8 44810000 */ mtc1 $at, $f0 -/* 0B9EEC 7F0853BC 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B9EF0 7F0853C0 44817000 */ mtc1 $at, $f14 -/* 0B9EF4 7F0853C4 E7A6025C */ swc1 $f6, 0x25c($sp) -/* 0B9EF8 7F0853C8 C60A005C */ lwc1 $f10, 0x5c($s0) -/* 0B9EFC 7F0853CC C7A60264 */ lwc1 $f6, 0x264($sp) -/* 0B9F00 7F0853D0 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0B9F04 7F0853D4 460A2200 */ add.s $f8, $f4, $f10 -/* 0B9F08 7F0853D8 8E2A0000 */ lw $t2, ($s1) -/* 0B9F0C 7F0853DC E7A80260 */ swc1 $f8, 0x260($sp) -/* 0B9F10 7F0853E0 C6040060 */ lwc1 $f4, 0x60($s0) -/* 0B9F14 7F0853E4 C4286464 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B9F18 7F0853E8 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0B9F1C 7F0853EC 46043280 */ add.s $f10, $f6, $f4 -/* 0B9F20 7F0853F0 C4266474 */ lwc1 $f6, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B9F24 7F0853F4 3C018005 */ lui $at, %hi(D_800551E0) -/* 0B9F28 7F0853F8 46064100 */ add.s $f4, $f8, $f6 -/* 0B9F2C 7F0853FC E7AA0264 */ swc1 $f10, 0x264($sp) -/* 0B9F30 7F085400 C5420158 */ lwc1 $f2, 0x158($t2) -/* 0B9F34 7F085404 C42851E0 */ lwc1 $f8, %lo(D_800551E0)($at) -/* 0B9F38 7F085408 460E2282 */ mul.s $f10, $f4, $f14 -/* 0B9F3C 7F08540C 4600103C */ c.lt.s $f2, $f0 -/* 0B9F40 7F085410 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9F44 7F085414 44819000 */ mtc1 $at, $f18 -/* 0B9F48 7F085418 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0B9F4C 7F08541C 45000002 */ bc1f .L7F085428 -/* 0B9F50 7F085420 46085403 */ div.s $f16, $f10, $f8 -/* 0B9F54 7F085424 46000086 */ mov.s $f2, $f0 -.L7F085428: -/* 0B9F58 7F085428 C4268378 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B9F5C 7F08542C 3C014234 */ li $at, 0x42340000 # 45.000000 -/* 0B9F60 7F085430 44812000 */ mtc1 $at, $f4 -/* 0B9F64 7F085434 3C108008 */ lui $s0, %hi(g_TankEnteringSitHeight) -/* 0B9F68 7F085438 261099BC */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x6644 -/* 0B9F6C 7F08543C 46043283 */ div.s $f10, $f6, $f4 -/* 0B9F70 7F085440 C6080000 */ lwc1 $f8, ($s0) -/* 0B9F74 7F085444 3C018005 */ lui $at, %hi(D_800551E4) -/* 0B9F78 7F085448 460A4180 */ add.s $f6, $f8, $f10 -/* 0B9F7C 7F08544C E6060000 */ swc1 $f6, ($s0) -/* 0B9F80 7F085450 C6000000 */ lwc1 $f0, ($s0) -/* 0B9F84 7F085454 4600903E */ c.le.s $f18, $f0 -/* 0B9F88 7F085458 00000000 */ nop -/* 0B9F8C 7F08545C 45000003 */ bc1f .L7F08546C -/* 0B9F90 7F085460 00000000 */ nop -/* 0B9F94 7F085464 E6120000 */ swc1 $f18, ($s0) -/* 0B9F98 7F085468 C6000000 */ lwc1 $f0, ($s0) -.L7F08546C: -/* 0B9F9C 7F08546C C42451E4 */ lwc1 $f4, %lo(D_800551E4)($at) -/* 0B9FA0 7F085470 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B9FA4 7F085474 44815000 */ mtc1 $at, $f10 -/* 0B9FA8 7F085478 46040202 */ mul.s $f8, $f0, $f4 -/* 0B9FAC 7F08547C E7A20254 */ swc1 $f2, 0x254($sp) -/* 0B9FB0 7F085480 E7B00258 */ swc1 $f16, 0x258($sp) -/* 0B9FB4 7F085484 460A4302 */ mul.s $f12, $f8, $f10 -/* 0B9FB8 7F085488 0FC15FA8 */ jal cosf -/* 0B9FBC 7F08548C 00000000 */ nop -/* 0B9FC0 7F085490 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B9FC4 7F085494 44817000 */ mtc1 $at, $f14 -/* 0B9FC8 7F085498 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9FCC 7F08549C 44813000 */ mtc1 $at, $f6 -/* 0B9FD0 7F0854A0 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B9FD4 7F0854A4 44814000 */ mtc1 $at, $f8 -/* 0B9FD8 7F0854A8 46060100 */ add.s $f4, $f0, $f6 -/* 0B9FDC 7F0854AC 3C028008 */ lui $v0, %hi(g_TankEnteringSitHeightRemain) -/* 0B9FE0 7F0854B0 244299C0 */ addiu $v0, %lo(g_TankEnteringSitHeightRemain) # addiu $v0, $v0, -0x6640 -/* 0B9FE4 7F0854B4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9FE8 7F0854B8 46082282 */ mul.s $f10, $f4, $f8 -/* 0B9FEC 7F0854BC 44813000 */ mtc1 $at, $f6 -/* 0B9FF0 7F0854C0 C7A80254 */ lwc1 $f8, 0x254($sp) -/* 0B9FF4 7F0854C4 3C018008 */ lui $at, %hi(g_TankEnterBondVertAngleDeg) -/* 0B9FF8 7F0854C8 8E2D0000 */ lw $t5, ($s1) -/* 0B9FFC 7F0854CC C7B00258 */ lwc1 $f16, 0x258($sp) -/* 0BA000 7F0854D0 3C038008 */ lui $v1, %hi(g_EnterTankCoord) -/* 0BA004 7F0854D4 E44A0000 */ swc1 $f10, ($v0) -/* 0BA008 7F0854D8 C4420000 */ lwc1 $f2, ($v0) -/* 0BA00C 7F0854DC 246399D0 */ addiu $v1, %lo(g_EnterTankCoord) # addiu $v1, $v1, -0x6630 -/* 0BA010 7F0854E0 46023101 */ sub.s $f4, $f6, $f2 -/* 0BA014 7F0854E4 C42699C8 */ lwc1 $f6, %lo(g_TankEnterBondVertAngleDeg)($at) -/* 0BA018 7F0854E8 3C018008 */ lui $at, %hi(g_TankEnterBondHorizAngleDeg) -/* 0BA01C 7F0854EC 46082282 */ mul.s $f10, $f4, $f8 -/* 0BA020 7F0854F0 00000000 */ nop -/* 0BA024 7F0854F4 46061102 */ mul.s $f4, $f2, $f6 -/* 0BA028 7F0854F8 460A2200 */ add.s $f8, $f4, $f10 -/* 0BA02C 7F0854FC E5A80158 */ swc1 $f8, 0x158($t5) -/* 0BA030 7F085500 C43299C4 */ lwc1 $f18, %lo(g_TankEnterBondHorizAngleDeg)($at) -/* 0BA034 7F085504 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0BA038 7F085508 44813000 */ mtc1 $at, $f6 -/* 0BA03C 7F08550C 46128301 */ sub.s $f12, $f16, $f18 -/* 0BA040 7F085510 3C01C334 */ li $at, 0xC3340000 # -180.000000 -/* 0BA044 7F085514 44812000 */ mtc1 $at, $f4 -/* 0BA048 7F085518 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA04C 7F08551C 460C303C */ c.lt.s $f6, $f12 -/* 0BA050 7F085520 44814000 */ mtc1 $at, $f8 -/* 0BA054 7F085524 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA058 7F085528 45000002 */ bc1f .L7F085534 -/* 0BA05C 7F08552C 00000000 */ nop -/* 0BA060 7F085530 460E8401 */ sub.s $f16, $f16, $f14 -.L7F085534: -/* 0BA064 7F085534 4604603C */ c.lt.s $f12, $f4 -/* 0BA068 7F085538 00000000 */ nop -/* 0BA06C 7F08553C 45020003 */ bc1fl .L7F08554C -/* 0BA070 7F085540 C4420000 */ lwc1 $f2, ($v0) -/* 0BA074 7F085544 460E8400 */ add.s $f16, $f16, $f14 -/* 0BA078 7F085548 C4420000 */ lwc1 $f2, ($v0) -.L7F08554C: -/* 0BA07C 7F08554C 8E2E0000 */ lw $t6, ($s1) -/* 0BA080 7F085550 46024181 */ sub.s $f6, $f8, $f2 -/* 0BA084 7F085554 46121282 */ mul.s $f10, $f2, $f18 -/* 0BA088 7F085558 00000000 */ nop -/* 0BA08C 7F08555C 46103102 */ mul.s $f4, $f6, $f16 -/* 0BA090 7F085560 46045200 */ add.s $f8, $f10, $f4 -/* 0BA094 7F085564 44812000 */ mtc1 $at, $f4 -/* 0BA098 7F085568 E5C80148 */ swc1 $f8, 0x148($t6) -/* 0BA09C 7F08556C 8E280000 */ lw $t0, ($s1) -/* 0BA0A0 7F085570 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0BA0A4 7F085574 4600703E */ c.le.s $f14, $f0 -/* 0BA0A8 7F085578 00000000 */ nop -/* 0BA0AC 7F08557C 45000005 */ bc1f .L7F085594 -/* 0BA0B0 7F085580 00000000 */ nop -/* 0BA0B4 7F085584 460E0181 */ sub.s $f6, $f0, $f14 -/* 0BA0B8 7F085588 E5060148 */ swc1 $f6, 0x148($t0) -/* 0BA0BC 7F08558C 8E280000 */ lw $t0, ($s1) -/* 0BA0C0 7F085590 C5000148 */ lwc1 $f0, 0x148($t0) -.L7F085594: -/* 0BA0C4 7F085594 4614003C */ c.lt.s $f0, $f20 -/* 0BA0C8 7F085598 00000000 */ nop -/* 0BA0CC 7F08559C 45020005 */ bc1fl .L7F0855B4 -/* 0BA0D0 7F0855A0 C4420000 */ lwc1 $f2, ($v0) -/* 0BA0D4 7F0855A4 460E0280 */ add.s $f10, $f0, $f14 -/* 0BA0D8 7F0855A8 E50A0148 */ swc1 $f10, 0x148($t0) -/* 0BA0DC 7F0855AC 8E280000 */ lw $t0, ($s1) -/* 0BA0E0 7F0855B0 C4420000 */ lwc1 $f2, ($v0) -.L7F0855B4: -/* 0BA0E4 7F0855B4 C4680000 */ lwc1 $f8, ($v1) -/* 0BA0E8 7F0855B8 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 0BA0EC 7F0855BC 46022001 */ sub.s $f0, $f4, $f2 -/* 0BA0F0 7F0855C0 46081182 */ mul.s $f6, $f2, $f8 -/* 0BA0F4 7F0855C4 00000000 */ nop -/* 0BA0F8 7F0855C8 460A0102 */ mul.s $f4, $f0, $f10 -/* 0BA0FC 7F0855CC C50A048C */ lwc1 $f10, 0x48c($t0) -/* 0BA100 7F0855D0 E7B403B0 */ swc1 $f20, 0x3b0($sp) -/* 0BA104 7F0855D4 46043200 */ add.s $f8, $f6, $f4 -/* 0BA108 7F0855D8 C4640008 */ lwc1 $f4, 8($v1) -/* 0BA10C 7F0855DC 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BA110 7F0855E0 46041202 */ mul.s $f8, $f2, $f4 -/* 0BA114 7F0855E4 C7AA0264 */ lwc1 $f10, 0x264($sp) -/* 0BA118 7F0855E8 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0BA11C 7F0855EC 460A0182 */ mul.s $f6, $f0, $f10 -/* 0BA120 7F0855F0 C50A0494 */ lwc1 $f10, 0x494($t0) -/* 0BA124 7F0855F4 46064100 */ add.s $f4, $f8, $f6 -/* 0BA128 7F0855F8 460A2201 */ sub.s $f8, $f4, $f10 -/* 0BA12C 7F0855FC E7A803B4 */ swc1 $f8, 0x3b4($sp) -.L7F085600: -/* 0BA130 7F085600 3C108008 */ lui $s0, %hi(g_TankEnteringSitHeight) -/* 0BA134 7F085604 261099BC */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x6644 -/* 0BA138 7F085608 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA13C 7F08560C 44812000 */ mtc1 $at, $f4 -/* 0BA140 7F085610 C6060000 */ lwc1 $f6, ($s0) -/* 0BA144 7F085614 8E280000 */ lw $t0, ($s1) -/* 0BA148 7F085618 3C018008 */ lui $at, %hi(g_EnterTankAudioState) -/* 0BA14C 7F08561C 4606203E */ c.le.s $f4, $f6 -/* 0BA150 7F085620 240F0001 */ li $t7, 1 -/* 0BA154 7F085624 450200EF */ bc1fl .L7F0859E4 -/* 0BA158 7F085628 3C013F40 */ lui $at, %hi(0x3F3F99B8) # $at, 0x3f40 -/* 0BA15C 7F08562C 100000EC */ b .L7F0859E0 -/* 0BA160 7F085630 AC2F99B8 */ sw $t7, %lo(g_EnterTankAudioState)($at) -.L7F085634: -/* 0BA164 7F085634 1441001A */ bne $v0, $at, .L7F0856A0 -/* 0BA168 7F085638 3C108003 */ lui $s0, %hi(SFX_80036458) -/* 0BA16C 7F08563C 240B0002 */ li $t3, 2 -/* 0BA170 7F085640 3C018008 */ lui $at, %hi(g_EnterTankAudioState) -/* 0BA174 7F085644 26106458 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6458 -/* 0BA178 7F085648 AC2B99B8 */ sw $t3, %lo(g_EnterTankAudioState)($at) -/* 0BA17C 7F08564C 8E180000 */ lw $t8, ($s0) -/* 0BA180 7F085650 5700000A */ bnezl $t8, .L7F08567C -/* 0BA184 7F085654 8E040000 */ lw $a0, ($s0) -/* 0BA188 7F085658 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0BA18C 7F08565C 00000000 */ nop -/* 0BA190 7F085660 14400005 */ bnez $v0, .L7F085678 -/* 0BA194 7F085664 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0BA198 7F085668 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BA19C 7F08566C 24050042 */ li $a1, 66 -/* 0BA1A0 7F085670 0C002382 */ jal sndPlaySfx -/* 0BA1A4 7F085674 02003025 */ move $a2, $s0 -.L7F085678: -/* 0BA1A8 7F085678 8E040000 */ lw $a0, ($s0) -.L7F08567C: -/* 0BA1AC 7F08567C 24050008 */ li $a1, 8 -/* 0BA1B0 7F085680 0C002461 */ jal sndCreatePostEvent -/* 0BA1B4 7F085684 240661A8 */ li $a2, 25000 -/* 0BA1B8 7F085688 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) -/* 0BA1BC 7F08568C 244299B4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x664c -/* 0BA1C0 7F085690 240C61A8 */ li $t4, 25000 -/* 0BA1C4 7F085694 AC4C0000 */ sw $t4, ($v0) -/* 0BA1C8 7F085698 100000D1 */ b .L7F0859E0 -/* 0BA1CC 7F08569C 8E280000 */ lw $t0, ($s1) -.L7F0856A0: -/* 0BA1D0 7F0856A0 8E280000 */ lw $t0, ($s1) -/* 0BA1D4 7F0856A4 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0BA1D8 7F0856A8 44814000 */ mtc1 $at, $f8 -/* 0BA1DC 7F0856AC C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BA1E0 7F0856B0 3C018005 */ lui $at, %hi(D_800551E8) -/* 0BA1E4 7F0856B4 C42451E8 */ lwc1 $f4, %lo(D_800551E8)($at) -/* 0BA1E8 7F0856B8 46085003 */ div.s $f0, $f10, $f8 -/* 0BA1EC 7F0856BC C506014C */ lwc1 $f6, 0x14c($t0) -/* 0BA1F0 7F0856C0 46043083 */ div.s $f2, $f6, $f4 -/* 0BA1F4 7F0856C4 4614003C */ c.lt.s $f0, $f20 -/* 0BA1F8 7F0856C8 00000000 */ nop -/* 0BA1FC 7F0856CC 45020003 */ bc1fl .L7F0856DC -/* 0BA200 7F0856D0 4614103C */ c.lt.s $f2, $f20 -/* 0BA204 7F0856D4 46000007 */ neg.s $f0, $f0 -/* 0BA208 7F0856D8 4614103C */ c.lt.s $f2, $f20 -.L7F0856DC: -/* 0BA20C 7F0856DC 00000000 */ nop -/* 0BA210 7F0856E0 45020003 */ bc1fl .L7F0856F0 -/* 0BA214 7F0856E4 4602003C */ c.lt.s $f0, $f2 -/* 0BA218 7F0856E8 46001087 */ neg.s $f2, $f2 -/* 0BA21C 7F0856EC 4602003C */ c.lt.s $f0, $f2 -.L7F0856F0: -/* 0BA220 7F0856F0 46000306 */ mov.s $f12, $f0 -/* 0BA224 7F0856F4 45020003 */ bc1fl .L7F085704 -/* 0BA228 7F0856F8 460CA03C */ c.lt.s $f20, $f12 -/* 0BA22C 7F0856FC 46001306 */ mov.s $f12, $f2 -/* 0BA230 7F085700 460CA03C */ c.lt.s $f20, $f12 -.L7F085704: -/* 0BA234 7F085704 00000000 */ nop -/* 0BA238 7F085708 45000043 */ bc1f .L7F085818 -/* 0BA23C 7F08570C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA240 7F085710 44815000 */ mtc1 $at, $f10 -/* 0BA244 7F085714 3C108003 */ lui $s0, %hi(SFX_80036458) -/* 0BA248 7F085718 26106458 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6458 -/* 0BA24C 7F08571C 460C503C */ c.lt.s $f10, $f12 -/* 0BA250 7F085720 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA254 7F085724 45020004 */ bc1fl .L7F085738 -/* 0BA258 7F085728 8E190004 */ lw $t9, 4($s0) -/* 0BA25C 7F08572C 44816000 */ mtc1 $at, $f12 -/* 0BA260 7F085730 00000000 */ nop -/* 0BA264 7F085734 8E190004 */ lw $t9, 4($s0) -.L7F085738: -/* 0BA268 7F085738 5720000E */ bnezl $t9, .L7F085774 -/* 0BA26C 7F08573C 8E040004 */ lw $a0, 4($s0) -/* 0BA270 7F085740 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0BA274 7F085744 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA278 7F085748 14400009 */ bnez $v0, .L7F085770 -/* 0BA27C 7F08574C C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BA280 7F085750 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0BA284 7F085754 3C068003 */ lui $a2, %hi(SFX_80036458 + 4) -/* 0BA288 7F085758 24C6645C */ addiu $a2, %lo(SFX_80036458 + 4) # addiu $a2, $a2, 0x645c -/* 0BA28C 7F08575C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BA290 7F085760 2405003E */ li $a1, 62 -/* 0BA294 7F085764 0C002382 */ jal sndPlaySfx -/* 0BA298 7F085768 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA29C 7F08576C C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085770: -/* 0BA2A0 7F085770 8E040004 */ lw $a0, 4($s0) -.L7F085774: -/* 0BA2A4 7F085774 3C018005 */ lui $at, %hi(D_800551EC) -/* 0BA2A8 7F085778 24050008 */ li $a1, 8 -/* 0BA2AC 7F08577C 50800034 */ beql $a0, $zero, .L7F085850 -/* 0BA2B0 7F085780 8E0E0000 */ lw $t6, ($s0) -/* 0BA2B4 7F085784 C42051EC */ lwc1 $f0, %lo(D_800551EC)($at) -/* 0BA2B8 7F085788 24067FFF */ li $a2, 32767 -/* 0BA2BC 7F08578C 3C018005 */ lui $at, %hi(D_800551F4) -/* 0BA2C0 7F085790 4600603C */ c.lt.s $f12, $f0 -/* 0BA2C4 7F085794 00000000 */ nop -/* 0BA2C8 7F085798 45000009 */ bc1f .L7F0857C0 -/* 0BA2CC 7F08579C 00000000 */ nop -/* 0BA2D0 7F0857A0 3C018005 */ lui $at, %hi(D_800551F0) -/* 0BA2D4 7F0857A4 C42851F0 */ lwc1 $f8, %lo(D_800551F0)($at) -/* 0BA2D8 7F0857A8 46086182 */ mul.s $f6, $f12, $f8 -/* 0BA2DC 7F0857AC 46003103 */ div.s $f4, $f6, $f0 -/* 0BA2E0 7F0857B0 4600228D */ trunc.w.s $f10, $f4 -/* 0BA2E4 7F0857B4 44065000 */ mfc1 $a2, $f10 -/* 0BA2E8 7F0857B8 10000013 */ b .L7F085808 -/* 0BA2EC 7F0857BC 00000000 */ nop -.L7F0857C0: -/* 0BA2F0 7F0857C0 C42851F4 */ lwc1 $f8, %lo(D_800551F4)($at) -/* 0BA2F4 7F0857C4 3C018005 */ lui $at, %hi(D_800551F8) -/* 0BA2F8 7F0857C8 4608603C */ c.lt.s $f12, $f8 -/* 0BA2FC 7F0857CC 00000000 */ nop -/* 0BA300 7F0857D0 4500000D */ bc1f .L7F085808 -/* 0BA304 7F0857D4 00000000 */ nop -/* 0BA308 7F0857D8 46006181 */ sub.s $f6, $f12, $f0 -/* 0BA30C 7F0857DC C42451F8 */ lwc1 $f4, %lo(D_800551F8)($at) -/* 0BA310 7F0857E0 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0BA314 7F0857E4 44814000 */ mtc1 $at, $f8 -/* 0BA318 7F0857E8 46043282 */ mul.s $f10, $f6, $f4 -/* 0BA31C 7F0857EC 3C018005 */ lui $at, %hi(D_800551FC) -/* 0BA320 7F0857F0 C42451FC */ lwc1 $f4, %lo(D_800551FC)($at) -/* 0BA324 7F0857F4 46085183 */ div.s $f6, $f10, $f8 -/* 0BA328 7F0857F8 46043280 */ add.s $f10, $f6, $f4 -/* 0BA32C 7F0857FC 4600520D */ trunc.w.s $f8, $f10 -/* 0BA330 7F085800 44064000 */ mfc1 $a2, $f8 -/* 0BA334 7F085804 00000000 */ nop -.L7F085808: -/* 0BA338 7F085808 0C002461 */ jal sndCreatePostEvent -/* 0BA33C 7F08580C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA340 7F085810 1000000E */ b .L7F08584C -/* 0BA344 7F085814 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085818: -/* 0BA348 7F085818 3C108003 */ lui $s0, %hi(SFX_80036458) -/* 0BA34C 7F08581C 26106458 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6458 -/* 0BA350 7F085820 8E040004 */ lw $a0, 4($s0) -/* 0BA354 7F085824 5080000A */ beql $a0, $zero, .L7F085850 -/* 0BA358 7F085828 8E0E0000 */ lw $t6, ($s0) -/* 0BA35C 7F08582C 0C00237C */ jal sndGetPlayingState -/* 0BA360 7F085830 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA364 7F085834 10400005 */ beqz $v0, .L7F08584C -/* 0BA368 7F085838 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BA36C 7F08583C 8E040004 */ lw $a0, 4($s0) -/* 0BA370 7F085840 0C002408 */ jal sndDeactivate -/* 0BA374 7F085844 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA378 7F085848 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F08584C: -/* 0BA37C 7F08584C 8E0E0000 */ lw $t6, ($s0) -.L7F085850: -/* 0BA380 7F085850 55C0000D */ bnezl $t6, .L7F085888 -/* 0BA384 7F085854 8E040000 */ lw $a0, ($s0) -/* 0BA388 7F085858 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 0BA38C 7F08585C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA390 7F085860 14400008 */ bnez $v0, .L7F085884 -/* 0BA394 7F085864 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BA398 7F085868 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0BA39C 7F08586C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BA3A0 7F085870 24050041 */ li $a1, 65 -/* 0BA3A4 7F085874 02003025 */ move $a2, $s0 -/* 0BA3A8 7F085878 0C002382 */ jal sndPlaySfx -/* 0BA3AC 7F08587C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA3B0 7F085880 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085884: -/* 0BA3B4 7F085884 8E040000 */ lw $a0, ($s0) -.L7F085888: -/* 0BA3B8 7F085888 1080001A */ beqz $a0, .L7F0858F4 -/* 0BA3BC 7F08588C 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) -/* 0BA3C0 7F085890 244299B4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x664c -/* 0BA3C4 7F085894 240F7FFF */ li $t7, 32767 -/* 0BA3C8 7F085898 AC4F0000 */ sw $t7, ($v0) -/* 0BA3CC 7F08589C 3C018005 */ lui $at, %hi(D_80055200) -/* 0BA3D0 7F0858A0 C4265200 */ lwc1 $f6, %lo(D_80055200)($at) -/* 0BA3D4 7F0858A4 3C018005 */ lui $at, %hi(D_80055204) -/* 0BA3D8 7F0858A8 24050008 */ li $a1, 8 -/* 0BA3DC 7F0858AC 4606603C */ c.lt.s $f12, $f6 -/* 0BA3E0 7F0858B0 00000000 */ nop -/* 0BA3E4 7F0858B4 4500000D */ bc1f .L7F0858EC -/* 0BA3E8 7F0858B8 00000000 */ nop -/* 0BA3EC 7F0858BC C4245204 */ lwc1 $f4, %lo(D_80055204)($at) -/* 0BA3F0 7F0858C0 3C018005 */ lui $at, %hi(D_80055208) -/* 0BA3F4 7F0858C4 C4285208 */ lwc1 $f8, %lo(D_80055208)($at) -/* 0BA3F8 7F0858C8 46046282 */ mul.s $f10, $f12, $f4 -/* 0BA3FC 7F0858CC 3C018005 */ lui $at, %hi(D_8005520C) -/* 0BA400 7F0858D0 C424520C */ lwc1 $f4, %lo(D_8005520C)($at) -/* 0BA404 7F0858D4 46085183 */ div.s $f6, $f10, $f8 -/* 0BA408 7F0858D8 46043280 */ add.s $f10, $f6, $f4 -/* 0BA40C 7F0858DC 4600520D */ trunc.w.s $f8, $f10 -/* 0BA410 7F0858E0 44184000 */ mfc1 $t8, $f8 -/* 0BA414 7F0858E4 00000000 */ nop -/* 0BA418 7F0858E8 AC580000 */ sw $t8, ($v0) -.L7F0858EC: -/* 0BA41C 7F0858EC 0C002461 */ jal sndCreatePostEvent -/* 0BA420 7F0858F0 8C460000 */ lw $a2, ($v0) -.L7F0858F4: -/* 0BA424 7F0858F4 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0BA428 7F0858F8 00002025 */ move $a0, $zero -/* 0BA42C 7F0858FC 24010020 */ li $at, 32 -/* 0BA430 7F085900 14410007 */ bne $v0, $at, .L7F085920 -/* 0BA434 7F085904 3C048005 */ lui $a0, %hi(g_ClockTimer) -/* 0BA438 7F085908 8E280000 */ lw $t0, ($s1) -/* 0BA43C 7F08590C 3C018005 */ lui $at, %hi(D_80055210) -/* 0BA440 7F085910 C4265210 */ lwc1 $f6, %lo(D_80055210)($at) -/* 0BA444 7F085914 C5022A08 */ lwc1 $f2, 0x2a08($t0) -/* 0BA448 7F085918 10000004 */ b .L7F08592C -/* 0BA44C 7F08591C 46061080 */ add.s $f2, $f2, $f6 -.L7F085920: -/* 0BA450 7F085920 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) -/* 0BA454 7F085924 C422646C */ lwc1 $f2, %lo(g_TankTurretVerticalAngle)($at) -/* 0BA458 7F085928 8E280000 */ lw $t0, ($s1) -.L7F08592C: -/* 0BA45C 7F08592C 3C018005 */ lui $at, %hi(D_80055214) -/* 0BA460 7F085930 C4205214 */ lwc1 $f0, %lo(D_80055214)($at) -/* 0BA464 7F085934 3C018005 */ lui $at, %hi(D_80055218) -/* 0BA468 7F085938 4602003C */ c.lt.s $f0, $f2 -/* 0BA46C 7F08593C 00000000 */ nop -/* 0BA470 7F085940 45000002 */ bc1f .L7F08594C -/* 0BA474 7F085944 00000000 */ nop -/* 0BA478 7F085948 46000086 */ mov.s $f2, $f0 -.L7F08594C: -/* 0BA47C 7F08594C C4205218 */ lwc1 $f0, %lo(D_80055218)($at) -/* 0BA480 7F085950 4600103C */ c.lt.s $f2, $f0 -/* 0BA484 7F085954 00000000 */ nop -/* 0BA488 7F085958 45000002 */ bc1f .L7F085964 -/* 0BA48C 7F08595C 00000000 */ nop -/* 0BA490 7F085960 46000086 */ mov.s $f2, $f0 -.L7F085964: -/* 0BA494 7F085964 8C848374 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0BA498 7F085968 00001025 */ move $v0, $zero -/* 0BA49C 7F08596C 18800014 */ blez $a0, .L7F0859C0 -/* 0BA4A0 7F085970 3C018005 */ lui $at, %hi(D_8005521C) -/* 0BA4A4 7F085974 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) -/* 0BA4A8 7F085978 24636470 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x6470 -/* 0BA4AC 7F08597C C420521C */ lwc1 $f0, %lo(D_8005521C)($at) -/* 0BA4B0 7F085980 C4700000 */ lwc1 $f16, ($v1) -/* 0BA4B4 7F085984 24420001 */ addiu $v0, $v0, 1 -/* 0BA4B8 7F085988 0044082A */ slt $at, $v0, $a0 -/* 0BA4BC 7F08598C 46100482 */ mul.s $f18, $f0, $f16 -/* 0BA4C0 7F085990 5020000A */ beql $at, $zero, .L7F0859BC -/* 0BA4C4 7F085994 46029400 */ add.s $f16, $f18, $f2 -/* 0BA4C8 7F085998 46029400 */ add.s $f16, $f18, $f2 -.L7F08599C: -/* 0BA4CC 7F08599C 24420001 */ addiu $v0, $v0, 1 -/* 0BA4D0 7F0859A0 0044082A */ slt $at, $v0, $a0 -/* 0BA4D4 7F0859A4 E4700000 */ swc1 $f16, ($v1) -/* 0BA4D8 7F0859A8 C4700000 */ lwc1 $f16, ($v1) -/* 0BA4DC 7F0859AC 46100482 */ mul.s $f18, $f0, $f16 -/* 0BA4E0 7F0859B0 5420FFFA */ bnezl $at, .L7F08599C -/* 0BA4E4 7F0859B4 46029400 */ add.s $f16, $f18, $f2 -/* 0BA4E8 7F0859B8 46029400 */ add.s $f16, $f18, $f2 -.L7F0859BC: -/* 0BA4EC 7F0859BC E4700000 */ swc1 $f16, ($v1) -.L7F0859C0: -/* 0BA4F0 7F0859C0 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) -/* 0BA4F4 7F0859C4 24636470 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x6470 -/* 0BA4F8 7F0859C8 3C018005 */ lui $at, %hi(D_80055220) -/* 0BA4FC 7F0859CC C4245220 */ lwc1 $f4, %lo(D_80055220)($at) -/* 0BA500 7F0859D0 C4660000 */ lwc1 $f6, ($v1) -/* 0BA504 7F0859D4 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) -/* 0BA508 7F0859D8 46043282 */ mul.s $f10, $f6, $f4 -/* 0BA50C 7F0859DC E42A646C */ swc1 $f10, %lo(g_TankTurretVerticalAngle)($at) -.L7F0859E0: -/* 0BA510 7F0859E0 3C013F40 */ li $at, 0x3F400000 # 0.750000 -.L7F0859E4: -/* 0BA514 7F0859E4 44810000 */ mtc1 $at, $f0 -/* 0BA518 7F0859E8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA51C 7F0859EC C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BA520 7F0859F0 3C018005 */ lui $at, %hi(D_80055224) -/* 0BA524 7F0859F4 C4245224 */ lwc1 $f4, %lo(D_80055224)($at) -/* 0BA528 7F0859F8 46080182 */ mul.s $f6, $f0, $f8 -/* 0BA52C 7F0859FC C508019C */ lwc1 $f8, 0x19c($t0) -/* 0BA530 7F085A00 4406A000 */ mfc1 $a2, $f20 -/* 0BA534 7F085A04 4600A306 */ mov.s $f12, $f20 -/* 0BA538 7F085A08 46043283 */ div.s $f10, $f6, $f4 -/* 0BA53C 7F085A0C 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BA540 7F085A10 E506019C */ swc1 $f6, 0x19c($t0) -/* 0BA544 7F085A14 8E280000 */ lw $t0, ($s1) -/* 0BA548 7F085A18 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BA54C 7F085A1C 4614203C */ c.lt.s $f4, $f20 -/* 0BA550 7F085A20 00000000 */ nop -/* 0BA554 7F085A24 45000002 */ bc1f .L7F085A30 -/* 0BA558 7F085A28 00000000 */ nop -/* 0BA55C 7F085A2C E514019C */ swc1 $f20, 0x19c($t0) -.L7F085A30: -/* 0BA560 7F085A30 0FC202CD */ jal bondviewMoveAnimationTick -/* 0BA564 7F085A34 4600A386 */ mov.s $f14, $f20 -/* 0BA568 7F085A38 3C018005 */ lui $at, %hi(D_80055228) -/* 0BA56C 7F085A3C C4285228 */ lwc1 $f8, %lo(D_80055228)($at) -/* 0BA570 7F085A40 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0BA574 7F085A44 C42A6464 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0BA578 7F085A48 0FC15FAB */ jal sinf -/* 0BA57C 7F085A4C 460A4301 */ sub.s $f12, $f8, $f10 -/* 0BA580 7F085A50 8E2C0000 */ lw $t4, ($s1) -/* 0BA584 7F085A54 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA588 7F085A58 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BA58C 7F085A5C C5860174 */ lwc1 $f6, 0x174($t4) -/* 0BA590 7F085A60 3C018005 */ lui $at, %hi(D_8005522C) -/* 0BA594 7F085A64 46003102 */ mul.s $f4, $f6, $f0 -/* 0BA598 7F085A68 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BA59C 7F085A6C 46082282 */ mul.s $f10, $f4, $f8 -/* 0BA5A0 7F085A70 C428522C */ lwc1 $f8, %lo(D_8005522C)($at) -/* 0BA5A4 7F085A74 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0BA5A8 7F085A78 460A3100 */ add.s $f4, $f6, $f10 -/* 0BA5AC 7F085A7C C4266464 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0BA5B0 7F085A80 E7A403AC */ swc1 $f4, 0x3ac($sp) -/* 0BA5B4 7F085A84 0FC15FA8 */ jal cosf -/* 0BA5B8 7F085A88 46064301 */ sub.s $f12, $f8, $f6 -/* 0BA5BC 7F085A8C 8E390000 */ lw $t9, ($s1) -/* 0BA5C0 7F085A90 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA5C4 7F085A94 C4288378 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BA5C8 7F085A98 C72A0174 */ lwc1 $f10, 0x174($t9) -/* 0BA5CC 7F085A9C 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BA5D0 7F085AA0 24050001 */ li $a1, 1 -/* 0BA5D4 7F085AA4 46005102 */ mul.s $f4, $f10, $f0 -/* 0BA5D8 7F085AA8 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BA5DC 7F085AAC 46082182 */ mul.s $f6, $f4, $f8 -/* 0BA5E0 7F085AB0 46065100 */ add.s $f4, $f10, $f6 -/* 0BA5E4 7F085AB4 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0BA5E8 7F085AB8 E7A403B4 */ swc1 $f4, 0x3b4($sp) -/* 0BA5EC 7F085ABC 3C0A8008 */ lui $t2, %hi(g_EnterTankAudioState) -/* 0BA5F0 7F085AC0 8D4A99B8 */ lw $t2, %lo(g_EnterTankAudioState)($t2) -/* 0BA5F4 7F085AC4 24010002 */ li $at, 2 -/* 0BA5F8 7F085AC8 3C0D8005 */ lui $t5, %hi(g_ClockTimer) -/* 0BA5FC 7F085ACC 55410237 */ bnel $t2, $at, .L7F0863AC -/* 0BA600 7F085AD0 8E280000 */ lw $t0, ($s1) -/* 0BA604 7F085AD4 8DAD8374 */ lw $t5, %lo(g_ClockTimer)($t5) -/* 0BA608 7F085AD8 59A00234 */ blezl $t5, .L7F0863AC -/* 0BA60C 7F085ADC 8E280000 */ lw $t0, ($s1) -/* 0BA610 7F085AE0 8E280000 */ lw $t0, ($s1) -/* 0BA614 7F085AE4 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA618 7F085AE8 C42E8378 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BA61C 7F085AEC C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BA620 7F085AF0 C50A0408 */ lwc1 $f10, 0x408($t0) -/* 0BA624 7F085AF4 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BA628 7F085AF8 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BA62C 7F085AFC C5080410 */ lwc1 $f8, 0x410($t0) -/* 0BA630 7F085B00 46082281 */ sub.s $f10, $f4, $f8 -/* 0BA634 7F085B04 460E3003 */ div.s $f0, $f6, $f14 -/* 0BA638 7F085B08 460E5083 */ div.s $f2, $f10, $f14 -/* 0BA63C 7F085B0C 46000182 */ mul.s $f6, $f0, $f0 -/* 0BA640 7F085B10 00000000 */ nop -/* 0BA644 7F085B14 46021102 */ mul.s $f4, $f2, $f2 -/* 0BA648 7F085B18 0C007DF8 */ jal sqrtf -/* 0BA64C 7F085B1C 46043300 */ add.s $f12, $f6, $f4 -/* 0BA650 7F085B20 8E280000 */ lw $t0, ($s1) -/* 0BA654 7F085B24 46000086 */ mov.s $f2, $f0 -/* 0BA658 7F085B28 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0BA65C 7F085B2C 4614403C */ c.lt.s $f8, $f20 -/* 0BA660 7F085B30 00000000 */ nop -/* 0BA664 7F085B34 45000002 */ bc1f .L7F085B40 -/* 0BA668 7F085B38 00000000 */ nop -/* 0BA66C 7F085B3C 46000087 */ neg.s $f2, $f0 -.L7F085B40: -/* 0BA670 7F085B40 10000219 */ b .L7F0863A8 -/* 0BA674 7F085B44 E5020174 */ swc1 $f2, 0x174($t0) -.L7F085B48: -/* 0BA678 7F085B48 8E040000 */ lw $a0, ($s0) -/* 0BA67C 7F085B4C 50800019 */ beql $a0, $zero, .L7F085BB4 -/* 0BA680 7F085B50 8E040004 */ lw $a0, 4($s0) -/* 0BA684 7F085B54 0C00237C */ jal sndGetPlayingState -/* 0BA688 7F085B58 00000000 */ nop -/* 0BA68C 7F085B5C 10400014 */ beqz $v0, .L7F085BB0 -/* 0BA690 7F085B60 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 0BA694 7F085B64 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 0BA698 7F085B68 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) -/* 0BA69C 7F085B6C 244299B4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x664c -/* 0BA6A0 7F085B70 000F5940 */ sll $t3, $t7, 5 -/* 0BA6A4 7F085B74 016F5823 */ subu $t3, $t3, $t7 -/* 0BA6A8 7F085B78 8C4E0000 */ lw $t6, ($v0) -/* 0BA6AC 7F085B7C 000B5880 */ sll $t3, $t3, 2 -/* 0BA6B0 7F085B80 016F5821 */ addu $t3, $t3, $t7 -/* 0BA6B4 7F085B84 000B58C0 */ sll $t3, $t3, 3 -/* 0BA6B8 7F085B88 01CB3023 */ subu $a2, $t6, $t3 -/* 0BA6BC 7F085B8C 18C00006 */ blez $a2, .L7F085BA8 -/* 0BA6C0 7F085B90 AC460000 */ sw $a2, ($v0) -/* 0BA6C4 7F085B94 8E040000 */ lw $a0, ($s0) -/* 0BA6C8 7F085B98 0C002461 */ jal sndCreatePostEvent -/* 0BA6CC 7F085B9C 24050008 */ li $a1, 8 -/* 0BA6D0 7F085BA0 10000004 */ b .L7F085BB4 -/* 0BA6D4 7F085BA4 8E040004 */ lw $a0, 4($s0) -.L7F085BA8: -/* 0BA6D8 7F085BA8 0C002408 */ jal sndDeactivate -/* 0BA6DC 7F085BAC 8E040000 */ lw $a0, ($s0) -.L7F085BB0: -/* 0BA6E0 7F085BB0 8E040004 */ lw $a0, 4($s0) -.L7F085BB4: -/* 0BA6E4 7F085BB4 10800007 */ beqz $a0, .L7F085BD4 -/* 0BA6E8 7F085BB8 00000000 */ nop -/* 0BA6EC 7F085BBC 0C00237C */ jal sndGetPlayingState -/* 0BA6F0 7F085BC0 00000000 */ nop -/* 0BA6F4 7F085BC4 10400003 */ beqz $v0, .L7F085BD4 -/* 0BA6F8 7F085BC8 00000000 */ nop -/* 0BA6FC 7F085BCC 0C002408 */ jal sndDeactivate -/* 0BA700 7F085BD0 8E040004 */ lw $a0, 4($s0) -.L7F085BD4: -/* 0BA704 7F085BD4 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA708 7F085BD8 C42E8378 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BA70C 7F085BDC 3C018003 */ lui $at, %hi(g_BondMoveAnimationSetup + 36) -/* 0BA710 7F085BE0 C42A6AF4 */ lwc1 $f10, %lo(g_BondMoveAnimationSetup + 36)($at) -/* 0BA714 7F085BE4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0BA718 7F085BE8 44813000 */ mtc1 $at, $f6 -/* 0BA71C 7F085BEC 8E280000 */ lw $t0, ($s1) -/* 0BA720 7F085BF0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0BA724 7F085BF4 46065102 */ mul.s $f4, $f10, $f6 -/* 0BA728 7F085BF8 C508016C */ lwc1 $f8, 0x16c($t0) -/* 0BA72C 7F085BFC E7A8004C */ swc1 $f8, 0x4c($sp) -/* 0BA730 7F085C00 C7AA004C */ lwc1 $f10, 0x4c($sp) -/* 0BA734 7F085C04 460E2302 */ mul.s $f12, $f4, $f14 -/* 0BA738 7F085C08 00000000 */ nop -/* 0BA73C 7F085C0C 460C5182 */ mul.s $f6, $f10, $f12 -/* 0BA740 7F085C10 E7A603A0 */ swc1 $f6, 0x3a0($sp) -/* 0BA744 7F085C14 C5001274 */ lwc1 $f0, 0x1274($t0) -/* 0BA748 7F085C18 C50404A0 */ lwc1 $f4, 0x4a0($t0) -/* 0BA74C 7F085C1C C5061278 */ lwc1 $f6, 0x1278($t0) -/* 0BA750 7F085C20 46000207 */ neg.s $f8, $f0 -/* 0BA754 7F085C24 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0BA758 7F085C28 46082402 */ mul.s $f16, $f4, $f8 -/* 0BA75C 7F085C2C 46068101 */ sub.s $f4, $f16, $f6 -/* 0BA760 7F085C30 46005482 */ mul.s $f18, $f10, $f0 -/* 0BA764 7F085C34 E7A40220 */ swc1 $f4, 0x220($sp) -/* 0BA768 7F085C38 C508127C */ lwc1 $f8, 0x127c($t0) -/* 0BA76C 7F085C3C C7A60220 */ lwc1 $f6, 0x220($sp) -/* 0BA770 7F085C40 46089281 */ sub.s $f10, $f18, $f8 -/* 0BA774 7F085C44 46063102 */ mul.s $f4, $f6, $f6 -/* 0BA778 7F085C48 E7AA021C */ swc1 $f10, 0x21c($sp) -/* 0BA77C 7F085C4C C7A8021C */ lwc1 $f8, 0x21c($sp) -/* 0BA780 7F085C50 46084282 */ mul.s $f10, $f8, $f8 -/* 0BA784 7F085C54 460A2080 */ add.s $f2, $f4, $f10 -/* 0BA788 7F085C58 44812000 */ mtc1 $at, $f4 -/* 0BA78C 7F085C5C 00000000 */ nop -/* 0BA790 7F085C60 4602203E */ c.le.s $f4, $f2 -/* 0BA794 7F085C64 E7A20218 */ swc1 $f2, 0x218($sp) -/* 0BA798 7F085C68 45000008 */ bc1f .L7F085C8C -/* 0BA79C 7F085C6C 00000000 */ nop -/* 0BA7A0 7F085C70 3C018005 */ lui $at, %hi(D_80055230) -/* 0BA7A4 7F085C74 C4205230 */ lwc1 $f0, %lo(D_80055230)($at) -/* 0BA7A8 7F085C78 46003282 */ mul.s $f10, $f6, $f0 -/* 0BA7AC 7F085C7C 00000000 */ nop -/* 0BA7B0 7F085C80 46004102 */ mul.s $f4, $f8, $f0 -/* 0BA7B4 7F085C84 E7AA0220 */ swc1 $f10, 0x220($sp) -/* 0BA7B8 7F085C88 E7A4021C */ swc1 $f4, 0x21c($sp) -.L7F085C8C: -/* 0BA7BC 7F085C8C 3C018005 */ lui $at, %hi(D_80055234) -/* 0BA7C0 7F085C90 C4305234 */ lwc1 $f16, %lo(D_80055234)($at) -/* 0BA7C4 7F085C94 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 0BA7C8 7F085C98 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0BA7CC 7F085C9C C5020174 */ lwc1 $f2, 0x174($t0) -/* 0BA7D0 7F085CA0 46103002 */ mul.s $f0, $f6, $f16 -/* 0BA7D4 7F085CA4 4614003C */ c.lt.s $f0, $f20 -/* 0BA7D8 7F085CA8 46105302 */ mul.s $f12, $f10, $f16 -/* 0BA7DC 7F085CAC 45020003 */ bc1fl .L7F085CBC -/* 0BA7E0 7F085CB0 4614103C */ c.lt.s $f2, $f20 -/* 0BA7E4 7F085CB4 46000007 */ neg.s $f0, $f0 -/* 0BA7E8 7F085CB8 4614103C */ c.lt.s $f2, $f20 -.L7F085CBC: -/* 0BA7EC 7F085CBC 3C018005 */ lui $at, %hi(D_80055238) -/* 0BA7F0 7F085CC0 45020003 */ bc1fl .L7F085CD0 -/* 0BA7F4 7F085CC4 4614603C */ c.lt.s $f12, $f20 -/* 0BA7F8 7F085CC8 46001087 */ neg.s $f2, $f2 -/* 0BA7FC 7F085CCC 4614603C */ c.lt.s $f12, $f20 -.L7F085CD0: -/* 0BA800 7F085CD0 00000000 */ nop -/* 0BA804 7F085CD4 45020003 */ bc1fl .L7F085CE4 -/* 0BA808 7F085CD8 4600103C */ c.lt.s $f2, $f0 -/* 0BA80C 7F085CDC 46006307 */ neg.s $f12, $f12 -/* 0BA810 7F085CE0 4600103C */ c.lt.s $f2, $f0 -.L7F085CE4: -/* 0BA814 7F085CE4 E7A20398 */ swc1 $f2, 0x398($sp) -/* 0BA818 7F085CE8 45020003 */ bc1fl .L7F085CF8 -/* 0BA81C 7F085CEC C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BA820 7F085CF0 E7A00398 */ swc1 $f0, 0x398($sp) -/* 0BA824 7F085CF4 C7A80398 */ lwc1 $f8, 0x398($sp) -.L7F085CF8: -/* 0BA828 7F085CF8 460C403C */ c.lt.s $f8, $f12 -/* 0BA82C 7F085CFC 00000000 */ nop -/* 0BA830 7F085D00 45020003 */ bc1fl .L7F085D10 -/* 0BA834 7F085D04 C7A40218 */ lwc1 $f4, 0x218($sp) -/* 0BA838 7F085D08 E7AC0398 */ swc1 $f12, 0x398($sp) -/* 0BA83C 7F085D0C C7A40218 */ lwc1 $f4, 0x218($sp) -.L7F085D10: -/* 0BA840 7F085D10 C4265238 */ lwc1 $f6, %lo(D_80055238)($at) -/* 0BA844 7F085D14 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0BA848 7F085D18 44810000 */ mtc1 $at, $f0 -/* 0BA84C 7F085D1C 4604303E */ c.le.s $f6, $f4 -/* 0BA850 7F085D20 00000000 */ nop -/* 0BA854 7F085D24 45020008 */ bc1fl .L7F085D48 -/* 0BA858 7F085D28 C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BA85C 7F085D2C C7AA0398 */ lwc1 $f10, 0x398($sp) -/* 0BA860 7F085D30 4610503C */ c.lt.s $f10, $f16 -/* 0BA864 7F085D34 00000000 */ nop -/* 0BA868 7F085D38 45020003 */ bc1fl .L7F085D48 -/* 0BA86C 7F085D3C C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BA870 7F085D40 E7B00398 */ swc1 $f16, 0x398($sp) -/* 0BA874 7F085D44 C7A80398 */ lwc1 $f8, 0x398($sp) -.L7F085D48: -/* 0BA878 7F085D48 4608003E */ c.le.s $f0, $f8 -/* 0BA87C 7F085D4C 00000000 */ nop -/* 0BA880 7F085D50 4502000B */ bc1fl .L7F085D80 -/* 0BA884 7F085D54 C7AA0398 */ lwc1 $f10, 0x398($sp) -/* 0BA888 7F085D58 46004101 */ sub.s $f4, $f8, $f0 -/* 0BA88C 7F085D5C 3C014461 */ li $at, 0x44610000 # 900.000000 -/* 0BA890 7F085D60 44815000 */ mtc1 $at, $f10 -/* 0BA894 7F085D64 460E2182 */ mul.s $f6, $f4, $f14 -/* 0BA898 7F085D68 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BA89C 7F085D6C 460A3203 */ div.s $f8, $f6, $f10 -/* 0BA8A0 7F085D70 46082180 */ add.s $f6, $f4, $f8 -/* 0BA8A4 7F085D74 1000000A */ b .L7F085DA0 -/* 0BA8A8 7F085D78 E506019C */ swc1 $f6, 0x19c($t0) -/* 0BA8AC 7F085D7C C7AA0398 */ lwc1 $f10, 0x398($sp) -.L7F085D80: -/* 0BA8B0 7F085D80 3C018005 */ lui $at, %hi(D_8005523C) -/* 0BA8B4 7F085D84 C426523C */ lwc1 $f6, %lo(D_8005523C)($at) -/* 0BA8B8 7F085D88 460A0101 */ sub.s $f4, $f0, $f10 -/* 0BA8BC 7F085D8C 460E2202 */ mul.s $f8, $f4, $f14 -/* 0BA8C0 7F085D90 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BA8C4 7F085D94 46064283 */ div.s $f10, $f8, $f6 -/* 0BA8C8 7F085D98 460A2201 */ sub.s $f8, $f4, $f10 -/* 0BA8CC 7F085D9C E508019C */ swc1 $f8, 0x19c($t0) -.L7F085DA0: -/* 0BA8D0 7F085DA0 8E280000 */ lw $t0, ($s1) -/* 0BA8D4 7F085DA4 C500019C */ lwc1 $f0, 0x19c($t0) -/* 0BA8D8 7F085DA8 4614003C */ c.lt.s $f0, $f20 -/* 0BA8DC 7F085DAC 00000000 */ nop -/* 0BA8E0 7F085DB0 45020005 */ bc1fl .L7F085DC8 -/* 0BA8E4 7F085DB4 3C013F80 */ lui $at, 0x3f80 -/* 0BA8E8 7F085DB8 E514019C */ swc1 $f20, 0x19c($t0) -/* 0BA8EC 7F085DBC 1000000C */ b .L7F085DF0 -/* 0BA8F0 7F085DC0 8E280000 */ lw $t0, ($s1) -/* 0BA8F4 7F085DC4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F085DC8: -/* 0BA8F8 7F085DC8 44813000 */ mtc1 $at, $f6 -/* 0BA8FC 7F085DCC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA900 7F085DD0 4600303C */ c.lt.s $f6, $f0 -/* 0BA904 7F085DD4 00000000 */ nop -/* 0BA908 7F085DD8 45020006 */ bc1fl .L7F085DF4 -/* 0BA90C 7F085DDC C7AC0398 */ lwc1 $f12, 0x398($sp) -/* 0BA910 7F085DE0 44812000 */ mtc1 $at, $f4 -/* 0BA914 7F085DE4 00000000 */ nop -/* 0BA918 7F085DE8 E504019C */ swc1 $f4, 0x19c($t0) -/* 0BA91C 7F085DEC 8E280000 */ lw $t0, ($s1) -.L7F085DF0: -/* 0BA920 7F085DF0 C7AC0398 */ lwc1 $f12, 0x398($sp) -.L7F085DF4: -/* 0BA924 7F085DF4 C50E0174 */ lwc1 $f14, 0x174($t0) -/* 0BA928 7F085DF8 0FC202CD */ jal bondviewMoveAnimationTick -/* 0BA92C 7F085DFC 8FA603A0 */ lw $a2, 0x3a0($sp) -/* 0BA930 7F085E00 8E280000 */ lw $t0, ($s1) -/* 0BA934 7F085E04 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA938 7F085E08 C42E8378 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BA93C 7F085E0C C5020504 */ lwc1 $f2, 0x504($t0) -/* 0BA940 7F085E10 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0BA944 7F085E14 C50004FC */ lwc1 $f0, 0x4fc($t0) -/* 0BA948 7F085E18 C50604A0 */ lwc1 $f6, 0x4a0($t0) -/* 0BA94C 7F085E1C 460A1202 */ mul.s $f8, $f2, $f10 -/* 0BA950 7F085E20 00000000 */ nop -/* 0BA954 7F085E24 46060102 */ mul.s $f4, $f0, $f6 -/* 0BA958 7F085E28 46044281 */ sub.s $f10, $f8, $f4 -/* 0BA95C 7F085E2C C7A803AC */ lwc1 $f8, 0x3ac($sp) -/* 0BA960 7F085E30 460E5182 */ mul.s $f6, $f10, $f14 -/* 0BA964 7F085E34 46064100 */ add.s $f4, $f8, $f6 -/* 0BA968 7F085E38 E7A403AC */ swc1 $f4, 0x3ac($sp) -/* 0BA96C 7F085E3C C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0BA970 7F085E40 C5060498 */ lwc1 $f6, 0x498($t0) -/* 0BA974 7F085E44 460A1202 */ mul.s $f8, $f2, $f10 -/* 0BA978 7F085E48 00000000 */ nop -/* 0BA97C 7F085E4C 46060282 */ mul.s $f10, $f0, $f6 -/* 0BA980 7F085E50 460A4180 */ add.s $f6, $f8, $f10 -/* 0BA984 7F085E54 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BA988 7F085E58 460E3202 */ mul.s $f8, $f6, $f14 -/* 0BA98C 7F085E5C 46085180 */ add.s $f6, $f10, $f8 -/* 0BA990 7F085E60 C7AA0220 */ lwc1 $f10, 0x220($sp) -/* 0BA994 7F085E64 460A2200 */ add.s $f8, $f4, $f10 -/* 0BA998 7F085E68 C7A4021C */ lwc1 $f4, 0x21c($sp) -/* 0BA99C 7F085E6C E7A603B4 */ swc1 $f6, 0x3b4($sp) -/* 0BA9A0 7F085E70 46043280 */ add.s $f10, $f6, $f4 -/* 0BA9A4 7F085E74 E7A803AC */ swc1 $f8, 0x3ac($sp) -/* 0BA9A8 7F085E78 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0BA9AC 7F085E7C C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BA9B0 7F085E80 E7A80208 */ swc1 $f8, 0x208($sp) -/* 0BA9B4 7F085E84 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0BA9B8 7F085E88 E7A60204 */ swc1 $f6, 0x204($sp) -/* 0BA9BC 7F085E8C 8D0C0488 */ lw $t4, 0x488($t0) -/* 0BA9C0 7F085E90 0FC24406 */ jal get_debug_fast_bond_flag -/* 0BA9C4 7F085E94 AFAC0200 */ sw $t4, 0x200($sp) -/* 0BA9C8 7F085E98 50400021 */ beql $v0, $zero, .L7F085F20 -/* 0BA9CC 7F085E9C 8E390000 */ lw $t9, ($s1) -/* 0BA9D0 7F085EA0 8E280000 */ lw $t0, ($s1) -/* 0BA9D4 7F085EA4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0BA9D8 7F085EA8 44810000 */ mtc1 $at, $f0 -/* 0BA9DC 7F085EAC C5040498 */ lwc1 $f4, 0x498($t0) -/* 0BA9E0 7F085EB0 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BA9E4 7F085EB4 C50604A0 */ lwc1 $f6, 0x4a0($t0) -/* 0BA9E8 7F085EB8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BA9EC 7F085EBC 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BA9F0 7F085EC0 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0BA9F4 7F085EC4 C42E8378 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BA9F8 7F085EC8 46043282 */ mul.s $f10, $f6, $f4 -/* 0BA9FC 7F085ECC 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BAA00 7F085ED0 C7AA03AC */ lwc1 $f10, 0x3ac($sp) -/* 0BAA04 7F085ED4 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BAA08 7F085ED8 00000000 */ nop -/* 0BAA0C 7F085EDC 46002202 */ mul.s $f8, $f4, $f0 -/* 0BAA10 7F085EE0 46085180 */ add.s $f6, $f10, $f8 -/* 0BAA14 7F085EE4 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0BAA18 7F085EE8 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BAA1C 7F085EEC C50404A0 */ lwc1 $f4, 0x4a0($t0) -/* 0BAA20 7F085EF0 C5060498 */ lwc1 $f6, 0x498($t0) -/* 0BAA24 7F085EF4 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BAA28 7F085EF8 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0BAA2C 7F085EFC 46043282 */ mul.s $f10, $f6, $f4 -/* 0BAA30 7F085F00 460A4180 */ add.s $f6, $f8, $f10 -/* 0BAA34 7F085F04 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BAA38 7F085F08 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BAA3C 7F085F0C 00000000 */ nop -/* 0BAA40 7F085F10 46002202 */ mul.s $f8, $f4, $f0 -/* 0BAA44 7F085F14 46085180 */ add.s $f6, $f10, $f8 -/* 0BAA48 7F085F18 E7A603B4 */ swc1 $f6, 0x3b4($sp) -/* 0BAA4C 7F085F1C 8E390000 */ lw $t9, ($s1) -.L7F085F20: -/* 0BAA50 7F085F20 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BAA54 7F085F24 00002825 */ move $a1, $zero -/* 0BAA58 7F085F28 C7241274 */ lwc1 $f4, 0x1274($t9) -/* 0BAA5C 7F085F2C 4604A032 */ c.eq.s $f20, $f4 -/* 0BAA60 7F085F30 00000000 */ nop -/* 0BAA64 7F085F34 45000002 */ bc1f .L7F085F40 -/* 0BAA68 7F085F38 00000000 */ nop -/* 0BAA6C 7F085F3C 24050001 */ li $a1, 1 -.L7F085F40: -/* 0BAA70 7F085F40 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0BAA74 7F085F44 00000000 */ nop -/* 0BAA78 7F085F48 8E2A0000 */ lw $t2, ($s1) -/* 0BAA7C 7F085F4C 3C018005 */ lui $at, %hi(D_80055240) -/* 0BAA80 7F085F50 C4285240 */ lwc1 $f8, %lo(D_80055240)($at) -/* 0BAA84 7F085F54 C54A04B0 */ lwc1 $f10, 0x4b0($t2) -/* 0BAA88 7F085F58 27B001B4 */ addiu $s0, $sp, 0x1b4 -/* 0BAA8C 7F085F5C AFB00010 */ sw $s0, 0x10($sp) -/* 0BAA90 7F085F60 46085182 */ mul.s $f6, $f10, $f8 -/* 0BAA94 7F085F64 27A40200 */ addiu $a0, $sp, 0x200 -/* 0BAA98 7F085F68 8FA50208 */ lw $a1, 0x208($sp) -/* 0BAA9C 7F085F6C 8FA60204 */ lw $a2, 0x204($sp) -/* 0BAAA0 7F085F70 44073000 */ mfc1 $a3, $f6 -/* 0BAAA4 7F085F74 0FC2C8C5 */ jal stanTileDistanceRelated -/* 0BAAA8 7F085F78 00000000 */ nop -/* 0BAAAC 7F085F7C 0FC2C8E9 */ jal stanGetLocusCount -/* 0BAAB0 7F085F80 02002025 */ move $a0, $s0 -/* 0BAAB4 7F085F84 10400002 */ beqz $v0, .L7F085F90 -/* 0BAAB8 7F085F88 240D0001 */ li $t5, 1 -/* 0BAABC 7F085F8C AFAD0394 */ sw $t5, 0x394($sp) -.L7F085F90: -/* 0BAAC0 7F085F90 8E280000 */ lw $t0, ($s1) -/* 0BAAC4 7F085F94 3C018005 */ lui $at, %hi(D_80055244) -/* 0BAAC8 7F085F98 C42A5244 */ lwc1 $f10, %lo(D_80055244)($at) -/* 0BAACC 7F085F9C C50404B0 */ lwc1 $f4, 0x4b0($t0) -/* 0BAAD0 7F085FA0 8D05048C */ lw $a1, 0x48c($t0) -/* 0BAAD4 7F085FA4 8D060494 */ lw $a2, 0x494($t0) -/* 0BAAD8 7F085FA8 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BAADC 7F085FAC AFB00010 */ sw $s0, 0x10($sp) -/* 0BAAE0 7F085FB0 25040488 */ addiu $a0, $t0, 0x488 -/* 0BAAE4 7F085FB4 44074000 */ mfc1 $a3, $f8 -/* 0BAAE8 7F085FB8 0FC2C8C5 */ jal stanTileDistanceRelated -/* 0BAAEC 7F085FBC 00000000 */ nop -/* 0BAAF0 7F085FC0 0FC2C8E9 */ jal stanGetLocusCount -/* 0BAAF4 7F085FC4 02002025 */ move $a0, $s0 -/* 0BAAF8 7F085FC8 10400002 */ beqz $v0, .L7F085FD4 -/* 0BAAFC 7F085FCC 240F0001 */ li $t7, 1 -/* 0BAB00 7F085FD0 AFAF0394 */ sw $t7, 0x394($sp) -.L7F085FD4: -/* 0BAB04 7F085FD4 8E280000 */ lw $t0, ($s1) -/* 0BAB08 7F085FD8 8D05048C */ lw $a1, 0x48c($t0) -/* 0BAB0C 7F085FDC 8D060494 */ lw $a2, 0x494($t0) -/* 0BAB10 7F085FE0 8D0704B0 */ lw $a3, 0x4b0($t0) -/* 0BAB14 7F085FE4 AFB00010 */ sw $s0, 0x10($sp) -/* 0BAB18 7F085FE8 0FC2C8C5 */ jal stanTileDistanceRelated -/* 0BAB1C 7F085FEC 25040488 */ addiu $a0, $t0, 0x488 -/* 0BAB20 7F085FF0 0FC2C8E9 */ jal stanGetLocusCount -/* 0BAB24 7F085FF4 02002025 */ move $a0, $s0 -/* 0BAB28 7F085FF8 1440000D */ bnez $v0, .L7F086030 -/* 0BAB2C 7F085FFC 00000000 */ nop -/* 0BAB30 7F086000 8E2E0000 */ lw $t6, ($s1) -/* 0BAB34 7F086004 3C018005 */ lui $at, %hi(D_80055248) -/* 0BAB38 7F086008 C4245248 */ lwc1 $f4, %lo(D_80055248)($at) -/* 0BAB3C 7F08600C C5C604B0 */ lwc1 $f6, 0x4b0($t6) -/* 0BAB40 7F086010 AFB00010 */ sw $s0, 0x10($sp) -/* 0BAB44 7F086014 27A40200 */ addiu $a0, $sp, 0x200 -/* 0BAB48 7F086018 46043282 */ mul.s $f10, $f6, $f4 -/* 0BAB4C 7F08601C 8FA50208 */ lw $a1, 0x208($sp) -/* 0BAB50 7F086020 8FA60204 */ lw $a2, 0x204($sp) -/* 0BAB54 7F086024 44075000 */ mfc1 $a3, $f10 -/* 0BAB58 7F086028 0FC2C8C5 */ jal stanTileDistanceRelated -/* 0BAB5C 7F08602C 00000000 */ nop -.L7F086030: -/* 0BAB60 7F086030 0FC2C8E9 */ jal stanGetLocusCount -/* 0BAB64 7F086034 02002025 */ move $a0, $s0 -/* 0BAB68 7F086038 104000B8 */ beqz $v0, .L7F08631C -/* 0BAB6C 7F08603C 240B0001 */ li $t3, 1 -/* 0BAB70 7F086040 AFAB0394 */ sw $t3, 0x394($sp) -/* 0BAB74 7F086044 27A40174 */ addiu $a0, $sp, 0x174 -/* 0BAB78 7F086048 27A50170 */ addiu $a1, $sp, 0x170 -/* 0BAB7C 7F08604C 0FC2C908 */ jal stanGetMoveBondCollisionTiles -/* 0BAB80 7F086050 27A60184 */ addiu $a2, $sp, 0x184 -/* 0BAB84 7F086054 8E380000 */ lw $t8, ($s1) -/* 0BAB88 7F086058 C7A801A0 */ lwc1 $f8, 0x1a0($sp) -/* 0BAB8C 7F08605C C7060074 */ lwc1 $f6, 0x74($t8) -/* 0BAB90 7F086060 4608303E */ c.le.s $f6, $f8 -/* 0BAB94 7F086064 C7A80198 */ lwc1 $f8, 0x198($sp) -/* 0BAB98 7F086068 C7A6018C */ lwc1 $f6, 0x18c($sp) -/* 0BAB9C 7F08606C 450200AC */ bc1fl .L7F086320 -/* 0BABA0 7F086070 8E280000 */ lw $t0, ($s1) -/* 0BABA4 7F086074 C7A40184 */ lwc1 $f4, 0x184($sp) -/* 0BABA8 7F086078 C7AA0190 */ lwc1 $f10, 0x190($sp) -/* 0BABAC 7F08607C 46064381 */ sub.s $f14, $f8, $f6 -/* 0BABB0 7F086080 460A2081 */ sub.s $f2, $f4, $f10 -/* 0BABB4 7F086084 460E7102 */ mul.s $f4, $f14, $f14 -/* 0BABB8 7F086088 E7AE016C */ swc1 $f14, 0x16c($sp) -/* 0BABBC 7F08608C 46021282 */ mul.s $f10, $f2, $f2 -/* 0BABC0 7F086090 E7A20168 */ swc1 $f2, 0x168($sp) -/* 0BABC4 7F086094 0C007DF8 */ jal sqrtf -/* 0BABC8 7F086098 460A2300 */ add.s $f12, $f4, $f10 -/* 0BABCC 7F08609C C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0BABD0 7F0860A0 C7AE016C */ lwc1 $f14, 0x16c($sp) -/* 0BABD4 7F0860A4 C7A80204 */ lwc1 $f8, 0x204($sp) -/* 0BABD8 7F0860A8 46001083 */ div.s $f2, $f2, $f0 -/* 0BABDC 7F0860AC C7A6018C */ lwc1 $f6, 0x18c($sp) -/* 0BABE0 7F0860B0 E7A80030 */ swc1 $f8, 0x30($sp) -/* 0BABE4 7F0860B4 46064101 */ sub.s $f4, $f8, $f6 -/* 0BABE8 7F0860B8 C7A80184 */ lwc1 $f8, 0x184($sp) -/* 0BABEC 7F0860BC E7A60034 */ swc1 $f6, 0x34($sp) -/* 0BABF0 7F0860C0 46007383 */ div.s $f14, $f14, $f0 -/* 0BABF4 7F0860C4 46022282 */ mul.s $f10, $f4, $f2 -/* 0BABF8 7F0860C8 C7A40208 */ lwc1 $f4, 0x208($sp) -/* 0BABFC 7F0860CC 46082181 */ sub.s $f6, $f4, $f8 -/* 0BAC00 7F0860D0 460E3182 */ mul.s $f6, $f6, $f14 -/* 0BAC04 7F0860D4 46065300 */ add.s $f12, $f10, $f6 -/* 0BAC08 7F0860D8 C7A60030 */ lwc1 $f6, 0x30($sp) -/* 0BAC0C 7F0860DC C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BAC10 7F0860E0 E7AC0050 */ swc1 $f12, 0x50($sp) -/* 0BAC14 7F0860E4 460A3180 */ add.s $f6, $f6, $f10 -/* 0BAC18 7F0860E8 C7AA0034 */ lwc1 $f10, 0x34($sp) -/* 0BAC1C 7F0860EC 460A3181 */ sub.s $f6, $f6, $f10 -/* 0BAC20 7F0860F0 46023282 */ mul.s $f10, $f6, $f2 -/* 0BAC24 7F0860F4 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BAC28 7F0860F8 46062100 */ add.s $f4, $f4, $f6 -/* 0BAC2C 7F0860FC 46082181 */ sub.s $f6, $f4, $f8 -/* 0BAC30 7F086100 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BAC34 7F086104 46045480 */ add.s $f18, $f10, $f4 -/* 0BAC38 7F086108 C7A403B4 */ lwc1 $f4, 0x3b4($sp) -/* 0BAC3C 7F08610C 46126202 */ mul.s $f8, $f12, $f18 -/* 0BAC40 7F086110 46009406 */ mov.s $f16, $f18 -/* 0BAC44 7F086114 4614403E */ c.le.s $f8, $f20 -/* 0BAC48 7F086118 46042202 */ mul.s $f8, $f4, $f4 -/* 0BAC4C 7F08611C 45020004 */ bc1fl .L7F086130 -/* 0BAC50 7F086120 4614903C */ c.lt.s $f18, $f20 -/* 0BAC54 7F086124 1000001F */ b .L7F0861A4 -/* 0BAC58 7F086128 4600A386 */ mov.s $f14, $f20 -/* 0BAC5C 7F08612C 4614903C */ c.lt.s $f18, $f20 -.L7F086130: -/* 0BAC60 7F086130 00000000 */ nop -/* 0BAC64 7F086134 45020005 */ bc1fl .L7F08614C -/* 0BAC68 7F086138 4610603E */ c.le.s $f12, $f16 -/* 0BAC6C 7F08613C C7AC0050 */ lwc1 $f12, 0x50($sp) -/* 0BAC70 7F086140 46009407 */ neg.s $f16, $f18 -/* 0BAC74 7F086144 46006307 */ neg.s $f12, $f12 -/* 0BAC78 7F086148 4610603E */ c.le.s $f12, $f16 -.L7F08614C: -/* 0BAC7C 7F08614C 00000000 */ nop -/* 0BAC80 7F086150 45020004 */ bc1fl .L7F086164 -/* 0BAC84 7F086154 8E2C0000 */ lw $t4, ($s1) -/* 0BAC88 7F086158 10000012 */ b .L7F0861A4 -/* 0BAC8C 7F08615C 4600A386 */ mov.s $f14, $f20 -/* 0BAC90 7F086160 8E2C0000 */ lw $t4, ($s1) -.L7F086164: -/* 0BAC94 7F086164 C58004B0 */ lwc1 $f0, 0x4b0($t4) -/* 0BAC98 7F086168 4610003C */ c.lt.s $f0, $f16 -/* 0BAC9C 7F08616C 00000000 */ nop -/* 0BACA0 7F086170 45020004 */ bc1fl .L7F086184 -/* 0BACA4 7F086174 4600603C */ c.lt.s $f12, $f0 -/* 0BACA8 7F086178 1000000A */ b .L7F0861A4 -/* 0BACAC 7F08617C 4600A386 */ mov.s $f14, $f20 -/* 0BACB0 7F086180 4600603C */ c.lt.s $f12, $f0 -.L7F086184: -/* 0BACB4 7F086184 00000000 */ nop -/* 0BACB8 7F086188 45020004 */ bc1fl .L7F08619C -/* 0BACBC 7F08618C 46006181 */ sub.s $f6, $f12, $f0 -/* 0BACC0 7F086190 10000004 */ b .L7F0861A4 -/* 0BACC4 7F086194 4600A386 */ mov.s $f14, $f20 -/* 0BACC8 7F086198 46006181 */ sub.s $f6, $f12, $f0 -.L7F08619C: -/* 0BACCC 7F08619C 46106281 */ sub.s $f10, $f12, $f16 -/* 0BACD0 7F0861A0 460A3383 */ div.s $f14, $f6, $f10 -.L7F0861A4: -/* 0BACD4 7F0861A4 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BACD8 7F0861A8 E7AE0180 */ swc1 $f14, 0x180($sp) -/* 0BACDC 7F0861AC 46063282 */ mul.s $f10, $f6, $f6 -/* 0BACE0 7F0861B0 0C007DF8 */ jal sqrtf -/* 0BACE4 7F0861B4 460A4300 */ add.s $f12, $f8, $f10 -/* 0BACE8 7F0861B8 4600A03C */ c.lt.s $f20, $f0 -/* 0BACEC 7F0861BC C7AE0180 */ lwc1 $f14, 0x180($sp) -/* 0BACF0 7F0861C0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BACF4 7F0861C4 4502001B */ bc1fl .L7F086234 -/* 0BACF8 7F0861C8 C7A6019C */ lwc1 $f6, 0x19c($sp) -/* 0BACFC 7F0861CC 44812000 */ mtc1 $at, $f4 -/* 0BAD00 7F0861D0 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0BAD04 7F0861D4 44814000 */ mtc1 $at, $f8 -/* 0BAD08 7F0861D8 460E2181 */ sub.s $f6, $f4, $f14 -/* 0BAD0C 7F0861DC 8E390000 */ lw $t9, ($s1) -/* 0BAD10 7F0861E0 C7A401A0 */ lwc1 $f4, 0x1a0($sp) -/* 0BAD14 7F0861E4 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0BAD18 7F0861E8 46003082 */ mul.s $f2, $f6, $f0 -/* 0BAD1C 7F0861EC 00000000 */ nop -/* 0BAD20 7F0861F0 46081302 */ mul.s $f12, $f2, $f8 -/* 0BAD24 7F0861F4 E7AC0390 */ swc1 $f12, 0x390($sp) -/* 0BAD28 7F0861F8 C7320074 */ lwc1 $f18, 0x74($t9) -/* 0BAD2C 7F0861FC 460C9280 */ add.s $f10, $f18, $f12 -/* 0BAD30 7F086200 460A203E */ c.le.s $f4, $f10 -/* 0BAD34 7F086204 00000000 */ nop -/* 0BAD38 7F086208 45000009 */ bc1f .L7F086230 -/* 0BAD3C 7F08620C 00000000 */ nop -/* 0BAD40 7F086210 46122181 */ sub.s $f6, $f4, $f18 -/* 0BAD44 7F086214 44814000 */ mtc1 $at, $f8 -/* 0BAD48 7F086218 00000000 */ nop -/* 0BAD4C 7F08621C 46083283 */ div.s $f10, $f6, $f8 -/* 0BAD50 7F086220 E7A60390 */ swc1 $f6, 0x390($sp) -/* 0BAD54 7F086224 460A1401 */ sub.s $f16, $f2, $f10 -/* 0BAD58 7F086228 46008103 */ div.s $f4, $f16, $f0 -/* 0BAD5C 7F08622C 46047380 */ add.s $f14, $f14, $f4 -.L7F086230: -/* 0BAD60 7F086230 C7A6019C */ lwc1 $f6, 0x19c($sp) -.L7F086234: -/* 0BAD64 7F086234 C7A80184 */ lwc1 $f8, 0x184($sp) -/* 0BAD68 7F086238 C7AA01A4 */ lwc1 $f10, 0x1a4($sp) -/* 0BAD6C 7F08623C C7A4018C */ lwc1 $f4, 0x18c($sp) -/* 0BAD70 7F086240 46083301 */ sub.s $f12, $f6, $f8 -/* 0BAD74 7F086244 C7A601A8 */ lwc1 $f6, 0x1a8($sp) -/* 0BAD78 7F086248 8E280000 */ lw $t0, ($s1) -/* 0BAD7C 7F08624C 46045401 */ sub.s $f16, $f10, $f4 -/* 0BAD80 7F086250 C7AA01B0 */ lwc1 $f10, 0x1b0($sp) -/* 0BAD84 7F086254 46083481 */ sub.s $f18, $f6, $f8 -/* 0BAD88 7F086258 46045181 */ sub.s $f6, $f10, $f4 -/* 0BAD8C 7F08625C 46129202 */ mul.s $f8, $f18, $f18 -/* 0BAD90 7F086260 00000000 */ nop -/* 0BAD94 7F086264 46063282 */ mul.s $f10, $f6, $f6 -/* 0BAD98 7F086268 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0BAD9C 7F08626C 460A4100 */ add.s $f4, $f8, $f10 -/* 0BADA0 7F086270 460C6202 */ mul.s $f8, $f12, $f12 -/* 0BADA4 7F086274 00000000 */ nop -/* 0BADA8 7F086278 46108282 */ mul.s $f10, $f16, $f16 -/* 0BADAC 7F08627C 460A4200 */ add.s $f8, $f8, $f10 -/* 0BADB0 7F086280 C7AA01A0 */ lwc1 $f10, 0x1a0($sp) -/* 0BADB4 7F086284 4608203C */ c.lt.s $f4, $f8 -/* 0BADB8 7F086288 C7A40188 */ lwc1 $f4, 0x188($sp) -/* 0BADBC 7F08628C 45000003 */ bc1f .L7F08629C -/* 0BADC0 7F086290 46045201 */ sub.s $f8, $f10, $f4 -/* 0BADC4 7F086294 46009306 */ mov.s $f12, $f18 -/* 0BADC8 7F086298 46003406 */ mov.s $f16, $f6 -.L7F08629C: -/* 0BADCC 7F08629C C7A60390 */ lwc1 $f6, 0x390($sp) -/* 0BADD0 7F0862A0 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0BADD4 7F0862A4 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BADD8 7F0862A8 46083003 */ div.s $f0, $f6, $f8 -/* 0BADDC 7F0862AC 00002825 */ move $a1, $zero -/* 0BADE0 7F0862B0 460C0282 */ mul.s $f10, $f0, $f12 -/* 0BADE4 7F0862B4 00000000 */ nop -/* 0BADE8 7F0862B8 460E2182 */ mul.s $f6, $f4, $f14 -/* 0BADEC 7F0862BC 46065200 */ add.s $f8, $f10, $f6 -/* 0BADF0 7F0862C0 46100102 */ mul.s $f4, $f0, $f16 -/* 0BADF4 7F0862C4 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BADF8 7F0862C8 E7A803AC */ swc1 $f8, 0x3ac($sp) -/* 0BADFC 7F0862CC 460E5182 */ mul.s $f6, $f10, $f14 -/* 0BAE00 7F0862D0 C7AA0208 */ lwc1 $f10, 0x208($sp) -/* 0BAE04 7F0862D4 46062200 */ add.s $f8, $f4, $f6 -/* 0BAE08 7F0862D8 E7A803B4 */ swc1 $f8, 0x3b4($sp) -/* 0BAE0C 7F0862DC E50A048C */ swc1 $f10, 0x48c($t0) -/* 0BAE10 7F0862E0 8E2A0000 */ lw $t2, ($s1) -/* 0BAE14 7F0862E4 C7A40204 */ lwc1 $f4, 0x204($sp) -/* 0BAE18 7F0862E8 E5440494 */ swc1 $f4, 0x494($t2) -/* 0BAE1C 7F0862EC 8E2F0000 */ lw $t7, ($s1) -/* 0BAE20 7F0862F0 8FAD0200 */ lw $t5, 0x200($sp) -/* 0BAE24 7F0862F4 ADED0488 */ sw $t5, 0x488($t7) -/* 0BAE28 7F0862F8 8E2E0000 */ lw $t6, ($s1) -/* 0BAE2C 7F0862FC C5C61274 */ lwc1 $f6, 0x1274($t6) -/* 0BAE30 7F086300 4606A032 */ c.eq.s $f20, $f6 -/* 0BAE34 7F086304 00000000 */ nop -/* 0BAE38 7F086308 45000002 */ bc1f .L7F086314 -/* 0BAE3C 7F08630C 00000000 */ nop -/* 0BAE40 7F086310 24050001 */ li $a1, 1 -.L7F086314: -/* 0BAE44 7F086314 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0BAE48 7F086318 00000000 */ nop -.L7F08631C: -/* 0BAE4C 7F08631C 8E280000 */ lw $t0, ($s1) -.L7F086320: -/* 0BAE50 7F086320 C7AA0208 */ lwc1 $f10, 0x208($sp) -/* 0BAE54 7F086324 C7A60204 */ lwc1 $f6, 0x204($sp) -/* 0BAE58 7F086328 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BAE5C 7F08632C C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BAE60 7F086330 460A4081 */ sub.s $f2, $f8, $f10 -/* 0BAE64 7F086334 C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0BAE68 7F086338 46062381 */ sub.s $f14, $f4, $f6 -/* 0BAE6C 7F08633C 46084282 */ mul.s $f10, $f8, $f8 -/* 0BAE70 7F086340 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0BAE74 7F086344 46042182 */ mul.s $f6, $f4, $f4 -/* 0BAE78 7F086348 46065000 */ add.s $f0, $f10, $f6 -/* 0BAE7C 7F08634C 46140032 */ c.eq.s $f0, $f20 -/* 0BAE80 7F086350 46000306 */ mov.s $f12, $f0 -/* 0BAE84 7F086354 45010006 */ bc1t .L7F086370 -/* 0BAE88 7F086358 00000000 */ nop -/* 0BAE8C 7F08635C 46021202 */ mul.s $f8, $f2, $f2 -/* 0BAE90 7F086360 00000000 */ nop -/* 0BAE94 7F086364 460E7102 */ mul.s $f4, $f14, $f14 -/* 0BAE98 7F086368 46044280 */ add.s $f10, $f8, $f4 -/* 0BAE9C 7F08636C 46005303 */ div.s $f12, $f10, $f0 -.L7F086370: -/* 0BAEA0 7F086370 0C007DF8 */ jal sqrtf -/* 0BAEA4 7F086374 00000000 */ nop -/* 0BAEA8 7F086378 C7A80220 */ lwc1 $f8, 0x220($sp) -/* 0BAEAC 7F08637C 8E280000 */ lw $t0, ($s1) -/* 0BAEB0 7F086380 46080102 */ mul.s $f4, $f0, $f8 -/* 0BAEB4 7F086384 C5061278 */ lwc1 $f6, 0x1278($t0) -/* 0BAEB8 7F086388 46043280 */ add.s $f10, $f6, $f4 -/* 0BAEBC 7F08638C E50A1278 */ swc1 $f10, 0x1278($t0) -/* 0BAEC0 7F086390 C7A6021C */ lwc1 $f6, 0x21c($sp) -/* 0BAEC4 7F086394 8E280000 */ lw $t0, ($s1) -/* 0BAEC8 7F086398 46060102 */ mul.s $f4, $f0, $f6 -/* 0BAECC 7F08639C C508127C */ lwc1 $f8, 0x127c($t0) -/* 0BAED0 7F0863A0 46044280 */ add.s $f10, $f8, $f4 -/* 0BAED4 7F0863A4 E50A127C */ swc1 $f10, 0x127c($t0) -.L7F0863A8: -/* 0BAED8 7F0863A8 8E280000 */ lw $t0, ($s1) -.L7F0863AC: -/* 0BAEDC 7F0863AC 3C018005 */ lui $at, %hi(D_8005524C) -/* 0BAEE0 7F0863B0 C428524C */ lwc1 $f8, %lo(D_8005524C)($at) -/* 0BAEE4 7F0863B4 C5060160 */ lwc1 $f6, 0x160($t0) -/* 0BAEE8 7F0863B8 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0BAEEC 7F0863BC C50A00A4 */ lwc1 $f10, 0xa4($t0) -/* 0BAEF0 7F0863C0 46083103 */ div.s $f4, $f6, $f8 -/* 0BAEF4 7F0863C4 44813000 */ mtc1 $at, $f6 -/* 0BAEF8 7F0863C8 C514014C */ lwc1 $f20, 0x14c($t0) -/* 0BAEFC 7F0863CC 46065203 */ div.s $f8, $f10, $f6 -/* 0BAF00 7F0863D0 46082080 */ add.s $f2, $f4, $f8 -/* 0BAF04 7F0863D4 0FC23ABE */ jal bheadGetBreathingValue -/* 0BAF08 7F0863D8 E7A20144 */ swc1 $f2, 0x144($sp) -/* 0BAF0C 7F0863DC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BAF10 7F0863E0 44817000 */ mtc1 $at, $f14 -/* 0BAF14 7F0863E4 C7A20144 */ lwc1 $f2, 0x144($sp) -/* 0BAF18 7F0863E8 4407A000 */ mfc1 $a3, $f20 -/* 0BAF1C 7F0863EC 46000306 */ mov.s $f12, $f0 -/* 0BAF20 7F0863F0 4602703C */ c.lt.s $f14, $f2 -/* 0BAF24 7F0863F4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0BAF28 7F0863F8 45020004 */ bc1fl .L7F08640C -/* 0BAF2C 7F0863FC 44817000 */ mtc1 $at, $f14 -/* 0BAF30 7F086400 10000008 */ b .L7F086424 -/* 0BAF34 7F086404 46007086 */ mov.s $f2, $f14 -/* 0BAF38 7F086408 44817000 */ mtc1 $at, $f14 -.L7F08640C: -/* 0BAF3C 7F08640C 00000000 */ nop -/* 0BAF40 7F086410 460E103C */ c.lt.s $f2, $f14 -/* 0BAF44 7F086414 00000000 */ nop -/* 0BAF48 7F086418 45020003 */ bc1fl .L7F086428 -/* 0BAF4C 7F08641C 8E2B0000 */ lw $t3, ($s1) -/* 0BAF50 7F086420 46007086 */ mov.s $f2, $f14 -.L7F086424: -/* 0BAF54 7F086424 8E2B0000 */ lw $t3, ($s1) -.L7F086428: -/* 0BAF58 7F086428 24010001 */ li $at, 1 -/* 0BAF5C 7F08642C 44061000 */ mfc1 $a2, $f2 -/* 0BAF60 7F086430 8D7804E8 */ lw $t8, 0x4e8($t3) -/* 0BAF64 7F086434 17010004 */ bne $t8, $at, .L7F086448 -/* 0BAF68 7F086438 3C018005 */ lui $at, %hi(D_80055250) -/* 0BAF6C 7F08643C C42A5250 */ lwc1 $f10, %lo(D_80055250)($at) -/* 0BAF70 7F086440 460A0302 */ mul.s $f12, $f0, $f10 -/* 0BAF74 7F086444 00000000 */ nop -.L7F086448: -/* 0BAF78 7F086448 0FC17839 */ jal gunSetBondWeaponSway -/* 0BAF7C 7F08644C C7AE0398 */ lwc1 $f14, 0x398($sp) -/* 0BAF80 7F086450 8E2C0000 */ lw $t4, ($s1) -/* 0BAF84 7F086454 3C018005 */ lui $at, %hi(D_80055254) -/* 0BAF88 7F086458 C4245254 */ lwc1 $f4, %lo(D_80055254)($at) -/* 0BAF8C 7F08645C C586015C */ lwc1 $f6, 0x15c($t4) -/* 0BAF90 7F086460 46043302 */ mul.s $f12, $f6, $f4 -/* 0BAF94 7F086464 0FC1797C */ jal gunSetOffsetRelated -/* 0BAF98 7F086468 00000000 */ nop -/* 0BAF9C 7F08646C 3C038003 */ lui $v1, %hi(ptr_playerstank) -/* 0BAFA0 7F086470 8C636450 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0BAFA4 7F086474 3C198003 */ lui $t9, %hi(in_tank_flag) -/* 0BAFA8 7F086478 5060012F */ beql $v1, $zero, .L7F086938 -/* 0BAFAC 7F08647C 8FA40394 */ lw $a0, 0x394($sp) -/* 0BAFB0 7F086480 8F396448 */ lw $t9, %lo(in_tank_flag)($t9) -/* 0BAFB4 7F086484 24010001 */ li $at, 1 -/* 0BAFB8 7F086488 3C0A8008 */ lui $t2, %hi(g_EnterTankAudioState) -/* 0BAFBC 7F08648C 5721012A */ bnel $t9, $at, .L7F086938 -/* 0BAFC0 7F086490 8FA40394 */ lw $a0, 0x394($sp) -/* 0BAFC4 7F086494 8D4A99B8 */ lw $t2, %lo(g_EnterTankAudioState)($t2) -/* 0BAFC8 7F086498 24010002 */ li $at, 2 -/* 0BAFCC 7F08649C 55410126 */ bnel $t2, $at, .L7F086938 -/* 0BAFD0 7F0864A0 8FA40394 */ lw $a0, 0x394($sp) -/* 0BAFD4 7F0864A4 8C620004 */ lw $v0, 4($v1) -/* 0BAFD8 7F0864A8 00002025 */ move $a0, $zero -/* 0BAFDC 7F0864AC AFA20138 */ sw $v0, 0x138($sp) -/* 0BAFE0 7F0864B0 8C4D0014 */ lw $t5, 0x14($v0) -/* 0BAFE4 7F0864B4 00408025 */ move $s0, $v0 -/* 0BAFE8 7F0864B8 8DAF0008 */ lw $t7, 8($t5) -/* 0BAFEC 7F0864BC 8DEE0008 */ lw $t6, 8($t7) -/* 0BAFF0 7F0864C0 8DCB0014 */ lw $t3, 0x14($t6) -/* 0BAFF4 7F0864C4 8D780004 */ lw $t8, 4($t3) -/* 0BAFF8 7F0864C8 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0BAFFC 7F0864CC AFB80130 */ sw $t8, 0x130($sp) -/* 0BB000 7F0864D0 38430020 */ xori $v1, $v0, 0x20 -/* 0BB004 7F0864D4 2C640001 */ sltiu $a0, $v1, 1 -/* 0BB008 7F0864D8 50800005 */ beql $a0, $zero, .L7F0864F0 -/* 0BB00C 7F0864DC AE0400C4 */ sw $a0, 0xc4($s0) -/* 0BB010 7F0864E0 0FC17722 */ jal get_hands_firing_status -/* 0BB014 7F0864E4 00002025 */ move $a0, $zero -/* 0BB018 7F0864E8 0002202B */ sltu $a0, $zero, $v0 -/* 0BB01C 7F0864EC AE0400C4 */ sw $a0, 0xc4($s0) -.L7F0864F0: -/* 0BB020 7F0864F0 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) -/* 0BB024 7F0864F4 C428646C */ lwc1 $f8, %lo(g_TankTurretVerticalAngle)($at) -/* 0BB028 7F0864F8 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) -/* 0BB02C 7F0864FC 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0BB030 7F086500 E60800C8 */ swc1 $f8, 0xc8($s0) -/* 0BB034 7F086504 C42A6474 */ lwc1 $f10, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BB038 7F086508 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0BB03C 7F08650C E60A00CC */ swc1 $f10, 0xcc($s0) -/* 0BB040 7F086510 C4266464 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0BB044 7F086514 3C018005 */ lui $at, %hi(D_80055258) -/* 0BB048 7F086518 E60600DC */ swc1 $f6, 0xdc($s0) -/* 0BB04C 7F08651C C4245258 */ lwc1 $f4, %lo(D_80055258)($at) -/* 0BB050 7F086520 3C018003 */ lui $at, %hi(g_TankOrientationAngle) -/* 0BB054 7F086524 C4286464 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0BB058 7F086528 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 0BB05C 7F08652C 46082301 */ sub.s $f12, $f4, $f8 -/* 0BB060 7F086530 8FAC0138 */ lw $t4, 0x138($sp) -/* 0BB064 7F086534 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0BB068 7F086538 8D990014 */ lw $t9, 0x14($t4) -/* 0BB06C 7F08653C 0FC1629F */ jal matrix_scalar_multiply -/* 0BB070 7F086540 C72C0014 */ lwc1 $f12, 0x14($t9) -/* 0BB074 7F086544 3C018008 */ lui $at, %hi(flt_CODE_bss_800799A8 + 4) -/* 0BB078 7F086548 C42A99A8 */ lwc1 $f10, %lo(flt_CODE_bss_800799A8)($at) -/* 0BB07C 7F08654C C42499AC */ lwc1 $f4, %lo(flt_CODE_bss_800799A8 + 4)($at) -/* 0BB080 7F086550 3C018008 */ lui $at, %hi(flt_CODE_bss_800799A8 + 8) -/* 0BB084 7F086554 46005187 */ neg.s $f6, $f10 -/* 0BB088 7F086558 C42A99B0 */ lwc1 $f10, %lo(flt_CODE_bss_800799A8 + 8)($at) -/* 0BB08C 7F08655C E7A600E4 */ swc1 $f6, 0xe4($sp) -/* 0BB090 7F086560 46002207 */ neg.s $f8, $f4 -/* 0BB094 7F086564 46005187 */ neg.s $f6, $f10 -/* 0BB098 7F086568 E7A800E8 */ swc1 $f8, 0xe8($sp) -/* 0BB09C 7F08656C E7A600EC */ swc1 $f6, 0xec($sp) -/* 0BB0A0 7F086570 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0BB0A4 7F086574 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0BB0A8 7F086578 27A500E4 */ addiu $a1, $sp, 0xe4 -/* 0BB0AC 7F08657C 8E280000 */ lw $t0, ($s1) -/* 0BB0B0 7F086580 C7A400E4 */ lwc1 $f4, 0xe4($sp) -/* 0BB0B4 7F086584 C7A600EC */ lwc1 $f6, 0xec($sp) -/* 0BB0B8 7F086588 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BB0BC 7F08658C 8FA20138 */ lw $v0, 0x138($sp) -/* 0BB0C0 7F086590 46082280 */ add.s $f10, $f4, $f8 -/* 0BB0C4 7F086594 E7AA00E4 */ swc1 $f10, 0xe4($sp) -/* 0BB0C8 7F086598 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BB0CC 7F08659C 46043200 */ add.s $f8, $f6, $f4 -/* 0BB0D0 7F0865A0 E7A800EC */ swc1 $f8, 0xec($sp) -/* 0BB0D4 7F0865A4 8D0A0488 */ lw $t2, 0x488($t0) -/* 0BB0D8 7F0865A8 8C4D0010 */ lw $t5, 0x10($v0) -/* 0BB0DC 7F0865AC ADAA0014 */ sw $t2, 0x14($t5) -/* 0BB0E0 7F0865B0 8E280000 */ lw $t0, ($s1) -/* 0BB0E4 7F0865B4 C7AA00EC */ lwc1 $f10, 0xec($sp) -/* 0BB0E8 7F0865B8 8C440010 */ lw $a0, 0x10($v0) -/* 0BB0EC 7F0865BC 8D05048C */ lw $a1, 0x48c($t0) -/* 0BB0F0 7F0865C0 8D060494 */ lw $a2, 0x494($t0) -/* 0BB0F4 7F0865C4 8FA700E4 */ lw $a3, 0xe4($sp) -/* 0BB0F8 7F0865C8 E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0BB0FC 7F0865CC 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 0BB100 7F0865D0 24840014 */ addiu $a0, $a0, 0x14 -/* 0BB104 7F0865D4 8FAF0138 */ lw $t7, 0x138($sp) -/* 0BB108 7F0865D8 8FA500E4 */ lw $a1, 0xe4($sp) -/* 0BB10C 7F0865DC 8FA600EC */ lw $a2, 0xec($sp) -/* 0BB110 7F0865E0 8DEE0010 */ lw $t6, 0x10($t7) -/* 0BB114 7F0865E4 0FC2CA5C */ jal stanGetPositionYValue -/* 0BB118 7F0865E8 8DC40014 */ lw $a0, 0x14($t6) -/* 0BB11C 7F0865EC 3C038005 */ lui $v1, %hi(g_ClockTimer) -/* 0BB120 7F0865F0 24638374 */ addiu $v1, %lo(g_ClockTimer) # addiu $v1, $v1, -0x7c8c -/* 0BB124 7F0865F4 E60000D4 */ swc1 $f0, 0xd4($s0) -/* 0BB128 7F0865F8 8C6B0000 */ lw $t3, ($v1) -/* 0BB12C 7F0865FC 00001025 */ move $v0, $zero -/* 0BB130 7F086600 3C018005 */ lui $at, %hi(D_8005525C) -/* 0BB134 7F086604 1960000C */ blez $t3, .L7F086638 -/* 0BB138 7F086608 00000000 */ nop -/* 0BB13C 7F08660C C60200D4 */ lwc1 $f2, 0xd4($s0) -/* 0BB140 7F086610 C420525C */ lwc1 $f0, %lo(D_8005525C)($at) -/* 0BB144 7F086614 C60600D0 */ lwc1 $f6, 0xd0($s0) -.L7F086618: -/* 0BB148 7F086618 24420001 */ addiu $v0, $v0, 1 -/* 0BB14C 7F08661C 46003102 */ mul.s $f4, $f6, $f0 -/* 0BB150 7F086620 46022200 */ add.s $f8, $f4, $f2 -/* 0BB154 7F086624 E60800D0 */ swc1 $f8, 0xd0($s0) -/* 0BB158 7F086628 8C780000 */ lw $t8, ($v1) -/* 0BB15C 7F08662C 0058082A */ slt $at, $v0, $t8 -/* 0BB160 7F086630 5420FFF9 */ bnezl $at, .L7F086618 -/* 0BB164 7F086634 C60600D0 */ lwc1 $f6, 0xd0($s0) -.L7F086638: -/* 0BB168 7F086638 3C018005 */ lui $at, %hi(D_80055260) -/* 0BB16C 7F08663C C4265260 */ lwc1 $f6, %lo(D_80055260)($at) -/* 0BB170 7F086640 C60A00D0 */ lwc1 $f10, 0xd0($s0) -/* 0BB174 7F086644 8FA40130 */ lw $a0, 0x130($sp) -/* 0BB178 7F086648 46065502 */ mul.s $f20, $f10, $f6 -/* 0BB17C 7F08664C 0FC0FA19 */ jal chrpropBBOXGetYmin -/* 0BB180 7F086650 00000000 */ nop -/* 0BB184 7F086654 8FA20138 */ lw $v0, 0x138($sp) -/* 0BB188 7F086658 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0BB18C 7F08665C 44813000 */ mtc1 $at, $f6 -/* 0BB190 7F086660 8C4C0014 */ lw $t4, 0x14($v0) -/* 0BB194 7F086664 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0BB198 7F086668 24450018 */ addiu $a1, $v0, 0x18 -/* 0BB19C 7F08666C C5840014 */ lwc1 $f4, 0x14($t4) -/* 0BB1A0 7F086670 46040202 */ mul.s $f8, $f0, $f4 -/* 0BB1A4 7F086674 4608A281 */ sub.s $f10, $f20, $f8 -/* 0BB1A8 7F086678 46065100 */ add.s $f4, $f10, $f6 -/* 0BB1AC 7F08667C 0FC16008 */ jal matrix_4x4_copy -/* 0BB1B0 7F086680 E7A400E8 */ swc1 $f4, 0xe8($sp) -/* 0BB1B4 7F086684 8FA40138 */ lw $a0, 0x138($sp) -/* 0BB1B8 7F086688 C7A000E4 */ lwc1 $f0, 0xe4($sp) -/* 0BB1BC 7F08668C 8C990010 */ lw $t9, 0x10($a0) -/* 0BB1C0 7F086690 E7200008 */ swc1 $f0, 8($t9) -/* 0BB1C4 7F086694 E4800058 */ swc1 $f0, 0x58($a0) -/* 0BB1C8 7F086698 C7A000E8 */ lwc1 $f0, 0xe8($sp) -/* 0BB1CC 7F08669C 8C8A0010 */ lw $t2, 0x10($a0) -/* 0BB1D0 7F0866A0 E540000C */ swc1 $f0, 0xc($t2) -/* 0BB1D4 7F0866A4 E480005C */ swc1 $f0, 0x5c($a0) -/* 0BB1D8 7F0866A8 C7A000EC */ lwc1 $f0, 0xec($sp) -/* 0BB1DC 7F0866AC 8C8D0010 */ lw $t5, 0x10($a0) -/* 0BB1E0 7F0866B0 E5A00010 */ swc1 $f0, 0x10($t5) -/* 0BB1E4 7F0866B4 0FC15B28 */ jal setupUpdateObjectRoomPosition -/* 0BB1E8 7F0866B8 E4800060 */ swc1 $f0, 0x60($a0) -/* 0BB1EC 7F0866BC 0FC10121 */ jal chrobjCollisionRelated -/* 0BB1F0 7F0866C0 8FA40138 */ lw $a0, 0x138($sp) -/* 0BB1F4 7F0866C4 8E250000 */ lw $a1, ($s1) -/* 0BB1F8 7F0866C8 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) -/* 0BB1FC 7F0866CC 8CC66464 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0BB200 7F0866D0 27A400B4 */ addiu $a0, $sp, 0xb4 -/* 0BB204 7F0866D4 0FC1F222 */ jal bondviewTankCollisionRelated -/* 0BB208 7F0866D8 24A5048C */ addiu $a1, $a1, 0x48c -/* 0BB20C 7F0866DC 8FAF0138 */ lw $t7, 0x138($sp) -/* 0BB210 7F0866E0 27B00094 */ addiu $s0, $sp, 0x94 -/* 0BB214 7F0866E4 02002825 */ move $a1, $s0 -/* 0BB218 7F0866E8 0FC0F2E3 */ jal chraiGetPropRoomIds -/* 0BB21C 7F0866EC 8DE40010 */ lw $a0, 0x10($t7) -/* 0BB220 7F0866F0 0FC0F8FF */ jal sub_GAME_7F03E3FC -/* 0BB224 7F0866F4 02002025 */ move $a0, $s0 -/* 0BB228 7F0866F8 3C0E8007 */ lui $t6, %hi(ptr_list_object_lookup_indices) -/* 0BB22C 7F0866FC 8DCE9C30 */ lw $t6, %lo(ptr_list_object_lookup_indices)($t6) -/* 0BB230 7F086700 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 0BB234 7F086704 AFAE008C */ sw $t6, 0x8c($sp) -/* 0BB238 7F086708 85C20000 */ lh $v0, ($t6) -/* 0BB23C 7F08670C 0442008A */ bltzl $v0, .L7F086938 -/* 0BB240 7F086710 8FA40394 */ lw $a0, 0x394($sp) -/* 0BB244 7F086714 4481A000 */ mtc1 $at, $f20 -/* 0BB248 7F086718 00000000 */ nop -/* 0BB24C 7F08671C 8FAC0138 */ lw $t4, 0x138($sp) -.L7F086720: -/* 0BB250 7F086720 00025880 */ sll $t3, $v0, 2 -/* 0BB254 7F086724 01625823 */ subu $t3, $t3, $v0 -/* 0BB258 7F086728 000B5880 */ sll $t3, $t3, 2 -/* 0BB25C 7F08672C 8D990010 */ lw $t9, 0x10($t4) -/* 0BB260 7F086730 01625821 */ addu $t3, $t3, $v0 -/* 0BB264 7F086734 3C188007 */ lui $t8, %hi(pos_data_entry) -/* 0BB268 7F086738 27189C38 */ addiu $t8, %lo(pos_data_entry) # addiu $t8, $t8, -0x63c8 -/* 0BB26C 7F08673C 000B5880 */ sll $t3, $t3, 2 -/* 0BB270 7F086740 01788021 */ addu $s0, $t3, $t8 -/* 0BB274 7F086744 52190076 */ beql $s0, $t9, .L7F086920 -/* 0BB278 7F086748 8FAF008C */ lw $t7, 0x8c($sp) -/* 0BB27C 7F08674C 92020000 */ lbu $v0, ($s0) -/* 0BB280 7F086750 24010003 */ li $at, 3 -/* 0BB284 7F086754 240A0001 */ li $t2, 1 -/* 0BB288 7F086758 14410054 */ bne $v0, $at, .L7F0868AC -/* 0BB28C 7F08675C 02002025 */ move $a0, $s0 -/* 0BB290 7F086760 AFAA007C */ sw $t2, 0x7c($sp) -/* 0BB294 7F086764 8E080004 */ lw $t0, 4($s0) -/* 0BB298 7F086768 27A50080 */ addiu $a1, $sp, 0x80 -/* 0BB29C 7F08676C 27A60088 */ addiu $a2, $sp, 0x88 -/* 0BB2A0 7F086770 27A70084 */ addiu $a3, $sp, 0x84 -/* 0BB2A4 7F086774 0FC0F3E2 */ jal chrpropGetCollisionBounds -/* 0BB2A8 7F086778 AFA8006C */ sw $t0, 0x6c($sp) -/* 0BB2AC 7F08677C 26040008 */ addiu $a0, $s0, 8 -/* 0BB2B0 7F086780 AFA40050 */ sw $a0, 0x50($sp) -/* 0BB2B4 7F086784 27A500B4 */ addiu $a1, $sp, 0xb4 -/* 0BB2B8 7F086788 0FC0F336 */ jal chrpropTestPointInPolygon -/* 0BB2BC 7F08678C 24060004 */ li $a2, 4 -/* 0BB2C0 7F086790 1040002B */ beqz $v0, .L7F086840 -/* 0BB2C4 7F086794 8FA8006C */ lw $t0, 0x6c($sp) -/* 0BB2C8 7F086798 AFA0007C */ sw $zero, 0x7c($sp) -/* 0BB2CC 7F08679C 810D0007 */ lb $t5, 7($t0) -/* 0BB2D0 7F0867A0 24010004 */ li $at, 4 -/* 0BB2D4 7F0867A4 55A10027 */ bnel $t5, $at, .L7F086844 -/* 0BB2D8 7F0867A8 8FAC007C */ lw $t4, 0x7c($sp) -/* 0BB2DC 7F0867AC 8D030014 */ lw $v1, 0x14($t0) -/* 0BB2E0 7F0867B0 3C010100 */ lui $at, 0x100 -/* 0BB2E4 7F0867B4 3C028005 */ lui $v0, %hi(D_80048380) -/* 0BB2E8 7F0867B8 000379C0 */ sll $t7, $v1, 7 -/* 0BB2EC 7F0867BC 05E00020 */ bltz $t7, .L7F086840 -/* 0BB2F0 7F0867C0 00617025 */ or $t6, $v1, $at -/* 0BB2F4 7F0867C4 AD0E0014 */ sw $t6, 0x14($t0) -/* 0BB2F8 7F0867C8 8C428380 */ lw $v0, %lo(D_80048380)($v0) -/* 0BB2FC 7F0867CC 24010003 */ li $at, 3 -/* 0BB300 7F0867D0 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0BB304 7F0867D4 0041001A */ div $zero, $v0, $at -/* 0BB308 7F0867D8 00001010 */ mfhi $v0 -/* 0BB30C 7F0867DC 28410002 */ slti $at, $v0, 2 -/* 0BB310 7F0867E0 1020000E */ beqz $at, .L7F08681C -/* 0BB314 7F0867E4 240500B7 */ li $a1, 183 -/* 0BB318 7F0867E8 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BB31C 7F0867EC 0C002382 */ jal sndPlaySfx -/* 0BB320 7F0867F0 00003025 */ move $a2, $zero -/* 0BB324 7F0867F4 00402025 */ move $a0, $v0 -/* 0BB328 7F0867F8 0FC14E84 */ jal sub_GAME_7F053A10 -/* 0BB32C 7F0867FC 8FA50050 */ lw $a1, 0x50($sp) -/* 0BB330 7F086800 3C028005 */ lui $v0, %hi(D_80048380) -/* 0BB334 7F086804 8C428380 */ lw $v0, %lo(D_80048380)($v0) -/* 0BB338 7F086808 24010003 */ li $at, 3 -/* 0BB33C 7F08680C 0041001A */ div $zero, $v0, $at -/* 0BB340 7F086810 00001010 */ mfhi $v0 -/* 0BB344 7F086814 00000000 */ nop -/* 0BB348 7F086818 00000000 */ nop -.L7F08681C: -/* 0BB34C 7F08681C 18400008 */ blez $v0, .L7F086840 -/* 0BB350 7F086820 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0BB354 7F086824 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BB358 7F086828 240500D5 */ li $a1, 213 -/* 0BB35C 7F08682C 0C002382 */ jal sndPlaySfx -/* 0BB360 7F086830 00003025 */ move $a2, $zero -/* 0BB364 7F086834 00402025 */ move $a0, $v0 -/* 0BB368 7F086838 0FC14E84 */ jal sub_GAME_7F053A10 -/* 0BB36C 7F08683C 8FA50050 */ lw $a1, 0x50($sp) -.L7F086840: -/* 0BB370 7F086840 8FAC007C */ lw $t4, 0x7c($sp) -.L7F086844: -/* 0BB374 7F086844 8FA40050 */ lw $a0, 0x50($sp) -/* 0BB378 7F086848 8FA50080 */ lw $a1, 0x80($sp) -/* 0BB37C 7F08684C 11800006 */ beqz $t4, .L7F086868 -/* 0BB380 7F086850 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0BB384 7F086854 0FC111C6 */ jal chrobjTestPointPolygonCollision -/* 0BB388 7F086858 24070004 */ li $a3, 4 -/* 0BB38C 7F08685C 50400003 */ beql $v0, $zero, .L7F08686C -/* 0BB390 7F086860 8FB9007C */ lw $t9, 0x7c($sp) -/* 0BB394 7F086864 AFA0007C */ sw $zero, 0x7c($sp) -.L7F086868: -/* 0BB398 7F086868 8FB9007C */ lw $t9, 0x7c($sp) -.L7F08686C: -/* 0BB39C 7F08686C 8FAA0138 */ lw $t2, 0x138($sp) -/* 0BB3A0 7F086870 5720002B */ bnezl $t9, .L7F086920 -/* 0BB3A4 7F086874 8FAF008C */ lw $t7, 0x8c($sp) -/* 0BB3A8 7F086878 C5480058 */ lwc1 $f8, 0x58($t2) -/* 0BB3AC 7F08687C 4406A000 */ mfc1 $a2, $f20 -/* 0BB3B0 7F086880 27A50070 */ addiu $a1, $sp, 0x70 -/* 0BB3B4 7F086884 E7A80070 */ swc1 $f8, 0x70($sp) -/* 0BB3B8 7F086888 C60A000C */ lwc1 $f10, 0xc($s0) -/* 0BB3BC 7F08688C 24070001 */ li $a3, 1 -/* 0BB3C0 7F086890 E7AA0074 */ swc1 $f10, 0x74($sp) -/* 0BB3C4 7F086894 C5460060 */ lwc1 $f6, 0x60($t2) -/* 0BB3C8 7F086898 E7A60078 */ swc1 $f6, 0x78($sp) -/* 0BB3CC 7F08689C 0FC09E01 */ jal chrlvExplosionDamage -/* 0BB3D0 7F0868A0 8E040004 */ lw $a0, 4($s0) -/* 0BB3D4 7F0868A4 1000001E */ b .L7F086920 -/* 0BB3D8 7F0868A8 8FAF008C */ lw $t7, 0x8c($sp) -.L7F0868AC: -/* 0BB3DC 7F0868AC 24010001 */ li $at, 1 -/* 0BB3E0 7F0868B0 1441001A */ bne $v0, $at, .L7F08691C -/* 0BB3E4 7F0868B4 02002025 */ move $a0, $s0 -/* 0BB3E8 7F0868B8 27A50064 */ addiu $a1, $sp, 0x64 -/* 0BB3EC 7F0868BC 0FC0F32C */ jal chraiGetCollisionBoundsWithoutY -/* 0BB3F0 7F0868C0 27A60060 */ addiu $a2, $sp, 0x60 -/* 0BB3F4 7F0868C4 8FA50060 */ lw $a1, 0x60($sp) -/* 0BB3F8 7F0868C8 8FA40064 */ lw $a0, 0x64($sp) -/* 0BB3FC 7F0868CC 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0BB400 7F0868D0 58A00013 */ blezl $a1, .L7F086920 -/* 0BB404 7F0868D4 8FAF008C */ lw $t7, 0x8c($sp) -/* 0BB408 7F0868D8 0FC111AE */ jal sub_GAME_7F0446B8 -/* 0BB40C 7F0868DC 24070004 */ li $a3, 4 -/* 0BB410 7F0868E0 5040000F */ beql $v0, $zero, .L7F086920 -/* 0BB414 7F0868E4 8FAF008C */ lw $t7, 0x8c($sp) -/* 0BB418 7F0868E8 0FC26C54 */ jal get_cur_playernum -/* 0BB41C 7F0868EC 00000000 */ nop -/* 0BB420 7F0868F0 8E060004 */ lw $a2, 4($s0) -/* 0BB424 7F0868F4 3C05461C */ lui $a1, (0x461C4000 >> 16) # lui $a1, 0x461c -/* 0BB428 7F0868F8 34A54000 */ ori $a1, (0x461C4000 & 0xFFFF) # ori $a1, $a1, 0x4000 -/* 0BB42C 7F0868FC AFA20010 */ sw $v0, 0x10($sp) -/* 0BB430 7F086900 02002025 */ move $a0, $s0 -/* 0BB434 7F086904 24070020 */ li $a3, 32 -/* 0BB438 7F086908 0FC137BF */ jal sub_GAME_7F04DEFC -/* 0BB43C 7F08690C 24C60058 */ addiu $a2, $a2, 0x58 -/* 0BB440 7F086910 240D005A */ li $t5, 90 -/* 0BB444 7F086914 3C018003 */ lui $at, %hi(D_80036490) -/* 0BB448 7F086918 AC2D6490 */ sw $t5, %lo(D_80036490)($at) -.L7F08691C: -/* 0BB44C 7F08691C 8FAF008C */ lw $t7, 0x8c($sp) -.L7F086920: -/* 0BB450 7F086920 25EE0002 */ addiu $t6, $t7, 2 -/* 0BB454 7F086924 AFAE008C */ sw $t6, 0x8c($sp) -/* 0BB458 7F086928 85C20000 */ lh $v0, ($t6) -/* 0BB45C 7F08692C 0443FF7C */ bgezl $v0, .L7F086720 -/* 0BB460 7F086930 8FAC0138 */ lw $t4, 0x138($sp) -/* 0BB464 7F086934 8FA40394 */ lw $a0, 0x394($sp) -.L7F086938: -/* 0BB468 7F086938 0FC2037E */ jal bondviewUpdatePlayerClipping -/* 0BB46C 7F08693C 8FA50390 */ lw $a1, 0x390($sp) -/* 0BB470 7F086940 0FC2051E */ jal bondviewUpdatePlayerCollisionPositionFields -/* 0BB474 7F086944 00000000 */ nop -/* 0BB478 7F086948 0FC22867 */ jal bondviewUpdatePlayerCollisionBounds -/* 0BB47C 7F08694C 00000000 */ nop -/* 0BB480 7F086950 0FC243DF */ jal get_debug_man_pos_flag -/* 0BB484 7F086954 00000000 */ nop -/* 0BB488 7F086958 50400008 */ beql $v0, $zero, .L7F08697C -/* 0BB48C 7F08695C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0BB490 7F086960 8E280000 */ lw $t0, ($s1) -/* 0BB494 7F086964 27A7005C */ addiu $a3, $sp, 0x5c -/* 0BB498 7F086968 8D040488 */ lw $a0, 0x488($t0) -/* 0BB49C 7F08696C 8D05048C */ lw $a1, 0x48c($t0) -/* 0BB4A0 7F086970 0FC2CB0B */ jal copy_tile_RGB_as_24bit -/* 0BB4A4 7F086974 8D060494 */ lw $a2, 0x494($t0) -/* 0BB4A8 7F086978 8FBF002C */ lw $ra, 0x2c($sp) -.L7F08697C: -/* 0BB4AC 7F08697C D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0BB4B0 7F086980 8FB00024 */ lw $s0, 0x24($sp) -/* 0BB4B4 7F086984 8FB10028 */ lw $s1, 0x28($sp) -/* 0BB4B8 7F086988 03E00008 */ jr $ra -/* 0BB4BC 7F08698C 27BD03B8 */ addiu $sp, $sp, 0x3b8 -) -#endif - -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata -glabel D_8005516C -.word 0x3d888889 /*0.06666667*/ -glabel D_80055170 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055174 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055178 -.word 0x3f8147ae /*1.01*/ -glabel D_8005517C -.word 0x3f8147ae /*1.01*/ -glabel D_80055180 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055184 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055188 -.word 0x40490fdb /*3.1415927*/ -glabel D_8005518C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055190 -.word 0xc0490fdb /*-3.1415927*/ -glabel D_80055194 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055198 -.word 0x3f6b851f /*0.92000002*/ -glabel D_8005519C -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551A0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551A4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551A8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551AC -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551B0 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551B4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551B8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551BC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551C0 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551C4 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551C8 -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551CC -.word 0x3f6b851f /*0.92000002*/ -glabel D_800551D0 -.word 0x3da3d708 /*0.079999983*/ -glabel D_800551D4 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_800551D8 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551DC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E4 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E8 -.word 0x3e99999a /*0.30000001*/ -glabel D_800551EC -.word 0x3e19999a /*0.15000001*/ -glabel D_800551F0 -.word 0x469c4000 /*20000.0*/ -glabel D_800551F4 -.word 0x3f666666 /*0.89999998*/ -glabel D_800551F8 -.word 0x46477c00 /*12767.0*/ -glabel D_800551FC -.word 0x469c4000 /*20000.0*/ -glabel D_80055200 -.word 0x3f666666 /*0.89999998*/ -glabel D_80055204 -.word 0x45f2b800 /*7767.0*/ -glabel D_80055208 -.word 0x3f666666 /*0.89999998*/ -glabel D_8005520C -.word 0x46c35000 /*25000.0;*/ -glabel D_80055210 -.word 0x3e32b8c3 /*0.17453294*/ -glabel D_80055214 -.word 0x3edf66f3 /*0.43633232*/ -glabel D_80055218 -.word 0xbdb2b8c3 /*-0.087266468*/ -glabel D_8005521C -.word 0x3f70a3d7 /*0.94*/ -glabel D_80055220 -.word 0x3d75c290 /*0.060000002*/ -glabel D_80055224 -.word 0x4528c000 /*2700.0*/ -glabel D_80055228 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005522C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055230 -.word 0x3f19999a /*0.60000002*/ -glabel D_80055234 -.word 0x3f4ccccd /*0.80000001*/ -glabel D_80055238 -.word 0x3dcccccd /*0.1*/ -glabel D_8005523C -.word 0x4528c000 /*2700.0*/ -glabel D_80055240 -.word 0x3f947ae1 /*1.16*/ -glabel D_80055244 -.word 0x3f8147ae /*1.01*/ -glabel D_80055248 -.word 0x3f7d7721 /*0.99009901*/ -glabel D_8005524C -.word 0x3f333333 /*0.69999999*/ -glabel D_80055250 -.word 0x3f99999a /*1.2*/ -glabel D_80055254 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055258 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005525C -.word 0x3f547ae1 /*0.82999998*/ -glabel D_80055260 -.word 0x3e2e147c /*0.17000002*/ -.text -glabel MoveBond -/* 0B9868 7F084CF8 27BDFC48 */ addiu $sp, $sp, -0x3b8 -/* 0B986C 7F084CFC 3C198003 */ lui $t9, %hi(D_800367F4) # $t9, 0x8003 -/* 0B9870 7F084D00 AFBF002C */ sw $ra, 0x2c($sp) -/* 0B9874 7F084D04 AFB10028 */ sw $s1, 0x28($sp) -/* 0B9878 7F084D08 AFB00024 */ sw $s0, 0x24($sp) -/* 0B987C 7F084D0C F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0B9880 7F084D10 AFA403B8 */ sw $a0, 0x3b8($sp) -/* 0B9884 7F084D14 AFA503BC */ sw $a1, 0x3bc($sp) -/* 0B9888 7F084D18 AFA603C0 */ sw $a2, 0x3c0($sp) -/* 0B988C 7F084D1C AFA703C4 */ sw $a3, 0x3c4($sp) -/* 0B9890 7F084D20 27396834 */ addiu $t9, %lo(D_800367F4) # addiu $t9, $t9, 0x6834 -/* 0B9894 7F084D24 8F210000 */ lw $at, ($t9) -/* 0B9898 7F084D28 27AA03AC */ addiu $t2, $sp, 0x3ac -/* 0B989C 7F084D2C 8F2C0004 */ lw $t4, 4($t9) -/* 0B98A0 7F084D30 AD410000 */ sw $at, ($t2) -/* 0B98A4 7F084D34 8F210008 */ lw $at, 8($t9) -/* 0B98A8 7F084D38 4480A000 */ mtc1 $zero, $f20 -/* 0B98AC 7F084D3C 00048600 */ sll $s0, $a0, 0x18 -/* 0B98B0 7F084D40 AD410008 */ sw $at, 8($t2) -/* 0B98B4 7F084D44 00107603 */ sra $t6, $s0, 0x18 -/* 0B98B8 7F084D48 AD4C0004 */ sw $t4, 4($t2) -/* 0B98BC 7F084D4C 29C10064 */ slti $at, $t6, 0x64 -/* 0B98C0 7F084D50 01C08025 */ move $s0, $t6 -/* 0B98C4 7F084D54 AFA00394 */ sw $zero, 0x394($sp) -/* 0B98C8 7F084D58 E7B40398 */ swc1 $f20, 0x398($sp) -/* 0B98CC 7F084D5C 10200004 */ beqz $at, .Ljp7F084D70 -/* 0B98D0 7F084D60 E7B40390 */ swc1 $f20, 0x390($sp) -/* 0B98D4 7F084D64 29C1FF9D */ slti $at, $t6, -0x63 -/* 0B98D8 7F084D68 50200004 */ beql $at, $zero, .Ljp7F084D7C -/* 0B98DC 7F084D6C 83AB03BF */ lb $t3, 0x3bf($sp) -.Ljp7F084D70: -/* 0B98E0 7F084D70 0FC1B297 */ jal return_null -/* 0B98E4 7F084D74 00000000 */ nop -/* 0B98E8 7F084D78 83AB03BF */ lb $t3, 0x3bf($sp) -.Ljp7F084D7C: -/* 0B98EC 7F084D7C 29610064 */ slti $at, $t3, 0x64 -/* 0B98F0 7F084D80 10200003 */ beqz $at, .Ljp7F084D90 -/* 0B98F4 7F084D84 2961FF9D */ slti $at, $t3, -0x63 -/* 0B98F8 7F084D88 10200003 */ beqz $at, .Ljp7F084D98 -/* 0B98FC 7F084D8C 00000000 */ nop -.Ljp7F084D90: -/* 0B9900 7F084D90 0FC1B297 */ jal return_null -/* 0B9904 7F084D94 00000000 */ nop -.Ljp7F084D98: -/* 0B9908 7F084D98 3C038003 */ lui $v1, %hi(g_bondviewForceDisarm) # $v1, 0x8003 -/* 0B990C 7F084D9C 24636464 */ addiu $v1, %lo(g_bondviewForceDisarm) # addiu $v1, $v1, 0x6464 -/* 0B9910 7F084DA0 8C620000 */ lw $v0, ($v1) -/* 0B9914 7F084DA4 18400015 */ blez $v0, .Ljp7F084DFC -/* 0B9918 7F084DA8 244D0001 */ addiu $t5, $v0, 1 -/* 0B991C 7F084DAC 29A10004 */ slti $at, $t5, 4 -/* 0B9920 7F084DB0 14200012 */ bnez $at, .Ljp7F084DFC -/* 0B9924 7F084DB4 AC6D0000 */ sw $t5, ($v1) -/* 0B9928 7F084DB8 3C118008 */ lui $s1, %hi(g_CurrentPlayer) # $s1, 0x8008 -/* 0B992C 7F084DBC 2631A120 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x5ee0 -/* 0B9930 7F084DC0 8E380000 */ lw $t8, ($s1) -/* 0B9934 7F084DC4 AC600000 */ sw $zero, ($v1) -/* 0B9938 7F084DC8 24040001 */ li $a0, 1 -/* 0B993C 7F084DCC AF002A54 */ sw $zero, 0x2a54($t8) -/* 0B9940 7F084DD0 8E2F0000 */ lw $t7, ($s1) -/* 0B9944 7F084DD4 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B9948 7F084DD8 ADE02A50 */ sw $zero, 0x2a50($t7) -/* 0B994C 7F084DDC 24040001 */ li $a0, 1 -/* 0B9950 7F084DE0 0FC1781D */ jal currentPlayerUnEquipWeaponWrapper -/* 0B9954 7F084DE4 00402825 */ move $a1, $v0 -/* 0B9958 7F084DE8 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0B995C 7F084DEC 00002025 */ move $a0, $zero -/* 0B9960 7F084DF0 00002025 */ move $a0, $zero -/* 0B9964 7F084DF4 0FC1781D */ jal currentPlayerUnEquipWeaponWrapper -/* 0B9968 7F084DF8 00402825 */ move $a1, $v0 -.Ljp7F084DFC: -/* 0B996C 7F084DFC 3C118008 */ lui $s1, %hi(g_CurrentPlayer) # $s1, 0x8008 -/* 0B9970 7F084E00 2631A120 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x5ee0 -/* 0B9974 7F084E04 0FC1E810 */ jal currentPlayerSetField00 -/* 0B9978 7F084E08 00002025 */ move $a0, $zero -/* 0B997C 7F084E0C 0FC21176 */ jal sub_GAME_7F083FC8 -/* 0B9980 7F084E10 00000000 */ nop -/* 0B9984 7F084E14 0FC21284 */ jal sub_GAME_7F084360 -/* 0B9988 7F084E18 00000000 */ nop -/* 0B998C 7F084E1C 00102600 */ sll $a0, $s0, 0x18 -/* 0B9990 7F084E20 00045603 */ sra $t2, $a0, 0x18 -/* 0B9994 7F084E24 01402025 */ move $a0, $t2 -/* 0B9998 7F084E28 83A503BF */ lb $a1, 0x3bf($sp) -/* 0B999C 7F084E2C 97A603C2 */ lhu $a2, 0x3c2($sp) -/* 0B99A0 7F084E30 0FC207E1 */ jal controller_gameplay_interaction -/* 0B99A4 7F084E34 97A703C6 */ lhu $a3, 0x3c6($sp) -/* 0B99A8 7F084E38 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0B99AC 7F084E3C 00000000 */ nop -/* 0B99B0 7F084E40 50400004 */ beql $v0, $zero, .Ljp7F084E54 -/* 0B99B4 7F084E44 8E390000 */ lw $t9, ($s1) -/* 0B99B8 7F084E48 0FC1FC3F */ jal sub_GAME_7F07EAF0 -/* 0B99BC 7F084E4C 00000000 */ nop -/* 0B99C0 7F084E50 8E390000 */ lw $t9, ($s1) -.Ljp7F084E54: -/* 0B99C4 7F084E54 8F2C01C8 */ lw $t4, 0x1c8($t9) -/* 0B99C8 7F084E58 11800003 */ beqz $t4, .Ljp7F084E68 -/* 0B99CC 7F084E5C 00000000 */ nop -/* 0B99D0 7F084E60 0FC1FC98 */ jal sub_GAME_7F07EC54 -/* 0B99D4 7F084E64 00000000 */ nop -.Ljp7F084E68: -/* 0B99D8 7F084E68 3C0B8003 */ lui $t3, %hi(in_tank_flag) # $t3, 0x8003 -/* 0B99DC 7F084E6C 8D6B6488 */ lw $t3, %lo(in_tank_flag)($t3) -/* 0B99E0 7F084E70 1560006E */ bnez $t3, .Ljp7F08502C -/* 0B99E4 7F084E74 00000000 */ nop -/* 0B99E8 7F084E78 0FC1E7F8 */ jal currentPlayerGetCrouchPos -/* 0B99EC 7F084E7C 00000000 */ nop -/* 0B99F0 7F084E80 5440000D */ bnezl $v0, .Ljp7F084EB8 -/* 0B99F4 7F084E84 8E280000 */ lw $t0, ($s1) -/* 0B99F8 7F084E88 8E280000 */ lw $t0, ($s1) -/* 0B99FC 7F084E8C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B9A00 7F084E90 44815000 */ mtc1 $at, $f10 -/* 0B9A04 7F084E94 C5040174 */ lwc1 $f4, 0x174($t0) -/* 0B9A08 7F084E98 460A2182 */ mul.s $f6, $f4, $f10 -/* 0B9A0C 7F084E9C 44812000 */ mtc1 $at, $f4 -/* 0B9A10 7F084EA0 E5060174 */ swc1 $f6, 0x174($t0) -/* 0B9A14 7F084EA4 8E280000 */ lw $t0, ($s1) -/* 0B9A18 7F084EA8 C508016C */ lwc1 $f8, 0x16c($t0) -/* 0B9A1C 7F084EAC 46044282 */ mul.s $f10, $f8, $f4 -/* 0B9A20 7F084EB0 E50A016C */ swc1 $f10, 0x16c($t0) -/* 0B9A24 7F084EB4 8E280000 */ lw $t0, ($s1) -.Ljp7F084EB8: -/* 0B9A28 7F084EB8 C5120180 */ lwc1 $f18, 0x180($t0) -/* 0B9A2C 7F084EBC 4612A032 */ c.eq.s $f20, $f18 -/* 0B9A30 7F084EC0 00000000 */ nop -/* 0B9A34 7F084EC4 45020007 */ bc1fl .Ljp7F084EE4 -/* 0B9A38 7F084EC8 C5000188 */ lwc1 $f0, 0x188($t0) -/* 0B9A3C 7F084ECC C5060188 */ lwc1 $f6, 0x188($t0) -/* 0B9A40 7F084ED0 4606A032 */ c.eq.s $f20, $f6 -/* 0B9A44 7F084ED4 00000000 */ nop -/* 0B9A48 7F084ED8 45010054 */ bc1t .Ljp7F08502C -/* 0B9A4C 7F084EDC 00000000 */ nop -/* 0B9A50 7F084EE0 C5000188 */ lwc1 $f0, 0x188($t0) -.Ljp7F084EE4: -/* 0B9A54 7F084EE4 C5020150 */ lwc1 $f2, 0x150($t0) -/* 0B9A58 7F084EE8 C5100154 */ lwc1 $f16, 0x154($t0) -/* 0B9A5C 7F084EEC 46009387 */ neg.s $f14, $f18 -/* 0B9A60 7F084EF0 46020202 */ mul.s $f8, $f0, $f2 -/* 0B9A64 7F084EF4 00000000 */ nop -/* 0B9A68 7F084EF8 46107102 */ mul.s $f4, $f14, $f16 -/* 0B9A6C 7F084EFC 46044280 */ add.s $f10, $f8, $f4 -/* 0B9A70 7F084F00 46027182 */ mul.s $f6, $f14, $f2 -/* 0B9A74 7F084F04 00000000 */ nop -/* 0B9A78 7F084F08 46100202 */ mul.s $f8, $f0, $f16 -/* 0B9A7C 7F084F0C E7AA038C */ swc1 $f10, 0x38c($sp) -/* 0B9A80 7F084F10 46000282 */ mul.s $f10, $f0, $f0 -/* 0B9A84 7F084F14 46083101 */ sub.s $f4, $f6, $f8 -/* 0B9A88 7F084F18 46129182 */ mul.s $f6, $f18, $f18 -/* 0B9A8C 7F084F1C E7A40388 */ swc1 $f4, 0x388($sp) -/* 0B9A90 7F084F20 0C007E08 */ jal sqrtf -/* 0B9A94 7F084F24 46065300 */ add.s $f12, $f10, $f6 -/* 0B9A98 7F084F28 8E280000 */ lw $t0, ($s1) -/* 0B9A9C 7F084F2C C7A4038C */ lwc1 $f4, 0x38c($sp) -/* 0B9AA0 7F084F30 3C018005 */ lui $at, %hi(D_8005516C) # $at, 0x8005 -/* 0B9AA4 7F084F34 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B9AA8 7F084F38 3C098005 */ lui $t1, %hi(g_GlobalTimerDelta) # $t1, 0x8005 -/* 0B9AAC 7F084F3C 252983B4 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, -0x7c4c -/* 0B9AB0 7F084F40 46044280 */ add.s $f10, $f8, $f4 -/* 0B9AB4 7F084F44 00001825 */ move $v1, $zero -/* 0B9AB8 7F084F48 2404000C */ li $a0, 12 -/* 0B9ABC 7F084F4C E50A0174 */ swc1 $f10, 0x174($t0) -/* 0B9AC0 7F084F50 8E280000 */ lw $t0, ($s1) -/* 0B9AC4 7F084F54 C7A80388 */ lwc1 $f8, 0x388($sp) -/* 0B9AC8 7F084F58 C506016C */ lwc1 $f6, 0x16c($t0) -/* 0B9ACC 7F084F5C 46083100 */ add.s $f4, $f6, $f8 -/* 0B9AD0 7F084F60 E504016C */ swc1 $f4, 0x16c($t0) -/* 0B9AD4 7F084F64 C42C519C */ lwc1 $f12, %lo(D_8005516C)($at) -/* 0B9AD8 7F084F68 8E2D0000 */ lw $t5, ($s1) -.Ljp7F084F6C: -/* 0B9ADC 7F084F6C 01A31021 */ addu $v0, $t5, $v1 -/* 0B9AE0 7F084F70 C4420180 */ lwc1 $f2, 0x180($v0) -/* 0B9AE4 7F084F74 4602A032 */ c.eq.s $f20, $f2 -/* 0B9AE8 7F084F78 00000000 */ nop -/* 0B9AEC 7F084F7C 45030029 */ bc1tl .Ljp7F085024 -/* 0B9AF0 7F084F80 24630004 */ addiu $v1, $v1, 4 -/* 0B9AF4 7F084F84 4602A03C */ c.lt.s $f20, $f2 -/* 0B9AF8 7F084F88 00000000 */ nop -/* 0B9AFC 7F084F8C 45020012 */ bc1fl .Ljp7F084FD8 -/* 0B9B00 7F084F90 4614103C */ c.lt.s $f2, $f20 -/* 0B9B04 7F084F94 C52A0000 */ lwc1 $f10, ($t1) -/* 0B9B08 7F084F98 460A6182 */ mul.s $f6, $f12, $f10 -/* 0B9B0C 7F084F9C 00000000 */ nop -/* 0B9B10 7F084FA0 46023202 */ mul.s $f8, $f6, $f2 -/* 0B9B14 7F084FA4 46004103 */ div.s $f4, $f8, $f0 -/* 0B9B18 7F084FA8 46041281 */ sub.s $f10, $f2, $f4 -/* 0B9B1C 7F084FAC E44A0180 */ swc1 $f10, 0x180($v0) -/* 0B9B20 7F084FB0 8E2E0000 */ lw $t6, ($s1) -/* 0B9B24 7F084FB4 01C31021 */ addu $v0, $t6, $v1 -/* 0B9B28 7F084FB8 C4460180 */ lwc1 $f6, 0x180($v0) -/* 0B9B2C 7F084FBC 4614303C */ c.lt.s $f6, $f20 -/* 0B9B30 7F084FC0 00000000 */ nop -/* 0B9B34 7F084FC4 45000016 */ bc1f .Ljp7F085020 -/* 0B9B38 7F084FC8 00000000 */ nop -/* 0B9B3C 7F084FCC 10000014 */ b .Ljp7F085020 -/* 0B9B40 7F084FD0 E4540180 */ swc1 $f20, 0x180($v0) -/* 0B9B44 7F084FD4 4614103C */ c.lt.s $f2, $f20 -.Ljp7F084FD8: -/* 0B9B48 7F084FD8 00000000 */ nop -/* 0B9B4C 7F084FDC 45020011 */ bc1fl .Ljp7F085024 -/* 0B9B50 7F084FE0 24630004 */ addiu $v1, $v1, 4 -/* 0B9B54 7F084FE4 C5280000 */ lwc1 $f8, ($t1) -/* 0B9B58 7F084FE8 46086102 */ mul.s $f4, $f12, $f8 -/* 0B9B5C 7F084FEC 00000000 */ nop -/* 0B9B60 7F084FF0 46022282 */ mul.s $f10, $f4, $f2 -/* 0B9B64 7F084FF4 46005183 */ div.s $f6, $f10, $f0 -/* 0B9B68 7F084FF8 46061201 */ sub.s $f8, $f2, $f6 -/* 0B9B6C 7F084FFC E4480180 */ swc1 $f8, 0x180($v0) -/* 0B9B70 7F085000 8E380000 */ lw $t8, ($s1) -/* 0B9B74 7F085004 03031021 */ addu $v0, $t8, $v1 -/* 0B9B78 7F085008 C4440180 */ lwc1 $f4, 0x180($v0) -/* 0B9B7C 7F08500C 4604A03C */ c.lt.s $f20, $f4 -/* 0B9B80 7F085010 00000000 */ nop -/* 0B9B84 7F085014 45000002 */ bc1f .Ljp7F085020 -/* 0B9B88 7F085018 00000000 */ nop -/* 0B9B8C 7F08501C E4540180 */ swc1 $f20, 0x180($v0) -.Ljp7F085020: -/* 0B9B90 7F085020 24630004 */ addiu $v1, $v1, 4 -.Ljp7F085024: -/* 0B9B94 7F085024 5464FFD1 */ bnel $v1, $a0, .Ljp7F084F6C -/* 0B9B98 7F085028 8E2D0000 */ lw $t5, ($s1) -.Ljp7F08502C: -/* 0B9B9C 7F08502C 3C0F8003 */ lui $t7, %hi(in_tank_flag) # $t7, 0x8003 -/* 0B9BA0 7F085030 8DEF6488 */ lw $t7, %lo(in_tank_flag)($t7) -/* 0B9BA4 7F085034 3C098005 */ lui $t1, %hi(g_GlobalTimerDelta) # $t1, 0x8005 -/* 0B9BA8 7F085038 24010001 */ li $at, 1 -/* 0B9BAC 7F08503C 252983B4 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, -0x7c4c -/* 0B9BB0 7F085040 15E10211 */ bne $t7, $at, .Ljp7F085888 -/* 0B9BB4 7F085044 8E280000 */ lw $t0, ($s1) -/* 0B9BB8 7F085048 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0B9BBC 7F08504C C5260000 */ lwc1 $f6, ($t1) -/* 0B9BC0 7F085050 3C018005 */ lui $at, %hi(D_80055170) # $at, 0x8005 -/* 0B9BC4 7F085054 C42C51A0 */ lwc1 $f12, %lo(D_80055170)($at) -/* 0B9BC8 7F085058 46065202 */ mul.s $f8, $f10, $f6 -/* 0B9BCC 7F08505C 3C018005 */ lui $at, %hi(D_80055174) # $at, 0x8005 -/* 0B9BD0 7F085060 C42451A4 */ lwc1 $f4, %lo(D_80055174)($at) -/* 0B9BD4 7F085064 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B9BD8 7F085068 44813000 */ mtc1 $at, $f6 -/* 0B9BDC 7F08506C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B9BE0 7F085070 27B00374 */ addiu $s0, $sp, 0x374 -/* 0B9BE4 7F085074 46044282 */ mul.s $f10, $f8, $f4 -/* 0B9BE8 7F085078 C42864A4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B9BEC 7F08507C 02003825 */ move $a3, $s0 -/* 0B9BF0 7F085080 2504048C */ addiu $a0, $t0, 0x48c -/* 0B9BF4 7F085084 27AA0368 */ addiu $t2, $sp, 0x368 -/* 0B9BF8 7F085088 46065082 */ mul.s $f2, $f10, $f6 -/* 0B9BFC 7F08508C 46024000 */ add.s $f0, $f8, $f2 -/* 0B9C00 7F085090 4600603E */ c.le.s $f12, $f0 -/* 0B9C04 7F085094 00000000 */ nop -/* 0B9C08 7F085098 45020003 */ bc1fl .Ljp7F0850A8 -/* 0B9C0C 7F08509C 4614003C */ c.lt.s $f0, $f20 -/* 0B9C10 7F0850A0 460C0001 */ sub.s $f0, $f0, $f12 -/* 0B9C14 7F0850A4 4614003C */ c.lt.s $f0, $f20 -.Ljp7F0850A8: -/* 0B9C18 7F0850A8 00000000 */ nop -/* 0B9C1C 7F0850AC 45020003 */ bc1fl .Ljp7F0850BC -/* 0B9C20 7F0850B0 8D050488 */ lw $a1, 0x488($t0) -/* 0B9C24 7F0850B4 460C0000 */ add.s $f0, $f0, $f12 -/* 0B9C28 7F0850B8 8D050488 */ lw $a1, 0x488($t0) -.Ljp7F0850BC: -/* 0B9C2C 7F0850BC 44060000 */ mfc1 $a2, $f0 -/* 0B9C30 7F0850C0 E7A20358 */ swc1 $f2, 0x358($sp) -/* 0B9C34 7F0850C4 E7A0035C */ swc1 $f0, 0x35c($sp) -/* 0B9C38 7F0850C8 0FC1F43B */ jal bondviewTankCollisionStatus -/* 0B9C3C 7F0850CC AFAA0010 */ sw $t2, 0x10($sp) -/* 0B9C40 7F0850D0 50400007 */ beql $v0, $zero, .Ljp7F0850F0 -/* 0B9C44 7F0850D4 3C01BF80 */ lui $at, 0xbf80 -/* 0B9C48 7F0850D8 C7A4035C */ lwc1 $f4, 0x35c($sp) -/* 0B9C4C 7F0850DC 3C018003 */ li $at, 0x80030000 # -0.000000 -/* 0B9C50 7F0850E0 E42464A4 */ swc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B9C54 7F0850E4 100000CB */ b .Ljp7F085414 -/* 0B9C58 7F0850E8 8E280000 */ lw $t0, ($s1) -/* 0B9C5C 7F0850EC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.Ljp7F0850F0: -/* 0B9C60 7F0850F0 44815000 */ mtc1 $at, $f10 -/* 0B9C64 7F0850F4 44813000 */ mtc1 $at, $f6 -/* 0B9C68 7F0850F8 27A40348 */ addiu $a0, $sp, 0x348 -/* 0B9C6C 7F0850FC 27A5033C */ addiu $a1, $sp, 0x33c -/* 0B9C70 7F085100 E7AA031C */ swc1 $f10, 0x31c($sp) -/* 0B9C74 7F085104 0FC2CD18 */ jal getCollisionEdge_maybe -/* 0B9C78 7F085108 E7A60304 */ swc1 $f6, 0x304($sp) -/* 0B9C7C 7F08510C C7A8033C */ lwc1 $f8, 0x33c($sp) -/* 0B9C80 7F085110 C7A40348 */ lwc1 $f4, 0x348($sp) -/* 0B9C84 7F085114 C7AA0344 */ lwc1 $f10, 0x344($sp) -/* 0B9C88 7F085118 C7A60350 */ lwc1 $f6, 0x350($sp) -/* 0B9C8C 7F08511C 46044081 */ sub.s $f2, $f8, $f4 -/* 0B9C90 7F085120 46065381 */ sub.s $f14, $f10, $f6 -/* 0B9C94 7F085124 46021202 */ mul.s $f8, $f2, $f2 -/* 0B9C98 7F085128 E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B9C9C 7F08512C 460E7102 */ mul.s $f4, $f14, $f14 -/* 0B9CA0 7F085130 E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B9CA4 7F085134 0C007E08 */ jal sqrtf -/* 0B9CA8 7F085138 46044300 */ add.s $f12, $f8, $f4 -/* 0B9CAC 7F08513C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9CB0 7F085140 44815000 */ mtc1 $at, $f10 -/* 0B9CB4 7F085144 C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B9CB8 7F085148 C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B9CBC 7F08514C 46005403 */ div.s $f16, $f10, $f0 -/* 0B9CC0 7F085150 8E280000 */ lw $t0, ($s1) -/* 0B9CC4 7F085154 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B9CC8 7F085158 46101082 */ mul.s $f2, $f2, $f16 -/* 0B9CCC 7F08515C 00000000 */ nop -/* 0B9CD0 7F085160 46107382 */ mul.s $f14, $f14, $f16 -/* 0B9CD4 7F085164 46001307 */ neg.s $f12, $f2 -/* 0B9CD8 7F085168 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B9CDC 7F08516C E7AE0324 */ swc1 $f14, 0x324($sp) -/* 0B9CE0 7F085170 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B9CE4 7F085174 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B9CE8 7F085178 C7A40048 */ lwc1 $f4, 0x48($sp) -/* 0B9CEC 7F08517C C508048C */ lwc1 $f8, 0x48c($t0) -/* 0B9CF0 7F085180 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9CF4 7F085184 E7A80044 */ swc1 $f8, 0x44($sp) -/* 0B9CF8 7F085188 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B9CFC 7F08518C C7AA0368 */ lwc1 $f10, 0x368($sp) -/* 0B9D00 7F085190 460C3202 */ mul.s $f8, $f6, $f12 -/* 0B9D04 7F085194 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9D08 7F085198 460E3102 */ mul.s $f4, $f6, $f14 -/* 0B9D0C 7F08519C 46044480 */ add.s $f18, $f8, $f4 -/* 0B9D10 7F0851A0 4614903C */ c.lt.s $f18, $f20 -/* 0B9D14 7F0851A4 00000000 */ nop -/* 0B9D18 7F0851A8 45000006 */ bc1f .Ljp7F0851C4 -/* 0B9D1C 7F0851AC 00000000 */ nop -/* 0B9D20 7F0851B0 46007287 */ neg.s $f10, $f14 -/* 0B9D24 7F0851B4 46006187 */ neg.s $f6, $f12 -/* 0B9D28 7F0851B8 46009487 */ neg.s $f18, $f18 -/* 0B9D2C 7F0851BC E7AA0324 */ swc1 $f10, 0x324($sp) -/* 0B9D30 7F0851C0 E7A60320 */ swc1 $f6, 0x320($sp) -.Ljp7F0851C4: -/* 0B9D34 7F0851C4 C7A80048 */ lwc1 $f8, 0x48($sp) -/* 0B9D38 7F0851C8 C7A40350 */ lwc1 $f4, 0x350($sp) -/* 0B9D3C 7F0851CC C7A60320 */ lwc1 $f6, 0x320($sp) -/* 0B9D40 7F0851D0 46044281 */ sub.s $f10, $f8, $f4 -/* 0B9D44 7F0851D4 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B9D48 7F0851D8 46065202 */ mul.s $f8, $f10, $f6 -/* 0B9D4C 7F0851DC C7AA0348 */ lwc1 $f10, 0x348($sp) -/* 0B9D50 7F0851E0 460A2181 */ sub.s $f6, $f4, $f10 -/* 0B9D54 7F0851E4 C7A40324 */ lwc1 $f4, 0x324($sp) -/* 0B9D58 7F0851E8 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9D5C 7F0851EC 460A4000 */ add.s $f0, $f8, $f10 -/* 0B9D60 7F0851F0 4612003C */ c.lt.s $f0, $f18 -/* 0B9D64 7F0851F4 00000000 */ nop -/* 0B9D68 7F0851F8 45020004 */ bc1fl .Ljp7F08520C -/* 0B9D6C 7F0851FC C7A40368 */ lwc1 $f4, 0x368($sp) -/* 0B9D70 7F085200 46009181 */ sub.s $f6, $f18, $f0 -/* 0B9D74 7F085204 E7A6031C */ swc1 $f6, 0x31c($sp) -/* 0B9D78 7F085208 C7A40368 */ lwc1 $f4, 0x368($sp) -.Ljp7F08520C: -/* 0B9D7C 7F08520C C7A80374 */ lwc1 $f8, 0x374($sp) -/* 0B9D80 7F085210 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B9D84 7F085214 C7A6037C */ lwc1 $f6, 0x37c($sp) -/* 0B9D88 7F085218 46082081 */ sub.s $f2, $f4, $f8 -/* 0B9D8C 7F08521C 46065381 */ sub.s $f14, $f10, $f6 -/* 0B9D90 7F085220 46021102 */ mul.s $f4, $f2, $f2 -/* 0B9D94 7F085224 E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B9D98 7F085228 460E7202 */ mul.s $f8, $f14, $f14 -/* 0B9D9C 7F08522C E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B9DA0 7F085230 0C007E08 */ jal sqrtf -/* 0B9DA4 7F085234 46082300 */ add.s $f12, $f4, $f8 -/* 0B9DA8 7F085238 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9DAC 7F08523C 44815000 */ mtc1 $at, $f10 -/* 0B9DB0 7F085240 C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B9DB4 7F085244 C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B9DB8 7F085248 46005403 */ div.s $f16, $f10, $f0 -/* 0B9DBC 7F08524C 8E280000 */ lw $t0, ($s1) -/* 0B9DC0 7F085250 C7AA0370 */ lwc1 $f10, 0x370($sp) -/* 0B9DC4 7F085254 46101082 */ mul.s $f2, $f2, $f16 -/* 0B9DC8 7F085258 00000000 */ nop -/* 0B9DCC 7F08525C 46107382 */ mul.s $f14, $f14, $f16 -/* 0B9DD0 7F085260 46001307 */ neg.s $f12, $f2 -/* 0B9DD4 7F085264 E7AC0308 */ swc1 $f12, 0x308($sp) -/* 0B9DD8 7F085268 E7AE030C */ swc1 $f14, 0x30c($sp) -/* 0B9DDC 7F08526C C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B9DE0 7F085270 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B9DE4 7F085274 C7A80048 */ lwc1 $f8, 0x48($sp) -/* 0B9DE8 7F085278 C504048C */ lwc1 $f4, 0x48c($t0) -/* 0B9DEC 7F08527C 460A4181 */ sub.s $f6, $f8, $f10 -/* 0B9DF0 7F085280 E7A40044 */ swc1 $f4, 0x44($sp) -/* 0B9DF4 7F085284 C7A80044 */ lwc1 $f8, 0x44($sp) -/* 0B9DF8 7F085288 C7AA0368 */ lwc1 $f10, 0x368($sp) -/* 0B9DFC 7F08528C 460C3102 */ mul.s $f4, $f6, $f12 -/* 0B9E00 7F085290 460A4181 */ sub.s $f6, $f8, $f10 -/* 0B9E04 7F085294 460E3202 */ mul.s $f8, $f6, $f14 -/* 0B9E08 7F085298 46082480 */ add.s $f18, $f4, $f8 -/* 0B9E0C 7F08529C 4614903C */ c.lt.s $f18, $f20 -/* 0B9E10 7F0852A0 00000000 */ nop -/* 0B9E14 7F0852A4 45000006 */ bc1f .Ljp7F0852C0 -/* 0B9E18 7F0852A8 00000000 */ nop -/* 0B9E1C 7F0852AC 46007407 */ neg.s $f16, $f14 -/* 0B9E20 7F0852B0 46006287 */ neg.s $f10, $f12 -/* 0B9E24 7F0852B4 46009487 */ neg.s $f18, $f18 -/* 0B9E28 7F0852B8 E7AA0308 */ swc1 $f10, 0x308($sp) -/* 0B9E2C 7F0852BC E7B0030C */ swc1 $f16, 0x30c($sp) -.Ljp7F0852C0: -/* 0B9E30 7F0852C0 C7A60048 */ lwc1 $f6, 0x48($sp) -/* 0B9E34 7F0852C4 C7A40350 */ lwc1 $f4, 0x350($sp) -/* 0B9E38 7F0852C8 C7AC0308 */ lwc1 $f12, 0x308($sp) -/* 0B9E3C 7F0852CC C7B0030C */ lwc1 $f16, 0x30c($sp) -/* 0B9E40 7F0852D0 46043201 */ sub.s $f8, $f6, $f4 -/* 0B9E44 7F0852D4 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B9E48 7F0852D8 460C4282 */ mul.s $f10, $f8, $f12 -/* 0B9E4C 7F0852DC C7A80348 */ lwc1 $f8, 0x348($sp) -/* 0B9E50 7F0852E0 46082201 */ sub.s $f8, $f4, $f8 -/* 0B9E54 7F0852E4 46104202 */ mul.s $f8, $f8, $f16 -/* 0B9E58 7F0852E8 46085000 */ add.s $f0, $f10, $f8 -/* 0B9E5C 7F0852EC C7AA0344 */ lwc1 $f10, 0x344($sp) -/* 0B9E60 7F0852F0 460A3201 */ sub.s $f8, $f6, $f10 -/* 0B9E64 7F0852F4 C7AA033C */ lwc1 $f10, 0x33c($sp) -/* 0B9E68 7F0852F8 460C4182 */ mul.s $f6, $f8, $f12 -/* 0B9E6C 7F0852FC 460A2201 */ sub.s $f8, $f4, $f10 -/* 0B9E70 7F085300 46104102 */ mul.s $f4, $f8, $f16 -/* 0B9E74 7F085304 46043080 */ add.s $f2, $f6, $f4 -/* 0B9E78 7F085308 4600103C */ c.lt.s $f2, $f0 -/* 0B9E7C 7F08530C 00000000 */ nop -/* 0B9E80 7F085310 45020003 */ bc1fl .Ljp7F085320 -/* 0B9E84 7F085314 4612003C */ c.lt.s $f0, $f18 -/* 0B9E88 7F085318 46001006 */ mov.s $f0, $f2 -/* 0B9E8C 7F08531C 4612003C */ c.lt.s $f0, $f18 -.Ljp7F085320: -/* 0B9E90 7F085320 00000000 */ nop -/* 0B9E94 7F085324 45020004 */ bc1fl .Ljp7F085338 -/* 0B9E98 7F085328 C7A20304 */ lwc1 $f2, 0x304($sp) -/* 0B9E9C 7F08532C 46009081 */ sub.s $f2, $f18, $f0 -/* 0B9EA0 7F085330 E7A20304 */ swc1 $f2, 0x304($sp) -/* 0B9EA4 7F085334 C7A20304 */ lwc1 $f2, 0x304($sp) -.Ljp7F085338: -/* 0B9EA8 7F085338 C7AA031C */ lwc1 $f10, 0x31c($sp) -/* 0B9EAC 7F08533C 4602A03E */ c.le.s $f20, $f2 -/* 0B9EB0 7F085340 00000000 */ nop -/* 0B9EB4 7F085344 4502000D */ bc1fl .Ljp7F08537C -/* 0B9EB8 7F085348 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B9EBC 7F08534C 460A103C */ c.lt.s $f2, $f10 -/* 0B9EC0 7F085350 00000000 */ nop -/* 0B9EC4 7F085354 45030006 */ bc1tl .Ljp7F085370 -/* 0B9EC8 7F085358 E7B00324 */ swc1 $f16, 0x324($sp) -/* 0B9ECC 7F08535C 4614503C */ c.lt.s $f10, $f20 -/* 0B9ED0 7F085360 00000000 */ nop -/* 0B9ED4 7F085364 45020005 */ bc1fl .Ljp7F08537C -/* 0B9ED8 7F085368 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B9EDC 7F08536C E7B00324 */ swc1 $f16, 0x324($sp) -.Ljp7F085370: -/* 0B9EE0 7F085370 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B9EE4 7F085374 E7A2031C */ swc1 $f2, 0x31c($sp) -/* 0B9EE8 7F085378 C7A0031C */ lwc1 $f0, 0x31c($sp) -.Ljp7F08537C: -/* 0B9EEC 7F08537C C7A80324 */ lwc1 $f8, 0x324($sp) -/* 0B9EF0 7F085380 4600A03E */ c.le.s $f20, $f0 -/* 0B9EF4 7F085384 00000000 */ nop -/* 0B9EF8 7F085388 45020022 */ bc1fl .Ljp7F085414 -/* 0B9EFC 7F08538C E7B40358 */ swc1 $f20, 0x358($sp) -/* 0B9F00 7F085390 46080182 */ mul.s $f6, $f0, $f8 -/* 0B9F04 7F085394 3C018005 */ lui $at, %hi(D_80055178) # $at, 0x8005 -/* 0B9F08 7F085398 C42451A8 */ lwc1 $f4, %lo(D_80055178)($at) -/* 0B9F0C 7F08539C C7A80320 */ lwc1 $f8, 0x320($sp) -/* 0B9F10 7F0853A0 3C018005 */ lui $at, %hi(D_8005517C) # $at, 0x8005 -/* 0B9F14 7F0853A4 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B9F18 7F0853A8 24050001 */ li $a1, 1 -/* 0B9F1C 7F0853AC 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9F20 7F0853B0 C42451AC */ lwc1 $f4, %lo(D_8005517C)($at) -/* 0B9F24 7F0853B4 46080182 */ mul.s $f6, $f0, $f8 -/* 0B9F28 7F0853B8 E7AA03AC */ swc1 $f10, 0x3ac($sp) -/* 0B9F2C 7F0853BC 46043282 */ mul.s $f10, $f6, $f4 -/* 0B9F30 7F0853C0 0FC1F7E1 */ jal bondviewCalcUpdatePlayerCollision -/* 0B9F34 7F0853C4 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0B9F38 7F0853C8 8E280000 */ lw $t0, ($s1) -/* 0B9F3C 7F0853CC E7B403AC */ swc1 $f20, 0x3ac($sp) -/* 0B9F40 7F0853D0 E7B403B4 */ swc1 $f20, 0x3b4($sp) -/* 0B9F44 7F0853D4 27B90368 */ addiu $t9, $sp, 0x368 -/* 0B9F48 7F0853D8 8D050488 */ lw $a1, 0x488($t0) -/* 0B9F4C 7F0853DC AFB90010 */ sw $t9, 0x10($sp) -/* 0B9F50 7F0853E0 8FA6035C */ lw $a2, 0x35c($sp) -/* 0B9F54 7F0853E4 02003825 */ move $a3, $s0 -/* 0B9F58 7F0853E8 0FC1F43B */ jal bondviewTankCollisionStatus -/* 0B9F5C 7F0853EC 2504048C */ addiu $a0, $t0, 0x48c -/* 0B9F60 7F0853F0 10400004 */ beqz $v0, .Ljp7F085404 -/* 0B9F64 7F0853F4 C7A8035C */ lwc1 $f8, 0x35c($sp) -/* 0B9F68 7F0853F8 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B9F6C 7F0853FC 10000002 */ b .Ljp7F085408 -/* 0B9F70 7F085400 E42864A4 */ swc1 $f8, %lo(g_TankOrientationAngle)($at) -.Ljp7F085404: -/* 0B9F74 7F085404 E7B40358 */ swc1 $f20, 0x358($sp) -.Ljp7F085408: -/* 0B9F78 7F085408 10000002 */ b .Ljp7F085414 -/* 0B9F7C 7F08540C 8E280000 */ lw $t0, ($s1) -/* 0B9F80 7F085410 E7B40358 */ swc1 $f20, 0x358($sp) -.Ljp7F085414: -/* 0B9F84 7F085414 3C018005 */ lui $at, %hi(D_80055180) # $at, 0x8005 -/* 0B9F88 7F085418 C42E51B0 */ lwc1 $f14, %lo(D_80055180)($at) -/* 0B9F8C 7F08541C 3C038003 */ lui $v1, %hi(g_TankTurretAngle) # $v1, 0x8003 -/* 0B9F90 7F085420 246364C4 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x64c4 -/* 0B9F94 7F085424 3C018003 */ lui $at, %hi(g_TankTurretTurn) # $at, 0x8003 -/* 0B9F98 7F085428 C42464C8 */ lwc1 $f4, %lo(g_TankTurretTurn)($at) -/* 0B9F9C 7F08542C C4660000 */ lwc1 $f6, ($v1) -/* 0B9FA0 7F085430 3C078003 */ lui $a3, %hi(g_TankTurretOrientationAngleRad) # $a3, 0x8003 -/* 0B9FA4 7F085434 24E764B4 */ addiu $a3, %lo(g_TankTurretOrientationAngleRad) # addiu $a3, $a3, 0x64b4 -/* 0B9FA8 7F085438 46043280 */ add.s $f10, $f6, $f4 -/* 0B9FAC 7F08543C C4EC0000 */ lwc1 $f12, ($a3) -/* 0B9FB0 7F085440 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B9FB4 7F085444 3C048005 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8005 -/* 0B9FB8 7F085448 E46A0000 */ swc1 $f10, ($v1) -/* 0B9FBC 7F08544C C4600000 */ lwc1 $f0, ($v1) -/* 0B9FC0 7F085450 44815000 */ mtc1 $at, $f10 -/* 0B9FC4 7F085454 46006406 */ mov.s $f16, $f12 -/* 0B9FC8 7F085458 4600703E */ c.le.s $f14, $f0 -/* 0B9FCC 7F08545C 00000000 */ nop -/* 0B9FD0 7F085460 45020005 */ bc1fl .Ljp7F085478 -/* 0B9FD4 7F085464 4614003C */ c.lt.s $f0, $f20 -/* 0B9FD8 7F085468 460E0201 */ sub.s $f8, $f0, $f14 -/* 0B9FDC 7F08546C E4680000 */ swc1 $f8, ($v1) -/* 0B9FE0 7F085470 C4600000 */ lwc1 $f0, ($v1) -/* 0B9FE4 7F085474 4614003C */ c.lt.s $f0, $f20 -.Ljp7F085478: -/* 0B9FE8 7F085478 00000000 */ nop -/* 0B9FEC 7F08547C 45020005 */ bc1fl .Ljp7F085494 -/* 0B9FF0 7F085480 C504014C */ lwc1 $f4, 0x14c($t0) -/* 0B9FF4 7F085484 460E0180 */ add.s $f6, $f0, $f14 -/* 0B9FF8 7F085488 E4660000 */ swc1 $f6, ($v1) -/* 0B9FFC 7F08548C C4600000 */ lwc1 $f0, ($v1) -/* 0BA000 7F085490 C504014C */ lwc1 $f4, 0x14c($t0) -.Ljp7F085494: -/* 0BA004 7F085494 3C018005 */ lui $at, %hi(D_80055184) # $at, 0x8005 -/* 0BA008 7F085498 C42651B4 */ lwc1 $f6, %lo(D_80055184)($at) -/* 0BA00C 7F08549C 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BA010 7F0854A0 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0BA014 7F0854A4 44815000 */ mtc1 $at, $f10 -/* 0BA018 7F0854A8 3C018005 */ lui $at, %hi(D_80055188) # $at, 0x8005 -/* 0BA01C 7F0854AC 46064102 */ mul.s $f4, $f8, $f6 -/* 0BA020 7F0854B0 00000000 */ nop -/* 0BA024 7F0854B4 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BA028 7F0854B8 46004080 */ add.s $f2, $f8, $f0 -/* 0BA02C 7F0854BC 4614103C */ c.lt.s $f2, $f20 -/* 0BA030 7F0854C0 00000000 */ nop -/* 0BA034 7F0854C4 45000002 */ bc1f .Ljp7F0854D0 -/* 0BA038 7F0854C8 00000000 */ nop -/* 0BA03C 7F0854CC 460E1080 */ add.s $f2, $f2, $f14 -.Ljp7F0854D0: -/* 0BA040 7F0854D0 4602703E */ c.le.s $f14, $f2 -/* 0BA044 7F0854D4 00000000 */ nop -/* 0BA048 7F0854D8 45020003 */ bc1fl .Ljp7F0854E8 -/* 0BA04C 7F0854DC 460C1001 */ sub.s $f0, $f2, $f12 -/* 0BA050 7F0854E0 460E1081 */ sub.s $f2, $f2, $f14 -/* 0BA054 7F0854E4 460C1001 */ sub.s $f0, $f2, $f12 -.Ljp7F0854E8: -/* 0BA058 7F0854E8 C42651B8 */ lwc1 $f6, %lo(D_80055188)($at) -/* 0BA05C 7F0854EC 3C018005 */ lui $at, %hi(D_80055190) -/* 0BA060 7F0854F0 4600303E */ c.le.s $f6, $f0 -/* 0BA064 7F0854F4 00000000 */ nop -/* 0BA068 7F0854F8 45000005 */ bc1f .Ljp7F085510 -/* 0BA06C 7F0854FC 00000000 */ nop -/* 0BA070 7F085500 3C018005 */ lui $at, %hi(D_8005518C) # $at, 0x8005 -/* 0BA074 7F085504 C42451BC */ lwc1 $f4, %lo(D_8005518C)($at) -/* 0BA078 7F085508 10000009 */ b .Ljp7F085530 -/* 0BA07C 7F08550C 46041081 */ sub.s $f2, $f2, $f4 -.Ljp7F085510: -/* 0BA080 7F085510 C42A51C0 */ lwc1 $f10, %lo(D_80055190)($at) -/* 0BA084 7F085514 3C018005 */ lui $at, %hi(D_80055194) # $at, 0x8005 -/* 0BA088 7F085518 460A003C */ c.lt.s $f0, $f10 -/* 0BA08C 7F08551C 00000000 */ nop -/* 0BA090 7F085520 45000003 */ bc1f .Ljp7F085530 -/* 0BA094 7F085524 00000000 */ nop -/* 0BA098 7F085528 C42851C4 */ lwc1 $f8, %lo(D_80055194)($at) -/* 0BA09C 7F08552C 46081080 */ add.s $f2, $f2, $f8 -.Ljp7F085530: -/* 0BA0A0 7F085530 8C8483A4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0BA0A4 7F085534 00001025 */ move $v0, $zero -/* 0BA0A8 7F085538 3C018005 */ lui $at, %hi(D_80055198) # $at, 0x8005 -/* 0BA0AC 7F08553C 18800013 */ blez $a0, .Ljp7F08558C -/* 0BA0B0 7F085540 3C108003 */ lui $s0, %hi(D_80036478) # $s0, 0x8003 -/* 0BA0B4 7F085544 C42E51C8 */ lwc1 $f14, %lo(D_80055198)($at) -/* 0BA0B8 7F085548 261064B8 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x64b8 -/* 0BA0BC 7F08554C C60C0000 */ lwc1 $f12, ($s0) -/* 0BA0C0 7F085550 24420001 */ addiu $v0, $v0, 1 -/* 0BA0C4 7F085554 0044082A */ slt $at, $v0, $a0 -/* 0BA0C8 7F085558 460C7482 */ mul.s $f18, $f14, $f12 -/* 0BA0CC 7F08555C 5020000A */ beql $at, $zero, .Ljp7F085588 -/* 0BA0D0 7F085560 46029300 */ add.s $f12, $f18, $f2 -/* 0BA0D4 7F085564 46029300 */ add.s $f12, $f18, $f2 -.Ljp7F085568: -/* 0BA0D8 7F085568 24420001 */ addiu $v0, $v0, 1 -/* 0BA0DC 7F08556C 0044082A */ slt $at, $v0, $a0 -/* 0BA0E0 7F085570 E60C0000 */ swc1 $f12, ($s0) -/* 0BA0E4 7F085574 C60C0000 */ lwc1 $f12, ($s0) -/* 0BA0E8 7F085578 460C7482 */ mul.s $f18, $f14, $f12 -/* 0BA0EC 7F08557C 5420FFFA */ bnezl $at, .Ljp7F085568 -/* 0BA0F0 7F085580 46029300 */ add.s $f12, $f18, $f2 -/* 0BA0F4 7F085584 46029300 */ add.s $f12, $f18, $f2 -.Ljp7F085588: -/* 0BA0F8 7F085588 E60C0000 */ swc1 $f12, ($s0) -.Ljp7F08558C: -/* 0BA0FC 7F08558C 3C108003 */ lui $s0, %hi(D_80036478) # $s0, 0x8003 -/* 0BA100 7F085590 261064B8 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x64b8 -/* 0BA104 7F085594 3C018005 */ lui $at, %hi(D_8005519C) # $at, 0x8005 -/* 0BA108 7F085598 C42051CC */ lwc1 $f0, %lo(D_8005519C)($at) -/* 0BA10C 7F08559C C6080000 */ lwc1 $f8, ($s0) -/* 0BA110 7F0855A0 3C018005 */ lui $at, %hi(D_800551A0) # $at, 0x8005 -/* 0BA114 7F0855A4 C42251D0 */ lwc1 $f2, %lo(D_800551A0)($at) -/* 0BA118 7F0855A8 46004182 */ mul.s $f6, $f8, $f0 -/* 0BA11C 7F0855AC 2504048C */ addiu $a0, $t0, 0x48c -/* 0BA120 7F0855B0 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) # $a2, 0x8003 -/* 0BA124 7F0855B4 E4E60000 */ swc1 $f6, ($a3) -/* 0BA128 7F0855B8 C4EC0000 */ lwc1 $f12, ($a3) -/* 0BA12C 7F0855BC 460C103E */ c.le.s $f2, $f12 -/* 0BA130 7F0855C0 00000000 */ nop -/* 0BA134 7F0855C4 45020007 */ bc1fl .Ljp7F0855E4 -/* 0BA138 7F0855C8 4614603C */ c.lt.s $f12, $f20 -/* 0BA13C 7F0855CC 46026101 */ sub.s $f4, $f12, $f2 -/* 0BA140 7F0855D0 E4E40000 */ swc1 $f4, ($a3) -/* 0BA144 7F0855D4 C4EC0000 */ lwc1 $f12, ($a3) -/* 0BA148 7F0855D8 46006283 */ div.s $f10, $f12, $f0 -/* 0BA14C 7F0855DC E60A0000 */ swc1 $f10, ($s0) -/* 0BA150 7F0855E0 4614603C */ c.lt.s $f12, $f20 -.Ljp7F0855E4: -/* 0BA154 7F0855E4 00000000 */ nop -/* 0BA158 7F0855E8 45020007 */ bc1fl .Ljp7F085608 -/* 0BA15C 7F0855EC 8D050488 */ lw $a1, 0x488($t0) -/* 0BA160 7F0855F0 46026200 */ add.s $f8, $f12, $f2 -/* 0BA164 7F0855F4 E4E80000 */ swc1 $f8, ($a3) -/* 0BA168 7F0855F8 C4E60000 */ lwc1 $f6, ($a3) -/* 0BA16C 7F0855FC 46003103 */ div.s $f4, $f6, $f0 -/* 0BA170 7F085600 E6040000 */ swc1 $f4, ($s0) -/* 0BA174 7F085604 8D050488 */ lw $a1, 0x488($t0) -.Ljp7F085608: -/* 0BA178 7F085608 E7B00354 */ swc1 $f16, 0x354($sp) -/* 0BA17C 7F08560C 0FC1F4F3 */ jal bondviewCallTankCollisionStatus -/* 0BA180 7F085610 8CC664A4 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0BA184 7F085614 3C038003 */ lui $v1, %hi(g_TankTurretAngle) # $v1, 0x8003 -/* 0BA188 7F085618 3C018005 */ lui $at, %hi(D_800551A8) # $at, 0x8005 -/* 0BA18C 7F08561C C42E51D8 */ lwc1 $f14, %lo(D_800551A8)($at) -/* 0BA190 7F085620 246364C4 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x64c4 -/* 0BA194 7F085624 14400009 */ bnez $v0, .Ljp7F08564C -/* 0BA198 7F085628 C7B00354 */ lwc1 $f16, 0x354($sp) -/* 0BA19C 7F08562C 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0BA1A0 7F085630 E43064B4 */ swc1 $f16, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BA1A4 7F085634 C42A64B4 */ lwc1 $f10, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BA1A8 7F085638 3C018005 */ lui $at, %hi(D_800551AC) # $at, 0x8005 -/* 0BA1AC 7F08563C C42851DC */ lwc1 $f8, %lo(D_800551AC)($at) -/* 0BA1B0 7F085640 E4700000 */ swc1 $f16, ($v1) -/* 0BA1B4 7F085644 46085183 */ div.s $f6, $f10, $f8 -/* 0BA1B8 7F085648 E6060000 */ swc1 $f6, ($s0) -.Ljp7F08564C: -/* 0BA1BC 7F08564C 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0BA1C0 7F085650 8C636490 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0BA1C4 7F085654 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8008 -/* 0BA1C8 7F085658 244299E8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6618 -/* 0BA1CC 7F08565C 1060002F */ beqz $v1, .Ljp7F08571C -/* 0BA1D0 7F085660 27B002B4 */ addiu $s0, $sp, 0x2b4 -/* 0BA1D4 7F085664 8C6C0004 */ lw $t4, 4($v1) -/* 0BA1D8 7F085668 C4440000 */ lwc1 $f4, ($v0) -/* 0BA1DC 7F08566C C44A0008 */ lwc1 $f10, 8($v0) -/* 0BA1E0 7F085670 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0BA1E4 7F085674 C7AC0358 */ lwc1 $f12, 0x358($sp) -/* 0BA1E8 7F085678 02002825 */ move $a1, $s0 -/* 0BA1EC 7F08567C AFAC0300 */ sw $t4, 0x300($sp) -/* 0BA1F0 7F085680 E7A402F4 */ swc1 $f4, 0x2f4($sp) -/* 0BA1F4 7F085684 0FC162C7 */ jal matrix_4x4_set_rotation_around_y -/* 0BA1F8 7F085688 E7AA02FC */ swc1 $f10, 0x2fc($sp) -/* 0BA1FC 7F08568C 02002025 */ move $a0, $s0 -/* 0BA200 7F085690 0FC1623E */ jal matrix_4x4_rotate_vector_in_place -/* 0BA204 7F085694 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0BA208 7F085698 0FC1F376 */ jal sub_GAME_7F07C7B4 -/* 0BA20C 7F08569C 00000000 */ nop -/* 0BA210 7F0856A0 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8008 -/* 0BA214 7F0856A4 244299E8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6618 -/* 0BA218 7F0856A8 C4480000 */ lwc1 $f8, ($v0) -/* 0BA21C 7F0856AC C7A602F4 */ lwc1 $f6, 0x2f4($sp) -/* 0BA220 7F0856B0 C44A0008 */ lwc1 $f10, 8($v0) -/* 0BA224 7F0856B4 3C018005 */ lui $at, %hi(D_800551BC) # $at, 0x8005 -/* 0BA228 7F0856B8 46064101 */ sub.s $f4, $f8, $f6 -/* 0BA22C 7F0856BC C7A802FC */ lwc1 $f8, 0x2fc($sp) -/* 0BA230 7F0856C0 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0BA234 7F0856C4 02002825 */ move $a1, $s0 -/* 0BA238 7F0856C8 E7A402F4 */ swc1 $f4, 0x2f4($sp) -/* 0BA23C 7F0856CC 46085181 */ sub.s $f6, $f10, $f8 -/* 0BA240 7F0856D0 C42451EC */ lwc1 $f4, %lo(D_800551BC)($at) -/* 0BA244 7F0856D4 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BA248 7F0856D8 C42A64A4 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0BA24C 7F0856DC E7A602FC */ swc1 $f6, 0x2fc($sp) -/* 0BA250 7F0856E0 0FC162C7 */ jal matrix_4x4_set_rotation_around_y -/* 0BA254 7F0856E4 460A2301 */ sub.s $f12, $f4, $f10 -/* 0BA258 7F0856E8 8FAB0300 */ lw $t3, 0x300($sp) -/* 0BA25C 7F0856EC 02002825 */ move $a1, $s0 -/* 0BA260 7F0856F0 8D6D0014 */ lw $t5, 0x14($t3) -/* 0BA264 7F0856F4 0FC163E7 */ jal matrix_scalar_multiply -/* 0BA268 7F0856F8 C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0BA26C 7F0856FC 02002025 */ move $a0, $s0 -/* 0BA270 7F085700 0FC1623E */ jal matrix_4x4_rotate_vector_in_place -/* 0BA274 7F085704 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0BA278 7F085708 27A402F4 */ addiu $a0, $sp, 0x2f4 -/* 0BA27C 7F08570C 0FC1F7E1 */ jal bondviewCalcUpdatePlayerCollision -/* 0BA280 7F085710 24050001 */ li $a1, 1 -/* 0BA284 7F085714 3C018005 */ lui $at, %hi(D_800551CC) # $at, 0x8005 -/* 0BA288 7F085718 C42E51FC */ lwc1 $f14, %lo(D_800551CC)($at) -.Ljp7F08571C: -/* 0BA28C 7F08571C 3C048005 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8005 -/* 0BA290 7F085720 8C8483A4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0BA294 7F085724 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0BA298 7F085728 C42C64B4 */ lwc1 $f12, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BA29C 7F08572C 5880001B */ blezl $a0, .Ljp7F08579C -/* 0BA2A0 7F085730 3C0143B4 */ lui $at, 0x43b4 -/* 0BA2A4 7F085734 18800018 */ blez $a0, .Ljp7F085798 -/* 0BA2A8 7F085738 00001025 */ move $v0, $zero -/* 0BA2AC 7F08573C 3C018003 */ lui $at, %hi(g_TankTurretTurn) # $at, 0x8003 -/* 0BA2B0 7F085740 C42864C8 */ lwc1 $f8, %lo(g_TankTurretTurn)($at) -/* 0BA2B4 7F085744 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BA2B8 7F085748 C42683B4 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0BA2BC 7F08574C 3C038003 */ lui $v1, %hi(D_8003647C) # $v1, 0x8003 -/* 0BA2C0 7F085750 246364BC */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x64bc -/* 0BA2C4 7F085754 46064003 */ div.s $f0, $f8, $f6 -/* 0BA2C8 7F085758 C4700000 */ lwc1 $f16, ($v1) -/* 0BA2CC 7F08575C 24420001 */ addiu $v0, $v0, 1 -/* 0BA2D0 7F085760 0044082A */ slt $at, $v0, $a0 -/* 0BA2D4 7F085764 46107482 */ mul.s $f18, $f14, $f16 -/* 0BA2D8 7F085768 5020000A */ beql $at, $zero, .Ljp7F085794 -/* 0BA2DC 7F08576C 46009400 */ add.s $f16, $f18, $f0 -/* 0BA2E0 7F085770 46009400 */ add.s $f16, $f18, $f0 -.Ljp7F085774: -/* 0BA2E4 7F085774 24420001 */ addiu $v0, $v0, 1 -/* 0BA2E8 7F085778 0044082A */ slt $at, $v0, $a0 -/* 0BA2EC 7F08577C E4700000 */ swc1 $f16, ($v1) -/* 0BA2F0 7F085780 C4700000 */ lwc1 $f16, ($v1) -/* 0BA2F4 7F085784 46107482 */ mul.s $f18, $f14, $f16 -/* 0BA2F8 7F085788 5420FFFA */ bnezl $at, .Ljp7F085774 -/* 0BA2FC 7F08578C 46009400 */ add.s $f16, $f18, $f0 -/* 0BA300 7F085790 46009400 */ add.s $f16, $f18, $f0 -.Ljp7F085794: -/* 0BA304 7F085794 E4700000 */ swc1 $f16, ($v1) -.Ljp7F085798: -/* 0BA308 7F085798 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.Ljp7F08579C: -/* 0BA30C 7F08579C 44817000 */ mtc1 $at, $f14 -/* 0BA310 7F0857A0 3C038003 */ lui $v1, %hi(D_8003647C) # $v1, 0x8003 -/* 0BA314 7F0857A4 246364BC */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x64bc -/* 0BA318 7F0857A8 3C018005 */ lui $at, %hi(D_800551D0) # $at, 0x8005 -/* 0BA31C 7F0857AC C4245200 */ lwc1 $f4, %lo(D_800551D0)($at) -/* 0BA320 7F0857B0 C4660000 */ lwc1 $f6, ($v1) -/* 0BA324 7F0857B4 8E280000 */ lw $t0, ($s1) -/* 0BA328 7F0857B8 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0BA32C 7F0857BC 46043082 */ mul.s $f2, $f6, $f4 -/* 0BA330 7F0857C0 44814000 */ mtc1 $at, $f8 -/* 0BA334 7F0857C4 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0BA338 7F0857C8 3C018005 */ lui $at, %hi(D_800551D4) # $at, 0x8005 -/* 0BA33C 7F0857CC C4245204 */ lwc1 $f4, %lo(D_800551D4)($at) -/* 0BA340 7F0857D0 46085182 */ mul.s $f6, $f10, $f8 -/* 0BA344 7F0857D4 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0BA348 7F0857D8 44814000 */ mtc1 $at, $f8 -/* 0BA34C 7F0857DC 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BA350 7F0857E0 46043282 */ mul.s $f10, $f6, $f4 -/* 0BA354 7F0857E4 C42464A4 */ lwc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0BA358 7F0857E8 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0BA35C 7F0857EC 46085182 */ mul.s $f6, $f10, $f8 -/* 0BA360 7F0857F0 460C2280 */ add.s $f10, $f4, $f12 -/* 0BA364 7F0857F4 44812000 */ mtc1 $at, $f4 -/* 0BA368 7F0857F8 3C018005 */ lui $at, %hi(D_800551D8) # $at, 0x8005 -/* 0BA36C 7F0857FC 46065200 */ add.s $f8, $f10, $f6 -/* 0BA370 7F085800 46041282 */ mul.s $f10, $f2, $f4 -/* 0BA374 7F085804 460A4180 */ add.s $f6, $f8, $f10 -/* 0BA378 7F085808 C4285208 */ lwc1 $f8, %lo(D_800551D8)($at) -/* 0BA37C 7F08580C 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BA380 7F085810 46082283 */ div.s $f10, $f4, $f8 -/* 0BA384 7F085814 E50A0148 */ swc1 $f10, 0x148($t0) -/* 0BA388 7F085818 8E280000 */ lw $t0, ($s1) -/* 0BA38C 7F08581C C5000148 */ lwc1 $f0, 0x148($t0) -/* 0BA390 7F085820 4614003C */ c.lt.s $f0, $f20 -/* 0BA394 7F085824 00000000 */ nop -/* 0BA398 7F085828 4502000A */ bc1fl .Ljp7F085854 -/* 0BA39C 7F08582C 4600703E */ c.le.s $f14, $f0 -/* 0BA3A0 7F085830 460E0180 */ add.s $f6, $f0, $f14 -.Ljp7F085834: -/* 0BA3A4 7F085834 E5060148 */ swc1 $f6, 0x148($t0) -/* 0BA3A8 7F085838 8E280000 */ lw $t0, ($s1) -/* 0BA3AC 7F08583C C5000148 */ lwc1 $f0, 0x148($t0) -/* 0BA3B0 7F085840 4614003C */ c.lt.s $f0, $f20 -/* 0BA3B4 7F085844 00000000 */ nop -/* 0BA3B8 7F085848 4503FFFA */ bc1tl .Ljp7F085834 -/* 0BA3BC 7F08584C 460E0180 */ add.s $f6, $f0, $f14 -/* 0BA3C0 7F085850 4600703E */ c.le.s $f14, $f0 -.Ljp7F085854: -/* 0BA3C4 7F085854 00000000 */ nop -/* 0BA3C8 7F085858 45000009 */ bc1f .Ljp7F085880 -/* 0BA3CC 7F08585C 00000000 */ nop -/* 0BA3D0 7F085860 460E0101 */ sub.s $f4, $f0, $f14 -.Ljp7F085864: -/* 0BA3D4 7F085864 E5040148 */ swc1 $f4, 0x148($t0) -/* 0BA3D8 7F085868 8E280000 */ lw $t0, ($s1) -/* 0BA3DC 7F08586C C5000148 */ lwc1 $f0, 0x148($t0) -/* 0BA3E0 7F085870 4600703E */ c.le.s $f14, $f0 -/* 0BA3E4 7F085874 00000000 */ nop -/* 0BA3E8 7F085878 4503FFFA */ bc1tl .Ljp7F085864 -/* 0BA3EC 7F08587C 460E0101 */ sub.s $f4, $f0, $f14 -.Ljp7F085880: -/* 0BA3F0 7F085880 10000022 */ b .Ljp7F08590C -/* 0BA3F4 7F085884 00000000 */ nop -.Ljp7F085888: -/* 0BA3F8 7F085888 C508014C */ lwc1 $f8, 0x14c($t0) -/* 0BA3FC 7F08588C C52A0000 */ lwc1 $f10, ($t1) -/* 0BA400 7F085890 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0BA404 7F085894 44812000 */ mtc1 $at, $f4 -/* 0BA408 7F085898 460A4182 */ mul.s $f6, $f8, $f10 -/* 0BA40C 7F08589C C50A0148 */ lwc1 $f10, 0x148($t0) -/* 0BA410 7F0858A0 3C0143B4 */ lui $at, 0x43b4 -/* 0BA414 7F0858A4 46043202 */ mul.s $f8, $f6, $f4 -/* 0BA418 7F0858A8 46085000 */ add.s $f0, $f10, $f8 -/* 0BA41C 7F0858AC 4614003C */ c.lt.s $f0, $f20 -/* 0BA420 7F0858B0 00000000 */ nop -/* 0BA424 7F0858B4 45020009 */ bc1fl .Ljp7F0858DC -/* 0BA428 7F0858B8 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0BA42C 7F0858BC 44817000 */ mtc1 $at, $f14 -/* 0BA430 7F0858C0 00000000 */ nop -/* 0BA434 7F0858C4 460E0000 */ add.s $f0, $f0, $f14 -.Ljp7F0858C8: -/* 0BA438 7F0858C8 4614003C */ c.lt.s $f0, $f20 -/* 0BA43C 7F0858CC 00000000 */ nop -/* 0BA440 7F0858D0 4503FFFD */ bc1tl .Ljp7F0858C8 -/* 0BA444 7F0858D4 460E0000 */ add.s $f0, $f0, $f14 -/* 0BA448 7F0858D8 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.Ljp7F0858DC: -/* 0BA44C 7F0858DC 44817000 */ mtc1 $at, $f14 -/* 0BA450 7F0858E0 00000000 */ nop -/* 0BA454 7F0858E4 4600703E */ c.le.s $f14, $f0 -/* 0BA458 7F0858E8 00000000 */ nop -/* 0BA45C 7F0858EC 45020007 */ bc1fl .Ljp7F08590C -/* 0BA460 7F0858F0 E5000148 */ swc1 $f0, 0x148($t0) -/* 0BA464 7F0858F4 460E0001 */ sub.s $f0, $f0, $f14 -.Ljp7F0858F8: -/* 0BA468 7F0858F8 4600703E */ c.le.s $f14, $f0 -/* 0BA46C 7F0858FC 00000000 */ nop -/* 0BA470 7F085900 4503FFFD */ bc1tl .Ljp7F0858F8 -/* 0BA474 7F085904 460E0001 */ sub.s $f0, $f0, $f14 -/* 0BA478 7F085908 E5000148 */ swc1 $f0, 0x148($t0) -.Ljp7F08590C: -/* 0BA47C 7F08590C 0FC20768 */ jal bondviewApplyVertaTheta -/* 0BA480 7F085910 00000000 */ nop -/* 0BA484 7F085914 0FC1E7F8 */ jal currentPlayerGetCrouchPos -/* 0BA488 7F085918 E7B402AC */ swc1 $f20, 0x2ac($sp) -/* 0BA48C 7F08591C 14400004 */ bnez $v0, .Ljp7F085930 -/* 0BA490 7F085920 3C01C2C8 */ li $at, 0xC2C80000 # -100.000000 -/* 0BA494 7F085924 44813000 */ mtc1 $at, $f6 -/* 0BA498 7F085928 1000000B */ b .Ljp7F085958 -/* 0BA49C 7F08592C E7A602AC */ swc1 $f6, 0x2ac($sp) -.Ljp7F085930: -/* 0BA4A0 7F085930 0FC1E7F8 */ jal currentPlayerGetCrouchPos -/* 0BA4A4 7F085934 00000000 */ nop -/* 0BA4A8 7F085938 24010001 */ li $at, 1 -/* 0BA4AC 7F08593C 14410004 */ bne $v0, $at, .Ljp7F085950 -/* 0BA4B0 7F085940 3C01C270 */ li $at, 0xC2700000 # -60.000000 -/* 0BA4B4 7F085944 44812000 */ mtc1 $at, $f4 -/* 0BA4B8 7F085948 10000003 */ b .Ljp7F085958 -/* 0BA4BC 7F08594C E7A402AC */ swc1 $f4, 0x2ac($sp) -.Ljp7F085950: -/* 0BA4C0 7F085950 0FC1E7F8 */ jal currentPlayerGetCrouchPos -/* 0BA4C4 7F085954 00000000 */ nop -.Ljp7F085958: -/* 0BA4C8 7F085958 8E280000 */ lw $t0, ($s1) -/* 0BA4CC 7F08595C C7AA02AC */ lwc1 $f10, 0x2ac($sp) -/* 0BA4D0 7F085960 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0BA4D4 7F085964 C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0BA4D8 7F085968 250400A0 */ addiu $a0, $t0, 0xa0 -/* 0BA4DC 7F08596C 250600A4 */ addiu $a2, $t0, 0xa4 -/* 0BA4E0 7F085970 46005032 */ c.eq.s $f10, $f0 -/* 0BA4E4 7F085974 00000000 */ nop -/* 0BA4E8 7F085978 4503000C */ bc1tl .Ljp7F0859AC -/* 0BA4EC 7F08597C C7A602AC */ lwc1 $f6, 0x2ac($sp) -/* 0BA4F0 7F085980 44810000 */ mtc1 $at, $f0 -/* 0BA4F4 7F085984 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0BA4F8 7F085988 44814000 */ mtc1 $at, $f8 -/* 0BA4FC 7F08598C 44055000 */ mfc1 $a1, $f10 -/* 0BA500 7F085990 44070000 */ mfc1 $a3, $f0 -/* 0BA504 7F085994 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0BA508 7F085998 0FC10C86 */ jal chrobjApplySpeed -/* 0BA50C 7F08599C E7A80014 */ swc1 $f8, 0x14($sp) -/* 0BA510 7F0859A0 8E280000 */ lw $t0, ($s1) -/* 0BA514 7F0859A4 C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0BA518 7F0859A8 C7A602AC */ lwc1 $f6, 0x2ac($sp) -.Ljp7F0859AC: -/* 0BA51C 7F0859AC 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0BA520 7F0859B0 3C0E8003 */ lui $t6, %hi(in_tank_flag) # $t6, 0x8003 -/* 0BA524 7F0859B4 46003032 */ c.eq.s $f6, $f0 -/* 0BA528 7F0859B8 26106498 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6498 -/* 0BA52C 7F0859BC 45000002 */ bc1f .Ljp7F0859C8 -/* 0BA530 7F0859C0 00000000 */ nop -/* 0BA534 7F0859C4 E51400A4 */ swc1 $f20, 0xa4($t0) -.Ljp7F0859C8: -/* 0BA538 7F0859C8 8DCE6488 */ lw $t6, %lo(in_tank_flag)($t6) -/* 0BA53C 7F0859CC 24010001 */ li $at, 1 -/* 0BA540 7F0859D0 15C10209 */ bne $t6, $at, .Ljp7F0861F8 -/* 0BA544 7F0859D4 3C028008 */ lui $v0, %hi(g_EnterTankAudioState) # $v0, 0x8008 -/* 0BA548 7F0859D8 8C4299F8 */ lw $v0, %lo(g_EnterTankAudioState)($v0) -/* 0BA54C 7F0859DC 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0BA550 7F0859E0 24010001 */ li $at, 1 -/* 0BA554 7F0859E4 144000BF */ bnez $v0, .Ljp7F085CE4 -/* 0BA558 7F0859E8 00000000 */ nop -/* 0BA55C 7F0859EC 8C636490 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0BA560 7F0859F0 3C018005 */ lui $at, %hi(D_800551DC) # $at, 0x8005 -/* 0BA564 7F0859F4 27A50268 */ addiu $a1, $sp, 0x268 -/* 0BA568 7F0859F8 106000AD */ beqz $v1, .Ljp7F085CB0 -/* 0BA56C 7F0859FC 00000000 */ nop -/* 0BA570 7F085A00 C424520C */ lwc1 $f4, %lo(D_800551DC)($at) -/* 0BA574 7F085A04 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BA578 7F085A08 C42A64A4 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0BA57C 7F085A0C 8C700004 */ lw $s0, 4($v1) -/* 0BA580 7F085A10 0FC162C7 */ jal matrix_4x4_set_rotation_around_y -/* 0BA584 7F085A14 460A2301 */ sub.s $f12, $f4, $f10 -/* 0BA588 7F085A18 8E180014 */ lw $t8, 0x14($s0) -/* 0BA58C 7F085A1C 27A50268 */ addiu $a1, $sp, 0x268 -/* 0BA590 7F085A20 0FC163E7 */ jal matrix_scalar_multiply -/* 0BA594 7F085A24 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0BA598 7F085A28 3C028008 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8008 -/* 0BA59C 7F085A2C 244299E8 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x6618 -/* 0BA5A0 7F085A30 C4480000 */ lwc1 $f8, ($v0) -/* 0BA5A4 7F085A34 C4460004 */ lwc1 $f6, 4($v0) -/* 0BA5A8 7F085A38 C4440008 */ lwc1 $f4, 8($v0) -/* 0BA5AC 7F085A3C 27A40268 */ addiu $a0, $sp, 0x268 -/* 0BA5B0 7F085A40 27A5025C */ addiu $a1, $sp, 0x25c -/* 0BA5B4 7F085A44 E7A8025C */ swc1 $f8, 0x25c($sp) -/* 0BA5B8 7F085A48 E7A60260 */ swc1 $f6, 0x260($sp) -/* 0BA5BC 7F085A4C 0FC1623E */ jal matrix_4x4_rotate_vector_in_place -/* 0BA5C0 7F085A50 E7A40264 */ swc1 $f4, 0x264($sp) -/* 0BA5C4 7F085A54 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 0BA5C8 7F085A58 C6080058 */ lwc1 $f8, 0x58($s0) -/* 0BA5CC 7F085A5C C7A40260 */ lwc1 $f4, 0x260($sp) -/* 0BA5D0 7F085A60 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0BA5D4 7F085A64 46085180 */ add.s $f6, $f10, $f8 -/* 0BA5D8 7F085A68 44810000 */ mtc1 $at, $f0 -/* 0BA5DC 7F085A6C 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0BA5E0 7F085A70 44817000 */ mtc1 $at, $f14 -/* 0BA5E4 7F085A74 E7A6025C */ swc1 $f6, 0x25c($sp) -/* 0BA5E8 7F085A78 C60A005C */ lwc1 $f10, 0x5c($s0) -/* 0BA5EC 7F085A7C C7A60264 */ lwc1 $f6, 0x264($sp) -/* 0BA5F0 7F085A80 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BA5F4 7F085A84 460A2200 */ add.s $f8, $f4, $f10 -/* 0BA5F8 7F085A88 8E2F0000 */ lw $t7, ($s1) -/* 0BA5FC 7F085A8C E7A80260 */ swc1 $f8, 0x260($sp) -/* 0BA600 7F085A90 C6040060 */ lwc1 $f4, 0x60($s0) -/* 0BA604 7F085A94 C42864A4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0BA608 7F085A98 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0BA60C 7F085A9C 46043280 */ add.s $f10, $f6, $f4 -/* 0BA610 7F085AA0 C42664B4 */ lwc1 $f6, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BA614 7F085AA4 3C018005 */ lui $at, %hi(D_800551E0) # $at, 0x8005 -/* 0BA618 7F085AA8 46064100 */ add.s $f4, $f8, $f6 -/* 0BA61C 7F085AAC E7AA0264 */ swc1 $f10, 0x264($sp) -/* 0BA620 7F085AB0 C5E20158 */ lwc1 $f2, 0x158($t7) -/* 0BA624 7F085AB4 C4285210 */ lwc1 $f8, %lo(D_800551E0)($at) -/* 0BA628 7F085AB8 460E2282 */ mul.s $f10, $f4, $f14 -/* 0BA62C 7F085ABC 4600103C */ c.lt.s $f2, $f0 -/* 0BA630 7F085AC0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA634 7F085AC4 44819000 */ mtc1 $at, $f18 -/* 0BA638 7F085AC8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BA63C 7F085ACC 45000002 */ bc1f .Ljp7F085AD8 -/* 0BA640 7F085AD0 46085403 */ div.s $f16, $f10, $f8 -/* 0BA644 7F085AD4 46000086 */ mov.s $f2, $f0 -.Ljp7F085AD8: -/* 0BA648 7F085AD8 C42683B4 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0BA64C 7F085ADC 3C014234 */ li $at, 0x42340000 # 45.000000 -/* 0BA650 7F085AE0 44812000 */ mtc1 $at, $f4 -/* 0BA654 7F085AE4 3C108008 */ lui $s0, %hi(g_TankEnteringSitHeight) # $s0, 0x8008 -/* 0BA658 7F085AE8 261099FC */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x6604 -/* 0BA65C 7F085AEC 46043283 */ div.s $f10, $f6, $f4 -/* 0BA660 7F085AF0 C6080000 */ lwc1 $f8, ($s0) -/* 0BA664 7F085AF4 3C018005 */ lui $at, %hi(D_800551E4) # $at, 0x8005 -/* 0BA668 7F085AF8 460A4180 */ add.s $f6, $f8, $f10 -/* 0BA66C 7F085AFC E6060000 */ swc1 $f6, ($s0) -/* 0BA670 7F085B00 C6000000 */ lwc1 $f0, ($s0) -/* 0BA674 7F085B04 4600903E */ c.le.s $f18, $f0 -/* 0BA678 7F085B08 00000000 */ nop -/* 0BA67C 7F085B0C 45000003 */ bc1f .Ljp7F085B1C -/* 0BA680 7F085B10 00000000 */ nop -/* 0BA684 7F085B14 E6120000 */ swc1 $f18, ($s0) -/* 0BA688 7F085B18 C6000000 */ lwc1 $f0, ($s0) -.Ljp7F085B1C: -/* 0BA68C 7F085B1C C4245214 */ lwc1 $f4, %lo(D_800551E4)($at) -/* 0BA690 7F085B20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0BA694 7F085B24 44815000 */ mtc1 $at, $f10 -/* 0BA698 7F085B28 46040202 */ mul.s $f8, $f0, $f4 -/* 0BA69C 7F085B2C E7A20254 */ swc1 $f2, 0x254($sp) -/* 0BA6A0 7F085B30 E7B00258 */ swc1 $f16, 0x258($sp) -/* 0BA6A4 7F085B34 460A4302 */ mul.s $f12, $f8, $f10 -/* 0BA6A8 7F085B38 0FC160F0 */ jal cosf -/* 0BA6AC 7F085B3C 00000000 */ nop -/* 0BA6B0 7F085B40 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0BA6B4 7F085B44 44817000 */ mtc1 $at, $f14 -/* 0BA6B8 7F085B48 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA6BC 7F085B4C 44813000 */ mtc1 $at, $f6 -/* 0BA6C0 7F085B50 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0BA6C4 7F085B54 44814000 */ mtc1 $at, $f8 -/* 0BA6C8 7F085B58 46060100 */ add.s $f4, $f0, $f6 -/* 0BA6CC 7F085B5C 3C028008 */ lui $v0, %hi(g_TankEnteringSitHeightRemain) # $v0, 0x8008 -/* 0BA6D0 7F085B60 24429A00 */ addiu $v0, %lo(g_TankEnteringSitHeightRemain) # addiu $v0, $v0, -0x6600 -/* 0BA6D4 7F085B64 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA6D8 7F085B68 46082282 */ mul.s $f10, $f4, $f8 -/* 0BA6DC 7F085B6C 44813000 */ mtc1 $at, $f6 -/* 0BA6E0 7F085B70 C7A80254 */ lwc1 $f8, 0x254($sp) -/* 0BA6E4 7F085B74 3C018008 */ lui $at, %hi(g_TankEnterBondVertAngleDeg) # $at, 0x8008 -/* 0BA6E8 7F085B78 8E2A0000 */ lw $t2, ($s1) -/* 0BA6EC 7F085B7C C7B00258 */ lwc1 $f16, 0x258($sp) -/* 0BA6F0 7F085B80 3C038008 */ lui $v1, %hi(g_EnterTankCoord) # $v1, 0x8008 -/* 0BA6F4 7F085B84 E44A0000 */ swc1 $f10, ($v0) -/* 0BA6F8 7F085B88 C4420000 */ lwc1 $f2, ($v0) -/* 0BA6FC 7F085B8C 24639A10 */ addiu $v1, %lo(g_EnterTankCoord) # addiu $v1, $v1, -0x65f0 -/* 0BA700 7F085B90 46023101 */ sub.s $f4, $f6, $f2 -/* 0BA704 7F085B94 C4269A08 */ lwc1 $f6, %lo(g_TankEnterBondVertAngleDeg)($at) -/* 0BA708 7F085B98 3C018008 */ lui $at, %hi(g_TankEnterBondHorizAngleDeg) # $at, 0x8008 -/* 0BA70C 7F085B9C 46082282 */ mul.s $f10, $f4, $f8 -/* 0BA710 7F085BA0 00000000 */ nop -/* 0BA714 7F085BA4 46061102 */ mul.s $f4, $f2, $f6 -/* 0BA718 7F085BA8 460A2200 */ add.s $f8, $f4, $f10 -/* 0BA71C 7F085BAC E5480158 */ swc1 $f8, 0x158($t2) -/* 0BA720 7F085BB0 C4329A04 */ lwc1 $f18, %lo(g_TankEnterBondHorizAngleDeg)($at) -/* 0BA724 7F085BB4 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0BA728 7F085BB8 44813000 */ mtc1 $at, $f6 -/* 0BA72C 7F085BBC 46128301 */ sub.s $f12, $f16, $f18 -/* 0BA730 7F085BC0 3C01C334 */ li $at, 0xC3340000 # -180.000000 -/* 0BA734 7F085BC4 44812000 */ mtc1 $at, $f4 -/* 0BA738 7F085BC8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA73C 7F085BCC 460C303C */ c.lt.s $f6, $f12 -/* 0BA740 7F085BD0 44814000 */ mtc1 $at, $f8 -/* 0BA744 7F085BD4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA748 7F085BD8 45000002 */ bc1f .Ljp7F085BE4 -/* 0BA74C 7F085BDC 00000000 */ nop -/* 0BA750 7F085BE0 460E8401 */ sub.s $f16, $f16, $f14 -.Ljp7F085BE4: -/* 0BA754 7F085BE4 4604603C */ c.lt.s $f12, $f4 -/* 0BA758 7F085BE8 00000000 */ nop -/* 0BA75C 7F085BEC 45020003 */ bc1fl .Ljp7F085BFC -/* 0BA760 7F085BF0 C4420000 */ lwc1 $f2, ($v0) -/* 0BA764 7F085BF4 460E8400 */ add.s $f16, $f16, $f14 -/* 0BA768 7F085BF8 C4420000 */ lwc1 $f2, ($v0) -.Ljp7F085BFC: -/* 0BA76C 7F085BFC 8E390000 */ lw $t9, ($s1) -/* 0BA770 7F085C00 46024181 */ sub.s $f6, $f8, $f2 -/* 0BA774 7F085C04 46121282 */ mul.s $f10, $f2, $f18 -/* 0BA778 7F085C08 00000000 */ nop -/* 0BA77C 7F085C0C 46103102 */ mul.s $f4, $f6, $f16 -/* 0BA780 7F085C10 46045200 */ add.s $f8, $f10, $f4 -/* 0BA784 7F085C14 44812000 */ mtc1 $at, $f4 -/* 0BA788 7F085C18 E7280148 */ swc1 $f8, 0x148($t9) -/* 0BA78C 7F085C1C 8E280000 */ lw $t0, ($s1) -/* 0BA790 7F085C20 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0BA794 7F085C24 4600703E */ c.le.s $f14, $f0 -/* 0BA798 7F085C28 00000000 */ nop -/* 0BA79C 7F085C2C 45000005 */ bc1f .Ljp7F085C44 -/* 0BA7A0 7F085C30 00000000 */ nop -/* 0BA7A4 7F085C34 460E0181 */ sub.s $f6, $f0, $f14 -/* 0BA7A8 7F085C38 E5060148 */ swc1 $f6, 0x148($t0) -/* 0BA7AC 7F085C3C 8E280000 */ lw $t0, ($s1) -/* 0BA7B0 7F085C40 C5000148 */ lwc1 $f0, 0x148($t0) -.Ljp7F085C44: -/* 0BA7B4 7F085C44 4614003C */ c.lt.s $f0, $f20 -/* 0BA7B8 7F085C48 00000000 */ nop -/* 0BA7BC 7F085C4C 45020005 */ bc1fl .Ljp7F085C64 -/* 0BA7C0 7F085C50 C4420000 */ lwc1 $f2, ($v0) -/* 0BA7C4 7F085C54 460E0280 */ add.s $f10, $f0, $f14 -/* 0BA7C8 7F085C58 E50A0148 */ swc1 $f10, 0x148($t0) -/* 0BA7CC 7F085C5C 8E280000 */ lw $t0, ($s1) -/* 0BA7D0 7F085C60 C4420000 */ lwc1 $f2, ($v0) -.Ljp7F085C64: -/* 0BA7D4 7F085C64 C4680000 */ lwc1 $f8, ($v1) -/* 0BA7D8 7F085C68 C7AA025C */ lwc1 $f10, 0x25c($sp) -/* 0BA7DC 7F085C6C 46022001 */ sub.s $f0, $f4, $f2 -/* 0BA7E0 7F085C70 46081182 */ mul.s $f6, $f2, $f8 -/* 0BA7E4 7F085C74 00000000 */ nop -/* 0BA7E8 7F085C78 460A0102 */ mul.s $f4, $f0, $f10 -/* 0BA7EC 7F085C7C C50A048C */ lwc1 $f10, 0x48c($t0) -/* 0BA7F0 7F085C80 E7B403B0 */ swc1 $f20, 0x3b0($sp) -/* 0BA7F4 7F085C84 46043200 */ add.s $f8, $f6, $f4 -/* 0BA7F8 7F085C88 C4640008 */ lwc1 $f4, 8($v1) -/* 0BA7FC 7F085C8C 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BA800 7F085C90 46041202 */ mul.s $f8, $f2, $f4 -/* 0BA804 7F085C94 C7AA0264 */ lwc1 $f10, 0x264($sp) -/* 0BA808 7F085C98 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0BA80C 7F085C9C 460A0182 */ mul.s $f6, $f0, $f10 -/* 0BA810 7F085CA0 C50A0494 */ lwc1 $f10, 0x494($t0) -/* 0BA814 7F085CA4 46064100 */ add.s $f4, $f8, $f6 -/* 0BA818 7F085CA8 460A2201 */ sub.s $f8, $f4, $f10 -/* 0BA81C 7F085CAC E7A803B4 */ swc1 $f8, 0x3b4($sp) -.Ljp7F085CB0: -/* 0BA820 7F085CB0 3C108008 */ lui $s0, %hi(g_TankEnteringSitHeight) # $s0, 0x8008 -/* 0BA824 7F085CB4 261099FC */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x6604 -/* 0BA828 7F085CB8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA82C 7F085CBC 44812000 */ mtc1 $at, $f4 -/* 0BA830 7F085CC0 C6060000 */ lwc1 $f6, ($s0) -/* 0BA834 7F085CC4 8E280000 */ lw $t0, ($s1) -/* 0BA838 7F085CC8 3C018008 */ lui $at, %hi(g_EnterTankAudioState) -/* 0BA83C 7F085CCC 4606203E */ c.le.s $f4, $f6 -/* 0BA840 7F085CD0 240C0001 */ li $t4, 1 -/* 0BA844 7F085CD4 450200EF */ bc1fl .Ljp7F086094 -/* 0BA848 7F085CD8 3C013F40 */ lui $at, %hi(0x3F3F99F8) # $at, 0x3f40 -/* 0BA84C 7F085CDC 100000EC */ b .Ljp7F086090 -/* 0BA850 7F085CE0 AC2C99F8 */ sw $t4, %lo(g_EnterTankAudioState)($at) -.Ljp7F085CE4: -/* 0BA854 7F085CE4 1441001A */ bne $v0, $at, .Ljp7F085D50 -/* 0BA858 7F085CE8 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0BA85C 7F085CEC 240B0002 */ li $t3, 2 -/* 0BA860 7F085CF0 3C018008 */ lui $at, %hi(g_EnterTankAudioState) # $at, 0x8008 -/* 0BA864 7F085CF4 26106498 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6498 -/* 0BA868 7F085CF8 AC2B99F8 */ sw $t3, %lo(g_EnterTankAudioState)($at) -/* 0BA86C 7F085CFC 8E0D0000 */ lw $t5, ($s0) -/* 0BA870 7F085D00 55A0000A */ bnezl $t5, .Ljp7F085D2C -/* 0BA874 7F085D04 8E040000 */ lw $a0, ($s0) -/* 0BA878 7F085D08 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0BA87C 7F085D0C 00000000 */ nop -/* 0BA880 7F085D10 14400005 */ bnez $v0, .Ljp7F085D28 -/* 0BA884 7F085D14 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0BA888 7F085D18 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BA88C 7F085D1C 24050042 */ li $a1, 66 -/* 0BA890 7F085D20 0C002386 */ jal sndPlaySfx -/* 0BA894 7F085D24 02003025 */ move $a2, $s0 -.Ljp7F085D28: -/* 0BA898 7F085D28 8E040000 */ lw $a0, ($s0) -.Ljp7F085D2C: -/* 0BA89C 7F085D2C 24050008 */ li $a1, 8 -/* 0BA8A0 7F085D30 0C002465 */ jal sndCreatePostEvent -/* 0BA8A4 7F085D34 240661A8 */ li $a2, 25000 -/* 0BA8A8 7F085D38 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8008 -/* 0BA8AC 7F085D3C 244299F4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x660c -/* 0BA8B0 7F085D40 240E61A8 */ li $t6, 25000 -/* 0BA8B4 7F085D44 AC4E0000 */ sw $t6, ($v0) -/* 0BA8B8 7F085D48 100000D1 */ b .Ljp7F086090 -/* 0BA8BC 7F085D4C 8E280000 */ lw $t0, ($s1) -.Ljp7F085D50: -/* 0BA8C0 7F085D50 8E280000 */ lw $t0, ($s1) -/* 0BA8C4 7F085D54 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0BA8C8 7F085D58 44814000 */ mtc1 $at, $f8 -/* 0BA8CC 7F085D5C C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BA8D0 7F085D60 3C018005 */ lui $at, %hi(D_800551E8) # $at, 0x8005 -/* 0BA8D4 7F085D64 C4245218 */ lwc1 $f4, %lo(D_800551E8)($at) -/* 0BA8D8 7F085D68 46085003 */ div.s $f0, $f10, $f8 -/* 0BA8DC 7F085D6C C506014C */ lwc1 $f6, 0x14c($t0) -/* 0BA8E0 7F085D70 46043083 */ div.s $f2, $f6, $f4 -/* 0BA8E4 7F085D74 4614003C */ c.lt.s $f0, $f20 -/* 0BA8E8 7F085D78 00000000 */ nop -/* 0BA8EC 7F085D7C 45020003 */ bc1fl .Ljp7F085D8C -/* 0BA8F0 7F085D80 4614103C */ c.lt.s $f2, $f20 -/* 0BA8F4 7F085D84 46000007 */ neg.s $f0, $f0 -/* 0BA8F8 7F085D88 4614103C */ c.lt.s $f2, $f20 -.Ljp7F085D8C: -/* 0BA8FC 7F085D8C 00000000 */ nop -/* 0BA900 7F085D90 45020003 */ bc1fl .Ljp7F085DA0 -/* 0BA904 7F085D94 4602003C */ c.lt.s $f0, $f2 -/* 0BA908 7F085D98 46001087 */ neg.s $f2, $f2 -/* 0BA90C 7F085D9C 4602003C */ c.lt.s $f0, $f2 -.Ljp7F085DA0: -/* 0BA910 7F085DA0 46000306 */ mov.s $f12, $f0 -/* 0BA914 7F085DA4 45020003 */ bc1fl .Ljp7F085DB4 -/* 0BA918 7F085DA8 460CA03C */ c.lt.s $f20, $f12 -/* 0BA91C 7F085DAC 46001306 */ mov.s $f12, $f2 -/* 0BA920 7F085DB0 460CA03C */ c.lt.s $f20, $f12 -.Ljp7F085DB4: -/* 0BA924 7F085DB4 00000000 */ nop -/* 0BA928 7F085DB8 45000043 */ bc1f .Ljp7F085EC8 -/* 0BA92C 7F085DBC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA930 7F085DC0 44815000 */ mtc1 $at, $f10 -/* 0BA934 7F085DC4 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0BA938 7F085DC8 26106498 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6498 -/* 0BA93C 7F085DCC 460C503C */ c.lt.s $f10, $f12 -/* 0BA940 7F085DD0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BA944 7F085DD4 45020004 */ bc1fl .Ljp7F085DE8 -/* 0BA948 7F085DD8 8E180004 */ lw $t8, 4($s0) -/* 0BA94C 7F085DDC 44816000 */ mtc1 $at, $f12 -/* 0BA950 7F085DE0 00000000 */ nop -/* 0BA954 7F085DE4 8E180004 */ lw $t8, 4($s0) -.Ljp7F085DE8: -/* 0BA958 7F085DE8 5700000E */ bnezl $t8, .Ljp7F085E24 -/* 0BA95C 7F085DEC 8E040004 */ lw $a0, 4($s0) -/* 0BA960 7F085DF0 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0BA964 7F085DF4 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA968 7F085DF8 14400009 */ bnez $v0, .Ljp7F085E20 -/* 0BA96C 7F085DFC C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BA970 7F085E00 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0BA974 7F085E04 3C068003 */ lui $a2, %hi(SFX_80036458 + 4) # $a2, 0x8003 -/* 0BA978 7F085E08 24C6649C */ addiu $a2, %lo(SFX_80036458 + 4) # addiu $a2, $a2, 0x649c -/* 0BA97C 7F085E0C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BA980 7F085E10 2405003E */ li $a1, 62 -/* 0BA984 7F085E14 0C002386 */ jal sndPlaySfx -/* 0BA988 7F085E18 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BA98C 7F085E1C C7AC0244 */ lwc1 $f12, 0x244($sp) -.Ljp7F085E20: -/* 0BA990 7F085E20 8E040004 */ lw $a0, 4($s0) -.Ljp7F085E24: -/* 0BA994 7F085E24 3C018005 */ lui $at, %hi(D_800551EC) # $at, 0x8005 -/* 0BA998 7F085E28 24050008 */ li $a1, 8 -/* 0BA99C 7F085E2C 50800034 */ beql $a0, $zero, .Ljp7F085F00 -/* 0BA9A0 7F085E30 8E190000 */ lw $t9, ($s0) -/* 0BA9A4 7F085E34 C420521C */ lwc1 $f0, %lo(D_800551EC)($at) -/* 0BA9A8 7F085E38 24067FFF */ li $a2, 32767 -/* 0BA9AC 7F085E3C 3C018005 */ lui $at, 0x8005 -/* 0BA9B0 7F085E40 4600603C */ c.lt.s $f12, $f0 -/* 0BA9B4 7F085E44 00000000 */ nop -/* 0BA9B8 7F085E48 45000009 */ bc1f .Ljp7F085E70 -/* 0BA9BC 7F085E4C 00000000 */ nop -/* 0BA9C0 7F085E50 3C018005 */ lui $at, %hi(D_800551F0) # $at, 0x8005 -/* 0BA9C4 7F085E54 C4285220 */ lwc1 $f8, %lo(D_800551F0)($at) -/* 0BA9C8 7F085E58 46086182 */ mul.s $f6, $f12, $f8 -/* 0BA9CC 7F085E5C 46003103 */ div.s $f4, $f6, $f0 -/* 0BA9D0 7F085E60 4600228D */ trunc.w.s $f10, $f4 -/* 0BA9D4 7F085E64 44065000 */ mfc1 $a2, $f10 -/* 0BA9D8 7F085E68 10000013 */ b .Ljp7F085EB8 -/* 0BA9DC 7F085E6C 00000000 */ nop -.Ljp7F085E70: -/* 0BA9E0 7F085E70 C4285224 */ lwc1 $f8, %lo(D_800551F4)($at) -/* 0BA9E4 7F085E74 3C018005 */ lui $at, %hi(D_800551F4) # $at, 0x8005 -/* 0BA9E8 7F085E78 4608603C */ c.lt.s $f12, $f8 -/* 0BA9EC 7F085E7C 00000000 */ nop -/* 0BA9F0 7F085E80 4500000D */ bc1f .Ljp7F085EB8 -/* 0BA9F4 7F085E84 00000000 */ nop -/* 0BA9F8 7F085E88 46006181 */ sub.s $f6, $f12, $f0 -/* 0BA9FC 7F085E8C C4245228 */ lwc1 $f4, %lo(D_800551F8)($at) -/* 0BAA00 7F085E90 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0BAA04 7F085E94 44814000 */ mtc1 $at, $f8 -/* 0BAA08 7F085E98 46043282 */ mul.s $f10, $f6, $f4 -/* 0BAA0C 7F085E9C 3C018005 */ lui $at, %hi(D_800551FC) # $at, 0x8005 -/* 0BAA10 7F085EA0 C424522C */ lwc1 $f4, %lo(D_800551FC)($at) -/* 0BAA14 7F085EA4 46085183 */ div.s $f6, $f10, $f8 -/* 0BAA18 7F085EA8 46043280 */ add.s $f10, $f6, $f4 -/* 0BAA1C 7F085EAC 4600520D */ trunc.w.s $f8, $f10 -/* 0BAA20 7F085EB0 44064000 */ mfc1 $a2, $f8 -/* 0BAA24 7F085EB4 00000000 */ nop -.Ljp7F085EB8: -/* 0BAA28 7F085EB8 0C002465 */ jal sndCreatePostEvent -/* 0BAA2C 7F085EBC E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BAA30 7F085EC0 1000000E */ b .Ljp7F085EFC -/* 0BAA34 7F085EC4 C7AC0244 */ lwc1 $f12, 0x244($sp) -.Ljp7F085EC8: -/* 0BAA38 7F085EC8 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0BAA3C 7F085ECC 26106498 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x6498 -/* 0BAA40 7F085ED0 8E040004 */ lw $a0, 4($s0) -/* 0BAA44 7F085ED4 5080000A */ beql $a0, $zero, .Ljp7F085F00 -/* 0BAA48 7F085ED8 8E190000 */ lw $t9, ($s0) -/* 0BAA4C 7F085EDC 0C002380 */ jal sndGetPlayingState -/* 0BAA50 7F085EE0 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BAA54 7F085EE4 10400005 */ beqz $v0, .Ljp7F085EFC -/* 0BAA58 7F085EE8 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BAA5C 7F085EEC 8E040004 */ lw $a0, 4($s0) -/* 0BAA60 7F085EF0 0C00240C */ jal sndDeactivate -/* 0BAA64 7F085EF4 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BAA68 7F085EF8 C7AC0244 */ lwc1 $f12, 0x244($sp) -.Ljp7F085EFC: -/* 0BAA6C 7F085EFC 8E190000 */ lw $t9, ($s0) -.Ljp7F085F00: -/* 0BAA70 7F085F00 5720000D */ bnezl $t9, .Ljp7F085F38 -/* 0BAA74 7F085F04 8E040000 */ lw $a0, ($s0) -/* 0BAA78 7F085F08 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0BAA7C 7F085F0C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BAA80 7F085F10 14400008 */ bnez $v0, .Ljp7F085F34 -/* 0BAA84 7F085F14 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0BAA88 7F085F18 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0BAA8C 7F085F1C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BAA90 7F085F20 24050041 */ li $a1, 65 -/* 0BAA94 7F085F24 02003025 */ move $a2, $s0 -/* 0BAA98 7F085F28 0C002386 */ jal sndPlaySfx -/* 0BAA9C 7F085F2C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0BAAA0 7F085F30 C7AC0244 */ lwc1 $f12, 0x244($sp) -.Ljp7F085F34: -/* 0BAAA4 7F085F34 8E040000 */ lw $a0, ($s0) -.Ljp7F085F38: -/* 0BAAA8 7F085F38 1080001A */ beqz $a0, .Ljp7F085FA4 -/* 0BAAAC 7F085F3C 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8008 -/* 0BAAB0 7F085F40 244299F4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x660c -/* 0BAAB4 7F085F44 240C7FFF */ li $t4, 32767 -/* 0BAAB8 7F085F48 AC4C0000 */ sw $t4, ($v0) -/* 0BAABC 7F085F4C 3C018005 */ lui $at, %hi(D_80055200) # $at, 0x8005 -/* 0BAAC0 7F085F50 C4265230 */ lwc1 $f6, %lo(D_80055200)($at) -/* 0BAAC4 7F085F54 3C018005 */ lui $at, %hi(D_80055204) # $at, 0x8005 -/* 0BAAC8 7F085F58 24050008 */ li $a1, 8 -/* 0BAACC 7F085F5C 4606603C */ c.lt.s $f12, $f6 -/* 0BAAD0 7F085F60 00000000 */ nop -/* 0BAAD4 7F085F64 4500000D */ bc1f .Ljp7F085F9C -/* 0BAAD8 7F085F68 00000000 */ nop -/* 0BAADC 7F085F6C C4245234 */ lwc1 $f4, %lo(D_80055204)($at) -/* 0BAAE0 7F085F70 3C018005 */ lui $at, %hi(D_80055208) # $at, 0x8005 -/* 0BAAE4 7F085F74 C4285238 */ lwc1 $f8, %lo(D_80055208)($at) -/* 0BAAE8 7F085F78 46046282 */ mul.s $f10, $f12, $f4 -/* 0BAAEC 7F085F7C 3C018005 */ lui $at, %hi(D_8005520C) # $at, 0x8005 -/* 0BAAF0 7F085F80 C424523C */ lwc1 $f4, %lo(D_8005520C)($at) -/* 0BAAF4 7F085F84 46085183 */ div.s $f6, $f10, $f8 -/* 0BAAF8 7F085F88 46043280 */ add.s $f10, $f6, $f4 -/* 0BAAFC 7F085F8C 4600520D */ trunc.w.s $f8, $f10 -/* 0BAB00 7F085F90 440D4000 */ mfc1 $t5, $f8 -/* 0BAB04 7F085F94 00000000 */ nop -/* 0BAB08 7F085F98 AC4D0000 */ sw $t5, ($v0) -.Ljp7F085F9C: -/* 0BAB0C 7F085F9C 0C002465 */ jal sndCreatePostEvent -/* 0BAB10 7F085FA0 8C460000 */ lw $a2, ($v0) -.Ljp7F085FA4: -/* 0BAB14 7F085FA4 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0BAB18 7F085FA8 00002025 */ move $a0, $zero -/* 0BAB1C 7F085FAC 24010020 */ li $at, 32 -/* 0BAB20 7F085FB0 14410007 */ bne $v0, $at, .Ljp7F085FD0 -/* 0BAB24 7F085FB4 3C048005 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8005 -/* 0BAB28 7F085FB8 8E280000 */ lw $t0, ($s1) -/* 0BAB2C 7F085FBC 3C018005 */ lui $at, %hi(D_80055210) # $at, 0x8005 -/* 0BAB30 7F085FC0 C4265240 */ lwc1 $f6, %lo(D_80055210)($at) -/* 0BAB34 7F085FC4 C5022A08 */ lwc1 $f2, 0x2a08($t0) -/* 0BAB38 7F085FC8 10000004 */ b .Ljp7F085FDC -/* 0BAB3C 7F085FCC 46061080 */ add.s $f2, $f2, $f6 -.Ljp7F085FD0: -/* 0BAB40 7F085FD0 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0BAB44 7F085FD4 C42264AC */ lwc1 $f2, %lo(g_TankTurretVerticalAngle)($at) -/* 0BAB48 7F085FD8 8E280000 */ lw $t0, ($s1) -.Ljp7F085FDC: -/* 0BAB4C 7F085FDC 3C018005 */ lui $at, %hi(D_80055214) # $at, 0x8005 -/* 0BAB50 7F085FE0 C4205244 */ lwc1 $f0, %lo(D_80055214)($at) -/* 0BAB54 7F085FE4 3C018005 */ lui $at, %hi(D_80055218) # $at, 0x8005 -/* 0BAB58 7F085FE8 4602003C */ c.lt.s $f0, $f2 -/* 0BAB5C 7F085FEC 00000000 */ nop -/* 0BAB60 7F085FF0 45000002 */ bc1f .Ljp7F085FFC -/* 0BAB64 7F085FF4 00000000 */ nop -/* 0BAB68 7F085FF8 46000086 */ mov.s $f2, $f0 -.Ljp7F085FFC: -/* 0BAB6C 7F085FFC C4205248 */ lwc1 $f0, %lo(D_80055218)($at) -/* 0BAB70 7F086000 4600103C */ c.lt.s $f2, $f0 -/* 0BAB74 7F086004 00000000 */ nop -/* 0BAB78 7F086008 45000002 */ bc1f .Ljp7F086014 -/* 0BAB7C 7F08600C 00000000 */ nop -/* 0BAB80 7F086010 46000086 */ mov.s $f2, $f0 -.Ljp7F086014: -/* 0BAB84 7F086014 8C8483A4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0BAB88 7F086018 00001025 */ move $v0, $zero -/* 0BAB8C 7F08601C 18800014 */ blez $a0, .Ljp7F086070 -/* 0BAB90 7F086020 3C018005 */ lui $at, %hi(D_8005521C) # $at, 0x8005 -/* 0BAB94 7F086024 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) # $v1, 0x8003 -/* 0BAB98 7F086028 246364B0 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x64b0 -/* 0BAB9C 7F08602C C420524C */ lwc1 $f0, %lo(D_8005521C)($at) -/* 0BABA0 7F086030 C4700000 */ lwc1 $f16, ($v1) -/* 0BABA4 7F086034 24420001 */ addiu $v0, $v0, 1 -/* 0BABA8 7F086038 0044082A */ slt $at, $v0, $a0 -/* 0BABAC 7F08603C 46100482 */ mul.s $f18, $f0, $f16 -/* 0BABB0 7F086040 5020000A */ beql $at, $zero, .Ljp7F08606C -/* 0BABB4 7F086044 46029400 */ add.s $f16, $f18, $f2 -/* 0BABB8 7F086048 46029400 */ add.s $f16, $f18, $f2 -.Ljp7F08604C: -/* 0BABBC 7F08604C 24420001 */ addiu $v0, $v0, 1 -/* 0BABC0 7F086050 0044082A */ slt $at, $v0, $a0 -/* 0BABC4 7F086054 E4700000 */ swc1 $f16, ($v1) -/* 0BABC8 7F086058 C4700000 */ lwc1 $f16, ($v1) -/* 0BABCC 7F08605C 46100482 */ mul.s $f18, $f0, $f16 -/* 0BABD0 7F086060 5420FFFA */ bnezl $at, .Ljp7F08604C -/* 0BABD4 7F086064 46029400 */ add.s $f16, $f18, $f2 -/* 0BABD8 7F086068 46029400 */ add.s $f16, $f18, $f2 -.Ljp7F08606C: -/* 0BABDC 7F08606C E4700000 */ swc1 $f16, ($v1) -.Ljp7F086070: -/* 0BABE0 7F086070 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) # $v1, 0x8003 -/* 0BABE4 7F086074 246364B0 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x64b0 -/* 0BABE8 7F086078 3C018005 */ lui $at, %hi(D_80055220) # $at, 0x8005 -/* 0BABEC 7F08607C C4245250 */ lwc1 $f4, %lo(D_80055220)($at) -/* 0BABF0 7F086080 C4660000 */ lwc1 $f6, ($v1) -/* 0BABF4 7F086084 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0BABF8 7F086088 46043282 */ mul.s $f10, $f6, $f4 -/* 0BABFC 7F08608C E42A64AC */ swc1 $f10, %lo(g_TankTurretVerticalAngle)($at) -.Ljp7F086090: -/* 0BAC00 7F086090 3C013F40 */ li $at, 0x3F400000 # 0.750000 -.Ljp7F086094: -/* 0BAC04 7F086094 44810000 */ mtc1 $at, $f0 -/* 0BAC08 7F086098 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BAC0C 7F08609C C42883B4 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BAC10 7F0860A0 3C018005 */ lui $at, %hi(D_80055224) # $at, 0x8005 -/* 0BAC14 7F0860A4 C4245254 */ lwc1 $f4, %lo(D_80055224)($at) -/* 0BAC18 7F0860A8 46080182 */ mul.s $f6, $f0, $f8 -/* 0BAC1C 7F0860AC C508019C */ lwc1 $f8, 0x19c($t0) -/* 0BAC20 7F0860B0 4406A000 */ mfc1 $a2, $f20 -/* 0BAC24 7F0860B4 4600A306 */ mov.s $f12, $f20 -/* 0BAC28 7F0860B8 46043283 */ div.s $f10, $f6, $f4 -/* 0BAC2C 7F0860BC 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BAC30 7F0860C0 E506019C */ swc1 $f6, 0x19c($t0) -/* 0BAC34 7F0860C4 8E280000 */ lw $t0, ($s1) -/* 0BAC38 7F0860C8 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BAC3C 7F0860CC 4614203C */ c.lt.s $f4, $f20 -/* 0BAC40 7F0860D0 00000000 */ nop -/* 0BAC44 7F0860D4 45000002 */ bc1f .Ljp7F0860E0 -/* 0BAC48 7F0860D8 00000000 */ nop -/* 0BAC4C 7F0860DC E514019C */ swc1 $f20, 0x19c($t0) -.Ljp7F0860E0: -/* 0BAC50 7F0860E0 0FC20451 */ jal bondviewMoveAnimationTick -/* 0BAC54 7F0860E4 4600A386 */ mov.s $f14, $f20 -/* 0BAC58 7F0860E8 3C018005 */ lui $at, %hi(D_80055228) # $at, 0x8005 -/* 0BAC5C 7F0860EC C4285258 */ lwc1 $f8, %lo(D_80055228)($at) -/* 0BAC60 7F0860F0 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BAC64 7F0860F4 C42A64A4 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0BAC68 7F0860F8 0FC160F3 */ jal sinf -/* 0BAC6C 7F0860FC 460A4301 */ sub.s $f12, $f8, $f10 -/* 0BAC70 7F086100 8E2E0000 */ lw $t6, ($s1) -/* 0BAC74 7F086104 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BAC78 7F086108 C42883B4 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BAC7C 7F08610C C5C60174 */ lwc1 $f6, 0x174($t6) -/* 0BAC80 7F086110 3C018005 */ lui $at, %hi(D_8005522C) # $at, 0x8005 -/* 0BAC84 7F086114 46003102 */ mul.s $f4, $f6, $f0 -/* 0BAC88 7F086118 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BAC8C 7F08611C 46082282 */ mul.s $f10, $f4, $f8 -/* 0BAC90 7F086120 C428525C */ lwc1 $f8, %lo(D_8005522C)($at) -/* 0BAC94 7F086124 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BAC98 7F086128 460A3100 */ add.s $f4, $f6, $f10 -/* 0BAC9C 7F08612C C42664A4 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0BACA0 7F086130 E7A403AC */ swc1 $f4, 0x3ac($sp) -/* 0BACA4 7F086134 0FC160F0 */ jal cosf -/* 0BACA8 7F086138 46064301 */ sub.s $f12, $f8, $f6 -/* 0BACAC 7F08613C 8E380000 */ lw $t8, ($s1) -/* 0BACB0 7F086140 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BACB4 7F086144 C42883B4 */ lwc1 $f8, %lo(g_GlobalTimerDelta)($at) -/* 0BACB8 7F086148 C70A0174 */ lwc1 $f10, 0x174($t8) -/* 0BACBC 7F08614C 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BACC0 7F086150 24050001 */ li $a1, 1 -/* 0BACC4 7F086154 46005102 */ mul.s $f4, $f10, $f0 -/* 0BACC8 7F086158 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BACCC 7F08615C 46082182 */ mul.s $f6, $f4, $f8 -/* 0BACD0 7F086160 46065100 */ add.s $f4, $f10, $f6 -/* 0BACD4 7F086164 0FC1F7E1 */ jal bondviewCalcUpdatePlayerCollision -/* 0BACD8 7F086168 E7A403B4 */ swc1 $f4, 0x3b4($sp) -/* 0BACDC 7F08616C 3C0F8008 */ lui $t7, %hi(g_EnterTankAudioState) # $t7, 0x8008 -/* 0BACE0 7F086170 8DEF99F8 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0BACE4 7F086174 24010002 */ li $at, 2 -/* 0BACE8 7F086178 3C0A8005 */ lui $t2, %hi(g_ClockTimer) # $t2, 0x8005 -/* 0BACEC 7F08617C 55E10238 */ bnel $t7, $at, .Ljp7F086A60 -/* 0BACF0 7F086180 8E280000 */ lw $t0, ($s1) -/* 0BACF4 7F086184 8D4A83A4 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 0BACF8 7F086188 59400235 */ blezl $t2, .Ljp7F086A60 -/* 0BACFC 7F08618C 8E280000 */ lw $t0, ($s1) -/* 0BAD00 7F086190 8E280000 */ lw $t0, ($s1) -/* 0BAD04 7F086194 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BAD08 7F086198 C42E83B4 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BAD0C 7F08619C C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BAD10 7F0861A0 C50A0408 */ lwc1 $f10, 0x408($t0) -/* 0BAD14 7F0861A4 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BAD18 7F0861A8 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BAD1C 7F0861AC C5080410 */ lwc1 $f8, 0x410($t0) -/* 0BAD20 7F0861B0 46082281 */ sub.s $f10, $f4, $f8 -/* 0BAD24 7F0861B4 460E3003 */ div.s $f0, $f6, $f14 -/* 0BAD28 7F0861B8 460E5083 */ div.s $f2, $f10, $f14 -/* 0BAD2C 7F0861BC 46000182 */ mul.s $f6, $f0, $f0 -/* 0BAD30 7F0861C0 00000000 */ nop -/* 0BAD34 7F0861C4 46021102 */ mul.s $f4, $f2, $f2 -/* 0BAD38 7F0861C8 0C007E08 */ jal sqrtf -/* 0BAD3C 7F0861CC 46043300 */ add.s $f12, $f6, $f4 -/* 0BAD40 7F0861D0 8E280000 */ lw $t0, ($s1) -/* 0BAD44 7F0861D4 46000086 */ mov.s $f2, $f0 -/* 0BAD48 7F0861D8 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0BAD4C 7F0861DC 4614403C */ c.lt.s $f8, $f20 -/* 0BAD50 7F0861E0 00000000 */ nop -/* 0BAD54 7F0861E4 45000002 */ bc1f .Ljp7F0861F0 -/* 0BAD58 7F0861E8 00000000 */ nop -/* 0BAD5C 7F0861EC 46000087 */ neg.s $f2, $f0 -.Ljp7F0861F0: -/* 0BAD60 7F0861F0 1000021A */ b .Ljp7F086A5C -/* 0BAD64 7F0861F4 E5020174 */ swc1 $f2, 0x174($t0) -.Ljp7F0861F8: -/* 0BAD68 7F0861F8 8E040000 */ lw $a0, ($s0) -/* 0BAD6C 7F0861FC 5080001A */ beql $a0, $zero, .Ljp7F086268 -/* 0BAD70 7F086200 8E040004 */ lw $a0, 4($s0) -/* 0BAD74 7F086204 0C002380 */ jal sndGetPlayingState -/* 0BAD78 7F086208 00000000 */ nop -/* 0BAD7C 7F08620C 10400015 */ beqz $v0, .Ljp7F086264 -/* 0BAD80 7F086210 3C01447A */ li $at, 0x447A0000 # 1000.000000 -/* 0BAD84 7F086214 44815000 */ mtc1 $at, $f10 -/* 0BAD88 7F086218 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BAD8C 7F08621C C42683B4 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0BAD90 7F086220 3C028008 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8008 -/* 0BAD94 7F086224 244299F4 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x660c -/* 0BAD98 7F086228 46065102 */ mul.s $f4, $f10, $f6 -/* 0BAD9C 7F08622C 8C4B0000 */ lw $t3, ($v0) -/* 0BADA0 7F086230 24050008 */ li $a1, 8 -/* 0BADA4 7F086234 4600220D */ trunc.w.s $f8, $f4 -/* 0BADA8 7F086238 440C4000 */ mfc1 $t4, $f8 -/* 0BADAC 7F08623C 00000000 */ nop -/* 0BADB0 7F086240 016C3023 */ subu $a2, $t3, $t4 -/* 0BADB4 7F086244 18C00005 */ blez $a2, .Ljp7F08625C -/* 0BADB8 7F086248 AC460000 */ sw $a2, ($v0) -/* 0BADBC 7F08624C 0C002465 */ jal sndCreatePostEvent -/* 0BADC0 7F086250 8E040000 */ lw $a0, ($s0) -/* 0BADC4 7F086254 10000004 */ b .Ljp7F086268 -/* 0BADC8 7F086258 8E040004 */ lw $a0, 4($s0) -.Ljp7F08625C: -/* 0BADCC 7F08625C 0C00240C */ jal sndDeactivate -/* 0BADD0 7F086260 8E040000 */ lw $a0, ($s0) -.Ljp7F086264: -/* 0BADD4 7F086264 8E040004 */ lw $a0, 4($s0) -.Ljp7F086268: -/* 0BADD8 7F086268 10800007 */ beqz $a0, .Ljp7F086288 -/* 0BADDC 7F08626C 00000000 */ nop -/* 0BADE0 7F086270 0C002380 */ jal sndGetPlayingState -/* 0BADE4 7F086274 00000000 */ nop -/* 0BADE8 7F086278 10400003 */ beqz $v0, .Ljp7F086288 -/* 0BADEC 7F08627C 00000000 */ nop -/* 0BADF0 7F086280 0C00240C */ jal sndDeactivate -/* 0BADF4 7F086284 8E040004 */ lw $a0, 4($s0) -.Ljp7F086288: -/* 0BADF8 7F086288 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BADFC 7F08628C C42E83B4 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BAE00 7F086290 3C018003 */ lui $at, %hi(g_BondMoveAnimationSetup + 36) # $at, 0x8003 -/* 0BAE04 7F086294 C42A6B24 */ lwc1 $f10, %lo(g_BondMoveAnimationSetup + 36)($at) -/* 0BAE08 7F086298 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0BAE0C 7F08629C 44813000 */ mtc1 $at, $f6 -/* 0BAE10 7F0862A0 8E280000 */ lw $t0, ($s1) -/* 0BAE14 7F0862A4 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0BAE18 7F0862A8 46065102 */ mul.s $f4, $f10, $f6 -/* 0BAE1C 7F0862AC C508016C */ lwc1 $f8, 0x16c($t0) -/* 0BAE20 7F0862B0 E7A8004C */ swc1 $f8, 0x4c($sp) -/* 0BAE24 7F0862B4 C7AA004C */ lwc1 $f10, 0x4c($sp) -/* 0BAE28 7F0862B8 460E2302 */ mul.s $f12, $f4, $f14 -/* 0BAE2C 7F0862BC 00000000 */ nop -/* 0BAE30 7F0862C0 460C5182 */ mul.s $f6, $f10, $f12 -/* 0BAE34 7F0862C4 E7A603A0 */ swc1 $f6, 0x3a0($sp) -/* 0BAE38 7F0862C8 C5001274 */ lwc1 $f0, 0x1274($t0) -/* 0BAE3C 7F0862CC C50404A0 */ lwc1 $f4, 0x4a0($t0) -/* 0BAE40 7F0862D0 C5061278 */ lwc1 $f6, 0x1278($t0) -/* 0BAE44 7F0862D4 46000207 */ neg.s $f8, $f0 -/* 0BAE48 7F0862D8 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0BAE4C 7F0862DC 46082402 */ mul.s $f16, $f4, $f8 -/* 0BAE50 7F0862E0 46068101 */ sub.s $f4, $f16, $f6 -/* 0BAE54 7F0862E4 46005482 */ mul.s $f18, $f10, $f0 -/* 0BAE58 7F0862E8 E7A40220 */ swc1 $f4, 0x220($sp) -/* 0BAE5C 7F0862EC C508127C */ lwc1 $f8, 0x127c($t0) -/* 0BAE60 7F0862F0 C7A60220 */ lwc1 $f6, 0x220($sp) -/* 0BAE64 7F0862F4 46089281 */ sub.s $f10, $f18, $f8 -/* 0BAE68 7F0862F8 46063102 */ mul.s $f4, $f6, $f6 -/* 0BAE6C 7F0862FC E7AA021C */ swc1 $f10, 0x21c($sp) -/* 0BAE70 7F086300 C7A8021C */ lwc1 $f8, 0x21c($sp) -/* 0BAE74 7F086304 46084282 */ mul.s $f10, $f8, $f8 -/* 0BAE78 7F086308 460A2080 */ add.s $f2, $f4, $f10 -/* 0BAE7C 7F08630C 44812000 */ mtc1 $at, $f4 -/* 0BAE80 7F086310 00000000 */ nop -/* 0BAE84 7F086314 4602203E */ c.le.s $f4, $f2 -/* 0BAE88 7F086318 E7A20218 */ swc1 $f2, 0x218($sp) -/* 0BAE8C 7F08631C 45000008 */ bc1f .Ljp7F086340 -/* 0BAE90 7F086320 00000000 */ nop -/* 0BAE94 7F086324 3C018005 */ lui $at, %hi(D_80055230) # $at, 0x8005 -/* 0BAE98 7F086328 C4205260 */ lwc1 $f0, %lo(D_80055230)($at) -/* 0BAE9C 7F08632C 46003282 */ mul.s $f10, $f6, $f0 -/* 0BAEA0 7F086330 00000000 */ nop -/* 0BAEA4 7F086334 46004102 */ mul.s $f4, $f8, $f0 -/* 0BAEA8 7F086338 E7AA0220 */ swc1 $f10, 0x220($sp) -/* 0BAEAC 7F08633C E7A4021C */ swc1 $f4, 0x21c($sp) -.Ljp7F086340: -/* 0BAEB0 7F086340 3C018005 */ lui $at, %hi(D_80055234) # $at, 0x8005 -/* 0BAEB4 7F086344 C4305264 */ lwc1 $f16, %lo(D_80055234)($at) -/* 0BAEB8 7F086348 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 0BAEBC 7F08634C C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0BAEC0 7F086350 C5020174 */ lwc1 $f2, 0x174($t0) -/* 0BAEC4 7F086354 46103002 */ mul.s $f0, $f6, $f16 -/* 0BAEC8 7F086358 4614003C */ c.lt.s $f0, $f20 -/* 0BAECC 7F08635C 46105302 */ mul.s $f12, $f10, $f16 -/* 0BAED0 7F086360 45020003 */ bc1fl .Ljp7F086370 -/* 0BAED4 7F086364 4614103C */ c.lt.s $f2, $f20 -/* 0BAED8 7F086368 46000007 */ neg.s $f0, $f0 -/* 0BAEDC 7F08636C 4614103C */ c.lt.s $f2, $f20 -.Ljp7F086370: -/* 0BAEE0 7F086370 3C018005 */ lui $at, %hi(D_80055238) # $at, 0x8005 -/* 0BAEE4 7F086374 45020003 */ bc1fl .Ljp7F086384 -/* 0BAEE8 7F086378 4614603C */ c.lt.s $f12, $f20 -/* 0BAEEC 7F08637C 46001087 */ neg.s $f2, $f2 -/* 0BAEF0 7F086380 4614603C */ c.lt.s $f12, $f20 -.Ljp7F086384: -/* 0BAEF4 7F086384 00000000 */ nop -/* 0BAEF8 7F086388 45020003 */ bc1fl .Ljp7F086398 -/* 0BAEFC 7F08638C 4600103C */ c.lt.s $f2, $f0 -/* 0BAF00 7F086390 46006307 */ neg.s $f12, $f12 -/* 0BAF04 7F086394 4600103C */ c.lt.s $f2, $f0 -.Ljp7F086398: -/* 0BAF08 7F086398 E7A20398 */ swc1 $f2, 0x398($sp) -/* 0BAF0C 7F08639C 45020003 */ bc1fl .Ljp7F0863AC -/* 0BAF10 7F0863A0 C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BAF14 7F0863A4 E7A00398 */ swc1 $f0, 0x398($sp) -/* 0BAF18 7F0863A8 C7A80398 */ lwc1 $f8, 0x398($sp) -.Ljp7F0863AC: -/* 0BAF1C 7F0863AC 460C403C */ c.lt.s $f8, $f12 -/* 0BAF20 7F0863B0 00000000 */ nop -/* 0BAF24 7F0863B4 45020003 */ bc1fl .Ljp7F0863C4 -/* 0BAF28 7F0863B8 C7A40218 */ lwc1 $f4, 0x218($sp) -/* 0BAF2C 7F0863BC E7AC0398 */ swc1 $f12, 0x398($sp) -/* 0BAF30 7F0863C0 C7A40218 */ lwc1 $f4, 0x218($sp) -.Ljp7F0863C4: -/* 0BAF34 7F0863C4 C4265268 */ lwc1 $f6, %lo(D_80055238)($at) -/* 0BAF38 7F0863C8 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0BAF3C 7F0863CC 44810000 */ mtc1 $at, $f0 -/* 0BAF40 7F0863D0 4604303E */ c.le.s $f6, $f4 -/* 0BAF44 7F0863D4 00000000 */ nop -/* 0BAF48 7F0863D8 45020008 */ bc1fl .Ljp7F0863FC -/* 0BAF4C 7F0863DC C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BAF50 7F0863E0 C7AA0398 */ lwc1 $f10, 0x398($sp) -/* 0BAF54 7F0863E4 4610503C */ c.lt.s $f10, $f16 -/* 0BAF58 7F0863E8 00000000 */ nop -/* 0BAF5C 7F0863EC 45020003 */ bc1fl .Ljp7F0863FC -/* 0BAF60 7F0863F0 C7A80398 */ lwc1 $f8, 0x398($sp) -/* 0BAF64 7F0863F4 E7B00398 */ swc1 $f16, 0x398($sp) -/* 0BAF68 7F0863F8 C7A80398 */ lwc1 $f8, 0x398($sp) -.Ljp7F0863FC: -/* 0BAF6C 7F0863FC 4608003E */ c.le.s $f0, $f8 -/* 0BAF70 7F086400 00000000 */ nop -/* 0BAF74 7F086404 4502000B */ bc1fl .Ljp7F086434 -/* 0BAF78 7F086408 C7AA0398 */ lwc1 $f10, 0x398($sp) -/* 0BAF7C 7F08640C 46004101 */ sub.s $f4, $f8, $f0 -/* 0BAF80 7F086410 3C014461 */ li $at, 0x44610000 # 900.000000 -/* 0BAF84 7F086414 44815000 */ mtc1 $at, $f10 -/* 0BAF88 7F086418 460E2182 */ mul.s $f6, $f4, $f14 -/* 0BAF8C 7F08641C C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BAF90 7F086420 460A3203 */ div.s $f8, $f6, $f10 -/* 0BAF94 7F086424 46082180 */ add.s $f6, $f4, $f8 -/* 0BAF98 7F086428 1000000A */ b .Ljp7F086454 -/* 0BAF9C 7F08642C E506019C */ swc1 $f6, 0x19c($t0) -/* 0BAFA0 7F086430 C7AA0398 */ lwc1 $f10, 0x398($sp) -.Ljp7F086434: -/* 0BAFA4 7F086434 3C018005 */ lui $at, %hi(D_8005523C) # $at, 0x8005 -/* 0BAFA8 7F086438 C426526C */ lwc1 $f6, %lo(D_8005523C)($at) -/* 0BAFAC 7F08643C 460A0101 */ sub.s $f4, $f0, $f10 -/* 0BAFB0 7F086440 460E2202 */ mul.s $f8, $f4, $f14 -/* 0BAFB4 7F086444 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0BAFB8 7F086448 46064283 */ div.s $f10, $f8, $f6 -/* 0BAFBC 7F08644C 460A2201 */ sub.s $f8, $f4, $f10 -/* 0BAFC0 7F086450 E508019C */ swc1 $f8, 0x19c($t0) -.Ljp7F086454: -/* 0BAFC4 7F086454 8E280000 */ lw $t0, ($s1) -/* 0BAFC8 7F086458 C500019C */ lwc1 $f0, 0x19c($t0) -/* 0BAFCC 7F08645C 4614003C */ c.lt.s $f0, $f20 -/* 0BAFD0 7F086460 00000000 */ nop -/* 0BAFD4 7F086464 45020005 */ bc1fl .Ljp7F08647C -/* 0BAFD8 7F086468 3C013F80 */ lui $at, 0x3f80 -/* 0BAFDC 7F08646C E514019C */ swc1 $f20, 0x19c($t0) -/* 0BAFE0 7F086470 1000000C */ b .Ljp7F0864A4 -/* 0BAFE4 7F086474 8E280000 */ lw $t0, ($s1) -/* 0BAFE8 7F086478 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.Ljp7F08647C: -/* 0BAFEC 7F08647C 44813000 */ mtc1 $at, $f6 -/* 0BAFF0 7F086480 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BAFF4 7F086484 4600303C */ c.lt.s $f6, $f0 -/* 0BAFF8 7F086488 00000000 */ nop -/* 0BAFFC 7F08648C 45020006 */ bc1fl .Ljp7F0864A8 -/* 0BB000 7F086490 C7AC0398 */ lwc1 $f12, 0x398($sp) -/* 0BB004 7F086494 44812000 */ mtc1 $at, $f4 -/* 0BB008 7F086498 00000000 */ nop -/* 0BB00C 7F08649C E504019C */ swc1 $f4, 0x19c($t0) -/* 0BB010 7F0864A0 8E280000 */ lw $t0, ($s1) -.Ljp7F0864A4: -/* 0BB014 7F0864A4 C7AC0398 */ lwc1 $f12, 0x398($sp) -.Ljp7F0864A8: -/* 0BB018 7F0864A8 C50E0174 */ lwc1 $f14, 0x174($t0) -/* 0BB01C 7F0864AC 0FC20451 */ jal bondviewMoveAnimationTick -/* 0BB020 7F0864B0 8FA603A0 */ lw $a2, 0x3a0($sp) -/* 0BB024 7F0864B4 8E280000 */ lw $t0, ($s1) -/* 0BB028 7F0864B8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BB02C 7F0864BC C42E83B4 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BB030 7F0864C0 C5020504 */ lwc1 $f2, 0x504($t0) -/* 0BB034 7F0864C4 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0BB038 7F0864C8 C50004FC */ lwc1 $f0, 0x4fc($t0) -/* 0BB03C 7F0864CC C50604A0 */ lwc1 $f6, 0x4a0($t0) -/* 0BB040 7F0864D0 460A1202 */ mul.s $f8, $f2, $f10 -/* 0BB044 7F0864D4 00000000 */ nop -/* 0BB048 7F0864D8 46060102 */ mul.s $f4, $f0, $f6 -/* 0BB04C 7F0864DC 46044281 */ sub.s $f10, $f8, $f4 -/* 0BB050 7F0864E0 C7A803AC */ lwc1 $f8, 0x3ac($sp) -/* 0BB054 7F0864E4 460E5182 */ mul.s $f6, $f10, $f14 -/* 0BB058 7F0864E8 46064100 */ add.s $f4, $f8, $f6 -/* 0BB05C 7F0864EC E7A403AC */ swc1 $f4, 0x3ac($sp) -/* 0BB060 7F0864F0 C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0BB064 7F0864F4 C5060498 */ lwc1 $f6, 0x498($t0) -/* 0BB068 7F0864F8 460A1202 */ mul.s $f8, $f2, $f10 -/* 0BB06C 7F0864FC 00000000 */ nop -/* 0BB070 7F086500 46060282 */ mul.s $f10, $f0, $f6 -/* 0BB074 7F086504 460A4180 */ add.s $f6, $f8, $f10 -/* 0BB078 7F086508 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BB07C 7F08650C 460E3202 */ mul.s $f8, $f6, $f14 -/* 0BB080 7F086510 46085180 */ add.s $f6, $f10, $f8 -/* 0BB084 7F086514 C7AA0220 */ lwc1 $f10, 0x220($sp) -/* 0BB088 7F086518 460A2200 */ add.s $f8, $f4, $f10 -/* 0BB08C 7F08651C C7A4021C */ lwc1 $f4, 0x21c($sp) -/* 0BB090 7F086520 E7A603B4 */ swc1 $f6, 0x3b4($sp) -/* 0BB094 7F086524 46043280 */ add.s $f10, $f6, $f4 -/* 0BB098 7F086528 E7A803AC */ swc1 $f8, 0x3ac($sp) -/* 0BB09C 7F08652C E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0BB0A0 7F086530 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BB0A4 7F086534 E7A80208 */ swc1 $f8, 0x208($sp) -/* 0BB0A8 7F086538 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0BB0AC 7F08653C E7A60204 */ swc1 $f6, 0x204($sp) -/* 0BB0B0 7F086540 8D0E0488 */ lw $t6, 0x488($t0) -/* 0BB0B4 7F086544 0FC246BE */ jal get_debug_fast_bond_flag -/* 0BB0B8 7F086548 AFAE0200 */ sw $t6, 0x200($sp) -/* 0BB0BC 7F08654C 50400021 */ beql $v0, $zero, .Ljp7F0865D4 -/* 0BB0C0 7F086550 8E380000 */ lw $t8, ($s1) -/* 0BB0C4 7F086554 8E280000 */ lw $t0, ($s1) -/* 0BB0C8 7F086558 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0BB0CC 7F08655C 44810000 */ mtc1 $at, $f0 -/* 0BB0D0 7F086560 C5040498 */ lwc1 $f4, 0x498($t0) -/* 0BB0D4 7F086564 C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BB0D8 7F086568 C50604A0 */ lwc1 $f6, 0x4a0($t0) -/* 0BB0DC 7F08656C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8005 -/* 0BB0E0 7F086570 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BB0E4 7F086574 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0BB0E8 7F086578 C42E83B4 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0BB0EC 7F08657C 46043282 */ mul.s $f10, $f6, $f4 -/* 0BB0F0 7F086580 460A4181 */ sub.s $f6, $f8, $f10 -/* 0BB0F4 7F086584 C7AA03AC */ lwc1 $f10, 0x3ac($sp) -/* 0BB0F8 7F086588 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BB0FC 7F08658C 00000000 */ nop -/* 0BB100 7F086590 46002202 */ mul.s $f8, $f4, $f0 -/* 0BB104 7F086594 46085180 */ add.s $f6, $f10, $f8 -/* 0BB108 7F086598 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0BB10C 7F08659C C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0BB110 7F0865A0 C50404A0 */ lwc1 $f4, 0x4a0($t0) -/* 0BB114 7F0865A4 C5060498 */ lwc1 $f6, 0x498($t0) -/* 0BB118 7F0865A8 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BB11C 7F0865AC C504016C */ lwc1 $f4, 0x16c($t0) -/* 0BB120 7F0865B0 46043282 */ mul.s $f10, $f6, $f4 -/* 0BB124 7F0865B4 460A4180 */ add.s $f6, $f8, $f10 -/* 0BB128 7F0865B8 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BB12C 7F0865BC 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BB130 7F0865C0 00000000 */ nop -/* 0BB134 7F0865C4 46002202 */ mul.s $f8, $f4, $f0 -/* 0BB138 7F0865C8 46085180 */ add.s $f6, $f10, $f8 -/* 0BB13C 7F0865CC E7A603B4 */ swc1 $f6, 0x3b4($sp) -/* 0BB140 7F0865D0 8E380000 */ lw $t8, ($s1) -.Ljp7F0865D4: -/* 0BB144 7F0865D4 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BB148 7F0865D8 00002825 */ move $a1, $zero -/* 0BB14C 7F0865DC C7041274 */ lwc1 $f4, 0x1274($t8) -/* 0BB150 7F0865E0 4604A032 */ c.eq.s $f20, $f4 -/* 0BB154 7F0865E4 00000000 */ nop -/* 0BB158 7F0865E8 45000002 */ bc1f .Ljp7F0865F4 -/* 0BB15C 7F0865EC 00000000 */ nop -/* 0BB160 7F0865F0 24050001 */ li $a1, 1 -.Ljp7F0865F4: -/* 0BB164 7F0865F4 0FC1F7E1 */ jal bondviewCalcUpdatePlayerCollision -/* 0BB168 7F0865F8 00000000 */ nop -/* 0BB16C 7F0865FC 8E2F0000 */ lw $t7, ($s1) -/* 0BB170 7F086600 3C018005 */ lui $at, %hi(D_80055240) # $at, 0x8005 -/* 0BB174 7F086604 C4285270 */ lwc1 $f8, %lo(D_80055240)($at) -/* 0BB178 7F086608 C5EA04B0 */ lwc1 $f10, 0x4b0($t7) -/* 0BB17C 7F08660C 27B001B4 */ addiu $s0, $sp, 0x1b4 -/* 0BB180 7F086610 AFB00010 */ sw $s0, 0x10($sp) -/* 0BB184 7F086614 46085182 */ mul.s $f6, $f10, $f8 -/* 0BB188 7F086618 27A40200 */ addiu $a0, $sp, 0x200 -/* 0BB18C 7F08661C 8FA50208 */ lw $a1, 0x208($sp) -/* 0BB190 7F086620 8FA60204 */ lw $a2, 0x204($sp) -/* 0BB194 7F086624 44073000 */ mfc1 $a3, $f6 -/* 0BB198 7F086628 0FC2CBB1 */ jal stanTileDistanceRelated -/* 0BB19C 7F08662C 00000000 */ nop -/* 0BB1A0 7F086630 0FC2CBD5 */ jal stanGetLocusCount -/* 0BB1A4 7F086634 02002025 */ move $a0, $s0 -/* 0BB1A8 7F086638 10400002 */ beqz $v0, .Ljp7F086644 -/* 0BB1AC 7F08663C 240A0001 */ li $t2, 1 -/* 0BB1B0 7F086640 AFAA0394 */ sw $t2, 0x394($sp) -.Ljp7F086644: -/* 0BB1B4 7F086644 8E280000 */ lw $t0, ($s1) -/* 0BB1B8 7F086648 3C018005 */ lui $at, %hi(D_80055244) # $at, 0x8005 -/* 0BB1BC 7F08664C C42A5274 */ lwc1 $f10, %lo(D_80055244)($at) -/* 0BB1C0 7F086650 C50404B0 */ lwc1 $f4, 0x4b0($t0) -/* 0BB1C4 7F086654 8D05048C */ lw $a1, 0x48c($t0) -/* 0BB1C8 7F086658 8D060494 */ lw $a2, 0x494($t0) -/* 0BB1CC 7F08665C 460A2202 */ mul.s $f8, $f4, $f10 -/* 0BB1D0 7F086660 AFB00010 */ sw $s0, 0x10($sp) -/* 0BB1D4 7F086664 25040488 */ addiu $a0, $t0, 0x488 -/* 0BB1D8 7F086668 44074000 */ mfc1 $a3, $f8 -/* 0BB1DC 7F08666C 0FC2CBB1 */ jal stanTileDistanceRelated -/* 0BB1E0 7F086670 00000000 */ nop -/* 0BB1E4 7F086674 0FC2CBD5 */ jal stanGetLocusCount -/* 0BB1E8 7F086678 02002025 */ move $a0, $s0 -/* 0BB1EC 7F08667C 10400002 */ beqz $v0, .Ljp7F086688 -/* 0BB1F0 7F086680 24190001 */ li $t9, 1 -/* 0BB1F4 7F086684 AFB90394 */ sw $t9, 0x394($sp) -.Ljp7F086688: -/* 0BB1F8 7F086688 8E280000 */ lw $t0, ($s1) -/* 0BB1FC 7F08668C 8D05048C */ lw $a1, 0x48c($t0) -/* 0BB200 7F086690 8D060494 */ lw $a2, 0x494($t0) -/* 0BB204 7F086694 8D0704B0 */ lw $a3, 0x4b0($t0) -/* 0BB208 7F086698 AFB00010 */ sw $s0, 0x10($sp) -/* 0BB20C 7F08669C 0FC2CBB1 */ jal stanTileDistanceRelated -/* 0BB210 7F0866A0 25040488 */ addiu $a0, $t0, 0x488 -/* 0BB214 7F0866A4 0FC2CBD5 */ jal stanGetLocusCount -/* 0BB218 7F0866A8 02002025 */ move $a0, $s0 -/* 0BB21C 7F0866AC 1440000D */ bnez $v0, .Ljp7F0866E4 -/* 0BB220 7F0866B0 00000000 */ nop -/* 0BB224 7F0866B4 8E2B0000 */ lw $t3, ($s1) -/* 0BB228 7F0866B8 3C018005 */ lui $at, %hi(D_80055248) # $at, 0x8005 -/* 0BB22C 7F0866BC C4245278 */ lwc1 $f4, %lo(D_80055248)($at) -/* 0BB230 7F0866C0 C56604B0 */ lwc1 $f6, 0x4b0($t3) -/* 0BB234 7F0866C4 AFB00010 */ sw $s0, 0x10($sp) -/* 0BB238 7F0866C8 27A40200 */ addiu $a0, $sp, 0x200 -/* 0BB23C 7F0866CC 46043282 */ mul.s $f10, $f6, $f4 -/* 0BB240 7F0866D0 8FA50208 */ lw $a1, 0x208($sp) -/* 0BB244 7F0866D4 8FA60204 */ lw $a2, 0x204($sp) -/* 0BB248 7F0866D8 44075000 */ mfc1 $a3, $f10 -/* 0BB24C 7F0866DC 0FC2CBB1 */ jal stanTileDistanceRelated -/* 0BB250 7F0866E0 00000000 */ nop -.Ljp7F0866E4: -/* 0BB254 7F0866E4 0FC2CBD5 */ jal stanGetLocusCount -/* 0BB258 7F0866E8 02002025 */ move $a0, $s0 -/* 0BB25C 7F0866EC 104000B8 */ beqz $v0, .Ljp7F0869D0 -/* 0BB260 7F0866F0 240C0001 */ li $t4, 1 -/* 0BB264 7F0866F4 AFAC0394 */ sw $t4, 0x394($sp) -/* 0BB268 7F0866F8 27A40174 */ addiu $a0, $sp, 0x174 -/* 0BB26C 7F0866FC 27A50170 */ addiu $a1, $sp, 0x170 -/* 0BB270 7F086700 0FC2CBF4 */ jal stanGetMoveBondCollisionTiles -/* 0BB274 7F086704 27A60184 */ addiu $a2, $sp, 0x184 -/* 0BB278 7F086708 8E2D0000 */ lw $t5, ($s1) -/* 0BB27C 7F08670C C7A801A0 */ lwc1 $f8, 0x1a0($sp) -/* 0BB280 7F086710 C5A60074 */ lwc1 $f6, 0x74($t5) -/* 0BB284 7F086714 4608303E */ c.le.s $f6, $f8 -/* 0BB288 7F086718 C7A80198 */ lwc1 $f8, 0x198($sp) -/* 0BB28C 7F08671C C7A6018C */ lwc1 $f6, 0x18c($sp) -/* 0BB290 7F086720 450200AC */ bc1fl .Ljp7F0869D4 -/* 0BB294 7F086724 8E280000 */ lw $t0, ($s1) -/* 0BB298 7F086728 C7A40184 */ lwc1 $f4, 0x184($sp) -/* 0BB29C 7F08672C C7AA0190 */ lwc1 $f10, 0x190($sp) -/* 0BB2A0 7F086730 46064381 */ sub.s $f14, $f8, $f6 -/* 0BB2A4 7F086734 460A2081 */ sub.s $f2, $f4, $f10 -/* 0BB2A8 7F086738 460E7102 */ mul.s $f4, $f14, $f14 -/* 0BB2AC 7F08673C E7AE016C */ swc1 $f14, 0x16c($sp) -/* 0BB2B0 7F086740 46021282 */ mul.s $f10, $f2, $f2 -/* 0BB2B4 7F086744 E7A20168 */ swc1 $f2, 0x168($sp) -/* 0BB2B8 7F086748 0C007E08 */ jal sqrtf -/* 0BB2BC 7F08674C 460A2300 */ add.s $f12, $f4, $f10 -/* 0BB2C0 7F086750 C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0BB2C4 7F086754 C7AE016C */ lwc1 $f14, 0x16c($sp) -/* 0BB2C8 7F086758 C7A80204 */ lwc1 $f8, 0x204($sp) -/* 0BB2CC 7F08675C 46001083 */ div.s $f2, $f2, $f0 -/* 0BB2D0 7F086760 C7A6018C */ lwc1 $f6, 0x18c($sp) -/* 0BB2D4 7F086764 E7A80030 */ swc1 $f8, 0x30($sp) -/* 0BB2D8 7F086768 46064101 */ sub.s $f4, $f8, $f6 -/* 0BB2DC 7F08676C C7A80184 */ lwc1 $f8, 0x184($sp) -/* 0BB2E0 7F086770 E7A60034 */ swc1 $f6, 0x34($sp) -/* 0BB2E4 7F086774 46007383 */ div.s $f14, $f14, $f0 -/* 0BB2E8 7F086778 46022282 */ mul.s $f10, $f4, $f2 -/* 0BB2EC 7F08677C C7A40208 */ lwc1 $f4, 0x208($sp) -/* 0BB2F0 7F086780 46082181 */ sub.s $f6, $f4, $f8 -/* 0BB2F4 7F086784 460E3182 */ mul.s $f6, $f6, $f14 -/* 0BB2F8 7F086788 46065300 */ add.s $f12, $f10, $f6 -/* 0BB2FC 7F08678C C7A60030 */ lwc1 $f6, 0x30($sp) -/* 0BB300 7F086790 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BB304 7F086794 E7AC0050 */ swc1 $f12, 0x50($sp) -/* 0BB308 7F086798 460A3180 */ add.s $f6, $f6, $f10 -/* 0BB30C 7F08679C C7AA0034 */ lwc1 $f10, 0x34($sp) -/* 0BB310 7F0867A0 460A3181 */ sub.s $f6, $f6, $f10 -/* 0BB314 7F0867A4 46023282 */ mul.s $f10, $f6, $f2 -/* 0BB318 7F0867A8 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BB31C 7F0867AC 46062100 */ add.s $f4, $f4, $f6 -/* 0BB320 7F0867B0 46082181 */ sub.s $f6, $f4, $f8 -/* 0BB324 7F0867B4 460E3102 */ mul.s $f4, $f6, $f14 -/* 0BB328 7F0867B8 46045480 */ add.s $f18, $f10, $f4 -/* 0BB32C 7F0867BC C7A403B4 */ lwc1 $f4, 0x3b4($sp) -/* 0BB330 7F0867C0 46126202 */ mul.s $f8, $f12, $f18 -/* 0BB334 7F0867C4 46009406 */ mov.s $f16, $f18 -/* 0BB338 7F0867C8 4614403E */ c.le.s $f8, $f20 -/* 0BB33C 7F0867CC 46042202 */ mul.s $f8, $f4, $f4 -/* 0BB340 7F0867D0 45020004 */ bc1fl .Ljp7F0867E4 -/* 0BB344 7F0867D4 4614903C */ c.lt.s $f18, $f20 -/* 0BB348 7F0867D8 1000001F */ b .Ljp7F086858 -/* 0BB34C 7F0867DC 4600A386 */ mov.s $f14, $f20 -/* 0BB350 7F0867E0 4614903C */ c.lt.s $f18, $f20 -.Ljp7F0867E4: -/* 0BB354 7F0867E4 00000000 */ nop -/* 0BB358 7F0867E8 45020005 */ bc1fl .Ljp7F086800 -/* 0BB35C 7F0867EC 4610603E */ c.le.s $f12, $f16 -/* 0BB360 7F0867F0 C7AC0050 */ lwc1 $f12, 0x50($sp) -/* 0BB364 7F0867F4 46009407 */ neg.s $f16, $f18 -/* 0BB368 7F0867F8 46006307 */ neg.s $f12, $f12 -/* 0BB36C 7F0867FC 4610603E */ c.le.s $f12, $f16 -.Ljp7F086800: -/* 0BB370 7F086800 00000000 */ nop -/* 0BB374 7F086804 45020004 */ bc1fl .Ljp7F086818 -/* 0BB378 7F086808 8E2E0000 */ lw $t6, ($s1) -/* 0BB37C 7F08680C 10000012 */ b .Ljp7F086858 -/* 0BB380 7F086810 4600A386 */ mov.s $f14, $f20 -/* 0BB384 7F086814 8E2E0000 */ lw $t6, ($s1) -.Ljp7F086818: -/* 0BB388 7F086818 C5C004B0 */ lwc1 $f0, 0x4b0($t6) -/* 0BB38C 7F08681C 4610003C */ c.lt.s $f0, $f16 -/* 0BB390 7F086820 00000000 */ nop -/* 0BB394 7F086824 45020004 */ bc1fl .Ljp7F086838 -/* 0BB398 7F086828 4600603C */ c.lt.s $f12, $f0 -/* 0BB39C 7F08682C 1000000A */ b .Ljp7F086858 -/* 0BB3A0 7F086830 4600A386 */ mov.s $f14, $f20 -/* 0BB3A4 7F086834 4600603C */ c.lt.s $f12, $f0 -.Ljp7F086838: -/* 0BB3A8 7F086838 00000000 */ nop -/* 0BB3AC 7F08683C 45020004 */ bc1fl .Ljp7F086850 -/* 0BB3B0 7F086840 46006181 */ sub.s $f6, $f12, $f0 -/* 0BB3B4 7F086844 10000004 */ b .Ljp7F086858 -/* 0BB3B8 7F086848 4600A386 */ mov.s $f14, $f20 -/* 0BB3BC 7F08684C 46006181 */ sub.s $f6, $f12, $f0 -.Ljp7F086850: -/* 0BB3C0 7F086850 46106281 */ sub.s $f10, $f12, $f16 -/* 0BB3C4 7F086854 460A3383 */ div.s $f14, $f6, $f10 -.Ljp7F086858: -/* 0BB3C8 7F086858 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0BB3CC 7F08685C E7AE0180 */ swc1 $f14, 0x180($sp) -/* 0BB3D0 7F086860 46063282 */ mul.s $f10, $f6, $f6 -/* 0BB3D4 7F086864 0C007E08 */ jal sqrtf -/* 0BB3D8 7F086868 460A4300 */ add.s $f12, $f8, $f10 -/* 0BB3DC 7F08686C 4600A03C */ c.lt.s $f20, $f0 -/* 0BB3E0 7F086870 C7AE0180 */ lwc1 $f14, 0x180($sp) -/* 0BB3E4 7F086874 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BB3E8 7F086878 4502001B */ bc1fl .Ljp7F0868E8 -/* 0BB3EC 7F08687C C7A6019C */ lwc1 $f6, 0x19c($sp) -/* 0BB3F0 7F086880 44812000 */ mtc1 $at, $f4 -/* 0BB3F4 7F086884 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0BB3F8 7F086888 44814000 */ mtc1 $at, $f8 -/* 0BB3FC 7F08688C 460E2181 */ sub.s $f6, $f4, $f14 -/* 0BB400 7F086890 8E380000 */ lw $t8, ($s1) -/* 0BB404 7F086894 C7A401A0 */ lwc1 $f4, 0x1a0($sp) -/* 0BB408 7F086898 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0BB40C 7F08689C 46003082 */ mul.s $f2, $f6, $f0 -/* 0BB410 7F0868A0 00000000 */ nop -/* 0BB414 7F0868A4 46081302 */ mul.s $f12, $f2, $f8 -/* 0BB418 7F0868A8 E7AC0390 */ swc1 $f12, 0x390($sp) -/* 0BB41C 7F0868AC C7120074 */ lwc1 $f18, 0x74($t8) -/* 0BB420 7F0868B0 460C9280 */ add.s $f10, $f18, $f12 -/* 0BB424 7F0868B4 460A203E */ c.le.s $f4, $f10 -/* 0BB428 7F0868B8 00000000 */ nop -/* 0BB42C 7F0868BC 45000009 */ bc1f .Ljp7F0868E4 -/* 0BB430 7F0868C0 00000000 */ nop -/* 0BB434 7F0868C4 46122181 */ sub.s $f6, $f4, $f18 -/* 0BB438 7F0868C8 44814000 */ mtc1 $at, $f8 -/* 0BB43C 7F0868CC 00000000 */ nop -/* 0BB440 7F0868D0 46083283 */ div.s $f10, $f6, $f8 -/* 0BB444 7F0868D4 E7A60390 */ swc1 $f6, 0x390($sp) -/* 0BB448 7F0868D8 460A1401 */ sub.s $f16, $f2, $f10 -/* 0BB44C 7F0868DC 46008103 */ div.s $f4, $f16, $f0 -/* 0BB450 7F0868E0 46047380 */ add.s $f14, $f14, $f4 -.Ljp7F0868E4: -/* 0BB454 7F0868E4 C7A6019C */ lwc1 $f6, 0x19c($sp) -.Ljp7F0868E8: -/* 0BB458 7F0868E8 C7A80184 */ lwc1 $f8, 0x184($sp) -/* 0BB45C 7F0868EC C7AA01A4 */ lwc1 $f10, 0x1a4($sp) -/* 0BB460 7F0868F0 C7A4018C */ lwc1 $f4, 0x18c($sp) -/* 0BB464 7F0868F4 46083301 */ sub.s $f12, $f6, $f8 -/* 0BB468 7F0868F8 C7A601A8 */ lwc1 $f6, 0x1a8($sp) -/* 0BB46C 7F0868FC 8E280000 */ lw $t0, ($s1) -/* 0BB470 7F086900 46045401 */ sub.s $f16, $f10, $f4 -/* 0BB474 7F086904 C7AA01B0 */ lwc1 $f10, 0x1b0($sp) -/* 0BB478 7F086908 46083481 */ sub.s $f18, $f6, $f8 -/* 0BB47C 7F08690C 46045181 */ sub.s $f6, $f10, $f4 -/* 0BB480 7F086910 46129202 */ mul.s $f8, $f18, $f18 -/* 0BB484 7F086914 00000000 */ nop -/* 0BB488 7F086918 46063282 */ mul.s $f10, $f6, $f6 -/* 0BB48C 7F08691C E7A60048 */ swc1 $f6, 0x48($sp) -/* 0BB490 7F086920 460A4100 */ add.s $f4, $f8, $f10 -/* 0BB494 7F086924 460C6202 */ mul.s $f8, $f12, $f12 -/* 0BB498 7F086928 00000000 */ nop -/* 0BB49C 7F08692C 46108282 */ mul.s $f10, $f16, $f16 -/* 0BB4A0 7F086930 460A4200 */ add.s $f8, $f8, $f10 -/* 0BB4A4 7F086934 C7AA01A0 */ lwc1 $f10, 0x1a0($sp) -/* 0BB4A8 7F086938 4608203C */ c.lt.s $f4, $f8 -/* 0BB4AC 7F08693C C7A40188 */ lwc1 $f4, 0x188($sp) -/* 0BB4B0 7F086940 45000003 */ bc1f .Ljp7F086950 -/* 0BB4B4 7F086944 46045201 */ sub.s $f8, $f10, $f4 -/* 0BB4B8 7F086948 46009306 */ mov.s $f12, $f18 -/* 0BB4BC 7F08694C 46003406 */ mov.s $f16, $f6 -.Ljp7F086950: -/* 0BB4C0 7F086950 C7A60390 */ lwc1 $f6, 0x390($sp) -/* 0BB4C4 7F086954 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0BB4C8 7F086958 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0BB4CC 7F08695C 46083003 */ div.s $f0, $f6, $f8 -/* 0BB4D0 7F086960 00002825 */ move $a1, $zero -/* 0BB4D4 7F086964 460C0282 */ mul.s $f10, $f0, $f12 -/* 0BB4D8 7F086968 00000000 */ nop -/* 0BB4DC 7F08696C 460E2182 */ mul.s $f6, $f4, $f14 -/* 0BB4E0 7F086970 46065200 */ add.s $f8, $f10, $f6 -/* 0BB4E4 7F086974 46100102 */ mul.s $f4, $f0, $f16 -/* 0BB4E8 7F086978 C7AA03B4 */ lwc1 $f10, 0x3b4($sp) -/* 0BB4EC 7F08697C E7A803AC */ swc1 $f8, 0x3ac($sp) -/* 0BB4F0 7F086980 460E5182 */ mul.s $f6, $f10, $f14 -/* 0BB4F4 7F086984 C7AA0208 */ lwc1 $f10, 0x208($sp) -/* 0BB4F8 7F086988 46062200 */ add.s $f8, $f4, $f6 -/* 0BB4FC 7F08698C E7A803B4 */ swc1 $f8, 0x3b4($sp) -/* 0BB500 7F086990 E50A048C */ swc1 $f10, 0x48c($t0) -/* 0BB504 7F086994 8E2F0000 */ lw $t7, ($s1) -/* 0BB508 7F086998 C7A40204 */ lwc1 $f4, 0x204($sp) -/* 0BB50C 7F08699C E5E40494 */ swc1 $f4, 0x494($t7) -/* 0BB510 7F0869A0 8E390000 */ lw $t9, ($s1) -/* 0BB514 7F0869A4 8FAA0200 */ lw $t2, 0x200($sp) -/* 0BB518 7F0869A8 AF2A0488 */ sw $t2, 0x488($t9) -/* 0BB51C 7F0869AC 8E2B0000 */ lw $t3, ($s1) -/* 0BB520 7F0869B0 C5661274 */ lwc1 $f6, 0x1274($t3) -/* 0BB524 7F0869B4 4606A032 */ c.eq.s $f20, $f6 -/* 0BB528 7F0869B8 00000000 */ nop -/* 0BB52C 7F0869BC 45000002 */ bc1f .Ljp7F0869C8 -/* 0BB530 7F0869C0 00000000 */ nop -/* 0BB534 7F0869C4 24050001 */ li $a1, 1 -.Ljp7F0869C8: -/* 0BB538 7F0869C8 0FC1F7E1 */ jal bondviewCalcUpdatePlayerCollision -/* 0BB53C 7F0869CC 00000000 */ nop -.Ljp7F0869D0: -/* 0BB540 7F0869D0 8E280000 */ lw $t0, ($s1) -.Ljp7F0869D4: -/* 0BB544 7F0869D4 C7AA0208 */ lwc1 $f10, 0x208($sp) -/* 0BB548 7F0869D8 C7A60204 */ lwc1 $f6, 0x204($sp) -/* 0BB54C 7F0869DC C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BB550 7F0869E0 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BB554 7F0869E4 460A4081 */ sub.s $f2, $f8, $f10 -/* 0BB558 7F0869E8 C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0BB55C 7F0869EC 46062381 */ sub.s $f14, $f4, $f6 -/* 0BB560 7F0869F0 46084282 */ mul.s $f10, $f8, $f8 -/* 0BB564 7F0869F4 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0BB568 7F0869F8 46042182 */ mul.s $f6, $f4, $f4 -/* 0BB56C 7F0869FC 46065000 */ add.s $f0, $f10, $f6 -/* 0BB570 7F086A00 46140032 */ c.eq.s $f0, $f20 -/* 0BB574 7F086A04 46000306 */ mov.s $f12, $f0 -/* 0BB578 7F086A08 45010006 */ bc1t .Ljp7F086A24 -/* 0BB57C 7F086A0C 00000000 */ nop -/* 0BB580 7F086A10 46021202 */ mul.s $f8, $f2, $f2 -/* 0BB584 7F086A14 00000000 */ nop -/* 0BB588 7F086A18 460E7102 */ mul.s $f4, $f14, $f14 -/* 0BB58C 7F086A1C 46044280 */ add.s $f10, $f8, $f4 -/* 0BB590 7F086A20 46005303 */ div.s $f12, $f10, $f0 -.Ljp7F086A24: -/* 0BB594 7F086A24 0C007E08 */ jal sqrtf -/* 0BB598 7F086A28 00000000 */ nop -/* 0BB59C 7F086A2C C7A80220 */ lwc1 $f8, 0x220($sp) -/* 0BB5A0 7F086A30 8E280000 */ lw $t0, ($s1) -/* 0BB5A4 7F086A34 46080102 */ mul.s $f4, $f0, $f8 -/* 0BB5A8 7F086A38 C5061278 */ lwc1 $f6, 0x1278($t0) -/* 0BB5AC 7F086A3C 46043280 */ add.s $f10, $f6, $f4 -/* 0BB5B0 7F086A40 E50A1278 */ swc1 $f10, 0x1278($t0) -/* 0BB5B4 7F086A44 C7A6021C */ lwc1 $f6, 0x21c($sp) -/* 0BB5B8 7F086A48 8E280000 */ lw $t0, ($s1) -/* 0BB5BC 7F086A4C 46060102 */ mul.s $f4, $f0, $f6 -/* 0BB5C0 7F086A50 C508127C */ lwc1 $f8, 0x127c($t0) -/* 0BB5C4 7F086A54 46044280 */ add.s $f10, $f8, $f4 -/* 0BB5C8 7F086A58 E50A127C */ swc1 $f10, 0x127c($t0) -.Ljp7F086A5C: -/* 0BB5CC 7F086A5C 8E280000 */ lw $t0, ($s1) -.Ljp7F086A60: -/* 0BB5D0 7F086A60 3C018005 */ lui $at, %hi(D_8005524C) -/* 0BB5D4 7F086A64 C428527C */ lwc1 $f8, %lo(D_8005524C)($at) -/* 0BB5D8 7F086A68 C5060160 */ lwc1 $f6, 0x160($t0) -/* 0BB5DC 7F086A6C 3C0140A0 */ li $at, 0x40A00000 # 5.000000 -/* 0BB5E0 7F086A70 C50A00A4 */ lwc1 $f10, 0xa4($t0) -/* 0BB5E4 7F086A74 46083103 */ div.s $f4, $f6, $f8 -/* 0BB5E8 7F086A78 44813000 */ mtc1 $at, $f6 -/* 0BB5EC 7F086A7C C514014C */ lwc1 $f20, 0x14c($t0) -/* 0BB5F0 7F086A80 46065203 */ div.s $f8, $f10, $f6 -/* 0BB5F4 7F086A84 46082080 */ add.s $f2, $f4, $f8 -/* 0BB5F8 7F086A88 0FC23D76 */ jal bheadGetBreathingValue -/* 0BB5FC 7F086A8C E7A20144 */ swc1 $f2, 0x144($sp) -/* 0BB600 7F086A90 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0BB604 7F086A94 44817000 */ mtc1 $at, $f14 -/* 0BB608 7F086A98 C7A20144 */ lwc1 $f2, 0x144($sp) -/* 0BB60C 7F086A9C 4407A000 */ mfc1 $a3, $f20 -/* 0BB610 7F086AA0 46000306 */ mov.s $f12, $f0 -/* 0BB614 7F086AA4 4602703C */ c.lt.s $f14, $f2 -/* 0BB618 7F086AA8 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0BB61C 7F086AAC 45020004 */ bc1fl .Ljp7F086AC0 -/* 0BB620 7F086AB0 44817000 */ mtc1 $at, $f14 -/* 0BB624 7F086AB4 10000008 */ b .Ljp7F086AD8 -/* 0BB628 7F086AB8 46007086 */ mov.s $f2, $f14 -/* 0BB62C 7F086ABC 44817000 */ mtc1 $at, $f14 -.Ljp7F086AC0: -/* 0BB630 7F086AC0 00000000 */ nop -/* 0BB634 7F086AC4 460E103C */ c.lt.s $f2, $f14 -/* 0BB638 7F086AC8 00000000 */ nop -/* 0BB63C 7F086ACC 45020003 */ bc1fl .Ljp7F086ADC -/* 0BB640 7F086AD0 8E2C0000 */ lw $t4, ($s1) -/* 0BB644 7F086AD4 46007086 */ mov.s $f2, $f14 -.Ljp7F086AD8: -/* 0BB648 7F086AD8 8E2C0000 */ lw $t4, ($s1) -.Ljp7F086ADC: -/* 0BB64C 7F086ADC 24010001 */ li $at, 1 -/* 0BB650 7F086AE0 44061000 */ mfc1 $a2, $f2 -/* 0BB654 7F086AE4 8D8D04E8 */ lw $t5, 0x4e8($t4) -/* 0BB658 7F086AE8 15A10004 */ bne $t5, $at, .Ljp7F086AFC -/* 0BB65C 7F086AEC 3C018005 */ lui $at, %hi(D_80055250) # $at, 0x8005 -/* 0BB660 7F086AF0 C42A5280 */ lwc1 $f10, %lo(D_80055250)($at) -/* 0BB664 7F086AF4 460A0302 */ mul.s $f12, $f0, $f10 -/* 0BB668 7F086AF8 00000000 */ nop -.Ljp7F086AFC: -/* 0BB66C 7F086AFC 0FC17981 */ jal gunSetBondWeaponSway -/* 0BB670 7F086B00 C7AE0398 */ lwc1 $f14, 0x398($sp) -/* 0BB674 7F086B04 8E2E0000 */ lw $t6, ($s1) -/* 0BB678 7F086B08 3C018005 */ lui $at, %hi(D_80055254) # $at, 0x8005 -/* 0BB67C 7F086B0C C4245284 */ lwc1 $f4, %lo(D_80055254)($at) -/* 0BB680 7F086B10 C5C6015C */ lwc1 $f6, 0x15c($t6) -/* 0BB684 7F086B14 46043302 */ mul.s $f12, $f6, $f4 -/* 0BB688 7F086B18 0FC17AC4 */ jal gunSetOffsetRelated -/* 0BB68C 7F086B1C 00000000 */ nop -/* 0BB690 7F086B20 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0BB694 7F086B24 8C636490 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0BB698 7F086B28 3C188003 */ lui $t8, %hi(in_tank_flag) # $t8, 0x8003 -/* 0BB69C 7F086B2C 50600135 */ beql $v1, $zero, .Ljp7F087004 -/* 0BB6A0 7F086B30 8FA40394 */ lw $a0, 0x394($sp) -/* 0BB6A4 7F086B34 8F186488 */ lw $t8, %lo(in_tank_flag)($t8) -/* 0BB6A8 7F086B38 24010001 */ li $at, 1 -/* 0BB6AC 7F086B3C 3C0F8008 */ lui $t7, %hi(g_EnterTankAudioState) # $t7, 0x8008 -/* 0BB6B0 7F086B40 57010130 */ bnel $t8, $at, .Ljp7F087004 -/* 0BB6B4 7F086B44 8FA40394 */ lw $a0, 0x394($sp) -/* 0BB6B8 7F086B48 8DEF99F8 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0BB6BC 7F086B4C 24010002 */ li $at, 2 -/* 0BB6C0 7F086B50 55E1012C */ bnel $t7, $at, .Ljp7F087004 -/* 0BB6C4 7F086B54 8FA40394 */ lw $a0, 0x394($sp) -/* 0BB6C8 7F086B58 8C620004 */ lw $v0, 4($v1) -/* 0BB6CC 7F086B5C 00002025 */ move $a0, $zero -/* 0BB6D0 7F086B60 AFA20138 */ sw $v0, 0x138($sp) -/* 0BB6D4 7F086B64 8C4A0014 */ lw $t2, 0x14($v0) -/* 0BB6D8 7F086B68 00408025 */ move $s0, $v0 -/* 0BB6DC 7F086B6C 8D590008 */ lw $t9, 8($t2) -/* 0BB6E0 7F086B70 8F2B0008 */ lw $t3, 8($t9) -/* 0BB6E4 7F086B74 8D6C0014 */ lw $t4, 0x14($t3) -/* 0BB6E8 7F086B78 8D8D0004 */ lw $t5, 4($t4) -/* 0BB6EC 7F086B7C 0FC177BC */ jal getCurrentPlayerWeaponId -/* 0BB6F0 7F086B80 AFAD0130 */ sw $t5, 0x130($sp) -/* 0BB6F4 7F086B84 38430020 */ xori $v1, $v0, 0x20 -/* 0BB6F8 7F086B88 2C640001 */ sltiu $a0, $v1, 1 -/* 0BB6FC 7F086B8C 50800005 */ beql $a0, $zero, .Ljp7F086BA4 -/* 0BB700 7F086B90 AE0400C4 */ sw $a0, 0xc4($s0) -/* 0BB704 7F086B94 0FC1786A */ jal get_hands_firing_status -/* 0BB708 7F086B98 00002025 */ move $a0, $zero -/* 0BB70C 7F086B9C 0002202B */ sltu $a0, $zero, $v0 -/* 0BB710 7F086BA0 AE0400C4 */ sw $a0, 0xc4($s0) -.Ljp7F086BA4: -/* 0BB714 7F086BA4 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0BB718 7F086BA8 C42864AC */ lwc1 $f8, %lo(g_TankTurretVerticalAngle)($at) -/* 0BB71C 7F086BAC 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0BB720 7F086BB0 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0BB724 7F086BB4 E60800C8 */ swc1 $f8, 0xc8($s0) -/* 0BB728 7F086BB8 C42A64B4 */ lwc1 $f10, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0BB72C 7F086BBC 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BB730 7F086BC0 E60A00CC */ swc1 $f10, 0xcc($s0) -/* 0BB734 7F086BC4 C42664A4 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0BB738 7F086BC8 3C018005 */ lui $at, %hi(D_80055258) # $at, 0x8005 -/* 0BB73C 7F086BCC E60600DC */ swc1 $f6, 0xdc($s0) -/* 0BB740 7F086BD0 C4245288 */ lwc1 $f4, %lo(D_80055258)($at) -/* 0BB744 7F086BD4 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0BB748 7F086BD8 C42864A4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0BB74C 7F086BDC 0FC162C7 */ jal matrix_4x4_set_rotation_around_y -/* 0BB750 7F086BE0 46082301 */ sub.s $f12, $f4, $f8 -/* 0BB754 7F086BE4 8FAE0138 */ lw $t6, 0x138($sp) -/* 0BB758 7F086BE8 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0BB75C 7F086BEC 8DD80014 */ lw $t8, 0x14($t6) -/* 0BB760 7F086BF0 0FC163E7 */ jal matrix_scalar_multiply -/* 0BB764 7F086BF4 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0BB768 7F086BF8 3C018008 */ lui $at, %hi(flt_CODE_bss_800799A8 + 4) # $at, 0x8008 -/* 0BB76C 7F086BFC C42A99E8 */ lwc1 $f10, %lo(flt_CODE_bss_800799A8)($at) -/* 0BB770 7F086C00 C42499EC */ lwc1 $f4, %lo(flt_CODE_bss_800799A8 + 4)($at) -/* 0BB774 7F086C04 3C018008 */ lui $at, %hi(flt_CODE_bss_800799A8 + 8) # $at, 0x8008 -/* 0BB778 7F086C08 46005187 */ neg.s $f6, $f10 -/* 0BB77C 7F086C0C C42A99F0 */ lwc1 $f10, %lo(flt_CODE_bss_800799A8 + 8)($at) -/* 0BB780 7F086C10 E7A600E4 */ swc1 $f6, 0xe4($sp) -/* 0BB784 7F086C14 46002207 */ neg.s $f8, $f4 -/* 0BB788 7F086C18 46005187 */ neg.s $f6, $f10 -/* 0BB78C 7F086C1C E7A800E8 */ swc1 $f8, 0xe8($sp) -/* 0BB790 7F086C20 E7A600EC */ swc1 $f6, 0xec($sp) -/* 0BB794 7F086C24 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0BB798 7F086C28 0FC1623E */ jal matrix_4x4_rotate_vector_in_place -/* 0BB79C 7F086C2C 27A500E4 */ addiu $a1, $sp, 0xe4 -/* 0BB7A0 7F086C30 8E280000 */ lw $t0, ($s1) -/* 0BB7A4 7F086C34 C7A400E4 */ lwc1 $f4, 0xe4($sp) -/* 0BB7A8 7F086C38 C7A600EC */ lwc1 $f6, 0xec($sp) -/* 0BB7AC 7F086C3C C508048C */ lwc1 $f8, 0x48c($t0) -/* 0BB7B0 7F086C40 8FA20138 */ lw $v0, 0x138($sp) -/* 0BB7B4 7F086C44 46082280 */ add.s $f10, $f4, $f8 -/* 0BB7B8 7F086C48 E7AA00E4 */ swc1 $f10, 0xe4($sp) -/* 0BB7BC 7F086C4C C5040494 */ lwc1 $f4, 0x494($t0) -/* 0BB7C0 7F086C50 46043200 */ add.s $f8, $f6, $f4 -/* 0BB7C4 7F086C54 E7A800EC */ swc1 $f8, 0xec($sp) -/* 0BB7C8 7F086C58 8D0F0488 */ lw $t7, 0x488($t0) -/* 0BB7CC 7F086C5C 8C4A0010 */ lw $t2, 0x10($v0) -/* 0BB7D0 7F086C60 AD4F0014 */ sw $t7, 0x14($t2) -/* 0BB7D4 7F086C64 8E280000 */ lw $t0, ($s1) -/* 0BB7D8 7F086C68 C7AA00EC */ lwc1 $f10, 0xec($sp) -/* 0BB7DC 7F086C6C 8C440010 */ lw $a0, 0x10($v0) -/* 0BB7E0 7F086C70 8D05048C */ lw $a1, 0x48c($t0) -/* 0BB7E4 7F086C74 8D060494 */ lw $a2, 0x494($t0) -/* 0BB7E8 7F086C78 8FA700E4 */ lw $a3, 0xe4($sp) -/* 0BB7EC 7F086C7C E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0BB7F0 7F086C80 0FC2C5E5 */ jal walkTilesBetweenPoints_NoCallback -/* 0BB7F4 7F086C84 24840014 */ addiu $a0, $a0, 0x14 -/* 0BB7F8 7F086C88 8FB90138 */ lw $t9, 0x138($sp) -/* 0BB7FC 7F086C8C 8FA500E4 */ lw $a1, 0xe4($sp) -/* 0BB800 7F086C90 8FA600EC */ lw $a2, 0xec($sp) -/* 0BB804 7F086C94 8F2B0010 */ lw $t3, 0x10($t9) -/* 0BB808 7F086C98 0FC2CD48 */ jal stanGetPositionYValue -/* 0BB80C 7F086C9C 8D640014 */ lw $a0, 0x14($t3) -/* 0BB810 7F086CA0 3C038005 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8005 -/* 0BB814 7F086CA4 246383A4 */ addiu $v1, %lo(g_ClockTimer) # addiu $v1, $v1, -0x7c5c -/* 0BB818 7F086CA8 E60000D4 */ swc1 $f0, 0xd4($s0) -/* 0BB81C 7F086CAC 8C6C0000 */ lw $t4, ($v1) -/* 0BB820 7F086CB0 00001025 */ move $v0, $zero -/* 0BB824 7F086CB4 3C018005 */ lui $at, %hi(D_8005525C) # $at, 0x8005 -/* 0BB828 7F086CB8 1980000C */ blez $t4, .Ljp7F086CEC -/* 0BB82C 7F086CBC 00000000 */ nop -/* 0BB830 7F086CC0 C60200D4 */ lwc1 $f2, 0xd4($s0) -/* 0BB834 7F086CC4 C420528C */ lwc1 $f0, %lo(D_8005525C)($at) -/* 0BB838 7F086CC8 C60600D0 */ lwc1 $f6, 0xd0($s0) -.Ljp7F086CCC: -/* 0BB83C 7F086CCC 24420001 */ addiu $v0, $v0, 1 -/* 0BB840 7F086CD0 46003102 */ mul.s $f4, $f6, $f0 -/* 0BB844 7F086CD4 46022200 */ add.s $f8, $f4, $f2 -/* 0BB848 7F086CD8 E60800D0 */ swc1 $f8, 0xd0($s0) -/* 0BB84C 7F086CDC 8C6D0000 */ lw $t5, ($v1) -/* 0BB850 7F086CE0 004D082A */ slt $at, $v0, $t5 -/* 0BB854 7F086CE4 5420FFF9 */ bnezl $at, .Ljp7F086CCC -/* 0BB858 7F086CE8 C60600D0 */ lwc1 $f6, 0xd0($s0) -.Ljp7F086CEC: -/* 0BB85C 7F086CEC 3C018005 */ lui $at, %hi(D_80055260) # $at, 0x8005 -/* 0BB860 7F086CF0 C4265290 */ lwc1 $f6, %lo(D_80055260)($at) -/* 0BB864 7F086CF4 C60A00D0 */ lwc1 $f10, 0xd0($s0) -/* 0BB868 7F086CF8 8FA40130 */ lw $a0, 0x130($sp) -/* 0BB86C 7F086CFC 46065502 */ mul.s $f20, $f10, $f6 -/* 0BB870 7F086D00 0FC0FAD9 */ jal chrpropBBOXGetYmin -/* 0BB874 7F086D04 00000000 */ nop -/* 0BB878 7F086D08 8FA20138 */ lw $v0, 0x138($sp) -/* 0BB87C 7F086D0C 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0BB880 7F086D10 44813000 */ mtc1 $at, $f6 -/* 0BB884 7F086D14 8C4E0014 */ lw $t6, 0x14($v0) -/* 0BB888 7F086D18 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0BB88C 7F086D1C 24450018 */ addiu $a1, $v0, 0x18 -/* 0BB890 7F086D20 C5C40014 */ lwc1 $f4, 0x14($t6) -/* 0BB894 7F086D24 46040202 */ mul.s $f8, $f0, $f4 -/* 0BB898 7F086D28 4608A281 */ sub.s $f10, $f20, $f8 -/* 0BB89C 7F086D2C 46065100 */ add.s $f4, $f10, $f6 -/* 0BB8A0 7F086D30 0FC16150 */ jal matrix_4x4_copy -/* 0BB8A4 7F086D34 E7A400E8 */ swc1 $f4, 0xe8($sp) -/* 0BB8A8 7F086D38 8FA40138 */ lw $a0, 0x138($sp) -/* 0BB8AC 7F086D3C C7A000E4 */ lwc1 $f0, 0xe4($sp) -/* 0BB8B0 7F086D40 8C980010 */ lw $t8, 0x10($a0) -/* 0BB8B4 7F086D44 E7000008 */ swc1 $f0, 8($t8) -/* 0BB8B8 7F086D48 E4800058 */ swc1 $f0, 0x58($a0) -/* 0BB8BC 7F086D4C C7A000E8 */ lwc1 $f0, 0xe8($sp) -/* 0BB8C0 7F086D50 8C8F0010 */ lw $t7, 0x10($a0) -/* 0BB8C4 7F086D54 E5E0000C */ swc1 $f0, 0xc($t7) -/* 0BB8C8 7F086D58 E480005C */ swc1 $f0, 0x5c($a0) -/* 0BB8CC 7F086D5C C7A000EC */ lwc1 $f0, 0xec($sp) -/* 0BB8D0 7F086D60 8C8A0010 */ lw $t2, 0x10($a0) -/* 0BB8D4 7F086D64 E5400010 */ swc1 $f0, 0x10($t2) -/* 0BB8D8 7F086D68 0FC15C68 */ jal setupUpdateObjectRoomPosition -/* 0BB8DC 7F086D6C E4800060 */ swc1 $f0, 0x60($a0) -/* 0BB8E0 7F086D70 0FC101E1 */ jal chrobjCollisionRelated -/* 0BB8E4 7F086D74 8FA40138 */ lw $a0, 0x138($sp) -/* 0BB8E8 7F086D78 8E250000 */ lw $a1, ($s1) -/* 0BB8EC 7F086D7C 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) # $a2, 0x8003 -/* 0BB8F0 7F086D80 8CC664A4 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0BB8F4 7F086D84 27A400B4 */ addiu $a0, $sp, 0xb4 -/* 0BB8F8 7F086D88 0FC1F3AB */ jal bondviewTankCollisionRelated -/* 0BB8FC 7F086D8C 24A5048C */ addiu $a1, $a1, 0x48c -/* 0BB900 7F086D90 8FB90138 */ lw $t9, 0x138($sp) -/* 0BB904 7F086D94 27B00094 */ addiu $s0, $sp, 0x94 -/* 0BB908 7F086D98 02002825 */ move $a1, $s0 -/* 0BB90C 7F086D9C 0FC0F3A3 */ jal chraiGetPropRoomIds -/* 0BB910 7F086DA0 8F240010 */ lw $a0, 0x10($t9) -/* 0BB914 7F086DA4 0FC0F9BF */ jal sub_GAME_7F03E3FC -/* 0BB918 7F086DA8 02002025 */ move $a0, $s0 -/* 0BB91C 7F086DAC 3C0B8007 */ lui $t3, %hi(ptr_list_object_lookup_indices) # $t3, 0x8007 -/* 0BB920 7F086DB0 8D6B9C70 */ lw $t3, %lo(ptr_list_object_lookup_indices)($t3) -/* 0BB924 7F086DB4 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 0BB928 7F086DB8 AFAB008C */ sw $t3, 0x8c($sp) -/* 0BB92C 7F086DBC 85620000 */ lh $v0, ($t3) -/* 0BB930 7F086DC0 04420090 */ bltzl $v0, .Ljp7F087004 -/* 0BB934 7F086DC4 8FA40394 */ lw $a0, 0x394($sp) -/* 0BB938 7F086DC8 4481A000 */ mtc1 $at, $f20 -/* 0BB93C 7F086DCC 00000000 */ nop -/* 0BB940 7F086DD0 8FAE0138 */ lw $t6, 0x138($sp) -.Ljp7F086DD4: -/* 0BB944 7F086DD4 00026080 */ sll $t4, $v0, 2 -/* 0BB948 7F086DD8 01826023 */ subu $t4, $t4, $v0 -/* 0BB94C 7F086DDC 000C6080 */ sll $t4, $t4, 2 -/* 0BB950 7F086DE0 8DD80010 */ lw $t8, 0x10($t6) -/* 0BB954 7F086DE4 01826021 */ addu $t4, $t4, $v0 -/* 0BB958 7F086DE8 3C0D8007 */ lui $t5, %hi(pos_data_entry) # $t5, 0x8007 -/* 0BB95C 7F086DEC 25AD9C78 */ addiu $t5, %lo(pos_data_entry) # addiu $t5, $t5, -0x6388 -/* 0BB960 7F086DF0 000C6080 */ sll $t4, $t4, 2 -/* 0BB964 7F086DF4 018D8021 */ addu $s0, $t4, $t5 -/* 0BB968 7F086DF8 5218007C */ beql $s0, $t8, .Ljp7F086FEC -/* 0BB96C 7F086DFC 8FAC008C */ lw $t4, 0x8c($sp) -/* 0BB970 7F086E00 92020000 */ lbu $v0, ($s0) -/* 0BB974 7F086E04 24010003 */ li $at, 3 -/* 0BB978 7F086E08 240F0001 */ li $t7, 1 -/* 0BB97C 7F086E0C 1441005A */ bne $v0, $at, .Ljp7F086F78 -/* 0BB980 7F086E10 02002025 */ move $a0, $s0 -/* 0BB984 7F086E14 AFAF007C */ sw $t7, 0x7c($sp) -/* 0BB988 7F086E18 8E030004 */ lw $v1, 4($s0) -/* 0BB98C 7F086E1C 27A50080 */ addiu $a1, $sp, 0x80 -/* 0BB990 7F086E20 27A60088 */ addiu $a2, $sp, 0x88 -/* 0BB994 7F086E24 27A70084 */ addiu $a3, $sp, 0x84 -/* 0BB998 7F086E28 0FC0F4A2 */ jal chrpropGetCollisionBounds -/* 0BB99C 7F086E2C AFA3006C */ sw $v1, 0x6c($sp) -/* 0BB9A0 7F086E30 26040008 */ addiu $a0, $s0, 8 -/* 0BB9A4 7F086E34 AFA40050 */ sw $a0, 0x50($sp) -/* 0BB9A8 7F086E38 27A500B4 */ addiu $a1, $sp, 0xb4 -/* 0BB9AC 7F086E3C 0FC0F3F6 */ jal chrpropTestPointInPolygon -/* 0BB9B0 7F086E40 24060004 */ li $a2, 4 -/* 0BB9B4 7F086E44 10400031 */ beqz $v0, .Ljp7F086F0C -/* 0BB9B8 7F086E48 8FA3006C */ lw $v1, 0x6c($sp) -/* 0BB9BC 7F086E4C AFA0007C */ sw $zero, 0x7c($sp) -/* 0BB9C0 7F086E50 806A0007 */ lb $t2, 7($v1) -/* 0BB9C4 7F086E54 24010004 */ li $at, 4 -/* 0BB9C8 7F086E58 5541002D */ bnel $t2, $at, .Ljp7F086F10 -/* 0BB9CC 7F086E5C 8FAF007C */ lw $t7, 0x7c($sp) -/* 0BB9D0 7F086E60 8C790014 */ lw $t9, 0x14($v1) -/* 0BB9D4 7F086E64 001959C0 */ sll $t3, $t9, 7 -/* 0BB9D8 7F086E68 05620029 */ bltzl $t3, .Ljp7F086F10 -/* 0BB9DC 7F086E6C 8FAF007C */ lw $t7, 0x7c($sp) -/* 0BB9E0 7F086E70 0FC3021B */ jal lvlGetControlsLockedFlag -/* 0BB9E4 7F086E74 AFA3006C */ sw $v1, 0x6c($sp) -/* 0BB9E8 7F086E78 14400024 */ bnez $v0, .Ljp7F086F0C -/* 0BB9EC 7F086E7C 8FA3006C */ lw $v1, 0x6c($sp) -/* 0BB9F0 7F086E80 8C6C0014 */ lw $t4, 0x14($v1) -/* 0BB9F4 7F086E84 3C010100 */ lui $at, 0x100 -/* 0BB9F8 7F086E88 3C028005 */ lui $v0, %hi(D_80048380) # $v0, 0x8005 -/* 0BB9FC 7F086E8C 01816825 */ or $t5, $t4, $at -/* 0BBA00 7F086E90 AC6D0014 */ sw $t5, 0x14($v1) -/* 0BBA04 7F086E94 8C4283B0 */ lw $v0, %lo(D_80048380)($v0) -/* 0BBA08 7F086E98 24010003 */ li $at, 3 -/* 0BBA0C 7F086E9C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0BBA10 7F086EA0 0041001A */ div $zero, $v0, $at -/* 0BBA14 7F086EA4 00001010 */ mfhi $v0 -/* 0BBA18 7F086EA8 28410002 */ slti $at, $v0, 2 -/* 0BBA1C 7F086EAC 1020000E */ beqz $at, .Ljp7F086EE8 -/* 0BBA20 7F086EB0 240500B7 */ li $a1, 183 -/* 0BBA24 7F086EB4 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BBA28 7F086EB8 0C002386 */ jal sndPlaySfx -/* 0BBA2C 7F086EBC 00003025 */ move $a2, $zero -/* 0BBA30 7F086EC0 00402025 */ move $a0, $v0 -/* 0BBA34 7F086EC4 0FC14FC3 */ jal sub_GAME_7F053A10 -/* 0BBA38 7F086EC8 8FA50050 */ lw $a1, 0x50($sp) -/* 0BBA3C 7F086ECC 3C028005 */ lui $v0, %hi(D_80048380) # $v0, 0x8005 -/* 0BBA40 7F086ED0 8C4283B0 */ lw $v0, %lo(D_80048380)($v0) -/* 0BBA44 7F086ED4 24010003 */ li $at, 3 -/* 0BBA48 7F086ED8 0041001A */ div $zero, $v0, $at -/* 0BBA4C 7F086EDC 00001010 */ mfhi $v0 -/* 0BBA50 7F086EE0 00000000 */ nop -/* 0BBA54 7F086EE4 00000000 */ nop -.Ljp7F086EE8: -/* 0BBA58 7F086EE8 18400008 */ blez $v0, .Ljp7F086F0C -/* 0BBA5C 7F086EEC 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 0BBA60 7F086EF0 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0BBA64 7F086EF4 240500D5 */ li $a1, 213 -/* 0BBA68 7F086EF8 0C002386 */ jal sndPlaySfx -/* 0BBA6C 7F086EFC 00003025 */ move $a2, $zero -/* 0BBA70 7F086F00 00402025 */ move $a0, $v0 -/* 0BBA74 7F086F04 0FC14FC3 */ jal sub_GAME_7F053A10 -/* 0BBA78 7F086F08 8FA50050 */ lw $a1, 0x50($sp) -.Ljp7F086F0C: -/* 0BBA7C 7F086F0C 8FAF007C */ lw $t7, 0x7c($sp) -.Ljp7F086F10: -/* 0BBA80 7F086F10 8FA40050 */ lw $a0, 0x50($sp) -/* 0BBA84 7F086F14 8FA50080 */ lw $a1, 0x80($sp) -/* 0BBA88 7F086F18 11E00006 */ beqz $t7, .Ljp7F086F34 -/* 0BBA8C 7F086F1C 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0BBA90 7F086F20 0FC112BB */ jal chrobjTestPointPolygonCollision -/* 0BBA94 7F086F24 24070004 */ li $a3, 4 -/* 0BBA98 7F086F28 50400003 */ beql $v0, $zero, .Ljp7F086F38 -/* 0BBA9C 7F086F2C 8FAA007C */ lw $t2, 0x7c($sp) -/* 0BBAA0 7F086F30 AFA0007C */ sw $zero, 0x7c($sp) -.Ljp7F086F34: -/* 0BBAA4 7F086F34 8FAA007C */ lw $t2, 0x7c($sp) -.Ljp7F086F38: -/* 0BBAA8 7F086F38 8FB90138 */ lw $t9, 0x138($sp) -/* 0BBAAC 7F086F3C 5540002B */ bnezl $t2, .Ljp7F086FEC -/* 0BBAB0 7F086F40 8FAC008C */ lw $t4, 0x8c($sp) -/* 0BBAB4 7F086F44 C7280058 */ lwc1 $f8, 0x58($t9) -/* 0BBAB8 7F086F48 4406A000 */ mfc1 $a2, $f20 -/* 0BBABC 7F086F4C 27A50070 */ addiu $a1, $sp, 0x70 -/* 0BBAC0 7F086F50 E7A80070 */ swc1 $f8, 0x70($sp) -/* 0BBAC4 7F086F54 C60A000C */ lwc1 $f10, 0xc($s0) -/* 0BBAC8 7F086F58 24070001 */ li $a3, 1 -/* 0BBACC 7F086F5C E7AA0074 */ swc1 $f10, 0x74($sp) -/* 0BBAD0 7F086F60 C7260060 */ lwc1 $f6, 0x60($t9) -/* 0BBAD4 7F086F64 E7A60078 */ swc1 $f6, 0x78($sp) -/* 0BBAD8 7F086F68 0FC09EC3 */ jal chrlvExplosionDamage -/* 0BBADC 7F086F6C 8E040004 */ lw $a0, 4($s0) -/* 0BBAE0 7F086F70 1000001E */ b .Ljp7F086FEC -/* 0BBAE4 7F086F74 8FAC008C */ lw $t4, 0x8c($sp) -.Ljp7F086F78: -/* 0BBAE8 7F086F78 24010001 */ li $at, 1 -/* 0BBAEC 7F086F7C 1441001A */ bne $v0, $at, .Ljp7F086FE8 -/* 0BBAF0 7F086F80 02002025 */ move $a0, $s0 -/* 0BBAF4 7F086F84 27A50064 */ addiu $a1, $sp, 0x64 -/* 0BBAF8 7F086F88 0FC0F3EC */ jal chraiGetCollisionBoundsWithoutY -/* 0BBAFC 7F086F8C 27A60060 */ addiu $a2, $sp, 0x60 -/* 0BBB00 7F086F90 8FA50060 */ lw $a1, 0x60($sp) -/* 0BBB04 7F086F94 8FA40064 */ lw $a0, 0x64($sp) -/* 0BBB08 7F086F98 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0BBB0C 7F086F9C 58A00013 */ blezl $a1, .Ljp7F086FEC -/* 0BBB10 7F086FA0 8FAC008C */ lw $t4, 0x8c($sp) -/* 0BBB14 7F086FA4 0FC11268 */ jal sub_GAME_7F0446B8 -/* 0BBB18 7F086FA8 24070004 */ li $a3, 4 -/* 0BBB1C 7F086FAC 5040000F */ beql $v0, $zero, .Ljp7F086FEC -/* 0BBB20 7F086FB0 8FAC008C */ lw $t4, 0x8c($sp) -/* 0BBB24 7F086FB4 0FC26F3C */ jal get_cur_playernum -/* 0BBB28 7F086FB8 00000000 */ nop -/* 0BBB2C 7F086FBC 8E060004 */ lw $a2, 4($s0) -/* 0BBB30 7F086FC0 3C05461C */ lui $a1, (0x461C4000 >> 16) # lui $a1, 0x461c -/* 0BBB34 7F086FC4 34A54000 */ ori $a1, (0x461C4000 & 0xFFFF) # ori $a1, $a1, 0x4000 -/* 0BBB38 7F086FC8 AFA20010 */ sw $v0, 0x10($sp) -/* 0BBB3C 7F086FCC 02002025 */ move $a0, $s0 -/* 0BBB40 7F086FD0 24070020 */ li $a3, 32 -/* 0BBB44 7F086FD4 0FC138C0 */ jal sub_GAME_7F04DEFC -/* 0BBB48 7F086FD8 24C60058 */ addiu $a2, $a2, 0x58 -/* 0BBB4C 7F086FDC 240B005A */ li $t3, 90 -/* 0BBB50 7F086FE0 3C018003 */ lui $at, %hi(D_80036490) # $at, 0x8003 -/* 0BBB54 7F086FE4 AC2B64D0 */ sw $t3, %lo(D_80036490)($at) -.Ljp7F086FE8: -/* 0BBB58 7F086FE8 8FAC008C */ lw $t4, 0x8c($sp) -.Ljp7F086FEC: -/* 0BBB5C 7F086FEC 258D0002 */ addiu $t5, $t4, 2 -/* 0BBB60 7F086FF0 AFAD008C */ sw $t5, 0x8c($sp) -/* 0BBB64 7F086FF4 85A20000 */ lh $v0, ($t5) -/* 0BBB68 7F086FF8 0443FF76 */ bgezl $v0, .Ljp7F086DD4 -/* 0BBB6C 7F086FFC 8FAE0138 */ lw $t6, 0x138($sp) -/* 0BBB70 7F087000 8FA40394 */ lw $a0, 0x394($sp) -.Ljp7F087004: -/* 0BBB74 7F087004 0FC20502 */ jal bondviewUpdatePlayerClipping -/* 0BBB78 7F087008 8FA50390 */ lw $a1, 0x390($sp) -/* 0BBB7C 7F08700C 0FC206A2 */ jal bondviewUpdatePlayerCollisionPositionFields -/* 0BBB80 7F087010 00000000 */ nop -/* 0BBB84 7F087014 0FC22A35 */ jal bondviewUpdatePlayerCollisionBounds -/* 0BBB88 7F087018 00000000 */ nop -/* 0BBB8C 7F08701C 0FC24697 */ jal get_debug_man_pos_flag -/* 0BBB90 7F087020 00000000 */ nop -/* 0BBB94 7F087024 50400008 */ beql $v0, $zero, .Ljp7F087048 -/* 0BBB98 7F087028 8FBF002C */ lw $ra, 0x2c($sp) -/* 0BBB9C 7F08702C 8E280000 */ lw $t0, ($s1) -/* 0BBBA0 7F087030 27A7005C */ addiu $a3, $sp, 0x5c -/* 0BBBA4 7F087034 8D040488 */ lw $a0, 0x488($t0) -/* 0BBBA8 7F087038 8D05048C */ lw $a1, 0x48c($t0) -/* 0BBBAC 7F08703C 0FC2CDF7 */ jal copy_tile_RGB_as_24bit -/* 0BBBB0 7F087040 8D060494 */ lw $a2, 0x494($t0) -/* 0BBBB4 7F087044 8FBF002C */ lw $ra, 0x2c($sp) -.Ljp7F087048: -/* 0BBBB8 7F087048 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0BBBBC 7F08704C 8FB00024 */ lw $s0, 0x24($sp) -/* 0BBBC0 7F087050 8FB10028 */ lw $s1, 0x28($sp) -/* 0BBBC4 7F087054 03E00008 */ jr $ra -/* 0BBBC8 7F087058 27BD03B8 */ addiu $sp, $sp, 0x3b8 - -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_8005516C -.word 0x3d888889 /*0.06666667*/ -glabel D_80055170 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055174 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055178 -.word 0x3f8147ae /*1.01*/ -glabel D_8005517C -.word 0x3f8147ae /*1.01*/ -glabel D_80055180 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055184 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055188 -.word 0x40490fdb /*3.1415927*/ -glabel D_8005518C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055190 -.word 0xc0490fdb /*-3.1415927*/ -glabel D_80055194 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055198 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_8005519C -.word 0x3dc2f838 -glabel D_800551A0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551A4 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551A8 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551AC -.word 0x3dc2f838 -glabel D_800551B0 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551B4 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551B8 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551BC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551C0 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551C4 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551C8 -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551CC -.word 0x3f67a0f9 /* 0.904799997807 */ -glabel D_800551D0 -.word 0x3dc2f838 -glabel D_800551D4 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_800551D8 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8004ADAC -.word 0x3f19999a /*0.6*/ -glabel D_800551DC -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E4 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800551E8 -.word 0x3e99999a /*0.30000001*/ -glabel D_800551EC -.word 0x3e19999a /*0.15000001*/ -glabel D_800551F0 -.word 0x469c4000 /*20000.0*/ -glabel D_800551F4 -.word 0x3f666666 /*0.89999998*/ -glabel D_800551F8 -.word 0x46477c00 /*12767.0*/ -glabel D_800551FC -.word 0x469c4000 /*20000.0*/ -glabel D_80055200 -.word 0x3f666666 /*0.89999998*/ -glabel D_80055204 -.word 0x45f2b800 /*7767.0*/ -glabel D_80055208 -.word 0x3f666666 /*0.89999998*/ -glabel D_8005520C -.word 0x46c35000 /*25000.0;*/ -glabel D_80055210 -.word 0x3e32b8c3 /*0.17453294*/ -glabel D_80055214 -.word 0x3edf66f3 /*0.43633232*/ -glabel D_80055218 -.word 0xbdb2b8c3 /*-0.087266468*/ -glabel D_8005521C -.word 0x3f6dab9f -glabel D_80055220 -.word 0x3d92a308 -glabel D_80055224 -.word 0x4528c000 /*2700.0*/ -glabel D_80055228 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005522C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80055230 -.word 0x3f19999a /*0.60000002*/ -glabel D_80055234 -.word 0x3f4ccccd /*0.80000001*/ -glabel D_80055238 -.word 0x3dcccccd /*0.1*/ -glabel D_8005523C -.word 0x4528c000 /*2700.0*/ -glabel D_80055240 -.word 0x3f947ae1 /*1.16*/ -glabel D_80055244 -.word 0x3f8147ae /*1.01*/ -glabel D_80055248 -.word 0x3f7d7721 /*0.99009901*/ -glabel D_8005524C -.word 0x3f333333 /*0.69999999*/ -glabel D_80055250 -.word 0x3f99999a /*1.2*/ -glabel D_80055254 -.word 0x3c8efa35 /*0.017453292*/ -glabel D_80055258 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005525C -.word 0x3f4cb296 -glabel D_80055260 -.word 0x3e4d35a8 -.text -glabel MoveBond -/* 0B717C 7F08478C 27BDFC48 */ addiu $sp, $sp, -0x3b8 -/* 0B7180 7F084790 3C0A8003 */ lui $t2, %hi(D_800367F4) # $t2, 0x8003 -/* 0B7184 7F084794 AFBF002C */ sw $ra, 0x2c($sp) -/* 0B7188 7F084798 AFB10028 */ sw $s1, 0x28($sp) -/* 0B718C 7F08479C AFB00024 */ sw $s0, 0x24($sp) -/* 0B7190 7F0847A0 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0B7194 7F0847A4 AFA403B8 */ sw $a0, 0x3b8($sp) -/* 0B7198 7F0847A8 AFA503BC */ sw $a1, 0x3bc($sp) -/* 0B719C 7F0847AC AFA603C0 */ sw $a2, 0x3c0($sp) -/* 0B71A0 7F0847B0 AFA703C4 */ sw $a3, 0x3c4($sp) -/* 0B71A4 7F0847B4 254A1D44 */ addiu $t2, %lo(D_800367F4) # addiu $t2, $t2, 0x1d44 -/* 0B71A8 7F0847B8 8D410000 */ lw $at, ($t2) -/* 0B71AC 7F0847BC 27AE03AC */ addiu $t6, $sp, 0x3ac -/* 0B71B0 7F0847C0 8D4B0004 */ lw $t3, 4($t2) -/* 0B71B4 7F0847C4 ADC10000 */ sw $at, ($t6) -/* 0B71B8 7F0847C8 8D410008 */ lw $at, 8($t2) -/* 0B71BC 7F0847CC 3C038003 */ lui $v1, %hi(g_bondviewForceDisarm) # $v1, 0x8003 -/* 0B71C0 7F0847D0 24631974 */ addiu $v1, %lo(g_bondviewForceDisarm) # addiu $v1, $v1, 0x1974 -/* 0B71C4 7F0847D4 ADCB0004 */ sw $t3, 4($t6) -/* 0B71C8 7F0847D8 ADC10008 */ sw $at, 8($t6) -/* 0B71CC 7F0847DC 4480A000 */ mtc1 $zero, $f20 -/* 0B71D0 7F0847E0 8C620000 */ lw $v0, ($v1) -/* 0B71D4 7F0847E4 00048600 */ sll $s0, $a0, 0x18 -/* 0B71D8 7F0847E8 00106E03 */ sra $t5, $s0, 0x18 -/* 0B71DC 7F0847EC 01A08025 */ move $s0, $t5 -/* 0B71E0 7F0847F0 AFA00394 */ sw $zero, 0x394($sp) -/* 0B71E4 7F0847F4 E7B40398 */ swc1 $f20, 0x398($sp) -/* 0B71E8 7F0847F8 18400016 */ blez $v0, .L7F084854 -/* 0B71EC 7F0847FC E7B40390 */ swc1 $f20, 0x390($sp) -/* 0B71F0 7F084800 24580001 */ addiu $t8, $v0, 1 -/* 0B71F4 7F084804 2B010004 */ slti $at, $t8, 4 -/* 0B71F8 7F084808 14200012 */ bnez $at, .L7F084854 -/* 0B71FC 7F08480C AC780000 */ sw $t8, ($v1) -/* 0B7200 7F084810 3C118007 */ lui $s1, %hi(g_CurrentPlayer) # $s1, 0x8007 -/* 0B7204 7F084814 26318BC0 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x7440 -/* 0B7208 7F084818 8E2D0000 */ lw $t5, ($s1) -/* 0B720C 7F08481C AC600000 */ sw $zero, ($v1) -/* 0B7210 7F084820 24040001 */ li $a0, 1 -/* 0B7214 7F084824 ADA02A4C */ sw $zero, 0x2a4c($t5) -/* 0B7218 7F084828 8E2F0000 */ lw $t7, ($s1) -/* 0B721C 7F08482C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B7220 7F084830 ADE02A48 */ sw $zero, 0x2a48($t7) -/* 0B7224 7F084834 24040001 */ li $a0, 1 -/* 0B7228 7F084838 0FC17803 */ jal currentPlayerUnEquipWeaponWrapper -/* 0B722C 7F08483C 00402825 */ move $a1, $v0 -/* 0B7230 7F084840 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B7234 7F084844 00002025 */ move $a0, $zero -/* 0B7238 7F084848 00002025 */ move $a0, $zero -/* 0B723C 7F08484C 0FC17803 */ jal currentPlayerUnEquipWeaponWrapper -/* 0B7240 7F084850 00402825 */ move $a1, $v0 -.L7F084854: -/* 0B7244 7F084854 3C118007 */ lui $s1, %hi(g_CurrentPlayer) # $s1, 0x8007 -/* 0B7248 7F084858 26318BC0 */ addiu $s1, %lo(g_CurrentPlayer) # addiu $s1, $s1, -0x7440 -/* 0B724C 7F08485C 0FC1E6B4 */ jal currentPlayerSetField00 -/* 0B7250 7F084860 00002025 */ move $a0, $zero -/* 0B7254 7F084864 0FC2101B */ jal sub_GAME_7F083FC8 -/* 0B7258 7F084868 00000000 */ nop -/* 0B725C 7F08486C 0FC21129 */ jal sub_GAME_7F084360 -/* 0B7260 7F084870 00000000 */ nop -/* 0B7264 7F084874 00102600 */ sll $a0, $s0, 0x18 -/* 0B7268 7F084878 0004CE03 */ sra $t9, $a0, 0x18 -/* 0B726C 7F08487C 03202025 */ move $a0, $t9 -/* 0B7270 7F084880 83A503BF */ lb $a1, 0x3bf($sp) -/* 0B7274 7F084884 97A603C2 */ lhu $a2, 0x3c2($sp) -/* 0B7278 7F084888 0FC20686 */ jal controller_gameplay_interaction -/* 0B727C 7F08488C 97A703C6 */ lhu $a3, 0x3c6($sp) -/* 0B7280 7F084890 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B7284 7F084894 00000000 */ nop -/* 0B7288 7F084898 50400004 */ beql $v0, $zero, .L7F0848AC -/* 0B728C 7F08489C 8E2E0000 */ lw $t6, ($s1) -/* 0B7290 7F0848A0 0FC1FAE4 */ jal sub_GAME_7F07EAF0 -/* 0B7294 7F0848A4 00000000 */ nop -/* 0B7298 7F0848A8 8E2E0000 */ lw $t6, ($s1) -.L7F0848AC: -/* 0B729C 7F0848AC 8DCA01C8 */ lw $t2, 0x1c8($t6) -/* 0B72A0 7F0848B0 11400003 */ beqz $t2, .L7F0848C0 -/* 0B72A4 7F0848B4 00000000 */ nop -/* 0B72A8 7F0848B8 0FC1FB3D */ jal sub_GAME_7F07EC54 -/* 0B72AC 7F0848BC 00000000 */ nop -.L7F0848C0: -/* 0B72B0 7F0848C0 3C0B8003 */ lui $t3, %hi(in_tank_flag) # $t3, 0x8003 -/* 0B72B4 7F0848C4 8D6B1998 */ lw $t3, %lo(in_tank_flag)($t3) -/* 0B72B8 7F0848C8 1560006E */ bnez $t3, .L7F084A84 -/* 0B72BC 7F0848CC 00000000 */ nop -/* 0B72C0 7F0848D0 0FC1E69C */ jal currentPlayerGetCrouchPos -/* 0B72C4 7F0848D4 00000000 */ nop -/* 0B72C8 7F0848D8 5440000D */ bnezl $v0, .L7F084910 -/* 0B72CC 7F0848DC 8E280000 */ lw $t0, ($s1) -/* 0B72D0 7F0848E0 8E280000 */ lw $t0, ($s1) -/* 0B72D4 7F0848E4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B72D8 7F0848E8 44814000 */ mtc1 $at, $f8 -/* 0B72DC 7F0848EC C50A0174 */ lwc1 $f10, 0x174($t0) -/* 0B72E0 7F0848F0 46085182 */ mul.s $f6, $f10, $f8 -/* 0B72E4 7F0848F4 44815000 */ mtc1 $at, $f10 -/* 0B72E8 7F0848F8 E5060174 */ swc1 $f6, 0x174($t0) -/* 0B72EC 7F0848FC 8E280000 */ lw $t0, ($s1) -/* 0B72F0 7F084900 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0B72F4 7F084904 460A2202 */ mul.s $f8, $f4, $f10 -/* 0B72F8 7F084908 E508016C */ swc1 $f8, 0x16c($t0) -/* 0B72FC 7F08490C 8E280000 */ lw $t0, ($s1) -.L7F084910: -/* 0B7300 7F084910 C5120180 */ lwc1 $f18, 0x180($t0) -/* 0B7304 7F084914 4612A032 */ c.eq.s $f20, $f18 -/* 0B7308 7F084918 00000000 */ nop -/* 0B730C 7F08491C 45020007 */ bc1fl .L7F08493C -/* 0B7310 7F084920 C5000188 */ lwc1 $f0, 0x188($t0) -/* 0B7314 7F084924 C5060188 */ lwc1 $f6, 0x188($t0) -/* 0B7318 7F084928 4606A032 */ c.eq.s $f20, $f6 -/* 0B731C 7F08492C 00000000 */ nop -/* 0B7320 7F084930 45010054 */ bc1t .L7F084A84 -/* 0B7324 7F084934 00000000 */ nop -/* 0B7328 7F084938 C5000188 */ lwc1 $f0, 0x188($t0) -.L7F08493C: -/* 0B732C 7F08493C C5020150 */ lwc1 $f2, 0x150($t0) -/* 0B7330 7F084940 C5100154 */ lwc1 $f16, 0x154($t0) -/* 0B7334 7F084944 46009387 */ neg.s $f14, $f18 -/* 0B7338 7F084948 46020102 */ mul.s $f4, $f0, $f2 -/* 0B733C 7F08494C 00000000 */ nop -/* 0B7340 7F084950 46107282 */ mul.s $f10, $f14, $f16 -/* 0B7344 7F084954 460A2200 */ add.s $f8, $f4, $f10 -/* 0B7348 7F084958 46027182 */ mul.s $f6, $f14, $f2 -/* 0B734C 7F08495C 00000000 */ nop -/* 0B7350 7F084960 46100102 */ mul.s $f4, $f0, $f16 -/* 0B7354 7F084964 E7A8038C */ swc1 $f8, 0x38c($sp) -/* 0B7358 7F084968 46000202 */ mul.s $f8, $f0, $f0 -/* 0B735C 7F08496C 46043281 */ sub.s $f10, $f6, $f4 -/* 0B7360 7F084970 46129182 */ mul.s $f6, $f18, $f18 -/* 0B7364 7F084974 E7AA0388 */ swc1 $f10, 0x388($sp) -/* 0B7368 7F084978 0C007614 */ jal sqrtf -/* 0B736C 7F08497C 46064300 */ add.s $f12, $f8, $f6 -/* 0B7370 7F084980 8E280000 */ lw $t0, ($s1) -/* 0B7374 7F084984 C7AA038C */ lwc1 $f10, 0x38c($sp) -/* 0B7378 7F084988 3C018005 */ lui $at, %hi(D_8005516C) # $at, 0x8005 -/* 0B737C 7F08498C C5040174 */ lwc1 $f4, 0x174($t0) -/* 0B7380 7F084990 3C098004 */ lui $t1, %hi(g_GlobalTimerDelta) # $t1, 0x8004 -/* 0B7384 7F084994 25291004 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, 0x1004 -/* 0B7388 7F084998 460A2200 */ add.s $f8, $f4, $f10 -/* 0B738C 7F08499C 00001825 */ move $v1, $zero -/* 0B7390 7F0849A0 2404000C */ li $a0, 12 -/* 0B7394 7F0849A4 E5080174 */ swc1 $f8, 0x174($t0) -/* 0B7398 7F0849A8 8E280000 */ lw $t0, ($s1) -/* 0B739C 7F0849AC C7A40388 */ lwc1 $f4, 0x388($sp) -/* 0B73A0 7F0849B0 C506016C */ lwc1 $f6, 0x16c($t0) -/* 0B73A4 7F0849B4 46043280 */ add.s $f10, $f6, $f4 -/* 0B73A8 7F0849B8 E50A016C */ swc1 $f10, 0x16c($t0) -/* 0B73AC 7F0849BC C42CAD3C */ lwc1 $f12, %lo(D_8005516C)($at) -/* 0B73B0 7F0849C0 8E380000 */ lw $t8, ($s1) -.L7F0849C4: -/* 0B73B4 7F0849C4 03031021 */ addu $v0, $t8, $v1 -/* 0B73B8 7F0849C8 C4420180 */ lwc1 $f2, 0x180($v0) -/* 0B73BC 7F0849CC 4602A032 */ c.eq.s $f20, $f2 -/* 0B73C0 7F0849D0 00000000 */ nop -/* 0B73C4 7F0849D4 45030029 */ bc1tl .L7F084A7C -/* 0B73C8 7F0849D8 24630004 */ addiu $v1, $v1, 4 -/* 0B73CC 7F0849DC 4602A03C */ c.lt.s $f20, $f2 -/* 0B73D0 7F0849E0 00000000 */ nop -/* 0B73D4 7F0849E4 45020012 */ bc1fl .L7F084A30 -/* 0B73D8 7F0849E8 4614103C */ c.lt.s $f2, $f20 -/* 0B73DC 7F0849EC C5280000 */ lwc1 $f8, ($t1) -/* 0B73E0 7F0849F0 46086182 */ mul.s $f6, $f12, $f8 -/* 0B73E4 7F0849F4 00000000 */ nop -/* 0B73E8 7F0849F8 46023102 */ mul.s $f4, $f6, $f2 -/* 0B73EC 7F0849FC 46002283 */ div.s $f10, $f4, $f0 -/* 0B73F0 7F084A00 460A1201 */ sub.s $f8, $f2, $f10 -/* 0B73F4 7F084A04 E4480180 */ swc1 $f8, 0x180($v0) -/* 0B73F8 7F084A08 8E2C0000 */ lw $t4, ($s1) -/* 0B73FC 7F084A0C 01831021 */ addu $v0, $t4, $v1 -/* 0B7400 7F084A10 C4460180 */ lwc1 $f6, 0x180($v0) -/* 0B7404 7F084A14 4614303C */ c.lt.s $f6, $f20 -/* 0B7408 7F084A18 00000000 */ nop -/* 0B740C 7F084A1C 45000016 */ bc1f .L7F084A78 -/* 0B7410 7F084A20 00000000 */ nop -/* 0B7414 7F084A24 10000014 */ b .L7F084A78 -/* 0B7418 7F084A28 E4540180 */ swc1 $f20, 0x180($v0) -/* 0B741C 7F084A2C 4614103C */ c.lt.s $f2, $f20 -.L7F084A30: -/* 0B7420 7F084A30 00000000 */ nop -/* 0B7424 7F084A34 45020011 */ bc1fl .L7F084A7C -/* 0B7428 7F084A38 24630004 */ addiu $v1, $v1, 4 -/* 0B742C 7F084A3C C5240000 */ lwc1 $f4, ($t1) -/* 0B7430 7F084A40 46046282 */ mul.s $f10, $f12, $f4 -/* 0B7434 7F084A44 00000000 */ nop -/* 0B7438 7F084A48 46025202 */ mul.s $f8, $f10, $f2 -/* 0B743C 7F084A4C 46004183 */ div.s $f6, $f8, $f0 -/* 0B7440 7F084A50 46061101 */ sub.s $f4, $f2, $f6 -/* 0B7444 7F084A54 E4440180 */ swc1 $f4, 0x180($v0) -/* 0B7448 7F084A58 8E2D0000 */ lw $t5, ($s1) -/* 0B744C 7F084A5C 01A31021 */ addu $v0, $t5, $v1 -/* 0B7450 7F084A60 C44A0180 */ lwc1 $f10, 0x180($v0) -/* 0B7454 7F084A64 460AA03C */ c.lt.s $f20, $f10 -/* 0B7458 7F084A68 00000000 */ nop -/* 0B745C 7F084A6C 45000002 */ bc1f .L7F084A78 -/* 0B7460 7F084A70 00000000 */ nop -/* 0B7464 7F084A74 E4540180 */ swc1 $f20, 0x180($v0) -.L7F084A78: -/* 0B7468 7F084A78 24630004 */ addiu $v1, $v1, 4 -.L7F084A7C: -/* 0B746C 7F084A7C 5464FFD1 */ bnel $v1, $a0, .L7F0849C4 -/* 0B7470 7F084A80 8E380000 */ lw $t8, ($s1) -.L7F084A84: -/* 0B7474 7F084A84 3C0F8003 */ lui $t7, %hi(in_tank_flag) # $t7, 0x8003 -/* 0B7478 7F084A88 8DEF1998 */ lw $t7, %lo(in_tank_flag)($t7) -/* 0B747C 7F084A8C 3C098004 */ lui $t1, %hi(g_GlobalTimerDelta) # $t1, 0x8004 -/* 0B7480 7F084A90 24010001 */ li $at, 1 -/* 0B7484 7F084A94 25291004 */ addiu $t1, %lo(g_GlobalTimerDelta) # addiu $t1, $t1, 0x1004 -/* 0B7488 7F084A98 15E10211 */ bne $t7, $at, .L7F0852E0 -/* 0B748C 7F084A9C 8E280000 */ lw $t0, ($s1) -/* 0B7490 7F084AA0 C508014C */ lwc1 $f8, 0x14c($t0) -/* 0B7494 7F084AA4 C5260000 */ lwc1 $f6, ($t1) -/* 0B7498 7F084AA8 3C018005 */ lui $at, %hi(D_80055170) # $at, 0x8005 -/* 0B749C 7F084AAC C42CAD40 */ lwc1 $f12, %lo(D_80055170)($at) -/* 0B74A0 7F084AB0 46064102 */ mul.s $f4, $f8, $f6 -/* 0B74A4 7F084AB4 3C018005 */ lui $at, %hi(D_80055174) # $at, 0x8005 -/* 0B74A8 7F084AB8 C42AAD44 */ lwc1 $f10, %lo(D_80055174)($at) -/* 0B74AC 7F084ABC 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B74B0 7F084AC0 44813000 */ mtc1 $at, $f6 -/* 0B74B4 7F084AC4 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B74B8 7F084AC8 27B00374 */ addiu $s0, $sp, 0x374 -/* 0B74BC 7F084ACC 460A2202 */ mul.s $f8, $f4, $f10 -/* 0B74C0 7F084AD0 C42419B4 */ lwc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B74C4 7F084AD4 02003825 */ move $a3, $s0 -/* 0B74C8 7F084AD8 2504048C */ addiu $a0, $t0, 0x48c -/* 0B74CC 7F084ADC 27B90368 */ addiu $t9, $sp, 0x368 -/* 0B74D0 7F084AE0 46064082 */ mul.s $f2, $f8, $f6 -/* 0B74D4 7F084AE4 46022000 */ add.s $f0, $f4, $f2 -/* 0B74D8 7F084AE8 4600603E */ c.le.s $f12, $f0 -/* 0B74DC 7F084AEC 00000000 */ nop -/* 0B74E0 7F084AF0 45020003 */ bc1fl .L7F084B00 -/* 0B74E4 7F084AF4 4614003C */ c.lt.s $f0, $f20 -/* 0B74E8 7F084AF8 460C0001 */ sub.s $f0, $f0, $f12 -/* 0B74EC 7F084AFC 4614003C */ c.lt.s $f0, $f20 -.L7F084B00: -/* 0B74F0 7F084B00 00000000 */ nop -/* 0B74F4 7F084B04 45020003 */ bc1fl .L7F084B14 -/* 0B74F8 7F084B08 8D050488 */ lw $a1, 0x488($t0) -/* 0B74FC 7F084B0C 460C0000 */ add.s $f0, $f0, $f12 -/* 0B7500 7F084B10 8D050488 */ lw $a1, 0x488($t0) -.L7F084B14: -/* 0B7504 7F084B14 44060000 */ mfc1 $a2, $f0 -/* 0B7508 7F084B18 E7A20358 */ swc1 $f2, 0x358($sp) -/* 0B750C 7F084B1C E7A0035C */ swc1 $f0, 0x35c($sp) -/* 0B7510 7F084B20 0FC1F2E7 */ jal bondviewTankCollisionStatus -/* 0B7514 7F084B24 AFB90010 */ sw $t9, 0x10($sp) -/* 0B7518 7F084B28 50400007 */ beql $v0, $zero, .L7F084B48 -/* 0B751C 7F084B2C 3C01BF80 */ lui $at, 0xbf80 -/* 0B7520 7F084B30 C7AA035C */ lwc1 $f10, 0x35c($sp) -/* 0B7524 7F084B34 3C018003 */ li $at, 0x80030000 # -0.000000 -/* 0B7528 7F084B38 E42A19B4 */ swc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0B752C 7F084B3C 100000CB */ b .L7F084E6C -/* 0B7530 7F084B40 8E280000 */ lw $t0, ($s1) -/* 0B7534 7F084B44 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F084B48: -/* 0B7538 7F084B48 44814000 */ mtc1 $at, $f8 -/* 0B753C 7F084B4C 44813000 */ mtc1 $at, $f6 -/* 0B7540 7F084B50 27A40348 */ addiu $a0, $sp, 0x348 -/* 0B7544 7F084B54 27A5033C */ addiu $a1, $sp, 0x33c -/* 0B7548 7F084B58 E7A8031C */ swc1 $f8, 0x31c($sp) -/* 0B754C 7F084B5C 0FC2C6DC */ jal getCollisionEdge_maybe -/* 0B7550 7F084B60 E7A60304 */ swc1 $f6, 0x304($sp) -/* 0B7554 7F084B64 C7A4033C */ lwc1 $f4, 0x33c($sp) -/* 0B7558 7F084B68 C7AA0348 */ lwc1 $f10, 0x348($sp) -/* 0B755C 7F084B6C C7A80344 */ lwc1 $f8, 0x344($sp) -/* 0B7560 7F084B70 C7A60350 */ lwc1 $f6, 0x350($sp) -/* 0B7564 7F084B74 460A2081 */ sub.s $f2, $f4, $f10 -/* 0B7568 7F084B78 46064381 */ sub.s $f14, $f8, $f6 -/* 0B756C 7F084B7C 46021102 */ mul.s $f4, $f2, $f2 -/* 0B7570 7F084B80 E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B7574 7F084B84 460E7282 */ mul.s $f10, $f14, $f14 -/* 0B7578 7F084B88 E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B757C 7F084B8C 0C007614 */ jal sqrtf -/* 0B7580 7F084B90 460A2300 */ add.s $f12, $f4, $f10 -/* 0B7584 7F084B94 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7588 7F084B98 44814000 */ mtc1 $at, $f8 -/* 0B758C 7F084B9C C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B7590 7F084BA0 C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B7594 7F084BA4 46004403 */ div.s $f16, $f8, $f0 -/* 0B7598 7F084BA8 8E280000 */ lw $t0, ($s1) -/* 0B759C 7F084BAC C7A80370 */ lwc1 $f8, 0x370($sp) -/* 0B75A0 7F084BB0 46101082 */ mul.s $f2, $f2, $f16 -/* 0B75A4 7F084BB4 00000000 */ nop -/* 0B75A8 7F084BB8 46107382 */ mul.s $f14, $f14, $f16 -/* 0B75AC 7F084BBC 46001307 */ neg.s $f12, $f2 -/* 0B75B0 7F084BC0 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B75B4 7F084BC4 E7AE0324 */ swc1 $f14, 0x324($sp) -/* 0B75B8 7F084BC8 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B75BC 7F084BCC E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B75C0 7F084BD0 C7AA0048 */ lwc1 $f10, 0x48($sp) -/* 0B75C4 7F084BD4 C504048C */ lwc1 $f4, 0x48c($t0) -/* 0B75C8 7F084BD8 46085181 */ sub.s $f6, $f10, $f8 -/* 0B75CC 7F084BDC E7A40044 */ swc1 $f4, 0x44($sp) -/* 0B75D0 7F084BE0 C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 0B75D4 7F084BE4 C7A80368 */ lwc1 $f8, 0x368($sp) -/* 0B75D8 7F084BE8 460C3102 */ mul.s $f4, $f6, $f12 -/* 0B75DC 7F084BEC 46085181 */ sub.s $f6, $f10, $f8 -/* 0B75E0 7F084BF0 460E3282 */ mul.s $f10, $f6, $f14 -/* 0B75E4 7F084BF4 460A2480 */ add.s $f18, $f4, $f10 -/* 0B75E8 7F084BF8 4614903C */ c.lt.s $f18, $f20 -/* 0B75EC 7F084BFC 00000000 */ nop -/* 0B75F0 7F084C00 45000006 */ bc1f .L7F084C1C -/* 0B75F4 7F084C04 00000000 */ nop -/* 0B75F8 7F084C08 46007207 */ neg.s $f8, $f14 -/* 0B75FC 7F084C0C 46006187 */ neg.s $f6, $f12 -/* 0B7600 7F084C10 46009487 */ neg.s $f18, $f18 -/* 0B7604 7F084C14 E7A80324 */ swc1 $f8, 0x324($sp) -/* 0B7608 7F084C18 E7A60320 */ swc1 $f6, 0x320($sp) -.L7F084C1C: -/* 0B760C 7F084C1C C7A40048 */ lwc1 $f4, 0x48($sp) -/* 0B7610 7F084C20 C7AA0350 */ lwc1 $f10, 0x350($sp) -/* 0B7614 7F084C24 C7A60320 */ lwc1 $f6, 0x320($sp) -/* 0B7618 7F084C28 460A2201 */ sub.s $f8, $f4, $f10 -/* 0B761C 7F084C2C C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 0B7620 7F084C30 46064102 */ mul.s $f4, $f8, $f6 -/* 0B7624 7F084C34 C7A80348 */ lwc1 $f8, 0x348($sp) -/* 0B7628 7F084C38 46085181 */ sub.s $f6, $f10, $f8 -/* 0B762C 7F084C3C C7AA0324 */ lwc1 $f10, 0x324($sp) -/* 0B7630 7F084C40 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B7634 7F084C44 46082000 */ add.s $f0, $f4, $f8 -/* 0B7638 7F084C48 4612003C */ c.lt.s $f0, $f18 -/* 0B763C 7F084C4C 00000000 */ nop -/* 0B7640 7F084C50 45020004 */ bc1fl .L7F084C64 -/* 0B7644 7F084C54 C7AA0368 */ lwc1 $f10, 0x368($sp) -/* 0B7648 7F084C58 46009181 */ sub.s $f6, $f18, $f0 -/* 0B764C 7F084C5C E7A6031C */ swc1 $f6, 0x31c($sp) -/* 0B7650 7F084C60 C7AA0368 */ lwc1 $f10, 0x368($sp) -.L7F084C64: -/* 0B7654 7F084C64 C7A40374 */ lwc1 $f4, 0x374($sp) -/* 0B7658 7F084C68 C7A80370 */ lwc1 $f8, 0x370($sp) -/* 0B765C 7F084C6C C7A6037C */ lwc1 $f6, 0x37c($sp) -/* 0B7660 7F084C70 46045081 */ sub.s $f2, $f10, $f4 -/* 0B7664 7F084C74 46064381 */ sub.s $f14, $f8, $f6 -/* 0B7668 7F084C78 46021282 */ mul.s $f10, $f2, $f2 -/* 0B766C 7F084C7C E7A20338 */ swc1 $f2, 0x338($sp) -/* 0B7670 7F084C80 460E7102 */ mul.s $f4, $f14, $f14 -/* 0B7674 7F084C84 E7AE0334 */ swc1 $f14, 0x334($sp) -/* 0B7678 7F084C88 0C007614 */ jal sqrtf -/* 0B767C 7F084C8C 46045300 */ add.s $f12, $f10, $f4 -/* 0B7680 7F084C90 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7684 7F084C94 44814000 */ mtc1 $at, $f8 -/* 0B7688 7F084C98 C7A20338 */ lwc1 $f2, 0x338($sp) -/* 0B768C 7F084C9C C7AE0334 */ lwc1 $f14, 0x334($sp) -/* 0B7690 7F084CA0 46004403 */ div.s $f16, $f8, $f0 -/* 0B7694 7F084CA4 8E280000 */ lw $t0, ($s1) -/* 0B7698 7F084CA8 C7A80370 */ lwc1 $f8, 0x370($sp) -/* 0B769C 7F084CAC 46101082 */ mul.s $f2, $f2, $f16 -/* 0B76A0 7F084CB0 00000000 */ nop -/* 0B76A4 7F084CB4 46107382 */ mul.s $f14, $f14, $f16 -/* 0B76A8 7F084CB8 46001307 */ neg.s $f12, $f2 -/* 0B76AC 7F084CBC E7AC0308 */ swc1 $f12, 0x308($sp) -/* 0B76B0 7F084CC0 E7AE030C */ swc1 $f14, 0x30c($sp) -/* 0B76B4 7F084CC4 C5060494 */ lwc1 $f6, 0x494($t0) -/* 0B76B8 7F084CC8 E7A60048 */ swc1 $f6, 0x48($sp) -/* 0B76BC 7F084CCC C7A40048 */ lwc1 $f4, 0x48($sp) -/* 0B76C0 7F084CD0 C50A048C */ lwc1 $f10, 0x48c($t0) -/* 0B76C4 7F084CD4 46082181 */ sub.s $f6, $f4, $f8 -/* 0B76C8 7F084CD8 E7AA0044 */ swc1 $f10, 0x44($sp) -/* 0B76CC 7F084CDC C7A40044 */ lwc1 $f4, 0x44($sp) -/* 0B76D0 7F084CE0 C7A80368 */ lwc1 $f8, 0x368($sp) -/* 0B76D4 7F084CE4 460C3282 */ mul.s $f10, $f6, $f12 -/* 0B76D8 7F084CE8 46082181 */ sub.s $f6, $f4, $f8 -/* 0B76DC 7F084CEC 460E3102 */ mul.s $f4, $f6, $f14 -/* 0B76E0 7F084CF0 46045480 */ add.s $f18, $f10, $f4 -/* 0B76E4 7F084CF4 4614903C */ c.lt.s $f18, $f20 -/* 0B76E8 7F084CF8 00000000 */ nop -/* 0B76EC 7F084CFC 45000006 */ bc1f .L7F084D18 -/* 0B76F0 7F084D00 00000000 */ nop -/* 0B76F4 7F084D04 46007407 */ neg.s $f16, $f14 -/* 0B76F8 7F084D08 46006207 */ neg.s $f8, $f12 -/* 0B76FC 7F084D0C 46009487 */ neg.s $f18, $f18 -/* 0B7700 7F084D10 E7A80308 */ swc1 $f8, 0x308($sp) -/* 0B7704 7F084D14 E7B0030C */ swc1 $f16, 0x30c($sp) -.L7F084D18: -/* 0B7708 7F084D18 C7A60048 */ lwc1 $f6, 0x48($sp) -/* 0B770C 7F084D1C C7AA0350 */ lwc1 $f10, 0x350($sp) -/* 0B7710 7F084D20 C7AC0308 */ lwc1 $f12, 0x308($sp) -/* 0B7714 7F084D24 C7B0030C */ lwc1 $f16, 0x30c($sp) -/* 0B7718 7F084D28 460A3101 */ sub.s $f4, $f6, $f10 -/* 0B771C 7F084D2C C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 0B7720 7F084D30 460C2202 */ mul.s $f8, $f4, $f12 -/* 0B7724 7F084D34 C7A40348 */ lwc1 $f4, 0x348($sp) -/* 0B7728 7F084D38 46045101 */ sub.s $f4, $f10, $f4 -/* 0B772C 7F084D3C 46102102 */ mul.s $f4, $f4, $f16 -/* 0B7730 7F084D40 46044000 */ add.s $f0, $f8, $f4 -/* 0B7734 7F084D44 C7A80344 */ lwc1 $f8, 0x344($sp) -/* 0B7738 7F084D48 46083101 */ sub.s $f4, $f6, $f8 -/* 0B773C 7F084D4C C7A8033C */ lwc1 $f8, 0x33c($sp) -/* 0B7740 7F084D50 460C2182 */ mul.s $f6, $f4, $f12 -/* 0B7744 7F084D54 46085101 */ sub.s $f4, $f10, $f8 -/* 0B7748 7F084D58 46102282 */ mul.s $f10, $f4, $f16 -/* 0B774C 7F084D5C 460A3080 */ add.s $f2, $f6, $f10 -/* 0B7750 7F084D60 4600103C */ c.lt.s $f2, $f0 -/* 0B7754 7F084D64 00000000 */ nop -/* 0B7758 7F084D68 45020003 */ bc1fl .L7F084D78 -/* 0B775C 7F084D6C 4612003C */ c.lt.s $f0, $f18 -/* 0B7760 7F084D70 46001006 */ mov.s $f0, $f2 -/* 0B7764 7F084D74 4612003C */ c.lt.s $f0, $f18 -.L7F084D78: -/* 0B7768 7F084D78 00000000 */ nop -/* 0B776C 7F084D7C 45020004 */ bc1fl .L7F084D90 -/* 0B7770 7F084D80 C7A20304 */ lwc1 $f2, 0x304($sp) -/* 0B7774 7F084D84 46009081 */ sub.s $f2, $f18, $f0 -/* 0B7778 7F084D88 E7A20304 */ swc1 $f2, 0x304($sp) -/* 0B777C 7F084D8C C7A20304 */ lwc1 $f2, 0x304($sp) -.L7F084D90: -/* 0B7780 7F084D90 C7A8031C */ lwc1 $f8, 0x31c($sp) -/* 0B7784 7F084D94 4602A03E */ c.le.s $f20, $f2 -/* 0B7788 7F084D98 00000000 */ nop -/* 0B778C 7F084D9C 4502000D */ bc1fl .L7F084DD4 -/* 0B7790 7F084DA0 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B7794 7F084DA4 4608103C */ c.lt.s $f2, $f8 -/* 0B7798 7F084DA8 00000000 */ nop -/* 0B779C 7F084DAC 45030006 */ bc1tl .L7F084DC8 -/* 0B77A0 7F084DB0 E7B00324 */ swc1 $f16, 0x324($sp) -/* 0B77A4 7F084DB4 4614403C */ c.lt.s $f8, $f20 -/* 0B77A8 7F084DB8 00000000 */ nop -/* 0B77AC 7F084DBC 45020005 */ bc1fl .L7F084DD4 -/* 0B77B0 7F084DC0 C7A0031C */ lwc1 $f0, 0x31c($sp) -/* 0B77B4 7F084DC4 E7B00324 */ swc1 $f16, 0x324($sp) -.L7F084DC8: -/* 0B77B8 7F084DC8 E7AC0320 */ swc1 $f12, 0x320($sp) -/* 0B77BC 7F084DCC E7A2031C */ swc1 $f2, 0x31c($sp) -/* 0B77C0 7F084DD0 C7A0031C */ lwc1 $f0, 0x31c($sp) -.L7F084DD4: -/* 0B77C4 7F084DD4 C7A40324 */ lwc1 $f4, 0x324($sp) -/* 0B77C8 7F084DD8 4600A03E */ c.le.s $f20, $f0 -/* 0B77CC 7F084DDC 00000000 */ nop -/* 0B77D0 7F084DE0 45020022 */ bc1fl .L7F084E6C -/* 0B77D4 7F084DE4 E7B40358 */ swc1 $f20, 0x358($sp) -/* 0B77D8 7F084DE8 46040182 */ mul.s $f6, $f0, $f4 -/* 0B77DC 7F084DEC 3C018005 */ lui $at, %hi(D_80055178) # $at, 0x8005 -/* 0B77E0 7F084DF0 C42AAD48 */ lwc1 $f10, %lo(D_80055178)($at) -/* 0B77E4 7F084DF4 C7A40320 */ lwc1 $f4, 0x320($sp) -/* 0B77E8 7F084DF8 3C018005 */ lui $at, %hi(D_8005517C) # $at, 0x8005 -/* 0B77EC 7F084DFC 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B77F0 7F084E00 24050001 */ li $a1, 1 -/* 0B77F4 7F084E04 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B77F8 7F084E08 C42AAD4C */ lwc1 $f10, %lo(D_8005517C)($at) -/* 0B77FC 7F084E0C 46040182 */ mul.s $f6, $f0, $f4 -/* 0B7800 7F084E10 E7A803AC */ swc1 $f8, 0x3ac($sp) -/* 0B7804 7F084E14 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B7808 7F084E18 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B780C 7F084E1C E7A803B4 */ swc1 $f8, 0x3b4($sp) -/* 0B7810 7F084E20 8E280000 */ lw $t0, ($s1) -/* 0B7814 7F084E24 E7B403AC */ swc1 $f20, 0x3ac($sp) -/* 0B7818 7F084E28 E7B403B4 */ swc1 $f20, 0x3b4($sp) -/* 0B781C 7F084E2C 27AE0368 */ addiu $t6, $sp, 0x368 -/* 0B7820 7F084E30 8D050488 */ lw $a1, 0x488($t0) -/* 0B7824 7F084E34 AFAE0010 */ sw $t6, 0x10($sp) -/* 0B7828 7F084E38 8FA6035C */ lw $a2, 0x35c($sp) -/* 0B782C 7F084E3C 02003825 */ move $a3, $s0 -/* 0B7830 7F084E40 0FC1F2E7 */ jal bondviewTankCollisionStatus -/* 0B7834 7F084E44 2504048C */ addiu $a0, $t0, 0x48c -/* 0B7838 7F084E48 10400004 */ beqz $v0, .L7F084E5C -/* 0B783C 7F084E4C C7A4035C */ lwc1 $f4, 0x35c($sp) -/* 0B7840 7F084E50 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B7844 7F084E54 10000002 */ b .L7F084E60 -/* 0B7848 7F084E58 E42419B4 */ swc1 $f4, %lo(g_TankOrientationAngle)($at) -.L7F084E5C: -/* 0B784C 7F084E5C E7B40358 */ swc1 $f20, 0x358($sp) -.L7F084E60: -/* 0B7850 7F084E60 10000002 */ b .L7F084E6C -/* 0B7854 7F084E64 8E280000 */ lw $t0, ($s1) -/* 0B7858 7F084E68 E7B40358 */ swc1 $f20, 0x358($sp) -.L7F084E6C: -/* 0B785C 7F084E6C 3C018005 */ lui $at, %hi(D_80055180) # $at, 0x8005 -/* 0B7860 7F084E70 C42EAD50 */ lwc1 $f14, %lo(D_80055180)($at) -/* 0B7864 7F084E74 3C038003 */ lui $v1, %hi(g_TankTurretAngle) # $v1, 0x8003 -/* 0B7868 7F084E78 246319D4 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x19d4 -/* 0B786C 7F084E7C 3C018003 */ lui $at, %hi(g_TankTurretTurn) # $at, 0x8003 -/* 0B7870 7F084E80 C42A19D8 */ lwc1 $f10, %lo(g_TankTurretTurn)($at) -/* 0B7874 7F084E84 C4660000 */ lwc1 $f6, ($v1) -/* 0B7878 7F084E88 3C078003 */ lui $a3, %hi(g_TankTurretOrientationAngleRad) # $a3, 0x8003 -/* 0B787C 7F084E8C 24E719C4 */ addiu $a3, %lo(g_TankTurretOrientationAngleRad) # addiu $a3, $a3, 0x19c4 -/* 0B7880 7F084E90 460A3200 */ add.s $f8, $f6, $f10 -/* 0B7884 7F084E94 C4EC0000 */ lwc1 $f12, ($a3) -/* 0B7888 7F084E98 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B788C 7F084E9C 3C048004 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8004 -/* 0B7890 7F084EA0 E4680000 */ swc1 $f8, ($v1) -/* 0B7894 7F084EA4 C4600000 */ lwc1 $f0, ($v1) -/* 0B7898 7F084EA8 44814000 */ mtc1 $at, $f8 -/* 0B789C 7F084EAC 46006406 */ mov.s $f16, $f12 -/* 0B78A0 7F084EB0 4600703E */ c.le.s $f14, $f0 -/* 0B78A4 7F084EB4 00000000 */ nop -/* 0B78A8 7F084EB8 45020005 */ bc1fl .L7F084ED0 -/* 0B78AC 7F084EBC 4614003C */ c.lt.s $f0, $f20 -/* 0B78B0 7F084EC0 460E0101 */ sub.s $f4, $f0, $f14 -/* 0B78B4 7F084EC4 E4640000 */ swc1 $f4, ($v1) -/* 0B78B8 7F084EC8 C4600000 */ lwc1 $f0, ($v1) -/* 0B78BC 7F084ECC 4614003C */ c.lt.s $f0, $f20 -.L7F084ED0: -/* 0B78C0 7F084ED0 00000000 */ nop -/* 0B78C4 7F084ED4 45020005 */ bc1fl .L7F084EEC -/* 0B78C8 7F084ED8 C50A014C */ lwc1 $f10, 0x14c($t0) -/* 0B78CC 7F084EDC 460E0180 */ add.s $f6, $f0, $f14 -/* 0B78D0 7F084EE0 E4660000 */ swc1 $f6, ($v1) -/* 0B78D4 7F084EE4 C4600000 */ lwc1 $f0, ($v1) -/* 0B78D8 7F084EE8 C50A014C */ lwc1 $f10, 0x14c($t0) -.L7F084EEC: -/* 0B78DC 7F084EEC 3C018005 */ lui $at, %hi(D_80055184) # $at, 0x8005 -/* 0B78E0 7F084EF0 C426AD54 */ lwc1 $f6, %lo(D_80055184)($at) -/* 0B78E4 7F084EF4 46085102 */ mul.s $f4, $f10, $f8 -/* 0B78E8 7F084EF8 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B78EC 7F084EFC 44814000 */ mtc1 $at, $f8 -/* 0B78F0 7F084F00 3C018005 */ lui $at, %hi(D_80055188) # $at, 0x8005 -/* 0B78F4 7F084F04 46062282 */ mul.s $f10, $f4, $f6 -/* 0B78F8 7F084F08 00000000 */ nop -/* 0B78FC 7F084F0C 46085102 */ mul.s $f4, $f10, $f8 -/* 0B7900 7F084F10 46002080 */ add.s $f2, $f4, $f0 -/* 0B7904 7F084F14 4614103C */ c.lt.s $f2, $f20 -/* 0B7908 7F084F18 00000000 */ nop -/* 0B790C 7F084F1C 45000002 */ bc1f .L7F084F28 -/* 0B7910 7F084F20 00000000 */ nop -/* 0B7914 7F084F24 460E1080 */ add.s $f2, $f2, $f14 -.L7F084F28: -/* 0B7918 7F084F28 4602703E */ c.le.s $f14, $f2 -/* 0B791C 7F084F2C 00000000 */ nop -/* 0B7920 7F084F30 45020003 */ bc1fl .L7F084F40 -/* 0B7924 7F084F34 460C1001 */ sub.s $f0, $f2, $f12 -/* 0B7928 7F084F38 460E1081 */ sub.s $f2, $f2, $f14 -/* 0B792C 7F084F3C 460C1001 */ sub.s $f0, $f2, $f12 -.L7F084F40: -/* 0B7930 7F084F40 C426AD58 */ lwc1 $f6, %lo(D_80055188)($at) -/* 0B7934 7F084F44 3C018005 */ lui $at, %hi(D_80055190) -/* 0B7938 7F084F48 4600303E */ c.le.s $f6, $f0 -/* 0B793C 7F084F4C 00000000 */ nop -/* 0B7940 7F084F50 45000005 */ bc1f .L7F084F68 -/* 0B7944 7F084F54 00000000 */ nop -/* 0B7948 7F084F58 3C018005 */ lui $at, %hi(D_80055190) # $at, 0x8005 -/* 0B794C 7F084F5C C42AAD5C */ lwc1 $f10, %lo(D_8005518C)($at) -/* 0B7950 7F084F60 10000009 */ b .L7F084F88 -/* 0B7954 7F084F64 460A1081 */ sub.s $f2, $f2, $f10 -.L7F084F68: -/* 0B7958 7F084F68 C428AD60 */ lwc1 $f8, %lo(D_80055190)($at) -/* 0B795C 7F084F6C 3C018005 */ lui $at, %hi(D_80055194) # $at, 0x8005 -/* 0B7960 7F084F70 4608003C */ c.lt.s $f0, $f8 -/* 0B7964 7F084F74 00000000 */ nop -/* 0B7968 7F084F78 45000003 */ bc1f .L7F084F88 -/* 0B796C 7F084F7C 00000000 */ nop -/* 0B7970 7F084F80 C424AD64 */ lwc1 $f4, %lo(D_80055194)($at) -/* 0B7974 7F084F84 46041080 */ add.s $f2, $f2, $f4 -.L7F084F88: -/* 0B7978 7F084F88 8C840FF4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0B797C 7F084F8C 00001025 */ move $v0, $zero -/* 0B7980 7F084F90 3C018005 */ lui $at, %hi(D_80055198) # $at, 0x8005 -/* 0B7984 7F084F94 18800013 */ blez $a0, .L7F084FE4 -/* 0B7988 7F084F98 3C108003 */ lui $s0, %hi(D_80036478) # $s0, 0x8003 -/* 0B798C 7F084F9C C42EAD68 */ lwc1 $f14, %lo(D_80055198)($at) -/* 0B7990 7F084FA0 261019C8 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x19c8 -/* 0B7994 7F084FA4 C60C0000 */ lwc1 $f12, ($s0) -/* 0B7998 7F084FA8 24420001 */ addiu $v0, $v0, 1 -/* 0B799C 7F084FAC 0044082A */ slt $at, $v0, $a0 -/* 0B79A0 7F084FB0 460C7482 */ mul.s $f18, $f14, $f12 -/* 0B79A4 7F084FB4 5020000A */ beql $at, $zero, .L7F084FE0 -/* 0B79A8 7F084FB8 46029300 */ add.s $f12, $f18, $f2 -/* 0B79AC 7F084FBC 46029300 */ add.s $f12, $f18, $f2 -.L7F084FC0: -/* 0B79B0 7F084FC0 24420001 */ addiu $v0, $v0, 1 -/* 0B79B4 7F084FC4 0044082A */ slt $at, $v0, $a0 -/* 0B79B8 7F084FC8 E60C0000 */ swc1 $f12, ($s0) -/* 0B79BC 7F084FCC C60C0000 */ lwc1 $f12, ($s0) -/* 0B79C0 7F084FD0 460C7482 */ mul.s $f18, $f14, $f12 -/* 0B79C4 7F084FD4 5420FFFA */ bnezl $at, .L7F084FC0 -/* 0B79C8 7F084FD8 46029300 */ add.s $f12, $f18, $f2 -/* 0B79CC 7F084FDC 46029300 */ add.s $f12, $f18, $f2 -.L7F084FE0: -/* 0B79D0 7F084FE0 E60C0000 */ swc1 $f12, ($s0) -.L7F084FE4: -/* 0B79D4 7F084FE4 3C108003 */ lui $s0, %hi(D_80036478) # $s0, 0x8003 -/* 0B79D8 7F084FE8 261019C8 */ addiu $s0, %lo(D_80036478) # addiu $s0, $s0, 0x19c8 -/* 0B79DC 7F084FEC 3C018005 */ lui $at, %hi(D_8005519C) # $at, 0x8005 -/* 0B79E0 7F084FF0 C420AD6C */ lwc1 $f0, %lo(D_8005519C)($at) -/* 0B79E4 7F084FF4 C6040000 */ lwc1 $f4, ($s0) -/* 0B79E8 7F084FF8 3C018005 */ lui $at, %hi(D_800551A0) # $at, 0x8005 -/* 0B79EC 7F084FFC C422AD70 */ lwc1 $f2, %lo(D_800551A0)($at) -/* 0B79F0 7F085000 46002182 */ mul.s $f6, $f4, $f0 -/* 0B79F4 7F085004 2504048C */ addiu $a0, $t0, 0x48c -/* 0B79F8 7F085008 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) # $a2, 0x8003 -/* 0B79FC 7F08500C E4E60000 */ swc1 $f6, ($a3) -/* 0B7A00 7F085010 C4EC0000 */ lwc1 $f12, ($a3) -/* 0B7A04 7F085014 460C103E */ c.le.s $f2, $f12 -/* 0B7A08 7F085018 00000000 */ nop -/* 0B7A0C 7F08501C 45020007 */ bc1fl .L7F08503C -/* 0B7A10 7F085020 4614603C */ c.lt.s $f12, $f20 -/* 0B7A14 7F085024 46026281 */ sub.s $f10, $f12, $f2 -/* 0B7A18 7F085028 E4EA0000 */ swc1 $f10, ($a3) -/* 0B7A1C 7F08502C C4EC0000 */ lwc1 $f12, ($a3) -/* 0B7A20 7F085030 46006203 */ div.s $f8, $f12, $f0 -/* 0B7A24 7F085034 E6080000 */ swc1 $f8, ($s0) -/* 0B7A28 7F085038 4614603C */ c.lt.s $f12, $f20 -.L7F08503C: -/* 0B7A2C 7F08503C 00000000 */ nop -/* 0B7A30 7F085040 45020007 */ bc1fl .L7F085060 -/* 0B7A34 7F085044 8D050488 */ lw $a1, 0x488($t0) -/* 0B7A38 7F085048 46026100 */ add.s $f4, $f12, $f2 -/* 0B7A3C 7F08504C E4E40000 */ swc1 $f4, ($a3) -/* 0B7A40 7F085050 C4E60000 */ lwc1 $f6, ($a3) -/* 0B7A44 7F085054 46003283 */ div.s $f10, $f6, $f0 -/* 0B7A48 7F085058 E60A0000 */ swc1 $f10, ($s0) -/* 0B7A4C 7F08505C 8D050488 */ lw $a1, 0x488($t0) -.L7F085060: -/* 0B7A50 7F085060 E7B00354 */ swc1 $f16, 0x354($sp) -/* 0B7A54 7F085064 0FC1F39F */ jal bondviewCallTankCollisionStatus -/* 0B7A58 7F085068 8CC619B4 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0B7A5C 7F08506C 3C038003 */ lui $v1, %hi(g_TankTurretAngle) # $v1, 0x8003 -/* 0B7A60 7F085070 3C018005 */ lui $at, %hi(D_800551A8) # $at, 0x8005 -/* 0B7A64 7F085074 C42EAD78 */ lwc1 $f14, %lo(D_800551A8)($at) -/* 0B7A68 7F085078 246319D4 */ addiu $v1, %lo(g_TankTurretAngle) # addiu $v1, $v1, 0x19d4 -/* 0B7A6C 7F08507C 14400009 */ bnez $v0, .L7F0850A4 -/* 0B7A70 7F085080 C7B00354 */ lwc1 $f16, 0x354($sp) -/* 0B7A74 7F085084 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0B7A78 7F085088 E43019C4 */ swc1 $f16, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B7A7C 7F08508C C42819C4 */ lwc1 $f8, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B7A80 7F085090 3C018005 */ lui $at, %hi(D_800551AC) # $at, 0x8005 -/* 0B7A84 7F085094 C424AD7C */ lwc1 $f4, %lo(D_800551AC)($at) -/* 0B7A88 7F085098 E4700000 */ swc1 $f16, ($v1) -/* 0B7A8C 7F08509C 46044183 */ div.s $f6, $f8, $f4 -/* 0B7A90 7F0850A0 E6060000 */ swc1 $f6, ($s0) -.L7F0850A4: -/* 0B7A94 7F0850A4 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0B7A98 7F0850A8 8C6319A0 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0B7A9C 7F0850AC 3C028007 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8007 -/* 0B7AA0 7F0850B0 24428488 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x7b78 -/* 0B7AA4 7F0850B4 1060002F */ beqz $v1, .L7F085174 -/* 0B7AA8 7F0850B8 27B002B4 */ addiu $s0, $sp, 0x2b4 -/* 0B7AAC 7F0850BC 8C6A0004 */ lw $t2, 4($v1) -/* 0B7AB0 7F0850C0 C44A0000 */ lwc1 $f10, ($v0) -/* 0B7AB4 7F0850C4 C4480008 */ lwc1 $f8, 8($v0) -/* 0B7AB8 7F0850C8 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0B7ABC 7F0850CC C7AC0358 */ lwc1 $f12, 0x358($sp) -/* 0B7AC0 7F0850D0 02002825 */ move $a1, $s0 -/* 0B7AC4 7F0850D4 AFAA0300 */ sw $t2, 0x300($sp) -/* 0B7AC8 7F0850D8 E7AA02F4 */ swc1 $f10, 0x2f4($sp) -/* 0B7ACC 7F0850DC 0FC162A9 */ jal matrix_4x4_set_rotation_around_y -/* 0B7AD0 7F0850E0 E7A802FC */ swc1 $f8, 0x2fc($sp) -/* 0B7AD4 7F0850E4 02002025 */ move $a0, $s0 -/* 0B7AD8 7F0850E8 0FC16220 */ jal matrix_4x4_rotate_vector_in_place -/* 0B7ADC 7F0850EC 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0B7AE0 7F0850F0 0FC1F222 */ jal sub_GAME_7F07C7B4 -/* 0B7AE4 7F0850F4 00000000 */ nop -/* 0B7AE8 7F0850F8 3C028007 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8007 -/* 0B7AEC 7F0850FC 24428488 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x7b78 -/* 0B7AF0 7F085100 C4440000 */ lwc1 $f4, ($v0) -/* 0B7AF4 7F085104 C7A602F4 */ lwc1 $f6, 0x2f4($sp) -/* 0B7AF8 7F085108 C4480008 */ lwc1 $f8, 8($v0) -/* 0B7AFC 7F08510C 3C018005 */ lui $at, %hi(D_800551BC) # $at, 0x8005 -/* 0B7B00 7F085110 46062281 */ sub.s $f10, $f4, $f6 -/* 0B7B04 7F085114 C7A402FC */ lwc1 $f4, 0x2fc($sp) -/* 0B7B08 7F085118 E7B402F8 */ swc1 $f20, 0x2f8($sp) -/* 0B7B0C 7F08511C 02002825 */ move $a1, $s0 -/* 0B7B10 7F085120 E7AA02F4 */ swc1 $f10, 0x2f4($sp) -/* 0B7B14 7F085124 46044181 */ sub.s $f6, $f8, $f4 -/* 0B7B18 7F085128 C42AAD8C */ lwc1 $f10, %lo(D_800551BC)($at) -/* 0B7B1C 7F08512C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B7B20 7F085130 C42819B4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B7B24 7F085134 E7A602FC */ swc1 $f6, 0x2fc($sp) -/* 0B7B28 7F085138 0FC162A9 */ jal matrix_4x4_set_rotation_around_y -/* 0B7B2C 7F08513C 46085301 */ sub.s $f12, $f10, $f8 -/* 0B7B30 7F085140 8FAB0300 */ lw $t3, 0x300($sp) -/* 0B7B34 7F085144 02002825 */ move $a1, $s0 -/* 0B7B38 7F085148 8D780014 */ lw $t8, 0x14($t3) -/* 0B7B3C 7F08514C 0FC163C9 */ jal matrix_scalar_multiply -/* 0B7B40 7F085150 C70C0014 */ lwc1 $f12, 0x14($t8) -/* 0B7B44 7F085154 02002025 */ move $a0, $s0 -/* 0B7B48 7F085158 0FC16220 */ jal matrix_4x4_rotate_vector_in_place -/* 0B7B4C 7F08515C 27A502F4 */ addiu $a1, $sp, 0x2f4 -/* 0B7B50 7F085160 27A402F4 */ addiu $a0, $sp, 0x2f4 -/* 0B7B54 7F085164 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B7B58 7F085168 24050001 */ li $a1, 1 -/* 0B7B5C 7F08516C 3C018005 */ lui $at, %hi(D_800551CC) # $at, 0x8005 -/* 0B7B60 7F085170 C42EAD9C */ lwc1 $f14, %lo(D_800551CC)($at) -.L7F085174: -/* 0B7B64 7F085174 3C048004 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8004 -/* 0B7B68 7F085178 8C840FF4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0B7B6C 7F08517C 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0B7B70 7F085180 C42C19C4 */ lwc1 $f12, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B7B74 7F085184 5880001B */ blezl $a0, .L7F0851F4 -/* 0B7B78 7F085188 3C0143B4 */ lui $at, 0x43b4 -/* 0B7B7C 7F08518C 18800018 */ blez $a0, .L7F0851F0 -/* 0B7B80 7F085190 00001025 */ move $v0, $zero -/* 0B7B84 7F085194 3C018003 */ lui $at, %hi(g_TankTurretTurn) # $at, 0x8003 -/* 0B7B88 7F085198 C42419D8 */ lwc1 $f4, %lo(g_TankTurretTurn)($at) -/* 0B7B8C 7F08519C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B7B90 7F0851A0 C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B7B94 7F0851A4 3C038003 */ lui $v1, %hi(D_8003647C) # $v1, 0x8003 -/* 0B7B98 7F0851A8 246319CC */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x19cc -/* 0B7B9C 7F0851AC 46062003 */ div.s $f0, $f4, $f6 -/* 0B7BA0 7F0851B0 C4700000 */ lwc1 $f16, ($v1) -/* 0B7BA4 7F0851B4 24420001 */ addiu $v0, $v0, 1 -/* 0B7BA8 7F0851B8 0044082A */ slt $at, $v0, $a0 -/* 0B7BAC 7F0851BC 46107482 */ mul.s $f18, $f14, $f16 -/* 0B7BB0 7F0851C0 5020000A */ beql $at, $zero, .L7F0851EC -/* 0B7BB4 7F0851C4 46009400 */ add.s $f16, $f18, $f0 -/* 0B7BB8 7F0851C8 46009400 */ add.s $f16, $f18, $f0 -.L7F0851CC: -/* 0B7BBC 7F0851CC 24420001 */ addiu $v0, $v0, 1 -/* 0B7BC0 7F0851D0 0044082A */ slt $at, $v0, $a0 -/* 0B7BC4 7F0851D4 E4700000 */ swc1 $f16, ($v1) -/* 0B7BC8 7F0851D8 C4700000 */ lwc1 $f16, ($v1) -/* 0B7BCC 7F0851DC 46107482 */ mul.s $f18, $f14, $f16 -/* 0B7BD0 7F0851E0 5420FFFA */ bnezl $at, .L7F0851CC -/* 0B7BD4 7F0851E4 46009400 */ add.s $f16, $f18, $f0 -/* 0B7BD8 7F0851E8 46009400 */ add.s $f16, $f18, $f0 -.L7F0851EC: -/* 0B7BDC 7F0851EC E4700000 */ swc1 $f16, ($v1) -.L7F0851F0: -/* 0B7BE0 7F0851F0 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.L7F0851F4: -/* 0B7BE4 7F0851F4 44817000 */ mtc1 $at, $f14 -/* 0B7BE8 7F0851F8 3C038003 */ lui $v1, %hi(D_8003647C) # $v1, 0x8003 -/* 0B7BEC 7F0851FC 246319CC */ addiu $v1, %lo(D_8003647C) # addiu $v1, $v1, 0x19cc -/* 0B7BF0 7F085200 3C018005 */ lui $at, %hi(D_800551D0) # $at, 0x8005 -/* 0B7BF4 7F085204 C42AADA0 */ lwc1 $f10, %lo(D_800551D0)($at) -/* 0B7BF8 7F085208 C4660000 */ lwc1 $f6, ($v1) -/* 0B7BFC 7F08520C 8E280000 */ lw $t0, ($s1) -/* 0B7C00 7F085210 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B7C04 7F085214 460A3082 */ mul.s $f2, $f6, $f10 -/* 0B7C08 7F085218 44812000 */ mtc1 $at, $f4 -/* 0B7C0C 7F08521C C508014C */ lwc1 $f8, 0x14c($t0) -/* 0B7C10 7F085220 3C018005 */ lui $at, %hi(D_800551D4) # $at, 0x8005 -/* 0B7C14 7F085224 C42AADA4 */ lwc1 $f10, %lo(D_800551D4)($at) -/* 0B7C18 7F085228 46044182 */ mul.s $f6, $f8, $f4 -/* 0B7C1C 7F08522C 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B7C20 7F085230 44812000 */ mtc1 $at, $f4 -/* 0B7C24 7F085234 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B7C28 7F085238 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B7C2C 7F08523C C42A19B4 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0B7C30 7F085240 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B7C34 7F085244 46044182 */ mul.s $f6, $f8, $f4 -/* 0B7C38 7F085248 460C5200 */ add.s $f8, $f10, $f12 -/* 0B7C3C 7F08524C 44815000 */ mtc1 $at, $f10 -/* 0B7C40 7F085250 3C018005 */ lui $at, %hi(D_800551D8) # $at, 0x8005 -/* 0B7C44 7F085254 46064100 */ add.s $f4, $f8, $f6 -/* 0B7C48 7F085258 460A1202 */ mul.s $f8, $f2, $f10 -/* 0B7C4C 7F08525C 46082180 */ add.s $f6, $f4, $f8 -/* 0B7C50 7F085260 C424ADA8 */ lwc1 $f4, %lo(D_800551D8)($at) -/* 0B7C54 7F085264 460E3282 */ mul.s $f10, $f6, $f14 -/* 0B7C58 7F085268 46045203 */ div.s $f8, $f10, $f4 -/* 0B7C5C 7F08526C E5080148 */ swc1 $f8, 0x148($t0) -/* 0B7C60 7F085270 8E280000 */ lw $t0, ($s1) -/* 0B7C64 7F085274 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B7C68 7F085278 4614003C */ c.lt.s $f0, $f20 -/* 0B7C6C 7F08527C 00000000 */ nop -/* 0B7C70 7F085280 4502000A */ bc1fl .L7F0852AC -/* 0B7C74 7F085284 4600703E */ c.le.s $f14, $f0 -/* 0B7C78 7F085288 460E0180 */ add.s $f6, $f0, $f14 -.L7F08528C: -/* 0B7C7C 7F08528C E5060148 */ swc1 $f6, 0x148($t0) -/* 0B7C80 7F085290 8E280000 */ lw $t0, ($s1) -/* 0B7C84 7F085294 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B7C88 7F085298 4614003C */ c.lt.s $f0, $f20 -/* 0B7C8C 7F08529C 00000000 */ nop -/* 0B7C90 7F0852A0 4503FFFA */ bc1tl .L7F08528C -/* 0B7C94 7F0852A4 460E0180 */ add.s $f6, $f0, $f14 -/* 0B7C98 7F0852A8 4600703E */ c.le.s $f14, $f0 -.L7F0852AC: -/* 0B7C9C 7F0852AC 00000000 */ nop -/* 0B7CA0 7F0852B0 45000009 */ bc1f .L7F0852D8 -/* 0B7CA4 7F0852B4 00000000 */ nop -/* 0B7CA8 7F0852B8 460E0281 */ sub.s $f10, $f0, $f14 -.L7F0852BC: -/* 0B7CAC 7F0852BC E50A0148 */ swc1 $f10, 0x148($t0) -/* 0B7CB0 7F0852C0 8E280000 */ lw $t0, ($s1) -/* 0B7CB4 7F0852C4 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B7CB8 7F0852C8 4600703E */ c.le.s $f14, $f0 -/* 0B7CBC 7F0852CC 00000000 */ nop -/* 0B7CC0 7F0852D0 4503FFFA */ bc1tl .L7F0852BC -/* 0B7CC4 7F0852D4 460E0281 */ sub.s $f10, $f0, $f14 -.L7F0852D8: -/* 0B7CC8 7F0852D8 10000022 */ b .L7F085364 -/* 0B7CCC 7F0852DC 00000000 */ nop -.L7F0852E0: -/* 0B7CD0 7F0852E0 C504014C */ lwc1 $f4, 0x14c($t0) -/* 0B7CD4 7F0852E4 C5280000 */ lwc1 $f8, ($t1) -/* 0B7CD8 7F0852E8 3C014060 */ li $at, 0x40600000 # 3.500000 -/* 0B7CDC 7F0852EC 44815000 */ mtc1 $at, $f10 -/* 0B7CE0 7F0852F0 46082182 */ mul.s $f6, $f4, $f8 -/* 0B7CE4 7F0852F4 C5080148 */ lwc1 $f8, 0x148($t0) -/* 0B7CE8 7F0852F8 3C0143B4 */ lui $at, 0x43b4 -/* 0B7CEC 7F0852FC 460A3102 */ mul.s $f4, $f6, $f10 -/* 0B7CF0 7F085300 46044000 */ add.s $f0, $f8, $f4 -/* 0B7CF4 7F085304 4614003C */ c.lt.s $f0, $f20 -/* 0B7CF8 7F085308 00000000 */ nop -/* 0B7CFC 7F08530C 45020009 */ bc1fl .L7F085334 -/* 0B7D00 7F085310 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B7D04 7F085314 44817000 */ mtc1 $at, $f14 -/* 0B7D08 7F085318 00000000 */ nop -/* 0B7D0C 7F08531C 460E0000 */ add.s $f0, $f0, $f14 -.L7F085320: -/* 0B7D10 7F085320 4614003C */ c.lt.s $f0, $f20 -/* 0B7D14 7F085324 00000000 */ nop -/* 0B7D18 7F085328 4503FFFD */ bc1tl .L7F085320 -/* 0B7D1C 7F08532C 460E0000 */ add.s $f0, $f0, $f14 -/* 0B7D20 7F085330 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -.L7F085334: -/* 0B7D24 7F085334 44817000 */ mtc1 $at, $f14 -/* 0B7D28 7F085338 00000000 */ nop -/* 0B7D2C 7F08533C 4600703E */ c.le.s $f14, $f0 -/* 0B7D30 7F085340 00000000 */ nop -/* 0B7D34 7F085344 45020007 */ bc1fl .L7F085364 -/* 0B7D38 7F085348 E5000148 */ swc1 $f0, 0x148($t0) -/* 0B7D3C 7F08534C 460E0001 */ sub.s $f0, $f0, $f14 -.L7F085350: -/* 0B7D40 7F085350 4600703E */ c.le.s $f14, $f0 -/* 0B7D44 7F085354 00000000 */ nop -/* 0B7D48 7F085358 4503FFFD */ bc1tl .L7F085350 -/* 0B7D4C 7F08535C 460E0001 */ sub.s $f0, $f0, $f14 -/* 0B7D50 7F085360 E5000148 */ swc1 $f0, 0x148($t0) -.L7F085364: -/* 0B7D54 7F085364 0FC2060D */ jal bondviewApplyVertaTheta -/* 0B7D58 7F085368 00000000 */ nop -/* 0B7D5C 7F08536C 0FC1E69C */ jal currentPlayerGetCrouchPos -/* 0B7D60 7F085370 E7B402AC */ swc1 $f20, 0x2ac($sp) -/* 0B7D64 7F085374 14400004 */ bnez $v0, .L7F085388 -/* 0B7D68 7F085378 3C01C2C8 */ li $at, 0xC2C80000 # -100.000000 -/* 0B7D6C 7F08537C 44813000 */ mtc1 $at, $f6 -/* 0B7D70 7F085380 1000000B */ b .L7F0853B0 -/* 0B7D74 7F085384 E7A602AC */ swc1 $f6, 0x2ac($sp) -.L7F085388: -/* 0B7D78 7F085388 0FC1E69C */ jal currentPlayerGetCrouchPos -/* 0B7D7C 7F08538C 00000000 */ nop -/* 0B7D80 7F085390 24010001 */ li $at, 1 -/* 0B7D84 7F085394 14410004 */ bne $v0, $at, .L7F0853A8 -/* 0B7D88 7F085398 3C01C270 */ li $at, 0xC2700000 # -60.000000 -/* 0B7D8C 7F08539C 44815000 */ mtc1 $at, $f10 -/* 0B7D90 7F0853A0 10000003 */ b .L7F0853B0 -/* 0B7D94 7F0853A4 E7AA02AC */ swc1 $f10, 0x2ac($sp) -.L7F0853A8: -/* 0B7D98 7F0853A8 0FC1E69C */ jal currentPlayerGetCrouchPos -/* 0B7D9C 7F0853AC 00000000 */ nop -.L7F0853B0: -/* 0B7DA0 7F0853B0 8E280000 */ lw $t0, ($s1) -/* 0B7DA4 7F0853B4 C7A802AC */ lwc1 $f8, 0x2ac($sp) -/* 0B7DA8 7F0853B8 3C018005 */ lui $at, %hi(D_8004ADAC) # $at, 0x8005 -/* 0B7DAC 7F0853BC C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0B7DB0 7F0853C0 250400A0 */ addiu $a0, $t0, 0xa0 -/* 0B7DB4 7F0853C4 250600A4 */ addiu $a2, $t0, 0xa4 -/* 0B7DB8 7F0853C8 46004032 */ c.eq.s $f8, $f0 -/* 0B7DBC 7F0853CC 00000000 */ nop -/* 0B7DC0 7F0853D0 4503000C */ bc1tl .L7F085404 -/* 0B7DC4 7F0853D4 C7A602AC */ lwc1 $f6, 0x2ac($sp) -/* 0B7DC8 7F0853D8 C420ADAC */ lwc1 $f0, %lo(D_8004ADAC)($at) -/* 0B7DCC 7F0853DC 3C0140C0 */ li $at, 0x40C00000 # 6.000000 -/* 0B7DD0 7F0853E0 44812000 */ mtc1 $at, $f4 -/* 0B7DD4 7F0853E4 44054000 */ mfc1 $a1, $f8 -/* 0B7DD8 7F0853E8 44070000 */ mfc1 $a3, $f0 -/* 0B7DDC 7F0853EC E7A00010 */ swc1 $f0, 0x10($sp) -/* 0B7DE0 7F0853F0 0FC10BF6 */ jal chrobjApplySpeed -/* 0B7DE4 7F0853F4 E7A40014 */ swc1 $f4, 0x14($sp) -/* 0B7DE8 7F0853F8 8E280000 */ lw $t0, ($s1) -/* 0B7DEC 7F0853FC C50000A0 */ lwc1 $f0, 0xa0($t0) -/* 0B7DF0 7F085400 C7A602AC */ lwc1 $f6, 0x2ac($sp) -.L7F085404: -/* 0B7DF4 7F085404 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0B7DF8 7F085408 3C0C8003 */ lui $t4, %hi(in_tank_flag) # $t4, 0x8003 -/* 0B7DFC 7F08540C 46003032 */ c.eq.s $f6, $f0 -/* 0B7E00 7F085410 261019A8 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x19a8 -/* 0B7E04 7F085414 45000002 */ bc1f .L7F085420 -/* 0B7E08 7F085418 00000000 */ nop -/* 0B7E0C 7F08541C E51400A4 */ swc1 $f20, 0xa4($t0) -.L7F085420: -/* 0B7E10 7F085420 8D8C1998 */ lw $t4, %lo(in_tank_flag)($t4) -/* 0B7E14 7F085424 24010001 */ li $at, 1 -/* 0B7E18 7F085428 15810209 */ bne $t4, $at, .L7F085C50 -/* 0B7E1C 7F08542C 3C028007 */ lui $v0, %hi(g_EnterTankAudioState) # $v0, 0x8007 -/* 0B7E20 7F085430 8C428498 */ lw $v0, %lo(g_EnterTankAudioState)($v0) -/* 0B7E24 7F085434 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0B7E28 7F085438 24010001 */ li $at, 1 -/* 0B7E2C 7F08543C 144000BF */ bnez $v0, .L7F08573C -/* 0B7E30 7F085440 00000000 */ nop -/* 0B7E34 7F085444 8C6319A0 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0B7E38 7F085448 3C018005 */ lui $at, %hi(D_800551DC) # $at, 0x8005 -/* 0B7E3C 7F08544C 27A50268 */ addiu $a1, $sp, 0x268 -/* 0B7E40 7F085450 106000AD */ beqz $v1, .L7F085708 -/* 0B7E44 7F085454 00000000 */ nop -/* 0B7E48 7F085458 C42AADB0 */ lwc1 $f10, %lo(D_800551DC)($at) -/* 0B7E4C 7F08545C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B7E50 7F085460 C42819B4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B7E54 7F085464 8C700004 */ lw $s0, 4($v1) -/* 0B7E58 7F085468 0FC162A9 */ jal matrix_4x4_set_rotation_around_y -/* 0B7E5C 7F08546C 46085301 */ sub.s $f12, $f10, $f8 -/* 0B7E60 7F085470 8E0D0014 */ lw $t5, 0x14($s0) -/* 0B7E64 7F085474 27A50268 */ addiu $a1, $sp, 0x268 -/* 0B7E68 7F085478 0FC163C9 */ jal matrix_scalar_multiply -/* 0B7E6C 7F08547C C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B7E70 7F085480 3C028007 */ lui $v0, %hi(flt_CODE_bss_800799A8) # $v0, 0x8007 -/* 0B7E74 7F085484 24428488 */ addiu $v0, %lo(flt_CODE_bss_800799A8) # addiu $v0, $v0, -0x7b78 -/* 0B7E78 7F085488 C4440000 */ lwc1 $f4, ($v0) -/* 0B7E7C 7F08548C C4460004 */ lwc1 $f6, 4($v0) -/* 0B7E80 7F085490 C44A0008 */ lwc1 $f10, 8($v0) -/* 0B7E84 7F085494 27A40268 */ addiu $a0, $sp, 0x268 -/* 0B7E88 7F085498 27A5025C */ addiu $a1, $sp, 0x25c -/* 0B7E8C 7F08549C E7A4025C */ swc1 $f4, 0x25c($sp) -/* 0B7E90 7F0854A0 E7A60260 */ swc1 $f6, 0x260($sp) -/* 0B7E94 7F0854A4 0FC16220 */ jal matrix_4x4_rotate_vector_in_place -/* 0B7E98 7F0854A8 E7AA0264 */ swc1 $f10, 0x264($sp) -/* 0B7E9C 7F0854AC C7A8025C */ lwc1 $f8, 0x25c($sp) -/* 0B7EA0 7F0854B0 C6040058 */ lwc1 $f4, 0x58($s0) -/* 0B7EA4 7F0854B4 C7AA0260 */ lwc1 $f10, 0x260($sp) -/* 0B7EA8 7F0854B8 3C01C1A0 */ li $at, 0xC1A00000 # -20.000000 -/* 0B7EAC 7F0854BC 46044180 */ add.s $f6, $f8, $f4 -/* 0B7EB0 7F0854C0 44810000 */ mtc1 $at, $f0 -/* 0B7EB4 7F0854C4 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B7EB8 7F0854C8 44817000 */ mtc1 $at, $f14 -/* 0B7EBC 7F0854CC E7A6025C */ swc1 $f6, 0x25c($sp) -/* 0B7EC0 7F0854D0 C608005C */ lwc1 $f8, 0x5c($s0) -/* 0B7EC4 7F0854D4 C7A60264 */ lwc1 $f6, 0x264($sp) -/* 0B7EC8 7F0854D8 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B7ECC 7F0854DC 46085100 */ add.s $f4, $f10, $f8 -/* 0B7ED0 7F0854E0 8E2F0000 */ lw $t7, ($s1) -/* 0B7ED4 7F0854E4 E7A40260 */ swc1 $f4, 0x260($sp) -/* 0B7ED8 7F0854E8 C60A0060 */ lwc1 $f10, 0x60($s0) -/* 0B7EDC 7F0854EC C42419B4 */ lwc1 $f4, %lo(g_TankOrientationAngle)($at) -/* 0B7EE0 7F0854F0 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0B7EE4 7F0854F4 460A3200 */ add.s $f8, $f6, $f10 -/* 0B7EE8 7F0854F8 C42619C4 */ lwc1 $f6, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B7EEC 7F0854FC 3C018005 */ lui $at, %hi(D_800551E0) # $at, 0x8005 -/* 0B7EF0 7F085500 46062280 */ add.s $f10, $f4, $f6 -/* 0B7EF4 7F085504 E7A80264 */ swc1 $f8, 0x264($sp) -/* 0B7EF8 7F085508 C5E20158 */ lwc1 $f2, 0x158($t7) -/* 0B7EFC 7F08550C C424ADB4 */ lwc1 $f4, %lo(D_800551E0)($at) -/* 0B7F00 7F085510 460E5202 */ mul.s $f8, $f10, $f14 -/* 0B7F04 7F085514 4600103C */ c.lt.s $f2, $f0 -/* 0B7F08 7F085518 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7F0C 7F08551C 44819000 */ mtc1 $at, $f18 -/* 0B7F10 7F085520 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B7F14 7F085524 45000002 */ bc1f .L7F085530 -/* 0B7F18 7F085528 46044403 */ div.s $f16, $f8, $f4 -/* 0B7F1C 7F08552C 46000086 */ mov.s $f2, $f0 -.L7F085530: -/* 0B7F20 7F085530 C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B7F24 7F085534 3C014234 */ li $at, 0x42340000 # 45.000000 -/* 0B7F28 7F085538 44815000 */ mtc1 $at, $f10 -/* 0B7F2C 7F08553C 3C108007 */ lui $s0, %hi(g_TankEnteringSitHeight) # $s0, 0x8007 -/* 0B7F30 7F085540 2610849C */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x7b64 -/* 0B7F34 7F085544 460A3203 */ div.s $f8, $f6, $f10 -/* 0B7F38 7F085548 C6040000 */ lwc1 $f4, ($s0) -/* 0B7F3C 7F08554C 3C018005 */ lui $at, %hi(D_800551E4) # $at, 0x8005 -/* 0B7F40 7F085550 46082180 */ add.s $f6, $f4, $f8 -/* 0B7F44 7F085554 E6060000 */ swc1 $f6, ($s0) -/* 0B7F48 7F085558 C6000000 */ lwc1 $f0, ($s0) -/* 0B7F4C 7F08555C 4600903E */ c.le.s $f18, $f0 -/* 0B7F50 7F085560 00000000 */ nop -/* 0B7F54 7F085564 45000003 */ bc1f .L7F085574 -/* 0B7F58 7F085568 00000000 */ nop -/* 0B7F5C 7F08556C E6120000 */ swc1 $f18, ($s0) -/* 0B7F60 7F085570 C6000000 */ lwc1 $f0, ($s0) -.L7F085574: -/* 0B7F64 7F085574 C42AADB8 */ lwc1 $f10, %lo(D_800551E4)($at) -/* 0B7F68 7F085578 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B7F6C 7F08557C 44814000 */ mtc1 $at, $f8 -/* 0B7F70 7F085580 460A0102 */ mul.s $f4, $f0, $f10 -/* 0B7F74 7F085584 E7A20254 */ swc1 $f2, 0x254($sp) -/* 0B7F78 7F085588 E7B00258 */ swc1 $f16, 0x258($sp) -/* 0B7F7C 7F08558C 46082302 */ mul.s $f12, $f4, $f8 -/* 0B7F80 7F085590 0FC16068 */ jal cosf -/* 0B7F84 7F085594 00000000 */ nop -/* 0B7F88 7F085598 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0B7F8C 7F08559C 44817000 */ mtc1 $at, $f14 -/* 0B7F90 7F0855A0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7F94 7F0855A4 44813000 */ mtc1 $at, $f6 -/* 0B7F98 7F0855A8 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B7F9C 7F0855AC 44812000 */ mtc1 $at, $f4 -/* 0B7FA0 7F0855B0 46060280 */ add.s $f10, $f0, $f6 -/* 0B7FA4 7F0855B4 3C028007 */ lui $v0, %hi(g_TankEnteringSitHeightRemain) # $v0, 0x8007 -/* 0B7FA8 7F0855B8 244284A0 */ addiu $v0, %lo(g_TankEnteringSitHeightRemain) # addiu $v0, $v0, -0x7b60 -/* 0B7FAC 7F0855BC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B7FB0 7F0855C0 46045202 */ mul.s $f8, $f10, $f4 -/* 0B7FB4 7F0855C4 44813000 */ mtc1 $at, $f6 -/* 0B7FB8 7F0855C8 C7A40254 */ lwc1 $f4, 0x254($sp) -/* 0B7FBC 7F0855CC 3C018007 */ lui $at, %hi(g_TankEnterBondVertAngleDeg) # $at, 0x8007 -/* 0B7FC0 7F0855D0 8E390000 */ lw $t9, ($s1) -/* 0B7FC4 7F0855D4 C7B00258 */ lwc1 $f16, 0x258($sp) -/* 0B7FC8 7F0855D8 3C038007 */ lui $v1, %hi(g_EnterTankCoord) # $v1, 0x8007 -/* 0B7FCC 7F0855DC E4480000 */ swc1 $f8, ($v0) -/* 0B7FD0 7F0855E0 C4420000 */ lwc1 $f2, ($v0) -/* 0B7FD4 7F0855E4 246384B0 */ addiu $v1, %lo(g_EnterTankCoord) # addiu $v1, $v1, -0x7b50 -/* 0B7FD8 7F0855E8 46023281 */ sub.s $f10, $f6, $f2 -/* 0B7FDC 7F0855EC C42684A8 */ lwc1 $f6, %lo(g_TankEnterBondVertAngleDeg)($at) -/* 0B7FE0 7F0855F0 3C018007 */ lui $at, %hi(g_TankEnterBondHorizAngleDeg) # $at, 0x8007 -/* 0B7FE4 7F0855F4 46045202 */ mul.s $f8, $f10, $f4 -/* 0B7FE8 7F0855F8 00000000 */ nop -/* 0B7FEC 7F0855FC 46061282 */ mul.s $f10, $f2, $f6 -/* 0B7FF0 7F085600 46085100 */ add.s $f4, $f10, $f8 -/* 0B7FF4 7F085604 E7240158 */ swc1 $f4, 0x158($t9) -/* 0B7FF8 7F085608 C43284A4 */ lwc1 $f18, %lo(g_TankEnterBondHorizAngleDeg)($at) -/* 0B7FFC 7F08560C 3C014334 */ li $at, 0x43340000 # 180.000000 -/* 0B8000 7F085610 44813000 */ mtc1 $at, $f6 -/* 0B8004 7F085614 46128301 */ sub.s $f12, $f16, $f18 -/* 0B8008 7F085618 3C01C334 */ li $at, 0xC3340000 # -180.000000 -/* 0B800C 7F08561C 44815000 */ mtc1 $at, $f10 -/* 0B8010 7F085620 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8014 7F085624 460C303C */ c.lt.s $f6, $f12 -/* 0B8018 7F085628 44812000 */ mtc1 $at, $f4 -/* 0B801C 7F08562C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8020 7F085630 45000002 */ bc1f .L7F08563C -/* 0B8024 7F085634 00000000 */ nop -/* 0B8028 7F085638 460E8401 */ sub.s $f16, $f16, $f14 -.L7F08563C: -/* 0B802C 7F08563C 460A603C */ c.lt.s $f12, $f10 -/* 0B8030 7F085640 00000000 */ nop -/* 0B8034 7F085644 45020003 */ bc1fl .L7F085654 -/* 0B8038 7F085648 C4420000 */ lwc1 $f2, ($v0) -/* 0B803C 7F08564C 460E8400 */ add.s $f16, $f16, $f14 -/* 0B8040 7F085650 C4420000 */ lwc1 $f2, ($v0) -.L7F085654: -/* 0B8044 7F085654 8E2E0000 */ lw $t6, ($s1) -/* 0B8048 7F085658 46022181 */ sub.s $f6, $f4, $f2 -/* 0B804C 7F08565C 46121202 */ mul.s $f8, $f2, $f18 -/* 0B8050 7F085660 00000000 */ nop -/* 0B8054 7F085664 46103282 */ mul.s $f10, $f6, $f16 -/* 0B8058 7F085668 460A4100 */ add.s $f4, $f8, $f10 -/* 0B805C 7F08566C 44815000 */ mtc1 $at, $f10 -/* 0B8060 7F085670 E5C40148 */ swc1 $f4, 0x148($t6) -/* 0B8064 7F085674 8E280000 */ lw $t0, ($s1) -/* 0B8068 7F085678 C5000148 */ lwc1 $f0, 0x148($t0) -/* 0B806C 7F08567C 4600703E */ c.le.s $f14, $f0 -/* 0B8070 7F085680 00000000 */ nop -/* 0B8074 7F085684 45000005 */ bc1f .L7F08569C -/* 0B8078 7F085688 00000000 */ nop -/* 0B807C 7F08568C 460E0181 */ sub.s $f6, $f0, $f14 -/* 0B8080 7F085690 E5060148 */ swc1 $f6, 0x148($t0) -/* 0B8084 7F085694 8E280000 */ lw $t0, ($s1) -/* 0B8088 7F085698 C5000148 */ lwc1 $f0, 0x148($t0) -.L7F08569C: -/* 0B808C 7F08569C 4614003C */ c.lt.s $f0, $f20 -/* 0B8090 7F0856A0 00000000 */ nop -/* 0B8094 7F0856A4 45020005 */ bc1fl .L7F0856BC -/* 0B8098 7F0856A8 C4420000 */ lwc1 $f2, ($v0) -/* 0B809C 7F0856AC 460E0200 */ add.s $f8, $f0, $f14 -/* 0B80A0 7F0856B0 E5080148 */ swc1 $f8, 0x148($t0) -/* 0B80A4 7F0856B4 8E280000 */ lw $t0, ($s1) -/* 0B80A8 7F0856B8 C4420000 */ lwc1 $f2, ($v0) -.L7F0856BC: -/* 0B80AC 7F0856BC C4640000 */ lwc1 $f4, ($v1) -/* 0B80B0 7F0856C0 C7A8025C */ lwc1 $f8, 0x25c($sp) -/* 0B80B4 7F0856C4 46025001 */ sub.s $f0, $f10, $f2 -/* 0B80B8 7F0856C8 46041182 */ mul.s $f6, $f2, $f4 -/* 0B80BC 7F0856CC 00000000 */ nop -/* 0B80C0 7F0856D0 46080282 */ mul.s $f10, $f0, $f8 -/* 0B80C4 7F0856D4 C508048C */ lwc1 $f8, 0x48c($t0) -/* 0B80C8 7F0856D8 E7B403B0 */ swc1 $f20, 0x3b0($sp) -/* 0B80CC 7F0856DC 460A3100 */ add.s $f4, $f6, $f10 -/* 0B80D0 7F0856E0 C46A0008 */ lwc1 $f10, 8($v1) -/* 0B80D4 7F0856E4 46082181 */ sub.s $f6, $f4, $f8 -/* 0B80D8 7F0856E8 460A1102 */ mul.s $f4, $f2, $f10 -/* 0B80DC 7F0856EC C7A80264 */ lwc1 $f8, 0x264($sp) -/* 0B80E0 7F0856F0 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0B80E4 7F0856F4 46080182 */ mul.s $f6, $f0, $f8 -/* 0B80E8 7F0856F8 C5080494 */ lwc1 $f8, 0x494($t0) -/* 0B80EC 7F0856FC 46062280 */ add.s $f10, $f4, $f6 -/* 0B80F0 7F085700 46085101 */ sub.s $f4, $f10, $f8 -/* 0B80F4 7F085704 E7A403B4 */ swc1 $f4, 0x3b4($sp) -.L7F085708: -/* 0B80F8 7F085708 3C108007 */ lui $s0, %hi(g_TankEnteringSitHeight) # $s0, 0x8007 -/* 0B80FC 7F08570C 2610849C */ addiu $s0, %lo(g_TankEnteringSitHeight) # addiu $s0, $s0, -0x7b64 -/* 0B8100 7F085710 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8104 7F085714 44815000 */ mtc1 $at, $f10 -/* 0B8108 7F085718 C6060000 */ lwc1 $f6, ($s0) -/* 0B810C 7F08571C 8E280000 */ lw $t0, ($s1) -/* 0B8110 7F085720 3C018007 */ lui $at, %hi(g_EnterTankAudioState) -/* 0B8114 7F085724 4606503E */ c.le.s $f10, $f6 -/* 0B8118 7F085728 240A0001 */ li $t2, 1 -/* 0B811C 7F08572C 450200EF */ bc1fl .L7F085AEC -/* 0B8120 7F085730 3C013F40 */ lui $at, %hi(0x3F3F99B8) # $at, 0x3f40 -/* 0B8124 7F085734 100000EC */ b .L7F085AE8 -/* 0B8128 7F085738 AC2A8498 */ sw $t2, %lo(g_EnterTankAudioState)($at) -.L7F08573C: -/* 0B812C 7F08573C 1441001A */ bne $v0, $at, .L7F0857A8 -/* 0B8130 7F085740 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0B8134 7F085744 240B0002 */ li $t3, 2 -/* 0B8138 7F085748 3C018007 */ lui $at, %hi(g_EnterTankAudioState) # $at, 0x8007 -/* 0B813C 7F08574C 261019A8 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x19a8 -/* 0B8140 7F085750 AC2B8498 */ sw $t3, %lo(g_EnterTankAudioState)($at) -/* 0B8144 7F085754 8E180000 */ lw $t8, ($s0) -/* 0B8148 7F085758 5700000A */ bnezl $t8, .L7F085784 -/* 0B814C 7F08575C 8E040000 */ lw $a0, ($s0) -/* 0B8150 7F085760 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B8154 7F085764 00000000 */ nop -/* 0B8158 7F085768 14400005 */ bnez $v0, .L7F085780 -/* 0B815C 7F08576C 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B8160 7F085770 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B8164 7F085774 24050042 */ li $a1, 66 -/* 0B8168 7F085778 0C00209A */ jal sndPlaySfx -/* 0B816C 7F08577C 02003025 */ move $a2, $s0 -.L7F085780: -/* 0B8170 7F085780 8E040000 */ lw $a0, ($s0) -.L7F085784: -/* 0B8174 7F085784 24050008 */ li $a1, 8 -/* 0B8178 7F085788 0C002179 */ jal sndCreatePostEvent -/* 0B817C 7F08578C 240661A8 */ li $a2, 25000 -/* 0B8180 7F085790 3C028007 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8007 -/* 0B8184 7F085794 24428494 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x7b6c -/* 0B8188 7F085798 240C61A8 */ li $t4, 25000 -/* 0B818C 7F08579C AC4C0000 */ sw $t4, ($v0) -/* 0B8190 7F0857A0 100000D1 */ b .L7F085AE8 -/* 0B8194 7F0857A4 8E280000 */ lw $t0, ($s1) -.L7F0857A8: -/* 0B8198 7F0857A8 8E280000 */ lw $t0, ($s1) -/* 0B819C 7F0857AC 3C014170 */ li $at, 0x41700000 # 15.000000 -/* 0B81A0 7F0857B0 44812000 */ mtc1 $at, $f4 -/* 0B81A4 7F0857B4 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B81A8 7F0857B8 3C018005 */ lui $at, %hi(D_800551E8) # $at, 0x8005 -/* 0B81AC 7F0857BC C42AADBC */ lwc1 $f10, %lo(D_800551E8)($at) -/* 0B81B0 7F0857C0 46044003 */ div.s $f0, $f8, $f4 -/* 0B81B4 7F0857C4 C506014C */ lwc1 $f6, 0x14c($t0) -/* 0B81B8 7F0857C8 460A3083 */ div.s $f2, $f6, $f10 -/* 0B81BC 7F0857CC 4614003C */ c.lt.s $f0, $f20 -/* 0B81C0 7F0857D0 00000000 */ nop -/* 0B81C4 7F0857D4 45020003 */ bc1fl .L7F0857E4 -/* 0B81C8 7F0857D8 4614103C */ c.lt.s $f2, $f20 -/* 0B81CC 7F0857DC 46000007 */ neg.s $f0, $f0 -/* 0B81D0 7F0857E0 4614103C */ c.lt.s $f2, $f20 -.L7F0857E4: -/* 0B81D4 7F0857E4 00000000 */ nop -/* 0B81D8 7F0857E8 45020003 */ bc1fl .L7F0857F8 -/* 0B81DC 7F0857EC 4602003C */ c.lt.s $f0, $f2 -/* 0B81E0 7F0857F0 46001087 */ neg.s $f2, $f2 -/* 0B81E4 7F0857F4 4602003C */ c.lt.s $f0, $f2 -.L7F0857F8: -/* 0B81E8 7F0857F8 46000306 */ mov.s $f12, $f0 -/* 0B81EC 7F0857FC 45020003 */ bc1fl .L7F08580C -/* 0B81F0 7F085800 460CA03C */ c.lt.s $f20, $f12 -/* 0B81F4 7F085804 46001306 */ mov.s $f12, $f2 -/* 0B81F8 7F085808 460CA03C */ c.lt.s $f20, $f12 -.L7F08580C: -/* 0B81FC 7F08580C 00000000 */ nop -/* 0B8200 7F085810 45000043 */ bc1f .L7F085920 -/* 0B8204 7F085814 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8208 7F085818 44814000 */ mtc1 $at, $f8 -/* 0B820C 7F08581C 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0B8210 7F085820 261019A8 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x19a8 -/* 0B8214 7F085824 460C403C */ c.lt.s $f8, $f12 -/* 0B8218 7F085828 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B821C 7F08582C 45020004 */ bc1fl .L7F085840 -/* 0B8220 7F085830 8E0D0004 */ lw $t5, 4($s0) -/* 0B8224 7F085834 44816000 */ mtc1 $at, $f12 -/* 0B8228 7F085838 00000000 */ nop -/* 0B822C 7F08583C 8E0D0004 */ lw $t5, 4($s0) -.L7F085840: -/* 0B8230 7F085840 55A0000E */ bnezl $t5, .L7F08587C -/* 0B8234 7F085844 8E040004 */ lw $a0, 4($s0) -/* 0B8238 7F085848 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B823C 7F08584C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8240 7F085850 14400009 */ bnez $v0, .L7F085878 -/* 0B8244 7F085854 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0B8248 7F085858 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B824C 7F08585C 3C068003 */ lui $a2, %hi(SFX_80036458 + 4) # $a2, 0x8003 -/* 0B8250 7F085860 24C619AC */ addiu $a2, %lo(SFX_80036458 + 4) # addiu $a2, $a2, 0x19ac -/* 0B8254 7F085864 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B8258 7F085868 2405003E */ li $a1, 62 -/* 0B825C 7F08586C 0C00209A */ jal sndPlaySfx -/* 0B8260 7F085870 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8264 7F085874 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085878: -/* 0B8268 7F085878 8E040004 */ lw $a0, 4($s0) -.L7F08587C: -/* 0B826C 7F08587C 3C018005 */ lui $at, %hi(D_800551EC) # $at, 0x8005 -/* 0B8270 7F085880 24050008 */ li $a1, 8 -/* 0B8274 7F085884 50800034 */ beql $a0, $zero, .L7F085958 -/* 0B8278 7F085888 8E0E0000 */ lw $t6, ($s0) -/* 0B827C 7F08588C C420ADC0 */ lwc1 $f0, %lo(D_800551EC)($at) -/* 0B8280 7F085890 24067FFF */ li $a2, 32767 -/* 0B8284 7F085894 3C018005 */ lui $at, %hi(D_800551F4) -/* 0B8288 7F085898 4600603C */ c.lt.s $f12, $f0 -/* 0B828C 7F08589C 00000000 */ nop -/* 0B8290 7F0858A0 45000009 */ bc1f .L7F0858C8 -/* 0B8294 7F0858A4 00000000 */ nop -/* 0B8298 7F0858A8 3C018005 */ lui $at, %hi(D_800551F0) # $at, 0x8005 -/* 0B829C 7F0858AC C424ADC4 */ lwc1 $f4, %lo(D_800551F0)($at) -/* 0B82A0 7F0858B0 46046182 */ mul.s $f6, $f12, $f4 -/* 0B82A4 7F0858B4 46003283 */ div.s $f10, $f6, $f0 -/* 0B82A8 7F0858B8 4600520D */ trunc.w.s $f8, $f10 -/* 0B82AC 7F0858BC 44064000 */ mfc1 $a2, $f8 -/* 0B82B0 7F0858C0 10000013 */ b .L7F085910 -/* 0B82B4 7F0858C4 00000000 */ nop -.L7F0858C8: -/* 0B82B8 7F0858C8 C424ADC8 */ lwc1 $f4, %lo(D_800551F4)($at) -/* 0B82BC 7F0858CC 3C018005 */ lui $at, %hi(D_800551F8) # $at, 0x8005 -/* 0B82C0 7F0858D0 4604603C */ c.lt.s $f12, $f4 -/* 0B82C4 7F0858D4 00000000 */ nop -/* 0B82C8 7F0858D8 4500000D */ bc1f .L7F085910 -/* 0B82CC 7F0858DC 00000000 */ nop -/* 0B82D0 7F0858E0 46006181 */ sub.s $f6, $f12, $f0 -/* 0B82D4 7F0858E4 C42AADCC */ lwc1 $f10, %lo(D_800551F8)($at) -/* 0B82D8 7F0858E8 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0B82DC 7F0858EC 44812000 */ mtc1 $at, $f4 -/* 0B82E0 7F0858F0 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B82E4 7F0858F4 3C018005 */ lui $at, %hi(D_800551FC) # $at, 0x8005 -/* 0B82E8 7F0858F8 C42AADD0 */ lwc1 $f10, %lo(D_800551FC)($at) -/* 0B82EC 7F0858FC 46044183 */ div.s $f6, $f8, $f4 -/* 0B82F0 7F085900 460A3200 */ add.s $f8, $f6, $f10 -/* 0B82F4 7F085904 4600410D */ trunc.w.s $f4, $f8 -/* 0B82F8 7F085908 44062000 */ mfc1 $a2, $f4 -/* 0B82FC 7F08590C 00000000 */ nop -.L7F085910: -/* 0B8300 7F085910 0C002179 */ jal sndCreatePostEvent -/* 0B8304 7F085914 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8308 7F085918 1000000E */ b .L7F085954 -/* 0B830C 7F08591C C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085920: -/* 0B8310 7F085920 3C108003 */ lui $s0, %hi(SFX_80036458) # $s0, 0x8003 -/* 0B8314 7F085924 261019A8 */ addiu $s0, %lo(SFX_80036458) # addiu $s0, $s0, 0x19a8 -/* 0B8318 7F085928 8E040004 */ lw $a0, 4($s0) -/* 0B831C 7F08592C 5080000A */ beql $a0, $zero, .L7F085958 -/* 0B8320 7F085930 8E0E0000 */ lw $t6, ($s0) -/* 0B8324 7F085934 0C002094 */ jal sndGetPlayingState -/* 0B8328 7F085938 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B832C 7F08593C 10400005 */ beqz $v0, .L7F085954 -/* 0B8330 7F085940 C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0B8334 7F085944 8E040004 */ lw $a0, 4($s0) -/* 0B8338 7F085948 0C002120 */ jal sndDeactivate -/* 0B833C 7F08594C E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8340 7F085950 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F085954: -/* 0B8344 7F085954 8E0E0000 */ lw $t6, ($s0) -.L7F085958: -/* 0B8348 7F085958 55C0000D */ bnezl $t6, .L7F085990 -/* 0B834C 7F08595C 8E040000 */ lw $a0, ($s0) -/* 0B8350 7F085960 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B8354 7F085964 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8358 7F085968 14400008 */ bnez $v0, .L7F08598C -/* 0B835C 7F08596C C7AC0244 */ lwc1 $f12, 0x244($sp) -/* 0B8360 7F085970 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B8364 7F085974 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B8368 7F085978 24050041 */ li $a1, 65 -/* 0B836C 7F08597C 02003025 */ move $a2, $s0 -/* 0B8370 7F085980 0C00209A */ jal sndPlaySfx -/* 0B8374 7F085984 E7AC0244 */ swc1 $f12, 0x244($sp) -/* 0B8378 7F085988 C7AC0244 */ lwc1 $f12, 0x244($sp) -.L7F08598C: -/* 0B837C 7F08598C 8E040000 */ lw $a0, ($s0) -.L7F085990: -/* 0B8380 7F085990 1080001A */ beqz $a0, .L7F0859FC -/* 0B8384 7F085994 3C028007 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8007 -/* 0B8388 7F085998 24428494 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x7b6c -/* 0B838C 7F08599C 240A7FFF */ li $t2, 32767 -/* 0B8390 7F0859A0 AC4A0000 */ sw $t2, ($v0) -/* 0B8394 7F0859A4 3C018005 */ lui $at, %hi(D_80055200) # $at, 0x8005 -/* 0B8398 7F0859A8 C426ADD4 */ lwc1 $f6, %lo(D_80055200)($at) -/* 0B839C 7F0859AC 3C018005 */ lui $at, %hi(D_80055204) # $at, 0x8005 -/* 0B83A0 7F0859B0 24050008 */ li $a1, 8 -/* 0B83A4 7F0859B4 4606603C */ c.lt.s $f12, $f6 -/* 0B83A8 7F0859B8 00000000 */ nop -/* 0B83AC 7F0859BC 4500000D */ bc1f .L7F0859F4 -/* 0B83B0 7F0859C0 00000000 */ nop -/* 0B83B4 7F0859C4 C42AADD8 */ lwc1 $f10, %lo(D_80055204)($at) -/* 0B83B8 7F0859C8 3C018005 */ lui $at, %hi(D_80055208) # $at, 0x8005 -/* 0B83BC 7F0859CC C424ADDC */ lwc1 $f4, %lo(D_80055208)($at) -/* 0B83C0 7F0859D0 460A6202 */ mul.s $f8, $f12, $f10 -/* 0B83C4 7F0859D4 3C018005 */ lui $at, %hi(D_8005520C) # $at, 0x8005 -/* 0B83C8 7F0859D8 C42AADE0 */ lwc1 $f10, %lo(D_8005520C)($at) -/* 0B83CC 7F0859DC 46044183 */ div.s $f6, $f8, $f4 -/* 0B83D0 7F0859E0 460A3200 */ add.s $f8, $f6, $f10 -/* 0B83D4 7F0859E4 4600410D */ trunc.w.s $f4, $f8 -/* 0B83D8 7F0859E8 44182000 */ mfc1 $t8, $f4 -/* 0B83DC 7F0859EC 00000000 */ nop -/* 0B83E0 7F0859F0 AC580000 */ sw $t8, ($v0) -.L7F0859F4: -/* 0B83E4 7F0859F4 0C002179 */ jal sndCreatePostEvent -/* 0B83E8 7F0859F8 8C460000 */ lw $a2, ($v0) -.L7F0859FC: -/* 0B83EC 7F0859FC 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B83F0 7F085A00 00002025 */ move $a0, $zero -/* 0B83F4 7F085A04 24010020 */ li $at, 32 -/* 0B83F8 7F085A08 14410007 */ bne $v0, $at, .L7F085A28 -/* 0B83FC 7F085A0C 3C048004 */ lui $a0, %hi(g_ClockTimer) # $a0, 0x8004 -/* 0B8400 7F085A10 8E280000 */ lw $t0, ($s1) -/* 0B8404 7F085A14 3C018005 */ lui $at, %hi(D_80055210) # $at, 0x8005 -/* 0B8408 7F085A18 C426ADE4 */ lwc1 $f6, %lo(D_80055210)($at) -/* 0B840C 7F085A1C C5022A00 */ lwc1 $f2, 0x2a00($t0) -/* 0B8410 7F085A20 10000004 */ b .L7F085A34 -/* 0B8414 7F085A24 46061080 */ add.s $f2, $f2, $f6 -.L7F085A28: -/* 0B8418 7F085A28 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0B841C 7F085A2C C42219BC */ lwc1 $f2, %lo(g_TankTurretVerticalAngle)($at) -/* 0B8420 7F085A30 8E280000 */ lw $t0, ($s1) -.L7F085A34: -/* 0B8424 7F085A34 3C018005 */ lui $at, %hi(D_80055214) # $at, 0x8005 -/* 0B8428 7F085A38 C420ADE8 */ lwc1 $f0, %lo(D_80055214)($at) -/* 0B842C 7F085A3C 3C018005 */ lui $at, %hi(D_80055218) # $at, 0x8005 -/* 0B8430 7F085A40 4602003C */ c.lt.s $f0, $f2 -/* 0B8434 7F085A44 00000000 */ nop -/* 0B8438 7F085A48 45000002 */ bc1f .L7F085A54 -/* 0B843C 7F085A4C 00000000 */ nop -/* 0B8440 7F085A50 46000086 */ mov.s $f2, $f0 -.L7F085A54: -/* 0B8444 7F085A54 C420ADEC */ lwc1 $f0, %lo(D_80055218)($at) -/* 0B8448 7F085A58 4600103C */ c.lt.s $f2, $f0 -/* 0B844C 7F085A5C 00000000 */ nop -/* 0B8450 7F085A60 45000002 */ bc1f .L7F085A6C -/* 0B8454 7F085A64 00000000 */ nop -/* 0B8458 7F085A68 46000086 */ mov.s $f2, $f0 -.L7F085A6C: -/* 0B845C 7F085A6C 8C840FF4 */ lw $a0, %lo(g_ClockTimer)($a0) -/* 0B8460 7F085A70 00001025 */ move $v0, $zero -/* 0B8464 7F085A74 18800014 */ blez $a0, .L7F085AC8 -/* 0B8468 7F085A78 3C018005 */ lui $at, %hi(D_8005521C) # $at, 0x8005 -/* 0B846C 7F085A7C 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) # $v1, 0x8003 -/* 0B8470 7F085A80 246319C0 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x19c0 -/* 0B8474 7F085A84 C420ADF0 */ lwc1 $f0, %lo(D_8005521C)($at) -/* 0B8478 7F085A88 C4700000 */ lwc1 $f16, ($v1) -/* 0B847C 7F085A8C 24420001 */ addiu $v0, $v0, 1 -/* 0B8480 7F085A90 0044082A */ slt $at, $v0, $a0 -/* 0B8484 7F085A94 46100482 */ mul.s $f18, $f0, $f16 -/* 0B8488 7F085A98 5020000A */ beql $at, $zero, .L7F085AC4 -/* 0B848C 7F085A9C 46029400 */ add.s $f16, $f18, $f2 -/* 0B8490 7F085AA0 46029400 */ add.s $f16, $f18, $f2 -.L7F085AA4: -/* 0B8494 7F085AA4 24420001 */ addiu $v0, $v0, 1 -/* 0B8498 7F085AA8 0044082A */ slt $at, $v0, $a0 -/* 0B849C 7F085AAC E4700000 */ swc1 $f16, ($v1) -/* 0B84A0 7F085AB0 C4700000 */ lwc1 $f16, ($v1) -/* 0B84A4 7F085AB4 46100482 */ mul.s $f18, $f0, $f16 -/* 0B84A8 7F085AB8 5420FFFA */ bnezl $at, .L7F085AA4 -/* 0B84AC 7F085ABC 46029400 */ add.s $f16, $f18, $f2 -/* 0B84B0 7F085AC0 46029400 */ add.s $f16, $f18, $f2 -.L7F085AC4: -/* 0B84B4 7F085AC4 E4700000 */ swc1 $f16, ($v1) -.L7F085AC8: -/* 0B84B8 7F085AC8 3C038003 */ lui $v1, %hi(g_TankTurretVerticalAngleRelated) # $v1, 0x8003 -/* 0B84BC 7F085ACC 246319C0 */ addiu $v1, %lo(g_TankTurretVerticalAngleRelated) # addiu $v1, $v1, 0x19c0 -/* 0B84C0 7F085AD0 3C018005 */ lui $at, %hi(D_80055220) # $at, 0x8005 -/* 0B84C4 7F085AD4 C42AADF4 */ lwc1 $f10, %lo(D_80055220)($at) -/* 0B84C8 7F085AD8 C4660000 */ lwc1 $f6, ($v1) -/* 0B84CC 7F085ADC 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0B84D0 7F085AE0 460A3202 */ mul.s $f8, $f6, $f10 -/* 0B84D4 7F085AE4 E42819BC */ swc1 $f8, %lo(g_TankTurretVerticalAngle)($at) -.L7F085AE8: -/* 0B84D8 7F085AE8 3C013F40 */ li $at, 0x3F400000 # 0.750000 -.L7F085AEC: -/* 0B84DC 7F085AEC 44810000 */ mtc1 $at, $f0 -/* 0B84E0 7F085AF0 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B84E4 7F085AF4 C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B84E8 7F085AF8 3C018005 */ lui $at, %hi(D_80055224) # $at, 0x8005 -/* 0B84EC 7F085AFC C42AADF8 */ lwc1 $f10, %lo(D_80055224)($at) -/* 0B84F0 7F085B00 46040182 */ mul.s $f6, $f0, $f4 -/* 0B84F4 7F085B04 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0B84F8 7F085B08 4406A000 */ mfc1 $a2, $f20 -/* 0B84FC 7F085B0C 4600A306 */ mov.s $f12, $f20 -/* 0B8500 7F085B10 460A3203 */ div.s $f8, $f6, $f10 -/* 0B8504 7F085B14 46082181 */ sub.s $f6, $f4, $f8 -/* 0B8508 7F085B18 E506019C */ swc1 $f6, 0x19c($t0) -/* 0B850C 7F085B1C 8E280000 */ lw $t0, ($s1) -/* 0B8510 7F085B20 C50A019C */ lwc1 $f10, 0x19c($t0) -/* 0B8514 7F085B24 4614503C */ c.lt.s $f10, $f20 -/* 0B8518 7F085B28 00000000 */ nop -/* 0B851C 7F085B2C 45000002 */ bc1f .L7F085B38 -/* 0B8520 7F085B30 00000000 */ nop -/* 0B8524 7F085B34 E514019C */ swc1 $f20, 0x19c($t0) -.L7F085B38: -/* 0B8528 7F085B38 0FC202F6 */ jal bondviewMoveAnimationTick -/* 0B852C 7F085B3C 4600A386 */ mov.s $f14, $f20 -/* 0B8530 7F085B40 3C018005 */ lui $at, %hi(D_80055228) # $at, 0x8005 -/* 0B8534 7F085B44 C424ADFC */ lwc1 $f4, %lo(D_80055228)($at) -/* 0B8538 7F085B48 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B853C 7F085B4C C42819B4 */ lwc1 $f8, %lo(g_TankOrientationAngle)($at) -/* 0B8540 7F085B50 0FC1606B */ jal sinf -/* 0B8544 7F085B54 46082301 */ sub.s $f12, $f4, $f8 -/* 0B8548 7F085B58 8E2C0000 */ lw $t4, ($s1) -/* 0B854C 7F085B5C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B8550 7F085B60 C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B8554 7F085B64 C5860174 */ lwc1 $f6, 0x174($t4) -/* 0B8558 7F085B68 3C018005 */ lui $at, %hi(D_8005522C) # $at, 0x8005 -/* 0B855C 7F085B6C 46003282 */ mul.s $f10, $f6, $f0 -/* 0B8560 7F085B70 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0B8564 7F085B74 46045202 */ mul.s $f8, $f10, $f4 -/* 0B8568 7F085B78 C424AE00 */ lwc1 $f4, %lo(D_8005522C)($at) -/* 0B856C 7F085B7C 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B8570 7F085B80 46083280 */ add.s $f10, $f6, $f8 -/* 0B8574 7F085B84 C42619B4 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0B8578 7F085B88 E7AA03AC */ swc1 $f10, 0x3ac($sp) -/* 0B857C 7F085B8C 0FC16068 */ jal cosf -/* 0B8580 7F085B90 46062301 */ sub.s $f12, $f4, $f6 -/* 0B8584 7F085B94 8E2D0000 */ lw $t5, ($s1) -/* 0B8588 7F085B98 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B858C 7F085B9C C4241004 */ lwc1 $f4, %lo(g_GlobalTimerDelta)($at) -/* 0B8590 7F085BA0 C5A80174 */ lwc1 $f8, 0x174($t5) -/* 0B8594 7F085BA4 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B8598 7F085BA8 24050001 */ li $a1, 1 -/* 0B859C 7F085BAC 46004282 */ mul.s $f10, $f8, $f0 -/* 0B85A0 7F085BB0 C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0B85A4 7F085BB4 46045182 */ mul.s $f6, $f10, $f4 -/* 0B85A8 7F085BB8 46064280 */ add.s $f10, $f8, $f6 -/* 0B85AC 7F085BBC 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B85B0 7F085BC0 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0B85B4 7F085BC4 3C0F8007 */ lui $t7, %hi(g_EnterTankAudioState) # $t7, 0x8007 -/* 0B85B8 7F085BC8 8DEF8498 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0B85BC 7F085BCC 24010002 */ li $at, 2 -/* 0B85C0 7F085BD0 3C198004 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8004 -/* 0B85C4 7F085BD4 55E10237 */ bnel $t7, $at, .L7F0864B4 -/* 0B85C8 7F085BD8 8E280000 */ lw $t0, ($s1) -/* 0B85CC 7F085BDC 8F390FF4 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 0B85D0 7F085BE0 5B200234 */ blezl $t9, .L7F0864B4 -/* 0B85D4 7F085BE4 8E280000 */ lw $t0, ($s1) -/* 0B85D8 7F085BE8 8E280000 */ lw $t0, ($s1) -/* 0B85DC 7F085BEC 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B85E0 7F085BF0 C42E1004 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0B85E4 7F085BF4 C504048C */ lwc1 $f4, 0x48c($t0) -/* 0B85E8 7F085BF8 C5080408 */ lwc1 $f8, 0x408($t0) -/* 0B85EC 7F085BFC C50A0494 */ lwc1 $f10, 0x494($t0) -/* 0B85F0 7F085C00 46082181 */ sub.s $f6, $f4, $f8 -/* 0B85F4 7F085C04 C5040410 */ lwc1 $f4, 0x410($t0) -/* 0B85F8 7F085C08 46045201 */ sub.s $f8, $f10, $f4 -/* 0B85FC 7F085C0C 460E3003 */ div.s $f0, $f6, $f14 -/* 0B8600 7F085C10 460E4083 */ div.s $f2, $f8, $f14 -/* 0B8604 7F085C14 46000182 */ mul.s $f6, $f0, $f0 -/* 0B8608 7F085C18 00000000 */ nop -/* 0B860C 7F085C1C 46021282 */ mul.s $f10, $f2, $f2 -/* 0B8610 7F085C20 0C007614 */ jal sqrtf -/* 0B8614 7F085C24 460A3300 */ add.s $f12, $f6, $f10 -/* 0B8618 7F085C28 8E280000 */ lw $t0, ($s1) -/* 0B861C 7F085C2C 46000086 */ mov.s $f2, $f0 -/* 0B8620 7F085C30 C5040174 */ lwc1 $f4, 0x174($t0) -/* 0B8624 7F085C34 4614203C */ c.lt.s $f4, $f20 -/* 0B8628 7F085C38 00000000 */ nop -/* 0B862C 7F085C3C 45000002 */ bc1f .L7F085C48 -/* 0B8630 7F085C40 00000000 */ nop -/* 0B8634 7F085C44 46000087 */ neg.s $f2, $f0 -.L7F085C48: -/* 0B8638 7F085C48 10000219 */ b .L7F0864B0 -/* 0B863C 7F085C4C E5020174 */ swc1 $f2, 0x174($t0) -.L7F085C50: -/* 0B8640 7F085C50 8E040000 */ lw $a0, ($s0) -/* 0B8644 7F085C54 5080001A */ beql $a0, $zero, .L7F085CC0 -/* 0B8648 7F085C58 8E040004 */ lw $a0, 4($s0) -/* 0B864C 7F085C5C 0C002094 */ jal sndGetPlayingState -/* 0B8650 7F085C60 00000000 */ nop -/* 0B8654 7F085C64 10400015 */ beqz $v0, .L7F085CBC -/* 0B8658 7F085C68 3C01447A */ li $at, 0x447A0000 # 1000.000000 -/* 0B865C 7F085C6C 44814000 */ mtc1 $at, $f8 -/* 0B8660 7F085C70 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B8664 7F085C74 C4261004 */ lwc1 $f6, %lo(g_GlobalTimerDelta)($at) -/* 0B8668 7F085C78 3C028007 */ lui $v0, %hi(g_TankEngineSfxVolume) # $v0, 0x8007 -/* 0B866C 7F085C7C 24428494 */ addiu $v0, %lo(g_TankEngineSfxVolume) # addiu $v0, $v0, -0x7b6c -/* 0B8670 7F085C80 46064282 */ mul.s $f10, $f8, $f6 -/* 0B8674 7F085C84 8C4B0000 */ lw $t3, ($v0) -/* 0B8678 7F085C88 24050008 */ li $a1, 8 -/* 0B867C 7F085C8C 4600510D */ trunc.w.s $f4, $f10 -/* 0B8680 7F085C90 440A2000 */ mfc1 $t2, $f4 -/* 0B8684 7F085C94 00000000 */ nop -/* 0B8688 7F085C98 016A3023 */ subu $a2, $t3, $t2 -/* 0B868C 7F085C9C 18C00005 */ blez $a2, .L7F085CB4 -/* 0B8690 7F085CA0 AC460000 */ sw $a2, ($v0) -/* 0B8694 7F085CA4 0C002179 */ jal sndCreatePostEvent -/* 0B8698 7F085CA8 8E040000 */ lw $a0, ($s0) -/* 0B869C 7F085CAC 10000004 */ b .L7F085CC0 -/* 0B86A0 7F085CB0 8E040004 */ lw $a0, 4($s0) -.L7F085CB4: -/* 0B86A4 7F085CB4 0C002120 */ jal sndDeactivate -/* 0B86A8 7F085CB8 8E040000 */ lw $a0, ($s0) -.L7F085CBC: -/* 0B86AC 7F085CBC 8E040004 */ lw $a0, 4($s0) -.L7F085CC0: -/* 0B86B0 7F085CC0 10800007 */ beqz $a0, .L7F085CE0 -/* 0B86B4 7F085CC4 00000000 */ nop -/* 0B86B8 7F085CC8 0C002094 */ jal sndGetPlayingState -/* 0B86BC 7F085CCC 00000000 */ nop -/* 0B86C0 7F085CD0 10400003 */ beqz $v0, .L7F085CE0 -/* 0B86C4 7F085CD4 00000000 */ nop -/* 0B86C8 7F085CD8 0C002120 */ jal sndDeactivate -/* 0B86CC 7F085CDC 8E040004 */ lw $a0, 4($s0) -.L7F085CE0: -/* 0B86D0 7F085CE0 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B86D4 7F085CE4 C42E1004 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0B86D8 7F085CE8 3C018003 */ lui $at, %hi(g_BondMoveAnimationSetup + 36) # $at, 0x8003 -/* 0B86DC 7F085CEC C4282034 */ lwc1 $f8, %lo(g_BondMoveAnimationSetup + 36)($at) -/* 0B86E0 7F085CF0 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0B86E4 7F085CF4 44813000 */ mtc1 $at, $f6 -/* 0B86E8 7F085CF8 8E280000 */ lw $t0, ($s1) -/* 0B86EC 7F085CFC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0B86F0 7F085D00 46064282 */ mul.s $f10, $f8, $f6 -/* 0B86F4 7F085D04 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0B86F8 7F085D08 E7A4004C */ swc1 $f4, 0x4c($sp) -/* 0B86FC 7F085D0C C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 0B8700 7F085D10 460E5302 */ mul.s $f12, $f10, $f14 -/* 0B8704 7F085D14 00000000 */ nop -/* 0B8708 7F085D18 460C4182 */ mul.s $f6, $f8, $f12 -/* 0B870C 7F085D1C E7A603A0 */ swc1 $f6, 0x3a0($sp) -/* 0B8710 7F085D20 C500126C */ lwc1 $f0, 0x126c($t0) -/* 0B8714 7F085D24 C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0B8718 7F085D28 C5061270 */ lwc1 $f6, 0x1270($t0) -/* 0B871C 7F085D2C 46000107 */ neg.s $f4, $f0 -/* 0B8720 7F085D30 C5080498 */ lwc1 $f8, 0x498($t0) -/* 0B8724 7F085D34 46045402 */ mul.s $f16, $f10, $f4 -/* 0B8728 7F085D38 46068281 */ sub.s $f10, $f16, $f6 -/* 0B872C 7F085D3C 46004482 */ mul.s $f18, $f8, $f0 -/* 0B8730 7F085D40 E7AA0220 */ swc1 $f10, 0x220($sp) -/* 0B8734 7F085D44 C5041274 */ lwc1 $f4, 0x1274($t0) -/* 0B8738 7F085D48 C7A60220 */ lwc1 $f6, 0x220($sp) -/* 0B873C 7F085D4C 46049201 */ sub.s $f8, $f18, $f4 -/* 0B8740 7F085D50 46063282 */ mul.s $f10, $f6, $f6 -/* 0B8744 7F085D54 E7A8021C */ swc1 $f8, 0x21c($sp) -/* 0B8748 7F085D58 C7A4021C */ lwc1 $f4, 0x21c($sp) -/* 0B874C 7F085D5C 46042202 */ mul.s $f8, $f4, $f4 -/* 0B8750 7F085D60 46085080 */ add.s $f2, $f10, $f8 -/* 0B8754 7F085D64 44815000 */ mtc1 $at, $f10 -/* 0B8758 7F085D68 00000000 */ nop -/* 0B875C 7F085D6C 4602503E */ c.le.s $f10, $f2 -/* 0B8760 7F085D70 E7A20218 */ swc1 $f2, 0x218($sp) -/* 0B8764 7F085D74 45000008 */ bc1f .L7F085D98 -/* 0B8768 7F085D78 00000000 */ nop -/* 0B876C 7F085D7C 3C018005 */ lui $at, %hi(D_80055230) # $at, 0x8005 -/* 0B8770 7F085D80 C420AE04 */ lwc1 $f0, %lo(D_80055230)($at) -/* 0B8774 7F085D84 46003202 */ mul.s $f8, $f6, $f0 -/* 0B8778 7F085D88 00000000 */ nop -/* 0B877C 7F085D8C 46002282 */ mul.s $f10, $f4, $f0 -/* 0B8780 7F085D90 E7A80220 */ swc1 $f8, 0x220($sp) -/* 0B8784 7F085D94 E7AA021C */ swc1 $f10, 0x21c($sp) -.L7F085D98: -/* 0B8788 7F085D98 3C018005 */ lui $at, %hi(D_80055234) # $at, 0x8005 -/* 0B878C 7F085D9C C430AE08 */ lwc1 $f16, %lo(D_80055234)($at) -/* 0B8790 7F085DA0 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 0B8794 7F085DA4 C508014C */ lwc1 $f8, 0x14c($t0) -/* 0B8798 7F085DA8 C5020174 */ lwc1 $f2, 0x174($t0) -/* 0B879C 7F085DAC 46103002 */ mul.s $f0, $f6, $f16 -/* 0B87A0 7F085DB0 4614003C */ c.lt.s $f0, $f20 -/* 0B87A4 7F085DB4 46104302 */ mul.s $f12, $f8, $f16 -/* 0B87A8 7F085DB8 45020003 */ bc1fl .L7F085DC8 -/* 0B87AC 7F085DBC 4614103C */ c.lt.s $f2, $f20 -/* 0B87B0 7F085DC0 46000007 */ neg.s $f0, $f0 -/* 0B87B4 7F085DC4 4614103C */ c.lt.s $f2, $f20 -.L7F085DC8: -/* 0B87B8 7F085DC8 3C018005 */ lui $at, %hi(D_80055238) # $at, 0x8005 -/* 0B87BC 7F085DCC 45020003 */ bc1fl .L7F085DDC -/* 0B87C0 7F085DD0 4614603C */ c.lt.s $f12, $f20 -/* 0B87C4 7F085DD4 46001087 */ neg.s $f2, $f2 -/* 0B87C8 7F085DD8 4614603C */ c.lt.s $f12, $f20 -.L7F085DDC: -/* 0B87CC 7F085DDC 00000000 */ nop -/* 0B87D0 7F085DE0 45020003 */ bc1fl .L7F085DF0 -/* 0B87D4 7F085DE4 4600103C */ c.lt.s $f2, $f0 -/* 0B87D8 7F085DE8 46006307 */ neg.s $f12, $f12 -/* 0B87DC 7F085DEC 4600103C */ c.lt.s $f2, $f0 -.L7F085DF0: -/* 0B87E0 7F085DF0 E7A20398 */ swc1 $f2, 0x398($sp) -/* 0B87E4 7F085DF4 45020003 */ bc1fl .L7F085E04 -/* 0B87E8 7F085DF8 C7A20398 */ lwc1 $f2, 0x398($sp) -/* 0B87EC 7F085DFC E7A00398 */ swc1 $f0, 0x398($sp) -/* 0B87F0 7F085E00 C7A20398 */ lwc1 $f2, 0x398($sp) -.L7F085E04: -/* 0B87F4 7F085E04 C7A40218 */ lwc1 $f4, 0x218($sp) -/* 0B87F8 7F085E08 460C103C */ c.lt.s $f2, $f12 -/* 0B87FC 7F085E0C 00000000 */ nop -/* 0B8800 7F085E10 45000002 */ bc1f .L7F085E1C -/* 0B8804 7F085E14 00000000 */ nop -/* 0B8808 7F085E18 46006086 */ mov.s $f2, $f12 -.L7F085E1C: -/* 0B880C 7F085E1C C42AAE0C */ lwc1 $f10, %lo(D_80055238)($at) -/* 0B8810 7F085E20 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0B8814 7F085E24 44810000 */ mtc1 $at, $f0 -/* 0B8818 7F085E28 4604503E */ c.le.s $f10, $f4 -/* 0B881C 7F085E2C 00000000 */ nop -/* 0B8820 7F085E30 45020007 */ bc1fl .L7F085E50 -/* 0B8824 7F085E34 4602003E */ c.le.s $f0, $f2 -/* 0B8828 7F085E38 4610103C */ c.lt.s $f2, $f16 -/* 0B882C 7F085E3C 00000000 */ nop -/* 0B8830 7F085E40 45020003 */ bc1fl .L7F085E50 -/* 0B8834 7F085E44 4602003E */ c.le.s $f0, $f2 -/* 0B8838 7F085E48 46008086 */ mov.s $f2, $f16 -/* 0B883C 7F085E4C 4602003E */ c.le.s $f0, $f2 -.L7F085E50: -/* 0B8840 7F085E50 00000000 */ nop -/* 0B8844 7F085E54 4502000C */ bc1fl .L7F085E88 -/* 0B8848 7F085E58 46020101 */ sub.s $f4, $f0, $f2 -/* 0B884C 7F085E5C 46001181 */ sub.s $f6, $f2, $f0 -/* 0B8850 7F085E60 3C014461 */ li $at, 0x44610000 # 900.000000 -/* 0B8854 7F085E64 44812000 */ mtc1 $at, $f4 -/* 0B8858 7F085E68 460E3202 */ mul.s $f8, $f6, $f14 -/* 0B885C 7F085E6C C506019C */ lwc1 $f6, 0x19c($t0) -/* 0B8860 7F085E70 46044283 */ div.s $f10, $f8, $f4 -/* 0B8864 7F085E74 460A3200 */ add.s $f8, $f6, $f10 -/* 0B8868 7F085E78 E508019C */ swc1 $f8, 0x19c($t0) -/* 0B886C 7F085E7C 1000000A */ b .L7F085EA8 -/* 0B8870 7F085E80 E7A20398 */ swc1 $f2, 0x398($sp) -/* 0B8874 7F085E84 46020101 */ sub.s $f4, $f0, $f2 -.L7F085E88: -/* 0B8878 7F085E88 3C018005 */ lui $at, %hi(D_8005523C) # $at, 0x8005 -/* 0B887C 7F085E8C C42AAE10 */ lwc1 $f10, %lo(D_8005523C)($at) -/* 0B8880 7F085E90 460E2182 */ mul.s $f6, $f4, $f14 -/* 0B8884 7F085E94 C504019C */ lwc1 $f4, 0x19c($t0) -/* 0B8888 7F085E98 460A3203 */ div.s $f8, $f6, $f10 -/* 0B888C 7F085E9C 46082181 */ sub.s $f6, $f4, $f8 -/* 0B8890 7F085EA0 E506019C */ swc1 $f6, 0x19c($t0) -/* 0B8894 7F085EA4 E7A20398 */ swc1 $f2, 0x398($sp) -.L7F085EA8: -/* 0B8898 7F085EA8 8E280000 */ lw $t0, ($s1) -/* 0B889C 7F085EAC C500019C */ lwc1 $f0, 0x19c($t0) -/* 0B88A0 7F085EB0 4614003C */ c.lt.s $f0, $f20 -/* 0B88A4 7F085EB4 00000000 */ nop -/* 0B88A8 7F085EB8 45020005 */ bc1fl .L7F085ED0 -/* 0B88AC 7F085EBC 3C013F80 */ lui $at, 0x3f80 -/* 0B88B0 7F085EC0 E514019C */ swc1 $f20, 0x19c($t0) -/* 0B88B4 7F085EC4 1000000C */ b .L7F085EF8 -/* 0B88B8 7F085EC8 8E280000 */ lw $t0, ($s1) -/* 0B88BC 7F085ECC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F085ED0: -/* 0B88C0 7F085ED0 44815000 */ mtc1 $at, $f10 -/* 0B88C4 7F085ED4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B88C8 7F085ED8 4600503C */ c.lt.s $f10, $f0 -/* 0B88CC 7F085EDC 00000000 */ nop -/* 0B88D0 7F085EE0 45020006 */ bc1fl .L7F085EFC -/* 0B88D4 7F085EE4 C7AC0398 */ lwc1 $f12, 0x398($sp) -/* 0B88D8 7F085EE8 44812000 */ mtc1 $at, $f4 -/* 0B88DC 7F085EEC 00000000 */ nop -/* 0B88E0 7F085EF0 E504019C */ swc1 $f4, 0x19c($t0) -/* 0B88E4 7F085EF4 8E280000 */ lw $t0, ($s1) -.L7F085EF8: -/* 0B88E8 7F085EF8 C7AC0398 */ lwc1 $f12, 0x398($sp) -.L7F085EFC: -/* 0B88EC 7F085EFC C50E0174 */ lwc1 $f14, 0x174($t0) -/* 0B88F0 7F085F00 0FC202F6 */ jal bondviewMoveAnimationTick -/* 0B88F4 7F085F04 8FA603A0 */ lw $a2, 0x3a0($sp) -/* 0B88F8 7F085F08 8E280000 */ lw $t0, ($s1) -/* 0B88FC 7F085F0C 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B8900 7F085F10 C42E1004 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0B8904 7F085F14 C5020504 */ lwc1 $f2, 0x504($t0) -/* 0B8908 7F085F18 C5080498 */ lwc1 $f8, 0x498($t0) -/* 0B890C 7F085F1C C50004FC */ lwc1 $f0, 0x4fc($t0) -/* 0B8910 7F085F20 C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0B8914 7F085F24 46081182 */ mul.s $f6, $f2, $f8 -/* 0B8918 7F085F28 00000000 */ nop -/* 0B891C 7F085F2C 460A0102 */ mul.s $f4, $f0, $f10 -/* 0B8920 7F085F30 46043201 */ sub.s $f8, $f6, $f4 -/* 0B8924 7F085F34 C7A603AC */ lwc1 $f6, 0x3ac($sp) -/* 0B8928 7F085F38 460E4282 */ mul.s $f10, $f8, $f14 -/* 0B892C 7F085F3C 460A3100 */ add.s $f4, $f6, $f10 -/* 0B8930 7F085F40 E7A403AC */ swc1 $f4, 0x3ac($sp) -/* 0B8934 7F085F44 C50804A0 */ lwc1 $f8, 0x4a0($t0) -/* 0B8938 7F085F48 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0B893C 7F085F4C 46081182 */ mul.s $f6, $f2, $f8 -/* 0B8940 7F085F50 00000000 */ nop -/* 0B8944 7F085F54 460A0202 */ mul.s $f8, $f0, $f10 -/* 0B8948 7F085F58 46083280 */ add.s $f10, $f6, $f8 -/* 0B894C 7F085F5C C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0B8950 7F085F60 460E5182 */ mul.s $f6, $f10, $f14 -/* 0B8954 7F085F64 46064280 */ add.s $f10, $f8, $f6 -/* 0B8958 7F085F68 C7A80220 */ lwc1 $f8, 0x220($sp) -/* 0B895C 7F085F6C 46082180 */ add.s $f6, $f4, $f8 -/* 0B8960 7F085F70 C7A4021C */ lwc1 $f4, 0x21c($sp) -/* 0B8964 7F085F74 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0B8968 7F085F78 46045200 */ add.s $f8, $f10, $f4 -/* 0B896C 7F085F7C E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0B8970 7F085F80 E7A803B4 */ swc1 $f8, 0x3b4($sp) -/* 0B8974 7F085F84 C506048C */ lwc1 $f6, 0x48c($t0) -/* 0B8978 7F085F88 E7A60208 */ swc1 $f6, 0x208($sp) -/* 0B897C 7F085F8C C50A0494 */ lwc1 $f10, 0x494($t0) -/* 0B8980 7F085F90 E7AA0204 */ swc1 $f10, 0x204($sp) -/* 0B8984 7F085F94 8D0C0488 */ lw $t4, 0x488($t0) -/* 0B8988 7F085F98 0FC24134 */ jal get_debug_fast_bond_flag -/* 0B898C 7F085F9C AFAC0200 */ sw $t4, 0x200($sp) -/* 0B8990 7F085FA0 50400021 */ beql $v0, $zero, .L7F086028 -/* 0B8994 7F085FA4 8E2D0000 */ lw $t5, ($s1) -/* 0B8998 7F085FA8 8E280000 */ lw $t0, ($s1) -/* 0B899C 7F085FAC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0B89A0 7F085FB0 44810000 */ mtc1 $at, $f0 -/* 0B89A4 7F085FB4 C5040498 */ lwc1 $f4, 0x498($t0) -/* 0B89A8 7F085FB8 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B89AC 7F085FBC C50A04A0 */ lwc1 $f10, 0x4a0($t0) -/* 0B89B0 7F085FC0 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B89B4 7F085FC4 46082182 */ mul.s $f6, $f4, $f8 -/* 0B89B8 7F085FC8 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0B89BC 7F085FCC C42E1004 */ lwc1 $f14, %lo(g_GlobalTimerDelta)($at) -/* 0B89C0 7F085FD0 46045202 */ mul.s $f8, $f10, $f4 -/* 0B89C4 7F085FD4 46083281 */ sub.s $f10, $f6, $f8 -/* 0B89C8 7F085FD8 C7A803AC */ lwc1 $f8, 0x3ac($sp) -/* 0B89CC 7F085FDC 460E5102 */ mul.s $f4, $f10, $f14 -/* 0B89D0 7F085FE0 00000000 */ nop -/* 0B89D4 7F085FE4 46002182 */ mul.s $f6, $f4, $f0 -/* 0B89D8 7F085FE8 46064280 */ add.s $f10, $f8, $f6 -/* 0B89DC 7F085FEC E7AA03AC */ swc1 $f10, 0x3ac($sp) -/* 0B89E0 7F085FF0 C5080174 */ lwc1 $f8, 0x174($t0) -/* 0B89E4 7F085FF4 C50404A0 */ lwc1 $f4, 0x4a0($t0) -/* 0B89E8 7F085FF8 C50A0498 */ lwc1 $f10, 0x498($t0) -/* 0B89EC 7F085FFC 46082182 */ mul.s $f6, $f4, $f8 -/* 0B89F0 7F086000 C504016C */ lwc1 $f4, 0x16c($t0) -/* 0B89F4 7F086004 46045202 */ mul.s $f8, $f10, $f4 -/* 0B89F8 7F086008 46083280 */ add.s $f10, $f6, $f8 -/* 0B89FC 7F08600C C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0B8A00 7F086010 460E5102 */ mul.s $f4, $f10, $f14 -/* 0B8A04 7F086014 00000000 */ nop -/* 0B8A08 7F086018 46002182 */ mul.s $f6, $f4, $f0 -/* 0B8A0C 7F08601C 46064280 */ add.s $f10, $f8, $f6 -/* 0B8A10 7F086020 E7AA03B4 */ swc1 $f10, 0x3b4($sp) -/* 0B8A14 7F086024 8E2D0000 */ lw $t5, ($s1) -.L7F086028: -/* 0B8A18 7F086028 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B8A1C 7F08602C 00002825 */ move $a1, $zero -/* 0B8A20 7F086030 C5A4126C */ lwc1 $f4, 0x126c($t5) -/* 0B8A24 7F086034 4604A032 */ c.eq.s $f20, $f4 -/* 0B8A28 7F086038 00000000 */ nop -/* 0B8A2C 7F08603C 45000002 */ bc1f .L7F086048 -/* 0B8A30 7F086040 00000000 */ nop -/* 0B8A34 7F086044 24050001 */ li $a1, 1 -.L7F086048: -/* 0B8A38 7F086048 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B8A3C 7F08604C 00000000 */ nop -/* 0B8A40 7F086050 8E2F0000 */ lw $t7, ($s1) -/* 0B8A44 7F086054 3C018005 */ lui $at, %hi(D_80055240) # $at, 0x8005 -/* 0B8A48 7F086058 C426AE14 */ lwc1 $f6, %lo(D_80055240)($at) -/* 0B8A4C 7F08605C C5E804B0 */ lwc1 $f8, 0x4b0($t7) -/* 0B8A50 7F086060 27B001B4 */ addiu $s0, $sp, 0x1b4 -/* 0B8A54 7F086064 AFB00010 */ sw $s0, 0x10($sp) -/* 0B8A58 7F086068 46064282 */ mul.s $f10, $f8, $f6 -/* 0B8A5C 7F08606C 27A40200 */ addiu $a0, $sp, 0x200 -/* 0B8A60 7F086070 8FA50208 */ lw $a1, 0x208($sp) -/* 0B8A64 7F086074 8FA60204 */ lw $a2, 0x204($sp) -/* 0B8A68 7F086078 44075000 */ mfc1 $a3, $f10 -/* 0B8A6C 7F08607C 0FC2C575 */ jal stanTileDistanceRelated -/* 0B8A70 7F086080 00000000 */ nop -/* 0B8A74 7F086084 0FC2C599 */ jal stanGetLocusCount -/* 0B8A78 7F086088 02002025 */ move $a0, $s0 -/* 0B8A7C 7F08608C 10400002 */ beqz $v0, .L7F086098 -/* 0B8A80 7F086090 24190001 */ li $t9, 1 -/* 0B8A84 7F086094 AFB90394 */ sw $t9, 0x394($sp) -.L7F086098: -/* 0B8A88 7F086098 8E280000 */ lw $t0, ($s1) -/* 0B8A8C 7F08609C 3C018005 */ lui $at, %hi(D_80055244) # $at, 0x8005 -/* 0B8A90 7F0860A0 C428AE18 */ lwc1 $f8, %lo(D_80055244)($at) -/* 0B8A94 7F0860A4 C50404B0 */ lwc1 $f4, 0x4b0($t0) -/* 0B8A98 7F0860A8 8D05048C */ lw $a1, 0x48c($t0) -/* 0B8A9C 7F0860AC 8D060494 */ lw $a2, 0x494($t0) -/* 0B8AA0 7F0860B0 46082182 */ mul.s $f6, $f4, $f8 -/* 0B8AA4 7F0860B4 AFB00010 */ sw $s0, 0x10($sp) -/* 0B8AA8 7F0860B8 25040488 */ addiu $a0, $t0, 0x488 -/* 0B8AAC 7F0860BC 44073000 */ mfc1 $a3, $f6 -/* 0B8AB0 7F0860C0 0FC2C575 */ jal stanTileDistanceRelated -/* 0B8AB4 7F0860C4 00000000 */ nop -/* 0B8AB8 7F0860C8 0FC2C599 */ jal stanGetLocusCount -/* 0B8ABC 7F0860CC 02002025 */ move $a0, $s0 -/* 0B8AC0 7F0860D0 10400002 */ beqz $v0, .L7F0860DC -/* 0B8AC4 7F0860D4 240E0001 */ li $t6, 1 -/* 0B8AC8 7F0860D8 AFAE0394 */ sw $t6, 0x394($sp) -.L7F0860DC: -/* 0B8ACC 7F0860DC 8E280000 */ lw $t0, ($s1) -/* 0B8AD0 7F0860E0 8D05048C */ lw $a1, 0x48c($t0) -/* 0B8AD4 7F0860E4 8D060494 */ lw $a2, 0x494($t0) -/* 0B8AD8 7F0860E8 8D0704B0 */ lw $a3, 0x4b0($t0) -/* 0B8ADC 7F0860EC AFB00010 */ sw $s0, 0x10($sp) -/* 0B8AE0 7F0860F0 0FC2C575 */ jal stanTileDistanceRelated -/* 0B8AE4 7F0860F4 25040488 */ addiu $a0, $t0, 0x488 -/* 0B8AE8 7F0860F8 0FC2C599 */ jal stanGetLocusCount -/* 0B8AEC 7F0860FC 02002025 */ move $a0, $s0 -/* 0B8AF0 7F086100 1440000D */ bnez $v0, .L7F086138 -/* 0B8AF4 7F086104 00000000 */ nop -/* 0B8AF8 7F086108 8E2B0000 */ lw $t3, ($s1) -/* 0B8AFC 7F08610C 3C018005 */ lui $at, %hi(D_80055248) # $at, 0x8005 -/* 0B8B00 7F086110 C424AE1C */ lwc1 $f4, %lo(D_80055248)($at) -/* 0B8B04 7F086114 C56A04B0 */ lwc1 $f10, 0x4b0($t3) -/* 0B8B08 7F086118 AFB00010 */ sw $s0, 0x10($sp) -/* 0B8B0C 7F08611C 27A40200 */ addiu $a0, $sp, 0x200 -/* 0B8B10 7F086120 46045202 */ mul.s $f8, $f10, $f4 -/* 0B8B14 7F086124 8FA50208 */ lw $a1, 0x208($sp) -/* 0B8B18 7F086128 8FA60204 */ lw $a2, 0x204($sp) -/* 0B8B1C 7F08612C 44074000 */ mfc1 $a3, $f8 -/* 0B8B20 7F086130 0FC2C575 */ jal stanTileDistanceRelated -/* 0B8B24 7F086134 00000000 */ nop -.L7F086138: -/* 0B8B28 7F086138 0FC2C599 */ jal stanGetLocusCount -/* 0B8B2C 7F08613C 02002025 */ move $a0, $s0 -/* 0B8B30 7F086140 104000B8 */ beqz $v0, .L7F086424 -/* 0B8B34 7F086144 240A0001 */ li $t2, 1 -/* 0B8B38 7F086148 AFAA0394 */ sw $t2, 0x394($sp) -/* 0B8B3C 7F08614C 27A40174 */ addiu $a0, $sp, 0x174 -/* 0B8B40 7F086150 27A50170 */ addiu $a1, $sp, 0x170 -/* 0B8B44 7F086154 0FC2C5B8 */ jal stanGetMoveBondCollisionTiles -/* 0B8B48 7F086158 27A60184 */ addiu $a2, $sp, 0x184 -/* 0B8B4C 7F08615C 8E380000 */ lw $t8, ($s1) -/* 0B8B50 7F086160 C7A601A0 */ lwc1 $f6, 0x1a0($sp) -/* 0B8B54 7F086164 C70A0074 */ lwc1 $f10, 0x74($t8) -/* 0B8B58 7F086168 4606503E */ c.le.s $f10, $f6 -/* 0B8B5C 7F08616C C7A60198 */ lwc1 $f6, 0x198($sp) -/* 0B8B60 7F086170 C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 0B8B64 7F086174 450200AC */ bc1fl .L7F086428 -/* 0B8B68 7F086178 8E280000 */ lw $t0, ($s1) -/* 0B8B6C 7F08617C C7A40184 */ lwc1 $f4, 0x184($sp) -/* 0B8B70 7F086180 C7A80190 */ lwc1 $f8, 0x190($sp) -/* 0B8B74 7F086184 460A3381 */ sub.s $f14, $f6, $f10 -/* 0B8B78 7F086188 46082081 */ sub.s $f2, $f4, $f8 -/* 0B8B7C 7F08618C 460E7102 */ mul.s $f4, $f14, $f14 -/* 0B8B80 7F086190 E7AE016C */ swc1 $f14, 0x16c($sp) -/* 0B8B84 7F086194 46021202 */ mul.s $f8, $f2, $f2 -/* 0B8B88 7F086198 E7A20168 */ swc1 $f2, 0x168($sp) -/* 0B8B8C 7F08619C 0C007614 */ jal sqrtf -/* 0B8B90 7F0861A0 46082300 */ add.s $f12, $f4, $f8 -/* 0B8B94 7F0861A4 C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0B8B98 7F0861A8 C7AE016C */ lwc1 $f14, 0x16c($sp) -/* 0B8B9C 7F0861AC C7A60204 */ lwc1 $f6, 0x204($sp) -/* 0B8BA0 7F0861B0 46001083 */ div.s $f2, $f2, $f0 -/* 0B8BA4 7F0861B4 C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 0B8BA8 7F0861B8 E7A60030 */ swc1 $f6, 0x30($sp) -/* 0B8BAC 7F0861BC 460A3101 */ sub.s $f4, $f6, $f10 -/* 0B8BB0 7F0861C0 C7A60184 */ lwc1 $f6, 0x184($sp) -/* 0B8BB4 7F0861C4 E7AA0034 */ swc1 $f10, 0x34($sp) -/* 0B8BB8 7F0861C8 46007383 */ div.s $f14, $f14, $f0 -/* 0B8BBC 7F0861CC 46022202 */ mul.s $f8, $f4, $f2 -/* 0B8BC0 7F0861D0 C7A40208 */ lwc1 $f4, 0x208($sp) -/* 0B8BC4 7F0861D4 46062281 */ sub.s $f10, $f4, $f6 -/* 0B8BC8 7F0861D8 460E5282 */ mul.s $f10, $f10, $f14 -/* 0B8BCC 7F0861DC 460A4300 */ add.s $f12, $f8, $f10 -/* 0B8BD0 7F0861E0 C7AA0030 */ lwc1 $f10, 0x30($sp) -/* 0B8BD4 7F0861E4 C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0B8BD8 7F0861E8 E7AC0050 */ swc1 $f12, 0x50($sp) -/* 0B8BDC 7F0861EC 46085280 */ add.s $f10, $f10, $f8 -/* 0B8BE0 7F0861F0 C7A80034 */ lwc1 $f8, 0x34($sp) -/* 0B8BE4 7F0861F4 46085281 */ sub.s $f10, $f10, $f8 -/* 0B8BE8 7F0861F8 46025202 */ mul.s $f8, $f10, $f2 -/* 0B8BEC 7F0861FC C7AA03AC */ lwc1 $f10, 0x3ac($sp) -/* 0B8BF0 7F086200 460A2100 */ add.s $f4, $f4, $f10 -/* 0B8BF4 7F086204 46062281 */ sub.s $f10, $f4, $f6 -/* 0B8BF8 7F086208 460E5102 */ mul.s $f4, $f10, $f14 -/* 0B8BFC 7F08620C 46044480 */ add.s $f18, $f8, $f4 -/* 0B8C00 7F086210 C7A403B4 */ lwc1 $f4, 0x3b4($sp) -/* 0B8C04 7F086214 46126182 */ mul.s $f6, $f12, $f18 -/* 0B8C08 7F086218 46009406 */ mov.s $f16, $f18 -/* 0B8C0C 7F08621C 4614303E */ c.le.s $f6, $f20 -/* 0B8C10 7F086220 46042182 */ mul.s $f6, $f4, $f4 -/* 0B8C14 7F086224 45020004 */ bc1fl .L7F086238 -/* 0B8C18 7F086228 4614903C */ c.lt.s $f18, $f20 -/* 0B8C1C 7F08622C 1000001F */ b .L7F0862AC -/* 0B8C20 7F086230 4600A386 */ mov.s $f14, $f20 -/* 0B8C24 7F086234 4614903C */ c.lt.s $f18, $f20 -.L7F086238: -/* 0B8C28 7F086238 00000000 */ nop -/* 0B8C2C 7F08623C 45020005 */ bc1fl .L7F086254 -/* 0B8C30 7F086240 4610603E */ c.le.s $f12, $f16 -/* 0B8C34 7F086244 C7AC0050 */ lwc1 $f12, 0x50($sp) -/* 0B8C38 7F086248 46009407 */ neg.s $f16, $f18 -/* 0B8C3C 7F08624C 46006307 */ neg.s $f12, $f12 -/* 0B8C40 7F086250 4610603E */ c.le.s $f12, $f16 -.L7F086254: -/* 0B8C44 7F086254 00000000 */ nop -/* 0B8C48 7F086258 45020004 */ bc1fl .L7F08626C -/* 0B8C4C 7F08625C 8E2C0000 */ lw $t4, ($s1) -/* 0B8C50 7F086260 10000012 */ b .L7F0862AC -/* 0B8C54 7F086264 4600A386 */ mov.s $f14, $f20 -/* 0B8C58 7F086268 8E2C0000 */ lw $t4, ($s1) -.L7F08626C: -/* 0B8C5C 7F08626C C58004B0 */ lwc1 $f0, 0x4b0($t4) -/* 0B8C60 7F086270 4610003C */ c.lt.s $f0, $f16 -/* 0B8C64 7F086274 00000000 */ nop -/* 0B8C68 7F086278 45020004 */ bc1fl .L7F08628C -/* 0B8C6C 7F08627C 4600603C */ c.lt.s $f12, $f0 -/* 0B8C70 7F086280 1000000A */ b .L7F0862AC -/* 0B8C74 7F086284 4600A386 */ mov.s $f14, $f20 -/* 0B8C78 7F086288 4600603C */ c.lt.s $f12, $f0 -.L7F08628C: -/* 0B8C7C 7F08628C 00000000 */ nop -/* 0B8C80 7F086290 45020004 */ bc1fl .L7F0862A4 -/* 0B8C84 7F086294 46006281 */ sub.s $f10, $f12, $f0 -/* 0B8C88 7F086298 10000004 */ b .L7F0862AC -/* 0B8C8C 7F08629C 4600A386 */ mov.s $f14, $f20 -/* 0B8C90 7F0862A0 46006281 */ sub.s $f10, $f12, $f0 -.L7F0862A4: -/* 0B8C94 7F0862A4 46106201 */ sub.s $f8, $f12, $f16 -/* 0B8C98 7F0862A8 46085383 */ div.s $f14, $f10, $f8 -.L7F0862AC: -/* 0B8C9C 7F0862AC C7AA03AC */ lwc1 $f10, 0x3ac($sp) -/* 0B8CA0 7F0862B0 E7AE0180 */ swc1 $f14, 0x180($sp) -/* 0B8CA4 7F0862B4 460A5202 */ mul.s $f8, $f10, $f10 -/* 0B8CA8 7F0862B8 0C007614 */ jal sqrtf -/* 0B8CAC 7F0862BC 46083300 */ add.s $f12, $f6, $f8 -/* 0B8CB0 7F0862C0 4600A03C */ c.lt.s $f20, $f0 -/* 0B8CB4 7F0862C4 C7AE0180 */ lwc1 $f14, 0x180($sp) -/* 0B8CB8 7F0862C8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8CBC 7F0862CC 4502001B */ bc1fl .L7F08633C -/* 0B8CC0 7F0862D0 C7AA019C */ lwc1 $f10, 0x19c($sp) -/* 0B8CC4 7F0862D4 44812000 */ mtc1 $at, $f4 -/* 0B8CC8 7F0862D8 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B8CCC 7F0862DC 44813000 */ mtc1 $at, $f6 -/* 0B8CD0 7F0862E0 460E2281 */ sub.s $f10, $f4, $f14 -/* 0B8CD4 7F0862E4 8E2D0000 */ lw $t5, ($s1) -/* 0B8CD8 7F0862E8 C7A401A0 */ lwc1 $f4, 0x1a0($sp) -/* 0B8CDC 7F0862EC 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 0B8CE0 7F0862F0 46005082 */ mul.s $f2, $f10, $f0 -/* 0B8CE4 7F0862F4 00000000 */ nop -/* 0B8CE8 7F0862F8 46061302 */ mul.s $f12, $f2, $f6 -/* 0B8CEC 7F0862FC E7AC0390 */ swc1 $f12, 0x390($sp) -/* 0B8CF0 7F086300 C5B20074 */ lwc1 $f18, 0x74($t5) -/* 0B8CF4 7F086304 460C9200 */ add.s $f8, $f18, $f12 -/* 0B8CF8 7F086308 4608203E */ c.le.s $f4, $f8 -/* 0B8CFC 7F08630C 00000000 */ nop -/* 0B8D00 7F086310 45000009 */ bc1f .L7F086338 -/* 0B8D04 7F086314 00000000 */ nop -/* 0B8D08 7F086318 46122281 */ sub.s $f10, $f4, $f18 -/* 0B8D0C 7F08631C 44813000 */ mtc1 $at, $f6 -/* 0B8D10 7F086320 00000000 */ nop -/* 0B8D14 7F086324 46065203 */ div.s $f8, $f10, $f6 -/* 0B8D18 7F086328 E7AA0390 */ swc1 $f10, 0x390($sp) -/* 0B8D1C 7F08632C 46081401 */ sub.s $f16, $f2, $f8 -/* 0B8D20 7F086330 46008103 */ div.s $f4, $f16, $f0 -/* 0B8D24 7F086334 46047380 */ add.s $f14, $f14, $f4 -.L7F086338: -/* 0B8D28 7F086338 C7AA019C */ lwc1 $f10, 0x19c($sp) -.L7F08633C: -/* 0B8D2C 7F08633C C7A60184 */ lwc1 $f6, 0x184($sp) -/* 0B8D30 7F086340 C7A801A4 */ lwc1 $f8, 0x1a4($sp) -/* 0B8D34 7F086344 C7A4018C */ lwc1 $f4, 0x18c($sp) -/* 0B8D38 7F086348 46065301 */ sub.s $f12, $f10, $f6 -/* 0B8D3C 7F08634C C7AA01A8 */ lwc1 $f10, 0x1a8($sp) -/* 0B8D40 7F086350 8E280000 */ lw $t0, ($s1) -/* 0B8D44 7F086354 46044401 */ sub.s $f16, $f8, $f4 -/* 0B8D48 7F086358 C7A801B0 */ lwc1 $f8, 0x1b0($sp) -/* 0B8D4C 7F08635C 46065481 */ sub.s $f18, $f10, $f6 -/* 0B8D50 7F086360 46044281 */ sub.s $f10, $f8, $f4 -/* 0B8D54 7F086364 46129182 */ mul.s $f6, $f18, $f18 -/* 0B8D58 7F086368 00000000 */ nop -/* 0B8D5C 7F08636C 460A5202 */ mul.s $f8, $f10, $f10 -/* 0B8D60 7F086370 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 0B8D64 7F086374 46083100 */ add.s $f4, $f6, $f8 -/* 0B8D68 7F086378 460C6182 */ mul.s $f6, $f12, $f12 -/* 0B8D6C 7F08637C 00000000 */ nop -/* 0B8D70 7F086380 46108202 */ mul.s $f8, $f16, $f16 -/* 0B8D74 7F086384 46083180 */ add.s $f6, $f6, $f8 -/* 0B8D78 7F086388 C7A801A0 */ lwc1 $f8, 0x1a0($sp) -/* 0B8D7C 7F08638C 4606203C */ c.lt.s $f4, $f6 -/* 0B8D80 7F086390 C7A40188 */ lwc1 $f4, 0x188($sp) -/* 0B8D84 7F086394 45000003 */ bc1f .L7F0863A4 -/* 0B8D88 7F086398 46044181 */ sub.s $f6, $f8, $f4 -/* 0B8D8C 7F08639C 46009306 */ mov.s $f12, $f18 -/* 0B8D90 7F0863A0 46005406 */ mov.s $f16, $f10 -.L7F0863A4: -/* 0B8D94 7F0863A4 C7AA0390 */ lwc1 $f10, 0x390($sp) -/* 0B8D98 7F0863A8 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0B8D9C 7F0863AC 27A403AC */ addiu $a0, $sp, 0x3ac -/* 0B8DA0 7F0863B0 46065003 */ div.s $f0, $f10, $f6 -/* 0B8DA4 7F0863B4 00002825 */ move $a1, $zero -/* 0B8DA8 7F0863B8 460C0202 */ mul.s $f8, $f0, $f12 -/* 0B8DAC 7F0863BC 00000000 */ nop -/* 0B8DB0 7F0863C0 460E2282 */ mul.s $f10, $f4, $f14 -/* 0B8DB4 7F0863C4 460A4180 */ add.s $f6, $f8, $f10 -/* 0B8DB8 7F0863C8 46100102 */ mul.s $f4, $f0, $f16 -/* 0B8DBC 7F0863CC C7A803B4 */ lwc1 $f8, 0x3b4($sp) -/* 0B8DC0 7F0863D0 E7A603AC */ swc1 $f6, 0x3ac($sp) -/* 0B8DC4 7F0863D4 460E4282 */ mul.s $f10, $f8, $f14 -/* 0B8DC8 7F0863D8 C7A80208 */ lwc1 $f8, 0x208($sp) -/* 0B8DCC 7F0863DC 460A2180 */ add.s $f6, $f4, $f10 -/* 0B8DD0 7F0863E0 E7A603B4 */ swc1 $f6, 0x3b4($sp) -/* 0B8DD4 7F0863E4 E508048C */ swc1 $f8, 0x48c($t0) -/* 0B8DD8 7F0863E8 8E2F0000 */ lw $t7, ($s1) -/* 0B8DDC 7F0863EC C7A40204 */ lwc1 $f4, 0x204($sp) -/* 0B8DE0 7F0863F0 E5E40494 */ swc1 $f4, 0x494($t7) -/* 0B8DE4 7F0863F4 8E2E0000 */ lw $t6, ($s1) -/* 0B8DE8 7F0863F8 8FB90200 */ lw $t9, 0x200($sp) -/* 0B8DEC 7F0863FC ADD90488 */ sw $t9, 0x488($t6) -/* 0B8DF0 7F086400 8E2B0000 */ lw $t3, ($s1) -/* 0B8DF4 7F086404 C56A126C */ lwc1 $f10, 0x126c($t3) -/* 0B8DF8 7F086408 460AA032 */ c.eq.s $f20, $f10 -/* 0B8DFC 7F08640C 00000000 */ nop -/* 0B8E00 7F086410 45000002 */ bc1f .L7F08641C -/* 0B8E04 7F086414 00000000 */ nop -/* 0B8E08 7F086418 24050001 */ li $a1, 1 -.L7F08641C: -/* 0B8E0C 7F08641C 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B8E10 7F086420 00000000 */ nop -.L7F086424: -/* 0B8E14 7F086424 8E280000 */ lw $t0, ($s1) -.L7F086428: -/* 0B8E18 7F086428 C7A80208 */ lwc1 $f8, 0x208($sp) -/* 0B8E1C 7F08642C C7AA0204 */ lwc1 $f10, 0x204($sp) -/* 0B8E20 7F086430 C506048C */ lwc1 $f6, 0x48c($t0) -/* 0B8E24 7F086434 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0B8E28 7F086438 46083081 */ sub.s $f2, $f6, $f8 -/* 0B8E2C 7F08643C C7A603B4 */ lwc1 $f6, 0x3b4($sp) -/* 0B8E30 7F086440 460A2381 */ sub.s $f14, $f4, $f10 -/* 0B8E34 7F086444 46063202 */ mul.s $f8, $f6, $f6 -/* 0B8E38 7F086448 C7A403AC */ lwc1 $f4, 0x3ac($sp) -/* 0B8E3C 7F08644C 46042282 */ mul.s $f10, $f4, $f4 -/* 0B8E40 7F086450 460A4000 */ add.s $f0, $f8, $f10 -/* 0B8E44 7F086454 46140032 */ c.eq.s $f0, $f20 -/* 0B8E48 7F086458 46000306 */ mov.s $f12, $f0 -/* 0B8E4C 7F08645C 45010006 */ bc1t .L7F086478 -/* 0B8E50 7F086460 00000000 */ nop -/* 0B8E54 7F086464 46021182 */ mul.s $f6, $f2, $f2 -/* 0B8E58 7F086468 00000000 */ nop -/* 0B8E5C 7F08646C 460E7102 */ mul.s $f4, $f14, $f14 -/* 0B8E60 7F086470 46043200 */ add.s $f8, $f6, $f4 -/* 0B8E64 7F086474 46004303 */ div.s $f12, $f8, $f0 -.L7F086478: -/* 0B8E68 7F086478 0C007614 */ jal sqrtf -/* 0B8E6C 7F08647C 00000000 */ nop -/* 0B8E70 7F086480 C7A60220 */ lwc1 $f6, 0x220($sp) -/* 0B8E74 7F086484 8E280000 */ lw $t0, ($s1) -/* 0B8E78 7F086488 46060102 */ mul.s $f4, $f0, $f6 -/* 0B8E7C 7F08648C C50A1270 */ lwc1 $f10, 0x1270($t0) -/* 0B8E80 7F086490 46045200 */ add.s $f8, $f10, $f4 -/* 0B8E84 7F086494 E5081270 */ swc1 $f8, 0x1270($t0) -/* 0B8E88 7F086498 C7AA021C */ lwc1 $f10, 0x21c($sp) -/* 0B8E8C 7F08649C 8E280000 */ lw $t0, ($s1) -/* 0B8E90 7F0864A0 460A0102 */ mul.s $f4, $f0, $f10 -/* 0B8E94 7F0864A4 C5061274 */ lwc1 $f6, 0x1274($t0) -/* 0B8E98 7F0864A8 46043200 */ add.s $f8, $f6, $f4 -/* 0B8E9C 7F0864AC E5081274 */ swc1 $f8, 0x1274($t0) -.L7F0864B0: -/* 0B8EA0 7F0864B0 8E280000 */ lw $t0, ($s1) -.L7F0864B4: -/* 0B8EA4 7F0864B4 3C018005 */ lui $at, %hi(D_8005524C) # -0.000000 -/* 0B8EA8 7F0864B8 C426AE20 */ lwc1 $f6, %lo(D_8005524C)($at) -/* 0B8EAC 7F0864BC C50A0160 */ lwc1 $f10, 0x160($t0) -/* 0B8EB0 7F0864C0 3C0140C0 */ li $at, 0x40C00000 # 6.000000 -/* 0B8EB4 7F0864C4 C50800A4 */ lwc1 $f8, 0xa4($t0) -/* 0B8EB8 7F0864C8 46065103 */ div.s $f4, $f10, $f6 -/* 0B8EBC 7F0864CC 44815000 */ mtc1 $at, $f10 -/* 0B8EC0 7F0864D0 C514014C */ lwc1 $f20, 0x14c($t0) -/* 0B8EC4 7F0864D4 460A4183 */ div.s $f6, $f8, $f10 -/* 0B8EC8 7F0864D8 46062080 */ add.s $f2, $f4, $f6 -/* 0B8ECC 7F0864DC 0FC23C16 */ jal bheadGetBreathingValue -/* 0B8ED0 7F0864E0 E7A20144 */ swc1 $f2, 0x144($sp) -/* 0B8ED4 7F0864E4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B8ED8 7F0864E8 44817000 */ mtc1 $at, $f14 -/* 0B8EDC 7F0864EC C7A20144 */ lwc1 $f2, 0x144($sp) -/* 0B8EE0 7F0864F0 4407A000 */ mfc1 $a3, $f20 -/* 0B8EE4 7F0864F4 46000306 */ mov.s $f12, $f0 -/* 0B8EE8 7F0864F8 4602703C */ c.lt.s $f14, $f2 -/* 0B8EEC 7F0864FC 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0B8EF0 7F086500 45020004 */ bc1fl .L7F086514 -/* 0B8EF4 7F086504 44817000 */ mtc1 $at, $f14 -/* 0B8EF8 7F086508 10000008 */ b .L7F08652C -/* 0B8EFC 7F08650C 46007086 */ mov.s $f2, $f14 -/* 0B8F00 7F086510 44817000 */ mtc1 $at, $f14 -.L7F086514: -/* 0B8F04 7F086514 00000000 */ nop -/* 0B8F08 7F086518 460E103C */ c.lt.s $f2, $f14 -/* 0B8F0C 7F08651C 00000000 */ nop -/* 0B8F10 7F086520 45020003 */ bc1fl .L7F086530 -/* 0B8F14 7F086524 8E2A0000 */ lw $t2, ($s1) -/* 0B8F18 7F086528 46007086 */ mov.s $f2, $f14 -.L7F08652C: -/* 0B8F1C 7F08652C 8E2A0000 */ lw $t2, ($s1) -.L7F086530: -/* 0B8F20 7F086530 24010001 */ li $at, 1 -/* 0B8F24 7F086534 44061000 */ mfc1 $a2, $f2 -/* 0B8F28 7F086538 8D5804E8 */ lw $t8, 0x4e8($t2) -/* 0B8F2C 7F08653C 17010004 */ bne $t8, $at, .L7F086550 -/* 0B8F30 7F086540 3C018005 */ lui $at, %hi(D_80055250) # $at, 0x8005 -/* 0B8F34 7F086544 C428AE24 */ lwc1 $f8, %lo(D_80055250)($at) -/* 0B8F38 7F086548 46080302 */ mul.s $f12, $f0, $f8 -/* 0B8F3C 7F08654C 00000000 */ nop -.L7F086550: -/* 0B8F40 7F086550 0FC17967 */ jal gunSetBondWeaponSway -/* 0B8F44 7F086554 C7AE0398 */ lwc1 $f14, 0x398($sp) -/* 0B8F48 7F086558 8E2C0000 */ lw $t4, ($s1) -/* 0B8F4C 7F08655C 3C018005 */ lui $at, %hi(D_80055254) # $at, 0x8005 -/* 0B8F50 7F086560 C424AE28 */ lwc1 $f4, %lo(D_80055254)($at) -/* 0B8F54 7F086564 C58A015C */ lwc1 $f10, 0x15c($t4) -/* 0B8F58 7F086568 46045302 */ mul.s $f12, $f10, $f4 -/* 0B8F5C 7F08656C 0FC17AAA */ jal gunSetOffsetRelated -/* 0B8F60 7F086570 00000000 */ nop -/* 0B8F64 7F086574 3C038003 */ lui $v1, %hi(ptr_playerstank) # $v1, 0x8003 -/* 0B8F68 7F086578 8C6319A0 */ lw $v1, %lo(ptr_playerstank)($v1) -/* 0B8F6C 7F08657C 3C0D8003 */ lui $t5, %hi(in_tank_flag) # $t5, 0x8003 -/* 0B8F70 7F086580 50600135 */ beql $v1, $zero, .L7F086A58 -/* 0B8F74 7F086584 8FA40394 */ lw $a0, 0x394($sp) -/* 0B8F78 7F086588 8DAD1998 */ lw $t5, %lo(in_tank_flag)($t5) -/* 0B8F7C 7F08658C 24010001 */ li $at, 1 -/* 0B8F80 7F086590 3C0F8007 */ lui $t7, %hi(g_EnterTankAudioState) # $t7, 0x8007 -/* 0B8F84 7F086594 55A10130 */ bnel $t5, $at, .L7F086A58 -/* 0B8F88 7F086598 8FA40394 */ lw $a0, 0x394($sp) -/* 0B8F8C 7F08659C 8DEF8498 */ lw $t7, %lo(g_EnterTankAudioState)($t7) -/* 0B8F90 7F0865A0 24010002 */ li $at, 2 -/* 0B8F94 7F0865A4 55E1012C */ bnel $t7, $at, .L7F086A58 -/* 0B8F98 7F0865A8 8FA40394 */ lw $a0, 0x394($sp) -/* 0B8F9C 7F0865AC 8C620004 */ lw $v0, 4($v1) -/* 0B8FA0 7F0865B0 00002025 */ move $a0, $zero -/* 0B8FA4 7F0865B4 AFA20138 */ sw $v0, 0x138($sp) -/* 0B8FA8 7F0865B8 8C590014 */ lw $t9, 0x14($v0) -/* 0B8FAC 7F0865BC 00408025 */ move $s0, $v0 -/* 0B8FB0 7F0865C0 8F2E0008 */ lw $t6, 8($t9) -/* 0B8FB4 7F0865C4 8DCB0008 */ lw $t3, 8($t6) -/* 0B8FB8 7F0865C8 8D6A0014 */ lw $t2, 0x14($t3) -/* 0B8FBC 7F0865CC 8D580004 */ lw $t8, 4($t2) -/* 0B8FC0 7F0865D0 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0B8FC4 7F0865D4 AFB80130 */ sw $t8, 0x130($sp) -/* 0B8FC8 7F0865D8 38430020 */ xori $v1, $v0, 0x20 -/* 0B8FCC 7F0865DC 2C640001 */ sltiu $a0, $v1, 1 -/* 0B8FD0 7F0865E0 50800005 */ beql $a0, $zero, .L7F0865F8 -/* 0B8FD4 7F0865E4 AE0400C4 */ sw $a0, 0xc4($s0) -/* 0B8FD8 7F0865E8 0FC17850 */ jal get_hands_firing_status -/* 0B8FDC 7F0865EC 00002025 */ move $a0, $zero -/* 0B8FE0 7F0865F0 0002202B */ sltu $a0, $zero, $v0 -/* 0B8FE4 7F0865F4 AE0400C4 */ sw $a0, 0xc4($s0) -.L7F0865F8: -/* 0B8FE8 7F0865F8 3C018003 */ lui $at, %hi(g_TankTurretVerticalAngle) # $at, 0x8003 -/* 0B8FEC 7F0865FC C42619BC */ lwc1 $f6, %lo(g_TankTurretVerticalAngle)($at) -/* 0B8FF0 7F086600 3C018003 */ lui $at, %hi(g_TankTurretOrientationAngleRad) # $at, 0x8003 -/* 0B8FF4 7F086604 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0B8FF8 7F086608 E60600C8 */ swc1 $f6, 0xc8($s0) -/* 0B8FFC 7F08660C C42819C4 */ lwc1 $f8, %lo(g_TankTurretOrientationAngleRad)($at) -/* 0B9000 7F086610 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B9004 7F086614 E60800CC */ swc1 $f8, 0xcc($s0) -/* 0B9008 7F086618 C42A19B4 */ lwc1 $f10, %lo(g_TankOrientationAngle)($at) -/* 0B900C 7F08661C 3C018005 */ lui $at, %hi(D_80055258) # $at, 0x8005 -/* 0B9010 7F086620 E60A00DC */ swc1 $f10, 0xdc($s0) -/* 0B9014 7F086624 C424AE2C */ lwc1 $f4, %lo(D_80055258)($at) -/* 0B9018 7F086628 3C018003 */ lui $at, %hi(g_TankOrientationAngle) # $at, 0x8003 -/* 0B901C 7F08662C C42619B4 */ lwc1 $f6, %lo(g_TankOrientationAngle)($at) -/* 0B9020 7F086630 0FC162A9 */ jal matrix_4x4_set_rotation_around_y -/* 0B9024 7F086634 46062301 */ sub.s $f12, $f4, $f6 -/* 0B9028 7F086638 8FAC0138 */ lw $t4, 0x138($sp) -/* 0B902C 7F08663C 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0B9030 7F086640 8D8D0014 */ lw $t5, 0x14($t4) -/* 0B9034 7F086644 0FC163C9 */ jal matrix_scalar_multiply -/* 0B9038 7F086648 C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 0B903C 7F08664C 3C018007 */ lui $at, %hi(flt_CODE_bss_800799A8 + 4) # $at, 0x8007 -/* 0B9040 7F086650 C4288488 */ lwc1 $f8, %lo(flt_CODE_bss_800799A8)($at) -/* 0B9044 7F086654 C424848C */ lwc1 $f4, %lo(flt_CODE_bss_800799A8 + 4)($at) -/* 0B9048 7F086658 3C018007 */ lui $at, %hi(flt_CODE_bss_800799A8 + 8) # $at, 0x8007 -/* 0B904C 7F08665C 46004287 */ neg.s $f10, $f8 -/* 0B9050 7F086660 C4288490 */ lwc1 $f8, %lo(flt_CODE_bss_800799A8 + 8)($at) -/* 0B9054 7F086664 E7AA00E4 */ swc1 $f10, 0xe4($sp) -/* 0B9058 7F086668 46002187 */ neg.s $f6, $f4 -/* 0B905C 7F08666C 46004287 */ neg.s $f10, $f8 -/* 0B9060 7F086670 E7A600E8 */ swc1 $f6, 0xe8($sp) -/* 0B9064 7F086674 E7AA00EC */ swc1 $f10, 0xec($sp) -/* 0B9068 7F086678 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0B906C 7F08667C 0FC16220 */ jal matrix_4x4_rotate_vector_in_place -/* 0B9070 7F086680 27A500E4 */ addiu $a1, $sp, 0xe4 -/* 0B9074 7F086684 8E280000 */ lw $t0, ($s1) -/* 0B9078 7F086688 C7A400E4 */ lwc1 $f4, 0xe4($sp) -/* 0B907C 7F08668C C7AA00EC */ lwc1 $f10, 0xec($sp) -/* 0B9080 7F086690 C506048C */ lwc1 $f6, 0x48c($t0) -/* 0B9084 7F086694 8FA20138 */ lw $v0, 0x138($sp) -/* 0B9088 7F086698 46062200 */ add.s $f8, $f4, $f6 -/* 0B908C 7F08669C E7A800E4 */ swc1 $f8, 0xe4($sp) -/* 0B9090 7F0866A0 C5040494 */ lwc1 $f4, 0x494($t0) -/* 0B9094 7F0866A4 46045180 */ add.s $f6, $f10, $f4 -/* 0B9098 7F0866A8 E7A600EC */ swc1 $f6, 0xec($sp) -/* 0B909C 7F0866AC 8D0F0488 */ lw $t7, 0x488($t0) -/* 0B90A0 7F0866B0 8C590010 */ lw $t9, 0x10($v0) -/* 0B90A4 7F0866B4 AF2F0014 */ sw $t7, 0x14($t9) -/* 0B90A8 7F0866B8 8E280000 */ lw $t0, ($s1) -/* 0B90AC 7F0866BC C7A800EC */ lwc1 $f8, 0xec($sp) -/* 0B90B0 7F0866C0 8C440010 */ lw $a0, 0x10($v0) -/* 0B90B4 7F0866C4 8D05048C */ lw $a1, 0x48c($t0) -/* 0B90B8 7F0866C8 8D060494 */ lw $a2, 0x494($t0) -/* 0B90BC 7F0866CC 8FA700E4 */ lw $a3, 0xe4($sp) -/* 0B90C0 7F0866D0 E7A80010 */ swc1 $f8, 0x10($sp) -/* 0B90C4 7F0866D4 0FC2BFA9 */ jal walkTilesBetweenPoints_NoCallback -/* 0B90C8 7F0866D8 24840014 */ addiu $a0, $a0, 0x14 -/* 0B90CC 7F0866DC 8FAE0138 */ lw $t6, 0x138($sp) -/* 0B90D0 7F0866E0 8FA500E4 */ lw $a1, 0xe4($sp) -/* 0B90D4 7F0866E4 8FA600EC */ lw $a2, 0xec($sp) -/* 0B90D8 7F0866E8 8DCB0010 */ lw $t3, 0x10($t6) -/* 0B90DC 7F0866EC 0FC2C70C */ jal stanGetPositionYValue -/* 0B90E0 7F0866F0 8D640014 */ lw $a0, 0x14($t3) -/* 0B90E4 7F0866F4 3C038004 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8004 -/* 0B90E8 7F0866F8 24630FF4 */ addiu $v1, %lo(g_ClockTimer) # addiu $v1, $v1, 0xff4 -/* 0B90EC 7F0866FC E60000D4 */ swc1 $f0, 0xd4($s0) -/* 0B90F0 7F086700 8C6A0000 */ lw $t2, ($v1) -/* 0B90F4 7F086704 00001025 */ move $v0, $zero -/* 0B90F8 7F086708 3C018005 */ lui $at, %hi(D_8005525C) # $at, 0x8005 -/* 0B90FC 7F08670C 1940000C */ blez $t2, .L7F086740 -/* 0B9100 7F086710 00000000 */ nop -/* 0B9104 7F086714 C60200D4 */ lwc1 $f2, 0xd4($s0) -/* 0B9108 7F086718 C420AE30 */ lwc1 $f0, %lo(D_8005525C)($at) -/* 0B910C 7F08671C C60A00D0 */ lwc1 $f10, 0xd0($s0) -.L7F086720: -/* 0B9110 7F086720 24420001 */ addiu $v0, $v0, 1 -/* 0B9114 7F086724 46005102 */ mul.s $f4, $f10, $f0 -/* 0B9118 7F086728 46022180 */ add.s $f6, $f4, $f2 -/* 0B911C 7F08672C E60600D0 */ swc1 $f6, 0xd0($s0) -/* 0B9120 7F086730 8C780000 */ lw $t8, ($v1) -/* 0B9124 7F086734 0058082A */ slt $at, $v0, $t8 -/* 0B9128 7F086738 5420FFF9 */ bnezl $at, .L7F086720 -/* 0B912C 7F08673C C60A00D0 */ lwc1 $f10, 0xd0($s0) -.L7F086740: -/* 0B9130 7F086740 3C018005 */ lui $at, %hi(D_80055260) # $at, 0x8005 -/* 0B9134 7F086744 C42AAE34 */ lwc1 $f10, %lo(D_80055260)($at) -/* 0B9138 7F086748 C60800D0 */ lwc1 $f8, 0xd0($s0) -/* 0B913C 7F08674C 8FA40130 */ lw $a0, 0x130($sp) -/* 0B9140 7F086750 460A4502 */ mul.s $f20, $f8, $f10 -/* 0B9144 7F086754 0FC0FA49 */ jal chrpropBBOXGetYmin -/* 0B9148 7F086758 00000000 */ nop -/* 0B914C 7F08675C 8FA20138 */ lw $v0, 0x138($sp) -/* 0B9150 7F086760 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0B9154 7F086764 44815000 */ mtc1 $at, $f10 -/* 0B9158 7F086768 8C4C0014 */ lw $t4, 0x14($v0) -/* 0B915C 7F08676C 27A400F0 */ addiu $a0, $sp, 0xf0 -/* 0B9160 7F086770 24450018 */ addiu $a1, $v0, 0x18 -/* 0B9164 7F086774 C5840014 */ lwc1 $f4, 0x14($t4) -/* 0B9168 7F086778 46040182 */ mul.s $f6, $f0, $f4 -/* 0B916C 7F08677C 4606A201 */ sub.s $f8, $f20, $f6 -/* 0B9170 7F086780 460A4100 */ add.s $f4, $f8, $f10 -/* 0B9174 7F086784 0FC16132 */ jal matrix_4x4_copy -/* 0B9178 7F086788 E7A400E8 */ swc1 $f4, 0xe8($sp) -/* 0B917C 7F08678C 8FA40138 */ lw $a0, 0x138($sp) -/* 0B9180 7F086790 C7A000E4 */ lwc1 $f0, 0xe4($sp) -/* 0B9184 7F086794 8C8D0010 */ lw $t5, 0x10($a0) -/* 0B9188 7F086798 E5A00008 */ swc1 $f0, 8($t5) -/* 0B918C 7F08679C E4800058 */ swc1 $f0, 0x58($a0) -/* 0B9190 7F0867A0 C7A000E8 */ lwc1 $f0, 0xe8($sp) -/* 0B9194 7F0867A4 8C8F0010 */ lw $t7, 0x10($a0) -/* 0B9198 7F0867A8 E5E0000C */ swc1 $f0, 0xc($t7) -/* 0B919C 7F0867AC E480005C */ swc1 $f0, 0x5c($a0) -/* 0B91A0 7F0867B0 C7A000EC */ lwc1 $f0, 0xec($sp) -/* 0B91A4 7F0867B4 8C990010 */ lw $t9, 0x10($a0) -/* 0B91A8 7F0867B8 E7200010 */ swc1 $f0, 0x10($t9) -/* 0B91AC 7F0867BC 0FC15BE0 */ jal setupUpdateObjectRoomPosition -/* 0B91B0 7F0867C0 E4800060 */ swc1 $f0, 0x60($a0) -/* 0B91B4 7F0867C4 0FC10151 */ jal chrobjCollisionRelated -/* 0B91B8 7F0867C8 8FA40138 */ lw $a0, 0x138($sp) -/* 0B91BC 7F0867CC 8E250000 */ lw $a1, ($s1) -/* 0B91C0 7F0867D0 3C068003 */ lui $a2, %hi(g_TankOrientationAngle) # $a2, 0x8003 -/* 0B91C4 7F0867D4 8CC619B4 */ lw $a2, %lo(g_TankOrientationAngle)($a2) -/* 0B91C8 7F0867D8 27A400B4 */ addiu $a0, $sp, 0xb4 -/* 0B91CC 7F0867DC 0FC1F257 */ jal bondviewTankCollisionRelated -/* 0B91D0 7F0867E0 24A5048C */ addiu $a1, $a1, 0x48c -/* 0B91D4 7F0867E4 8FAE0138 */ lw $t6, 0x138($sp) -/* 0B91D8 7F0867E8 27B00094 */ addiu $s0, $sp, 0x94 -/* 0B91DC 7F0867EC 02002825 */ move $a1, $s0 -/* 0B91E0 7F0867F0 0FC0F313 */ jal chraiGetPropRoomIds -/* 0B91E4 7F0867F4 8DC40010 */ lw $a0, 0x10($t6) -/* 0B91E8 7F0867F8 0FC0F92F */ jal sub_GAME_7F03E3FC -/* 0B91EC 7F0867FC 02002025 */ move $a0, $s0 -/* 0B91F0 7F086800 3C0B8006 */ lui $t3, %hi(ptr_list_object_lookup_indices) # $t3, 0x8006 -/* 0B91F4 7F086804 8D6B8B70 */ lw $t3, %lo(ptr_list_object_lookup_indices)($t3) -/* 0B91F8 7F086808 3C014040 */ li $at, 0x40400000 # 3.000000 -/* 0B91FC 7F08680C AFAB008C */ sw $t3, 0x8c($sp) -/* 0B9200 7F086810 85620000 */ lh $v0, ($t3) -/* 0B9204 7F086814 04420090 */ bltzl $v0, .L7F086A58 -/* 0B9208 7F086818 8FA40394 */ lw $a0, 0x394($sp) -/* 0B920C 7F08681C 4481A000 */ mtc1 $at, $f20 -/* 0B9210 7F086820 00000000 */ nop -/* 0B9214 7F086824 8FAC0138 */ lw $t4, 0x138($sp) -.L7F086828: -/* 0B9218 7F086828 00025080 */ sll $t2, $v0, 2 -/* 0B921C 7F08682C 01425023 */ subu $t2, $t2, $v0 -/* 0B9220 7F086830 000A5080 */ sll $t2, $t2, 2 -/* 0B9224 7F086834 8D8D0010 */ lw $t5, 0x10($t4) -/* 0B9228 7F086838 01425021 */ addu $t2, $t2, $v0 -/* 0B922C 7F08683C 3C188006 */ lui $t8, %hi(pos_data_entry) # $t8, 0x8006 -/* 0B9230 7F086840 27188B78 */ addiu $t8, %lo(pos_data_entry) # addiu $t8, $t8, -0x7488 -/* 0B9234 7F086844 000A5080 */ sll $t2, $t2, 2 -/* 0B9238 7F086848 01588021 */ addu $s0, $t2, $t8 -/* 0B923C 7F08684C 520D007C */ beql $s0, $t5, .L7F086A40 -/* 0B9240 7F086850 8FAA008C */ lw $t2, 0x8c($sp) -/* 0B9244 7F086854 92020000 */ lbu $v0, ($s0) -/* 0B9248 7F086858 24010003 */ li $at, 3 -/* 0B924C 7F08685C 240F0001 */ li $t7, 1 -/* 0B9250 7F086860 1441005A */ bne $v0, $at, .L7F0869CC -/* 0B9254 7F086864 02002025 */ move $a0, $s0 -/* 0B9258 7F086868 AFAF007C */ sw $t7, 0x7c($sp) -/* 0B925C 7F08686C 8E030004 */ lw $v1, 4($s0) -/* 0B9260 7F086870 27A50080 */ addiu $a1, $sp, 0x80 -/* 0B9264 7F086874 27A60088 */ addiu $a2, $sp, 0x88 -/* 0B9268 7F086878 27A70084 */ addiu $a3, $sp, 0x84 -/* 0B926C 7F08687C 0FC0F412 */ jal chrpropGetCollisionBounds -/* 0B9270 7F086880 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B9274 7F086884 26040008 */ addiu $a0, $s0, 8 -/* 0B9278 7F086888 AFA40050 */ sw $a0, 0x50($sp) -/* 0B927C 7F08688C 27A500B4 */ addiu $a1, $sp, 0xb4 -/* 0B9280 7F086890 0FC0F366 */ jal chrpropTestPointInPolygon -/* 0B9284 7F086894 24060004 */ li $a2, 4 -/* 0B9288 7F086898 10400031 */ beqz $v0, .L7F086960 -/* 0B928C 7F08689C 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B9290 7F0868A0 AFA0007C */ sw $zero, 0x7c($sp) -/* 0B9294 7F0868A4 80790007 */ lb $t9, 7($v1) -/* 0B9298 7F0868A8 24010004 */ li $at, 4 -/* 0B929C 7F0868AC 5721002D */ bnel $t9, $at, .L7F086964 -/* 0B92A0 7F0868B0 8FAF007C */ lw $t7, 0x7c($sp) -/* 0B92A4 7F0868B4 8C6E0014 */ lw $t6, 0x14($v1) -/* 0B92A8 7F0868B8 000E59C0 */ sll $t3, $t6, 7 -/* 0B92AC 7F0868BC 05620029 */ bltzl $t3, .L7F086964 -/* 0B92B0 7F0868C0 8FAF007C */ lw $t7, 0x7c($sp) -/* 0B92B4 7F0868C4 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B92B8 7F0868C8 AFA3006C */ sw $v1, 0x6c($sp) -/* 0B92BC 7F0868CC 14400024 */ bnez $v0, .L7F086960 -/* 0B92C0 7F0868D0 8FA3006C */ lw $v1, 0x6c($sp) -/* 0B92C4 7F0868D4 8C6A0014 */ lw $t2, 0x14($v1) -/* 0B92C8 7F0868D8 3C010100 */ lui $at, 0x100 -/* 0B92CC 7F0868DC 3C028004 */ lui $v0, %hi(D_80048380) # $v0, 0x8004 -/* 0B92D0 7F0868E0 0141C025 */ or $t8, $t2, $at -/* 0B92D4 7F0868E4 AC780014 */ sw $t8, 0x14($v1) -/* 0B92D8 7F0868E8 8C421000 */ lw $v0, %lo(D_80048380)($v0) -/* 0B92DC 7F0868EC 24010003 */ li $at, 3 -/* 0B92E0 7F0868F0 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B92E4 7F0868F4 0041001A */ div $zero, $v0, $at -/* 0B92E8 7F0868F8 00001010 */ mfhi $v0 -/* 0B92EC 7F0868FC 28410002 */ slti $at, $v0, 2 -/* 0B92F0 7F086900 1020000E */ beqz $at, .L7F08693C -/* 0B92F4 7F086904 240500B7 */ li $a1, 183 -/* 0B92F8 7F086908 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B92FC 7F08690C 0C00209A */ jal sndPlaySfx -/* 0B9300 7F086910 00003025 */ move $a2, $zero -/* 0B9304 7F086914 00402025 */ move $a0, $v0 -/* 0B9308 7F086918 0FC14F3C */ jal sub_GAME_7F053A10 -/* 0B930C 7F08691C 8FA50050 */ lw $a1, 0x50($sp) -/* 0B9310 7F086920 3C028004 */ lui $v0, %hi(D_80048380) # $v0, 0x8004 -/* 0B9314 7F086924 8C421000 */ lw $v0, %lo(D_80048380)($v0) -/* 0B9318 7F086928 24010003 */ li $at, 3 -/* 0B931C 7F08692C 0041001A */ div $zero, $v0, $at -/* 0B9320 7F086930 00001010 */ mfhi $v0 -/* 0B9324 7F086934 00000000 */ nop -/* 0B9328 7F086938 00000000 */ nop -.L7F08693C: -/* 0B932C 7F08693C 18400008 */ blez $v0, .L7F086960 -/* 0B9330 7F086940 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 0B9334 7F086944 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0B9338 7F086948 240500D5 */ li $a1, 213 -/* 0B933C 7F08694C 0C00209A */ jal sndPlaySfx -/* 0B9340 7F086950 00003025 */ move $a2, $zero -/* 0B9344 7F086954 00402025 */ move $a0, $v0 -/* 0B9348 7F086958 0FC14F3C */ jal sub_GAME_7F053A10 -/* 0B934C 7F08695C 8FA50050 */ lw $a1, 0x50($sp) -.L7F086960: -/* 0B9350 7F086960 8FAF007C */ lw $t7, 0x7c($sp) -.L7F086964: -/* 0B9354 7F086964 8FA40050 */ lw $a0, 0x50($sp) -/* 0B9358 7F086968 8FA50080 */ lw $a1, 0x80($sp) -/* 0B935C 7F08696C 11E00006 */ beqz $t7, .L7F086988 -/* 0B9360 7F086970 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0B9364 7F086974 0FC1122B */ jal chrobjTestPointPolygonCollision -/* 0B9368 7F086978 24070004 */ li $a3, 4 -/* 0B936C 7F08697C 50400003 */ beql $v0, $zero, .L7F08698C -/* 0B9370 7F086980 8FB9007C */ lw $t9, 0x7c($sp) -/* 0B9374 7F086984 AFA0007C */ sw $zero, 0x7c($sp) -.L7F086988: -/* 0B9378 7F086988 8FB9007C */ lw $t9, 0x7c($sp) -.L7F08698C: -/* 0B937C 7F08698C 8FAE0138 */ lw $t6, 0x138($sp) -/* 0B9380 7F086990 5720002B */ bnezl $t9, .L7F086A40 -/* 0B9384 7F086994 8FAA008C */ lw $t2, 0x8c($sp) -/* 0B9388 7F086998 C5C60058 */ lwc1 $f6, 0x58($t6) -/* 0B938C 7F08699C 4406A000 */ mfc1 $a2, $f20 -/* 0B9390 7F0869A0 27A50070 */ addiu $a1, $sp, 0x70 -/* 0B9394 7F0869A4 E7A60070 */ swc1 $f6, 0x70($sp) -/* 0B9398 7F0869A8 C608000C */ lwc1 $f8, 0xc($s0) -/* 0B939C 7F0869AC 24070001 */ li $a3, 1 -/* 0B93A0 7F0869B0 E7A80074 */ swc1 $f8, 0x74($sp) -/* 0B93A4 7F0869B4 C5CA0060 */ lwc1 $f10, 0x60($t6) -/* 0B93A8 7F0869B8 E7AA0078 */ swc1 $f10, 0x78($sp) -/* 0B93AC 7F0869BC 0FC09E07 */ jal chrlvExplosionDamage -/* 0B93B0 7F0869C0 8E040004 */ lw $a0, 4($s0) -/* 0B93B4 7F0869C4 1000001E */ b .L7F086A40 -/* 0B93B8 7F0869C8 8FAA008C */ lw $t2, 0x8c($sp) -.L7F0869CC: -/* 0B93BC 7F0869CC 24010001 */ li $at, 1 -/* 0B93C0 7F0869D0 1441001A */ bne $v0, $at, .L7F086A3C -/* 0B93C4 7F0869D4 02002025 */ move $a0, $s0 -/* 0B93C8 7F0869D8 27A50064 */ addiu $a1, $sp, 0x64 -/* 0B93CC 7F0869DC 0FC0F35C */ jal chraiGetCollisionBoundsWithoutY -/* 0B93D0 7F0869E0 27A60060 */ addiu $a2, $sp, 0x60 -/* 0B93D4 7F0869E4 8FA50060 */ lw $a1, 0x60($sp) -/* 0B93D8 7F0869E8 8FA40064 */ lw $a0, 0x64($sp) -/* 0B93DC 7F0869EC 27A600B4 */ addiu $a2, $sp, 0xb4 -/* 0B93E0 7F0869F0 58A00013 */ blezl $a1, .L7F086A40 -/* 0B93E4 7F0869F4 8FAA008C */ lw $t2, 0x8c($sp) -/* 0B93E8 7F0869F8 0FC111D8 */ jal sub_GAME_7F0446B8 -/* 0B93EC 7F0869FC 24070004 */ li $a3, 4 -/* 0B93F0 7F086A00 5040000F */ beql $v0, $zero, .L7F086A40 -/* 0B93F4 7F086A04 8FAA008C */ lw $t2, 0x8c($sp) -/* 0B93F8 7F086A08 0FC269A4 */ jal get_cur_playernum -/* 0B93FC 7F086A0C 00000000 */ nop -/* 0B9400 7F086A10 8E060004 */ lw $a2, 4($s0) -/* 0B9404 7F086A14 3C05461C */ lui $a1, (0x461C4000 >> 16) # lui $a1, 0x461c -/* 0B9408 7F086A18 34A54000 */ ori $a1, (0x461C4000 & 0xFFFF) # ori $a1, $a1, 0x4000 -/* 0B940C 7F086A1C AFA20010 */ sw $v0, 0x10($sp) -/* 0B9410 7F086A20 02002025 */ move $a0, $s0 -/* 0B9414 7F086A24 24070020 */ li $a3, 32 -/* 0B9418 7F086A28 0FC13839 */ jal sub_GAME_7F04DEFC -/* 0B941C 7F086A2C 24C60058 */ addiu $a2, $a2, 0x58 -/* 0B9420 7F086A30 240B004B */ li $t3, 75 -/* 0B9424 7F086A34 3C018003 */ lui $at, %hi(D_80036490) # $at, 0x8003 -/* 0B9428 7F086A38 AC2B19E0 */ sw $t3, %lo(D_80036490)($at) -.L7F086A3C: -/* 0B942C 7F086A3C 8FAA008C */ lw $t2, 0x8c($sp) -.L7F086A40: -/* 0B9430 7F086A40 25580002 */ addiu $t8, $t2, 2 -/* 0B9434 7F086A44 AFB8008C */ sw $t8, 0x8c($sp) -/* 0B9438 7F086A48 87020000 */ lh $v0, ($t8) -/* 0B943C 7F086A4C 0443FF76 */ bgezl $v0, .L7F086828 -/* 0B9440 7F086A50 8FAC0138 */ lw $t4, 0x138($sp) -/* 0B9444 7F086A54 8FA40394 */ lw $a0, 0x394($sp) -.L7F086A58: -/* 0B9448 7F086A58 0FC203A7 */ jal bondviewUpdatePlayerClipping -/* 0B944C 7F086A5C 8FA50390 */ lw $a1, 0x390($sp) -/* 0B9450 7F086A60 0FC20547 */ jal bondviewUpdatePlayerCollisionPositionFields -/* 0B9454 7F086A64 00000000 */ nop -/* 0B9458 7F086A68 0FC228DA */ jal bondviewUpdatePlayerCollisionBounds -/* 0B945C 7F086A6C 00000000 */ nop -/* 0B9460 7F086A70 0FC2410C */ jal get_debug_man_pos_flag -/* 0B9464 7F086A74 00000000 */ nop -/* 0B9468 7F086A78 50400008 */ beql $v0, $zero, .L7F086A9C -/* 0B946C 7F086A7C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0B9470 7F086A80 8E280000 */ lw $t0, ($s1) -/* 0B9474 7F086A84 27A7005C */ addiu $a3, $sp, 0x5c -/* 0B9478 7F086A88 8D040488 */ lw $a0, 0x488($t0) -/* 0B947C 7F086A8C 8D05048C */ lw $a1, 0x48c($t0) -/* 0B9480 7F086A90 0FC2C7BB */ jal copy_tile_RGB_as_24bit -/* 0B9484 7F086A94 8D060494 */ lw $a2, 0x494($t0) -/* 0B9488 7F086A98 8FBF002C */ lw $ra, 0x2c($sp) -.L7F086A9C: -/* 0B948C 7F086A9C D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0B9490 7F086AA0 8FB00024 */ lw $s0, 0x24($sp) -/* 0B9494 7F086AA4 8FB10028 */ lw $s1, 0x28($sp) -/* 0B9498 7F086AA8 03E00008 */ jr $ra -/* 0B949C 7F086AAC 27BD03B8 */ addiu $sp, $sp, 0x3b8 -) -#endif -#endif -#ifdef NONMATCHING -void sub_GAME_7F086990(s32 arg0, s32 arg1, ? arg2, ? arg_unalignedA, ? arg3, ? arg_unalignedE) { - ? sp30; - ? sp3C; - f32 sp40; - f32 sp48; - ? sp4C; - ? sp58; - ? sp64; - // Node 0 - sp64 = (?32) D_80036800; - sp64.unk4 = (?32) D_80036800.unk4; - sp64.unk8 = (?32) D_80036800.unk8; - sp58 = (?32) D_8003680C; - sp58.unk4 = (?32) D_8003680C.unk4; - sp58.unk8 = (?32) D_8003680C.unk8; - sp4C = (?32) D_80036818; - sp4C.unk4 = (?32) D_80036818.unk4; - sp4C.unk8 = (?32) D_80036818.unk8; - sp40 = (?32) D_80036824; - sp40.unk4 = (?32) D_80036824.unk4; - sp40.unk8 = (?32) D_80036824.unk8; - sub_GAME_7F083FC8(); - sub_GAME_7F084360(); - controller_gameplay_interaction(0, 0, 0, 0); +/** + * US address 7F086990. + * EU address 7F086AB0. +*/ +void bondviewFrozenMoveBond(s8 stick_x, s8 stick_y, u16 buttons, u16 oldbuttons) +{ + struct coord3d property_pos; + struct coord3d property_pos2; + struct coord3d property_offset; + struct coord3d offset; + struct StandTile *room_pointer_tile; + struct coord3d stan_walk_start; + + property_pos = g_DefaultFrozenPlayerPos; + property_pos2 = g_DefaultFrozenPlayerPos2; + property_offset = g_DefaultFrozenPlayerOffset; + offset = g_DefaultFrozenMoveOffset; + + bondviewPlayerTickDamageAndHealth(); + bondviewPlayerTickExplode(); + bondviewProcessInput(0, 0, 0, 0); bondviewApplyVertaTheta(); bondviewMoveAnimationTick(0, 0, 0); - if ((0.0f != flt_CODE_bss_80079990) || (0.0f != flt_CODE_bss_80079990.unk8)) - { - // Node 2 - sp40 = (f32) (sp40 + (flt_CODE_bss_80079990 * g_GlobalTimerDelta)); - sp48 = (f32) (sp48 + (flt_CODE_bss_80079990.unk8 * g_GlobalTimerDelta)); - } - else + + if ((g_ForceBondMoveOffset.f[0] != 0.0f) || (g_ForceBondMoveOffset.f[2] != 0.0f)) { - + offset.f[0] += g_ForceBondMoveOffset.f[0] * g_GlobalTimerDelta; + offset.f[2] += g_ForceBondMoveOffset.f[2] * g_GlobalTimerDelta; } - // Node 3 - sp40 = (f32) (sp40 + (((g_CurrentPlayer->field_504 * g_CurrentPlayer->field_498) - (g_CurrentPlayer->field_4FC * g_CurrentPlayer->field_4A0)) * g_GlobalTimerDelta)); - sp48 = (f32) (sp48 + (((g_CurrentPlayer->field_504 * g_CurrentPlayer->field_4A0) + (g_CurrentPlayer->field_4FC * g_CurrentPlayer->field_498)) * g_GlobalTimerDelta)); - bondviewCalcUpdatePlayerCollision(0.0f, &sp40, 1); - bondviewUpdatePlayerClipping(0, 0, 0); + + offset.f[0] += ((g_CurrentPlayer->headpos.f[2] * g_CurrentPlayer->field_488.theta_transform.f[0]) - (g_CurrentPlayer->headpos.f[0] * g_CurrentPlayer->field_488.theta_transform.f[2])) * g_GlobalTimerDelta; + offset.f[2] += ((g_CurrentPlayer->headpos.f[2] * g_CurrentPlayer->field_488.theta_transform.f[2]) + (g_CurrentPlayer->headpos.f[0] * g_CurrentPlayer->field_488.theta_transform.f[0])) * g_GlobalTimerDelta; + + bondviewCalcUpdatePlayerCollision(&offset, 1); + bondviewUpdatePlayerY(0, 0.0f); bondviewUpdatePlayerCollisionPositionFields(); - if (g_CameraMode != CAMERAMODE_FP) + + if ((g_CameraMode == CAMERAMODE_FP_NOINPUT) || (g_CameraMode == CAMERAMODE_FP) || (g_CameraMode == CAMERAMODE_UNK10)) { - // Node 4 - if (g_CameraMode != CAMERAMODE_UNK10) - { - // Node 5 - if (g_CameraMode != CAMERAMODE_UNK10) - { - // Node 7 - sub_GAME_7F07B56C(arg_unalignedA, arg_unalignedE, &sp64, &sp58, &sp4C, &sp3C, &sp30); - currentPlayerSetField00(1); - // Node 8 - return currentPlayerSetField00(0); - } - } + currentPlayerSetField00(0); + return; } - // Node 6 - return currentPlayerSetField00(0); + + bondviewFrozenCameraTick(buttons, oldbuttons, &property_pos, &property_pos2, &property_offset, &room_pointer_tile, &stan_walk_start); + currentPlayerSetField00(1); + bondviewSetCurrentPlayerPosition(&property_pos, &property_pos2, &property_offset, room_pointer_tile, &stan_walk_start); } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F086990 -/* 0BB4C0 7F086990 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0BB4C4 7F086994 3C0F8003 */ lui $t7, %hi(D_80036800) -/* 0BB4C8 7F086998 AFBF0024 */ sw $ra, 0x24($sp) -/* 0BB4CC 7F08699C AFA40070 */ sw $a0, 0x70($sp) -/* 0BB4D0 7F0869A0 AFA50074 */ sw $a1, 0x74($sp) -/* 0BB4D4 7F0869A4 AFA60078 */ sw $a2, 0x78($sp) -/* 0BB4D8 7F0869A8 AFA7007C */ sw $a3, 0x7c($sp) -/* 0BB4DC 7F0869AC 25EF6800 */ addiu $t7, %lo(D_80036800) # addiu $t7, $t7, 0x6800 -/* 0BB4E0 7F0869B0 8DE10000 */ lw $at, ($t7) -/* 0BB4E4 7F0869B4 27AE0064 */ addiu $t6, $sp, 0x64 -/* 0BB4E8 7F0869B8 8DE80004 */ lw $t0, 4($t7) -/* 0BB4EC 7F0869BC ADC10000 */ sw $at, ($t6) -/* 0BB4F0 7F0869C0 8DE10008 */ lw $at, 8($t7) -/* 0BB4F4 7F0869C4 3C0A8003 */ lui $t2, %hi(D_8003680C) -/* 0BB4F8 7F0869C8 254A680C */ addiu $t2, %lo(D_8003680C) # addiu $t2, $t2, 0x680c -/* 0BB4FC 7F0869CC ADC80004 */ sw $t0, 4($t6) -/* 0BB500 7F0869D0 ADC10008 */ sw $at, 8($t6) -/* 0BB504 7F0869D4 8D410000 */ lw $at, ($t2) -/* 0BB508 7F0869D8 27A90058 */ addiu $t1, $sp, 0x58 -/* 0BB50C 7F0869DC 8D4D0004 */ lw $t5, 4($t2) -/* 0BB510 7F0869E0 AD210000 */ sw $at, ($t1) -/* 0BB514 7F0869E4 8D410008 */ lw $at, 8($t2) -/* 0BB518 7F0869E8 3C188003 */ lui $t8, %hi(D_80036818) -/* 0BB51C 7F0869EC 27186818 */ addiu $t8, %lo(D_80036818) # addiu $t8, $t8, 0x6818 -/* 0BB520 7F0869F0 AD2D0004 */ sw $t5, 4($t1) -/* 0BB524 7F0869F4 AD210008 */ sw $at, 8($t1) -/* 0BB528 7F0869F8 8F010000 */ lw $at, ($t8) -/* 0BB52C 7F0869FC 27B9004C */ addiu $t9, $sp, 0x4c -/* 0BB530 7F086A00 8F080004 */ lw $t0, 4($t8) -/* 0BB534 7F086A04 AF210000 */ sw $at, ($t9) -/* 0BB538 7F086A08 8F010008 */ lw $at, 8($t8) -/* 0BB53C 7F086A0C 3C0B8003 */ lui $t3, %hi(D_80036824) -/* 0BB540 7F086A10 256B6824 */ addiu $t3, %lo(D_80036824) # addiu $t3, $t3, 0x6824 -/* 0BB544 7F086A14 AF280004 */ sw $t0, 4($t9) -/* 0BB548 7F086A18 AF210008 */ sw $at, 8($t9) -/* 0BB54C 7F086A1C 8D610000 */ lw $at, ($t3) -/* 0BB550 7F086A20 27AC0040 */ addiu $t4, $sp, 0x40 -/* 0BB554 7F086A24 8D6D0004 */ lw $t5, 4($t3) -/* 0BB558 7F086A28 AD810000 */ sw $at, ($t4) -/* 0BB55C 7F086A2C 8D610008 */ lw $at, 8($t3) -/* 0BB560 7F086A30 AD8D0004 */ sw $t5, 4($t4) -/* 0BB564 7F086A34 0FC20FF2 */ jal sub_GAME_7F083FC8 -/* 0BB568 7F086A38 AD810008 */ sw $at, 8($t4) -/* 0BB56C 7F086A3C 0FC210D8 */ jal sub_GAME_7F084360 -/* 0BB570 7F086A40 00000000 */ nop -/* 0BB574 7F086A44 00002025 */ move $a0, $zero -/* 0BB578 7F086A48 00002825 */ move $a1, $zero -/* 0BB57C 7F086A4C 00003025 */ move $a2, $zero -/* 0BB580 7F086A50 0FC2065D */ jal controller_gameplay_interaction -/* 0BB584 7F086A54 00003825 */ move $a3, $zero -/* 0BB588 7F086A58 0FC205E4 */ jal bondviewApplyVertaTheta -/* 0BB58C 7F086A5C 00000000 */ nop -/* 0BB590 7F086A60 44806000 */ mtc1 $zero, $f12 -/* 0BB594 7F086A64 00000000 */ nop -/* 0BB598 7F086A68 44066000 */ mfc1 $a2, $f12 -/* 0BB59C 7F086A6C 0FC202CD */ jal bondviewMoveAnimationTick -/* 0BB5A0 7F086A70 46006386 */ mov.s $f14, $f12 -/* 0BB5A4 7F086A74 3C028008 */ lui $v0, %hi(flt_CODE_bss_80079990) -/* 0BB5A8 7F086A78 24429990 */ addiu $v0, %lo(flt_CODE_bss_80079990) # addiu $v0, $v0, -0x6670 -/* 0BB5AC 7F086A7C 44806000 */ mtc1 $zero, $f12 -/* 0BB5B0 7F086A80 C4420000 */ lwc1 $f2, ($v0) -/* 0BB5B4 7F086A84 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BB5B8 7F086A88 46026032 */ c.eq.s $f12, $f2 -/* 0BB5BC 7F086A8C 00000000 */ nop -/* 0BB5C0 7F086A90 45000006 */ bc1f .L7F086AAC -/* 0BB5C4 7F086A94 00000000 */ nop -/* 0BB5C8 7F086A98 C4440008 */ lwc1 $f4, 8($v0) -/* 0BB5CC 7F086A9C 46046032 */ c.eq.s $f12, $f4 -/* 0BB5D0 7F086AA0 00000000 */ nop -/* 0BB5D4 7F086AA4 4501000B */ bc1t .L7F086AD4 -/* 0BB5D8 7F086AA8 00000000 */ nop -.L7F086AAC: -/* 0BB5DC 7F086AAC C4208378 */ lwc1 $f0, %lo(g_GlobalTimerDelta)($at) -/* 0BB5E0 7F086AB0 C4520008 */ lwc1 $f18, 8($v0) -/* 0BB5E4 7F086AB4 C7A60040 */ lwc1 $f6, 0x40($sp) -/* 0BB5E8 7F086AB8 46001202 */ mul.s $f8, $f2, $f0 -/* 0BB5EC 7F086ABC C7B00048 */ lwc1 $f16, 0x48($sp) -/* 0BB5F0 7F086AC0 46009102 */ mul.s $f4, $f18, $f0 -/* 0BB5F4 7F086AC4 46083280 */ add.s $f10, $f6, $f8 -/* 0BB5F8 7F086AC8 46048180 */ add.s $f6, $f16, $f4 -/* 0BB5FC 7F086ACC E7AA0040 */ swc1 $f10, 0x40($sp) -/* 0BB600 7F086AD0 E7A60048 */ swc1 $f6, 0x48($sp) -.L7F086AD4: -/* 0BB604 7F086AD4 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0BB608 7F086AD8 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0BB60C 7F086ADC 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0BB610 7F086AE0 C4208378 */ lwc1 $f0, %lo(g_GlobalTimerDelta)($at) -/* 0BB614 7F086AE4 C4480504 */ lwc1 $f8, 0x504($v0) -/* 0BB618 7F086AE8 C44A0498 */ lwc1 $f10, 0x498($v0) -/* 0BB61C 7F086AEC C45004FC */ lwc1 $f16, 0x4fc($v0) -/* 0BB620 7F086AF0 C44404A0 */ lwc1 $f4, 0x4a0($v0) -/* 0BB624 7F086AF4 460A4482 */ mul.s $f18, $f8, $f10 -/* 0BB628 7F086AF8 27A40040 */ addiu $a0, $sp, 0x40 -/* 0BB62C 7F086AFC 24050001 */ li $a1, 1 -/* 0BB630 7F086B00 46048182 */ mul.s $f6, $f16, $f4 -/* 0BB634 7F086B04 C7B00040 */ lwc1 $f16, 0x40($sp) -/* 0BB638 7F086B08 46069201 */ sub.s $f8, $f18, $f6 -/* 0BB63C 7F086B0C 46004282 */ mul.s $f10, $f8, $f0 -/* 0BB640 7F086B10 460A8100 */ add.s $f4, $f16, $f10 -/* 0BB644 7F086B14 E7A40040 */ swc1 $f4, 0x40($sp) -/* 0BB648 7F086B18 C44604A0 */ lwc1 $f6, 0x4a0($v0) -/* 0BB64C 7F086B1C C4520504 */ lwc1 $f18, 0x504($v0) -/* 0BB650 7F086B20 C44A0498 */ lwc1 $f10, 0x498($v0) -/* 0BB654 7F086B24 C45004FC */ lwc1 $f16, 0x4fc($v0) -/* 0BB658 7F086B28 46069202 */ mul.s $f8, $f18, $f6 -/* 0BB65C 7F086B2C 00000000 */ nop -/* 0BB660 7F086B30 460A8102 */ mul.s $f4, $f16, $f10 -/* 0BB664 7F086B34 C7B00048 */ lwc1 $f16, 0x48($sp) -/* 0BB668 7F086B38 46044480 */ add.s $f18, $f8, $f4 -/* 0BB66C 7F086B3C 46009182 */ mul.s $f6, $f18, $f0 -/* 0BB670 7F086B40 46068280 */ add.s $f10, $f16, $f6 -/* 0BB674 7F086B44 0FC1F658 */ jal bondviewCalcUpdatePlayerCollision -/* 0BB678 7F086B48 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 0BB67C 7F086B4C 44806000 */ mtc1 $zero, $f12 -/* 0BB680 7F086B50 00002025 */ move $a0, $zero -/* 0BB684 7F086B54 44056000 */ mfc1 $a1, $f12 -/* 0BB688 7F086B58 0FC2037E */ jal bondviewUpdatePlayerClipping -/* 0BB68C 7F086B5C 00000000 */ nop -/* 0BB690 7F086B60 0FC2051E */ jal bondviewUpdatePlayerCollisionPositionFields -/* 0BB694 7F086B64 00000000 */ nop -/* 0BB698 7F086B68 3C028003 */ lui $v0, %hi(g_CameraMode) -/* 0BB69C 7F086B6C 8C426494 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0BB6A0 7F086B70 24010008 */ li $at, 8 -/* 0BB6A4 7F086B74 10410005 */ beq $v0, $at, .L7F086B8C -/* 0BB6A8 7F086B78 24010004 */ li $at, 4 -/* 0BB6AC 7F086B7C 10410003 */ beq $v0, $at, .L7F086B8C -/* 0BB6B0 7F086B80 2401000A */ li $at, 10 -/* 0BB6B4 7F086B84 14410005 */ bne $v0, $at, .L7F086B9C -/* 0BB6B8 7F086B88 97A4007A */ lhu $a0, 0x7a($sp) -.L7F086B8C: -/* 0BB6BC 7F086B8C 0FC1E694 */ jal currentPlayerSetField00 -/* 0BB6C0 7F086B90 00002025 */ move $a0, $zero -/* 0BB6C4 7F086B94 10000015 */ b .L7F086BEC -/* 0BB6C8 7F086B98 8FBF0024 */ lw $ra, 0x24($sp) -.L7F086B9C: -/* 0BB6CC 7F086B9C 27AF004C */ addiu $t7, $sp, 0x4c -/* 0BB6D0 7F086BA0 27AE003C */ addiu $t6, $sp, 0x3c -/* 0BB6D4 7F086BA4 27B90030 */ addiu $t9, $sp, 0x30 -/* 0BB6D8 7F086BA8 AFB90018 */ sw $t9, 0x18($sp) -/* 0BB6DC 7F086BAC AFAE0014 */ sw $t6, 0x14($sp) -/* 0BB6E0 7F086BB0 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BB6E4 7F086BB4 97A5007E */ lhu $a1, 0x7e($sp) -/* 0BB6E8 7F086BB8 27A60064 */ addiu $a2, $sp, 0x64 -/* 0BB6EC 7F086BBC 0FC1ED5B */ jal sub_GAME_7F07B56C -/* 0BB6F0 7F086BC0 27A70058 */ addiu $a3, $sp, 0x58 -/* 0BB6F4 7F086BC4 0FC1E694 */ jal currentPlayerSetField00 -/* 0BB6F8 7F086BC8 24040001 */ li $a0, 1 -/* 0BB6FC 7F086BCC 27B80030 */ addiu $t8, $sp, 0x30 -/* 0BB700 7F086BD0 AFB80010 */ sw $t8, 0x10($sp) -/* 0BB704 7F086BD4 27A40064 */ addiu $a0, $sp, 0x64 -/* 0BB708 7F086BD8 27A50058 */ addiu $a1, $sp, 0x58 -/* 0BB70C 7F086BDC 27A6004C */ addiu $a2, $sp, 0x4c -/* 0BB710 7F086BE0 0FC1E698 */ jal bondviewUpdateCurrentPlayerPosition -/* 0BB714 7F086BE4 8FA7003C */ lw $a3, 0x3c($sp) -/* 0BB718 7F086BE8 8FBF0024 */ lw $ra, 0x24($sp) -.L7F086BEC: -/* 0BB71C 7F086BEC 27BD0070 */ addiu $sp, $sp, 0x70 -/* 0BB720 7F086BF0 03E00008 */ jr $ra -/* 0BB724 7F086BF4 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel sub_GAME_7F086990 -/* 0B94A0 7F086AB0 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0B94A4 7F086AB4 3C0F8003 */ lui $t7, %hi(D_80036800) # $t7, 0x8003 -/* 0B94A8 7F086AB8 AFBF0024 */ sw $ra, 0x24($sp) -/* 0B94AC 7F086ABC AFA40070 */ sw $a0, 0x70($sp) -/* 0B94B0 7F086AC0 AFA50074 */ sw $a1, 0x74($sp) -/* 0B94B4 7F086AC4 AFA60078 */ sw $a2, 0x78($sp) -/* 0B94B8 7F086AC8 AFA7007C */ sw $a3, 0x7c($sp) -/* 0B94BC 7F086ACC 25EF1D50 */ addiu $t7, %lo(D_80036800) # addiu $t7, $t7, 0x1d50 -/* 0B94C0 7F086AD0 8DE10000 */ lw $at, ($t7) -/* 0B94C4 7F086AD4 27AE0064 */ addiu $t6, $sp, 0x64 -/* 0B94C8 7F086AD8 8DE80004 */ lw $t0, 4($t7) -/* 0B94CC 7F086ADC ADC10000 */ sw $at, ($t6) -/* 0B94D0 7F086AE0 8DE10008 */ lw $at, 8($t7) -/* 0B94D4 7F086AE4 3C0A8003 */ lui $t2, %hi(D_8003680C) # $t2, 0x8003 -/* 0B94D8 7F086AE8 254A1D5C */ addiu $t2, %lo(D_8003680C) # addiu $t2, $t2, 0x1d5c -/* 0B94DC 7F086AEC ADC80004 */ sw $t0, 4($t6) -/* 0B94E0 7F086AF0 ADC10008 */ sw $at, 8($t6) -/* 0B94E4 7F086AF4 8D410000 */ lw $at, ($t2) -/* 0B94E8 7F086AF8 27A90058 */ addiu $t1, $sp, 0x58 -/* 0B94EC 7F086AFC 8D4D0004 */ lw $t5, 4($t2) -/* 0B94F0 7F086B00 AD210000 */ sw $at, ($t1) -/* 0B94F4 7F086B04 8D410008 */ lw $at, 8($t2) -/* 0B94F8 7F086B08 3C188003 */ lui $t8, %hi(D_80036818) # $t8, 0x8003 -/* 0B94FC 7F086B0C 27181D68 */ addiu $t8, %lo(D_80036818) # addiu $t8, $t8, 0x1d68 -/* 0B9500 7F086B10 AD2D0004 */ sw $t5, 4($t1) -/* 0B9504 7F086B14 AD210008 */ sw $at, 8($t1) -/* 0B9508 7F086B18 8F010000 */ lw $at, ($t8) -/* 0B950C 7F086B1C 27B9004C */ addiu $t9, $sp, 0x4c -/* 0B9510 7F086B20 8F080004 */ lw $t0, 4($t8) -/* 0B9514 7F086B24 AF210000 */ sw $at, ($t9) -/* 0B9518 7F086B28 8F010008 */ lw $at, 8($t8) -/* 0B951C 7F086B2C 3C0B8003 */ lui $t3, %hi(D_80036824) # $t3, 0x8003 -/* 0B9520 7F086B30 256B1D74 */ addiu $t3, %lo(D_80036824) # addiu $t3, $t3, 0x1d74 -/* 0B9524 7F086B34 AF280004 */ sw $t0, 4($t9) -/* 0B9528 7F086B38 AF210008 */ sw $at, 8($t9) -/* 0B952C 7F086B3C 8D610000 */ lw $at, ($t3) -/* 0B9530 7F086B40 27AC0040 */ addiu $t4, $sp, 0x40 -/* 0B9534 7F086B44 8D6D0004 */ lw $t5, 4($t3) -/* 0B9538 7F086B48 AD810000 */ sw $at, ($t4) -/* 0B953C 7F086B4C 8D610008 */ lw $at, 8($t3) -/* 0B9540 7F086B50 AD8D0004 */ sw $t5, 4($t4) -/* 0B9544 7F086B54 0FC2101B */ jal sub_GAME_7F083FC8 -/* 0B9548 7F086B58 AD810008 */ sw $at, 8($t4) -/* 0B954C 7F086B5C 0FC21129 */ jal sub_GAME_7F084360 -/* 0B9550 7F086B60 00000000 */ nop -/* 0B9554 7F086B64 00002025 */ move $a0, $zero -/* 0B9558 7F086B68 00002825 */ move $a1, $zero -/* 0B955C 7F086B6C 00003025 */ move $a2, $zero -/* 0B9560 7F086B70 0FC20686 */ jal controller_gameplay_interaction -/* 0B9564 7F086B74 00003825 */ move $a3, $zero -/* 0B9568 7F086B78 0FC2060D */ jal bondviewApplyVertaTheta -/* 0B956C 7F086B7C 00000000 */ nop -/* 0B9570 7F086B80 44806000 */ mtc1 $zero, $f12 -/* 0B9574 7F086B84 00000000 */ nop -/* 0B9578 7F086B88 44066000 */ mfc1 $a2, $f12 -/* 0B957C 7F086B8C 0FC202F6 */ jal bondviewMoveAnimationTick -/* 0B9580 7F086B90 46006386 */ mov.s $f14, $f12 -/* 0B9584 7F086B94 3C028007 */ lui $v0, %hi(flt_CODE_bss_80079990) # $v0, 0x8007 -/* 0B9588 7F086B98 24428470 */ addiu $v0, %lo(flt_CODE_bss_80079990) # addiu $v0, $v0, -0x7b90 -/* 0B958C 7F086B9C 44806000 */ mtc1 $zero, $f12 -/* 0B9590 7F086BA0 C4420000 */ lwc1 $f2, ($v0) -/* 0B9594 7F086BA4 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B9598 7F086BA8 46026032 */ c.eq.s $f12, $f2 -/* 0B959C 7F086BAC 00000000 */ nop -/* 0B95A0 7F086BB0 45000006 */ bc1f .L7F086BCC -/* 0B95A4 7F086BB4 00000000 */ nop -/* 0B95A8 7F086BB8 C4440008 */ lwc1 $f4, 8($v0) -/* 0B95AC 7F086BBC 46046032 */ c.eq.s $f12, $f4 -/* 0B95B0 7F086BC0 00000000 */ nop -/* 0B95B4 7F086BC4 4501000B */ bc1t .L7F086BF4 -/* 0B95B8 7F086BC8 00000000 */ nop -.L7F086BCC: -/* 0B95BC 7F086BCC C4201004 */ lwc1 $f0, %lo(g_GlobalTimerDelta)($at) -/* 0B95C0 7F086BD0 C4520008 */ lwc1 $f18, 8($v0) -/* 0B95C4 7F086BD4 C7A60040 */ lwc1 $f6, 0x40($sp) -/* 0B95C8 7F086BD8 46001202 */ mul.s $f8, $f2, $f0 -/* 0B95CC 7F086BDC C7B00048 */ lwc1 $f16, 0x48($sp) -/* 0B95D0 7F086BE0 46009102 */ mul.s $f4, $f18, $f0 -/* 0B95D4 7F086BE4 46083280 */ add.s $f10, $f6, $f8 -/* 0B95D8 7F086BE8 46048180 */ add.s $f6, $f16, $f4 -/* 0B95DC 7F086BEC E7AA0040 */ swc1 $f10, 0x40($sp) -/* 0B95E0 7F086BF0 E7A60048 */ swc1 $f6, 0x48($sp) -.L7F086BF4: -/* 0B95E4 7F086BF4 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B95E8 7F086BF8 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B95EC 7F086BFC 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 -/* 0B95F0 7F086C00 C4201004 */ lwc1 $f0, %lo(g_GlobalTimerDelta)($at) -/* 0B95F4 7F086C04 C4480504 */ lwc1 $f8, 0x504($v0) -/* 0B95F8 7F086C08 C44A0498 */ lwc1 $f10, 0x498($v0) -/* 0B95FC 7F086C0C C45004FC */ lwc1 $f16, 0x4fc($v0) -/* 0B9600 7F086C10 C44404A0 */ lwc1 $f4, 0x4a0($v0) -/* 0B9604 7F086C14 460A4482 */ mul.s $f18, $f8, $f10 -/* 0B9608 7F086C18 27A40040 */ addiu $a0, $sp, 0x40 -/* 0B960C 7F086C1C 24050001 */ li $a1, 1 -/* 0B9610 7F086C20 46048182 */ mul.s $f6, $f16, $f4 -/* 0B9614 7F086C24 C7B00040 */ lwc1 $f16, 0x40($sp) -/* 0B9618 7F086C28 46069201 */ sub.s $f8, $f18, $f6 -/* 0B961C 7F086C2C 46004282 */ mul.s $f10, $f8, $f0 -/* 0B9620 7F086C30 460A8100 */ add.s $f4, $f16, $f10 -/* 0B9624 7F086C34 E7A40040 */ swc1 $f4, 0x40($sp) -/* 0B9628 7F086C38 C44604A0 */ lwc1 $f6, 0x4a0($v0) -/* 0B962C 7F086C3C C4520504 */ lwc1 $f18, 0x504($v0) -/* 0B9630 7F086C40 C44A0498 */ lwc1 $f10, 0x498($v0) -/* 0B9634 7F086C44 C45004FC */ lwc1 $f16, 0x4fc($v0) -/* 0B9638 7F086C48 46069202 */ mul.s $f8, $f18, $f6 -/* 0B963C 7F086C4C 00000000 */ nop -/* 0B9640 7F086C50 460A8102 */ mul.s $f4, $f16, $f10 -/* 0B9644 7F086C54 C7B00048 */ lwc1 $f16, 0x48($sp) -/* 0B9648 7F086C58 46044480 */ add.s $f18, $f8, $f4 -/* 0B964C 7F086C5C 46009182 */ mul.s $f6, $f18, $f0 -/* 0B9650 7F086C60 46068280 */ add.s $f10, $f16, $f6 -/* 0B9654 7F086C64 0FC1F68D */ jal bondviewCalcUpdatePlayerCollision -/* 0B9658 7F086C68 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 0B965C 7F086C6C 44806000 */ mtc1 $zero, $f12 -/* 0B9660 7F086C70 00002025 */ move $a0, $zero -/* 0B9664 7F086C74 44056000 */ mfc1 $a1, $f12 -/* 0B9668 7F086C78 0FC203A7 */ jal bondviewUpdatePlayerClipping -/* 0B966C 7F086C7C 00000000 */ nop -/* 0B9670 7F086C80 0FC20547 */ jal bondviewUpdatePlayerCollisionPositionFields -/* 0B9674 7F086C84 00000000 */ nop -/* 0B9678 7F086C88 3C028003 */ lui $v0, %hi(g_CameraMode) # $v0, 0x8003 -/* 0B967C 7F086C8C 8C4219E4 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0B9680 7F086C90 24010008 */ li $at, 8 -/* 0B9684 7F086C94 10410005 */ beq $v0, $at, .L7F086CAC -/* 0B9688 7F086C98 24010004 */ li $at, 4 -/* 0B968C 7F086C9C 10410003 */ beq $v0, $at, .L7F086CAC -/* 0B9690 7F086CA0 2401000A */ li $at, 10 -/* 0B9694 7F086CA4 14410005 */ bne $v0, $at, .L7F086CBC -/* 0B9698 7F086CA8 97A4007A */ lhu $a0, 0x7a($sp) -.L7F086CAC: -/* 0B969C 7F086CAC 0FC1E6B4 */ jal currentPlayerSetField00 -/* 0B96A0 7F086CB0 00002025 */ move $a0, $zero -/* 0B96A4 7F086CB4 10000015 */ b .L7F086D0C -/* 0B96A8 7F086CB8 8FBF0024 */ lw $ra, 0x24($sp) -.L7F086CBC: -/* 0B96AC 7F086CBC 27AF004C */ addiu $t7, $sp, 0x4c -/* 0B96B0 7F086CC0 27AE003C */ addiu $t6, $sp, 0x3c -/* 0B96B4 7F086CC4 27B90030 */ addiu $t9, $sp, 0x30 -/* 0B96B8 7F086CC8 AFB90018 */ sw $t9, 0x18($sp) -/* 0B96BC 7F086CCC AFAE0014 */ sw $t6, 0x14($sp) -/* 0B96C0 7F086CD0 AFAF0010 */ sw $t7, 0x10($sp) -/* 0B96C4 7F086CD4 97A5007E */ lhu $a1, 0x7e($sp) -/* 0B96C8 7F086CD8 27A60064 */ addiu $a2, $sp, 0x64 -/* 0B96CC 7F086CDC 0FC1ED81 */ jal sub_GAME_7F07B56C -/* 0B96D0 7F086CE0 27A70058 */ addiu $a3, $sp, 0x58 -/* 0B96D4 7F086CE4 0FC1E6B4 */ jal currentPlayerSetField00 -/* 0B96D8 7F086CE8 24040001 */ li $a0, 1 -/* 0B96DC 7F086CEC 27B80030 */ addiu $t8, $sp, 0x30 -/* 0B96E0 7F086CF0 AFB80010 */ sw $t8, 0x10($sp) -/* 0B96E4 7F086CF4 27A40064 */ addiu $a0, $sp, 0x64 -/* 0B96E8 7F086CF8 27A50058 */ addiu $a1, $sp, 0x58 -/* 0B96EC 7F086CFC 27A6004C */ addiu $a2, $sp, 0x4c -/* 0B96F0 7F086D00 0FC1E6B8 */ jal bondviewUpdateCurrentPlayerPosition -/* 0B96F4 7F086D04 8FA7003C */ lw $a3, 0x3c($sp) -/* 0B96F8 7F086D08 8FBF0024 */ lw $ra, 0x24($sp) -.L7F086D0C: -/* 0B96FC 7F086D0C 27BD0070 */ addiu $sp, $sp, 0x70 -/* 0B9700 7F086D10 03E00008 */ jr $ra -/* 0B9704 7F086D14 00000000 */ nop -) -#endif -#endif - - @@ -33670,12 +12095,10 @@ s16 bondviewGetCurrentPlayerViewportUly(void) } } - -#ifndef VERSION_EU /* VERSION_US, VERSION_JP, unspecified */ /** * Sets/updates viewport for player. * Refreshes autoaim setting. - * Arguments are passed into MoveBond or sub_GAME_7F086990. + * Arguments are passed into MoveBond or bondviewFrozenMoveBond. * Checks if necessary to call bossReturnTitleStage. * Set player->buttons_pressed to arg2. * @@ -33689,8 +12112,13 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) f32 faspect; #endif - set_cur_player_fovy(60.0f); - viSetFovY(60.0f); + set_cur_player_fovy(FOV_Y_F); + + // This call doesn't do anything, the call viSetFovY(g_CurrentPlayer->fovy); in lvlRender + // will actually change the field of view. + // The call above should set g_CurrentPlayer->fovy, but it doesn't seem to affect + // the fov.... + viSetFovY(FOV_Y_F); if (camera_80036430 != 0) { @@ -33737,7 +12165,7 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) if (camera_8003642C == 0) { - faspect *= WIDESCREEN_ASPECT; + faspect *= EU_CAMERA_8003642C_ASPECT; } set_cur_player_aspect(faspect); @@ -33768,14 +12196,18 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) set_BONDdata_autoaim_y(cur_player_get_autoaim()); set_BONDdata_autoaim_x(cur_player_get_autoaim()); set_BONDdata_lookahead_setting(cur_player_get_lookahead()); - set_unset_ammo_on_screen_setting(1, cur_player_get_ammo_onscreen_setting()); + gunSetGunAmmoVisible(GUNAMMOREASON_OPTION, cur_player_get_ammo_onscreen_setting()); - set_unset_bitflags( - 1, - (getPlayerCount() == 1 && cur_player_get_sight_onscreen_control() != 0) - || (getPlayerCount() >= 2 && g_playerPerm->sight != 0) + gunSetSightVisible( + GUNSIGHTREASON_1, + (getPlayerCount() == 1 && cur_player_get_sight_onscreen_control()) + || (getPlayerCount() >= 2 && g_playerPerm->sight) ); +#if defined(VERSION_EU) + if (1); +#endif + if ((g_CameraMode == CAMERAMODE_NONE) || ((g_CameraMode == CAMERAMODE_FP) && (D_800364B0 != 0)) || (g_CameraMode == CAMERAMODE_UNK10)) { if (get_cur_playernum() == 0) @@ -33787,7 +12219,7 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) } else { - sub_GAME_7F086990(arg0, arg1, arg2, (u16) g_CurrentPlayer->buttons_pressed); + bondviewFrozenMoveBond(arg0, arg1, arg2, (u16) g_CurrentPlayer->buttons_pressed); } #if defined(BUGFIX_R1) @@ -33799,7 +12231,7 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) if (stop_time_flag != 0) { - if ((lvlGetControlsLockedFlag() == 0) && ((arg2 & ~(g_CurrentPlayer->buttons_pressed) & 0xF030))) + if ((lvlGetControlsLockedFlag() == 0) && ((arg2 & ~(g_CurrentPlayer->buttons_pressed) & (CONT_A | B_BUTTON | Z_TRIG | START_BUTTON | CONT_R | CONT_L)))) { stop_time_flag = 2; @@ -33826,7 +12258,7 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) } } - if (enable_move_after_cinema) + if (g_CameraAfterCinema) { sub_GAME_7F07B1A4(); } @@ -33844,7 +12276,7 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) }; } - if (g_CurrentPlayer->redbloodfinished && g_CurrentPlayer->deathanimfinished && (D_80036510 >= 3)) + if (g_CurrentPlayer->redbloodfinished && g_CurrentPlayer->deathanimfinished && (D_80036510 >= CAMERAMODE_SWIRL)) { bossRunTitleStage(); } @@ -33858,423 +12290,6 @@ void bondviewMovePlayerUpdateViewport(s8 arg0, s8 arg1, u16 arg2) g_CurrentPlayer->buttons_pressed = arg2; } -#else /* VERSION_EU */ -GLOBAL_ASM( -.late_rodata -glabel D_80055264 -.word 0x3fe38e39 /*1.7777778*/ -glabel D_80055268 -.word 0x3f986186 -.text -glabel bondviewMovePlayerUpdateViewport -/* 0B9AAC 7F0870BC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0B9AB0 7F0870C0 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B9AB4 7F0870C4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0B9AB8 7F0870C8 44816000 */ mtc1 $at, $f12 -/* 0B9ABC 7F0870CC AFA40020 */ sw $a0, 0x20($sp) -/* 0B9AC0 7F0870D0 AFA50024 */ sw $a1, 0x24($sp) -/* 0B9AC4 7F0870D4 0FC269D5 */ jal set_cur_player_fovy -/* 0B9AC8 7F0870D8 AFA60028 */ sw $a2, 0x28($sp) -/* 0B9ACC 7F0870DC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B9AD0 7F0870E0 44816000 */ mtc1 $at, $f12 -/* 0B9AD4 7F0870E4 0C000FE5 */ jal viSetFovY -/* 0B9AD8 7F0870E8 00000000 */ nop -/* 0B9ADC 7F0870EC 3C038003 */ lui $v1, %hi(camera_80036430) # $v1, 0x8003 -/* 0B9AE0 7F0870F0 24631980 */ addiu $v1, %lo(camera_80036430) # addiu $v1, $v1, 0x1980 -/* 0B9AE4 7F0870F4 8C620000 */ lw $v0, ($v1) -/* 0B9AE8 7F0870F8 10400016 */ beqz $v0, .L7F087154 -/* 0B9AEC 7F0870FC 28410004 */ slti $at, $v0, 4 -/* 0B9AF0 7F087100 14200010 */ bnez $at, .L7F087144 -/* 0B9AF4 7F087104 3C0E8003 */ lui $t6, %hi(resolution) # $t6, 0x8003 -/* 0B9AF8 7F087108 8DCE1978 */ lw $t6, %lo(resolution)($t6) -/* 0B9AFC 7F08710C 51C0000E */ beql $t6, $zero, .L7F087148 -/* 0B9B00 7F087110 8C790000 */ lw $t9, ($v1) -/* 0B9B04 7F087114 0C000D9B */ jal viGetFrameBuf2 -/* 0B9B08 7F087118 00000000 */ nop -/* 0B9B0C 7F08711C 3C0F803D */ lui $t7, %hi(cfb_16+0x2a800) # $t7, 0x803d -/* 0B9B10 7F087120 25EF5800 */ addiu $t7, %lo(cfb_16+0x2a800) # addiu $t7, $t7, 0x5800 -/* 0B9B14 7F087124 3C038003 */ lui $v1, %hi(camera_80036430) # $v1, 0x8003 -/* 0B9B18 7F087128 144F0006 */ bne $v0, $t7, .L7F087144 -/* 0B9B1C 7F08712C 24631980 */ addiu $v1, %lo(camera_80036430) # addiu $v1, $v1, 0x1980 -/* 0B9B20 7F087130 24180001 */ li $t8, 1 -/* 0B9B24 7F087134 3C018003 */ lui $at, %hi(camera_8003642C) # $at, 0x8003 -/* 0B9B28 7F087138 AC38197C */ sw $t8, %lo(camera_8003642C)($at) -/* 0B9B2C 7F08713C 1000001A */ b .L7F0871A8 -/* 0B9B30 7F087140 AC600000 */ sw $zero, ($v1) -.L7F087144: -/* 0B9B34 7F087144 8C790000 */ lw $t9, ($v1) -.L7F087148: -/* 0B9B38 7F087148 27280001 */ addiu $t0, $t9, 1 -/* 0B9B3C 7F08714C 10000016 */ b .L7F0871A8 -/* 0B9B40 7F087150 AC680000 */ sw $t0, ($v1) -.L7F087154: -/* 0B9B44 7F087154 3C038003 */ lui $v1, %hi(camera_80036434) # $v1, 0x8003 -/* 0B9B48 7F087158 24631984 */ addiu $v1, %lo(camera_80036434) # addiu $v1, $v1, 0x1984 -/* 0B9B4C 7F08715C 8C620000 */ lw $v0, ($v1) -/* 0B9B50 7F087160 10400011 */ beqz $v0, .L7F0871A8 -/* 0B9B54 7F087164 28410004 */ slti $at, $v0, 4 -/* 0B9B58 7F087168 5420000D */ bnezl $at, .L7F0871A0 -/* 0B9B5C 7F08716C 8C6A0000 */ lw $t2, ($v1) -/* 0B9B60 7F087170 0C000D9B */ jal viGetFrameBuf2 -/* 0B9B64 7F087174 00000000 */ nop -/* 0B9B68 7F087178 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b -/* 0B9B6C 7F08717C 2529B000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, -0x5000 -/* 0B9B70 7F087180 3C038003 */ lui $v1, %hi(camera_80036434) # $v1, 0x8003 -/* 0B9B74 7F087184 14490005 */ bne $v0, $t1, .L7F08719C -/* 0B9B78 7F087188 24631984 */ addiu $v1, %lo(camera_80036434) # addiu $v1, $v1, 0x1984 -/* 0B9B7C 7F08718C 3C018003 */ lui $at, %hi(camera_8003642C) # $at, 0x8003 -/* 0B9B80 7F087190 AC20197C */ sw $zero, %lo(camera_8003642C)($at) -/* 0B9B84 7F087194 10000004 */ b .L7F0871A8 -/* 0B9B88 7F087198 AC600000 */ sw $zero, ($v1) -.L7F08719C: -/* 0B9B8C 7F08719C 8C6A0000 */ lw $t2, ($v1) -.L7F0871A0: -/* 0B9B90 7F0871A0 254B0001 */ addiu $t3, $t2, 1 -/* 0B9B94 7F0871A4 AC6B0000 */ sw $t3, ($v1) -.L7F0871A8: -/* 0B9B98 7F0871A8 3C0C8003 */ lui $t4, %hi(camera_8003642C) # $t4, 0x8003 -/* 0B9B9C 7F0871AC 8D8C197C */ lw $t4, %lo(camera_8003642C)($t4) -/* 0B9BA0 7F0871B0 11800009 */ beqz $t4, .L7F0871D8 -/* 0B9BA4 7F0871B4 00000000 */ nop -/* 0B9BA8 7F0871B8 0C000D9B */ jal viGetFrameBuf2 -/* 0B9BAC 7F0871BC 00000000 */ nop -/* 0B9BB0 7F0871C0 3C0D803D */ lui $t5, %hi(cfb_16+0x2a800) # $t5, 0x803d -/* 0B9BB4 7F0871C4 25AD5800 */ addiu $t5, %lo(cfb_16+0x2a800) # addiu $t5, $t5, 0x5800 -/* 0B9BB8 7F0871C8 144D0003 */ bne $v0, $t5, .L7F0871D8 -/* 0B9BBC 7F0871CC 3C048003 */ lui $a0, %hi(resolution) # $a0, 0x8003 -/* 0B9BC0 7F0871D0 0C000DA3 */ jal viSetFrameBuf2 -/* 0B9BC4 7F0871D4 8C841978 */ lw $a0, %lo(resolution)($a0) -.L7F0871D8: -/* 0B9BC8 7F0871D8 0FC29080 */ jal get_screen_ratio -/* 0B9BCC 7F0871DC 00000000 */ nop -/* 0B9BD0 7F0871E0 24010001 */ li $at, 1 -/* 0B9BD4 7F0871E4 14410014 */ bne $v0, $at, .L7F087238 -/* 0B9BD8 7F0871E8 00000000 */ nop -/* 0B9BDC 7F0871EC 0FC21B58 */ jal bondviewGetCurrentPlayerViewportWidth -/* 0B9BE0 7F0871F0 00000000 */ nop -/* 0B9BE4 7F0871F4 0FC21B91 */ jal bondviewGetCurrentPlayerViewportHeight -/* 0B9BE8 7F0871F8 A7A2001A */ sh $v0, 0x1a($sp) -/* 0B9BEC 7F0871FC 87AE001A */ lh $t6, 0x1a($sp) -/* 0B9BF0 7F087200 44824000 */ mtc1 $v0, $f8 -/* 0B9BF4 7F087204 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 0B9BF8 7F087208 448E2000 */ mtc1 $t6, $f4 -/* 0B9BFC 7F08720C 468042A0 */ cvt.s.w $f10, $f8 -/* 0B9C00 7F087210 44819000 */ mtc1 $at, $f18 -/* 0B9C04 7F087214 3C018005 */ lui $at, %hi(D_80055264) # $at, 0x8005 -/* 0B9C08 7F087218 C428AE38 */ lwc1 $f8, %lo(D_80055264)($at) -/* 0B9C0C 7F08721C 468021A0 */ cvt.s.w $f6, $f4 -/* 0B9C10 7F087220 460A3403 */ div.s $f16, $f6, $f10 -/* 0B9C14 7F087224 46128102 */ mul.s $f4, $f16, $f18 -/* 0B9C18 7F087228 00000000 */ nop -/* 0B9C1C 7F08722C 46082302 */ mul.s $f12, $f4, $f8 -/* 0B9C20 7F087230 1000000B */ b .L7F087260 -/* 0B9C24 7F087234 00000000 */ nop -.L7F087238: -/* 0B9C28 7F087238 0FC21B58 */ jal bondviewGetCurrentPlayerViewportWidth -/* 0B9C2C 7F08723C 00000000 */ nop -/* 0B9C30 7F087240 0FC21B91 */ jal bondviewGetCurrentPlayerViewportHeight -/* 0B9C34 7F087244 A7A2001A */ sh $v0, 0x1a($sp) -/* 0B9C38 7F087248 87AF001A */ lh $t7, 0x1a($sp) -/* 0B9C3C 7F08724C 44828000 */ mtc1 $v0, $f16 -/* 0B9C40 7F087250 448F3000 */ mtc1 $t7, $f6 -/* 0B9C44 7F087254 468084A0 */ cvt.s.w $f18, $f16 -/* 0B9C48 7F087258 468032A0 */ cvt.s.w $f10, $f6 -/* 0B9C4C 7F08725C 46125303 */ div.s $f12, $f10, $f18 -.L7F087260: -/* 0B9C50 7F087260 3C188003 */ lui $t8, %hi(camera_8003642C) # $t8, 0x8003 -/* 0B9C54 7F087264 8F18197C */ lw $t8, %lo(camera_8003642C)($t8) -/* 0B9C58 7F087268 17000004 */ bnez $t8, .L7F08727C -/* 0B9C5C 7F08726C 3C018005 */ lui $at, %hi(D_80055268) # $at, 0x8005 -/* 0B9C60 7F087270 C424AE3C */ lwc1 $f4, %lo(D_80055268)($at) -/* 0B9C64 7F087274 46046302 */ mul.s $f12, $f12, $f4 -/* 0B9C68 7F087278 00000000 */ nop -.L7F08727C: -/* 0B9C6C 7F08727C 0FC269D9 */ jal set_cur_player_aspect -/* 0B9C70 7F087280 E7AC001C */ swc1 $f12, 0x1c($sp) -/* 0B9C74 7F087284 0C000FF8 */ jal viSetAspect -/* 0B9C78 7F087288 C7AC001C */ lwc1 $f12, 0x1c($sp) -/* 0B9C7C 7F08728C 0FC21B58 */ jal bondviewGetCurrentPlayerViewportWidth -/* 0B9C80 7F087290 00000000 */ nop -/* 0B9C84 7F087294 0FC21B91 */ jal bondviewGetCurrentPlayerViewportHeight -/* 0B9C88 7F087298 A7A20018 */ sh $v0, 0x18($sp) -/* 0B9C8C 7F08729C 87A40018 */ lh $a0, 0x18($sp) -/* 0B9C90 7F0872A0 0FC269C7 */ jal set_cur_player_screen_size -/* 0B9C94 7F0872A4 00402825 */ move $a1, $v0 -/* 0B9C98 7F0872A8 0FC21B79 */ jal get_curplayer_viewport_ulx -/* 0B9C9C 7F0872AC 00000000 */ nop -/* 0B9CA0 7F0872B0 0FC21BD6 */ jal bondviewGetCurrentPlayerViewportUly -/* 0B9CA4 7F0872B4 A7A20018 */ sh $v0, 0x18($sp) -/* 0B9CA8 7F0872B8 87A40018 */ lh $a0, 0x18($sp) -/* 0B9CAC 7F0872BC 0FC269CE */ jal set_cur_player_viewport_size -/* 0B9CB0 7F0872C0 00402825 */ move $a1, $v0 -/* 0B9CB4 7F0872C4 0FC21B46 */ jal getWidth320or440 -/* 0B9CB8 7F0872C8 00000000 */ nop -/* 0B9CBC 7F0872CC 0FC21B4F */ jal getHeight330or240 -/* 0B9CC0 7F0872D0 A7A20018 */ sh $v0, 0x18($sp) -/* 0B9CC4 7F0872D4 00022C00 */ sll $a1, $v0, 0x10 -/* 0B9CC8 7F0872D8 0005CC03 */ sra $t9, $a1, 0x10 -/* 0B9CCC 7F0872DC 03202825 */ move $a1, $t9 -/* 0B9CD0 7F0872E0 0C000F92 */ jal viSetXY -/* 0B9CD4 7F0872E4 87A40018 */ lh $a0, 0x18($sp) -/* 0B9CD8 7F0872E8 0FC21B46 */ jal getWidth320or440 -/* 0B9CDC 7F0872EC 00000000 */ nop -/* 0B9CE0 7F0872F0 0FC21B4F */ jal getHeight330or240 -/* 0B9CE4 7F0872F4 A7A20018 */ sh $v0, 0x18($sp) -/* 0B9CE8 7F0872F8 00022C00 */ sll $a1, $v0, 0x10 -/* 0B9CEC 7F0872FC 00054403 */ sra $t0, $a1, 0x10 -/* 0B9CF0 7F087300 01002825 */ move $a1, $t0 -/* 0B9CF4 7F087304 0C000F81 */ jal viSetBuf -/* 0B9CF8 7F087308 87A40018 */ lh $a0, 0x18($sp) -/* 0B9CFC 7F08730C 0FC21B58 */ jal bondviewGetCurrentPlayerViewportWidth -/* 0B9D00 7F087310 00000000 */ nop -/* 0B9D04 7F087314 0FC21B91 */ jal bondviewGetCurrentPlayerViewportHeight -/* 0B9D08 7F087318 A7A20018 */ sh $v0, 0x18($sp) -/* 0B9D0C 7F08731C 00022C00 */ sll $a1, $v0, 0x10 -/* 0B9D10 7F087320 00054C03 */ sra $t1, $a1, 0x10 -/* 0B9D14 7F087324 01202825 */ move $a1, $t1 -/* 0B9D18 7F087328 0C000FA3 */ jal viSetViewSize -/* 0B9D1C 7F08732C 87A40018 */ lh $a0, 0x18($sp) -/* 0B9D20 7F087330 0FC21B79 */ jal get_curplayer_viewport_ulx -/* 0B9D24 7F087334 00000000 */ nop -/* 0B9D28 7F087338 0FC21BD6 */ jal bondviewGetCurrentPlayerViewportUly -/* 0B9D2C 7F08733C A7A20018 */ sh $v0, 0x18($sp) -/* 0B9D30 7F087340 00022C00 */ sll $a1, $v0, 0x10 -/* 0B9D34 7F087344 00055403 */ sra $t2, $a1, 0x10 -/* 0B9D38 7F087348 01402825 */ move $a1, $t2 -/* 0B9D3C 7F08734C 0C000FC3 */ jal viSetViewPosition -/* 0B9D40 7F087350 87A40018 */ lh $a0, 0x18($sp) -/* 0B9D44 7F087354 0FC20258 */ jal currentPlayerUpdateColourScreenProperties -/* 0B9D48 7F087358 00000000 */ nop -/* 0B9D4C 7F08735C 0FC202C9 */ jal currentPlayerTickChrFade -/* 0B9D50 7F087360 00000000 */ nop -/* 0B9D54 7F087364 0FC2905C */ jal cur_player_get_autoaim -/* 0B9D58 7F087368 00000000 */ nop -/* 0B9D5C 7F08736C 0FC1F191 */ jal set_BONDdata_autoaim_y -/* 0B9D60 7F087370 00402025 */ move $a0, $v0 -/* 0B9D64 7F087374 0FC2905C */ jal cur_player_get_autoaim -/* 0B9D68 7F087378 00000000 */ nop -/* 0B9D6C 7F08737C 0FC1F1CB */ jal set_BONDdata_autoaim_x -/* 0B9D70 7F087380 00402025 */ move $a0, $v0 -/* 0B9D74 7F087384 0FC29062 */ jal cur_player_get_lookahead -/* 0B9D78 7F087388 00000000 */ nop -/* 0B9D7C 7F08738C 0FC1F189 */ jal set_BONDdata_lookahead_setting -/* 0B9D80 7F087390 00402025 */ move $a0, $v0 -/* 0B9D84 7F087394 0FC29074 */ jal cur_player_get_ammo_onscreen_setting -/* 0B9D88 7F087398 00000000 */ nop -/* 0B9D8C 7F08739C 24040001 */ li $a0, 1 -/* 0B9D90 7F0873A0 0FC1A622 */ jal set_unset_ammo_on_screen_setting -/* 0B9D94 7F0873A4 00402825 */ move $a1, $v0 -/* 0B9D98 7F0873A8 0FC26669 */ jal getPlayerCount -/* 0B9D9C 7F0873AC 00000000 */ nop -/* 0B9DA0 7F0873B0 24010001 */ li $at, 1 -/* 0B9DA4 7F0873B4 14410006 */ bne $v0, $at, .L7F0873D0 -/* 0B9DA8 7F0873B8 00000000 */ nop -/* 0B9DAC 7F0873BC 0FC2906E */ jal cur_player_get_sight_onscreen_control -/* 0B9DB0 7F0873C0 00000000 */ nop -/* 0B9DB4 7F0873C4 0002282B */ sltu $a1, $zero, $v0 -/* 0B9DB8 7F0873C8 14A0000B */ bnez $a1, .L7F0873F8 -/* 0B9DBC 7F0873CC 00000000 */ nop -.L7F0873D0: -/* 0B9DC0 7F0873D0 0FC26669 */ jal getPlayerCount -/* 0B9DC4 7F0873D4 00000000 */ nop -/* 0B9DC8 7F0873D8 28430002 */ slti $v1, $v0, 2 -/* 0B9DCC 7F0873DC 38650001 */ xori $a1, $v1, 1 -/* 0B9DD0 7F0873E0 10A00005 */ beqz $a1, .L7F0873F8 -/* 0B9DD4 7F0873E4 3C0B8007 */ lui $t3, %hi(g_playerPerm) # $t3, 0x8007 -/* 0B9DD8 7F0873E8 8D6B8BC4 */ lw $t3, %lo(g_playerPerm)($t3) -/* 0B9DDC 7F0873EC 9165006B */ lbu $a1, 0x6b($t3) -/* 0B9DE0 7F0873F0 0005602B */ sltu $t4, $zero, $a1 -/* 0B9DE4 7F0873F4 01802825 */ move $a1, $t4 -.L7F0873F8: -/* 0B9DE8 7F0873F8 0FC1AB4F */ jal set_unset_bitflags -/* 0B9DEC 7F0873FC 24040001 */ li $a0, 1 -/* 0B9DF0 7F087400 3C028003 */ lui $v0, %hi(g_CameraMode) # $v0, 0x8003 -/* 0B9DF4 7F087404 8C4219E4 */ lw $v0, %lo(g_CameraMode)($v0) -/* 0B9DF8 7F087408 24010004 */ li $at, 4 -/* 0B9DFC 7F08740C 10400008 */ beqz $v0, .L7F087430 -/* 0B9E00 7F087410 00000000 */ nop -/* 0B9E04 7F087414 14410003 */ bne $v0, $at, .L7F087424 -/* 0B9E08 7F087418 3C0D8003 */ lui $t5, %hi(D_800364B0) # $t5, 0x8003 -/* 0B9E0C 7F08741C 8DAD1A00 */ lw $t5, %lo(D_800364B0)($t5) -/* 0B9E10 7F087420 15A00003 */ bnez $t5, .L7F087430 -.L7F087424: -/* 0B9E14 7F087424 2401000A */ li $at, 10 -/* 0B9E18 7F087428 14410014 */ bne $v0, $at, .L7F08747C -/* 0B9E1C 7F08742C 83A40023 */ lb $a0, 0x23($sp) -.L7F087430: -/* 0B9E20 7F087430 0FC269A4 */ jal get_cur_playernum -/* 0B9E24 7F087434 00000000 */ nop -/* 0B9E28 7F087438 14400008 */ bnez $v0, .L7F08745C -/* 0B9E2C 7F08743C 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B9E30 7F087440 3C028007 */ lui $v0, %hi(mission_timer) # $v0, 0x8007 -/* 0B9E34 7F087444 24428500 */ addiu $v0, %lo(mission_timer) # addiu $v0, $v0, -0x7b00 -/* 0B9E38 7F087448 3C0F8004 */ lui $t7, %hi(g_ClockTimer) # $t7, 0x8004 -/* 0B9E3C 7F08744C 8DEF0FF4 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 0B9E40 7F087450 8C4E0000 */ lw $t6, ($v0) -/* 0B9E44 7F087454 01CFC021 */ addu $t8, $t6, $t7 -/* 0B9E48 7F087458 AC580000 */ sw $t8, ($v0) -.L7F08745C: -/* 0B9E4C 7F08745C 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B9E50 7F087460 83A40023 */ lb $a0, 0x23($sp) -/* 0B9E54 7F087464 83A50027 */ lb $a1, 0x27($sp) -/* 0B9E58 7F087468 97A6002A */ lhu $a2, 0x2a($sp) -/* 0B9E5C 7F08746C 0FC211E3 */ jal MoveBond -/* 0B9E60 7F087470 972703B4 */ lhu $a3, 0x3b4($t9) -/* 0B9E64 7F087474 10000007 */ b .L7F087494 -/* 0B9E68 7F087478 00000000 */ nop -.L7F08747C: -/* 0B9E6C 7F08747C 3C088007 */ lui $t0, %hi(g_CurrentPlayer) # $t0, 0x8007 -/* 0B9E70 7F087480 8D088BC0 */ lw $t0, %lo(g_CurrentPlayer)($t0) -/* 0B9E74 7F087484 83A50027 */ lb $a1, 0x27($sp) -/* 0B9E78 7F087488 97A6002A */ lhu $a2, 0x2a($sp) -/* 0B9E7C 7F08748C 0FC21AAC */ jal sub_GAME_7F086990 -/* 0B9E80 7F087490 950703B4 */ lhu $a3, 0x3b4($t0) -.L7F087494: -/* 0B9E84 7F087494 3C028007 */ lui $v0, %hi(watch_time_0) # $v0, 0x8007 -/* 0B9E88 7F087498 24428504 */ addiu $v0, %lo(watch_time_0) # addiu $v0, $v0, -0x7afc -/* 0B9E8C 7F08749C 3C018004 */ lui $at, %hi(jpD_800484D0) # $at, 0x8004 -/* 0B9E90 7F0874A0 C4261120 */ lwc1 $f6, %lo(jpD_800484D0)($at) -/* 0B9E94 7F0874A4 C4480000 */ lwc1 $f8, ($v0) -/* 0B9E98 7F0874A8 3C098003 */ lui $t1, %hi(stop_time_flag) # $t1, 0x8003 -/* 0B9E9C 7F0874AC 46064400 */ add.s $f16, $f8, $f6 -/* 0B9EA0 7F0874B0 E4500000 */ swc1 $f16, ($v0) -/* 0B9EA4 7F0874B4 8D2919F0 */ lw $t1, %lo(stop_time_flag)($t1) -/* 0B9EA8 7F0874B8 11200046 */ beqz $t1, .L7F0875D4 -/* 0B9EAC 7F0874BC 00000000 */ nop -/* 0B9EB0 7F0874C0 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 0B9EB4 7F0874C4 00000000 */ nop -/* 0B9EB8 7F0874C8 1440002F */ bnez $v0, .L7F087588 -/* 0B9EBC 7F0874CC 3C0B8007 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8007 -/* 0B9EC0 7F0874D0 8D6B8BC0 */ lw $t3, %lo(g_CurrentPlayer)($t3) -/* 0B9EC4 7F0874D4 97AA002A */ lhu $t2, 0x2a($sp) -/* 0B9EC8 7F0874D8 24180002 */ li $t8, 2 -/* 0B9ECC 7F0874DC 956C03B4 */ lhu $t4, 0x3b4($t3) -/* 0B9ED0 7F0874E0 3C018003 */ lui $at, %hi(stop_time_flag) # $at, 0x8003 -/* 0B9ED4 7F0874E4 01806827 */ not $t5, $t4 -/* 0B9ED8 7F0874E8 014D7024 */ and $t6, $t2, $t5 -/* 0B9EDC 7F0874EC 31CFF030 */ andi $t7, $t6, 0xf030 -/* 0B9EE0 7F0874F0 11E00025 */ beqz $t7, .L7F087588 -/* 0B9EE4 7F0874F4 00000000 */ nop -/* 0B9EE8 7F0874F8 0FC2024C */ jal currentPlayerIsFadeComplete -/* 0B9EEC 7F0874FC AC3819F0 */ sw $t8, %lo(stop_time_flag)($at) -/* 0B9EF0 7F087500 10400015 */ beqz $v0, .L7F087558 -/* 0B9EF4 7F087504 3C198007 */ lui $t9, %hi(g_CurrentPlayer) # $t9, 0x8007 -/* 0B9EF8 7F087508 8F398BC0 */ lw $t9, %lo(g_CurrentPlayer)($t9) -/* 0B9EFC 7F08750C 44800000 */ mtc1 $zero, $f0 -/* 0B9F00 7F087510 00002025 */ move $a0, $zero -/* 0B9F04 7F087514 C72A03DC */ lwc1 $f10, 0x3dc($t9) -/* 0B9F08 7F087518 00002825 */ move $a1, $zero -/* 0B9F0C 7F08751C 460A0032 */ c.eq.s $f0, $f10 -/* 0B9F10 7F087520 00000000 */ nop -/* 0B9F14 7F087524 45000018 */ bc1f .L7F087588 -/* 0B9F18 7F087528 00000000 */ nop -/* 0B9F1C 7F08752C 44070000 */ mfc1 $a3, $f0 -/* 0B9F20 7F087530 0FC20215 */ jal currentPlayerSetFadeColour -/* 0B9F24 7F087534 00003025 */ move $a2, $zero -/* 0B9F28 7F087538 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0B9F2C 7F08753C 44816000 */ mtc1 $at, $f12 -/* 0B9F30 7F087540 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9F34 7F087544 44817000 */ mtc1 $at, $f14 -/* 0B9F38 7F087548 0FC2023F */ jal currentPlayerSetFadeFrac -/* 0B9F3C 7F08754C 00000000 */ nop -/* 0B9F40 7F087550 1000000D */ b .L7F087588 -/* 0B9F44 7F087554 00000000 */ nop -.L7F087558: -/* 0B9F48 7F087558 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B9F4C 7F08755C 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9F50 7F087560 44800000 */ mtc1 $zero, $f0 -/* 0B9F54 7F087564 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9F58 7F087568 C4520404 */ lwc1 $f18, 0x404($v0) -/* 0B9F5C 7F08756C 46120032 */ c.eq.s $f0, $f18 -/* 0B9F60 7F087570 00000000 */ nop -/* 0B9F64 7F087574 45000004 */ bc1f .L7F087588 -/* 0B9F68 7F087578 00000000 */ nop -/* 0B9F6C 7F08757C 44817000 */ mtc1 $at, $f14 -/* 0B9F70 7F087580 0FC2023F */ jal currentPlayerSetFadeFrac -/* 0B9F74 7F087584 C44C03E0 */ lwc1 $f12, 0x3e0($v0) -.L7F087588: -/* 0B9F78 7F087588 3C088003 */ lui $t0, %hi(stop_time_flag) # $t0, 0x8003 -/* 0B9F7C 7F08758C 8D0819F0 */ lw $t0, %lo(stop_time_flag)($t0) -/* 0B9F80 7F087590 24010002 */ li $at, 2 -/* 0B9F84 7F087594 1501000F */ bne $t0, $at, .L7F0875D4 -/* 0B9F88 7F087598 00000000 */ nop -/* 0B9F8C 7F08759C 0FC2024C */ jal currentPlayerIsFadeComplete -/* 0B9F90 7F0875A0 00000000 */ nop -/* 0B9F94 7F0875A4 1040000B */ beqz $v0, .L7F0875D4 -/* 0B9F98 7F0875A8 3C098007 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8007 -/* 0B9F9C 7F0875AC 8D298BC0 */ lw $t1, %lo(g_CurrentPlayer)($t1) -/* 0B9FA0 7F0875B0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0B9FA4 7F0875B4 44812000 */ mtc1 $at, $f4 -/* 0B9FA8 7F0875B8 C52803DC */ lwc1 $f8, 0x3dc($t1) -/* 0B9FAC 7F0875BC 46082032 */ c.eq.s $f4, $f8 -/* 0B9FB0 7F0875C0 00000000 */ nop -/* 0B9FB4 7F0875C4 45000003 */ bc1f .L7F0875D4 -/* 0B9FB8 7F0875C8 00000000 */ nop -/* 0B9FBC 7F0875CC 0C00176C */ jal bossReturnTitleStage -/* 0B9FC0 7F0875D0 00000000 */ nop -.L7F0875D4: -/* 0B9FC4 7F0875D4 3C0B8003 */ lui $t3, %hi(enable_move_after_cinema) # $t3, 0x8003 -/* 0B9FC8 7F0875D8 8D6B19E8 */ lw $t3, %lo(enable_move_after_cinema)($t3) -/* 0B9FCC 7F0875DC 11600003 */ beqz $t3, .L7F0875EC -/* 0B9FD0 7F0875E0 00000000 */ nop -/* 0B9FD4 7F0875E4 0FC1EC8F */ jal sub_GAME_7F07B1A4 -/* 0B9FD8 7F0875E8 00000000 */ nop -.L7F0875EC: -/* 0B9FDC 7F0875EC 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0B9FE0 7F0875F0 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0B9FE4 7F0875F4 8C4C00D8 */ lw $t4, 0xd8($v0) -/* 0B9FE8 7F0875F8 11800019 */ beqz $t4, .L7F087660 -/* 0B9FEC 7F0875FC 00000000 */ nop -/* 0B9FF0 7F087600 8C430424 */ lw $v1, 0x424($v0) -/* 0B9FF4 7F087604 24040001 */ li $a0, 1 -/* 0B9FF8 7F087608 14600009 */ bnez $v1, .L7F087630 -/* 0B9FFC 7F08760C 00000000 */ nop -/* 0BA000 7F087610 0FC17773 */ jal currentPlayerEquipWeaponWrapper -/* 0BA004 7F087614 00002825 */ move $a1, $zero -/* 0BA008 7F087618 00002025 */ move $a0, $zero -/* 0BA00C 7F08761C 0FC17773 */ jal currentPlayerEquipWeaponWrapper -/* 0BA010 7F087620 00002825 */ move $a1, $zero -/* 0BA014 7F087624 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0BA018 7F087628 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0BA01C 7F08762C 8C430424 */ lw $v1, 0x424($v0) -.L7F087630: -/* 0BA020 7F087630 1060000B */ beqz $v1, .L7F087660 -/* 0BA024 7F087634 00000000 */ nop -/* 0BA028 7F087638 8C4A0428 */ lw $t2, 0x428($v0) -/* 0BA02C 7F08763C 3C0D8003 */ lui $t5, %hi(D_80036510) # $t5, 0x8003 -/* 0BA030 7F087640 11400007 */ beqz $t2, .L7F087660 -/* 0BA034 7F087644 00000000 */ nop -/* 0BA038 7F087648 8DAD1A60 */ lw $t5, %lo(D_80036510)($t5) -/* 0BA03C 7F08764C 29A10003 */ slti $at, $t5, 3 -/* 0BA040 7F087650 14200003 */ bnez $at, .L7F087660 -/* 0BA044 7F087654 00000000 */ nop -/* 0BA048 7F087658 0C00175E */ jal bossRunTitleStage -/* 0BA04C 7F08765C 00000000 */ nop -.L7F087660: -/* 0BA050 7F087660 3C0E8003 */ lui $t6, %hi(g_CameraMode) # $t6, 0x8003 -/* 0BA054 7F087664 8DCE19E4 */ lw $t6, %lo(g_CameraMode)($t6) -/* 0BA058 7F087668 2401000A */ li $at, 10 -/* 0BA05C 7F08766C 15C10007 */ bne $t6, $at, .L7F08768C -/* 0BA060 7F087670 00000000 */ nop -/* 0BA064 7F087674 0FC2024C */ jal currentPlayerIsFadeComplete -/* 0BA068 7F087678 00000000 */ nop -/* 0BA06C 7F08767C 10400003 */ beqz $v0, .L7F08768C -/* 0BA070 7F087680 00000000 */ nop -/* 0BA074 7F087684 0C00175E */ jal bossRunTitleStage -/* 0BA078 7F087688 00000000 */ nop -.L7F08768C: -/* 0BA07C 7F08768C 3C188007 */ lui $t8, %hi(g_CurrentPlayer) # $t8, 0x8007 -/* 0BA080 7F087690 8F188BC0 */ lw $t8, %lo(g_CurrentPlayer)($t8) -/* 0BA084 7F087694 97AF002A */ lhu $t7, 0x2a($sp) -/* 0BA088 7F087698 A70F03B4 */ sh $t7, 0x3b4($t8) -/* 0BA08C 7F08769C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0BA090 7F0876A0 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0BA094 7F0876A4 03E00008 */ jr $ra -/* 0BA098 7F0876A8 00000000 */ nop -) -#endif - - /** * Address 0x7F0875E4. @@ -34293,327 +12308,92 @@ void store_BONDdata_curpos_to_previous(void) { g_CurrentPlayer->previous_model_pos.f[0] = g_CurrentPlayer->current_model_pos.f[0]; g_CurrentPlayer->previous_model_pos.f[1] = g_CurrentPlayer->current_model_pos.f[1]; g_CurrentPlayer->previous_model_pos.f[2] = g_CurrentPlayer->current_model_pos.f[2]; - matrix_4x4_rotate_vector_in_place(currentPlayerGetMatrix10CC(), &g_CurrentPlayer->previous_model_pos); + mtx4RotateVecInPlace(camGetWorldToScreenMtxf(), &g_CurrentPlayer->previous_model_pos); } -#ifdef NONMATCHING -void sub_GAME_7F0876C4(void *arg0, void *arg1, void *arg2) { - ? sp60; - ? spA0; - f32 spAC; - f32 spB0; - f32 spB4; - f32 spB8; - f32 spBC; - f32 spC0; - ? spC4; - s32 sp104; - ? sp108; - f32 temp_f10; - f32 temp_f6; - f32 temp_f4; - f32 temp_f16; - s32 temp_s0; - f32 temp_f0; - s32 temp_v1; - void *temp_a1; - void *phi_v0; - s32 phi_v1; - void *phi_a1; +void sub_GAME_7F0876C4(coord3d* cam_pos, coord3d* cam_look, coord3d* cam_up) +{ + Mtx sp108; + LookAt *lookat; + Mtxf spC4; + coord3d clpos; + coord3d scaledpos; + f32 scale; + Mtx *temp_s0; + Mtxf *projmtx; + Mtxf sp60; + s32 j; + s32 i; + + i = bondviewGetCurrentPlayersRoom(); + bondviewUpdateCurrentRoomPosition(i); - // Node 0 - bondviewUpdateCurrentRoomPosition(bondviewGetCurrentPlayersRoom()); g_CurrentPlayer->field_5C = dynAllocateMatrix(); g_CurrentPlayer->field_60 = dynAllocateMatrix(); g_CurrentPlayer->field_64 = dynAllocateMatrix(); g_CurrentPlayer->field_68 = dynAllocateMatrix(); - sp104 = dynAllocate7F0BD6F8(2); - temp_f10 = ((*arg0 - g_CurrentPlayer->current_model_xpos) * D_800364CC); - spAC = temp_f10; - temp_f6 = ((arg0->unk4 - g_CurrentPlayer->current_model_ypos) * D_800364CC); - spB0 = temp_f6; - temp_f4 = ((arg0->unk8 - g_CurrentPlayer->current_model_zpos) * D_800364CC); - spB4 = temp_f4; - temp_f16 = (*arg1 + temp_f10); - spB8 = temp_f16; - spBC = (f32) (arg1->unk4 + temp_f6); - spC0 = (f32) (arg1->unk8 + temp_f4); - matrix_4x4_7F059424(&spC4, temp_f10, temp_f6, temp_f4, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); - guLookAtReflect(&sp108, sp104, spAC, spB0, spB4, temp_f16, spBC, spC0, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); - matrix_4x4_7F059424(g_CurrentPlayer->field_64, *arg0, arg0->unk4, arg0->unk8, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); - matrix_4x4_7F059708(g_CurrentPlayer->field_68, *arg0, arg0->unk4, arg0->unk8, (f32) *arg1, (f32) arg1->unk4, (f32) arg1->unk8, (f32) *arg2, (f32) arg2->unk4, (f32) arg2->unk8); + + lookat = dynAllocate7F0BD6F8(2); + + scale = D_800364CC; + + scaledpos.x = (cam_pos->x - g_CurrentPlayer->current_model_pos.x) * scale; + scaledpos.y = (cam_pos->y - g_CurrentPlayer->current_model_pos.y) * scale; + scaledpos.z = (cam_pos->z - g_CurrentPlayer->current_model_pos.z) * scale; + + clpos.f[0] = scaledpos.f[0] + cam_look->f[0]; + clpos.f[1] = scaledpos.f[1] + cam_look->f[1]; + clpos.f[2] = scaledpos.f[2] + cam_look->f[2]; + + matrix_4x4_7F059424(&spC4, + scaledpos.x, scaledpos.y, scaledpos.z, + cam_look->x, cam_look->y, cam_look->z, + cam_up->x, cam_up->y, cam_up->z); + + guLookAtReflect(&sp108, lookat, + scaledpos.x, scaledpos.y, scaledpos.z, + clpos.x, clpos.y, clpos.z, + cam_up->x, cam_up->y, cam_up->z); + + matrix_4x4_7F059424((Mtxf*) g_CurrentPlayer->field_64, + cam_pos->x, cam_pos->y, cam_pos->z, + cam_look->x, cam_look->y, cam_look->z, + cam_up->x, cam_up->y, cam_up->z); + + matrix_4x4_7F059708((Mtxf*) g_CurrentPlayer->field_68, + cam_pos->x, cam_pos->y, cam_pos->z, + cam_look->x, cam_look->y, cam_look->z, + cam_up->x, cam_up->y, cam_up->z); + temp_s0 = dynAllocateMatrix(); - matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), &spC4, &sp60); - phi_a1 = &sp60; -loop_1: - // Node 1 - phi_v0 = phi_a1; - phi_v1 = 0; -loop_2: - // Node 2 - temp_f0 = *phi_v0; - temp_v1 = (phi_v1 + 4); - if (32000.0f < temp_f0) - { - // Node 3 - *phi_v0 = 32000.0f; - } - else - { - // Node 4 - if (temp_f0 < -32000.0f) - { - // Node 5 - *phi_v0 = -32000.0f; - } - } - // Node 6 - phi_v0 = (phi_v0 + 4); - phi_v1 = temp_v1; - if (temp_v1 != 0x10) - { - goto loop_2; - } - // Node 7 - temp_a1 = (phi_a1 + 0x10); - phi_a1 = temp_a1; - if (temp_a1 != &spA0) - { - goto loop_1; - } - // Node 8 - guMtxF2L(-32000.0f, &sp60, temp_s0, &spA0); - set_BONDdata_field_10E0(temp_s0); - matrix_scalar_multiply(bgGetLevelVisibilityScale(), &spC4); - guMtxF2L(&spC4, g_CurrentPlayer->field_5C); - sub_GAME_7F059334(g_CurrentPlayer->field_5C, g_CurrentPlayer->field_60); - currentPlayerSetMatrix10C8(g_CurrentPlayer->field_5C); - currentPlayerSetMatrix10C4(g_CurrentPlayer->field_60); - currentPlayerSetMatrix10CC(g_CurrentPlayer->field_64); - currentPlayerSetMatrix10D4(g_CurrentPlayer->field_68); - sub_GAME_7F078464(sp104); + + projmtx = currentPlayerGetProjectionMatrixF(); + matrix_4x4_multiply(projmtx, &spC4, &sp60); + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + if (sp60.m[i][j] > 32000.0f) { + sp60.m[i][j] = 32000.0f; + } else if (sp60.m[i][j] < -32000.0f) { + sp60.m[i][j] = -32000.0f; + } + } + } + + guMtxF2L((f32 (*)[4]) &sp60, temp_s0); + set_BONDdata_field_10E0((s32) temp_s0); + scale = bgGetLevelVisibilityScale(); + matrix_scalar_multiply(scale, spC4.m[0]); + guMtxF2L((f32 (*)[4]) &spC4, (Mtx* ) g_CurrentPlayer->field_5C); + sub_GAME_7F059334((s32* ) g_CurrentPlayer->field_5C, (s32* ) g_CurrentPlayer->field_60); + currentPlayerSetMatrix10C8((Mtx* ) g_CurrentPlayer->field_5C); + currentPlayerSetMatrix10C4((Mtx* ) g_CurrentPlayer->field_60); + currentPlayerSetMatrix10CC((Mtxf* ) g_CurrentPlayer->field_64); + currentPlayerSetMatrix10D4((Mtxf* ) g_CurrentPlayer->field_68); + sub_GAME_7F078464((s32) lookat); sub_GAME_7F0785DC(); - return store_BONDdata_curpos_to_previous(); + store_BONDdata_curpos_to_previous(); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0876C4 -/* 0BC1F4 7F0876C4 27BDFEB8 */ addiu $sp, $sp, -0x148 -/* 0BC1F8 7F0876C8 AFBF0044 */ sw $ra, 0x44($sp) -/* 0BC1FC 7F0876CC AFB1003C */ sw $s1, 0x3c($sp) -/* 0BC200 7F0876D0 AFB00038 */ sw $s0, 0x38($sp) -/* 0BC204 7F0876D4 00A08025 */ move $s0, $a1 -/* 0BC208 7F0876D8 00C08825 */ move $s1, $a2 -/* 0BC20C 7F0876DC AFB20040 */ sw $s2, 0x40($sp) -/* 0BC210 7F0876E0 0FC227E6 */ jal bondviewGetCurrentPlayersRoom -/* 0BC214 7F0876E4 AFA40148 */ sw $a0, 0x148($sp) -/* 0BC218 7F0876E8 0FC21D79 */ jal bondviewUpdateCurrentRoomPosition -/* 0BC21C 7F0876EC 00402025 */ move $a0, $v0 -/* 0BC220 7F0876F0 0FC2F5B8 */ jal dynAllocateMatrix -/* 0BC224 7F0876F4 00000000 */ nop -/* 0BC228 7F0876F8 3C128008 */ lui $s2, %hi(g_CurrentPlayer) -/* 0BC22C 7F0876FC 2652A0B0 */ addiu $s2, %lo(g_CurrentPlayer) # addiu $s2, $s2, -0x5f50 -/* 0BC230 7F087700 8E4E0000 */ lw $t6, ($s2) -/* 0BC234 7F087704 0FC2F5B8 */ jal dynAllocateMatrix -/* 0BC238 7F087708 ADC2005C */ sw $v0, 0x5c($t6) -/* 0BC23C 7F08770C 8E4F0000 */ lw $t7, ($s2) -/* 0BC240 7F087710 0FC2F5B8 */ jal dynAllocateMatrix -/* 0BC244 7F087714 ADE20060 */ sw $v0, 0x60($t7) -/* 0BC248 7F087718 8E580000 */ lw $t8, ($s2) -/* 0BC24C 7F08771C 0FC2F5B8 */ jal dynAllocateMatrix -/* 0BC250 7F087720 AF020064 */ sw $v0, 0x64($t8) -/* 0BC254 7F087724 8E590000 */ lw $t9, ($s2) -/* 0BC258 7F087728 24040002 */ li $a0, 2 -/* 0BC25C 7F08772C 0FC2F5BE */ jal dynAllocate7F0BD6F8 -/* 0BC260 7F087730 AF220068 */ sw $v0, 0x68($t9) -/* 0BC264 7F087734 8FA80148 */ lw $t0, 0x148($sp) -/* 0BC268 7F087738 8E430000 */ lw $v1, ($s2) -/* 0BC26C 7F08773C AFA20104 */ sw $v0, 0x104($sp) -/* 0BC270 7F087740 C5040000 */ lwc1 $f4, ($t0) -/* 0BC274 7F087744 C4660038 */ lwc1 $f6, 0x38($v1) -/* 0BC278 7F087748 3C018003 */ lui $at, %hi(D_800364CC) -/* 0BC27C 7F08774C C42064CC */ lwc1 $f0, %lo(D_800364CC)($at) -/* 0BC280 7F087750 46062201 */ sub.s $f8, $f4, $f6 -/* 0BC284 7F087754 27A400C4 */ addiu $a0, $sp, 0xc4 -/* 0BC288 7F087758 46004282 */ mul.s $f10, $f8, $f0 -/* 0BC28C 7F08775C E7AA00AC */ swc1 $f10, 0xac($sp) -/* 0BC290 7F087760 C5100004 */ lwc1 $f16, 4($t0) -/* 0BC294 7F087764 C472003C */ lwc1 $f18, 0x3c($v1) -/* 0BC298 7F087768 44055000 */ mfc1 $a1, $f10 -/* 0BC29C 7F08776C 46128101 */ sub.s $f4, $f16, $f18 -/* 0BC2A0 7F087770 46002182 */ mul.s $f6, $f4, $f0 -/* 0BC2A4 7F087774 E7A600B0 */ swc1 $f6, 0xb0($sp) -/* 0BC2A8 7F087778 C5080008 */ lwc1 $f8, 8($t0) -/* 0BC2AC 7F08777C C4700040 */ lwc1 $f16, 0x40($v1) -/* 0BC2B0 7F087780 44063000 */ mfc1 $a2, $f6 -/* 0BC2B4 7F087784 46104481 */ sub.s $f18, $f8, $f16 -/* 0BC2B8 7F087788 46009102 */ mul.s $f4, $f18, $f0 -/* 0BC2BC 7F08778C E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 0BC2C0 7F087790 C6080000 */ lwc1 $f8, ($s0) -/* 0BC2C4 7F087794 44072000 */ mfc1 $a3, $f4 -/* 0BC2C8 7F087798 460A4400 */ add.s $f16, $f8, $f10 -/* 0BC2CC 7F08779C E7B000B8 */ swc1 $f16, 0xb8($sp) -/* 0BC2D0 7F0877A0 C6120004 */ lwc1 $f18, 4($s0) -/* 0BC2D4 7F0877A4 46069200 */ add.s $f8, $f18, $f6 -/* 0BC2D8 7F0877A8 E7A800BC */ swc1 $f8, 0xbc($sp) -/* 0BC2DC 7F0877AC C6100008 */ lwc1 $f16, 8($s0) -/* 0BC2E0 7F0877B0 46048480 */ add.s $f18, $f16, $f4 -/* 0BC2E4 7F0877B4 E7B200C0 */ swc1 $f18, 0xc0($sp) -/* 0BC2E8 7F0877B8 C6080000 */ lwc1 $f8, ($s0) -/* 0BC2EC 7F0877BC E7A80010 */ swc1 $f8, 0x10($sp) -/* 0BC2F0 7F0877C0 C6100004 */ lwc1 $f16, 4($s0) -/* 0BC2F4 7F0877C4 E7B00014 */ swc1 $f16, 0x14($sp) -/* 0BC2F8 7F0877C8 C6120008 */ lwc1 $f18, 8($s0) -/* 0BC2FC 7F0877CC E7B20018 */ swc1 $f18, 0x18($sp) -/* 0BC300 7F0877D0 C62A0000 */ lwc1 $f10, ($s1) -/* 0BC304 7F0877D4 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 0BC308 7F0877D8 C6260004 */ lwc1 $f6, 4($s1) -/* 0BC30C 7F0877DC E7A60020 */ swc1 $f6, 0x20($sp) -/* 0BC310 7F0877E0 C6240008 */ lwc1 $f4, 8($s1) -/* 0BC314 7F0877E4 0FC16509 */ jal matrix_4x4_7F059424 -/* 0BC318 7F0877E8 E7A40024 */ swc1 $f4, 0x24($sp) -/* 0BC31C 7F0877EC C7A800B4 */ lwc1 $f8, 0xb4($sp) -/* 0BC320 7F0877F0 C7B000B8 */ lwc1 $f16, 0xb8($sp) -/* 0BC324 7F0877F4 C7B200BC */ lwc1 $f18, 0xbc($sp) -/* 0BC328 7F0877F8 C7AA00C0 */ lwc1 $f10, 0xc0($sp) -/* 0BC32C 7F0877FC E7A80010 */ swc1 $f8, 0x10($sp) -/* 0BC330 7F087800 E7B00014 */ swc1 $f16, 0x14($sp) -/* 0BC334 7F087804 E7B20018 */ swc1 $f18, 0x18($sp) -/* 0BC338 7F087808 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 0BC33C 7F08780C C6260000 */ lwc1 $f6, ($s1) -/* 0BC340 7F087810 27A40108 */ addiu $a0, $sp, 0x108 -/* 0BC344 7F087814 8FA50104 */ lw $a1, 0x104($sp) -/* 0BC348 7F087818 E7A60020 */ swc1 $f6, 0x20($sp) -/* 0BC34C 7F08781C C6240004 */ lwc1 $f4, 4($s1) -/* 0BC350 7F087820 8FA600AC */ lw $a2, 0xac($sp) -/* 0BC354 7F087824 8FA700B0 */ lw $a3, 0xb0($sp) -/* 0BC358 7F087828 E7A40024 */ swc1 $f4, 0x24($sp) -/* 0BC35C 7F08782C C6280008 */ lwc1 $f8, 8($s1) -/* 0BC360 7F087830 0C005CDC */ jal guLookAtReflect -/* 0BC364 7F087834 E7A80028 */ swc1 $f8, 0x28($sp) -/* 0BC368 7F087838 8FA20148 */ lw $v0, 0x148($sp) -/* 0BC36C 7F08783C 8E490000 */ lw $t1, ($s2) -/* 0BC370 7F087840 C6100000 */ lwc1 $f16, ($s0) -/* 0BC374 7F087844 8C450000 */ lw $a1, ($v0) -/* 0BC378 7F087848 8C460004 */ lw $a2, 4($v0) -/* 0BC37C 7F08784C 8C470008 */ lw $a3, 8($v0) -/* 0BC380 7F087850 8D240064 */ lw $a0, 0x64($t1) -/* 0BC384 7F087854 E7B00010 */ swc1 $f16, 0x10($sp) -/* 0BC388 7F087858 C6120004 */ lwc1 $f18, 4($s0) -/* 0BC38C 7F08785C E7B20014 */ swc1 $f18, 0x14($sp) -/* 0BC390 7F087860 C60A0008 */ lwc1 $f10, 8($s0) -/* 0BC394 7F087864 E7AA0018 */ swc1 $f10, 0x18($sp) -/* 0BC398 7F087868 C6260000 */ lwc1 $f6, ($s1) -/* 0BC39C 7F08786C E7A6001C */ swc1 $f6, 0x1c($sp) -/* 0BC3A0 7F087870 C6240004 */ lwc1 $f4, 4($s1) -/* 0BC3A4 7F087874 E7A40020 */ swc1 $f4, 0x20($sp) -/* 0BC3A8 7F087878 C6280008 */ lwc1 $f8, 8($s1) -/* 0BC3AC 7F08787C 0FC16509 */ jal matrix_4x4_7F059424 -/* 0BC3B0 7F087880 E7A80024 */ swc1 $f8, 0x24($sp) -/* 0BC3B4 7F087884 8FAB0148 */ lw $t3, 0x148($sp) -/* 0BC3B8 7F087888 8E4A0000 */ lw $t2, ($s2) -/* 0BC3BC 7F08788C C6100000 */ lwc1 $f16, ($s0) -/* 0BC3C0 7F087890 8D650000 */ lw $a1, ($t3) -/* 0BC3C4 7F087894 8D660004 */ lw $a2, 4($t3) -/* 0BC3C8 7F087898 8D670008 */ lw $a3, 8($t3) -/* 0BC3CC 7F08789C 8D440068 */ lw $a0, 0x68($t2) -/* 0BC3D0 7F0878A0 E7B00010 */ swc1 $f16, 0x10($sp) -/* 0BC3D4 7F0878A4 C6120004 */ lwc1 $f18, 4($s0) -/* 0BC3D8 7F0878A8 E7B20014 */ swc1 $f18, 0x14($sp) -/* 0BC3DC 7F0878AC C60A0008 */ lwc1 $f10, 8($s0) -/* 0BC3E0 7F0878B0 E7AA0018 */ swc1 $f10, 0x18($sp) -/* 0BC3E4 7F0878B4 C6260000 */ lwc1 $f6, ($s1) -/* 0BC3E8 7F0878B8 E7A6001C */ swc1 $f6, 0x1c($sp) -/* 0BC3EC 7F0878BC C6240004 */ lwc1 $f4, 4($s1) -/* 0BC3F0 7F0878C0 E7A40020 */ swc1 $f4, 0x20($sp) -/* 0BC3F4 7F0878C4 C6280008 */ lwc1 $f8, 8($s1) -/* 0BC3F8 7F0878C8 0FC165C2 */ jal matrix_4x4_7F059708 -/* 0BC3FC 7F0878CC E7A80024 */ swc1 $f8, 0x24($sp) -/* 0BC400 7F0878D0 0FC2F5B8 */ jal dynAllocateMatrix -/* 0BC404 7F0878D4 00000000 */ nop -/* 0BC408 7F0878D8 0FC1E0F9 */ jal currentPlayerGetProjectionMatrixF -/* 0BC40C 7F0878DC 00408025 */ move $s0, $v0 -/* 0BC410 7F0878E0 27B10060 */ addiu $s1, $sp, 0x60 -/* 0BC414 7F0878E4 02203025 */ move $a2, $s1 -/* 0BC418 7F0878E8 00402025 */ move $a0, $v0 -/* 0BC41C 7F0878EC 0FC16032 */ jal matrix_4x4_multiply -/* 0BC420 7F0878F0 27A500C4 */ addiu $a1, $sp, 0xc4 -/* 0BC424 7F0878F4 3C01C6FA */ li $at, 0xC6FA0000 # -32000.000000 -/* 0BC428 7F0878F8 44816000 */ mtc1 $at, $f12 -/* 0BC42C 7F0878FC 3C0146FA */ li $at, 0x46FA0000 # 32000.000000 -/* 0BC430 7F087900 44811000 */ mtc1 $at, $f2 -/* 0BC434 7F087904 27A50060 */ addiu $a1, $sp, 0x60 -/* 0BC438 7F087908 27A700A0 */ addiu $a3, $sp, 0xa0 -/* 0BC43C 7F08790C 24040010 */ li $a0, 16 -/* 0BC440 7F087910 00001825 */ move $v1, $zero -.L7F087914: -/* 0BC444 7F087914 00A01025 */ move $v0, $a1 -.L7F087918: -/* 0BC448 7F087918 C4400000 */ lwc1 $f0, ($v0) -/* 0BC44C 7F08791C 24630004 */ addiu $v1, $v1, 4 -/* 0BC450 7F087920 4600103C */ c.lt.s $f2, $f0 -/* 0BC454 7F087924 00000000 */ nop -/* 0BC458 7F087928 45020004 */ bc1fl .L7F08793C -/* 0BC45C 7F08792C 460C003C */ c.lt.s $f0, $f12 -/* 0BC460 7F087930 10000006 */ b .L7F08794C -/* 0BC464 7F087934 E4420000 */ swc1 $f2, ($v0) -/* 0BC468 7F087938 460C003C */ c.lt.s $f0, $f12 -.L7F08793C: -/* 0BC46C 7F08793C 00000000 */ nop -/* 0BC470 7F087940 45000002 */ bc1f .L7F08794C -/* 0BC474 7F087944 00000000 */ nop -/* 0BC478 7F087948 E44C0000 */ swc1 $f12, ($v0) -.L7F08794C: -/* 0BC47C 7F08794C 1464FFF2 */ bne $v1, $a0, .L7F087918 -/* 0BC480 7F087950 24420004 */ addiu $v0, $v0, 4 -/* 0BC484 7F087954 24A50010 */ addiu $a1, $a1, 0x10 -/* 0BC488 7F087958 54A7FFEE */ bnel $a1, $a3, .L7F087914 -/* 0BC48C 7F08795C 00001825 */ move $v1, $zero -/* 0BC490 7F087960 02202025 */ move $a0, $s1 -/* 0BC494 7F087964 0C003FC4 */ jal guMtxF2L -/* 0BC498 7F087968 02002825 */ move $a1, $s0 -/* 0BC49C 7F08796C 0FC1E0E1 */ jal set_BONDdata_field_10E0 -/* 0BC4A0 7F087970 02002025 */ move $a0, $s0 -/* 0BC4A4 7F087974 0FC2D21E */ jal bgGetLevelVisibilityScale -/* 0BC4A8 7F087978 00000000 */ nop -/* 0BC4AC 7F08797C 46000306 */ mov.s $f12, $f0 -/* 0BC4B0 7F087980 0FC1629F */ jal matrix_scalar_multiply -/* 0BC4B4 7F087984 27A500C4 */ addiu $a1, $sp, 0xc4 -/* 0BC4B8 7F087988 8E4C0000 */ lw $t4, ($s2) -/* 0BC4BC 7F08798C 27A400C4 */ addiu $a0, $sp, 0xc4 -/* 0BC4C0 7F087990 0C003FC4 */ jal guMtxF2L -/* 0BC4C4 7F087994 8D85005C */ lw $a1, 0x5c($t4) -/* 0BC4C8 7F087998 8E430000 */ lw $v1, ($s2) -/* 0BC4CC 7F08799C 8C64005C */ lw $a0, 0x5c($v1) -/* 0BC4D0 7F0879A0 0FC164CD */ jal sub_GAME_7F059334 -/* 0BC4D4 7F0879A4 8C650060 */ lw $a1, 0x60($v1) -/* 0BC4D8 7F0879A8 8E4D0000 */ lw $t5, ($s2) -/* 0BC4DC 7F0879AC 0FC1E0D1 */ jal currentPlayerSetMatrix10C8 -/* 0BC4E0 7F0879B0 8DA4005C */ lw $a0, 0x5c($t5) -/* 0BC4E4 7F0879B4 8E4E0000 */ lw $t6, ($s2) -/* 0BC4E8 7F0879B8 0FC1E0C9 */ jal currentPlayerSetMatrix10C4 -/* 0BC4EC 7F0879BC 8DC40060 */ lw $a0, 0x60($t6) -/* 0BC4F0 7F0879C0 8E4F0000 */ lw $t7, ($s2) -/* 0BC4F4 7F0879C4 0FC1E0E9 */ jal currentPlayerSetMatrix10CC -/* 0BC4F8 7F0879C8 8DE40064 */ lw $a0, 0x64($t7) -/* 0BC4FC 7F0879CC 8E580000 */ lw $t8, ($s2) -/* 0BC500 7F0879D0 0FC1E109 */ jal currentPlayerSetMatrix10D4 -/* 0BC504 7F0879D4 8F040068 */ lw $a0, 0x68($t8) -/* 0BC508 7F0879D8 0FC1E119 */ jal sub_GAME_7F078464 -/* 0BC50C 7F0879DC 8FA40104 */ lw $a0, 0x104($sp) -/* 0BC510 7F0879E0 0FC1E177 */ jal sub_GAME_7F0785DC -/* 0BC514 7F0879E4 00000000 */ nop -/* 0BC518 7F0879E8 0FC21D99 */ jal store_BONDdata_curpos_to_previous -/* 0BC51C 7F0879EC 00000000 */ nop -/* 0BC520 7F0879F0 8FBF0044 */ lw $ra, 0x44($sp) -/* 0BC524 7F0879F4 8FB00038 */ lw $s0, 0x38($sp) -/* 0BC528 7F0879F8 8FB1003C */ lw $s1, 0x3c($sp) -/* 0BC52C 7F0879FC 8FB20040 */ lw $s2, 0x40($sp) -/* 0BC530 7F087A00 03E00008 */ jr $ra -/* 0BC534 7F087A04 27BD0148 */ addiu $sp, $sp, 0x148 -) -#endif @@ -35538,7 +13318,7 @@ glabel sub_GAME_7F087E74 /* 0BCB94 7F088064 44054000 */ mfc1 $a1, $f8 /* 0BCB98 7F088068 0FC16134 */ jal matrix_4x4_set_position_and_rotation_around_y /* 0BCB9C 7F08806C 00000000 */ nop -/* 0BCBA0 7F088070 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0BCBA0 7F088070 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0BCBA4 7F088074 00000000 */ nop /* 0BCBA8 7F088078 00402025 */ move $a0, $v0 /* 0BCBAC 7F08807C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -36059,7 +13839,7 @@ glabel sub_GAME_7F087E74 /* 0BD2A0 7F088730 44054000 */ mfc1 $a1, $f8 /* 0BD2A4 7F088734 0FC1627C */ jal matrix_4x4_set_position_and_rotation_around_y /* 0BD2A8 7F088738 00000000 */ nop -/* 0BD2AC 7F08873C 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 0BD2AC 7F08873C 0FC1E26D */ jal camGetWorldToScreenMtxf /* 0BD2B0 7F088740 00000000 */ nop /* 0BD2B4 7F088744 00402025 */ move $a0, $v0 /* 0BD2B8 7F088748 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -36582,7 +14362,7 @@ glabel sub_GAME_7F087E74 /* 0BABB4 7F0881C4 44054000 */ mfc1 $a1, $f8 /* 0BABB8 7F0881C8 0FC1625E */ jal matrix_4x4_set_position_and_rotation_around_y /* 0BABBC 7F0881CC 00000000 */ nop -/* 0BABC0 7F0881D0 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 0BABC0 7F0881D0 0FC1E111 */ jal camGetWorldToScreenMtxf /* 0BABC4 7F0881D4 00000000 */ nop /* 0BABC8 7F0881D8 00402025 */ move $a0, $v0 /* 0BABCC 7F0881DC 0FC16150 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -37492,7 +15272,7 @@ glabel mp_respawn_handler /* 0BD4B0 7F088980 8E280000 */ lw $t0, ($s1) /* 0BD4B4 7F088984 0FC228E0 */ jal hudmsgsSetOn /* 0BD4B8 7F088988 AD0F1128 */ sw $t7, 0x1128($t0) -/* 0BD4BC 7F08898C 0FC22A4A */ jal sub_GAME_7F08A928 +/* 0BD4BC 7F08898C 0FC22A4A */ jal bondviewClearUpperTextDisplayFlag /* 0BD4C0 7F088990 2404FFFF */ li $a0, -1 /* 0BD4C4 7F088994 0FC26919 */ jal getPlayerCount /* 0BD4C8 7F088998 00000000 */ nop @@ -37791,7 +15571,7 @@ glabel mp_respawn_handler /* 0BB4D8 7F088AE8 8E280000 */ lw $t0, ($s1) /* 0BB4DC 7F088AEC 0FC2294B */ jal hudmsgsSetOn /* 0BB4E0 7F088AF0 AD0F1120 */ sw $t7, 0x1120($t0) -/* 0BB4E4 7F088AF4 0FC22ADC */ jal sub_GAME_7F08A928 +/* 0BB4E4 7F088AF4 0FC22ADC */ jal bondviewClearUpperTextDisplayFlag /* 0BB4E8 7F088AF8 2404FFFF */ li $a0, -1 /* 0BB4EC 7F088AFC 0FC26669 */ jal getPlayerCount /* 0BB4F0 7F088B00 00000000 */ nop @@ -38163,10 +15943,10 @@ glabel sub_GAME_7F088CD8 /* 0BD9C0 7F088E90 116000CD */ beqz $t3, .L7F0891C8 /* 0BD9C4 7F088E94 00000000 */ nop .L7F088E98: -/* 0BD9C8 7F088E98 3C1E8004 */ lui $fp, %hi(ptrSecondFontTableLarge) +/* 0BD9C8 7F088E98 3C1E8004 */ lui $fp, %hi(ptrFontZurichBoldChars) /* 0BD9CC 7F088E9C 24015011 */ li $at, 20497 /* 0BD9D0 7F088EA0 1041005E */ beq $v0, $at, .L7F08901C -/* 0BD9D4 7F088EA4 27DE0EB8 */ addiu $fp, %lo(ptrSecondFontTableLarge) # addiu $fp, $fp, 0xeb8 +/* 0BD9D4 7F088EA4 27DE0EB8 */ addiu $fp, %lo(ptrFontZurichBoldChars) # addiu $fp, $fp, 0xeb8 /* 0BD9D8 7F088EA8 00402025 */ move $a0, $v0 /* 0BD9DC 7F088EAC 0FC30776 */ jal langGet /* 0BD9E0 7F088EB0 00138900 */ sll $s1, $s3, 4 @@ -38192,8 +15972,8 @@ glabel sub_GAME_7F088CD8 /* 0BDA28 7F088EF8 01808025 */ move $s0, $t4 /* 0BDA2C 7F088EFC 8FAE00B4 */ lw $t6, 0xb4($sp) /* 0BDA30 7F088F00 00516821 */ addu $t5, $v0, $s1 -/* 0BDA34 7F088F04 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0BDA38 7F088F08 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) +/* 0BDA34 7F088F04 3C198004 */ lui $t9, %hi(ptrFontZurichBold) +/* 0BDA38 7F088F08 8F390EB4 */ lw $t9, %lo(ptrFontZurichBold)($t9) /* 0BDA3C 7F088F0C 01AE7823 */ subu $t7, $t5, $t6 /* 0BDA40 7F088F10 01F0C021 */ addu $t8, $t7, $s0 /* 0BDA44 7F088F14 AFB800A8 */ sw $t8, 0xa8($sp) @@ -38204,7 +15984,7 @@ glabel sub_GAME_7F088CD8 /* 0BDA58 7F088F28 8FC70000 */ lw $a3, ($fp) /* 0BDA5C 7F088F2C AFA00014 */ sw $zero, 0x14($sp) /* 0BDA60 7F088F30 AFA00098 */ sw $zero, 0x98($sp) -/* 0BDA64 7F088F34 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0BDA64 7F088F34 0FC2BA63 */ jal textMeasure /* 0BDA68 7F088F38 AFB90010 */ sw $t9, 0x10($sp) /* 0BDA6C 7F088F3C 8FAA0084 */ lw $t2, 0x84($sp) /* 0BDA70 7F088F40 8FA900A8 */ lw $t1, 0xa8($sp) @@ -38245,8 +16025,8 @@ glabel sub_GAME_7F088CD8 /* 0BDAF0 7F088FC0 00107C03 */ sra $t7, $s0, 0x10 /* 0BDAF4 7F088FC4 0C00110B */ jal viGetY /* 0BDAF8 7F088FC8 01E08025 */ move $s0, $t7 -/* 0BDAFC 7F088FCC 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0BDB00 7F088FD0 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) +/* 0BDAFC 7F088FCC 3C198004 */ lui $t9, %hi(ptrFontZurichBold) +/* 0BDB00 7F088FD0 8F390EB4 */ lw $t9, %lo(ptrFontZurichBold)($t9) /* 0BDB04 7F088FD4 8FD80000 */ lw $t8, ($fp) /* 0BDB08 7F088FD8 2409FFFF */ li $t1, -1 /* 0BDB0C 7F088FDC AFA90018 */ sw $t1, 0x18($sp) @@ -38259,7 +16039,7 @@ glabel sub_GAME_7F088CD8 /* 0BDB28 7F088FF8 AFA00024 */ sw $zero, 0x24($sp) /* 0BDB2C 7F088FFC AFA00028 */ sw $zero, 0x28($sp) /* 0BDB30 7F089000 AFB90014 */ sw $t9, 0x14($sp) -/* 0BDB34 7F089004 0FC2B6AF */ jal en_text_write_stuff +/* 0BDB34 7F089004 0FC2B6AF */ jal textRender /* 0BDB38 7F089008 AFB80010 */ sw $t8, 0x10($sp) /* 0BDB3C 7F08900C 3C0B8003 */ lui $t3, %hi(D_80036440) /* 0BDB40 7F089010 8D6B6440 */ lw $t3, %lo(D_80036440)($t3) @@ -38294,8 +16074,8 @@ glabel sub_GAME_7F088CD8 /* 0BDBA8 7F089078 01808025 */ move $s0, $t4 /* 0BDBAC 7F08907C 8FAE00B4 */ lw $t6, 0xb4($sp) /* 0BDBB0 7F089080 00516821 */ addu $t5, $v0, $s1 -/* 0BDBB4 7F089084 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0BDBB8 7F089088 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) +/* 0BDBB4 7F089084 3C198004 */ lui $t9, %hi(ptrFontZurichBold) +/* 0BDBB8 7F089088 8F390EB4 */ lw $t9, %lo(ptrFontZurichBold)($t9) /* 0BDBBC 7F08908C 01AE7823 */ subu $t7, $t5, $t6 /* 0BDBC0 7F089090 01F0C021 */ addu $t8, $t7, $s0 /* 0BDBC4 7F089094 AFB800A8 */ sw $t8, 0xa8($sp) @@ -38306,7 +16086,7 @@ glabel sub_GAME_7F088CD8 /* 0BDBD8 7F0890A8 8FC70000 */ lw $a3, ($fp) /* 0BDBDC 7F0890AC AFA00014 */ sw $zero, 0x14($sp) /* 0BDBE0 7F0890B0 AFA00098 */ sw $zero, 0x98($sp) -/* 0BDBE4 7F0890B4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0BDBE4 7F0890B4 0FC2BA63 */ jal textMeasure /* 0BDBE8 7F0890B8 AFB90010 */ sw $t9, 0x10($sp) /* 0BDBEC 7F0890BC 8FAA0080 */ lw $t2, 0x80($sp) /* 0BDBF0 7F0890C0 8FA900A8 */ lw $t1, 0xa8($sp) @@ -38347,8 +16127,8 @@ glabel sub_GAME_7F088CD8 /* 0BDC70 7F089140 00107C03 */ sra $t7, $s0, 0x10 /* 0BDC74 7F089144 0C00110B */ jal viGetY /* 0BDC78 7F089148 01E08025 */ move $s0, $t7 -/* 0BDC7C 7F08914C 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0BDC80 7F089150 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) +/* 0BDC7C 7F08914C 3C198004 */ lui $t9, %hi(ptrFontZurichBold) +/* 0BDC80 7F089150 8F390EB4 */ lw $t9, %lo(ptrFontZurichBold)($t9) /* 0BDC84 7F089154 8FD80000 */ lw $t8, ($fp) /* 0BDC88 7F089158 2409FFFF */ li $t1, -1 /* 0BDC8C 7F08915C AFA90018 */ sw $t1, 0x18($sp) @@ -38361,7 +16141,7 @@ glabel sub_GAME_7F088CD8 /* 0BDCA8 7F089178 AFA00024 */ sw $zero, 0x24($sp) /* 0BDCAC 7F08917C AFA00028 */ sw $zero, 0x28($sp) /* 0BDCB0 7F089180 AFB90014 */ sw $t9, 0x14($sp) -/* 0BDCB4 7F089184 0FC2B6AF */ jal en_text_write_stuff +/* 0BDCB4 7F089184 0FC2B6AF */ jal textRender /* 0BDCB8 7F089188 AFB80010 */ sw $t8, 0x10($sp) /* 0BDCBC 7F08918C 0040A825 */ move $s5, $v0 .L7F089190: @@ -38432,7 +16212,7 @@ glabel maybe_mp_interface /* 0BDD74 7F089244 0FC22ABA */ jal sub_GAME_7F08AAE8 /* 0BDD78 7F089248 8FA40058 */ lw $a0, 0x58($sp) /* 0BDD7C 7F08924C AFA20058 */ sw $v0, 0x58($sp) -/* 0BDD80 7F089250 0FC15884 */ jal sub_GAME_7F056210 +/* 0BDD80 7F089250 0FC15884 */ jal countdownTimerRender /* 0BDD84 7F089254 00402025 */ move $a0, $v0 /* 0BDD88 7F089258 AFA20058 */ sw $v0, 0x58($sp) /* 0BDD8C 7F08925C 0FC20138 */ jal currentPlayerDrawFade @@ -38719,12 +16499,12 @@ glabel maybe_mp_interface /* 0BE1A0 7F089670 0FC22ABA */ jal sub_GAME_7F08AAE8 /* 0BE1A4 7F089674 8FA40058 */ lw $a0, 0x58($sp) /* 0BE1A8 7F089678 AFA20058 */ sw $v0, 0x58($sp) -/* 0BE1AC 7F08967C 0FC1A979 */ jal display_in_game_crosshair +/* 0BE1AC 7F08967C 0FC1A979 */ jal gunDrawSight /* 0BE1B0 7F089680 27A40058 */ addiu $a0, $sp, 0x58 /* 0BE1B4 7F089684 0FC1A73D */ jal generate_ammo_total_microcode /* 0BE1B8 7F089688 8FA40058 */ lw $a0, 0x58($sp) /* 0BE1BC 7F08968C AFA20058 */ sw $v0, 0x58($sp) -/* 0BE1C0 7F089690 0FC15884 */ jal sub_GAME_7F056210 +/* 0BE1C0 7F089690 0FC15884 */ jal countdownTimerRender /* 0BE1C4 7F089694 00402025 */ move $a0, $v0 /* 0BE1C8 7F089698 AFA20058 */ sw $v0, 0x58($sp) /* 0BE1CC 7F08969C 0FC31824 */ jal display_red_blue_on_radar @@ -38762,7 +16542,7 @@ glabel maybe_mp_interface /* 0BBD9C 7F0893AC 0FC22B4C */ jal sub_GAME_7F08AAE8 /* 0BBDA0 7F0893B0 8FA40058 */ lw $a0, 0x58($sp) /* 0BBDA4 7F0893B4 AFA20058 */ sw $v0, 0x58($sp) -/* 0BBDA8 7F0893B8 0FC1593C */ jal sub_GAME_7F056210 +/* 0BBDA8 7F0893B8 0FC1593C */ jal countdownTimerRender /* 0BBDAC 7F0893BC 00402025 */ move $a0, $v0 /* 0BBDB0 7F0893C0 AFA20058 */ sw $v0, 0x58($sp) /* 0BBDB4 7F0893C4 0FC20161 */ jal currentPlayerDrawFade @@ -39049,12 +16829,12 @@ glabel maybe_mp_interface /* 0BC1C8 7F0897D8 0FC22B4C */ jal sub_GAME_7F08AAE8 /* 0BC1CC 7F0897DC 8FA40058 */ lw $a0, 0x58($sp) /* 0BC1D0 7F0897E0 AFA20058 */ sw $v0, 0x58($sp) -/* 0BC1D4 7F0897E4 0FC1AB5E */ jal display_in_game_crosshair +/* 0BC1D4 7F0897E4 0FC1AB5E */ jal gunDrawSight /* 0BC1D8 7F0897E8 27A40058 */ addiu $a0, $sp, 0x58 /* 0BC1DC 7F0897EC 0FC1A922 */ jal generate_ammo_total_microcode /* 0BC1E0 7F0897F0 8FA40058 */ lw $a0, 0x58($sp) /* 0BC1E4 7F0897F4 AFA20058 */ sw $v0, 0x58($sp) -/* 0BC1E8 7F0897F8 0FC1593C */ jal sub_GAME_7F056210 +/* 0BC1E8 7F0897F8 0FC1593C */ jal countdownTimerRender /* 0BC1EC 7F0897FC 00402025 */ move $a0, $v0 /* 0BC1F0 7F089800 AFA20058 */ sw $v0, 0x58($sp) /* 0BC1F4 7F089804 0FC31568 */ jal display_red_blue_on_radar @@ -39171,9 +16951,9 @@ void bondviewKillCurrentPlayer(void) g_CurrentPlayer->thetadie = g_CurrentPlayer->vv_theta; g_CurrentPlayer->vertadie = g_CurrentPlayer->vv_verta; - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - D_8003648C = 1; + g_ExplodeTankOnDeathFlag = 1; } currentPlayerEquipWeaponWrapper(GUNLEFT, 0); @@ -40502,16 +18282,16 @@ void bondviewUpdateGuardTankFlagsRelated(PropRecord *arg0, s32 flags) { s32 sp1C; - sp1C = sub_GAME_7F09B15C(arg0); + sp1C = getPlayerPointerIndex(arg0); if (arg0->chr != NULL) { - set_or_unset_GUARDdata_flag(arg0->chr, flags); + chrSetMoving(arg0->chr, flags); } - if (ptr_playerstank != NULL) + if (g_PlayerTankProp != NULL) { - sub_GAME_7F04F218(ptr_playerstank, flags); + sub_GAME_7F04F218(g_PlayerTankProp, flags); } g_playerPointers[sp1C]->field_AC = flags; @@ -40528,7 +18308,7 @@ void bondviewGetPropHeightRelatedValues(PropRecord *arg0, struct rect4f **field_ { s32 temp_v0; - temp_v0 = sub_GAME_7F09B15C(arg0); + temp_v0 = getPlayerPointerIndex(arg0); if (g_playerPointers[temp_v0]->field_AC != 0) { if (getPlayerCount() == 1 || g_playerPointers[temp_v0]->bonddead == 0) @@ -40559,7 +18339,7 @@ void bondviewUpdatePlayerCollisionBounds(void) if (in_tank_flag == 1) { - bondviewTankCollisionRelated(&g_CurrentPlayer->collision_bounds, &g_CurrentPlayer->field_488.collision_position, g_TankOrientationAngle); + bondviewGetTankCollisionBounds(&g_CurrentPlayer->collision_bounds, &g_CurrentPlayer->field_488.collision_position, g_TankOrientationAngle); return; } @@ -40586,11 +18366,11 @@ void bondviewUpdatePlayerCollisionBounds(void) * * Address 0x7F08A274. */ -void bondviewCollisionRadiusRelated(PropRecord* arg0, f32 *collision_radius, f32 *height, f32 *always_30) +void bondviewGetCollisionRadius(PropRecord* arg0, f32 *collision_radius, f32 *height, f32 *always_30) { struct player **temp_v1; - temp_v1 = &g_playerPointers[sub_GAME_7F09B15C(arg0)]; + temp_v1 = &g_playerPointers[getPlayerPointerIndex(arg0)]; *collision_radius = (*temp_v1)->field_488.collision_radius; *height = (bondviewGetPlayerDuckingHeightRelated(*temp_v1) + 10.0f) - 30.0f; *always_30 = 30.0f; @@ -40641,9 +18421,9 @@ void bondviewResetIntroCameraMessageDialogs(void) display_statusbar = 0; status_bar_text_buffer_index = 0; -#ifdef VERSION_US - copy_1stfonttable = ptrFirstFontTableSmall; - copy_2ndfonttable = ptrSecondFontTableSmall; +#ifdef BUGFIX_R0 + copy_1stfonttable = ptrFontBankGothic; + copy_2ndfonttable = ptrFontBankGothicChars; #endif } @@ -40742,7 +18522,7 @@ void hudmsgBottomShow(char *string) #if defined(BUGFIX_R1) void jp_hudmsgBottomShow(char *string) { - hudmsgBottomShow(string, ptrSecondFontTableSmall, ptrFirstFontTableSmall); + hudmsgBottomShow(string, ptrFontBankGothicChars, ptrFontBankGothic); } #endif @@ -40817,7 +18597,7 @@ Gfx* sub_GAME_7F08A5FC(Gfx* arg0) arg0 = microcode_constructor(arg0); view_left_offset = 0; view_top_offset = 0; - sub_GAME_7F0AE98C(&view_top_offset, &view_left_offset ,(u8* ) stringbuffer_lowerleft[status_bar_text_buffer_index], BONDVIEW_2ND_FONTTABLE(status_bar_text_buffer_index), BONDVIEW_1ST_FONTTABLE(status_bar_text_buffer_index), 0); + textMeasure(&view_top_offset, &view_left_offset ,(u8* ) stringbuffer_lowerleft[status_bar_text_buffer_index], BONDVIEW_2ND_FONTTABLE(status_bar_text_buffer_index), BONDVIEW_1ST_FONTTABLE(status_bar_text_buffer_index), 0); if (getPlayerCount() < 3) { @@ -40862,7 +18642,7 @@ Gfx* sub_GAME_7F08A5FC(Gfx* arg0) view_vert = view_top - view_top_offset; arg0 = draw_blackbox_to_screen(arg0, (s32) &view_left, (s32) &view_vert, (s32) &view_horiz, (s32) &view_top); - arg0 = combiner_bayer_lod_perspective(jp_text_write_stuff(arg0, &view_left, &view_vert, stringbuffer_lowerleft[status_bar_text_buffer_index], BONDVIEW_2ND_FONTTABLE(status_bar_text_buffer_index), BONDVIEW_1ST_FONTTABLE(status_bar_text_buffer_index), -1, 0x646464FFU, (s16) (s32) viGetX(), (s16) viGetY(), 0, 0)); + arg0 = combiner_bayer_lod_perspective(textRenderGlow(arg0, &view_left, &view_vert, stringbuffer_lowerleft[status_bar_text_buffer_index], BONDVIEW_2ND_FONTTABLE(status_bar_text_buffer_index), BONDVIEW_1ST_FONTTABLE(status_bar_text_buffer_index), -1, 0x646464FFU, (s16) (s32) viGetX(), (s16) viGetY(), 0, 0)); } } @@ -40870,26 +18650,26 @@ Gfx* sub_GAME_7F08A5FC(Gfx* arg0) } -void sub_GAME_7F08A900(void) +void bondviewResetUpperTextDisplay(void) { upper_text_window_timer = -1; display_upper_text_window = 0; upper_text_buffer_index = 0; - D_800368B4 = 0; + g_UpperTextDisplayFlag = 0; } -void sub_GAME_7F08A928(int param_1) +void bondviewClearUpperTextDisplayFlag(int param_1) { int new_var; new_var = ~param_1; - D_800368B4 = D_800368B4 & new_var; + g_UpperTextDisplayFlag = g_UpperTextDisplayFlag & new_var; } -void sub_GAME_7F08A944(PLAYERFLAG flag) +void bondviewSetUpperTextDisplayFlag(PLAYERFLAG flag) { - D_800368B4 |= flag; + g_UpperTextDisplayFlag |= flag; } @@ -40917,7 +18697,7 @@ void hudmsgTopShow(char* string) */ void bondviewUpperTextWindowTimerTick(void) { - if ((D_800368B4 == 0) && (g_CurrentPlayer->mpmenuon == 0)) + if ((g_UpperTextDisplayFlag == 0) && (g_CurrentPlayer->mpmenuon == 0)) { if (upper_text_window_timer >= 0) { @@ -40966,8 +18746,8 @@ glabel D_800552BC .word 0x40490fdb /*3.1415927*/ .text glabel sub_GAME_7F08AAE8 -/* 0BF618 7F08AAE8 3C0E8003 */ lui $t6, %hi(D_800368B4) -/* 0BF61C 7F08AAEC 8DCE68B4 */ lw $t6, %lo(D_800368B4)($t6) +/* 0BF618 7F08AAE8 3C0E8003 */ lui $t6, %hi(g_UpperTextDisplayFlag) +/* 0BF61C 7F08AAEC 8DCE68B4 */ lw $t6, %lo(g_UpperTextDisplayFlag)($t6) /* 0BF620 7F08AAF0 27BDFF18 */ addiu $sp, $sp, -0xe8 /* 0BF624 7F08AAF4 AFB00038 */ sw $s0, 0x38($sp) /* 0BF628 7F08AAF8 00808025 */ move $s0, $a0 @@ -40999,8 +18779,8 @@ glabel sub_GAME_7F08AAE8 /* 0BF690 7F08AB60 00000000 */ nop /* 0BF694 7F08AB64 3C0B8003 */ lui $t3, %hi(upper_text_buffer_index) /* 0BF698 7F08AB68 8D6B68A8 */ lw $t3, %lo(upper_text_buffer_index)($t3) -/* 0BF69C 7F08AB6C 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) -/* 0BF6A0 7F08AB70 8DCE0EB4 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) +/* 0BF69C 7F08AB6C 3C0E8004 */ lui $t6, %hi(ptrFontZurichBold) +/* 0BF6A0 7F08AB70 8DCE0EB4 */ lw $t6, %lo(ptrFontZurichBold)($t6) /* 0BF6A4 7F08AB74 000B6080 */ sll $t4, $t3, 2 /* 0BF6A8 7F08AB78 018B6021 */ addu $t4, $t4, $t3 /* 0BF6AC 7F08AB7C 000C6080 */ sll $t4, $t4, 2 @@ -41008,17 +18788,17 @@ glabel sub_GAME_7F08AAE8 /* 0BF6B4 7F08AB84 000C60C0 */ sll $t4, $t4, 3 /* 0BF6B8 7F08AB88 3C0D8008 */ lui $t5, %hi(stringbuffer_top) /* 0BF6BC 7F08AB8C 25AD9C70 */ addiu $t5, %lo(stringbuffer_top) # addiu $t5, $t5, -0x6390 -/* 0BF6C0 7F08AB90 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) +/* 0BF6C0 7F08AB90 3C078004 */ lui $a3, %hi(ptrFontZurichBoldChars) /* 0BF6C4 7F08AB94 018B6023 */ subu $t4, $t4, $t3 /* 0BF6C8 7F08AB98 00408025 */ move $s0, $v0 /* 0BF6CC 7F08AB9C AFA000D4 */ sw $zero, 0xd4($sp) /* 0BF6D0 7F08ABA0 AFA000D8 */ sw $zero, 0xd8($sp) /* 0BF6D4 7F08ABA4 018D3021 */ addu $a2, $t4, $t5 -/* 0BF6D8 7F08ABA8 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) +/* 0BF6D8 7F08ABA8 8CE70EB8 */ lw $a3, %lo(ptrFontZurichBoldChars)($a3) /* 0BF6DC 7F08ABAC 27A400D8 */ addiu $a0, $sp, 0xd8 /* 0BF6E0 7F08ABB0 27A500D4 */ addiu $a1, $sp, 0xd4 /* 0BF6E4 7F08ABB4 AFA00014 */ sw $zero, 0x14($sp) -/* 0BF6E8 7F08ABB8 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0BF6E8 7F08ABB8 0FC2BA63 */ jal textMeasure /* 0BF6EC 7F08ABBC AFAE0010 */ sw $t6, 0x10($sp) /* 0BF6F0 7F08ABC0 3C0F8003 */ lui $t7, %hi(camera_8003642C) /* 0BF6F4 7F08ABC4 8DEF642C */ lw $t7, %lo(camera_8003642C)($t7) @@ -41081,14 +18861,14 @@ glabel sub_GAME_7F08AAE8 /* 0BF7C8 7F08AC98 A7A20048 */ sh $v0, 0x48($sp) /* 0BF7CC 7F08AC9C 3C0C8003 */ lui $t4, %hi(upper_text_buffer_index) /* 0BF7D0 7F08ACA0 8D8C68A8 */ lw $t4, %lo(upper_text_buffer_index)($t4) -/* 0BF7D4 7F08ACA4 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableLarge) -/* 0BF7D8 7F08ACA8 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) +/* 0BF7D4 7F08ACA4 3C0F8004 */ lui $t7, %hi(ptrFontZurichBoldChars) +/* 0BF7D8 7F08ACA8 3C188004 */ lui $t8, %hi(ptrFontZurichBold) /* 0BF7DC 7F08ACAC 000C6880 */ sll $t5, $t4, 2 /* 0BF7E0 7F08ACB0 01AC6821 */ addu $t5, $t5, $t4 /* 0BF7E4 7F08ACB4 000D6880 */ sll $t5, $t5, 2 /* 0BF7E8 7F08ACB8 01AC6823 */ subu $t5, $t5, $t4 -/* 0BF7EC 7F08ACBC 8F180EB4 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) -/* 0BF7F0 7F08ACC0 8DEF0EB8 */ lw $t7, %lo(ptrSecondFontTableLarge)($t7) +/* 0BF7EC 7F08ACBC 8F180EB4 */ lw $t8, %lo(ptrFontZurichBold)($t8) +/* 0BF7F0 7F08ACC0 8DEF0EB8 */ lw $t7, %lo(ptrFontZurichBoldChars)($t7) /* 0BF7F4 7F08ACC4 87A80048 */ lh $t0, 0x48($sp) /* 0BF7F8 7F08ACC8 000D68C0 */ sll $t5, $t5, 3 /* 0BF7FC 7F08ACCC 3C0E8008 */ lui $t6, %hi(stringbuffer_top) @@ -41105,7 +18885,7 @@ glabel sub_GAME_7F08AAE8 /* 0BF828 7F08ACF8 AFA00028 */ sw $zero, 0x28($sp) /* 0BF82C 7F08ACFC AFB80014 */ sw $t8, 0x14($sp) /* 0BF830 7F08AD00 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BF834 7F08AD04 0FC2B6AF */ jal en_text_write_stuff +/* 0BF834 7F08AD04 0FC2B6AF */ jal textRender /* 0BF838 7F08AD08 AFA8001C */ sw $t0, 0x1c($sp) /* 0BF83C 7F08AD0C 0FC2B3BC */ jal combiner_bayer_lod_perspective /* 0BF840 7F08AD10 00402025 */ move $a0, $v0 @@ -41231,10 +19011,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFA1C 7F08AEEC 00408025 */ move $s0, $v0 /* 0BFA20 7F08AEF0 0C00110B */ jal viGetY /* 0BFA24 7F08AEF4 A7A20048 */ sh $v0, 0x48($sp) -/* 0BFA28 7F08AEF8 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) -/* 0BFA2C 7F08AEFC 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0BFA30 7F08AF00 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0BFA34 7F08AF04 8D4A0EB0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0BFA28 7F08AEF8 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) +/* 0BFA2C 7F08AEFC 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0BFA30 7F08AF00 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0BFA34 7F08AF04 8D4A0EB0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0BFA38 7F08AF08 87AB0048 */ lh $t3, 0x48($sp) /* 0BFA3C 7F08AF0C 240DFFFF */ li $t5, -1 /* 0BFA40 7F08AF10 AFAD0018 */ sw $t5, 0x18($sp) @@ -41247,7 +19027,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFA5C 7F08AF2C AFA00028 */ sw $zero, 0x28($sp) /* 0BFA60 7F08AF30 AFAE0014 */ sw $t6, 0x14($sp) /* 0BFA64 7F08AF34 AFAA0010 */ sw $t2, 0x10($sp) -/* 0BFA68 7F08AF38 0FC2B6AF */ jal en_text_write_stuff +/* 0BFA68 7F08AF38 0FC2B6AF */ jal textRender /* 0BFA6C 7F08AF3C AFAB001C */ sw $t3, 0x1c($sp) /* 0BFA70 7F08AF40 0C001145 */ jal viGetViewLeft /* 0BFA74 7F08AF44 00408025 */ move $s0, $v0 @@ -41256,10 +19036,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFA80 7F08AF50 AFAC0080 */ sw $t4, 0x80($sp) /* 0BFA84 7F08AF54 0C00110B */ jal viGetY /* 0BFA88 7F08AF58 A7A20048 */ sh $v0, 0x48($sp) -/* 0BFA8C 7F08AF5C 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0BFA90 7F08AF60 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0BFA94 7F08AF64 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0BFA98 7F08AF68 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0BFA8C 7F08AF5C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0BFA90 7F08AF60 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0BFA94 7F08AF64 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0BFA98 7F08AF68 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0BFA9C 7F08AF6C 87A80048 */ lh $t0, 0x48($sp) /* 0BFAA0 7F08AF70 2419FFFF */ li $t9, -1 /* 0BFAA4 7F08AF74 AFB90018 */ sw $t9, 0x18($sp) @@ -41272,7 +19052,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFAC0 7F08AF90 AFA00028 */ sw $zero, 0x28($sp) /* 0BFAC4 7F08AF94 AFB80014 */ sw $t8, 0x14($sp) /* 0BFAC8 7F08AF98 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BFACC 7F08AF9C 0FC2B6AF */ jal en_text_write_stuff +/* 0BFACC 7F08AF9C 0FC2B6AF */ jal textRender /* 0BFAD0 7F08AFA0 AFA8001C */ sw $t0, 0x1c($sp) /* 0BFAD4 7F08AFA4 0C001145 */ jal viGetViewLeft /* 0BFAD8 7F08AFA8 00408025 */ move $s0, $v0 @@ -41281,10 +19061,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFAE4 7F08AFB4 AFA90080 */ sw $t1, 0x80($sp) /* 0BFAE8 7F08AFB8 0C00110B */ jal viGetY /* 0BFAEC 7F08AFBC A7A20048 */ sh $v0, 0x48($sp) -/* 0BFAF0 7F08AFC0 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) -/* 0BFAF4 7F08AFC4 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0BFAF8 7F08AFC8 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0BFAFC 7F08AFCC 8D4A0EB0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0BFAF0 7F08AFC0 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) +/* 0BFAF4 7F08AFC4 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0BFAF8 7F08AFC8 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0BFAFC 7F08AFCC 8D4A0EB0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0BFB00 7F08AFD0 87AB0048 */ lh $t3, 0x48($sp) /* 0BFB04 7F08AFD4 240DFFFF */ li $t5, -1 /* 0BFB08 7F08AFD8 AFAD0018 */ sw $t5, 0x18($sp) @@ -41297,7 +19077,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFB24 7F08AFF4 AFA00028 */ sw $zero, 0x28($sp) /* 0BFB28 7F08AFF8 AFAE0014 */ sw $t6, 0x14($sp) /* 0BFB2C 7F08AFFC AFAA0010 */ sw $t2, 0x10($sp) -/* 0BFB30 7F08B000 0FC2B6AF */ jal en_text_write_stuff +/* 0BFB30 7F08B000 0FC2B6AF */ jal textRender /* 0BFB34 7F08B004 AFAB001C */ sw $t3, 0x1c($sp) /* 0BFB38 7F08B008 0C001145 */ jal viGetViewLeft /* 0BFB3C 7F08B00C 00408025 */ move $s0, $v0 @@ -41306,10 +19086,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFB48 7F08B018 AFAC0080 */ sw $t4, 0x80($sp) /* 0BFB4C 7F08B01C 0C00110B */ jal viGetY /* 0BFB50 7F08B020 A7A20048 */ sh $v0, 0x48($sp) -/* 0BFB54 7F08B024 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0BFB58 7F08B028 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0BFB5C 7F08B02C 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0BFB60 7F08B030 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0BFB54 7F08B024 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0BFB58 7F08B028 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0BFB5C 7F08B02C 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0BFB60 7F08B030 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0BFB64 7F08B034 87A80048 */ lh $t0, 0x48($sp) /* 0BFB68 7F08B038 2419FFFF */ li $t9, -1 /* 0BFB6C 7F08B03C AFB90018 */ sw $t9, 0x18($sp) @@ -41322,7 +19102,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFB88 7F08B058 AFA00028 */ sw $zero, 0x28($sp) /* 0BFB8C 7F08B05C AFB80014 */ sw $t8, 0x14($sp) /* 0BFB90 7F08B060 AFAF0010 */ sw $t7, 0x10($sp) -/* 0BFB94 7F08B064 0FC2B6AF */ jal en_text_write_stuff +/* 0BFB94 7F08B064 0FC2B6AF */ jal textRender /* 0BFB98 7F08B068 AFA8001C */ sw $t0, 0x1c($sp) /* 0BFB9C 7F08B06C 0C001145 */ jal viGetViewLeft /* 0BFBA0 7F08B070 00408025 */ move $s0, $v0 @@ -41331,10 +19111,10 @@ glabel sub_GAME_7F08AAE8 /* 0BFBAC 7F08B07C AFA90080 */ sw $t1, 0x80($sp) /* 0BFBB0 7F08B080 0C00110B */ jal viGetY /* 0BFBB4 7F08B084 A7A20048 */ sh $v0, 0x48($sp) -/* 0BFBB8 7F08B088 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) -/* 0BFBBC 7F08B08C 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0BFBC0 7F08B090 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0BFBC4 7F08B094 8D4A0EB0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0BFBB8 7F08B088 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) +/* 0BFBBC 7F08B08C 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0BFBC0 7F08B090 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0BFBC4 7F08B094 8D4A0EB0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0BFBC8 7F08B098 87AB0048 */ lh $t3, 0x48($sp) /* 0BFBCC 7F08B09C 240DFFFF */ li $t5, -1 /* 0BFBD0 7F08B0A0 AFAD0018 */ sw $t5, 0x18($sp) @@ -41347,7 +19127,7 @@ glabel sub_GAME_7F08AAE8 /* 0BFBEC 7F08B0BC AFA00028 */ sw $zero, 0x28($sp) /* 0BFBF0 7F08B0C0 AFAE0014 */ sw $t6, 0x14($sp) /* 0BFBF4 7F08B0C4 AFAA0010 */ sw $t2, 0x10($sp) -/* 0BFBF8 7F08B0C8 0FC2B6AF */ jal en_text_write_stuff +/* 0BFBF8 7F08B0C8 0FC2B6AF */ jal textRender /* 0BFBFC 7F08B0CC AFAB001C */ sw $t3, 0x1c($sp) /* 0BFC00 7F08B0D0 0FC2B3BC */ jal combiner_bayer_lod_perspective /* 0BFC04 7F08B0D4 00402025 */ move $a0, $v0 @@ -41368,8 +19148,8 @@ glabel D_800552BC .word 0x40490fdb /*3.1415927*/ .text glabel sub_GAME_7F08AAE8 -/* 0BFE34 7F08B2C4 3C0E8003 */ lui $t6, %hi(D_800368B4) # $t6, 0x8003 -/* 0BFE38 7F08B2C8 8DCE68EC */ lw $t6, %lo(D_800368B4)($t6) +/* 0BFE34 7F08B2C4 3C0E8003 */ lui $t6, %hi(g_UpperTextDisplayFlag) # $t6, 0x8003 +/* 0BFE38 7F08B2C8 8DCE68EC */ lw $t6, %lo(g_UpperTextDisplayFlag)($t6) /* 0BFE3C 7F08B2CC 27BDFF18 */ addiu $sp, $sp, -0xe8 /* 0BFE40 7F08B2D0 AFB00038 */ sw $s0, 0x38($sp) /* 0BFE44 7F08B2D4 00808025 */ move $s0, $a0 @@ -41401,8 +19181,8 @@ glabel sub_GAME_7F08AAE8 /* 0BFEAC 7F08B33C 00000000 */ nop /* 0BFEB0 7F08B340 3C0B8003 */ lui $t3, %hi(upper_text_buffer_index) # $t3, 0x8003 /* 0BFEB4 7F08B344 8D6B68E0 */ lw $t3, %lo(upper_text_buffer_index)($t3) -/* 0BFEB8 7F08B348 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) # $t6, 0x8004 -/* 0BFEBC 7F08B34C 8DCE0EE4 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) +/* 0BFEB8 7F08B348 3C0E8004 */ lui $t6, %hi(ptrFontZurichBold) # $t6, 0x8004 +/* 0BFEBC 7F08B34C 8DCE0EE4 */ lw $t6, %lo(ptrFontZurichBold)($t6) /* 0BFEC0 7F08B350 000B6080 */ sll $t4, $t3, 2 /* 0BFEC4 7F08B354 018B6021 */ addu $t4, $t4, $t3 /* 0BFEC8 7F08B358 000C6080 */ sll $t4, $t4, 2 @@ -41410,17 +19190,17 @@ glabel sub_GAME_7F08AAE8 /* 0BFED0 7F08B360 000C60C0 */ sll $t4, $t4, 3 /* 0BFED4 7F08B364 3C0D8008 */ lui $t5, %hi(stringbuffer_top) # $t5, 0x8008 /* 0BFED8 7F08B368 25AD9CE0 */ addiu $t5, %lo(stringbuffer_top) # addiu $t5, $t5, -0x6320 -/* 0BFEDC 7F08B36C 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 +/* 0BFEDC 7F08B36C 3C078004 */ lui $a3, %hi(ptrFontZurichBoldChars) # $a3, 0x8004 /* 0BFEE0 7F08B370 018B6023 */ subu $t4, $t4, $t3 /* 0BFEE4 7F08B374 00408025 */ move $s0, $v0 /* 0BFEE8 7F08B378 AFA000D4 */ sw $zero, 0xd4($sp) /* 0BFEEC 7F08B37C AFA000D8 */ sw $zero, 0xd8($sp) /* 0BFEF0 7F08B380 018D3021 */ addu $a2, $t4, $t5 -/* 0BFEF4 7F08B384 8CE70EE8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) +/* 0BFEF4 7F08B384 8CE70EE8 */ lw $a3, %lo(ptrFontZurichBoldChars)($a3) /* 0BFEF8 7F08B388 27A400D8 */ addiu $a0, $sp, 0xd8 /* 0BFEFC 7F08B38C 27A500D4 */ addiu $a1, $sp, 0xd4 /* 0BFF00 7F08B390 AFA00014 */ sw $zero, 0x14($sp) -/* 0BFF04 7F08B394 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0BFF04 7F08B394 0FC2BD4F */ jal textMeasure /* 0BFF08 7F08B398 AFAE0010 */ sw $t6, 0x10($sp) /* 0BFF0C 7F08B39C 3C0F8003 */ lui $t7, %hi(camera_8003642C) # $t7, 0x8003 /* 0BFF10 7F08B3A0 8DEF646C */ lw $t7, %lo(camera_8003642C)($t7) @@ -41488,14 +19268,14 @@ glabel sub_GAME_7F08AAE8 /* 0BFFF8 7F08B488 A7A20048 */ sh $v0, 0x48($sp) /* 0BFFFC 7F08B48C 3C0D8003 */ lui $t5, %hi(upper_text_buffer_index) # $t5, 0x8003 /* 0C0000 7F08B490 8DAD68E0 */ lw $t5, %lo(upper_text_buffer_index)($t5) -/* 0C0004 7F08B494 3C188004 */ lui $t8, %hi(ptrSecondFontTableLarge) # $t8, 0x8004 -/* 0C0008 7F08B498 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) # $t9, 0x8004 +/* 0C0004 7F08B494 3C188004 */ lui $t8, %hi(ptrFontZurichBoldChars) # $t8, 0x8004 +/* 0C0008 7F08B498 3C198004 */ lui $t9, %hi(ptrFontZurichBold) # $t9, 0x8004 /* 0C000C 7F08B49C 000D7080 */ sll $t6, $t5, 2 /* 0C0010 7F08B4A0 01CD7021 */ addu $t6, $t6, $t5 /* 0C0014 7F08B4A4 000E7080 */ sll $t6, $t6, 2 /* 0C0018 7F08B4A8 01CD7023 */ subu $t6, $t6, $t5 -/* 0C001C 7F08B4AC 8F390EE4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 0C0020 7F08B4B0 8F180EE8 */ lw $t8, %lo(ptrSecondFontTableLarge)($t8) +/* 0C001C 7F08B4AC 8F390EE4 */ lw $t9, %lo(ptrFontZurichBold)($t9) +/* 0C0020 7F08B4B0 8F180EE8 */ lw $t8, %lo(ptrFontZurichBoldChars)($t8) /* 0C0024 7F08B4B4 87AA0048 */ lh $t2, 0x48($sp) /* 0C0028 7F08B4B8 000E70C0 */ sll $t6, $t6, 3 /* 0C002C 7F08B4BC 3C0F8008 */ lui $t7, %hi(stringbuffer_top) # $t7, 0x8008 @@ -41515,7 +19295,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0064 7F08B4F4 AFA0002C */ sw $zero, 0x2c($sp) /* 0C0068 7F08B4F8 AFB90014 */ sw $t9, 0x14($sp) /* 0C006C 7F08B4FC AFB80010 */ sw $t8, 0x10($sp) -/* 0C0070 7F08B500 0FC2BCA7 */ jal jp_text_write_stuff +/* 0C0070 7F08B500 0FC2BCA7 */ jal textRenderGlow /* 0C0074 7F08B504 AFAA0020 */ sw $t2, 0x20($sp) /* 0C0078 7F08B508 10000022 */ b .Ljp7F08B594 /* 0C007C 7F08B50C 00408025 */ move $s0, $v0 @@ -41526,14 +19306,14 @@ glabel sub_GAME_7F08AAE8 /* 0C008C 7F08B51C A7A20048 */ sh $v0, 0x48($sp) /* 0C0090 7F08B520 3C0B8003 */ lui $t3, %hi(upper_text_buffer_index) # $t3, 0x8003 /* 0C0094 7F08B524 8D6B68E0 */ lw $t3, %lo(upper_text_buffer_index)($t3) -/* 0C0098 7F08B528 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableLarge) # $t6, 0x8004 -/* 0C009C 7F08B52C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) # $t7, 0x8004 +/* 0C0098 7F08B528 3C0E8004 */ lui $t6, %hi(ptrFontZurichBoldChars) # $t6, 0x8004 +/* 0C009C 7F08B52C 3C0F8004 */ lui $t7, %hi(ptrFontZurichBold) # $t7, 0x8004 /* 0C00A0 7F08B530 000B6080 */ sll $t4, $t3, 2 /* 0C00A4 7F08B534 018B6021 */ addu $t4, $t4, $t3 /* 0C00A8 7F08B538 000C6080 */ sll $t4, $t4, 2 /* 0C00AC 7F08B53C 018B6023 */ subu $t4, $t4, $t3 -/* 0C00B0 7F08B540 8DEF0EE4 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) -/* 0C00B4 7F08B544 8DCE0EE8 */ lw $t6, %lo(ptrSecondFontTableLarge)($t6) +/* 0C00B0 7F08B540 8DEF0EE4 */ lw $t7, %lo(ptrFontZurichBold)($t7) +/* 0C00B4 7F08B544 8DCE0EE8 */ lw $t6, %lo(ptrFontZurichBoldChars)($t6) /* 0C00B8 7F08B548 87B90048 */ lh $t9, 0x48($sp) /* 0C00BC 7F08B54C 000C60C0 */ sll $t4, $t4, 3 /* 0C00C0 7F08B550 3C0D8008 */ lui $t5, %hi(stringbuffer_top) # $t5, 0x8008 @@ -41550,7 +19330,7 @@ glabel sub_GAME_7F08AAE8 /* 0C00EC 7F08B57C AFA00028 */ sw $zero, 0x28($sp) /* 0C00F0 7F08B580 AFAF0014 */ sw $t7, 0x14($sp) /* 0C00F4 7F08B584 AFAE0010 */ sw $t6, 0x10($sp) -/* 0C00F8 7F08B588 0FC2B99B */ jal en_text_write_stuff +/* 0C00F8 7F08B588 0FC2B99B */ jal textRender /* 0C00FC 7F08B58C AFB9001C */ sw $t9, 0x1c($sp) /* 0C0100 7F08B590 00408025 */ move $s0, $v0 .Ljp7F08B594: @@ -41678,10 +19458,10 @@ glabel sub_GAME_7F08AAE8 /* 0C02E4 7F08B774 00408025 */ move $s0, $v0 /* 0C02E8 7F08B778 0C00110B */ jal viGetY /* 0C02EC 7F08B77C A7A20048 */ sh $v0, 0x48($sp) -/* 0C02F0 7F08B780 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0C02F4 7F08B784 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0C02F8 7F08B788 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0C02FC 7F08B78C 8D290EE0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0C02F0 7F08B780 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0C02F4 7F08B784 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0C02F8 7F08B788 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0C02FC 7F08B78C 8D290EE0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0C0300 7F08B790 87AA0048 */ lh $t2, 0x48($sp) /* 0C0304 7F08B794 240CFFFF */ li $t4, -1 /* 0C0308 7F08B798 AFAC0018 */ sw $t4, 0x18($sp) @@ -41694,7 +19474,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0324 7F08B7B4 AFA00028 */ sw $zero, 0x28($sp) /* 0C0328 7F08B7B8 AFAD0014 */ sw $t5, 0x14($sp) /* 0C032C 7F08B7BC AFA90010 */ sw $t1, 0x10($sp) -/* 0C0330 7F08B7C0 0FC2B99B */ jal en_text_write_stuff +/* 0C0330 7F08B7C0 0FC2B99B */ jal textRender /* 0C0334 7F08B7C4 AFAA001C */ sw $t2, 0x1c($sp) /* 0C0338 7F08B7C8 0C001145 */ jal viGetViewLeft /* 0C033C 7F08B7CC 00408025 */ move $s0, $v0 @@ -41703,10 +19483,10 @@ glabel sub_GAME_7F08AAE8 /* 0C0348 7F08B7D8 AFAB0080 */ sw $t3, 0x80($sp) /* 0C034C 7F08B7DC 0C00110B */ jal viGetY /* 0C0350 7F08B7E0 A7A20048 */ sh $v0, 0x48($sp) -/* 0C0354 7F08B7E4 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0C0358 7F08B7E8 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0C035C 7F08B7EC 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0C0360 7F08B7F0 8DCE0EE0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0C0354 7F08B7E4 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0C0358 7F08B7E8 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0C035C 7F08B7EC 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0C0360 7F08B7F0 8DCE0EE0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0C0364 7F08B7F4 87B90048 */ lh $t9, 0x48($sp) /* 0C0368 7F08B7F8 2418FFFF */ li $t8, -1 /* 0C036C 7F08B7FC AFB80018 */ sw $t8, 0x18($sp) @@ -41719,7 +19499,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0388 7F08B818 AFA00028 */ sw $zero, 0x28($sp) /* 0C038C 7F08B81C AFAF0014 */ sw $t7, 0x14($sp) /* 0C0390 7F08B820 AFAE0010 */ sw $t6, 0x10($sp) -/* 0C0394 7F08B824 0FC2B99B */ jal en_text_write_stuff +/* 0C0394 7F08B824 0FC2B99B */ jal textRender /* 0C0398 7F08B828 AFB9001C */ sw $t9, 0x1c($sp) /* 0C039C 7F08B82C 0C001145 */ jal viGetViewLeft /* 0C03A0 7F08B830 00408025 */ move $s0, $v0 @@ -41728,10 +19508,10 @@ glabel sub_GAME_7F08AAE8 /* 0C03AC 7F08B83C AFA80080 */ sw $t0, 0x80($sp) /* 0C03B0 7F08B840 0C00110B */ jal viGetY /* 0C03B4 7F08B844 A7A20048 */ sh $v0, 0x48($sp) -/* 0C03B8 7F08B848 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0C03BC 7F08B84C 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0C03C0 7F08B850 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0C03C4 7F08B854 8D290EE0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0C03B8 7F08B848 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0C03BC 7F08B84C 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0C03C0 7F08B850 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0C03C4 7F08B854 8D290EE0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0C03C8 7F08B858 87AA0048 */ lh $t2, 0x48($sp) /* 0C03CC 7F08B85C 240CFFFF */ li $t4, -1 /* 0C03D0 7F08B860 AFAC0018 */ sw $t4, 0x18($sp) @@ -41744,7 +19524,7 @@ glabel sub_GAME_7F08AAE8 /* 0C03EC 7F08B87C AFA00028 */ sw $zero, 0x28($sp) /* 0C03F0 7F08B880 AFAD0014 */ sw $t5, 0x14($sp) /* 0C03F4 7F08B884 AFA90010 */ sw $t1, 0x10($sp) -/* 0C03F8 7F08B888 0FC2B99B */ jal en_text_write_stuff +/* 0C03F8 7F08B888 0FC2B99B */ jal textRender /* 0C03FC 7F08B88C AFAA001C */ sw $t2, 0x1c($sp) /* 0C0400 7F08B890 0C001145 */ jal viGetViewLeft /* 0C0404 7F08B894 00408025 */ move $s0, $v0 @@ -41753,10 +19533,10 @@ glabel sub_GAME_7F08AAE8 /* 0C0410 7F08B8A0 AFAB0080 */ sw $t3, 0x80($sp) /* 0C0414 7F08B8A4 0C00110B */ jal viGetY /* 0C0418 7F08B8A8 A7A20048 */ sh $v0, 0x48($sp) -/* 0C041C 7F08B8AC 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0C0420 7F08B8B0 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0C0424 7F08B8B4 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0C0428 7F08B8B8 8DCE0EE0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0C041C 7F08B8AC 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0C0420 7F08B8B0 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0C0424 7F08B8B4 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0C0428 7F08B8B8 8DCE0EE0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0C042C 7F08B8BC 87B90048 */ lh $t9, 0x48($sp) /* 0C0430 7F08B8C0 2418FFFF */ li $t8, -1 /* 0C0434 7F08B8C4 AFB80018 */ sw $t8, 0x18($sp) @@ -41769,7 +19549,7 @@ glabel sub_GAME_7F08AAE8 /* 0C0450 7F08B8E0 AFA00028 */ sw $zero, 0x28($sp) /* 0C0454 7F08B8E4 AFAF0014 */ sw $t7, 0x14($sp) /* 0C0458 7F08B8E8 AFAE0010 */ sw $t6, 0x10($sp) -/* 0C045C 7F08B8EC 0FC2B99B */ jal en_text_write_stuff +/* 0C045C 7F08B8EC 0FC2B99B */ jal textRender /* 0C0460 7F08B8F0 AFB9001C */ sw $t9, 0x1c($sp) /* 0C0464 7F08B8F4 0C001145 */ jal viGetViewLeft /* 0C0468 7F08B8F8 00408025 */ move $s0, $v0 @@ -41778,10 +19558,10 @@ glabel sub_GAME_7F08AAE8 /* 0C0474 7F08B904 AFA80080 */ sw $t0, 0x80($sp) /* 0C0478 7F08B908 0C00110B */ jal viGetY /* 0C047C 7F08B90C A7A20048 */ sh $v0, 0x48($sp) -/* 0C0480 7F08B910 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0C0484 7F08B914 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0C0488 7F08B918 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0C048C 7F08B91C 8D290EE0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0C0480 7F08B910 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0C0484 7F08B914 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0C0488 7F08B918 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0C048C 7F08B91C 8D290EE0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0C0490 7F08B920 87AA0048 */ lh $t2, 0x48($sp) /* 0C0494 7F08B924 240CFFFF */ li $t4, -1 /* 0C0498 7F08B928 AFAC0018 */ sw $t4, 0x18($sp) @@ -41794,7 +19574,7 @@ glabel sub_GAME_7F08AAE8 /* 0C04B4 7F08B944 AFA00028 */ sw $zero, 0x28($sp) /* 0C04B8 7F08B948 AFAD0014 */ sw $t5, 0x14($sp) /* 0C04BC 7F08B94C AFA90010 */ sw $t1, 0x10($sp) -/* 0C04C0 7F08B950 0FC2B99B */ jal en_text_write_stuff +/* 0C04C0 7F08B950 0FC2B99B */ jal textRender /* 0C04C4 7F08B954 AFAA001C */ sw $t2, 0x1c($sp) /* 0C04C8 7F08B958 0FC2B6A8 */ jal combiner_bayer_lod_perspective /* 0C04CC 7F08B95C 00402025 */ move $a0, $v0 @@ -41816,8 +19596,8 @@ glabel D_8004AE90 .text glabel sub_GAME_7F08AAE8 -/* 0BD720 7F08AD30 3C0E8003 */ lui $t6, %hi(D_800368B4) # $t6, 0x8003 -/* 0BD724 7F08AD34 8DCE1DFC */ lw $t6, %lo(D_800368B4)($t6) +/* 0BD720 7F08AD30 3C0E8003 */ lui $t6, %hi(g_UpperTextDisplayFlag) # $t6, 0x8003 +/* 0BD724 7F08AD34 8DCE1DFC */ lw $t6, %lo(g_UpperTextDisplayFlag)($t6) /* 0BD728 7F08AD38 27BDFF18 */ addiu $sp, $sp, -0xe8 /* 0BD72C 7F08AD3C AFB00038 */ sw $s0, 0x38($sp) /* 0BD730 7F08AD40 00808025 */ move $s0, $a0 @@ -41849,8 +19629,8 @@ glabel sub_GAME_7F08AAE8 /* 0BD798 7F08ADA8 00000000 */ nop /* 0BD79C 7F08ADAC 3C0B8003 */ lui $t3, %hi(upper_text_buffer_index) # $t3, 0x8003 /* 0BD7A0 7F08ADB0 8D6B1DF0 */ lw $t3, %lo(upper_text_buffer_index)($t3) -/* 0BD7A4 7F08ADB4 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) # $t6, 0x8004 -/* 0BD7A8 7F08ADB8 8DCEAB04 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) +/* 0BD7A4 7F08ADB4 3C0E8004 */ lui $t6, %hi(ptrFontZurichBold) # $t6, 0x8004 +/* 0BD7A8 7F08ADB8 8DCEAB04 */ lw $t6, %lo(ptrFontZurichBold)($t6) /* 0BD7AC 7F08ADBC 000B6080 */ sll $t4, $t3, 2 /* 0BD7B0 7F08ADC0 018B6021 */ addu $t4, $t4, $t3 /* 0BD7B4 7F08ADC4 000C6080 */ sll $t4, $t4, 2 @@ -41858,17 +19638,17 @@ glabel sub_GAME_7F08AAE8 /* 0BD7BC 7F08ADCC 000C60C0 */ sll $t4, $t4, 3 /* 0BD7C0 7F08ADD0 3C0D8007 */ lui $t5, %hi(dword_CODE_bss_80079DC8) # $t5, 0x8007 /* 0BD7C4 7F08ADD4 25AD87A8 */ addiu $t5, %lo(dword_CODE_bss_80079DC8) # addiu $t5, $t5, -0x7858 -/* 0BD7C8 7F08ADD8 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 +/* 0BD7C8 7F08ADD8 3C078004 */ lui $a3, %hi(ptrFontZurichBoldChars) # $a3, 0x8004 /* 0BD7CC 7F08ADDC 018B6023 */ subu $t4, $t4, $t3 /* 0BD7D0 7F08ADE0 00408025 */ move $s0, $v0 /* 0BD7D4 7F08ADE4 AFA000D4 */ sw $zero, 0xd4($sp) /* 0BD7D8 7F08ADE8 AFA000D8 */ sw $zero, 0xd8($sp) /* 0BD7DC 7F08ADEC 018D3021 */ addu $a2, $t4, $t5 -/* 0BD7E0 7F08ADF0 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) +/* 0BD7E0 7F08ADF0 8CE7AB08 */ lw $a3, %lo(ptrFontZurichBoldChars)($a3) /* 0BD7E4 7F08ADF4 27A400D8 */ addiu $a0, $sp, 0xd8 /* 0BD7E8 7F08ADF8 27A500D4 */ addiu $a1, $sp, 0xd4 /* 0BD7EC 7F08ADFC AFA00014 */ sw $zero, 0x14($sp) -/* 0BD7F0 7F08AE00 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0BD7F0 7F08AE00 0FC2B713 */ jal textMeasure /* 0BD7F4 7F08AE04 AFAE0010 */ sw $t6, 0x10($sp) /* 0BD7F8 7F08AE08 3C0F8003 */ lui $t7, %hi(camera_8003642C) # $t7, 0x8003 /* 0BD7FC 7F08AE0C 8DEF197C */ lw $t7, %lo(camera_8003642C)($t7) @@ -41936,14 +19716,14 @@ glabel sub_GAME_7F08AAE8 /* 0BD8E4 7F08AEF4 A7A20048 */ sh $v0, 0x48($sp) /* 0BD8E8 7F08AEF8 3C0D8003 */ lui $t5, %hi(upper_text_buffer_index) # $t5, 0x8003 /* 0BD8EC 7F08AEFC 8DAD1DF0 */ lw $t5, %lo(upper_text_buffer_index)($t5) -/* 0BD8F0 7F08AF00 3C188004 */ lui $t8, %hi(ptrSecondFontTableLarge) # $t8, 0x8004 -/* 0BD8F4 7F08AF04 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) # $t9, 0x8004 +/* 0BD8F0 7F08AF00 3C188004 */ lui $t8, %hi(ptrFontZurichBoldChars) # $t8, 0x8004 +/* 0BD8F4 7F08AF04 3C198004 */ lui $t9, %hi(ptrFontZurichBold) # $t9, 0x8004 /* 0BD8F8 7F08AF08 000D7080 */ sll $t6, $t5, 2 /* 0BD8FC 7F08AF0C 01CD7021 */ addu $t6, $t6, $t5 /* 0BD900 7F08AF10 000E7080 */ sll $t6, $t6, 2 /* 0BD904 7F08AF14 01CD7023 */ subu $t6, $t6, $t5 -/* 0BD908 7F08AF18 8F39AB04 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 0BD90C 7F08AF1C 8F18AB08 */ lw $t8, %lo(ptrSecondFontTableLarge)($t8) +/* 0BD908 7F08AF18 8F39AB04 */ lw $t9, %lo(ptrFontZurichBold)($t9) +/* 0BD90C 7F08AF1C 8F18AB08 */ lw $t8, %lo(ptrFontZurichBoldChars)($t8) /* 0BD910 7F08AF20 87AA0048 */ lh $t2, 0x48($sp) /* 0BD914 7F08AF24 000E70C0 */ sll $t6, $t6, 3 /* 0BD918 7F08AF28 3C0F8007 */ lui $t7, %hi(dword_CODE_bss_80079DC8) # $t7, 0x8007 @@ -41963,7 +19743,7 @@ glabel sub_GAME_7F08AAE8 /* 0BD950 7F08AF60 AFA0002C */ sw $zero, 0x2c($sp) /* 0BD954 7F08AF64 AFB90014 */ sw $t9, 0x14($sp) /* 0BD958 7F08AF68 AFB80010 */ sw $t8, 0x10($sp) -/* 0BD95C 7F08AF6C 0FC2B66B */ jal jp_text_write_stuff +/* 0BD95C 7F08AF6C 0FC2B66B */ jal textRenderGlow /* 0BD960 7F08AF70 AFAA0020 */ sw $t2, 0x20($sp) /* 0BD964 7F08AF74 10000022 */ b .L7F08B000 /* 0BD968 7F08AF78 00408025 */ move $s0, $v0 @@ -41974,14 +19754,14 @@ glabel sub_GAME_7F08AAE8 /* 0BD978 7F08AF88 A7A20048 */ sh $v0, 0x48($sp) /* 0BD97C 7F08AF8C 3C0B8003 */ lui $t3, %hi(upper_text_buffer_index) # $t3, 0x8003 /* 0BD980 7F08AF90 8D6B1DF0 */ lw $t3, %lo(upper_text_buffer_index)($t3) -/* 0BD984 7F08AF94 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableLarge) # $t6, 0x8004 -/* 0BD988 7F08AF98 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) # $t7, 0x8004 +/* 0BD984 7F08AF94 3C0E8004 */ lui $t6, %hi(ptrFontZurichBoldChars) # $t6, 0x8004 +/* 0BD988 7F08AF98 3C0F8004 */ lui $t7, %hi(ptrFontZurichBold) # $t7, 0x8004 /* 0BD98C 7F08AF9C 000B6080 */ sll $t4, $t3, 2 /* 0BD990 7F08AFA0 018B6021 */ addu $t4, $t4, $t3 /* 0BD994 7F08AFA4 000C6080 */ sll $t4, $t4, 2 /* 0BD998 7F08AFA8 018B6023 */ subu $t4, $t4, $t3 -/* 0BD99C 7F08AFAC 8DEFAB04 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) -/* 0BD9A0 7F08AFB0 8DCEAB08 */ lw $t6, %lo(ptrSecondFontTableLarge)($t6) +/* 0BD99C 7F08AFAC 8DEFAB04 */ lw $t7, %lo(ptrFontZurichBold)($t7) +/* 0BD9A0 7F08AFB0 8DCEAB08 */ lw $t6, %lo(ptrFontZurichBoldChars)($t6) /* 0BD9A4 7F08AFB4 87B90048 */ lh $t9, 0x48($sp) /* 0BD9A8 7F08AFB8 000C60C0 */ sll $t4, $t4, 3 /* 0BD9AC 7F08AFBC 3C0D8007 */ lui $t5, %hi(dword_CODE_bss_80079DC8) # $t5, 0x8007 @@ -41998,7 +19778,7 @@ glabel sub_GAME_7F08AAE8 /* 0BD9D8 7F08AFE8 AFA00028 */ sw $zero, 0x28($sp) /* 0BD9DC 7F08AFEC AFAF0014 */ sw $t7, 0x14($sp) /* 0BD9E0 7F08AFF0 AFAE0010 */ sw $t6, 0x10($sp) -/* 0BD9E4 7F08AFF4 0FC2B35F */ jal en_text_write_stuff +/* 0BD9E4 7F08AFF4 0FC2B35F */ jal textRender /* 0BD9E8 7F08AFF8 AFB9001C */ sw $t9, 0x1c($sp) /* 0BD9EC 7F08AFFC 00408025 */ move $s0, $v0 .L7F08B000: @@ -42126,10 +19906,10 @@ glabel sub_GAME_7F08AAE8 /* 0BDBD0 7F08B1E0 00408025 */ move $s0, $v0 /* 0BDBD4 7F08B1E4 0C000F9F */ jal viGetY /* 0BDBD8 7F08B1E8 A7A20048 */ sh $v0, 0x48($sp) -/* 0BDBDC 7F08B1EC 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0BDBE0 7F08B1F0 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0BDBE4 7F08B1F4 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0BDBE8 7F08B1F8 8D29AB00 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0BDBDC 7F08B1EC 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0BDBE0 7F08B1F0 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0BDBE4 7F08B1F4 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0BDBE8 7F08B1F8 8D29AB00 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0BDBEC 7F08B1FC 87AA0048 */ lh $t2, 0x48($sp) /* 0BDBF0 7F08B200 240CFFFF */ li $t4, -1 /* 0BDBF4 7F08B204 AFAC0018 */ sw $t4, 0x18($sp) @@ -42142,7 +19922,7 @@ glabel sub_GAME_7F08AAE8 /* 0BDC10 7F08B220 AFA00028 */ sw $zero, 0x28($sp) /* 0BDC14 7F08B224 AFAD0014 */ sw $t5, 0x14($sp) /* 0BDC18 7F08B228 AFA90010 */ sw $t1, 0x10($sp) -/* 0BDC1C 7F08B22C 0FC2B35F */ jal en_text_write_stuff +/* 0BDC1C 7F08B22C 0FC2B35F */ jal textRender /* 0BDC20 7F08B230 AFAA001C */ sw $t2, 0x1c($sp) /* 0BDC24 7F08B234 0C000FD9 */ jal viGetViewLeft /* 0BDC28 7F08B238 00408025 */ move $s0, $v0 @@ -42151,10 +19931,10 @@ glabel sub_GAME_7F08AAE8 /* 0BDC34 7F08B244 AFAB0080 */ sw $t3, 0x80($sp) /* 0BDC38 7F08B248 0C000F9F */ jal viGetY /* 0BDC3C 7F08B24C A7A20048 */ sh $v0, 0x48($sp) -/* 0BDC40 7F08B250 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0BDC44 7F08B254 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0BDC48 7F08B258 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0BDC4C 7F08B25C 8DCEAB00 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0BDC40 7F08B250 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0BDC44 7F08B254 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0BDC48 7F08B258 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0BDC4C 7F08B25C 8DCEAB00 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0BDC50 7F08B260 87B90048 */ lh $t9, 0x48($sp) /* 0BDC54 7F08B264 2418FFFF */ li $t8, -1 /* 0BDC58 7F08B268 AFB80018 */ sw $t8, 0x18($sp) @@ -42167,7 +19947,7 @@ glabel sub_GAME_7F08AAE8 /* 0BDC74 7F08B284 AFA00028 */ sw $zero, 0x28($sp) /* 0BDC78 7F08B288 AFAF0014 */ sw $t7, 0x14($sp) /* 0BDC7C 7F08B28C AFAE0010 */ sw $t6, 0x10($sp) -/* 0BDC80 7F08B290 0FC2B35F */ jal en_text_write_stuff +/* 0BDC80 7F08B290 0FC2B35F */ jal textRender /* 0BDC84 7F08B294 AFB9001C */ sw $t9, 0x1c($sp) /* 0BDC88 7F08B298 0C000FD9 */ jal viGetViewLeft /* 0BDC8C 7F08B29C 00408025 */ move $s0, $v0 @@ -42176,10 +19956,10 @@ glabel sub_GAME_7F08AAE8 /* 0BDC98 7F08B2A8 AFA80080 */ sw $t0, 0x80($sp) /* 0BDC9C 7F08B2AC 0C000F9F */ jal viGetY /* 0BDCA0 7F08B2B0 A7A20048 */ sh $v0, 0x48($sp) -/* 0BDCA4 7F08B2B4 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0BDCA8 7F08B2B8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0BDCAC 7F08B2BC 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0BDCB0 7F08B2C0 8D29AB00 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0BDCA4 7F08B2B4 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0BDCA8 7F08B2B8 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0BDCAC 7F08B2BC 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0BDCB0 7F08B2C0 8D29AB00 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0BDCB4 7F08B2C4 87AA0048 */ lh $t2, 0x48($sp) /* 0BDCB8 7F08B2C8 240CFFFF */ li $t4, -1 /* 0BDCBC 7F08B2CC AFAC0018 */ sw $t4, 0x18($sp) @@ -42192,7 +19972,7 @@ glabel sub_GAME_7F08AAE8 /* 0BDCD8 7F08B2E8 AFA00028 */ sw $zero, 0x28($sp) /* 0BDCDC 7F08B2EC AFAD0014 */ sw $t5, 0x14($sp) /* 0BDCE0 7F08B2F0 AFA90010 */ sw $t1, 0x10($sp) -/* 0BDCE4 7F08B2F4 0FC2B35F */ jal en_text_write_stuff +/* 0BDCE4 7F08B2F4 0FC2B35F */ jal textRender /* 0BDCE8 7F08B2F8 AFAA001C */ sw $t2, 0x1c($sp) /* 0BDCEC 7F08B2FC 0C000FD9 */ jal viGetViewLeft /* 0BDCF0 7F08B300 00408025 */ move $s0, $v0 @@ -42201,10 +19981,10 @@ glabel sub_GAME_7F08AAE8 /* 0BDCFC 7F08B30C AFAB0080 */ sw $t3, 0x80($sp) /* 0BDD00 7F08B310 0C000F9F */ jal viGetY /* 0BDD04 7F08B314 A7A20048 */ sh $v0, 0x48($sp) -/* 0BDD08 7F08B318 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0BDD0C 7F08B31C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0BDD10 7F08B320 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0BDD14 7F08B324 8DCEAB00 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0BDD08 7F08B318 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0BDD0C 7F08B31C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0BDD10 7F08B320 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0BDD14 7F08B324 8DCEAB00 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0BDD18 7F08B328 87B90048 */ lh $t9, 0x48($sp) /* 0BDD1C 7F08B32C 2418FFFF */ li $t8, -1 /* 0BDD20 7F08B330 AFB80018 */ sw $t8, 0x18($sp) @@ -42217,7 +19997,7 @@ glabel sub_GAME_7F08AAE8 /* 0BDD3C 7F08B34C AFA00028 */ sw $zero, 0x28($sp) /* 0BDD40 7F08B350 AFAF0014 */ sw $t7, 0x14($sp) /* 0BDD44 7F08B354 AFAE0010 */ sw $t6, 0x10($sp) -/* 0BDD48 7F08B358 0FC2B35F */ jal en_text_write_stuff +/* 0BDD48 7F08B358 0FC2B35F */ jal textRender /* 0BDD4C 7F08B35C AFB9001C */ sw $t9, 0x1c($sp) /* 0BDD50 7F08B360 0C000FD9 */ jal viGetViewLeft /* 0BDD54 7F08B364 00408025 */ move $s0, $v0 @@ -42226,10 +20006,10 @@ glabel sub_GAME_7F08AAE8 /* 0BDD60 7F08B370 AFA80080 */ sw $t0, 0x80($sp) /* 0BDD64 7F08B374 0C000F9F */ jal viGetY /* 0BDD68 7F08B378 A7A20048 */ sh $v0, 0x48($sp) -/* 0BDD6C 7F08B37C 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) # $t1, 0x8004 -/* 0BDD70 7F08B380 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0BDD74 7F08B384 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0BDD78 7F08B388 8D29AB00 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0BDD6C 7F08B37C 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) # $t1, 0x8004 +/* 0BDD70 7F08B380 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0BDD74 7F08B384 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0BDD78 7F08B388 8D29AB00 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0BDD7C 7F08B38C 87AA0048 */ lh $t2, 0x48($sp) /* 0BDD80 7F08B390 240CFFFF */ li $t4, -1 /* 0BDD84 7F08B394 AFAC0018 */ sw $t4, 0x18($sp) @@ -42242,7 +20022,7 @@ glabel sub_GAME_7F08AAE8 /* 0BDDA0 7F08B3B0 AFA00028 */ sw $zero, 0x28($sp) /* 0BDDA4 7F08B3B4 AFAD0014 */ sw $t5, 0x14($sp) /* 0BDDA8 7F08B3B8 AFA90010 */ sw $t1, 0x10($sp) -/* 0BDDAC 7F08B3BC 0FC2B35F */ jal en_text_write_stuff +/* 0BDDAC 7F08B3BC 0FC2B35F */ jal textRender /* 0BDDB0 7F08B3C0 AFAA001C */ sw $t2, 0x1c($sp) /* 0BDDB4 7F08B3C4 0FC2B06C */ jal combiner_bayer_lod_perspective /* 0BDDB8 7F08B3C8 00402025 */ move $a0, $v0 @@ -42287,7 +20067,7 @@ glabel sub_GAME_7F08B0F0 /* 0BFC24 7F08B0F4 AFBF0024 */ sw $ra, 0x24($sp) /* 0BFC28 7F08B0F8 AFB10020 */ sw $s1, 0x20($sp) /* 0BFC2C 7F08B0FC AFB0001C */ sw $s0, 0x1c($sp) -/* 0BFC30 7F08B100 0FC26C57 */ jal sub_GAME_7F09B15C +/* 0BFC30 7F08B100 0FC26C57 */ jal getPlayerPointerIndex /* 0BFC34 7F08B104 AFA400F8 */ sw $a0, 0xf8($sp) /* 0BFC38 7F08B108 8FAE00F8 */ lw $t6, 0xf8($sp) /* 0BFC3C 7F08B10C AFA200F4 */ sw $v0, 0xf4($sp) @@ -43004,12 +20784,12 @@ glabel sub_GAME_7F08B0F0 /* 0C066C 7F08BB3C 8FAB007C */ lw $t3, 0x7c($sp) /* 0C0670 7F08BB40 AC8B002C */ sw $t3, 0x2c($a0) /* 0C0674 7F08BB44 8E2C0000 */ lw $t4, ($s1) -/* 0C0678 7F08BB48 0FC0B446 */ jal sub_GAME_7F02D118 +/* 0C0678 7F08BB48 0FC0B446 */ jal chrSetFiring /* 0C067C 7F08BB4C 8186087D */ lb $a2, 0x87d($t4) /* 0C0680 7F08BB50 8E2E0000 */ lw $t6, ($s1) /* 0C0684 7F08BB54 8FA400F0 */ lw $a0, 0xf0($sp) /* 0C0688 7F08BB58 24050001 */ li $a1, 1 -/* 0C068C 7F08BB5C 0FC0B446 */ jal sub_GAME_7F02D118 +/* 0C068C 7F08BB5C 0FC0B446 */ jal chrSetFiring /* 0C0690 7F08BB60 81C60C25 */ lb $a2, 0xc25($t6) /* 0C0694 7F08BB64 0FC083BC */ jal sub_GAME_7F020EF0 /* 0C0698 7F08BB68 8FA400F8 */ lw $a0, 0xf8($sp) @@ -43125,7 +20905,7 @@ glabel sub_GAME_7F08B0F0 /* 0BDDD8 7F08B3E8 AFBF0024 */ sw $ra, 0x24($sp) /* 0BDDDC 7F08B3EC AFB10020 */ sw $s1, 0x20($sp) /* 0BDDE0 7F08B3F0 AFB0001C */ sw $s0, 0x1c($sp) -/* 0BDDE4 7F08B3F4 0FC269A7 */ jal sub_GAME_7F09B15C +/* 0BDDE4 7F08B3F4 0FC269A7 */ jal getPlayerPointerIndex /* 0BDDE8 7F08B3F8 AFA400F8 */ sw $a0, 0xf8($sp) /* 0BDDEC 7F08B3FC 8FAE00F8 */ lw $t6, 0xf8($sp) /* 0BDDF0 7F08B400 AFA200F4 */ sw $v0, 0xf4($sp) @@ -43842,12 +21622,12 @@ glabel sub_GAME_7F08B0F0 /* 0BE820 7F08BE30 8FAB007C */ lw $t3, 0x7c($sp) /* 0BE824 7F08BE34 AC8B002C */ sw $t3, 0x2c($a0) /* 0BE828 7F08BE38 8E2C0000 */ lw $t4, ($s1) -/* 0BE82C 7F08BE3C 0FC0B453 */ jal sub_GAME_7F02D118 +/* 0BE82C 7F08BE3C 0FC0B453 */ jal chrSetFiring /* 0BE830 7F08BE40 81860875 */ lb $a2, 0x875($t4) /* 0BE834 7F08BE44 8E2E0000 */ lw $t6, ($s1) /* 0BE838 7F08BE48 8FA400F0 */ lw $a0, 0xf0($sp) /* 0BE83C 7F08BE4C 24050001 */ li $a1, 1 -/* 0BE840 7F08BE50 0FC0B453 */ jal sub_GAME_7F02D118 +/* 0BE840 7F08BE50 0FC0B453 */ jal chrSetFiring /* 0BE844 7F08BE54 81C60C1D */ lb $a2, 0xc1d($t6) /* 0BE848 7F08BE58 0FC0839A */ jal sub_GAME_7F020EF0 /* 0BE84C 7F08BE5C 8FA400F8 */ lw $a0, 0xf8($sp) @@ -44056,100 +21836,23 @@ void sub_GAME_7F08BDC4(Mtxf *arg0) } - -#ifdef NONMATCHING -/** - * Unreferenced. - * - * Address 0x7F08BE2C. - * - * decomp status: - * - compiles: yes - * - stack resize: ok - * - identical instructions: two swapped instructions that don't affect each other - * - identical registers: ok - * - */ -void sub_GAME_7F08BE2C(Mtxf * arg0, s32 arg1) +void sub_GAME_7F08BE2C(Mtxf *matrices, s32 count) { - Mtxf sp38; - s32 var_s0; - Mtxf* var_s1; + Mtxf copy; + s32 i; - var_s0 = 0; + for (i = 0; i < count; i++) + { + matrix_4x4_copy((Mtxf *)((uintptr_t)matrices + i * sizeof(Mtxf)), ©); - if (arg1 <= 0) { return; } + copy.m[3][0] -= g_CurrentPlayer->previous_model_pos.x; + copy.m[3][1] -= g_CurrentPlayer->previous_model_pos.y; + copy.m[3][2] -= g_CurrentPlayer->previous_model_pos.z; - var_s1 = arg0; - do - { - matrix_4x4_copy(var_s1, &sp38); - sp38.m[3][0] -= g_CurrentPlayer->previous_model_pos.f[0]; - sp38.m[3][1] -= g_CurrentPlayer->previous_model_pos.f[1]; - sp38.m[3][2] -= g_CurrentPlayer->previous_model_pos.f[2]; - matrix_4x4_f32_to_s32(&sp38, &arg0[var_s0]); - var_s0++; - var_s1++; - } while (var_s0 != arg1); + matrix_4x4_f32_to_s32(©, matrices + i); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08BE2C -/* 0C095C 7F08BE2C 27BDFF88 */ addiu $sp, $sp, -0x78 -/* 0C0960 7F08BE30 AFB40024 */ sw $s4, 0x24($sp) -/* 0C0964 7F08BE34 AFB30020 */ sw $s3, 0x20($sp) -/* 0C0968 7F08BE38 AFB00014 */ sw $s0, 0x14($sp) -/* 0C096C 7F08BE3C 00A09825 */ move $s3, $a1 -/* 0C0970 7F08BE40 0080A025 */ move $s4, $a0 -/* 0C0974 7F08BE44 AFBF002C */ sw $ra, 0x2c($sp) -/* 0C0978 7F08BE48 AFB50028 */ sw $s5, 0x28($sp) -/* 0C097C 7F08BE4C AFB2001C */ sw $s2, 0x1c($sp) -/* 0C0980 7F08BE50 AFB10018 */ sw $s1, 0x18($sp) -/* 0C0984 7F08BE54 18A0001C */ blez $a1, .L7F08BEC8 -/* 0C0988 7F08BE58 00008025 */ move $s0, $zero -/* 0C098C 7F08BE5C 3C158008 */ lui $s5, %hi(g_CurrentPlayer) -/* 0C0990 7F08BE60 26B5A0B0 */ addiu $s5, %lo(g_CurrentPlayer) # addiu $s5, $s5, -0x5f50 -/* 0C0994 7F08BE64 00808825 */ move $s1, $a0 -/* 0C0998 7F08BE68 27B20038 */ addiu $s2, $sp, 0x38 -.L7F08BE6C: -/* 0C099C 7F08BE6C 02202025 */ move $a0, $s1 -/* 0C09A0 7F08BE70 0FC16008 */ jal matrix_4x4_copy -/* 0C09A4 7F08BE74 02402825 */ move $a1, $s2 -/* 0C09A8 7F08BE78 8EA20000 */ lw $v0, ($s5) -/* 0C09AC 7F08BE7C C7A40068 */ lwc1 $f4, 0x68($sp) -/* 0C09B0 7F08BE80 C7AA006C */ lwc1 $f10, 0x6c($sp) -/* 0C09B4 7F08BE84 C4460044 */ lwc1 $f6, 0x44($v0) -/* 0C09B8 7F08BE88 00107180 */ sll $t6, $s0, 6 -/* 0C09BC 7F08BE8C 01D42821 */ addu $a1, $t6, $s4 -/* 0C09C0 7F08BE90 46062201 */ sub.s $f8, $f4, $f6 -/* 0C09C4 7F08BE94 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 0C09C8 7F08BE98 02402025 */ move $a0, $s2 -/* 0C09CC 7F08BE9C E7A80068 */ swc1 $f8, 0x68($sp) -/* 0C09D0 7F08BEA0 C4500048 */ lwc1 $f16, 0x48($v0) -/* 0C09D4 7F08BEA4 46105481 */ sub.s $f18, $f10, $f16 -/* 0C09D8 7F08BEA8 E7B2006C */ swc1 $f18, 0x6c($sp) -/* 0C09DC 7F08BEAC C446004C */ lwc1 $f6, 0x4c($v0) -/* 0C09E0 7F08BEB0 46062201 */ sub.s $f8, $f4, $f6 -/* 0C09E4 7F08BEB4 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 0C09E8 7F08BEB8 E7A80070 */ swc1 $f8, 0x70($sp) -/* 0C09EC 7F08BEBC 26100001 */ addiu $s0, $s0, 1 -/* 0C09F0 7F08BEC0 1613FFEA */ bne $s0, $s3, .L7F08BE6C -/* 0C09F4 7F08BEC4 26310040 */ addiu $s1, $s1, 0x40 -.L7F08BEC8: -/* 0C09F8 7F08BEC8 8FBF002C */ lw $ra, 0x2c($sp) -/* 0C09FC 7F08BECC 8FB00014 */ lw $s0, 0x14($sp) -/* 0C0A00 7F08BED0 8FB10018 */ lw $s1, 0x18($sp) -/* 0C0A04 7F08BED4 8FB2001C */ lw $s2, 0x1c($sp) -/* 0C0A08 7F08BED8 8FB30020 */ lw $s3, 0x20($sp) -/* 0C0A0C 7F08BEDC 8FB40024 */ lw $s4, 0x24($sp) -/* 0C0A10 7F08BEE0 8FB50028 */ lw $s5, 0x28($sp) -/* 0C0A14 7F08BEE4 03E00008 */ jr $ra -/* 0C0A18 7F08BEE8 27BD0078 */ addiu $sp, $sp, 0x78 -) -#endif - void sub_GAME_7F08BEEC(Mtxf *matrices, s32 count) { @@ -44181,9 +21884,9 @@ s32 getMissiontimer(void) { void SurroundWithExplosions(int delay) { - D_80036444 = 1; - dword_CODE_bss_8007999C = delay + g_GlobalTimer; - dword_CODE_bss_800799A0 = 0; + g_SurroundBondWithExplosionsFlag = 1; + g_SurroundBondWithExplosionsTicks = delay + g_GlobalTimer; + g_PlayerTickExplodeCreatePosition = 0; } diff --git a/src/game/bondview.h b/src/game/bondview.h index e3e57b26..c01296cf 100644 --- a/src/game/bondview.h +++ b/src/game/bondview.h @@ -43,9 +43,15 @@ struct collision434 { coord3d collision_position; /** + * This affects Bond's movement, but not the viewport. + * This does not affect boost direction. + * + * f[0]: forward component (sin theta) in radians + * f[1]: zero + * f[2]: sideways component (cos theta) in radians. * Offset 0x10. */ - struct coord3d field_10; + struct coord3d theta_transform; /** * Some kind of alternative to pos3 (in player struct). @@ -167,7 +173,7 @@ struct hand f32 field_A38; f32 field_A3C; f32 field_A40; - s32 field_A44; + ALSoundState * audioHandle; s32 field_A48; s32 field_A4C; s32 field_A50; @@ -176,8 +182,8 @@ struct hand f32 field_A84; f32 field_A88; s32 field_A8C; - ObjectRecord* field_A90; - s32 field_A94; + ObjectRecord* rocket; + s32 firedrocket; s32 field_A98; s32 field_A9C; s32 field_AA0; @@ -256,7 +262,7 @@ struct hand s32 field_BFC; s32 field_C00; s32 field_C04; - s32 field_C08; + s32 volley; // Number of bullets discharged in a row. For pistols, it's always 1 even if the fire button is held. coord3d item_related; }; @@ -284,7 +290,7 @@ typedef struct textoverride { /*0x10*/ u32 unk5; /*0x14*/ u32 unk6; /*0x18*/ u32 unk7; - /*0x1c*/ u32 unk8; + /*0x1c*/ u32 pickuptext; /*0x20*/ struct textoverride *next; /*0x24*/ struct ObjectRecord *obj; } textoverride; @@ -398,9 +404,12 @@ struct player /** * Collision / clipping related. + * When Bond falls off a ladder or similar, will "overshoot" vertical default. + * Current offset is stored in this field. + * * Offset 0x0090. */ - /* 0x0090 */ f32 field_90; + /* 0x0090 */ f32 vertical_bounce_adjust; /* 0x0094 */ s32 field_94; /* 0x0098 */ f32 field_98; @@ -438,11 +447,29 @@ struct player /* 0x00f0 */ f32 apparentarmour; #if defined(VERSION_JP) || defined (VERSION_EU) -/* 0x00f4 */ f32 damageshowtime; -/* 0x00f8 */ f32 healthshowtime; + + /* + * When a non-negative integer: + * - hide ammo and aim sight + * - hide any active speech text + * - disable shoot and B press interact + * Otherwise, + * - undo the above. + * 0x00f4 + **/ + f32 damageshowtime; + + /** + * When a non-negative integer: + * - Show health and body armor overlay if Bond isn't dead. + * Otherwise, + * - undo the above. + * 0x00f8 + **/ + f32 healthshowtime; #else - /* 0x00f4 */ s32 damageshowtime; - /* 0x00f8 */ s32 healthshowtime; + /* See comments above. 0x00f4 */ s32 damageshowtime; + /* See comments above. 0x00f8 */ s32 healthshowtime; #endif @@ -466,21 +493,53 @@ struct player /* 0x0124 */ s32 insightaimmode; /* 0x0128 */ s32 autoyaimenabled; /* 0x012c */ f32 autoaimy; - /* 0x0130 */ s32 autoyaimtime; + /* 0x0130 */ struct PropRecord *autoaim_target_y; /* 0x0134 */ s32 autoyaimtime60; /* 0x0138 */ s32 autoxaimenabled; /* 0x013c */ f32 autoaimx; - /* 0x0140 */ s32 autoxaimtime; + /* 0x0140 */ struct PropRecord *autoaim_target_x; /* 0x0144 */ s32 autoxaimtime60; /* 0x0148 */ f32 vv_theta; /* 0x014c */ f32 speedtheta; - /* 0x0150 */ f32 vv_costheta; - /* 0x0154 */ f32 vv_sintheta; - /* 0x0158 */ f32 vv_verta; - /* 0x015c */ f32 vv_verta360; + + /** + * Computed value from vv_theta, used to calculate boost direction. + * 0x0150 + **/ + f32 vv_costheta; + + /** + * Computed value from vv_theta, used to calculate boost direction. + * 0x0154 + **/ + f32 vv_sintheta; + + /** + * Vertical look angle. + * 0x0158 + **/ + f32 vv_verta; + + /** + * Vertical look angle. Computed value from vv_verta, should always be between 0 and 360 degrees. + * 0x015c + **/ + f32 vv_verta360; + /* 0x0160 */ f32 speedverta; - /* 0x0164 */ f32 vv_cosverta; - /* 0x0168 */ f32 vv_sinverta; + + /** + * Computed value from vv_verta360, but otherwise unused? + * 0x0164 + **/ + f32 vv_cosverta; + + /** + * Computed value from vv_verta360, but otherwise unused? + * 0x0168 + **/ + f32 vv_sinverta; + /* 0x016c */ f32 speedsideways; /* 0x0170 */ f32 speedstrafe; /* 0x0174 */ f32 speedforwards; @@ -689,7 +748,7 @@ struct player * Address 0x800C6B17 */ u16 buttons_pressed; - s16 field_3B6; + u16 prev_buttons_pressed; struct coord3d field_3B8; @@ -754,18 +813,18 @@ struct player s32 headwalkingtime60; //0x4f0 f32 headamplitude; //0x4f4 f32 sideamplitude; //0x4f8 - vec3 headpos; - vec3 headlook; + struct coord3d headpos; + struct coord3d headlook; - vec3 headup; - vec3 headpossum; + struct coord3d headup; + struct coord3d headpossum; // headlooksum[2] has NTSC->PAL conversion rate (5/6) - vec3 headlooksum; + struct coord3d headlooksum; // headupsum[1] has NTSC->PAL conversion rate (5/6) - vec3 headupsum; - vec3 headbodyoffset; //0x544 + struct coord3d headupsum; + struct coord3d headbodyoffset; //0x544 f32 standheight; // old name stationary_ground_offset // f32[4] ?? or 2 x f32[2] ?? @@ -773,10 +832,10 @@ struct player f32 standfrac; //0x560 // offset 0x564 - vec3 standlook[2]; + struct coord3d standlook[2]; // offset 0x57C - vec3 standup[2]; + struct coord3d standup[2]; // offset 0x594 s32 standcnt; @@ -890,7 +949,7 @@ struct player s32 hand_invisible[2]; /* 0x7f8*/ ITEM_IDS hand_item[2]; /* 0x800 */ - u8 *ptr_hand_weapon_buffer[2]; /* 0x808 */ + ModelFileHeader *ptr_hand_weapon_buffer[2]; /* 0x808 */ /** * Offset 0x810. @@ -919,12 +978,11 @@ struct player s32 z_trigger_timer; s32 field_FD8; - u8 field_FDC; - u8 field_FDD; - u8 field_FDE; - u8 field_FDF; + struct rgba_u8 tileColor; s32 resetshadecol; - s32 field_FE4; + + // unused. Name comes from XBLA debug. + s32 aimtype; /** * Crosshair or bullet angle related. @@ -942,7 +1000,7 @@ struct player Mtxf field_101C; s32 last_z_trigger_timer; s32 copiedgoldeneye; - s32 ammodispflags; + s32 gunammooff; s32 field_1068; f32 gunsync; f32 syncchange; @@ -1088,8 +1146,8 @@ struct player gunheld gunheldarr[10]; s32 magnetattracttime; f32 swaytarget; - f32 field_1278; - f32 field_127C; + f32 swayoffset0; + f32 swayoffset2; f32 field_1280; s32 players_cur_animation; f32 field_1288; @@ -2509,7 +2567,7 @@ struct player s32 field_29B4; // Alt field_29C0 ?? Used in EU. - s32 field_29B8; + s32 healthDamageType; /** * Related to player perspective. @@ -2596,42 +2654,42 @@ struct struct_4 { }; #ifdef BUGFIX_R0 -typedef struct bondstruct_unk_80036634 +typedef struct DamageType { u32 field_0x0; u32 field_0x4; s32 field_0x8; f32 field_0xC; - u32 field_0x10; - u32 field_0x14; - s32 field_0x18; - f32 field_0x1c; - u32 field_0x20; - u32 field_0x24; - u32 field_0x28; -} bondstruct_unk_80036634; + s32 flashStartFrame; + u32 flashFullFrame; + s32 flashEndFrame; + f32 maxAlpha; + u32 red; + u32 green; + u32 blue; +} DamageType; #else -typedef struct bondstruct_unk_80036634 +typedef struct DamageType { f32 field_0x0; f32 field_0x4; f32 field_0x8; f32 field_0xC; - f32 field_0x10; - f32 field_0x14; - f32 field_0x18; - f32 field_0x1c; - u32 field_0x20; - u32 field_0x24; - u32 field_0x28; -} bondstruct_unk_80036634; + f32 flashStartFrame; + f32 flashFullFrame; + f32 flashEndFrame; + f32 maxAlpha; + u32 red; + u32 green; + u32 blue; +} DamageType; #endif -typedef struct bondstruct_unk_80036794 { // time related idk - s32 unk0; - s32 unk4; - s32 unk8; -} bondstruct_unk_80036794; +typedef struct HealthDamageType { // time related idk + s32 updateStartFrame; + s32 updateEndFrame; + s32 otherEndFrame; +} HealthDamageType; typedef struct bondstruct_unk_80035904 { u32 unk00; @@ -2641,6 +2699,12 @@ typedef struct bondstruct_unk_80035904 { f32 unk20; } bondstruct_unk_80035904; +// placeholder while matching +struct move_bond_temp_struct { + s32 unk00; + s32 unk04; +}; + //D:80036424 extern s32 g_bondviewForceDisarm; //D:80036428 @@ -2658,23 +2722,23 @@ extern s32 D_8003643C; //D:80036440 extern CreditsEntry *D_80036440; //D:80036444 -extern s32 D_80036444; +extern s32 g_SurroundBondWithExplosionsFlag; //D:80036448 extern s32 in_tank_flag; //D:8003644C -extern struct PropRecord *D_8003644C; +extern struct PropRecord *g_WorldTankProp; //D:80036450 -extern struct PropRecord *ptr_playerstank; +extern struct PropRecord *g_PlayerTankProp; /** - * Related to ptr_playerstank. + * Related to g_PlayerTankProp. * Address 0x80036454. */ extern f32 g_PlayerTankYOffset; //D:80036458 -extern ALSoundState * SFX_80036458[2]; +extern ALSoundState * g_TankSfxState[2]; //D:80036460 extern f32 g_TankTurnSpeed; @@ -2699,13 +2763,13 @@ extern f32 g_TankTurretAngle; //D:80036488 extern f32 g_TankTurretTurn; //D:8003648C -extern s32 D_8003648C; +extern s32 g_ExplodeTankOnDeathFlag; //D:80036490 -extern s32 D_80036490; +extern s32 g_TankDamagePenaltyTicks; //D:80036494 -extern s32 g_CameraMode; +extern enum CAMERAMODE g_CameraMode; //D:80036498 -extern s32 enable_move_after_cinema; +extern enum CAMERAMODE g_CameraAfterCinema; //D:8003649C extern s32 D_8003649C; //D:800364A0 @@ -2742,7 +2806,7 @@ extern s32 g_bondviewBondDeathAnimations[]; //D:8003650C extern s32 g_bondviewBondDeathAnimationsCount; //D:80036510 -extern s32 D_80036510; +extern enum CAMERAMODE D_80036510; //D:80036514 extern s32 g_IntroAnimationIndex; /* @@ -2778,7 +2842,7 @@ D:80036624 .word 0xFFFFFF00, 0xFFFFFF00, 0x4FFFFFF //D:80036630 extern u32 D_80036630; //D:80036634 -extern bondstruct_unk_80036634 D_80036634[]; +extern struct DamageType g_DamageTypes[]; /* D:80036638 .byte 0 D:80036639 .byte 0, 0, 0xA @@ -2820,7 +2884,7 @@ D:8003676C .byte 0 D:8003676D .byte 0, 0, 0xA D:80036770 .word 0x1E, 0x3F19999A, 0 D:8003677C .word 5, 0xF, 0x3ECCCCCD, 0xFF, 0xFF, 0xFF -D:80036794 D_80036794:.word 0 +D:80036794 g_HealthDamageTypes:.word 0 D:80036798 .byte 0 D:80036799 .byte 0, 0, 0x28 D:8003679C .word 0x64, 0 @@ -2845,30 +2909,11 @@ D:800367ED .byte 0, 0, 0x14 D:800367F0 .word 0x32 */ -//D:80036800 -extern s32 D_80036800; -//D:80036804 -extern s32 D_80036804; -//D:80036808 -extern s32 D_80036808; -//D:8003680C -extern s32 D_8003680C; -//D:80036810 -extern s32 D_80036810; -//D:80036814 -extern s32 D_80036814; -//D:80036818 -extern s32 D_80036818; -//D:8003681C -extern s32 D_8003681C; -//D:80036820 -extern s32 D_80036820; -//D:80036824 -extern s32 D_80036824; -//D:80036828 -extern s32 D_80036828; -//D:8003682C -extern s32 D_8003682C; +extern struct coord3d g_DefaultFrozenPlayerPos; +extern struct coord3d g_DefaultFrozenPlayerPos2; +extern struct coord3d g_DefaultFrozenPlayerOffset; +extern struct coord3d g_DefaultFrozenMoveOffset; + //D:80036830 extern s32 D_80036830; //D:80036834 @@ -2906,7 +2951,7 @@ extern s32 upper_text_buffer_index; extern s32 display_upper_text_window; //D:800368B0 extern s32 upper_text_window_timer; -extern s32 D_800368B4; +extern s32 g_UpperTextDisplayFlag; /* D:800368D8 firing_animation_groups:firing_anim_struct D:800368D8 # DATA XREF: sub_CODE_7F08B0F0+720o @@ -2944,7 +2989,7 @@ extern f32 D_80036AC0; extern f32 D_80036AC4; extern s32 startpadcount; -extern vec3d flt_CODE_bss_80079990; +extern vec3d g_ForceBondMoveOffset; extern s32 mission_timer; #if defined(VERSION_JP) || defined(VERSION_EU) @@ -3006,6 +3051,7 @@ void jp_hudmsgBottomShow(char *string); // VERSION_US #define HUDMESSAGEBOTTOM hudmsgBottomShow void hudmsgBottomShow(char *string); +void setFontTables(s32 arg0, s32 arg1); #endif Gfx * sub_GAME_7F087A08(Gfx *arg0); @@ -3016,13 +3062,13 @@ Gfx * bondviewRemoved7F08BCB8(Gfx *arg0); s32 sub_GAME_7F078A58(coord3d *vec_scale, f32 norm_scale); s32 getMissiontimer(void); void solo_char_load(void); -void bondviewUpdateYAutoAimTime(s32 auto_aim_time, f32 auto_aim_y); -void bondviewUpdateXAutoAimTime(s32 auto_aim_time, f32 auto_aim_x); +void bondviewUpdateYAutoAimTime(struct PropRecord *autoaim_target, f32 auto_aim_y); +void bondviewUpdateXAutoAimTime(struct PropRecord *autoaim_target, f32 auto_aim_x); void bondviewSet3dCoord7F07CEB0(coord3d *arg0); f32 bondviewYPositionRelated(struct StandTile *arg0, f32 arg1, f32 arg2); f32 bondviewGetPlayerDuckingHeightRelated(struct player *player); -void bondviewCollisionRadiusRelated(PropRecord* arg0, f32 *collision_radius, f32 *height, f32 *always_30); -void bondviewUpdatePlayerClipping(s32 use_stanHeight, f32 stanHeight_offset); +void bondviewGetCollisionRadius(PropRecord* arg0, f32 *collision_radius, f32 *height, f32 *always_30); +void bondviewUpdatePlayerY(s32 use_stanHeight, f32 stanHeight_offset); void currentPlayerSetFadeColour(s32 r, s32 g, s32 b, f32 frac); void currentPlayerSetFadeFrac(f32 maxfadetime, f32 frac); void set_BONDdata_autoaim_x(s32 param_1); @@ -3052,7 +3098,7 @@ void set_bondata_invincible_flag(u32 arg0); void bondviewSetVisibleToGuardsFlag(s32 param_1); Mtxf *currentPlayerGetMatrix10EC(void); f32 get_curplay_horizontal_rotation_in_degrees(void); -Mtxf *currentPlayerGetMatrix10CC(void); +Mtxf *camGetWorldToScreenMtxf(void); void sub_GAME_7F077EEC(struct coord2d *in, coord3d *out, f32 value); s32 camIsPosInScreenBox(coord3d *, f32, struct bbox2d *); @@ -3063,9 +3109,9 @@ Mtx *currentPlayerGetProjectionMatrix(void); Gfx *bondviewRenderProp(PropRecord *arg0, Gfx *arg1, s32 arg2); f32 getPlayer_c_lodscalez(void); f32 bondviewGetBondBreathing(void); -void sub_GAME_7F08A928(int param_1); +void bondviewClearUpperTextDisplayFlag(int param_1); -void sub_GAME_7F08A944(PLAYERFLAG flag); +void bondviewSetUpperTextDisplayFlag(PLAYERFLAG flag); void set_camera_mode(s32 arg0); bool isBondInTank(void); void hudmsgTopShow(char* string); @@ -3077,9 +3123,10 @@ struct PropRecord *get_ptr_for_players_tank(void); s32 bondviewGetRandomSpawnPadIndex(void); void change_player_pos_to_target(struct collision434* arg0, struct coord3d *arg1, struct StandTile *arg2); void sub_GAME_7F089718(f32); -void sub_GAME_7F08A900(void); +void bondviewResetUpperTextDisplay(void); Mtxf *currentPlayerGetProjectionMatrixF(void); int redirect_get_BONDdata_autoaim_x(void); +int redirect_get_BONDdata_autoaim_y(void); void sub_GAME_7F077FF4(coord3d *in, coord3d *out); #endif diff --git a/src/game/bondview_r.c b/src/game/bondview_r.c index f91c6b6b..5aa0a6b1 100644 --- a/src/game/bondview_r.c +++ b/src/game/bondview_r.c @@ -129,17 +129,17 @@ void bondviewLoadSetupIntroSection(void) camera_80036438 = 0; D_8003643C = 0; D_80036440 = NULL; - flt_CODE_bss_80079990.f[0] = FLOAT_INIT; - flt_CODE_bss_80079990.f[1] = FLOAT_INIT; - flt_CODE_bss_80079990.f[2] = FLOAT_INIT; - D_80036444 = 0; + g_ForceBondMoveOffset.f[0] = FLOAT_INIT; + g_ForceBondMoveOffset.f[1] = FLOAT_INIT; + g_ForceBondMoveOffset.f[2] = FLOAT_INIT; + g_SurroundBondWithExplosionsFlag = 0; startpadcount = 0; in_tank_flag = 0; - D_8003644C = 0; - ptr_playerstank = NULL; + g_WorldTankProp = 0; + g_PlayerTankProp = NULL; g_PlayerTankYOffset = FLOAT_INIT; - SFX_80036458[0] = NULL; - SFX_80036458[1] = NULL; + g_TankSfxState[0] = NULL; + g_TankSfxState[1] = NULL; g_TankTurnSpeed = FLOAT_INIT; g_TankOrientationAngle = FLOAT_INIT; D_80036468 = FLOAT_INIT; @@ -151,11 +151,11 @@ void bondviewLoadSetupIntroSection(void) g_BondCanEnterTank = 0; g_TankTurretAngle = FLOAT_INIT; g_TankTurretTurn = FLOAT_INIT; - D_8003648C = 0; + g_ExplodeTankOnDeathFlag = 0; D_800364B0 = 1; g_PlayerInvincible = 0; g_CameraMode = 0; - enable_move_after_cinema = 0; + g_CameraAfterCinema = 0; D_8003649C = 0; stop_time_flag = 0; D_800364A4 = FLOAT_INIT; @@ -412,9 +412,9 @@ void bondviewLoadSetupIntroSection(void) g_CurrentPlayer->stanHeight = stan_height; g_CurrentPlayer->field_6C = stan_height / FIELD_6C_FACTOR; change_player_pos_to_target(&g_CurrentPlayer->field_488, &start_pos, start_stan); - g_CurrentPlayer->field_488.field_10.f[0] = -sinf(start_look_angle); - g_CurrentPlayer->field_488.field_10.f[1] = FLOAT_INIT; - g_CurrentPlayer->field_488.field_10.f[2] = cosf(start_look_angle); + g_CurrentPlayer->field_488.theta_transform.f[0] = -sinf(start_look_angle); + g_CurrentPlayer->field_488.theta_transform.f[1] = FLOAT_INIT; + g_CurrentPlayer->field_488.theta_transform.f[2] = cosf(start_look_angle); sub_GAME_7F089718(D_800364D0); dword_CODE_bss_80079DA0 = 0; @@ -426,8 +426,8 @@ void bondviewLoadSetupIntroSection(void) } bondviewResetIntroCameraMessageDialogs(); - sub_GAME_7F08A900(); - g_CurrentPlayer->prop = chrpropAllocate(); + bondviewResetUpperTextDisplay(); + g_CurrentPlayer->prop = propAllocate(); g_CurrentPlayer->prop->obj = NULL; g_CurrentPlayer->prop->type = PROP_TYPE_VIEWER; @@ -466,5 +466,5 @@ void bondviewLoadSetupIntroSection(void) g_CurrentPlayer->startnewbonddie = 1; g_CurrentPlayer->redbloodfinished = 0; g_CurrentPlayer->deathanimfinished = 0; - D_80036510 = 0; + D_80036510 = CAMERAMODE_NONE; } diff --git a/src/game/cheat_buttons.c b/src/game/cheat_buttons.c index ae13555a..850ad273 100644 --- a/src/game/cheat_buttons.c +++ b/src/game/cheat_buttons.c @@ -17,6 +17,8 @@ #include "objecthandler.h" #include "player.h" #include "player_2.h" +#include "assets/obseg/text/LmiscE.h" + //#include "chraicommands.h" /* needed for ai list commands, remove when moving global ai lists to chraicommands/chrai */ // bss @@ -683,39 +685,39 @@ u16 mBtnCheatUnlockAllGuns[] = { */ CheatInfo g_CheatInfo[] = { { CHEAT_EXTRA_MP_CHARS, 0xA, 0, 0, mBtnCheatExtraMPChars, 0, 0, /* 0x31 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MENUS}, - { CHEAT_INVINCIBILITY, 0xA, 0, 0, mBtnCheatInvincibility, TEXT(LMISC,0x00), 0, /* 0x06 */ CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, - { CHEAT_ALLGUNS, 0xA, 0, 0, mBtnCheatAllGuns, TEXT(LMISC,0x01), 0, /* 0x02 */ CHEAT_MASK_SPGAME}, + { CHEAT_INVINCIBILITY, 0xA, 0, 0, mBtnCheatInvincibility, TEXT(LMISC, MISC_STR_00), 0, /* 0x06 */ CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_ALLGUNS, 0xA, 0, 0, mBtnCheatAllGuns, TEXT(LMISC, MISC_STR_01), 0, /* 0x02 */ CHEAT_MASK_SPGAME}, { CHEAT_MAXAMMO, 0xA, 0, 0, mBtnCheatMaxAmmo, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_DEBUG_RETURN_SAVED_RA, 0xA, 0, 0, mBtnCheatInvalid, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, {CHEAT_DEACTIVATE_INVINCIBILITY, 0xA, 0, 0, mBtnCheatDeactivateInvincibilityMulti, 0, 0, /* 0x34 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_MPGAME}, - { CHEAT_LINEMODE, 0xA, 0, 0, mBtnCheatLineMode, TEXT(LMISC,0x37), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_LINEMODE, 0xA, 0, 0, mBtnCheatLineMode, TEXT(LMISC, MISC_STR_37), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_2X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_2X_ARMOR, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, - { CHEAT_INVISIBILITY, 0xA, 0, 0, mBtnCheatInvisibility, TEXT(LMISC,0x04), 0, /* 0x62 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_SPGAME}, - { CHEAT_INFINITE_AMMO, 0, 0, 0, 0, TEXT(LMISC,0x06), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, - { CHEAT_DK_MODE, 0, 0, 0, 0, TEXT(LMISC,0x07), 0, /* 0x26 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_INVISIBILITY, 0xA, 0, 0, mBtnCheatInvisibility, TEXT(LMISC, MISC_STR_04), 0, /* 0x62 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_SPGAME}, + { CHEAT_INFINITE_AMMO, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_06), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_DK_MODE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_07), 0, /* 0x26 */ CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_EXTRA_WEAPONS, 0, 0, 0, 0, 0, 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_TINY_BOND, 0, 0, 0, 0, TEXT(LMISC,0x08), 0, /* 0x02 */ CHEAT_MASK_SPGAME}, - { CHEAT_PAINTBALL, 0, 0, 0, 0, TEXT(LMISC,0x38), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_TINY_BOND, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_08), 0, /* 0x02 */ CHEAT_MASK_SPGAME}, + { CHEAT_PAINTBALL, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_38), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_10X_HEALTH, 0, 0, 0, 0, 0, 0, /* 0x16 */ CHEAT_MASK_16 | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, - { CHEAT_MAGNUM, 0, 0, 0, 0, TEXT(LMISC,0x0A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_LASER, 0, 0, 0, 0, TEXT(LMISC,0x0B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_GOLDEN_GUN, 0, 0, 0, 0, TEXT(LMISC,0x0C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_SILVER_PP7, 0, 0, 0, 0, TEXT(LMISC,0x0D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_GOLD_PP7, 0, 0, 0, 0, TEXT(LMISC,0x0E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_MAGNUM, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_LASER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_GOLDEN_GUN, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_SILVER_PP7, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_GOLD_PP7, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_0E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, { CHEAT_INVISIBILITY_MP, 0xA, 0, 0, mBtnCheatInvisibilityMulti, 0, 0, /* 0x12 */ CHEAT_MASK_MPGAME}, - { CHEAT_NO_RADAR_MP, 0, 0, 0, 0, TEXT(LMISC,0x43), 0, /* 0x64 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME}, - { CHEAT_TURBO_MODE, 0, 0, 0, 0, TEXT(LMISC,0x40), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, + { CHEAT_NO_RADAR_MP, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_43), 0, /* 0x64 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME}, + { CHEAT_TURBO_MODE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_40), 0, /* 0x66 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_MPGAME | CHEAT_MASK_SPGAME}, { CHEAT_DEBUG_POS, 0, 0, 0, 0, 0, 0, /* 0x20 */ CHEAT_MASK_GLOBAL}, - { CHEAT_FAST_ANIMATION, 0, 0, 0, 0, TEXT(LMISC,0x41), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_SLOW_ANIMATION, 0, 0, 0, 0, TEXT(LMISC,0x42), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_ENEMY_ROCKETS, 0, 0, 0, 0, TEXT(LMISC,0x39), 0, /* 0x01 */ CHEAT_MASK_MENUS}, - { CHEAT_2X_ROCKET_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC,0x3A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_2X_GRENADE_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC,0x3B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_2X_RCP90, 0, 0, 0, 0, TEXT(LMISC,0x3C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_2X_THROWING_KNIFE, 0, 0, 0, 0, TEXT(LMISC,0x3D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_2X_HUNTING_KNIFE, 0, 0, 0, 0, TEXT(LMISC,0x3E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, - { CHEAT_2X_LASER, 0, 0, 0, 0, TEXT(LMISC,0x3F), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_FAST_ANIMATION, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_41), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_SLOW_ANIMATION, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_42), 0, /* 0x72 */ CHEAT_MASK_TOGGLE | CHEAT_MASK_GLOBAL | CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_ENEMY_ROCKETS, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_39), 0, /* 0x01 */ CHEAT_MASK_MENUS}, + { CHEAT_2X_ROCKET_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3A), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_2X_GRENADE_LAUNCHER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3B), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_2X_RCP90, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3C), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_2X_THROWING_KNIFE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3D), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_2X_HUNTING_KNIFE, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3E), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, + { CHEAT_2X_LASER, 0, 0, 0, 0, TEXT(LMISC, MISC_STR_3F), 0, /* 0x12 */ CHEAT_MASK_16 | CHEAT_MASK_SPGAME}, { CHEAT_UNLOCK_PAINTBALL, 0xA, 0, 0, mBtnCheatPaintballMod, 0, 0, /* 0x11 */ CHEAT_MASK_16 | CHEAT_MASK_MENUS}, //at cheat menu { CHEAT_UNLOCK_INVINCIBLE, 0xA, 0, 0, mBtnCheatInvincible2, 0, 0, /* 0x11 */ CHEAT_MASK_16 | CHEAT_MASK_MENUS}, //at cheat menu @@ -1646,7 +1648,7 @@ char *cheatGetMenuTextPointer(CHEAT_ID cheat_id) return langGet((s32) temp_v0); } - return langGet(TEXT(LMISC,0x28)); + return langGet(TEXT(LMISC, MISC_STR_28)); } @@ -1667,13 +1669,13 @@ bool cheatIsActive(CHEAT_ID cheat) */ void cheatButtonSetDkMode(CHEAT_ID cheat_id) { - s32 num_guards; + s32 g_NumChrSlots; s32 i; f32 scale; Model *model; - ChrRecord* guard = ptr_guard_data; + ChrRecord* guard = g_ChrSlots; - num_guards = get_numguards(); + g_NumChrSlots = get_numguards(); if (cheat_id) { @@ -1684,7 +1686,7 @@ void cheatButtonSetDkMode(CHEAT_ID cheat_id) scale = 1.25f; } - for (i=0; ihidden &= ~0x100; + self->hidden &= ~CHRHIDDEN_MOVING; } else { - self->hidden |= 0x100; + self->hidden |= CHRHIDDEN_MOVING; } return; } @@ -1220,7 +1220,7 @@ glabel sub_GAME_7F01F614 /* 054178 7F01F648 0FC08C58 */ jal chrGetChrWidthHeight /* 05417C 7F01F64C 27A6008C */ addiu $a2, $sp, 0x8c /* 054180 7F01F650 8FA40098 */ lw $a0, 0x98($sp) -/* 054184 7F01F654 0FC07D7A */ jal set_or_unset_GUARDdata_flag +/* 054184 7F01F654 0FC07D7A */ jal chrSetMoving /* 054188 7F01F658 00002825 */ move $a1, $zero /* 05418C 7F01F65C 0FC2C731 */ jal sub_GAME_7F0B1CC4 /* 054190 7F01F660 00000000 */ nop @@ -1240,7 +1240,7 @@ glabel sub_GAME_7F01F614 /* 0541C8 7F01F698 E7A60018 */ swc1 $f6, 0x18($sp) /* 0541CC 7F01F69C E7B00024 */ swc1 $f16, 0x24($sp) /* 0541D0 7F01F6A0 E7A8001C */ swc1 $f8, 0x1c($sp) -/* 0541D4 7F01F6A4 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0541D4 7F01F6A4 0FC2C389 */ jal stanTestLineUnobstructed /* 0541D8 7F01F6A8 E7AA0020 */ swc1 $f10, 0x20($sp) /* 0541DC 7F01F6AC 10400016 */ beqz $v0, .L7F01F708 /* 0541E0 7F01F6B0 27A40090 */ addiu $a0, $sp, 0x90 @@ -1252,7 +1252,7 @@ glabel sub_GAME_7F01F614 /* 0541F8 7F01F6C8 AFB90010 */ sw $t9, 0x10($sp) /* 0541FC 7F01F6CC 8FA70084 */ lw $a3, 0x84($sp) /* 054200 7F01F6D0 E7B20014 */ swc1 $f18, 0x14($sp) -/* 054204 7F01F6D4 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 054204 7F01F6D4 0FC2C62E */ jal stanTestVolume /* 054208 7F01F6D8 E7A40018 */ swc1 $f4, 0x18($sp) /* 05420C 7F01F6DC 0441000A */ bgez $v0, .L7F01F708 /* 054210 7F01F6E0 8FA800A8 */ lw $t0, 0xa8($sp) @@ -1349,7 +1349,7 @@ glabel sub_GAME_7F01F614 /* 05436C 7F01F83C E7B20018 */ swc1 $f18, 0x18($sp) /* 054370 7F01F840 E7A60024 */ swc1 $f6, 0x24($sp) /* 054374 7F01F844 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 054378 7F01F848 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 054378 7F01F848 0FC2C389 */ jal stanTestLineUnobstructed /* 05437C 7F01F84C E7A80020 */ swc1 $f8, 0x20($sp) /* 054380 7F01F850 10400016 */ beqz $v0, .L7F01F8AC /* 054384 7F01F854 27A40090 */ addiu $a0, $sp, 0x90 @@ -1361,7 +1361,7 @@ glabel sub_GAME_7F01F614 /* 05439C 7F01F86C 8FA60048 */ lw $a2, 0x48($sp) /* 0543A0 7F01F870 8FA70084 */ lw $a3, 0x84($sp) /* 0543A4 7F01F874 E7B00014 */ swc1 $f16, 0x14($sp) -/* 0543A8 7F01F878 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 0543A8 7F01F878 0FC2C62E */ jal stanTestVolume /* 0543AC 7F01F87C E7A40018 */ swc1 $f4, 0x18($sp) /* 0543B0 7F01F880 0441000A */ bgez $v0, .L7F01F8AC /* 0543B4 7F01F884 C7B20040 */ lwc1 $f18, 0x40($sp) @@ -1455,7 +1455,7 @@ glabel sub_GAME_7F01F614 /* 05450C 7F01F9DC E7AA001C */ swc1 $f10, 0x1c($sp) /* 054510 7F01F9E0 E7B20018 */ swc1 $f18, 0x18($sp) /* 054514 7F01F9E4 E7A60024 */ swc1 $f6, 0x24($sp) -/* 054518 7F01F9E8 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 054518 7F01F9E8 0FC2C389 */ jal stanTestLineUnobstructed /* 05451C 7F01F9EC E7B00020 */ swc1 $f16, 0x20($sp) /* 054520 7F01F9F0 10400079 */ beqz $v0, .L7F01FBD8 /* 054524 7F01F9F4 27A40090 */ addiu $a0, $sp, 0x90 @@ -1467,7 +1467,7 @@ glabel sub_GAME_7F01F614 /* 05453C 7F01FA0C 8FA60048 */ lw $a2, 0x48($sp) /* 054540 7F01FA10 8FA70084 */ lw $a3, 0x84($sp) /* 054544 7F01FA14 E7A40014 */ swc1 $f4, 0x14($sp) -/* 054548 7F01FA18 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 054548 7F01FA18 0FC2C62E */ jal stanTestVolume /* 05454C 7F01FA1C E7A80018 */ swc1 $f8, 0x18($sp) /* 054550 7F01FA20 0441006D */ bgez $v0, .L7F01FBD8 /* 054554 7F01FA24 C7B20040 */ lwc1 $f18, 0x40($sp) @@ -1557,7 +1557,7 @@ glabel sub_GAME_7F01F614 /* 05469C 7F01FB6C E7AA001C */ swc1 $f10, 0x1c($sp) /* 0546A0 7F01FB70 E7A60018 */ swc1 $f6, 0x18($sp) /* 0546A4 7F01FB74 E7B20024 */ swc1 $f18, 0x24($sp) -/* 0546A8 7F01FB78 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0546A8 7F01FB78 0FC2C389 */ jal stanTestLineUnobstructed /* 0546AC 7F01FB7C E7A40020 */ swc1 $f4, 0x20($sp) /* 0546B0 7F01FB80 10400015 */ beqz $v0, .L7F01FBD8 /* 0546B4 7F01FB84 27A40090 */ addiu $a0, $sp, 0x90 @@ -1569,7 +1569,7 @@ glabel sub_GAME_7F01F614 /* 0546CC 7F01FB9C 8FA60048 */ lw $a2, 0x48($sp) /* 0546D0 7F01FBA0 8FA70084 */ lw $a3, 0x84($sp) /* 0546D4 7F01FBA4 E7A80014 */ swc1 $f8, 0x14($sp) -/* 0546D8 7F01FBA8 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 0546D8 7F01FBA8 0FC2C62E */ jal stanTestVolume /* 0546DC 7F01FBAC E7B00018 */ swc1 $f16, 0x18($sp) /* 0546E0 7F01FBB0 04410009 */ bgez $v0, .L7F01FBD8 /* 0546E4 7F01FBB4 C7A60040 */ lwc1 $f6, 0x40($sp) @@ -1584,7 +1584,7 @@ glabel sub_GAME_7F01F614 .L7F01FBD8: /* 054708 7F01FBD8 8FA40098 */ lw $a0, 0x98($sp) .L7F01FBDC: -/* 05470C 7F01FBDC 0FC07D7A */ jal set_or_unset_GUARDdata_flag +/* 05470C 7F01FBDC 0FC07D7A */ jal chrSetMoving /* 054710 7F01FBE0 24050001 */ li $a1, 1 /* 054714 7F01FBE4 8FAC0094 */ lw $t4, 0x94($sp) /* 054718 7F01FBE8 8FAE0098 */ lw $t6, 0x98($sp) @@ -2527,9 +2527,9 @@ s32 chrGetNumFree(void) s32 count = 0; s32 i; - for (i = 0; i < num_guards; i++) + for (i = 0; i < g_NumChrSlots; i++) { - if (ptr_guard_data[i].model == 0) + if (g_ChrSlots[i].model == 0) { count++; } @@ -2577,8 +2577,8 @@ glabel init_GUARDdata_with_set_values /* 054BEC 7F0200BC 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 054BF0 7F0200C0 F7B40010 */ sdc1 $f20, 0x10($sp) /* 054BF4 7F0200C4 4487A000 */ mtc1 $a3, $f20 -/* 054BF8 7F0200C8 3C078003 */ lui $a3, %hi(num_guards) -/* 054BFC 7F0200CC 8CE7CC68 */ lw $a3, %lo(num_guards)($a3) +/* 054BF8 7F0200C8 3C078003 */ lui $a3, %hi(g_NumChrSlots) +/* 054BFC 7F0200CC 8CE7CC68 */ lw $a3, %lo(g_NumChrSlots)($a3) /* 054C00 7F0200D0 AFB30028 */ sw $s3, 0x28($sp) /* 054C04 7F0200D4 AFB20024 */ sw $s2, 0x24($sp) /* 054C08 7F0200D8 AFB10020 */ sw $s1, 0x20($sp) @@ -2590,8 +2590,8 @@ glabel init_GUARDdata_with_set_values /* 054C20 7F0200F0 00008025 */ move $s0, $zero /* 054C24 7F0200F4 18E0000E */ blez $a3, .L7F020130 /* 054C28 7F0200F8 00001025 */ move $v0, $zero -/* 054C2C 7F0200FC 3C058003 */ lui $a1, %hi(ptr_guard_data) -/* 054C30 7F020100 8CA5CC64 */ lw $a1, %lo(ptr_guard_data)($a1) +/* 054C2C 7F0200FC 3C058003 */ lui $a1, %hi(g_ChrSlots) +/* 054C30 7F020100 8CA5CC64 */ lw $a1, %lo(g_ChrSlots)($a1) /* 054C34 7F020104 00002025 */ move $a0, $zero /* 054C38 7F020108 00A01825 */ move $v1, $a1 .L7F02010C: @@ -2634,7 +2634,7 @@ glabel init_GUARDdata_with_set_values /* 054CC4 7F020194 3C058003 */ lui $a1, %hi(animation_rate) /* 054CC8 7F020198 8CA5C900 */ lw $a1, %lo(animation_rate)($a1) /* 054CCC 7F02019C 4406A000 */ mfc1 $a2, $f20 -/* 054CD0 7F0201A0 0FC1BFC6 */ jal modelSetAnimRateForDuration +/* 054CD0 7F0201A0 0FC1BFC6 */ jal modelSetAnimPlaySpeed /* 054CD4 7F0201A4 02402025 */ move $a0, $s2 /* 054CD8 7F0201A8 3C028003 */ lui $v0, %hi(player1_guardID) /* 054CDC 7F0201AC 2442CC60 */ addiu $v0, %lo(player1_guardID) # addiu $v0, $v0, -0x33a0 @@ -2781,8 +2781,8 @@ glabel init_GUARDdata_with_set_values /* 05290C 7F01FF1C 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 052910 7F01FF20 F7B40010 */ sdc1 $f20, 0x10($sp) /* 052914 7F01FF24 4487A000 */ mtc1 $a3, $f20 -/* 052918 7F01FF28 3C078003 */ lui $a3, %hi(num_guards) # $a3, 0x8003 -/* 05291C 7F01FF2C 8CE781B8 */ lw $a3, %lo(num_guards)($a3) +/* 052918 7F01FF28 3C078003 */ lui $a3, %hi(g_NumChrSlots) # $a3, 0x8003 +/* 05291C 7F01FF2C 8CE781B8 */ lw $a3, %lo(g_NumChrSlots)($a3) /* 052920 7F01FF30 AFB30028 */ sw $s3, 0x28($sp) /* 052924 7F01FF34 AFB20024 */ sw $s2, 0x24($sp) /* 052928 7F01FF38 AFB10020 */ sw $s1, 0x20($sp) @@ -2794,8 +2794,8 @@ glabel init_GUARDdata_with_set_values /* 052940 7F01FF50 00008025 */ move $s0, $zero /* 052944 7F01FF54 18E0000E */ blez $a3, .L7F01FF90 /* 052948 7F01FF58 00001025 */ move $v0, $zero -/* 05294C 7F01FF5C 3C058003 */ lui $a1, %hi(ptr_guard_data) # $a1, 0x8003 -/* 052950 7F01FF60 8CA581B4 */ lw $a1, %lo(ptr_guard_data)($a1) +/* 05294C 7F01FF5C 3C058003 */ lui $a1, %hi(g_ChrSlots) # $a1, 0x8003 +/* 052950 7F01FF60 8CA581B4 */ lw $a1, %lo(g_ChrSlots)($a1) /* 052954 7F01FF64 00002025 */ move $a0, $zero /* 052958 7F01FF68 00A01825 */ move $v1, $a1 .L7F01FF6C: @@ -2843,7 +2843,7 @@ glabel init_GUARDdata_with_set_values /* 0529F8 7F020008 46105482 */ mul.s $f18, $f10, $f16 /* 0529FC 7F02000C 4406A000 */ mfc1 $a2, $f20 /* 052A00 7F020010 44059000 */ mfc1 $a1, $f18 -/* 052A04 7F020014 0FC1C02E */ jal modelSetAnimRateForDuration +/* 052A04 7F020014 0FC1C02E */ jal modelSetAnimPlaySpeed /* 052A08 7F020018 00000000 */ nop /* 052A0C 7F02001C 3C028003 */ lui $v0, %hi(player1_guardID) # $v0, 0x8003 /* 052A10 7F020020 244281B0 */ addiu $v0, %lo(player1_guardID) # addiu $v0, $v0, -0x7e50 @@ -2986,12 +2986,12 @@ glabel init_GUARDdata_with_set_values /** * Address 0x7F0203B8. */ -PropRecord * replace_GUARDdata_with_actual_values( Model * arg0, coord3d * arg1, f32 arg2, StandTile * arg3, s32 arg4) +PropRecord * chrAllocate( Model * arg0, coord3d * arg1, f32 arg2, StandTile * arg3, s32 arg4) { PropRecord * ret; s32 phi_a0; - ret = chrpropAllocate(); + ret = propAllocate(); if (ret != 0) { @@ -3051,12 +3051,12 @@ void disable_sounds_attached_to_player_then_something(PropRecord *prop) p = prop->child; while (p != NULL) { - sub_GAME_7F04C044(p); + objDetach(p); objFreePermanently(p->chr, 1); p = p->nextSibling; } - set_aircraft_obj_inst_scale_to_zero(model); + clear_aircraft_model_obj(model); chr->model = NULL; chr->chrnum = -1; @@ -3127,7 +3127,7 @@ glabel disable_sounds_attached_to_player_then_something /* 055010 7F0204E0 00000000 */ nop .L7F0204E4: /* 055014 7F0204E4 8C910004 */ lw $s1, 4($a0) -/* 055018 7F0204E8 0FC13011 */ jal sub_GAME_7F04C044 +/* 055018 7F0204E8 0FC13011 */ jal objDetach /* 05501C 7F0204EC 8C900024 */ lw $s0, 0x24($a0) /* 055020 7F0204F0 02202025 */ move $a0, $s1 /* 055024 7F0204F4 0FC10409 */ jal objFreePermanently @@ -3135,7 +3135,7 @@ glabel disable_sounds_attached_to_player_then_something /* 05502C 7F0204FC 1600FFF9 */ bnez $s0, .L7F0204E4 /* 055030 7F020500 02002025 */ move $a0, $s0 .L7F020504: -/* 055034 7F020504 0FC1B0FE */ jal set_aircraft_obj_inst_scale_to_zero +/* 055034 7F020504 0FC1B0FE */ jal clear_aircraft_model_obj /* 055038 7F020508 8FA40028 */ lw $a0, 0x28($sp) /* 05503C 7F02050C 8E440020 */ lw $a0, 0x20($s2) /* 055040 7F020510 240FFFFF */ li $t7, -1 @@ -3166,15 +3166,15 @@ void setAnimationRate(f32 arg0) animation_rate = arg0; - for (i=0; iaimendcount >= 2) { #if defined(BUGFIX_R1) - temp_f0 = g_JP_GlobalTimerDelta / (f32) self->aimendcount; + mult = g_JP_GlobalTimerDelta / (f32) self->aimendcount; #else - temp_f0 = g_GlobalTimerDelta / (f32) self->aimendcount; + mult = g_GlobalTimerDelta / (f32) self->aimendcount; #endif - if (temp_f0 > 1.0f) + if (mult > 1.0f) { - temp_f0 = 1.0f; + mult = 1.0f; } - self->aimuplshoulder += ((self->aimendlshoulder - self->aimuplshoulder) * temp_f0); - self->aimuprshoulder += ((self->aimendrshoulder - self->aimuprshoulder) * temp_f0); - self->aimupback += ((self->aimendback - self->aimupback) * temp_f0); - self->aimsideback += ((self->aimendsideback - self->aimsideback) * temp_f0); + self->aimuplshoulder += ((self->aimendlshoulder - self->aimuplshoulder) * mult); + self->aimuprshoulder += ((self->aimendrshoulder - self->aimuprshoulder) * mult); + self->aimupback += ((self->aimendback - self->aimupback) * mult); + self->aimsideback += ((self->aimendsideback - self->aimsideback) * mult); self->aimendcount -= g_ClockTimer; return; @@ -3249,11 +3249,11 @@ void chrSetHiddenToRandom(ChrRecord *self) if (rand == 0) { - self->hidden |= 0x1000; + self->hidden |= CHRHIDDEN_1000; } else if (rand == 1) { - self->hidden |= 0x2000; + self->hidden |= CHRHIDDEN_2000; } // roll for bits 14,15. @@ -3265,11 +3265,11 @@ void chrSetHiddenToRandom(ChrRecord *self) if (rand == 0) { - self->hidden |= 0x4000; + self->hidden |= CHRHIDDEN_4000; } else if (rand == 1) { - self->hidden |= 0x8000; + self->hidden |= CHRHIDDEN_8000; } } } @@ -3421,8 +3421,25 @@ s32 not_in_us_7F0209EC(s32 bodynum, s32 headnum) return 1; } - if ((bodynum != 6) && (bodynum != 7) && (bodynum != 8) && (bodynum != 9) && (bodynum != 0xA) && (bodynum != 0xB) && (bodynum != 0xC) && (bodynum != 0xD) && (bodynum != 0xE) && (bodynum != 0xF) && (bodynum != 0x10) && (bodynum != 0x4F) - && (headnum != 0x4A) && (headnum != 0x4B) && (headnum != 0x4C) && (headnum != 0x4D) && (headnum != 0x4E) && (headnum != 0x45)) + if ((bodynum != BODY_Boris) && + (bodynum != BODY_Ourumov) && + (bodynum != BODY_Trevelyan_Janus) && + (bodynum != BODY_Trevelyan_006) && + (bodynum != BODY_Valentin_) && + (bodynum != BODY_Xenia) && + (bodynum != BODY_Baron_Samedi) && + (bodynum != BODY_Jaws) && + (bodynum != BODY_Mayday) && + (bodynum != BODY_Oddjob) && + (bodynum != BODY_Natalya_Skirt) && + (bodynum != BODY_Natalya_Jungle_Fatigues) && + + (headnum != BODY_Male_Pierce_Bond_1) && + (headnum != BODY_Male_Pierce_Bond_2) && + (headnum != BODY_Male_Pierce_Bond_3) && + (headnum != BODY_Male_Pierce_Bond_Parka) && + (headnum != BODY_Male_Pierce_Bond_Tuxedo) && + (headnum != BODY_Male_Mishkin)) { return 1; } @@ -3810,7 +3827,7 @@ glabel sub_GAME_7F02083C /* 055894 7F020D64 C7A80078 */ lwc1 $f8, 0x78($sp) /* 055898 7F020D68 E5080034 */ swc1 $f8, 0x34($t0) /* 05589C 7F020D6C C7A4007C */ lwc1 $f4, 0x7c($sp) -/* 0558A0 7F020D70 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0558A0 7F020D70 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0558A4 7F020D74 E5040038 */ swc1 $f4, 0x38($t0) /* 0558A8 7F020D78 00402025 */ move $a0, $v0 /* 0558AC 7F020D7C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -4204,7 +4221,7 @@ glabel sub_GAME_7F02083C /* 055B6C 7F020FFC C7A80078 */ lwc1 $f8, 0x78($sp) /* 055B70 7F021000 E5280034 */ swc1 $f8, 0x34($t1) /* 055B74 7F021004 C7A4007C */ lwc1 $f4, 0x7c($sp) -/* 055B78 7F021008 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 055B78 7F021008 0FC1E26D */ jal camGetWorldToScreenMtxf /* 055B7C 7F02100C E5240038 */ swc1 $f4, 0x38($t1) /* 055B80 7F021010 00402025 */ move $a0, $v0 /* 055B84 7F021014 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -4256,10 +4273,10 @@ void chrPositionRelated7F020E40(ChrRecord *chr, s32 arg1) model = chr->model; prop = chr->prop; - if ((chr->hidden & 0x800) == 0) + if (!(chr->hidden & CHRHIDDEN_FREEZE)) { getsuboffset(model, &chr->prevpos); - sub_GAME_7F070AEC(model, arg1, 1); + modelTickAnimQuarterSpeed(model, arg1, 1); subcalcpos(model); set_color_shading_from_tile(prop, &chr->nextcol); getsuboffset(model, &prop->pos); @@ -4419,7 +4436,7 @@ glabel sub_GAME_7F020EF0 /* 055C0C 7F0210DC 24010006 */ li $at, 6 /* 055C10 7F0210E0 55A1000D */ bnel $t5, $at, .L7F021118 /* 055C14 7F0210E4 00027A00 */ sll $t7, $v0, 8 -/* 055C18 7F0210E8 0FC26C57 */ jal sub_GAME_7F09B15C +/* 055C18 7F0210E8 0FC26C57 */ jal getPlayerPointerIndex /* 055C1C 7F0210EC 01802025 */ move $a0, $t4 /* 055C20 7F0210F0 0002C880 */ sll $t9, $v0, 2 /* 055C24 7F0210F4 3C188008 */ lui $t8, %hi(g_playerPointers) @@ -4449,7 +4466,7 @@ glabel sub_GAME_7F020EF0 /* 055C7C 7F02114C 00003025 */ move $a2, $zero /* 055C80 7F021150 11600005 */ beqz $t3, .L7F021168 /* 055C84 7F021154 00000000 */ nop -/* 055C88 7F021158 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 055C88 7F021158 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 055C8C 7F02115C 8FA40110 */ lw $a0, 0x110($sp) /* 055C90 7F021160 10000003 */ b .L7F021170 /* 055C94 7F021164 00000000 */ nop @@ -4564,7 +4581,7 @@ glabel sub_GAME_7F020EF0 /* 055E1C 7F0212EC 8FA40110 */ lw $a0, 0x110($sp) .L7F0212F0: /* 055E20 7F0212F0 8FA50104 */ lw $a1, 0x104($sp) -/* 055E24 7F0212F4 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 055E24 7F0212F4 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 055E28 7F0212F8 00003025 */ move $a2, $zero .L7F0212FC: /* 055E2C 7F0212FC 10000032 */ b .L7F0213C8 @@ -4598,7 +4615,7 @@ glabel sub_GAME_7F020EF0 /* 055E90 7F021360 8FA50104 */ lw $a1, 0x104($sp) /* 055E94 7F021364 13000003 */ beqz $t8, .L7F021374 /* 055E98 7F021368 00000000 */ nop -/* 055E9C 7F02136C 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 055E9C 7F02136C 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 055EA0 7F021370 00003025 */ move $a2, $zero .L7F021374: /* 055EA4 7F021374 10000014 */ b .L7F0213C8 @@ -4608,7 +4625,7 @@ glabel sub_GAME_7F020EF0 /* 055EB0 7F021380 02002025 */ move $a0, $s0 /* 055EB4 7F021384 8FA40110 */ lw $a0, 0x110($sp) /* 055EB8 7F021388 8FA50104 */ lw $a1, 0x104($sp) -/* 055EBC 7F02138C 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 055EBC 7F02138C 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 055EC0 7F021390 00003025 */ move $a2, $zero /* 055EC4 7F021394 10000003 */ b .L7F0213A4 /* 055EC8 7F021398 00000000 */ nop @@ -4643,7 +4660,7 @@ glabel sub_GAME_7F020EF0 /* 055F28 7F0213F8 35AC0200 */ ori $t4, $t5, 0x200 /* 055F2C 7F0213FC A60C0012 */ sh $t4, 0x12($s0) .L7F021400: -/* 055F30 7F021400 0FC0817C */ jal chrAimGlobalTimerTickRelated +/* 055F30 7F021400 0FC0817C */ jal chrUpdateAimProperties /* 055F34 7F021404 02002025 */ move $a0, $s0 /* 055F38 7F021408 8E040020 */ lw $a0, 0x20($s0) /* 055F3C 7F02140C 50800005 */ beql $a0, $zero, .L7F021424 @@ -4670,7 +4687,7 @@ glabel sub_GAME_7F020EF0 /* 055F8C 7F02145C 10400004 */ beqz $v0, .L7F021470 /* 055F90 7F021460 3C013EA0 */ li $at, 0x3EA00000 # 0.312500 /* 055F94 7F021464 44816000 */ mtc1 $at, $f12 -/* 055F98 7F021468 0FC1B103 */ jal set_float_80036088 +/* 055F98 7F021468 0FC1B103 */ jal modelSetDistanceScale /* 055F9C 7F02146C 00000000 */ nop .L7F021470: /* 055FA0 7F021470 3C0A7F02 */ lui $t2, %hi(sub_GAME_7F02083C) # $t2, 0x7f02 @@ -4678,7 +4695,7 @@ glabel sub_GAME_7F020EF0 /* 055FA8 7F021478 3C018003 */ lui $at, %hi(D_80036090) /* 055FAC 7F02147C AC2A6090 */ sw $t2, %lo(D_80036090)($at) /* 055FB0 7F021480 3C018007 */ lui $at, %hi(dword_CODE_bss_80069B60) -/* 055FB4 7F021484 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 055FB4 7F021484 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 055FB8 7F021488 AC309B60 */ sw $s0, %lo(dword_CODE_bss_80069B60)($at) /* 055FBC 7F02148C 8FAB0110 */ lw $t3, 0x110($sp) /* 055FC0 7F021490 AFA20118 */ sw $v0, 0x118($sp) @@ -4713,7 +4730,7 @@ glabel sub_GAME_7F020EF0 /* 05602C 7F0214FC AC206090 */ sw $zero, %lo(D_80036090)($at) /* 056030 7F021500 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 056034 7F021504 44816000 */ mtc1 $at, $f12 -/* 056038 7F021508 0FC1B103 */ jal set_float_80036088 +/* 056038 7F021508 0FC1B103 */ jal modelSetDistanceScale /* 05603C 7F02150C 00000000 */ nop /* 056040 7F021510 260400F4 */ addiu $a0, $s0, 0xf4 /* 056044 7F021514 0FC100C4 */ jal update_color_shading @@ -4747,7 +4764,7 @@ glabel sub_GAME_7F020EF0 /* 0560B4 7F021584 8C65001C */ lw $a1, 0x1c($v1) /* 0560B8 7F021588 8FA40110 */ lw $a0, 0x110($sp) /* 0560BC 7F02158C AFA70100 */ sw $a3, 0x100($sp) -/* 0560C0 7F021590 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0560C0 7F021590 0FC1B198 */ jal modelFindNodeMtx /* 0560C4 7F021594 AFA300FC */ sw $v1, 0xfc($sp) /* 0560C8 7F021598 8FAB00FC */ lw $t3, 0xfc($sp) /* 0560CC 7F02159C AFA20118 */ sw $v0, 0x118($sp) @@ -5110,7 +5127,7 @@ glabel sub_GAME_7F020EF0 /* 056608 7F021AD8 3058FFFE */ andi $t8, $v0, 0xfffe /* 05660C 7F021ADC 8C830024 */ lw $v1, 0x24($a0) .L7F021AE0: -/* 056610 7F021AE0 0FC1304C */ jal sub_GAME_7F04C130 +/* 056610 7F021AE0 0FC1304C */ jal objDrop /* 056614 7F021AE4 AFA3003C */ sw $v1, 0x3c($sp) /* 056618 7F021AE8 8FA4003C */ lw $a0, 0x3c($sp) /* 05661C 7F021AEC 5480FFFC */ bnezl $a0, .L7F021AE0 @@ -5271,7 +5288,7 @@ glabel sub_GAME_7F020EF0 /* 055EE4 7F021374 24010006 */ li $at, 6 /* 055EE8 7F021378 55A1000D */ bnel $t5, $at, .Ljp7F0213B0 /* 055EEC 7F02137C 00027A00 */ sll $t7, $v0, 8 -/* 055EF0 7F021380 0FC26F3F */ jal sub_GAME_7F09B15C +/* 055EF0 7F021380 0FC26F3F */ jal getPlayerPointerIndex /* 055EF4 7F021384 01802025 */ move $a0, $t4 /* 055EF8 7F021388 0002C880 */ sll $t9, $v0, 2 /* 055EFC 7F02138C 3C188008 */ lui $t8, %hi(g_playerPointers) @@ -5301,7 +5318,7 @@ glabel sub_GAME_7F020EF0 /* 055F54 7F0213E4 00003025 */ move $a2, $zero /* 055F58 7F0213E8 11600005 */ beqz $t3, .Ljp7F021400 /* 055F5C 7F0213EC 00000000 */ nop -/* 055F60 7F0213F0 0FC1C437 */ jal sub_GAME_7F070AEC +/* 055F60 7F0213F0 0FC1C437 */ jal modelTickAnimQuarterSpeed /* 055F64 7F0213F4 8FA40110 */ lw $a0, 0x110($sp) /* 055F68 7F0213F8 10000003 */ b .Ljp7F021408 /* 055F6C 7F0213FC 00000000 */ nop @@ -5416,7 +5433,7 @@ glabel sub_GAME_7F020EF0 /* 0560F4 7F021584 8FA40110 */ lw $a0, 0x110($sp) .Ljp7F021588: /* 0560F8 7F021588 8FA50104 */ lw $a1, 0x104($sp) -/* 0560FC 7F02158C 0FC1C437 */ jal sub_GAME_7F070AEC +/* 0560FC 7F02158C 0FC1C437 */ jal modelTickAnimQuarterSpeed /* 056100 7F021590 00003025 */ move $a2, $zero .Ljp7F021594: /* 056104 7F021594 10000032 */ b .Ljp7F021660 @@ -5450,7 +5467,7 @@ glabel sub_GAME_7F020EF0 /* 056168 7F0215F8 8FA50104 */ lw $a1, 0x104($sp) /* 05616C 7F0215FC 13000003 */ beqz $t8, .Ljp7F02160C /* 056170 7F021600 00000000 */ nop -/* 056174 7F021604 0FC1C437 */ jal sub_GAME_7F070AEC +/* 056174 7F021604 0FC1C437 */ jal modelTickAnimQuarterSpeed /* 056178 7F021608 00003025 */ move $a2, $zero .Ljp7F02160C: /* 05617C 7F02160C 10000014 */ b .Ljp7F021660 @@ -5460,7 +5477,7 @@ glabel sub_GAME_7F020EF0 /* 056188 7F021618 02002025 */ move $a0, $s0 /* 05618C 7F02161C 8FA40110 */ lw $a0, 0x110($sp) /* 056190 7F021620 8FA50104 */ lw $a1, 0x104($sp) -/* 056194 7F021624 0FC1C437 */ jal sub_GAME_7F070AEC +/* 056194 7F021624 0FC1C437 */ jal modelTickAnimQuarterSpeed /* 056198 7F021628 00003025 */ move $a2, $zero /* 05619C 7F02162C 10000003 */ b .Ljp7F02163C /* 0561A0 7F021630 00000000 */ nop @@ -5495,7 +5512,7 @@ glabel sub_GAME_7F020EF0 /* 056200 7F021690 35AC0200 */ ori $t4, $t5, 0x200 /* 056204 7F021694 A60C0012 */ sh $t4, 0x12($s0) .Ljp7F021698: -/* 056208 7F021698 0FC081E8 */ jal chrAimGlobalTimerTickRelated +/* 056208 7F021698 0FC081E8 */ jal chrUpdateAimProperties /* 05620C 7F02169C 02002025 */ move $a0, $s0 /* 056210 7F0216A0 8E040020 */ lw $a0, 0x20($s0) /* 056214 7F0216A4 50800005 */ beql $a0, $zero, .Ljp7F0216BC @@ -5527,7 +5544,7 @@ glabel sub_GAME_7F020EF0 /* 056278 7F021708 10400013 */ beqz $v0, .Ljp7F021758 /* 05627C 7F02170C 3C013EA0 */ li $at, 0x3EA00000 # 0.312500 /* 056280 7F021710 44816000 */ mtc1 $at, $f12 -/* 056284 7F021714 0FC1B27F */ jal set_float_80036088 +/* 056284 7F021714 0FC1B27F */ jal modelSetDistanceScale /* 056288 7F021718 00000000 */ nop /* 05628C 7F02171C 8E020014 */ lw $v0, 0x14($s0) /* 056290 7F021720 3C01EFFF */ lui $at, (0xEFFFFFFF >> 16) # lui $at, 0xefff @@ -5550,7 +5567,7 @@ glabel sub_GAME_7F020EF0 /* 0562D0 7F021760 3C018003 */ lui $at, %hi(D_80036090) # $at, 0x8003 /* 0562D4 7F021764 AC2D60D0 */ sw $t5, %lo(D_80036090)($at) /* 0562D8 7F021768 3C018007 */ lui $at, %hi(dword_CODE_bss_80069B60) # $at, 0x8007 -/* 0562DC 7F02176C 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 0562DC 7F02176C 0FC1E26D */ jal camGetWorldToScreenMtxf /* 0562E0 7F021770 AC309BA0 */ sw $s0, %lo(dword_CODE_bss_80069B60)($at) /* 0562E4 7F021774 8FAC0110 */ lw $t4, 0x110($sp) /* 0562E8 7F021778 AFA20118 */ sw $v0, 0x118($sp) @@ -5585,7 +5602,7 @@ glabel sub_GAME_7F020EF0 /* 056354 7F0217E4 AC2060D0 */ sw $zero, %lo(D_80036090)($at) /* 056358 7F0217E8 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 05635C 7F0217EC 44816000 */ mtc1 $at, $f12 -/* 056360 7F0217F0 0FC1B27F */ jal set_float_80036088 +/* 056360 7F0217F0 0FC1B27F */ jal modelSetDistanceScale /* 056364 7F0217F4 00000000 */ nop /* 056368 7F0217F8 260400F4 */ addiu $a0, $s0, 0xf4 /* 05636C 7F0217FC 0FC10184 */ jal update_color_shading @@ -5619,7 +5636,7 @@ glabel sub_GAME_7F020EF0 /* 0563DC 7F02186C 8C65001C */ lw $a1, 0x1c($v1) /* 0563E0 7F021870 8FA40110 */ lw $a0, 0x110($sp) /* 0563E4 7F021874 AFA70100 */ sw $a3, 0x100($sp) -/* 0563E8 7F021878 0FC1B314 */ jal sub_GAME_7F06C660 +/* 0563E8 7F021878 0FC1B314 */ jal modelFindNodeMtx /* 0563EC 7F02187C AFA300FC */ sw $v1, 0xfc($sp) /* 0563F0 7F021880 8FAC00FC */ lw $t4, 0xfc($sp) /* 0563F4 7F021884 AFA20118 */ sw $v0, 0x118($sp) @@ -5982,7 +5999,7 @@ glabel sub_GAME_7F020EF0 /* 056930 7F021DC0 3048FFFE */ andi $t0, $v0, 0xfffe /* 056934 7F021DC4 8C830024 */ lw $v1, 0x24($a0) .Ljp7F021DC8: -/* 056938 7F021DC8 0FC1314D */ jal sub_GAME_7F04C130 +/* 056938 7F021DC8 0FC1314D */ jal objDrop /* 05693C 7F021DCC AFA3003C */ sw $v1, 0x3c($sp) /* 056940 7F021DD0 8FA4003C */ lw $a0, 0x3c($sp) /* 056944 7F021DD4 5480FFFC */ bnezl $a0, .Ljp7F021DC8 @@ -6197,7 +6214,7 @@ glabel sub_GAME_7F020EF0 /* 053A44 7F021054 24010006 */ li $at, 6 /* 053A48 7F021058 55A1000D */ bnel $t5, $at, .L7F021090 /* 053A4C 7F02105C 00027A00 */ sll $t7, $v0, 8 -/* 053A50 7F021060 0FC269A7 */ jal sub_GAME_7F09B15C +/* 053A50 7F021060 0FC269A7 */ jal getPlayerPointerIndex /* 053A54 7F021064 01802025 */ move $a0, $t4 /* 053A58 7F021068 0002C880 */ sll $t9, $v0, 2 /* 053A5C 7F02106C 3C188007 */ lui $t8, %hi(g_playerPointers) @@ -6227,7 +6244,7 @@ glabel sub_GAME_7F020EF0 /* 053AB4 7F0210C4 00003025 */ move $a2, $zero /* 053AB8 7F0210C8 11600005 */ beqz $t3, .L7F0210E0 /* 053ABC 7F0210CC 00000000 */ nop -/* 053AC0 7F0210D0 0FC1C323 */ jal sub_GAME_7F070AEC +/* 053AC0 7F0210D0 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 053AC4 7F0210D4 8FA40110 */ lw $a0, 0x110($sp) /* 053AC8 7F0210D8 10000003 */ b .L7F0210E8 /* 053ACC 7F0210DC 00000000 */ nop @@ -6342,7 +6359,7 @@ glabel sub_GAME_7F020EF0 /* 053C54 7F021264 8FA40110 */ lw $a0, 0x110($sp) .L7F021268: /* 053C58 7F021268 8FA50104 */ lw $a1, 0x104($sp) -/* 053C5C 7F02126C 0FC1C323 */ jal sub_GAME_7F070AEC +/* 053C5C 7F02126C 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 053C60 7F021270 00003025 */ move $a2, $zero .L7F021274: /* 053C64 7F021274 10000032 */ b .L7F021340 @@ -6376,7 +6393,7 @@ glabel sub_GAME_7F020EF0 /* 053CC8 7F0212D8 8FA50104 */ lw $a1, 0x104($sp) /* 053CCC 7F0212DC 13000003 */ beqz $t8, .L7F0212EC /* 053CD0 7F0212E0 00000000 */ nop -/* 053CD4 7F0212E4 0FC1C323 */ jal sub_GAME_7F070AEC +/* 053CD4 7F0212E4 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 053CD8 7F0212E8 00003025 */ move $a2, $zero .L7F0212EC: /* 053CDC 7F0212EC 10000014 */ b .L7F021340 @@ -6386,7 +6403,7 @@ glabel sub_GAME_7F020EF0 /* 053CE8 7F0212F8 02002025 */ move $a0, $s0 /* 053CEC 7F0212FC 8FA40110 */ lw $a0, 0x110($sp) /* 053CF0 7F021300 8FA50104 */ lw $a1, 0x104($sp) -/* 053CF4 7F021304 0FC1C323 */ jal sub_GAME_7F070AEC +/* 053CF4 7F021304 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 053CF8 7F021308 00003025 */ move $a2, $zero /* 053CFC 7F02130C 10000003 */ b .L7F02131C /* 053D00 7F021310 00000000 */ nop @@ -6421,7 +6438,7 @@ glabel sub_GAME_7F020EF0 /* 053D60 7F021370 35AC0200 */ ori $t4, $t5, 0x200 /* 053D64 7F021374 A60C0012 */ sh $t4, 0x12($s0) .L7F021378: -/* 053D68 7F021378 0FC08120 */ jal chrAimGlobalTimerTickRelated +/* 053D68 7F021378 0FC08120 */ jal chrUpdateAimProperties /* 053D6C 7F02137C 02002025 */ move $a0, $s0 /* 053D70 7F021380 8E040020 */ lw $a0, 0x20($s0) /* 053D74 7F021384 50800005 */ beql $a0, $zero, .L7F02139C @@ -6453,7 +6470,7 @@ glabel sub_GAME_7F020EF0 /* 053DD8 7F0213E8 10400013 */ beqz $v0, .L7F021438 /* 053DDC 7F0213EC 3C013EA0 */ li $at, 0x3EA00000 # 0.312500 /* 053DE0 7F0213F0 44816000 */ mtc1 $at, $f12 -/* 053DE4 7F0213F4 0FC1B2D3 */ jal set_float_80036088 +/* 053DE4 7F0213F4 0FC1B2D3 */ jal modelSetDistanceScale /* 053DE8 7F0213F8 00000000 */ nop /* 053DEC 7F0213FC 8E020014 */ lw $v0, 0x14($s0) /* 053DF0 7F021400 3C01EFFF */ lui $at, (0xEFFFFFFF >> 16) # lui $at, 0xefff @@ -6476,7 +6493,7 @@ glabel sub_GAME_7F020EF0 /* 053E30 7F021440 3C018003 */ lui $at, %hi(D_80036090) # $at, 0x8003 /* 053E34 7F021444 AC2D15E0 */ sw $t5, %lo(D_80036090)($at) /* 053E38 7F021448 3C018006 */ lui $at, %hi(dword_CODE_bss_80069B60) # $at, 0x8006 -/* 053E3C 7F02144C 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 053E3C 7F02144C 0FC1E111 */ jal camGetWorldToScreenMtxf /* 053E40 7F021450 AC308AA0 */ sw $s0, %lo(dword_CODE_bss_80069B60)($at) /* 053E44 7F021454 8FAC0110 */ lw $t4, 0x110($sp) /* 053E48 7F021458 AFA20118 */ sw $v0, 0x118($sp) @@ -6511,7 +6528,7 @@ glabel sub_GAME_7F020EF0 /* 053EB4 7F0214C4 AC2015E0 */ sw $zero, %lo(D_80036090)($at) /* 053EB8 7F0214C8 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 053EBC 7F0214CC 44816000 */ mtc1 $at, $f12 -/* 053EC0 7F0214D0 0FC1B2D3 */ jal set_float_80036088 +/* 053EC0 7F0214D0 0FC1B2D3 */ jal modelSetDistanceScale /* 053EC4 7F0214D4 00000000 */ nop /* 053EC8 7F0214D8 260400F4 */ addiu $a0, $s0, 0xf4 /* 053ECC 7F0214DC 0FC100F4 */ jal update_color_shading @@ -6545,7 +6562,7 @@ glabel sub_GAME_7F020EF0 /* 053F3C 7F02154C 8C65001C */ lw $a1, 0x1c($v1) /* 053F40 7F021550 8FA40110 */ lw $a0, 0x110($sp) /* 053F44 7F021554 AFA70100 */ sw $a3, 0x100($sp) -/* 053F48 7F021558 0FC1B366 */ jal sub_GAME_7F06C660 +/* 053F48 7F021558 0FC1B366 */ jal modelFindNodeMtx /* 053F4C 7F02155C AFA300FC */ sw $v1, 0xfc($sp) /* 053F50 7F021560 8FAC00FC */ lw $t4, 0xfc($sp) /* 053F54 7F021564 AFA20118 */ sw $v0, 0x118($sp) @@ -6908,7 +6925,7 @@ glabel sub_GAME_7F020EF0 /* 054490 7F021AA0 3048FFFE */ andi $t0, $v0, 0xfffe /* 054494 7F021AA4 8C830024 */ lw $v1, 0x24($a0) .L7F021AA8: -/* 054498 7F021AA8 0FC130C9 */ jal sub_GAME_7F04C130 +/* 054498 7F021AA8 0FC130C9 */ jal objDrop /* 05449C 7F021AAC AFA3003C */ sw $v1, 0x3c($sp) /* 0544A0 7F021AB0 8FA4003C */ lw $a0, 0x3c($sp) /* 0544A4 7F021AB4 5480FFFC */ bnezl $a0, .L7F021AA8 @@ -7258,7 +7275,7 @@ glabel sub_GAME_7F022078 /* 056CA4 7F022174 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 056CA8 7F022178 E7A40044 */ swc1 $f4, 0x44($sp) /* 056CAC 7F02217C 00402025 */ move $a0, $v0 -/* 056CB0 7F022180 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 056CB0 7F022180 0FC1611D */ jal mtx4TransformVecInPlace /* 056CB4 7F022184 27A5003C */ addiu $a1, $sp, 0x3c /* 056CB8 7F022188 8FAD0050 */ lw $t5, 0x50($sp) /* 056CBC 7F02218C 27A4003C */ addiu $a0, $sp, 0x3c @@ -7385,17 +7402,17 @@ glabel sub_GAME_7F0221DC /* 056E54 7F022324 1000000C */ b .L7F022358 /* 056E58 7F022328 00000000 */ nop .L7F02232C: -/* 056E5C 7F02232C 0FC1BA5C */ jal sub_GAME_7F06E970 +/* 056E5C 7F02232C 0FC1BA5C */ jal modelApplyDistanceRelations /* 056E60 7F022330 02002825 */ move $a1, $s0 /* 056E64 7F022334 10000008 */ b .L7F022358 /* 056E68 7F022338 8E090014 */ lw $t1, 0x14($s0) .L7F02233C: -/* 056E6C 7F02233C 0FC1BA6F */ jal process_12_handle_switch +/* 056E6C 7F02233C 0FC1BA6F */ jal modelApplyToggleRelations /* 056E70 7F022340 02002825 */ move $a1, $s0 /* 056E74 7F022344 10000004 */ b .L7F022358 /* 056E78 7F022348 8E090014 */ lw $t1, 0x14($s0) .L7F02234C: -/* 056E7C 7F02234C 0FC1BA82 */ jal process_17_pointer_to_head +/* 056E7C 7F02234C 0FC1BA82 */ jal modelApplyHeadRelations /* 056E80 7F022350 02002825 */ move $a1, $s0 /* 056E84 7F022354 8E090014 */ lw $t1, 0x14($s0) .L7F022358: @@ -7754,11 +7771,11 @@ glabel sub_GAME_7F022648 /* 05736C 7F02283C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 057370 7F022840 E7A4007C */ swc1 $f4, 0x7c($sp) /* 057374 7F022844 00402025 */ move $a0, $v0 -/* 057378 7F022848 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 057378 7F022848 0FC160F6 */ jal mtx4RotateVecInPlace /* 05737C 7F02284C 27A50074 */ addiu $a1, $sp, 0x74 /* 057380 7F022850 8FA400DC */ lw $a0, 0xdc($sp) /* 057384 7F022854 8FA500D8 */ lw $a1, 0xd8($sp) -/* 057388 7F022858 0FC1B198 */ jal sub_GAME_7F06C660 +/* 057388 7F022858 0FC1B198 */ jal modelFindNodeMtx /* 05738C 7F02285C 00003025 */ move $a2, $zero /* 057390 7F022860 C4460030 */ lwc1 $f6, 0x30($v0) /* 057394 7F022864 C6480000 */ lwc1 $f8, ($s2) @@ -7910,7 +7927,7 @@ glabel sub_GAME_7F022980 /* 0575A0 7F022A70 E7A800B0 */ swc1 $f8, 0xb0($sp) /* 0575A4 7F022A74 27B000A8 */ addiu $s0, $sp, 0xa8 /* 0575A8 7F022A78 02002825 */ move $a1, $s0 -/* 0575AC 7F022A7C 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 0575AC 7F022A7C 0FC1611D */ jal mtx4TransformVecInPlace /* 0575B0 7F022A80 00402025 */ move $a0, $v0 /* 0575B4 7F022A84 0FC19ED3 */ jal sub_GAME_7F067B4C /* 0575B8 7F022A88 02002025 */ move $a0, $s0 @@ -8077,7 +8094,7 @@ glabel sub_GAME_7F022980 /* 057810 7F022CE0 8FBF004C */ lw $ra, 0x4c($sp) .L7F022CE4: /* 057814 7F022CE4 8E240048 */ lw $a0, 0x48($s1) -/* 057818 7F022CE8 0FC1B198 */ jal sub_GAME_7F06C660 +/* 057818 7F022CE8 0FC1B198 */ jal modelFindNodeMtx /* 05781C 7F022CEC 8E25000C */ lw $a1, 0xc($s1) /* 057820 7F022CF0 C7B20098 */ lwc1 $f18, 0x98($sp) /* 057824 7F022CF4 C7A4009C */ lwc1 $f4, 0x9c($sp) @@ -8136,7 +8153,7 @@ glabel sub_GAME_7F022980 /* 0578F8 7F022DC8 E7A60078 */ swc1 $f6, 0x78($sp) /* 0578FC 7F022DCC 27B00070 */ addiu $s0, $sp, 0x70 /* 057900 7F022DD0 02002825 */ move $a1, $s0 -/* 057904 7F022DD4 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 057904 7F022DD4 0FC1611D */ jal mtx4TransformVecInPlace /* 057908 7F022DD8 02402025 */ move $a0, $s2 /* 05790C 7F022DDC 8E240048 */ lw $a0, 0x48($s1) /* 057910 7F022DE0 8E250008 */ lw $a1, 8($s1) @@ -8254,13 +8271,13 @@ void chrCheckGuardsHeardSound(f32 noise) { s32 i; - for (i=0; iweapon; - if (bondwalkItemCheckBitflags(wep->weaponnum, 0x200) == 0) + if (bondwalkItemCheckBitflags(wep->weaponnum, WEAPONSTATBITFLAG_HOLD_AS_GUN) == 0) { gunprop = NULL; } @@ -8408,81 +8425,51 @@ f32 chrGetChrGround(PropRecord *arg0) -#ifdef NONMATCHING -void sub_GAME_7F023194(void) { +/** + * Calculate auto aim position coordinates. + * + * US address 7F023194. +*/ +s32 sub_GAME_7F023194(PropRecord *arg0, struct coord3d *arg1, struct coord2d *arg2, struct coord2d *arg3) +{ + struct ChrRecord *temp_v1; + temp_v1 = arg0->chr; + + if (arg0->flags & PROPFLAG_ONSCREEN) + { + if ((temp_v1->actiontype != ACT_DIE) && (temp_v1->actiontype != ACT_DEAD) && !(temp_v1->chrflags & CHRFLAG_NO_AUTOAIM)) + { + struct Model *model; + RenderPosView *model_render_pos_1; + RenderPosView *model_render_pos_2; + + model = temp_v1->model; + model_render_pos_1 = &model->render_pos[0]; + model_render_pos_2 = &model->render_pos[1]; + + arg1->f[2] = model_render_pos_2->pos.m[3][2] + ((model_render_pos_1->pos.m[3][2] - model_render_pos_2->pos.m[3][2]) * 0.25f); + + if (arg1->f[2] < 0.0f) + { + arg1->f[0] = model_render_pos_2->pos.m[3][0] + ((model_render_pos_1->pos.m[3][0] - model_render_pos_2->pos.m[3][0]) * 0.25f); + arg1->f[1] = model_render_pos_2->pos.m[3][1] + ((model_render_pos_1->pos.m[3][1] - model_render_pos_2->pos.m[3][1]) * 0.25f); + + arg3->y = 0.0f; + arg3->x = 0.0f; + + arg2->x = 0.0f; + arg2->y = 0.0f; + + sub_GAME_7F03F90C(model, &arg2->y, &arg2->x, &arg3->y, &arg3->x); + + return 1; + } + } + } + + return 0; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F023194 -/* 057CC4 7F023194 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 057CC8 7F023198 AFBF001C */ sw $ra, 0x1c($sp) -/* 057CCC 7F02319C AFA50024 */ sw $a1, 0x24($sp) -/* 057CD0 7F0231A0 AFA7002C */ sw $a3, 0x2c($sp) -/* 057CD4 7F0231A4 908E0001 */ lbu $t6, 1($a0) -/* 057CD8 7F0231A8 8C830004 */ lw $v1, 4($a0) -/* 057CDC 7F0231AC 31CF0002 */ andi $t7, $t6, 2 -/* 057CE0 7F0231B0 51E00033 */ beql $t7, $zero, .L7F023280 -/* 057CE4 7F0231B4 00001025 */ move $v0, $zero -/* 057CE8 7F0231B8 80620007 */ lb $v0, 7($v1) -/* 057CEC 7F0231BC 24010004 */ li $at, 4 -/* 057CF0 7F0231C0 1041002E */ beq $v0, $at, .L7F02327C -/* 057CF4 7F0231C4 24010005 */ li $at, 5 -/* 057CF8 7F0231C8 5041002D */ beql $v0, $at, .L7F023280 -/* 057CFC 7F0231CC 00001025 */ move $v0, $zero -/* 057D00 7F0231D0 8C780014 */ lw $t8, 0x14($v1) -/* 057D04 7F0231D4 33190800 */ andi $t9, $t8, 0x800 -/* 057D08 7F0231D8 57200029 */ bnezl $t9, .L7F023280 -/* 057D0C 7F0231DC 00001025 */ move $v0, $zero -/* 057D10 7F0231E0 8C64001C */ lw $a0, 0x1c($v1) -/* 057D14 7F0231E4 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 057D18 7F0231E8 44817000 */ mtc1 $at, $f14 -/* 057D1C 7F0231EC 8C82000C */ lw $v0, 0xc($a0) -/* 057D20 7F0231F0 44806000 */ mtc1 $zero, $f12 -/* 057D24 7F0231F4 24480040 */ addiu $t0, $v0, 0x40 -/* 057D28 7F0231F8 C5000038 */ lwc1 $f0, 0x38($t0) -/* 057D2C 7F0231FC C4440038 */ lwc1 $f4, 0x38($v0) -/* 057D30 7F023200 46002181 */ sub.s $f6, $f4, $f0 -/* 057D34 7F023204 460E3202 */ mul.s $f8, $f6, $f14 -/* 057D38 7F023208 46004280 */ add.s $f10, $f8, $f0 -/* 057D3C 7F02320C 460C503C */ c.lt.s $f10, $f12 -/* 057D40 7F023210 E4AA0008 */ swc1 $f10, 8($a1) -/* 057D44 7F023214 4502001A */ bc1fl .L7F023280 -/* 057D48 7F023218 00001025 */ move $v0, $zero -/* 057D4C 7F02321C C5000030 */ lwc1 $f0, 0x30($t0) -/* 057D50 7F023220 C4500030 */ lwc1 $f16, 0x30($v0) -/* 057D54 7F023224 46008481 */ sub.s $f18, $f16, $f0 -/* 057D58 7F023228 460E9102 */ mul.s $f4, $f18, $f14 -/* 057D5C 7F02322C 46002180 */ add.s $f6, $f4, $f0 -/* 057D60 7F023230 E4A60000 */ swc1 $f6, ($a1) -/* 057D64 7F023234 C4480034 */ lwc1 $f8, 0x34($v0) -/* 057D68 7F023238 C5020034 */ lwc1 $f2, 0x34($t0) -/* 057D6C 7F02323C 46024281 */ sub.s $f10, $f8, $f2 -/* 057D70 7F023240 460E5402 */ mul.s $f16, $f10, $f14 -/* 057D74 7F023244 46028480 */ add.s $f18, $f16, $f2 -/* 057D78 7F023248 E4B20004 */ swc1 $f18, 4($a1) -/* 057D7C 7F02324C 8FAB002C */ lw $t3, 0x2c($sp) -/* 057D80 7F023250 24C50004 */ addiu $a1, $a2, 4 -/* 057D84 7F023254 E56C0004 */ swc1 $f12, 4($t3) -/* 057D88 7F023258 E56C0000 */ swc1 $f12, ($t3) -/* 057D8C 7F02325C E4CC0000 */ swc1 $f12, ($a2) -/* 057D90 7F023260 E4CC0004 */ swc1 $f12, 4($a2) -/* 057D94 7F023264 8FAC002C */ lw $t4, 0x2c($sp) -/* 057D98 7F023268 25870004 */ addiu $a3, $t4, 4 -/* 057D9C 7F02326C 0FC0FE43 */ jal sub_GAME_7F03F90C -/* 057DA0 7F023270 AFAC0010 */ sw $t4, 0x10($sp) -/* 057DA4 7F023274 10000002 */ b .L7F023280 -/* 057DA8 7F023278 24020001 */ li $v0, 1 -.L7F02327C: -/* 057DAC 7F02327C 00001025 */ move $v0, $zero -.L7F023280: -/* 057DB0 7F023280 8FBF001C */ lw $ra, 0x1c($sp) -/* 057DB4 7F023284 27BD0020 */ addiu $sp, $sp, 0x20 -/* 057DB8 7F023288 03E00008 */ jr $ra -/* 057DBC 7F02328C 00000000 */ nop -) -#endif diff --git a/src/game/chr.h b/src/game/chr.h index 743532fd..24a7dc14 100644 --- a/src/game/chr.h +++ b/src/game/chr.h @@ -230,8 +230,8 @@ extern s32 D_8002C910; extern s32 D_8002CC58; extern s32 show_patrols_flag; extern s32 player1_guardID; -extern ChrRecord *ptr_guard_data; -extern s32 num_guards; +extern ChrRecord *g_ChrSlots; +extern s32 g_NumChrSlots; extern struct unk_joint_list D_8002CC6C; extern s32 D_8002CCAC; extern s32 D_8002CCB0; @@ -285,11 +285,11 @@ void sub_GAME_7F022EE0(s32 param_1); void setanimationdebugflag(s32 param_1); void disable_sounds_attached_to_player_then_something(PropRecord* prop); void chrPositionRelated7F020D94(ChrRecord *); -void set_or_unset_GUARDdata_flag(ChrRecord *guard,s32 param_2); +void chrSetMoving(ChrRecord *guard,s32 param_2); f32 getAnimationRate(void); void setAnimationRate(f32); PropRecord *init_GUARDdata_with_set_values(PropRecord *, Model *, coord3d *, f32 arg2, StandTile * arg3, s32 arg4); -PropRecord *replace_GUARDdata_with_actual_values(struct Model * arg0, coord3d * arg1, f32 arg2, StandTile * arg3, s32 arg4); +PropRecord *chrAllocate(struct Model * arg0, coord3d * arg1, f32 arg2, StandTile * arg3, s32 arg4); void chrSetHiddenToRandom(ChrRecord *arg0); void chrRemoved7F022E1C(f32 arg0); void chrDecrementAnimationTablePointerCount(void); @@ -307,9 +307,12 @@ s32 get_numguards(void); Gfx *chrRenderProp(PropRecord *arg0, Gfx *arg1, s32 arg2); void chrAddHealth(ChrRecord *chr, f32 health); void chrSetMaxDamage(ChrRecord *chr, f32 maxdamage); +s32 sub_GAME_7F03DA50(struct PropRecord *arg0, s32 arg1); +s32 sub_GAME_7F023194(PropRecord *arg0, struct coord3d *arg1, struct coord2d *arg2, struct coord2d *arg3); //tentative signature s32 sub_GAME_7F01FC10(Model *, coord3d *, coord3d *, f32 *); +void sub_GAME_7F0221DC(Model *arg0, s32 arg1, ModelNode *arg2, struct coord3d *arg3); #ifdef BUGFIX_R1 s32 not_in_us_7F0209EC(s32 bodynum, s32 headnum); diff --git a/src/game/chr_b.c b/src/game/chr_b.c index 4ebdff43..0ca34110 100644 --- a/src/game/chr_b.c +++ b/src/game/chr_b.c @@ -20,6 +20,8 @@ s32 load_body_head_if_not_loaded(s32 model) /** * Address 0x7F0232E8 (VERSION_US) * Address 0x7F0235D8 (other version) + * Not a very descriptive name for a function. What it does is load Bond's model or those + * for spawning guards. It is not used for guards that spawn at level loading. */ struct Model *makeonebody(s32 body, s32 head, struct ModelFileHeader *bodyHeader, struct ModelFileHeader *headHeader, s32 sunglasses, struct Model *model) { @@ -95,7 +97,7 @@ struct Model *makeonebody(s32 body, s32 head, struct ModelFileHeader *bodyHeader if ((headHeader != 0) && (c_item_entries[body].hasHead == 0)) { bodyHeader->numRecords -= headHeader->numRecords; - sub_GAME_7F06C3B4(model, opcode, headHeader); + modelAttachHead(model, opcode, headHeader); if ((sunglasses == 0) && ((s32) headHeader->numSwitches > 0)) { diff --git a/src/game/chrai.c b/src/game/chrai.c index 8995d5b0..e8f45a11 100644 --- a/src/game/chrai.c +++ b/src/game/chrai.c @@ -847,9 +847,9 @@ PathRecord *pathFindById(s32 ID) extern void chrpropDelist(PropRecord *prop); extern PadRecord * dword_CODE_bss_800799F8; extern CutsceneRecord *gBondViewCutscene; -extern s32 dword_CODE_bss_80079A18; +extern enum CAMERAMODE dword_CODE_bss_80079A18; extern s32 dword_CODE_bss_80079A1C; -extern vec3d flt_CODE_bss_80079990; +extern vec3d g_ForceBondMoveOffset; //CODE.bss:80079A00 extern f32 flt_CODE_bss_80079A00; //CODE.bss:80079A04 @@ -2290,14 +2290,14 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) #endif if (obj && obj->prop) { - if (!do_something_if_object_destroyed(obj)) + if (!objGetDestroyedLevel(obj)) { f32 damage = ((obj->damage - obj->maxdamage) + 1) / 250.0f; #ifdef ENABLE_LOG osSyncPrintf("ai_destroyobj 3 : adddamageobj\n"); #endif - maybe_detonate_object(obj, damage, &obj->runtime_pos, 29, -1); + maybe_detonate_object(obj, damage, &obj->runtime_pos, 0x1D, -1); } } Offset += AI_DestroyObject_LENGTH; @@ -2354,7 +2354,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) if (obj && obj->prop) { INV_ITEM_TYPE iType = collect_or_interact_object(obj->prop, FALSE); - sub_GAME_7F03C2BC(obj->prop, iType); + propExecuteTickOperation(obj->prop, iType); } Offset += AI_BondCollectObject_LENGTH; break; @@ -2368,7 +2368,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) { if (obj->prop->parent) { - sub_GAME_7F04C044(obj->prop); + objDetach(obj->prop); } else { @@ -2376,7 +2376,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) chrpropDelist(obj->prop); chrpropDisable(obj->prop); } - if (obj->type != PROPDEF_COLLECTABLE || !sub_GAME_7F051E1C(obj, chr)) + if (obj->type != PROPDEF_COLLECTABLE || !chrEquipWeapon(obj, chr)) { chrpropReparent(obj->prop, chr->prop); } @@ -3586,7 +3586,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) bool ok = FALSE; if (ChrEntityp && ChrEntityp->prop && ChrEntityp->model) { - ok = chrTryEquipHat(ChrEntityp, modelnum, flags); + ok = hatCreateForChr(ChrEntityp, modelnum, flags); } if (ok) { @@ -3665,7 +3665,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) { hatobj = hatprop->obj; - chrTryEquipHat(clone, hatobj->obj, 0); + hatCreateForChr(clone, hatobj->obj, 0); } } /* PD extras */ @@ -3953,15 +3953,15 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) if (obj->type == PROPDEF_MONITOR) { MonitorObjRecord *sm = (MonitorObjRecord *)obj; - monitorSetImageByNum(&sm->Monitor.image, ai->val[2]); + monitorSetImageByNum(&sm->Monitor.cmdlist, ai->val[2]); } else if (obj->type == PROPDEF_MULTI_MONITOR) { u8 slot = ai->val[1]; if (slot < 4) { - multimonitorobj *mm = (multimonitorobj *)obj; //need new size here 0x74 (116) + 0x80 (so monitor is obj + 74) - monitorSetImageByNum(&mm->Monitor[slot].image, ai->val[2]); + MultiMonitorObjRecord *mm = (MultiMonitorObjRecord *)obj; //need new size here 0x74 (116) + 0x80 (so monitor is obj + 74) + monitorSetImageByNum(&mm->Monitor[slot].cmdlist, ai->val[2]); } } } @@ -4065,15 +4065,15 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) case AI_BondDisableControl: { AIRecord1 *ai = AiListp + Offset; - set_unset_bitflags(4, FALSE); - set_unset_ammo_on_screen_setting(2, FALSE); + gunSetSightVisible(GUNSIGHTREASON_NOCONTROL, FALSE); + gunSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, FALSE); if (!(PLAYERFLAG_NOCONTROL & ai->val)) { hudmsgsSetOff(PLAYERFLAG_NOCONTROL); } if (!(ai->val & PLAYERFLAG_LOCKCONTROLS)) { - sub_GAME_7F08A944(PLAYERFLAG_NOCONTROL); + bondviewSetUpperTextDisplayFlag(PLAYERFLAG_NOCONTROL); } if (!(ai->val & PLAYERFLAG_NOTIMER)) { @@ -4088,10 +4088,10 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) #ifdef ENABLE_LOG osSyncPrintf("AI_BONDENABLECONTROL\n"); #endif - set_unset_bitflags(4, TRUE); - set_unset_ammo_on_screen_setting(2, TRUE); + gunSetSightVisible(GUNSIGHTREASON_NOCONTROL, TRUE); + gunSetGunAmmoVisible(GUNAMMOREASON_NOCONTROL, TRUE); hudmsgsSetOn(PLAYERFLAG_NOCONTROL); - sub_GAME_7F08A928(2); + bondviewClearUpperTextDisplayFlag(2); countdownTimerSetVisible(16, TRUE); D_800364B0 = TRUE; Offset += AI_BondEnableControl_LENGTH; @@ -4202,9 +4202,9 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) s32 num; for (num = get_numguards() - 1; num >= 0; num--) { - if (ptr_guard_data[num].model != NULL) + if (g_ChrSlots[num].model != NULL) { - ptr_guard_data[num].chrflags |= CHRFLAG_HIDDEN; + g_ChrSlots[num].chrflags |= CHRFLAG_HIDDEN; } } Offset += AI_HideAllChrs_LENGTH; @@ -4215,7 +4215,7 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) s32 num; for (num = get_numguards() - 1; num >= 0; num--) { - ptr_guard_data[num].chrflags &= ~CHRFLAG_HIDDEN; + g_ChrSlots[num].chrflags &= ~CHRFLAG_HIDDEN; } Offset += AI_ShowAllChrs_LENGTH; @@ -4305,9 +4305,9 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) g_Vars.currentplayer->bondforcespeed.z = (s8)ai->val[2]; */ AIRecord *ai = AiListp + Offset; - flt_CODE_bss_80079990.x = (s8)ai->val[0]; - flt_CODE_bss_80079990.y = 0; - flt_CODE_bss_80079990.z = (s8)ai->val[1]; + g_ForceBondMoveOffset.x = (s8)ai->val[0]; + g_ForceBondMoveOffset.y = 0; + g_ForceBondMoveOffset.z = (s8)ai->val[1]; Offset += AI_BondSetLockedVelocity_LENGTH; break; } @@ -4549,15 +4549,15 @@ void ai(PropDefHeaderRecord *Entityp, PROP_TYPE EntityType) if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - obj->unk6C->flags |= 0x601; - sub_GAME_7F03FE14(obj->prop); - matrix_4x4_set_identity(&obj->unk6C->m); - obj->unk6C->pos.x = 0; - obj->unk6C->pos.y = 0.016666666f; //step height? - obj->unk6C->pos.z = 0; - obj->unk6C->vec.x = 0; - obj->unk6C->vec.y = 0.29166666f; //direction to move? - obj->unk6C->vec.z = 0; + obj->projectile->flags |= 0x601; + projectileSetSticky(obj->prop); + matrix_4x4_set_identity(&obj->projectile->mtx); + obj->projectile->speed.x = 0; + obj->projectile->speed.y = 0.016666666f; //step height? + obj->projectile->speed.z = 0; + obj->projectile->unk10.x = 0; + obj->projectile->unk10.y = 0.29166666f; //direction to move? + obj->projectile->unk10.z = 0; } } Offset += AI_ObjectRocketLaunch_LENGTH; diff --git a/src/game/chrai.h b/src/game/chrai.h index 96658eac..1446e5ee 100644 --- a/src/game/chrai.h +++ b/src/game/chrai.h @@ -165,11 +165,11 @@ Rotate Image: #define PTR_LIST_OBJECT_LOOKUP_INDICES_LEN 512 #define BSS_8007161C_LEN 256 #define BSS_8007161C_DATA_LEN 16 -#define PROJECTILEDATA_START_ADDRESS_LEN 30 -#define BSS_80072E70_DATA_LEN 10 -#define BSS_80073370_DATA_LEN 20 -#define BSS_80073DC0_DATA_LEN 20 -#define BSS_80075030_DATA_LEN 40 +#define MAX_WEAPON_SLOTS 30 +#define MAX_HAT_SLOTS 10 +#define MAX_AMMO_CRATES 20 +#define PROJECTILES_ARR_MAX 20 +#define EMBEDMENT_ARR_MAX 40 #define ONSCREEN_PROP_LIST_LEN 500 @@ -178,242 +178,9 @@ Rotate Image: * Getting a match on alloc_lookup_buffers makes it seem * the struct is just one continuous array. (or maybe there's no struct....) */ -struct unk_8007161c +struct roomproplistchunk { - s16 data[16]; -}; - -struct projectile_data { - u32 unk00; - u32 unk04; - u32 unk08; - u32 unk0C; - - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - - u32 unk20; - u32 unk24; - u32 unk28; - u32 unk2C; - - u32 unk30; - u32 unk34; - u32 unk38; - u32 unk3C; - - u32 unk40; - u32 unk44; - u32 unk48; - u32 unk4C; - - u32 unk50; - u32 unk54; - u32 unk58; - u32 unk5C; - - u32 unk60; - u32 unk64; - u32 unk68; - u32 unk6C; - - u32 unk70; - u32 unk74; - u32 unk78; - u32 unk7C; - - u32 unk80; - u32 unk84; -}; - -struct bss_80072E70 { - u32 unk00; - u32 unk04; - u32 unk08; - u32 unk0C; - - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - - u32 unk20; - u32 unk24; - u32 unk28; - u32 unk2C; - - u32 unk30; - u32 unk34; - u32 unk38; - u32 unk3C; - - u32 unk40; - u32 unk44; - u32 unk48; - u32 unk4C; - - u32 unk50; - u32 unk54; - u32 unk58; - u32 unk5C; - - u32 unk60; - u32 unk64; - u32 unk68; - u32 unk6C; - - u32 unk70; - u32 unk74; - u32 unk78; - u32 unk7C; -}; - -struct bss_80073370 { - u32 unk00; - u32 unk04; - u32 unk08; - u32 unk0C; - - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - - u32 unk20; - u32 unk24; - u32 unk28; - u32 unk2C; - - u32 unk30; - u32 unk34; - u32 unk38; - u32 unk3C; - - u32 unk40; - u32 unk44; - u32 unk48; - u32 unk4C; - - u32 unk50; - u32 unk54; - u32 unk58; - u32 unk5C; - - u32 unk60; - u32 unk64; - u32 unk68; - u32 unk6C; - - u32 unk70; - u32 unk74; - u32 unk78; - u32 unk7C; - - u32 unk80; -}; - -struct bss_80073DC0 { - u32 unk00; - f32 unk04; - f32 unk08; - f32 unk0C; - - f32 unk10; - f32 unk14; - f32 unk18; - f32 unk1C; - - u32 unk20; - u32 unk24; - u32 unk28; - u32 unk2C; - - u32 unk30; - u32 unk34; - u32 unk38; - u32 unk3C; - - u32 unk40; - u32 unk44; - u32 unk48; - u32 unk4C; - - u32 unk50; - u32 unk54; - u32 unk58; - u32 unk5C; - - f32 unk60; - u32 unk64; - u32 unk68; - u32 unk6C; - - u32 unk70; - u32 unk74; - u32 unk78; - u32 unk7C; - - u32 unk80; - u32 unk84; - u32 unk88; - f32 unk8C; - - u32 unk90; - f32 unk94; - u32 unk98; - u32 unk9C; - - u32 unkA0; - u32 unkA4; - u32 unkA8; - u32 unkAC; - - u32 unkB0; - u32 unkB4; - u32 unkB8; - u32 unkBC; - - f32 unkC0; - f32 unkC4; - f32 unkC8; - u32 unkCC; - - u32 unkD0; - u32 unkD4; - u32 unkD8; - u32 unkDC; - - u32 unkE0; - u32 unkE4; - u32 unkE8; -}; - - -struct bss_80075030 { - s32 unk00; - u32 unk04; - u32 unk08; - u32 unk0C; - - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - - u32 unk20; - u32 unk24; - u32 unk28; - u32 unk2C; - - u32 unk30; - u32 unk34; - u32 unk38; - u32 unk3C; - - u32 unk40; - u32 unk44; + s16 propnums[16]; }; extern struct SetupPtrs g_SetupPtrs; @@ -465,17 +232,20 @@ extern PropRecord *ptr_obj_pos_list_final_entry; extern s32 g_OnScreenPropCount; extern PropRecord ** g_LastOnScreenProp; extern PropRecord * g_OnScreenPropList[]; -extern s16 * ptr_room_lookup_buffer_maybe; -extern struct unk_8007161c * dword_CODE_bss_8007161C; +extern PropRecord * g_InteractProp; +extern s16 * RoomPropListChunkIndexes; +extern struct roomproplistchunk * RoomPropListChunks; extern sfxRecord sfx_related[]; -extern struct projectile_data ProjectileData_start_address[]; -extern struct bss_80072E70 dword_CODE_bss_80072E70[]; -extern struct bss_80073370 dword_CODE_bss_80073370[]; -extern struct bss_80073DC0 dword_CODE_bss_80073DC0[]; -extern struct bss_80075030 dword_CODE_bss_80075030[]; +extern struct WeaponObjRecord g_WeaponSlots[]; +extern struct HatRecord g_HatSlots[]; +extern struct AmmoCrateRecord g_AmmoCrates[]; +extern struct Projectile g_Projectiles[]; +extern struct Embedment g_Embedments[]; +extern struct coord3d flt_CODE_bss_80075B78; +extern struct coord3d flt_CODE_bss_80075B88; -extern struct object_animation_controller g_MonitorAnimController; +extern MonitorRecord g_MonitorAnimController; extern struct object_animation_controller g_UnknownAnimController; extern struct object_animation_controller g_TaserAnimController; @@ -487,12 +257,12 @@ void check_deactivate_gas_sound(void); void handle_mp_respawn_and_some_things(void); void determing_type_of_object_and_detection(void); void chraiUpdateOnscreenPropCount(void); -void sub_GAME_7F03D78C(void); +void chrpropUpdateAutoaimTarget(void); void chraiCheckUseHeldItems(void); -s32 bond_interact_object(void); +bool bond_interact_object(void); void sub_GAME_7F03D0D4(void); void chrpropRegisterRoom(PropRecord *, s16); -PropRecord* chrpropAllocate(); +PropRecord* propAllocate(); void chrpropDeregisterRooms(PropRecord *); void sub_GAME_7F03E27C(PropRecord *, coord3d *, coord3d *, f32); void chrpropRegisterRooms(PropRecord *posData); @@ -506,7 +276,7 @@ void chraiGetCollisionBounds(PropRecord *arg0, struct rect4f **arg1, s3 void sub_GAME_7F03D058(PropRecord *prop, bool unset); void chraiGetCollisionBoundsWithoutY(PropRecord *arg0, struct rect4f **arg1, s32 *arg2); s32 chrpropTestPointInPolygon(coord3d *point, struct rect4f *polygon, s32 edges); -void sub_GAME_7F03E3FC(s32 *roomids); +void roomGetProps(s32 *roomids); ObjectRecord *scan_position_data_table_for_normal_object_at_preset(s32 arg0); Gfx *chrpropsRenderPass(Gfx *arg0, s32 roomid, s32 arg2); PropRecord *get_ptr_obj_pos_list_current_entry(void); @@ -521,11 +291,12 @@ ObjectRecord *sub_GAME_7F03FAB0(PadRecord *pad, s32 RoomID); void chraiGetCollisionBounds(PropRecord *arg0, struct rect4f **arg1, s32 *arg2, f32 *arg3, f32 *arg4); void chrpropGetCollisionBounds(PropRecord *arg0, f32 *arg1, f32 *arg2, f32 *arg3); f32 sub_GAME_7F03CFE8(PropRecord *arg0); -f32 chrpropSumMatrixPosX(struct modeldata_unk_pos* arg0, Mtxf *arg1); -f32 chrpropSumMatrixNegX(struct modeldata_unk_pos* arg0, Mtxf *arg1); -f32 chrpropSumMatrixPosY(struct modeldata_unk_pos* arg0, Mtxf *arg1); -f32 chrpropSumMatrixNegY(struct modeldata_unk_pos* arg0, Mtxf *arg1); -f32 chrpropSumMatrixPosZ(struct modeldata_unk_pos* arg0, Mtxf *arg1); -f32 chrpropSumMatrixNegZ(struct modeldata_unk_pos* arg0, Mtxf *arg1); -void sub_GAME_7F03F540(struct modeldata_unk_pos *arg0, Mtxf *arg1, s32* arg2, struct collision_data *arg3); +f32 chrpropSumMatrixPosX(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +f32 chrpropSumMatrixNegX(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +f32 chrpropSumMatrixPosY(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +f32 chrpropSumMatrixNegY(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +f32 chrpropSumMatrixPosZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +f32 chrpropSumMatrixNegZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1); +void sub_GAME_7F03F540(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1, struct rect4f* arg2, struct collision_data *arg3); +void sub_GAME_7F03F948(struct coord3d *arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4); #endif diff --git a/src/game/chrlv.c b/src/game/chrlv.c index e045c014..d53ff4a2 100644 --- a/src/game/chrlv.c +++ b/src/game/chrlv.c @@ -35,7 +35,7 @@ // forward declarations -u32 check_if_item_held_like_pistol (PropRecord *arg0); +u32 weaponIsOneHanded (PropRecord *arg0); void chrlvIdleAnimationRelated (ChrRecord *self, f32 arg1); f32 chrlvGetGuard007SpeedRating (ChrRecord *self, f32 min, f32 max); s32 chrlvGetGuard007SpeedRatingInt (ChrRecord *self, s32 arg1); @@ -43,9 +43,9 @@ f32 chrlvGetGuard007ArghRating (ChrRecord *self, f32 min, f32 max void chrlvKneelingAnimationRelated (ChrRecord *self); void chrlvIdleAnimationRelated7F023E14 (ChrRecord *self, f32 arg1); void chrlvKneelingAnimationRelated7F023E48 (ChrRecord *self); -void chrlvActorKneel (ChrRecord *self); +void chrKneelChooseAnimation (ChrRecord *self); void chrlvPerformAnimationForActor (ChrRecord *self, s32 arg1, s32 arg2, s32 arg3, u8 arg4, s32 arg5); -void chrlvExtendLeftHandAnimationRelated (ChrRecord *self); +void chrStartAlarmChooseAnimation (ChrRecord *self); void chrlvThrowGrenadeAnimationRelated (ChrRecord *self, PropRecord *arg1, s32 arg2, s32 arg3); void chrlvSpotBondAnimationRelated (ChrRecord *self, f32 arg1); void chrlvActorShuffleFeet (ChrRecord *self); @@ -73,7 +73,7 @@ s32 chrlvStanRoomRelatedPad (ChrRecord *self, PadRecord *arg1) void play_sound_for_shot_actor (ChrRecord *); void sub_GAME_7F025560 (ChrRecord *self, s32 attack_type, s32 arg2); coord3d *chrlvGetChrOrPresetLocation (ChrRecord *self, s32 flags, s32 lookup_id, StandTile **stan); -void sub_GAME_7F02D184 (ChrRecord *self); +void chrStopFiring (ChrRecord *self); void sub_GAME_7F0281F4 (ChrRecord *self); s32 plot_course_for_actor (ChrRecord *self, coord3d *arg1, StandTile *stan, SPEED speed); void chrlvPlotCourseRelated (ChrRecord *self); @@ -143,7 +143,7 @@ s32 chrResolveId (ChrRecord *self, s32 id); s32 sub_GAME_7F033780 (waypoint *arg0, coord3d *arg1, f32 angle); s32 chrlvFindPathNeighborRelated (coord3d *bondpos, StandTile *stan, f32 rot, u8 quadrant); s32 sub_GAME_7F033EAC (coord3d *arg0, StandTile *arg1); -PropRecord *actionblock_guard_constructor_BDBE(s32 bodynum, s32 headnum, coord3d *pos, StandTile *stan, f32 yrot, AIListRecord *ailist, s32 arg5); +PropRecord *chrSpawnAtCoord(s32 bodynum, s32 headnum, coord3d *pos, StandTile *stan, f32 angle, AIListRecord *ailist, s32 spawnflags); void chrlvInitActAttack (ChrRecord *self, struct anim_group_info ** arg1, s32 arg2, point2d *arg3, s32 attack_type, s32 arg5, s32 arg6); s32 chrlvPatrolCalculateStep (ChrRecord *self, bool *forward, s32 numsteps); s32 sub_GAME_7F028510 (coord3d *arg0, StandTile *arg1); @@ -218,7 +218,7 @@ s32 get_current_random_body(void) * @param id: Integer Index of body * @return an integer ID of a head to use */ -s32 select_psuedorandom_heads(s32 id) +s32 bodyChooseHead(s32 id) { s32 ret; @@ -281,7 +281,7 @@ void expand_09_characters(s32 stageid, GuardRecord *arg1, s32 arg2) { headid = (arg1->HeadID >= 0) ? arg1->HeadID - : select_psuedorandom_heads(bodyid); + : bodyChooseHead(bodyid); } sp38 = retrieve_header_for_body_and_head(bodyid, headid, (u32) arg1->bitflags); @@ -289,7 +289,7 @@ void expand_09_characters(s32 stageid, GuardRecord *arg1, s32 arg2) if (sp38 != 0) { sp3C = atan2f(pad->look.f[0], pad->look.f[2]); - temp_v0_4 = replace_GUARDdata_with_actual_values(sp38, (PadRecord *)&sp48, sp3C, sp54, ailistFindById(arg1->AIListID)); + temp_v0_4 = chrAllocate(sp38, (PadRecord *)&sp48, sp3C, sp54, ailistFindById(arg1->AIListID)); if (temp_v0_4 != 0) { @@ -327,13 +327,13 @@ void expand_09_characters(s32 stageid, GuardRecord *arg1, s32 arg2) * Address 0x7F023910. * dont think this is right, shouldnt it check for gun flags not chr? */ -u32 check_if_item_held_like_pistol(PropRecord *arg0) +u32 weaponIsOneHanded(PropRecord *arg0) { if (arg0 != NULL) { ChrRecord *v = (ChrRecord*)arg0->voidp; - return bondwalkItemCheckBitflags(v->act_bytes.padding[84], 0x100U); + return bondwalkItemCheckBitflags(v->act_bytes.padding[84], WEAPONSTATBITFLAG_ONLY_1_HANDED); } return 0U; @@ -355,8 +355,8 @@ void chrlvIdleAnimationRelated(ChrRecord *self, f32 duration) if ( ((left != NULL) && (right != NULL)) || ((left == NULL) && (right == NULL)) - || (check_if_item_held_like_pistol(left) != 0) - || (check_if_item_held_like_pistol(right) != 0)) + || (weaponIsOneHanded(left) != 0) + || (weaponIsOneHanded(right) != 0)) { modelSetAnimation(self->model, (void*)&ptr_animation_table->data[(s32)&ANIM_DATA_idle_unarmed], randomGetNext() & 1, 0, 0.25f, duration); modelSetAnimLooping(self->model, 0, 16.0f); @@ -384,41 +384,41 @@ void chrlvIdleAnimationRelated(ChrRecord *self, f32 duration) #define RATE 1.0f #endif -void chrlvIdleAnimationRelated7F023A94(ChrRecord *self, f32 arg1) +void chrlvIdleAnimationRelated7F023A94(ChrRecord *self, f32 mergetime) { - f32 f2; + f32 fsleep; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_STAND; - self->act_stand.unk02c = 0; + self->act_stand.prestand = 0; self->act_stand.face_entitytype = 0; self->act_stand.face_entityid = 0; - self->act_stand.unk038 = 0; - self->act_stand.unk03c = 2; - self->act_stand.unk040 = 0; + self->act_stand.reaim = 0; + self->act_stand.turning = 2; + self->act_stand.checkfacingwall = 0; //eu bug, doesnt use pal version of CHRLV_SEEN_RECENT_CHECK) + CHRLV_DEFAULT_TIMER; //so temp hardcoded to 120) + 180; - self->act_stand.unk044 = (randomGetNext() % (u32) 120) + 180; + self->act_stand.wallcount = (randomGetNext() % (u32) 120) + 180; - f2 = arg1; + fsleep = mergetime; - if (self->model->unka4 != RATE) + if (self->model->playspeed != RATE) { #if defined(BUGFIX_R1) - f2 *= (RATE / self->model->unka4); + fsleep *= (RATE / self->model->playspeed); #else - f2 = arg1 / self->model->unka4; + fsleep = mergetime / self->model->playspeed; #endif } - if (f2 > 127.0f) + if (fsleep > 127.0f) { - f2 = 127.0f; + fsleep = 127.0f; } - self->sleep = (s8) (s32) f2; - chrlvIdleAnimationRelated(self, arg1); + self->sleep = (s8) (s32) fsleep; + chrlvIdleAnimationRelated(self, mergetime); } @@ -476,22 +476,23 @@ f32 chrlvGetGuard007ArghRating(ChrRecord *self, f32 min, f32 max) /** * Address 0x7F023CB8. + * PD: chrStand */ void chrlvKneelingAnimationRelated(ChrRecord *self) { if (self->actiontype == ACT_KNEEL) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_STAND; - self->act_stand.unk02c = 1; + self->act_stand.prestand = 1; self->act_stand.face_entitytype = 0; self->act_stand.face_entityid = 0; - self->act_stand.unk038 = 0; - self->act_stand.unk03c = 2; - self->act_stand.unk040 = 0; + self->act_stand.reaim = 0; + self->act_stand.turning = 2; + self->act_stand.checkfacingwall = 0; // bug/typo??: this is the only code like this not adjusted for VERSION_EU - self->act_stand.unk044 = (randomGetNext() % 120) + 180; + self->act_stand.wallcount = (randomGetNext() % 120) + 180; self->sleep = 0; if ((s32)objecthandlerGetModelAnim(self->model) == (s32)&ANIM_DATA_fire_kneel_forward_one_handed_weapon_slow + (s32)&ptr_animation_table->data) @@ -515,11 +516,12 @@ void chrlvKneelingAnimationRelated(ChrRecord *self) /** * Address 0x7F023E14. + * PD: func0f02ed28 */ void chrlvIdleAnimationRelated7F023E14(ChrRecord *self, f32 arg1) { chrlvIdleAnimationRelated7F023A94(self, arg1); - self->act_stand.unk040 = 1; + self->act_stand.checkfacingwall = 1; } @@ -527,11 +529,12 @@ void chrlvIdleAnimationRelated7F023E14(ChrRecord *self, f32 arg1) /** * Address 0x7F023E48. + * PD: chrStop */ void chrlvKneelingAnimationRelated7F023E48(ChrRecord *self) { chrlvKneelingAnimationRelated(self); - self->act_stand.unk040 = 1; + self->act_stand.checkfacingwall = 1; } @@ -540,26 +543,27 @@ void chrlvKneelingAnimationRelated7F023E48(ChrRecord *self) /** * Address 0x7F023E74. + * PD: chrKneelChooseAnimation */ -void chrlvActorKneel(ChrRecord *self) +void chrKneelChooseAnimation(ChrRecord *self) { PropRecord *left; PropRecord *right; left = chrGetEquippedWeaponProp(self, GUNLEFT); right = chrGetEquippedWeaponProp(self, GUNRIGHT); - sub_GAME_7F02D184(self); + chrStopFiring(self); - if (((left != NULL) && (right != NULL)) - || ((left == NULL) && (right == NULL)) - || (check_if_item_held_like_pistol(left) != 0) - || (check_if_item_held_like_pistol(right) != 0)) + if ((left && right) + || (!left && !right) + || weaponIsOneHanded(left) + || weaponIsOneHanded(right)) { s32 r = randomGetNext() & 1; modelSetAnimation(self->model, (struct ModelAnimation*)&ptr_animation_table->data[(s32)&ANIM_DATA_fire_kneel_forward_one_handed_weapon_slow], r, 0.0f, chrlvGetGuard007SpeedRating(self, 0.5f, 0.8f), 16.0f); modelSetAnimEndFrame(self->model, 28.0f); } - else if ((right != NULL) || (left != NULL)) + else if (right || left) { modelSetAnimation(self->model, (struct ModelAnimation*)&ptr_animation_table->data[(s32)&ANIM_DATA_fire_kneel_left_leg], left != NULL, 0.0f, chrlvGetGuard007SpeedRating(self, 0.5f, 0.8f), 16.0f); modelSetAnimEndFrame(self->model, 27.0f); @@ -585,7 +589,7 @@ void chrlvPerformAnimationForActor(ChrRecord *self, s32 arg1, s32 arg2, s32 arg3 phi_f0 = -0.5f; } - sub_GAME_7F02D184(self); + chrStopFiring(self); modelSetAnimation(self->model, (void *) animation_table_ptrs1[arg1], (arg4 & 1) != 0, farg2, phi_f0, (f32)arg5); if (arg3 >= 0) @@ -623,32 +627,29 @@ void chrlvPerformAnimationForActor(ChrRecord *self, s32 arg1, s32 arg2, s32 arg3 * Extend left hand = ACT_STARTALARM. * * Address 0x7F024150. + * PD: chrStartAlarmChooseAnimation */ -void chrlvExtendLeftHandAnimationRelated(ChrRecord *self) +void chrStartAlarmChooseAnimation(ChrRecord *self) { - PropRecord *left; - PropRecord *right; - s32 phi_a2; + PropRecord *left = chrGetEquippedWeaponProp(self, GUNLEFT); + PropRecord *right = chrGetEquippedWeaponProp(self, GUNRIGHT); + bool flip = FALSE; - left = chrGetEquippedWeaponProp(self, GUNLEFT); - right = chrGetEquippedWeaponProp(self, GUNRIGHT); - - phi_a2 = 0; - if ((left != NULL) && (right == NULL)) + if (left && !right) { - phi_a2 = 1; + flip = TRUE; } - else if (((left != NULL) && (right != NULL)) || ((left == NULL) && (right == NULL))) + else if ((left && right) || (!left && !right)) { - phi_a2 = randomGetNext() & 1; + flip = randomGetNext() & 1; } - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_STARTALARM; self->sleep = 0; - modelSetAnimation(self->model, (void*)&ptr_animation_table->data[(s32)&ANIM_DATA_extending_left_hand], phi_a2, 40.0f, 1.0f, 16.0f); + modelSetAnimation(self->model, (void*)&ptr_animation_table->data[(s32)&ANIM_DATA_extending_left_hand], flip, 40.0f, 1.0f, 16.0f); modelSetAnimEndFrame(self->model, 82.0f); } @@ -656,10 +657,11 @@ void chrlvExtendLeftHandAnimationRelated(ChrRecord *self) /** * Address 0x7F024238. + * PD: chrThrowGrenade */ void chrlvThrowGrenadeAnimationRelated(ChrRecord *self, PropRecord *arg1, s32 arg2, s32 arg3) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_THROWGRENADE; self->sleep = 0; @@ -722,7 +724,7 @@ void chrlvActorShuffleFeet(ChrRecord *self) if ((temp_f0 < 0.17453294f) || (temp_f0 > 6.1086526f)) { chrlvSpotBondAnimationRelated(self, 16.0f); - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_SURPRISED; self->sleep = 0; @@ -742,7 +744,7 @@ void chrlvActorShuffleFeet(ChrRecord *self) */ void chrlvSurrenderAnimationRelated(ChrRecord *self) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_SURPRISED; self->sleep = 0; modelSetAnimation(self->model, (struct ModelAnimation*)&ptr_animation_table->data[(s32)&ANIM_DATA_surrendering_armed], randomGetNext() & 1, 0.0f, chrlvGetGuard007SpeedRating(self, 0.35f, 0.56f), 16.0f); @@ -753,6 +755,7 @@ void chrlvSurrenderAnimationRelated(ChrRecord *self) /** * Address 0x7F024548. + * PD: chrSurprisedChooseAnimation */ void chrlvActorLookFlustered(ChrRecord *self) { @@ -760,7 +763,7 @@ void chrlvActorLookFlustered(ChrRecord *self) sp2C = randomGetNext() % 3U; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_SURPRISED; self->sleep = 0; @@ -785,6 +788,7 @@ void chrlvActorLookFlustered(ChrRecord *self) /** * Address 0x7F024648. + * PD: chrSurrenderChooseAnimation */ void chrlvActorThrowWeaponSurrender(ChrRecord *self) { @@ -796,7 +800,7 @@ void chrlvActorThrowWeaponSurrender(ChrRecord *self) left = chrGetEquippedWeaponProp(self, GUNLEFT); right = chrGetEquippedWeaponProp(self, GUNRIGHT); - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_SURRENDER; @@ -839,7 +843,7 @@ void chrlvActorFadeAway(ChrRecord *self) { if (self->actiontype != ACT_DEAD) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_DEAD; self->act_dead.allowfade = -1; self->sleep = 0; @@ -851,6 +855,7 @@ void chrlvActorFadeAway(ChrRecord *self) /** * chrStepToSide * Address 0x7F024800. + * PD: chrSidestepChooseAnimation (Somewhat similar) */ void chrlvSideStepAnimationRelated(ChrRecord *self, GUNHAND side) { @@ -869,16 +874,16 @@ void chrlvSideStepAnimationRelated(ChrRecord *self, GUNHAND side) sp2C = randomGetNext() & 1; phi_v1 = randomGetNext() & 1; } - else if (check_if_item_held_like_pistol(left) == 0) + else if (weaponIsOneHanded(left) == 0) { - if ((check_if_item_held_like_pistol(right) == 0) && ((left != NULL) || (right != NULL))) + if ((weaponIsOneHanded(right) == 0) && ((left != NULL) || (right != NULL))) { sp2C = left != 0; phi_v1 = randomGetNext() & 1; } } - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_SIDESTEP; self->sleep = 0; @@ -920,6 +925,7 @@ void chrlvSideStepAnimationRelated(ChrRecord *self, GUNHAND side) /** * chrHopToSide * Address 0x7F024A84. + * PD: chrSidestepChooseAnimation (somewhat similar) */ void chrlvFireJumpToSideAnimationRelated(ChrRecord *self, GUNHAND side) { @@ -939,13 +945,13 @@ void chrlvFireJumpToSideAnimationRelated(ChrRecord *self, GUNHAND side) else if ( ((left != NULL) && (right != NULL)) || ((left == NULL) && (right == NULL)) - || (check_if_item_held_like_pistol(left) != 0) - || (check_if_item_held_like_pistol(right) != 0)) + || (weaponIsOneHanded(left) != 0) + || (weaponIsOneHanded(right) != 0)) { side2 = randomGetNext() & 1; } - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_JUMPOUT; self->sleep = 0; @@ -987,6 +993,7 @@ void chrlvFireJumpToSideAnimationRelated(ChrRecord *self, GUNHAND side) * // run to coord * Address 0x7F024CF8 (not EU). * Address 0x7F024CE0 (VERSION_EU). + * PD: chrJumpOutChooseAnimation (has a few things in common) */ void sub_GAME_7F024CF8(ChrRecord *self, coord3d *arg1) { @@ -1015,7 +1022,7 @@ void sub_GAME_7F024CF8(ChrRecord *self, coord3d *arg1) } else { - if ((check_if_item_held_like_pistol(left)) || (check_if_item_held_like_pistol(right))) + if ((weaponIsOneHanded(left)) || (weaponIsOneHanded(right))) { sp2C = 0; phi_a2 = left != 0; @@ -1026,7 +1033,7 @@ void sub_GAME_7F024CF8(ChrRecord *self, coord3d *arg1) } } - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_RUNPOS; self->act_runpos.pos.f[0] = arg1->f[0]; @@ -1060,7 +1067,7 @@ void sub_GAME_7F024CF8(ChrRecord *self, coord3d *arg1) void chrlvDeathStaggerAnimationRelated(ChrRecord *self) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_TEST; self->sleep = 0; modelSetAnimation(self->model, (struct ModelAnimation*)&ptr_animation_table->data[(s32)&ANIM_DATA_death_stagger_back_to_wall], 0, 10.0f, 0.5f, 16.0f); @@ -1371,7 +1378,7 @@ void sub_GAME_7F025560(ChrRecord *self, s32 attack_type, s32 arg2) } else { - if ((check_if_item_held_like_pistol(left) != 0) || (check_if_item_held_like_pistol(right) != 0)) + if ((weaponIsOneHanded(left) != 0) || (weaponIsOneHanded(right) != 0)) { last_arg2 = left != 0; animation_pointer = (struct anim_group_info **)ptr_pistol_firing_animation_groups; @@ -1443,7 +1450,7 @@ void sub_GAME_7F0256F0(ChrRecord *self, s32 attack_type, s32 arg2) } else { - if ((check_if_item_held_like_pistol(left) != 0) || (check_if_item_held_like_pistol(right) != 0)) + if ((weaponIsOneHanded(left) != 0) || (weaponIsOneHanded(right) != 0)) { last_arg2 = left != 0; animation_pointer = (struct anim_group_info **)ptr_crouched_pistol_firing_animation_groups; @@ -1557,7 +1564,7 @@ void chrlvInitActAttackWalk(ChrRecord *chr, s32 arg1) sp70.p[0] = 1; } } - else if (check_if_item_held_like_pistol(left) || check_if_item_held_like_pistol(right)) + else if (weaponIsOneHanded(left) || weaponIsOneHanded(right)) { sp78 = (s32)left != 0; @@ -1706,7 +1713,7 @@ void chrlvInitActAttackRoll(ChrRecord *chr, GUNHAND side) sp64.p[0] = sp7C == 0; } } - else if (check_if_item_held_like_pistol(left) || check_if_item_held_like_pistol(right)) + else if (weaponIsOneHanded(left) || weaponIsOneHanded(right)) { sp7C = (s32)left != 0; sp78 = 1; @@ -1991,10 +1998,10 @@ f32 chrlvPathingCollisionRelated(PropRecord *arg0, f32 arg1, f32 arg2, s32 objFl dest_x = arg0->pos.f[0] + (sp5C.f[0] * arg2); dest_z = arg0->pos.f[2] + (sp5C.f[2] * arg2); - set_or_unset_GUARDdata_flag(chr, 0); + chrSetMoving(chr, 0); sub_GAME_7F0B1CC4(); - if (sub_GAME_7F0B0E24(&stan, arg0->pos.f[0], arg0->pos.f[2], dest_x, dest_z, objFlags, unkHeight, unkA, 0.0f, 1.0f) != 0) + if (stanTestLineUnobstructed(&stan, arg0->pos.f[0], arg0->pos.f[2], dest_x, dest_z, objFlags, unkHeight, unkA, 0.0f, 1.0f) != 0) { ret = arg2; } @@ -2006,7 +2013,7 @@ f32 chrlvPathingCollisionRelated(PropRecord *arg0, f32 arg1, f32 arg2, s32 objFl ret = sqrtf((dest_x * dest_x) + (dest_z * dest_z)); } - set_or_unset_GUARDdata_flag(chr, 1); + chrSetMoving(chr, 1); return ret; } @@ -2109,7 +2116,7 @@ void triggered_on_shot_hit(ChrRecord *self, coord3d *arg1, f32 arg2, s32 req_ani { struck_ani = &D_8002DEBC[randomGetNext() & 1]; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_DIE; self->act_die.notifychrindex = 0; self->act_die.thudframe1 = struck_ani->sfx1_timer_60; @@ -2148,7 +2155,7 @@ void triggered_on_shot_hit(ChrRecord *self, coord3d *arg1, f32 arg2, s32 req_ani tr = (randomGetNext() % (u32)D_8002C914[animation_something_index].field_20); struck_anib = &D_8002C914[animation_something_index].field_1C[tr]; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_DIE; self->act_die.notifychrindex = 0; @@ -2199,7 +2206,7 @@ void triggered_on_shot_hit(ChrRecord *self, coord3d *arg1, f32 arg2, s32 req_ani if ((req_animation_id == 7) && (arg2 > 2.3561945f) && (arg2 < 3.926991f) && ((u32) (randomGetNext() % (u32)5) < 2U)) { u32 sp54 = randomGetNext() % (u32)5; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_ARGH; self->act_argh.notifychrindex = 0; self->act_argh.unk30 = g_GlobalTimer; @@ -2271,7 +2278,7 @@ void triggered_on_shot_hit(ChrRecord *self, coord3d *arg1, f32 arg2, s32 req_ani tr = (randomGetNext() % (u32) something_ani->field_28); struck_ani = &something_ani->field_24[tr]; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_ARGH; self->act_argh.notifychrindex = 0; @@ -2395,7 +2402,7 @@ void play_sound_for_shot_actor(ChrRecord *self) static s32 male_guard_yelp_counter = 0; static s32 female_guard_yelp_counter = 0; - if ((self->prop->type != PROP_TYPE_VIEWER) || (g_playerPointers[sub_GAME_7F09B15C(self->prop)]->bonddead == 0)) + if ((self->prop->type != PROP_TYPE_VIEWER) || (g_playerPointers[getPlayerPointerIndex(self->prop)]->bonddead == 0)) { /* * decomp issue: mystery section. @@ -2413,7 +2420,7 @@ void play_sound_for_shot_actor(ChrRecord *self) } else { - if (get_player_mp_char_gender(sub_GAME_7F09B15C(self->prop)) != 0) + if (get_player_mp_char_gender(getPlayerPointerIndex(self->prop)) != 0) { male = 1; } @@ -2457,7 +2464,7 @@ void play_sound_for_shot_actor(ChrRecord *self) } } - sub_GAME_7F053A10(sndstate, &self->prop->pos); + chrobjSndCreatePostEventDefault(sndstate, &self->prop->pos); } } #else @@ -2474,7 +2481,7 @@ glabel play_sound_for_shot_actor /* 05BBAC 7F02707C 00A02025 */ move $a0, $a1 /* 05BBB0 7F027080 55E1000C */ bnel $t7, $at, .L7F0270B4 /* 05BBB4 7F027084 8FA90068 */ lw $t1, 0x68($sp) -/* 05BBB8 7F027088 0FC26C57 */ jal sub_GAME_7F09B15C +/* 05BBB8 7F027088 0FC26C57 */ jal getPlayerPointerIndex /* 05BBBC 7F02708C AFA00060 */ sw $zero, 0x60($sp) /* 05BBC0 7F027090 0002C080 */ sll $t8, $v0, 2 /* 05BBC4 7F027094 3C198008 */ lui $t9, %hi(g_playerPointers) @@ -2512,7 +2519,7 @@ glabel play_sound_for_shot_actor .L7F027110: /* 05BC40 7F027110 8FB80068 */ lw $t8, 0x68($sp) /* 05BC44 7F027114 8F040018 */ lw $a0, 0x18($t8) -/* 05BC48 7F027118 0FC26C57 */ jal sub_GAME_7F09B15C +/* 05BC48 7F027118 0FC26C57 */ jal getPlayerPointerIndex /* 05BC4C 7F02711C AFA30060 */ sw $v1, 0x60($sp) /* 05BC50 7F027120 0FC040C3 */ jal get_player_mp_char_gender /* 05BC54 7F027124 00402025 */ move $a0, $v0 @@ -2600,7 +2607,7 @@ glabel play_sound_for_shot_actor .L7F02725C: /* 05BD8C 7F02725C 8FAF0068 */ lw $t7, 0x68($sp) /* 05BD90 7F027260 8DE50018 */ lw $a1, 0x18($t7) -/* 05BD94 7F027264 0FC14E84 */ jal sub_GAME_7F053A10 +/* 05BD94 7F027264 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 05BD98 7F027268 24A50008 */ addiu $a1, $a1, 8 /* 05BD9C 7F02726C 8FBF0014 */ lw $ra, 0x14($sp) .L7F027270: @@ -2639,7 +2646,7 @@ bool handles_shot_actors(ChrRecord *self, s32 hitpart, coord3d *vector, s32 weap { s16 mrs[3] = metal_ricochet_SFX; ALSoundState * p = sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, mrs[randomGetNext() % 3U], NULL); - sub_GAME_7F053A10(p, &self->prop->pos); + chrobjSndCreatePostEventDefault(p, &self->prop->pos); } } @@ -2766,7 +2773,7 @@ bool handles_shot_actors(ChrRecord *self, s32 hitpart, coord3d *vector, s32 weap if (self->prop->type == PROP_TYPE_VIEWER) { playerNum = get_cur_playernum(); - set_cur_player(sub_GAME_7F09B15C(self->prop)); + set_cur_player(getPlayerPointerIndex(self->prop)); record_damage_kills(damageToCause * 0.125f, vector->x, vector->z, playerNum, 1); set_cur_player(playerNum); } @@ -2904,7 +2911,7 @@ s32 chrlvExplosionDamage(ChrRecord *self, coord3d *arg1, f32 damage, s32 arg3) explosion_animation_table[sp40].table[t] ]; - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_DIE; self->act_die.notifychrindex = 0; @@ -3138,6 +3145,7 @@ s32 chrlvStanRoomRelatedPad(ChrRecord *self, PadRecord *arg1) /** * Address 0x7F027E90. + * PD: chrGoPosInitMagic */ void chrlvSetGoposSegDistTotal(ChrRecord *self, struct waydata *arg1, coord3d *arg2) { @@ -3166,23 +3174,24 @@ void chrlvSetGoposSegDistTotal(ChrRecord *self, struct waydata *arg1, coord3d *a * @param target_stan: out parameter, will contain pointer to target stan * * Address 0x7F027F20. + * PD: chrGoPosGetCurWaypointInfoWithFlags (somewhat similar) */ void chrlvActGoposRelated(ChrRecord *self, coord3d *target_point, StandTile **target_stan) { - waypoint *temp_v0; - PadRecord *temp_v1; + waypoint *waypoint; + PadRecord *pad; - temp_v0 = self->act_gopos.waypoints[self->act_gopos.curindex]; + waypoint = self->act_gopos.waypoints[self->act_gopos.curindex]; - if (temp_v0 != 0) + if (waypoint != 0) { - temp_v1 = &g_CurrentSetup.pads[temp_v0->padID]; + pad = &g_CurrentSetup.pads[waypoint->padID]; - target_point->f[0] = temp_v1->pos.f[0]; - target_point->f[1] = temp_v1->pos.f[1]; - target_point->f[2] = temp_v1->pos.f[2]; + target_point->f[0] = pad->pos.f[0]; + target_point->f[1] = pad->pos.f[1]; + target_point->f[2] = pad->pos.f[2]; - *target_stan = temp_v1->stan; + *target_stan = pad->stan; } else { @@ -3198,6 +3207,7 @@ void chrlvActGoposRelated(ChrRecord *self, coord3d *target_point, StandTile **ta /** * Address 0x7F027FA8. + * PD: func0f0370a8 (but GE has much more cases) */ f32 chrlvModelScaleAnimationRelated(ChrRecord *self) { @@ -3247,6 +3257,7 @@ f32 chrlvModelScaleAnimationRelated(ChrRecord *self) /** * Address 0x7F028144. + * PD: chrGoPosCalculateBaseTtl */ s32 chrlvMovementTargetRelated(ChrRecord *self) { @@ -3280,6 +3291,7 @@ s32 chrlvMovementTargetRelated(ChrRecord *self) /** * Address 0x7F0281F4. + * PD: chrGoPosClearRestartTtl */ void sub_GAME_7F0281F4(ChrRecord *self) { @@ -3290,6 +3302,7 @@ void sub_GAME_7F0281F4(ChrRecord *self) /** * Address 0x7F0281FC (US,JP) * Address 0x7F028214 (VERSION_EU) + * PD: chrGoPosConsiderRestart */ void chrlvPlotCourseRelated(ChrRecord *self) { @@ -3336,6 +3349,7 @@ void chrlvPlotCourseRelated(ChrRecord *self) /** * Address 0x7F02828C. + * PD: chrGoPosInitExpensive */ void chrlvActGoposSetTargetPosRelated(ChrRecord *self) { @@ -3359,6 +3373,7 @@ void chrlvActGoposSetTargetPosRelated(ChrRecord *self) /** * Address 0x7F0282E0. + * PD: chrGoPosAdvanceWaypoint */ void chrlvActGoposIncCurIndex(ChrRecord *self) { @@ -3459,6 +3474,7 @@ s32 chrlvPatrolCalculateStep(ChrRecord *self, bool *forward, s32 numsteps) /** * Address 0x7F0283FC. + * PD: chrPatrolCalculatePadNum (had some nice finds when searching for "patrol" in "chraction.c" in PD) */ // notes: 99.33% match, only failing regalloc on a single line PadRecord *chrlvGetPatrolStepPad(ChrRecord *self, s32 numsteps) @@ -3567,7 +3583,7 @@ s32 sub_GAME_7F028510(coord3d *arg0, StandTile *arg1) roomids[0] = arg1->room; roomids[1] = -1; - sub_GAME_7F03E3FC((s32*)&roomids); + roomGetProps((s32*)&roomids); for (temp_s0 = ptr_list_object_lookup_indices; *temp_s0 >= 0; temp_s0++) { @@ -3619,10 +3635,10 @@ void chrlvTravelTickMagic(ChrRecord *self, struct waydata *arg1, f32 arg2, coord if (arg1->segdisttotal <= arg1->segdistdone) { - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); if ( - (sub_GAME_7F0B18B8(&arg4, arg3->f[0], arg3->f[2], self->chrwidth, 0x1F, 0.0f, 1.0f) < 0) + (stanTestVolume(&arg4, arg3->f[0], arg3->f[2], self->chrwidth, 0x1F, 0.0f, 1.0f) < 0) && sub_GAME_7F028510(arg3, arg4)) { self_prop = self->prop; @@ -3683,7 +3699,7 @@ void chrlvTravelTickMagic(ChrRecord *self, struct waydata *arg1, f32 arg2, coord } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); } } @@ -3783,7 +3799,7 @@ void get_sound_at_range(ChrRecord *self, s32 arg1, s32 arg2) else { s32 t; - if (check_if_item_held_like_pistol(left) || check_if_item_held_like_pistol(right)) + if (weaponIsOneHanded(left) || weaponIsOneHanded(right)) { t = 0; flag = t; @@ -3888,7 +3904,7 @@ s32 plot_course_for_actor(ChrRecord *self, coord3d *arg1, StandTile *stan, SPEED && !(waypointFindRoute(prop_waypoint, target_waypoint, (waypoint **)&sp44, MAX_CHRWAYPOINTS) < 2) ) { - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_GOPOS; @@ -3954,7 +3970,7 @@ void chrlvWalkingAnimationRelated(ChrRecord *self) else { s32 t; - if (check_if_item_held_like_pistol(left) || check_if_item_held_like_pistol(right)) + if (weaponIsOneHanded(left) || weaponIsOneHanded(right)) { t = 0; flag = t; @@ -4026,7 +4042,7 @@ void set_actor_on_path(ChrRecord *self, struct patrol_path *path) next_step = 0; } - sub_GAME_7F02D184(self); + chrStopFiring(self); self->actiontype = ACT_PATROL; self->act_patrol.path = path; @@ -4122,7 +4138,7 @@ glabel set_actor_on_path /* 05DD08 7F0291D8 02002025 */ move $a0, $s0 /* 05DD0C 7F0291DC 00006025 */ move $t4, $zero .L7F0291E0: -/* 05DD10 7F0291E0 0FC0B461 */ jal sub_GAME_7F02D184 +/* 05DD10 7F0291E0 0FC0B461 */ jal chrStopFiring /* 05DD14 7F0291E4 AFAC0020 */ sw $t4, 0x20($sp) /* 05DD18 7F0291E8 8FAC0020 */ lw $t4, 0x20($sp) /* 05DD1C 7F0291EC 240F000E */ li $t7, 14 @@ -4210,7 +4226,7 @@ s32 chrlvAttackRelated7F0292A8(ChrRecord *self, coord3d *arg1, StandTile *arg2) { stan = arg2; sp3C = chrlvGetChrOrPresetLocation(self, flags, self->act_attack.entityid, &sp40); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); if ((flags & 1) != 0) { @@ -4218,7 +4234,7 @@ s32 chrlvAttackRelated7F0292A8(ChrRecord *self, coord3d *arg1, StandTile *arg2) if (bondviewGetVisibleToGuardsFlag() != 0) { - if ((sub_GAME_7F0B0E24(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x11B, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) + if ((stanTestLineUnobstructed(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x11B, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) { setSeenBondTimeToNow(self); ret = 1; @@ -4229,20 +4245,20 @@ s32 chrlvAttackRelated7F0292A8(ChrRecord *self, coord3d *arg1, StandTile *arg2) } else if ((flags & 4) != 0) { - if ((sub_GAME_7F0B0E24(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x117, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) + if ((stanTestLineUnobstructed(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x117, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) { ret = 1; } } else if ((flags & 8) != 0) { - if ((sub_GAME_7F0B0E24(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x11F, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) + if ((stanTestLineUnobstructed(&stan, arg1->x, arg1->f[2], sp3C->x, sp3C->f[2], 0x11F, arg1->f[1], arg1->f[1], sp3C->f[1], sp3C->f[1]) != 0) && (stan == sp40)) { ret = 1; } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); } return ret; @@ -4268,18 +4284,18 @@ bool chrCanSeeBond(ChrRecord *self) bondprop = get_curplayer_positiondata(); myheight = self->chrheight - 20.0f; - set_or_unset_GUARDdata_flag(self, FALSE); + chrSetMoving(self, FALSE); bondviewUpdateGuardTankFlagsRelated(g_CurrentPlayer->prop, 0); mystan = myprop->stan; - if (sub_GAME_7F0B0E24(&mystan, myprop->pos.x, myprop->pos.z, bondprop->pos.x, bondprop->pos.z, 0x11B, myheight, myheight, 0.0f, 1.0f) && (mystan == bondprop->stan)) + if (stanTestLineUnobstructed(&mystan, myprop->pos.x, myprop->pos.z, bondprop->pos.x, bondprop->pos.z, 0x11B, myheight, myheight, 0.0f, 1.0f) && (mystan == bondprop->stan)) { setSeenBondTimeToNow(self); pass = TRUE; } - set_or_unset_GUARDdata_flag(self, TRUE); + chrSetMoving(self, TRUE); bondviewUpdateGuardTankFlagsRelated(g_CurrentPlayer->prop, 1); } @@ -4299,16 +4315,16 @@ bool check_if_position_in_same_room(ChrRecord *self, coord3d *pos, StandTile *st f32 myheight = self->chrheight - 20.0f; bool pass = FALSE; - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); propstan = myprop->stan; - if (sub_GAME_7F0B0E24(&propstan, myprop->pos.x, myprop->pos.z, pos->x, pos->z, 0x113, myheight, myheight, 0.0f, 1.0f) && (propstan == stan)) + if (stanTestLineUnobstructed(&propstan, myprop->pos.x, myprop->pos.z, pos->x, pos->z, 0x113, myheight, myheight, 0.0f, 1.0f) && (propstan == stan)) { pass = TRUE; } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return pass; } @@ -4362,7 +4378,7 @@ s32 chrlvCurrentPlayerCall7F0B0E24(ChrRecord *self) bond_stan = bond_prop->stan; - if ((sub_GAME_7F0B0E24( + if ((stanTestLineUnobstructed( &bond_stan, bond_prop->pos.f[0], bond_prop->pos.f[2], @@ -4410,7 +4426,7 @@ s32 chrlvCall7F0B0E24WithChrWidthHeight(PropRecord *arg0, coord3d *arg1, coord3d ret = 0; chrGetChrWidthHeight(arg0, &sp50, &sp58, &sp54); - set_or_unset_GUARDdata_flag(sp7C, 0); + chrSetMoving(sp7C, 0); sp78 = arg0->pos.f[0] + chrz; sp74 = arg0->pos.f[2] - chrx; @@ -4420,8 +4436,8 @@ s32 chrlvCall7F0B0E24WithChrWidthHeight(PropRecord *arg0, coord3d *arg1, coord3d stan = arg0->stan; if ( - (sub_GAME_7F0B0E24(&stan, arg0->pos.f[0], arg0->pos.f[2], sp78, sp74, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) - && (sub_GAME_7F0B0E24(&stan, sp78, sp74, sp70, sp6C, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) + (stanTestLineUnobstructed(&stan, arg0->pos.f[0], arg0->pos.f[2], sp78, sp74, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) + && (stanTestLineUnobstructed(&stan, sp78, sp74, sp70, sp6C, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) ) { sp78 = arg0->pos.f[0] - chrz; @@ -4433,15 +4449,15 @@ s32 chrlvCall7F0B0E24WithChrWidthHeight(PropRecord *arg0, coord3d *arg1, coord3d stan = arg0->stan; if ( - (sub_GAME_7F0B0E24(&stan, arg0->pos.f[0], arg0->pos.f[2], sp78, sp74, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) - && (sub_GAME_7F0B0E24(&stan, sp78, sp74, sp70, sp6C, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) + (stanTestLineUnobstructed(&stan, arg0->pos.f[0], arg0->pos.f[2], sp78, sp74, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) + && (stanTestLineUnobstructed(&stan, sp78, sp74, sp70, sp6C, 0x1F, sp58, sp54, 0.0f, 1.0f) != 0) ) { ret = 1; } } - set_or_unset_GUARDdata_flag(sp7C, 1); + chrSetMoving(sp7C, 1); return ret; } @@ -4539,7 +4555,7 @@ void chrlvAlertGuardToPlayerPosition(ChrRecord *self) */ bool chrHasStoppedOrPatroling(ChrRecord *self) //chrHasStoppedOrPatroling { - if ((self->actiontype == ACT_STAND) && !self->act_stand.unk02c && !self->act_stand.unk038) + if ((self->actiontype == ACT_STAND) && !self->act_stand.prestand && !self->act_stand.reaim) { return TRUE; } @@ -5124,7 +5140,9 @@ bool actor_kneel_aim_at_actor(ChrRecord *self, s32 targettype, s32 targetid) - +/** + * Address 0x7F02AAF4 +*/ bool actor_fire_or_aim_at_target_update(ChrRecord *self, s32 newtargettype, s32 newtargetid) { if (self->actiontype == ACT_ATTACK) @@ -5156,8 +5174,8 @@ bool check_set_actor_standing_still(ChrRecord *self, s32 faceentitytype, s32 fac self->act_stand.face_entitytype = faceentitytype; self->act_stand.face_entityid = faceentityid; - self->act_stand.unk038 = 0; - self->act_stand.unk040 = 0; + self->act_stand.reaim = 0; + self->act_stand.checkfacingwall = 0; return TRUE; } @@ -5261,13 +5279,13 @@ void chrlvTickStand(ChrRecord *self) return; } - if (self->act_stand.unk02c != 0) + if (self->act_stand.prestand != 0) { // needs to save $f0 into sp(0x3c) if (objecthandlerGetModelField28(self->model) >= sub_GAME_7F06F5C4(self->model)) { chrlvIdleAnimationRelated(self, 8.0f); - self->act_stand.unk02c = 0; + self->act_stand.prestand = 0; } self->sleep = 0; @@ -5277,15 +5295,15 @@ void chrlvTickStand(ChrRecord *self) if (self->act_stand.face_entitytype > 0) { - if (self->act_stand.unk038) + if (self->act_stand.reaim) { subrotyarg2 = objecthandlerGetModelAnim(self->model)->unk04 - 1; - self->act_stand.unk03c = chrlvSetSubroty(self, self->act_stand.unk03c, subrotyarg2, 1.0f, 0.0f); + self->act_stand.turning = chrlvSetSubroty(self, self->act_stand.turning, subrotyarg2, 1.0f, 0.0f); - if (self->act_stand.unk03c != 1) + if (self->act_stand.turning != 1) { chrlvIdleAnimationRelated(self, 8.0f); - self->act_stand.unk038 = 0; + self->act_stand.reaim = 0; if (self->act_stand.face_entitytype & 0x10) { @@ -5301,13 +5319,13 @@ void chrlvTickStand(ChrRecord *self) left = chrGetEquippedWeaponProp(self, 1); right = chrGetEquippedWeaponProp(self, 0); - self->act_stand.unk038 = 1; - self->act_stand.unk03c = 1; + self->act_stand.reaim = 1; + self->act_stand.turning = 1; if (((left != NULL) && (right != NULL)) || ((left == NULL) && (right == NULL)) - || check_if_item_held_like_pistol(left) - || check_if_item_held_like_pistol(right)) + || weaponIsOneHanded(left) + || weaponIsOneHanded(right)) { // required to fix stack above // looks like it doesn't matter which `s32` is used. @@ -5354,16 +5372,16 @@ void chrlvTickStand(ChrRecord *self) self->sleep = ((u32)randomGetNext() % 5U) + 0xE; - if (self->act_stand.unk040) + if (self->act_stand.checkfacingwall) { if (self->chrflags & 0x80) { - self->act_stand.unk040 = 0; + self->act_stand.checkfacingwall = 0; return; } - self->act_stand.unk044 -= self->sleep; - if (self->act_stand.unk044 < 0) + self->act_stand.wallcount -= self->sleep; + if (self->act_stand.wallcount < 0) { subroty = getsubroty(self->model); @@ -5450,7 +5468,7 @@ void chrlvTickStand(ChrRecord *self) } else { - self->act_stand.unk040 = 0; + self->act_stand.checkfacingwall = 0; } } } @@ -5488,7 +5506,7 @@ void chrlvTickAnim(ChrRecord *self) { if (((D_80048380 & 1) == 0) && (chrGetDistanceToBond(self) < 800.0f)) { - sub_GAME_7F053A10(sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 0x101, 0), &self->prop->pos); + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 0x101, 0), &self->prop->pos); } self->chrflags |= 0x2000000; @@ -5596,7 +5614,7 @@ void chrlvIterateGuardSeeShotDie(ChrRecord *self, s32 flag) for (; i < numguards && alert_count < 4; i++) { - guard = &ptr_guard_data[i]; + guard = &g_ChrSlots[i]; if (guard->model != NULL) { @@ -5656,7 +5674,7 @@ void chrlvTickDie(ChrRecord *self) { p = sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, body_hit_SFX[thud_index], NULL); - sub_GAME_7F053A10(p, &self->prop->pos); + chrobjSndCreatePostEventDefault(p, &self->prop->pos); thud_index++; if (thud_index >= 0xB) @@ -5671,7 +5689,7 @@ void chrlvTickDie(ChrRecord *self) { p = sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, body_hit_SFX[thud_index], NULL); - sub_GAME_7F053A10(p, &self->prop->pos); + chrobjSndCreatePostEventDefault(p, &self->prop->pos); thud_index++; if (thud_index >= 0xB) @@ -5947,7 +5965,7 @@ void sub_GAME_7F02BFE4(ChrRecord *self, s32 arg1, s32 arg2) // if (phi_a2 != NULL) // { // sndPlaySfx(g_musicSfxBufferPtr, (s16) sp30, phi_a2); - // sub_GAME_7F053A10(phi_a2, &self->prop->pos); + // chrobjSndCreatePostEventDefault(phi_a2, &self->prop->pos); // self->field_178[arg1] = g_GlobalTimer + sp33; // self->hidden |= 0x80; @@ -6059,7 +6077,7 @@ glabel sub_GAME_7F02BFE4 /* 060C74 7F02C144 8FA6002C */ lw $a2, 0x2c($sp) /* 060C78 7F02C148 8E050018 */ lw $a1, 0x18($s0) /* 060C7C 7F02C14C 8CC40000 */ lw $a0, ($a2) -/* 060C80 7F02C150 0FC14E84 */ jal sub_GAME_7F053A10 +/* 060C80 7F02C150 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 060C84 7F02C154 24A50008 */ addiu $a1, $a1, 8 /* 060C88 7F02C158 3C0C8005 */ lui $t4, %hi(g_GlobalTimer) /* 060C8C 7F02C15C 8D8C837C */ lw $t4, %lo(g_GlobalTimer)($t4) @@ -6173,9 +6191,9 @@ s32 chrlvSetSubroty(ChrRecord *self, s32 arg1, f32 arg2, f32 arg3, f32 arg4) roty = getsubroty(model); #if defined(BUGFIX_R1) - temp_f14 = 0.06283186f * arg3 * g_JP_GlobalTimerDelta * model->unka4; + temp_f14 = 0.06283186f * arg3 * g_JP_GlobalTimerDelta * model->playspeed; #else /* VERSION_US */ - temp_f14 = 0.06283186f * arg3 * g_GlobalTimerDelta * model->unka4; + temp_f14 = 0.06283186f * arg3 * g_GlobalTimerDelta * model->playspeed; #endif if (self->actiontype == ACT_ATTACK) @@ -6434,7 +6452,7 @@ s32 chrlvUpdateAimendsideback(ChrRecord *self, struct weapon_firing_animation_ta if (weapon_prop_model->obj->Switches[0]) { - temp_a0 = sub_GAME_7F06C660(weapon_prop_model, weapon_prop_model->obj->Switches[0], 0); + temp_a0 = modelFindNodeMtx(weapon_prop_model, weapon_prop_model->obj->Switches[0], 0); spB8 = weapon_prop_model->obj->Switches[0]->Data; sub_GAME_7F058E78(temp_a0, &spBC); @@ -6444,7 +6462,7 @@ s32 chrlvUpdateAimendsideback(ChrRecord *self, struct weapon_firing_animation_ta spAC.f[1] = spB8[1]; spAC.f[2] = spB8[2]; - matrix_4x4_transform_vector_in_place(&spBC, &spAC); + mtx4TransformVecInPlace(&spBC, &spAC); sp104.f[0] = spAC.f[0]; sp104.f[1] = spAC.f[1]; @@ -6454,7 +6472,7 @@ s32 chrlvUpdateAimendsideback(ChrRecord *self, struct weapon_firing_animation_ta } else if (weapon_prop_model->obj->Switches[1]) { - temp_a0 = sub_GAME_7F06C660(weapon_prop_model, weapon_prop_model->obj->Switches[1], 0); + temp_a0 = modelFindNodeMtx(weapon_prop_model, weapon_prop_model->obj->Switches[1], 0); sub_GAME_7F058E78(temp_a0, &sp68); matrix_4x4_multiply_homogeneous_in_place(currentPlayerGetMatrix10EC(), &sp68); sp104.f[0] = sp68.m[3][0]; @@ -6505,7 +6523,7 @@ s32 chrlvUpdateAimendsideback(ChrRecord *self, struct weapon_firing_animation_ta if ((attack_type & 1) && ((attack_type & 0x60) == 0)) { - t1 = (((f32) ((s32) ((s32) ((f32) g_GlobalTimer * self->model->unka4) + self->chrnum) % 60) * M_TAU_F) / 60.0f); + t1 = (((f32) ((s32) ((s32) ((f32) g_GlobalTimer * self->model->playspeed) + self->chrnum) % 60) * M_TAU_F) / 60.0f); t1 = sinf(t1) * (chrlvGetAimLimitAngle(dxdydz_square) * 0.5f); calc_aimendsideback += t1; @@ -6657,16 +6675,17 @@ void chrlvResetAimend(ChrRecord *self) /** * Address 0x7F02D118. + * PD: chrSetFiring */ -void sub_GAME_7F02D118(ChrRecord *self, s32 hand, s32 arg2) +void chrSetFiring(ChrRecord *self, s32 hand, s32 firing) { - PropRecord *temp_v0; + PropRecord *prop; - temp_v0 = chrGetEquippedWeaponProp(self, hand); + prop = chrGetEquippedWeaponProp(self, hand); - if (temp_v0 != NULL) + if (prop != NULL) { - sub_GAME_7F052574(temp_v0, arg2); + weaponSetGunfireVisible(prop, firing); } } @@ -6679,13 +6698,13 @@ void sub_GAME_7F02D118(ChrRecord *self, s32 hand, s32 arg2) */ s32 sub_GAME_7F02D148(ChrRecord *self, s32 hand) { - PropRecord *temp_v0; + PropRecord *prop; - temp_v0 = chrGetEquippedWeaponProp(self, hand); + prop = chrGetEquippedWeaponProp(self, hand); - if (temp_v0 != NULL) + if (prop != NULL) { - return sub_GAME_7F052604(temp_v0); + return weaponIsGunfireVisible(prop); } return 0; @@ -6694,11 +6713,12 @@ s32 sub_GAME_7F02D148(ChrRecord *self, s32 hand) /** * Address 0x7F02D184. + * PD: chrStopFiring */ -void sub_GAME_7F02D184(ChrRecord *self) +void chrStopFiring(ChrRecord *self) { - sub_GAME_7F02D118(self, GUNRIGHT, 0); - sub_GAME_7F02D118(self, GUNLEFT, 0); + chrSetFiring(self, GUNRIGHT, FALSE); + chrSetFiring(self, GUNLEFT, FALSE); chrlvResetAimend(self); } @@ -6730,7 +6750,7 @@ void chrlvToggleHiddenRelated(ChrRecord *self, s32 hand, s32 arg2) if (arg2 == 0) { - sub_GAME_7F02D118(self, hand, 0); + chrSetFiring(self, hand, FALSE); } } @@ -6927,7 +6947,7 @@ s32 sub_GAME_7F02D630(ChrRecord *self, GUNHAND hand, coord3d *arg2) { if (weapon_prop_model->obj->Switches[0]) { - temp_a0 = sub_GAME_7F06C660(weapon_prop_model, weapon_prop_model->obj->Switches[0], 0); + temp_a0 = modelFindNodeMtx(weapon_prop_model, weapon_prop_model->obj->Switches[0], 0); spB8 = weapon_prop_model->obj->Switches[0]->Data; arg2->f[0] = spB8[0]; @@ -6935,13 +6955,13 @@ s32 sub_GAME_7F02D630(ChrRecord *self, GUNHAND hand, coord3d *arg2) arg2->f[2] = spB8[2]; matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), temp_a0, &sp74); - matrix_4x4_transform_vector_in_place(&sp74, arg2); + mtx4TransformVecInPlace(&sp74, arg2); ret = 1; } else if (weapon_prop_model->obj->Switches[1]) { - temp_a0_2 = sub_GAME_7F06C660(weapon_prop_model, weapon_prop_model->obj->Switches[1], 0); + temp_a0_2 = modelFindNodeMtx(weapon_prop_model, weapon_prop_model->obj->Switches[1], 0); matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), temp_a0_2, &sp68); arg2->f[0] = sp68.m[3][0]; @@ -6976,13 +6996,13 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) StandTile *sp254; // 596 f32 subroty; // 592 f32 sp24C; // 588 - coord3d sp240; // 576 + coord3d sp240; // 576 StandTile *self_stan; // 572 StandTile *sp238; // 568 s32 sp234; // 564 s32 sp230; // 560 s32 sp22C; // 556 - coord3d sp220; + coord3d sp220; s32 sp21C; f32 dy; f32 dz; @@ -6990,18 +7010,18 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) f32 sp20C; // 524 struct WeaponObjRecord *sp208; Mtxf sp1C8; - coord3d sp1BC; // 444 + coord3d sp1BC; // 444 PropRecord *weapon_prop; - coord3d sp1AC; // 428 + coord3d sp1AC; // 428 Mtxf sp16C; Mtxf sp12C; struct WeaponObjRecord *sp128; // 296 Mtxf spE8; - coord3d spDC; // 220 + coord3d spDC; // 220 Mtxf sp9C; Mtxf sp5C; // 92 s32 sp44; - struct ObjectRecord_f6c * temp_v0_4; + s32 unused; f32 sp4C; self_prop = self->prop; @@ -7078,7 +7098,7 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) } } - if (sub_GAME_7F0B0E24(&self_stan, self_prop->pos.x, self_prop->pos.f[2], sp240.f[0], sp240.f[2], 2, sp240.f[1] - self->ground, sp240.f[1] - self->ground, 0.0f, 1.0f) != 0) + if (stanTestLineUnobstructed(&self_stan, self_prop->pos.x, self_prop->pos.f[2], sp240.f[0], sp240.f[2], 2, sp240.f[1] - self->ground, sp240.f[1] - self->ground, 0.0f, 1.0f) != 0) { sp238 = self_stan; } @@ -7104,11 +7124,11 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) sp258.f[1] = sp240.f[1] + (sp220.f[1] * M_U16_MAX_VALUE_F); sp258.f[2] = sp240.f[2] + (sp220.f[2] * M_U16_MAX_VALUE_F); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); sub_GAME_7F0B1CC4(); self_stan = sp238; - if (sub_GAME_7F0B0E24(&self_stan, sp240.f[0], sp240.f[2], sp258.f[0], sp258.f[2], 0x1B, sp240.f[1], sp240.f[1], sp258.f[1], sp258.f[1]) == 0) + if (stanTestLineUnobstructed(&self_stan, sp240.f[0], sp240.f[2], sp258.f[0], sp258.f[2], 0x1B, sp240.f[1], sp240.f[1], sp258.f[1], sp258.f[1]) == 0) { chrlvStanLineDirIntersection(&sp240, &sp220, &sp258); sp254 = self_stan; @@ -7117,7 +7137,7 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) sp258.f[2] -= 26.0f * sp220.f[2]; } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); dx = sp258.f[0] - sp240.f[0]; dy = sp258.f[1] - sp240.f[1]; @@ -7149,27 +7169,27 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) if (sp208->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - sp208->unk6C->flags |= 0x80; + sp208->projectile->flags |= 0x80; sp208->timer = -1; - sp208->unk6C->flags |= 0x20; + sp208->projectile->flags |= 0x20; - sp208->unk6C->unkb0 = sp208->runtime_pos.y; - sp208->unk6C->unkb4 = sp208->unk6C->pos.f[1]; + sp208->projectile->unkB0 = sp208->runtime_pos.y; + sp208->projectile->unkB4 = sp208->projectile->speed.f[1]; - /* sp208->unk6C->vec.x = sp1AC.f[0]; - sp208->unk6C->vec.y = sp1AC.f[1]; - sp208->unk6C->vec.z = sp1AC.f[2];*/ - sp208->unk6C->vec.x = sp1AC.f[0]; - sp208->unk6C->vec.y = sp1AC.f[1]; - sp208->unk6C->vec.z = sp1AC.f[2]; + /* sp208->projectile->unk10.x = sp1AC.f[0]; + sp208->projectile->unk10.y = sp1AC.f[1]; + sp208->projectile->unk10.z = sp1AC.f[2];*/ + sp208->projectile->unk10.x = sp1AC.f[0]; + sp208->projectile->unk10.y = sp1AC.f[1]; + sp208->projectile->unk10.z = sp1AC.f[2]; - if (sp208->unk6C->unk98[0] == NULL) + if (sp208->projectile->sound1 == NULL) { - sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 1, (ALSoundState *)&sp208->unk6C->unk98[0]); + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 1, (ALSoundState *)&sp208->projectile->sound1); } - else if (sp208->unk6C->unk98[1] == NULL) + else if (sp208->projectile->sound2 == NULL) { - sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 1, (ALSoundState *)&sp208->unk6C->unk98[1]); + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, 1, (ALSoundState *)&sp208->projectile->sound2); } } } @@ -7198,12 +7218,12 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) if (sp128->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - sp128->unk6C->unk8c = 0.3f; - sp128->unk6C->unk94 = 0.13333333f; + sp128->projectile->unk8C = 0.3f; + sp128->projectile->unk94 = 0.13333333f; #ifdef REFRESH_PAL - sp128->unk6C->refreshrate = 50; + sp128->projectile->refreshrate = 50; #else - sp128->unk6C->refreshrate = 60; + sp128->projectile->refreshrate = 60; #endif } } @@ -7325,7 +7345,7 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) if (sp264 != 0) { - sub_GAME_7F061948(&self->unk180[hand], prop_selfchr->act_attack.attack_item, &sp240, &sp258); + CapBeamLengthAndDecideIfRendered(&self->unk180[hand], prop_selfchr->act_attack.attack_item, &sp240, &sp258); } } } @@ -7336,7 +7356,7 @@ void chrlvFireWeaponRelated(ChrRecord *self, s32 hand) sub_GAME_7F02BFE4(self, hand, phi_a2); } - sub_GAME_7F02D118(self, hand, sp27C); + chrSetFiring(self, hand, sp27C); } } @@ -7717,532 +7737,6 @@ void chrlvTickAttackCommon(ChrRecord *self) } } -//#else - -#ifdef NONMATCHING - // should be implemented above, but untested. -//#else - -GLOBAL_ASM( -.late_rodata -glabel D_80051FC8 -.word 0x40c90fdb /*6.2831855*/ -.text -glabel chrlvTickAttackCommon -/* 060EE4 7F02E4F4 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 060EE8 7F02E4F8 AFBF0044 */ sw $ra, 0x44($sp) -/* 060EEC 7F02E4FC AFB30040 */ sw $s3, 0x40($sp) -/* 060EF0 7F02E500 AFB2003C */ sw $s2, 0x3c($sp) -/* 060EF4 7F02E504 AFB10038 */ sw $s1, 0x38($sp) -/* 060EF8 7F02E508 AFB00034 */ sw $s0, 0x34($sp) -/* 060EFC 7F02E50C F7B80028 */ sdc1 $f24, 0x28($sp) -/* 060F00 7F02E510 F7B60020 */ sdc1 $f22, 0x20($sp) -/* 060F04 7F02E514 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 060F08 7F02E518 8C93001C */ lw $s3, 0x1c($a0) -/* 060F0C 7F02E51C 00808025 */ move $s0, $a0 -/* 060F10 7F02E520 0FC1BDD7 */ jal objecthandlerGetModelField28 -/* 060F14 7F02E524 02602025 */ move $a0, $s3 -/* 060F18 7F02E528 8E0F0044 */ lw $t7, 0x44($s0) -/* 060F1C 7F02E52C 8E0E0048 */ lw $t6, 0x48($s0) -/* 060F20 7F02E530 46000506 */ mov.s $f20, $f0 -/* 060F24 7F02E534 25F8FFE7 */ addiu $t8, $t7, -0x19 -/* 060F28 7F02E538 01D8082A */ slt $at, $t6, $t8 -/* 060F2C 7F02E53C 5020004B */ beql $at, $zero, .L7F02E66C -/* 060F30 7F02E540 3C013F00 */ lui $at, 0x3f00 -/* 060F34 7F02E544 8E790054 */ lw $t9, 0x54($s3) -/* 060F38 7F02E548 57200048 */ bnezl $t9, .L7F02E66C -/* 060F3C 7F02E54C 3C013F00 */ lui $at, 0x3f00 -/* 060F40 7F02E550 8E05002C */ lw $a1, 0x2c($s0) -/* 060F44 7F02E554 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 060F48 7F02E558 44813000 */ mtc1 $at, $f6 -/* 060F4C 7F02E55C C4A40018 */ lwc1 $f4, 0x18($a1) -/* 060F50 7F02E560 46062200 */ add.s $f8, $f4, $f6 -/* 060F54 7F02E564 4600403C */ c.lt.s $f8, $f0 -/* 060F58 7F02E568 00000000 */ nop -/* 060F5C 7F02E56C 4502003F */ bc1fl .L7F02E66C -/* 060F60 7F02E570 3C013F00 */ lui $at, 0x3f00 -/* 060F64 7F02E574 C4AA001C */ lwc1 $f10, 0x1c($a1) -/* 060F68 7F02E578 460A003C */ c.lt.s $f0, $f10 -/* 060F6C 7F02E57C 00000000 */ nop -/* 060F70 7F02E580 4502003A */ bc1fl .L7F02E66C -/* 060F74 7F02E584 3C013F00 */ lui $at, 0x3f00 -/* 060F78 7F02E588 4480B000 */ mtc1 $zero, $f22 -/* 060F7C 7F02E58C C4A20024 */ lwc1 $f2, 0x24($a1) -/* 060F80 7F02E590 4616103C */ c.lt.s $f2, $f22 -/* 060F84 7F02E594 00000000 */ nop -/* 060F88 7F02E598 45030006 */ bc1tl .L7F02E5B4 -/* 060F8C 7F02E59C 82080036 */ lb $t0, 0x36($s0) -/* 060F90 7F02E5A0 4602003C */ c.lt.s $f0, $f2 -/* 060F94 7F02E5A4 00000000 */ nop -/* 060F98 7F02E5A8 45020030 */ bc1fl .L7F02E66C -/* 060F9C 7F02E5AC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 060FA0 7F02E5B0 82080036 */ lb $t0, 0x36($s0) -.L7F02E5B4: -/* 060FA4 7F02E5B4 15000024 */ bnez $t0, .L7F02E648 -/* 060FA8 7F02E5B8 00000000 */ nop -/* 060FAC 7F02E5BC 0FC0B8C5 */ jal chrlvAttackrollAnimationRelated7F02E2E0 -/* 060FB0 7F02E5C0 02002025 */ move $a0, $s0 -/* 060FB4 7F02E5C4 1440001E */ bnez $v0, .L7F02E640 -/* 060FB8 7F02E5C8 00000000 */ nop -/* 060FBC 7F02E5CC 0FC1BDD3 */ jal objecthandlerGetModelAnim -/* 060FC0 7F02E5D0 02602025 */ move $a0, $s3 -/* 060FC4 7F02E5D4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 060FC8 7F02E5D8 4481C000 */ mtc1 $at, $f24 -/* 060FCC 7F02E5DC 3C063F4C */ lui $a2, (0x3F4CCCCD >> 16) # lui $a2, 0x3f4c -/* 060FD0 7F02E5E0 34C6CCCD */ ori $a2, (0x3F4CCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 060FD4 7F02E5E4 4405C000 */ mfc1 $a1, $f24 -/* 060FD8 7F02E5E8 00408825 */ move $s1, $v0 -/* 060FDC 7F02E5EC 0FC08ED1 */ jal chrlvGetGuard007SpeedRating -/* 060FE0 7F02E5F0 02002025 */ move $a0, $s0 -/* 060FE4 7F02E5F4 8E09002C */ lw $t1, 0x2c($s0) -/* 060FE8 7F02E5F8 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 060FEC 7F02E5FC 44818000 */ mtc1 $at, $f16 -/* 060FF0 7F02E600 82660024 */ lb $a2, 0x24($s3) -/* 060FF4 7F02E604 8D27001C */ lw $a3, 0x1c($t1) -/* 060FF8 7F02E608 E7A00010 */ swc1 $f0, 0x10($sp) -/* 060FFC 7F02E60C 02602025 */ move $a0, $s3 -/* 061000 7F02E610 02202825 */ move $a1, $s1 -/* 061004 7F02E614 0FC1BF92 */ jal modelSetAnimation -/* 061008 7F02E618 E7B00014 */ swc1 $f16, 0x14($sp) -/* 06100C 7F02E61C 8E0A002C */ lw $t2, 0x2c($s0) -/* 061010 7F02E620 C5400014 */ lwc1 $f0, 0x14($t2) -/* 061014 7F02E624 4600B03E */ c.le.s $f22, $f0 -/* 061018 7F02E628 00000000 */ nop -/* 06101C 7F02E62C 45000004 */ bc1f .L7F02E640 -/* 061020 7F02E630 00000000 */ nop -/* 061024 7F02E634 44050000 */ mfc1 $a1, $f0 -/* 061028 7F02E638 0FC1BFE2 */ jal modelSetAnimEndFrame -/* 06102C 7F02E63C 02602025 */ move $a0, $s3 -.L7F02E640: -/* 061030 7F02E640 10000004 */ b .L7F02E654 -/* 061034 7F02E644 820B0034 */ lb $t3, 0x34($s0) -.L7F02E648: -/* 061038 7F02E648 0FC0B8FB */ jal chrlvAttackrollAnimationRelated7F02E3B8 -/* 06103C 7F02E64C 02002025 */ move $a0, $s0 -/* 061040 7F02E650 820B0034 */ lb $t3, 0x34($s0) -.L7F02E654: -/* 061044 7F02E654 02602025 */ move $a0, $s3 -/* 061048 7F02E658 256C0001 */ addiu $t4, $t3, 1 -/* 06104C 7F02E65C 0FC1BDD7 */ jal objecthandlerGetModelField28 -/* 061050 7F02E660 A20C0033 */ sb $t4, 0x33($s0) -/* 061054 7F02E664 46000506 */ mov.s $f20, $f0 -/* 061058 7F02E668 3C013F00 */ li $at, 0x3F000000 # 0.500000 -.L7F02E66C: -/* 06105C 7F02E66C 4481C000 */ mtc1 $at, $f24 -/* 061060 7F02E670 4480B000 */ mtc1 $zero, $f22 -/* 061064 7F02E674 0FC1BDD9 */ jal sub_GAME_7F06F5C4 -/* 061068 7F02E678 02602025 */ move $a0, $s3 -/* 06106C 7F02E67C 4614003E */ c.le.s $f0, $f20 -/* 061070 7F02E680 00000000 */ nop -/* 061074 7F02E684 45020076 */ bc1fl .L7F02E860 -/* 061078 7F02E688 8E02004C */ lw $v0, 0x4c($s0) -/* 06107C 7F02E68C 820D0037 */ lb $t5, 0x37($s0) -/* 061080 7F02E690 15A00006 */ bnez $t5, .L7F02E6AC -/* 061084 7F02E694 00000000 */ nop -/* 061088 7F02E698 82030034 */ lb $v1, 0x34($s0) -/* 06108C 7F02E69C 82020033 */ lb $v0, 0x33($s0) -/* 061090 7F02E6A0 0062082A */ slt $at, $v1, $v0 -/* 061094 7F02E6A4 1020000F */ beqz $at, .L7F02E6E4 -/* 061098 7F02E6A8 00000000 */ nop -.L7F02E6AC: -/* 06109C 7F02E6AC 0FC0B8C5 */ jal chrlvAttackrollAnimationRelated7F02E2E0 -/* 0610A0 7F02E6B0 02002025 */ move $a0, $s0 -/* 0610A4 7F02E6B4 14400066 */ bnez $v0, .L7F02E850 -/* 0610A8 7F02E6B8 00000000 */ nop -/* 0610AC 7F02E6BC 8E0F004C */ lw $t7, 0x4c($s0) -/* 0610B0 7F02E6C0 31EE0001 */ andi $t6, $t7, 1 -/* 0610B4 7F02E6C4 11C00003 */ beqz $t6, .L7F02E6D4 -/* 0610B8 7F02E6C8 00000000 */ nop -/* 0610BC 7F02E6CC 0FC0A6F9 */ jal chrlvSetTargetToPlayer -/* 0610C0 7F02E6D0 02002025 */ move $a0, $s0 -.L7F02E6D4: -/* 0610C4 7F02E6D4 0FC08F8C */ jal chrlvKneelingAnimationRelated7F023E48 -/* 0610C8 7F02E6D8 02002025 */ move $a0, $s0 -/* 0610CC 7F02E6DC 10000151 */ b .L7F02EC24 -/* 0610D0 7F02E6E0 8FBF0044 */ lw $ra, 0x44($sp) -.L7F02E6E4: -/* 0610D4 7F02E6E4 14620006 */ bne $v1, $v0, .L7F02E700 -/* 0610D8 7F02E6E8 24580001 */ addiu $t8, $v0, 1 -/* 0610DC 7F02E6EC A2180033 */ sb $t8, 0x33($s0) -/* 0610E0 7F02E6F0 0FC0B8FB */ jal chrlvAttackrollAnimationRelated7F02E3B8 -/* 0610E4 7F02E6F4 02002025 */ move $a0, $s0 -/* 0610E8 7F02E6F8 10000055 */ b .L7F02E850 -/* 0610EC 7F02E6FC 00000000 */ nop -.L7F02E700: -/* 0610F0 7F02E700 82190031 */ lb $t9, 0x31($s0) -/* 0610F4 7F02E704 3C014140 */ li $at, 0x41400000 # 12.000000 -/* 0610F8 7F02E708 02602025 */ move $a0, $s3 -/* 0610FC 7F02E70C 13200050 */ beqz $t9, .L7F02E850 -/* 061100 7F02E710 00000000 */ nop -/* 061104 7F02E714 82080036 */ lb $t0, 0x36($s0) -/* 061108 7F02E718 4600C306 */ mov.s $f12, $f24 -/* 06110C 7F02E71C 51000014 */ beql $t0, $zero, .L7F02E770 -/* 061110 7F02E720 8E05002C */ lw $a1, 0x2c($s0) -/* 061114 7F02E724 8E05002C */ lw $a1, 0x2c($s0) -/* 061118 7F02E728 C4A00020 */ lwc1 $f0, 0x20($a1) -/* 06111C 7F02E72C 4600B03C */ c.lt.s $f22, $f0 -/* 061120 7F02E730 00000000 */ nop -/* 061124 7F02E734 45020004 */ bc1fl .L7F02E748 -/* 061128 7F02E738 C4AE0018 */ lwc1 $f14, 0x18($a1) -/* 06112C 7F02E73C 10000002 */ b .L7F02E748 -/* 061130 7F02E740 46000386 */ mov.s $f14, $f0 -/* 061134 7F02E744 C4AE0018 */ lwc1 $f14, 0x18($a1) -.L7F02E748: -/* 061138 7F02E748 C4A20024 */ lwc1 $f2, 0x24($a1) -/* 06113C 7F02E74C 4602B03C */ c.lt.s $f22, $f2 -/* 061140 7F02E750 00000000 */ nop -/* 061144 7F02E754 45000003 */ bc1f .L7F02E764 -/* 061148 7F02E758 00000000 */ nop -/* 06114C 7F02E75C 1000000D */ b .L7F02E794 -/* 061150 7F02E760 46001506 */ mov.s $f20, $f2 -.L7F02E764: -/* 061154 7F02E764 1000000B */ b .L7F02E794 -/* 061158 7F02E768 C4B4001C */ lwc1 $f20, 0x1c($a1) -/* 06115C 7F02E76C 8E05002C */ lw $a1, 0x2c($s0) -.L7F02E770: -/* 061160 7F02E770 C4A00020 */ lwc1 $f0, 0x20($a1) -/* 061164 7F02E774 C4AE0018 */ lwc1 $f14, 0x18($a1) -/* 061168 7F02E778 4600B03C */ c.lt.s $f22, $f0 -/* 06116C 7F02E77C 00000000 */ nop -/* 061170 7F02E780 45020004 */ bc1fl .L7F02E794 -/* 061174 7F02E784 C4B4001C */ lwc1 $f20, 0x1c($a1) -/* 061178 7F02E788 10000002 */ b .L7F02E794 -/* 06117C 7F02E78C 46000506 */ mov.s $f20, $f0 -/* 061180 7F02E790 C4B4001C */ lwc1 $f20, 0x1c($a1) -.L7F02E794: -/* 061184 7F02E794 460EA001 */ sub.s $f0, $f20, $f14 -/* 061188 7F02E798 44811000 */ mtc1 $at, $f2 -/* 06118C 7F02E79C 3C014180 */ li $at, 0x41800000 # 16.000000 -/* 061190 7F02E7A0 4602003C */ c.lt.s $f0, $f2 -/* 061194 7F02E7A4 00000000 */ nop -/* 061198 7F02E7A8 45020005 */ bc1fl .L7F02E7C0 -/* 06119C 7F02E7AC 44812000 */ mtc1 $at, $f4 -/* 0611A0 7F02E7B0 46180482 */ mul.s $f18, $f0, $f24 -/* 0611A4 7F02E7B4 1000000D */ b .L7F02E7EC -/* 0611A8 7F02E7B8 46029303 */ div.s $f12, $f18, $f2 -/* 0611AC 7F02E7BC 44812000 */ mtc1 $at, $f4 -.L7F02E7C0: -/* 0611B0 7F02E7C0 00000000 */ nop -/* 0611B4 7F02E7C4 4600203C */ c.lt.s $f4, $f0 -/* 0611B8 7F02E7C8 00000000 */ nop -/* 0611BC 7F02E7CC 45020008 */ bc1fl .L7F02E7F0 -/* 0611C0 7F02E7D0 8209003A */ lb $t1, 0x3a($s0) -/* 0611C4 7F02E7D4 46180182 */ mul.s $f6, $f0, $f24 -/* 0611C8 7F02E7D8 3C013D80 */ li $at, 0x3D800000 # 0.062500 -/* 0611CC 7F02E7DC 44814000 */ mtc1 $at, $f8 -/* 0611D0 7F02E7E0 00000000 */ nop -/* 0611D4 7F02E7E4 46083302 */ mul.s $f12, $f6, $f8 -/* 0611D8 7F02E7E8 00000000 */ nop -.L7F02E7EC: -/* 0611DC 7F02E7EC 8209003A */ lb $t1, 0x3a($s0) -.L7F02E7F0: -/* 0611E0 7F02E7F0 51200006 */ beql $t1, $zero, .L7F02E80C -/* 0611E4 7F02E7F4 A2000031 */ sb $zero, 0x31($s0) -/* 0611E8 7F02E7F8 820A003B */ lb $t2, 0x3b($s0) -/* 0611EC 7F02E7FC 51400003 */ beql $t2, $zero, .L7F02E80C -/* 0611F0 7F02E800 A2000031 */ sb $zero, 0x31($s0) -/* 0611F4 7F02E804 460C6300 */ add.s $f12, $f12, $f12 -/* 0611F8 7F02E808 A2000031 */ sb $zero, 0x31($s0) -.L7F02E80C: -/* 0611FC 7F02E80C E7AE005C */ swc1 $f14, 0x5c($sp) -/* 061200 7F02E810 0FC1BDD3 */ jal objecthandlerGetModelAnim -/* 061204 7F02E814 E7AC0060 */ swc1 $f12, 0x60($sp) -/* 061208 7F02E818 C7AE005C */ lwc1 $f14, 0x5c($sp) -/* 06120C 7F02E81C 3C014100 */ li $at, 0x41000000 # 8.000000 -/* 061210 7F02E820 44815000 */ mtc1 $at, $f10 -/* 061214 7F02E824 C7AC0060 */ lwc1 $f12, 0x60($sp) -/* 061218 7F02E828 82660024 */ lb $a2, 0x24($s3) -/* 06121C 7F02E82C 44077000 */ mfc1 $a3, $f14 -/* 061220 7F02E830 02602025 */ move $a0, $s3 -/* 061224 7F02E834 00402825 */ move $a1, $v0 -/* 061228 7F02E838 E7AA0014 */ swc1 $f10, 0x14($sp) -/* 06122C 7F02E83C 0FC1BF92 */ jal modelSetAnimation -/* 061230 7F02E840 E7AC0010 */ swc1 $f12, 0x10($sp) -/* 061234 7F02E844 4405A000 */ mfc1 $a1, $f20 -/* 061238 7F02E848 0FC1BFE2 */ jal modelSetAnimEndFrame -/* 06123C 7F02E84C 02602025 */ move $a0, $s3 -.L7F02E850: -/* 061240 7F02E850 0FC1BDD7 */ jal objecthandlerGetModelField28 -/* 061244 7F02E854 02602025 */ move $a0, $s3 -/* 061248 7F02E858 46000506 */ mov.s $f20, $f0 -/* 06124C 7F02E85C 8E02004C */ lw $v0, 0x4c($s0) -.L7F02E860: -/* 061250 7F02E860 304B0040 */ andi $t3, $v0, 0x40 -/* 061254 7F02E864 5560002B */ bnezl $t3, .L7F02E914 -/* 061258 7F02E868 8E05002C */ lw $a1, 0x2c($s0) -/* 06125C 7F02E86C 8E05002C */ lw $a1, 0x2c($s0) -/* 061260 7F02E870 304C0020 */ andi $t4, $v0, 0x20 -/* 061264 7F02E874 02602025 */ move $a0, $s3 -/* 061268 7F02E878 C4A2000C */ lwc1 $f2, 0xc($a1) -/* 06126C 7F02E87C 1180000F */ beqz $t4, .L7F02E8BC -/* 061270 7F02E880 C4AC0004 */ lwc1 $f12, 4($a1) -/* 061274 7F02E884 E7A20050 */ swc1 $f2, 0x50($sp) -/* 061278 7F02E888 0FC1BDD9 */ jal sub_GAME_7F06F5C4 -/* 06127C 7F02E88C E7AC004C */ swc1 $f12, 0x4c($sp) -/* 061280 7F02E890 C7AC004C */ lwc1 $f12, 0x4c($sp) -/* 061284 7F02E894 C7A20050 */ lwc1 $f2, 0x50($sp) -/* 061288 7F02E898 02602025 */ move $a0, $s3 -/* 06128C 7F02E89C 460C003C */ c.lt.s $f0, $f12 -/* 061290 7F02E8A0 00000000 */ nop -/* 061294 7F02E8A4 45020006 */ bc1fl .L7F02E8C0 -/* 061298 7F02E8A8 826D0024 */ lb $t5, 0x24($s3) -/* 06129C 7F02E8AC 0FC1BDD9 */ jal sub_GAME_7F06F5C4 -/* 0612A0 7F02E8B0 E7A20050 */ swc1 $f2, 0x50($sp) -/* 0612A4 7F02E8B4 C7A20050 */ lwc1 $f2, 0x50($sp) -/* 0612A8 7F02E8B8 46000306 */ mov.s $f12, $f0 -.L7F02E8BC: -/* 0612AC 7F02E8BC 826D0024 */ lb $t5, 0x24($s3) -.L7F02E8C0: -/* 0612B0 7F02E8C0 02002025 */ move $a0, $s0 -/* 0612B4 7F02E8C4 3C053F80 */ lui $a1, 0x3f80 -/* 0612B8 7F02E8C8 11A00004 */ beqz $t5, .L7F02E8DC -/* 0612BC 7F02E8CC 3C063FCC */ lui $a2, (0x3FCCCCCD >> 16) # lui $a2, 0x3fcc -/* 0612C0 7F02E8D0 3C018005 */ lui $at, %hi(D_80051FC8) # $at, 0x8005 -/* 0612C4 7F02E8D4 C4308100 */ lwc1 $f16, %lo(D_80051FC8)($at) -/* 0612C8 7F02E8D8 46028081 */ sub.s $f2, $f16, $f2 -.L7F02E8DC: -/* 0612CC 7F02E8DC 34C6CCCD */ ori $a2, (0x3FCCCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 0612D0 7F02E8E0 E7A20050 */ swc1 $f2, 0x50($sp) -/* 0612D4 7F02E8E4 0FC08ED1 */ jal chrlvGetGuard007SpeedRating -/* 0612D8 7F02E8E8 E7AC004C */ swc1 $f12, 0x4c($sp) -/* 0612DC 7F02E8EC C7AC004C */ lwc1 $f12, 0x4c($sp) -/* 0612E0 7F02E8F0 C7A20050 */ lwc1 $f2, 0x50($sp) -/* 0612E4 7F02E8F4 82050030 */ lb $a1, 0x30($s0) -/* 0612E8 7F02E8F8 44070000 */ mfc1 $a3, $f0 -/* 0612EC 7F02E8FC 44066000 */ mfc1 $a2, $f12 -/* 0612F0 7F02E900 02002025 */ move $a0, $s0 -/* 0612F4 7F02E904 0FC0B0B9 */ jal chrlvSetSubroty -/* 0612F8 7F02E908 E7A20010 */ swc1 $f2, 0x10($sp) -/* 0612FC 7F02E90C A2020030 */ sb $v0, 0x30($s0) -/* 061300 7F02E910 8E05002C */ lw $a1, 0x2c($s0) -.L7F02E914: -/* 061304 7F02E914 C4B20028 */ lwc1 $f18, 0x28($a1) -/* 061308 7F02E918 4614903C */ c.lt.s $f18, $f20 -/* 06130C 7F02E91C 00000000 */ nop -/* 061310 7F02E920 4500000F */ bc1f .L7F02E960 -/* 061314 7F02E924 00000000 */ nop -/* 061318 7F02E928 C4A4002C */ lwc1 $f4, 0x2c($a1) -/* 06131C 7F02E92C 02002025 */ move $a0, $s0 -/* 061320 7F02E930 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 061324 7F02E934 4604A03C */ c.lt.s $f20, $f4 -/* 061328 7F02E938 00000000 */ nop -/* 06132C 7F02E93C 45000008 */ bc1f .L7F02E960 -/* 061330 7F02E940 00000000 */ nop -/* 061334 7F02E944 44813000 */ mtc1 $at, $f6 -/* 061338 7F02E948 82060039 */ lb $a2, 0x39($s0) -/* 06133C 7F02E94C 82070038 */ lb $a3, 0x38($s0) -/* 061340 7F02E950 0FC0B13D */ jal chrlvUpdateAimendsideback -/* 061344 7F02E954 E7A60010 */ swc1 $f6, 0x10($sp) -/* 061348 7F02E958 10000004 */ b .L7F02E96C -/* 06134C 7F02E95C 00008825 */ move $s1, $zero -.L7F02E960: -/* 061350 7F02E960 0FC0B44B */ jal chrlvResetAimend -/* 061354 7F02E964 02002025 */ move $a0, $s0 -/* 061358 7F02E968 00008825 */ move $s1, $zero -.L7F02E96C: -/* 06135C 7F02E96C 02009025 */ move $s2, $s0 -.L7F02E970: -/* 061360 7F02E970 824F0038 */ lb $t7, 0x38($s2) -/* 061364 7F02E974 02002025 */ move $a0, $s0 -/* 061368 7F02E978 02202825 */ move $a1, $s1 -/* 06136C 7F02E97C 11E000A2 */ beqz $t7, .L7F02EC08 -/* 061370 7F02E980 00000000 */ nop -/* 061374 7F02E984 824E003A */ lb $t6, 0x3a($s2) -/* 061378 7F02E988 55C0006A */ bnezl $t6, .L7F02EB34 -/* 06137C 7F02E98C 82090031 */ lb $t1, 0x31($s0) -/* 061380 7F02E990 8E05002C */ lw $a1, 0x2c($s0) -/* 061384 7F02E994 02002025 */ move $a0, $s0 -/* 061388 7F02E998 00003025 */ move $a2, $zero -/* 06138C 7F02E99C C4A80018 */ lwc1 $f8, 0x18($a1) -/* 061390 7F02E9A0 4614403E */ c.le.s $f8, $f20 -/* 061394 7F02E9A4 00000000 */ nop -/* 061398 7F02E9A8 45000046 */ bc1f .L7F02EAC4 -/* 06139C 7F02E9AC 00000000 */ nop -/* 0613A0 7F02E9B0 C4AA001C */ lwc1 $f10, 0x1c($a1) -/* 0613A4 7F02E9B4 02202825 */ move $a1, $s1 -/* 0613A8 7F02E9B8 460AA03C */ c.lt.s $f20, $f10 -/* 0613AC 7F02E9BC 00000000 */ nop -/* 0613B0 7F02E9C0 45000040 */ bc1f .L7F02EAC4 -/* 0613B4 7F02E9C4 00000000 */ nop -/* 0613B8 7F02E9C8 02002025 */ move $a0, $s0 -/* 0613BC 7F02E9CC 0FC0B47E */ jal chrlvToggleHiddenRelated -/* 0613C0 7F02E9D0 24060001 */ li $a2, 1 -/* 0613C4 7F02E9D4 82190007 */ lb $t9, 7($s0) -/* 0613C8 7F02E9D8 3C188004 */ lui $t8, %hi(g_GlobalTimer) # $t8, 0x8004 -/* 0613CC 7F02E9DC 8F180FFC */ lw $t8, %lo(g_GlobalTimer)($t8) -/* 0613D0 7F02E9E0 2401000A */ li $at, 10 -/* 0613D4 7F02E9E4 17210031 */ bne $t9, $at, .L7F02EAAC -/* 0613D8 7F02E9E8 AE180044 */ sw $t8, 0x44($s0) -/* 0613DC 7F02E9EC 8E05002C */ lw $a1, 0x2c($s0) -/* 0613E0 7F02E9F0 3C014248 */ li $at, 0x42480000 # 50.000000 -/* 0613E4 7F02E9F4 44813000 */ mtc1 $at, $f6 -/* 0613E8 7F02E9F8 C4B0001C */ lwc1 $f16, 0x1c($a1) -/* 0613EC 7F02E9FC C4B20018 */ lwc1 $f18, 0x18($a1) -/* 0613F0 7F02EA00 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0613F4 7F02EA04 44815000 */ mtc1 $at, $f10 -/* 0613F8 7F02EA08 46128101 */ sub.s $f4, $f16, $f18 -/* 0613FC 7F02EA0C 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 061400 7F02EA10 44818000 */ mtc1 $at, $f16 -/* 061404 7F02EA14 46062202 */ mul.s $f8, $f4, $f6 -/* 061408 7F02EA18 460A4003 */ div.s $f0, $f8, $f10 -/* 06140C 7F02EA1C 4610003C */ c.lt.s $f0, $f16 -/* 061410 7F02EA20 00000000 */ nop -/* 061414 7F02EA24 4502001C */ bc1fl .L7F02EA98 -/* 061418 7F02EA28 4405C000 */ mfc1 $a1, $f24 -/* 06141C 7F02EA2C 4600048D */ trunc.w.s $f18, $f0 -/* 061420 7F02EA30 8E080040 */ lw $t0, 0x40($s0) -/* 061424 7F02EA34 240C0032 */ li $t4, 50 -/* 061428 7F02EA38 02602025 */ move $a0, $s3 -/* 06142C 7F02EA3C 440A9000 */ mfc1 $t2, $f18 -/* 061430 7F02EA40 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc -/* 061434 7F02EA44 000A5840 */ sll $t3, $t2, 1 -/* 061438 7F02EA48 018B6823 */ subu $t5, $t4, $t3 -/* 06143C 7F02EA4C 010D082A */ slt $at, $t0, $t5 -/* 061440 7F02EA50 54200008 */ bnezl $at, .L7F02EA74 -/* 061444 7F02EA54 4406B000 */ mfc1 $a2, $f22 -/* 061448 7F02EA58 4405C000 */ mfc1 $a1, $f24 -/* 06144C 7F02EA5C 4406B000 */ mfc1 $a2, $f22 -/* 061450 7F02EA60 0FC1BFFB */ jal modelSetAnimSpeed -/* 061454 7F02EA64 02602025 */ move $a0, $s3 -/* 061458 7F02EA68 1000006A */ b .L7F02EC14 -/* 06145C 7F02EA6C 26310001 */ addiu $s1, $s1, 1 -/* 061460 7F02EA70 4406B000 */ mfc1 $a2, $f22 -.L7F02EA74: -/* 061464 7F02EA74 0FC1BFFB */ jal modelSetAnimSpeed -/* 061468 7F02EA78 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd -/* 06146C 7F02EA7C 3C0E8004 */ lui $t6, %hi(g_ClockTimer) # $t6, 0x8004 -/* 061470 7F02EA80 8DCE0FF4 */ lw $t6, %lo(g_ClockTimer)($t6) -/* 061474 7F02EA84 8E0F0040 */ lw $t7, 0x40($s0) -/* 061478 7F02EA88 01EEC021 */ addu $t8, $t7, $t6 -/* 06147C 7F02EA8C 10000060 */ b .L7F02EC10 -/* 061480 7F02EA90 AE180040 */ sw $t8, 0x40($s0) -/* 061484 7F02EA94 4405C000 */ mfc1 $a1, $f24 -.L7F02EA98: -/* 061488 7F02EA98 4406B000 */ mfc1 $a2, $f22 -/* 06148C 7F02EA9C 0FC1BFFB */ jal modelSetAnimSpeed -/* 061490 7F02EAA0 02602025 */ move $a0, $s3 -/* 061494 7F02EAA4 1000005B */ b .L7F02EC14 -/* 061498 7F02EAA8 26310001 */ addiu $s1, $s1, 1 -.L7F02EAAC: -/* 06149C 7F02EAAC 4405C000 */ mfc1 $a1, $f24 -/* 0614A0 7F02EAB0 4406B000 */ mfc1 $a2, $f22 -/* 0614A4 7F02EAB4 0FC1BFFB */ jal modelSetAnimSpeed -/* 0614A8 7F02EAB8 02602025 */ move $a0, $s3 -/* 0614AC 7F02EABC 10000055 */ b .L7F02EC14 -/* 0614B0 7F02EAC0 26310001 */ addiu $s1, $s1, 1 -.L7F02EAC4: -/* 0614B4 7F02EAC4 0FC0B47E */ jal chrlvToggleHiddenRelated -/* 0614B8 7F02EAC8 02202825 */ move $a1, $s1 -/* 0614BC 7F02EACC 82190007 */ lb $t9, 7($s0) -/* 0614C0 7F02EAD0 2401000A */ li $at, 10 -/* 0614C4 7F02EAD4 02002025 */ move $a0, $s0 -/* 0614C8 7F02EAD8 1721000C */ bne $t9, $at, .L7F02EB0C -/* 0614CC 7F02EADC 3C063F4C */ lui $a2, 0x3f4c -/* 0614D0 7F02EAE0 4405C000 */ mfc1 $a1, $f24 -/* 0614D4 7F02EAE4 3C063F4C */ lui $a2, (0x3F4CCCCD >> 16) # lui $a2, 0x3f4c -/* 0614D8 7F02EAE8 34C6CCCD */ ori $a2, (0x3F4CCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 0614DC 7F02EAEC 0FC08ED1 */ jal chrlvGetGuard007SpeedRating -/* 0614E0 7F02EAF0 02002025 */ move $a0, $s0 -/* 0614E4 7F02EAF4 44050000 */ mfc1 $a1, $f0 -/* 0614E8 7F02EAF8 4406B000 */ mfc1 $a2, $f22 -/* 0614EC 7F02EAFC 0FC1BFFB */ jal modelSetAnimSpeed -/* 0614F0 7F02EB00 02602025 */ move $a0, $s3 -/* 0614F4 7F02EB04 10000043 */ b .L7F02EC14 -/* 0614F8 7F02EB08 26310001 */ addiu $s1, $s1, 1 -.L7F02EB0C: -/* 0614FC 7F02EB0C 4405C000 */ mfc1 $a1, $f24 -/* 061500 7F02EB10 0FC08ED1 */ jal chrlvGetGuard007SpeedRating -/* 061504 7F02EB14 34C6CCCD */ ori $a2, (0x3F4CCCCD & 0xFFFF) # ori $a2, $a2, 0xcccd -/* 061508 7F02EB18 44050000 */ mfc1 $a1, $f0 -/* 06150C 7F02EB1C 4406B000 */ mfc1 $a2, $f22 -/* 061510 7F02EB20 0FC1BFFB */ jal modelSetAnimSpeed -/* 061514 7F02EB24 02602025 */ move $a0, $s3 -/* 061518 7F02EB28 1000003A */ b .L7F02EC14 -/* 06151C 7F02EB2C 26310001 */ addiu $s1, $s1, 1 -/* 061520 7F02EB30 82090031 */ lb $t1, 0x31($s0) -.L7F02EB34: -/* 061524 7F02EB34 02002025 */ move $a0, $s0 -/* 061528 7F02EB38 00003025 */ move $a2, $zero -/* 06152C 7F02EB3C 1520002E */ bnez $t1, .L7F02EBF8 -/* 061530 7F02EB40 00000000 */ nop -/* 061534 7F02EB44 82020032 */ lb $v0, 0x32($s0) -/* 061538 7F02EB48 12220004 */ beq $s1, $v0, .L7F02EB5C -/* 06153C 7F02EB4C 02025021 */ addu $t2, $s0, $v0 -/* 061540 7F02EB50 814C003A */ lb $t4, 0x3a($t2) -/* 061544 7F02EB54 15800028 */ bnez $t4, .L7F02EBF8 -/* 061548 7F02EB58 00000000 */ nop -.L7F02EB5C: -/* 06154C 7F02EB5C 8E05002C */ lw $a1, 0x2c($s0) -/* 061550 7F02EB60 C4A00020 */ lwc1 $f0, 0x20($a1) -/* 061554 7F02EB64 4600B03E */ c.le.s $f22, $f0 -/* 061558 7F02EB68 00000000 */ nop -/* 06155C 7F02EB6C 4502000B */ bc1fl .L7F02EB9C -/* 061560 7F02EB70 4616003C */ c.lt.s $f0, $f22 -/* 061564 7F02EB74 4614003E */ c.le.s $f0, $f20 -/* 061568 7F02EB78 00000000 */ nop -/* 06156C 7F02EB7C 45020007 */ bc1fl .L7F02EB9C -/* 061570 7F02EB80 4616003C */ c.lt.s $f0, $f22 -/* 061574 7F02EB84 C4A40024 */ lwc1 $f4, 0x24($a1) -/* 061578 7F02EB88 4604A03E */ c.le.s $f20, $f4 -/* 06157C 7F02EB8C 00000000 */ nop -/* 061580 7F02EB90 4503000B */ bc1tl .L7F02EBC0 -/* 061584 7F02EB94 82080033 */ lb $t0, 0x33($s0) -/* 061588 7F02EB98 4616003C */ c.lt.s $f0, $f22 -.L7F02EB9C: -/* 06158C 7F02EB9C 00000000 */ nop -/* 061590 7F02EBA0 45000015 */ bc1f .L7F02EBF8 -/* 061594 7F02EBA4 00000000 */ nop -/* 061598 7F02EBA8 C4A60018 */ lwc1 $f6, 0x18($a1) -/* 06159C 7F02EBAC 4614303E */ c.le.s $f6, $f20 -/* 0615A0 7F02EBB0 00000000 */ nop -/* 0615A4 7F02EBB4 45000010 */ bc1f .L7F02EBF8 -/* 0615A8 7F02EBB8 00000000 */ nop -/* 0615AC 7F02EBBC 82080033 */ lb $t0, 0x33($s0) -.L7F02EBC0: -/* 0615B0 7F02EBC0 24060001 */ li $a2, 1 -/* 0615B4 7F02EBC4 00C25823 */ subu $t3, $a2, $v0 -/* 0615B8 7F02EBC8 250D0001 */ addiu $t5, $t0, 1 -/* 0615BC 7F02EBCC A2060031 */ sb $a2, 0x31($s0) -/* 0615C0 7F02EBD0 A20B0032 */ sb $t3, 0x32($s0) -/* 0615C4 7F02EBD4 A20D0033 */ sb $t5, 0x33($s0) -/* 0615C8 7F02EBD8 3C0F8004 */ lui $t7, %hi(g_GlobalTimer) # $t7, 0x8004 -/* 0615CC 7F02EBDC 8DEF0FFC */ lw $t7, %lo(g_GlobalTimer)($t7) -/* 0615D0 7F02EBE0 02002025 */ move $a0, $s0 -/* 0615D4 7F02EBE4 02202825 */ move $a1, $s1 -/* 0615D8 7F02EBE8 0FC0B47E */ jal chrlvToggleHiddenRelated -/* 0615DC 7F02EBEC AE0F0044 */ sw $t7, 0x44($s0) -/* 0615E0 7F02EBF0 10000008 */ b .L7F02EC14 -/* 0615E4 7F02EBF4 26310001 */ addiu $s1, $s1, 1 -.L7F02EBF8: -/* 0615E8 7F02EBF8 0FC0B47E */ jal chrlvToggleHiddenRelated -/* 0615EC 7F02EBFC 02202825 */ move $a1, $s1 -/* 0615F0 7F02EC00 10000004 */ b .L7F02EC14 -/* 0615F4 7F02EC04 26310001 */ addiu $s1, $s1, 1 -.L7F02EC08: -/* 0615F8 7F02EC08 0FC0B47E */ jal chrlvToggleHiddenRelated -/* 0615FC 7F02EC0C 00003025 */ move $a2, $zero -.L7F02EC10: -/* 061600 7F02EC10 26310001 */ addiu $s1, $s1, 1 -.L7F02EC14: -/* 061604 7F02EC14 24010002 */ li $at, 2 -/* 061608 7F02EC18 1621FF55 */ bne $s1, $at, .L7F02E970 -/* 06160C 7F02EC1C 26520001 */ addiu $s2, $s2, 1 -/* 061610 7F02EC20 8FBF0044 */ lw $ra, 0x44($sp) -.L7F02EC24: -/* 061614 7F02EC24 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 061618 7F02EC28 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 06161C 7F02EC2C D7B80028 */ ldc1 $f24, 0x28($sp) -/* 061620 7F02EC30 8FB00034 */ lw $s0, 0x34($sp) -/* 061624 7F02EC34 8FB10038 */ lw $s1, 0x38($sp) -/* 061628 7F02EC38 8FB2003C */ lw $s2, 0x3c($sp) -/* 06162C 7F02EC3C 8FB30040 */ lw $s3, 0x40($sp) -/* 061630 7F02EC40 03E00008 */ jr $ra -/* 061634 7F02EC44 27BD0070 */ addiu $sp, $sp, 0x70 -) -#endif - -//#endif - /** * Address 0x7F02EBFC (VERSION_US). @@ -8754,8 +8248,8 @@ s32 chrlvApplySpeed(ChrRecord *self, coord3d *arg1, s32 arg2, f32 *speedPtr) accel = ACCEL_C; } - maxSpeed *= self_model->unka4; - accel *= self_model->unka4; + maxSpeed *= self_model->playspeed; + accel *= self_model->playspeed; // void chrobjCallsApplySpeed(f32 *openPosition, f32 maxFrac, f32 *speedPtr, f32 accel, f32 decel, f32 maxSpeed) chrobjCallsApplySpeed( @@ -9085,16 +8579,16 @@ s32 sub_GAME_7F030128(ChrRecord *self, coord3d *point, StandTile *arg2, coord3d chrGetChrWidthHeight(self->prop, &sp34, &sp3C, &sp38); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); if ( - sub_GAME_7F0B0E24(&sp44, point->f[0], point->f[2], dest->f[0], dest->f[2], objflags, sp3C, sp38, 0.0f, 1.0f) + stanTestLineUnobstructed(&sp44, point->f[0], point->f[2], dest->f[0], dest->f[2], objflags, sp3C, sp38, 0.0f, 1.0f) && ((arg4 == NULL) || (sp44 == arg4))) { sp40 = 1; } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return sp40; } @@ -9139,23 +8633,23 @@ s32 sub_GAME_7F0301FC(ChrRecord *self, coord3d *point, StandTile *arg2, coord3d temp_f20 = arg4 * dd.f[0]; temp_f22 = arg4 * dd.f[2]; - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); pstan = arg2; - if (sub_GAME_7F0B0E24(&pstan, point->f[0], point->f[2], point->f[0] + temp_f22, point->f[2] - temp_f20, arg5, sp64, sp60, 0.0f, 1.0f) - && sub_GAME_7F0B0E24(&pstan, point->f[0] + temp_f22, point->f[2] - temp_f20, dest->f[0] + temp_f22, dest->f[2] - temp_f20, arg5, sp64, sp60, 0.0f, 1.0f)) + if (stanTestLineUnobstructed(&pstan, point->f[0], point->f[2], point->f[0] + temp_f22, point->f[2] - temp_f20, arg5, sp64, sp60, 0.0f, 1.0f) + && stanTestLineUnobstructed(&pstan, point->f[0] + temp_f22, point->f[2] - temp_f20, dest->f[0] + temp_f22, dest->f[2] - temp_f20, arg5, sp64, sp60, 0.0f, 1.0f)) { pstan = arg2; - if (sub_GAME_7F0B0E24(&pstan, point->f[0], point->f[2], point->f[0] - temp_f22, point->f[2] + temp_f20, arg5, sp64, sp60, 0.0f, 1.0f) - && sub_GAME_7F0B0E24(&pstan, point->f[0] - temp_f22, point->f[2] + temp_f20, dest->f[0] - temp_f22, dest->f[2] + temp_f20, arg5, sp64, sp60, 0.0f, 1.0f)) + if (stanTestLineUnobstructed(&pstan, point->f[0], point->f[2], point->f[0] - temp_f22, point->f[2] + temp_f20, arg5, sp64, sp60, 0.0f, 1.0f) + && stanTestLineUnobstructed(&pstan, point->f[0] - temp_f22, point->f[2] + temp_f20, dest->f[0] - temp_f22, dest->f[2] + temp_f20, arg5, sp64, sp60, 0.0f, 1.0f)) { ret = 1; } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); } return ret; @@ -9179,20 +8673,20 @@ s32 sub_GAME_7F0304AC(ChrRecord *self, coord3d *mypos, StandTile *mystan, coord3 pass = FALSE; chrGetChrWidthHeight(self->prop, &sp34, &sp3C, &sp38); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); - if (sub_GAME_7F0B0E24(&sp44, mypos->x, mypos->z, arg3->x, arg3->z, arg6, sp3C, sp38, 0.0f, 1.0f)) + if (stanTestLineUnobstructed(&sp44, mypos->x, mypos->z, arg3->x, arg3->z, arg6, sp3C, sp38, 0.0f, 1.0f)) { sp30 = sp44; // duplicate var? needed? - if (sub_GAME_7F0B0E24(&sp30, arg3->x, arg3->z, bondpos->x, bondpos->z, arg6, sp3C, sp38, 0.0f, 1.0f) + if (stanTestLineUnobstructed(&sp30, arg3->x, arg3->z, bondpos->x, bondpos->z, arg6, sp3C, sp38, 0.0f, 1.0f) && ((bondstan == NULL) || (sp30 == bondstan))) { pass = TRUE; } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return pass; } @@ -9217,13 +8711,13 @@ s32 sub_GAME_7F0305E0(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp48 = 0; chrGetChrWidthHeight(self->prop, &sp3C, &sp44, &sp40); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); - if (sub_GAME_7F0B0E24(&sp4C, arg1->x, arg1->f[2], arg3->x, arg3->f[2], arg6, sp44, sp40, 0.0f, 1.0f)) + if (stanTestLineUnobstructed(&sp4C, arg1->x, arg1->f[2], arg3->x, arg3->f[2], arg6, sp44, sp40, 0.0f, 1.0f)) { sp38 = sp4C; - if (sub_GAME_7F0B0E24(&sp38, arg3->x, arg3->f[2], arg4->x, arg4->f[2], arg6, sp44, sp40, 0.0f, 1.0f) + if (stanTestLineUnobstructed(&sp38, arg3->x, arg3->f[2], arg4->x, arg4->f[2], arg6, sp44, sp40, 0.0f, 1.0f) && sub_GAME_7F0301FC(self, arg1, arg2, arg3, arg5, arg6) && sub_GAME_7F0301FC(self, arg3, sp4C, arg4, arg5, arg6)) { @@ -9231,7 +8725,7 @@ s32 sub_GAME_7F0305E0(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return sp48; } @@ -9325,12 +8819,12 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp94 = 1.2f * (arg7 * spA0.f[0]); sp90 = 1.2f * (arg7 * spA0.f[2]); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); sub_GAME_7F0B1CC4(); spAC = arg2; - if ((sub_GAME_7F0B0E24( + if ((stanTestLineUnobstructed( &spAC, arg1->f[0], arg1->f[2], @@ -9341,7 +8835,7 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp48, 0.0f, 1.0f) == 0) - || (sub_GAME_7F0B0E24( + || (stanTestLineUnobstructed( &spAC, arg1->f[0] + sp98, arg1->f[2] - sp9C, @@ -9361,7 +8855,7 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * spAC = arg2; - if ((sub_GAME_7F0B0E24( + if ((stanTestLineUnobstructed( &spAC, arg1->f[0], arg1->f[2], @@ -9372,7 +8866,7 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp48, 0.0f, 1.0f) == 0) - || (sub_GAME_7F0B0E24( + || (stanTestLineUnobstructed( &spAC, arg1->f[0] - sp98, arg1->f[2] + sp9C, @@ -9427,8 +8921,8 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * { spAC = arg2; - if (sub_GAME_7F0B0E24(&spAC, arg1->f[0], arg1->f[2], arg3->f[0], arg3->f[2], arg8, sp4C, sp48, 0.0f, 1.0f) - && sub_GAME_7F0B18B8(&spAC, arg3->f[0], arg3->f[2], arg7, arg8, sp4C, sp48) < 0) + if (stanTestLineUnobstructed(&spAC, arg1->f[0], arg1->f[2], arg3->f[0], arg3->f[2], arg8, sp4C, sp48, 0.0f, 1.0f) + && stanTestVolume(&spAC, arg3->f[0], arg3->f[2], arg7, arg8, sp4C, sp48) < 0) { sp50 = 1; } @@ -9439,7 +8933,7 @@ s32 sub_GAME_7F03081C(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return sp50; } @@ -9499,12 +8993,12 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp94 = 1.2f * (arg7 * spA0.f[0]); sp90 = 1.2f * (arg7 * spA0.f[2]); - set_or_unset_GUARDdata_flag(self, 0); + chrSetMoving(self, 0); sub_GAME_7F0B1CC4(); spAC = arg2; - if ((sub_GAME_7F0B0E24( + if ((stanTestLineUnobstructed( &spAC, arg1->f[0], arg1->f[2], @@ -9515,7 +9009,7 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp48, 0.0f, 1.0f) == 0) - || (sub_GAME_7F0B0E24( + || (stanTestLineUnobstructed( &spAC, arg1->f[0] + sp98, arg1->f[2] - sp9C, @@ -9537,7 +9031,7 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * spAC = arg2; - if ((sub_GAME_7F0B0E24( + if ((stanTestLineUnobstructed( &spAC, arg1->f[0], arg1->f[2], @@ -9548,7 +9042,7 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * sp48, 0.0f, 1.0f) == 0) - || (sub_GAME_7F0B0E24( + || (stanTestLineUnobstructed( &spAC, arg1->f[0] - sp98, arg1->f[2] + sp9C, @@ -9615,8 +9109,8 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * { spAC = arg2; - if (sub_GAME_7F0B0E24(&spAC, arg1->f[0], arg1->f[2], arg3->f[0], arg3->f[2], arg8, sp4C, sp48, 0.0f, 1.0f) - && sub_GAME_7F0B18B8(&spAC, arg3->f[0], arg3->f[2], arg7, arg8, sp4C, sp48) < 0) + if (stanTestLineUnobstructed(&spAC, arg1->f[0], arg1->f[2], arg3->f[0], arg3->f[2], arg8, sp4C, sp48, 0.0f, 1.0f) + && stanTestVolume(&spAC, arg3->f[0], arg3->f[2], arg7, arg8, sp4C, sp48) < 0) { sp50 = 1; } @@ -9627,7 +9121,7 @@ s32 sub_GAME_7F030D70(ChrRecord *self, coord3d *arg1, StandTile *arg2, coord3d * } } - set_or_unset_GUARDdata_flag(self, 1); + chrSetMoving(self, 1); return sp50; } @@ -10028,7 +9522,7 @@ void chrlvTravelTick(ChrRecord *self, coord3d *arg1, StandTile *arg2, struct way if (phi_s3 != NULL) { obj = phi_s3->obj; - if (!(obj->flags2 & PROPFLAG_NO_AI_INTERACTION)) + if (!(obj->flags2 & PROPFLAG_DOOR_OPENTOFRONT)) { dx = phi_s3->pos.f[0] - self_prop->pos.f[0]; dy = phi_s3->pos.f[1] - self_prop->pos.f[1]; @@ -10037,7 +9531,7 @@ void chrlvTravelTick(ChrRecord *self, coord3d *arg1, StandTile *arg2, struct way if (((dx * dx) + (dy * dy) + (dz * dz )) < 40000.0f) { sub_GAME_7F0281F4(self); - sub_GAME_7F055B78(self_prop, phi_s3->door); + doorsChooseSwingDirection(self_prop, phi_s3->door); doorActivate(phi_s3->door, 1); if (((self->hidden & CHRHIDDEN_OFFSCREEN_PATROL) == 0) @@ -10480,7 +9974,7 @@ void chrlvAllChrTick(void) for (i=0; imodel != NULL) { @@ -11029,7 +10523,7 @@ bool sub_GAME_7F0333F8(ChrRecord *self) Model *mymodel; coord3d zeropos; coord3d pos; - vec3 vec; + struct coord3d vec; f32 scale; if (chrlvCurrentPlayerCall7F0B0E24(self)) @@ -11038,7 +10532,7 @@ bool sub_GAME_7F0333F8(ChrRecord *self) scale = getinstsize(mymodel) * 0.8f; sub_GAME_7F068190(&zeropos, &pos); getsuboffset(mymodel, &vec); - matrix_4x4_transform_vector_in_place(currentPlayerGetMatrix10CC(), &vec); + mtx4TransformVecInPlace(camGetWorldToScreenMtxf(), &vec); if (sub_GAME_7F041074(&zeropos, &pos, &vec, scale)) { @@ -11231,7 +10725,7 @@ bool check_if_able_to_then_kneel(ChrRecord *self) { if (chrIsNotDeadOrShot(self)) { - chrlvActorKneel(self); + chrKneelChooseAnimation(self); return TRUE; } @@ -11502,7 +10996,7 @@ bool sub_GAME_7F033B38(ChrRecord *self, f32 distance) for (i = 0; i < numguards; i++) { - chr = &ptr_guard_data[i]; + chr = &g_ChrSlots[i]; if ((chr != self) && chr->model && !chrIsDead(chr)) { @@ -11620,36 +11114,38 @@ s32 chrIsTargetNearlyInSight(ChrRecord *self) /** * Address 0x7F033EAC. + * PD: chrIsPosOffScreen */ s32 sub_GAME_7F033EAC(coord3d *arg0, StandTile *arg1) { - bool pass; + bool offscreen; bbox2d sp1C; - pass = TRUE; + offscreen = TRUE; if (getROOMID_Bitflags(getTileRoom(arg1)) && fogPositionIsVisibleThroughFog(arg0, 0.0f)) { if (bgGet2dBboxByRoomId(getTileRoom(arg1), &sp1C)) { - pass = camIsPosInScreenBox(arg0, 200.0f, &sp1C) == 0; + offscreen = camIsPosInScreenBox(arg0, 200.0f, &sp1C) == 0; } else { - pass = sub_GAME_7F078A58(arg0, 200.0f) == 0; + offscreen = sub_GAME_7F078A58(arg0, 200.0f) == 0; } } - return pass; + return offscreen; } /** * Address 0x7F033F48. + * PD: chrAdjustPosForSpawn */ -bool sub_GAME_7F033F48(coord3d *pos, StandTile **arg1, f32 facing, bool b) +bool sub_GAME_7F033F48(coord3d *pos, StandTile **arg1, f32 facing, bool allowonscreen) { - coord3d angle; + coord3d testpos; StandTile *s; s32 i; StandTile **spp; @@ -11657,28 +11153,28 @@ bool sub_GAME_7F033F48(coord3d *pos, StandTile **arg1, f32 facing, bool b) s = *arg1; spp = &s; - if ((sub_GAME_7F0B18B8(spp, pos->f[0], pos->z, 20.0f, 0x1F, 0.0f, 1.0f) < 0) && - (b || sub_GAME_7F033EAC(pos, *arg1))) + if ((stanTestVolume(spp, pos->f[0], pos->z, 20.0f, 0x1F, 0.0f, 1.0f) < 0) && + (allowonscreen || sub_GAME_7F033EAC(pos, *arg1))) { return TRUE; } for (i = 0; i < 8; i++) { - angle.f[0] = pos->f[0] + (sinf(facing) * 60.0f); - angle.f[1] = pos->f[1]; - angle.f[2] = pos->f[2] + (cosf(facing) * 60.0f); + testpos.f[0] = pos->f[0] + (sinf(facing) * 60.0f); + testpos.f[1] = pos->f[1]; + testpos.f[2] = pos->f[2] + (cosf(facing) * 60.0f); s = *arg1; - if (sub_GAME_7F0B0E24(spp, pos->f[0], pos->f[2], angle.f[0], angle.f[2], 0x13, 0.0f, 1.0f, 0.0f, 1.0f) - && (sub_GAME_7F0B18B8(spp, angle.f[0], angle.f[2], 20.0f, 0x1F, 0.0f, 1.0f) < 0) - && (b || sub_GAME_7F033EAC(&angle, s))) + if (stanTestLineUnobstructed(spp, pos->f[0], pos->f[2], testpos.f[0], testpos.f[2], 0x13, 0.0f, 1.0f, 0.0f, 1.0f) + && (stanTestVolume(spp, testpos.f[0], testpos.f[2], 20.0f, 0x1F, 0.0f, 1.0f) < 0) + && (allowonscreen || sub_GAME_7F033EAC(&testpos, s))) { *arg1 = s; - pos->f[0] = angle.f[0]; //send back upstream - pos->f[2] = angle.f[2]; + pos->f[0] = testpos.f[0]; //send back upstream + pos->f[2] = testpos.f[2]; return TRUE; } @@ -11698,8 +11194,9 @@ bool sub_GAME_7F033F48(coord3d *pos, StandTile **arg1, f32 facing, bool b) /** * Address 0x7F03415C. + * PD: chrSpawnAtCoord */ -PropRecord *actionblock_guard_constructor_BDBE(s32 bodynum, s32 headnum, coord3d *pos, StandTile *stan, f32 yrot, AIListRecord *ailist, s32 arg5) +PropRecord *chrSpawnAtCoord(s32 bodynum, s32 headnum, coord3d *pos, StandTile *stan, f32 angle, AIListRecord *ailist, s32 spawnflags) { PropRecord *chrprop; coord3d newpos; //struct copy here would have been more efficient @@ -11711,7 +11208,7 @@ PropRecord *actionblock_guard_constructor_BDBE(s32 bodynum, s32 headnum, coord3d { if (headnum < 0) { - headnum = select_psuedorandom_heads(bodynum); + headnum = bodyChooseHead(bodynum); } newpos.x = pos->x; @@ -11719,13 +11216,13 @@ PropRecord *actionblock_guard_constructor_BDBE(s32 bodynum, s32 headnum, coord3d newpos.z = pos->z; stancopy = stan; - if (sub_GAME_7F033F48(&newpos, &stancopy, yrot, ((arg5 & 0x10) != 0))) + if (sub_GAME_7F033F48(&newpos, &stancopy, angle, ((spawnflags & 0x10) != 0))) { - chrHeader = retrieve_header_for_body_and_head(bodynum, headnum, arg5); + chrHeader = retrieve_header_for_body_and_head(bodynum, headnum, spawnflags); if (chrHeader != NULL) { - chrprop = replace_GUARDdata_with_actual_values(chrHeader, &newpos, yrot, stancopy, ailist); + chrprop = chrAllocate(chrHeader, &newpos, angle, stancopy, ailist); if (chrprop != NULL) { @@ -11765,7 +11262,7 @@ PropRecord *chrSpawnAtPad(ChrRecord *self, s32 bodynum, s32 headnum, s32 padid, #ifdef ENABLE_LOG osSyncPrintf("%s%s new char x = %f, y = %f, z = %f \n", "", "", pad->pos.x, pad->pos.y, pad->pos.z); #endif - return actionblock_guard_constructor_BDBE(bodynum, headnum, &pad->pos, pad->stan, atan2f(pad->look.f[0], pad->look.f[2]), ailist, flags); + return chrSpawnAtCoord(bodynum, headnum, &pad->pos, pad->stan, atan2f(pad->look.f[0], pad->look.f[2]), ailist, flags); } @@ -11783,7 +11280,7 @@ PropRecord *chrSpawnAtChr(ChrRecord *self, s32 bodynum, s32 headnum, s32 chrnum, f32 chrRadHeading = getsubroty(chr->model); PropRecord *chrprop = chr->prop; - return actionblock_guard_constructor_BDBE(bodynum, headnum, &chrprop->pos, chrprop->stan, chrRadHeading, ailist, flags); + return chrSpawnAtCoord(bodynum, headnum, &chrprop->pos, chrprop->stan, chrRadHeading, ailist, flags); } return NULL; @@ -11886,7 +11383,7 @@ bool chrTryStartAlarm(ChrRecord *self, s32 PadId) if (objinst && objIsHealthy(objinst)) { - chrlvExtendLeftHandAnimationRelated(self); + chrStartAlarmChooseAnimation(self); return TRUE; } diff --git a/src/game/chrlv.h b/src/game/chrlv.h index 27ecda4b..d2c618c0 100644 --- a/src/game/chrlv.h +++ b/src/game/chrlv.h @@ -47,14 +47,14 @@ Model * retrieve_header_for_body_and_head(s32 body, s32 head, u32 bitflags); s32 get_current_random_body(void); -s32 select_psuedorandom_heads(s32 id); +s32 bodyChooseHead(s32 id); s32 get_random_head(s32 id); f32 chrGetDistanceToBond(ChrRecord *guardData); s32 chrCheckTargetInSight(ChrRecord *self); bool actor_fire_or_aim_at_target_update(ChrRecord *self, s32 newtargettype, s32 newtargetid); void chrlvAlertGuardToPlayerPosition(ChrRecord *); -void chrlvIdleAnimationRelated7F023A94(ChrRecord *arg0, f32 duration); +void chrlvIdleAnimationRelated7F023A94(ChrRecord *self, f32 mergetime); f32 chrGetAngleToBond(ChrRecord *arg0); s32 chrHasStoppedOrPatroling(ChrRecord *); s32 chrResolvePadId(ChrRecord *guardData,s32 padNo); @@ -80,7 +80,7 @@ bool if_actor_able_set_on_path(ChrRecord *self, s32 pathid); f32 chrlvGetSubrotySideback(ChrRecord *arg0); f32 chrlvGetAimLimitAngle(f32 arg0); void chrlvUpdateAimendbackShoulders(ChrRecord *arg0, void *arg1, s32 same, s32 swap, f32 next); -void sub_GAME_7F02D118(ChrRecord *arg0, s32 hand, s32 arg2); +void chrSetFiring(ChrRecord *arg0, s32 hand, s32 firing); s32 sub_GAME_7F02D630(ChrRecord *arg0, GUNHAND hand, coord3d *arg2); void chrlvTriggerFireWeapon(ChrRecord *arg0); s32 chrlvGeometryRelated7F02FC34(coord3d *arg0, coord3d *arg1, coord3d *arg2, f32 arg3); diff --git a/src/game/chrobjdata.h b/src/game/chrobjdata.h index 5177b274..5662a9ab 100644 --- a/src/game/chrobjdata.h +++ b/src/game/chrobjdata.h @@ -568,5 +568,4 @@ extern struct ChrModelFileRecord c_item_entries[]; extern struct ModelSkeleton SKELETON(guard); extern struct ModelSkeleton SKELETON(suit_lf_hand); -extern struct object_weapon blank_08_object_preset_1[]; #endif diff --git a/src/game/chrobjhandler.c b/src/game/chrobjhandler.c index d955e6d8..feae19f5 100644 --- a/src/game/chrobjhandler.c +++ b/src/game/chrobjhandler.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "bg.h" #include "bondview.h" #include "bondinv.h" @@ -29,6 +30,16 @@ #include "quaternion.h" #include #include "stan.h" +#include "assets/obseg/text/LpropobjE.h" +#include "explosions.h" +#include "image_bank.h" +#include "random.h" +#include "unk_0B3200.h" +#include "textrelated.h" +#include "gun.h" +#include "fr.h" +#include "objective_status.h" + #ifdef VERSION_EU @@ -36,14 +47,24 @@ #define CHROBJ_TIMETOREGEN_F 50.0f #define CHROBJ_GAS_TIMER 0x5dc /* 1500 */ +#define PLASTIQUE_EXPLOSION_DELAY_TICKS 100 + #else #define CHROBJ_TIMETOREGEN 60 #define CHROBJ_TIMETOREGEN_F 60.0f #define CHROBJ_GAS_TIMER 0x708 /* 1800 */ +#define PLASTIQUE_EXPLOSION_DELAY_TICKS 120 #endif + + +#define PROXIMITY_MINE_TRIGGER_DISTANCE 62500.0f + + + + s32 alarm_timer = 0; s32 *ptr_alarm_sfx = 0; f32 toxic_gas_sound_timer = 0.0; @@ -55,18 +76,18 @@ ALSoundState *ptr_gas_sound = NULL; s32 clock_drawn_flag = 1; s32 clock_enable = 0; f32 clock_time = 0; -s32 D_80030AF4 = 0; -s32 D_80030AF8 = 0; // numbers between 0 and 30 -s32 D_80030AFC = 0; +s32 g_RemoteMineOwnerTriggerFlag = 0; +s32 g_NextWeaponSlot = 0; // numbers between 0 and 30 +s32 g_NextHatSlot = 0; ObjectRecord *g_LevelLoadPropSwitch = NULL; -ObjectRecord *g_LevelLoadPropLockDoor = NULL; +LockDoorRecord *g_LevelLoadPropLockDoor = NULL; ObjectRecord *g_LevelLoadPropSafeItem = NULL; -s32 D_80030B0C = 0; +struct PropRecord * D_80030B0C = NULL; s32 bodypartshot = 0xFFFFFFFF; f32 F_80030B14 = 1.0; f32 F_80030B18 = 1.0; -f32 F_80030B1C = 1.0; -f32 F_80030B20 = 1.0; +f32 g_AutogunPendingDamageTick = 1.0; +f32 g_AutogunDamageScalar = 1.0; f32 F_80030B24 = 1.0; /* @@ -76,10 +97,7 @@ f32 g_SoloAmmoMultiplier = 1.0; s16 Throwing_knife_SFX[] = {0x5F, 0x60, 0x61}; -u32 D_80030B34[] = { - 0, 1, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; +struct unk_joint_list D_80030B34 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; @@ -800,568 +818,193 @@ u32 monAnim35Taser[] = { MONLOOP() }; - /** * Address 0x80031FD0. */ struct unk_joint_list D_80031FD0 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; -u32 D_80032010 = 0; -u32 D_80032014 = 0; -u32 D_80032018 = 0; -u32 D_8003201C = 0; -u32 D_80032020 = 0; -u32 D_80032024 = 0; -u32 D_80032028 = 0; -u32 D_8003202C = 0; -u32 D_80032030 = 0; -u32 D_80032034 = 0; -u32 D_80032038 = 0; -u32 D_8003203C = 0; -u32 D_80032040 = 0; -u32 D_80032044 = 0; -u32 D_80032048 = 0; - -u32 D_8003204C = 0x7FFF; -u32 D_80032050 = 0x7FFF; -u32 D_80032054 = 0x7FFF; -u32 D_80032058 = 0xFFFF8000; -u32 D_8003205C = 0xFFFF8000; -u32 D_80032060 = 0xFFFF8000; -u32 D_80032064 = 0; -u32 D_80032068 = 0; -u32 D_8003206C = 0; -u32 D_80032070 = 0x7FFF; -u32 D_80032074 = 0x7FFF; -u32 D_80032078 = 0x7FFF; -u32 D_8003207C = 0xFFFF8000; -u32 D_80032080 = 0xFFFF8000; -u32 D_80032084 = 0xFFFF8000; -u32 D_80032088 = 0; -u32 D_8003208C = 0; -u32 D_80032090 = 0; - -object_standard blank_07_object[] = { - 0x0100, 00, 07, - 0x0000,0xFFFF, - 1, - 0, - 0, - 0, - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - 0.0, 0.0, 0.0, - 0x00000000, - 0, - 0, - 0, - 0x447A,0x0000, - 0xFFFFFF00, - 0xFFFFFF00 -}; - -object_standard blank_11_object[] = { - 0x0100,0x0, 0x11, - 0, 0, - 0x00004000, - 0, - 0, - 0, - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - 0.0, 0.0, 0.0, - 0x00000000, - 0, - 0, - 0.0, - 0x447A,0x0000, - 0xFFFFFF00, - 0xFFFFFF00 -}; - -object_weapon blank_08_object_preset_1[] = { - 0x0100,0x0,0x08, - 0, 1, - 0x00000000, - 0, - 0, - 0, - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - 0.0, 0.0, 0.0, - 0x00000000, - 0, - 0, - 0.0, - 0x447A,0x0000, - 0xFFFFFF00, - 0xFFFFFF00, - 0x0, - 0xFF, - 0xFFFF, - 00000000 -}; - -object_weapon blank_08_object_preset_4001[] = { - 0x0100,0x0,0x08, - 0, 0x4001, - 0x00000000, - 0, - 0, - 0, - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - 0.0, 0.0, 0.0, - 0x00000000, - 0, - 0, - 0.0, - 0x447A,0x0000, - 0xFFFFFF00, - 0xFFFFFF00, - 0x0, - 0xFF, - 0xFFFF, - 00000000 -}; - - -u32 D_800322A4 = 0; - -u32 D_800322A8[] = {1, 3}; -u32 D_800322B0[] = {0, 0, 0, 0}; -u32 D_800322C0[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - // Forward declarations. s32 updateDoorDisplacement(DoorRecord* door); -s32 sub_GAME_7F03FF60(ObjectRecord *); +s32 objGetShotsTaken(ObjectRecord *); void sub_GAME_7F04AC20(PropRecord *prop, struct unk_joint_list *, s32 arg2); -s32 sub_GAME_7F044414(struct rect4f *arg0, s32 arg1, struct rect4f *arg2, s32 arg3); - -//rodata - - -#ifdef NONMATCHING -void sub_GAME_7F03FB70(void* arg0) { - s32 temp_a0; - s32 temp_a0_2; +bool sub_GAME_7F044414(rect4f* rect1, s32 numvertices0, rect4f* rect2, s32 numvertices1); +void chrobjSndCreatePostEvent(ALSoundState *state, coord3d *pos, f32 low, f32 high); +void sub_GAME_7F050DE8(Model* model); +void remove_obj_from_temp_proxmine_table(WeaponObjRecord* proxy); +void add_obj_to_temp_proxmine_table(WeaponObjRecord* proxy); +s32 sub_GAME_7F042EB4(struct ObjectRecord *arg0, f32 *arg1, struct coord3d *arg2, struct coord3d *arg3, s32 arg4, s32 arg5); +s32 sub_GAME_7F042A0C(struct ObjectRecord *arg0, f32 *arg1, struct coord3d *arg2, struct coord3d *arg3, s32 arg4); +s32 handles_projectile_motion(struct ObjectRecord *arg0, f32 *arg1, struct coord3d *arg2, struct coord3d *arg3, s32 arg4, s32 arg5); +void sub_GAME_7F0431E4(struct ObjectRecord *arg0, struct coord3d *arg1); +void sub_GAME_7F054FB4(struct DoorRecord *arg0); + +/* PD: projectileFree (similar but not the same structure) */ +void projectileFree(Projectile* projectile) +{ + ALSoundState* sound1; + ALSoundState* sound2; - if ((arg0->unk0 & 0x80) != 0) { - temp_a0 = arg0->unk98; - if ((temp_a0 != 0) && (sndGetPlayingState(temp_a0) != 0)) { - sndDeactivate(arg0->unk98); + if (projectile->flags & PROJECTILEFLAG_LAUNCHING) + { + sound1 = projectile->sound1; + if ((sound1 != 0) && (sndGetPlayingState((ALSoundState* ) sound1) != 0)) + { + sndDeactivate((ALSoundState* ) projectile->sound1); } - temp_a0_2 = arg0->unk9C; - if ((temp_a0_2 != 0) && (sndGetPlayingState(temp_a0_2) != 0)) { - sndDeactivate(arg0->unk9C); + + sound2 = projectile->sound2; + if ((sound2 != 0) && (sndGetPlayingState((ALSoundState* ) sound2) != 0)) + { + sndDeactivate((ALSoundState* ) projectile->sound2); } } - arg0->unk0 = (s32) (arg0->unk0 | 0x80000000); + projectile->flags |= PROJECTILEFLAG_FREE; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03FB70 -/* 0746A0 7F03FB70 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0746A4 7F03FB74 AFBF001C */ sw $ra, 0x1c($sp) -/* 0746A8 7F03FB78 AFB00018 */ sw $s0, 0x18($sp) -/* 0746AC 7F03FB7C 8C8E0000 */ lw $t6, ($a0) -/* 0746B0 7F03FB80 00808025 */ move $s0, $a0 -/* 0746B4 7F03FB84 31CF0080 */ andi $t7, $t6, 0x80 -/* 0746B8 7F03FB88 51E00014 */ beql $t7, $zero, .L7F03FBDC -/* 0746BC 7F03FB8C 8E180000 */ lw $t8, ($s0) -/* 0746C0 7F03FB90 8C840098 */ lw $a0, 0x98($a0) -/* 0746C4 7F03FB94 50800008 */ beql $a0, $zero, .L7F03FBB8 -/* 0746C8 7F03FB98 8E04009C */ lw $a0, 0x9c($s0) -/* 0746CC 7F03FB9C 0C00237C */ jal sndGetPlayingState -/* 0746D0 7F03FBA0 00000000 */ nop -/* 0746D4 7F03FBA4 50400004 */ beql $v0, $zero, .L7F03FBB8 -/* 0746D8 7F03FBA8 8E04009C */ lw $a0, 0x9c($s0) -/* 0746DC 7F03FBAC 0C002408 */ jal sndDeactivate -/* 0746E0 7F03FBB0 8E040098 */ lw $a0, 0x98($s0) -/* 0746E4 7F03FBB4 8E04009C */ lw $a0, 0x9c($s0) -.L7F03FBB8: -/* 0746E8 7F03FBB8 50800008 */ beql $a0, $zero, .L7F03FBDC -/* 0746EC 7F03FBBC 8E180000 */ lw $t8, ($s0) -/* 0746F0 7F03FBC0 0C00237C */ jal sndGetPlayingState -/* 0746F4 7F03FBC4 00000000 */ nop -/* 0746F8 7F03FBC8 50400004 */ beql $v0, $zero, .L7F03FBDC -/* 0746FC 7F03FBCC 8E180000 */ lw $t8, ($s0) -/* 074700 7F03FBD0 0C002408 */ jal sndDeactivate -/* 074704 7F03FBD4 8E04009C */ lw $a0, 0x9c($s0) -/* 074708 7F03FBD8 8E180000 */ lw $t8, ($s0) -.L7F03FBDC: -/* 07470C 7F03FBDC 3C018000 */ lui $at, 0x8000 -/* 074710 7F03FBE0 0301C825 */ or $t9, $t8, $at -/* 074714 7F03FBE4 AE190000 */ sw $t9, ($s0) -/* 074718 7F03FBE8 8FBF001C */ lw $ra, 0x1c($sp) -/* 07471C 7F03FBEC 8FB00018 */ lw $s0, 0x18($sp) -/* 074720 7F03FBF0 27BD0020 */ addiu $sp, $sp, 0x20 -/* 074724 7F03FBF4 03E00008 */ jr $ra -/* 074728 7F03FBF8 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -/* matches according to decomp.me, I believe it doesn't build yet because the asm references label 'D_80052A48', which is defined elsewhere */ -void sub_GAME_7F03FBFC(struct bss_80073DC0 *arg0) +void projectileReset(Projectile *projectile) { - arg0->unk00 = 0; - arg0->unk04 = 0.0f; - arg0->unk08 = 0.0f; - arg0->unk0C = 0.0f; - arg0->unk10 = 0.0f; - arg0->unk14 = 0.0f; - arg0->unk18 = 0.0f; - arg0->unk1C = 0.0f; - arg0->unk60 = 1.0f; - arg0->unk88 = 0; - arg0->unk8C = 0.05f; - arg0->unk90 = 0; - arg0->unk94 = 0.0f; - arg0->unkA0 = -1; - arg0->unkA4 = 0; - arg0->unkA8 = 0; - arg0->unkAC = -1; - arg0->unkB8 = 1; - arg0->unkBC = 0; - arg0->unkC0 = 1.0f; - arg0->unkC4 = 1.0f; - arg0->unkC8 = 1.0f; - arg0->unkE0 = 0; - arg0->unkE4 = 0; - arg0->unkE8 = 0; + projectile->flags = 0; + + projectile->speed.x = 0.0f; + projectile->speed.y = 0.0f; + projectile->speed.z = 0.0f; + + projectile->unk10.x = 0.0f; + projectile->unk10.y = 0.0f; + projectile->unk10.z = 0.0f; + + projectile->unk1C = 0.0f; + + projectile->unk60 = 1.0f; + projectile->ownerprop = NULL; + projectile->unk8C = 0.05f; + projectile->unk90 = 0; + projectile->unk94 = 0.0f; + projectile->unkA0 = -1; + projectile->unkA4 = 0; + projectile->unkA8 = 0; + projectile->unkAC = -1; + projectile->droptype = DROPTYPE_DEFAULT; + projectile->refreshrate = 0; + projectile->unkC0 = 1.0f; + projectile->unkC4 = 1.0f; + projectile->unkC8 = 1.0f; + projectile->unkE0 = 0; + projectile->obj = 0; + projectile->unkE8 = 0; } -#else -GLOBAL_ASM( - -.text -glabel sub_GAME_7F03FBFC -/* 07472C 7F03FBFC 44800000 */ mtc1 $zero, $f0 -/* 074730 7F03FC00 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 074734 7F03FC04 44811000 */ mtc1 $at, $f2 -/* 074738 7F03FC08 AC800000 */ sw $zero, ($a0) -/* 07473C 7F03FC0C AC800088 */ sw $zero, 0x88($a0) -/* 074740 7F03FC10 3C018005 */ lui $at, %hi(D_80052A48) -/* 074744 7F03FC14 E4800004 */ swc1 $f0, 4($a0) -/* 074748 7F03FC18 E4800008 */ swc1 $f0, 8($a0) -/* 07474C 7F03FC1C E480000C */ swc1 $f0, 0xc($a0) -/* 074750 7F03FC20 E4800010 */ swc1 $f0, 0x10($a0) -/* 074754 7F03FC24 E4800014 */ swc1 $f0, 0x14($a0) -/* 074758 7F03FC28 E4800018 */ swc1 $f0, 0x18($a0) -/* 07475C 7F03FC2C E480001C */ swc1 $f0, 0x1c($a0) -/* 074760 7F03FC30 E4820060 */ swc1 $f2, 0x60($a0) -/* 074764 7F03FC34 C4242A48 */ lwc1 $f4, %lo(D_80052A48)($at) -/* 074768 7F03FC38 2402FFFF */ li $v0, -1 -/* 07476C 7F03FC3C 240E0001 */ li $t6, 1 -/* 074770 7F03FC40 AC800090 */ sw $zero, 0x90($a0) -/* 074774 7F03FC44 AC8200A0 */ sw $v0, 0xa0($a0) -/* 074778 7F03FC48 AC8000A4 */ sw $zero, 0xa4($a0) -/* 07477C 7F03FC4C AC8000A8 */ sw $zero, 0xa8($a0) -/* 074780 7F03FC50 AC8200AC */ sw $v0, 0xac($a0) -/* 074784 7F03FC54 AC8E00B8 */ sw $t6, 0xb8($a0) -/* 074788 7F03FC58 AC8000BC */ sw $zero, 0xbc($a0) -/* 07478C 7F03FC5C AC8000E0 */ sw $zero, 0xe0($a0) -/* 074790 7F03FC60 AC8000E4 */ sw $zero, 0xe4($a0) -/* 074794 7F03FC64 AC8000E8 */ sw $zero, 0xe8($a0) -/* 074798 7F03FC68 E4800094 */ swc1 $f0, 0x94($a0) -/* 07479C 7F03FC6C E48200C0 */ swc1 $f2, 0xc0($a0) -/* 0747A0 7F03FC70 E48200C4 */ swc1 $f2, 0xc4($a0) -/* 0747A4 7F03FC74 E48200C8 */ swc1 $f2, 0xc8($a0) -/* 0747A8 7F03FC78 03E00008 */ jr $ra -/* 0747AC 7F03FC7C E484008C */ swc1 $f4, 0x8c($a0) -) -#endif +Projectile *projectileAllocate(void) +{ + s32 bestindex; + s32 i; + bestindex = -1; + // Happy path - find one that is already free + for (i = 0; i < PROJECTILES_ARR_MAX; i++) + { + if (g_Projectiles[i].flags & PROJECTILEFLAG_FREE) + { + projectileReset(g_Projectiles + i); + return (g_Projectiles + i); + } + } + // Find one with the lowest unkE8 (some kind of age/timer?) + // and some other conditions + for (i = 0; i < PROJECTILES_ARR_MAX; i++) + { + if (g_Projectiles[i].obj && (bestindex < 0 || g_Projectiles[i].unkE8 < g_Projectiles[bestindex].unkE8)) + { + bestindex = i; + } + } -#ifdef NONMATCHING -void sub_GAME_7F03FC80(void) { + if (bestindex >= 0) + { + // Reset and return it + objFreeEmbedmentOrProjectile(g_Projectiles[bestindex].obj->prop); + g_Projectiles[bestindex].obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; + projectileReset(g_Projectiles + bestindex); + return (g_Projectiles + bestindex); + } + else + { + return NULL; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03FC80 -/* 0747B0 7F03FC80 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0747B4 7F03FC84 3C028007 */ lui $v0, %hi(dword_CODE_bss_80073DC0) -/* 0747B8 7F03FC88 3C048007 */ lui $a0, %hi(dword_CODE_bss_80075030) -/* 0747BC 7F03FC8C AFBF0014 */ sw $ra, 0x14($sp) -/* 0747C0 7F03FC90 2406FFFF */ li $a2, -1 -/* 0747C4 7F03FC94 24845030 */ addiu $a0, %lo(dword_CODE_bss_80075030) # addiu $a0, $a0, 0x5030 -/* 0747C8 7F03FC98 24423DC0 */ addiu $v0, %lo(dword_CODE_bss_80073DC0) # addiu $v0, $v0, 0x3dc0 -/* 0747CC 7F03FC9C 00002825 */ move $a1, $zero -/* 0747D0 7F03FCA0 3C038000 */ lui $v1, 0x8000 -.L7F03FCA4: -/* 0747D4 7F03FCA4 8C4E0000 */ lw $t6, ($v0) -/* 0747D8 7F03FCA8 244200EC */ addiu $v0, $v0, 0xec -/* 0747DC 7F03FCAC 0044082B */ sltu $at, $v0, $a0 -/* 0747E0 7F03FCB0 01C37824 */ and $t7, $t6, $v1 -/* 0747E4 7F03FCB4 11E00007 */ beqz $t7, .L7F03FCD4 -/* 0747E8 7F03FCB8 3C078007 */ lui $a3, %hi(dword_CODE_bss_80073DC0) -/* 0747EC 7F03FCBC 24E73DC0 */ addiu $a3, %lo(dword_CODE_bss_80073DC0) # addiu $a3, $a3, 0x3dc0 -/* 0747F0 7F03FCC0 00E52021 */ addu $a0, $a3, $a1 -/* 0747F4 7F03FCC4 0FC0FEFF */ jal sub_GAME_7F03FBFC -/* 0747F8 7F03FCC8 AFA40020 */ sw $a0, 0x20($sp) -/* 0747FC 7F03FCCC 10000032 */ b .L7F03FD98 -/* 074800 7F03FCD0 8FA20020 */ lw $v0, 0x20($sp) -.L7F03FCD4: -/* 074804 7F03FCD4 1420FFF3 */ bnez $at, .L7F03FCA4 -/* 074808 7F03FCD8 24A500EC */ addiu $a1, $a1, 0xec -/* 07480C 7F03FCDC 3C028007 */ lui $v0, %hi(dword_CODE_bss_80073DC0) -/* 074810 7F03FCE0 3C078007 */ lui $a3, %hi(dword_CODE_bss_80073DC0) -/* 074814 7F03FCE4 24E73DC0 */ addiu $a3, %lo(dword_CODE_bss_80073DC0) # addiu $a3, $a3, 0x3dc0 -/* 074818 7F03FCE8 24423DC0 */ addiu $v0, %lo(dword_CODE_bss_80073DC0) # addiu $v0, $v0, 0x3dc0 -/* 07481C 7F03FCEC 00001825 */ move $v1, $zero -/* 074820 7F03FCF0 240500EC */ li $a1, 236 -/* 074824 7F03FCF4 24040014 */ li $a0, 20 -.L7F03FCF8: -/* 074828 7F03FCF8 8C5800E4 */ lw $t8, 0xe4($v0) -/* 07482C 7F03FCFC 5300000D */ beql $t8, $zero, .L7F03FD34 -/* 074830 7F03FD00 24630001 */ addiu $v1, $v1, 1 -/* 074834 7F03FD04 04C2000A */ bltzl $a2, .L7F03FD30 -/* 074838 7F03FD08 00603025 */ move $a2, $v1 -/* 07483C 7F03FD0C 00C50019 */ multu $a2, $a1 -/* 074840 7F03FD10 8C5900E8 */ lw $t9, 0xe8($v0) -/* 074844 7F03FD14 00004812 */ mflo $t1 -/* 074848 7F03FD18 00E95021 */ addu $t2, $a3, $t1 -/* 07484C 7F03FD1C 8D4B00E8 */ lw $t3, 0xe8($t2) -/* 074850 7F03FD20 032B082A */ slt $at, $t9, $t3 -/* 074854 7F03FD24 50200003 */ beql $at, $zero, .L7F03FD34 -/* 074858 7F03FD28 24630001 */ addiu $v1, $v1, 1 -/* 07485C 7F03FD2C 00603025 */ move $a2, $v1 -.L7F03FD30: -/* 074860 7F03FD30 24630001 */ addiu $v1, $v1, 1 -.L7F03FD34: -/* 074864 7F03FD34 1464FFF0 */ bne $v1, $a0, .L7F03FCF8 -/* 074868 7F03FD38 244200EC */ addiu $v0, $v0, 0xec -/* 07486C 7F03FD3C 04C00016 */ bltz $a2, .L7F03FD98 -/* 074870 7F03FD40 00001025 */ move $v0, $zero -/* 074874 7F03FD44 00C50019 */ multu $a2, $a1 -/* 074878 7F03FD48 00001812 */ mflo $v1 -/* 07487C 7F03FD4C 00E34021 */ addu $t0, $a3, $v1 -/* 074880 7F03FD50 8D0C00E4 */ lw $t4, 0xe4($t0) -/* 074884 7F03FD54 8D840010 */ lw $a0, 0x10($t4) -/* 074888 7F03FD58 AFA80020 */ sw $t0, 0x20($sp) -/* 07488C 7F03FD5C 0FC1033C */ jal sub_GAME_7F040CF0 -/* 074890 7F03FD60 AFA30024 */ sw $v1, 0x24($sp) -/* 074894 7F03FD64 8FA80020 */ lw $t0, 0x20($sp) -/* 074898 7F03FD68 8FA30024 */ lw $v1, 0x24($sp) -/* 07489C 7F03FD6C 3C078007 */ lui $a3, %hi(dword_CODE_bss_80073DC0) -/* 0748A0 7F03FD70 8D0200E4 */ lw $v0, 0xe4($t0) -/* 0748A4 7F03FD74 24E73DC0 */ addiu $a3, %lo(dword_CODE_bss_80073DC0) # addiu $a3, $a3, 0x3dc0 -/* 0748A8 7F03FD78 00E32021 */ addu $a0, $a3, $v1 -/* 0748AC 7F03FD7C 8C4D0064 */ lw $t5, 0x64($v0) -/* 0748B0 7F03FD80 35AE0004 */ ori $t6, $t5, 4 -/* 0748B4 7F03FD84 AC4E0064 */ sw $t6, 0x64($v0) -/* 0748B8 7F03FD88 0FC0FEFF */ jal sub_GAME_7F03FBFC -/* 0748BC 7F03FD8C AFA4001C */ sw $a0, 0x1c($sp) -/* 0748C0 7F03FD90 10000001 */ b .L7F03FD98 -/* 0748C4 7F03FD94 8FA2001C */ lw $v0, 0x1c($sp) -.L7F03FD98: -/* 0748C8 7F03FD98 8FBF0014 */ lw $ra, 0x14($sp) -/* 0748CC 7F03FD9C 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0748D0 7F03FDA0 03E00008 */ jr $ra -/* 0748D4 7F03FDA4 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING void sub_GAME_7F03FDA8(PropRecord *prop) { - ObjectRecord *sp1C; - s32 temp_v0; - struct - { - u32 id; - coord3d pos; - vec3d vec; - u32 padding; - float m[4][4]; - } * temp_v0_2; - ObjectRecord *temp_v1; + ObjectRecord *obj = prop->obj; - temp_v1 = prop->obj; - temp_v0 = temp_v1->runtime_bitflags; - if ((temp_v0 & 0x40) != 0) + if (obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) { - sp1C = temp_v1; - temp_v1->unk6C->m[2][1] = (bitwise f32)sub_GAME_7F03FC80(); - return; + obj->embedment->projectile = projectileAllocate(); } - if ((temp_v0 & 0x80) == 0) + else if ((obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0) { - sp1C = temp_v1; - temp_v0_2 = sub_GAME_7F03FC80(); - temp_v1->unk6C = temp_v0_2; - if (temp_v0_2 != 0) + obj->projectile = projectileAllocate(); + + if (obj->projectile) { - temp_v1->runtime_bitflags |= 0x80; + obj->runtime_bitflags |= RUNTIMEBITFLAG_DEPOSIT; } } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03FDA8 -/* 0748D8 7F03FDA8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0748DC 7F03FDAC AFBF0014 */ sw $ra, 0x14($sp) -/* 0748E0 7F03FDB0 8C830004 */ lw $v1, 4($a0) -/* 0748E4 7F03FDB4 8C620064 */ lw $v0, 0x64($v1) -/* 0748E8 7F03FDB8 304E0040 */ andi $t6, $v0, 0x40 -/* 0748EC 7F03FDBC 11C00007 */ beqz $t6, .L7F03FDDC -/* 0748F0 7F03FDC0 30580080 */ andi $t8, $v0, 0x80 -/* 0748F4 7F03FDC4 0FC0FF20 */ jal sub_GAME_7F03FC80 -/* 0748F8 7F03FDC8 AFA3001C */ sw $v1, 0x1c($sp) -/* 0748FC 7F03FDCC 8FA3001C */ lw $v1, 0x1c($sp) -/* 074900 7F03FDD0 8C6F006C */ lw $t7, 0x6c($v1) -/* 074904 7F03FDD4 1000000B */ b .L7F03FE04 -/* 074908 7F03FDD8 ADE20044 */ sw $v0, 0x44($t7) -.L7F03FDDC: -/* 07490C 7F03FDDC 5700000A */ bnezl $t8, .L7F03FE08 -/* 074910 7F03FDE0 8FBF0014 */ lw $ra, 0x14($sp) -/* 074914 7F03FDE4 0FC0FF20 */ jal sub_GAME_7F03FC80 -/* 074918 7F03FDE8 AFA3001C */ sw $v1, 0x1c($sp) -/* 07491C 7F03FDEC 8FA3001C */ lw $v1, 0x1c($sp) -/* 074920 7F03FDF0 10400004 */ beqz $v0, .L7F03FE04 -/* 074924 7F03FDF4 AC62006C */ sw $v0, 0x6c($v1) -/* 074928 7F03FDF8 8C790064 */ lw $t9, 0x64($v1) -/* 07492C 7F03FDFC 37280080 */ ori $t0, $t9, 0x80 -/* 074930 7F03FE00 AC680064 */ sw $t0, 0x64($v1) -.L7F03FE04: -/* 074934 7F03FE04 8FBF0014 */ lw $ra, 0x14($sp) -.L7F03FE08: -/* 074938 7F03FE08 27BD0020 */ addiu $sp, $sp, 0x20 -/* 07493C 7F03FE0C 03E00008 */ jr $ra -/* 074940 7F03FE10 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F03FE14( PropRecord *prop) +void projectileSetSticky(PropRecord *prop) { - s32 temp_a1; - s8 *temp_v0_2; - ObjectRecord *temp_v0; - struct - { - u32 id; - struct coord3d pos; - struct coord3d vec; - u32 padding; - float m[4][4]; - } * phi_v1; + ObjectRecord *obj = prop->obj; + Projectile *projectile = NULL; - temp_v0 = prop->obj; - temp_a1 = temp_v0->runtime_bitflags; - phi_v1 = NULL; - if ((temp_a1 & RUNTIMEBITFLAG_DEPOSIT) != 0) + if (obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) { - phi_v1 = temp_v0->unk6C->m[2][1]; + projectile = obj->embedment->projectile; } - else if ((temp_a1 & RUNTIMEBITFLAG_LAUNCHING) != 0) + else if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - phi_v1 = temp_v0->unk6C; + projectile = obj->projectile; } - if (phi_v1 != 0) + + if (projectile) { - phi_v1->id |= 4; - temp_v0_2 = prop->stanid; - if (temp_v0_2 != 0) + projectile->flags |= PROJECTILEFLAG_STICKY; + if (prop->stan) { - phi_v1->unkCD = 0xFF; - phi_v1->unkCC = temp_v0_2->unk3; + projectile->unkCC = prop->stan->room; + projectile->unkCD = 0xFF; return; } - phi_v1->unkCC = 0xFF; - // Duplicate return node #8. Try simplifying control flow for better match + projectile->unkCC = 0xFFU; } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03FE14 -/* 074944 7F03FE14 8C820004 */ lw $v0, 4($a0) -/* 074948 7F03FE18 00001825 */ move $v1, $zero -/* 07494C 7F03FE1C 8C450064 */ lw $a1, 0x64($v0) -/* 074950 7F03FE20 30AE0040 */ andi $t6, $a1, 0x40 -/* 074954 7F03FE24 11C00004 */ beqz $t6, .L7F03FE38 -/* 074958 7F03FE28 30B80080 */ andi $t8, $a1, 0x80 -/* 07495C 7F03FE2C 8C4F006C */ lw $t7, 0x6c($v0) -/* 074960 7F03FE30 10000004 */ b .L7F03FE44 -/* 074964 7F03FE34 8DE30044 */ lw $v1, 0x44($t7) -.L7F03FE38: -/* 074968 7F03FE38 13000002 */ beqz $t8, .L7F03FE44 -/* 07496C 7F03FE3C 00000000 */ nop -/* 074970 7F03FE40 8C43006C */ lw $v1, 0x6c($v0) -.L7F03FE44: -/* 074974 7F03FE44 1060000E */ beqz $v1, .L7F03FE80 -/* 074978 7F03FE48 00000000 */ nop -/* 07497C 7F03FE4C 8C790000 */ lw $t9, ($v1) -/* 074980 7F03FE50 240A00FF */ li $t2, 255 -/* 074984 7F03FE54 240B00FF */ li $t3, 255 -/* 074988 7F03FE58 37280004 */ ori $t0, $t9, 4 -/* 07498C 7F03FE5C AC680000 */ sw $t0, ($v1) -/* 074990 7F03FE60 8C820014 */ lw $v0, 0x14($a0) -/* 074994 7F03FE64 50400006 */ beql $v0, $zero, .L7F03FE80 -/* 074998 7F03FE68 A06B00CC */ sb $t3, 0xcc($v1) -/* 07499C 7F03FE6C 90490003 */ lbu $t1, 3($v0) -/* 0749A0 7F03FE70 A06A00CD */ sb $t2, 0xcd($v1) -/* 0749A4 7F03FE74 03E00008 */ jr $ra -/* 0749A8 7F03FE78 A06900CC */ sb $t1, 0xcc($v1) - -/* 0749AC 7F03FE7C A06B00CC */ sb $t3, 0xcc($v1) -.L7F03FE80: -/* 0749B0 7F03FE80 03E00008 */ jr $ra -/* 0749B4 7F03FE84 00000000 */ nop -) -#endif - - -void sub_GAME_7F03FE88(u32 *param_1) +void embedmentFree(Embedment *embedment) { - *param_1 = *param_1 | 1; - return; + embedment->flags |= EMBEDMENTFLAG_FREE; } -struct bss_80075030 *monitorthingGetNew(void) +Embedment *embedmentAllocate(void) { s32 i; - for (i = 0; i < BSS_80075030_DATA_LEN; i++) + for (i = 0; i < EMBEDMENT_ARR_MAX; i++) { - if (dword_CODE_bss_80075030[i].unk00 & 1) + if (g_Embedments[i].flags & 1) { - dword_CODE_bss_80075030[i].unk00 = 0; - dword_CODE_bss_80075030[i].unk44 = 0; - return &dword_CODE_bss_80075030[(u32)i]; + g_Embedments[i].flags = 0; + g_Embedments[i].projectile = NULL; + return &g_Embedments[(u32)i]; } } @@ -1369,21 +1012,46 @@ struct bss_80075030 *monitorthingGetNew(void) } -s32 sub_GAME_7F03FF60(ObjectRecord *arg0) +/** + * This doesn't exactly return the number of shots taken but it's the best way + * to describe the behaviour of the function without writing a novel into the + * function's name. + * + * The number returned is 0 when at full health and only ever increments as the + * object takes damage. While healthy, the number scales from 0 to 4 based on + * how close it is to being destroyed, where 4 is destroyed. After being + * destroyed, the number increments at 1 per shot up to a max of 12. + */ + +s32 objGetShotsTaken(ObjectRecord *obj) { - if (!(arg0->state & PROPSTATE_DESTROYED)) + if (!(obj->state & PROPSTATE_DESTROYED)) { - return (arg0->maxdamage * 3.0f) / arg0->damage; + return (obj->maxdamage * 3.0f) / obj->damage; } - return arg0->maxdamage + 4.0f; + return obj->maxdamage + 4.0f; } -/* - * maxdamage / 4 + 1 +/** + * Return 0 if not destroyed + * Return 1 if at destroyed level 1 + * Return 2 if at destroyed level 2 + * Return 3 if at destroyed level 3 + * + * Each destroyed level is a new phase of visual brokenness. Typically the + * object is destroyed and it looks broken (level 1), then after a couple of + * shots it enters level 2, and a few shots later level 3. + * + * While healthy, damage goes from 0 to maxdamage (eg. 1000) but this function + * returns 0 due to the if statement. + * + * When destroyed, damage is reset to 0 then incremented at one unit per shot, + * so four shots causes it to enter a new destroyed level. */ -s32 do_something_if_object_destroyed(ObjectRecord *obj) + +s32 objGetDestroyedLevel(ObjectRecord *obj) { if (!(obj->state & PROPSTATE_DESTROYED)) { @@ -1393,11 +1061,7 @@ s32 do_something_if_object_destroyed(ObjectRecord *obj) } - - - -#ifndef NONMATCHING -ModelRoData_BoundingBoxRecord *sub_GAME_7F03FFF8(ModelFileHeader *obj) +ModelRoData_BoundingBoxRecord *chrobjGetBboxFromObjFile(ModelFileHeader *obj) { ModelNode *mdlnext; @@ -1406,7 +1070,7 @@ ModelRoData_BoundingBoxRecord *sub_GAME_7F03FFF8(ModelFileHeader *obj) //for each next node, check for BBox for (mdlnext = obj->RootNode->Child; mdlnext; mdlnext = mdlnext->Next) { - if (mdlnext->Opcode == MODELNODE_OPCODE_BOUNDINGBOXRECORD) + if (mdlnext->Opcode == MODELNODE_OPCODE_BBOX) { return mdlnext->Data; } @@ -1418,7 +1082,7 @@ ModelRoData_BoundingBoxRecord *sub_GAME_7F03FFF8(ModelFileHeader *obj) //for each next node, check for BBox for (mdlnext = obj->RootNode->Child->Child; mdlnext; mdlnext = mdlnext->Next) { - if (mdlnext->Opcode == MODELNODE_OPCODE_BOUNDINGBOXRECORD) + if (mdlnext->Opcode == MODELNODE_OPCODE_BBOX) { return mdlnext->Data; } @@ -1427,62 +1091,11 @@ ModelRoData_BoundingBoxRecord *sub_GAME_7F03FFF8(ModelFileHeader *obj) } return NULL; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03FFF8 -/* 074B28 7F03FFF8 8C8E0000 */ lw $t6, ($a0) -/* 074B2C 7F03FFFC 8DC20014 */ lw $v0, 0x14($t6) -/* 074B30 7F040000 5040001B */ beql $v0, $zero, .L7F040070 -/* 074B34 7F040004 00001025 */ move $v0, $zero -/* 074B38 7F040008 1040000A */ beqz $v0, .L7F040034 -/* 074B3C 7F04000C 00401825 */ move $v1, $v0 -/* 074B40 7F040010 2405000A */ li $a1, 10 -/* 074B44 7F040014 946F0000 */ lhu $t7, ($v1) -.L7F040018: -/* 074B48 7F040018 54AF0004 */ bnel $a1, $t7, .L7F04002C -/* 074B4C 7F04001C 8C63000C */ lw $v1, 0xc($v1) -/* 074B50 7F040020 03E00008 */ jr $ra -/* 074B54 7F040024 8C620004 */ lw $v0, 4($v1) - -/* 074B58 7F040028 8C63000C */ lw $v1, 0xc($v1) -.L7F04002C: -/* 074B5C 7F04002C 5460FFFA */ bnezl $v1, .L7F040018 -/* 074B60 7F040030 946F0000 */ lhu $t7, ($v1) -.L7F040034: -/* 074B64 7F040034 8C440014 */ lw $a0, 0x14($v0) -/* 074B68 7F040038 2405000A */ li $a1, 10 -/* 074B6C 7F04003C 5080000C */ beql $a0, $zero, .L7F040070 -/* 074B70 7F040040 00001025 */ move $v0, $zero -/* 074B74 7F040044 10800009 */ beqz $a0, .L7F04006C -/* 074B78 7F040048 00801825 */ move $v1, $a0 -/* 074B7C 7F04004C 94780000 */ lhu $t8, ($v1) -.L7F040050: -/* 074B80 7F040050 54B80004 */ bnel $a1, $t8, .L7F040064 -/* 074B84 7F040054 8C63000C */ lw $v1, 0xc($v1) -/* 074B88 7F040058 03E00008 */ jr $ra -/* 074B8C 7F04005C 8C620004 */ lw $v0, 4($v1) - -/* 074B90 7F040060 8C63000C */ lw $v1, 0xc($v1) -.L7F040064: -/* 074B94 7F040064 5460FFFA */ bnezl $v1, .L7F040050 -/* 074B98 7F040068 94780000 */ lhu $t8, ($v1) -.L7F04006C: -/* 074B9C 7F04006C 00001025 */ move $v0, $zero -.L7F040070: -/* 074BA0 7F040070 03E00008 */ jr $ra -/* 074BA4 7F040074 00000000 */ nop -) -#endif - - - - -struct modeldata_unk_pos * sub_GAME_7F040078(ObjectRecord *arg0) +struct ModelRoData_BoundingBoxRecord* chrobjGetBboxFromObjectRecord(ObjectRecord *arg0) { - return (struct modeldata_unk_pos *)sub_GAME_7F03FFF8(arg0->model->obj); + return (struct ModelRoData_BoundingBoxRecord *)chrobjGetBboxFromObjFile(arg0->model->obj); } @@ -1691,34 +1304,34 @@ void sub_GAME_7F040384(rgba_s32* arg0, s32 arg1, rgba_f32* arg2) /** * Address 0x7F040484. */ -void chrobjCollisionRelated(ObjectRecord *arg0) +void chrobjCollisionRelated(ObjectRecord *obj) { - struct modeldata_unk_pos *sp64; + struct ModelRoData_BoundingBoxRecord *bbox; Mtxf sp24; - if (arg0->ptr_allocated_collisiondata_block != NULL) + if (obj->ptr_allocated_collisiondata_block != NULL) { - sp64 = sub_GAME_7F040078(arg0); - matrix_4x4_copy(&arg0->mtx, &sp24); - matrix_4x4_set_position(arg0->runtime_pos.f, &sp24); - sub_GAME_7F03F540(sp64, &sp24, &arg0->ptr_allocated_collisiondata_block->unk04, arg0->ptr_allocated_collisiondata_block); + bbox = chrobjGetBboxFromObjectRecord(obj); + matrix_4x4_copy(&obj->mtx, &sp24); + matrix_4x4_set_position(&obj->runtime_pos, &sp24); + sub_GAME_7F03F540(bbox, &sp24, &obj->ptr_allocated_collisiondata_block->unk04, obj->ptr_allocated_collisiondata_block); - arg0->ptr_allocated_collisiondata_block->unk48 = arg0->runtime_pos.f[1] + chrpropSumMatrixPosY(sp64, &sp24); - arg0->ptr_allocated_collisiondata_block->unk44 = arg0->runtime_pos.f[1] + chrpropSumMatrixNegY(sp64, &sp24); + obj->ptr_allocated_collisiondata_block->unk48 = obj->runtime_pos.f[1] + chrpropSumMatrixPosY(bbox, &sp24); + obj->ptr_allocated_collisiondata_block->unk44 = obj->runtime_pos.f[1] + chrpropSumMatrixNegY(bbox, &sp24); - if (arg0->type == PROPDEF_AIRCRAFT) + if (obj->type == PROPDEF_AIRCRAFT) { - arg0->ptr_allocated_collisiondata_block->unk48 -= 200.0f; + obj->ptr_allocated_collisiondata_block->unk48 -= 200.0f; } } } -PropRecord* init_standard_object(ObjectRecord* obj, ModelFileHeader* model_header, PropRecord* prop, Model* model) +PropRecord* objInit(ObjectRecord* obj, ModelFileHeader* model_header, PropRecord* prop, Model* model) { if (prop == NULL) { - prop = chrpropAllocate(); + prop = propAllocate(); } if (model == NULL) @@ -1749,15 +1362,18 @@ PropRecord* init_standard_object(ObjectRecord* obj, ModelFileHeader* model_heade } obj->prop = prop; - obj->unk6C = 0; - obj->field_78.r = 0; - obj->field_78.g = 0; - obj->field_78.b = 0; - obj->field_78.a = 0; - obj->field_7C = 0; - obj->field_7D = 0; - obj->field_7E = 0; - obj->field_7F = 0; + obj->projectile = NULL; + + obj->shadecol.r = 0; + obj->shadecol.g = 0; + obj->shadecol.b = 0; + obj->shadecol.a = 0; + + obj->nextcol.r = 0; + obj->nextcol.g = 0; + obj->nextcol.b = 0; + obj->nextcol.a = 0; + obj->maxdamage = 0.0f; *((s16*)&obj->model->unk00) = -1; obj->model->chr = NULL; @@ -1778,7 +1394,7 @@ PropRecord* init_standard_object(ObjectRecord* obj, ModelFileHeader* model_heade { if (obj->type == 0x28) { - set_aircraft_obj_inst_scale_to_zero(model); + clear_aircraft_model_obj(model); } else { @@ -1797,137 +1413,69 @@ PropRecord* init_standard_object(ObjectRecord* obj, ModelFileHeader* model_heade } -PropRecord* sub_GAME_7F0406F8(ObjectRecord* object, ModelFileHeader* header) +PropRecord* objInitWithModelDef(ObjectRecord* object, ModelFileHeader* header) { - return init_standard_object(object, header, 0, 0); + return objInit(object, header, 0, 0); } -void objInitWithAutoModel(ObjectRecord* obj) +PropRecord* objInitWithAutoModel(ObjectRecord* obj) { - sub_GAME_7F0406F8(obj, PitemZ_entries[obj->obj].header); + return objInitWithModelDef(obj, PitemZ_entries[obj->obj].header); } -#ifdef NONMATCHING -void sub_GAME_7F040754(void) { +// Changes the color shade on the object, e.g. when walking in a darker area or under a colored light. +void objChangeShading(ObjectRecord* obj, coord3d* pos, Mtxf* matrix, StandTile* stan) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F040754 -/* 075284 7F040754 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 075288 7F040758 AFBF001C */ sw $ra, 0x1c($sp) -/* 07528C 7F04075C AFB00018 */ sw $s0, 0x18($sp) -/* 075290 7F040760 AFA5002C */ sw $a1, 0x2c($sp) -/* 075294 7F040764 AFA70034 */ sw $a3, 0x34($sp) -/* 075298 7F040768 8C820010 */ lw $v0, 0x10($a0) -/* 07529C 7F04076C 00808025 */ move $s0, $a0 -/* 0752A0 7F040770 26050018 */ addiu $a1, $s0, 0x18 -/* 0752A4 7F040774 00C02025 */ move $a0, $a2 -/* 0752A8 7F040778 0FC16008 */ jal matrix_4x4_copy -/* 0752AC 7F04077C AFA20024 */ sw $v0, 0x24($sp) -/* 0752B0 7F040780 8FA3002C */ lw $v1, 0x2c($sp) -/* 0752B4 7F040784 8FA20024 */ lw $v0, 0x24($sp) -/* 0752B8 7F040788 2605007C */ addiu $a1, $s0, 0x7c -/* 0752BC 7F04078C C4600000 */ lwc1 $f0, ($v1) -/* 0752C0 7F040790 E4400008 */ swc1 $f0, 8($v0) -/* 0752C4 7F040794 E6000058 */ swc1 $f0, 0x58($s0) -/* 0752C8 7F040798 C4600004 */ lwc1 $f0, 4($v1) -/* 0752CC 7F04079C E440000C */ swc1 $f0, 0xc($v0) -/* 0752D0 7F0407A0 E600005C */ swc1 $f0, 0x5c($s0) -/* 0752D4 7F0407A4 C4600008 */ lwc1 $f0, 8($v1) -/* 0752D8 7F0407A8 E4400010 */ swc1 $f0, 0x10($v0) -/* 0752DC 7F0407AC E6000060 */ swc1 $f0, 0x60($s0) -/* 0752E0 7F0407B0 8FAE0034 */ lw $t6, 0x34($sp) -/* 0752E4 7F0407B4 AC4E0014 */ sw $t6, 0x14($v0) -/* 0752E8 7F0407B8 0FC100AD */ jal sub_GAME_7F0402B4 -/* 0752EC 7F0407BC 8E040010 */ lw $a0, 0x10($s0) -/* 0752F0 7F0407C0 920F007C */ lbu $t7, 0x7c($s0) -/* 0752F4 7F0407C4 9218007D */ lbu $t8, 0x7d($s0) -/* 0752F8 7F0407C8 9219007E */ lbu $t9, 0x7e($s0) -/* 0752FC 7F0407CC 9208007F */ lbu $t0, 0x7f($s0) -/* 075300 7F0407D0 A20F0078 */ sb $t7, 0x78($s0) -/* 075304 7F0407D4 A2180079 */ sb $t8, 0x79($s0) -/* 075308 7F0407D8 A219007A */ sb $t9, 0x7a($s0) -/* 07530C 7F0407DC A208007B */ sb $t0, 0x7b($s0) -/* 075310 7F0407E0 8FBF001C */ lw $ra, 0x1c($sp) -/* 075314 7F0407E4 8FB00018 */ lw $s0, 0x18($sp) -/* 075318 7F0407E8 27BD0028 */ addiu $sp, $sp, 0x28 -/* 07531C 7F0407EC 03E00008 */ jr $ra -/* 075320 7F0407F0 00000000 */ nop -) -#endif + PropRecord *prop = obj->prop; + matrix_4x4_copy(matrix, &obj->mtx); + obj->runtime_pos.x = prop->pos.x = pos->x; + obj->runtime_pos.y = prop->pos.y = pos->y; + obj->runtime_pos.z = prop->pos.z = pos->z; + prop->stan = stan; + sub_GAME_7F0402B4(obj->prop, &obj->nextcol); -#ifdef NONMATCHING -void sub_GAME_7F0407F4(void) { - + obj->shadecol.r = obj->nextcol.r; + obj->shadecol.g = obj->nextcol.g; + obj->shadecol.b = obj->nextcol.b; + obj->shadecol.a = obj->nextcol.a; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0407F4 -/* 075324 7F0407F4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 075328 7F0407F8 AFBF001C */ sw $ra, 0x1c($sp) -/* 07532C 7F0407FC AFB00018 */ sw $s0, 0x18($sp) -/* 075330 7F040800 AFA40028 */ sw $a0, 0x28($sp) -/* 075334 7F040804 AFA60030 */ sw $a2, 0x30($sp) -/* 075338 7F040808 AFA70034 */ sw $a3, 0x34($sp) -/* 07533C 7F04080C 8C8F0014 */ lw $t7, 0x14($a0) -/* 075340 7F040810 00A08025 */ move $s0, $a1 -/* 075344 7F040814 0FC0FFFE */ jal sub_GAME_7F03FFF8 -/* 075348 7F040818 8DE40008 */ lw $a0, 8($t7) -/* 07534C 7F04081C AFA20020 */ sw $v0, 0x20($sp) -/* 075350 7F040820 8E060008 */ lw $a2, 8($s0) -/* 075354 7F040824 8E050000 */ lw $a1, ($s0) -/* 075358 7F040828 0FC2CA5C */ jal stanGetPositionYValue -/* 07535C 7F04082C 8FA40034 */ lw $a0, 0x34($sp) -/* 075360 7F040830 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 075364 7F040834 44812000 */ mtc1 $at, $f4 -/* 075368 7F040838 00000000 */ nop -/* 07536C 7F04083C 46040180 */ add.s $f6, $f0, $f4 -/* 075370 7F040840 E6060004 */ swc1 $f6, 4($s0) -/* 075374 7F040844 8FA50030 */ lw $a1, 0x30($sp) -/* 075378 7F040848 0FC0FA6F */ jal chrpropSumMatrixPosY -/* 07537C 7F04084C 8FA40020 */ lw $a0, 0x20($sp) -/* 075380 7F040850 C6080004 */ lwc1 $f8, 4($s0) -/* 075384 7F040854 02002825 */ move $a1, $s0 -/* 075388 7F040858 46004281 */ sub.s $f10, $f8, $f0 -/* 07538C 7F04085C E60A0004 */ swc1 $f10, 4($s0) -/* 075390 7F040860 8FA70034 */ lw $a3, 0x34($sp) -/* 075394 7F040864 8FA60030 */ lw $a2, 0x30($sp) -/* 075398 7F040868 0FC101D5 */ jal sub_GAME_7F040754 -/* 07539C 7F04086C 8FA40028 */ lw $a0, 0x28($sp) -/* 0753A0 7F040870 0FC10121 */ jal chrobjCollisionRelated -/* 0753A4 7F040874 8FA40028 */ lw $a0, 0x28($sp) -/* 0753A8 7F040878 8FBF001C */ lw $ra, 0x1c($sp) -/* 0753AC 7F04087C 8FB00018 */ lw $s0, 0x18($sp) -/* 0753B0 7F040880 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0753B4 7F040884 03E00008 */ jr $ra -/* 0753B8 7F040888 00000000 */ nop -) -#endif +// Unreferenced function (unused) +void sub_GAME_7F0407F4(ObjectRecord* obj, coord3d* pos, Mtxf* matrix, StandTile* stan) +{ + u32 a; // Adds 4 bytes to the stack so it matches. Could be anything 4 bytes long. + struct ModelRoData_BoundingBoxRecord *modelunk = chrobjGetBboxFromObjFile(obj->model->obj); + + pos->y = stanGetPositionYValue(stan, pos->x, pos->z) + 4.0f; + pos->y = pos->y - chrpropSumMatrixPosY(modelunk, matrix); + + objChangeShading(obj, pos, matrix, stan); + chrobjCollisionRelated(obj); +} -//todo: fix function calls and global vars "undefined reference to" -#ifdef NONMATCHING //moveToPad -void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, StandTile *stan, PadRecord *pad2) //#MATCH +void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, StandTile *stan, PadRecord *pad2) { - int padd[1]; - ModelRoData_BoundingBoxRecord *modelBoundingBox = sub_GAME_7F03FFF8(baseobj->model->obj); //GetBoundingBox //a0 yes - f32 xmax = chrpropBBOXGetYmin(modelBoundingBox); //GetXMax//9c yes - f32 ymin = chrpropBBOXGetYmax(modelBoundingBox); //GetYMin//98 yes - coord3d newPos; //8c 90 94 yes - StandTile * mStan = stan; //88 - Mtxf mtxcopy; //48 yes (size 0x40) + int padd[1]; + ModelRoData_BoundingBoxRecord *modelBoundingBox; + f32 xmax; + f32 ymin; + coord3d newPos; + StandTile *mStan; + Mtxf mtxcopy; + + modelBoundingBox = chrobjGetBboxFromObjFile(baseobj->model->obj); + xmax = chrpropBBOXGetYmin(modelBoundingBox); + ymin = chrpropBBOXGetYmax(modelBoundingBox); + mStan = stan; if (baseobj->flags & 4) { @@ -1946,21 +1494,25 @@ void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, Stan } else { - ObjectRecord *roomObj; //44 - f32 distfromTileCenter = stanGetPositionYValue(mStan, pad->pos.x, pad->pos.z); //40 - f32 byrefA; //3c - f32 byrefB; //38 - f32 byrefC; //34 - f32 byrefD; //30 + ObjectRecord *roomObj; + f32 distfromTileCenter; + f32 byrefA; + f32 byrefB; + f32 byrefC; + f32 byrefD; + + distfromTileCenter = stanGetPositionYValue(mStan, pad->pos.x, pad->pos.z); matrix_4x4_copy(matrix, &mtxcopy); newPos.x = pad2->pos.x - (mtxcopy.m[1][0] * xmax); newPos.z = pad2->pos.z - (mtxcopy.m[1][2] * xmax); roomObj = sub_GAME_7F03FAB0(pad, stan->room); + if (roomObj) { PropRecord *roomObjProp = roomObj->prop; chraiGetCollisionBounds(roomObjProp, &byrefA, &byrefB, &byrefC, &byrefD); + if ((distfromTileCenter < byrefC) && (byrefD < ((mtxcopy.m[1][1] * (ymin - xmax)) + distfromTileCenter + 4.0f))) { newPos.y = byrefC - (mtxcopy.m[1][1] * xmax); @@ -1976,13 +1528,14 @@ void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, Stan newPos.y = (distfromTileCenter - (mtxcopy.m[1][1] * xmax)) + 4.0f; } } + if (!(baseobj->flags2 & 1) && walkTilesBetweenPoints_NoCallback(&mStan, pad->pos.x, pad->pos.z, newPos.x, newPos.z)) { - sub_GAME_7F040754(baseobj, &newPos, &mtxcopy, mStan); + objChangeShading(baseobj, &newPos, &mtxcopy, mStan); } else { - sub_GAME_7F040754(baseobj, pad, &mtxcopy, stan); + objChangeShading(baseobj, pad, &mtxcopy, stan); if ((baseobj->flags2 & 1) || (baseobj->flags & 0x1000)) { baseobj->runtime_pos.x = newPos.x; @@ -1990,629 +1543,210 @@ void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, Stan baseobj->runtime_pos.z = newPos.z; } } + chrobjCollisionRelated(baseobj); } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800529D0 -.word 0xA000000 /*"\n"*/ -glabel D_800529D4 -.word 0x2E0A0000 /*".\n"*/ -glabel D_800529D8 -.word 0, 0, 0, 0, 0, 0, 0, 0 -.word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -glabel D_80052A38 -.word 0 -glabel D_80052A3C -.word 0 -glabel D_80052A40 -.word 0xA000000 /*"\n"*/ -glabel D_80052A44 -.word 0x3A0A0000 /*":\n"*/ -glabel D_80052A48 -.word 0x3d4ccccd /*0.050000001*/ -.late_rodata -glabel D_80052A4C -.word 0x40490fdb /*3.1415927*/ -.text -glabel sub_GAME_7F04088C -/* 0753BC 7F04088C 27BDFF58 */ addiu $sp, $sp, -0xa8 -/* 0753C0 7F040890 AFBF0024 */ sw $ra, 0x24($sp) -/* 0753C4 7F040894 AFB00020 */ sw $s0, 0x20($sp) -/* 0753C8 7F040898 AFA500AC */ sw $a1, 0xac($sp) -/* 0753CC 7F04089C AFA600B0 */ sw $a2, 0xb0($sp) -/* 0753D0 7F0408A0 AFA700B4 */ sw $a3, 0xb4($sp) -/* 0753D4 7F0408A4 8C8E0014 */ lw $t6, 0x14($a0) -/* 0753D8 7F0408A8 00808025 */ move $s0, $a0 -/* 0753DC 7F0408AC 0FC0FFFE */ jal sub_GAME_7F03FFF8 -/* 0753E0 7F0408B0 8DC40008 */ lw $a0, 8($t6) -/* 0753E4 7F0408B4 AFA200A0 */ sw $v0, 0xa0($sp) -/* 0753E8 7F0408B8 0FC0FA19 */ jal chrpropBBOXGetYmin -/* 0753EC 7F0408BC 00402025 */ move $a0, $v0 -/* 0753F0 7F0408C0 8FA400A0 */ lw $a0, 0xa0($sp) -/* 0753F4 7F0408C4 0FC0FA1B */ jal chrpropBBOXGetYmax -/* 0753F8 7F0408C8 E7A0009C */ swc1 $f0, 0x9c($sp) -/* 0753FC 7F0408CC 8FA700B4 */ lw $a3, 0xb4($sp) -/* 075400 7F0408D0 E7A00098 */ swc1 $f0, 0x98($sp) -/* 075404 7F0408D4 C7A2009C */ lwc1 $f2, 0x9c($sp) -/* 075408 7F0408D8 AFA70088 */ sw $a3, 0x88($sp) -/* 07540C 7F0408DC 8E020008 */ lw $v0, 8($s0) -/* 075410 7F0408E0 3C018005 */ lui $at, %hi(D_80052A4C) -/* 075414 7F0408E4 27A50048 */ addiu $a1, $sp, 0x48 -/* 075418 7F0408E8 304F0004 */ andi $t7, $v0, 4 -/* 07541C 7F0408EC 11E00018 */ beqz $t7, .L7F040950 -/* 075420 7F0408F0 30580008 */ andi $t8, $v0, 8 -/* 075424 7F0408F4 0FC161A2 */ jal matrix_4x4_set_rotation_around_z -/* 075428 7F0408F8 C42C2A4C */ lwc1 $f12, %lo(D_80052A4C)($at) -/* 07542C 7F0408FC 8FA400B0 */ lw $a0, 0xb0($sp) -/* 075430 7F040900 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 075434 7F040904 27A50048 */ addiu $a1, $sp, 0x48 -/* 075438 7F040908 C7A00098 */ lwc1 $f0, 0x98($sp) -/* 07543C 7F04090C C7A60058 */ lwc1 $f6, 0x58($sp) -/* 075440 7F040910 8FA200B8 */ lw $v0, 0xb8($sp) -/* 075444 7F040914 C7B2005C */ lwc1 $f18, 0x5c($sp) -/* 075448 7F040918 46003202 */ mul.s $f8, $f6, $f0 -/* 07544C 7F04091C C4440000 */ lwc1 $f4, ($v0) -/* 075450 7F040920 46009182 */ mul.s $f6, $f18, $f0 -/* 075454 7F040924 46082281 */ sub.s $f10, $f4, $f8 -/* 075458 7F040928 E7AA008C */ swc1 $f10, 0x8c($sp) -/* 07545C 7F04092C C4500004 */ lwc1 $f16, 4($v0) -/* 075460 7F040930 C7AA0060 */ lwc1 $f10, 0x60($sp) -/* 075464 7F040934 46068101 */ sub.s $f4, $f16, $f6 -/* 075468 7F040938 46005482 */ mul.s $f18, $f10, $f0 -/* 07546C 7F04093C E7A40090 */ swc1 $f4, 0x90($sp) -/* 075470 7F040940 C4480008 */ lwc1 $f8, 8($v0) -/* 075474 7F040944 46124401 */ sub.s $f16, $f8, $f18 -/* 075478 7F040948 10000068 */ b .L7F040AEC -/* 07547C 7F04094C E7B00094 */ swc1 $f16, 0x94($sp) -.L7F040950: -/* 075480 7F040950 13000017 */ beqz $t8, .L7F0409B0 -/* 075484 7F040954 8FA200AC */ lw $v0, 0xac($sp) -/* 075488 7F040958 8FA400B0 */ lw $a0, 0xb0($sp) -/* 07548C 7F04095C 27A50048 */ addiu $a1, $sp, 0x48 -/* 075490 7F040960 0FC16008 */ jal matrix_4x4_copy -/* 075494 7F040964 E7A2009C */ swc1 $f2, 0x9c($sp) -/* 075498 7F040968 C7A2009C */ lwc1 $f2, 0x9c($sp) -/* 07549C 7F04096C C7A40058 */ lwc1 $f4, 0x58($sp) -/* 0754A0 7F040970 8FA200B8 */ lw $v0, 0xb8($sp) -/* 0754A4 7F040974 C7B0005C */ lwc1 $f16, 0x5c($sp) -/* 0754A8 7F040978 46022282 */ mul.s $f10, $f4, $f2 -/* 0754AC 7F04097C C4460000 */ lwc1 $f6, ($v0) -/* 0754B0 7F040980 46028102 */ mul.s $f4, $f16, $f2 -/* 0754B4 7F040984 460A3201 */ sub.s $f8, $f6, $f10 -/* 0754B8 7F040988 E7A8008C */ swc1 $f8, 0x8c($sp) -/* 0754BC 7F04098C C4520004 */ lwc1 $f18, 4($v0) -/* 0754C0 7F040990 C7A80060 */ lwc1 $f8, 0x60($sp) -/* 0754C4 7F040994 46049181 */ sub.s $f6, $f18, $f4 -/* 0754C8 7F040998 46024402 */ mul.s $f16, $f8, $f2 -/* 0754CC 7F04099C E7A60090 */ swc1 $f6, 0x90($sp) -/* 0754D0 7F0409A0 C44A0008 */ lwc1 $f10, 8($v0) -/* 0754D4 7F0409A4 46105481 */ sub.s $f18, $f10, $f16 -/* 0754D8 7F0409A8 10000050 */ b .L7F040AEC -/* 0754DC 7F0409AC E7B20094 */ swc1 $f18, 0x94($sp) -.L7F0409B0: -/* 0754E0 7F0409B0 8C450000 */ lw $a1, ($v0) -/* 0754E4 7F0409B4 8C460008 */ lw $a2, 8($v0) -/* 0754E8 7F0409B8 E7A2009C */ swc1 $f2, 0x9c($sp) -/* 0754EC 7F0409BC 0FC2CA5C */ jal stanGetPositionYValue -/* 0754F0 7F0409C0 00E02025 */ move $a0, $a3 -/* 0754F4 7F0409C4 8FA400B0 */ lw $a0, 0xb0($sp) -/* 0754F8 7F0409C8 27A50048 */ addiu $a1, $sp, 0x48 -/* 0754FC 7F0409CC 0FC16008 */ jal matrix_4x4_copy -/* 075500 7F0409D0 E7A00040 */ swc1 $f0, 0x40($sp) -/* 075504 7F0409D4 C7A2009C */ lwc1 $f2, 0x9c($sp) -/* 075508 7F0409D8 C7A60058 */ lwc1 $f6, 0x58($sp) -/* 07550C 7F0409DC 8FA200B8 */ lw $v0, 0xb8($sp) -/* 075510 7F0409E0 C7B20060 */ lwc1 $f18, 0x60($sp) -/* 075514 7F0409E4 46023202 */ mul.s $f8, $f6, $f2 -/* 075518 7F0409E8 C4440000 */ lwc1 $f4, ($v0) -/* 07551C 7F0409EC 8FB900B4 */ lw $t9, 0xb4($sp) -/* 075520 7F0409F0 46029182 */ mul.s $f6, $f18, $f2 -/* 075524 7F0409F4 8FA400AC */ lw $a0, 0xac($sp) -/* 075528 7F0409F8 46082281 */ sub.s $f10, $f4, $f8 -/* 07552C 7F0409FC E7AA008C */ swc1 $f10, 0x8c($sp) -/* 075530 7F040A00 C4500008 */ lwc1 $f16, 8($v0) -/* 075534 7F040A04 46068101 */ sub.s $f4, $f16, $f6 -/* 075538 7F040A08 E7A40094 */ swc1 $f4, 0x94($sp) -/* 07553C 7F040A0C 0FC0FEAC */ jal sub_GAME_7F03FAB0 -/* 075540 7F040A10 93250003 */ lbu $a1, 3($t9) -/* 075544 7F040A14 C7A2009C */ lwc1 $f2, 0x9c($sp) -/* 075548 7F040A18 1040002D */ beqz $v0, .L7F040AD0 -/* 07554C 7F040A1C C7AC0040 */ lwc1 $f12, 0x40($sp) -/* 075550 7F040A20 8C440010 */ lw $a0, 0x10($v0) -/* 075554 7F040A24 27A80030 */ addiu $t0, $sp, 0x30 -/* 075558 7F040A28 AFA80010 */ sw $t0, 0x10($sp) -/* 07555C 7F040A2C E7AC0040 */ swc1 $f12, 0x40($sp) -/* 075560 7F040A30 E7A2009C */ swc1 $f2, 0x9c($sp) -/* 075564 7F040A34 27A5003C */ addiu $a1, $sp, 0x3c -/* 075568 7F040A38 27A60038 */ addiu $a2, $sp, 0x38 -/* 07556C 7F040A3C 0FC0F308 */ jal chraiGetCollisionBounds -/* 075570 7F040A40 27A70034 */ addiu $a3, $sp, 0x34 -/* 075574 7F040A44 C7AC0040 */ lwc1 $f12, 0x40($sp) -/* 075578 7F040A48 C7A80034 */ lwc1 $f8, 0x34($sp) -/* 07557C 7F040A4C C7A2009C */ lwc1 $f2, 0x9c($sp) -/* 075580 7F040A50 C7B00098 */ lwc1 $f16, 0x98($sp) -/* 075584 7F040A54 4608603C */ c.lt.s $f12, $f8 -/* 075588 7F040A58 00000000 */ nop -/* 07558C 7F040A5C 45020015 */ bc1fl .L7F040AB4 -/* 075590 7F040A60 C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 075594 7F040A64 46028181 */ sub.s $f6, $f16, $f2 -/* 075598 7F040A68 C7B2005C */ lwc1 $f18, 0x5c($sp) -/* 07559C 7F040A6C 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0755A0 7F040A70 C7AA0030 */ lwc1 $f10, 0x30($sp) -/* 0755A4 7F040A74 46069102 */ mul.s $f4, $f18, $f6 -/* 0755A8 7F040A78 44813000 */ mtc1 $at, $f6 -/* 0755AC 7F040A7C 460C2400 */ add.s $f16, $f4, $f12 -/* 0755B0 7F040A80 46068100 */ add.s $f4, $f16, $f6 -/* 0755B4 7F040A84 4604503C */ c.lt.s $f10, $f4 -/* 0755B8 7F040A88 00000000 */ nop -/* 0755BC 7F040A8C 45020009 */ bc1fl .L7F040AB4 -/* 0755C0 7F040A90 C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 0755C4 7F040A94 46029402 */ mul.s $f16, $f18, $f2 -/* 0755C8 7F040A98 46104181 */ sub.s $f6, $f8, $f16 -/* 0755CC 7F040A9C E7A60090 */ swc1 $f6, 0x90($sp) -/* 0755D0 7F040AA0 8E090064 */ lw $t1, 0x64($s0) -/* 0755D4 7F040AA4 352A8000 */ ori $t2, $t1, 0x8000 -/* 0755D8 7F040AA8 10000010 */ b .L7F040AEC -/* 0755DC 7F040AAC AE0A0064 */ sw $t2, 0x64($s0) -/* 0755E0 7F040AB0 C7AA005C */ lwc1 $f10, 0x5c($sp) -.L7F040AB4: -/* 0755E4 7F040AB4 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0755E8 7F040AB8 44814000 */ mtc1 $at, $f8 -/* 0755EC 7F040ABC 46025102 */ mul.s $f4, $f10, $f2 -/* 0755F0 7F040AC0 46046481 */ sub.s $f18, $f12, $f4 -/* 0755F4 7F040AC4 46089400 */ add.s $f16, $f18, $f8 -/* 0755F8 7F040AC8 10000008 */ b .L7F040AEC -/* 0755FC 7F040ACC E7B00090 */ swc1 $f16, 0x90($sp) -.L7F040AD0: -/* 075600 7F040AD0 C7A6005C */ lwc1 $f6, 0x5c($sp) -/* 075604 7F040AD4 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 075608 7F040AD8 44819000 */ mtc1 $at, $f18 -/* 07560C 7F040ADC 46023282 */ mul.s $f10, $f6, $f2 -/* 075610 7F040AE0 460A6101 */ sub.s $f4, $f12, $f10 -/* 075614 7F040AE4 46122200 */ add.s $f8, $f4, $f18 -/* 075618 7F040AE8 E7A80090 */ swc1 $f8, 0x90($sp) -.L7F040AEC: -/* 07561C 7F040AEC 8E0B000C */ lw $t3, 0xc($s0) -/* 075620 7F040AF0 8FA200AC */ lw $v0, 0xac($sp) -/* 075624 7F040AF4 27A40088 */ addiu $a0, $sp, 0x88 -/* 075628 7F040AF8 316C0001 */ andi $t4, $t3, 1 -/* 07562C 7F040AFC 1580000E */ bnez $t4, .L7F040B38 -/* 075630 7F040B00 8FA7008C */ lw $a3, 0x8c($sp) -/* 075634 7F040B04 C7B00094 */ lwc1 $f16, 0x94($sp) -/* 075638 7F040B08 8C450000 */ lw $a1, ($v0) -/* 07563C 7F040B0C 8C460008 */ lw $a2, 8($v0) -/* 075640 7F040B10 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 075644 7F040B14 E7B00010 */ swc1 $f16, 0x10($sp) -/* 075648 7F040B18 10400007 */ beqz $v0, .L7F040B38 -/* 07564C 7F040B1C 02002025 */ move $a0, $s0 -/* 075650 7F040B20 27A5008C */ addiu $a1, $sp, 0x8c -/* 075654 7F040B24 27A60048 */ addiu $a2, $sp, 0x48 -/* 075658 7F040B28 0FC101D5 */ jal sub_GAME_7F040754 -/* 07565C 7F040B2C 8FA70088 */ lw $a3, 0x88($sp) -/* 075660 7F040B30 10000014 */ b .L7F040B84 -/* 075664 7F040B34 00000000 */ nop -.L7F040B38: -/* 075668 7F040B38 02002025 */ move $a0, $s0 -/* 07566C 7F040B3C 8FA500AC */ lw $a1, 0xac($sp) -/* 075670 7F040B40 27A60048 */ addiu $a2, $sp, 0x48 -/* 075674 7F040B44 0FC101D5 */ jal sub_GAME_7F040754 -/* 075678 7F040B48 8FA700B4 */ lw $a3, 0xb4($sp) -/* 07567C 7F040B4C 8E0D000C */ lw $t5, 0xc($s0) -/* 075680 7F040B50 C7A6008C */ lwc1 $f6, 0x8c($sp) -/* 075684 7F040B54 31AE0001 */ andi $t6, $t5, 1 -/* 075688 7F040B58 55C00006 */ bnezl $t6, .L7F040B74 -/* 07568C 7F040B5C E6060058 */ swc1 $f6, 0x58($s0) -/* 075690 7F040B60 8E0F0008 */ lw $t7, 8($s0) -/* 075694 7F040B64 31F81000 */ andi $t8, $t7, 0x1000 -/* 075698 7F040B68 13000006 */ beqz $t8, .L7F040B84 -/* 07569C 7F040B6C 00000000 */ nop -/* 0756A0 7F040B70 E6060058 */ swc1 $f6, 0x58($s0) -.L7F040B74: -/* 0756A4 7F040B74 C7AA0090 */ lwc1 $f10, 0x90($sp) -/* 0756A8 7F040B78 E60A005C */ swc1 $f10, 0x5c($s0) -/* 0756AC 7F040B7C C7A40094 */ lwc1 $f4, 0x94($sp) -/* 0756B0 7F040B80 E6040060 */ swc1 $f4, 0x60($s0) -.L7F040B84: -/* 0756B4 7F040B84 0FC10121 */ jal chrobjCollisionRelated -/* 0756B8 7F040B88 02002025 */ move $a0, $s0 -/* 0756BC 7F040B8C 8FBF0024 */ lw $ra, 0x24($sp) -/* 0756C0 7F040B90 8FB00020 */ lw $s0, 0x20($sp) -/* 0756C4 7F040B94 27BD00A8 */ addiu $sp, $sp, 0xa8 -/* 0756C8 7F040B98 03E00008 */ jr $ra -/* 0756CC 7F040B9C 00000000 */ nop -) -#endif +void sub_GAME_7F040BA0(ObjectRecord *obj, coord3d *pos, Mtxf *arg2, StandTile *stan2, coord3d *pos2) +{ + Mtxf *sp6C_ptr; + f32 (*sp6Cm_ptr)[4]; + f32 spBC; + coord3d posdiff; + StandTile *stan; + Mtxf matrix; + Mtxf sp2C; + spBC = chrpropBBOXGetZmin(chrobjGetBboxFromObjFile(obj->model->obj)); + stan = stan2; + sp6C_ptr = &matrix; + matrix_4x4_set_rotation_around_x(4.712389f, sp6C_ptr); -#ifdef NONMATCHING -void sub_GAME_7F040BA0(void) { + sp6Cm_ptr = matrix.m; -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80052A50 -.word 0x4096cbe4 /*4.712389*/ -glabel D_80052A54 -.word 0x40490fdb /*3.1415927*/ -.text -glabel sub_GAME_7F040BA0 -/* 0756D0 7F040BA0 27BDFF38 */ addiu $sp, $sp, -0xc8 -/* 0756D4 7F040BA4 AFBF0024 */ sw $ra, 0x24($sp) -/* 0756D8 7F040BA8 AFB00020 */ sw $s0, 0x20($sp) -/* 0756DC 7F040BAC AFA500CC */ sw $a1, 0xcc($sp) -/* 0756E0 7F040BB0 AFA600D0 */ sw $a2, 0xd0($sp) -/* 0756E4 7F040BB4 AFA700D4 */ sw $a3, 0xd4($sp) -/* 0756E8 7F040BB8 8C8E0014 */ lw $t6, 0x14($a0) -/* 0756EC 7F040BBC 00808025 */ move $s0, $a0 -/* 0756F0 7F040BC0 0FC0FFFE */ jal sub_GAME_7F03FFF8 -/* 0756F4 7F040BC4 8DC40008 */ lw $a0, 8($t6) -/* 0756F8 7F040BC8 0FC0FA1D */ jal chrpropBBOXGetZmin -/* 0756FC 7F040BCC 00402025 */ move $a0, $v0 -/* 075700 7F040BD0 8FAF00D4 */ lw $t7, 0xd4($sp) -/* 075704 7F040BD4 3C018005 */ lui $at, %hi(D_80052A50) -/* 075708 7F040BD8 E7A000BC */ swc1 $f0, 0xbc($sp) -/* 07570C 7F040BDC C42C2A50 */ lwc1 $f12, %lo(D_80052A50)($at) -/* 075710 7F040BE0 27A5006C */ addiu $a1, $sp, 0x6c -/* 075714 7F040BE4 0FC1615C */ jal matrix_4x4_set_rotation_around_x -/* 075718 7F040BE8 AFAF00AC */ sw $t7, 0xac($sp) -/* 07571C 7F040BEC 3C018005 */ lui $at, %hi(D_80052A54) -/* 075720 7F040BF0 C42C2A54 */ lwc1 $f12, %lo(D_80052A54)($at) -/* 075724 7F040BF4 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 075728 7F040BF8 27A5002C */ addiu $a1, $sp, 0x2c -/* 07572C 7F040BFC 27A4002C */ addiu $a0, $sp, 0x2c -/* 075730 7F040C00 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 075734 7F040C04 27A5006C */ addiu $a1, $sp, 0x6c -/* 075738 7F040C08 8FA400D0 */ lw $a0, 0xd0($sp) -/* 07573C 7F040C0C 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 075740 7F040C10 27A5006C */ addiu $a1, $sp, 0x6c -/* 075744 7F040C14 C7A000BC */ lwc1 $f0, 0xbc($sp) -/* 075748 7F040C18 C7A6008C */ lwc1 $f6, 0x8c($sp) -/* 07574C 7F040C1C 8FA200D8 */ lw $v0, 0xd8($sp) -/* 075750 7F040C20 C7B20090 */ lwc1 $f18, 0x90($sp) -/* 075754 7F040C24 46003202 */ mul.s $f8, $f6, $f0 -/* 075758 7F040C28 C4440000 */ lwc1 $f4, ($v0) -/* 07575C 7F040C2C 27A400AC */ addiu $a0, $sp, 0xac -/* 075760 7F040C30 46009182 */ mul.s $f6, $f18, $f0 -/* 075764 7F040C34 46082281 */ sub.s $f10, $f4, $f8 -/* 075768 7F040C38 E7AA00B0 */ swc1 $f10, 0xb0($sp) -/* 07576C 7F040C3C C4500004 */ lwc1 $f16, 4($v0) -/* 075770 7F040C40 C7AA0094 */ lwc1 $f10, 0x94($sp) -/* 075774 7F040C44 8FA700B0 */ lw $a3, 0xb0($sp) -/* 075778 7F040C48 46068101 */ sub.s $f4, $f16, $f6 -/* 07577C 7F040C4C 46005482 */ mul.s $f18, $f10, $f0 -/* 075780 7F040C50 E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 075784 7F040C54 C4480008 */ lwc1 $f8, 8($v0) -/* 075788 7F040C58 8FA200CC */ lw $v0, 0xcc($sp) -/* 07578C 7F040C5C 46124401 */ sub.s $f16, $f8, $f18 -/* 075790 7F040C60 E7B000B8 */ swc1 $f16, 0xb8($sp) -/* 075794 7F040C64 8E18000C */ lw $t8, 0xc($s0) -/* 075798 7F040C68 C7A600B8 */ lwc1 $f6, 0xb8($sp) -/* 07579C 7F040C6C 33190001 */ andi $t9, $t8, 1 -/* 0757A0 7F040C70 5720000E */ bnezl $t9, .L7F040CAC -/* 0757A4 7F040C74 02002025 */ move $a0, $s0 -/* 0757A8 7F040C78 8C450000 */ lw $a1, ($v0) -/* 0757AC 7F040C7C 8C460008 */ lw $a2, 8($v0) -/* 0757B0 7F040C80 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 0757B4 7F040C84 E7A60010 */ swc1 $f6, 0x10($sp) -/* 0757B8 7F040C88 10400007 */ beqz $v0, .L7F040CA8 -/* 0757BC 7F040C8C 02002025 */ move $a0, $s0 -/* 0757C0 7F040C90 27A500B0 */ addiu $a1, $sp, 0xb0 -/* 0757C4 7F040C94 27A6006C */ addiu $a2, $sp, 0x6c -/* 0757C8 7F040C98 0FC101D5 */ jal sub_GAME_7F040754 -/* 0757CC 7F040C9C 8FA700AC */ lw $a3, 0xac($sp) -/* 0757D0 7F040CA0 1000000C */ b .L7F040CD4 -/* 0757D4 7F040CA4 00000000 */ nop -.L7F040CA8: -/* 0757D8 7F040CA8 02002025 */ move $a0, $s0 -.L7F040CAC: -/* 0757DC 7F040CAC 8FA500CC */ lw $a1, 0xcc($sp) -/* 0757E0 7F040CB0 27A6006C */ addiu $a2, $sp, 0x6c -/* 0757E4 7F040CB4 0FC101D5 */ jal sub_GAME_7F040754 -/* 0757E8 7F040CB8 8FA700D4 */ lw $a3, 0xd4($sp) -/* 0757EC 7F040CBC C7A400B0 */ lwc1 $f4, 0xb0($sp) -/* 0757F0 7F040CC0 E6040058 */ swc1 $f4, 0x58($s0) -/* 0757F4 7F040CC4 C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* 0757F8 7F040CC8 E60A005C */ swc1 $f10, 0x5c($s0) -/* 0757FC 7F040CCC C7A800B8 */ lwc1 $f8, 0xb8($sp) -/* 075800 7F040CD0 E6080060 */ swc1 $f8, 0x60($s0) -.L7F040CD4: -/* 075804 7F040CD4 0FC10121 */ jal chrobjCollisionRelated -/* 075808 7F040CD8 02002025 */ move $a0, $s0 -/* 07580C 7F040CDC 8FBF0024 */ lw $ra, 0x24($sp) -/* 075810 7F040CE0 8FB00020 */ lw $s0, 0x20($sp) -/* 075814 7F040CE4 27BD00C8 */ addiu $sp, $sp, 0xc8 -/* 075818 7F040CE8 03E00008 */ jr $ra -/* 07581C 7F040CEC 00000000 */ nop -) -#endif + matrix_4x4_set_rotation_around_y(M_PI_F, &sp2C); + matrix_4x4_multiply_in_place(&sp2C, sp6C_ptr); + matrix_4x4_multiply_in_place(arg2, &matrix); + posdiff.x = pos2->x - (sp6Cm_ptr[2][0] * spBC); + posdiff.y = pos2->y - (sp6Cm_ptr[2][1] * spBC); + posdiff.z = pos2->z - (sp6Cm_ptr[2][2] * spBC); + if ((!(((s32) obj->flags2) & 1)) && (walkTilesBetweenPoints_NoCallback(&stan, pos->x, pos->z, posdiff.x, posdiff.z) != 0)) + { + objChangeShading(obj, &posdiff, &matrix, stan); + } + else + { + objChangeShading(obj, pos, &matrix, stan2); + obj->runtime_pos.x = posdiff.x; + obj->runtime_pos.y = posdiff.y; + obj->runtime_pos.z = posdiff.z; + } + chrobjCollisionRelated(obj); +} -#ifdef NONMATCHING -void sub_GAME_7F040CF0(PropRecord*) +void objFreeEmbedmentOrProjectile(PropRecord *prop) { + ObjectRecord *obj = prop->obj; + if (obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) + { + if (obj->embedment) + { + if (obj->embedment->projectile) + { + projectileFree(obj->embedment->projectile); + } + embedmentFree(obj->embedment); + } + obj->embedment = NULL; + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_EMBEDDED; + } + else if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) + { + projectileFree(obj->projectile); + obj->projectile = NULL; + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_DEPOSIT; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F040CF0 -/* 075820 7F040CF0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 075824 7F040CF4 AFBF0014 */ sw $ra, 0x14($sp) -/* 075828 7F040CF8 8C820004 */ lw $v0, 4($a0) -/* 07582C 7F040CFC 8C430064 */ lw $v1, 0x64($v0) -/* 075830 7F040D00 306E0040 */ andi $t6, $v1, 0x40 -/* 075834 7F040D04 11C00015 */ beqz $t6, .L7F040D5C -/* 075838 7F040D08 30780080 */ andi $t8, $v1, 0x80 -/* 07583C 7F040D0C 8C44006C */ lw $a0, 0x6c($v0) -/* 075840 7F040D10 5080000E */ beql $a0, $zero, .L7F040D4C -/* 075844 7F040D14 2401FFBF */ li $at, -65 -/* 075848 7F040D18 8C850044 */ lw $a1, 0x44($a0) -/* 07584C 7F040D1C 10A00006 */ beqz $a1, .L7F040D38 -/* 075850 7F040D20 00000000 */ nop -/* 075854 7F040D24 00A02025 */ move $a0, $a1 -/* 075858 7F040D28 0FC0FEDC */ jal sub_GAME_7F03FB70 -/* 07585C 7F040D2C AFA2001C */ sw $v0, 0x1c($sp) -/* 075860 7F040D30 8FA2001C */ lw $v0, 0x1c($sp) -/* 075864 7F040D34 8C44006C */ lw $a0, 0x6c($v0) -.L7F040D38: -/* 075868 7F040D38 0FC0FFA2 */ jal sub_GAME_7F03FE88 -/* 07586C 7F040D3C AFA2001C */ sw $v0, 0x1c($sp) -/* 075870 7F040D40 8FA2001C */ lw $v0, 0x1c($sp) -/* 075874 7F040D44 8C430064 */ lw $v1, 0x64($v0) -/* 075878 7F040D48 2401FFBF */ li $at, -65 -.L7F040D4C: -/* 07587C 7F040D4C 00617824 */ and $t7, $v1, $at -/* 075880 7F040D50 AC40006C */ sw $zero, 0x6c($v0) -/* 075884 7F040D54 1000000C */ b .L7F040D88 -/* 075888 7F040D58 AC4F0064 */ sw $t7, 0x64($v0) -.L7F040D5C: -/* 07588C 7F040D5C 5300000B */ beql $t8, $zero, .L7F040D8C -/* 075890 7F040D60 8FBF0014 */ lw $ra, 0x14($sp) -/* 075894 7F040D64 8C44006C */ lw $a0, 0x6c($v0) -/* 075898 7F040D68 0FC0FEDC */ jal sub_GAME_7F03FB70 -/* 07589C 7F040D6C AFA2001C */ sw $v0, 0x1c($sp) -/* 0758A0 7F040D70 8FA2001C */ lw $v0, 0x1c($sp) -/* 0758A4 7F040D74 2401FF7F */ li $at, -129 -/* 0758A8 7F040D78 8C590064 */ lw $t9, 0x64($v0) -/* 0758AC 7F040D7C AC40006C */ sw $zero, 0x6c($v0) -/* 0758B0 7F040D80 03214024 */ and $t0, $t9, $at -/* 0758B4 7F040D84 AC480064 */ sw $t0, 0x64($v0) -.L7F040D88: -/* 0758B8 7F040D88 8FBF0014 */ lw $ra, 0x14($sp) -.L7F040D8C: -/* 0758BC 7F040D8C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0758C0 7F040D90 03E00008 */ jr $ra -/* 0758C4 7F040D94 00000000 */ nop -) -#endif +void objFree(ObjectRecord* obj, s32 freeprop, s32 canregen) +{ + PropRecord *child; + if (obj->type == PROPDEF_AUTOGUN) + { + AutogunRecord* record = (AutogunRecord*)obj; + if ((record->unkC4 != NULL) && (sndGetPlayingState(record->unkC4) != 0)) + { + sndDeactivate(record->unkC4); + } + if ((record->unkC8 != NULL) && (sndGetPlayingState(record->unkC8) != 0)) + { + sndDeactivate(record->unkC8); + } + } + else if (obj->type == PROPDEF_COLLECTABLE) + { + WeaponObjRecord* record = (WeaponObjRecord*) obj; + WeaponObjRecord* record2 = record->dualweapon; + if (record2 != NULL) + { + record2->dualweapon = NULL; + record->dualweapon = NULL; + } + } + else if (obj->type == PROPDEF_DOOR) + { + DoorRecord* record = (DoorRecord*) obj; + if ((record->openSoundState != NULL) && (sndGetPlayingState(record->openSoundState) != 0)) + { + sndDeactivate(record->openSoundState); + } -#ifdef NONMATCHING -void objFree(void) { + if ((record->closeSoundState != NULL) && (sndGetPlayingState(record->closeSoundState) != 0)) + { + sndDeactivate(record->closeSoundState); + } + } + else if (obj->type == PROPDEF_TINTED_GLASS) + { + TintedGlassRecord* record = (TintedGlassRecord*) obj; + if (record->unk8c >= 0) + { + bgToggleDataPortalsContrlBytes1Bit1(record->unk8c, 1); + } + } + else if (obj->type == PROPDEF_AIRCRAFT) + { + AircraftRecord* record = (AircraftRecord*) obj; + if ((record->Sound != NULL) && (sndGetPlayingState(record->Sound) != 0)) + { + sndDeactivate(record->Sound); + } + } + else if (obj->type == PROPDEF_VEHICHLE) + { + VehichleRecord* record = (VehichleRecord*) obj; + if ((record->Sound != NULL) && (sndGetPlayingState(record->Sound) != 0)) + { + sndDeactivate(record->Sound); + } + } -} -#else -GLOBAL_ASM( -.text -glabel objFree -/* 0758C8 7F040D98 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0758CC 7F040D9C AFBF0024 */ sw $ra, 0x24($sp) -/* 0758D0 7F040DA0 AFB20020 */ sw $s2, 0x20($sp) -/* 0758D4 7F040DA4 AFB1001C */ sw $s1, 0x1c($sp) -/* 0758D8 7F040DA8 AFB00018 */ sw $s0, 0x18($sp) -/* 0758DC 7F040DAC AFA5002C */ sw $a1, 0x2c($sp) -/* 0758E0 7F040DB0 90820003 */ lbu $v0, 3($a0) -/* 0758E4 7F040DB4 2401000D */ li $at, 13 -/* 0758E8 7F040DB8 00C08025 */ move $s0, $a2 -/* 0758EC 7F040DBC 14410015 */ bne $v0, $at, .L7F040E14 -/* 0758F0 7F040DC0 00809025 */ move $s2, $a0 -/* 0758F4 7F040DC4 8C8400C4 */ lw $a0, 0xc4($a0) -/* 0758F8 7F040DC8 50800008 */ beql $a0, $zero, .L7F040DEC -/* 0758FC 7F040DCC 8E4400C8 */ lw $a0, 0xc8($s2) -/* 075900 7F040DD0 0C00237C */ jal sndGetPlayingState -/* 075904 7F040DD4 00000000 */ nop -/* 075908 7F040DD8 50400004 */ beql $v0, $zero, .L7F040DEC -/* 07590C 7F040DDC 8E4400C8 */ lw $a0, 0xc8($s2) -/* 075910 7F040DE0 0C002408 */ jal sndDeactivate -/* 075914 7F040DE4 8E4400C4 */ lw $a0, 0xc4($s2) -/* 075918 7F040DE8 8E4400C8 */ lw $a0, 0xc8($s2) -.L7F040DEC: -/* 07591C 7F040DEC 5080004E */ beql $a0, $zero, .L7F040F28 -/* 075920 7F040DF0 8E510010 */ lw $s1, 0x10($s2) -/* 075924 7F040DF4 0C00237C */ jal sndGetPlayingState -/* 075928 7F040DF8 00000000 */ nop -/* 07592C 7F040DFC 5040004A */ beql $v0, $zero, .L7F040F28 -/* 075930 7F040E00 8E510010 */ lw $s1, 0x10($s2) -/* 075934 7F040E04 0C002408 */ jal sndDeactivate -/* 075938 7F040E08 8E4400C8 */ lw $a0, 0xc8($s2) -/* 07593C 7F040E0C 10000046 */ b .L7F040F28 -/* 075940 7F040E10 8E510010 */ lw $s1, 0x10($s2) -.L7F040E14: -/* 075944 7F040E14 24010008 */ li $at, 8 -/* 075948 7F040E18 54410008 */ bnel $v0, $at, .L7F040E3C -/* 07594C 7F040E1C 24010001 */ li $at, 1 -/* 075950 7F040E20 8E420084 */ lw $v0, 0x84($s2) -/* 075954 7F040E24 50400040 */ beql $v0, $zero, .L7F040F28 -/* 075958 7F040E28 8E510010 */ lw $s1, 0x10($s2) -/* 07595C 7F040E2C AC400084 */ sw $zero, 0x84($v0) -/* 075960 7F040E30 1000003C */ b .L7F040F24 -/* 075964 7F040E34 AE400084 */ sw $zero, 0x84($s2) -/* 075968 7F040E38 24010001 */ li $at, 1 -.L7F040E3C: -/* 07596C 7F040E3C 54410016 */ bnel $v0, $at, .L7F040E98 -/* 075970 7F040E40 2401002F */ li $at, 47 -/* 075974 7F040E44 8E4400F4 */ lw $a0, 0xf4($s2) -/* 075978 7F040E48 50800008 */ beql $a0, $zero, .L7F040E6C -/* 07597C 7F040E4C 8E4400F8 */ lw $a0, 0xf8($s2) -/* 075980 7F040E50 0C00237C */ jal sndGetPlayingState -/* 075984 7F040E54 00000000 */ nop -/* 075988 7F040E58 50400004 */ beql $v0, $zero, .L7F040E6C -/* 07598C 7F040E5C 8E4400F8 */ lw $a0, 0xf8($s2) -/* 075990 7F040E60 0C002408 */ jal sndDeactivate -/* 075994 7F040E64 8E4400F4 */ lw $a0, 0xf4($s2) -/* 075998 7F040E68 8E4400F8 */ lw $a0, 0xf8($s2) -.L7F040E6C: -/* 07599C 7F040E6C 5080002E */ beql $a0, $zero, .L7F040F28 -/* 0759A0 7F040E70 8E510010 */ lw $s1, 0x10($s2) -/* 0759A4 7F040E74 0C00237C */ jal sndGetPlayingState -/* 0759A8 7F040E78 00000000 */ nop -/* 0759AC 7F040E7C 5040002A */ beql $v0, $zero, .L7F040F28 -/* 0759B0 7F040E80 8E510010 */ lw $s1, 0x10($s2) -/* 0759B4 7F040E84 0C002408 */ jal sndDeactivate -/* 0759B8 7F040E88 8E4400F8 */ lw $a0, 0xf8($s2) -/* 0759BC 7F040E8C 10000026 */ b .L7F040F28 -/* 0759C0 7F040E90 8E510010 */ lw $s1, 0x10($s2) -/* 0759C4 7F040E94 2401002F */ li $at, 47 -.L7F040E98: -/* 0759C8 7F040E98 54410009 */ bnel $v0, $at, .L7F040EC0 -/* 0759CC 7F040E9C 24010028 */ li $at, 40 -/* 0759D0 7F040EA0 8E44008C */ lw $a0, 0x8c($s2) -/* 0759D4 7F040EA4 04820020 */ bltzl $a0, .L7F040F28 -/* 0759D8 7F040EA8 8E510010 */ lw $s1, 0x10($s2) -/* 0759DC 7F040EAC 0FC2E76F */ jal bgToggleDataPortalsContrlBytes1Bit1 -/* 0759E0 7F040EB0 24050001 */ li $a1, 1 -/* 0759E4 7F040EB4 1000001C */ b .L7F040F28 -/* 0759E8 7F040EB8 8E510010 */ lw $s1, 0x10($s2) -/* 0759EC 7F040EBC 24010028 */ li $at, 40 -.L7F040EC0: -/* 0759F0 7F040EC0 5441000D */ bnel $v0, $at, .L7F040EF8 -/* 0759F4 7F040EC4 24010027 */ li $at, 39 -/* 0759F8 7F040EC8 8E4400B0 */ lw $a0, 0xb0($s2) -/* 0759FC 7F040ECC 50800016 */ beql $a0, $zero, .L7F040F28 -/* 075A00 7F040ED0 8E510010 */ lw $s1, 0x10($s2) -/* 075A04 7F040ED4 0C00237C */ jal sndGetPlayingState -/* 075A08 7F040ED8 00000000 */ nop -/* 075A0C 7F040EDC 50400012 */ beql $v0, $zero, .L7F040F28 -/* 075A10 7F040EE0 8E510010 */ lw $s1, 0x10($s2) -/* 075A14 7F040EE4 0C002408 */ jal sndDeactivate -/* 075A18 7F040EE8 8E4400B0 */ lw $a0, 0xb0($s2) -/* 075A1C 7F040EEC 1000000E */ b .L7F040F28 -/* 075A20 7F040EF0 8E510010 */ lw $s1, 0x10($s2) -/* 075A24 7F040EF4 24010027 */ li $at, 39 -.L7F040EF8: -/* 075A28 7F040EF8 5441000B */ bnel $v0, $at, .L7F040F28 -/* 075A2C 7F040EFC 8E510010 */ lw $s1, 0x10($s2) -/* 075A30 7F040F00 8E4400AC */ lw $a0, 0xac($s2) -/* 075A34 7F040F04 50800008 */ beql $a0, $zero, .L7F040F28 -/* 075A38 7F040F08 8E510010 */ lw $s1, 0x10($s2) -/* 075A3C 7F040F0C 0C00237C */ jal sndGetPlayingState -/* 075A40 7F040F10 00000000 */ nop -/* 075A44 7F040F14 50400004 */ beql $v0, $zero, .L7F040F28 -/* 075A48 7F040F18 8E510010 */ lw $s1, 0x10($s2) -/* 075A4C 7F040F1C 0C002408 */ jal sndDeactivate -/* 075A50 7F040F20 8E4400AC */ lw $a0, 0xac($s2) -.L7F040F24: -/* 075A54 7F040F24 8E510010 */ lw $s1, 0x10($s2) -.L7F040F28: -/* 075A58 7F040F28 12200038 */ beqz $s1, .L7F04100C -/* 075A5C 7F040F2C 02202025 */ move $a0, $s1 -/* 075A60 7F040F30 0FC28333 */ jal sub_GAME_7F0A0CCC -/* 075A64 7F040F34 00002825 */ move $a1, $zero -/* 075A68 7F040F38 8E440010 */ lw $a0, 0x10($s2) -/* 075A6C 7F040F3C 0FC28333 */ jal sub_GAME_7F0A0CCC -/* 075A70 7F040F40 24050001 */ li $a1, 1 -/* 075A74 7F040F44 56000032 */ bnezl $s0, .L7F041010 -/* 075A78 7F040F48 8FBF0024 */ lw $ra, 0x24($sp) -/* 075A7C 7F040F4C 0FC1033C */ jal sub_GAME_7F040CF0 -/* 075A80 7F040F50 8E440010 */ lw $a0, 0x10($s2) -/* 075A84 7F040F54 8E510010 */ lw $s1, 0x10($s2) -/* 075A88 7F040F58 8E2E001C */ lw $t6, 0x1c($s1) -/* 075A8C 7F040F5C 11C00004 */ beqz $t6, .L7F040F70 -/* 075A90 7F040F60 00000000 */ nop -/* 075A94 7F040F64 0FC13011 */ jal sub_GAME_7F04C044 -/* 075A98 7F040F68 02202025 */ move $a0, $s1 -/* 075A9C 7F040F6C 8E510010 */ lw $s1, 0x10($s2) -.L7F040F70: -/* 075AA0 7F040F70 0FC0F863 */ jal chrpropDeregisterRooms -/* 075AA4 7F040F74 02202025 */ move $a0, $s1 -/* 075AA8 7F040F78 8E510010 */ lw $s1, 0x10($s2) -/* 075AAC 7F040F7C 8E300020 */ lw $s0, 0x20($s1) -/* 075AB0 7F040F80 52000009 */ beql $s0, $zero, .L7F040FA8 -/* 075AB4 7F040F84 922F0000 */ lbu $t7, ($s1) -.L7F040F88: -/* 075AB8 7F040F88 8E110024 */ lw $s1, 0x24($s0) -/* 075ABC 7F040F8C 8E040004 */ lw $a0, 4($s0) -/* 075AC0 7F040F90 0FC10409 */ jal objFreePermanently -/* 075AC4 7F040F94 24050001 */ li $a1, 1 -/* 075AC8 7F040F98 1620FFFB */ bnez $s1, .L7F040F88 -/* 075ACC 7F040F9C 02208025 */ move $s0, $s1 -/* 075AD0 7F040FA0 8E510010 */ lw $s1, 0x10($s2) -/* 075AD4 7F040FA4 922F0000 */ lbu $t7, ($s1) -.L7F040FA8: -/* 075AD8 7F040FA8 24010002 */ li $at, 2 -/* 075ADC 7F040FAC 51E10004 */ beql $t7, $at, .L7F040FC0 -/* 075AE0 7F040FB0 92580003 */ lbu $t8, 3($s2) -/* 075AE4 7F040FB4 0FC1437A */ jal sub_GAME_7F050DE8 -/* 075AE8 7F040FB8 8E440014 */ lw $a0, 0x14($s2) -/* 075AEC 7F040FBC 92580003 */ lbu $t8, 3($s2) -.L7F040FC0: -/* 075AF0 7F040FC0 24010028 */ li $at, 40 -/* 075AF4 7F040FC4 17010005 */ bne $t8, $at, .L7F040FDC -/* 075AF8 7F040FC8 00000000 */ nop -/* 075AFC 7F040FCC 0FC1B0FE */ jal set_aircraft_obj_inst_scale_to_zero -/* 075B00 7F040FD0 8E440014 */ lw $a0, 0x14($s2) -/* 075B04 7F040FD4 10000004 */ b .L7F040FE8 -/* 075B08 7F040FD8 8FB9002C */ lw $t9, 0x2c($sp) -.L7F040FDC: -/* 075B0C 7F040FDC 0FC1B08D */ jal clear_model_obj -/* 075B10 7F040FE0 8E440014 */ lw $a0, 0x14($s2) -/* 075B14 7F040FE4 8FB9002C */ lw $t9, 0x2c($sp) -.L7F040FE8: -/* 075B18 7F040FE8 53200008 */ beql $t9, $zero, .L7F04100C -/* 075B1C 7F040FEC AE400010 */ sw $zero, 0x10($s2) -/* 075B20 7F040FF0 0FC0E94E */ jal chrpropDelist -/* 075B24 7F040FF4 8E440010 */ lw $a0, 0x10($s2) -/* 075B28 7F040FF8 0FC0E905 */ jal chrpropDisable -/* 075B2C 7F040FFC 8E440010 */ lw $a0, 0x10($s2) -/* 075B30 7F041000 0FC0E921 */ jal chrpropFree -/* 075B34 7F041004 8E440010 */ lw $a0, 0x10($s2) -/* 075B38 7F041008 AE400010 */ sw $zero, 0x10($s2) -.L7F04100C: -/* 075B3C 7F04100C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F041010: -/* 075B40 7F041010 8FB00018 */ lw $s0, 0x18($sp) -/* 075B44 7F041014 8FB1001C */ lw $s1, 0x1c($sp) -/* 075B48 7F041018 8FB20020 */ lw $s2, 0x20($sp) -/* 075B4C 7F04101C 03E00008 */ jr $ra -/* 075B50 7F041020 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif + if (obj->prop != NULL) + { + sub_GAME_7F0A0CCC(obj->prop, FALSE); + sub_GAME_7F0A0CCC(obj->prop, TRUE); + if (canregen == 0) + { + objFreeEmbedmentOrProjectile(obj->prop); + if (obj->prop->parent != NULL) + { + objDetach(obj->prop); + } + chrpropDeregisterRooms(obj->prop); + child = obj->prop->child; + while (child) + { + PropRecord* next = child->prev; + objFreePermanently(child->obj, TRUE); + child = next; + } + if (obj->prop->type != PROP_TYPE_DOOR) + { + sub_GAME_7F050DE8(obj->model); + } -void objFreePermanently(struct ObjectRecord * obj, bool freeprop) { - objFree(obj, freeprop, 0); -} + if (obj->type == PROPDEF_AIRCRAFT) + { + clear_aircraft_model_obj(obj->model); + } + else + { + clear_model_obj(obj->model); + } + if (freeprop != 0) + { + chrpropDelist(obj->prop); + chrpropDisable(obj->prop); + chrpropFree(obj->prop); + } + obj->prop = NULL; + } + } +} +void objFreePermanently(struct ObjectRecord * obj, bool freeprop) +{ + objFree(obj, freeprop, 0); +} -float objGetWidth(struct ObjectRecord * obj) { - if (obj->type == 4) { +float objGetWidth(struct ObjectRecord * obj) +{ + if (obj->type == PROP_TYPE_WEAPON) + { return 20.0f; } return 10.0f; } - - bool sub_GAME_7F041074(coord3d *zeropos, coord3d *pos, coord3d *vec, f32 scale) { vec3d vector; @@ -2732,12 +1866,12 @@ glabel sub_GAME_7F041160 /* 075DC4 7F041294 E4A60004 */ swc1 $f6, 4($a1) /* 075DC8 7F041298 C7A80074 */ lwc1 $f8, 0x74($sp) /* 075DCC 7F04129C 02202025 */ move $a0, $s1 -/* 075DD0 7F0412A0 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 075DD0 7F0412A0 0FC1611D */ jal mtx4TransformVecInPlace /* 075DD4 7F0412A4 E4A80008 */ swc1 $f8, 8($a1) /* 075DD8 7F0412A8 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 075DDC 7F0412AC 00000000 */ nop /* 075DE0 7F0412B0 00402025 */ move $a0, $v0 -/* 075DE4 7F0412B4 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 075DE4 7F0412B4 0FC1611D */ jal mtx4TransformVecInPlace /* 075DE8 7F0412B8 8FA500B4 */ lw $a1, 0xb4($sp) /* 075DEC 7F0412BC 8FB000B8 */ lw $s0, 0xb8($sp) /* 075DF0 7F0412C0 C7AA0078 */ lwc1 $f10, 0x78($sp) @@ -2747,7 +1881,7 @@ glabel sub_GAME_7F041160 /* 075E00 7F0412D0 C7B0007C */ lwc1 $f16, 0x7c($sp) /* 075E04 7F0412D4 E6100004 */ swc1 $f16, 4($s0) /* 075E08 7F0412D8 C7B20080 */ lwc1 $f18, 0x80($sp) -/* 075E0C 7F0412DC 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 075E0C 7F0412DC 0FC160F6 */ jal mtx4RotateVecInPlace /* 075E10 7F0412E0 E6120008 */ swc1 $f18, 8($s0) /* 075E14 7F0412E4 C6020000 */ lwc1 $f2, ($s0) /* 075E18 7F0412E8 C6640000 */ lwc1 $f4, ($s3) @@ -2775,7 +1909,7 @@ glabel sub_GAME_7F041160 /* 075E6C 7F04133C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 075E70 7F041340 00000000 */ nop /* 075E74 7F041344 00402025 */ move $a0, $v0 -/* 075E78 7F041348 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 075E78 7F041348 0FC160F6 */ jal mtx4RotateVecInPlace /* 075E7C 7F04134C 02002825 */ move $a1, $s0 /* 075E80 7F041350 44807000 */ mtc1 $zero, $f14 /* 075E84 7F041354 C6040000 */ lwc1 $f4, ($s0) @@ -2833,10 +1967,12 @@ glabel sub_GAME_7F041160 #ifdef NONMATCHING -void sub_GAME_7F041400(void) { +// PD: func0f06b488 +bool sub_GAME_7F041400(PropRecord *prop, coord3d *arg1, coord3d *arg2, coord3d *arg3, coord3d *arg4, coord3d *arg5, f32 *arg6) { } #else +bool sub_GAME_7F041400(PropRecord *prop, coord3d *arg1, coord3d *arg2, coord3d *arg3, coord3d *arg4, coord3d *arg5, f32 *arg6); GLOBAL_ASM( .text glabel sub_GAME_7F041400 @@ -2958,7 +2094,7 @@ glabel sub_GAME_7F041400 /* 0760E8 7F0415B8 C44A0000 */ lwc1 $f10, ($v0) /* 0760EC 7F0415BC E7AA00A8 */ swc1 $f10, 0xa8($sp) /* 0760F0 7F0415C0 C4480004 */ lwc1 $f8, 4($v0) -/* 0760F4 7F0415C4 0FC2CC80 */ jal sub_GAME_7F0B3200 +/* 0760F4 7F0415C4 0FC2CC80 */ jal unkGeometry7F0B3200 /* 0760F8 7F0415C8 E7A800AC */ swc1 $f8, 0xac($sp) /* 0760FC 7F0415CC 4614003C */ c.lt.s $f0, $f20 /* 076100 7F0415D0 00000000 */ nop @@ -3080,8 +2216,8 @@ glabel sub_GAME_7F041400 /* 0762B4 7F041784 AC2C0B0C */ sw $t4, %lo(D_80030B0C)($at) /* 0762B8 7F041788 3C018003 */ lui $at, %hi(bodypartshot) /* 0762BC 7F04178C AC200B10 */ sw $zero, %lo(bodypartshot)($at) -/* 0762C0 7F041790 3C018007 */ lui $at, %hi(objinst) -/* 0762C4 7F041794 AC205B70 */ sw $zero, %lo(objinst)($at) +/* 0762C0 7F041790 3C018007 */ lui $at, %hi(g_CurrentProjectileModel) +/* 0762C4 7F041794 AC205B70 */ sw $zero, %lo(g_CurrentProjectileModel)($at) /* 0762C8 7F041798 3C018007 */ lui $at, %hi(dword_CODE_bss_80075B74) /* 0762CC 7F04179C 10000002 */ b .L7F0417A8 /* 0762D0 7F0417A0 AC205B74 */ sw $zero, %lo(dword_CODE_bss_80075B74)($at) @@ -3258,10 +2394,12 @@ glabel sub_GAME_7F0417DC #ifdef NONMATCHING -void sub_GAME_7F0419E4(void) { +// PD: func0f06b610 +bool sub_GAME_7F0419E4(ObjectRecord *obj, coord3d *arg1, coord3d *arg2, coord3d *arg3, f32 arg4, coord3d *arg5, coord3d *arg6, coord3d *arg7, coord3d *arg8, f32 *arg9) { } #else +bool sub_GAME_7F0419E4(ObjectRecord *obj, coord3d *arg1, coord3d *arg2, coord3d *arg3, f32 arg4, coord3d *arg5, coord3d *arg6, coord3d *arg7, coord3d *arg8, f32 *arg9); GLOBAL_ASM( .text glabel sub_GAME_7F0419E4 @@ -3334,8 +2472,8 @@ glabel sub_GAME_7F0419E4 /* 07661C 7F041AEC AC2A0B0C */ sw $t2, %lo(D_80030B0C)($at) /* 076620 7F041AF0 3C018003 */ lui $at, %hi(bodypartshot) /* 076624 7F041AF4 AC2B0B10 */ sw $t3, %lo(bodypartshot)($at) -/* 076628 7F041AF8 3C018007 */ lui $at, %hi(objinst) -/* 07662C 7F041AFC AC2C5B70 */ sw $t4, %lo(objinst)($at) +/* 076628 7F041AF8 3C018007 */ lui $at, %hi(g_CurrentProjectileModel) +/* 07662C 7F041AFC AC2C5B70 */ sw $t4, %lo(g_CurrentProjectileModel)($at) /* 076630 7F041B00 3C018007 */ lui $at, %hi(dword_CODE_bss_80075B74) /* 076634 7F041B04 AC2D5B74 */ sw $t5, %lo(dword_CODE_bss_80075B74)($at) .L7F041B08: @@ -3396,10 +2534,12 @@ glabel sub_GAME_7F0419E4 #ifdef NONMATCHING -void sub_GAME_7F041BB8(void) { +// PD: func0f06c28c +bool sub_GAME_7F041BB8(ChrRecord *chr, coord3d *arg1, coord3d *arg2, f32 arg3, coord3d *arg4, coord3d *arg5, coord3d *arg6, coord3d *arg7, f32 *arg8) { } #else +bool sub_GAME_7F041BB8(ChrRecord *chr, coord3d *arg1, coord3d *arg2, f32 arg3, coord3d *arg4, coord3d *arg5, coord3d *arg6, coord3d *arg7, f32 *arg8); GLOBAL_ASM( .text glabel sub_GAME_7F041BB8 @@ -3462,7 +2602,7 @@ glabel sub_GAME_7F041BB8 /* 0767C8 7F041C98 AFA20044 */ sw $v0, 0x44($sp) /* 0767CC 7F041C9C 8FA40040 */ lw $a0, 0x40($sp) /* 0767D0 7F041CA0 8FA5003C */ lw $a1, 0x3c($sp) -/* 0767D4 7F041CA4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0767D4 7F041CA4 0FC1B198 */ jal modelFindNodeMtx /* 0767D8 7F041CA8 00003025 */ move $a2, $zero /* 0767DC 7F041CAC 8FA30078 */ lw $v1, 0x78($sp) /* 0767E0 7F041CB0 C44A0030 */ lwc1 $f10, 0x30($v0) @@ -3541,9 +2681,9 @@ glabel sub_GAME_7F041BB8 /* 0768F8 7F041DC8 8FAA0040 */ lw $t2, 0x40($sp) /* 0768FC 7F041DCC 3C018003 */ lui $at, %hi(bodypartshot) /* 076900 7F041DD0 AC290B10 */ sw $t1, %lo(bodypartshot)($at) -/* 076904 7F041DD4 3C018007 */ lui $at, %hi(objinst) +/* 076904 7F041DD4 3C018007 */ lui $at, %hi(g_CurrentProjectileModel) /* 076908 7F041DD8 8FAB003C */ lw $t3, 0x3c($sp) -/* 07690C 7F041DDC AC2A5B70 */ sw $t2, %lo(objinst)($at) +/* 07690C 7F041DDC AC2A5B70 */ sw $t2, %lo(g_CurrentProjectileModel)($at) /* 076910 7F041DE0 3C018007 */ lui $at, %hi(dword_CODE_bss_80075B74) /* 076914 7F041DE4 24020001 */ li $v0, 1 /* 076918 7F041DE8 10000002 */ b .L7F041DF4 @@ -3561,311 +2701,147 @@ glabel sub_GAME_7F041BB8 #endif +bool projectileFindCollidingProp(PropRecord *prop, coord3d *pos1, coord3d *pos2, u32 cdtypes, coord3d *arg4, coord3d *arg5, s32 *rooms) +{ + bool result; + f32 dist; + s16 *propnumptr; + f32 spa8; + bool spa4; + coord3d sp98; + ChrRecord *chr; + coord3d sp88; + coord3d sp7c; + PropRecord *iterprop; + PropRecord *playerstank; + ObjectRecord *obj; + s32 unused; + result = FALSE; + spa4 = FALSE; + playerstank = get_ptr_for_players_tank(); + sp98.x = pos2->x - pos1->x; + sp98.y = pos2->y - pos1->y; + sp98.z = pos2->z - pos1->z; -#ifdef NONMATCHING -void sub_GAME_7F041E0C(void) { + dist = sqrtf(sp98.f[0] * sp98.f[0] + sp98.f[1] * sp98.f[1] + sp98.f[2] * sp98.f[2]); -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F041E0C -/* 07693C 7F041E0C 27BDFF48 */ addiu $sp, $sp, -0xb8 -/* 076940 7F041E10 AFBF005C */ sw $ra, 0x5c($sp) -/* 076944 7F041E14 AFB40048 */ sw $s4, 0x48($sp) -/* 076948 7F041E18 AFB20040 */ sw $s2, 0x40($sp) -/* 07694C 7F041E1C 00E09025 */ move $s2, $a3 -/* 076950 7F041E20 00A0A025 */ move $s4, $a1 -/* 076954 7F041E24 AFBE0058 */ sw $fp, 0x58($sp) -/* 076958 7F041E28 AFB70054 */ sw $s7, 0x54($sp) -/* 07695C 7F041E2C AFB60050 */ sw $s6, 0x50($sp) -/* 076960 7F041E30 AFB5004C */ sw $s5, 0x4c($sp) -/* 076964 7F041E34 AFB30044 */ sw $s3, 0x44($sp) -/* 076968 7F041E38 AFB1003C */ sw $s1, 0x3c($sp) -/* 07696C 7F041E3C AFB00038 */ sw $s0, 0x38($sp) -/* 076970 7F041E40 F7B40030 */ sdc1 $f20, 0x30($sp) -/* 076974 7F041E44 AFA400B8 */ sw $a0, 0xb8($sp) -/* 076978 7F041E48 AFA600C0 */ sw $a2, 0xc0($sp) -/* 07697C 7F041E4C AFA000B4 */ sw $zero, 0xb4($sp) -/* 076980 7F041E50 0FC1F3A1 */ jal get_ptr_for_players_tank -/* 076984 7F041E54 AFA000A4 */ sw $zero, 0xa4($sp) -/* 076988 7F041E58 8FA300C0 */ lw $v1, 0xc0($sp) -/* 07698C 7F041E5C AFA20074 */ sw $v0, 0x74($sp) -/* 076990 7F041E60 C6860000 */ lwc1 $f6, ($s4) -/* 076994 7F041E64 C4640000 */ lwc1 $f4, ($v1) -/* 076998 7F041E68 46062201 */ sub.s $f8, $f4, $f6 -/* 07699C 7F041E6C E7A80098 */ swc1 $f8, 0x98($sp) -/* 0769A0 7F041E70 C6900004 */ lwc1 $f16, 4($s4) -/* 0769A4 7F041E74 C46A0004 */ lwc1 $f10, 4($v1) -/* 0769A8 7F041E78 46105481 */ sub.s $f18, $f10, $f16 -/* 0769AC 7F041E7C C7AA0098 */ lwc1 $f10, 0x98($sp) -/* 0769B0 7F041E80 E7B2009C */ swc1 $f18, 0x9c($sp) -/* 0769B4 7F041E84 C6860008 */ lwc1 $f6, 8($s4) -/* 0769B8 7F041E88 C4640008 */ lwc1 $f4, 8($v1) -/* 0769BC 7F041E8C 460A5402 */ mul.s $f16, $f10, $f10 -/* 0769C0 7F041E90 C7B2009C */ lwc1 $f18, 0x9c($sp) -/* 0769C4 7F041E94 46062201 */ sub.s $f8, $f4, $f6 -/* 0769C8 7F041E98 46129102 */ mul.s $f4, $f18, $f18 -/* 0769CC 7F041E9C E7A800A0 */ swc1 $f8, 0xa0($sp) -/* 0769D0 7F041EA0 C7A800A0 */ lwc1 $f8, 0xa0($sp) -/* 0769D4 7F041EA4 46084282 */ mul.s $f10, $f8, $f8 -/* 0769D8 7F041EA8 46048180 */ add.s $f6, $f16, $f4 -/* 0769DC 7F041EAC 0C007DF8 */ jal sqrtf -/* 0769E0 7F041EB0 46065300 */ add.s $f12, $f10, $f6 -/* 0769E4 7F041EB4 44809000 */ mtc1 $zero, $f18 -/* 0769E8 7F041EB8 46000506 */ mov.s $f20, $f0 -/* 0769EC 7F041EBC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0769F0 7F041EC0 46120032 */ c.eq.s $f0, $f18 -/* 0769F4 7F041EC4 00000000 */ nop -/* 0769F8 7F041EC8 45020004 */ bc1fl .L7F041EDC -/* 0769FC 7F041ECC 44818000 */ mtc1 $at, $f16 -/* 076A00 7F041ED0 100000D1 */ b .L7F042218 -/* 076A04 7F041ED4 00001025 */ move $v0, $zero -/* 076A08 7F041ED8 44818000 */ mtc1 $at, $f16 -.L7F041EDC: -/* 076A0C 7F041EDC C7A40098 */ lwc1 $f4, 0x98($sp) -/* 076A10 7F041EE0 C7AA009C */ lwc1 $f10, 0x9c($sp) -/* 076A14 7F041EE4 46148003 */ div.s $f0, $f16, $f20 -/* 076A18 7F041EE8 C7B200A0 */ lwc1 $f18, 0xa0($sp) -/* 076A1C 7F041EEC 46002202 */ mul.s $f8, $f4, $f0 -/* 076A20 7F041EF0 00000000 */ nop -/* 076A24 7F041EF4 46005182 */ mul.s $f6, $f10, $f0 -/* 076A28 7F041EF8 00000000 */ nop -/* 076A2C 7F041EFC 46009402 */ mul.s $f16, $f18, $f0 -/* 076A30 7F041F00 E7A80098 */ swc1 $f8, 0x98($sp) -/* 076A34 7F041F04 E7A6009C */ swc1 $f6, 0x9c($sp) -/* 076A38 7F041F08 E7B000A0 */ swc1 $f16, 0xa0($sp) -/* 076A3C 7F041F0C C6840000 */ lwc1 $f4, ($s4) -/* 076A40 7F041F10 E7A40088 */ swc1 $f4, 0x88($sp) -/* 076A44 7F041F14 C6880004 */ lwc1 $f8, 4($s4) -/* 076A48 7F041F18 E7A8008C */ swc1 $f8, 0x8c($sp) -/* 076A4C 7F041F1C C68A0008 */ lwc1 $f10, 8($s4) -/* 076A50 7F041F20 0FC1E0F1 */ jal currentPlayerGetMatrix10CC -/* 076A54 7F041F24 E7AA0090 */ swc1 $f10, 0x90($sp) -/* 076A58 7F041F28 00402025 */ move $a0, $v0 -/* 076A5C 7F041F2C 0FC1611D */ jal matrix_4x4_transform_vector_in_place -/* 076A60 7F041F30 27A50088 */ addiu $a1, $sp, 0x88 -/* 076A64 7F041F34 C7A60098 */ lwc1 $f6, 0x98($sp) -/* 076A68 7F041F38 C7B2009C */ lwc1 $f18, 0x9c($sp) -/* 076A6C 7F041F3C C7B000A0 */ lwc1 $f16, 0xa0($sp) -/* 076A70 7F041F40 E7A6007C */ swc1 $f6, 0x7c($sp) -/* 076A74 7F041F44 E7B20080 */ swc1 $f18, 0x80($sp) -/* 076A78 7F041F48 0FC1E0F1 */ jal currentPlayerGetMatrix10CC -/* 076A7C 7F041F4C E7B00084 */ swc1 $f16, 0x84($sp) -/* 076A80 7F041F50 00402025 */ move $a0, $v0 -/* 076A84 7F041F54 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 076A88 7F041F58 27A5007C */ addiu $a1, $sp, 0x7c -/* 076A8C 7F041F5C 12400099 */ beqz $s2, .L7F0421C4 -/* 076A90 7F041F60 E7B400A8 */ swc1 $f20, 0xa8($sp) -/* 076A94 7F041F64 0FC0F8FF */ jal sub_GAME_7F03E3FC -/* 076A98 7F041F68 8FA400D0 */ lw $a0, 0xd0($sp) -/* 076A9C 7F041F6C 3C138007 */ lui $s3, %hi(ptr_list_object_lookup_indices) -/* 076AA0 7F041F70 8E739C30 */ lw $s3, %lo(ptr_list_object_lookup_indices)($s3) -/* 076AA4 7F041F74 27BE00A8 */ addiu $fp, $sp, 0xa8 -/* 076AA8 7F041F78 27B70098 */ addiu $s7, $sp, 0x98 -/* 076AAC 7F041F7C 86620000 */ lh $v0, ($s3) -/* 076AB0 7F041F80 8FB600CC */ lw $s6, 0xcc($sp) -/* 076AB4 7F041F84 8FB500C8 */ lw $s5, 0xc8($sp) -/* 076AB8 7F041F88 0440008E */ bltz $v0, .L7F0421C4 -/* 076ABC 7F041F8C 00027080 */ sll $t6, $v0, 2 -.L7F041F90: -/* 076AC0 7F041F90 01C27023 */ subu $t6, $t6, $v0 -/* 076AC4 7F041F94 000E7080 */ sll $t6, $t6, 2 -/* 076AC8 7F041F98 8FB800B8 */ lw $t8, 0xb8($sp) -/* 076ACC 7F041F9C 01C27021 */ addu $t6, $t6, $v0 -/* 076AD0 7F041FA0 3C0F8007 */ lui $t7, %hi(pos_data_entry) -/* 076AD4 7F041FA4 25EF9C38 */ addiu $t7, %lo(pos_data_entry) # addiu $t7, $t7, -0x63c8 -/* 076AD8 7F041FA8 000E7080 */ sll $t6, $t6, 2 -/* 076ADC 7F041FAC 01CF8021 */ addu $s0, $t6, $t7 -/* 076AE0 7F041FB0 52180081 */ beql $s0, $t8, .L7F0421B8 -/* 076AE4 7F041FB4 86620002 */ lh $v0, 2($s3) -/* 076AE8 7F041FB8 92020000 */ lbu $v0, ($s0) -/* 076AEC 7F041FBC 24010001 */ li $at, 1 -/* 076AF0 7F041FC0 10410005 */ beq $v0, $at, .L7F041FD8 -/* 076AF4 7F041FC4 24010004 */ li $at, 4 -/* 076AF8 7F041FC8 10410003 */ beq $v0, $at, .L7F041FD8 -/* 076AFC 7F041FCC 24010002 */ li $at, 2 -/* 076B00 7F041FD0 54410030 */ bnel $v0, $at, .L7F042094 -/* 076B04 7F041FD4 24010003 */ li $at, 3 -.L7F041FD8: -/* 076B08 7F041FD8 8E110004 */ lw $s1, 4($s0) -/* 076B0C 7F041FDC 8E390064 */ lw $t9, 0x64($s1) -/* 076B10 7F041FE0 33280008 */ andi $t0, $t9, 8 -/* 076B14 7F041FE4 55000074 */ bnezl $t0, .L7F0421B8 -/* 076B18 7F041FE8 86620002 */ lh $v0, 2($s3) -/* 076B1C 7F041FEC 8E29000C */ lw $t1, 0xc($s1) -/* 076B20 7F041FF0 24010002 */ li $at, 2 -/* 076B24 7F041FF4 00095180 */ sll $t2, $t1, 6 -/* 076B28 7F041FF8 0542006F */ bltzl $t2, .L7F0421B8 -/* 076B2C 7F041FFC 86620002 */ lh $v0, 2($s3) -/* 076B30 7F042000 1441000B */ bne $v0, $at, .L7F042030 -/* 076B34 7F042004 324D0001 */ andi $t5, $s2, 1 -/* 076B38 7F042008 324B0002 */ andi $t3, $s2, 2 -/* 076B3C 7F04200C 5560000B */ bnezl $t3, .L7F04203C -/* 076B40 7F042010 8FAE0074 */ lw $t6, 0x74($sp) -/* 076B44 7F042014 0FC0F67B */ jal sub_GAME_7F03D9EC -/* 076B48 7F042018 02002025 */ move $a0, $s0 -/* 076B4C 7F04201C 00526024 */ and $t4, $v0, $s2 -/* 076B50 7F042020 55800006 */ bnezl $t4, .L7F04203C -/* 076B54 7F042024 8FAE0074 */ lw $t6, 0x74($sp) -/* 076B58 7F042028 10000063 */ b .L7F0421B8 -/* 076B5C 7F04202C 86620002 */ lh $v0, 2($s3) -.L7F042030: -/* 076B60 7F042030 51A00061 */ beql $t5, $zero, .L7F0421B8 -/* 076B64 7F042034 86620002 */ lh $v0, 2($s3) -/* 076B68 7F042038 8FAE0074 */ lw $t6, 0x74($sp) -.L7F04203C: -/* 076B6C 7F04203C 02202025 */ move $a0, $s1 -/* 076B70 7F042040 02802825 */ move $a1, $s4 -/* 076B74 7F042044 160E0004 */ bne $s0, $t6, .L7F042058 -/* 076B78 7F042048 8FA600C0 */ lw $a2, 0xc0($sp) -/* 076B7C 7F04204C 922F0002 */ lbu $t7, 2($s1) -/* 076B80 7F042050 31F80020 */ andi $t8, $t7, 0x20 -/* 076B84 7F042054 17000057 */ bnez $t8, .L7F0421B4 -.L7F042058: -/* 076B88 7F042058 27B90088 */ addiu $t9, $sp, 0x88 -/* 076B8C 7F04205C 27A8007C */ addiu $t0, $sp, 0x7c -/* 076B90 7F042060 AFA80018 */ sw $t0, 0x18($sp) -/* 076B94 7F042064 AFB90014 */ sw $t9, 0x14($sp) -/* 076B98 7F042068 02E03825 */ move $a3, $s7 -/* 076B9C 7F04206C E7B40010 */ swc1 $f20, 0x10($sp) -/* 076BA0 7F042070 AFB5001C */ sw $s5, 0x1c($sp) -/* 076BA4 7F042074 AFB60020 */ sw $s6, 0x20($sp) -/* 076BA8 7F042078 0FC10679 */ jal sub_GAME_7F0419E4 -/* 076BAC 7F04207C AFBE0024 */ sw $fp, 0x24($sp) -/* 076BB0 7F042080 1040004C */ beqz $v0, .L7F0421B4 -/* 076BB4 7F042084 24090001 */ li $t1, 1 -/* 076BB8 7F042088 1000004A */ b .L7F0421B4 -/* 076BBC 7F04208C AFA900A4 */ sw $t1, 0xa4($sp) -/* 076BC0 7F042090 24010003 */ li $at, 3 -.L7F042094: -/* 076BC4 7F042094 10410005 */ beq $v0, $at, .L7F0420AC -/* 076BC8 7F042098 24010006 */ li $at, 6 -/* 076BCC 7F04209C 5441002F */ bnel $v0, $at, .L7F04215C -/* 076BD0 7F0420A0 24010006 */ li $at, 6 -/* 076BD4 7F0420A4 8E0A0004 */ lw $t2, 4($s0) -/* 076BD8 7F0420A8 1140002B */ beqz $t2, .L7F042158 -.L7F0420AC: -/* 076BDC 7F0420AC 24010006 */ li $at, 6 -/* 076BE0 7F0420B0 1441000F */ bne $v0, $at, .L7F0420F0 -/* 076BE4 7F0420B4 8E110004 */ lw $s1, 4($s0) -/* 076BE8 7F0420B8 0FC26C57 */ jal sub_GAME_7F09B15C -/* 076BEC 7F0420BC 02002025 */ move $a0, $s0 -/* 076BF0 7F0420C0 00025880 */ sll $t3, $v0, 2 -/* 076BF4 7F0420C4 3C0C8008 */ lui $t4, %hi(g_playerPointers) -/* 076BF8 7F0420C8 018B6021 */ addu $t4, $t4, $t3 -/* 076BFC 7F0420CC 8D8C9EE0 */ lw $t4, %lo(g_playerPointers)($t4) -/* 076C00 7F0420D0 324E0004 */ andi $t6, $s2, 4 -/* 076C04 7F0420D4 8D8D00AC */ lw $t5, 0xac($t4) -/* 076C08 7F0420D8 51A00037 */ beql $t5, $zero, .L7F0421B8 -/* 076C0C 7F0420DC 86620002 */ lh $v0, 2($s3) -/* 076C10 7F0420E0 55C0000E */ bnezl $t6, .L7F04211C -/* 076C14 7F0420E4 4407A000 */ mfc1 $a3, $f20 -/* 076C18 7F0420E8 10000033 */ b .L7F0421B8 -/* 076C1C 7F0420EC 86620002 */ lh $v0, 2($s3) -.L7F0420F0: -/* 076C20 7F0420F0 24010003 */ li $at, 3 -/* 076C24 7F0420F4 54410009 */ bnel $v0, $at, .L7F04211C -/* 076C28 7F0420F8 4407A000 */ mfc1 $a3, $f20 -/* 076C2C 7F0420FC 962F0012 */ lhu $t7, 0x12($s1) -/* 076C30 7F042100 32590008 */ andi $t9, $s2, 8 -/* 076C34 7F042104 31F80100 */ andi $t8, $t7, 0x100 -/* 076C38 7F042108 5700002B */ bnezl $t8, .L7F0421B8 -/* 076C3C 7F04210C 86620002 */ lh $v0, 2($s3) -/* 076C40 7F042110 53200029 */ beql $t9, $zero, .L7F0421B8 -/* 076C44 7F042114 86620002 */ lh $v0, 2($s3) -/* 076C48 7F042118 4407A000 */ mfc1 $a3, $f20 -.L7F04211C: -/* 076C4C 7F04211C 27A80088 */ addiu $t0, $sp, 0x88 -/* 076C50 7F042120 27A9007C */ addiu $t1, $sp, 0x7c -/* 076C54 7F042124 AFA90014 */ sw $t1, 0x14($sp) -/* 076C58 7F042128 AFA80010 */ sw $t0, 0x10($sp) -/* 076C5C 7F04212C 02202025 */ move $a0, $s1 -/* 076C60 7F042130 02802825 */ move $a1, $s4 -/* 076C64 7F042134 02E03025 */ move $a2, $s7 -/* 076C68 7F042138 AFB50018 */ sw $s5, 0x18($sp) -/* 076C6C 7F04213C AFB6001C */ sw $s6, 0x1c($sp) -/* 076C70 7F042140 0FC106EE */ jal sub_GAME_7F041BB8 -/* 076C74 7F042144 AFBE0020 */ sw $fp, 0x20($sp) -/* 076C78 7F042148 1040001A */ beqz $v0, .L7F0421B4 -/* 076C7C 7F04214C 240A0001 */ li $t2, 1 -/* 076C80 7F042150 10000018 */ b .L7F0421B4 -/* 076C84 7F042154 AFAA00A4 */ sw $t2, 0xa4($sp) -.L7F042158: -/* 076C88 7F042158 24010006 */ li $at, 6 -.L7F04215C: -/* 076C8C 7F04215C 54410016 */ bnel $v0, $at, .L7F0421B8 -/* 076C90 7F042160 86620002 */ lh $v0, 2($s3) -/* 076C94 7F042164 0FC26C57 */ jal sub_GAME_7F09B15C -/* 076C98 7F042168 02002025 */ move $a0, $s0 -/* 076C9C 7F04216C 00025880 */ sll $t3, $v0, 2 -/* 076CA0 7F042170 3C0C8008 */ lui $t4, %hi(g_playerPointers) -/* 076CA4 7F042174 018B6021 */ addu $t4, $t4, $t3 -/* 076CA8 7F042178 8D8C9EE0 */ lw $t4, %lo(g_playerPointers)($t4) -/* 076CAC 7F04217C 02002025 */ move $a0, $s0 -/* 076CB0 7F042180 02802825 */ move $a1, $s4 -/* 076CB4 7F042184 8D8D00AC */ lw $t5, 0xac($t4) -/* 076CB8 7F042188 8FA600C0 */ lw $a2, 0xc0($sp) -/* 076CBC 7F04218C 02E03825 */ move $a3, $s7 -/* 076CC0 7F042190 51A00009 */ beql $t5, $zero, .L7F0421B8 -/* 076CC4 7F042194 86620002 */ lh $v0, 2($s3) -/* 076CC8 7F042198 AFB50010 */ sw $s5, 0x10($sp) -/* 076CCC 7F04219C AFB60014 */ sw $s6, 0x14($sp) -/* 076CD0 7F0421A0 0FC10500 */ jal sub_GAME_7F041400 -/* 076CD4 7F0421A4 AFBE0018 */ sw $fp, 0x18($sp) -/* 076CD8 7F0421A8 10400002 */ beqz $v0, .L7F0421B4 -/* 076CDC 7F0421AC 240E0001 */ li $t6, 1 -/* 076CE0 7F0421B0 AFAE00A4 */ sw $t6, 0xa4($sp) -.L7F0421B4: -/* 076CE4 7F0421B4 86620002 */ lh $v0, 2($s3) -.L7F0421B8: -/* 076CE8 7F0421B8 26730002 */ addiu $s3, $s3, 2 -/* 076CEC 7F0421BC 0443FF74 */ bgezl $v0, .L7F041F90 -/* 076CF0 7F0421C0 00027080 */ sll $t6, $v0, 2 -.L7F0421C4: -/* 076CF4 7F0421C4 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 076CF8 7F0421C8 3C028007 */ lui $v0, %hi(flt_CODE_bss_80075B78) -/* 076CFC 7F0421CC 24425B78 */ addiu $v0, %lo(flt_CODE_bss_80075B78) # addiu $v0, $v0, 0x5b78 -/* 076D00 7F0421D0 11E00010 */ beqz $t7, .L7F042214 -/* 076D04 7F0421D4 3C038007 */ lui $v1, %hi(flt_CODE_bss_80075B88) -/* 076D08 7F0421D8 C7A40098 */ lwc1 $f4, 0x98($sp) -/* 076D0C 7F0421DC C7A8009C */ lwc1 $f8, 0x9c($sp) -/* 076D10 7F0421E0 C7AA00A0 */ lwc1 $f10, 0xa0($sp) -/* 076D14 7F0421E4 C7A6007C */ lwc1 $f6, 0x7c($sp) -/* 076D18 7F0421E8 C7B20080 */ lwc1 $f18, 0x80($sp) -/* 076D1C 7F0421EC C7B00084 */ lwc1 $f16, 0x84($sp) -/* 076D20 7F0421F0 24635B88 */ addiu $v1, %lo(flt_CODE_bss_80075B88) # addiu $v1, $v1, 0x5b88 -/* 076D24 7F0421F4 24180001 */ li $t8, 1 -/* 076D28 7F0421F8 AFB800B4 */ sw $t8, 0xb4($sp) -/* 076D2C 7F0421FC E4440000 */ swc1 $f4, ($v0) -/* 076D30 7F042200 E4480004 */ swc1 $f8, 4($v0) -/* 076D34 7F042204 E44A0008 */ swc1 $f10, 8($v0) -/* 076D38 7F042208 E4660000 */ swc1 $f6, ($v1) -/* 076D3C 7F04220C E4720004 */ swc1 $f18, 4($v1) -/* 076D40 7F042210 E4700008 */ swc1 $f16, 8($v1) -.L7F042214: -/* 076D44 7F042214 8FA200B4 */ lw $v0, 0xb4($sp) -.L7F042218: -/* 076D48 7F042218 8FBF005C */ lw $ra, 0x5c($sp) -/* 076D4C 7F04221C D7B40030 */ ldc1 $f20, 0x30($sp) -/* 076D50 7F042220 8FB00038 */ lw $s0, 0x38($sp) -/* 076D54 7F042224 8FB1003C */ lw $s1, 0x3c($sp) -/* 076D58 7F042228 8FB20040 */ lw $s2, 0x40($sp) -/* 076D5C 7F04222C 8FB30044 */ lw $s3, 0x44($sp) -/* 076D60 7F042230 8FB40048 */ lw $s4, 0x48($sp) -/* 076D64 7F042234 8FB5004C */ lw $s5, 0x4c($sp) -/* 076D68 7F042238 8FB60050 */ lw $s6, 0x50($sp) -/* 076D6C 7F04223C 8FB70054 */ lw $s7, 0x54($sp) -/* 076D70 7F042240 8FBE0058 */ lw $fp, 0x58($sp) -/* 076D74 7F042244 03E00008 */ jr $ra -/* 076D78 7F042248 27BD00B8 */ addiu $sp, $sp, 0xb8 -) -#endif + if (dist == 0.0f) + { + return FALSE; + } + + sp98.x *= (1.0f / dist); + sp98.y *= (1.0f / dist); + sp98.z *= (1.0f / dist); + + sp88.x = pos1->x; + sp88.y = pos1->y; + sp88.z = pos1->z; + mtx4TransformVecInPlace(camGetWorldToScreenMtxf(), &sp88); + sp7c.x = sp98.x; + sp7c.y = sp98.y; + sp7c.z = sp98.z; + mtx4RotateVecInPlace(camGetWorldToScreenMtxf(), sp7c.f); + + spa8 = dist; + + if (cdtypes != 0) + { + roomGetProps(rooms); + + for (propnumptr = ptr_list_object_lookup_indices; *propnumptr >= 0; propnumptr++) + { + iterprop = &pos_data_entry[*propnumptr]; + + if (iterprop != prop) + { + if (iterprop->type == PROP_TYPE_OBJ + || iterprop->type == PROP_TYPE_WEAPON + || iterprop->type == PROP_TYPE_DOOR) + { + obj = iterprop->obj; + + if ((obj->runtime_bitflags & RUNTIMEBITFLAG_ISRETICK) == 0 && (obj->flags2 & PROPFLAG2_THROWTHROUGH) == 0) { + if (iterprop->type == PROP_TYPE_DOOR) + { + if ((cdtypes & CDTYPE_DOORS) == 0 && (propDoorGetCdTypes(iterprop) & cdtypes) == 0) + { + continue; + } + } + else + { + if ((cdtypes & CDTYPE_OBJS) == 0) + { + continue; + } + } + + if ((iterprop != playerstank) || !(obj->state & PROPSTATE_20)) + { + if (sub_GAME_7F0419E4(obj, pos1, pos2, &sp98, dist, &sp88, &sp7c, arg4, arg5, &spa8)) + { + spa4 = TRUE; + } + } + } + } else if (iterprop->type == PROP_TYPE_CHR + || (iterprop->type == PROP_TYPE_VIEWER && iterprop->chr)) + { + chr = iterprop->chr; + + if (iterprop->type == PROP_TYPE_VIEWER) + { + if (!g_playerPointers[getPlayerPointerIndex(iterprop)]->field_AC || (cdtypes & CDTYPE_PLAYERS) == 0) + { + continue; + } + } + else if (iterprop->type == PROP_TYPE_CHR) + { + if ((chr->hidden & CHRHIDDEN_MOVING) || (cdtypes & CDTYPE_CHRS) == 0) + { + continue; + } + } + + if (sub_GAME_7F041BB8(chr, pos1, &sp98, dist, &sp88, &sp7c, arg4, arg5, &spa8)) + { + spa4 = TRUE; + } + } else if (iterprop->type == PROP_TYPE_VIEWER + && g_playerPointers[getPlayerPointerIndex(iterprop)]->field_AC) + { + if (sub_GAME_7F041400(iterprop, pos1, pos2, &sp98, arg4, arg5, &spa8)) + { + spa4 = TRUE; + } + } + } + } + } + + if (spa4) + { + result = TRUE; + + flt_CODE_bss_80075B78.x = sp98.x; + flt_CODE_bss_80075B78.y = sp98.y; + flt_CODE_bss_80075B78.z = sp98.z; + + flt_CODE_bss_80075B88.x = sp7c.x; + flt_CODE_bss_80075B88.y = sp7c.y; + flt_CODE_bss_80075B88.z = sp7c.z; + + } + + return result; +} #ifdef NONMATCHING @@ -4202,7 +3178,7 @@ glabel handles_projectile_motion /* 077238 7F042708 27A60268 */ addiu $a2, $sp, 0x268 /* 07723C 7F04270C 2407001F */ li $a3, 31 /* 077240 7F042710 AFB30010 */ sw $s3, 0x10($sp) -/* 077244 7F042714 0FC10783 */ jal sub_GAME_7F041E0C +/* 077244 7F042714 0FC10783 */ jal projectileFindCollidingProp /* 077248 7F042718 AFB00014 */ sw $s0, 0x14($sp) /* 07724C 7F04271C 14400036 */ bnez $v0, .L7F0427F8 /* 077250 7F042720 8FAB02C4 */ lw $t3, 0x2c4($sp) @@ -4526,7 +3502,7 @@ glabel sub_GAME_7F042A0C /* 0776AC 7F042B7C E7A60024 */ swc1 $f6, 0x24($sp) /* 0776B0 7F042B80 E7AA0018 */ swc1 $f10, 0x18($sp) /* 0776B4 7F042B84 E7B2001C */ swc1 $f18, 0x1c($sp) -/* 0776B8 7F042B88 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0776B8 7F042B88 0FC2C389 */ jal stanTestLineUnobstructed /* 0776BC 7F042B8C E7A40020 */ swc1 $f4, 0x20($sp) /* 0776C0 7F042B90 1040001D */ beqz $v0, .L7F042C08 /* 0776C4 7F042B94 8FAE00B8 */ lw $t6, 0xb8($sp) @@ -4540,7 +3516,7 @@ glabel sub_GAME_7F042A0C /* 0776E4 7F042BB4 8FA600A0 */ lw $a2, 0xa0($sp) /* 0776E8 7F042BB8 8FA700B4 */ lw $a3, 0xb4($sp) /* 0776EC 7F042BBC E7A80014 */ swc1 $f8, 0x14($sp) -/* 0776F0 7F042BC0 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 0776F0 7F042BC0 0FC2C62E */ jal stanTestVolume /* 0776F4 7F042BC4 E7B00018 */ swc1 $f16, 0x18($sp) /* 0776F8 7F042BC8 0441000F */ bgez $v0, .L7F042C08 /* 0776FC 7F042BCC C7AA0098 */ lwc1 $f10, 0x98($sp) @@ -4654,7 +3630,7 @@ glabel sub_GAME_7F042A0C /* 077898 7F042D68 E7B00044 */ swc1 $f16, 0x44($sp) /* 07789C 7F042D6C C6120010 */ lwc1 $f18, 0x10($s0) /* 0778A0 7F042D70 46125101 */ sub.s $f4, $f10, $f18 -/* 0778A4 7F042D74 0FC2CCF7 */ jal sub_GAME_7F0B33DC +/* 0778A4 7F042D74 0FC2CCF7 */ jal unkGeometry7F0B33DC /* 0778A8 7F042D78 E7A40048 */ swc1 $f4, 0x48($sp) /* 0778AC 7F042D7C C7A80044 */ lwc1 $f8, 0x44($sp) /* 0778B0 7F042D80 3C018005 */ lui $at, %hi(D_80052A5C) @@ -4690,7 +3666,7 @@ glabel sub_GAME_7F042A0C /* 077928 7F042DF8 E7A6001C */ swc1 $f6, 0x1c($sp) /* 07792C 7F042DFC E7AA0024 */ swc1 $f10, 0x24($sp) /* 077930 7F042E00 E7A80020 */ swc1 $f8, 0x20($sp) -/* 077934 7F042E04 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 077934 7F042E04 0FC2C389 */ jal stanTestLineUnobstructed /* 077938 7F042E08 E7A40010 */ swc1 $f4, 0x10($sp) /* 07793C 7F042E0C 1040001F */ beqz $v0, .L7F042E8C /* 077940 7F042E10 8FA900B8 */ lw $t1, 0xb8($sp) @@ -4704,7 +3680,7 @@ glabel sub_GAME_7F042A0C /* 077960 7F042E30 8FA60070 */ lw $a2, 0x70($sp) /* 077964 7F042E34 8FA700B4 */ lw $a3, 0xb4($sp) /* 077968 7F042E38 E7B20014 */ swc1 $f18, 0x14($sp) -/* 07796C 7F042E3C 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 07796C 7F042E3C 0FC2C62E */ jal stanTestVolume /* 077970 7F042E40 E7A40018 */ swc1 $f4, 0x18($sp) /* 077974 7F042E44 04410011 */ bgez $v0, .L7F042E8C /* 077978 7F042E48 C7B00068 */ lwc1 $f16, 0x68($sp) @@ -4744,45 +3720,18 @@ glabel sub_GAME_7F042A0C +/** + * US address 7F042EB4. +*/ +s32 sub_GAME_7F042EB4(struct ObjectRecord *arg0, f32 *arg1, struct coord3d *arg2, struct coord3d *arg3, s32 arg4, s32 arg5) +{ + if ((arg0->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) && arg0->projectile->flags & 4) + { + return handles_projectile_motion(arg0, arg1, arg2, arg3, arg4, arg5); + } -#ifdef NONMATCHING -void sub_GAME_7F042EB4(void) { - + return sub_GAME_7F042A0C(arg0, arg1, arg2, arg3, arg4); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F042EB4 -/* 0779E4 7F042EB4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0779E8 7F042EB8 AFBF001C */ sw $ra, 0x1c($sp) -/* 0779EC 7F042EBC 8C8E0064 */ lw $t6, 0x64($a0) -/* 0779F0 7F042EC0 8FAB0030 */ lw $t3, 0x30($sp) -/* 0779F4 7F042EC4 31CF0080 */ andi $t7, $t6, 0x80 -/* 0779F8 7F042EC8 11E0000D */ beqz $t7, .L7F042F00 -/* 0779FC 7F042ECC 00000000 */ nop -/* 077A00 7F042ED0 8C98006C */ lw $t8, 0x6c($a0) -/* 077A04 7F042ED4 8FA90030 */ lw $t1, 0x30($sp) -/* 077A08 7F042ED8 8F190000 */ lw $t9, ($t8) -/* 077A0C 7F042EDC 33280004 */ andi $t0, $t9, 4 -/* 077A10 7F042EE0 11000007 */ beqz $t0, .L7F042F00 -/* 077A14 7F042EE4 00000000 */ nop -/* 077A18 7F042EE8 8FAA0034 */ lw $t2, 0x34($sp) -/* 077A1C 7F042EEC AFA90010 */ sw $t1, 0x10($sp) -/* 077A20 7F042EF0 0FC10893 */ jal handles_projectile_motion -/* 077A24 7F042EF4 AFAA0014 */ sw $t2, 0x14($sp) -/* 077A28 7F042EF8 10000004 */ b .L7F042F0C -/* 077A2C 7F042EFC 8FBF001C */ lw $ra, 0x1c($sp) -.L7F042F00: -/* 077A30 7F042F00 0FC10A83 */ jal sub_GAME_7F042A0C -/* 077A34 7F042F04 AFAB0010 */ sw $t3, 0x10($sp) -/* 077A38 7F042F08 8FBF001C */ lw $ra, 0x1c($sp) -.L7F042F0C: -/* 077A3C 7F042F0C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 077A40 7F042F10 03E00008 */ jr $ra -/* 077A44 7F042F14 00000000 */ nop -) -#endif - @@ -4957,7 +3906,7 @@ glabel sub_GAME_7F0431E4 /* 077D50 7F043220 24010001 */ li $at, 1 /* 077D54 7F043224 15010009 */ bne $t0, $at, .L7F04324C /* 077D58 7F043228 26240018 */ addiu $a0, $s1, 0x18 -/* 077D5C 7F04322C 0FC0FEDC */ jal sub_GAME_7F03FB70 +/* 077D5C 7F04322C 0FC0FEDC */ jal projectileFree /* 077D60 7F043230 02002025 */ move $a0, $s0 /* 077D64 7F043234 8E290064 */ lw $t1, 0x64($s1) /* 077D68 7F043238 2401FF7F */ li $at, -129 @@ -5338,7 +4287,7 @@ glabel sub_GAME_7F043650 /* 0782BC 7F04378C 8E050010 */ lw $a1, 0x10($s0) /* 0782C0 7F043790 01275021 */ addu $t2, $t1, $a3 /* 0782C4 7F043794 8D440098 */ lw $a0, 0x98($t2) -/* 0782C8 7F043798 0FC14E84 */ jal sub_GAME_7F053A10 +/* 0782C8 7F043798 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 0782CC 7F04379C 24A50008 */ addiu $a1, $a1, 8 /* 0782D0 7F0437A0 3C0C8005 */ lui $t4, %hi(g_GlobalTimer) /* 0782D4 7F0437A4 8D8C837C */ lw $t4, %lo(g_GlobalTimer)($t4) @@ -5474,7 +4423,7 @@ glabel sub_GAME_7F043650 /* 07623C 7F04384C 8E050010 */ lw $a1, 0x10($s0) /* 076240 7F043850 01275021 */ addu $t2, $t1, $a3 /* 076244 7F043854 8D440098 */ lw $a0, 0x98($t2) -/* 076248 7F043858 0FC14F3C */ jal sub_GAME_7F053A10 +/* 076248 7F043858 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 07624C 7F04385C 24A50008 */ addiu $a1, $a1, 8 /* 076250 7F043860 3C0C8004 */ lui $t4, %hi(g_GlobalTimer) # $t4, 0x8004 /* 076254 7F043864 8D8C0FFC */ lw $t4, %lo(g_GlobalTimer)($t4) @@ -5580,7 +4529,7 @@ void sub_GAME_7F043838(coord3d *arg0, Mtxf *arg1) sp24.y = sp120; sp24.z = sp11c; - matrix_4x4_rotate_vector_in_place(&spb0, sp24.f); + mtx4RotateVecInPlace(&spb0, sp24.f); spf0 = atan2f(sp24.x, sp24.y); @@ -5591,157 +4540,74 @@ void sub_GAME_7F043838(coord3d *arg0, Mtxf *arg1) } -#ifdef NONMATCHING -void sub_GAME_7F0439B8(void) { +void sub_GAME_7F0439B8(ObjectRecord* obj, coord3d* pos, StandTile* stan, coord3d* arg3) +{ + Mtxf matrix; + f32 temp_f0; + sub_GAME_7F043838(arg3, &matrix); + matrix_scalar_multiply(obj->model->scale, matrix.m[0]); + objChangeShading(obj, pos, &matrix, stan); + + temp_f0 = chrpropBBOXGetYmin(chrobjGetBboxFromObjFile(obj->model->obj)); + + obj->runtime_pos.f[0] -= temp_f0 * obj->mtx.m[1][0]; + obj->runtime_pos.f[1] -= temp_f0 * obj->mtx.m[1][1]; + obj->runtime_pos.f[2] -= temp_f0 * obj->mtx.m[1][2]; + + chrobjCollisionRelated(obj); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0439B8 -/* 0784E8 7F0439B8 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0784EC 7F0439BC AFB00018 */ sw $s0, 0x18($sp) -/* 0784F0 7F0439C0 00808025 */ move $s0, $a0 -/* 0784F4 7F0439C4 AFBF001C */ sw $ra, 0x1c($sp) -/* 0784F8 7F0439C8 AFA5006C */ sw $a1, 0x6c($sp) -/* 0784FC 7F0439CC AFA60070 */ sw $a2, 0x70($sp) -/* 078500 7F0439D0 27A50028 */ addiu $a1, $sp, 0x28 -/* 078504 7F0439D4 0FC10E0E */ jal sub_GAME_7F043838 -/* 078508 7F0439D8 00E02025 */ move $a0, $a3 -/* 07850C 7F0439DC 8E0E0014 */ lw $t6, 0x14($s0) -/* 078510 7F0439E0 27A50028 */ addiu $a1, $sp, 0x28 -/* 078514 7F0439E4 0FC1629F */ jal matrix_scalar_multiply -/* 078518 7F0439E8 C5CC0014 */ lwc1 $f12, 0x14($t6) -/* 07851C 7F0439EC 02002025 */ move $a0, $s0 -/* 078520 7F0439F0 8FA5006C */ lw $a1, 0x6c($sp) -/* 078524 7F0439F4 27A60028 */ addiu $a2, $sp, 0x28 -/* 078528 7F0439F8 0FC101D5 */ jal sub_GAME_7F040754 -/* 07852C 7F0439FC 8FA70070 */ lw $a3, 0x70($sp) -/* 078530 7F043A00 8E0F0014 */ lw $t7, 0x14($s0) -/* 078534 7F043A04 0FC0FFFE */ jal sub_GAME_7F03FFF8 -/* 078538 7F043A08 8DE40008 */ lw $a0, 8($t7) -/* 07853C 7F043A0C 0FC0FA19 */ jal chrpropBBOXGetYmin -/* 078540 7F043A10 00402025 */ move $a0, $v0 -/* 078544 7F043A14 C6060028 */ lwc1 $f6, 0x28($s0) -/* 078548 7F043A18 C6040058 */ lwc1 $f4, 0x58($s0) -/* 07854C 7F043A1C C612002C */ lwc1 $f18, 0x2c($s0) -/* 078550 7F043A20 46060202 */ mul.s $f8, $f0, $f6 -/* 078554 7F043A24 C610005C */ lwc1 $f16, 0x5c($s0) -/* 078558 7F043A28 02002025 */ move $a0, $s0 -/* 07855C 7F043A2C 46120182 */ mul.s $f6, $f0, $f18 -/* 078560 7F043A30 46082281 */ sub.s $f10, $f4, $f8 -/* 078564 7F043A34 C6080060 */ lwc1 $f8, 0x60($s0) -/* 078568 7F043A38 46068101 */ sub.s $f4, $f16, $f6 -/* 07856C 7F043A3C E60A0058 */ swc1 $f10, 0x58($s0) -/* 078570 7F043A40 C60A0030 */ lwc1 $f10, 0x30($s0) -/* 078574 7F043A44 E604005C */ swc1 $f4, 0x5c($s0) -/* 078578 7F043A48 460A0482 */ mul.s $f18, $f0, $f10 -/* 07857C 7F043A4C 46124401 */ sub.s $f16, $f8, $f18 -/* 078580 7F043A50 0FC10121 */ jal chrobjCollisionRelated -/* 078584 7F043A54 E6100060 */ swc1 $f16, 0x60($s0) -/* 078588 7F043A58 8FBF001C */ lw $ra, 0x1c($sp) -/* 07858C 7F043A5C 8FB00018 */ lw $s0, 0x18($sp) -/* 078590 7F043A60 27BD0068 */ addiu $sp, $sp, 0x68 -/* 078594 7F043A64 03E00008 */ jr $ra -/* 078598 7F043A68 00000000 */ nop -) -#endif +bool objEmbed(PropRecord *prop, PropRecord *parent, Model *model, ModelNode *node) +{ + if (parent->flags & PROPFLAG_ONSCREEN) + { + ObjectRecord *obj = prop->obj; + Mtxf mtx1; + Mtxf mtx2; + Mtxf mtx3; + Mtxf* nodemtx; + obj->embedment = embedmentAllocate(); -#ifdef NONMATCHING -void sub_GAME_7F043A6C(void) { + if (obj->embedment) + { + nodemtx = modelFindNodeMtx(model, node, 0); -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F043A6C -/* 07859C 7F043A6C 27BDFF10 */ addiu $sp, $sp, -0xf0 -/* 0785A0 7F043A70 AFBF001C */ sw $ra, 0x1c($sp) -/* 0785A4 7F043A74 AFB10018 */ sw $s1, 0x18($sp) -/* 0785A8 7F043A78 AFB00014 */ sw $s0, 0x14($sp) -/* 0785AC 7F043A7C AFA500F4 */ sw $a1, 0xf4($sp) -/* 0785B0 7F043A80 AFA600F8 */ sw $a2, 0xf8($sp) -/* 0785B4 7F043A84 AFA700FC */ sw $a3, 0xfc($sp) -/* 0785B8 7F043A88 90AF0001 */ lbu $t7, 1($a1) -/* 0785BC 7F043A8C 00808825 */ move $s1, $a0 -/* 0785C0 7F043A90 31F80002 */ andi $t8, $t7, 2 -/* 0785C4 7F043A94 53000034 */ beql $t8, $zero, .L7F043B68 -/* 0785C8 7F043A98 00001025 */ move $v0, $zero -/* 0785CC 7F043A9C 0FC0FFA6 */ jal monitorthingGetNew -/* 0785D0 7F043AA0 8C900004 */ lw $s0, 4($a0) -/* 0785D4 7F043AA4 1040002F */ beqz $v0, .L7F043B64 -/* 0785D8 7F043AA8 AE02006C */ sw $v0, 0x6c($s0) -/* 0785DC 7F043AAC 8FA400F8 */ lw $a0, 0xf8($sp) -/* 0785E0 7F043AB0 8FA500FC */ lw $a1, 0xfc($sp) -/* 0785E4 7F043AB4 0FC1B198 */ jal sub_GAME_7F06C660 -/* 0785E8 7F043AB8 00003025 */ move $a2, $zero -/* 0785EC 7F043ABC AFA20028 */ sw $v0, 0x28($sp) -/* 0785F0 7F043AC0 8E190064 */ lw $t9, 0x64($s0) -/* 0785F4 7F043AC4 02202025 */ move $a0, $s1 -/* 0785F8 7F043AC8 37280040 */ ori $t0, $t9, 0x40 -/* 0785FC 7F043ACC 0FC0F863 */ jal chrpropDeregisterRooms -/* 078600 7F043AD0 AE080064 */ sw $t0, 0x64($s0) -/* 078604 7F043AD4 0FC0E94E */ jal chrpropDelist -/* 078608 7F043AD8 02202025 */ move $a0, $s1 -/* 07860C 7F043ADC 0FC0E905 */ jal chrpropDisable -/* 078610 7F043AE0 02202025 */ move $a0, $s1 -/* 078614 7F043AE4 8FA900F8 */ lw $t1, 0xf8($sp) -/* 078618 7F043AE8 8E0A0014 */ lw $t2, 0x14($s0) -/* 07861C 7F043AEC 02202025 */ move $a0, $s1 -/* 078620 7F043AF0 AD490018 */ sw $t1, 0x18($t2) -/* 078624 7F043AF4 8E0C0014 */ lw $t4, 0x14($s0) -/* 078628 7F043AF8 8FAB00FC */ lw $t3, 0xfc($sp) -/* 07862C 7F043AFC AD8B001C */ sw $t3, 0x1c($t4) -/* 078630 7F043B00 0FC0E969 */ jal chrpropReparent -/* 078634 7F043B04 8FA500F4 */ lw $a1, 0xf4($sp) -/* 078638 7F043B08 27B100AC */ addiu $s1, $sp, 0xac -/* 07863C 7F043B0C 02202825 */ move $a1, $s1 -/* 078640 7F043B10 0FC16008 */ jal matrix_4x4_copy -/* 078644 7F043B14 26040018 */ addiu $a0, $s0, 0x18 -/* 078648 7F043B18 26040058 */ addiu $a0, $s0, 0x58 -/* 07864C 7F043B1C 0FC16266 */ jal matrix_4x4_set_position -/* 078650 7F043B20 02202825 */ move $a1, $s1 -/* 078654 7F043B24 0FC1E111 */ jal currentPlayerGetMatrix10D4 -/* 078658 7F043B28 00000000 */ nop -/* 07865C 7F043B2C 00402025 */ move $a0, $v0 -/* 078660 7F043B30 8FA50028 */ lw $a1, 0x28($sp) -/* 078664 7F043B34 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 078668 7F043B38 27A6006C */ addiu $a2, $sp, 0x6c -/* 07866C 7F043B3C 27A4006C */ addiu $a0, $sp, 0x6c -/* 078670 7F043B40 0FC167EE */ jal sub_GAME_7F059FB8 -/* 078674 7F043B44 27A5002C */ addiu $a1, $sp, 0x2c -/* 078678 7F043B48 8E06006C */ lw $a2, 0x6c($s0) -/* 07867C 7F043B4C 27A4002C */ addiu $a0, $sp, 0x2c -/* 078680 7F043B50 02202825 */ move $a1, $s1 -/* 078684 7F043B54 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 078688 7F043B58 24C60004 */ addiu $a2, $a2, 4 -/* 07868C 7F043B5C 10000002 */ b .L7F043B68 -/* 078690 7F043B60 24020001 */ li $v0, 1 -.L7F043B64: -/* 078694 7F043B64 00001025 */ move $v0, $zero -.L7F043B68: -/* 078698 7F043B68 8FBF001C */ lw $ra, 0x1c($sp) -/* 07869C 7F043B6C 8FB00014 */ lw $s0, 0x14($sp) -/* 0786A0 7F043B70 8FB10018 */ lw $s1, 0x18($sp) -/* 0786A4 7F043B74 03E00008 */ jr $ra -/* 0786A8 7F043B78 27BD00F0 */ addiu $sp, $sp, 0xf0 -) -#endif + obj->runtime_bitflags |= RUNTIMEBITFLAG_EMBEDDED; + + chrpropDeregisterRooms(prop); + chrpropDelist(prop); + chrpropDisable(prop); + + obj->model->attachedto = model; + obj->model->attachedto_objinst = node; + + chrpropReparent(prop, parent); + matrix_4x4_copy(&obj->mtx, &mtx1); + matrix_4x4_set_position(&obj->runtime_pos, &mtx1); + matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), nodemtx, &mtx2); + sub_GAME_7F059FB8((f32 (*)[4]) &mtx2.m, (f32 (*)[4]) &mtx3.m); + matrix_4x4_multiply_homogeneous((Mtxf* ) &mtx3.m, &mtx1, &obj->embedment->matrix); + return TRUE; + } + } + + return FALSE; +} /** * Named same as Perfect Dark. */ #if defined(VERSION_JP) || defined(VERSION_EU) -s32 propExplode(PropRecord *prop, s32 arg1) +s32 propExplode(PropRecord *prop, s32 /* enum EXPLOSION_DEF */ explosionType) #else -void propExplode(PropRecord *prop, s32 arg1) +void propExplode(PropRecord *prop, s32 /* enum EXPLOSION_DEF */ explosionType) #endif { ObjectRecord *prop_obj; // sp92 @@ -5776,7 +4642,7 @@ void propExplode(PropRecord *prop, s32 arg1) pos.y = mtx->m[3][1]; pos.z = mtx->m[3][2]; - matrix_4x4_transform_vector_in_place(currentPlayerGetMatrix10D4(), &pos); + mtx4TransformVecInPlace(currentPlayerGetMatrix10D4(), &pos); } else { @@ -5791,14 +4657,14 @@ void propExplode(PropRecord *prop, s32 arg1) #if defined(VERSION_JP) || defined(VERSION_EU) ret = #endif - explosionCreate(0, &pos, stan, (s16) arg1, (prop_obj->flags & 0xE) == 0, playernum, parent->rooms, 0); + explosionCreate(0, &pos, stan, (s16) explosionType, (prop_obj->flags & 0xE) == 0, playernum, parent->rooms, 0); } else { #if defined(VERSION_JP) || defined(VERSION_EU) ret = #endif - explosionCreate(0, &pos, stan, (s16) arg1, 0, playernum, parent->rooms, 1); + explosionCreate(0, &pos, stan, (s16) explosionType, 0, playernum, parent->rooms, 1); } } else @@ -5810,7 +4676,7 @@ void propExplode(PropRecord *prop, s32 arg1) 0, &prop_obj->runtime_pos, prop->stan, - (s16) arg1, + (s16) explosionType, (prop_obj->flags & 0xE) == 0 && (prop->flags & PROPFLAG_00000008) == 0, playernum, prop->rooms, @@ -5824,1456 +4690,371 @@ void propExplode(PropRecord *prop, s32 arg1) -#ifdef NONMATCHING -// still needs work -void handle_thrown_explosive_detonation(PropRecord* prop) { - PropRecord* player_prop; - WeaponObjRecord* weapon; +/** + * US address 7F043D70. + * JP address 7F044074. + * EU address 7F043E34. + * + * Seems to be a subset of Perfect Dark weaponTick. +*/ +void chrobjWeaponTick(struct PropRecord* prop) +{ + struct ObjectRecord* obj; + struct WeaponObjRecord *weapon; +#if defined(VERSION_US) + u32 owner_player_number; + u32 owner_player_as_bitflag; +#else + s32 exp_result; + u32 owner_player_number; + s32 p1; + u32 owner_player_as_bitflag; +#endif + struct PropRecord* player_prop; f32 diff_x; f32 diff_z; f32 diff_y; - s32 var_a1; - f32 dist_sqr; - - weapon = prop->weapon; - if (sub_GAME_7F09B4D8(get_cur_playernum()) != 0) { return; } + obj = prop->obj; - if (weapon->type == 7) { - if (((s32)weapon->flags * 8) < 0) { - propExplode(prop, 0xC); - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + if (sub_GAME_7F09B4D8(get_cur_playernum()) != 0) + { + return; + } + + if (obj->type == PROP_TYPE_EXPLOSION) // 7 + { + if (obj->flags & PROPFLAG_IS_DRONE_GUN) + { + propExplode(prop, EXPLOSION_DEF_DRONE); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; } + return; } - if (weapon->type == 8) { - if (((weapon->weaponnum == 0x1A) || (weapon->weaponnum == 0x57)) && (weapon->timer >= 0)) { - weapon->timer = (s16) (weapon->timer - g_ClockTimer); - if (weapon->timer < 0) { - var_a1 = (weapon->flags2 & 0x80000000) ? 0x11 : 0xD; - propExplode(prop, var_a1); - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + if (obj->type == PROP_TYPE_SMOKE) // 8 + { + weapon = prop->weapon; + + if (((weapon->weaponnum == ITEM_GRENADE) || (weapon->weaponnum == ITEM_NULL87)) && (weapon->timer >= 0)) + { + weapon->timer -= g_ClockTimer; + + if (weapon->timer < 0) + { + propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; } - } else if (weapon->weaponnum == 0x56) { - if (weapon->timer == 0) { - var_a1 = (weapon->flags2 & 0x80000000) ? 0x11 : 0xD; - - propExplode(prop, var_a1); - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + } + else if (weapon->weaponnum == ITEM_NULL86) + { + if (weapon->timer == 0) + { + propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; } - } else if (weapon->weaponnum == 0x22) { - if (weapon->timer == 0) { - propExplode(prop, 0x11); - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); - SurroundWithExplosions(0x78); - countdownTimerSetVisible(2, 0); + } + else if (weapon->weaponnum == ITEM_PLASTIQUE) + { + if (weapon->timer == 0) + { + propExplode(prop, EXPLOSION_DEF_MASSIVE); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; + SurroundWithExplosions(PLASTIQUE_EXPLOSION_DELAY_TICKS); + countdownTimerSetVisible(2, FALSE); } - } else if (((weapon->weaponnum == 0x1B) || (weapon->weaponnum == 0x21)) && (weapon->timer >= 0)) { - weapon->timer = (s16) (weapon->timer - g_ClockTimer); - if (weapon->timer < 0) { - var_a1 = (weapon->flags2 & 0x80000000) ? 0x11 : 0xD; - propExplode(prop, var_a1); + } + else if (((weapon->weaponnum == ITEM_TIMEDMINE) || (weapon->weaponnum == ITEM_BOMBCASE)) && (weapon->timer >= 0)) + { + weapon->timer -= g_ClockTimer; + + if (weapon->timer < 0) + { +#if defined(VERSION_US) + propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); +#else + exp_result = propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); + if (exp_result == 0) + { + return; + } +#endif weapon->timer = -1; - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; + } - } else if (weapon->weaponnum == 0x1D) { - if ((D_80030AF4 != 0) && (D_80030AF4 & (1 << ((u32) (weapon->runtime_bitflags & 0x60000) >> 0x11)))) { - weapon->timer = 0; + } + else if (weapon->weaponnum == ITEM_REMOTEMINE) + { + if (g_RemoteMineOwnerTriggerFlag) + { + owner_player_number = (obj->runtime_bitflags & RUNTIMEBITFLAG_OWNER) >> RUNTIMEBITSHIFT_OWNER; + owner_player_as_bitflag = (1 << owner_player_number); + if (g_RemoteMineOwnerTriggerFlag & owner_player_as_bitflag) + { + weapon->timer = 0; + } } - if (weapon->timer >= 2) { - weapon->timer = (s16) (weapon->timer - g_ClockTimer); - if (weapon->timer < 2) { + + if (weapon->timer > 1) + { + weapon->timer -= g_ClockTimer; + + if (weapon->timer < 2) + { weapon->timer = 1; } - } else if (weapon->timer == 0) { - if (weapon->flags2 & 0x80000000) { - propExplode(prop, 0x11); - } else if (bossGetStageNum(prop, 0x11, weapon, weapon) == LEVELID_FACILITY) { - propExplode(prop, 0x13); - } else { - propExplode(prop, 0xD); + } + else if (weapon->timer == 0) + { +#if defined(VERSION_US) + if (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) + { + propExplode(prop, EXPLOSION_DEF_MASSIVE); + } + else if (bossGetStageNum() == LEVELID_FACILITY) + { + propExplode(prop, EXPLOSION_DEF_FACILITY_REMOTE); + } + else + { + propExplode(prop, EXPLOSION_DEF_STANDARD); + } +#else + if (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) + { + p1 = EXPLOSION_DEF_MASSIVE; + } + else + { + p1 = EXPLOSION_DEF_STANDARD; + + if (bossGetStageNum() == LEVELID_FACILITY) + { + p1 = EXPLOSION_DEF_FACILITY_REMOTE; + } + } + + exp_result = propExplode(prop, p1); + if (exp_result == 0) + { + return; } +#endif weapon->timer = -1; - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; } - } else if (weapon->weaponnum == 0x1C) { - if (weapon->timer >= 2) { - weapon->timer = (s16) (weapon->timer - g_ClockTimer); - if (weapon->timer < 2) { + + } + else if (weapon->weaponnum == ITEM_PROXIMITYMINE) + { + if (weapon->timer > 1) + { + weapon->timer -= g_ClockTimer; + + if (weapon->timer < 2) + { weapon->timer = 1; add_obj_to_temp_proxmine_table(weapon); } - } else if (weapon->timer == 1) { + } + else if (weapon->timer == 1) + { player_prop = get_curplayer_positiondata(); + diff_x = player_prop->pos.f[0] - prop->pos.f[0]; diff_y = player_prop->pos.f[1] - prop->pos.f[1]; diff_z = player_prop->pos.f[2] - prop->pos.f[2]; - dist_sqr = (diff_x * diff_x) + (diff_y * diff_y) + (diff_z * diff_z); - if (dist_sqr < 62500.0f) { + + if ((diff_x * diff_x) + (diff_y * diff_y) + (diff_z * diff_z) < PROXIMITY_MINE_TRIGGER_DISTANCE) + { weapon->timer = 0; } } - if (weapon->timer == 0) { - var_a1 = (weapon->flags2 & 0x80000000) ? 0x11 : 0xD; - propExplode(prop, var_a1); + + if (weapon->timer == 0) + { +#if defined(VERSION_US) + propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); +#else + exp_result = propExplode(prop, (obj->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM) ? EXPLOSION_DEF_MASSIVE : EXPLOSION_DEF_STANDARD); + if (exp_result == 0) + { + return; + } +#endif + weapon->timer = -1; - weapon->runtime_bitflags = (s32) (weapon->runtime_bitflags | 4); + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; remove_obj_from_temp_proxmine_table(weapon); } } } } -#else -#ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_80052A94 -.word 0x47742400 /*62500.0*/ -.text -glabel handle_thrown_explosive_detonation -/* 0788A0 7F043D70 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0788A4 7F043D74 AFBF0014 */ sw $ra, 0x14($sp) -/* 0788A8 7F043D78 AFA40020 */ sw $a0, 0x20($sp) -/* 0788AC 7F043D7C 8C870004 */ lw $a3, 4($a0) -/* 0788B0 7F043D80 0FC26C54 */ jal get_cur_playernum -/* 0788B4 7F043D84 AFA7001C */ sw $a3, 0x1c($sp) -/* 0788B8 7F043D88 0FC26D36 */ jal sub_GAME_7F09B4D8 -/* 0788BC 7F043D8C 00402025 */ move $a0, $v0 -/* 0788C0 7F043D90 14400117 */ bnez $v0, .L7F0441F0 -/* 0788C4 7F043D94 8FA7001C */ lw $a3, 0x1c($sp) -/* 0788C8 7F043D98 90E20003 */ lbu $v0, 3($a3) -/* 0788CC 7F043D9C 24010007 */ li $at, 7 -/* 0788D0 7F043DA0 5441000F */ bnel $v0, $at, .L7F043DE0 -/* 0788D4 7F043DA4 24010008 */ li $at, 8 -/* 0788D8 7F043DA8 8CEF0008 */ lw $t7, 8($a3) -/* 0788DC 7F043DAC 8FA40020 */ lw $a0, 0x20($sp) -/* 0788E0 7F043DB0 2405000C */ li $a1, 12 -/* 0788E4 7F043DB4 000FC0C0 */ sll $t8, $t7, 3 -/* 0788E8 7F043DB8 0703010E */ bgezl $t8, .L7F0441F4 -/* 0788EC 7F043DBC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0788F0 7F043DC0 0FC10EDF */ jal propExplode -/* 0788F4 7F043DC4 AFA7001C */ sw $a3, 0x1c($sp) -/* 0788F8 7F043DC8 8FA7001C */ lw $a3, 0x1c($sp) -/* 0788FC 7F043DCC 8CF90064 */ lw $t9, 0x64($a3) -/* 078900 7F043DD0 37280004 */ ori $t0, $t9, 4 -/* 078904 7F043DD4 10000106 */ b .L7F0441F0 -/* 078908 7F043DD8 ACE80064 */ sw $t0, 0x64($a3) -/* 07890C 7F043DDC 24010008 */ li $at, 8 -.L7F043DE0: -/* 078910 7F043DE0 14410103 */ bne $v0, $at, .L7F0441F0 -/* 078914 7F043DE4 8FA90020 */ lw $t1, 0x20($sp) -/* 078918 7F043DE8 8D260004 */ lw $a2, 4($t1) -/* 07891C 7F043DEC 2401001A */ li $at, 26 -/* 078920 7F043DF0 80C30080 */ lb $v1, 0x80($a2) -/* 078924 7F043DF4 10610003 */ beq $v1, $at, .L7F043E04 -/* 078928 7F043DF8 24010057 */ li $at, 87 -/* 07892C 7F043DFC 5461001B */ bnel $v1, $at, .L7F043E6C -/* 078930 7F043E00 24010056 */ li $at, 86 -.L7F043E04: -/* 078934 7F043E04 84C20082 */ lh $v0, 0x82($a2) -/* 078938 7F043E08 3C0A8005 */ lui $t2, %hi(g_ClockTimer) -/* 07893C 7F043E0C 04420017 */ bltzl $v0, .L7F043E6C -/* 078940 7F043E10 24010056 */ li $at, 86 -/* 078944 7F043E14 8D4A8374 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 078948 7F043E18 004A5823 */ subu $t3, $v0, $t2 -/* 07894C 7F043E1C A4CB0082 */ sh $t3, 0x82($a2) -/* 078950 7F043E20 84CC0082 */ lh $t4, 0x82($a2) -/* 078954 7F043E24 8FA40020 */ lw $a0, 0x20($sp) -/* 078958 7F043E28 058300F2 */ bgezl $t4, .L7F0441F4 -/* 07895C 7F043E2C 8FBF0014 */ lw $ra, 0x14($sp) -/* 078960 7F043E30 8CED000C */ lw $t5, 0xc($a3) -/* 078964 7F043E34 2405000D */ li $a1, 13 -/* 078968 7F043E38 000D7000 */ sll $t6, $t5, 0 -/* 07896C 7F043E3C 05C10003 */ bgez $t6, .L7F043E4C -/* 078970 7F043E40 00000000 */ nop -/* 078974 7F043E44 10000001 */ b .L7F043E4C -/* 078978 7F043E48 24050011 */ li $a1, 17 -.L7F043E4C: -/* 07897C 7F043E4C 0FC10EDF */ jal propExplode -/* 078980 7F043E50 AFA7001C */ sw $a3, 0x1c($sp) -/* 078984 7F043E54 8FA7001C */ lw $a3, 0x1c($sp) -/* 078988 7F043E58 8CEF0064 */ lw $t7, 0x64($a3) -/* 07898C 7F043E5C 35F80004 */ ori $t8, $t7, 4 -/* 078990 7F043E60 100000E3 */ b .L7F0441F0 -/* 078994 7F043E64 ACF80064 */ sw $t8, 0x64($a3) -/* 078998 7F043E68 24010056 */ li $at, 86 -.L7F043E6C: -/* 07899C 7F043E6C 54610014 */ bnel $v1, $at, .L7F043EC0 -/* 0789A0 7F043E70 24010022 */ li $at, 34 -/* 0789A4 7F043E74 84D90082 */ lh $t9, 0x82($a2) -/* 0789A8 7F043E78 8FA40020 */ lw $a0, 0x20($sp) -/* 0789AC 7F043E7C 572000DD */ bnezl $t9, .L7F0441F4 -/* 0789B0 7F043E80 8FBF0014 */ lw $ra, 0x14($sp) -/* 0789B4 7F043E84 8CE8000C */ lw $t0, 0xc($a3) -/* 0789B8 7F043E88 2405000D */ li $a1, 13 -/* 0789BC 7F043E8C 00084800 */ sll $t1, $t0, 0 -/* 0789C0 7F043E90 05210003 */ bgez $t1, .L7F043EA0 -/* 0789C4 7F043E94 00000000 */ nop -/* 0789C8 7F043E98 10000001 */ b .L7F043EA0 -/* 0789CC 7F043E9C 24050011 */ li $a1, 17 -.L7F043EA0: -/* 0789D0 7F043EA0 0FC10EDF */ jal propExplode -/* 0789D4 7F043EA4 AFA7001C */ sw $a3, 0x1c($sp) -/* 0789D8 7F043EA8 8FA7001C */ lw $a3, 0x1c($sp) -/* 0789DC 7F043EAC 8CEA0064 */ lw $t2, 0x64($a3) -/* 0789E0 7F043EB0 354B0004 */ ori $t3, $t2, 4 -/* 0789E4 7F043EB4 100000CE */ b .L7F0441F0 -/* 0789E8 7F043EB8 ACEB0064 */ sw $t3, 0x64($a3) -/* 0789EC 7F043EBC 24010022 */ li $at, 34 -.L7F043EC0: -/* 0789F0 7F043EC0 54610014 */ bnel $v1, $at, .L7F043F14 -/* 0789F4 7F043EC4 2401001B */ li $at, 27 -/* 0789F8 7F043EC8 84CC0082 */ lh $t4, 0x82($a2) -/* 0789FC 7F043ECC 8FA40020 */ lw $a0, 0x20($sp) -/* 078A00 7F043ED0 24050011 */ li $a1, 17 -/* 078A04 7F043ED4 558000C7 */ bnezl $t4, .L7F0441F4 -/* 078A08 7F043ED8 8FBF0014 */ lw $ra, 0x14($sp) -/* 078A0C 7F043EDC 0FC10EDF */ jal propExplode -/* 078A10 7F043EE0 AFA7001C */ sw $a3, 0x1c($sp) -/* 078A14 7F043EE4 8FA7001C */ lw $a3, 0x1c($sp) -/* 078A18 7F043EE8 24040078 */ li $a0, 120 -/* 078A1C 7F043EEC 8CED0064 */ lw $t5, 0x64($a3) -/* 078A20 7F043EF0 35AE0004 */ ori $t6, $t5, 4 -/* 078A24 7F043EF4 0FC22FF1 */ jal SurroundWithExplosions -/* 078A28 7F043EF8 ACEE0064 */ sw $t6, 0x64($a3) -/* 078A2C 7F043EFC 24040002 */ li $a0, 2 -/* 078A30 7F043F00 0FC15858 */ jal countdownTimerSetVisible -/* 078A34 7F043F04 00002825 */ move $a1, $zero -/* 078A38 7F043F08 100000BA */ b .L7F0441F4 -/* 078A3C 7F043F0C 8FBF0014 */ lw $ra, 0x14($sp) -/* 078A40 7F043F10 2401001B */ li $at, 27 -.L7F043F14: -/* 078A44 7F043F14 10610003 */ beq $v1, $at, .L7F043F24 -/* 078A48 7F043F18 24010021 */ li $at, 33 -/* 078A4C 7F043F1C 5461001F */ bnel $v1, $at, .L7F043F9C -/* 078A50 7F043F20 2401001D */ li $at, 29 -.L7F043F24: -/* 078A54 7F043F24 84C20082 */ lh $v0, 0x82($a2) -/* 078A58 7F043F28 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 078A5C 7F043F2C 0442001B */ bltzl $v0, .L7F043F9C -/* 078A60 7F043F30 2401001D */ li $at, 29 -/* 078A64 7F043F34 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 078A68 7F043F38 004FC023 */ subu $t8, $v0, $t7 -/* 078A6C 7F043F3C A4D80082 */ sh $t8, 0x82($a2) -/* 078A70 7F043F40 84D90082 */ lh $t9, 0x82($a2) -/* 078A74 7F043F44 8FA40020 */ lw $a0, 0x20($sp) -/* 078A78 7F043F48 072300AA */ bgezl $t9, .L7F0441F4 -/* 078A7C 7F043F4C 8FBF0014 */ lw $ra, 0x14($sp) -/* 078A80 7F043F50 8CE8000C */ lw $t0, 0xc($a3) -/* 078A84 7F043F54 2405000D */ li $a1, 13 -/* 078A88 7F043F58 00084800 */ sll $t1, $t0, 0 -/* 078A8C 7F043F5C 05210003 */ bgez $t1, .L7F043F6C -/* 078A90 7F043F60 00000000 */ nop -/* 078A94 7F043F64 10000001 */ b .L7F043F6C -/* 078A98 7F043F68 24050011 */ li $a1, 17 -.L7F043F6C: -/* 078A9C 7F043F6C AFA60018 */ sw $a2, 0x18($sp) -/* 078AA0 7F043F70 0FC10EDF */ jal propExplode -/* 078AA4 7F043F74 AFA7001C */ sw $a3, 0x1c($sp) -/* 078AA8 7F043F78 8FA60018 */ lw $a2, 0x18($sp) -/* 078AAC 7F043F7C 8FA7001C */ lw $a3, 0x1c($sp) -/* 078AB0 7F043F80 240AFFFF */ li $t2, -1 -/* 078AB4 7F043F84 A4CA0082 */ sh $t2, 0x82($a2) -/* 078AB8 7F043F88 8CEB0064 */ lw $t3, 0x64($a3) -/* 078ABC 7F043F8C 356C0004 */ ori $t4, $t3, 4 -/* 078AC0 7F043F90 10000097 */ b .L7F0441F0 -/* 078AC4 7F043F94 ACEC0064 */ sw $t4, 0x64($a3) -/* 078AC8 7F043F98 2401001D */ li $at, 29 -.L7F043F9C: -/* 078ACC 7F043F9C 54610049 */ bnel $v1, $at, .L7F0440C4 -/* 078AD0 7F043FA0 2401001C */ li $at, 28 -/* 078AD4 7F043FA4 3C038003 */ lui $v1, %hi(D_80030AF4) -/* 078AD8 7F043FA8 8C630AF4 */ lw $v1, %lo(D_80030AF4)($v1) -/* 078ADC 7F043FAC 3C088005 */ lui $t0, %hi(g_ClockTimer) -/* 078AE0 7F043FB0 5060000C */ beql $v1, $zero, .L7F043FE4 -/* 078AE4 7F043FB4 84C20082 */ lh $v0, 0x82($a2) -/* 078AE8 7F043FB8 8CE20064 */ lw $v0, 0x64($a3) -/* 078AEC 7F043FBC 3C010006 */ lui $at, 6 -/* 078AF0 7F043FC0 240F0001 */ li $t7, 1 -/* 078AF4 7F043FC4 00416824 */ and $t5, $v0, $at -/* 078AF8 7F043FC8 000D7442 */ srl $t6, $t5, 0x11 -/* 078AFC 7F043FCC 01CFC004 */ sllv $t8, $t7, $t6 -/* 078B00 7F043FD0 0078C824 */ and $t9, $v1, $t8 -/* 078B04 7F043FD4 53200003 */ beql $t9, $zero, .L7F043FE4 -/* 078B08 7F043FD8 84C20082 */ lh $v0, 0x82($a2) -/* 078B0C 7F043FDC A4C00082 */ sh $zero, 0x82($a2) -/* 078B10 7F043FE0 84C20082 */ lh $v0, 0x82($a2) -.L7F043FE4: -/* 078B14 7F043FE4 28410002 */ slti $at, $v0, 2 -/* 078B18 7F043FE8 1420000B */ bnez $at, .L7F044018 -/* 078B1C 7F043FEC 00000000 */ nop -/* 078B20 7F043FF0 8D088374 */ lw $t0, %lo(g_ClockTimer)($t0) -/* 078B24 7F043FF4 240B0001 */ li $t3, 1 -/* 078B28 7F043FF8 00484823 */ subu $t1, $v0, $t0 -/* 078B2C 7F043FFC A4C90082 */ sh $t1, 0x82($a2) -/* 078B30 7F044000 84CA0082 */ lh $t2, 0x82($a2) -/* 078B34 7F044004 29410002 */ slti $at, $t2, 2 -/* 078B38 7F044008 5020007A */ beql $at, $zero, .L7F0441F4 -/* 078B3C 7F04400C 8FBF0014 */ lw $ra, 0x14($sp) -/* 078B40 7F044010 10000077 */ b .L7F0441F0 -/* 078B44 7F044014 A4CB0082 */ sh $t3, 0x82($a2) -.L7F044018: -/* 078B48 7F044018 54400076 */ bnezl $v0, .L7F0441F4 -/* 078B4C 7F04401C 8FBF0014 */ lw $ra, 0x14($sp) -/* 078B50 7F044020 8CEC000C */ lw $t4, 0xc($a3) -/* 078B54 7F044024 8FA40020 */ lw $a0, 0x20($sp) -/* 078B58 7F044028 24050011 */ li $a1, 17 -/* 078B5C 7F04402C 000C6800 */ sll $t5, $t4, 0 -/* 078B60 7F044030 05A30008 */ bgezl $t5, .L7F044054 -/* 078B64 7F044034 AFA60018 */ sw $a2, 0x18($sp) -/* 078B68 7F044038 AFA60018 */ sw $a2, 0x18($sp) -/* 078B6C 7F04403C 0FC10EDF */ jal propExplode -/* 078B70 7F044040 AFA7001C */ sw $a3, 0x1c($sp) -/* 078B74 7F044044 8FA60018 */ lw $a2, 0x18($sp) -/* 078B78 7F044048 10000017 */ b .L7F0440A8 -/* 078B7C 7F04404C 8FA7001C */ lw $a3, 0x1c($sp) -/* 078B80 7F044050 AFA60018 */ sw $a2, 0x18($sp) -.L7F044054: -/* 078B84 7F044054 0C001A57 */ jal bossGetStageNum -/* 078B88 7F044058 AFA7001C */ sw $a3, 0x1c($sp) -/* 078B8C 7F04405C 24010022 */ li $at, 34 -/* 078B90 7F044060 8FA60018 */ lw $a2, 0x18($sp) -/* 078B94 7F044064 14410009 */ bne $v0, $at, .L7F04408C -/* 078B98 7F044068 8FA7001C */ lw $a3, 0x1c($sp) -/* 078B9C 7F04406C 8FA40020 */ lw $a0, 0x20($sp) -/* 078BA0 7F044070 24050013 */ li $a1, 19 -/* 078BA4 7F044074 AFA60018 */ sw $a2, 0x18($sp) -/* 078BA8 7F044078 0FC10EDF */ jal propExplode -/* 078BAC 7F04407C AFA7001C */ sw $a3, 0x1c($sp) -/* 078BB0 7F044080 8FA60018 */ lw $a2, 0x18($sp) -/* 078BB4 7F044084 10000008 */ b .L7F0440A8 -/* 078BB8 7F044088 8FA7001C */ lw $a3, 0x1c($sp) -.L7F04408C: -/* 078BBC 7F04408C 8FA40020 */ lw $a0, 0x20($sp) -/* 078BC0 7F044090 2405000D */ li $a1, 13 -/* 078BC4 7F044094 AFA60018 */ sw $a2, 0x18($sp) -/* 078BC8 7F044098 0FC10EDF */ jal propExplode -/* 078BCC 7F04409C AFA7001C */ sw $a3, 0x1c($sp) -/* 078BD0 7F0440A0 8FA60018 */ lw $a2, 0x18($sp) -/* 078BD4 7F0440A4 8FA7001C */ lw $a3, 0x1c($sp) -.L7F0440A8: -/* 078BD8 7F0440A8 240EFFFF */ li $t6, -1 -/* 078BDC 7F0440AC A4CE0082 */ sh $t6, 0x82($a2) -/* 078BE0 7F0440B0 8CEF0064 */ lw $t7, 0x64($a3) -/* 078BE4 7F0440B4 35F80004 */ ori $t8, $t7, 4 -/* 078BE8 7F0440B8 1000004D */ b .L7F0441F0 -/* 078BEC 7F0440BC ACF80064 */ sw $t8, 0x64($a3) -/* 078BF0 7F0440C0 2401001C */ li $at, 28 -.L7F0440C4: -/* 078BF4 7F0440C4 5461004B */ bnel $v1, $at, .L7F0441F4 -/* 078BF8 7F0440C8 8FBF0014 */ lw $ra, 0x14($sp) -/* 078BFC 7F0440CC 84C20082 */ lh $v0, 0x82($a2) -/* 078C00 7F0440D0 3C198005 */ lui $t9, %hi(g_ClockTimer) -/* 078C04 7F0440D4 28410002 */ slti $at, $v0, 2 -/* 078C08 7F0440D8 54200012 */ bnezl $at, .L7F044124 -/* 078C0C 7F0440DC 24010001 */ li $at, 1 -/* 078C10 7F0440E0 8F398374 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 078C14 7F0440E4 240A0001 */ li $t2, 1 -/* 078C18 7F0440E8 00C02025 */ move $a0, $a2 -/* 078C1C 7F0440EC 00594023 */ subu $t0, $v0, $t9 -/* 078C20 7F0440F0 A4C80082 */ sh $t0, 0x82($a2) -/* 078C24 7F0440F4 84C90082 */ lh $t1, 0x82($a2) -/* 078C28 7F0440F8 29210002 */ slti $at, $t1, 2 -/* 078C2C 7F0440FC 50200027 */ beql $at, $zero, .L7F04419C -/* 078C30 7F044100 84CC0082 */ lh $t4, 0x82($a2) -/* 078C34 7F044104 A4CA0082 */ sh $t2, 0x82($a2) -/* 078C38 7F044108 AFA7001C */ sw $a3, 0x1c($sp) -/* 078C3C 7F04410C 0FC146D7 */ jal add_obj_to_temp_proxmine_table -/* 078C40 7F044110 AFA60018 */ sw $a2, 0x18($sp) -/* 078C44 7F044114 8FA60018 */ lw $a2, 0x18($sp) -/* 078C48 7F044118 1000001F */ b .L7F044198 -/* 078C4C 7F04411C 8FA7001C */ lw $a3, 0x1c($sp) -/* 078C50 7F044120 24010001 */ li $at, 1 -.L7F044124: -/* 078C54 7F044124 5441001D */ bnel $v0, $at, .L7F04419C -/* 078C58 7F044128 84CC0082 */ lh $t4, 0x82($a2) -/* 078C5C 7F04412C AFA60018 */ sw $a2, 0x18($sp) -/* 078C60 7F044130 0FC225E6 */ jal get_curplayer_positiondata -/* 078C64 7F044134 AFA7001C */ sw $a3, 0x1c($sp) -/* 078C68 7F044138 8FAB0020 */ lw $t3, 0x20($sp) -/* 078C6C 7F04413C C4440008 */ lwc1 $f4, 8($v0) -/* 078C70 7F044140 C448000C */ lwc1 $f8, 0xc($v0) -/* 078C74 7F044144 C5660008 */ lwc1 $f6, 8($t3) -/* 078C78 7F044148 C56A000C */ lwc1 $f10, 0xc($t3) -/* 078C7C 7F04414C C4500010 */ lwc1 $f16, 0x10($v0) -/* 078C80 7F044150 46062001 */ sub.s $f0, $f4, $f6 -/* 078C84 7F044154 C5720010 */ lwc1 $f18, 0x10($t3) -/* 078C88 7F044158 3C018005 */ lui $at, %hi(D_80052A94) -/* 078C8C 7F04415C 460A4081 */ sub.s $f2, $f8, $f10 -/* 078C90 7F044160 46000102 */ mul.s $f4, $f0, $f0 -/* 078C94 7F044164 8FA60018 */ lw $a2, 0x18($sp) -/* 078C98 7F044168 46128301 */ sub.s $f12, $f16, $f18 -/* 078C9C 7F04416C 46021182 */ mul.s $f6, $f2, $f2 -/* 078CA0 7F044170 C4322A94 */ lwc1 $f18, %lo(D_80052A94)($at) -/* 078CA4 7F044174 8FA7001C */ lw $a3, 0x1c($sp) -/* 078CA8 7F044178 460C6282 */ mul.s $f10, $f12, $f12 -/* 078CAC 7F04417C 46062200 */ add.s $f8, $f4, $f6 -/* 078CB0 7F044180 460A4400 */ add.s $f16, $f8, $f10 -/* 078CB4 7F044184 4612803C */ c.lt.s $f16, $f18 -/* 078CB8 7F044188 00000000 */ nop -/* 078CBC 7F04418C 45020003 */ bc1fl .L7F04419C -/* 078CC0 7F044190 84CC0082 */ lh $t4, 0x82($a2) -/* 078CC4 7F044194 A4C00082 */ sh $zero, 0x82($a2) -.L7F044198: -/* 078CC8 7F044198 84CC0082 */ lh $t4, 0x82($a2) -.L7F04419C: -/* 078CCC 7F04419C 8FA40020 */ lw $a0, 0x20($sp) -/* 078CD0 7F0441A0 55800014 */ bnezl $t4, .L7F0441F4 -/* 078CD4 7F0441A4 8FBF0014 */ lw $ra, 0x14($sp) -/* 078CD8 7F0441A8 8CED000C */ lw $t5, 0xc($a3) -/* 078CDC 7F0441AC 2405000D */ li $a1, 13 -/* 078CE0 7F0441B0 000D7000 */ sll $t6, $t5, 0 -/* 078CE4 7F0441B4 05C10003 */ bgez $t6, .L7F0441C4 -/* 078CE8 7F0441B8 00000000 */ nop -/* 078CEC 7F0441BC 10000001 */ b .L7F0441C4 -/* 078CF0 7F0441C0 24050011 */ li $a1, 17 -.L7F0441C4: -/* 078CF4 7F0441C4 AFA60018 */ sw $a2, 0x18($sp) -/* 078CF8 7F0441C8 0FC10EDF */ jal propExplode -/* 078CFC 7F0441CC AFA7001C */ sw $a3, 0x1c($sp) -/* 078D00 7F0441D0 8FA40018 */ lw $a0, 0x18($sp) -/* 078D04 7F0441D4 8FA7001C */ lw $a3, 0x1c($sp) -/* 078D08 7F0441D8 240FFFFF */ li $t7, -1 -/* 078D0C 7F0441DC A48F0082 */ sh $t7, 0x82($a0) -/* 078D10 7F0441E0 8CF80064 */ lw $t8, 0x64($a3) -/* 078D14 7F0441E4 37190004 */ ori $t9, $t8, 4 -/* 078D18 7F0441E8 0FC146E5 */ jal remove_obj_from_temp_proxmine_table -/* 078D1C 7F0441EC ACF90064 */ sw $t9, 0x64($a3) -.L7F0441F0: -/* 078D20 7F0441F0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0441F4: -/* 078D24 7F0441F4 27BD0020 */ addiu $sp, $sp, 0x20 -/* 078D28 7F0441F8 03E00008 */ jr $ra -/* 078D2C 7F0441FC 00000000 */ nop -) -#endif -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata -glabel D_80052A94 -.word 0x47742400 /*62500.0*/ -.text -glabel handle_thrown_explosive_detonation -/* 078BE4 7F044074 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 078BE8 7F044078 AFBF0014 */ sw $ra, 0x14($sp) -/* 078BEC 7F04407C AFA40030 */ sw $a0, 0x30($sp) -/* 078BF0 7F044080 8C870004 */ lw $a3, 4($a0) -/* 078BF4 7F044084 0FC26F3C */ jal get_cur_playernum -/* 078BF8 7F044088 AFA7002C */ sw $a3, 0x2c($sp) -/* 078BFC 7F04408C 0FC2701E */ jal sub_GAME_7F09B4D8 -/* 078C00 7F044090 00402025 */ move $a0, $v0 -/* 078C04 7F044094 14400110 */ bnez $v0, .L7F0444D8 -/* 078C08 7F044098 8FA7002C */ lw $a3, 0x2c($sp) -/* 078C0C 7F04409C 90E20003 */ lbu $v0, 3($a3) -/* 078C10 7F0440A0 24010007 */ li $at, 7 -/* 078C14 7F0440A4 5441000F */ bnel $v0, $at, .L7F0440E4 -/* 078C18 7F0440A8 24010008 */ li $at, 8 -/* 078C1C 7F0440AC 8CEF0008 */ lw $t7, 8($a3) -/* 078C20 7F0440B0 8FA40030 */ lw $a0, 0x30($sp) -/* 078C24 7F0440B4 2405000C */ li $a1, 12 -/* 078C28 7F0440B8 000FC0C0 */ sll $t8, $t7, 3 -/* 078C2C 7F0440BC 07030107 */ bgezl $t8, .L7F0444DC -/* 078C30 7F0440C0 8FBF0014 */ lw $ra, 0x14($sp) -/* 078C34 7F0440C4 0FC10F9F */ jal propExplode -/* 078C38 7F0440C8 AFA7002C */ sw $a3, 0x2c($sp) -/* 078C3C 7F0440CC 8FA7002C */ lw $a3, 0x2c($sp) -/* 078C40 7F0440D0 8CF90064 */ lw $t9, 0x64($a3) -/* 078C44 7F0440D4 37280004 */ ori $t0, $t9, 4 -/* 078C48 7F0440D8 100000FF */ b .L7F0444D8 -/* 078C4C 7F0440DC ACE80064 */ sw $t0, 0x64($a3) -/* 078C50 7F0440E0 24010008 */ li $at, 8 -.L7F0440E4: -/* 078C54 7F0440E4 144100FC */ bne $v0, $at, .L7F0444D8 -/* 078C58 7F0440E8 8FA90030 */ lw $t1, 0x30($sp) -/* 078C5C 7F0440EC 8D260004 */ lw $a2, 4($t1) -/* 078C60 7F0440F0 2401001A */ li $at, 26 -/* 078C64 7F0440F4 80C30080 */ lb $v1, 0x80($a2) -/* 078C68 7F0440F8 10610003 */ beq $v1, $at, .L7F044108 -/* 078C6C 7F0440FC 24010057 */ li $at, 87 -/* 078C70 7F044100 5461001B */ bnel $v1, $at, .L7F044170 -/* 078C74 7F044104 24010056 */ li $at, 86 -.L7F044108: -/* 078C78 7F044108 84C20082 */ lh $v0, 0x82($a2) -/* 078C7C 7F04410C 3C0A8005 */ lui $t2, %hi(g_ClockTimer) # $t2, 0x8005 -/* 078C80 7F044110 04420017 */ bltzl $v0, .L7F044170 -/* 078C84 7F044114 24010056 */ li $at, 86 -/* 078C88 7F044118 8D4A83A4 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 078C8C 7F04411C 004A5823 */ subu $t3, $v0, $t2 -/* 078C90 7F044120 A4CB0082 */ sh $t3, 0x82($a2) -/* 078C94 7F044124 84CC0082 */ lh $t4, 0x82($a2) -/* 078C98 7F044128 8FA40030 */ lw $a0, 0x30($sp) -/* 078C9C 7F04412C 058300EB */ bgezl $t4, .L7F0444DC -/* 078CA0 7F044130 8FBF0014 */ lw $ra, 0x14($sp) -/* 078CA4 7F044134 8CED000C */ lw $t5, 0xc($a3) -/* 078CA8 7F044138 2405000D */ li $a1, 13 -/* 078CAC 7F04413C 000D7000 */ sll $t6, $t5, 0 -/* 078CB0 7F044140 05C10003 */ bgez $t6, .L7F044150 -/* 078CB4 7F044144 00000000 */ nop -/* 078CB8 7F044148 10000001 */ b .L7F044150 -/* 078CBC 7F04414C 24050011 */ li $a1, 17 -.L7F044150: -/* 078CC0 7F044150 0FC10F9F */ jal propExplode -/* 078CC4 7F044154 AFA7002C */ sw $a3, 0x2c($sp) -/* 078CC8 7F044158 8FA7002C */ lw $a3, 0x2c($sp) -/* 078CCC 7F04415C 8CEF0064 */ lw $t7, 0x64($a3) -/* 078CD0 7F044160 35F80004 */ ori $t8, $t7, 4 -/* 078CD4 7F044164 100000DC */ b .L7F0444D8 -/* 078CD8 7F044168 ACF80064 */ sw $t8, 0x64($a3) -/* 078CDC 7F04416C 24010056 */ li $at, 86 -.L7F044170: -/* 078CE0 7F044170 54610014 */ bnel $v1, $at, .L7F0441C4 -/* 078CE4 7F044174 24010022 */ li $at, 34 -/* 078CE8 7F044178 84D90082 */ lh $t9, 0x82($a2) -/* 078CEC 7F04417C 8FA40030 */ lw $a0, 0x30($sp) -/* 078CF0 7F044180 572000D6 */ bnezl $t9, .L7F0444DC -/* 078CF4 7F044184 8FBF0014 */ lw $ra, 0x14($sp) -/* 078CF8 7F044188 8CE8000C */ lw $t0, 0xc($a3) -/* 078CFC 7F04418C 2405000D */ li $a1, 13 -/* 078D00 7F044190 00084800 */ sll $t1, $t0, 0 -/* 078D04 7F044194 05210003 */ bgez $t1, .L7F0441A4 -/* 078D08 7F044198 00000000 */ nop -/* 078D0C 7F04419C 10000001 */ b .L7F0441A4 -/* 078D10 7F0441A0 24050011 */ li $a1, 17 -.L7F0441A4: -/* 078D14 7F0441A4 0FC10F9F */ jal propExplode -/* 078D18 7F0441A8 AFA7002C */ sw $a3, 0x2c($sp) -/* 078D1C 7F0441AC 8FA7002C */ lw $a3, 0x2c($sp) -/* 078D20 7F0441B0 8CEA0064 */ lw $t2, 0x64($a3) -/* 078D24 7F0441B4 354B0004 */ ori $t3, $t2, 4 -/* 078D28 7F0441B8 100000C7 */ b .L7F0444D8 -/* 078D2C 7F0441BC ACEB0064 */ sw $t3, 0x64($a3) -/* 078D30 7F0441C0 24010022 */ li $at, 34 -.L7F0441C4: -/* 078D34 7F0441C4 54610014 */ bnel $v1, $at, .L7F044218 -/* 078D38 7F0441C8 2401001B */ li $at, 27 -/* 078D3C 7F0441CC 84CC0082 */ lh $t4, 0x82($a2) -/* 078D40 7F0441D0 8FA40030 */ lw $a0, 0x30($sp) -/* 078D44 7F0441D4 24050011 */ li $a1, 17 -/* 078D48 7F0441D8 558000C0 */ bnezl $t4, .L7F0444DC -/* 078D4C 7F0441DC 8FBF0014 */ lw $ra, 0x14($sp) -/* 078D50 7F0441E0 0FC10F9F */ jal propExplode -/* 078D54 7F0441E4 AFA7002C */ sw $a3, 0x2c($sp) -/* 078D58 7F0441E8 8FA7002C */ lw $a3, 0x2c($sp) -/* 078D5C 7F0441EC 24040078 */ li $a0, 120 -/* 078D60 7F0441F0 8CED0064 */ lw $t5, 0x64($a3) -/* 078D64 7F0441F4 35AE0004 */ ori $t6, $t5, 4 -/* 078D68 7F0441F8 0FC23213 */ jal SurroundWithExplosions -/* 078D6C 7F0441FC ACEE0064 */ sw $t6, 0x64($a3) -/* 078D70 7F044200 24040002 */ li $a0, 2 -/* 078D74 7F044204 0FC15997 */ jal countdownTimerSetVisible -/* 078D78 7F044208 00002825 */ move $a1, $zero -/* 078D7C 7F04420C 100000B3 */ b .L7F0444DC -/* 078D80 7F044210 8FBF0014 */ lw $ra, 0x14($sp) -/* 078D84 7F044214 2401001B */ li $at, 27 -.L7F044218: -/* 078D88 7F044218 10610003 */ beq $v1, $at, .L7F044228 -/* 078D8C 7F04421C 24010021 */ li $at, 33 -/* 078D90 7F044220 54610020 */ bnel $v1, $at, .L7F0442A4 -/* 078D94 7F044224 2401001D */ li $at, 29 -.L7F044228: -/* 078D98 7F044228 84C20082 */ lh $v0, 0x82($a2) -/* 078D9C 7F04422C 3C0F8005 */ lui $t7, %hi(g_ClockTimer) # $t7, 0x8005 -/* 078DA0 7F044230 0442001C */ bltzl $v0, .L7F0442A4 -/* 078DA4 7F044234 2401001D */ li $at, 29 -/* 078DA8 7F044238 8DEF83A4 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 078DAC 7F04423C 004FC023 */ subu $t8, $v0, $t7 -/* 078DB0 7F044240 A4D80082 */ sh $t8, 0x82($a2) -/* 078DB4 7F044244 84D90082 */ lh $t9, 0x82($a2) -/* 078DB8 7F044248 8FA40030 */ lw $a0, 0x30($sp) -/* 078DBC 7F04424C 072300A3 */ bgezl $t9, .L7F0444DC -/* 078DC0 7F044250 8FBF0014 */ lw $ra, 0x14($sp) -/* 078DC4 7F044254 8CE8000C */ lw $t0, 0xc($a3) -/* 078DC8 7F044258 2405000D */ li $a1, 13 -/* 078DCC 7F04425C 00084800 */ sll $t1, $t0, 0 -/* 078DD0 7F044260 05210003 */ bgez $t1, .L7F044270 -/* 078DD4 7F044264 00000000 */ nop -/* 078DD8 7F044268 10000001 */ b .L7F044270 -/* 078DDC 7F04426C 24050011 */ li $a1, 17 -.L7F044270: -/* 078DE0 7F044270 AFA60028 */ sw $a2, 0x28($sp) -/* 078DE4 7F044274 0FC10F9F */ jal propExplode -/* 078DE8 7F044278 AFA7002C */ sw $a3, 0x2c($sp) -/* 078DEC 7F04427C 8FA60028 */ lw $a2, 0x28($sp) -/* 078DF0 7F044280 10400095 */ beqz $v0, .L7F0444D8 -/* 078DF4 7F044284 8FA7002C */ lw $a3, 0x2c($sp) -/* 078DF8 7F044288 240AFFFF */ li $t2, -1 -/* 078DFC 7F04428C A4CA0082 */ sh $t2, 0x82($a2) -/* 078E00 7F044290 8CEB0064 */ lw $t3, 0x64($a3) -/* 078E04 7F044294 356C0004 */ ori $t4, $t3, 4 -/* 078E08 7F044298 1000008F */ b .L7F0444D8 -/* 078E0C 7F04429C ACEC0064 */ sw $t4, 0x64($a3) -/* 078E10 7F0442A0 2401001D */ li $at, 29 -.L7F0442A4: -/* 078E14 7F0442A4 5461003F */ bnel $v1, $at, .L7F0443A4 -/* 078E18 7F0442A8 2401001C */ li $at, 28 -/* 078E1C 7F0442AC 3C038003 */ lui $v1, %hi(D_80030AF4) # $v1, 0x8003 -/* 078E20 7F0442B0 8C630B34 */ lw $v1, %lo(D_80030AF4)($v1) -/* 078E24 7F0442B4 3C088005 */ lui $t0, %hi(g_ClockTimer) # $t0, 0x8005 -/* 078E28 7F0442B8 5060000C */ beql $v1, $zero, .L7F0442EC -/* 078E2C 7F0442BC 84C20082 */ lh $v0, 0x82($a2) -/* 078E30 7F0442C0 8CE20064 */ lw $v0, 0x64($a3) -/* 078E34 7F0442C4 3C010006 */ lui $at, 6 -/* 078E38 7F0442C8 240F0001 */ li $t7, 1 -/* 078E3C 7F0442CC 00416824 */ and $t5, $v0, $at -/* 078E40 7F0442D0 000D7442 */ srl $t6, $t5, 0x11 -/* 078E44 7F0442D4 01CFC004 */ sllv $t8, $t7, $t6 -/* 078E48 7F0442D8 0078C824 */ and $t9, $v1, $t8 -/* 078E4C 7F0442DC 53200003 */ beql $t9, $zero, .L7F0442EC -/* 078E50 7F0442E0 84C20082 */ lh $v0, 0x82($a2) -/* 078E54 7F0442E4 A4C00082 */ sh $zero, 0x82($a2) -/* 078E58 7F0442E8 84C20082 */ lh $v0, 0x82($a2) -.L7F0442EC: -/* 078E5C 7F0442EC 28410002 */ slti $at, $v0, 2 -/* 078E60 7F0442F0 1420000B */ bnez $at, .L7F044320 -/* 078E64 7F0442F4 00000000 */ nop -/* 078E68 7F0442F8 8D0883A4 */ lw $t0, %lo(g_ClockTimer)($t0) -/* 078E6C 7F0442FC 240B0001 */ li $t3, 1 -/* 078E70 7F044300 00484823 */ subu $t1, $v0, $t0 -/* 078E74 7F044304 A4C90082 */ sh $t1, 0x82($a2) -/* 078E78 7F044308 84CA0082 */ lh $t2, 0x82($a2) -/* 078E7C 7F04430C 29410002 */ slti $at, $t2, 2 -/* 078E80 7F044310 50200072 */ beql $at, $zero, .L7F0444DC -/* 078E84 7F044314 8FBF0014 */ lw $ra, 0x14($sp) -/* 078E88 7F044318 1000006F */ b .L7F0444D8 -/* 078E8C 7F04431C A4CB0082 */ sh $t3, 0x82($a2) -.L7F044320: -/* 078E90 7F044320 5440006E */ bnezl $v0, .L7F0444DC -/* 078E94 7F044324 8FBF0014 */ lw $ra, 0x14($sp) -/* 078E98 7F044328 8CEC000C */ lw $t4, 0xc($a3) -/* 078E9C 7F04432C 2405000D */ li $a1, 13 -/* 078EA0 7F044330 000C6800 */ sll $t5, $t4, 0 -/* 078EA4 7F044334 05A30004 */ bgezl $t5, .L7F044348 -/* 078EA8 7F044338 AFA5001C */ sw $a1, 0x1c($sp) -/* 078EAC 7F04433C 1000000B */ b .L7F04436C -/* 078EB0 7F044340 24050011 */ li $a1, 17 -/* 078EB4 7F044344 AFA5001C */ sw $a1, 0x1c($sp) -.L7F044348: -/* 078EB8 7F044348 AFA60028 */ sw $a2, 0x28($sp) -/* 078EBC 7F04434C 0C001A57 */ jal bossGetStageNum -/* 078EC0 7F044350 AFA7002C */ sw $a3, 0x2c($sp) -/* 078EC4 7F044354 24010022 */ li $at, 34 -/* 078EC8 7F044358 8FA5001C */ lw $a1, 0x1c($sp) -/* 078ECC 7F04435C 8FA60028 */ lw $a2, 0x28($sp) -/* 078ED0 7F044360 14410002 */ bne $v0, $at, .L7F04436C -/* 078ED4 7F044364 8FA7002C */ lw $a3, 0x2c($sp) -/* 078ED8 7F044368 24050013 */ li $a1, 19 -.L7F04436C: -/* 078EDC 7F04436C 8FA40030 */ lw $a0, 0x30($sp) -/* 078EE0 7F044370 AFA60028 */ sw $a2, 0x28($sp) -/* 078EE4 7F044374 0FC10F9F */ jal propExplode -/* 078EE8 7F044378 AFA7002C */ sw $a3, 0x2c($sp) -/* 078EEC 7F04437C 8FA60028 */ lw $a2, 0x28($sp) -/* 078EF0 7F044380 10400055 */ beqz $v0, .L7F0444D8 -/* 078EF4 7F044384 8FA7002C */ lw $a3, 0x2c($sp) -/* 078EF8 7F044388 240EFFFF */ li $t6, -1 -/* 078EFC 7F04438C A4CE0082 */ sh $t6, 0x82($a2) -/* 078F00 7F044390 8CEF0064 */ lw $t7, 0x64($a3) -/* 078F04 7F044394 35F80004 */ ori $t8, $t7, 4 -/* 078F08 7F044398 1000004F */ b .L7F0444D8 -/* 078F0C 7F04439C ACF80064 */ sw $t8, 0x64($a3) -/* 078F10 7F0443A0 2401001C */ li $at, 28 -.L7F0443A4: -/* 078F14 7F0443A4 5461004D */ bnel $v1, $at, .L7F0444DC -/* 078F18 7F0443A8 8FBF0014 */ lw $ra, 0x14($sp) -/* 078F1C 7F0443AC 84C20082 */ lh $v0, 0x82($a2) -/* 078F20 7F0443B0 3C198005 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8005 -/* 078F24 7F0443B4 28410002 */ slti $at, $v0, 2 -/* 078F28 7F0443B8 54200012 */ bnezl $at, .L7F044404 -/* 078F2C 7F0443BC 24010001 */ li $at, 1 -/* 078F30 7F0443C0 8F3983A4 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 078F34 7F0443C4 240A0001 */ li $t2, 1 -/* 078F38 7F0443C8 00C02025 */ move $a0, $a2 -/* 078F3C 7F0443CC 00594023 */ subu $t0, $v0, $t9 -/* 078F40 7F0443D0 A4C80082 */ sh $t0, 0x82($a2) -/* 078F44 7F0443D4 84C90082 */ lh $t1, 0x82($a2) -/* 078F48 7F0443D8 29210002 */ slti $at, $t1, 2 -/* 078F4C 7F0443DC 50200027 */ beql $at, $zero, .L7F04447C -/* 078F50 7F0443E0 84CC0082 */ lh $t4, 0x82($a2) -/* 078F54 7F0443E4 A4CA0082 */ sh $t2, 0x82($a2) -/* 078F58 7F0443E8 AFA7002C */ sw $a3, 0x2c($sp) -/* 078F5C 7F0443EC 0FC14816 */ jal add_obj_to_temp_proxmine_table -/* 078F60 7F0443F0 AFA60028 */ sw $a2, 0x28($sp) -/* 078F64 7F0443F4 8FA60028 */ lw $a2, 0x28($sp) -/* 078F68 7F0443F8 1000001F */ b .L7F044478 -/* 078F6C 7F0443FC 8FA7002C */ lw $a3, 0x2c($sp) -/* 078F70 7F044400 24010001 */ li $at, 1 -.L7F044404: -/* 078F74 7F044404 5441001D */ bnel $v0, $at, .L7F04447C -/* 078F78 7F044408 84CC0082 */ lh $t4, 0x82($a2) -/* 078F7C 7F04440C AFA60028 */ sw $a2, 0x28($sp) -/* 078F80 7F044410 0FC2279B */ jal get_curplayer_positiondata -/* 078F84 7F044414 AFA7002C */ sw $a3, 0x2c($sp) -/* 078F88 7F044418 8FAB0030 */ lw $t3, 0x30($sp) -/* 078F8C 7F04441C C4440008 */ lwc1 $f4, 8($v0) -/* 078F90 7F044420 C448000C */ lwc1 $f8, 0xc($v0) -/* 078F94 7F044424 C5660008 */ lwc1 $f6, 8($t3) -/* 078F98 7F044428 C56A000C */ lwc1 $f10, 0xc($t3) -/* 078F9C 7F04442C C4500010 */ lwc1 $f16, 0x10($v0) -/* 078FA0 7F044430 46062001 */ sub.s $f0, $f4, $f6 -/* 078FA4 7F044434 C5720010 */ lwc1 $f18, 0x10($t3) -/* 078FA8 7F044438 3C018005 */ lui $at, %hi(D_80052A94) # $at, 0x8005 -/* 078FAC 7F04443C 460A4081 */ sub.s $f2, $f8, $f10 -/* 078FB0 7F044440 46000102 */ mul.s $f4, $f0, $f0 -/* 078FB4 7F044444 8FA60028 */ lw $a2, 0x28($sp) -/* 078FB8 7F044448 46128301 */ sub.s $f12, $f16, $f18 -/* 078FBC 7F04444C 46021182 */ mul.s $f6, $f2, $f2 -/* 078FC0 7F044450 C4322AC4 */ lwc1 $f18, %lo(D_80052A94)($at) -/* 078FC4 7F044454 8FA7002C */ lw $a3, 0x2c($sp) -/* 078FC8 7F044458 460C6282 */ mul.s $f10, $f12, $f12 -/* 078FCC 7F04445C 46062200 */ add.s $f8, $f4, $f6 -/* 078FD0 7F044460 460A4400 */ add.s $f16, $f8, $f10 -/* 078FD4 7F044464 4612803C */ c.lt.s $f16, $f18 -/* 078FD8 7F044468 00000000 */ nop -/* 078FDC 7F04446C 45020003 */ bc1fl .L7F04447C -/* 078FE0 7F044470 84CC0082 */ lh $t4, 0x82($a2) -/* 078FE4 7F044474 A4C00082 */ sh $zero, 0x82($a2) -.L7F044478: -/* 078FE8 7F044478 84CC0082 */ lh $t4, 0x82($a2) -.L7F04447C: -/* 078FEC 7F04447C 8FA40030 */ lw $a0, 0x30($sp) -/* 078FF0 7F044480 55800016 */ bnezl $t4, .L7F0444DC -/* 078FF4 7F044484 8FBF0014 */ lw $ra, 0x14($sp) -/* 078FF8 7F044488 8CED000C */ lw $t5, 0xc($a3) -/* 078FFC 7F04448C 2405000D */ li $a1, 13 -/* 079000 7F044490 000D7000 */ sll $t6, $t5, 0 -/* 079004 7F044494 05C10003 */ bgez $t6, .L7F0444A4 -/* 079008 7F044498 00000000 */ nop -/* 07900C 7F04449C 10000001 */ b .L7F0444A4 -/* 079010 7F0444A0 24050011 */ li $a1, 17 -.L7F0444A4: -/* 079014 7F0444A4 AFA60028 */ sw $a2, 0x28($sp) -/* 079018 7F0444A8 0FC10F9F */ jal propExplode -/* 07901C 7F0444AC AFA7002C */ sw $a3, 0x2c($sp) -/* 079020 7F0444B0 8FA60028 */ lw $a2, 0x28($sp) -/* 079024 7F0444B4 10400008 */ beqz $v0, .L7F0444D8 -/* 079028 7F0444B8 8FA7002C */ lw $a3, 0x2c($sp) -/* 07902C 7F0444BC 240FFFFF */ li $t7, -1 -/* 079030 7F0444C0 A4CF0082 */ sh $t7, 0x82($a2) -/* 079034 7F0444C4 8CF80064 */ lw $t8, 0x64($a3) -/* 079038 7F0444C8 00C02025 */ move $a0, $a2 -/* 07903C 7F0444CC 37190004 */ ori $t9, $t8, 4 -/* 079040 7F0444D0 0FC14824 */ jal remove_obj_from_temp_proxmine_table -/* 079044 7F0444D4 ACF90064 */ sw $t9, 0x64($a3) -.L7F0444D8: -/* 079048 7F0444D8 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0444DC: -/* 07904C 7F0444DC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 079050 7F0444E0 03E00008 */ jr $ra -/* 079054 7F0444E4 00000000 */ nop -) -#endif -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_80052A94 -.word 0x47742400 /*62500.0*/ -.text -glabel handle_thrown_explosive_detonation -/* 076824 7F043E34 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 076828 7F043E38 AFBF0014 */ sw $ra, 0x14($sp) -/* 07682C 7F043E3C AFA40030 */ sw $a0, 0x30($sp) -/* 076830 7F043E40 8C870004 */ lw $a3, 4($a0) -/* 076834 7F043E44 0FC269A4 */ jal get_cur_playernum -/* 076838 7F043E48 AFA7002C */ sw $a3, 0x2c($sp) -/* 07683C 7F043E4C 0FC26A86 */ jal sub_GAME_7F09B4D8 -/* 076840 7F043E50 00402025 */ move $a0, $v0 -/* 076844 7F043E54 14400110 */ bnez $v0, .L7F044298eu -/* 076848 7F043E58 8FA7002C */ lw $a3, 0x2c($sp) -/* 07684C 7F043E5C 90E20003 */ lbu $v0, 3($a3) -/* 076850 7F043E60 24010007 */ li $at, 7 -/* 076854 7F043E64 5441000F */ bnel $v0, $at, .L7F043EA4 -/* 076858 7F043E68 24010008 */ li $at, 8 -/* 07685C 7F043E6C 8CEF0008 */ lw $t7, 8($a3) -/* 076860 7F043E70 8FA40030 */ lw $a0, 0x30($sp) -/* 076864 7F043E74 2405000C */ li $a1, 12 -/* 076868 7F043E78 000FC0C0 */ sll $t8, $t7, 3 -/* 07686C 7F043E7C 07030107 */ bgezl $t8, .L7F04429C -/* 076870 7F043E80 8FBF0014 */ lw $ra, 0x14($sp) -/* 076874 7F043E84 0FC10F0F */ jal propExplode -/* 076878 7F043E88 AFA7002C */ sw $a3, 0x2c($sp) -/* 07687C 7F043E8C 8FA7002C */ lw $a3, 0x2c($sp) -/* 076880 7F043E90 8CF90064 */ lw $t9, 0x64($a3) -/* 076884 7F043E94 37280004 */ ori $t0, $t9, 4 -/* 076888 7F043E98 100000FF */ b .L7F044298eu -/* 07688C 7F043E9C ACE80064 */ sw $t0, 0x64($a3) -/* 076890 7F043EA0 24010008 */ li $at, 8 -.L7F043EA4: -/* 076894 7F043EA4 144100FC */ bne $v0, $at, .L7F044298eu -/* 076898 7F043EA8 8FA90030 */ lw $t1, 0x30($sp) -/* 07689C 7F043EAC 8D260004 */ lw $a2, 4($t1) -/* 0768A0 7F043EB0 2401001A */ li $at, 26 -/* 0768A4 7F043EB4 80C30080 */ lb $v1, 0x80($a2) -/* 0768A8 7F043EB8 10610003 */ beq $v1, $at, .L7F043EC8 -/* 0768AC 7F043EBC 24010057 */ li $at, 87 -/* 0768B0 7F043EC0 5461001B */ bnel $v1, $at, .L7F043F30 -/* 0768B4 7F043EC4 24010056 */ li $at, 86 -.L7F043EC8: -/* 0768B8 7F043EC8 84C20082 */ lh $v0, 0x82($a2) -/* 0768BC 7F043ECC 3C0A8004 */ lui $t2, %hi(g_ClockTimer) # $t2, 0x8004 -/* 0768C0 7F043ED0 04420017 */ bltzl $v0, .L7F043F30 -/* 0768C4 7F043ED4 24010056 */ li $at, 86 -/* 0768C8 7F043ED8 8D4A0FF4 */ lw $t2, %lo(g_ClockTimer)($t2) -/* 0768CC 7F043EDC 004A5823 */ subu $t3, $v0, $t2 -/* 0768D0 7F043EE0 A4CB0082 */ sh $t3, 0x82($a2) -/* 0768D4 7F043EE4 84CC0082 */ lh $t4, 0x82($a2) -/* 0768D8 7F043EE8 8FA40030 */ lw $a0, 0x30($sp) -/* 0768DC 7F043EEC 058300EB */ bgezl $t4, .L7F04429C -/* 0768E0 7F043EF0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0768E4 7F043EF4 8CED000C */ lw $t5, 0xc($a3) -/* 0768E8 7F043EF8 2405000D */ li $a1, 13 -/* 0768EC 7F043EFC 000D7000 */ sll $t6, $t5, 0 -/* 0768F0 7F043F00 05C10003 */ bgez $t6, .L7F043F10 -/* 0768F4 7F043F04 00000000 */ nop -/* 0768F8 7F043F08 10000001 */ b .L7F043F10 -/* 0768FC 7F043F0C 24050011 */ li $a1, 17 -.L7F043F10: -/* 076900 7F043F10 0FC10F0F */ jal propExplode -/* 076904 7F043F14 AFA7002C */ sw $a3, 0x2c($sp) -/* 076908 7F043F18 8FA7002C */ lw $a3, 0x2c($sp) -/* 07690C 7F043F1C 8CEF0064 */ lw $t7, 0x64($a3) -/* 076910 7F043F20 35F80004 */ ori $t8, $t7, 4 -/* 076914 7F043F24 100000DC */ b .L7F044298eu -/* 076918 7F043F28 ACF80064 */ sw $t8, 0x64($a3) -/* 07691C 7F043F2C 24010056 */ li $at, 86 -.L7F043F30: -/* 076920 7F043F30 54610014 */ bnel $v1, $at, .L7F043F84 -/* 076924 7F043F34 24010022 */ li $at, 34 -/* 076928 7F043F38 84D90082 */ lh $t9, 0x82($a2) -/* 07692C 7F043F3C 8FA40030 */ lw $a0, 0x30($sp) -/* 076930 7F043F40 572000D6 */ bnezl $t9, .L7F04429C -/* 076934 7F043F44 8FBF0014 */ lw $ra, 0x14($sp) -/* 076938 7F043F48 8CE8000C */ lw $t0, 0xc($a3) -/* 07693C 7F043F4C 2405000D */ li $a1, 13 -/* 076940 7F043F50 00084800 */ sll $t1, $t0, 0 -/* 076944 7F043F54 05210003 */ bgez $t1, .L7F043F64 -/* 076948 7F043F58 00000000 */ nop -/* 07694C 7F043F5C 10000001 */ b .L7F043F64 -/* 076950 7F043F60 24050011 */ li $a1, 17 -.L7F043F64: -/* 076954 7F043F64 0FC10F0F */ jal propExplode -/* 076958 7F043F68 AFA7002C */ sw $a3, 0x2c($sp) -/* 07695C 7F043F6C 8FA7002C */ lw $a3, 0x2c($sp) -/* 076960 7F043F70 8CEA0064 */ lw $t2, 0x64($a3) -/* 076964 7F043F74 354B0004 */ ori $t3, $t2, 4 -/* 076968 7F043F78 100000C7 */ b .L7F044298eu -/* 07696C 7F043F7C ACEB0064 */ sw $t3, 0x64($a3) -/* 076970 7F043F80 24010022 */ li $at, 34 -.L7F043F84: -/* 076974 7F043F84 54610014 */ bnel $v1, $at, .L7F043FD8 -/* 076978 7F043F88 2401001B */ li $at, 27 -/* 07697C 7F043F8C 84CC0082 */ lh $t4, 0x82($a2) -/* 076980 7F043F90 8FA40030 */ lw $a0, 0x30($sp) -/* 076984 7F043F94 24050011 */ li $a1, 17 -/* 076988 7F043F98 558000C0 */ bnezl $t4, .L7F04429C -/* 07698C 7F043F9C 8FBF0014 */ lw $ra, 0x14($sp) -/* 076990 7F043FA0 0FC10F0F */ jal propExplode -/* 076994 7F043FA4 AFA7002C */ sw $a3, 0x2c($sp) -/* 076998 7F043FA8 8FA7002C */ lw $a3, 0x2c($sp) -/* 07699C 7F043FAC 24040064 */ li $a0, 100 -/* 0769A0 7F043FB0 8CED0064 */ lw $t5, 0x64($a3) -/* 0769A4 7F043FB4 35AE0004 */ ori $t6, $t5, 4 -/* 0769A8 7F043FB8 0FC230B5 */ jal SurroundWithExplosions -/* 0769AC 7F043FBC ACEE0064 */ sw $t6, 0x64($a3) -/* 0769B0 7F043FC0 24040002 */ li $a0, 2 -/* 0769B4 7F043FC4 0FC15910 */ jal countdownTimerSetVisible -/* 0769B8 7F043FC8 00002825 */ move $a1, $zero -/* 0769BC 7F043FCC 100000B3 */ b .L7F04429C -/* 0769C0 7F043FD0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0769C4 7F043FD4 2401001B */ li $at, 27 -.L7F043FD8: -/* 0769C8 7F043FD8 10610003 */ beq $v1, $at, .L7F043FE8 -/* 0769CC 7F043FDC 24010021 */ li $at, 33 -/* 0769D0 7F043FE0 54610020 */ bnel $v1, $at, .L7F044064 -/* 0769D4 7F043FE4 2401001D */ li $at, 29 -.L7F043FE8: -/* 0769D8 7F043FE8 84C20082 */ lh $v0, 0x82($a2) -/* 0769DC 7F043FEC 3C0F8004 */ lui $t7, %hi(g_ClockTimer) # $t7, 0x8004 -/* 0769E0 7F043FF0 0442001C */ bltzl $v0, .L7F044064 -/* 0769E4 7F043FF4 2401001D */ li $at, 29 -/* 0769E8 7F043FF8 8DEF0FF4 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 0769EC 7F043FFC 004FC023 */ subu $t8, $v0, $t7 -/* 0769F0 7F044000 A4D80082 */ sh $t8, 0x82($a2) -/* 0769F4 7F044004 84D90082 */ lh $t9, 0x82($a2) -/* 0769F8 7F044008 8FA40030 */ lw $a0, 0x30($sp) -/* 0769FC 7F04400C 072300A3 */ bgezl $t9, .L7F04429C -/* 076A00 7F044010 8FBF0014 */ lw $ra, 0x14($sp) -/* 076A04 7F044014 8CE8000C */ lw $t0, 0xc($a3) -/* 076A08 7F044018 2405000D */ li $a1, 13 -/* 076A0C 7F04401C 00084800 */ sll $t1, $t0, 0 -/* 076A10 7F044020 05210003 */ bgez $t1, .L7F044030 -/* 076A14 7F044024 00000000 */ nop -/* 076A18 7F044028 10000001 */ b .L7F044030 -/* 076A1C 7F04402C 24050011 */ li $a1, 17 -.L7F044030: -/* 076A20 7F044030 AFA60028 */ sw $a2, 0x28($sp) -/* 076A24 7F044034 0FC10F0F */ jal propExplode -/* 076A28 7F044038 AFA7002C */ sw $a3, 0x2c($sp) -/* 076A2C 7F04403C 8FA60028 */ lw $a2, 0x28($sp) -/* 076A30 7F044040 10400095 */ beqz $v0, .L7F044298eu -/* 076A34 7F044044 8FA7002C */ lw $a3, 0x2c($sp) -/* 076A38 7F044048 240AFFFF */ li $t2, -1 -/* 076A3C 7F04404C A4CA0082 */ sh $t2, 0x82($a2) -/* 076A40 7F044050 8CEB0064 */ lw $t3, 0x64($a3) -/* 076A44 7F044054 356C0004 */ ori $t4, $t3, 4 -/* 076A48 7F044058 1000008F */ b .L7F044298eu -/* 076A4C 7F04405C ACEC0064 */ sw $t4, 0x64($a3) -/* 076A50 7F044060 2401001D */ li $at, 29 -.L7F044064: -/* 076A54 7F044064 5461003F */ bnel $v1, $at, .L7F044164 -/* 076A58 7F044068 2401001C */ li $at, 28 -/* 076A5C 7F04406C 3C038003 */ lui $v1, %hi(D_80030AF4) # $v1, 0x8003 -/* 076A60 7F044070 8C63C044 */ lw $v1, %lo(D_80030AF4)($v1) -/* 076A64 7F044074 3C088004 */ lui $t0, %hi(g_ClockTimer) # $t0, 0x8004 -/* 076A68 7F044078 5060000C */ beql $v1, $zero, .L7F0440AC -/* 076A6C 7F04407C 84C20082 */ lh $v0, 0x82($a2) -/* 076A70 7F044080 8CE20064 */ lw $v0, 0x64($a3) -/* 076A74 7F044084 3C010006 */ lui $at, 6 -/* 076A78 7F044088 240F0001 */ li $t7, 1 -/* 076A7C 7F04408C 00416824 */ and $t5, $v0, $at -/* 076A80 7F044090 000D7442 */ srl $t6, $t5, 0x11 -/* 076A84 7F044094 01CFC004 */ sllv $t8, $t7, $t6 -/* 076A88 7F044098 0078C824 */ and $t9, $v1, $t8 -/* 076A8C 7F04409C 53200003 */ beql $t9, $zero, .L7F0440AC -/* 076A90 7F0440A0 84C20082 */ lh $v0, 0x82($a2) -/* 076A94 7F0440A4 A4C00082 */ sh $zero, 0x82($a2) -/* 076A98 7F0440A8 84C20082 */ lh $v0, 0x82($a2) -.L7F0440AC: -/* 076A9C 7F0440AC 28410002 */ slti $at, $v0, 2 -/* 076AA0 7F0440B0 1420000B */ bnez $at, .L7F0440E0 -/* 076AA4 7F0440B4 00000000 */ nop -/* 076AA8 7F0440B8 8D080FF4 */ lw $t0, %lo(g_ClockTimer)($t0) -/* 076AAC 7F0440BC 240B0001 */ li $t3, 1 -/* 076AB0 7F0440C0 00484823 */ subu $t1, $v0, $t0 -/* 076AB4 7F0440C4 A4C90082 */ sh $t1, 0x82($a2) -/* 076AB8 7F0440C8 84CA0082 */ lh $t2, 0x82($a2) -/* 076ABC 7F0440CC 29410002 */ slti $at, $t2, 2 -/* 076AC0 7F0440D0 50200072 */ beql $at, $zero, .L7F04429C -/* 076AC4 7F0440D4 8FBF0014 */ lw $ra, 0x14($sp) -/* 076AC8 7F0440D8 1000006F */ b .L7F044298eu -/* 076ACC 7F0440DC A4CB0082 */ sh $t3, 0x82($a2) -.L7F0440E0: -/* 076AD0 7F0440E0 5440006E */ bnezl $v0, .L7F04429C -/* 076AD4 7F0440E4 8FBF0014 */ lw $ra, 0x14($sp) -/* 076AD8 7F0440E8 8CEC000C */ lw $t4, 0xc($a3) -/* 076ADC 7F0440EC 2405000D */ li $a1, 13 -/* 076AE0 7F0440F0 000C6800 */ sll $t5, $t4, 0 -/* 076AE4 7F0440F4 05A30004 */ bgezl $t5, .L7F044108 -/* 076AE8 7F0440F8 AFA5001C */ sw $a1, 0x1c($sp) -/* 076AEC 7F0440FC 1000000B */ b .L7F04412C -/* 076AF0 7F044100 24050011 */ li $a1, 17 -/* 076AF4 7F044104 AFA5001C */ sw $a1, 0x1c($sp) -.L7F044108: -/* 076AF8 7F044108 AFA60028 */ sw $a2, 0x28($sp) -/* 076AFC 7F04410C 0C001769 */ jal bossGetStageNum -/* 076B00 7F044110 AFA7002C */ sw $a3, 0x2c($sp) -/* 076B04 7F044114 24010022 */ li $at, 34 -/* 076B08 7F044118 8FA5001C */ lw $a1, 0x1c($sp) -/* 076B0C 7F04411C 8FA60028 */ lw $a2, 0x28($sp) -/* 076B10 7F044120 14410002 */ bne $v0, $at, .L7F04412C -/* 076B14 7F044124 8FA7002C */ lw $a3, 0x2c($sp) -/* 076B18 7F044128 24050013 */ li $a1, 19 -.L7F04412C: -/* 076B1C 7F04412C 8FA40030 */ lw $a0, 0x30($sp) -/* 076B20 7F044130 AFA60028 */ sw $a2, 0x28($sp) -/* 076B24 7F044134 0FC10F0F */ jal propExplode -/* 076B28 7F044138 AFA7002C */ sw $a3, 0x2c($sp) -/* 076B2C 7F04413C 8FA60028 */ lw $a2, 0x28($sp) -/* 076B30 7F044140 10400055 */ beqz $v0, .L7F044298eu -/* 076B34 7F044144 8FA7002C */ lw $a3, 0x2c($sp) -/* 076B38 7F044148 240EFFFF */ li $t6, -1 -/* 076B3C 7F04414C A4CE0082 */ sh $t6, 0x82($a2) -/* 076B40 7F044150 8CEF0064 */ lw $t7, 0x64($a3) -/* 076B44 7F044154 35F80004 */ ori $t8, $t7, 4 -/* 076B48 7F044158 1000004F */ b .L7F044298eu -/* 076B4C 7F04415C ACF80064 */ sw $t8, 0x64($a3) -/* 076B50 7F044160 2401001C */ li $at, 28 -.L7F044164: -/* 076B54 7F044164 5461004D */ bnel $v1, $at, .L7F04429C -/* 076B58 7F044168 8FBF0014 */ lw $ra, 0x14($sp) -/* 076B5C 7F04416C 84C20082 */ lh $v0, 0x82($a2) -/* 076B60 7F044170 3C198004 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8004 -/* 076B64 7F044174 28410002 */ slti $at, $v0, 2 -/* 076B68 7F044178 54200012 */ bnezl $at, .L7F0441C4 -/* 076B6C 7F04417C 24010001 */ li $at, 1 -/* 076B70 7F044180 8F390FF4 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 076B74 7F044184 240A0001 */ li $t2, 1 -/* 076B78 7F044188 00C02025 */ move $a0, $a2 -/* 076B7C 7F04418C 00594023 */ subu $t0, $v0, $t9 -/* 076B80 7F044190 A4C80082 */ sh $t0, 0x82($a2) -/* 076B84 7F044194 84C90082 */ lh $t1, 0x82($a2) -/* 076B88 7F044198 29210002 */ slti $at, $t1, 2 -/* 076B8C 7F04419C 50200027 */ beql $at, $zero, .L7F04423Ceu -/* 076B90 7F0441A0 84CC0082 */ lh $t4, 0x82($a2) -/* 076B94 7F0441A4 A4CA0082 */ sh $t2, 0x82($a2) -/* 076B98 7F0441A8 AFA7002C */ sw $a3, 0x2c($sp) -/* 076B9C 7F0441AC 0FC1478F */ jal add_obj_to_temp_proxmine_table -/* 076BA0 7F0441B0 AFA60028 */ sw $a2, 0x28($sp) -/* 076BA4 7F0441B4 8FA60028 */ lw $a2, 0x28($sp) -/* 076BA8 7F0441B8 1000001F */ b .L7F044238 -/* 076BAC 7F0441BC 8FA7002C */ lw $a3, 0x2c($sp) -/* 076BB0 7F0441C0 24010001 */ li $at, 1 -.L7F0441C4: -/* 076BB4 7F0441C4 5441001D */ bnel $v0, $at, .L7F04423Ceu -/* 076BB8 7F0441C8 84CC0082 */ lh $t4, 0x82($a2) -/* 076BBC 7F0441CC AFA60028 */ sw $a2, 0x28($sp) -/* 076BC0 7F0441D0 0FC22640 */ jal get_curplayer_positiondata -/* 076BC4 7F0441D4 AFA7002C */ sw $a3, 0x2c($sp) -/* 076BC8 7F0441D8 8FAB0030 */ lw $t3, 0x30($sp) -/* 076BCC 7F0441DC C4440008 */ lwc1 $f4, 8($v0) -/* 076BD0 7F0441E0 C448000C */ lwc1 $f8, 0xc($v0) -/* 076BD4 7F0441E4 C5660008 */ lwc1 $f6, 8($t3) -/* 076BD8 7F0441E8 C56A000C */ lwc1 $f10, 0xc($t3) -/* 076BDC 7F0441EC C4500010 */ lwc1 $f16, 0x10($v0) -/* 076BE0 7F0441F0 46062001 */ sub.s $f0, $f4, $f6 -/* 076BE4 7F0441F4 C5720010 */ lwc1 $f18, 0x10($t3) -/* 076BE8 7F0441F8 3C018005 */ lui $at, %hi(D_80052A94) # $at, 0x8005 -/* 076BEC 7F0441FC 460A4081 */ sub.s $f2, $f8, $f10 -/* 076BF0 7F044200 46000102 */ mul.s $f4, $f0, $f0 -/* 076BF4 7F044204 8FA60028 */ lw $a2, 0x28($sp) -/* 076BF8 7F044208 46128301 */ sub.s $f12, $f16, $f18 -/* 076BFC 7F04420C 46021182 */ mul.s $f6, $f2, $f2 -/* 076C00 7F044210 C4328BD4 */ lwc1 $f18, %lo(D_80052A94)($at) -/* 076C04 7F044214 8FA7002C */ lw $a3, 0x2c($sp) -/* 076C08 7F044218 460C6282 */ mul.s $f10, $f12, $f12 -/* 076C0C 7F04421C 46062200 */ add.s $f8, $f4, $f6 -/* 076C10 7F044220 460A4400 */ add.s $f16, $f8, $f10 -/* 076C14 7F044224 4612803C */ c.lt.s $f16, $f18 -/* 076C18 7F044228 00000000 */ nop -/* 076C1C 7F04422C 45020003 */ bc1fl .L7F04423Ceu -/* 076C20 7F044230 84CC0082 */ lh $t4, 0x82($a2) -/* 076C24 7F044234 A4C00082 */ sh $zero, 0x82($a2) -.L7F044238: -/* 076C28 7F044238 84CC0082 */ lh $t4, 0x82($a2) -.L7F04423Ceu: -/* 076C2C 7F04423C 8FA40030 */ lw $a0, 0x30($sp) -/* 076C30 7F044240 55800016 */ bnezl $t4, .L7F04429C -/* 076C34 7F044244 8FBF0014 */ lw $ra, 0x14($sp) -/* 076C38 7F044248 8CED000C */ lw $t5, 0xc($a3) -/* 076C3C 7F04424C 2405000D */ li $a1, 13 -/* 076C40 7F044250 000D7000 */ sll $t6, $t5, 0 -/* 076C44 7F044254 05C10003 */ bgez $t6, .L7F044264 -/* 076C48 7F044258 00000000 */ nop -/* 076C4C 7F04425C 10000001 */ b .L7F044264 -/* 076C50 7F044260 24050011 */ li $a1, 17 -.L7F044264: -/* 076C54 7F044264 AFA60028 */ sw $a2, 0x28($sp) -/* 076C58 7F044268 0FC10F0F */ jal propExplode -/* 076C5C 7F04426C AFA7002C */ sw $a3, 0x2c($sp) -/* 076C60 7F044270 8FA60028 */ lw $a2, 0x28($sp) -/* 076C64 7F044274 10400008 */ beqz $v0, .L7F044298eu -/* 076C68 7F044278 8FA7002C */ lw $a3, 0x2c($sp) -/* 076C6C 7F04427C 240FFFFF */ li $t7, -1 -/* 076C70 7F044280 A4CF0082 */ sh $t7, 0x82($a2) -/* 076C74 7F044284 8CF80064 */ lw $t8, 0x64($a3) -/* 076C78 7F044288 00C02025 */ move $a0, $a2 -/* 076C7C 7F04428C 37190004 */ ori $t9, $t8, 4 -/* 076C80 7F044290 0FC1479D */ jal remove_obj_from_temp_proxmine_table -/* 076C84 7F044294 ACF90064 */ sw $t9, 0x64($a3) -.L7F044298eu: -/* 076C88 7F044298 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04429C: -/* 076C8C 7F04429C 27BD0030 */ addiu $sp, $sp, 0x30 -/* 076C90 7F0442A0 03E00008 */ jr $ra -/* 076C94 7F0442A4 00000000 */ nop -) -#endif -#endif +void objDropRecursively(PropRecord *prop) +{ + PropRecord *child = prop->child; + while (child) + { + PropRecord *prev = child->prev; + objDropRecursively(child); + objDrop(child); + child = prev; + } +} -#ifdef NONMATCHING -void sub_GAME_7F044200(void) { +void sub_GAME_7F04424C(PropRecord* prop) +{ + ObjectRecord* obj; + PropRecord* next; + PropRecord* child; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F044200 -/* 078D30 7F044200 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 078D34 7F044204 AFBF001C */ sw $ra, 0x1c($sp) -/* 078D38 7F044208 AFB10018 */ sw $s1, 0x18($sp) -/* 078D3C 7F04420C AFB00014 */ sw $s0, 0x14($sp) -/* 078D40 7F044210 8C900020 */ lw $s0, 0x20($a0) -/* 078D44 7F044214 52000009 */ beql $s0, $zero, .L7F04423C -/* 078D48 7F044218 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04421C: -/* 078D4C 7F04421C 8E110024 */ lw $s1, 0x24($s0) -/* 078D50 7F044220 0FC11080 */ jal sub_GAME_7F044200 -/* 078D54 7F044224 02002025 */ move $a0, $s0 -/* 078D58 7F044228 0FC1304C */ jal sub_GAME_7F04C130 -/* 078D5C 7F04422C 02002025 */ move $a0, $s0 -/* 078D60 7F044230 1620FFFA */ bnez $s1, .L7F04421C -/* 078D64 7F044234 02208025 */ move $s0, $s1 -/* 078D68 7F044238 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04423C: -/* 078D6C 7F04423C 8FB00014 */ lw $s0, 0x14($sp) -/* 078D70 7F044240 8FB10018 */ lw $s1, 0x18($sp) -/* 078D74 7F044244 03E00008 */ jr $ra -/* 078D78 7F044248 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif + obj = prop->obj; + if (obj->runtime_bitflags & RUNTIMEBITFLAG_REMOVE) + { + objFree(obj, 1, obj->state & PROPSTATE_RESPAWN); + return; + } + prop->flags &= ~(PROPFLAG_ONSCREEN); + chrobjWeaponTick(prop); + child = prop->child; + while (child != NULL) + { + next = child->prev; + sub_GAME_7F04424C(child); + child = next; + } +} +void sub_GAME_7F0442DC(PropRecord* prop) +{ + ObjectRecord* obj; + Model* model; + PropRecord* child; + PropRecord* prev; + Mtxf* mtx; -#ifdef NONMATCHING -void sub_GAME_7F04424C(void) { + obj = prop->obj; + model = obj->model; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04424C -/* 078D7C 7F04424C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 078D80 7F044250 AFBF001C */ sw $ra, 0x1c($sp) -/* 078D84 7F044254 AFB10018 */ sw $s1, 0x18($sp) -/* 078D88 7F044258 AFB00014 */ sw $s0, 0x14($sp) -/* 078D8C 7F04425C 8C870004 */ lw $a3, 4($a0) -/* 078D90 7F044260 00808825 */ move $s1, $a0 -/* 078D94 7F044264 8CEE0064 */ lw $t6, 0x64($a3) -/* 078D98 7F044268 31CF0004 */ andi $t7, $t6, 4 -/* 078D9C 7F04426C 51E0000A */ beql $t7, $zero, .L7F044298 -/* 078DA0 7F044270 92390001 */ lbu $t9, 1($s1) -/* 078DA4 7F044274 90E60002 */ lbu $a2, 2($a3) -/* 078DA8 7F044278 00E02025 */ move $a0, $a3 -/* 078DAC 7F04427C 24050001 */ li $a1, 1 -/* 078DB0 7F044280 30D80004 */ andi $t8, $a2, 4 -/* 078DB4 7F044284 0FC10366 */ jal objFree -/* 078DB8 7F044288 03003025 */ move $a2, $t8 -/* 078DBC 7F04428C 1000000F */ b .L7F0442CC -/* 078DC0 7F044290 8FBF001C */ lw $ra, 0x1c($sp) -/* 078DC4 7F044294 92390001 */ lbu $t9, 1($s1) -.L7F044298: -/* 078DC8 7F044298 02202025 */ move $a0, $s1 -/* 078DCC 7F04429C 3328FFFD */ andi $t0, $t9, 0xfffd -/* 078DD0 7F0442A0 0FC10F5C */ jal handle_thrown_explosive_detonation -/* 078DD4 7F0442A4 A2280001 */ sb $t0, 1($s1) -/* 078DD8 7F0442A8 8E300020 */ lw $s0, 0x20($s1) -/* 078DDC 7F0442AC 52000007 */ beql $s0, $zero, .L7F0442CC -/* 078DE0 7F0442B0 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0442B4: -/* 078DE4 7F0442B4 8E110024 */ lw $s1, 0x24($s0) -/* 078DE8 7F0442B8 0FC11093 */ jal sub_GAME_7F04424C -/* 078DEC 7F0442BC 02002025 */ move $a0, $s0 -/* 078DF0 7F0442C0 1620FFFC */ bnez $s1, .L7F0442B4 -/* 078DF4 7F0442C4 02208025 */ move $s0, $s1 -/* 078DF8 7F0442C8 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0442CC: -/* 078DFC 7F0442CC 8FB00014 */ lw $s0, 0x14($sp) -/* 078E00 7F0442D0 8FB10018 */ lw $s1, 0x18($sp) -/* 078E04 7F0442D4 03E00008 */ jr $ra -/* 078E08 7F0442D8 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif + if (obj->runtime_bitflags & RUNTIMEBITFLAG_REMOVE) + { + objFree(obj, 1, (obj->state & PROPSTATE_RESPAWN)); + return; + } + if ((model->attachedto_objinst != NULL) && (obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED)) + { + mtx = modelFindNodeMtx(model->attachedto, model->attachedto_objinst, 0); + prop->flags |= PROPFLAG_ONSCREEN; + model->render_pos = (RenderPosView*)dynAllocate(model->obj->numMatrices << 6); + matrix_4x4_multiply_homogeneous(mtx, &obj->embedment->matrix, (Mtxf*)model->render_pos); + modelUpdateRelationsQuick(model, model->obj->RootNode); + chrobjWeaponTick(prop); + child = prop->child; + while (child != NULL) + { + prev = child->prev; + sub_GAME_7F0442DC(child); + child = prev; + } + } + else + { + prop->flags &= ~(PROPFLAG_ONSCREEN); + chrobjWeaponTick(prop); + child = prop->child; + while (child != NULL) + { + prev = child->prev; + sub_GAME_7F04424C(child); + child = prev; + } + } +} -#ifdef NONMATCHING -void sub_GAME_7F0442DC(void) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0442DC -/* 078E0C 7F0442DC 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 078E10 7F0442E0 AFBF0024 */ sw $ra, 0x24($sp) -/* 078E14 7F0442E4 AFB20020 */ sw $s2, 0x20($sp) -/* 078E18 7F0442E8 AFB1001C */ sw $s1, 0x1c($sp) -/* 078E1C 7F0442EC AFB00018 */ sw $s0, 0x18($sp) -/* 078E20 7F0442F0 8C910004 */ lw $s1, 4($a0) -/* 078E24 7F0442F4 00809025 */ move $s2, $a0 -/* 078E28 7F0442F8 8E220064 */ lw $v0, 0x64($s1) -/* 078E2C 7F0442FC 8E300014 */ lw $s0, 0x14($s1) -/* 078E30 7F044300 304E0004 */ andi $t6, $v0, 4 -/* 078E34 7F044304 51C0000A */ beql $t6, $zero, .L7F044330 -/* 078E38 7F044308 8E05001C */ lw $a1, 0x1c($s0) -/* 078E3C 7F04430C 92260002 */ lbu $a2, 2($s1) -/* 078E40 7F044310 02202025 */ move $a0, $s1 -/* 078E44 7F044314 24050001 */ li $a1, 1 -/* 078E48 7F044318 30CF0004 */ andi $t7, $a2, 4 -/* 078E4C 7F04431C 0FC10366 */ jal objFree -/* 078E50 7F044320 01E03025 */ move $a2, $t7 -/* 078E54 7F044324 10000036 */ b .L7F044400 -/* 078E58 7F044328 8FBF0024 */ lw $ra, 0x24($sp) -/* 078E5C 7F04432C 8E05001C */ lw $a1, 0x1c($s0) -.L7F044330: -/* 078E60 7F044330 30580040 */ andi $t8, $v0, 0x40 -/* 078E64 7F044334 50A00025 */ beql $a1, $zero, .L7F0443CC -/* 078E68 7F044338 924C0001 */ lbu $t4, 1($s2) -/* 078E6C 7F04433C 13000022 */ beqz $t8, .L7F0443C8 -/* 078E70 7F044340 00003025 */ move $a2, $zero -/* 078E74 7F044344 0FC1B198 */ jal sub_GAME_7F06C660 -/* 078E78 7F044348 8E040018 */ lw $a0, 0x18($s0) -/* 078E7C 7F04434C AFA2002C */ sw $v0, 0x2c($sp) -/* 078E80 7F044350 92590001 */ lbu $t9, 1($s2) -/* 078E84 7F044354 37280002 */ ori $t0, $t9, 2 -/* 078E88 7F044358 A2480001 */ sb $t0, 1($s2) -/* 078E8C 7F04435C 8E090008 */ lw $t1, 8($s0) -/* 078E90 7F044360 8524000E */ lh $a0, 0xe($t1) -/* 078E94 7F044364 00045180 */ sll $t2, $a0, 6 -/* 078E98 7F044368 0FC2F5C5 */ jal dynAllocate -/* 078E9C 7F04436C 01402025 */ move $a0, $t2 -/* 078EA0 7F044370 AE02000C */ sw $v0, 0xc($s0) -/* 078EA4 7F044374 8E25006C */ lw $a1, 0x6c($s1) -/* 078EA8 7F044378 8FA4002C */ lw $a0, 0x2c($sp) -/* 078EAC 7F04437C 00403025 */ move $a2, $v0 -/* 078EB0 7F044380 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 078EB4 7F044384 24A50004 */ addiu $a1, $a1, 4 -/* 078EB8 7F044388 8E0B0008 */ lw $t3, 8($s0) -/* 078EBC 7F04438C 02002025 */ move $a0, $s0 -/* 078EC0 7F044390 0FC1BBA9 */ jal sub_GAME_7F06EEA4 -/* 078EC4 7F044394 8D650000 */ lw $a1, ($t3) -/* 078EC8 7F044398 0FC10F5C */ jal handle_thrown_explosive_detonation -/* 078ECC 7F04439C 02402025 */ move $a0, $s2 -/* 078ED0 7F0443A0 8E510020 */ lw $s1, 0x20($s2) -/* 078ED4 7F0443A4 52200016 */ beql $s1, $zero, .L7F044400 -/* 078ED8 7F0443A8 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0443AC: -/* 078EDC 7F0443AC 8E300024 */ lw $s0, 0x24($s1) -/* 078EE0 7F0443B0 0FC110B7 */ jal sub_GAME_7F0442DC -/* 078EE4 7F0443B4 02202025 */ move $a0, $s1 -/* 078EE8 7F0443B8 1600FFFC */ bnez $s0, .L7F0443AC -/* 078EEC 7F0443BC 02008825 */ move $s1, $s0 -/* 078EF0 7F0443C0 1000000F */ b .L7F044400 -/* 078EF4 7F0443C4 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0443C8: -/* 078EF8 7F0443C8 924C0001 */ lbu $t4, 1($s2) -.L7F0443CC: -/* 078EFC 7F0443CC 02402025 */ move $a0, $s2 -/* 078F00 7F0443D0 318DFFFD */ andi $t5, $t4, 0xfffd -/* 078F04 7F0443D4 0FC10F5C */ jal handle_thrown_explosive_detonation -/* 078F08 7F0443D8 A24D0001 */ sb $t5, 1($s2) -/* 078F0C 7F0443DC 8E510020 */ lw $s1, 0x20($s2) -/* 078F10 7F0443E0 52200007 */ beql $s1, $zero, .L7F044400 -/* 078F14 7F0443E4 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0443E8: -/* 078F18 7F0443E8 8E300024 */ lw $s0, 0x24($s1) -/* 078F1C 7F0443EC 0FC11093 */ jal sub_GAME_7F04424C -/* 078F20 7F0443F0 02202025 */ move $a0, $s1 -/* 078F24 7F0443F4 1600FFFC */ bnez $s0, .L7F0443E8 -/* 078F28 7F0443F8 02008825 */ move $s1, $s0 -/* 078F2C 7F0443FC 8FBF0024 */ lw $ra, 0x24($sp) -.L7F044400: -/* 078F30 7F044400 8FB00018 */ lw $s0, 0x18($sp) -/* 078F34 7F044404 8FB1001C */ lw $s1, 0x1c($sp) -/* 078F38 7F044408 8FB20020 */ lw $s2, 0x20($sp) -/* 078F3C 7F04440C 03E00008 */ jr $ra -/* 078F40 7F044410 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif +/** + * Return true if both blocks are not intersecting on the X/Z plane. + * PD: cdBlockExcludesBlockLaterally + */ +bool sub_GAME_7F044414(rect4f* rect1, s32 numvertices0, rect4f* rect2, s32 numvertices1) +{ + f64 diff2; + f64 diff1; + s32 j; + s32 k; + s32 next; + s32 i; + f64 sum3; + f64 sum2; + f64 sum1; + coord3d tmp; + for (i = 0; i < numvertices0; i++) + { + next = (i + 1) % numvertices0; + diff1 = rect1->points[next].y - (f64)rect1->points[i].y; + diff2 = rect1->points[i].x - (f64)rect1->points[next].x; + if (diff1 == 0.0f && diff2 == 0.0f) + { + tmp.x = rect1->points[i].x; + tmp.y = 0.0f; + tmp.z = rect1->points[i].y; + if (chrpropTestPointInPolygon(&tmp, rect2, numvertices1)) + { + return FALSE; + } + } + else + { + sum1 = rect1->points[i].x * diff1 + rect1->points[i].y * diff2; + j = (next + 1) % numvertices0; + while (j != i) + { + sum2 = rect1->points[j].x * diff1 + rect1->points[j].y * diff2; + if (sum2 != sum1) { break; } -#ifdef NONMATCHING -void sub_GAME_7F044414(void) { + j = (j + 1) % numvertices0; + } -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F044414 -/* 078F44 7F044414 27BDFF48 */ addiu $sp, $sp, -0xb8 -/* 078F48 7F044418 AFB50044 */ sw $s5, 0x44($sp) -/* 078F4C 7F04441C AFB20038 */ sw $s2, 0x38($sp) -/* 078F50 7F044420 AFB10034 */ sw $s1, 0x34($sp) -/* 078F54 7F044424 AFB00030 */ sw $s0, 0x30($sp) -/* 078F58 7F044428 00A08025 */ move $s0, $a1 -/* 078F5C 7F04442C 00E08825 */ move $s1, $a3 -/* 078F60 7F044430 00809025 */ move $s2, $a0 -/* 078F64 7F044434 00C0A825 */ move $s5, $a2 -/* 078F68 7F044438 AFBF004C */ sw $ra, 0x4c($sp) -/* 078F6C 7F04443C AFB60048 */ sw $s6, 0x48($sp) -/* 078F70 7F044440 AFB40040 */ sw $s4, 0x40($sp) -/* 078F74 7F044444 AFB3003C */ sw $s3, 0x3c($sp) -/* 078F78 7F044448 F7B80028 */ sdc1 $f24, 0x28($sp) -/* 078F7C 7F04444C F7B60020 */ sdc1 $f22, 0x20($sp) -/* 078F80 7F044450 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 078F84 7F044454 18A0008A */ blez $a1, .L7F044680 -/* 078F88 7F044458 00004025 */ move $t0, $zero -/* 078F8C 7F04445C 4480C000 */ mtc1 $zero, $f24 -/* 078F90 7F044460 4480B800 */ mtc1 $zero, $f23 -/* 078F94 7F044464 4480B000 */ mtc1 $zero, $f22 -/* 078F98 7F044468 00809825 */ move $s3, $a0 -/* 078F9C 7F04446C D7B40088 */ ldc1 $f20, 0x88($sp) -/* 078FA0 7F044470 27B60074 */ addiu $s6, $sp, 0x74 -.L7F044474: -/* 078FA4 7F044474 25140001 */ addiu $s4, $t0, 1 -/* 078FA8 7F044478 0290001A */ div $zero, $s4, $s0 -/* 078FAC 7F04447C 00002810 */ mfhi $a1 -/* 078FB0 7F044480 000570C0 */ sll $t6, $a1, 3 -/* 078FB4 7F044484 024E1021 */ addu $v0, $s2, $t6 -/* 078FB8 7F044488 C4460004 */ lwc1 $f6, 4($v0) -/* 078FBC 7F04448C C6640004 */ lwc1 $f4, 4($s3) -/* 078FC0 7F044490 C44A0000 */ lwc1 $f10, ($v0) -/* 078FC4 7F044494 46003221 */ cvt.d.s $f8, $f6 -/* 078FC8 7F044498 46002021 */ cvt.d.s $f0, $f4 -/* 078FCC 7F04449C C6620000 */ lwc1 $f2, ($s3) -/* 078FD0 7F0444A0 46204301 */ sub.d $f12, $f8, $f0 -/* 078FD4 7F0444A4 16000002 */ bnez $s0, .L7F0444B0 -/* 078FD8 7F0444A8 00000000 */ nop -/* 078FDC 7F0444AC 0007000D */ break 7 -.L7F0444B0: -/* 078FE0 7F0444B0 2401FFFF */ li $at, -1 -/* 078FE4 7F0444B4 16010004 */ bne $s0, $at, .L7F0444C8 -/* 078FE8 7F0444B8 3C018000 */ lui $at, 0x8000 -/* 078FEC 7F0444BC 16810002 */ bne $s4, $at, .L7F0444C8 -/* 078FF0 7F0444C0 00000000 */ nop -/* 078FF4 7F0444C4 0006000D */ break 6 -.L7F0444C8: -/* 078FF8 7F0444C8 46366032 */ c.eq.d $f12, $f22 -/* 078FFC 7F0444CC 24AF0001 */ addiu $t7, $a1, 1 -/* 079000 7F0444D0 460054A1 */ cvt.d.s $f18, $f10 -/* 079004 7F0444D4 46001421 */ cvt.d.s $f16, $f2 -/* 079008 7F0444D8 45000011 */ bc1f .L7F044520 -/* 07900C 7F0444DC 46328381 */ sub.d $f14, $f16, $f18 -/* 079010 7F0444E0 46367032 */ c.eq.d $f14, $f22 -/* 079014 7F0444E4 00000000 */ nop -/* 079018 7F0444E8 4500000D */ bc1f .L7F044520 -/* 07901C 7F0444EC 00000000 */ nop -/* 079020 7F0444F0 E7A20074 */ swc1 $f2, 0x74($sp) -/* 079024 7F0444F4 E7B80078 */ swc1 $f24, 0x78($sp) -/* 079028 7F0444F8 C6640004 */ lwc1 $f4, 4($s3) -/* 07902C 7F0444FC 02C02025 */ move $a0, $s6 -/* 079030 7F044500 02A02825 */ move $a1, $s5 -/* 079034 7F044504 02203025 */ move $a2, $s1 -/* 079038 7F044508 0FC0F336 */ jal chrpropTestPointInPolygon -/* 07903C 7F04450C E7A4007C */ swc1 $f4, 0x7c($sp) -/* 079040 7F044510 50400058 */ beql $v0, $zero, .L7F044674 -/* 079044 7F044514 02804025 */ move $t0, $s4 -/* 079048 7F044518 1000005A */ b .L7F044684 -/* 07904C 7F04451C 00001025 */ move $v0, $zero -.L7F044520: -/* 079050 7F044520 01F0001A */ div $zero, $t7, $s0 -/* 079054 7F044524 462E0182 */ mul.d $f6, $f0, $f14 -/* 079058 7F044528 00001010 */ mfhi $v0 -/* 07905C 7F04452C 00401825 */ move $v1, $v0 -/* 079060 7F044530 00002025 */ move $a0, $zero -/* 079064 7F044534 462C8202 */ mul.d $f8, $f16, $f12 -/* 079068 7F044538 46283080 */ add.d $f2, $f6, $f8 -/* 07906C 7F04453C 16000002 */ bnez $s0, .L7F044548 -/* 079070 7F044540 00000000 */ nop -/* 079074 7F044544 0007000D */ break 7 -.L7F044548: -/* 079078 7F044548 2401FFFF */ li $at, -1 -/* 07907C 7F04454C 16010004 */ bne $s0, $at, .L7F044560 -/* 079080 7F044550 3C018000 */ lui $at, 0x8000 -/* 079084 7F044554 15E10002 */ bne $t7, $at, .L7F044560 -/* 079088 7F044558 00000000 */ nop -/* 07908C 7F04455C 0006000D */ break 6 -.L7F044560: -/* 079090 7F044560 1102001D */ beq $t0, $v0, .L7F0445D8 -/* 079094 7F044564 00000000 */ nop -/* 079098 7F044568 0003C0C0 */ sll $t8, $v1, 3 -.L7F04456C: -/* 07909C 7F04456C 02581021 */ addu $v0, $s2, $t8 -/* 0790A0 7F044570 C44A0004 */ lwc1 $f10, 4($v0) -/* 0790A4 7F044574 C4460000 */ lwc1 $f6, ($v0) -/* 0790A8 7F044578 460054A1 */ cvt.d.s $f18, $f10 -/* 0790AC 7F04457C 46003221 */ cvt.d.s $f8, $f6 -/* 0790B0 7F044580 462E9102 */ mul.d $f4, $f18, $f14 -/* 0790B4 7F044584 00000000 */ nop -/* 0790B8 7F044588 462C4282 */ mul.d $f10, $f8, $f12 -/* 0790BC 7F04458C 462A2500 */ add.d $f20, $f4, $f10 -/* 0790C0 7F044590 4622A032 */ c.eq.d $f20, $f2 -/* 0790C4 7F044594 00000000 */ nop -/* 0790C8 7F044598 4500000F */ bc1f .L7F0445D8 -/* 0790CC 7F04459C 00000000 */ nop -/* 0790D0 7F0445A0 24790001 */ addiu $t9, $v1, 1 -/* 0790D4 7F0445A4 0330001A */ div $zero, $t9, $s0 -/* 0790D8 7F0445A8 00001810 */ mfhi $v1 -/* 0790DC 7F0445AC 16000002 */ bnez $s0, .L7F0445B8 -/* 0790E0 7F0445B0 00000000 */ nop -/* 0790E4 7F0445B4 0007000D */ break 7 -.L7F0445B8: -/* 0790E8 7F0445B8 2401FFFF */ li $at, -1 -/* 0790EC 7F0445BC 16010004 */ bne $s0, $at, .L7F0445D0 -/* 0790F0 7F0445C0 3C018000 */ lui $at, 0x8000 -/* 0790F4 7F0445C4 17210002 */ bne $t9, $at, .L7F0445D0 -/* 0790F8 7F0445C8 00000000 */ nop -/* 0790FC 7F0445CC 0006000D */ break 6 -.L7F0445D0: -/* 079100 7F0445D0 5468FFE6 */ bnel $v1, $t0, .L7F04456C -/* 079104 7F0445D4 0003C0C0 */ sll $t8, $v1, 3 -.L7F0445D8: -/* 079108 7F0445D8 1A200021 */ blez $s1, .L7F044660 -/* 07910C 7F0445DC 00000000 */ nop -/* 079110 7F0445E0 02A01025 */ move $v0, $s5 -.L7F0445E4: -/* 079114 7F0445E4 C4520004 */ lwc1 $f18, 4($v0) -/* 079118 7F0445E8 C4440000 */ lwc1 $f4, ($v0) -/* 07911C 7F0445EC 4622A032 */ c.eq.d $f20, $f2 -/* 079120 7F0445F0 460091A1 */ cvt.d.s $f6, $f18 -/* 079124 7F0445F4 460022A1 */ cvt.d.s $f10, $f4 -/* 079128 7F0445F8 462E3202 */ mul.d $f8, $f6, $f14 -/* 07912C 7F0445FC 00000000 */ nop -/* 079130 7F044600 462C5482 */ mul.d $f18, $f10, $f12 -/* 079134 7F044604 45000003 */ bc1f .L7F044614 -/* 079138 7F044608 46324000 */ add.d $f0, $f8, $f18 -/* 07913C 7F04460C 46201181 */ sub.d $f6, $f2, $f0 -/* 079140 7F044610 46223500 */ add.d $f20, $f6, $f2 -.L7F044614: -/* 079144 7F044614 4622003C */ c.lt.d $f0, $f2 -/* 079148 7F044618 00000000 */ nop -/* 07914C 7F04461C 45020006 */ bc1fl .L7F044638 -/* 079150 7F044620 4620103C */ c.lt.d $f2, $f0 -/* 079154 7F044624 4622A03C */ c.lt.d $f20, $f2 -/* 079158 7F044628 00000000 */ nop -/* 07915C 7F04462C 4501000C */ bc1t .L7F044660 -/* 079160 7F044630 00000000 */ nop -/* 079164 7F044634 4620103C */ c.lt.d $f2, $f0 -.L7F044638: -/* 079168 7F044638 00000000 */ nop -/* 07916C 7F04463C 45020006 */ bc1fl .L7F044658 -/* 079170 7F044640 24840001 */ addiu $a0, $a0, 1 -/* 079174 7F044644 4634103C */ c.lt.d $f2, $f20 -/* 079178 7F044648 00000000 */ nop -/* 07917C 7F04464C 45010004 */ bc1t .L7F044660 -/* 079180 7F044650 00000000 */ nop -/* 079184 7F044654 24840001 */ addiu $a0, $a0, 1 -.L7F044658: -/* 079188 7F044658 1491FFE2 */ bne $a0, $s1, .L7F0445E4 -/* 07918C 7F04465C 24420008 */ addiu $v0, $v0, 8 -.L7F044660: -/* 079190 7F044660 54910004 */ bnel $a0, $s1, .L7F044674 -/* 079194 7F044664 02804025 */ move $t0, $s4 -/* 079198 7F044668 10000006 */ b .L7F044684 -/* 07919C 7F04466C 24020001 */ li $v0, 1 -/* 0791A0 7F044670 02804025 */ move $t0, $s4 -.L7F044674: -/* 0791A4 7F044674 1690FF7F */ bne $s4, $s0, .L7F044474 -/* 0791A8 7F044678 26730008 */ addiu $s3, $s3, 8 -/* 0791AC 7F04467C F7B40088 */ sdc1 $f20, 0x88($sp) -.L7F044680: -/* 0791B0 7F044680 00001025 */ move $v0, $zero -.L7F044684: -/* 0791B4 7F044684 8FBF004C */ lw $ra, 0x4c($sp) -/* 0791B8 7F044688 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0791BC 7F04468C D7B60020 */ ldc1 $f22, 0x20($sp) -/* 0791C0 7F044690 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 0791C4 7F044694 8FB00030 */ lw $s0, 0x30($sp) -/* 0791C8 7F044698 8FB10034 */ lw $s1, 0x34($sp) -/* 0791CC 7F04469C 8FB20038 */ lw $s2, 0x38($sp) -/* 0791D0 7F0446A0 8FB3003C */ lw $s3, 0x3c($sp) -/* 0791D4 7F0446A4 8FB40040 */ lw $s4, 0x40($sp) -/* 0791D8 7F0446A8 8FB50044 */ lw $s5, 0x44($sp) -/* 0791DC 7F0446AC 8FB60048 */ lw $s6, 0x48($sp) -/* 0791E0 7F0446B0 03E00008 */ jr $ra -/* 0791E4 7F0446B4 27BD00B8 */ addiu $sp, $sp, 0xb8 -) -#endif + for (k = 0; k < numvertices1; k++) + { + sum3 = rect2->points[k].x * diff1 + rect2->points[k].y * diff2; + + if (sum2 == sum1) + { + sum2 = sum1 - sum3 + sum1; + } + if (sum3 < sum1 && sum2 < sum1) { break; } + if (sum3 > sum1 && sum2 > sum1) { break; } + } + if (k == numvertices1) + { + return TRUE; + } + } + } + return FALSE; +} /** @@ -7414,7 +5195,7 @@ glabel sub_GAME_7F0448A8 .L7F044900: /* 079430 7F044900 0FC0F2E3 */ jal chraiGetPropRoomIds /* 079434 7F044904 02002825 */ move $a1, $s0 -/* 079438 7F044908 0FC0F8FF */ jal sub_GAME_7F03E3FC +/* 079438 7F044908 0FC0F8FF */ jal roomGetProps /* 07943C 7F04490C 02002025 */ move $a0, $s0 /* 079440 7F044910 3C138007 */ lui $s3, %hi(ptr_list_object_lookup_indices) /* 079444 7F044914 8E739C30 */ lw $s3, %lo(ptr_list_object_lookup_indices)($s3) @@ -8027,93 +5808,2487 @@ glabel sub_GAME_7F044B38 #endif +s32 glassCalculateOpacity(coord3d *pos, f32 xludist, f32 opadist, f32 arg3) +{ + coord3d *campos = &get_curplayer_positiondata()->pos; + s32 opacity; + f32 xdiff = pos->x - campos->x; + f32 ydiff = pos->y - campos->y; + f32 zdiff = pos->z - campos->z; + + f32 distance = sqrtf(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff); + + if (distance > opadist) + { + opacity = 255; + } else if (distance < xludist) + { + opacity = arg3 * 255; + } + else + { + opacity = (((distance - xludist) * (1.0f - arg3)) / (opadist - xludist) + arg3) * 255; + } + return opacity; +} #ifdef NONMATCHING -void sub_GAME_7F0451DC(void) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0451DC -/* 079D0C 7F0451DC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 079D10 7F0451E0 AFBF0014 */ sw $ra, 0x14($sp) -/* 079D14 7F0451E4 AFA5001C */ sw $a1, 0x1c($sp) -/* 079D18 7F0451E8 AFA60020 */ sw $a2, 0x20($sp) -/* 079D1C 7F0451EC AFA70024 */ sw $a3, 0x24($sp) -/* 079D20 7F0451F0 0FC225E6 */ jal get_curplayer_positiondata -/* 079D24 7F0451F4 AFA40018 */ sw $a0, 0x18($sp) -/* 079D28 7F0451F8 8FA40018 */ lw $a0, 0x18($sp) -/* 079D2C 7F0451FC C4460008 */ lwc1 $f6, 8($v0) -/* 079D30 7F045200 C44A000C */ lwc1 $f10, 0xc($v0) -/* 079D34 7F045204 C4840000 */ lwc1 $f4, ($a0) -/* 079D38 7F045208 C4880004 */ lwc1 $f8, 4($a0) -/* 079D3C 7F04520C C4520010 */ lwc1 $f18, 0x10($v0) -/* 079D40 7F045210 46062001 */ sub.s $f0, $f4, $f6 -/* 079D44 7F045214 C4900008 */ lwc1 $f16, 8($a0) -/* 079D48 7F045218 460A4081 */ sub.s $f2, $f8, $f10 -/* 079D4C 7F04521C 46000102 */ mul.s $f4, $f0, $f0 -/* 079D50 7F045220 46128381 */ sub.s $f14, $f16, $f18 -/* 079D54 7F045224 46021182 */ mul.s $f6, $f2, $f2 -/* 079D58 7F045228 46062200 */ add.s $f8, $f4, $f6 -/* 079D5C 7F04522C 460E7282 */ mul.s $f10, $f14, $f14 -/* 079D60 7F045230 0C007DF8 */ jal sqrtf -/* 079D64 7F045234 460A4300 */ add.s $f12, $f8, $f10 -/* 079D68 7F045238 C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 079D6C 7F04523C C7A2001C */ lwc1 $f2, 0x1c($sp) -/* 079D70 7F045240 8FBF0014 */ lw $ra, 0x14($sp) -/* 079D74 7F045244 4600603C */ c.lt.s $f12, $f0 -/* 079D78 7F045248 00000000 */ nop -/* 079D7C 7F04524C 45020004 */ bc1fl .L7F045260 -/* 079D80 7F045250 4602003C */ c.lt.s $f0, $f2 -/* 079D84 7F045254 1000001C */ b .L7F0452C8 -/* 079D88 7F045258 240300FF */ li $v1, 255 -/* 079D8C 7F04525C 4602003C */ c.lt.s $f0, $f2 -.L7F045260: -/* 079D90 7F045260 C7AE0024 */ lwc1 $f14, 0x24($sp) -/* 079D94 7F045264 C7B00024 */ lwc1 $f16, 0x24($sp) -/* 079D98 7F045268 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 079D9C 7F04526C 4502000A */ bc1fl .L7F045298 -/* 079DA0 7F045270 44815000 */ mtc1 $at, $f10 -/* 079DA4 7F045274 3C01437F */ li $at, 0x437F0000 # 255.000000 -/* 079DA8 7F045278 44819000 */ mtc1 $at, $f18 -/* 079DAC 7F04527C 00000000 */ nop -/* 079DB0 7F045280 46128102 */ mul.s $f4, $f16, $f18 -/* 079DB4 7F045284 4600218D */ trunc.w.s $f6, $f4 -/* 079DB8 7F045288 44033000 */ mfc1 $v1, $f6 -/* 079DBC 7F04528C 1000000F */ b .L7F0452CC -/* 079DC0 7F045290 00601025 */ move $v0, $v1 -/* 079DC4 7F045294 44815000 */ mtc1 $at, $f10 -.L7F045298: -/* 079DC8 7F045298 46020201 */ sub.s $f8, $f0, $f2 -/* 079DCC 7F04529C 3C01437F */ li $at, 0x437F0000 # 255.000000 -/* 079DD0 7F0452A0 460E5401 */ sub.s $f16, $f10, $f14 -/* 079DD4 7F0452A4 46026101 */ sub.s $f4, $f12, $f2 -/* 079DD8 7F0452A8 46104482 */ mul.s $f18, $f8, $f16 -/* 079DDC 7F0452AC 44814000 */ mtc1 $at, $f8 -/* 079DE0 7F0452B0 46049183 */ div.s $f6, $f18, $f4 -/* 079DE4 7F0452B4 460E3280 */ add.s $f10, $f6, $f14 -/* 079DE8 7F0452B8 46085402 */ mul.s $f16, $f10, $f8 -/* 079DEC 7F0452BC 4600848D */ trunc.w.s $f18, $f16 -/* 079DF0 7F0452C0 44039000 */ mfc1 $v1, $f18 -/* 079DF4 7F0452C4 00000000 */ nop -.L7F0452C8: -/* 079DF8 7F0452C8 00601025 */ move $v0, $v1 -.L7F0452CC: -/* 079DFC 7F0452CC 03E00008 */ jr $ra -/* 079E00 7F0452D0 27BD0018 */ addiu $sp, $sp, 0x18 -) -#endif +// version US defines +#define AUTOGUN_P1_ACCEL 0.000011635529f +#define AUTOGUN_P1_DECEL AUTOGUN_P1_ACCEL +#define AUTOGUN_P1_MAXSPEED 0.00069813174f +#define AUTOGUN_P2_ACCEL 0.0000058177643f +#define AUTOGUN_P2_DECEL AUTOGUN_P1_ACCEL +#define AUTOGUN_P2_MAXSPEED 0.00034906587f +// https://decomp.me/scratch/c9RKZ 65.91% +s32 object_interaction(struct PropRecord *arg0) +{ + struct coord3d sp694; + s32 sp690; + struct PropRecord *sp684; + s32 sp680; + f32 sp67C; + s32 sp674; + s32 sp670; + s32 sp678; + s32 sp664; + struct coord3d sp658; + struct coord3d sp64C; + struct WeaponObjRecord *sp648; + struct ModelRoData_BoundingBoxRecord * sp640; + f32 sp63C; + f32 sp638; + struct coord3d sp62C; + struct coord3d sp620; + struct coord3d sp614; + s32 sp610; + s32 sp60C; + // missing: sp608 + s32 sp604; + struct coord3d sp5CC; + Mtxf *sp58C; + struct coord3d sp564; + f32 sp550[4]; //quatf + struct ModelRoData_BoundingBoxRecord *sp54C; + s32 sp548; + struct coord3d sp53C; + struct coord3d sp530; + f32 sp518; + struct PropRecord* sp514; + struct coord3d sp5xx; // temp variable, unknown stack position + struct StandTile *sp4F0; + f32 sp4D8; + f32 sp4D4; + struct coord3d sp4BC; + f32 sp4B8; + f32 sp4B4; + f32 sp4B0; + s32 sp4AC; + s32 sp4A8; + s32 sp4A4; + f32 sp4A0; + f32 sp49C; + f32 sp498; + f32 sp494; + struct StandTile *sp490; + + f32 sp47C; + struct coord3d *sp478; + struct StandTile *sp468; + f32 sp460; + struct coord3d sp450; + struct StandTile *sp44C; + f32 sp444; + f32 sp440; + f32 sp43C; + f32 sp438; + f32 sp434; + f32 sp430; + f32 sp42C; + f32 sp424; + f32 sp420; + f32 sp418; + f32 sp414; + f32 sp40C; + f32 sp408; + f32 sp400; + Mtxf sp3A4; + struct DoorRecord *sp39C; + f32 sp394; + Mtxf *sp390; + s32 sp38C; + f32 sp384; + f32 sp380; + struct CCTVRecord *sp370; + struct coord3d sp360; + Mtxf sp320; + struct AutogunRecord *sp318; + struct coord3d sp308; + f32 sp304; + f32 sp300; + Mtxf *sp2FC; + s32 sp2F8; + Mtxf sp2AC; + Mtxf sp26C; + struct coord3d *sp260; + struct coord3d *sp25C; + struct coord3d *sp258; + struct coord3d *sp254; + f32 sp250; + f32 sp24C; + f32 sp248; + Mtxf sp200; + struct coord3d *sp1FC; + struct unk_joint_list sp1B0; + Mtxf sp16C; + struct coord3d *sp168; + struct coord3d *sp164; + struct coord3d *sp160; + struct coord3d *sp15C; + struct ModelRoData_BoundingBoxRecord *sp158; + f32 sp154; + s32 sp13C; + s32 sp138; + struct coord3d sp12C; + struct coord3d sp120; + s32 sp11C; + struct coord3d sp110; + struct StandTile *sp10C; + struct StandTile *sp108; + s32 sp104; + struct PropRecord* sp100; + Mtxf spB8; + f32 sp94; + struct beam *beam; //sp90 + + Mtxf *sp70; /* compiler-managed */ + Mtxf *sp6C; + + struct ObjectRecord *obj; + struct Model *model; -#ifdef NONMATCHING -void object_interaction(void) { + f32 temp_f12; + s32 var_s2_2; + s32 var_a0; + struct StandTile *temp_s2; + f32 temp_f14_2; + Mtxf *temp_s2_4; + f32 temp_f14_3; + f32 temp_f20; + f32 temp_f14_4; + struct ALSoundState * sfx_state; + s32 var_s2_3; + f32 temp_f12_5; + s32 var_v1_3; + f32 temp_f0_13; // ~ sp510 + s32 var_s2_4; + f32 var_f2; + f32 temp_f0_14; + f32 var_f12; + f32 var_f2_3; + struct PropRecord *temp_v0_19; + f32 var_f12_3; + s32 var_v0_3; + f32 var_f0_2; + f32 var_f12_5; + f32 var_f2_6; + f32 temp_f0_22; + s32 var_v1_5; + s32 var_s0; + f32 *temp_s0_5; + f32 *temp_v0_25; + s32 var_s2_5; + f32 var_f12_6; + s32 var_s0_2; + struct Model *temp_s0_6; + struct PadRecord *var_v1_4; + struct ModelFileHeader *temp_v0_29; + s32 var_s2_6; + struct ModelFileHeader *temp_v0_31; + Mtxf *temp_a1_4; + Mtxf *temp_s0_10; + f32 temp_f0_31; + s32 temp_v0_32; + Mtxf *temp_a1_6; + f32 var_f12_7; + struct coord3d *temp_s0_13; + struct coord3d *temp_s0_14; + struct ModelNode** temp_v1_7; + f32 var_f0_3; + f32 *temp_v0_40; + ModelNode **var_v1_7; + Mtxf *temp_s0_21; + ModelNode **temp_v1_8; + f32 var_f12_9; + s32 var_a0_6; + ModelNode **temp_v1_10; + Mtxf *temp_s2_7; + struct coord3d *temp_v1_11; + struct coord3d temp_fc3d_a; + struct coord3d temp_fc3d_b; + f32 temp_f20_4; + f32 temp_f0_35; + f32 var_f2_7; + f32 temp_f2_23; + f32 var_f4; + + obj = arg0->obj; + model = obj->model; + + sp690 = 0; + sp680 = 0; + sp67C = 0.0f; + sp674 = getPlayerCount(); + sp670 = 1; + + if (obj->runtime_bitflags & RUNTIMEBITFLAG_REMOVE) + { + objFree(obj, 0, obj->state & RUNTIMEBITFLAG_REMOVE); + + return 1; + } + else if (obj->runtime_bitflags & RUNTIMEBITFLAG_ISRETICK) + { + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_ISRETICK; + } + else if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) + { + arg0->flags &= 0xFFFD; + obj->runtime_bitflags |= RUNTIMEBITFLAG_ISRETICK; + + return 3; + } + + if (sp674 == 1) + { + sp678 = 1; + } + else + { + sp678 = sub_GAME_7F09B4D8(get_cur_playernum()) == 0; + + if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) + { + if (obj->projectile->ownerprop != NULL) + { + sp678 = g_CurrentPlayer->prop == obj->projectile->ownerprop; + } + } + } + + // mips2c line 559 + if (sp678) + { + if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) + { + struct Projectile *temp_s0 = obj->projectile; + + temp_s0->unkE0 += g_ClockTimer; + + if (temp_s0->unkE0 > 2400) + { + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; + } + + if (temp_s0->flags & 0x100) + { + struct PropRecord *projectile_prop; + + s32 var_s2 = 1; + + sp648 = (struct WeaponObjRecord *)obj; + + if (obj->type == PROPDEF_COLLECTABLE && sp648->weaponnum == ITEM_NULL86) + { + var_s2 = 0; + } + + projectile_prop = temp_s0->ownerprop; + + if (projectile_prop != NULL) + { + sub_GAME_7F03D058(projectile_prop, 0); + } + + sp664 = sub_GAME_7F042EB4(obj, &temp_s0->unkd4, &sp64C, &sp658, 0, var_s2); + + if (projectile_prop != NULL) + { + sub_GAME_7F03D058(projectile_prop, 1); + } + + if ((sp664 != 1) && (sp648 != NULL) && sp648->weaponnum == ITEM_NULL86) + { + sp648->timer = 0; + } + + temp_s0->flags &= ~0x100; + } + + sp694.f[0] = obj->runtime_pos.f[0]; + sp694.f[1] = obj->runtime_pos.f[1]; + sp694.f[2] = obj->runtime_pos.f[2]; + + if (temp_s0->refreshrate > 0) + { + temp_s0->refreshrate -= g_ClockTimer; + } + + // mips2c line 608 + if (obj->projectile->flags & 1) + { + struct WeaponObjRecord *temp_s1 = (struct WeaponObjRecord *)obj; + + sp640 = sub_GAME_7F040078(obj); + sp610 = 0; + sp60C = 0; + sp604 = 0; + sp638 = 1.0f; + temp_f20 = obj->runtime_pos.f[1]; + + var_s2_2 = 0; + + temp_s0->unkA8 += g_ClockTimer; + + sp62C.f[0] = obj->mtx.m[0][0]; + sp62C.f[1] = obj->mtx.m[0][1]; + sp62C.f[2] = obj->mtx.m[0][2]; + + if (temp_s0->flags & 0x20) + { + if (temp_s0->unk1C < (10.0f/360.0f)) + { + temp_s0->unkB4 += temp_s0->unk10.f[1] * g_GlobalTimerDelta; + temp_s0->unkB0 += temp_s0->unkB4 * g_GlobalTimerDelta; + temp_s0->unk1C += ((1.0f/90.0f) * g_GlobalTimerDelta); + + if (temp_s0->unk1C > (10.0f/360.0f)) + { + temp_s0->unk1C = (10.0f/360.0f); + } + } + else + { + if (sp694.f[1] < temp_s0->unkB0) + { + temp_s0->unkB4 += temp_s0->unk10.f[1] * g_GlobalTimerDelta; + temp_s0->unkB0 += (temp_s0->unkB4 * g_GlobalTimerDelta); + sp694.f[1] += 0.07f * (temp_s0->unkB0 - sp694.f[1]) * g_GlobalTimerDelta; + } + else + { + sp694.f[1] = temp_s0->unkB0; + temp_s0->flags &= ~0x20; + temp_s0->flags |= 0x10; + temp_s0->unk1C = 0.0f; + temp_s0->speed.f[1] = temp_s0->unkB4; + } + } + } + + if (!(temp_s0->flags & 0x10)) + { + temp_s0->speed.f[1] += (temp_s0->unk10.f[1] + temp_s0->unk1C) * g_GlobalTimerDelta; + temp_f12 = temp_s0->speed.f[1]; + temp_s0->speed.f[1] -= (0.2777778f * g_GlobalTimerDelta); + sp694.f[1] += g_GlobalTimerDelta * (temp_f12 + temp_s0->speed.f[1]) * 0.5f; + } + else + { + temp_s0->speed.f[1] += (temp_s0->unk10.f[1] + temp_s0->unk1C) * g_GlobalTimerDelta; + sp694.f[1] += temp_s0->speed.f[1] * g_GlobalTimerDelta; + } + + sp70 = &obj->mtx; + sp6C = &obj->mtx; + + temp_s0->speed.f[0] += temp_s0->unk10.f[0] * g_GlobalTimerDelta; + temp_s0->speed.f[2] += temp_s0->unk10.f[2] * g_GlobalTimerDelta; + + sp694.f[0] += temp_s0->speed.f[0] * g_GlobalTimerDelta; + sp694.f[2] += temp_s0->speed.f[2] * g_GlobalTimerDelta; + + sub_GAME_7F057DF8(sp70, sp6C, g_ClockTimer, &g_ClockTimer); + + if ((obj->type == PROPDEF_COLLECTABLE) && (((temp_s1->weaponnum == 0x1D)) || (temp_s1->weaponnum == 0x1B) || (temp_s1->weaponnum == 0x1C) || (temp_s1->weaponnum == 0x21) || (temp_s1->weaponnum == 0x2F) || (temp_s1->weaponnum == 0x30) || (temp_s1->weaponnum == 0x22))) + { + var_s2_2 = 1; + } + + if (temp_s0->ownerprop != NULL) + { + sub_GAME_7F03D058(temp_s0->ownerprop, 0); + } + + sp664 = sub_GAME_7F042EB4(obj, &sp694.f[0], &sp614, &sp620, var_s2_2, 0); + + if (temp_s0->ownerprop != NULL) + { + sub_GAME_7F03D058(temp_s0->ownerprop, 1); + } + + sp690 = 1; + + // mps2c line 696 + if ((sp664 == 2) && ((D_80030B0C == NULL) || (((D_80030B0C->type != 3)) && (D_80030B0C->type != 6)))) + { + var_a0 = 0; + + if ((D_80030B0C != NULL) && (D_80030B0C->obj->runtime_bitflags & 0x80)) + { + var_a0 = 1; + } + + if (var_a0 == 0) + { + projectileFree(temp_s0); + + obj->projectile = NULL; + obj->runtime_bitflags &= ~0x80; + + if (arg0->flags & 8) + { + arg0->flags |= 0x10; + } + + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, ATTACH_MINE_SFX, NULL), &arg0->pos); + sub_GAME_7F0577E8(((struct WeaponObjRecord *)obj)->weaponnum, arg0->stan->room); + sub_GAME_7F0439B8(obj, &sp614, arg0->stan, &sp620); + + if (D_80030B0C != NULL) + { + temp_s2 = arg0->stan; + + if (objEmbed(arg0, D_80030B0C, objinst, dword_CODE_bss_80075B74) != 0) + { + arg0->stan = temp_s2; + sp680 = 5; + sp604 = 1; + } + } + } + } + + // mpis2c line 728 + if (sp604 == 0) + { + if ((D_80030B0C != NULL) && (obj->type == PROPDEF_COLLECTABLE)) + { + struct WeaponObjRecord *temp_weap = (struct WeaponObjRecord *)obj; + + if (temp_weap->weaponnum == ITEM_THROWKNIFE) + { + if (D_80030B0C->type != 3) + { + if (D_80030B0C->type == 6 && D_80030B0C->obj != NULL) + { + if (getPlayerPointerIndex(D_80030B0C) != get_cur_playernum()) + { + //goto block_77; + } + } + } + else + { +//block_77:; + struct Projectile *temp_v0_8 = obj->projectile; + + if ((temp_v0_8->flags & 1) + && ((s32) temp_v0_8->unk90 <= 0) + && (obj->runtime_bitflags & 0x20) + && (handles_shot_actors(D_80030B0C->chr, bodypartshot, &flt_CODE_bss_80075B78, ((struct WeaponObjRecord *)obj)->weaponnum, 1) != 0)) + { + sp604 = 1; + + if (temp_s0->unk8C > 0.0f) + { + temp_f14_2 = ((sp620.f[2] * temp_s0->speed.f[2]) + ((temp_s0->speed.f[0] * sp620.f[0]) + (temp_s0->speed.f[1] * sp620.f[1]))) * -(temp_s0->unk8C + 1.0f); + temp_s0->speed.f[0] = temp_s0->speed.f[0] + (temp_f14_2 * sp620.f[0]); + temp_s0->speed.f[1] = temp_s0->speed.f[1] + (temp_f14_2 * sp620.f[1]); + temp_s0->speed.f[2] = temp_s0->speed.f[2] + (temp_f14_2 * sp620.f[2]); + } + + if (!(temp_s0->flags & 0x200)) + { + mtxLoadRandomRotation(sp6C); + } + + temp_s0->unk90 += 1; + recall_joy2_hits_edit_detail_edit_flag(((struct WeaponObjRecord *)obj)->weaponnum, D_80030B0C, -1); + + if ((D_80030B0C->flags & 2) && (bodypartshot != 0x64) && (bodypartshot != 0x6E)) + { + temp_s2_4 = modelFindNodeMtx(objinst, dword_CODE_bss_80075B74, 0); + + sp5CC.f[0] = sp614.f[0]; + sp5CC.f[1] = sp614.f[1]; + sp5CC.f[2] = sp614.f[2]; + mtx4TransformVecInPlace(camGetWorldToScreenMtxf(), &sp5CC); + + sp5CC.f[0] += ((sp5CC.f[0] - temp_s2_4->m[3][0]) * 0.5f); + sp5CC.f[1] += ((sp5CC.f[1] - temp_s2_4->m[3][1]) * 0.5f); + sp5CC.f[2] += ((sp5CC.f[2] - temp_s2_4->m[3][2]) * 0.5f); + + sp5CC.f[0] -= (getjointsize(objinst, dword_CODE_bss_80075B74) * 0.5f * flt_CODE_bss_80075B88.f[0]); + sp5CC.f[1] -= (getjointsize(objinst, dword_CODE_bss_80075B74) * 0.5f * flt_CODE_bss_80075B78.f[0]); + sp5CC.f[2] -= (getjointsize(objinst, dword_CODE_bss_80075B74) * 0.5f * flt_CODE_bss_80075B88.f[0]); + + matrix_4x4_7F059E64(temp_s2_4, sp58C); + mtx4TransformVecInPlace(sp58C, &sp5CC); + sub_GAME_7F0221DC(objinst, bodypartshot, dword_CODE_bss_80075B74, &sp5CC); + } + } + } + } + // mips2c line 795 + else if (temp_weap->weaponnum == ITEM_NULL86) + { + if (D_80030B0C->type == PROP_TYPE_CHR) + { + sp604 = 1; + chrlvExplosionDamage((ChrRecord *) D_80030B0C->chr, &obj->runtime_pos, 2.0f, 1); + } + else if ((D_80030B0C->type == PROP_TYPE_OBJ) || (D_80030B0C->type == PROP_TYPE_WEAPON)) + { + maybe_detonate_object(D_80030B0C->obj, 100.0f, &obj->runtime_pos, ITEM_NULL86, (s32) ((u32) (obj->runtime_bitflags & RUNTIMEBITFLAG_OWNER) >> RUNTIMEBITSHIFT_OWNER)); + } + + ((struct WeaponObjRecord *)obj)->timer = 0; + } + } + } + + // mips2c line 811 + if (sp604 == 0) + { + if (sp664 == 0) + { + if (temp_s0->unk8C > 0.0f) + { + temp_f14_3 = ((sp620.f[2] * temp_s0->speed.f[2]) + ((temp_s0->speed.f[0] * sp620.f[0]) + (temp_s0->speed.f[1] * sp620.f[1]))) * -(temp_s0->unk8C + 1.0f); + + temp_s0->speed.f[0] += (temp_f14_3 * sp620.f[0]); + temp_s0->speed.f[1] += (temp_f14_3 * sp620.f[1]); + temp_s0->speed.f[2] += (temp_f14_3 * sp620.f[2]); + + if ((temp_s0->speed.f[1] <= 0.0f) && ((temp_s0->speed.f[1] >= 0.0f) || (temp_f20 <= obj->runtime_pos.f[1]))) + { + sp60C = 1; + } + } + } + + // mips2c line 832 + if (!(temp_s0->flags & 8)) + { + sp63C = stanGetPositionYValue(arg0->stan, arg0->pos.f[0], arg0->pos.f[2]); + sp638 = chrpropSumMatrixPosY(sp640, &sp70[0]); + sp610 = (arg0->pos.f[1] < (sp63C - sp638)); + } + + if ((sp610 != 0) || (sp664 == 0)) + { + if (!(temp_s0->flags & 0x200)) + { + mtxLoadRandomRotation(sp6C); + } + + temp_s0->unk90 += 1; + } + + if ((sp610 != 0) || (sp60C != 0)) + { + if (sp610 != 0) + { + arg0->pos.f[1] = (sp63C - sp638) + 4.0f; + obj->runtime_pos.f[1] = arg0->pos.f[1]; + } + else + { + arg0->pos.f[1] = (sp614.f[1] - sp638) + 4.0f; + obj->runtime_pos.f[1] = arg0->pos.f[1]; + } + + if (!(obj->runtime_bitflags & 0x10000)) + { + obj->runtime_bitflags |= 0x100; + } + + if (temp_s0->unk8C > 0.0f) + { + temp_s0->speed.f[1] *= -temp_s0->unk8C; + if (temp_s0->speed.f[1] < 2.2222223f) + { + if ((temp_s0->flags & 2) && (temp_s0->unk90 == 1)) + { + temp_s0->speed.f[1] = 2.2222223f; + } + else + { + sub_GAME_7F0431E4(obj, &sp62C); + } + } + } + else + { + sub_GAME_7F0431E4(obj, &sp62C); + } + } + + //mips2c line 892 + if (obj->type == 8) + { + if (temp_s1->weaponnum == 3) + { + sub_GAME_7F043650(temp_s1); + } + else if (temp_s1->weaponnum == 0x56) + { + if ((sp664 == 0) || (sp610 != 0)) + { + temp_s1->timer = 0; + } + else + { + temp_f14_4 = (temp_s0->speed.f[2] * temp_s0->speed.f[2]) + ((temp_s0->speed.f[0] * temp_s0->speed.f[0]) + (temp_s0->speed.f[1] * temp_s0->speed.f[1])); + if (temp_f14_4 > 27777.773f) + { + temp_s0->unk10.f[0] = 0.0f; + temp_s0->unk10.f[1] = 0.0f; + temp_s0->unk10.f[2] = 0.0f; + } + if ((s32) temp_s0->unkA8 >= 0x12D) + { + temp_s0->unk1C = 0.0f; + temp_s0->flags &= ~0x30; + } + else + { + sub_GAME_7F09E700(&temp_s1->runtime_pos, arg0->stan, 8, arg0->rooms, (arg0->flags & 8) != 0); + } + } + } + else if (temp_s1->weaponnum == 0x57) + { + if ((sp610 != 0) || (sp60C != 0)) + { + temp_s1->timer = 0; + } + else + { + sub_GAME_7F09E700(&obj->runtime_pos, arg0->stan, 9, arg0->rooms, (arg0->flags & 8) != 0); + } + } + + if ((sp664 == 0) || (sp610 != 0)) + { + if (temp_s0->unkAC < (D_80048380 - 2)) + { + if ((temp_s1->weaponnum == 3) || (temp_s1->weaponnum == 2)) + { + sfx_state = sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, KNIFE_HIT_WALL_SFX, NULL); + } + else + { + sfx_state = sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DROP_GUN_SFX, NULL); + } + + chrobjSndCreatePostEventDefault(sfx_state, &arg0->pos); + } + + temp_s0->unkAC = D_80048380; + } + } + } + + // mips2c line 960 + if ((temp_s1->runtime_bitflags & 0x80) && (temp_s0->flags & 0x400) && !(D_80048380 & 7)) + { + struct PropRecord *temp_v0_13 = temp_s1->prop; + + sp564.f[0] = temp_s1->runtime_pos.f[0] + 400.0f; + sp564.f[1] = temp_s1->runtime_pos.f[1] - 1800.0f; + sp564.f[2] = temp_s1->runtime_pos.f[2]; + + if (!(D_80048380 & 0xF)) + { + sp564.f[2] += 400.0f; + } + else + { + sp564.f[2] -= 400.0f; + } + + + // void explosionCreate(void *, struct coord3d *pos, struct StandTile *stan, s16 /* enum EXPLOSION_DEF */ explosionType, s32 flag, s32 playernum, u8 *rooms, s32 flag2); + explosionCreate(NULL, &sp564, temp_v0_13->stan, 0x14, 0, 0, temp_v0_13->rooms, 0); + if (((s32) D_80048380 % 40) == 0) + { + // void sub_GAME_7F09E700(coord3d *pos, StandTile *stan, s16 arg2, u8 *rooms, s32 arg4); + sub_GAME_7F09E700(&sp564, temp_v0_13->stan, 0xA, temp_v0_13->rooms, 1); + } + } + } + // mips2c line 982 + else + { + var_s2_3 = 1; + + if (temp_s0->unk60 < 1.0f) + { + temp_s0->unk60 += (temp_s0->unk64 * g_GlobalTimerDelta); + + if (g_ClockTimer > 0) + { + temp_s0->unk64 *= 1.1f; + } + + if ((temp_s0->unk60 > 1.0f) || (temp_s0->flags & 8)) + { + temp_s0->unk60 = 1.0f; + } + + //void quaternion_slerp(quatf q1, quatf q2, f32 t, quatf result); + quaternion_slerp((f32*)&temp_s0->unk68, (f32*)&temp_s0->unk78, temp_s0->unk60, (f32*)&sp550); + sp70 = &obj->mtx; + + // void quaternion_to_matrix(quatf q, mat44f matrix); + quaternion_to_matrix((f32*)&sp550, (f32*)&obj->mtx); + matrix_column_1_scalar_multiply(temp_s0->unkC0, (f32*)sp70); + matrix_column_2_scalar_multiply(temp_s0->unkC4, (f32*)sp70); + matrix_column_3_scalar_multiply_2(temp_s0->unkC8, (f32*)sp70); + var_s2_3 = 0; + } + + if (((temp_s0->speed.f[0] != 0.0f) || (temp_s0->speed.f[2] != 0.0f) || (temp_s0->unk60 < 1.0f)) && !(temp_s0->flags & 8)) + { + sp70 = &obj->mtx; + var_s2_3 = 0; + sp54C = sub_GAME_7F040078(obj); + + for (sp548 = 0; sp548 < g_ClockTimer; sp548++) + { + sp694.f[0] += temp_s0->speed.f[0]; + sp694.f[2] += temp_s0->speed.f[2]; + + if (temp_s0->unk60 >= 1.0f) + { + if (temp_s0->unk94 > 0.0f) + { + temp_f12_5 = (temp_s0->unk94 * g_GlobalTimerDelta) / sqrtf((temp_s0->speed.f[2] * temp_s0->speed.f[2]) + (temp_s0->speed.f[0] * temp_s0->speed.f[0])); + + if (temp_f12_5 >= 1.0f) + { + temp_s0->speed.f[0] = 0.0f; + temp_s0->speed.f[2] = 0.0f; + } + else + { + temp_s0->speed.f[0] -= (temp_s0->speed.f[0] * temp_f12_5); + temp_s0->speed.f[2] -= (temp_s0->speed.f[2] * temp_f12_5); + } + } + else + { + temp_s0->speed.f[0] *= 0.9f; + temp_s0->speed.f[2] *= 0.9f; + } + } + } + + // s32 sub_GAME_7F042EB4(struct ObjectRecord *arg0, f32 *arg1, struct coord3d *arg2, struct coord3d *arg3, s32 arg4, s32 arg5); + sub_GAME_7F042EB4(obj, &sp694.f[0], &sp530, &sp53C, 0, 0); + sp690 = 1; + + arg0->pos.f[1] = stanGetPositionYValue(arg0->stan, arg0->pos.f[0], arg0->pos.f[2]) - (chrpropSumMatrixPosY(sp54C, sp70) + 4.0f); + obj->runtime_pos.f[1] = arg0->pos.f[1]; + + + if ((temp_s0->speed.f[0] < 0.1f) && (temp_s0->speed.f[0] > -0.1f)) + { + if ((temp_s0->speed.f[2] < 0.1f) && (temp_s0->speed.f[2] > -0.1f)) + { + temp_s0->speed.f[2] = 0.0f; + temp_s0->speed.f[0] = 0.0f; + } + } + } + + if ((var_s2_3 != 0) || (temp_s0->flags & 8)) + { + projectileFree(temp_s0); + + obj->projectile = NULL; + obj->runtime_bitflags &= ~0x80; + + if (arg0->flags & 8) + { + arg0->flags |= 0x10; + } + } + } + } + + // mips2c line 1081 + if (sp690 != 0) + { + sp70 = (Mtxf *)&obj->runtime_pos; + chrobjCollisionRelated(obj); + setupUpdateObjectRoomPosition(obj); + sub_GAME_7F0402B4(obj->prop, &obj->nextcol); + detonate_proxmine_In_range((struct coord3d *)sp70); + } + + // mips2c line 1090 + if (obj->type == PROPDEF_DOOR) + { + struct DoorRecord *door = (struct DoorRecord *)arg0->obj; + + sp67C = door->openPosition; + + if ((door->openedTime > 0) && (door->openedTime < (g_GlobalTimer - door->autoCloseFrames)) && (door->openstate == DOORSTATE_STATIONARY) && !(door->flags & 0x80000000)) + { + doorActivate(door, DOORSTATE_CLOSING); + } + + if (door->openstate == DOORSTATE_WAITING) + { + struct DoorRecord *linked_door = door->linkedDoor; + + var_v1_3 = 1; + + while ((linked_door != NULL) && (linked_door != door)) + { + if ((linked_door->openstate != DOORSTATE_STATIONARY) || (linked_door->openPosition > 0.0f)) + { + var_v1_3 = 0; + } + + linked_door = linked_door->linkedDoor; + } + + if (var_v1_3 != 0) + { + doorSetOpenState(door, DOORSTATE_OPENING); + } + } + + if ((door->doorType == 8) && (doorIsClosed(door) != 0) && (doorIsPadlockFree(door) != 0)) + { + doorActivateWrapper(arg0); + } + + if ((door->timer < g_GlobalTimer) || (g_ClockTimer == 0)) + { + sub_GAME_7F054FB4(door); + } + } + // mips2c line 1130 + else if (obj->type == PROPDEF_CCTV && !(obj->flags & PROPFLAG_CCTV_DISABLED)) + { + struct CCTVRecord *camera = (struct CCTVRecord *)arg0->obj; + // camera is temp_s0_3 + + if (camera->unkD4 != 0) + { + sp518 = camera->unkCC; + } + else + { + sp518 = camera->unkD0; + } + + sp514 = get_curplayer_positiondata(); + + temp_f0_13 = camera->unkE8; + var_s2_4 = 1; + sp5xx.f[0] = sp514->pos.f[0] - obj->runtime_pos.f[0]; + sp5xx.f[1] = sp514->pos.f[1] - obj->runtime_pos.f[1]; + sp5xx.f[2] = sp514->pos.f[2] - obj->runtime_pos.f[2]; + + if ((temp_f0_13 > 0.0f) && ((temp_f0_13 * temp_f0_13) < ((sp5xx.f[0] * sp5xx.f[0]) + (sp5xx.f[1] * sp5xx.f[1]) + (sp5xx.f[2] * sp5xx.f[2])))) + { + var_s2_4 = 0; + } + + if (obj->flags & 0x20000000) + { + var_s2_4 = 0; + } + + if (var_s2_4 != 0) + { + temp_f0_14 = atan2f(sp5xx.f[0], sp5xx.f[2]); + + var_f2 = camera->unkC8; + + if ( var_f2 < 0.0f) + { + var_f2 += 6.2831855f; + } + else if (var_f2 >= 6.2831855f) + { + var_f2 -= 6.2831855f; + } + + var_f2 += camera->unkC4; + if (var_f2 >= 6.2831855f) + { + var_f2 -= 6.2831855f; + } + + var_f12 = temp_f0_14 - var_f2; + + if (temp_f0_14 < var_f2) + { + var_f12 += 6.2831855f; + } + + var_f12 -= 3.1415927f; + + if (var_f12 < 0.0f) + { + var_f12 += 6.2831855f; + } + + if (var_f12 > 3.1415927f) + { + var_f12 -= 6.2831855f; + } + + if ((var_f12 > 0.7853982f) || (var_f12 < -0.7853982f)) + { + var_s2_4 = 0; + } + } + + if (var_s2_4 != 0) + { + sp4F0 = arg0->stan; + bondviewUpdateGuardTankFlagsRelated(sp514, 0); + + if (stanTestLineUnobstructed(&sp4F0, arg0->pos.f[0], arg0->pos.f[2], sp514->pos.f[0], sp514->pos.f[2], 0x1B, 100.0f, 100.0f, 0.0f, 1.0f) != 0) + { + camera->timer += g_ClockTimer; + + if (camera->timer >= (s32) (300.0f * F_80030B14)) + { + alarmActivate(); + camera->timer = 0; + } + } + + bondviewUpdateGuardTankFlagsRelated(sp514, 1); + } + + if (camera->unkC8 < sp518) + { + if ((sp518 - ((camera->unkD8 * camera->unkD8 * 0.5f) / 0.00065449846f)) <= camera->unkC8) + { + camera->unkD8 = (f32) (camera->unkD8 - (0.00065449846f * g_GlobalTimerDelta)); + + if (camera->unkD8 < 0.00065449846f) + { + camera->unkD8 = 0.00065449846f; + } + } + else + { + if (camera->unkD8 < camera->unkDC) + { + var_f2_3 = camera->unkD8 + (0.00065449846f * g_GlobalTimerDelta); + + if (camera->unkDC < var_f2_3) + { + var_f2_3 = camera->unkDC; + } + + if (camera->unkC8 < (sp518 - ((var_f2_3 * var_f2_3 * 0.5f) / 0.00065449846f))) + { + camera->unkD8 = var_f2_3; + } + } + } + + camera->unkC8 += (camera->unkD8 * g_GlobalTimerDelta); + + if (sp518 <= camera->unkC8) + { + camera->unkC8 = sp518; + camera->unkD8 = 0.0f; + camera->unkD4 = 0; + } + } + else + { + if (camera->unkC8 <= (sp518 + ((camera->unkD8 * camera->unkD8 * 0.5f) / 0.00065449846f))) + { + camera->unkD8 = (f32) (camera->unkD8 - (0.00065449846f * g_GlobalTimerDelta)); + + if (camera->unkD8 < 0.00065449846f) + { + camera->unkD8 = 0.00065449846f; + } + } + else + { + if (camera->unkD8 < camera->unkDC) + { + var_f2_3 = camera->unkD8 + (0.00065449846f * g_GlobalTimerDelta); + + if (camera->unkDC < var_f2_3) + { + var_f2_3 = camera->unkDC; + } + + if ((sp518 + ((var_f2_3 * var_f2_3 * 0.5f) / 0.00065449846f)) < camera->unkC8) + { + camera->unkD8 = var_f2_3; + } + } + } + + camera->unkC8 -= (camera->unkD8 * g_GlobalTimerDelta); + + if (camera->unkC8 <= sp518) + { + camera->unkC8 = sp518; + camera->unkD8 = 0.0f; + camera->unkD4 = 1; + } + } + } + // mips2c line 1286 + else if (obj->type == PROPDEF_AUTOGUN && !(obj->flags & PROPFLAG_IS_DRONE_GUN)) + { + struct AutogunRecord *autogun = (struct AutogunRecord*)arg0->obj; + // autogun is temp_s0_4 + + temp_v0_19 = get_curplayer_positiondata(); + sp4AC = 0; + sp4A8 = 0; + sp4A4 = 0; + + if (obj->flags2 & 0x80000000) + { + if (obj->flags2 & 0x40000000) + { + autogun->rot_related = autogun->unk90; + autogun->unk98 = autogun->unk9C; + } + else if ((autogun->rot_related == autogun->unk90) && (autogun->unk98 == autogun->unk9C)) + { + autogun->unk98 = (((( RANDOMGETNEXT_F32() * 39.0f) + 1.0f) * 6.2831855f) / 360.0f); + autogun->rot_related = (RANDOMGETNEXT_F32() * 6.2831855f); + } + + chrobjCallsApplySpeed(&autogun->unk90, autogun->rot_related, &autogun->unk94, AUTOGUN_P1_ACCEL, AUTOGUN_P1_DECEL, AUTOGUN_P1_MAXSPEED); + chrobjCallsApplySpeed(&autogun->unk9C, autogun->unk98, &autogun->unkA0, AUTOGUN_P2_ACCEL, AUTOGUN_P2_DECEL, AUTOGUN_P2_MAXSPEED); + } + else + { + // mips2c line 1317 + sp4BC.f[2] = temp_v0_19->pos.f[0] - obj->runtime_pos.f[0]; + sp4BC.f[1] = (temp_v0_19->pos.f[1] - obj->runtime_pos.f[1]) - 20.0f; + sp4BC.f[0] = temp_v0_19->pos.f[2] - obj->runtime_pos.f[2]; + + sp4B8 = (sp4BC.f[2] * sp4BC.f[2]) + (sp4BC.f[0] * sp4BC.f[0]); + + sp4B0 = sqrtf(sp4B8); + + if (obj->flags & 0x08000000) + { + sp4B8 += (sp4BC.f[1] * sp4BC.f[1]); + sp4B0 = sqrtf(sp4B8); + } + + sp4B4 = sp4B0; + + sp4A0 = chrlvGetAimLimitAngle(sp4B8); + sp4D8 = autogun->rot_related; + sp4D4 = autogun->unk98; + + if (sp4B4 <= autogun->aimdist) + { + // mips2c line 1339 + sp49C = atan2f(sp4BC.f[2], sp4BC.f[0]); + sp498 = atan2f(sp4BC.f[1], sp4B0); + + if ((obj->flags & 0x40000000) || (obj->flags & 0x20000000)) + { + sp4AC = 1; + } + else + { + var_f12_3 = sp49C - autogun->unk90; + + if (var_f12_3 < 0.0f) + { + var_f12_3 += 6.2831855f; + } + + if (var_f12_3 > 3.1415927f) + { + var_f12_3 -= 6.2831855f; + } + + if ((sp498 - autogun->unk9C) < 0.0f) + { + // empty + } + + if ((var_f12_3 < 1.2217306f) && (var_f12_3 > -1.2217306f)) + { + sp4AC = 1; + } + } + + if (sp4AC != 0) + { + sp494 = sp49C - autogun->rot_related; + sp490 = arg0->stan; + if (sp494 < -3.1415927f) + { + sp494 += 6.2831855f; + } + else if (sp494 >= 3.1415927f) + { + sp494 -= 6.2831855f; + } + + bondviewUpdateGuardTankFlagsRelated(temp_v0_19, 0); + + if ((sp494 <= autogun->unk88) + && (autogun->unk8C <= sp494) + && (sub_GAME_7F0B0E24(&sp490, arg0->pos.f[0], arg0->pos.f[2], temp_v0_19->pos.f[0], temp_v0_19->pos.f[2], 0x1B, arg0->pos.f[1], arg0->pos.f[1], temp_v0_19->pos.f[1], temp_v0_19->pos.f[1]) != 0) + && (sp490 == temp_v0_19->stan)) + { + obj->flags |= 0x20000000; + sp4A4 = 1; + sp4D8 = sp49C; + sp4D4 = sp498; + } + else + { + if ((autogun->unkB8 >= 0) && ((g_GlobalTimer - 0x78) < autogun->unkB8)) + { + sp4D8 = autogun->unk90; + sp4D4 = autogun->unk9C; + } + else + { + sp4AC = 0; + } + } + + bondviewUpdateGuardTankFlagsRelated(temp_v0_19, 1); + } + } + + if (sp4AC != 0) + { + sp4A0 = chrlvGetAimLimitAngle(sp4B8); + } + + if (autogun->is_active != 0) + { + sp4D8 += sp4A0 * 0.8f * sinf(((f32) ((s32) g_GlobalTimer % 120) * 6.2831855f) / 120.0f); + + if (sp4D8 < 0.0f) + { + sp4D8 += 6.2831855f; + } + + if (sp4D8 >= 6.2831855f) + { + sp4D8 -= 6.2831855f; + } + } + + // mips2c linee 1427 + + var_f0_2 = sp4D8 - autogun->rot_related; + + if (var_f0_2 < -3.1415927f) + { + var_f0_2 += 6.2831855f; + } + else if (var_f0_2 >= 3.1415927f) + { + var_f0_2 -= 6.2831855f; + } + + if (autogun->unk88 < var_f0_2 || var_f0_2 < autogun->unk8C) + { + sp4D8 = autogun->rot_related + autogun->unk8C; + } + + if (sp4D8 < 0.0f) + { + sp4D8 += 6.2831855f; + } + + if (sp4D8 >= 6.2831855f) + { + sp4D8 -= 6.2831855f; + } + + chrobjCallsApplySpeed(&autogun->unk90, sp4D8, &autogun->unk94, 0.0008726647f, 0.0008726647f, autogun->speed); + chrobjCallsApplySpeed(&autogun->unk9C, sp4D4, &autogun->unkA0, 0.0008726647f, 0.0008726647f, autogun->speed); + + var_f12_5 = sp4D8 - autogun->unk90; + + if (var_f12_5 < 0.0f) + { + var_f12_5 += 6.2831855f; + } + + if (var_f12_5 > 3.1415927f) + { + var_f12_5 -= 6.2831855f; + } + + var_f2_6 = sp4D4 - autogun->unk9C; + + if (var_f2_6 < 0.0f) + { + var_f2_6 += 6.2831855f; + } + + if (var_f2_6 > 3.1415927f) + { + var_f2_6 -= 6.2831855f; + } + + autogun->is_active = 0; + + if (sp4AC != 0) + { + if ((var_f12_5 < sp4A0) + && (-sp4A0 < var_f12_5) + && (var_f2_6 < sp4A0) + && (-sp4A0 < var_f2_6)) + { + autogun->is_active = 1; + sp4A8 = 1; + + if (sp4A4 != 0) + { + autogun->unkB8 = (s32) g_GlobalTimer; + autogun->unkBC = (s32) g_GlobalTimer; + } + } + else + { + temp_f0_22 = 2.0f * sp4A0; + + if ((var_f12_5 < temp_f0_22) + && (-temp_f0_22 < var_f12_5) + && (var_f2_6 < temp_f0_22) + && (-temp_f0_22 < var_f2_6)) + { + autogun->is_active = 1; + sp4A8 = 1; + if (sp4A4 != 0) + { + autogun->unkB8 = (s32) g_GlobalTimer; + } + } + else + { + if ((autogun->unkB8 >= 0) && ((g_GlobalTimer - 0x78) < autogun->unkB8)) + { + autogun->is_active = 1; + sp4A8 = 1; + } + } + } + } + if (sp4A8 != 0) + { + autogun->unkB0 += (0.009973311f * g_GlobalTimerDelta); + + if (autogun->unkB0 > 0.5983986f) + { + autogun->unkB0 = 0.5983986f; + } + } + else if (autogun->unkB0 > 0.0f) + { + for (var_v0_3 = 0; var_v0_3 < g_ClockTimer; var_v0_3++) + { + autogun->unkB0 *= 0.99f; + } + + if (autogun->unkB0 <= 0.0001f) + { + autogun->unkB0 = 0.0f; + } + } + if (autogun->unkB0 > 0.0f) + { + autogun->unkB4 += (autogun->unkB0 * g_GlobalTimerDelta); + + while (autogun->unkB4 >= 6.2831855f) + { + autogun->unkB4 -= 6.2831855f; + } + } + } + } + // mips2c line 1550 + else if (obj->type == PROPDEF_VEHICHLE) + { + struct VehichleRecord *temp_s1 = (struct VehichleRecord *)obj; + + sp478 = NULL; + sp47C = temp_s1->roty; + + ai((PropDefHeaderRecord*)temp_s1, 1); + + if (temp_s1->speedtime60 >= 0.0f) + { + if (temp_s1->speedtime60 <= g_GlobalTimerDelta) + { + temp_s1->speed = temp_s1->speedaim; + } + else + { + temp_s1->speed += (((temp_s1->speedaim - temp_s1->speed) * g_GlobalTimerDelta) / temp_s1->speedtime60); + } + + temp_s1->speedtime60 -= g_GlobalTimerDelta; + } + + var_s0 = 0; + + // mips2c line 1570 + + if (!(obj->flags2 & 0x80000) && (objIsHealthy(obj) != 0) && ((temp_s1->speed > 0.0f) || (temp_s1->speedaim > 0.0f))) + { + var_s0 = sub_GAME_7F053894(&temp_s1->runtime_pos, 2000.0f, 3000.0f); + } + + if (var_s0 > 0) + { + if (((temp_s1->Sound == NULL) || (sndGetPlayingState(temp_s1->Sound) == 0)) && (lvlGetControlsLockedFlag() == 0)) + { + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, TRUCK_RUN_SFX, temp_s1->Sound); + } + + if (temp_s1->Sound != NULL) + { + sndCreatePostEvent(temp_s1->Sound, 8, var_s0); + } + } + else + { + if ((temp_s1->Sound != NULL) && (sndGetPlayingState(temp_s1->Sound) != 0)) + { + sndDeactivate(temp_s1->Sound); + } + } + + // mips2c line 1595 + + if (temp_s1->path != NULL) + { + sp478 = &g_CurrentSetup.pads[g_CurrentSetup.pathwaypoints[temp_s1->path->waypoints[temp_s1->nextstep]].padID].pos; + + sp47C = atan2f(sp478->f[0] - temp_s1->runtime_pos.f[0], sp478->f[2] - temp_s1->runtime_pos.f[2]); + + if (temp_s1->flags & 0x20000000) + { + temp_s1->roty = sp47C; + temp_s1->flags &= 0xDFFFFFFF; + sub_GAME_7F044B38(temp_s1); + } + } + else if (temp_s1->flags & 0x20000000) + { + temp_s1->roty = atan2f(temp_s1->mtx.m[2][0], temp_s1->mtx.m[2][2]); + temp_s1->flags &= 0xDFFFFFFF; + sub_GAME_7F044B38(temp_s1); + } + + // mips2c line 1614 + if (temp_s1->speed > 0.0f) + { + sp430 = 0.0f; + + sp468 = arg0->stan; + sp438 = temp_s1->roty; + sp434 = temp_s1->turnrot60; + + if (sp478 != NULL) + { + sp430 = 0.0f; + sp43C = sinf(sp438); + sp440 = 0.0f; + sp444 = cosf(temp_s1->roty); + + if (chrlvGeometryRelated7F02FC34(&temp_s1->runtime_pos, (struct coord3d *) &sp43C, sp478, 10.0f) != 0) + { + sp47C = temp_s1->roty; + } + } + + chrobjCallsApplySpeed(&temp_s1->roty, sp47C, &temp_s1->turnrot60, 0.000109083085f, 0.00021816617f, 0.006544985f); + + while (temp_s1->roty >= 6.2831855f) + { + temp_s1->roty -= 6.2831855f; + } + + while (temp_s1->roty < 0.0f) + { + temp_s1->roty += 6.2831855f; + } + + if (sp47C == temp_s1->roty) + { + if ((temp_s1->turnrot60 <= 0.00021816617f) && (temp_s1->turnrot60 >= -0.00021816617f)) + { + temp_s1->turnrot60 = 0.0f; + } + } + + temp_s0_5 = (f32*)model->obj->Switches[3]->Data; + + if (g_GlobalTimerDelta > 0.0f) + { + sp430 = (temp_s1->roty - sp438) / g_GlobalTimerDelta; + } + if (sp430 < 0.0f) + { + sp430 += 6.2831855f; + } + + sp460 = sinf(sp430) * (temp_s0_5[2] * model->scale) * g_GlobalTimerDelta; + sp43C = sinf(temp_s1->roty); + sp440 = 0.0f; + sp444 = cosf(temp_s1->roty); + sp694.f[0] = (temp_s1->runtime_pos.f[0] + (temp_s1->speed * g_GlobalTimerDelta * sp43C)) - (sp444 * sp460); + sp694.f[1] = temp_s1->runtime_pos.f[1]; + sp694.f[2] = (sp43C * sp460) + (temp_s1->runtime_pos.f[2] + (temp_s1->speed * g_GlobalTimerDelta * sp444)); + + if ((sub_GAME_7F0B0E24(&sp468, arg0->pos.f[0], arg0->pos.f[2], sp694.f[0], sp694.f[2], 0x1F, 0.0f, 1.0f, 0.0f, 1.0f) != 0) + && (sub_GAME_7F0B18B8(&sp468, sp694.f[0], sp694.f[2], 10.0f, 0x1F, 0.0f, 1.0f) < 0)) + { + sp44C = arg0->stan; + sp450.f[0] = arg0->pos.f[0]; + sp450.f[1] = arg0->pos.f[1]; + sp450.f[2] = arg0->pos.f[2]; + arg0->stan = sp468; + arg0->pos.f[0] = sp694.f[0]; + temp_s1->runtime_pos.f[0] = sp694.f[0]; + arg0->pos.f[2] = sp694.f[2]; + temp_s1->runtime_pos.f[2] = sp694.f[2]; + chrobjCollisionRelated(obj); + setupUpdateObjectRoomPosition(obj); + var_s2_5 = sub_GAME_7F0448A8(arg0); + + if (var_s2_5 != 0) + { + temp_v0_25 = (f32*)model->obj->Switches[7]->Data; + sp424 = temp_s1->mtx.m[0][0] * temp_v0_25[1]; + sp42C = temp_s1->mtx.m[0][2] * temp_v0_25[1]; + sp418 = temp_s1->mtx.m[0][0] * temp_v0_25[2]; + sp420 = temp_s1->mtx.m[0][2] * temp_v0_25[2]; + sp40C = temp_s1->mtx.m[2][0] * temp_v0_25[5]; + sp414 = temp_s1->mtx.m[2][2] * temp_v0_25[5]; + sp400 = temp_s1->mtx.m[2][0] * temp_v0_25[6]; + sp408 = temp_s1->mtx.m[2][2] * temp_v0_25[6]; + sp468 = arg0->stan; + // temp_f0_25 = arg0->pos.f[0] + //temp_f2_13 = arg0->pos.f[2] + + // temp_f0_26 = arg0->pos.f[0]; + // temp_f2_14 = arg0->pos.f[2] + // temp_f0_27 = arg0->pos.f[0] + sp418, + // temp_f2_15 = arg0->pos.f[2] + sp420 + // temp_f0_28 = arg0->pos.f[0], + // temp_f2_16 = arg0->pos.f[2] + // temp_f0_29 = arg0->pos.f[0] + sp424, + // temp_f2_17 = arg0->pos.f[2] + sp42C, + + if ((walkTilesBetweenPoints_NoCallback(&sp468, arg0->pos.f[0], arg0->pos.f[2], sp40C + (arg0->pos.f[0] + sp424), sp414 + (arg0->pos.f[2] + sp42C)) == 0) + || (walkTilesBetweenPoints_NoCallback(&sp468, sp40C + (arg0->pos.f[0] + sp424), sp414 + (arg0->pos.f[2] + sp42C), sp40C + (arg0->pos.f[0] + sp418), sp414 + (arg0->pos.f[2] + sp420)) == 0) + || (walkTilesBetweenPoints_NoCallback(&sp468, sp40C + arg0->pos.f[0] + sp418, sp414 + arg0->pos.f[2] + sp420, sp400 + arg0->pos.f[0] + sp418, sp408 + arg0->pos.f[2] + sp420) == 0) + || (walkTilesBetweenPoints_NoCallback(&sp468, sp400 + (arg0->pos.f[0] + sp418), sp408 + (arg0->pos.f[2] + sp420), sp400 + (arg0->pos.f[0] + sp424), sp408 + (arg0->pos.f[2] + sp42C)) == 0) + || (walkTilesBetweenPoints_NoCallback(&sp468, sp400 + arg0->pos.f[0] + sp424, sp408 + arg0->pos.f[2] + sp42C, sp40C + arg0->pos.f[0] + sp424, sp414 + arg0->pos.f[2] + sp42C) == 0)) + { + var_s2_5 = 0; + } + } + + if (var_s2_5 != 0) + { + sub_GAME_7F044B38(temp_s1); + sub_GAME_7F0402B4(arg0, &temp_s1->nextcol); + detonate_proxmine_In_range(&temp_s1->runtime_pos); + + if ((sp478 != NULL) + && (chrlvIsArrivingLaterallyAtPos(&sp450, &sp694, sp478, 100.0f) != 0)) + { + temp_s1->nextstep++; + if (temp_s1->path[temp_s1->nextstep].waypoints[0] < 0) + { + temp_s1->path = NULL; + temp_s1->speedaim = 0.0f; + temp_s1->speedtime60 = 60.0f; + } + } + } + else + { + if (temp_s1->speedtime60 < 0.0f) + { + temp_s1->speedaim = (f32) temp_s1->speed; + temp_s1->speedtime60 = 60.0f; + } + + temp_s1->speed = 0.0f; + temp_s1->roty = sp438; + temp_s1->turnrot60 = sp434; + arg0->stan = sp44C; + arg0->pos.f[0] = sp450.f[0]; + obj->runtime_pos.f[0] = sp450.f[0]; + arg0->pos.f[1] = sp450.f[1]; + obj->runtime_pos.f[1] = sp450.f[1]; + arg0->pos.f[2] = sp450.f[2]; + obj->runtime_pos.f[2] = sp450.f[2]; + + chrobjCollisionRelated(obj); + setupUpdateObjectRoomPosition(obj); + } + } + else + { + if (temp_s1->speedtime60 < 0.0f) + { + temp_s1->speedaim = (f32) temp_s1->speed; + temp_s1->speedtime60 = 60.0f; + } + + temp_s1->speed = 0.0f; + temp_s1->roty = sp438; + temp_s1->turnrot60 = sp434; + } + } + else if (temp_s1->flags & 0x20000000) + { + temp_s1->roty = atan2f(temp_s1->mtx.m[2][0], temp_s1->mtx.m[2][2]); + temp_s1->flags &= 0xDFFFFFFF; + sub_GAME_7F044B38(temp_s1); + } + } + // mips2c line 1754 + else if (obj->type == PROPDEF_AIRCRAFT) + { + struct AircraftRecord *temp_s1 = (struct AircraftRecord*)obj; + + ai((PropDefHeaderRecord*)temp_s1, 1); + + temp_s0_6 = temp_s1->model; + + if (temp_s0_6->anim != NULL) + { + setsuboffset(temp_s0_6, &temp_s1->runtime_pos); + + if (temp_s0_6->anim == animation_table_ptrs2[AIRCRAFT_ANIMATION_plane_runway]) + { + sub_GAME_7F06CE84(temp_s0_6, 10.438f); + setsubroty(temp_s1->model, 3.1415927f); + } + else if (bossGetStageNum() == LEVELID_STATUE) + { + sub_GAME_7F06CE84(temp_s1->model, 1.0438f); + setsubroty(temp_s1->model, 2.3561945f); + } + else if (bossGetStageNum() == LEVELID_FRIGATE) + { + sub_GAME_7F06CE84(temp_s1->model, 1.0438f); + setsubroty(temp_s1->model, 3.9269907f); + } + else + { + sub_GAME_7F06CE84(temp_s1->model, 1.0438f); + setsubroty(temp_s1->model, 0.0f); + } + + modelTickAnimQuarterSpeed(temp_s1->model, g_ClockTimer, 1); + subcalcpos(temp_s1->model); + getsuboffset(temp_s1->model, &temp_s1->runtime_pos); + arg0->pos.f[0] = temp_s1->runtime_pos.f[0]; + arg0->pos.f[2] = temp_s1->runtime_pos.f[2]; + + if (isNotBoundPad(temp_s1->pad)) + { + var_v1_4 = &g_CurrentSetup.pads[temp_s1->pad]; + } + else + { + var_v1_4 = (PadRecord *)&g_CurrentSetup.boundpads[getBoundPadNum(temp_s1->pad)]; + } + + arg0->pos.f[1] = temp_s1->runtime_pos.f[1] + var_v1_4->pos.f[1]; + temp_s1->runtime_pos.f[1] = arg0->pos.f[1]; + setsuboffset(temp_s1->model, &temp_s1->runtime_pos); + } + + var_f12_6 = temp_s1->speedtime60; + + if (var_f12_6 >= 0.0f) + { + if (var_f12_6 <= g_GlobalTimerDelta) + { + var_f12_6 = temp_s1->speedtime60; + temp_s1->speed = (f32) temp_s1->speedaim; + } + else + { + temp_s1->speed += (((temp_s1->speedaim - temp_s1->speed) * g_GlobalTimerDelta) / var_f12_6); + } + temp_s1->speedtime60 = (f32) (var_f12_6 - g_GlobalTimerDelta); + } + + if (temp_s1->rotaryspeedtime >= 0.0f) + { + if (temp_s1->rotaryspeedtime <= g_GlobalTimerDelta) + { + temp_s1->rotaryspeed = (f32) temp_s1->rotaryspeedaim; + } + else + { + var_f12_6 = temp_s1->rotaryspeed; + temp_s1->rotaryspeed += (((temp_s1->rotaryspeedaim - temp_s1->rotaryspeed) * g_GlobalTimerDelta) / temp_s1->rotaryspeedtime); + } + + temp_s1->rotaryspeedtime -= g_GlobalTimerDelta; + } + + var_s0_2 = 0; + + if (!(temp_s1->flags2 & 0x80000) + && (objIsHealthy(obj) != 0) + && (temp_s1->rotaryspeed != 0.0f) + && !(temp_s1->flags & 0x20000000)) + { + var_s0_2 = sub_GAME_7F053894(&temp_s1->runtime_pos, 5000.0f, 6000.0f); + } + + if (var_s0_2 > 0) + { + if (((temp_s1->Sound == NULL) || (sndGetPlayingState(temp_s1->Sound) == 0)) && (lvlGetControlsLockedFlag() == 0)) + { + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, HELI_RUN_SFX, temp_s1->Sound); + } + + if (temp_s1->Sound != NULL) + { + sndCreatePostEvent(temp_s1->Sound, 8, var_s0_2); + } + } + else + { + if ((temp_s1->Sound != NULL) && (sndGetPlayingState(temp_s1->Sound) != 0)) + { + sndDeactivate(temp_s1->Sound); + } + } + } + } + + // mips2c line 1860 + if (obj->type == PROPDEF_TINTED_GLASS) + { + struct TintedGlassRecord *tinted_glass = (struct TintedGlassRecord *)arg0->obj; + + tinted_glass->calculatedopacity = glassCalculateOpacity( + &obj->runtime_pos, + tinted_glass->TintDist, + tinted_glass->CullDist, + tinted_glass->unk90); + + if ((tinted_glass->unk8C >= 0) && (sp674 == 1)) + { + if (tinted_glass->calculatedopacity == 0xFF) + { + bgToggleDataPortalsContrlBytes1Bit1(tinted_glass->unk8C, 0); + } + else + { + bgToggleDataPortalsContrlBytes1Bit1(tinted_glass->unk8C, 1); + } + } + + sp670 = 0; + } + // mips2c line 1879 + else if (obj->type == PROPDEF_DOOR && ((struct DoorRecord*)obj)->doorFlags & 0x2) + { + struct DoorRecord *door = (struct DoorRecord *)arg0->obj; + + var_s2_6 = 1; + door->calculatedopacity = glassCalculateOpacity(&obj->runtime_pos, door->TintDist, door->CullDist, 0.0f); + + if (sp674 == 1) + { + if ((door->calculatedopacity != 0xFF) || (door->openPosition > 0.0f)) + { + var_s2_6 = 0; + } + + temp_v0_29 = model->obj; + + if ((&skeleton_door == temp_v0_29->Skeleton) + && ((modelGetNodeRwData(model, temp_v0_29->Switches[0]))->Header.unk00 == 0)) + { + var_s2_6 = 0; + } + + if (var_s2_6 != 0) + { + doorDeactivatePortal(door); + } + else + { + doorActivatePortal(door); + } + } + } + + // mips2c line 1905 + if (obj->type == PROPDEF_TANK && (get_ptr_for_players_tank() == arg0)) + { + var_v1_5 = 1; + } + else + { + if (obj->flags2 & 0x04000000) + { + var_v1_5 = 1; + } + else + { + var_v1_5 = 0; + + if (!(obj->runtime_bitflags & 0x800) && !(obj->flags2 & 0x80000)) + { + var_v1_5 = sub_GAME_7F054D6C(arg0, &obj->runtime_pos, getinstsize(model), sp670); + } + } + } + + // mips2c line 1926 + if (var_v1_5 != 0) + { + if (sp678 != 0) + { + update_color_shading(&obj->shadecol, &obj->nextcol); + } + + arg0->flags |= 2; + model->render_pos = dynAllocate(model->obj->numMatrices << 6); + // model->render_pos = temp_v0_30 + + if (obj->type == PROPDEF_DOOR) + { + sp39C = (struct DoorRecord *)arg0->obj; + + sub_GAME_7F0526EC(sp39C, (Mtxf *)model->render_pos); + matrix_4x4_multiply_homogeneous_in_place(camGetWorldToScreenMtxf(), (Mtxf *)model->render_pos); + + temp_v0_31 = model->obj; + + if (&skeleton_eyelid_door == temp_v0_31->Skeleton) + { + temp_a1_4 = &model->render_pos[1].pos; + temp_s0_10 = (Mtxf *)temp_v0_31->Switches[0]->Data; + + sp394 = 6.2831855f - ((sp39C->openPosition * 6.2831855f) / 360.0f); + + matrix_4x4_set_rotation_around_x(sp394, temp_a1_4); + matrix_4x4_set_position((struct coord3d *)temp_s0_10, temp_a1_4); + matrix_4x4_multiply_in_place((Mtxf *)model->render_pos, temp_a1_4); + + temp_a1_4 = &model->render_pos[2].pos; + temp_s0_10 = (Mtxf *)temp_v0_31->Switches[1]->Data; + + matrix_4x4_set_rotation_around_x(6.2831855f - sp394, temp_a1_4); + matrix_4x4_set_position((struct coord3d *)temp_s0_10, temp_a1_4); + matrix_4x4_multiply_in_place((Mtxf *)model->render_pos, temp_a1_4); + } + else if (&skeleton_iris_door == temp_v0_31->Skeleton) + { + sp384 = (sp39C->openPosition * 6.2831855f) / 360.0f; + + temp_f0_31 = sp39C->maxFrac * 0.3f; + if (temp_f0_31 < sp39C->openPosition) + { + sp380 = (((sp39C->maxFrac * (sp39C->openPosition - temp_f0_31)) / (sp39C->maxFrac - temp_f0_31)) * 6.2831855f) / 360.0f; + + if (sp678 != 0) + { + if (sp67C <= temp_f0_31) + { + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, METAL_SLIDE_OPEN_SFX, NULL), &arg0->pos); + } + } + } + else + { + sp380 = 0.0f; + + if (sp678 != 0) + { + if (temp_f0_31 < sp67C) + { + chrobjSndCreatePostEventDefault(sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, METAL_SLIDE_CLOSE_SFX, NULL), &arg0->pos); + } + } + } + + for (sp38C = 0; sp38C < 6; sp38C++) + { + temp_v0_32 = sp38C * 2; + + sp390 = (Mtxf *)model->obj->Switches[temp_v0_32 + 1]->Data; + temp_a1_6 = &model->render_pos[temp_v0_32 + 1].pos; + matrix_4x4_set_rotation_around_z(sp380, temp_a1_6); + matrix_4x4_set_position((struct coord3d *)sp390, temp_a1_6); + matrix_4x4_multiply_in_place((Mtxf *)model->render_pos, temp_a1_6); + + sp390 = (Mtxf *)model->obj->Switches[temp_v0_32 + 2]->Data; + temp_a1_6 = &model->render_pos[temp_v0_32 + 2].pos; + matrix_4x4_set_rotation_around_z(sp384, temp_a1_6); + matrix_4x4_set_position((struct coord3d *)sp390, temp_a1_6); + matrix_4x4_multiply_in_place(temp_a1_6, temp_a1_6); + } + } + } + // mips2c line 2018 + else + { + matrix_4x4_copy(&obj->mtx, &sp3A4); + matrix_4x4_set_position(&obj->runtime_pos, &sp3A4); + matrix_4x4_multiply_homogeneous(camGetWorldToScreenMtxf(), &sp3A4, model->render_pos); + + if (obj->type == PROPDEF_CCTV) + { + struct CCTVRecord *sp370 = (struct CCTVRecord *)arg0->obj; + + var_f12_7 = sp370->unkC8; + temp_s0_13 = (struct coord3d *)model->obj->Switches[0]->Data; + + if (var_f12_7 < 0.0f) + { + var_f12_7 += 6.2831855f; + } + else if (var_f12_7 >= 6.2831855f) + { + var_f12_7 -= 6.2831855f; + } + + matrix_4x4_set_rotation_around_y(var_f12_7, &sp320); + + matrix_4x4_multiply(&sp320, &sp370->unk84, &model->render_pos[1].pos); + + sp360.f[0] = temp_s0_13->f[0]; + sp360.f[1] = temp_s0_13->f[1]; + sp360.f[2] = temp_s0_13->f[2]; + + mtx4TransformVecInPlace(&sp3A4, &sp360); + matrix_4x4_set_position(&sp360, &model->render_pos[1].pos); + matrix_4x4_multiply_homogeneous_in_place(camGetWorldToScreenMtxf(), &model->render_pos[1].pos); + } + // mips2c line 2050 + else if (obj->type == PROPDEF_AUTOGUN) + { + struct AutogunRecord *sp318 = (struct AutogunRecord *)arg0->obj; + + sp304 = sp318->unk90 + 1.5707964f; + sp300 = -sp318->unk9C; + if (sp304 >= 6.2831855f) + { + sp304 -= 6.2831855f; + } + + temp_s0_14 = model->obj->Switches[1]->Data; + sp308.f[0] = temp_s0_14->f[0]; + sp308.f[1] = temp_s0_14->f[1]; + sp308.f[2] = temp_s0_14->f[2]; + mtx4TransformVecInPlace(&sp3A4, &sp308); + matrix_4x4_set_rotation_around_y(sp304, &model->render_pos[1].pos); + matrix_4x4_set_position(&sp308, &model->render_pos[1].pos); + matrix_scalar_multiply(sp318->model->scale, sp6C->m[0]); + matrix_4x4_multiply_homogeneous_in_place(camGetWorldToScreenMtxf(), sp6C); + + matrix_4x4_set_rotation_around_z(sp300, &model->render_pos[2].pos); + matrix_4x4_set_position((struct coord3d*)model->obj->Switches[2]->Data, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous_in_place(sp6C, &model->render_pos[2].pos); + + if (model->obj->Switches[3] != NULL) + { + sp2FC = modelFindNodeMtx(model, model->obj->Switches[3], 0); + matrix_4x4_set_rotation_around_x(sp318->unkB4, sp2FC); + matrix_4x4_set_position(model->obj->Switches[3]->Data, sp2FC); + matrix_4x4_multiply_homogeneous_in_place(model->obj->Switches[2]->Data, sp2FC); + } + + if (model->obj->Switches[4] != NULL) + { + sp2FC = modelFindNodeMtx(model, model->obj->Switches[4], 0); + matrix_4x4_set_identity_and_position(model->obj->Switches[4]->Data, sp2FC); + matrix_4x4_multiply_homogeneous_in_place(model->obj->Switches[2]->Data, sp2FC); + } + + if (model->obj->Switches[7] != NULL) + { + sp2FC = modelFindNodeMtx(model, model->obj->Switches[7], 0); + matrix_4x4_set_rotation_around_x(sp318->unkB4, sp2FC); + matrix_4x4_set_position(model->obj->Switches[7]->Data, sp2FC); + matrix_4x4_multiply_homogeneous_in_place(model->obj->Switches[2]->Data, sp2FC); + } + } + // mips2c line 2065 + else if (obj->type == PROPDEF_COLLECTABLE) + { + for (sp2F8 = 1; sp2F8 < model->obj->numMatrices; sp2F8++) + { + matrix_4x4_set_identity(&model->render_pos[sp2F8].pos); + } + } + // mips2c line 2081 + else if (obj->type == PROPDEF_RACK) + { + matrix_4x4_set_identity_and_position(model->obj->Switches[0]->Data, &model->render_pos[1].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[1].pos); + + matrix_4x4_set_identity_and_position(model->obj->Switches[1]->Data, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[2].pos); + + matrix_4x4_set_identity_and_position(model->obj->Switches[2]->Data, &model->render_pos[3].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[3].pos); + + matrix_4x4_set_identity_and_position(model->obj->Switches[3]->Data, &model->render_pos[4].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[4].pos); + } + // mips2c line 2099 + else if (obj->type == PROPDEF_VEHICHLE) + { + struct VehichleRecord *temp_s1 = (struct VehichleRecord *)obj; + + var_f0_3 = 0.0f; + + temp_v1_7 = model->obj->Switches; + sp260 = temp_v1_7[1]->Data; + sp25C = temp_v1_7[2]->Data; + sp258 = temp_v1_7[3]->Data; + sp254 = temp_v1_7[4]->Data; + temp_v0_40 = temp_v1_7[5]->Data; + + if (sp678 != 0) + { + var_f0_3 = (temp_s1->speed * g_GlobalTimerDelta * 6.2831855f) / ((temp_v0_40[4] - temp_v0_40[3]) * model->scale * 6.2831855f * 0.5f); + + temp_s1->wheelxrot += var_f0_3; + + while (temp_s1->wheelxrot >= 6.2831855f) + { + temp_s1->wheelxrot -= 6.2831855f; + } + + while (temp_s1->wheelxrot < 0.0f) + { + temp_s1->wheelxrot += 6.2831855f; + } + } + + temp_s1->wheelxrot += var_f0_3; + + while (temp_s1->wheelxrot >= 6.2831855f) + { + temp_s1->wheelxrot -= 6.2831855f; + } + + while (temp_s1->wheelxrot < 0.0f) + { + temp_s1->wheelxrot += 6.2831855f; + } + + matrix_4x4_set_rotation_around_x(temp_s1->wheelxrot, &sp2AC); + + if (temp_s1->speed > 0.0f) + { + sp24C = temp_s1->turnrot60; + sp250 = (sp258->f[2] - sp260->f[2]) * model->scale; + if (sp24C < 0.0f) + { + sp24C = -sp24C; + } + + sp248 = sinf(sp24C) * sp250; + temp_s1->wheelyrot = atan2f(sp248, (cosf(sp24C) * sp250) - (sp250 - temp_s1->speed)); + + if (temp_s1->wheelyrot < sp24C) + { + temp_s1->wheelyrot = sp24C; + } + + if (temp_s1->turnrot60 > 0.0f) + { + temp_s1->wheelyrot = (6.2831855f - temp_s1->wheelyrot); + } + } + + matrix_4x4_set_rotation_around_y(temp_s1->wheelyrot, &sp26C); + matrix_4x4_copy(&sp2AC, &model->render_pos[3].pos); + matrix_4x4_set_position(sp258, &model->render_pos[3].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[3].pos); + + matrix_4x4_copy(&sp2AC, &model->render_pos[4].pos); + matrix_4x4_set_position(sp254, &model->render_pos[4].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[4].pos); + matrix_4x4_multiply_homogeneous_in_place(&sp26C, &sp2AC); + + matrix_4x4_copy(&sp2AC, &model->render_pos[1].pos); + matrix_4x4_set_position(sp260, &model->render_pos[1].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[1].pos); + + matrix_4x4_copy(&sp2AC, &model->render_pos[2].pos); + matrix_4x4_set_position(sp25C, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[2].pos); + } + // mips2c line 2187 + else if (obj->type == PROPDEF_AIRCRAFT) + { + struct AircraftRecord *temp_s1 = (struct AircraftRecord*)obj; + + //temp_a1_19 = model->render_pos[1]; + sp1FC = model->obj->Switches[2]->Data; + + if ((g_ClockTimer > 0) && (sp678 != 0)) + { + temp_s1->rotoryrot += temp_s1->rotaryspeed; + + while (temp_s1->rotoryrot >= 6.2831855f) + { + temp_s1->rotoryrot -= 6.2831855f; + } + + while (temp_s1->rotoryrot < 0.0f) + { + temp_s1->rotoryrot += 6.2831855f; + } + } + + if (temp_s1->model->anim != NULL) + { + sp1B0 = D_80030B34; + + sp1B0.unk_matrix = camGetWorldToScreenMtxf(); + sp1B0.mtxlist = &model->render_pos[0].pos; + subcalcmatrices(&sp1B0, temp_s1->model); + } + else + { + matrix_4x4_copy(&model->render_pos[0].pos, &model->render_pos[1].pos); + } + + if (temp_s1->flags & 0x20000000) + { + matrix_4x4_set_rotation_around_z(temp_s1->rotoryrot, &sp200); + } + else + { + matrix_4x4_set_rotation_around_y(temp_s1->rotoryrot, &sp200); + } + + matrix_4x4_copy(&sp200, &model->render_pos[2].pos); + matrix_4x4_set_position(sp1FC, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[1].pos, &model->render_pos[2].pos); + + var_v1_7 = model->obj->Switches; + + if (var_v1_7[3] != NULL) + { + temp_s0_21 = modelFindNodeMtx(model, var_v1_7[3], 0); + matrix_4x4_set_rotation_around_x(temp_s1->rotoryrot, &sp200); + matrix_4x4_copy(&sp200, temp_s0_21); + matrix_4x4_set_position(var_v1_7[3]->Data, temp_s0_21); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[1].pos, temp_s0_21); + } + + if (var_v1_7[4] != NULL) + { + temp_s0_21 = modelFindNodeMtx(model, var_v1_7[4], 0); + matrix_4x4_set_identity_and_position(var_v1_7[4]->Data, temp_s0_21); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[1].pos, temp_s0_21); + } + } + // mips2c line 2258 + else + { + if (obj->type == PROPDEF_TANK) + { + struct TankRecord *temp_s1 = (struct TankRecord*)obj; + + temp_v1_8 = model->obj->Switches; + + sp168 = temp_v1_8[1]->Data; + sp164 = temp_v1_8[3]->Data; + sp160 = temp_v1_8[4]->Data; + sp15C = temp_v1_8[2]->Data; + sp158 = temp_v1_8[6]->Data; + + sp154 = -temp_s1->turret_vertical_angle; + if (sp154 < 0.0f) + { + sp154 += 6.2831855f; + } + + var_f12_9 = -temp_s1->turret_orientation_angle; + if (var_f12_9 < 0.0f) + { + var_f12_9 += 6.2831855f; + } + + matrix_4x4_set_rotation_around_y(var_f12_9, &model->render_pos[1].pos); + matrix_4x4_set_position(sp168, &model->render_pos[1].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[0].pos, &model->render_pos[1].pos); + + matrix_4x4_set_rotation_around_x(sp154, &model->render_pos[3].pos); + matrix_4x4_set_position(sp164, &model->render_pos[3].pos); + matrix_4x4_multiply_homogeneous_in_place(sp6C, &model->render_pos[3].pos); + + matrix_4x4_set_rotation_around_y(1.5707964f, &model->render_pos[4].pos); + matrix_4x4_set_position(sp160, &model->render_pos[4].pos); + matrix_4x4_multiply_homogeneous_in_place(&model->render_pos[3].pos, &model->render_pos[4].pos); + + matrix_4x4_set_identity_and_position(sp15C, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous_in_place(sp6C, &model->render_pos[2].pos); + matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), &model->render_pos[1].pos, &sp16C); + + sub_GAME_7F03F540(sp158, &sp16C, &temp_s1->rect, temp_s1->unk80); + + if (model->obj->Switches[7] != NULL) + { + modelGetNodeRwData(model, model->obj->Switches[7])->Header.unk00 = (s16) temp_s1->is_firing_tank; + } + + if (model->obj->Switches[8] != NULL) + { + modelGetNodeRwData(model, model->obj->Switches[8])->Header.unk00 = 0; + } + } + } + } + + modelUpdateRelationsQuick(model, model->obj->RootNode); + arg0->Unk18 = -model->render_pos[0].pos.m[3][2]; + chrobjWeaponTick(arg0); + + sp684 = arg0->child; + + while (sp684 != NULL) + { + sub_GAME_7F0442DC(sp684); + sp684 = sp684->prev; + } + } + else + { + arg0->flags &= 0xFFFD; + + chrobjWeaponTick(arg0); + + sp684 = arg0->child; + + while (sp684 != NULL) + { + sub_GAME_7F04424C(sp684); + sp684 = sp684->prev; + } + } + + if (obj->runtime_bitflags & 0x100) + { + obj->runtime_bitflags &= ~0x100; + + maybe_detonate_object( + obj, + (RANDOMGETNEXT_F32() * 4.0f) + 2.0f, + &arg0->pos, + ITEM_UNARMED, + (s32) ((u32) (obj->runtime_bitflags & RUNTIMEBITFLAG_OWNER) >> RUNTIMEBITSHIFT_OWNER)); + } + + if (sp678 != 0) + { + if (obj->type == PROPDEF_DOOR) + { + sub_GAME_7F053A3C((struct DoorRecord *)arg0->obj); + } + // mimps2c line 2355 + else if ((obj->type == PROPDEF_AUTOGUN) && (lvlGetControlsLockedFlag() == 0)) + { + struct AutogunRecord *autogun = (struct AutogunRecord*)arg0->obj; + // autogun is temp_s0_24 + + sp13C = 0; + sp138 = 0; + + if ((autogun->is_active != 0) && !(obj->flags & 0x10000000)) + { + autogun->unkAC = (autogun->unkAC + 1) & 1; + + sp13C = autogun->unkAC == 0; + + if (model->obj->Switches[5] != 0) + { + sp138 = autogun->unkAC == 1; + } + + if (autogun->unkC0 < g_GlobalTimer) + { + if ((autogun->unkC4 != NULL) && (sndGetPlayingState(autogun->unkC4) != 0)) + { + sndDeactivate(autogun->unkC4); + } + + if ((autogun->unkC8 != NULL) && (sndGetPlayingState(autogun->unkC8) != 0)) + { + sndDeactivate(autogun->unkC8); + } + + if (autogun->unkC4 == NULL) + { + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, GUN_B9_CANNON_SHORT_SFX, autogun->unkC4); + chrobjSndCreatePostEventDefault(autogun->unkC4, &arg0->pos); + } + else if (autogun->unkC8 == NULL) + { + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, GUN_B9_CANNON_SHORT_SFX, autogun->unkC8); + chrobjSndCreatePostEventDefault(autogun->unkC8, &arg0->pos); + } + + autogun->unkC0 = (s32) (g_GlobalTimer + 2); + } + + // mmips2c line 2396 + if ((sp13C != 0) || (sp138 != 0)) + { + sp11C = 1; + sp10C = NULL; + sp108 = arg0->stan; + sp104 = (autogun->unkAC & 3) == 0; + sp100 = get_curplayer_positiondata(); + var_a0_6 = 5; + temp_v1_10 = model->obj->Switches; + + if ((model->obj->Switches[7] != 0) && !(autogun->unkAC & 7)) + { + var_a0_6 = 7; + } + + if ((arg0->flags & 2) && temp_v1_10[var_a0_6] != NULL) + { + temp_s2_7 = modelFindNodeMtx(model, temp_v1_10[var_a0_6], 0); + temp_v1_11 = model->obj->Switches[var_a0_6]->Data; + sp12C.f[0] = temp_v1_11->f[0]; + sp12C.f[1] = temp_v1_11->f[1]; + sp12C.f[2] = temp_v1_11->f[2]; + matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), temp_s2_7, &spB8); + mtx4TransformVecInPlace(&spB8, &sp12C); + if (walkTilesBetweenPoints_NoCallback(&sp108, arg0->pos.f[0], arg0->pos.f[2], sp12C.f[0], sp12C.f[2]) == 0) + { + sp12C.f[0] = arg0->pos.f[0]; + sp12C.f[1] = arg0->pos.f[1]; + sp12C.f[2] = arg0->pos.f[2]; + } + } + else + { + sp12C.f[0] = arg0->pos.f[0]; + sp12C.f[1] = arg0->pos.f[1]; + sp12C.f[2] = arg0->pos.f[2]; + } + + sp120.f[0] = cosf(autogun->unk9C) * sinf(autogun->unk90); + sp120.f[1] = sinf(autogun->unk9C); + sp120.f[2] = cosf(autogun->unk9C) * cosf(autogun->unk90); + + sp110.f[0] = (sp120.f[0] * 65536.0f) + sp12C.f[0]; + sp110.f[1] = (sp120.f[1] * 65536.0f) + sp12C.f[1]; + sp110.f[2] = (sp120.f[2] * 65536.0f) + sp12C.f[2]; + + sub_GAME_7F0B1CC4(); + + // mmips2c line 2441 + if (sub_GAME_7F0B0E24(&sp108, sp12C.f[0], sp12C.f[2], sp110.f[0], sp110.f[2], 2, 100.0f, 100.0f, 0.0f, 1.0f) == 0) + { + chrlvStanLineDirIntersection(&sp12C, &sp120, &sp110); + sp10C = sp108; + sp110.f[0] -= 26.0f * sp120.f[0]; + sp110.f[1] -= 26.0f * sp120.f[1]; + sp110.f[2] -= 26.0f * sp120.f[2]; + } + + if (g_GlobalTimer == (s32) autogun->unkBC) + { + temp_fc3d_a.f[0] = sp100->pos.f[0] - sp12C.f[0]; + temp_fc3d_a.f[1] = sp100->pos.f[1] - sp12C.f[1]; + temp_fc3d_a.f[2] = sp100->pos.f[2] - sp12C.f[2]; + + temp_f20_4 = (temp_fc3d_a.f[0] * temp_fc3d_a.f[0]) + (temp_fc3d_a.f[1] * temp_fc3d_a.f[1]) + (temp_fc3d_a.f[2] * temp_fc3d_a.f[2]); + + temp_fc3d_b.f[0] = sp110.f[0] - sp12C.f[0]; + temp_fc3d_b.f[1] = sp110.f[1] - sp12C.f[1]; + temp_fc3d_b.f[2] = sp110.f[2] - sp12C.f[2]; + + if ((temp_f20_4 <= ((temp_fc3d_b.f[0] * temp_fc3d_b.f[0]) + (temp_fc3d_b.f[1] * temp_fc3d_b.f[1]) + (temp_fc3d_b.f[2] * temp_fc3d_b.f[2]))) + && (bondviewGetIfCurrentPlayerDamageShowTime() == 0)) + { + temp_f0_35 = sqrtf(temp_f20_4); + var_f2_7 = 0.16f * g_GlobalTimerDelta * F_80030B1C; + + if (temp_f0_35 > 200.0f) + { + var_f2_7 *= 200.0f / temp_f0_35; + } + + autogun->unkD4 += var_f2_7; + + if (autogun->unkD4 >= 1.0f) + { + bondviewCallRecordDamageKills(bondwalkItemGetDestructionAmount(ITEM_FNP90) * 0.125f * F_80030B20, autogun->unk90, -1, 1); + + autogun->unkD4 = 0.0f; + + if (bondviewGetIfCurrentPlayerDamageShowTime() != 0) + { + sp11C = 0; + } + } + } + } + + // mips2c line 2479 + if (sp11C != 0) + { + if (sp10C != NULL) + { + sub_GAME_7F0A3E1C(&sp110, 1, 26.0f, (s16) sp10C->room); + } + + recall_joy2_hits_edit_flag(ITEM_FNP90, &sp110, -1); + } + else + { + sp110.f[0] = sp100->pos.f[0]; + sp110.f[1] = sp100->pos.f[1]; + sp110.f[2] = sp100->pos.f[2]; + + recall_joy2_hits_edit_detail_edit_flag(ITEM_FNP90, sp100, -1); + } + + // mips2c line 2494 + if (sp104 != 0) + { + beam = autogun->beam; + + beam->from.f[0] = sp12C.f[0]; + beam->from.f[1] = sp12C.f[1]; + beam->from.f[2] = sp12C.f[2]; + + beam->dir.f[0] = sp110.f[0] - beam->from.f[0]; + beam->dir.f[1] = sp110.f[1] - beam->from.f[1]; + beam->dir.f[2] = sp110.f[2] - beam->from.f[2]; + + sp94 = sqrtf((beam->dir.f[2] * beam->dir.f[2]) + ((beam->from.f[0] * beam->from.f[0]) + (beam->from.f[1] * beam->from.f[1]))); + + temp_f2_23 = 1.0f / sp94; + + beam->dir.f[0] = (f32) (beam->dir.f[0] * temp_f2_23); + beam->dir.f[1] = (f32) (beam->dir.f[1] * temp_f2_23); + beam->dir.f[2] = (f32) (beam->dir.f[2] * temp_f2_23); + + if (sp94 > 10000.0f) + { + sp94 = 10000.0f; + } + + beam->age = 0; + beam->weaponnum = ITEM_FNP90; + beam->maxdist = sp94; + + if (sp94 < 500.0f) + { + sp94 = 500.0f; + } + + /* At some point the developers where exploring a laser auto turret */ + if (beam->weaponnum == ITEM_LASER) + { + beam->speed = 0.25f * sp94; + beam->mindist = 0.6f * sp94; + + if (beam->mindist > 3000.0f) + { + beam->mindist = 3000.0f; + } + + var_f4 = (-0.1f - (RANDOMGETNEXT_F32() * 0.3f)) * sp94; + } + else + { + beam->speed = 0.2f * sp94; + beam->mindist = 0.2f * sp94; + + if (beam->mindist > 3000.0f) + { + beam->mindist = 3000.0f; + } + + var_f4 = ((2.0f * RANDOMGETNEXT_F32()) - 1.0f) * beam->speed; + } + + beam->dist = var_f4; + } + } + } + + // mmips2c line 2553 + if (model->obj->Switches[5] != NULL) + { + modelGetNodeRwData(model, model->obj->Switches[5])->Header.unk00 = (s16) sp13C; + } + + if (model->obj->Switches[7] != NULL) + { + modelGetNodeRwData(model, model->obj->Switches[7])->Header.unk00 = (s16) sp138; + } + } + + objDropRecursively(arg0); + } + + if (sp680 == 5) + { + arg0->stan = NULL; + } + + return sp680; } #else @@ -8423,7 +8598,7 @@ glabel object_interaction /* 07A074 7F045544 31790001 */ andi $t9, $t3, 1 /* 07A078 7F045548 53200351 */ beql $t9, $zero, .L7F046290 /* 07A07C 7F04554C C6000060 */ lwc1 $f0, 0x60($s0) -/* 07A080 7F045550 0FC1001E */ jal sub_GAME_7F040078 +/* 07A080 7F045550 0FC1001E */ jal chrobjGetBboxFromObjectRecord /* 07A084 7F045554 02202025 */ move $a0, $s1 /* 07A088 7F045558 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 07A08C 7F04555C 44814000 */ mtc1 $at, $f8 @@ -8669,7 +8844,7 @@ glabel object_interaction .L7F0458F0: /* 07A420 7F0458F0 5480002F */ bnezl $a0, .L7F0459B0 /* 07A424 7F0458F4 8FAC0604 */ lw $t4, 0x604($sp) -/* 07A428 7F0458F8 0FC0FEDC */ jal sub_GAME_7F03FB70 +/* 07A428 7F0458F8 0FC0FEDC */ jal projectileFree /* 07A42C 7F0458FC 02002025 */ move $a0, $s0 /* 07A430 7F045900 8E2F0064 */ lw $t7, 0x64($s1) /* 07A434 7F045904 2401FF7F */ li $at, -129 @@ -8688,11 +8863,11 @@ glabel object_interaction /* 07A464 7F045934 0C002382 */ jal sndPlaySfx /* 07A468 7F045938 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07A46C 7F04593C 00402025 */ move $a0, $v0 -/* 07A470 7F045940 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07A470 7F045940 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07A474 7F045944 26650008 */ addiu $a1, $s3, 8 /* 07A478 7F045948 8E6B0014 */ lw $t3, 0x14($s3) /* 07A47C 7F04594C 82240080 */ lb $a0, 0x80($s1) -/* 07A480 7F045950 0FC15DFA */ jal sub_GAME_7F0577E8 +/* 07A480 7F045950 0FC15DFA */ jal objectivestatusCheckDeposit /* 07A484 7F045954 91650003 */ lbu $a1, 3($t3) /* 07A488 7F045958 02202025 */ move $a0, $s1 /* 07A48C 7F04595C 27A50614 */ addiu $a1, $sp, 0x614 @@ -8702,12 +8877,12 @@ glabel object_interaction /* 07A49C 7F04596C 3C058003 */ lui $a1, %hi(D_80030B0C) /* 07A4A0 7F045970 8CA50B0C */ lw $a1, %lo(D_80030B0C)($a1) /* 07A4A4 7F045974 02602025 */ move $a0, $s3 -/* 07A4A8 7F045978 3C068007 */ lui $a2, %hi(objinst) +/* 07A4A8 7F045978 3C068007 */ lui $a2, %hi(g_CurrentProjectileModel) /* 07A4AC 7F04597C 10A0000B */ beqz $a1, .L7F0459AC /* 07A4B0 7F045980 3C078007 */ lui $a3, %hi(dword_CODE_bss_80075B74) /* 07A4B4 7F045984 8E720014 */ lw $s2, 0x14($s3) -/* 07A4B8 7F045988 8CC65B70 */ lw $a2, %lo(objinst)($a2) -/* 07A4BC 7F04598C 0FC10E9B */ jal sub_GAME_7F043A6C +/* 07A4B8 7F045988 8CC65B70 */ lw $a2, %lo(g_CurrentProjectileModel)($a2) +/* 07A4BC 7F04598C 0FC10E9B */ jal objEmbed /* 07A4C0 7F045990 8CE75B74 */ lw $a3, %lo(dword_CODE_bss_80075B74)($a3) /* 07A4C4 7F045994 10400005 */ beqz $v0, .L7F0459AC /* 07A4C8 7F045998 24190005 */ li $t9, 5 @@ -8740,7 +8915,7 @@ glabel object_interaction /* 07A52C 7F0459FC 8E4D0004 */ lw $t5, 4($s2) /* 07A530 7F045A00 51A000D9 */ beql $t5, $zero, .L7F045D68 /* 07A534 7F045A04 8FAC0604 */ lw $t4, 0x604($sp) -/* 07A538 7F045A08 0FC26C57 */ jal sub_GAME_7F09B15C +/* 07A538 7F045A08 0FC26C57 */ jal getPlayerPointerIndex /* 07A53C 7F045A0C 02402025 */ move $a0, $s2 /* 07A540 7F045A10 0FC26C54 */ jal get_cur_playernum /* 07A544 7F045A14 00409025 */ move $s2, $v0 @@ -8809,7 +8984,7 @@ glabel object_interaction /* 07A638 7F045B08 318E0200 */ andi $t6, $t4, 0x200 /* 07A63C 7F045B0C 55C00004 */ bnezl $t6, .L7F045B20 /* 07A640 7F045B10 8E0D0090 */ lw $t5, 0x90($s0) -/* 07A644 7F045B14 0FC15EB0 */ jal sub_GAME_7F057AC0 +/* 07A644 7F045B14 0FC15EB0 */ jal mtxLoadRandomRotation /* 07A648 7F045B18 8FA4006C */ lw $a0, 0x6c($sp) /* 07A64C 7F045B1C 8E0D0090 */ lw $t5, 0x90($s0) .L7F045B20: @@ -8832,11 +9007,11 @@ glabel object_interaction /* 07A690 7F045B60 10410080 */ beq $v0, $at, .L7F045D64 /* 07A694 7F045B64 2401006E */ li $at, 110 /* 07A698 7F045B68 1041007E */ beq $v0, $at, .L7F045D64 -/* 07A69C 7F045B6C 3C048007 */ lui $a0, %hi(objinst) +/* 07A69C 7F045B6C 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) /* 07A6A0 7F045B70 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) /* 07A6A4 7F045B74 8CA55B74 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07A6A8 7F045B78 8C845B70 */ lw $a0, %lo(objinst)($a0) -/* 07A6AC 7F045B7C 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07A6A8 7F045B78 8C845B70 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) +/* 07A6AC 7F045B7C 0FC1B198 */ jal modelFindNodeMtx /* 07A6B0 7F045B80 00003025 */ move $a2, $zero /* 07A6B4 7F045B84 C7A60614 */ lwc1 $f6, 0x614($sp) /* 07A6B8 7F045B88 C7A80618 */ lwc1 $f8, 0x618($sp) @@ -8844,22 +9019,22 @@ glabel object_interaction /* 07A6C0 7F045B90 00409025 */ move $s2, $v0 /* 07A6C4 7F045B94 E7A605CC */ swc1 $f6, 0x5cc($sp) /* 07A6C8 7F045B98 E7A805D0 */ swc1 $f8, 0x5d0($sp) -/* 07A6CC 7F045B9C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07A6CC 7F045B9C 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07A6D0 7F045BA0 E7A405D4 */ swc1 $f4, 0x5d4($sp) /* 07A6D4 7F045BA4 00402025 */ move $a0, $v0 -/* 07A6D8 7F045BA8 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 07A6D8 7F045BA8 0FC1611D */ jal mtx4TransformVecInPlace /* 07A6DC 7F045BAC 27A505CC */ addiu $a1, $sp, 0x5cc /* 07A6E0 7F045BB0 C7AA05CC */ lwc1 $f10, 0x5cc($sp) /* 07A6E4 7F045BB4 C6460030 */ lwc1 $f6, 0x30($s2) /* 07A6E8 7F045BB8 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07A6EC 7F045BBC 44810000 */ mtc1 $at, $f0 /* 07A6F0 7F045BC0 46065201 */ sub.s $f8, $f10, $f6 -/* 07A6F4 7F045BC4 3C048007 */ lui $a0, %hi(objinst) +/* 07A6F4 7F045BC4 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) /* 07A6F8 7F045BC8 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) /* 07A6FC 7F045BCC 8CA55B74 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) /* 07A700 7F045BD0 46004102 */ mul.s $f4, $f8, $f0 /* 07A704 7F045BD4 C7A805D0 */ lwc1 $f8, 0x5d0($sp) -/* 07A708 7F045BD8 8C845B70 */ lw $a0, %lo(objinst)($a0) +/* 07A708 7F045BD8 8C845B70 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07A70C 7F045BDC 46045180 */ add.s $f6, $f10, $f4 /* 07A710 7F045BE0 E7A605CC */ swc1 $f6, 0x5cc($sp) /* 07A714 7F045BE4 C64A0034 */ lwc1 $f10, 0x34($s2) @@ -8880,32 +9055,32 @@ glabel object_interaction /* 07A750 7F045C20 C42A5B88 */ lwc1 $f10, %lo(flt_CODE_bss_80075B88)($at) /* 07A754 7F045C24 46060102 */ mul.s $f4, $f0, $f6 /* 07A758 7F045C28 C7A605CC */ lwc1 $f6, 0x5cc($sp) -/* 07A75C 7F045C2C 3C048007 */ lui $a0, %hi(objinst) +/* 07A75C 7F045C2C 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) /* 07A760 7F045C30 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) /* 07A764 7F045C34 8CA55B74 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07A768 7F045C38 8C845B70 */ lw $a0, %lo(objinst)($a0) +/* 07A768 7F045C38 8C845B70 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07A76C 7F045C3C 460A2202 */ mul.s $f8, $f4, $f10 /* 07A770 7F045C40 46083101 */ sub.s $f4, $f6, $f8 /* 07A774 7F045C44 0FC1B3A4 */ jal getjointsize /* 07A778 7F045C48 E7A405CC */ swc1 $f4, 0x5cc($sp) /* 07A77C 7F045C4C 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07A780 7F045C50 44815000 */ mtc1 $at, $f10 -/* 07A784 7F045C54 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B8C) -/* 07A788 7F045C58 C4285B8C */ lwc1 $f8, %lo(flt_CODE_bss_80075B8C)($at) +/* 07A784 7F045C54 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B78) +/* 07A788 7F045C58 C4285B8C */ lwc1 $f8, %lo(flt_CODE_bss_80075B78+0x14)($at) /* 07A78C 7F045C5C 460A0182 */ mul.s $f6, $f0, $f10 /* 07A790 7F045C60 C7AA05D0 */ lwc1 $f10, 0x5d0($sp) -/* 07A794 7F045C64 3C048007 */ lui $a0, %hi(objinst) +/* 07A794 7F045C64 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) /* 07A798 7F045C68 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) /* 07A79C 7F045C6C 8CA55B74 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07A7A0 7F045C70 8C845B70 */ lw $a0, %lo(objinst)($a0) +/* 07A7A0 7F045C70 8C845B70 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07A7A4 7F045C74 46083102 */ mul.s $f4, $f6, $f8 /* 07A7A8 7F045C78 46045181 */ sub.s $f6, $f10, $f4 /* 07A7AC 7F045C7C 0FC1B3A4 */ jal getjointsize /* 07A7B0 7F045C80 E7A605D0 */ swc1 $f6, 0x5d0($sp) /* 07A7B4 7F045C84 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07A7B8 7F045C88 44814000 */ mtc1 $at, $f8 -/* 07A7BC 7F045C8C 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B90) -/* 07A7C0 7F045C90 C4245B90 */ lwc1 $f4, %lo(flt_CODE_bss_80075B90)($at) +/* 07A7BC 7F045C8C 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B88) +/* 07A7C0 7F045C90 C4245B90 */ lwc1 $f4, %lo(flt_CODE_bss_80075B88+0x8)($at) /* 07A7C4 7F045C94 46080282 */ mul.s $f10, $f0, $f8 /* 07A7C8 7F045C98 C7A805D4 */ lwc1 $f8, 0x5d4($sp) /* 07A7CC 7F045C9C 02402025 */ move $a0, $s2 @@ -8915,14 +9090,14 @@ glabel object_interaction /* 07A7DC 7F045CAC 0FC16799 */ jal matrix_4x4_7F059E64 /* 07A7E0 7F045CB0 E7AA05D4 */ swc1 $f10, 0x5d4($sp) /* 07A7E4 7F045CB4 27A4058C */ addiu $a0, $sp, 0x58c -/* 07A7E8 7F045CB8 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 07A7E8 7F045CB8 0FC1611D */ jal mtx4TransformVecInPlace /* 07A7EC 7F045CBC 27A505CC */ addiu $a1, $sp, 0x5cc -/* 07A7F0 7F045CC0 3C048007 */ lui $a0, %hi(objinst) +/* 07A7F0 7F045CC0 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) /* 07A7F4 7F045CC4 3C058003 */ lui $a1, %hi(bodypartshot) /* 07A7F8 7F045CC8 3C068007 */ lui $a2, %hi(dword_CODE_bss_80075B74) /* 07A7FC 7F045CCC 8CC65B74 */ lw $a2, %lo(dword_CODE_bss_80075B74)($a2) /* 07A800 7F045CD0 8CA50B10 */ lw $a1, %lo(bodypartshot)($a1) -/* 07A804 7F045CD4 8C845B70 */ lw $a0, %lo(objinst)($a0) +/* 07A804 7F045CD4 8C845B70 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07A808 7F045CD8 0FC08877 */ jal sub_GAME_7F0221DC /* 07A80C 7F045CDC 27A705CC */ addiu $a3, $sp, 0x5cc /* 07A810 7F045CE0 10000021 */ b .L7F045D68 @@ -9055,7 +9230,7 @@ glabel object_interaction /* 07A9E4 7F045EB4 332A0200 */ andi $t2, $t9, 0x200 /* 07A9E8 7F045EB8 55400004 */ bnezl $t2, .L7F045ECC /* 07A9EC 7F045EBC 8E0C0090 */ lw $t4, 0x90($s0) -/* 07A9F0 7F045EC0 0FC15EB0 */ jal sub_GAME_7F057AC0 +/* 07A9F0 7F045EC0 0FC15EB0 */ jal mtxLoadRandomRotation /* 07A9F4 7F045EC4 8FA4006C */ lw $a0, 0x6c($sp) /* 07A9F8 7F045EC8 8E0C0090 */ lw $t4, 0x90($s0) .L7F045ECC: @@ -9256,7 +9431,7 @@ glabel object_interaction /* 07ACAC 7F04617C 00003025 */ move $a2, $zero /* 07ACB0 7F046180 00402025 */ move $a0, $v0 .L7F046184: -/* 07ACB4 7F046184 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07ACB4 7F046184 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07ACB8 7F046188 8FA50070 */ lw $a1, 0x70($sp) /* 07ACBC 7F04618C 8E420000 */ lw $v0, ($s2) /* 07ACC0 7F046190 AE0200AC */ sw $v0, 0xac($s0) @@ -9413,7 +9588,7 @@ glabel object_interaction /* 07AEF4 7F0463C4 15E00082 */ bnez $t7, .L7F0465D0 /* 07AEF8 7F0463C8 00000000 */ nop /* 07AEFC 7F0463CC AFB80070 */ sw $t8, 0x70($sp) -/* 07AF00 7F0463D0 0FC1001E */ jal sub_GAME_7F040078 +/* 07AF00 7F0463D0 0FC1001E */ jal chrobjGetBboxFromObjectRecord /* 07AF04 7F0463D4 00009025 */ move $s2, $zero /* 07AF08 7F0463D8 3C038005 */ lui $v1, %hi(g_ClockTimer) /* 07AF0C 7F0463DC 8C638374 */ lw $v1, %lo(g_ClockTimer)($v1) @@ -9556,7 +9731,7 @@ glabel object_interaction /* 07B110 7F0465E0 5160000E */ beql $t3, $zero, .L7F04661C /* 07B114 7F0465E4 8FAD0690 */ lw $t5, 0x690($sp) .L7F0465E8: -/* 07B118 7F0465E8 0FC0FEDC */ jal sub_GAME_7F03FB70 +/* 07B118 7F0465E8 0FC0FEDC */ jal projectileFree /* 07B11C 7F0465EC 02002025 */ move $a0, $s0 /* 07B120 7F0465F0 8E390064 */ lw $t9, 0x64($s1) /* 07B124 7F0465F4 2401FF7F */ li $at, -129 @@ -9654,7 +9829,7 @@ glabel object_interaction /* 07B270 7F046740 02002025 */ move $a0, $s0 /* 07B274 7F046744 10400007 */ beqz $v0, .L7F046764 /* 07B278 7F046748 00000000 */ nop -/* 07B27C 7F04674C 0FC0F9C6 */ jal sub_GAME_7F03E718 +/* 07B27C 7F04674C 0FC0F9C6 */ jal doorIsPadlockFree /* 07B280 7F046750 02002025 */ move $a0, $s0 /* 07B284 7F046754 10400003 */ beqz $v0, .L7F046764 /* 07B288 7F046758 00000000 */ nop @@ -9820,7 +9995,7 @@ glabel object_interaction /* 07B4D0 7F0469A0 E7A40010 */ swc1 $f4, 0x10($sp) /* 07B4D4 7F0469A4 E7A80018 */ swc1 $f8, 0x18($sp) /* 07B4D8 7F0469A8 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 07B4DC 7F0469AC 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 07B4DC 7F0469AC 0FC2C389 */ jal stanTestLineUnobstructed /* 07B4E0 7F0469B0 E7A60024 */ swc1 $f6, 0x24($sp) /* 07B4E4 7F0469B4 10400015 */ beqz $v0, .L7F046A0C /* 07B4E8 7F0469B8 C7B20518 */ lwc1 $f18, 0x518($sp) @@ -10281,7 +10456,7 @@ glabel object_interaction /* 07BB90 7F047060 C642000C */ lwc1 $f2, 0xc($s2) /* 07BB94 7F047064 E7B004D8 */ swc1 $f16, 0x4d8($sp) /* 07BB98 7F047068 E7A20020 */ swc1 $f2, 0x20($sp) -/* 07BB9C 7F04706C 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 07BB9C 7F04706C 0FC2C389 */ jal stanTestLineUnobstructed /* 07BBA0 7F047070 E7A20024 */ swc1 $f2, 0x24($sp) /* 07BBA4 7F047074 1040000F */ beqz $v0, .L7F0470B4 /* 07BBA8 7F047078 C7B004D8 */ lwc1 $f16, 0x4d8($sp) @@ -10964,7 +11139,7 @@ glabel object_interaction /* 07C568 7F047A38 AFAB0014 */ sw $t3, 0x14($sp) /* 07C56C 7F047A3C E7AA0010 */ swc1 $f10, 0x10($sp) /* 07C570 7F047A40 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 07C574 7F047A44 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 07C574 7F047A44 0FC2C389 */ jal stanTestLineUnobstructed /* 07C578 7F047A48 E7AE001C */ swc1 $f14, 0x1c($sp) /* 07C57C 7F047A4C 104000FA */ beqz $v0, .L7F047E38 /* 07C580 7F047A50 02002025 */ move $a0, $s0 @@ -10976,7 +11151,7 @@ glabel object_interaction /* 07C598 7F047A68 8FA6069C */ lw $a2, 0x69c($sp) /* 07C59C 7F047A6C 3C074120 */ lui $a3, 0x4120 /* 07C5A0 7F047A70 E7B60014 */ swc1 $f22, 0x14($sp) -/* 07C5A4 7F047A74 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 07C5A4 7F047A74 0FC2C62E */ jal stanTestVolume /* 07C5A8 7F047A78 E7A80018 */ swc1 $f8, 0x18($sp) /* 07C5AC 7F047A7C 044300EF */ bgezl $v0, .L7F047E3C /* 07C5B0 7F047A80 C6260098 */ lwc1 $f6, 0x98($s1) @@ -11331,7 +11506,7 @@ glabel object_interaction /* 07CAEC 7F047FBC 3C058005 */ lui $a1, %hi(g_ClockTimer) /* 07CAF0 7F047FC0 8CA58374 */ lw $a1, %lo(g_ClockTimer)($a1) /* 07CAF4 7F047FC4 8E240014 */ lw $a0, 0x14($s1) -/* 07CAF8 7F047FC8 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 07CAF8 7F047FC8 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 07CAFC 7F047FCC 24060001 */ li $a2, 1 /* 07CB00 7F047FD0 0FC1B5AC */ jal subcalcpos /* 07CB04 7F047FD4 8E240014 */ lw $a0, 0x14($s1) @@ -11517,7 +11692,7 @@ glabel object_interaction /* 07CD94 7F048264 468052A0 */ cvt.s.w $f10, $f10 /* 07CD98 7F048268 44053000 */ mfc1 $a1, $f6 /* 07CD9C 7F04826C 44065000 */ mfc1 $a2, $f10 -/* 07CDA0 7F048270 0FC11477 */ jal sub_GAME_7F0451DC +/* 07CDA0 7F048270 0FC11477 */ jal glassCalculateOpacity /* 07CDA4 7F048274 00000000 */ nop /* 07CDA8 7F048278 8E04008C */ lw $a0, 0x8c($s0) /* 07CDAC 7F04827C AE020088 */ sw $v0, 0x88($s0) @@ -11558,7 +11733,7 @@ glabel object_interaction /* 07CE2C 7F0482FC 46802120 */ cvt.s.w $f4, $f4 /* 07CE30 7F048300 44054000 */ mfc1 $a1, $f8 /* 07CE34 7F048304 44062000 */ mfc1 $a2, $f4 -/* 07CE38 7F048308 0FC11477 */ jal sub_GAME_7F0451DC +/* 07CE38 7F048308 0FC11477 */ jal glassCalculateOpacity /* 07CE3C 7F04830C 00000000 */ nop /* 07CE40 7F048310 A60200BE */ sh $v0, 0xbe($s0) /* 07CE44 7F048314 8FB90674 */ lw $t9, 0x674($sp) @@ -11665,7 +11840,7 @@ glabel object_interaction /* 07CFB0 7F048480 00402825 */ move $a1, $v0 /* 07CFB4 7F048484 0FC149BB */ jal sub_GAME_7F0526EC /* 07CFB8 7F048488 AFA4039C */ sw $a0, 0x39c($sp) -/* 07CFBC 7F04848C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07CFBC 7F04848C 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07CFC0 7F048490 00000000 */ nop /* 07CFC4 7F048494 00402025 */ move $a0, $v0 /* 07CFC8 7F048498 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -11757,7 +11932,7 @@ glabel object_interaction /* 07D11C 7F0485EC 0C002382 */ jal sndPlaySfx /* 07D120 7F0485F0 E7AE0380 */ swc1 $f14, 0x380($sp) /* 07D124 7F0485F4 00402025 */ move $a0, $v0 -/* 07D128 7F0485F8 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07D128 7F0485F8 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07D12C 7F0485FC 8FA50070 */ lw $a1, 0x70($sp) .L7F048600: /* 07D130 7F048600 10000016 */ b .L7F04865C @@ -11781,7 +11956,7 @@ glabel object_interaction /* 07D174 7F048644 0C002382 */ jal sndPlaySfx /* 07D178 7F048648 E7AE0380 */ swc1 $f14, 0x380($sp) /* 07D17C 7F04864C 00402025 */ move $a0, $v0 -/* 07D180 7F048650 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07D180 7F048650 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07D184 7F048654 8FA50070 */ lw $a1, 0x70($sp) /* 07D188 7F048658 AFA0038C */ sw $zero, 0x38c($sp) .L7F04865C: @@ -11845,7 +12020,7 @@ glabel object_interaction /* 07D26C 7F04873C 8FA40070 */ lw $a0, 0x70($sp) /* 07D270 7F048740 0FC16266 */ jal matrix_4x4_set_position /* 07D274 7F048744 27A503A4 */ addiu $a1, $sp, 0x3a4 -/* 07D278 7F048748 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07D278 7F048748 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07D27C 7F04874C 00000000 */ nop /* 07D280 7F048750 00402025 */ move $a0, $v0 /* 07D284 7F048754 27A503A4 */ addiu $a1, $sp, 0x3a4 @@ -11889,12 +12064,12 @@ glabel object_interaction /* 07D314 7F0487E4 27A403A4 */ addiu $a0, $sp, 0x3a4 /* 07D318 7F0487E8 E7A40364 */ swc1 $f4, 0x364($sp) /* 07D31C 7F0487EC C6060008 */ lwc1 $f6, 8($s0) -/* 07D320 7F0487F0 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 07D320 7F0487F0 0FC1611D */ jal mtx4TransformVecInPlace /* 07D324 7F0487F4 E7A60368 */ swc1 $f6, 0x368($sp) /* 07D328 7F0487F8 02402025 */ move $a0, $s2 /* 07D32C 7F0487FC 0FC16266 */ jal matrix_4x4_set_position /* 07D330 7F048800 8FA5006C */ lw $a1, 0x6c($sp) -/* 07D334 7F048804 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07D334 7F048804 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07D338 7F048808 00000000 */ nop /* 07D33C 7F04880C 00402025 */ move $a0, $v0 /* 07D340 7F048810 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -11931,7 +12106,7 @@ glabel object_interaction /* 07D3B4 7F048884 C6040008 */ lwc1 $f4, 8($s0) /* 07D3B8 7F048888 E7AC0304 */ swc1 $f12, 0x304($sp) /* 07D3BC 7F04888C AFA20318 */ sw $v0, 0x318($sp) -/* 07D3C0 7F048890 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 07D3C0 7F048890 0FC1611D */ jal mtx4TransformVecInPlace /* 07D3C4 7F048894 E7A40310 */ swc1 $f4, 0x310($sp) /* 07D3C8 7F048898 26450040 */ addiu $a1, $s2, 0x40 /* 07D3CC 7F04889C C7AC0304 */ lwc1 $f12, 0x304($sp) @@ -11945,7 +12120,7 @@ glabel object_interaction /* 07D3EC 7F0488BC 8D4E0014 */ lw $t6, 0x14($t2) /* 07D3F0 7F0488C0 0FC1629F */ jal matrix_scalar_multiply /* 07D3F4 7F0488C4 C5CC0014 */ lwc1 $f12, 0x14($t6) -/* 07D3F8 7F0488C8 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07D3F8 7F0488C8 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07D3FC 7F0488CC 00000000 */ nop /* 07D400 7F0488D0 00402025 */ move $a0, $v0 /* 07D404 7F0488D4 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -11970,7 +12145,7 @@ glabel object_interaction /* 07D450 7F048920 8C65000C */ lw $a1, 0xc($v1) /* 07D454 7F048924 50A00016 */ beql $a1, $zero, .L7F048980 /* 07D458 7F048928 8C650010 */ lw $a1, 0x10($v1) -/* 07D45C 7F04892C 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07D45C 7F04892C 0FC1B198 */ jal modelFindNodeMtx /* 07D460 7F048930 00003025 */ move $a2, $zero /* 07D464 7F048934 AFA202FC */ sw $v0, 0x2fc($sp) /* 07D468 7F048938 8E8B0008 */ lw $t3, 8($s4) @@ -11995,7 +12170,7 @@ glabel object_interaction /* 07D4B0 7F048980 02802025 */ move $a0, $s4 /* 07D4B4 7F048984 50A00010 */ beql $a1, $zero, .L7F0489C8 /* 07D4B8 7F048988 8C650018 */ lw $a1, 0x18($v1) -/* 07D4BC 7F04898C 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07D4BC 7F04898C 0FC1B198 */ jal modelFindNodeMtx /* 07D4C0 7F048990 00003025 */ move $a2, $zero /* 07D4C4 7F048994 8E8E0008 */ lw $t6, 8($s4) /* 07D4C8 7F048998 00409025 */ move $s2, $v0 @@ -12014,7 +12189,7 @@ glabel object_interaction /* 07D4F8 7F0489C8 02802025 */ move $a0, $s4 /* 07D4FC 7F0489CC 50A001FE */ beql $a1, $zero, .L7F0491C8 /* 07D500 7F0489D0 8E8F0008 */ lw $t7, 8($s4) -/* 07D504 7F0489D4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07D504 7F0489D4 0FC1B198 */ jal modelFindNodeMtx /* 07D508 7F0489D8 00003025 */ move $a2, $zero /* 07D50C 7F0489DC 8E880008 */ lw $t0, 8($s4) /* 07D510 7F0489E0 8FB90318 */ lw $t9, 0x318($sp) @@ -12373,7 +12548,7 @@ glabel object_interaction /* 07DA38 7F048F08 15EBFFF8 */ bne $t7, $t3, .L7F048EEC /* 07DA3C 7F048F0C AD21FFFC */ sw $at, -4($t1) /* 07DA40 7F048F10 8DE10000 */ lw $at, ($t7) -/* 07DA44 7F048F14 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 07DA44 7F048F14 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 07DA48 7F048F18 AD210000 */ sw $at, ($t1) /* 07DA4C 7F048F1C AFA201B0 */ sw $v0, 0x1b0($sp) /* 07DA50 7F048F20 AFB201C0 */ sw $s2, 0x1c0($sp) @@ -12418,7 +12593,7 @@ glabel object_interaction /* 07DADC 7F048FAC 8C65000C */ lw $a1, 0xc($v1) /* 07DAE0 7F048FB0 50A00013 */ beql $a1, $zero, .L7F049000 /* 07DAE4 7F048FB4 8C650010 */ lw $a1, 0x10($v1) -/* 07DAE8 7F048FB8 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07DAE8 7F048FB8 0FC1B198 */ jal modelFindNodeMtx /* 07DAEC 7F048FBC 8CB20004 */ lw $s2, 4($a1) /* 07DAF0 7F048FC0 00408025 */ move $s0, $v0 /* 07DAF4 7F048FC4 C62C0088 */ lwc1 $f12, 0x88($s1) @@ -12441,7 +12616,7 @@ glabel object_interaction /* 07DB34 7F049004 00003025 */ move $a2, $zero /* 07DB38 7F049008 50A0006F */ beql $a1, $zero, .L7F0491C8 /* 07DB3C 7F04900C 8E8F0008 */ lw $t7, 8($s4) -/* 07DB40 7F049010 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07DB40 7F049010 0FC1B198 */ jal modelFindNodeMtx /* 07DB44 7F049014 8CB20004 */ lw $s2, 4($a1) /* 07DB48 7F049018 00408025 */ move $s0, $v0 /* 07DB4C 7F04901C 02402025 */ move $a0, $s2 @@ -12558,13 +12733,13 @@ glabel object_interaction /* 07DCF4 7F0491C4 8E8F0008 */ lw $t7, 8($s4) .L7F0491C8: /* 07DCF8 7F0491C8 02802025 */ move $a0, $s4 -/* 07DCFC 7F0491CC 0FC1BBA9 */ jal sub_GAME_7F06EEA4 +/* 07DCFC 7F0491CC 0FC1BBA9 */ jal modelUpdateRelationsQuick /* 07DD00 7F0491D0 8DE50000 */ lw $a1, ($t7) /* 07DD04 7F0491D4 8E89000C */ lw $t1, 0xc($s4) /* 07DD08 7F0491D8 02602025 */ move $a0, $s3 /* 07DD0C 7F0491DC C52A0038 */ lwc1 $f10, 0x38($t1) /* 07DD10 7F0491E0 46005207 */ neg.s $f8, $f10 -/* 07DD14 7F0491E4 0FC10F5C */ jal handle_thrown_explosive_detonation +/* 07DD14 7F0491E4 0FC10F5C */ jal chrobjWeaponTick /* 07DD18 7F0491E8 E6680018 */ swc1 $f8, 0x18($s3) /* 07DD1C 7F0491EC 8E640020 */ lw $a0, 0x20($s3) /* 07DD20 7F0491F0 50800018 */ beql $a0, $zero, .L7F049254 @@ -12582,7 +12757,7 @@ glabel object_interaction /* 07DD48 7F049218 92790001 */ lbu $t9, 1($s3) /* 07DD4C 7F04921C 02602025 */ move $a0, $s3 /* 07DD50 7F049220 332CFFFD */ andi $t4, $t9, 0xfffd -/* 07DD54 7F049224 0FC10F5C */ jal handle_thrown_explosive_detonation +/* 07DD54 7F049224 0FC10F5C */ jal chrobjWeaponTick /* 07DD58 7F049228 A26C0001 */ sb $t4, 1($s3) /* 07DD5C 7F04922C 8E640020 */ lw $a0, 0x20($s3) /* 07DD60 7F049230 50800008 */ beql $a0, $zero, .L7F049254 @@ -12713,7 +12888,7 @@ glabel object_interaction /* 07DF34 7F049404 0C002382 */ jal sndPlaySfx /* 07DF38 7F049408 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07DF3C 7F04940C 8E0400C4 */ lw $a0, 0xc4($s0) -/* 07DF40 7F049410 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07DF40 7F049410 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07DF44 7F049414 8FA50070 */ lw $a1, 0x70($sp) /* 07DF48 7F049418 1000000D */ b .L7F049450 /* 07DF4C 7F04941C 00000000 */ nop @@ -12728,7 +12903,7 @@ glabel object_interaction /* 07DF6C 7F04943C 0C002382 */ jal sndPlaySfx /* 07DF70 7F049440 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07DF74 7F049444 8E0400C8 */ lw $a0, 0xc8($s0) -/* 07DF78 7F049448 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07DF78 7F049448 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 07DF7C 7F04944C 8FA50070 */ lw $a1, 0x70($sp) .L7F049450: /* 07DF80 7F049450 3C088005 */ lui $t0, %hi(g_GlobalTimer) @@ -12775,7 +12950,7 @@ glabel object_interaction /* 07E018 7F0494E8 02802025 */ move $a0, $s4 /* 07E01C 7F0494EC 50A00029 */ beql $a1, $zero, .L7F049594 /* 07E020 7F0494F0 C6640008 */ lwc1 $f4, 8($s3) -/* 07E024 7F0494F4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 07E024 7F0494F4 0FC1B198 */ jal modelFindNodeMtx /* 07E028 7F0494F8 00003025 */ move $a2, $zero /* 07E02C 7F0494FC 8E8A0008 */ lw $t2, 8($s4) /* 07E030 7F049500 00409025 */ move $s2, $v0 @@ -12796,7 +12971,7 @@ glabel object_interaction /* 07E06C 7F04953C 0FC16063 */ jal matrix_4x4_multiply_homogeneous /* 07E070 7F049540 02402825 */ move $a1, $s2 /* 07E074 7F049544 02202025 */ move $a0, $s1 -/* 07E078 7F049548 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 07E078 7F049548 0FC1611D */ jal mtx4TransformVecInPlace /* 07E07C 7F04954C 27A5012C */ addiu $a1, $sp, 0x12c /* 07E080 7F049550 C7A40134 */ lwc1 $f4, 0x134($sp) /* 07E084 7F049554 8E650008 */ lw $a1, 8($s3) @@ -12874,7 +13049,7 @@ glabel object_interaction /* 07E198 7F049668 E7A00018 */ swc1 $f0, 0x18($sp) /* 07E19C 7F04966C E7A0001C */ swc1 $f0, 0x1c($sp) /* 07E1A0 7F049670 E7A80010 */ swc1 $f8, 0x10($sp) -/* 07E1A4 7F049674 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 07E1A4 7F049674 0FC2C389 */ jal stanTestLineUnobstructed /* 07E1A8 7F049678 E7A40024 */ swc1 $f4, 0x24($sp) /* 07E1AC 7F04967C 14400017 */ bnez $v0, .L7F0496DC /* 07E1B0 7F049680 27A60110 */ addiu $a2, $sp, 0x110 @@ -12951,10 +13126,10 @@ glabel object_interaction /* 07E2C8 7F049798 C4282B74 */ lwc1 $f8, %lo(D_80052B74)($at) /* 07E2CC 7F04979C 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) /* 07E2D0 7F0497A0 C42A8378 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 07E2D4 7F0497A4 3C018003 */ lui $at, %hi(F_80030B1C) +/* 07E2D4 7F0497A4 3C018003 */ lui $at, %hi(g_AutogunPendingDamageTick) /* 07E2D8 7F0497A8 4600603C */ c.lt.s $f12, $f0 /* 07E2DC 7F0497AC 460A4182 */ mul.s $f6, $f8, $f10 -/* 07E2E0 7F0497B0 C4240B1C */ lwc1 $f4, %lo(F_80030B1C)($at) +/* 07E2E0 7F0497B0 C4240B1C */ lwc1 $f4, %lo(g_AutogunPendingDamageTick)($at) /* 07E2E4 7F0497B4 46043082 */ mul.s $f2, $f6, $f4 /* 07E2E8 7F0497B8 45020005 */ bc1fl .L7F0497D0 /* 07E2EC 7F0497BC C60A00D4 */ lwc1 $f10, 0xd4($s0) @@ -12976,8 +13151,8 @@ glabel object_interaction /* 07E328 7F0497F8 2404000E */ li $a0, 14 /* 07E32C 7F0497FC 3C013E00 */ li $at, 0x3E000000 # 0.125000 /* 07E330 7F049800 44815000 */ mtc1 $at, $f10 -/* 07E334 7F049804 3C018003 */ lui $at, %hi(F_80030B20) -/* 07E338 7F049808 C4240B20 */ lwc1 $f4, %lo(F_80030B20)($at) +/* 07E334 7F049804 3C018003 */ lui $at, %hi(g_AutogunDamageScalar) +/* 07E338 7F049808 C4240B20 */ lwc1 $f4, %lo(g_AutogunDamageScalar)($at) /* 07E33C 7F04980C 460A0182 */ mul.s $f6, $f0, $f10 /* 07E340 7F049810 C60E0090 */ lwc1 $f14, 0x90($s0) /* 07E344 7F049814 2406FFFF */ li $a2, -1 @@ -13187,7 +13362,7 @@ glabel object_interaction /* 07E638 7F049B08 8FAF0138 */ lw $t7, 0x138($sp) /* 07E63C 7F049B0C A44F0000 */ sh $t7, ($v0) .L7F049B10: -/* 07E640 7F049B10 0FC11080 */ jal sub_GAME_7F044200 +/* 07E640 7F049B10 0FC11080 */ jal objDropRecursively /* 07E644 7F049B14 02602025 */ move $a0, $s3 /* 07E648 7F049B18 8FA90680 */ lw $t1, 0x680($sp) .L7F049B1C: @@ -13415,7 +13590,7 @@ glabel object_interaction /* 07A318 7F0457A8 8E040088 */ lw $a0, 0x88($s0) /* 07A31C 7F0457AC 5080000C */ beql $a0, $zero, .Ljp7F0457E0 /* 07A320 7F0457B0 8FAA0680 */ lw $t2, 0x680($sp) -/* 07A324 7F0457B4 0FC26F3F */ jal sub_GAME_7F09B15C +/* 07A324 7F0457B4 0FC26F3F */ jal getPlayerPointerIndex /* 07A328 7F0457B8 00000000 */ nop /* 07A32C 7F0457BC 04400007 */ bltz $v0, .Ljp7F0457DC /* 07A330 7F0457C0 3C098008 */ lui $t1, %hi(g_CurrentPlayer) # $t1, 0x8008 @@ -13520,7 +13695,7 @@ glabel object_interaction /* 07A498 7F045928 314D0001 */ andi $t5, $t2, 1 /* 07A49C 7F04592C 51A00351 */ beql $t5, $zero, .Ljp7F046674 /* 07A4A0 7F045930 C6000060 */ lwc1 $f0, 0x60($s0) -/* 07A4A4 7F045934 0FC100DE */ jal sub_GAME_7F040078 +/* 07A4A4 7F045934 0FC100DE */ jal chrobjGetBboxFromObjectRecord /* 07A4A8 7F045938 02202025 */ move $a0, $s1 /* 07A4AC 7F04593C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 07A4B0 7F045940 44814000 */ mtc1 $at, $f8 @@ -13766,7 +13941,7 @@ glabel object_interaction .Ljp7F045CD4: /* 07A844 7F045CD4 5480002F */ bnezl $a0, .Ljp7F045D94 /* 07A848 7F045CD8 8FB9060C */ lw $t9, 0x60c($sp) -/* 07A84C 7F045CDC 0FC0FF9C */ jal sub_GAME_7F03FB70 +/* 07A84C 7F045CDC 0FC0FF9C */ jal projectileFree /* 07A850 7F045CE0 02002025 */ move $a0, $s0 /* 07A854 7F045CE4 8E290064 */ lw $t1, 0x64($s1) /* 07A858 7F045CE8 2401FF7F */ li $at, -129 @@ -13785,11 +13960,11 @@ glabel object_interaction /* 07A888 7F045D18 0C002386 */ jal sndPlaySfx /* 07A88C 7F045D1C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07A890 7F045D20 00402025 */ move $a0, $v0 -/* 07A894 7F045D24 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07A894 7F045D24 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07A898 7F045D28 26650008 */ addiu $a1, $s3, 8 /* 07A89C 7F045D2C 8E6A0014 */ lw $t2, 0x14($s3) /* 07A8A0 7F045D30 82240080 */ lb $a0, 0x80($s1) -/* 07A8A4 7F045D34 0FC15F41 */ jal sub_GAME_7F0577E8 +/* 07A8A4 7F045D34 0FC15F41 */ jal objectivestatusCheckDeposit /* 07A8A8 7F045D38 91450003 */ lbu $a1, 3($t2) /* 07A8AC 7F045D3C 02202025 */ move $a0, $s1 /* 07A8B0 7F045D40 27A5061C */ addiu $a1, $sp, 0x61c @@ -13799,12 +13974,12 @@ glabel object_interaction /* 07A8C0 7F045D50 3C058003 */ lui $a1, %hi(D_80030B0C) # $a1, 0x8003 /* 07A8C4 7F045D54 8CA50B4C */ lw $a1, %lo(D_80030B0C)($a1) /* 07A8C8 7F045D58 02602025 */ move $a0, $s3 -/* 07A8CC 7F045D5C 3C068007 */ lui $a2, %hi(objinst) # $a2, 0x8007 +/* 07A8CC 7F045D5C 3C068007 */ lui $a2, %hi(g_CurrentProjectileModel) # $a2, 0x8007 /* 07A8D0 7F045D60 10A0000B */ beqz $a1, .Ljp7F045D90 /* 07A8D4 7F045D64 3C078007 */ lui $a3, %hi(dword_CODE_bss_80075B74) # $a3, 0x8007 /* 07A8D8 7F045D68 8E720014 */ lw $s2, 0x14($s3) -/* 07A8DC 7F045D6C 8CC65BB0 */ lw $a2, %lo(objinst)($a2) -/* 07A8E0 7F045D70 0FC10F5B */ jal sub_GAME_7F043A6C +/* 07A8DC 7F045D6C 8CC65BB0 */ lw $a2, %lo(g_CurrentProjectileModel)($a2) +/* 07A8E0 7F045D70 0FC10F5B */ jal objEmbed /* 07A8E4 7F045D74 8CE75BB4 */ lw $a3, %lo(dword_CODE_bss_80075B74)($a3) /* 07A8E8 7F045D78 10400005 */ beqz $v0, .Ljp7F045D90 /* 07A8EC 7F045D7C 240D0005 */ li $t5, 5 @@ -13837,7 +14012,7 @@ glabel object_interaction /* 07A950 7F045DE0 8E480004 */ lw $t0, 4($s2) /* 07A954 7F045DE4 510000D9 */ beql $t0, $zero, .Ljp7F04614C /* 07A958 7F045DE8 8FB9060C */ lw $t9, 0x60c($sp) -/* 07A95C 7F045DEC 0FC26F3F */ jal sub_GAME_7F09B15C +/* 07A95C 7F045DEC 0FC26F3F */ jal getPlayerPointerIndex /* 07A960 7F045DF0 02402025 */ move $a0, $s2 /* 07A964 7F045DF4 0FC26F3C */ jal get_cur_playernum /* 07A968 7F045DF8 00409025 */ move $s2, $v0 @@ -13906,7 +14081,7 @@ glabel object_interaction /* 07AA5C 7F045EEC 33380200 */ andi $t8, $t9, 0x200 /* 07AA60 7F045EF0 57000004 */ bnezl $t8, .Ljp7F045F04 /* 07AA64 7F045EF4 8E080090 */ lw $t0, 0x90($s0) -/* 07AA68 7F045EF8 0FC15FF8 */ jal sub_GAME_7F057AC0 +/* 07AA68 7F045EF8 0FC15FF8 */ jal mtxLoadRandomRotation /* 07AA6C 7F045EFC 8FA40070 */ lw $a0, 0x70($sp) /* 07AA70 7F045F00 8E080090 */ lw $t0, 0x90($s0) .Ljp7F045F04: @@ -13929,11 +14104,11 @@ glabel object_interaction /* 07AAB4 7F045F44 10410080 */ beq $v0, $at, .Ljp7F046148 /* 07AAB8 7F045F48 2401006E */ li $at, 110 /* 07AABC 7F045F4C 1041007E */ beq $v0, $at, .Ljp7F046148 -/* 07AAC0 7F045F50 3C048007 */ lui $a0, %hi(objinst) # $a0, 0x8007 +/* 07AAC0 7F045F50 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8007 /* 07AAC4 7F045F54 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8007 /* 07AAC8 7F045F58 8CA55BB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07AACC 7F045F5C 8C845BB0 */ lw $a0, %lo(objinst)($a0) -/* 07AAD0 7F045F60 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07AACC 7F045F5C 8C845BB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) +/* 07AAD0 7F045F60 0FC1B314 */ jal modelFindNodeMtx /* 07AAD4 7F045F64 00003025 */ move $a2, $zero /* 07AAD8 7F045F68 C7A6061C */ lwc1 $f6, 0x61c($sp) /* 07AADC 7F045F6C C7A80620 */ lwc1 $f8, 0x620($sp) @@ -13941,22 +14116,22 @@ glabel object_interaction /* 07AAE4 7F045F74 00409025 */ move $s2, $v0 /* 07AAE8 7F045F78 E7A605D4 */ swc1 $f6, 0x5d4($sp) /* 07AAEC 7F045F7C E7A805D8 */ swc1 $f8, 0x5d8($sp) -/* 07AAF0 7F045F80 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07AAF0 7F045F80 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07AAF4 7F045F84 E7A405DC */ swc1 $f4, 0x5dc($sp) /* 07AAF8 7F045F88 00402025 */ move $a0, $v0 -/* 07AAFC 7F045F8C 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 07AAFC 7F045F8C 0FC16265 */ jal mtx4TransformVecInPlace /* 07AB00 7F045F90 27A505D4 */ addiu $a1, $sp, 0x5d4 /* 07AB04 7F045F94 C7AA05D4 */ lwc1 $f10, 0x5d4($sp) /* 07AB08 7F045F98 C6460030 */ lwc1 $f6, 0x30($s2) /* 07AB0C 7F045F9C 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07AB10 7F045FA0 44810000 */ mtc1 $at, $f0 /* 07AB14 7F045FA4 46065201 */ sub.s $f8, $f10, $f6 -/* 07AB18 7F045FA8 3C048007 */ lui $a0, %hi(objinst) # $a0, 0x8007 +/* 07AB18 7F045FA8 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8007 /* 07AB1C 7F045FAC 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8007 /* 07AB20 7F045FB0 8CA55BB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) /* 07AB24 7F045FB4 46004102 */ mul.s $f4, $f8, $f0 /* 07AB28 7F045FB8 C7A805D8 */ lwc1 $f8, 0x5d8($sp) -/* 07AB2C 7F045FBC 8C845BB0 */ lw $a0, %lo(objinst)($a0) +/* 07AB2C 7F045FBC 8C845BB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07AB30 7F045FC0 46045180 */ add.s $f6, $f10, $f4 /* 07AB34 7F045FC4 E7A605D4 */ swc1 $f6, 0x5d4($sp) /* 07AB38 7F045FC8 C64A0034 */ lwc1 $f10, 0x34($s2) @@ -13977,32 +14152,32 @@ glabel object_interaction /* 07AB74 7F046004 C42A5BC8 */ lwc1 $f10, %lo(flt_CODE_bss_80075B88)($at) /* 07AB78 7F046008 46060102 */ mul.s $f4, $f0, $f6 /* 07AB7C 7F04600C C7A605D4 */ lwc1 $f6, 0x5d4($sp) -/* 07AB80 7F046010 3C048007 */ lui $a0, %hi(objinst) # $a0, 0x8007 +/* 07AB80 7F046010 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8007 /* 07AB84 7F046014 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8007 /* 07AB88 7F046018 8CA55BB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07AB8C 7F04601C 8C845BB0 */ lw $a0, %lo(objinst)($a0) +/* 07AB8C 7F04601C 8C845BB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07AB90 7F046020 460A2202 */ mul.s $f8, $f4, $f10 /* 07AB94 7F046024 46083101 */ sub.s $f4, $f6, $f8 /* 07AB98 7F046028 0FC1B520 */ jal getjointsize /* 07AB9C 7F04602C E7A405D4 */ swc1 $f4, 0x5d4($sp) /* 07ABA0 7F046030 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07ABA4 7F046034 44815000 */ mtc1 $at, $f10 -/* 07ABA8 7F046038 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B8C) # $at, 0x8007 -/* 07ABAC 7F04603C C4285BCC */ lwc1 $f8, %lo(flt_CODE_bss_80075B8C)($at) +/* 07ABA8 7F046038 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B78) # $at, 0x8007 +/* 07ABAC 7F04603C C4285BCC */ lwc1 $f8, %lo(flt_CODE_bss_80075B78+0x14)($at) /* 07ABB0 7F046040 460A0182 */ mul.s $f6, $f0, $f10 /* 07ABB4 7F046044 C7AA05D8 */ lwc1 $f10, 0x5d8($sp) -/* 07ABB8 7F046048 3C048007 */ lui $a0, %hi(objinst) # $a0, 0x8007 +/* 07ABB8 7F046048 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8007 /* 07ABBC 7F04604C 3C058007 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8007 /* 07ABC0 7F046050 8CA55BB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07ABC4 7F046054 8C845BB0 */ lw $a0, %lo(objinst)($a0) +/* 07ABC4 7F046054 8C845BB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07ABC8 7F046058 46083102 */ mul.s $f4, $f6, $f8 /* 07ABCC 7F04605C 46045181 */ sub.s $f6, $f10, $f4 /* 07ABD0 7F046060 0FC1B520 */ jal getjointsize /* 07ABD4 7F046064 E7A605D8 */ swc1 $f6, 0x5d8($sp) /* 07ABD8 7F046068 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07ABDC 7F04606C 44814000 */ mtc1 $at, $f8 -/* 07ABE0 7F046070 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B90) # $at, 0x8007 -/* 07ABE4 7F046074 C4245BD0 */ lwc1 $f4, %lo(flt_CODE_bss_80075B90)($at) +/* 07ABE0 7F046070 3C018007 */ lui $at, %hi(flt_CODE_bss_80075B88) # $at, 0x8007 +/* 07ABE4 7F046074 C4245BD0 */ lwc1 $f4, %lo(flt_CODE_bss_80075B88+0x8)($at) /* 07ABE8 7F046078 46080282 */ mul.s $f10, $f0, $f8 /* 07ABEC 7F04607C C7A805DC */ lwc1 $f8, 0x5dc($sp) /* 07ABF0 7F046080 02402025 */ move $a0, $s2 @@ -14012,14 +14187,14 @@ glabel object_interaction /* 07AC00 7F046090 0FC168E1 */ jal matrix_4x4_7F059E64 /* 07AC04 7F046094 E7AA05DC */ swc1 $f10, 0x5dc($sp) /* 07AC08 7F046098 27A40594 */ addiu $a0, $sp, 0x594 -/* 07AC0C 7F04609C 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 07AC0C 7F04609C 0FC16265 */ jal mtx4TransformVecInPlace /* 07AC10 7F0460A0 27A505D4 */ addiu $a1, $sp, 0x5d4 -/* 07AC14 7F0460A4 3C048007 */ lui $a0, %hi(objinst) # $a0, 0x8007 +/* 07AC14 7F0460A4 3C048007 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8007 /* 07AC18 7F0460A8 3C058003 */ lui $a1, %hi(bodypartshot) # $a1, 0x8003 /* 07AC1C 7F0460AC 3C068007 */ lui $a2, %hi(dword_CODE_bss_80075B74) # $a2, 0x8007 /* 07AC20 7F0460B0 8CC65BB4 */ lw $a2, %lo(dword_CODE_bss_80075B74)($a2) /* 07AC24 7F0460B4 8CA50B50 */ lw $a1, %lo(bodypartshot)($a1) -/* 07AC28 7F0460B8 8C845BB0 */ lw $a0, %lo(objinst)($a0) +/* 07AC28 7F0460B8 8C845BB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07AC2C 7F0460BC 0FC08931 */ jal sub_GAME_7F0221DC /* 07AC30 7F0460C0 27A705D4 */ addiu $a3, $sp, 0x5d4 /* 07AC34 7F0460C4 10000021 */ b .Ljp7F04614C @@ -14152,7 +14327,7 @@ glabel object_interaction /* 07AE08 7F046298 31AF0200 */ andi $t7, $t5, 0x200 /* 07AE0C 7F04629C 55E00004 */ bnezl $t7, .Ljp7F0462B0 /* 07AE10 7F0462A0 8E190090 */ lw $t9, 0x90($s0) -/* 07AE14 7F0462A4 0FC15FF8 */ jal sub_GAME_7F057AC0 +/* 07AE14 7F0462A4 0FC15FF8 */ jal mtxLoadRandomRotation /* 07AE18 7F0462A8 8FA40070 */ lw $a0, 0x70($sp) /* 07AE1C 7F0462AC 8E190090 */ lw $t9, 0x90($s0) .Ljp7F0462B0: @@ -14353,7 +14528,7 @@ glabel object_interaction /* 07B0D0 7F046560 00003025 */ move $a2, $zero /* 07B0D4 7F046564 00402025 */ move $a0, $v0 .Ljp7F046568: -/* 07B0D8 7F046568 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07B0D8 7F046568 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07B0DC 7F04656C 8FA50074 */ lw $a1, 0x74($sp) /* 07B0E0 7F046570 8E420000 */ lw $v0, ($s2) /* 07B0E4 7F046574 AE0200AC */ sw $v0, 0xac($s0) @@ -14510,7 +14685,7 @@ glabel object_interaction /* 07B318 7F0467A8 15200082 */ bnez $t1, .Ljp7F0469B4 /* 07B31C 7F0467AC 00000000 */ nop /* 07B320 7F0467B0 AFAB0074 */ sw $t3, 0x74($sp) -/* 07B324 7F0467B4 0FC100DE */ jal sub_GAME_7F040078 +/* 07B324 7F0467B4 0FC100DE */ jal chrobjGetBboxFromObjectRecord /* 07B328 7F0467B8 00009025 */ move $s2, $zero /* 07B32C 7F0467BC 3C038005 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8005 /* 07B330 7F0467C0 8C6383A4 */ lw $v1, %lo(g_ClockTimer)($v1) @@ -14653,7 +14828,7 @@ glabel object_interaction /* 07B534 7F0469C4 51400016 */ beql $t2, $zero, .Ljp7F046A20 /* 07B538 7F0469C8 8FAB0698 */ lw $t3, 0x698($sp) .Ljp7F0469CC: -/* 07B53C 7F0469CC 0FC0FF9C */ jal sub_GAME_7F03FB70 +/* 07B53C 7F0469CC 0FC0FF9C */ jal projectileFree /* 07B540 7F0469D0 02002025 */ move $a0, $s0 /* 07B544 7F0469D4 8E2D0064 */ lw $t5, 0x64($s1) /* 07B548 7F0469D8 2401FF7F */ li $at, -129 @@ -14672,7 +14847,7 @@ glabel object_interaction /* 07B578 7F046A08 8FAB0698 */ lw $t3, 0x698($sp) /* 07B57C 7F046A0C 8E690014 */ lw $t1, 0x14($s3) /* 07B580 7F046A10 82240080 */ lb $a0, 0x80($s1) -/* 07B584 7F046A14 0FC15F41 */ jal sub_GAME_7F0577E8 +/* 07B584 7F046A14 0FC15F41 */ jal objectivestatusCheckDeposit /* 07B588 7F046A18 91250003 */ lbu $a1, 3($t1) .Ljp7F046A1C: /* 07B58C 7F046A1C 8FAB0698 */ lw $t3, 0x698($sp) @@ -14760,7 +14935,7 @@ glabel object_interaction /* 07B6B4 7F046B44 02002025 */ move $a0, $s0 /* 07B6B8 7F046B48 10400007 */ beqz $v0, .Ljp7F046B68 /* 07B6BC 7F046B4C 00000000 */ nop -/* 07B6C0 7F046B50 0FC0FA86 */ jal sub_GAME_7F03E718 +/* 07B6C0 7F046B50 0FC0FA86 */ jal doorIsPadlockFree /* 07B6C4 7F046B54 02002025 */ move $a0, $s0 /* 07B6C8 7F046B58 10400003 */ beqz $v0, .Ljp7F046B68 /* 07B6CC 7F046B5C 00000000 */ nop @@ -14926,7 +15101,7 @@ glabel object_interaction /* 07B914 7F046DA4 E7A40010 */ swc1 $f4, 0x10($sp) /* 07B918 7F046DA8 E7A80018 */ swc1 $f8, 0x18($sp) /* 07B91C 7F046DAC E7AA001C */ swc1 $f10, 0x1c($sp) -/* 07B920 7F046DB0 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 07B920 7F046DB0 0FC2C675 */ jal stanTestLineUnobstructed /* 07B924 7F046DB4 E7A60024 */ swc1 $f6, 0x24($sp) /* 07B928 7F046DB8 10400015 */ beqz $v0, .Ljp7F046E10 /* 07B92C 7F046DBC C7B2051C */ lwc1 $f18, 0x51c($sp) @@ -15387,7 +15562,7 @@ glabel object_interaction /* 07BFD4 7F047464 C642000C */ lwc1 $f2, 0xc($s2) /* 07BFD8 7F047468 E7B004DC */ swc1 $f16, 0x4dc($sp) /* 07BFDC 7F04746C E7A20020 */ swc1 $f2, 0x20($sp) -/* 07BFE0 7F047470 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 07BFE0 7F047470 0FC2C675 */ jal stanTestLineUnobstructed /* 07BFE4 7F047474 E7A20024 */ swc1 $f2, 0x24($sp) /* 07BFE8 7F047478 1040000F */ beqz $v0, .Ljp7F0474B8 /* 07BFEC 7F04747C C7B004DC */ lwc1 $f16, 0x4dc($sp) @@ -16070,7 +16245,7 @@ glabel object_interaction /* 07C9AC 7F047E3C AFAF0014 */ sw $t7, 0x14($sp) /* 07C9B0 7F047E40 E7AA0010 */ swc1 $f10, 0x10($sp) /* 07C9B4 7F047E44 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 07C9B8 7F047E48 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 07C9B8 7F047E48 0FC2C675 */ jal stanTestLineUnobstructed /* 07C9BC 7F047E4C E7AE001C */ swc1 $f14, 0x1c($sp) /* 07C9C0 7F047E50 104000FA */ beqz $v0, .Ljp7F04823C /* 07C9C4 7F047E54 02002025 */ move $a0, $s0 @@ -16082,7 +16257,7 @@ glabel object_interaction /* 07C9DC 7F047E6C 8FA606A4 */ lw $a2, 0x6a4($sp) /* 07C9E0 7F047E70 3C074120 */ lui $a3, 0x4120 /* 07C9E4 7F047E74 E7B60014 */ swc1 $f22, 0x14($sp) -/* 07C9E8 7F047E78 0FC2C91A */ jal sub_GAME_7F0B18B8 +/* 07C9E8 7F047E78 0FC2C91A */ jal stanTestVolume /* 07C9EC 7F047E7C E7A80018 */ swc1 $f8, 0x18($sp) /* 07C9F0 7F047E80 044300EF */ bgezl $v0, .Ljp7F048240 /* 07C9F4 7F047E84 C6260098 */ lwc1 $f6, 0x98($s1) @@ -16437,7 +16612,7 @@ glabel object_interaction /* 07CF30 7F0483C0 3C058005 */ lui $a1, %hi(g_ClockTimer) # $a1, 0x8005 /* 07CF34 7F0483C4 8CA583A4 */ lw $a1, %lo(g_ClockTimer)($a1) /* 07CF38 7F0483C8 8E240014 */ lw $a0, 0x14($s1) -/* 07CF3C 7F0483CC 0FC1C437 */ jal sub_GAME_7F070AEC +/* 07CF3C 7F0483CC 0FC1C437 */ jal modelTickAnimQuarterSpeed /* 07CF40 7F0483D0 24060001 */ li $a2, 1 /* 07CF44 7F0483D4 0FC1B728 */ jal subcalcpos /* 07CF48 7F0483D8 8E240014 */ lw $a0, 0x14($s1) @@ -16623,7 +16798,7 @@ glabel object_interaction /* 07D1D8 7F048668 468052A0 */ cvt.s.w $f10, $f10 /* 07D1DC 7F04866C 44053000 */ mfc1 $a1, $f6 /* 07D1E0 7F048670 44065000 */ mfc1 $a2, $f10 -/* 07D1E4 7F048674 0FC1156C */ jal sub_GAME_7F0451DC +/* 07D1E4 7F048674 0FC1156C */ jal glassCalculateOpacity /* 07D1E8 7F048678 00000000 */ nop /* 07D1EC 7F04867C 8E04008C */ lw $a0, 0x8c($s0) /* 07D1F0 7F048680 AE020088 */ sw $v0, 0x88($s0) @@ -16664,7 +16839,7 @@ glabel object_interaction /* 07D270 7F048700 46802120 */ cvt.s.w $f4, $f4 /* 07D274 7F048704 44054000 */ mfc1 $a1, $f8 /* 07D278 7F048708 44062000 */ mfc1 $a2, $f4 -/* 07D27C 7F04870C 0FC1156C */ jal sub_GAME_7F0451DC +/* 07D27C 7F04870C 0FC1156C */ jal glassCalculateOpacity /* 07D280 7F048710 00000000 */ nop /* 07D284 7F048714 A60200BE */ sh $v0, 0xbe($s0) /* 07D288 7F048718 8FB9067C */ lw $t9, 0x67c($sp) @@ -16771,7 +16946,7 @@ glabel object_interaction /* 07D3F4 7F048884 00402825 */ move $a1, $v0 /* 07D3F8 7F048888 0FC14AFA */ jal sub_GAME_7F0526EC /* 07D3FC 7F04888C AFA403A0 */ sw $a0, 0x3a0($sp) -/* 07D400 7F048890 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07D400 7F048890 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07D404 7F048894 00000000 */ nop /* 07D408 7F048898 00402025 */ move $a0, $v0 /* 07D40C 7F04889C 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -16863,7 +17038,7 @@ glabel object_interaction /* 07D560 7F0489F0 0C002386 */ jal sndPlaySfx /* 07D564 7F0489F4 E7AE0384 */ swc1 $f14, 0x384($sp) /* 07D568 7F0489F8 00402025 */ move $a0, $v0 -/* 07D56C 7F0489FC 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07D56C 7F0489FC 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07D570 7F048A00 8FA50074 */ lw $a1, 0x74($sp) .Ljp7F048A04: /* 07D574 7F048A04 10000016 */ b .Ljp7F048A60 @@ -16887,7 +17062,7 @@ glabel object_interaction /* 07D5B8 7F048A48 0C002386 */ jal sndPlaySfx /* 07D5BC 7F048A4C E7AE0384 */ swc1 $f14, 0x384($sp) /* 07D5C0 7F048A50 00402025 */ move $a0, $v0 -/* 07D5C4 7F048A54 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07D5C4 7F048A54 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07D5C8 7F048A58 8FA50074 */ lw $a1, 0x74($sp) /* 07D5CC 7F048A5C AFA00390 */ sw $zero, 0x390($sp) .Ljp7F048A60: @@ -16951,7 +17126,7 @@ glabel object_interaction /* 07D6B0 7F048B40 8FA40074 */ lw $a0, 0x74($sp) /* 07D6B4 7F048B44 0FC163AE */ jal matrix_4x4_set_position /* 07D6B8 7F048B48 27A503A8 */ addiu $a1, $sp, 0x3a8 -/* 07D6BC 7F048B4C 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07D6BC 7F048B4C 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07D6C0 7F048B50 00000000 */ nop /* 07D6C4 7F048B54 00402025 */ move $a0, $v0 /* 07D6C8 7F048B58 27A503A8 */ addiu $a1, $sp, 0x3a8 @@ -16995,12 +17170,12 @@ glabel object_interaction /* 07D758 7F048BE8 27A403A8 */ addiu $a0, $sp, 0x3a8 /* 07D75C 7F048BEC E7A40368 */ swc1 $f4, 0x368($sp) /* 07D760 7F048BF0 C6060008 */ lwc1 $f6, 8($s0) -/* 07D764 7F048BF4 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 07D764 7F048BF4 0FC16265 */ jal mtx4TransformVecInPlace /* 07D768 7F048BF8 E7A6036C */ swc1 $f6, 0x36c($sp) /* 07D76C 7F048BFC 02402025 */ move $a0, $s2 /* 07D770 7F048C00 0FC163AE */ jal matrix_4x4_set_position /* 07D774 7F048C04 8FA50070 */ lw $a1, 0x70($sp) -/* 07D778 7F048C08 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07D778 7F048C08 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07D77C 7F048C0C 00000000 */ nop /* 07D780 7F048C10 00402025 */ move $a0, $v0 /* 07D784 7F048C14 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -17037,7 +17212,7 @@ glabel object_interaction /* 07D7F8 7F048C88 C6040008 */ lwc1 $f4, 8($s0) /* 07D7FC 7F048C8C E7AC0308 */ swc1 $f12, 0x308($sp) /* 07D800 7F048C90 AFA2031C */ sw $v0, 0x31c($sp) -/* 07D804 7F048C94 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 07D804 7F048C94 0FC16265 */ jal mtx4TransformVecInPlace /* 07D808 7F048C98 E7A40314 */ swc1 $f4, 0x314($sp) /* 07D80C 7F048C9C 26450040 */ addiu $a1, $s2, 0x40 /* 07D810 7F048CA0 C7AC0308 */ lwc1 $f12, 0x308($sp) @@ -17051,7 +17226,7 @@ glabel object_interaction /* 07D830 7F048CC0 8F090014 */ lw $t1, 0x14($t8) /* 07D834 7F048CC4 0FC163E7 */ jal matrix_scalar_multiply /* 07D838 7F048CC8 C52C0014 */ lwc1 $f12, 0x14($t1) -/* 07D83C 7F048CCC 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07D83C 7F048CCC 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07D840 7F048CD0 00000000 */ nop /* 07D844 7F048CD4 00402025 */ move $a0, $v0 /* 07D848 7F048CD8 0FC1616E */ jal matrix_4x4_multiply_homogeneous_in_place @@ -17076,7 +17251,7 @@ glabel object_interaction /* 07D894 7F048D24 8C65000C */ lw $a1, 0xc($v1) /* 07D898 7F048D28 50A00016 */ beql $a1, $zero, .Ljp7F048D84 /* 07D89C 7F048D2C 8C650010 */ lw $a1, 0x10($v1) -/* 07D8A0 7F048D30 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07D8A0 7F048D30 0FC1B314 */ jal modelFindNodeMtx /* 07D8A4 7F048D34 00003025 */ move $a2, $zero /* 07D8A8 7F048D38 AFA20300 */ sw $v0, 0x300($sp) /* 07D8AC 7F048D3C 8E8F0008 */ lw $t7, 8($s4) @@ -17101,7 +17276,7 @@ glabel object_interaction /* 07D8F4 7F048D84 02802025 */ move $a0, $s4 /* 07D8F8 7F048D88 50A00010 */ beql $a1, $zero, .Ljp7F048DCC /* 07D8FC 7F048D8C 8C650018 */ lw $a1, 0x18($v1) -/* 07D900 7F048D90 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07D900 7F048D90 0FC1B314 */ jal modelFindNodeMtx /* 07D904 7F048D94 00003025 */ move $a2, $zero /* 07D908 7F048D98 8E890008 */ lw $t1, 8($s4) /* 07D90C 7F048D9C 00409025 */ move $s2, $v0 @@ -17120,7 +17295,7 @@ glabel object_interaction /* 07D93C 7F048DCC 02802025 */ move $a0, $s4 /* 07D940 7F048DD0 50A001FE */ beql $a1, $zero, .Ljp7F0495CC /* 07D944 7F048DD4 8E8C0008 */ lw $t4, 8($s4) -/* 07D948 7F048DD8 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07D948 7F048DD8 0FC1B314 */ jal modelFindNodeMtx /* 07D94C 7F048DDC 00003025 */ move $a2, $zero /* 07D950 7F048DE0 8E8A0008 */ lw $t2, 8($s4) /* 07D954 7F048DE4 8FB9031C */ lw $t9, 0x31c($sp) @@ -17479,7 +17654,7 @@ glabel object_interaction /* 07DE7C 7F04930C 158FFFF8 */ bne $t4, $t7, .Ljp7F0492F0 /* 07DE80 7F049310 ADA1FFFC */ sw $at, -4($t5) /* 07DE84 7F049314 8D810000 */ lw $at, ($t4) -/* 07DE88 7F049318 0FC1E26D */ jal currentPlayerGetMatrix10CC +/* 07DE88 7F049318 0FC1E26D */ jal camGetWorldToScreenMtxf /* 07DE8C 7F04931C ADA10000 */ sw $at, ($t5) /* 07DE90 7F049320 AFA201B4 */ sw $v0, 0x1b4($sp) /* 07DE94 7F049324 AFB201C4 */ sw $s2, 0x1c4($sp) @@ -17524,7 +17699,7 @@ glabel object_interaction /* 07DF20 7F0493B0 8C65000C */ lw $a1, 0xc($v1) /* 07DF24 7F0493B4 50A00013 */ beql $a1, $zero, .Ljp7F049404 /* 07DF28 7F0493B8 8C650010 */ lw $a1, 0x10($v1) -/* 07DF2C 7F0493BC 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07DF2C 7F0493BC 0FC1B314 */ jal modelFindNodeMtx /* 07DF30 7F0493C0 8CB20004 */ lw $s2, 4($a1) /* 07DF34 7F0493C4 00408025 */ move $s0, $v0 /* 07DF38 7F0493C8 C62C0088 */ lwc1 $f12, 0x88($s1) @@ -17547,7 +17722,7 @@ glabel object_interaction /* 07DF78 7F049408 00003025 */ move $a2, $zero /* 07DF7C 7F04940C 50A0006F */ beql $a1, $zero, .Ljp7F0495CC /* 07DF80 7F049410 8E8C0008 */ lw $t4, 8($s4) -/* 07DF84 7F049414 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07DF84 7F049414 0FC1B314 */ jal modelFindNodeMtx /* 07DF88 7F049418 8CB20004 */ lw $s2, 4($a1) /* 07DF8C 7F04941C 00408025 */ move $s0, $v0 /* 07DF90 7F049420 02402025 */ move $a0, $s2 @@ -17664,13 +17839,13 @@ glabel object_interaction /* 07E138 7F0495C8 8E8C0008 */ lw $t4, 8($s4) .Ljp7F0495CC: /* 07E13C 7F0495CC 02802025 */ move $a0, $s4 -/* 07E140 7F0495D0 0FC1BD25 */ jal sub_GAME_7F06EEA4 +/* 07E140 7F0495D0 0FC1BD25 */ jal modelUpdateRelationsQuick /* 07E144 7F0495D4 8D850000 */ lw $a1, ($t4) /* 07E148 7F0495D8 8E8D000C */ lw $t5, 0xc($s4) /* 07E14C 7F0495DC 02602025 */ move $a0, $s3 /* 07E150 7F0495E0 C5AA0038 */ lwc1 $f10, 0x38($t5) /* 07E154 7F0495E4 46005207 */ neg.s $f8, $f10 -/* 07E158 7F0495E8 0FC1101D */ jal handle_thrown_explosive_detonation +/* 07E158 7F0495E8 0FC1101D */ jal chrobjWeaponTick /* 07E15C 7F0495EC E6680018 */ swc1 $f8, 0x18($s3) /* 07E160 7F0495F0 8E640020 */ lw $a0, 0x20($s3) /* 07E164 7F0495F4 50800018 */ beql $a0, $zero, .Ljp7F049658 @@ -17688,7 +17863,7 @@ glabel object_interaction /* 07E18C 7F04961C 92790001 */ lbu $t9, 1($s3) /* 07E190 7F049620 02602025 */ move $a0, $s3 /* 07E194 7F049624 3328FFFD */ andi $t0, $t9, 0xfffd -/* 07E198 7F049628 0FC1101D */ jal handle_thrown_explosive_detonation +/* 07E198 7F049628 0FC1101D */ jal chrobjWeaponTick /* 07E19C 7F04962C A2680001 */ sb $t0, 1($s3) /* 07E1A0 7F049630 8E640020 */ lw $a0, 0x20($s3) /* 07E1A4 7F049634 50800008 */ beql $a0, $zero, .Ljp7F049658 @@ -17819,7 +17994,7 @@ glabel object_interaction /* 07E378 7F049808 0C002386 */ jal sndPlaySfx /* 07E37C 7F04980C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07E380 7F049810 8E0400C4 */ lw $a0, 0xc4($s0) -/* 07E384 7F049814 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07E384 7F049814 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07E388 7F049818 8FA50074 */ lw $a1, 0x74($sp) /* 07E38C 7F04981C 1000000D */ b .Ljp7F049854 /* 07E390 7F049820 00000000 */ nop @@ -17834,7 +18009,7 @@ glabel object_interaction /* 07E3B0 7F049840 0C002386 */ jal sndPlaySfx /* 07E3B4 7F049844 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07E3B8 7F049848 8E0400C8 */ lw $a0, 0xc8($s0) -/* 07E3BC 7F04984C 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 07E3BC 7F04984C 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 07E3C0 7F049850 8FA50074 */ lw $a1, 0x74($sp) .Ljp7F049854: /* 07E3C4 7F049854 3C0A8005 */ lui $t2, %hi(g_GlobalTimer) # $t2, 0x8005 @@ -17881,7 +18056,7 @@ glabel object_interaction /* 07E45C 7F0498EC 02802025 */ move $a0, $s4 /* 07E460 7F0498F0 50A00029 */ beql $a1, $zero, .Ljp7F049998 /* 07E464 7F0498F4 C6640008 */ lwc1 $f4, 8($s3) -/* 07E468 7F0498F8 0FC1B314 */ jal sub_GAME_7F06C660 +/* 07E468 7F0498F8 0FC1B314 */ jal modelFindNodeMtx /* 07E46C 7F0498FC 00003025 */ move $a2, $zero /* 07E470 7F049900 8E980008 */ lw $t8, 8($s4) /* 07E474 7F049904 00409025 */ move $s2, $v0 @@ -17902,7 +18077,7 @@ glabel object_interaction /* 07E4B0 7F049940 0FC161AB */ jal matrix_4x4_multiply_homogeneous /* 07E4B4 7F049944 02402825 */ move $a1, $s2 /* 07E4B8 7F049948 02202025 */ move $a0, $s1 -/* 07E4BC 7F04994C 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 07E4BC 7F04994C 0FC16265 */ jal mtx4TransformVecInPlace /* 07E4C0 7F049950 27A50130 */ addiu $a1, $sp, 0x130 /* 07E4C4 7F049954 C7A40138 */ lwc1 $f4, 0x138($sp) /* 07E4C8 7F049958 8E650008 */ lw $a1, 8($s3) @@ -17980,7 +18155,7 @@ glabel object_interaction /* 07E5DC 7F049A6C E7A00018 */ swc1 $f0, 0x18($sp) /* 07E5E0 7F049A70 E7A0001C */ swc1 $f0, 0x1c($sp) /* 07E5E4 7F049A74 E7A80010 */ swc1 $f8, 0x10($sp) -/* 07E5E8 7F049A78 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 07E5E8 7F049A78 0FC2C675 */ jal stanTestLineUnobstructed /* 07E5EC 7F049A7C E7A40024 */ swc1 $f4, 0x24($sp) /* 07E5F0 7F049A80 14400017 */ bnez $v0, .Ljp7F049AE0 /* 07E5F4 7F049A84 27A60114 */ addiu $a2, $sp, 0x114 @@ -18057,10 +18232,10 @@ glabel object_interaction /* 07E70C 7F049B9C C4282BA4 */ lwc1 $f8, %lo(D_80052B74)($at) /* 07E710 7F049BA0 3C018005 */ lui $at, %hi(g_JP_GlobalTimerDelta) # $at, 0x8005 /* 07E714 7F049BA4 C42A83A8 */ lwc1 $f10, %lo(g_JP_GlobalTimerDelta)($at) -/* 07E718 7F049BA8 3C018003 */ lui $at, %hi(F_80030B1C) # $at, 0x8003 +/* 07E718 7F049BA8 3C018003 */ lui $at, %hi(g_AutogunPendingDamageTick) # $at, 0x8003 /* 07E71C 7F049BAC 4600603C */ c.lt.s $f12, $f0 /* 07E720 7F049BB0 460A4182 */ mul.s $f6, $f8, $f10 -/* 07E724 7F049BB4 C4240B5C */ lwc1 $f4, %lo(F_80030B1C)($at) +/* 07E724 7F049BB4 C4240B5C */ lwc1 $f4, %lo(g_AutogunPendingDamageTick)($at) /* 07E728 7F049BB8 46043082 */ mul.s $f2, $f6, $f4 /* 07E72C 7F049BBC 45020005 */ bc1fl .Ljp7F049BD4 /* 07E730 7F049BC0 C60A00D4 */ lwc1 $f10, 0xd4($s0) @@ -18082,8 +18257,8 @@ glabel object_interaction /* 07E76C 7F049BFC 2404000E */ li $a0, 14 /* 07E770 7F049C00 3C013E00 */ li $at, 0x3E000000 # 0.125000 /* 07E774 7F049C04 44815000 */ mtc1 $at, $f10 -/* 07E778 7F049C08 3C018003 */ lui $at, %hi(F_80030B20) # $at, 0x8003 -/* 07E77C 7F049C0C C4240B60 */ lwc1 $f4, %lo(F_80030B20)($at) +/* 07E778 7F049C08 3C018003 */ lui $at, %hi(g_AutogunDamageScalar) # $at, 0x8003 +/* 07E77C 7F049C0C C4240B60 */ lwc1 $f4, %lo(g_AutogunDamageScalar)($at) /* 07E780 7F049C10 460A0182 */ mul.s $f6, $f0, $f10 /* 07E784 7F049C14 C60E0090 */ lwc1 $f14, 0x90($s0) /* 07E788 7F049C18 2406FFFF */ li $a2, -1 @@ -18293,7 +18468,7 @@ glabel object_interaction /* 07EA7C 7F049F0C 8FAC013C */ lw $t4, 0x13c($sp) /* 07EA80 7F049F10 A44C0000 */ sh $t4, ($v0) .Ljp7F049F14: -/* 07EA84 7F049F14 0FC1113A */ jal sub_GAME_7F044200 +/* 07EA84 7F049F14 0FC1113A */ jal objDropRecursively /* 07EA88 7F049F18 02602025 */ move $a0, $s3 /* 07EA8C 7F049F1C 8FAD0688 */ lw $t5, 0x688($sp) .Ljp7F049F20: @@ -18521,7 +18696,7 @@ glabel object_interaction /* 077F58 7F045568 8E040088 */ lw $a0, 0x88($s0) /* 077F5C 7F04556C 5080000C */ beql $a0, $zero, .L7F0455A0 /* 077F60 7F045570 8FA80680 */ lw $t0, 0x680($sp) -/* 077F64 7F045574 0FC269A7 */ jal sub_GAME_7F09B15C +/* 077F64 7F045574 0FC269A7 */ jal getPlayerPointerIndex /* 077F68 7F045578 00000000 */ nop /* 077F6C 7F04557C 04400007 */ bltz $v0, .L7F04559C /* 077F70 7F045580 3C0F8007 */ lui $t7, %hi(g_CurrentPlayer) # $t7, 0x8007 @@ -18626,7 +18801,7 @@ glabel object_interaction /* 0780D8 7F0456E8 310C0001 */ andi $t4, $t0, 1 /* 0780DC 7F0456EC 51800351 */ beql $t4, $zero, .L7F046434 /* 0780E0 7F0456F0 C6000060 */ lwc1 $f0, 0x60($s0) -/* 0780E4 7F0456F4 0FC1004E */ jal sub_GAME_7F040078 +/* 0780E4 7F0456F4 0FC1004E */ jal chrobjGetBboxFromObjectRecord /* 0780E8 7F0456F8 02202025 */ move $a0, $s1 /* 0780EC 7F0456FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0780F0 7F045700 44814000 */ mtc1 $at, $f8 @@ -18872,7 +19047,7 @@ glabel object_interaction .L7F045A94: /* 078484 7F045A94 5480002F */ bnezl $a0, .L7F045B54 /* 078488 7F045A98 8FAE060C */ lw $t6, 0x60c($sp) -/* 07848C 7F045A9C 0FC0FF0C */ jal sub_GAME_7F03FB70 +/* 07848C 7F045A9C 0FC0FF0C */ jal projectileFree /* 078490 7F045AA0 02002025 */ move $a0, $s0 /* 078494 7F045AA4 8E2F0064 */ lw $t7, 0x64($s1) /* 078498 7F045AA8 2401FF7F */ li $at, -129 @@ -18891,11 +19066,11 @@ glabel object_interaction /* 0784C8 7F045AD8 0C00209A */ jal sndPlaySfx /* 0784CC 7F045ADC 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 0784D0 7F045AE0 00402025 */ move $a0, $v0 -/* 0784D4 7F045AE4 0FC14F3C */ jal sub_GAME_7F053A10 +/* 0784D4 7F045AE4 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 0784D8 7F045AE8 26650008 */ addiu $a1, $s3, 8 /* 0784DC 7F045AEC 8E680014 */ lw $t0, 0x14($s3) /* 0784E0 7F045AF0 82240080 */ lb $a0, 0x80($s1) -/* 0784E4 7F045AF4 0FC15EB9 */ jal sub_GAME_7F0577E8 +/* 0784E4 7F045AF4 0FC15EB9 */ jal objectivestatusCheckDeposit /* 0784E8 7F045AF8 91050003 */ lbu $a1, 3($t0) /* 0784EC 7F045AFC 02202025 */ move $a0, $s1 /* 0784F0 7F045B00 27A5061C */ addiu $a1, $sp, 0x61c @@ -18905,12 +19080,12 @@ glabel object_interaction /* 078500 7F045B10 3C058003 */ lui $a1, %hi(D_80030B0C) # $a1, 0x8003 /* 078504 7F045B14 8CA5C05C */ lw $a1, %lo(D_80030B0C)($a1) /* 078508 7F045B18 02602025 */ move $a0, $s3 -/* 07850C 7F045B1C 3C068006 */ lui $a2, %hi(objinst) # $a2, 0x8006 +/* 07850C 7F045B1C 3C068006 */ lui $a2, %hi(g_CurrentProjectileModel) # $a2, 0x8006 /* 078510 7F045B20 10A0000B */ beqz $a1, .L7F045B50 /* 078514 7F045B24 3C078006 */ lui $a3, %hi(dword_CODE_bss_80075B74) # $a3, 0x8006 /* 078518 7F045B28 8E720014 */ lw $s2, 0x14($s3) -/* 07851C 7F045B2C 8CC64AB0 */ lw $a2, %lo(objinst)($a2) -/* 078520 7F045B30 0FC10ECB */ jal sub_GAME_7F043A6C +/* 07851C 7F045B2C 8CC64AB0 */ lw $a2, %lo(g_CurrentProjectileModel)($a2) +/* 078520 7F045B30 0FC10ECB */ jal objEmbed /* 078524 7F045B34 8CE74AB4 */ lw $a3, %lo(dword_CODE_bss_80075B74)($a3) /* 078528 7F045B38 10400005 */ beqz $v0, .L7F045B50 /* 07852C 7F045B3C 240C0005 */ li $t4, 5 @@ -18943,7 +19118,7 @@ glabel object_interaction /* 078590 7F045BA0 8E580004 */ lw $t8, 4($s2) /* 078594 7F045BA4 530000D9 */ beql $t8, $zero, .L7F045F0C /* 078598 7F045BA8 8FAE060C */ lw $t6, 0x60c($sp) -/* 07859C 7F045BAC 0FC269A7 */ jal sub_GAME_7F09B15C +/* 07859C 7F045BAC 0FC269A7 */ jal getPlayerPointerIndex /* 0785A0 7F045BB0 02402025 */ move $a0, $s2 /* 0785A4 7F045BB4 0FC269A4 */ jal get_cur_playernum /* 0785A8 7F045BB8 00409025 */ move $s2, $v0 @@ -19012,7 +19187,7 @@ glabel object_interaction /* 07869C 7F045CAC 31CD0200 */ andi $t5, $t6, 0x200 /* 0786A0 7F045CB0 55A00004 */ bnezl $t5, .L7F045CC4 /* 0786A4 7F045CB4 8E180090 */ lw $t8, 0x90($s0) -/* 0786A8 7F045CB8 0FC15F70 */ jal sub_GAME_7F057AC0 +/* 0786A8 7F045CB8 0FC15F70 */ jal mtxLoadRandomRotation /* 0786AC 7F045CBC 8FA40070 */ lw $a0, 0x70($sp) /* 0786B0 7F045CC0 8E180090 */ lw $t8, 0x90($s0) .L7F045CC4: @@ -19035,11 +19210,11 @@ glabel object_interaction /* 0786F4 7F045D04 10410080 */ beq $v0, $at, .L7F045F08 /* 0786F8 7F045D08 2401006E */ li $at, 110 /* 0786FC 7F045D0C 1041007E */ beq $v0, $at, .L7F045F08 -/* 078700 7F045D10 3C048006 */ lui $a0, %hi(objinst) # $a0, 0x8006 +/* 078700 7F045D10 3C048006 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8006 /* 078704 7F045D14 3C058006 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8006 /* 078708 7F045D18 8CA54AB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 07870C 7F045D1C 8C844AB0 */ lw $a0, %lo(objinst)($a0) -/* 078710 7F045D20 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07870C 7F045D1C 8C844AB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) +/* 078710 7F045D20 0FC1B366 */ jal modelFindNodeMtx /* 078714 7F045D24 00003025 */ move $a2, $zero /* 078718 7F045D28 C7A6061C */ lwc1 $f6, 0x61c($sp) /* 07871C 7F045D2C C7A80620 */ lwc1 $f8, 0x620($sp) @@ -19047,22 +19222,22 @@ glabel object_interaction /* 078724 7F045D34 00409025 */ move $s2, $v0 /* 078728 7F045D38 E7A605D4 */ swc1 $f6, 0x5d4($sp) /* 07872C 7F045D3C E7A805D8 */ swc1 $f8, 0x5d8($sp) -/* 078730 7F045D40 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 078730 7F045D40 0FC1E111 */ jal camGetWorldToScreenMtxf /* 078734 7F045D44 E7A405DC */ swc1 $f4, 0x5dc($sp) /* 078738 7F045D48 00402025 */ move $a0, $v0 -/* 07873C 7F045D4C 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 07873C 7F045D4C 0FC16247 */ jal mtx4TransformVecInPlace /* 078740 7F045D50 27A505D4 */ addiu $a1, $sp, 0x5d4 /* 078744 7F045D54 C7AA05D4 */ lwc1 $f10, 0x5d4($sp) /* 078748 7F045D58 C6460030 */ lwc1 $f6, 0x30($s2) /* 07874C 7F045D5C 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 078750 7F045D60 44810000 */ mtc1 $at, $f0 /* 078754 7F045D64 46065201 */ sub.s $f8, $f10, $f6 -/* 078758 7F045D68 3C048006 */ lui $a0, %hi(objinst) # $a0, 0x8006 +/* 078758 7F045D68 3C048006 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8006 /* 07875C 7F045D6C 3C058006 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8006 /* 078760 7F045D70 8CA54AB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) /* 078764 7F045D74 46004102 */ mul.s $f4, $f8, $f0 /* 078768 7F045D78 C7A805D8 */ lwc1 $f8, 0x5d8($sp) -/* 07876C 7F045D7C 8C844AB0 */ lw $a0, %lo(objinst)($a0) +/* 07876C 7F045D7C 8C844AB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 078770 7F045D80 46045180 */ add.s $f6, $f10, $f4 /* 078774 7F045D84 E7A605D4 */ swc1 $f6, 0x5d4($sp) /* 078778 7F045D88 C64A0034 */ lwc1 $f10, 0x34($s2) @@ -19083,32 +19258,32 @@ glabel object_interaction /* 0787B4 7F045DC4 C42A4AC8 */ lwc1 $f10, %lo(flt_CODE_bss_80075B88)($at) /* 0787B8 7F045DC8 46060102 */ mul.s $f4, $f0, $f6 /* 0787BC 7F045DCC C7A605D4 */ lwc1 $f6, 0x5d4($sp) -/* 0787C0 7F045DD0 3C048006 */ lui $a0, %hi(objinst) # $a0, 0x8006 +/* 0787C0 7F045DD0 3C048006 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8006 /* 0787C4 7F045DD4 3C058006 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8006 /* 0787C8 7F045DD8 8CA54AB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 0787CC 7F045DDC 8C844AB0 */ lw $a0, %lo(objinst)($a0) +/* 0787CC 7F045DDC 8C844AB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 0787D0 7F045DE0 460A2202 */ mul.s $f8, $f4, $f10 /* 0787D4 7F045DE4 46083101 */ sub.s $f4, $f6, $f8 /* 0787D8 7F045DE8 0FC1B4D5 */ jal getjointsize /* 0787DC 7F045DEC E7A405D4 */ swc1 $f4, 0x5d4($sp) /* 0787E0 7F045DF0 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 0787E4 7F045DF4 44815000 */ mtc1 $at, $f10 -/* 0787E8 7F045DF8 3C018006 */ lui $at, %hi(flt_CODE_bss_80075B8C) # $at, 0x8006 -/* 0787EC 7F045DFC C4284ACC */ lwc1 $f8, %lo(flt_CODE_bss_80075B8C)($at) +/* 0787E8 7F045DF8 3C018006 */ lui $at, %hi(flt_CODE_bss_80075B78) # $at, 0x8006 +/* 0787EC 7F045DFC C4284ACC */ lwc1 $f8, %lo(flt_CODE_bss_80075B78+0x14)($at) /* 0787F0 7F045E00 460A0182 */ mul.s $f6, $f0, $f10 /* 0787F4 7F045E04 C7AA05D8 */ lwc1 $f10, 0x5d8($sp) -/* 0787F8 7F045E08 3C048006 */ lui $a0, %hi(objinst) # $a0, 0x8006 +/* 0787F8 7F045E08 3C048006 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8006 /* 0787FC 7F045E0C 3C058006 */ lui $a1, %hi(dword_CODE_bss_80075B74) # $a1, 0x8006 /* 078800 7F045E10 8CA54AB4 */ lw $a1, %lo(dword_CODE_bss_80075B74)($a1) -/* 078804 7F045E14 8C844AB0 */ lw $a0, %lo(objinst)($a0) +/* 078804 7F045E14 8C844AB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 078808 7F045E18 46083102 */ mul.s $f4, $f6, $f8 /* 07880C 7F045E1C 46045181 */ sub.s $f6, $f10, $f4 /* 078810 7F045E20 0FC1B4D5 */ jal getjointsize /* 078814 7F045E24 E7A605D8 */ swc1 $f6, 0x5d8($sp) /* 078818 7F045E28 3C013F00 */ li $at, 0x3F000000 # 0.500000 /* 07881C 7F045E2C 44814000 */ mtc1 $at, $f8 -/* 078820 7F045E30 3C018006 */ lui $at, %hi(flt_CODE_bss_80075B90) # $at, 0x8006 -/* 078824 7F045E34 C4244AD0 */ lwc1 $f4, %lo(flt_CODE_bss_80075B90)($at) +/* 078820 7F045E30 3C018006 */ lui $at, %hi(flt_CODE_bss_80075B88) # $at, 0x8006 +/* 078824 7F045E34 C4244AD0 */ lwc1 $f4, %lo(flt_CODE_bss_80075B88+0x8)($at) /* 078828 7F045E38 46080282 */ mul.s $f10, $f0, $f8 /* 07882C 7F045E3C C7A805DC */ lwc1 $f8, 0x5dc($sp) /* 078830 7F045E40 02402025 */ move $a0, $s2 @@ -19118,14 +19293,14 @@ glabel object_interaction /* 078840 7F045E50 0FC168C3 */ jal matrix_4x4_7F059E64 /* 078844 7F045E54 E7AA05DC */ swc1 $f10, 0x5dc($sp) /* 078848 7F045E58 27A40594 */ addiu $a0, $sp, 0x594 -/* 07884C 7F045E5C 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 07884C 7F045E5C 0FC16247 */ jal mtx4TransformVecInPlace /* 078850 7F045E60 27A505D4 */ addiu $a1, $sp, 0x5d4 -/* 078854 7F045E64 3C048006 */ lui $a0, %hi(objinst) # $a0, 0x8006 +/* 078854 7F045E64 3C048006 */ lui $a0, %hi(g_CurrentProjectileModel) # $a0, 0x8006 /* 078858 7F045E68 3C058003 */ lui $a1, %hi(bodypartshot) # $a1, 0x8003 /* 07885C 7F045E6C 3C068006 */ lui $a2, %hi(dword_CODE_bss_80075B74) # $a2, 0x8006 /* 078860 7F045E70 8CC64AB4 */ lw $a2, %lo(dword_CODE_bss_80075B74)($a2) /* 078864 7F045E74 8CA5C060 */ lw $a1, %lo(bodypartshot)($a1) -/* 078868 7F045E78 8C844AB0 */ lw $a0, %lo(objinst)($a0) +/* 078868 7F045E78 8C844AB0 */ lw $a0, %lo(g_CurrentProjectileModel)($a0) /* 07886C 7F045E7C 0FC08869 */ jal sub_GAME_7F0221DC /* 078870 7F045E80 27A705D4 */ addiu $a3, $sp, 0x5d4 /* 078874 7F045E84 10000021 */ b .L7F045F0C @@ -19258,7 +19433,7 @@ glabel object_interaction /* 078A48 7F046058 318B0200 */ andi $t3, $t4, 0x200 /* 078A4C 7F04605C 55600004 */ bnezl $t3, .L7F046070 /* 078A50 7F046060 8E0E0090 */ lw $t6, 0x90($s0) -/* 078A54 7F046064 0FC15F70 */ jal sub_GAME_7F057AC0 +/* 078A54 7F046064 0FC15F70 */ jal mtxLoadRandomRotation /* 078A58 7F046068 8FA40070 */ lw $a0, 0x70($sp) /* 078A5C 7F04606C 8E0E0090 */ lw $t6, 0x90($s0) .L7F046070: @@ -19459,7 +19634,7 @@ glabel object_interaction /* 078D10 7F046320 00003025 */ move $a2, $zero /* 078D14 7F046324 00402025 */ move $a0, $v0 .L7F046328: -/* 078D18 7F046328 0FC14F3C */ jal sub_GAME_7F053A10 +/* 078D18 7F046328 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 078D1C 7F04632C 8FA50074 */ lw $a1, 0x74($sp) /* 078D20 7F046330 8E420000 */ lw $v0, ($s2) /* 078D24 7F046334 AE0200AC */ sw $v0, 0xac($s0) @@ -19616,7 +19791,7 @@ glabel object_interaction /* 078F58 7F046568 15E00082 */ bnez $t7, .L7F046774 /* 078F5C 7F04656C 00000000 */ nop /* 078F60 7F046570 AFB90074 */ sw $t9, 0x74($sp) -/* 078F64 7F046574 0FC1004E */ jal sub_GAME_7F040078 +/* 078F64 7F046574 0FC1004E */ jal chrobjGetBboxFromObjectRecord /* 078F68 7F046578 00009025 */ move $s2, $zero /* 078F6C 7F04657C 3C038004 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8004 /* 078F70 7F046580 8C630FF4 */ lw $v1, %lo(g_ClockTimer)($v1) @@ -19759,7 +19934,7 @@ glabel object_interaction /* 079174 7F046784 51000016 */ beql $t0, $zero, .L7F0467E0 /* 079178 7F046788 8FB90698 */ lw $t9, 0x698($sp) .L7F04678C: -/* 07917C 7F04678C 0FC0FF0C */ jal sub_GAME_7F03FB70 +/* 07917C 7F04678C 0FC0FF0C */ jal projectileFree /* 079180 7F046790 02002025 */ move $a0, $s0 /* 079184 7F046794 8E2C0064 */ lw $t4, 0x64($s1) /* 079188 7F046798 2401FF7F */ li $at, -129 @@ -19778,7 +19953,7 @@ glabel object_interaction /* 0791B8 7F0467C8 8FB90698 */ lw $t9, 0x698($sp) /* 0791BC 7F0467CC 8E6F0014 */ lw $t7, 0x14($s3) /* 0791C0 7F0467D0 82240080 */ lb $a0, 0x80($s1) -/* 0791C4 7F0467D4 0FC15EB9 */ jal sub_GAME_7F0577E8 +/* 0791C4 7F0467D4 0FC15EB9 */ jal objectivestatusCheckDeposit /* 0791C8 7F0467D8 91E50003 */ lbu $a1, 3($t7) .L7F0467DC: /* 0791CC 7F0467DC 8FB90698 */ lw $t9, 0x698($sp) @@ -19873,7 +20048,7 @@ glabel object_interaction /* 07930C 7F04691C 02002025 */ move $a0, $s0 /* 079310 7F046920 10400007 */ beqz $v0, .L7F046940 /* 079314 7F046924 00000000 */ nop -/* 079318 7F046928 0FC0F9F6 */ jal sub_GAME_7F03E718 +/* 079318 7F046928 0FC0F9F6 */ jal doorIsPadlockFree /* 07931C 7F04692C 02002025 */ move $a0, $s0 /* 079320 7F046930 10400003 */ beqz $v0, .L7F046940 /* 079324 7F046934 00000000 */ nop @@ -20039,7 +20214,7 @@ glabel object_interaction /* 07956C 7F046B7C E7A40010 */ swc1 $f4, 0x10($sp) /* 079570 7F046B80 E7A80018 */ swc1 $f8, 0x18($sp) /* 079574 7F046B84 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 079578 7F046B88 0FC2C039 */ jal sub_GAME_7F0B0E24 +/* 079578 7F046B88 0FC2C039 */ jal stanTestLineUnobstructed /* 07957C 7F046B8C E7A60024 */ swc1 $f6, 0x24($sp) /* 079580 7F046B90 10400015 */ beqz $v0, .L7F046BE8 /* 079584 7F046B94 C7B2051C */ lwc1 $f18, 0x51c($sp) @@ -20500,7 +20675,7 @@ glabel object_interaction /* 079C2C 7F04723C C642000C */ lwc1 $f2, 0xc($s2) /* 079C30 7F047240 E7B004DC */ swc1 $f16, 0x4dc($sp) /* 079C34 7F047244 E7A20020 */ swc1 $f2, 0x20($sp) -/* 079C38 7F047248 0FC2C039 */ jal sub_GAME_7F0B0E24 +/* 079C38 7F047248 0FC2C039 */ jal stanTestLineUnobstructed /* 079C3C 7F04724C E7A20024 */ swc1 $f2, 0x24($sp) /* 079C40 7F047250 1040000F */ beqz $v0, .L7F047290 /* 079C44 7F047254 C7B004DC */ lwc1 $f16, 0x4dc($sp) @@ -21182,7 +21357,7 @@ glabel object_interaction /* 07A600 7F047C10 AFAB0014 */ sw $t3, 0x14($sp) /* 07A604 7F047C14 E7AA0010 */ swc1 $f10, 0x10($sp) /* 07A608 7F047C18 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 07A60C 7F047C1C 0FC2C039 */ jal sub_GAME_7F0B0E24 +/* 07A60C 7F047C1C 0FC2C039 */ jal stanTestLineUnobstructed /* 07A610 7F047C20 E7AE001C */ swc1 $f14, 0x1c($sp) /* 07A614 7F047C24 104000F9 */ beqz $v0, .L7F04800C /* 07A618 7F047C28 02002025 */ move $a0, $s0 @@ -21194,7 +21369,7 @@ glabel object_interaction /* 07A630 7F047C40 8FA606A4 */ lw $a2, 0x6a4($sp) /* 07A634 7F047C44 3C074120 */ lui $a3, 0x4120 /* 07A638 7F047C48 E7B60014 */ swc1 $f22, 0x14($sp) -/* 07A63C 7F047C4C 0FC2C2DE */ jal sub_GAME_7F0B18B8 +/* 07A63C 7F047C4C 0FC2C2DE */ jal stanTestVolume /* 07A640 7F047C50 E7A80018 */ swc1 $f8, 0x18($sp) /* 07A644 7F047C54 044300EE */ bgezl $v0, .L7F048010 /* 07A648 7F047C58 C6260098 */ lwc1 $f6, 0x98($s1) @@ -21492,7 +21667,7 @@ glabel object_interaction /* 07AAB0 7F0480C0 3C053F99 */ lui $a1, (0x3F99999A >> 16) # lui $a1, 0x3f99 /* 07AAB4 7F0480C4 4406B000 */ mfc1 $a2, $f22 /* 07AAB8 7F0480C8 34A5999A */ ori $a1, (0x3F99999A & 0xFFFF) # ori $a1, $a1, 0x999a -/* 07AABC 7F0480CC 0FC1C02E */ jal modelSetAnimRateForDuration +/* 07AABC 7F0480CC 0FC1C02E */ jal modelSetAnimPlaySpeed /* 07AAC0 7F0480D0 8E240014 */ lw $a0, 0x14($s1) /* 07AAC4 7F0480D4 8E240014 */ lw $a0, 0x14($s1) /* 07AAC8 7F0480D8 3C188002 */ lui $t8, %hi(animation_table_ptrs2+4) # $t8, 0x8002 @@ -21551,7 +21726,7 @@ glabel object_interaction /* 07AB8C 7F04819C 3C058004 */ lui $a1, %hi(g_ClockTimer) # $a1, 0x8004 /* 07AB90 7F0481A0 8CA50FF4 */ lw $a1, %lo(g_ClockTimer)($a1) /* 07AB94 7F0481A4 8E240014 */ lw $a0, 0x14($s1) -/* 07AB98 7F0481A8 0FC1C323 */ jal sub_GAME_7F070AEC +/* 07AB98 7F0481A8 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 07AB9C 7F0481AC 24060001 */ li $a2, 1 /* 07ABA0 7F0481B0 0FC1B6B8 */ jal subcalcpos /* 07ABA4 7F0481B4 8E240014 */ lw $a0, 0x14($s1) @@ -21737,7 +21912,7 @@ glabel object_interaction /* 07AE34 7F048444 468052A0 */ cvt.s.w $f10, $f10 /* 07AE38 7F048448 44053000 */ mfc1 $a1, $f6 /* 07AE3C 7F04844C 44065000 */ mfc1 $a2, $f10 -/* 07AE40 7F048450 0FC114DC */ jal sub_GAME_7F0451DC +/* 07AE40 7F048450 0FC114DC */ jal glassCalculateOpacity /* 07AE44 7F048454 00000000 */ nop /* 07AE48 7F048458 8E04008C */ lw $a0, 0x8c($s0) /* 07AE4C 7F04845C AE020088 */ sw $v0, 0x88($s0) @@ -21778,7 +21953,7 @@ glabel object_interaction /* 07AECC 7F0484DC 46802120 */ cvt.s.w $f4, $f4 /* 07AED0 7F0484E0 44054000 */ mfc1 $a1, $f8 /* 07AED4 7F0484E4 44062000 */ mfc1 $a2, $f4 -/* 07AED8 7F0484E8 0FC114DC */ jal sub_GAME_7F0451DC +/* 07AED8 7F0484E8 0FC114DC */ jal glassCalculateOpacity /* 07AEDC 7F0484EC 00000000 */ nop /* 07AEE0 7F0484F0 A60200BE */ sh $v0, 0xbe($s0) /* 07AEE4 7F0484F4 8FAC067C */ lw $t4, 0x67c($sp) @@ -21884,7 +22059,7 @@ glabel object_interaction /* 07B04C 7F04865C 00402825 */ move $a1, $v0 /* 07B050 7F048660 0FC14A73 */ jal sub_GAME_7F0526EC /* 07B054 7F048664 AFA403A0 */ sw $a0, 0x3a0($sp) -/* 07B058 7F048668 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 07B058 7F048668 0FC1E111 */ jal camGetWorldToScreenMtxf /* 07B05C 7F04866C 00000000 */ nop /* 07B060 7F048670 00402025 */ move $a0, $v0 /* 07B064 7F048674 0FC16150 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -21976,7 +22151,7 @@ glabel object_interaction /* 07B1B8 7F0487C8 0C00209A */ jal sndPlaySfx /* 07B1BC 7F0487CC E7AE0384 */ swc1 $f14, 0x384($sp) /* 07B1C0 7F0487D0 00402025 */ move $a0, $v0 -/* 07B1C4 7F0487D4 0FC14F3C */ jal sub_GAME_7F053A10 +/* 07B1C4 7F0487D4 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 07B1C8 7F0487D8 8FA50074 */ lw $a1, 0x74($sp) .L7F0487DC: /* 07B1CC 7F0487DC 10000016 */ b .L7F048838 @@ -22000,7 +22175,7 @@ glabel object_interaction /* 07B210 7F048820 0C00209A */ jal sndPlaySfx /* 07B214 7F048824 E7AE0384 */ swc1 $f14, 0x384($sp) /* 07B218 7F048828 00402025 */ move $a0, $v0 -/* 07B21C 7F04882C 0FC14F3C */ jal sub_GAME_7F053A10 +/* 07B21C 7F04882C 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 07B220 7F048830 8FA50074 */ lw $a1, 0x74($sp) /* 07B224 7F048834 AFA00390 */ sw $zero, 0x390($sp) .L7F048838: @@ -22063,7 +22238,7 @@ glabel object_interaction /* 07B304 7F048914 02002025 */ move $a0, $s0 /* 07B308 7F048918 0FC16390 */ jal matrix_4x4_set_position /* 07B30C 7F04891C 27A503A8 */ addiu $a1, $sp, 0x3a8 -/* 07B310 7F048920 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 07B310 7F048920 0FC1E111 */ jal camGetWorldToScreenMtxf /* 07B314 7F048924 00000000 */ nop /* 07B318 7F048928 00402025 */ move $a0, $v0 /* 07B31C 7F04892C 27A503A8 */ addiu $a1, $sp, 0x3a8 @@ -22107,12 +22282,12 @@ glabel object_interaction /* 07B3AC 7F0489BC 27A403A8 */ addiu $a0, $sp, 0x3a8 /* 07B3B0 7F0489C0 E7A40368 */ swc1 $f4, 0x368($sp) /* 07B3B4 7F0489C4 C6060008 */ lwc1 $f6, 8($s0) -/* 07B3B8 7F0489C8 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 07B3B8 7F0489C8 0FC16247 */ jal mtx4TransformVecInPlace /* 07B3BC 7F0489CC E7A6036C */ swc1 $f6, 0x36c($sp) /* 07B3C0 7F0489D0 02402025 */ move $a0, $s2 /* 07B3C4 7F0489D4 0FC16390 */ jal matrix_4x4_set_position /* 07B3C8 7F0489D8 8FA50070 */ lw $a1, 0x70($sp) -/* 07B3CC 7F0489DC 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 07B3CC 7F0489DC 0FC1E111 */ jal camGetWorldToScreenMtxf /* 07B3D0 7F0489E0 00000000 */ nop /* 07B3D4 7F0489E4 00402025 */ move $a0, $v0 /* 07B3D8 7F0489E8 0FC16150 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -22149,7 +22324,7 @@ glabel object_interaction /* 07B44C 7F048A5C C6040008 */ lwc1 $f4, 8($s0) /* 07B450 7F048A60 E7AC0308 */ swc1 $f12, 0x308($sp) /* 07B454 7F048A64 AFA2031C */ sw $v0, 0x31c($sp) -/* 07B458 7F048A68 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 07B458 7F048A68 0FC16247 */ jal mtx4TransformVecInPlace /* 07B45C 7F048A6C E7A40314 */ swc1 $f4, 0x314($sp) /* 07B460 7F048A70 26450040 */ addiu $a1, $s2, 0x40 /* 07B464 7F048A74 C7AC0308 */ lwc1 $f12, 0x308($sp) @@ -22163,7 +22338,7 @@ glabel object_interaction /* 07B484 7F048A94 8D8D0014 */ lw $t5, 0x14($t4) /* 07B488 7F048A98 0FC163C9 */ jal matrix_scalar_multiply /* 07B48C 7F048A9C C5AC0014 */ lwc1 $f12, 0x14($t5) -/* 07B490 7F048AA0 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 07B490 7F048AA0 0FC1E111 */ jal camGetWorldToScreenMtxf /* 07B494 7F048AA4 00000000 */ nop /* 07B498 7F048AA8 00402025 */ move $a0, $v0 /* 07B49C 7F048AAC 0FC16150 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -22188,7 +22363,7 @@ glabel object_interaction /* 07B4E8 7F048AF8 8C65000C */ lw $a1, 0xc($v1) /* 07B4EC 7F048AFC 50A00016 */ beql $a1, $zero, .L7F048B58 /* 07B4F0 7F048B00 8C650010 */ lw $a1, 0x10($v1) -/* 07B4F4 7F048B04 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07B4F4 7F048B04 0FC1B366 */ jal modelFindNodeMtx /* 07B4F8 7F048B08 00003025 */ move $a2, $zero /* 07B4FC 7F048B0C AFA20300 */ sw $v0, 0x300($sp) /* 07B500 7F048B10 8E890008 */ lw $t1, 8($s4) @@ -22213,7 +22388,7 @@ glabel object_interaction /* 07B548 7F048B58 02802025 */ move $a0, $s4 /* 07B54C 7F048B5C 50A00010 */ beql $a1, $zero, .L7F048BA0 /* 07B550 7F048B60 8C650018 */ lw $a1, 0x18($v1) -/* 07B554 7F048B64 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07B554 7F048B64 0FC1B366 */ jal modelFindNodeMtx /* 07B558 7F048B68 00003025 */ move $a2, $zero /* 07B55C 7F048B6C 8E8D0008 */ lw $t5, 8($s4) /* 07B560 7F048B70 00409025 */ move $s2, $v0 @@ -22232,7 +22407,7 @@ glabel object_interaction /* 07B590 7F048BA0 02802025 */ move $a0, $s4 /* 07B594 7F048BA4 50A001FF */ beql $a1, $zero, .L7F0493A4 /* 07B598 7F048BA8 8E8F0008 */ lw $t7, 8($s4) -/* 07B59C 7F048BAC 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07B59C 7F048BAC 0FC1B366 */ jal modelFindNodeMtx /* 07B5A0 7F048BB0 00003025 */ move $a2, $zero /* 07B5A4 7F048BB4 8E990008 */ lw $t9, 8($s4) /* 07B5A8 7F048BB8 8FAA031C */ lw $t2, 0x31c($sp) @@ -22591,7 +22766,7 @@ glabel object_interaction /* 07BAD0 7F0490E0 15E9FFF8 */ bne $t7, $t1, .L7F0490C4 /* 07BAD4 7F0490E4 AD01FFFC */ sw $at, -4($t0) /* 07BAD8 7F0490E8 8DE10000 */ lw $at, ($t7) -/* 07BADC 7F0490EC 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 07BADC 7F0490EC 0FC1E111 */ jal camGetWorldToScreenMtxf /* 07BAE0 7F0490F0 AD010000 */ sw $at, ($t0) /* 07BAE4 7F0490F4 AFA201B4 */ sw $v0, 0x1b4($sp) /* 07BAE8 7F0490F8 AFB201C4 */ sw $s2, 0x1c4($sp) @@ -22636,7 +22811,7 @@ glabel object_interaction /* 07BB74 7F049184 8C65000C */ lw $a1, 0xc($v1) /* 07BB78 7F049188 50A00013 */ beql $a1, $zero, .L7F0491D8 /* 07BB7C 7F04918C 8C650010 */ lw $a1, 0x10($v1) -/* 07BB80 7F049190 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07BB80 7F049190 0FC1B366 */ jal modelFindNodeMtx /* 07BB84 7F049194 8CB20004 */ lw $s2, 4($a1) /* 07BB88 7F049198 00408025 */ move $s0, $v0 /* 07BB8C 7F04919C C62C0088 */ lwc1 $f12, 0x88($s1) @@ -22659,7 +22834,7 @@ glabel object_interaction /* 07BBCC 7F0491DC 00003025 */ move $a2, $zero /* 07BBD0 7F0491E0 50A00070 */ beql $a1, $zero, .L7F0493A4 /* 07BBD4 7F0491E4 8E8F0008 */ lw $t7, 8($s4) -/* 07BBD8 7F0491E8 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07BBD8 7F0491E8 0FC1B366 */ jal modelFindNodeMtx /* 07BBDC 7F0491EC 8CB20004 */ lw $s2, 4($a1) /* 07BBE0 7F0491F0 00408025 */ move $s0, $v0 /* 07BBE4 7F0491F4 02402025 */ move $a0, $s2 @@ -22777,13 +22952,13 @@ glabel object_interaction /* 07BD90 7F0493A0 8E8F0008 */ lw $t7, 8($s4) .L7F0493A4: /* 07BD94 7F0493A4 02802025 */ move $a0, $s4 -/* 07BD98 7F0493A8 0FC1BCA4 */ jal sub_GAME_7F06EEA4 +/* 07BD98 7F0493A8 0FC1BCA4 */ jal modelUpdateRelationsQuick /* 07BD9C 7F0493AC 8DE50000 */ lw $a1, ($t7) /* 07BDA0 7F0493B0 8E88000C */ lw $t0, 0xc($s4) /* 07BDA4 7F0493B4 02602025 */ move $a0, $s3 /* 07BDA8 7F0493B8 C50A0038 */ lwc1 $f10, 0x38($t0) /* 07BDAC 7F0493BC 46005207 */ neg.s $f8, $f10 -/* 07BDB0 7F0493C0 0FC10F8D */ jal handle_thrown_explosive_detonation +/* 07BDB0 7F0493C0 0FC10F8D */ jal chrobjWeaponTick /* 07BDB4 7F0493C4 E6680018 */ swc1 $f8, 0x18($s3) /* 07BDB8 7F0493C8 8E640020 */ lw $a0, 0x20($s3) /* 07BDBC 7F0493CC 50800018 */ beql $a0, $zero, .L7F049430 @@ -22801,7 +22976,7 @@ glabel object_interaction /* 07BDE4 7F0493F4 926A0001 */ lbu $t2, 1($s3) /* 07BDE8 7F0493F8 02602025 */ move $a0, $s3 /* 07BDEC 7F0493FC 314BFFFD */ andi $t3, $t2, 0xfffd -/* 07BDF0 7F049400 0FC10F8D */ jal handle_thrown_explosive_detonation +/* 07BDF0 7F049400 0FC10F8D */ jal chrobjWeaponTick /* 07BDF4 7F049404 A26B0001 */ sb $t3, 1($s3) /* 07BDF8 7F049408 8E640020 */ lw $a0, 0x20($s3) /* 07BDFC 7F04940C 50800008 */ beql $a0, $zero, .L7F049430 @@ -22932,7 +23107,7 @@ glabel object_interaction /* 07BFD0 7F0495E0 0C00209A */ jal sndPlaySfx /* 07BFD4 7F0495E4 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07BFD8 7F0495E8 8E0400C4 */ lw $a0, 0xc4($s0) -/* 07BFDC 7F0495EC 0FC14F3C */ jal sub_GAME_7F053A10 +/* 07BFDC 7F0495EC 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 07BFE0 7F0495F0 8FA50074 */ lw $a1, 0x74($sp) /* 07BFE4 7F0495F4 1000000D */ b .L7F04962C /* 07BFE8 7F0495F8 00000000 */ nop @@ -22947,7 +23122,7 @@ glabel object_interaction /* 07C008 7F049618 0C00209A */ jal sndPlaySfx /* 07C00C 7F04961C 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 07C010 7F049620 8E0400C8 */ lw $a0, 0xc8($s0) -/* 07C014 7F049624 0FC14F3C */ jal sub_GAME_7F053A10 +/* 07C014 7F049624 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 07C018 7F049628 8FA50074 */ lw $a1, 0x74($sp) .L7F04962C: /* 07C01C 7F04962C 3C198004 */ lui $t9, %hi(g_GlobalTimer) # $t9, 0x8004 @@ -22994,7 +23169,7 @@ glabel object_interaction /* 07C0B4 7F0496C4 02802025 */ move $a0, $s4 /* 07C0B8 7F0496C8 50A00029 */ beql $a1, $zero, .L7F049770 /* 07C0BC 7F0496CC C6640008 */ lwc1 $f4, 8($s3) -/* 07C0C0 7F0496D0 0FC1B366 */ jal sub_GAME_7F06C660 +/* 07C0C0 7F0496D0 0FC1B366 */ jal modelFindNodeMtx /* 07C0C4 7F0496D4 00003025 */ move $a2, $zero /* 07C0C8 7F0496D8 8E8C0008 */ lw $t4, 8($s4) /* 07C0CC 7F0496DC 00409025 */ move $s2, $v0 @@ -23015,7 +23190,7 @@ glabel object_interaction /* 07C108 7F049718 0FC1618D */ jal matrix_4x4_multiply_homogeneous /* 07C10C 7F04971C 02402825 */ move $a1, $s2 /* 07C110 7F049720 02202025 */ move $a0, $s1 -/* 07C114 7F049724 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 07C114 7F049724 0FC16247 */ jal mtx4TransformVecInPlace /* 07C118 7F049728 27A50130 */ addiu $a1, $sp, 0x130 /* 07C11C 7F04972C C7A40138 */ lwc1 $f4, 0x138($sp) /* 07C120 7F049730 8E650008 */ lw $a1, 8($s3) @@ -23093,7 +23268,7 @@ glabel object_interaction /* 07C234 7F049844 E7A00018 */ swc1 $f0, 0x18($sp) /* 07C238 7F049848 E7A0001C */ swc1 $f0, 0x1c($sp) /* 07C23C 7F04984C E7A80010 */ swc1 $f8, 0x10($sp) -/* 07C240 7F049850 0FC2C039 */ jal sub_GAME_7F0B0E24 +/* 07C240 7F049850 0FC2C039 */ jal stanTestLineUnobstructed /* 07C244 7F049854 E7A40024 */ swc1 $f4, 0x24($sp) /* 07C248 7F049858 14400017 */ bnez $v0, .L7F0498B8 /* 07C24C 7F04985C 27A60114 */ addiu $a2, $sp, 0x114 @@ -23170,10 +23345,10 @@ glabel object_interaction /* 07C364 7F049974 C4288CB4 */ lwc1 $f8, %lo(D_80052B74)($at) /* 07C368 7F049978 3C018004 */ lui $at, %hi(g_GlobalTimerDelta) # $at, 0x8004 /* 07C36C 7F04997C C42A1004 */ lwc1 $f10, %lo(g_GlobalTimerDelta)($at) -/* 07C370 7F049980 3C018003 */ lui $at, %hi(F_80030B1C) # $at, 0x8003 +/* 07C370 7F049980 3C018003 */ lui $at, %hi(g_AutogunPendingDamageTick) # $at, 0x8003 /* 07C374 7F049984 4600603C */ c.lt.s $f12, $f0 /* 07C378 7F049988 460A4182 */ mul.s $f6, $f8, $f10 -/* 07C37C 7F04998C C424C06C */ lwc1 $f4, %lo(F_80030B1C)($at) +/* 07C37C 7F04998C C424C06C */ lwc1 $f4, %lo(g_AutogunPendingDamageTick)($at) /* 07C380 7F049990 46043082 */ mul.s $f2, $f6, $f4 /* 07C384 7F049994 45020005 */ bc1fl .L7F0499AC /* 07C388 7F049998 C60A00D4 */ lwc1 $f10, 0xd4($s0) @@ -23195,8 +23370,8 @@ glabel object_interaction /* 07C3C4 7F0499D4 2404000E */ li $a0, 14 /* 07C3C8 7F0499D8 3C013E00 */ li $at, 0x3E000000 # 0.125000 /* 07C3CC 7F0499DC 44815000 */ mtc1 $at, $f10 -/* 07C3D0 7F0499E0 3C018003 */ lui $at, %hi(F_80030B20) # $at, 0x8003 -/* 07C3D4 7F0499E4 C424C070 */ lwc1 $f4, %lo(F_80030B20)($at) +/* 07C3D0 7F0499E0 3C018003 */ lui $at, %hi(g_AutogunDamageScalar) # $at, 0x8003 +/* 07C3D4 7F0499E4 C424C070 */ lwc1 $f4, %lo(g_AutogunDamageScalar)($at) /* 07C3D8 7F0499E8 460A0182 */ mul.s $f6, $f0, $f10 /* 07C3DC 7F0499EC C60E0090 */ lwc1 $f14, 0x90($s0) /* 07C3E0 7F0499F0 2406FFFF */ li $a2, -1 @@ -23406,7 +23581,7 @@ glabel object_interaction /* 07C6D4 7F049CE4 8FAF013C */ lw $t7, 0x13c($sp) /* 07C6D8 7F049CE8 A44F0000 */ sh $t7, ($v0) .L7F049CEC: -/* 07C6DC 7F049CEC 0FC110AA */ jal sub_GAME_7F044200 +/* 07C6DC 7F049CEC 0FC110AA */ jal objDropRecursively /* 07C6E0 7F049CF0 02602025 */ move $a0, $s3 /* 07C6E4 7F049CF4 8FA80688 */ lw $t0, 0x688($sp) .L7F049CF8: @@ -23492,7 +23667,7 @@ glabel sub_GAME_7F049B58 /* 07E73C 7F049C0C 8E0F0004 */ lw $t7, 4($s0) /* 07E740 7F049C10 51E00011 */ beql $t7, $zero, .L7F049C58 /* 07E744 7F049C14 8E100024 */ lw $s0, 0x24($s0) -/* 07E748 7F049C18 0FC26C57 */ jal sub_GAME_7F09B15C +/* 07E748 7F049C18 0FC26C57 */ jal getPlayerPointerIndex /* 07E74C 7F049C1C 02002025 */ move $a0, $s0 /* 07E750 7F049C20 0FC26C54 */ jal get_cur_playernum /* 07E754 7F049C24 00408825 */ move $s1, $v0 @@ -23533,7 +23708,7 @@ glabel sub_GAME_7F049B58 void save_ptr_monitor_ani_code_to_obj_ani_slot(MonitorRecord *mon, void *image) { - mon->image = image; + mon->cmdlist = image; mon->offset = 0; } @@ -23709,12 +23884,336 @@ void monitorSetImageByNum(MonitorRecord *mon, s32 monAnimID) void save_img_index_to_obj_ani_slot(MonitorRecord *mon, void *unk88) { - mon->unk88 = unk88; + mon->tconfig = unk88; } #ifdef NONMATCHING + +struct tvcmd { + u32 type; + s32 arg1; + u32 arg2; +}; + +// Almost matching - only regalloc issues left (for VERSION_US) +// Called tvscreenRender in PD + +Gfx *process_monitor_animation_microcode(Model *model, ModelNode *node, MonitorRecord *screen, Gfx *gdl, s32 arg4, s32 arg5) +{ + if (node && (node->Opcode & 0xff) == MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD) { + Vertex *vertices = dynAllocate7F0BD6C4(4); + Gfx *savedgdl = gdl++; + union ModelRoData *rodata = node->Data; + union ModelRwData *rwdata = modelGetNodeRwData(model, node); + sImageTableEntry *tconfig; + bool yielding = FALSE; + + while (!yielding) { + struct tvcmd *cmd = (struct tvcmd *) &screen->cmdlist[screen->offset]; + + switch (cmd->type) { + case TVCMD_STOPSCROLL: + screen->xmidinc = 0.0f; + screen->ymidinc = 0.0f; + screen->offset++; + break; + case TVCMD_SCROLLRELX: + screen->xmidfrac = 0.0f; + screen->xmidinc = 1.0f / cmd->arg2; + screen->xmidold = screen->xmid; + screen->xmidnew = screen->xmid + cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SCROLLRELY: + screen->ymidfrac = 0.0f; + screen->ymidinc = 1.0f / cmd->arg2; + screen->ymidold = screen->ymid; + screen->ymidnew = screen->ymid + cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SCROLLABSX: + screen->xmidfrac = 0.0f; + screen->xmidinc = 1.0f / cmd->arg2; + screen->xmidold = screen->xmid; + screen->xmidnew = cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SCROLLABSY: + screen->ymidfrac = 0.0f; + screen->ymidinc = 1.0f / cmd->arg2; + screen->ymidold = screen->ymid; + screen->ymidnew = cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SCALEABSX: + screen->xscalefrac = 0.0f; + screen->xscaleinc = 1.0f / cmd->arg2; + screen->xscaleold = screen->xscale; + screen->xscalenew = cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SCALEABSY: + screen->yscalefrac = 0.0f; + screen->yscaleinc = 1.0f / cmd->arg2; + screen->yscaleold = screen->yscale; + screen->yscalenew = cmd->arg1 * (1.0f / 1024.0f); + screen->offset += 3; + break; + case TVCMD_SETTEXTURE: + save_img_index_to_obj_ani_slot(screen, cmd->arg1); + screen->offset += 2; + break; + case TVCMD_PAUSE: + if (screen->pause60 >= 0) { + screen->pause60 -= g_ClockTimer; + + if (screen->pause60 >= 0) { + yielding = TRUE; + } else { + screen->offset += 2; + } + } else { + yielding = TRUE; + screen->pause60 = cmd->arg1; + } + break; + case TVCMD_SETCMDLIST: + save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) cmd->arg1); + break; + case TVCMD_RANDSETCMDLIST: + if ((randomGetNext() >> 16) < cmd->arg2) { + save_ptr_monitor_ani_code_to_obj_ani_slot(screen, (u32 *) cmd->arg1); + } else { + screen->offset += 3; + } + break; + case TVCMD_RESTART: + screen->offset = 0; + break; + case TVCMD_YIELD: + yielding = TRUE; + break; + case TVCMD_SETCOLOUR: + screen->colfrac = 0.0f; + screen->colinc = 1.0f / cmd->arg2; + + screen->redold = screen->red; + screen->rednew = ((u32)cmd->arg1 >> 24) & 0xff; + + screen->greenold = screen->green; + screen->greennew = ((u32)cmd->arg1 >> 16) & 0xff; + + screen->blueold = screen->blue; + screen->bluenew = ((u32)cmd->arg1 >> 8) & 0xff; + + screen->alphaold = screen->alpha; + screen->alphanew = cmd->arg1 & 0xff; + + screen->offset += 3; + break; + case TVCMD_ROTATEABS: + screen->rot = cmd->arg1 * M_TAU_F / M_U16_MAX_VALUE_F; + screen->offset += 2; + break; + case TVCMD_ROTATEREL: + screen->rot += g_GlobalTimerDelta * cmd->arg1 * M_TAU_F / M_U16_MAX_VALUE_F; + + if (screen->rot >= M_TAU_F) { + screen->rot -= M_TAU_F; + } + + if (screen->rot < 0.0f) { + screen->rot += M_TAU_F; + } + + screen->offset += 2; + break; + } + } + + // Increment X scale + if (screen->xscaleinc > 0.0f) { + screen->xscalefrac += screen->xscaleinc * g_GlobalTimerDelta; + + if (screen->xscalefrac < 1.0f) { + screen->xscale = screen->xscaleold + (screen->xscalenew - screen->xscaleold) * screen->xscalefrac; + } else { + screen->xscalefrac = 1.0f; + screen->xscaleinc = 0.0f; + screen->xscale = screen->xscalenew; + } + } + + // Increment Y scale + if (screen->yscaleinc > 0.0f) { + screen->yscalefrac += screen->yscaleinc * g_GlobalTimerDelta; + + if (screen->yscalefrac < 1.0f) { + screen->yscale = screen->yscaleold + (screen->yscalenew - screen->yscaleold) * screen->yscalefrac; + } else { + screen->yscalefrac = 1.0f; + screen->yscaleinc = 0.0f; + screen->yscale = screen->yscalenew; + } + } + + // Increment X scroll + if (screen->xmidinc > 0.0f) { + screen->xmidfrac += screen->xmidinc * g_GlobalTimerDelta; + + if (screen->xmidfrac < 1.0f) { + screen->xmid = screen->xmidold + (screen->xmidnew - screen->xmidold) * screen->xmidfrac; + } else { + screen->xmidfrac = 1.0f; + screen->xmidinc = 0.0f; + screen->xmid = screen->xmidnew; + } + } + + // Increment Y scroll + if (screen->ymidinc > 0.0f) { + screen->ymidfrac += screen->ymidinc * g_GlobalTimerDelta; + + if (screen->ymidfrac < 1.0f) { + screen->ymid = screen->ymidold + (screen->ymidnew - screen->ymidold) * screen->ymidfrac; + } else { + screen->ymidfrac = 1.0f; + screen->ymidinc = 0.0f; + screen->ymid = screen->ymidnew; + } + } + + // Increment colour change + if (screen->colinc > 0.0f) { + screen->colfrac += screen->colinc * g_GlobalTimerDelta; + + if (screen->colfrac < 1.0f) { + screen->red = screen->redold + (s32) ((screen->rednew - screen->redold) * screen->colfrac); + screen->green = screen->greenold + (s32) ((screen->greennew - screen->greenold) * screen->colfrac); + screen->blue = screen->blueold + (s32) ((screen->bluenew - screen->blueold) * screen->colfrac); + screen->alpha = screen->alphaold + (s32) ((screen->alphanew - screen->alphaold) * screen->colfrac); + } else { + screen->colfrac = 1.0f; + screen->colinc = 0.0f; + screen->red = screen->rednew; + screen->green = screen->greennew; + screen->blue = screen->bluenew; + screen->alpha = screen->alphanew; + } + } + + // Set up everything for rendering + rwdata->DisplayListCollisions.gdl = gdl; + rwdata->DisplayListCollisions.Vertices = vertices; + + vertices[0] = rodata->DisplayListCollisions.Vertices[0]; + vertices[1] = rodata->DisplayListCollisions.Vertices[1]; + vertices[2] = rodata->DisplayListCollisions.Vertices[2]; + vertices[3] = rodata->DisplayListCollisions.Vertices[3]; + + if ((u32)screen->tconfig < 100) { + tconfig = &monitorimages[(s32)screen->tconfig]; + } else { + tconfig = screen->tconfig; + } + + if (tconfig != NULL) { + u32 stack[13]; + f32 f22; // sp54 + f32 f24; // sp50 + f32 f14; + f32 f16; + + f22 = screen->xscale / 2.0f; + f24 = screen->yscale / 2.0f; + f14 = f22; + f16 = f24; + + if (1); + if (1); + if (1); + if (1); + if (1); + + if (screen->rot != 0.0f) { + f32 f20; + f32 f2_6; + + f20 = cosf(screen->rot) * 1.4142f; + f2_6 = sinf(screen->rot) * 1.4142f; + + f22 *= f20; + f24 *= f2_6; + f14 *= f2_6; + f16 *= f20; + } + + vertices[0].s = tconfig->width * (screen->xmid + f22) * 32.0f; + vertices[0].t = tconfig->height * (screen->ymid + f24) * 32.0f; + + vertices[1].s = tconfig->width * (screen->xmid - f14) * 32.0f; + vertices[1].t = tconfig->height * (screen->ymid + f16) * 32.0f; + + vertices[2].s = tconfig->width * (screen->xmid - f22) * 32.0f; + vertices[2].t = tconfig->height * (screen->ymid - f24) * 32.0f; + + vertices[3].s = tconfig->width * (screen->xmid + f14) * 32.0f; + vertices[3].t = tconfig->height * (screen->ymid - f16) * 32.0f; + } + + if (1) { + u8 tmpc; + u8 tmpc2; + tmpc = screen->red; + vertices[3].r = tmpc; + vertices[2].r = tmpc; + vertices[1].r = tmpc; + vertices[0].r = tmpc; + + tmpc = screen->green; + vertices[3].g = tmpc; + vertices[2].g = tmpc; + vertices[1].g = tmpc; + vertices[0].g = tmpc; + + tmpc2 = screen->blue; + vertices[3].b = tmpc2; + vertices[2].b = tmpc2; + vertices[1].b = tmpc2; + vertices[0].b = tmpc2; + + tmpc = screen->alpha; + vertices[3].a = tmpc; + vertices[2].a = tmpc; + vertices[1].a = tmpc; + vertices[0].a = tmpc; + } + + if (screen->alpha < 255) { + arg5 = 2; + } + + // Render the image + gSPSetGeometryMode(gdl++, G_CULL_BACK); + + likely_generate_DL_for_image_declaration(&gdl, tconfig, arg5, arg4, 2); + + gSPMatrix(gdl++, osVirtualToPhysical(model->render_pos), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(gdl++, SPSEGMENT_MODEL_VTX, osVirtualToPhysical(vertices)); + gSPVertex(gdl++, 0x04000000, 4, 0); + gDPTri2(gdl++, 0, 1, 2, 0, 2, 3); + gSPEndDisplayList(gdl++); + + gSPBranchList(savedgdl++, gdl); + } + + return gdl; +} + +// keeping old decompilation around for comparison's sake until a match is found: +#if 0 void *process_monitor_animation_microcode(Model *arg0, ModelNode *arg1, MonitorRecord *arg2, void *arg3, s32 arg4, s32 arg5) { void *spA8; @@ -23824,7 +24323,7 @@ void *process_monitor_animation_microcode(Model *arg0, ModelNode *arg1, MonitorR f32 phi_f4_2; f32 phi_f10_2; - if ((arg1 != 0) && ((arg1->Opcode & 0xFF) == MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD)) + if ((arg1 != 0) && ((arg1->Opcode & 0xFF) == MODELNODE_OPCODE_DLCOLLISION)) { temp_t8 = arg3; temp_s2 = dynAllocate7F0BD6C4(4); @@ -24278,6 +24777,7 @@ void *process_monitor_animation_microcode(Model *arg0, ModelNode *arg1, MonitorR } return arg3; } +#endif #else #ifdef VERSION_US @@ -27270,7 +27770,7 @@ glabel sub_GAME_7F04AC20 /* 07FA60 7F04AF30 8FA40074 */ lw $a0, 0x74($sp) .L7F04AF34: /* 07FA64 7F04AF34 AFA50040 */ sw $a1, 0x40($sp) -/* 07FA68 7F04AF38 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 07FA68 7F04AF38 0FC0FFF0 */ jal objGetDestroyedLevel /* 07FA6C 7F04AF3C AFA70064 */ sw $a3, 0x64($sp) /* 07FA70 7F04AF40 8FA50040 */ lw $a1, 0x40($sp) /* 07FA74 7F04AF44 10400003 */ beqz $v0, .L7F04AF54 @@ -27289,7 +27789,7 @@ glabel sub_GAME_7F04AC20 /* 07FAA4 7F04AF74 1000001F */ b .L7F04AFF4 /* 07FAA8 7F04AF78 AE090034 */ sw $t1, 0x34($s0) .L7F04AF7C: -/* 07FAAC 7F04AF7C 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 07FAAC 7F04AF7C 0FC0FFF0 */ jal objGetDestroyedLevel /* 07FAB0 7F04AF80 AFA70064 */ sw $a3, 0x64($sp) /* 07FAB4 7F04AF84 8E0C0030 */ lw $t4, 0x30($s0) /* 07FAB8 7F04AF88 8FA70064 */ lw $a3, 0x64($sp) @@ -27429,6 +27929,7 @@ glabel sub_GAME_7F04AC20 /** * Address 0x7F04B150. */ + Gfx *chrobjRenderProp(PropRecord *prop, Gfx *gdl, s32 arg2) { struct rgba_f32 spB0; @@ -27513,11 +28014,11 @@ Gfx *chrobjRenderProp(PropRecord *prop, Gfx *gdl, s32 arg2) if (obj->type == PROPDEF_TINTED_GLASS) { - jlist.unk34 = ((struct TintedGlassRecord*)obj)->unk88 << 8; + jlist.unk34 = ((struct TintedGlassRecord*)obj)->calculatedopacity << 8; } else if ((obj->type == PROPDEF_DOOR) && ((((struct DoorRecord*)obj)->doorFlags & 2) != 0)) { - jlist.unk34 = ((struct DoorRecord*)obj)->unkbe << 8; + jlist.unk34 = ((struct DoorRecord*)obj)->calculatedopacity << 8; } else { @@ -27525,7 +28026,7 @@ Gfx *chrobjRenderProp(PropRecord *prop, Gfx *gdl, s32 arg2) } } - temp_v0_4 = sub_GAME_7F03FF60(obj); + temp_v0_4 = objGetShotsTaken(obj); phi_a0 = 0xFF - (temp_v0_4 * 0x15); if (phi_a0 < 0) @@ -27533,10 +28034,10 @@ Gfx *chrobjRenderProp(PropRecord *prop, Gfx *gdl, s32 arg2) phi_a0 = 0; } - sp48.r = (s32) (obj->field_78.rgba[0] * phi_a0) >> 8; - sp48.g = (s32) (obj->field_78.rgba[1] * phi_a0) >> 8; - sp48.b = (s32) (obj->field_78.rgba[2] * phi_a0) >> 8; - sp48.a = obj->field_78.rgba[3] + temp_v0_4 * 0xF; + sp48.r = (s32) (obj->shadecol.rgba[0] * phi_a0) >> 8; + sp48.g = (s32) (obj->shadecol.rgba[1] * phi_a0) >> 8; + sp48.b = (s32) (obj->shadecol.rgba[2] * phi_a0) >> 8; + sp48.a = obj->shadecol.rgba[3] + temp_v0_4 * 0xF; if (sp48.a >= 0x100) { @@ -27553,154 +28054,76 @@ Gfx *chrobjRenderProp(PropRecord *prop, Gfx *gdl, s32 arg2) } +ModelNode* sub_GAME_7F04B478(ObjectRecord* obj) +{ + ModelFileHeader* header = obj->model->obj; + ModelNode *node = header->RootNode; + while (node) + { + u32 type = node->Opcode & 0xff; -#ifdef NONMATCHING -void sub_GAME_7F04B478(void) { - -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04B478 -/* 07FFA8 7F04B478 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 07FFAC 7F04B47C AFBF002C */ sw $ra, 0x2c($sp) -/* 07FFB0 7F04B480 AFB50028 */ sw $s5, 0x28($sp) -/* 07FFB4 7F04B484 AFB40024 */ sw $s4, 0x24($sp) -/* 07FFB8 7F04B488 AFB30020 */ sw $s3, 0x20($sp) -/* 07FFBC 7F04B48C AFB2001C */ sw $s2, 0x1c($sp) -/* 07FFC0 7F04B490 AFB10018 */ sw $s1, 0x18($sp) -/* 07FFC4 7F04B494 AFB00014 */ sw $s0, 0x14($sp) -/* 07FFC8 7F04B498 8C8E0014 */ lw $t6, 0x14($a0) -/* 07FFCC 7F04B49C 00808825 */ move $s1, $a0 -/* 07FFD0 7F04B4A0 24120008 */ li $s2, 8 -/* 07FFD4 7F04B4A4 8DC20008 */ lw $v0, 8($t6) -/* 07FFD8 7F04B4A8 24130012 */ li $s3, 18 -/* 07FFDC 7F04B4AC 24140017 */ li $s4, 23 -/* 07FFE0 7F04B4B0 8C500000 */ lw $s0, ($v0) -/* 07FFE4 7F04B4B4 24150018 */ li $s5, 24 -/* 07FFE8 7F04B4B8 5200002C */ beql $s0, $zero, .L7F04B56C -/* 07FFEC 7F04B4BC 00001025 */ move $v0, $zero -/* 07FFF0 7F04B4C0 96020000 */ lhu $v0, ($s0) -.L7F04B4C4: -/* 07FFF4 7F04B4C4 02002825 */ move $a1, $s0 -/* 07FFF8 7F04B4C8 304F00FF */ andi $t7, $v0, 0xff -/* 07FFFC 7F04B4CC 11F2000B */ beq $t7, $s2, .L7F04B4FC -/* 080000 7F04B4D0 00000000 */ nop -/* 080004 7F04B4D4 11F3000D */ beq $t7, $s3, .L7F04B50C -/* 080008 7F04B4D8 02002825 */ move $a1, $s0 -/* 08000C 7F04B4DC 11F4000F */ beq $t7, $s4, .L7F04B51C -/* 080010 7F04B4E0 02002825 */ move $a1, $s0 -/* 080014 7F04B4E4 11F50003 */ beq $t7, $s5, .L7F04B4F4 -/* 080018 7F04B4E8 00000000 */ nop -/* 08001C 7F04B4EC 1000000E */ b .L7F04B528 -/* 080020 7F04B4F0 8E020014 */ lw $v0, 0x14($s0) -.L7F04B4F4: -/* 080024 7F04B4F4 1000001D */ b .L7F04B56C -/* 080028 7F04B4F8 02001025 */ move $v0, $s0 -.L7F04B4FC: -/* 08002C 7F04B4FC 0FC1BA5C */ jal sub_GAME_7F06E970 -/* 080030 7F04B500 8E240014 */ lw $a0, 0x14($s1) -/* 080034 7F04B504 10000008 */ b .L7F04B528 -/* 080038 7F04B508 8E020014 */ lw $v0, 0x14($s0) -.L7F04B50C: -/* 08003C 7F04B50C 0FC1BA6F */ jal process_12_handle_switch -/* 080040 7F04B510 8E240014 */ lw $a0, 0x14($s1) -/* 080044 7F04B514 10000004 */ b .L7F04B528 -/* 080048 7F04B518 8E020014 */ lw $v0, 0x14($s0) -.L7F04B51C: -/* 08004C 7F04B51C 0FC1BA82 */ jal process_17_pointer_to_head -/* 080050 7F04B520 8E240014 */ lw $a0, 0x14($s1) -/* 080054 7F04B524 8E020014 */ lw $v0, 0x14($s0) -.L7F04B528: -/* 080058 7F04B528 10400003 */ beqz $v0, .L7F04B538 -/* 08005C 7F04B52C 00000000 */ nop -/* 080060 7F04B530 1000000B */ b .L7F04B560 -/* 080064 7F04B534 00408025 */ move $s0, $v0 -.L7F04B538: -/* 080068 7F04B538 12000009 */ beqz $s0, .L7F04B560 -/* 08006C 7F04B53C 00000000 */ nop -/* 080070 7F04B540 8E02000C */ lw $v0, 0xc($s0) -.L7F04B544: -/* 080074 7F04B544 50400004 */ beql $v0, $zero, .L7F04B558 -/* 080078 7F04B548 8E100008 */ lw $s0, 8($s0) -/* 08007C 7F04B54C 10000004 */ b .L7F04B560 -/* 080080 7F04B550 00408025 */ move $s0, $v0 -/* 080084 7F04B554 8E100008 */ lw $s0, 8($s0) -.L7F04B558: -/* 080088 7F04B558 5600FFFA */ bnezl $s0, .L7F04B544 -/* 08008C 7F04B55C 8E02000C */ lw $v0, 0xc($s0) -.L7F04B560: -/* 080090 7F04B560 5600FFD8 */ bnezl $s0, .L7F04B4C4 -/* 080094 7F04B564 96020000 */ lhu $v0, ($s0) -/* 080098 7F04B568 00001025 */ move $v0, $zero -.L7F04B56C: -/* 08009C 7F04B56C 8FBF002C */ lw $ra, 0x2c($sp) -/* 0800A0 7F04B570 8FB00014 */ lw $s0, 0x14($sp) -/* 0800A4 7F04B574 8FB10018 */ lw $s1, 0x18($sp) -/* 0800A8 7F04B578 8FB2001C */ lw $s2, 0x1c($sp) -/* 0800AC 7F04B57C 8FB30020 */ lw $s3, 0x20($sp) -/* 0800B0 7F04B580 8FB40024 */ lw $s4, 0x24($sp) -/* 0800B4 7F04B584 8FB50028 */ lw $s5, 0x28($sp) -/* 0800B8 7F04B588 03E00008 */ jr $ra -/* 0800BC 7F04B58C 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - + switch (type) + { + case MODELNODE_OPCODE_DLCOLLISION: + return node; + case MODELNODE_OPCODE_LOD: + modelApplyDistanceRelations(obj->model, node); + break; + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(obj->model, node); + break; + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(obj->model, node); + break; + } + if (node->Child) + { + node = node->Child; + } + else + { + while (node) + { + if (node->Next) + { + node = node->Next; + break; + } + node = node->Parent; + } + } + } + return NULL; +} -#ifdef NONMATCHING -void sub_GAME_7F04B590(void) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04B590 -/* 0800C0 7F04B590 8C820004 */ lw $v0, 4($a0) -/* 0800C4 7F04B594 3C0E8004 */ lui $t6, %hi(skeleton_console_one_screen) -/* 0800C8 7F04B598 25CEA070 */ addiu $t6, %lo(skeleton_console_one_screen) # addiu $t6, $t6, -0x5f90 -/* 0800CC 7F04B59C 15C20007 */ bne $t6, $v0, .L7F04B5BC -/* 0800D0 7F04B5A0 3C198004 */ lui $t9, %hi(skeleton_console_four_screen) -/* 0800D4 7F04B5A4 8C8F0008 */ lw $t7, 8($a0) -/* 0800D8 7F04B5A8 8DF80000 */ lw $t8, ($t7) -/* 0800DC 7F04B5AC 14B80003 */ bne $a1, $t8, .L7F04B5BC -/* 0800E0 7F04B5B0 00000000 */ nop -/* 0800E4 7F04B5B4 03E00008 */ jr $ra -/* 0800E8 7F04B5B8 00001025 */ move $v0, $zero - -.L7F04B5BC: -/* 0800EC 7F04B5BC 2739A084 */ addiu $t9, $t9, %lo(skeleton_console_four_screen) -/* 0800F0 7F04B5C0 57220011 */ bnel $t9, $v0, .L7F04B608 -/* 0800F4 7F04B5C4 24020001 */ li $v0, 1 -/* 0800F8 7F04B5C8 8C820008 */ lw $v0, 8($a0) -/* 0800FC 7F04B5CC 8C480000 */ lw $t0, ($v0) -/* 080100 7F04B5D0 10A8000A */ beq $a1, $t0, .L7F04B5FC -/* 080104 7F04B5D4 00000000 */ nop -/* 080108 7F04B5D8 8C490004 */ lw $t1, 4($v0) -/* 08010C 7F04B5DC 10A90007 */ beq $a1, $t1, .L7F04B5FC -/* 080110 7F04B5E0 00000000 */ nop -/* 080114 7F04B5E4 8C4A0008 */ lw $t2, 8($v0) -/* 080118 7F04B5E8 10AA0004 */ beq $a1, $t2, .L7F04B5FC -/* 08011C 7F04B5EC 00000000 */ nop -/* 080120 7F04B5F0 8C4B000C */ lw $t3, 0xc($v0) -/* 080124 7F04B5F4 54AB0004 */ bnel $a1, $t3, .L7F04B608 -/* 080128 7F04B5F8 24020001 */ li $v0, 1 -.L7F04B5FC: -/* 08012C 7F04B5FC 03E00008 */ jr $ra -/* 080130 7F04B600 00001025 */ move $v0, $zero - -/* 080134 7F04B604 24020001 */ li $v0, 1 -.L7F04B608: -/* 080138 7F04B608 03E00008 */ jr $ra -/* 08013C 7F04B60C 00000000 */ nop -) -#endif +bool sub_GAME_7F04B590(ModelFileHeader* arg0, ModelNode* arg1) +{ + ModelSkeleton* onescreen = &skeleton_console_one_screen; + ModelSkeleton* fourscreen = &skeleton_console_four_screen; + if ((onescreen == arg0->Skeleton)) + { + if (arg1 == arg0->Switches[0]) + { + return FALSE; + } + } + if (fourscreen == arg0->Skeleton) + { + if ((arg1 == arg0->Switches[0]) || (arg1 == arg0->Switches[1]) || (arg1 == arg0->Switches[2]) || (arg1 == arg0->Switches[3])) + { + return FALSE; + } + } + return TRUE; +} #ifdef NONMATCHING @@ -27801,7 +28224,7 @@ glabel sub_GAME_7F04B610 /* 080288 7F04B758 10000001 */ b .L7F04B760 /* 08028C 7F04B75C 0000B825 */ move $s7, $zero .L7F04B760: -/* 080290 7F04B760 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 080290 7F04B760 0FC0FFF0 */ jal objGetDestroyedLevel /* 080294 7F04B764 03C02025 */ move $a0, $fp /* 080298 7F04B768 86A4000C */ lh $a0, 0xc($s5) /* 08029C 7F04B76C 24050B0B */ li $a1, 2827 @@ -27902,7 +28325,7 @@ glabel sub_GAME_7F04B610 /* 0803FC 7F04B8CC 8FC20014 */ lw $v0, 0x14($fp) /* 080400 7F04B8D0 C4440014 */ lwc1 $f4, 0x14($v0) /* 080404 7F04B8D4 8C440008 */ lw $a0, 8($v0) -/* 080408 7F04B8D8 0FC0FFFE */ jal sub_GAME_7F03FFF8 +/* 080408 7F04B8D8 0FC0FFFE */ jal chrobjGetBboxFromObjFile /* 08040C 7F04B8DC E7A4005C */ swc1 $f4, 0x5c($sp) /* 080410 7F04B8E0 00408025 */ move $s0, $v0 /* 080414 7F04B8E4 0FC0FA19 */ jal chrpropBBOXGetYmin @@ -28293,7 +28716,7 @@ glabel sub_GAME_7F04B610 /* 07E33C 7F04B94C 10000001 */ b .L7F04B954 /* 07E340 7F04B950 0000B825 */ move $s7, $zero .L7F04B954: -/* 07E344 7F04B954 0FC10020 */ jal do_something_if_object_destroyed +/* 07E344 7F04B954 0FC10020 */ jal objGetDestroyedLevel /* 07E348 7F04B958 03C02025 */ move $a0, $fp /* 07E34C 7F04B95C 86A4000C */ lh $a0, 0xc($s5) /* 07E350 7F04B960 24050B0B */ li $a1, 2827 @@ -28394,7 +28817,7 @@ glabel sub_GAME_7F04B610 /* 07E4B0 7F04BAC0 8FC20014 */ lw $v0, 0x14($fp) /* 07E4B4 7F04BAC4 C4440014 */ lwc1 $f4, 0x14($v0) /* 07E4B8 7F04BAC8 8C440008 */ lw $a0, 8($v0) -/* 07E4BC 7F04BACC 0FC1002E */ jal sub_GAME_7F03FFF8 +/* 07E4BC 7F04BACC 0FC1002E */ jal chrobjGetBboxFromObjFile /* 07E4C0 7F04BAD0 E7A4005C */ swc1 $f4, 0x5c($sp) /* 07E4C4 7F04BAD4 00408025 */ move $s0, $v0 /* 07E4C8 7F04BAD8 0FC0FA49 */ jal chrpropBBOXGetYmin @@ -28688,2563 +29111,396 @@ glabel sub_GAME_7F04B610 #endif +void objBounce(ObjectRecord *obj, coord3d *arg1) +{ + coord3d dir; + coord3d rot = {0, 0, 0}; + Projectile *projectile = NULL; -#ifdef NONMATCHING -void sub_GAME_7F04BCDC(void) { - -} -#else + sub_GAME_7F03FDA8(obj->prop); -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_80052CC4 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CC8 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CCC -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CD0 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CD4 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CD8 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CDC -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052CE0 -.word 0x3d490fdb /*0.049087387*/ -glabel D_80052CE4 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052CE8 -.word 0x3d490fdb /*0.049087387*/ -glabel D_80052CEC -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052CF0 -.word 0x3d490fdb /*0.049087387*/ -glabel D_80052CF4 -.word 0x40555555 /*3.3333333*/ -.text -glabel sub_GAME_7F04BCDC -/* 08080C 7F04BCDC 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 080810 7F04BCE0 3C0F8003 */ lui $t7, %hi(D_80032010) -/* 080814 7F04BCE4 AFBF0024 */ sw $ra, 0x24($sp) -/* 080818 7F04BCE8 AFB00020 */ sw $s0, 0x20($sp) -/* 08081C 7F04BCEC F7B40018 */ sdc1 $f20, 0x18($sp) -/* 080820 7F04BCF0 AFA50054 */ sw $a1, 0x54($sp) -/* 080824 7F04BCF4 25EF2010 */ addiu $t7, %lo(D_80032010) # addiu $t7, $t7, 0x2010 -/* 080828 7F04BCF8 8DE10000 */ lw $at, ($t7) -/* 08082C 7F04BCFC 27AE0038 */ addiu $t6, $sp, 0x38 -/* 080830 7F04BD00 8DE80004 */ lw $t0, 4($t7) -/* 080834 7F04BD04 ADC10000 */ sw $at, ($t6) -/* 080838 7F04BD08 8DE10008 */ lw $at, 8($t7) -/* 08083C 7F04BD0C 00803025 */ move $a2, $a0 -/* 080840 7F04BD10 ADC80004 */ sw $t0, 4($t6) -/* 080844 7F04BD14 ADC10008 */ sw $at, 8($t6) -/* 080848 7F04BD18 8C840010 */ lw $a0, 0x10($a0) -/* 08084C 7F04BD1C 00008025 */ move $s0, $zero -/* 080850 7F04BD20 0FC0FF6A */ jal sub_GAME_7F03FDA8 -/* 080854 7F04BD24 AFA60050 */ sw $a2, 0x50($sp) -/* 080858 7F04BD28 8FA60050 */ lw $a2, 0x50($sp) -/* 08085C 7F04BD2C 8CC20064 */ lw $v0, 0x64($a2) -/* 080860 7F04BD30 30490040 */ andi $t1, $v0, 0x40 -/* 080864 7F04BD34 11200004 */ beqz $t1, .L7F04BD48 -/* 080868 7F04BD38 304B0080 */ andi $t3, $v0, 0x80 -/* 08086C 7F04BD3C 8CCA006C */ lw $t2, 0x6c($a2) -/* 080870 7F04BD40 10000004 */ b .L7F04BD54 -/* 080874 7F04BD44 8D500044 */ lw $s0, 0x44($t2) -.L7F04BD48: -/* 080878 7F04BD48 11600002 */ beqz $t3, .L7F04BD54 -/* 08087C 7F04BD4C 00000000 */ nop -/* 080880 7F04BD50 8CD0006C */ lw $s0, 0x6c($a2) -.L7F04BD54: -/* 080884 7F04BD54 5200009A */ beql $s0, $zero, .L7F04BFC0 -/* 080888 7F04BD58 8FBF0024 */ lw $ra, 0x24($sp) -/* 08088C 7F04BD5C 0C002914 */ jal randomGetNext -/* 080890 7F04BD60 00000000 */ nop -/* 080894 7F04BD64 44822000 */ mtc1 $v0, $f4 -/* 080898 7F04BD68 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08089C 7F04BD6C 4481A000 */ mtc1 $at, $f20 -/* 0808A0 7F04BD70 04410005 */ bgez $v0, .L7F04BD88 -/* 0808A4 7F04BD74 468021A0 */ cvt.s.w $f6, $f4 -/* 0808A8 7F04BD78 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0808AC 7F04BD7C 44814000 */ mtc1 $at, $f8 -/* 0808B0 7F04BD80 00000000 */ nop -/* 0808B4 7F04BD84 46083180 */ add.s $f6, $f6, $f8 -.L7F04BD88: -/* 0808B8 7F04BD88 46143282 */ mul.s $f10, $f6, $f20 -/* 0808BC 7F04BD8C 3C018005 */ lui $at, %hi(D_80052CC4) -/* 0808C0 7F04BD90 C4302CC4 */ lwc1 $f16, %lo(D_80052CC4)($at) -/* 0808C4 7F04BD94 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0808C8 7F04BD98 44812000 */ mtc1 $at, $f4 -/* 0808CC 7F04BD9C 3C018005 */ lui $at, %hi(D_80052CC8) -/* 0808D0 7F04BDA0 C4262CC8 */ lwc1 $f6, %lo(D_80052CC8)($at) -/* 0808D4 7F04BDA4 46105482 */ mul.s $f18, $f10, $f16 -/* 0808D8 7F04BDA8 00000000 */ nop -/* 0808DC 7F04BDAC 46049202 */ mul.s $f8, $f18, $f4 -/* 0808E0 7F04BDB0 46064281 */ sub.s $f10, $f8, $f6 -/* 0808E4 7F04BDB4 0C002914 */ jal randomGetNext -/* 0808E8 7F04BDB8 E60A0004 */ swc1 $f10, 4($s0) -/* 0808EC 7F04BDBC 44828000 */ mtc1 $v0, $f16 -/* 0808F0 7F04BDC0 04410005 */ bgez $v0, .L7F04BDD8 -/* 0808F4 7F04BDC4 468084A0 */ cvt.s.w $f18, $f16 -/* 0808F8 7F04BDC8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0808FC 7F04BDCC 44812000 */ mtc1 $at, $f4 -/* 080900 7F04BDD0 00000000 */ nop -/* 080904 7F04BDD4 46049480 */ add.s $f18, $f18, $f4 -.L7F04BDD8: -/* 080908 7F04BDD8 46149202 */ mul.s $f8, $f18, $f20 -/* 08090C 7F04BDDC 3C018005 */ lui $at, %hi(D_80052CCC) -/* 080910 7F04BDE0 C4262CCC */ lwc1 $f6, %lo(D_80052CCC)($at) -/* 080914 7F04BDE4 3C018005 */ lui $at, %hi(D_80052CD0) -/* 080918 7F04BDE8 C4302CD0 */ lwc1 $f16, %lo(D_80052CD0)($at) -/* 08091C 7F04BDEC 46064002 */ mul.s $f0, $f8, $f6 -/* 080920 7F04BDF0 46000280 */ add.s $f10, $f0, $f0 -/* 080924 7F04BDF4 46105100 */ add.s $f4, $f10, $f16 -/* 080928 7F04BDF8 0C002914 */ jal randomGetNext -/* 08092C 7F04BDFC E6040008 */ swc1 $f4, 8($s0) -/* 080930 7F04BE00 44829000 */ mtc1 $v0, $f18 -/* 080934 7F04BE04 04410005 */ bgez $v0, .L7F04BE1C -/* 080938 7F04BE08 46809220 */ cvt.s.w $f8, $f18 -/* 08093C 7F04BE0C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080940 7F04BE10 44813000 */ mtc1 $at, $f6 -/* 080944 7F04BE14 00000000 */ nop -/* 080948 7F04BE18 46064200 */ add.s $f8, $f8, $f6 -.L7F04BE1C: -/* 08094C 7F04BE1C 46144282 */ mul.s $f10, $f8, $f20 -/* 080950 7F04BE20 3C018005 */ lui $at, %hi(D_80052CD4) -/* 080954 7F04BE24 C4302CD4 */ lwc1 $f16, %lo(D_80052CD4)($at) -/* 080958 7F04BE28 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 08095C 7F04BE2C 44819000 */ mtc1 $at, $f18 -/* 080960 7F04BE30 3C018005 */ lui $at, %hi(D_80052CD8) -/* 080964 7F04BE34 C4282CD8 */ lwc1 $f8, %lo(D_80052CD8)($at) -/* 080968 7F04BE38 46105102 */ mul.s $f4, $f10, $f16 -/* 08096C 7F04BE3C 00000000 */ nop -/* 080970 7F04BE40 46122182 */ mul.s $f6, $f4, $f18 -/* 080974 7F04BE44 46083281 */ sub.s $f10, $f6, $f8 -/* 080978 7F04BE48 0C002914 */ jal randomGetNext -/* 08097C 7F04BE4C E60A000C */ swc1 $f10, 0xc($s0) -/* 080980 7F04BE50 44828000 */ mtc1 $v0, $f16 -/* 080984 7F04BE54 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080988 7F04BE58 04410004 */ bgez $v0, .L7F04BE6C -/* 08098C 7F04BE5C 46808120 */ cvt.s.w $f4, $f16 -/* 080990 7F04BE60 44819000 */ mtc1 $at, $f18 -/* 080994 7F04BE64 00000000 */ nop -/* 080998 7F04BE68 46122100 */ add.s $f4, $f4, $f18 -.L7F04BE6C: -/* 08099C 7F04BE6C 46142182 */ mul.s $f6, $f4, $f20 -/* 0809A0 7F04BE70 3C018005 */ lui $at, %hi(D_80052CDC) -/* 0809A4 7F04BE74 C4282CDC */ lwc1 $f8, %lo(D_80052CDC)($at) -/* 0809A8 7F04BE78 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 0809AC 7F04BE7C 44818000 */ mtc1 $at, $f16 -/* 0809B0 7F04BE80 3C018005 */ lui $at, %hi(D_80052CE0) -/* 0809B4 7F04BE84 C4242CE0 */ lwc1 $f4, %lo(D_80052CE0)($at) -/* 0809B8 7F04BE88 46083282 */ mul.s $f10, $f6, $f8 -/* 0809BC 7F04BE8C 00000000 */ nop -/* 0809C0 7F04BE90 46105482 */ mul.s $f18, $f10, $f16 -/* 0809C4 7F04BE94 46049181 */ sub.s $f6, $f18, $f4 -/* 0809C8 7F04BE98 0C002914 */ jal randomGetNext -/* 0809CC 7F04BE9C E7A60038 */ swc1 $f6, 0x38($sp) -/* 0809D0 7F04BEA0 44824000 */ mtc1 $v0, $f8 -/* 0809D4 7F04BEA4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0809D8 7F04BEA8 04410004 */ bgez $v0, .L7F04BEBC -/* 0809DC 7F04BEAC 468042A0 */ cvt.s.w $f10, $f8 -/* 0809E0 7F04BEB0 44818000 */ mtc1 $at, $f16 -/* 0809E4 7F04BEB4 00000000 */ nop -/* 0809E8 7F04BEB8 46105280 */ add.s $f10, $f10, $f16 -.L7F04BEBC: -/* 0809EC 7F04BEBC 46145482 */ mul.s $f18, $f10, $f20 -/* 0809F0 7F04BEC0 3C018005 */ lui $at, %hi(D_80052CE4) -/* 0809F4 7F04BEC4 C4242CE4 */ lwc1 $f4, %lo(D_80052CE4)($at) -/* 0809F8 7F04BEC8 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 0809FC 7F04BECC 44814000 */ mtc1 $at, $f8 -/* 080A00 7F04BED0 3C018005 */ lui $at, %hi(D_80052CE8) -/* 080A04 7F04BED4 C42A2CE8 */ lwc1 $f10, %lo(D_80052CE8)($at) -/* 080A08 7F04BED8 46049182 */ mul.s $f6, $f18, $f4 -/* 080A0C 7F04BEDC 00000000 */ nop -/* 080A10 7F04BEE0 46083402 */ mul.s $f16, $f6, $f8 -/* 080A14 7F04BEE4 460A8481 */ sub.s $f18, $f16, $f10 -/* 080A18 7F04BEE8 0C002914 */ jal randomGetNext -/* 080A1C 7F04BEEC E7B2003C */ swc1 $f18, 0x3c($sp) -/* 080A20 7F04BEF0 44822000 */ mtc1 $v0, $f4 -/* 080A24 7F04BEF4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080A28 7F04BEF8 04410004 */ bgez $v0, .L7F04BF0C -/* 080A2C 7F04BEFC 468021A0 */ cvt.s.w $f6, $f4 -/* 080A30 7F04BF00 44814000 */ mtc1 $at, $f8 -/* 080A34 7F04BF04 00000000 */ nop -/* 080A38 7F04BF08 46083180 */ add.s $f6, $f6, $f8 -.L7F04BF0C: -/* 080A3C 7F04BF0C 46143402 */ mul.s $f16, $f6, $f20 -/* 080A40 7F04BF10 3C018005 */ lui $at, %hi(D_80052CEC) -/* 080A44 7F04BF14 C42A2CEC */ lwc1 $f10, %lo(D_80052CEC)($at) -/* 080A48 7F04BF18 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 080A4C 7F04BF1C 44812000 */ mtc1 $at, $f4 -/* 080A50 7F04BF20 3C018005 */ lui $at, %hi(D_80052CF0) -/* 080A54 7F04BF24 C4262CF0 */ lwc1 $f6, %lo(D_80052CF0)($at) -/* 080A58 7F04BF28 460A8482 */ mul.s $f18, $f16, $f10 -/* 080A5C 7F04BF2C 27A40038 */ addiu $a0, $sp, 0x38 -/* 080A60 7F04BF30 26050020 */ addiu $a1, $s0, 0x20 -/* 080A64 7F04BF34 46049202 */ mul.s $f8, $f18, $f4 -/* 080A68 7F04BF38 46064401 */ sub.s $f16, $f8, $f6 -/* 080A6C 7F04BF3C 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 080A70 7F04BF40 E7B00040 */ swc1 $f16, 0x40($sp) -/* 080A74 7F04BF44 8E0C0000 */ lw $t4, ($s0) -/* 080A78 7F04BF48 8FA20054 */ lw $v0, 0x54($sp) -/* 080A7C 7F04BF4C 358D0001 */ ori $t5, $t4, 1 -/* 080A80 7F04BF50 AE0D0000 */ sw $t5, ($s0) -/* 080A84 7F04BF54 C44A0000 */ lwc1 $f10, ($v0) -/* 080A88 7F04BF58 E7AA0044 */ swc1 $f10, 0x44($sp) -/* 080A8C 7F04BF5C C4520004 */ lwc1 $f18, 4($v0) -/* 080A90 7F04BF60 E7B20048 */ swc1 $f18, 0x48($sp) -/* 080A94 7F04BF64 C4440008 */ lwc1 $f4, 8($v0) -/* 080A98 7F04BF68 0FC1E111 */ jal currentPlayerGetMatrix10D4 -/* 080A9C 7F04BF6C E7A4004C */ swc1 $f4, 0x4c($sp) -/* 080AA0 7F04BF70 00402025 */ move $a0, $v0 -/* 080AA4 7F04BF74 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 080AA8 7F04BF78 27A50044 */ addiu $a1, $sp, 0x44 -/* 080AAC 7F04BF7C 3C018005 */ lui $at, %hi(D_80052CF4) -/* 080AB0 7F04BF80 C4202CF4 */ lwc1 $f0, %lo(D_80052CF4)($at) -/* 080AB4 7F04BF84 C7A60044 */ lwc1 $f6, 0x44($sp) -/* 080AB8 7F04BF88 C6080004 */ lwc1 $f8, 4($s0) -/* 080ABC 7F04BF8C C612000C */ lwc1 $f18, 0xc($s0) -/* 080AC0 7F04BF90 46060402 */ mul.s $f16, $f0, $f6 -/* 080AC4 7F04BF94 46104280 */ add.s $f10, $f8, $f16 -/* 080AC8 7F04BF98 E60A0004 */ swc1 $f10, 4($s0) -/* 080ACC 7F04BF9C C7A4004C */ lwc1 $f4, 0x4c($sp) -/* 080AD0 7F04BFA0 46040182 */ mul.s $f6, $f0, $f4 -/* 080AD4 7F04BFA4 46069200 */ add.s $f8, $f18, $f6 -/* 080AD8 7F04BFA8 0FC225E6 */ jal get_curplayer_positiondata -/* 080ADC 7F04BFAC E608000C */ swc1 $f8, 0xc($s0) -/* 080AE0 7F04BFB0 24190001 */ li $t9, 1 -/* 080AE4 7F04BFB4 AE020088 */ sw $v0, 0x88($s0) -/* 080AE8 7F04BFB8 AE190090 */ sw $t9, 0x90($s0) -/* 080AEC 7F04BFBC 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04BFC0: -/* 080AF0 7F04BFC0 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 080AF4 7F04BFC4 8FB00020 */ lw $s0, 0x20($sp) -/* 080AF8 7F04BFC8 03E00008 */ jr $ra -/* 080AFC 7F04BFCC 27BD0050 */ addiu $sp, $sp, 0x50 -) -#endif - -#if !defined(LEFTOVERDEBUG) + if (obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) { + projectile = obj->embedment->projectile; + } else if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { + projectile = obj->projectile; + } -/* same asm, different float .rodata */ + if (projectile) { + projectile->speed.x = (RANDOMFRAC() * 1.6666666f * 4.0f) - 3.3333333f; + projectile->speed.y = (RANDOMFRAC() * 1.6666666f * 2.0f) + 3.3333333f; + projectile->speed.z = (RANDOMFRAC() * 1.6666666f * 4.0f) - 3.3333333f; -GLOBAL_ASM( -.late_rodata -glabel D_80052CC4 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CC8 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CCC -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CD0 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CD4 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CD8 -.word 0x40555555 /*3.3333333*/ -glabel D_80052CDC -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052CE0 -.word 0x3d71463a /* 0.049087387 * 1.2 = 0.058904863894 */ -glabel D_80052CE4 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052CE8 -.word 0x3d71463a /* 0.049087387 * 1.2 = 0.058904863894 */ -glabel D_80052CEC -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052CF0 -.word 0x3d71463a /* 0.049087387 * 1.2 = 0.058904863894 */ -glabel D_80052CF4 -.word 0x40555555 /*3.3333333*/ -.text -glabel sub_GAME_7F04BCDC -/* 08080C 7F04BCDC 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 080810 7F04BCE0 3C0F8003 */ lui $t7, %hi(D_80032010) -/* 080814 7F04BCE4 AFBF0024 */ sw $ra, 0x24($sp) -/* 080818 7F04BCE8 AFB00020 */ sw $s0, 0x20($sp) -/* 08081C 7F04BCEC F7B40018 */ sdc1 $f20, 0x18($sp) -/* 080820 7F04BCF0 AFA50054 */ sw $a1, 0x54($sp) -/* 080824 7F04BCF4 25EF2010 */ addiu $t7, %lo(D_80032010) # addiu $t7, $t7, 0x2010 -/* 080828 7F04BCF8 8DE10000 */ lw $at, ($t7) -/* 08082C 7F04BCFC 27AE0038 */ addiu $t6, $sp, 0x38 -/* 080830 7F04BD00 8DE80004 */ lw $t0, 4($t7) -/* 080834 7F04BD04 ADC10000 */ sw $at, ($t6) -/* 080838 7F04BD08 8DE10008 */ lw $at, 8($t7) -/* 08083C 7F04BD0C 00803025 */ move $a2, $a0 -/* 080840 7F04BD10 ADC80004 */ sw $t0, 4($t6) -/* 080844 7F04BD14 ADC10008 */ sw $at, 8($t6) -/* 080848 7F04BD18 8C840010 */ lw $a0, 0x10($a0) -/* 08084C 7F04BD1C 00008025 */ move $s0, $zero -/* 080850 7F04BD20 0FC0FF6A */ jal sub_GAME_7F03FDA8 -/* 080854 7F04BD24 AFA60050 */ sw $a2, 0x50($sp) -/* 080858 7F04BD28 8FA60050 */ lw $a2, 0x50($sp) -/* 08085C 7F04BD2C 8CC20064 */ lw $v0, 0x64($a2) -/* 080860 7F04BD30 30490040 */ andi $t1, $v0, 0x40 -/* 080864 7F04BD34 11200004 */ beqz $t1, .L7F04BD48 -/* 080868 7F04BD38 304B0080 */ andi $t3, $v0, 0x80 -/* 08086C 7F04BD3C 8CCA006C */ lw $t2, 0x6c($a2) -/* 080870 7F04BD40 10000004 */ b .L7F04BD54 -/* 080874 7F04BD44 8D500044 */ lw $s0, 0x44($t2) -.L7F04BD48: -/* 080878 7F04BD48 11600002 */ beqz $t3, .L7F04BD54 -/* 08087C 7F04BD4C 00000000 */ nop -/* 080880 7F04BD50 8CD0006C */ lw $s0, 0x6c($a2) -.L7F04BD54: -/* 080884 7F04BD54 5200009A */ beql $s0, $zero, .L7F04BFC0 -/* 080888 7F04BD58 8FBF0024 */ lw $ra, 0x24($sp) -/* 08088C 7F04BD5C 0C002914 */ jal randomGetNext -/* 080890 7F04BD60 00000000 */ nop -/* 080894 7F04BD64 44822000 */ mtc1 $v0, $f4 -/* 080898 7F04BD68 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08089C 7F04BD6C 4481A000 */ mtc1 $at, $f20 -/* 0808A0 7F04BD70 04410005 */ bgez $v0, .L7F04BD88 -/* 0808A4 7F04BD74 468021A0 */ cvt.s.w $f6, $f4 -/* 0808A8 7F04BD78 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0808AC 7F04BD7C 44814000 */ mtc1 $at, $f8 -/* 0808B0 7F04BD80 00000000 */ nop -/* 0808B4 7F04BD84 46083180 */ add.s $f6, $f6, $f8 -.L7F04BD88: -/* 0808B8 7F04BD88 46143282 */ mul.s $f10, $f6, $f20 -/* 0808BC 7F04BD8C 3C018005 */ lui $at, %hi(D_80052CC4) -/* 0808C0 7F04BD90 C4302CC4 */ lwc1 $f16, %lo(D_80052CC4)($at) -/* 0808C4 7F04BD94 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 0808C8 7F04BD98 44812000 */ mtc1 $at, $f4 -/* 0808CC 7F04BD9C 3C018005 */ lui $at, %hi(D_80052CC8) -/* 0808D0 7F04BDA0 C4262CC8 */ lwc1 $f6, %lo(D_80052CC8)($at) -/* 0808D4 7F04BDA4 46105482 */ mul.s $f18, $f10, $f16 -/* 0808D8 7F04BDA8 00000000 */ nop -/* 0808DC 7F04BDAC 46049202 */ mul.s $f8, $f18, $f4 -/* 0808E0 7F04BDB0 46064281 */ sub.s $f10, $f8, $f6 -/* 0808E4 7F04BDB4 0C002914 */ jal randomGetNext -/* 0808E8 7F04BDB8 E60A0004 */ swc1 $f10, 4($s0) -/* 0808EC 7F04BDBC 44828000 */ mtc1 $v0, $f16 -/* 0808F0 7F04BDC0 04410005 */ bgez $v0, .L7F04BDD8 -/* 0808F4 7F04BDC4 468084A0 */ cvt.s.w $f18, $f16 -/* 0808F8 7F04BDC8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0808FC 7F04BDCC 44812000 */ mtc1 $at, $f4 -/* 080900 7F04BDD0 00000000 */ nop -/* 080904 7F04BDD4 46049480 */ add.s $f18, $f18, $f4 -.L7F04BDD8: -/* 080908 7F04BDD8 46149202 */ mul.s $f8, $f18, $f20 -/* 08090C 7F04BDDC 3C018005 */ lui $at, %hi(D_80052CCC) -/* 080910 7F04BDE0 C4262CCC */ lwc1 $f6, %lo(D_80052CCC)($at) -/* 080914 7F04BDE4 3C018005 */ lui $at, %hi(D_80052CD0) -/* 080918 7F04BDE8 C4302CD0 */ lwc1 $f16, %lo(D_80052CD0)($at) -/* 08091C 7F04BDEC 46064002 */ mul.s $f0, $f8, $f6 -/* 080920 7F04BDF0 46000280 */ add.s $f10, $f0, $f0 -/* 080924 7F04BDF4 46105100 */ add.s $f4, $f10, $f16 -/* 080928 7F04BDF8 0C002914 */ jal randomGetNext -/* 08092C 7F04BDFC E6040008 */ swc1 $f4, 8($s0) -/* 080930 7F04BE00 44829000 */ mtc1 $v0, $f18 -/* 080934 7F04BE04 04410005 */ bgez $v0, .L7F04BE1C -/* 080938 7F04BE08 46809220 */ cvt.s.w $f8, $f18 -/* 08093C 7F04BE0C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080940 7F04BE10 44813000 */ mtc1 $at, $f6 -/* 080944 7F04BE14 00000000 */ nop -/* 080948 7F04BE18 46064200 */ add.s $f8, $f8, $f6 -.L7F04BE1C: -/* 08094C 7F04BE1C 46144282 */ mul.s $f10, $f8, $f20 -/* 080950 7F04BE20 3C018005 */ lui $at, %hi(D_80052CD4) -/* 080954 7F04BE24 C4302CD4 */ lwc1 $f16, %lo(D_80052CD4)($at) -/* 080958 7F04BE28 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 08095C 7F04BE2C 44819000 */ mtc1 $at, $f18 -/* 080960 7F04BE30 3C018005 */ lui $at, %hi(D_80052CD8) -/* 080964 7F04BE34 C4282CD8 */ lwc1 $f8, %lo(D_80052CD8)($at) -/* 080968 7F04BE38 46105102 */ mul.s $f4, $f10, $f16 -/* 08096C 7F04BE3C 00000000 */ nop -/* 080970 7F04BE40 46122182 */ mul.s $f6, $f4, $f18 -/* 080974 7F04BE44 46083281 */ sub.s $f10, $f6, $f8 -/* 080978 7F04BE48 0C002914 */ jal randomGetNext -/* 08097C 7F04BE4C E60A000C */ swc1 $f10, 0xc($s0) -/* 080980 7F04BE50 44828000 */ mtc1 $v0, $f16 -/* 080984 7F04BE54 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080988 7F04BE58 04410004 */ bgez $v0, .L7F04BE6C -/* 08098C 7F04BE5C 46808120 */ cvt.s.w $f4, $f16 -/* 080990 7F04BE60 44819000 */ mtc1 $at, $f18 -/* 080994 7F04BE64 00000000 */ nop -/* 080998 7F04BE68 46122100 */ add.s $f4, $f4, $f18 -.L7F04BE6C: -/* 08099C 7F04BE6C 46142182 */ mul.s $f6, $f4, $f20 -/* 0809A0 7F04BE70 3C018005 */ lui $at, %hi(D_80052CDC) -/* 0809A4 7F04BE74 C4282CDC */ lwc1 $f8, %lo(D_80052CDC)($at) -/* 0809A8 7F04BE78 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 0809AC 7F04BE7C 44818000 */ mtc1 $at, $f16 -/* 0809B0 7F04BE80 3C018005 */ lui $at, %hi(D_80052CE0) -/* 0809B4 7F04BE84 C4242CE0 */ lwc1 $f4, %lo(D_80052CE0)($at) -/* 0809B8 7F04BE88 46083282 */ mul.s $f10, $f6, $f8 -/* 0809BC 7F04BE8C 00000000 */ nop -/* 0809C0 7F04BE90 46105482 */ mul.s $f18, $f10, $f16 -/* 0809C4 7F04BE94 46049181 */ sub.s $f6, $f18, $f4 -/* 0809C8 7F04BE98 0C002914 */ jal randomGetNext -/* 0809CC 7F04BE9C E7A60038 */ swc1 $f6, 0x38($sp) -/* 0809D0 7F04BEA0 44824000 */ mtc1 $v0, $f8 -/* 0809D4 7F04BEA4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0809D8 7F04BEA8 04410004 */ bgez $v0, .L7F04BEBC -/* 0809DC 7F04BEAC 468042A0 */ cvt.s.w $f10, $f8 -/* 0809E0 7F04BEB0 44818000 */ mtc1 $at, $f16 -/* 0809E4 7F04BEB4 00000000 */ nop -/* 0809E8 7F04BEB8 46105280 */ add.s $f10, $f10, $f16 -.L7F04BEBC: -/* 0809EC 7F04BEBC 46145482 */ mul.s $f18, $f10, $f20 -/* 0809F0 7F04BEC0 3C018005 */ lui $at, %hi(D_80052CE4) -/* 0809F4 7F04BEC4 C4242CE4 */ lwc1 $f4, %lo(D_80052CE4)($at) -/* 0809F8 7F04BEC8 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 0809FC 7F04BECC 44814000 */ mtc1 $at, $f8 -/* 080A00 7F04BED0 3C018005 */ lui $at, %hi(D_80052CE8) -/* 080A04 7F04BED4 C42A2CE8 */ lwc1 $f10, %lo(D_80052CE8)($at) -/* 080A08 7F04BED8 46049182 */ mul.s $f6, $f18, $f4 -/* 080A0C 7F04BEDC 00000000 */ nop -/* 080A10 7F04BEE0 46083402 */ mul.s $f16, $f6, $f8 -/* 080A14 7F04BEE4 460A8481 */ sub.s $f18, $f16, $f10 -/* 080A18 7F04BEE8 0C002914 */ jal randomGetNext -/* 080A1C 7F04BEEC E7B2003C */ swc1 $f18, 0x3c($sp) -/* 080A20 7F04BEF0 44822000 */ mtc1 $v0, $f4 -/* 080A24 7F04BEF4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080A28 7F04BEF8 04410004 */ bgez $v0, .L7F04BF0C -/* 080A2C 7F04BEFC 468021A0 */ cvt.s.w $f6, $f4 -/* 080A30 7F04BF00 44814000 */ mtc1 $at, $f8 -/* 080A34 7F04BF04 00000000 */ nop -/* 080A38 7F04BF08 46083180 */ add.s $f6, $f6, $f8 -.L7F04BF0C: -/* 080A3C 7F04BF0C 46143402 */ mul.s $f16, $f6, $f20 -/* 080A40 7F04BF10 3C018005 */ lui $at, %hi(D_80052CEC) -/* 080A44 7F04BF14 C42A2CEC */ lwc1 $f10, %lo(D_80052CEC)($at) -/* 080A48 7F04BF18 3C013C80 */ li $at, 0x3C800000 # 0.015625 -/* 080A4C 7F04BF1C 44812000 */ mtc1 $at, $f4 -/* 080A50 7F04BF20 3C018005 */ lui $at, %hi(D_80052CF0) -/* 080A54 7F04BF24 C4262CF0 */ lwc1 $f6, %lo(D_80052CF0)($at) -/* 080A58 7F04BF28 460A8482 */ mul.s $f18, $f16, $f10 -/* 080A5C 7F04BF2C 27A40038 */ addiu $a0, $sp, 0x38 -/* 080A60 7F04BF30 26050020 */ addiu $a1, $s0, 0x20 -/* 080A64 7F04BF34 46049202 */ mul.s $f8, $f18, $f4 -/* 080A68 7F04BF38 46064401 */ sub.s $f16, $f8, $f6 -/* 080A6C 7F04BF3C 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 080A70 7F04BF40 E7B00040 */ swc1 $f16, 0x40($sp) -/* 080A74 7F04BF44 8E0C0000 */ lw $t4, ($s0) -/* 080A78 7F04BF48 8FA20054 */ lw $v0, 0x54($sp) -/* 080A7C 7F04BF4C 358D0001 */ ori $t5, $t4, 1 -/* 080A80 7F04BF50 AE0D0000 */ sw $t5, ($s0) -/* 080A84 7F04BF54 C44A0000 */ lwc1 $f10, ($v0) -/* 080A88 7F04BF58 E7AA0044 */ swc1 $f10, 0x44($sp) -/* 080A8C 7F04BF5C C4520004 */ lwc1 $f18, 4($v0) -/* 080A90 7F04BF60 E7B20048 */ swc1 $f18, 0x48($sp) -/* 080A94 7F04BF64 C4440008 */ lwc1 $f4, 8($v0) -/* 080A98 7F04BF68 0FC1E111 */ jal currentPlayerGetMatrix10D4 -/* 080A9C 7F04BF6C E7A4004C */ swc1 $f4, 0x4c($sp) -/* 080AA0 7F04BF70 00402025 */ move $a0, $v0 -/* 080AA4 7F04BF74 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 080AA8 7F04BF78 27A50044 */ addiu $a1, $sp, 0x44 -/* 080AAC 7F04BF7C 3C018005 */ lui $at, %hi(D_80052CF4) -/* 080AB0 7F04BF80 C4202CF4 */ lwc1 $f0, %lo(D_80052CF4)($at) -/* 080AB4 7F04BF84 C7A60044 */ lwc1 $f6, 0x44($sp) -/* 080AB8 7F04BF88 C6080004 */ lwc1 $f8, 4($s0) -/* 080ABC 7F04BF8C C612000C */ lwc1 $f18, 0xc($s0) -/* 080AC0 7F04BF90 46060402 */ mul.s $f16, $f0, $f6 -/* 080AC4 7F04BF94 46104280 */ add.s $f10, $f8, $f16 -/* 080AC8 7F04BF98 E60A0004 */ swc1 $f10, 4($s0) -/* 080ACC 7F04BF9C C7A4004C */ lwc1 $f4, 0x4c($sp) -/* 080AD0 7F04BFA0 46040182 */ mul.s $f6, $f0, $f4 -/* 080AD4 7F04BFA4 46069200 */ add.s $f8, $f18, $f6 -/* 080AD8 7F04BFA8 0FC225E6 */ jal get_curplayer_positiondata -/* 080ADC 7F04BFAC E608000C */ swc1 $f8, 0xc($s0) -/* 080AE0 7F04BFB0 24190001 */ li $t9, 1 -/* 080AE4 7F04BFB4 AE020088 */ sw $v0, 0x88($s0) -/* 080AE8 7F04BFB8 AE190090 */ sw $t9, 0x90($s0) -/* 080AEC 7F04BFBC 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04BFC0: -/* 080AF0 7F04BFC0 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 080AF4 7F04BFC4 8FB00020 */ lw $s0, 0x20($sp) -/* 080AF8 7F04BFC8 03E00008 */ jr $ra -/* 080AFC 7F04BFCC 27BD0050 */ addiu $sp, $sp, 0x50 -) +#ifdef VERSION_EU + rot.x = (RANDOMFRAC() * 7.53982257843f * 0.015625f) - 0.058904863894f; + rot.y = (RANDOMFRAC() * 7.53982257843f * 0.015625f) - 0.058904863894f; + rot.z = (RANDOMFRAC() * 7.53982257843f * 0.015625f) - 0.058904863894f; +#else + rot.x = (RANDOMFRAC() * M_TAU_F * 0.015625f) - 0.049087387f; + rot.y = (RANDOMFRAC() * M_TAU_F * 0.015625f) - 0.049087387f; + rot.z = (RANDOMFRAC() * M_TAU_F * 0.015625f) - 0.049087387f; #endif -#endif + matrix_4x4_set_rotation_around_xyz((f32*)&rot, &projectile->mtx); + + projectile->flags |= PROJECTILEFLAG_AIRBORNE; + dir.x = arg1->x; + dir.y = arg1->y; + dir.z = arg1->z; + mtx4RotateVecInPlace(currentPlayerGetMatrix10D4(), (f32*)&dir); + projectile->speed.x += 3.3333333f * dir.x; + projectile->speed.z += 3.3333333f * dir.z; + projectile->ownerprop = get_curplayer_positiondata(); + projectile->unk90 = 1; + } +} -#ifdef NONMATCHING -void propobjSetDropped(PropRecord *prop, s32 a) +void propobjSetDropped(PropRecord *prop, DROPTYPE droptype) { - WeaponObjRecord *item; + PropRecord *parent = prop->parent; - if (prop->parent) + if (parent) { - item = prop->weapon; - sub_GAME_7F03FDA8(); - if (item->runtime_bitflags & RUNTIMEBITFLAG_DEPOSITED) + ObjectRecord *obj = prop->obj; + + sub_GAME_7F03FDA8(prop); + + if ((obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) && obj->embedment->projectile) { - if (item->unk6C->unk44) - { - item->unk6C->unk44->unkB8 = a; - } + obj->embedment->projectile->droptype = droptype; } - else if (item->runtime_bitflags & RUNTIMEBITFLAG_LAUNCHING) + else if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - item->unk6C->unkB8 = a; + obj->projectile->droptype = droptype; } } } -#else -GLOBAL_ASM( -.text -glabel propobjSetDropped -/* 080B00 7F04BFD0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 080B04 7F04BFD4 AFBF0014 */ sw $ra, 0x14($sp) -/* 080B08 7F04BFD8 8C82001C */ lw $v0, 0x1c($a0) -/* 080B0C 7F04BFDC 50400016 */ beql $v0, $zero, .L7F04C038 -/* 080B10 7F04BFE0 8FBF0014 */ lw $ra, 0x14($sp) -/* 080B14 7F04BFE4 8C820004 */ lw $v0, 4($a0) -/* 080B18 7F04BFE8 AFA50024 */ sw $a1, 0x24($sp) -/* 080B1C 7F04BFEC 0FC0FF6A */ jal sub_GAME_7F03FDA8 -/* 080B20 7F04BFF0 AFA20018 */ sw $v0, 0x18($sp) -/* 080B24 7F04BFF4 8FA20018 */ lw $v0, 0x18($sp) -/* 080B28 7F04BFF8 8FA50024 */ lw $a1, 0x24($sp) -/* 080B2C 7F04BFFC 8C430064 */ lw $v1, 0x64($v0) -/* 080B30 7F04C000 306E0040 */ andi $t6, $v1, 0x40 -/* 080B34 7F04C004 11C00007 */ beqz $t6, .L7F04C024 -/* 080B38 7F04C008 30780080 */ andi $t8, $v1, 0x80 -/* 080B3C 7F04C00C 8C4F006C */ lw $t7, 0x6c($v0) -/* 080B40 7F04C010 8DE40044 */ lw $a0, 0x44($t7) -/* 080B44 7F04C014 10800003 */ beqz $a0, .L7F04C024 -/* 080B48 7F04C018 00000000 */ nop -/* 080B4C 7F04C01C 10000005 */ b .L7F04C034 -/* 080B50 7F04C020 AC8500B8 */ sw $a1, 0xb8($a0) -.L7F04C024: -/* 080B54 7F04C024 53000004 */ beql $t8, $zero, .L7F04C038 -/* 080B58 7F04C028 8FBF0014 */ lw $ra, 0x14($sp) -/* 080B5C 7F04C02C 8C59006C */ lw $t9, 0x6c($v0) -/* 080B60 7F04C030 AF2500B8 */ sw $a1, 0xb8($t9) -.L7F04C034: -/* 080B64 7F04C034 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04C038: -/* 080B68 7F04C038 27BD0020 */ addiu $sp, $sp, 0x20 -/* 080B6C 7F04C03C 03E00008 */ jr $ra -/* 080B70 7F04C040 00000000 */ nop -) -#endif +void objDetach(PropRecord *prop) +{ + PropRecord *parent = prop->parent; + if (parent) + { + ObjectRecord *obj = prop->obj; + Model *model = obj->model; + chrpropDetach(prop); -#ifdef NONMATCHING -void sub_GAME_7F04C044( PropRecord *prop) + model->attachedto_objinst = NULL; + + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_HASOWNER; + + if (parent->type == PROP_TYPE_CHR || parent->type == PROP_TYPE_VIEWER) + { + ChrRecord *chr = parent->chr; + + if (chr) + { + if (prop == chr->handle_positiondata_hat) + { + chr->handle_positiondata_hat = NULL; + } + else if (prop == chr->weapons_held[GUNRIGHT]) + { + chrSetFiring(chr, GUNRIGHT, FALSE); + chr->weapons_held[GUNRIGHT] = NULL; + } + else if (prop == chr->weapons_held[GUNLEFT]) + { + chrSetFiring(chr, GUNLEFT, FALSE); + chr->weapons_held[GUNLEFT] = NULL; + } + } + } + } +} + + +s32 objDrop(PropRecord *prop) { - PropRecord *sp24; - ObjectRecord *sp20; - void *sp1C; - ObjectRecord *sp18; - ObjectRecord *temp_a0; - ObjectRecord *temp_v0; - PropRecord *temp_a1; - PropRecord *temp_a2; - u8 temp_v1; - void *temp_t6; + PropRecord *parent = prop->parent; + Projectile *projectile; + ObjectRecord *obj = prop->obj; + Model *model; + Mtxf spB8; + PropRecord *root; + StandTile* rootstan; + + if ((obj->runtime_bitflags & RUNTIMEBITFLAG_EMBEDDED) && obj->embedment->projectile) + { + Projectile* projectile2 = obj->embedment->projectile; + embedmentFree(obj->embedment); + + obj->projectile = projectile2; + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_EMBEDDED; + obj->runtime_bitflags |= RUNTIMEBITFLAG_DEPOSIT; + } - temp_a2 = prop->parent; - temp_a1 = prop; - if ((temp_a2 != 0) && ((temp_v0 = prop->obj, temp_t6 = temp_v0->model, sp24 = temp_a2, prop = temp_a1, sp20 = temp_v0, sp1C = temp_t6, chrpropDetach(temp_a1, temp_a2), sp1C->unk1C = 0, temp_v0->runtime_bitflags &= 0xFFF7FFFF, temp_v1 = temp_a2->type, (temp_v1 == 3)) || (temp_v1 == 6)) && (temp_a0 = temp_a2->obj, (temp_a0 != 0))) + if (parent && (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT)) { - if (prop == temp_a0->unk1D8) + model = obj->model; + projectile = obj->projectile; + root = parent; + + projectile->flags |= PROJECTILEFLAG_AIRBORNE; + projectile->ownerprop = parent; + + if (projectile->droptype == DROPTYPE_SURRENDER && parent->type == PROP_TYPE_CHR) { - temp_a0->unk1D8 = 0; - return; + ChrRecord* chr = parent->chr; + Model *chrmodel = chr->model; + coord3d rot = { 0.0f, 0.0f, 0.0f }; + f32 angle = getsubroty(chrmodel); + + projectile->speed.x = sinf(angle) * 1.6666666f; + projectile->speed.y = -RANDOMFRAC() * 1.6666666f * 0.5f; + projectile->speed.z = cosf(angle) * 1.6666666f; + +#ifdef VERSION_EU + rot.x = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; + rot.y = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; + rot.z = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; +#else + rot.x = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; + rot.y = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; + rot.z = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; +#endif + + matrix_4x4_set_rotation_around_xyz(rot.f, &projectile->mtx); } - if (prop == temp_a0->unk160) + else if (projectile->droptype == DROPTYPE_THROWGRENADE && parent->type == PROP_TYPE_CHR) { - sp18 = temp_a0; - sub_GAME_7F02D118(temp_a0, 0, 0); - temp_a0->unk160 = 0; - return; + ChrRecord* chr = parent->chr; + Model *chrmodel = chr->model; + coord3d rot = { 0.0f, 0.0f, 0.0f }; + f32 angle = getsubroty(chrmodel); + + projectile->speed.x = sinf(angle) * 13.333333f; + projectile->speed.y = 6.6666665f; + projectile->speed.z = cosf(angle) * 13.333333f; + +#ifdef VERSION_EU + rot.x = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; + rot.y = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; + rot.z = (RANDOMFRAC() * 7.53982257843f * 0.0078125f) - 0.029452431947f; +#else + rot.x = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; + rot.y = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; + rot.z = (RANDOMFRAC() * M_TAU_F * 0.0078125f) - 0.024543693f; +#endif + + matrix_4x4_set_rotation_around_xyz(rot.f, &projectile->mtx); + projectile->flags |= 0x40; + } - if (prop == temp_a0->unk164) + else if (projectile->droptype == DROPTYPE_HAT) { - sp18 = temp_a0; - sub_GAME_7F02D118(temp_a0, 1, 0); - temp_a0->unk164 = 0; - } - // Duplicate return node #10. Try simplifying control flow for better match - } -} + coord3d rot = { 0.0f, 0.0f, 0.0f }; + PropRecord *playerprop = get_curplayer_positiondata(); + f32 x = parent->pos.x - playerprop->pos.x; + f32 z = parent->pos.z - playerprop->pos.z; + f32 angle = atan2f(x, z); + + projectile->speed.x = ((2.0f * (RANDOMFRAC() * 1.6666666f)) + 3.3333333f) * sinf(angle); + projectile->speed.y = 2.0f * (RANDOMFRAC() * 1.6666666f); + projectile->speed.z = ((2.0f * (RANDOMFRAC() * 1.6666666f)) + 3.3333333f) * cosf(angle); +#ifdef VERSION_EU + rot.x = (RANDOMFRAC() * 7.53982257843f * 0.03125f) - 0.117809727788f; + rot.y = (RANDOMFRAC() * 7.53982257843f * 0.03125f) - 0.117809727788f; + rot.z = (RANDOMFRAC() * 7.53982257843f * 0.03125f) - 0.117809727788f; #else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04C044 -/* 080B74 7F04C044 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 080B78 7F04C048 AFBF0014 */ sw $ra, 0x14($sp) -/* 080B7C 7F04C04C 8C86001C */ lw $a2, 0x1c($a0) -/* 080B80 7F04C050 00802825 */ move $a1, $a0 -/* 080B84 7F04C054 50C00033 */ beql $a2, $zero, .L7F04C124 -/* 080B88 7F04C058 8FBF0014 */ lw $ra, 0x14($sp) -/* 080B8C 7F04C05C 8C820004 */ lw $v0, 4($a0) -/* 080B90 7F04C060 8C4E0014 */ lw $t6, 0x14($v0) -/* 080B94 7F04C064 AFA60024 */ sw $a2, 0x24($sp) -/* 080B98 7F04C068 AFA50028 */ sw $a1, 0x28($sp) -/* 080B9C 7F04C06C AFA20020 */ sw $v0, 0x20($sp) -/* 080BA0 7F04C070 0FC0E974 */ jal chrpropDetach -/* 080BA4 7F04C074 AFAE001C */ sw $t6, 0x1c($sp) -/* 080BA8 7F04C078 8FAF001C */ lw $t7, 0x1c($sp) -/* 080BAC 7F04C07C 8FA20020 */ lw $v0, 0x20($sp) -/* 080BB0 7F04C080 8FA60024 */ lw $a2, 0x24($sp) -/* 080BB4 7F04C084 8FA50028 */ lw $a1, 0x28($sp) -/* 080BB8 7F04C088 ADE0001C */ sw $zero, 0x1c($t7) -/* 080BBC 7F04C08C 8C580064 */ lw $t8, 0x64($v0) -/* 080BC0 7F04C090 3C01FFF7 */ lui $at, (0xFFF7FFFF >> 16) # lui $at, 0xfff7 -/* 080BC4 7F04C094 3421FFFF */ ori $at, (0xFFF7FFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 080BC8 7F04C098 0301C824 */ and $t9, $t8, $at -/* 080BCC 7F04C09C AC590064 */ sw $t9, 0x64($v0) -/* 080BD0 7F04C0A0 90C30000 */ lbu $v1, ($a2) -/* 080BD4 7F04C0A4 24010003 */ li $at, 3 -/* 080BD8 7F04C0A8 10610003 */ beq $v1, $at, .L7F04C0B8 -/* 080BDC 7F04C0AC 24010006 */ li $at, 6 -/* 080BE0 7F04C0B0 5461001C */ bnel $v1, $at, .L7F04C124 -/* 080BE4 7F04C0B4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04C0B8: -/* 080BE8 7F04C0B8 8CC40004 */ lw $a0, 4($a2) -/* 080BEC 7F04C0BC 50800019 */ beql $a0, $zero, .L7F04C124 -/* 080BF0 7F04C0C0 8FBF0014 */ lw $ra, 0x14($sp) -/* 080BF4 7F04C0C4 8C8801D8 */ lw $t0, 0x1d8($a0) -/* 080BF8 7F04C0C8 54A80004 */ bnel $a1, $t0, .L7F04C0DC -/* 080BFC 7F04C0CC 8C890160 */ lw $t1, 0x160($a0) -/* 080C00 7F04C0D0 10000013 */ b .L7F04C120 -/* 080C04 7F04C0D4 AC8001D8 */ sw $zero, 0x1d8($a0) -/* 080C08 7F04C0D8 8C890160 */ lw $t1, 0x160($a0) -.L7F04C0DC: -/* 080C0C 7F04C0DC 00003025 */ move $a2, $zero -/* 080C10 7F04C0E0 54A90008 */ bnel $a1, $t1, .L7F04C104 -/* 080C14 7F04C0E4 8C8A0164 */ lw $t2, 0x164($a0) -/* 080C18 7F04C0E8 00002825 */ move $a1, $zero -/* 080C1C 7F04C0EC 0FC0B446 */ jal sub_GAME_7F02D118 -/* 080C20 7F04C0F0 AFA40018 */ sw $a0, 0x18($sp) -/* 080C24 7F04C0F4 8FA40018 */ lw $a0, 0x18($sp) -/* 080C28 7F04C0F8 10000009 */ b .L7F04C120 -/* 080C2C 7F04C0FC AC800160 */ sw $zero, 0x160($a0) -/* 080C30 7F04C100 8C8A0164 */ lw $t2, 0x164($a0) -.L7F04C104: -/* 080C34 7F04C104 00003025 */ move $a2, $zero -/* 080C38 7F04C108 14AA0005 */ bne $a1, $t2, .L7F04C120 -/* 080C3C 7F04C10C 24050001 */ li $a1, 1 -/* 080C40 7F04C110 0FC0B446 */ jal sub_GAME_7F02D118 -/* 080C44 7F04C114 AFA40018 */ sw $a0, 0x18($sp) -/* 080C48 7F04C118 8FA40018 */ lw $a0, 0x18($sp) -/* 080C4C 7F04C11C AC800164 */ sw $zero, 0x164($a0) -.L7F04C120: -/* 080C50 7F04C120 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04C124: -/* 080C54 7F04C124 27BD0028 */ addiu $sp, $sp, 0x28 -/* 080C58 7F04C128 03E00008 */ jr $ra -/* 080C5C 7F04C12C 00000000 */ nop -) + rot.x = (RANDOMFRAC() * M_TAU_F * 0.03125f) - 0.09817477f; + rot.y = (RANDOMFRAC() * M_TAU_F * 0.03125f) - 0.09817477f; + rot.z = (RANDOMFRAC() * M_TAU_F * 0.03125f) - 0.09817477f; #endif + matrix_4x4_set_rotation_around_xyz(rot.f, &projectile->mtx); + } + else + { + // DROPTYPE_OWNERREAP ? + sub_GAME_7F057C14(&projectile->speed, &projectile->mtx); + } + + while (root->parent != NULL) + { + root = root->parent; + } + rootstan = root->stan; + if (prop->flags & PROPFLAG_ONSCREEN) + { + // Do collision checks + f32 objwidth = objGetWidth(obj); + Mtxf *sp58 = getsubmatrix(model); + s32 sp54 = 0x1F; + matrix_4x4_multiply_homogeneous(currentPlayerGetMatrix10D4(), sp58, &spB8); -#ifdef NONMATCHING -void sub_GAME_7F04C130(void) { + if (projectile->flags & 0x40) + { + sp54 = 0x1D; + } -} -#else + sub_GAME_7F03D058(root, FALSE); -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_80052CF8 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CFC -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D00 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D04 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D08 -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D0C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D10 -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D14 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D18 -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D1C -.word 0x41555555 /*13.333333*/ -glabel D_80052D20 -.word 0x40d55555 /*6.6666665*/ -glabel D_80052D24 -.word 0x41555555 /*13.333333*/ -glabel D_80052D28 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D2C -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D30 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D34 -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D38 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D3C -.word 0x3cc90fdb /*0.024543693*/ -glabel D_80052D40 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D44 -.word 0x40555555 /*3.3333333*/ -glabel D_80052D48 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D4C -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D50 -.word 0x40555555 /*3.3333333*/ -glabel D_80052D54 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D58 -.word 0x3dc90fdb /*0.098174773*/ -glabel D_80052D5C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D60 -.word 0x3dc90fdb /*0.098174773*/ -glabel D_80052D64 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D68 -.word 0x3dc90fdb /*0.098174773*/ -.text -glabel sub_GAME_7F04C130 -/* 080C60 7F04C130 27BDFEF8 */ addiu $sp, $sp, -0x108 -/* 080C64 7F04C134 AFBF003C */ sw $ra, 0x3c($sp) -/* 080C68 7F04C138 AFB20038 */ sw $s2, 0x38($sp) -/* 080C6C 7F04C13C AFB10034 */ sw $s1, 0x34($sp) -/* 080C70 7F04C140 AFB00030 */ sw $s0, 0x30($sp) -/* 080C74 7F04C144 AFA40108 */ sw $a0, 0x108($sp) -/* 080C78 7F04C148 8C8F001C */ lw $t7, 0x1c($a0) -/* 080C7C 7F04C14C AFAF0104 */ sw $t7, 0x104($sp) -/* 080C80 7F04C150 8C920004 */ lw $s2, 4($a0) -/* 080C84 7F04C154 8E580064 */ lw $t8, 0x64($s2) -/* 080C88 7F04C158 33190040 */ andi $t9, $t8, 0x40 -/* 080C8C 7F04C15C 5320000F */ beql $t9, $zero, .L7F04C19C -/* 080C90 7F04C160 8FAC0104 */ lw $t4, 0x104($sp) -/* 080C94 7F04C164 8E44006C */ lw $a0, 0x6c($s2) -/* 080C98 7F04C168 8C820044 */ lw $v0, 0x44($a0) -/* 080C9C 7F04C16C 5040000B */ beql $v0, $zero, .L7F04C19C -/* 080CA0 7F04C170 8FAC0104 */ lw $t4, 0x104($sp) -/* 080CA4 7F04C174 0FC0FFA2 */ jal sub_GAME_7F03FE88 -/* 080CA8 7F04C178 00408025 */ move $s0, $v0 -/* 080CAC 7F04C17C 8E480064 */ lw $t0, 0x64($s2) -/* 080CB0 7F04C180 2401FFBF */ li $at, -65 -/* 080CB4 7F04C184 AE50006C */ sw $s0, 0x6c($s2) -/* 080CB8 7F04C188 01014824 */ and $t1, $t0, $at -/* 080CBC 7F04C18C AE490064 */ sw $t1, 0x64($s2) -/* 080CC0 7F04C190 352B0080 */ ori $t3, $t1, 0x80 -/* 080CC4 7F04C194 AE4B0064 */ sw $t3, 0x64($s2) -/* 080CC8 7F04C198 8FAC0104 */ lw $t4, 0x104($sp) -.L7F04C19C: -/* 080CCC 7F04C19C 00001025 */ move $v0, $zero -/* 080CD0 7F04C1A0 11800222 */ beqz $t4, .L7F04CA2C -/* 080CD4 7F04C1A4 00000000 */ nop -/* 080CD8 7F04C1A8 8E4D0064 */ lw $t5, 0x64($s2) -/* 080CDC 7F04C1AC 31AF0080 */ andi $t7, $t5, 0x80 -/* 080CE0 7F04C1B0 11E0021E */ beqz $t7, .L7F04CA2C -/* 080CE4 7F04C1B4 00000000 */ nop -/* 080CE8 7F04C1B8 8E4E0014 */ lw $t6, 0x14($s2) -/* 080CEC 7F04C1BC 24010002 */ li $at, 2 -/* 080CF0 7F04C1C0 01808025 */ move $s0, $t4 -/* 080CF4 7F04C1C4 AFAE00F8 */ sw $t6, 0xf8($sp) -/* 080CF8 7F04C1C8 8E51006C */ lw $s1, 0x6c($s2) -/* 080CFC 7F04C1CC 8E380000 */ lw $t8, ($s1) -/* 080D00 7F04C1D0 8E2200B8 */ lw $v0, 0xb8($s1) -/* 080D04 7F04C1D4 37190001 */ ori $t9, $t8, 1 -/* 080D08 7F04C1D8 AE390000 */ sw $t9, ($s1) -/* 080D0C 7F04C1DC 8FA80104 */ lw $t0, 0x104($sp) -/* 080D10 7F04C1E0 1441007A */ bne $v0, $at, .L7F04C3CC -/* 080D14 7F04C1E4 AE280088 */ sw $t0, 0x88($s1) -/* 080D18 7F04C1E8 8FA90104 */ lw $t1, 0x104($sp) -/* 080D1C 7F04C1EC 24030003 */ li $v1, 3 -/* 080D20 7F04C1F0 3C0D8003 */ lui $t5, %hi(D_8003201C) -/* 080D24 7F04C1F4 912A0000 */ lbu $t2, ($t1) -/* 080D28 7F04C1F8 25AD201C */ addiu $t5, %lo(D_8003201C) # addiu $t5, $t5, 0x201c -/* 080D2C 7F04C1FC 27AB0098 */ addiu $t3, $sp, 0x98 -/* 080D30 7F04C200 546A0073 */ bnel $v1, $t2, .L7F04C3D0 -/* 080D34 7F04C204 24030003 */ li $v1, 3 -/* 080D38 7F04C208 8D220004 */ lw $v0, 4($t1) -/* 080D3C 7F04C20C 8DA10000 */ lw $at, ($t5) -/* 080D40 7F04C210 8DAE0004 */ lw $t6, 4($t5) -/* 080D44 7F04C214 8C44001C */ lw $a0, 0x1c($v0) -/* 080D48 7F04C218 AD610000 */ sw $at, ($t3) -/* 080D4C 7F04C21C 8DA10008 */ lw $at, 8($t5) -/* 080D50 7F04C220 AD6E0004 */ sw $t6, 4($t3) -/* 080D54 7F04C224 0FC1B320 */ jal getsubroty -/* 080D58 7F04C228 AD610008 */ sw $at, 8($t3) -/* 080D5C 7F04C22C E7A00094 */ swc1 $f0, 0x94($sp) -/* 080D60 7F04C230 0FC15FAB */ jal sinf -/* 080D64 7F04C234 46000306 */ mov.s $f12, $f0 -/* 080D68 7F04C238 3C018005 */ lui $at, %hi(D_80052CF8) -/* 080D6C 7F04C23C C4242CF8 */ lwc1 $f4, %lo(D_80052CF8)($at) -/* 080D70 7F04C240 46040182 */ mul.s $f6, $f0, $f4 -/* 080D74 7F04C244 0C002914 */ jal randomGetNext -/* 080D78 7F04C248 E6260004 */ swc1 $f6, 4($s1) -/* 080D7C 7F04C24C 44824000 */ mtc1 $v0, $f8 -/* 080D80 7F04C250 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080D84 7F04C254 04410004 */ bgez $v0, .L7F04C268 -/* 080D88 7F04C258 468042A0 */ cvt.s.w $f10, $f8 -/* 080D8C 7F04C25C 44818000 */ mtc1 $at, $f16 -/* 080D90 7F04C260 00000000 */ nop -/* 080D94 7F04C264 46105280 */ add.s $f10, $f10, $f16 -.L7F04C268: -/* 080D98 7F04C268 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080D9C 7F04C26C 44819000 */ mtc1 $at, $f18 -/* 080DA0 7F04C270 3C018005 */ lui $at, %hi(D_80052CFC) -/* 080DA4 7F04C274 C4282CFC */ lwc1 $f8, %lo(D_80052CFC)($at) -/* 080DA8 7F04C278 46125102 */ mul.s $f4, $f10, $f18 -/* 080DAC 7F04C27C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 080DB0 7F04C280 44815000 */ mtc1 $at, $f10 -/* 080DB4 7F04C284 46002187 */ neg.s $f6, $f4 -/* 080DB8 7F04C288 46083402 */ mul.s $f16, $f6, $f8 -/* 080DBC 7F04C28C 00000000 */ nop -/* 080DC0 7F04C290 460A8482 */ mul.s $f18, $f16, $f10 -/* 080DC4 7F04C294 E6320008 */ swc1 $f18, 8($s1) -/* 080DC8 7F04C298 0FC15FA8 */ jal cosf -/* 080DCC 7F04C29C C7AC0094 */ lwc1 $f12, 0x94($sp) -/* 080DD0 7F04C2A0 3C018005 */ lui $at, %hi(D_80052D00) -/* 080DD4 7F04C2A4 C4242D00 */ lwc1 $f4, %lo(D_80052D00)($at) -/* 080DD8 7F04C2A8 46040182 */ mul.s $f6, $f0, $f4 -/* 080DDC 7F04C2AC 0C002914 */ jal randomGetNext -/* 080DE0 7F04C2B0 E626000C */ swc1 $f6, 0xc($s1) -/* 080DE4 7F04C2B4 44824000 */ mtc1 $v0, $f8 -/* 080DE8 7F04C2B8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080DEC 7F04C2BC 04410004 */ bgez $v0, .L7F04C2D0 -/* 080DF0 7F04C2C0 46804420 */ cvt.s.w $f16, $f8 -/* 080DF4 7F04C2C4 44815000 */ mtc1 $at, $f10 -/* 080DF8 7F04C2C8 00000000 */ nop -/* 080DFC 7F04C2CC 460A8400 */ add.s $f16, $f16, $f10 -.L7F04C2D0: -/* 080E00 7F04C2D0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080E04 7F04C2D4 44819000 */ mtc1 $at, $f18 -/* 080E08 7F04C2D8 3C018005 */ lui $at, %hi(D_80052D04) -/* 080E0C 7F04C2DC C4262D04 */ lwc1 $f6, %lo(D_80052D04)($at) -/* 080E10 7F04C2E0 46128102 */ mul.s $f4, $f16, $f18 -/* 080E14 7F04C2E4 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080E18 7F04C2E8 44815000 */ mtc1 $at, $f10 -/* 080E1C 7F04C2EC 3C018005 */ lui $at, %hi(D_80052D08) -/* 080E20 7F04C2F0 C4322D08 */ lwc1 $f18, %lo(D_80052D08)($at) -/* 080E24 7F04C2F4 46062202 */ mul.s $f8, $f4, $f6 -/* 080E28 7F04C2F8 00000000 */ nop -/* 080E2C 7F04C2FC 460A4402 */ mul.s $f16, $f8, $f10 -/* 080E30 7F04C300 46128101 */ sub.s $f4, $f16, $f18 -/* 080E34 7F04C304 0C002914 */ jal randomGetNext -/* 080E38 7F04C308 E7A40098 */ swc1 $f4, 0x98($sp) -/* 080E3C 7F04C30C 44823000 */ mtc1 $v0, $f6 -/* 080E40 7F04C310 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080E44 7F04C314 04410004 */ bgez $v0, .L7F04C328 -/* 080E48 7F04C318 46803220 */ cvt.s.w $f8, $f6 -/* 080E4C 7F04C31C 44815000 */ mtc1 $at, $f10 -/* 080E50 7F04C320 00000000 */ nop -/* 080E54 7F04C324 460A4200 */ add.s $f8, $f8, $f10 -.L7F04C328: -/* 080E58 7F04C328 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080E5C 7F04C32C 44818000 */ mtc1 $at, $f16 -/* 080E60 7F04C330 3C018005 */ lui $at, %hi(D_80052D0C) -/* 080E64 7F04C334 C4242D0C */ lwc1 $f4, %lo(D_80052D0C)($at) -/* 080E68 7F04C338 46104482 */ mul.s $f18, $f8, $f16 -/* 080E6C 7F04C33C 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080E70 7F04C340 44815000 */ mtc1 $at, $f10 -/* 080E74 7F04C344 3C018005 */ lui $at, %hi(D_80052D10) -/* 080E78 7F04C348 C4302D10 */ lwc1 $f16, %lo(D_80052D10)($at) -/* 080E7C 7F04C34C 46049182 */ mul.s $f6, $f18, $f4 -/* 080E80 7F04C350 00000000 */ nop -/* 080E84 7F04C354 460A3202 */ mul.s $f8, $f6, $f10 -/* 080E88 7F04C358 46104481 */ sub.s $f18, $f8, $f16 -/* 080E8C 7F04C35C 0C002914 */ jal randomGetNext -/* 080E90 7F04C360 E7B2009C */ swc1 $f18, 0x9c($sp) -/* 080E94 7F04C364 44822000 */ mtc1 $v0, $f4 -/* 080E98 7F04C368 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080E9C 7F04C36C 04410004 */ bgez $v0, .L7F04C380 -/* 080EA0 7F04C370 468021A0 */ cvt.s.w $f6, $f4 -/* 080EA4 7F04C374 44815000 */ mtc1 $at, $f10 -/* 080EA8 7F04C378 00000000 */ nop -/* 080EAC 7F04C37C 460A3180 */ add.s $f6, $f6, $f10 -.L7F04C380: -/* 080EB0 7F04C380 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080EB4 7F04C384 44814000 */ mtc1 $at, $f8 -/* 080EB8 7F04C388 3C018005 */ lui $at, %hi(D_80052D14) -/* 080EBC 7F04C38C C4322D14 */ lwc1 $f18, %lo(D_80052D14)($at) -/* 080EC0 7F04C390 46083402 */ mul.s $f16, $f6, $f8 -/* 080EC4 7F04C394 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080EC8 7F04C398 44815000 */ mtc1 $at, $f10 -/* 080ECC 7F04C39C 3C018005 */ lui $at, %hi(D_80052D18) -/* 080ED0 7F04C3A0 C4282D18 */ lwc1 $f8, %lo(D_80052D18)($at) -/* 080ED4 7F04C3A4 27A40098 */ addiu $a0, $sp, 0x98 -/* 080ED8 7F04C3A8 26250020 */ addiu $a1, $s1, 0x20 -/* 080EDC 7F04C3AC 46128102 */ mul.s $f4, $f16, $f18 -/* 080EE0 7F04C3B0 00000000 */ nop -/* 080EE4 7F04C3B4 460A2182 */ mul.s $f6, $f4, $f10 -/* 080EE8 7F04C3B8 46083401 */ sub.s $f16, $f6, $f8 -/* 080EEC 7F04C3BC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 080EF0 7F04C3C0 E7B000A0 */ swc1 $f16, 0xa0($sp) -/* 080EF4 7F04C3C4 1000010C */ b .L7F04C7F8 -/* 080EF8 7F04C3C8 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C3CC: -/* 080EFC 7F04C3CC 24030003 */ li $v1, 3 -.L7F04C3D0: -/* 080F00 7F04C3D0 14620068 */ bne $v1, $v0, .L7F04C574 -/* 080F04 7F04C3D4 8FAC0104 */ lw $t4, 0x104($sp) -/* 080F08 7F04C3D8 91980000 */ lbu $t8, ($t4) -/* 080F0C 7F04C3DC 3C088003 */ lui $t0, %hi(D_80032028) -/* 080F10 7F04C3E0 25082028 */ addiu $t0, %lo(D_80032028) # addiu $t0, $t0, 0x2028 -/* 080F14 7F04C3E4 14780063 */ bne $v1, $t8, .L7F04C574 -/* 080F18 7F04C3E8 27B90080 */ addiu $t9, $sp, 0x80 -/* 080F1C 7F04C3EC 8D820004 */ lw $v0, 4($t4) -/* 080F20 7F04C3F0 8D010000 */ lw $at, ($t0) -/* 080F24 7F04C3F4 8D090004 */ lw $t1, 4($t0) -/* 080F28 7F04C3F8 8C44001C */ lw $a0, 0x1c($v0) -/* 080F2C 7F04C3FC AF210000 */ sw $at, ($t9) -/* 080F30 7F04C400 8D010008 */ lw $at, 8($t0) -/* 080F34 7F04C404 AF290004 */ sw $t1, 4($t9) -/* 080F38 7F04C408 0FC1B320 */ jal getsubroty -/* 080F3C 7F04C40C AF210008 */ sw $at, 8($t9) -/* 080F40 7F04C410 E7A0007C */ swc1 $f0, 0x7c($sp) -/* 080F44 7F04C414 0FC15FAB */ jal sinf -/* 080F48 7F04C418 46000306 */ mov.s $f12, $f0 -/* 080F4C 7F04C41C 3C018005 */ lui $at, %hi(D_80052D1C) -/* 080F50 7F04C420 C4322D1C */ lwc1 $f18, %lo(D_80052D1C)($at) -/* 080F54 7F04C424 3C018005 */ lui $at, %hi(D_80052D20) -/* 080F58 7F04C428 46120102 */ mul.s $f4, $f0, $f18 -/* 080F5C 7F04C42C E6240004 */ swc1 $f4, 4($s1) -/* 080F60 7F04C430 C42A2D20 */ lwc1 $f10, %lo(D_80052D20)($at) -/* 080F64 7F04C434 E62A0008 */ swc1 $f10, 8($s1) -/* 080F68 7F04C438 0FC15FA8 */ jal cosf -/* 080F6C 7F04C43C C7AC007C */ lwc1 $f12, 0x7c($sp) -/* 080F70 7F04C440 3C018005 */ lui $at, %hi(D_80052D24) -/* 080F74 7F04C444 C4262D24 */ lwc1 $f6, %lo(D_80052D24)($at) -/* 080F78 7F04C448 46060202 */ mul.s $f8, $f0, $f6 -/* 080F7C 7F04C44C 0C002914 */ jal randomGetNext -/* 080F80 7F04C450 E628000C */ swc1 $f8, 0xc($s1) -/* 080F84 7F04C454 44828000 */ mtc1 $v0, $f16 -/* 080F88 7F04C458 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080F8C 7F04C45C 04410004 */ bgez $v0, .L7F04C470 -/* 080F90 7F04C460 468084A0 */ cvt.s.w $f18, $f16 -/* 080F94 7F04C464 44812000 */ mtc1 $at, $f4 -/* 080F98 7F04C468 00000000 */ nop -/* 080F9C 7F04C46C 46049480 */ add.s $f18, $f18, $f4 -.L7F04C470: -/* 080FA0 7F04C470 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080FA4 7F04C474 44815000 */ mtc1 $at, $f10 -/* 080FA8 7F04C478 3C018005 */ lui $at, %hi(D_80052D28) -/* 080FAC 7F04C47C C4282D28 */ lwc1 $f8, %lo(D_80052D28)($at) -/* 080FB0 7F04C480 460A9182 */ mul.s $f6, $f18, $f10 -/* 080FB4 7F04C484 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080FB8 7F04C488 44812000 */ mtc1 $at, $f4 -/* 080FBC 7F04C48C 3C018005 */ lui $at, %hi(D_80052D2C) -/* 080FC0 7F04C490 C42A2D2C */ lwc1 $f10, %lo(D_80052D2C)($at) -/* 080FC4 7F04C494 46083402 */ mul.s $f16, $f6, $f8 -/* 080FC8 7F04C498 00000000 */ nop -/* 080FCC 7F04C49C 46048482 */ mul.s $f18, $f16, $f4 -/* 080FD0 7F04C4A0 460A9181 */ sub.s $f6, $f18, $f10 -/* 080FD4 7F04C4A4 0C002914 */ jal randomGetNext -/* 080FD8 7F04C4A8 E7A60080 */ swc1 $f6, 0x80($sp) -/* 080FDC 7F04C4AC 44824000 */ mtc1 $v0, $f8 -/* 080FE0 7F04C4B0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080FE4 7F04C4B4 04410004 */ bgez $v0, .L7F04C4C8 -/* 080FE8 7F04C4B8 46804420 */ cvt.s.w $f16, $f8 -/* 080FEC 7F04C4BC 44812000 */ mtc1 $at, $f4 -/* 080FF0 7F04C4C0 00000000 */ nop -/* 080FF4 7F04C4C4 46048400 */ add.s $f16, $f16, $f4 -.L7F04C4C8: -/* 080FF8 7F04C4C8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080FFC 7F04C4CC 44819000 */ mtc1 $at, $f18 -/* 081000 7F04C4D0 3C018005 */ lui $at, %hi(D_80052D30) -/* 081004 7F04C4D4 C4262D30 */ lwc1 $f6, %lo(D_80052D30)($at) -/* 081008 7F04C4D8 46128282 */ mul.s $f10, $f16, $f18 -/* 08100C 7F04C4DC 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 081010 7F04C4E0 44812000 */ mtc1 $at, $f4 -/* 081014 7F04C4E4 3C018005 */ lui $at, %hi(D_80052D34) -/* 081018 7F04C4E8 C4322D34 */ lwc1 $f18, %lo(D_80052D34)($at) -/* 08101C 7F04C4EC 46065202 */ mul.s $f8, $f10, $f6 -/* 081020 7F04C4F0 00000000 */ nop -/* 081024 7F04C4F4 46044402 */ mul.s $f16, $f8, $f4 -/* 081028 7F04C4F8 46128281 */ sub.s $f10, $f16, $f18 -/* 08102C 7F04C4FC 0C002914 */ jal randomGetNext -/* 081030 7F04C500 E7AA0084 */ swc1 $f10, 0x84($sp) -/* 081034 7F04C504 44823000 */ mtc1 $v0, $f6 -/* 081038 7F04C508 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08103C 7F04C50C 04410004 */ bgez $v0, .L7F04C520 -/* 081040 7F04C510 46803220 */ cvt.s.w $f8, $f6 -/* 081044 7F04C514 44812000 */ mtc1 $at, $f4 -/* 081048 7F04C518 00000000 */ nop -/* 08104C 7F04C51C 46044200 */ add.s $f8, $f8, $f4 -.L7F04C520: -/* 081050 7F04C520 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081054 7F04C524 44818000 */ mtc1 $at, $f16 -/* 081058 7F04C528 3C018005 */ lui $at, %hi(D_80052D38) -/* 08105C 7F04C52C C42A2D38 */ lwc1 $f10, %lo(D_80052D38)($at) -/* 081060 7F04C530 46104482 */ mul.s $f18, $f8, $f16 -/* 081064 7F04C534 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 081068 7F04C538 44812000 */ mtc1 $at, $f4 -/* 08106C 7F04C53C 3C018005 */ lui $at, %hi(D_80052D3C) -/* 081070 7F04C540 C4302D3C */ lwc1 $f16, %lo(D_80052D3C)($at) -/* 081074 7F04C544 27A40080 */ addiu $a0, $sp, 0x80 -/* 081078 7F04C548 26250020 */ addiu $a1, $s1, 0x20 -/* 08107C 7F04C54C 460A9182 */ mul.s $f6, $f18, $f10 -/* 081080 7F04C550 00000000 */ nop -/* 081084 7F04C554 46043202 */ mul.s $f8, $f6, $f4 -/* 081088 7F04C558 46104481 */ sub.s $f18, $f8, $f16 -/* 08108C 7F04C55C 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 081090 7F04C560 E7B20088 */ swc1 $f18, 0x88($sp) -/* 081094 7F04C564 8E2F0000 */ lw $t7, ($s1) -/* 081098 7F04C568 35EB0040 */ ori $t3, $t7, 0x40 -/* 08109C 7F04C56C 100000A1 */ b .L7F04C7F4 -/* 0810A0 7F04C570 AE2B0000 */ sw $t3, ($s1) -.L7F04C574: -/* 0810A4 7F04C574 24010004 */ li $at, 4 -/* 0810A8 7F04C578 1441009C */ bne $v0, $at, .L7F04C7EC -/* 0810AC 7F04C57C 26240004 */ addiu $a0, $s1, 4 -/* 0810B0 7F04C580 3C0E8003 */ lui $t6, %hi(D_80032034) -/* 0810B4 7F04C584 25CE2034 */ addiu $t6, %lo(D_80032034) # addiu $t6, $t6, 0x2034 -/* 0810B8 7F04C588 8DC10000 */ lw $at, ($t6) -/* 0810BC 7F04C58C 27AD0070 */ addiu $t5, $sp, 0x70 -/* 0810C0 7F04C590 8DCC0004 */ lw $t4, 4($t6) -/* 0810C4 7F04C594 ADA10000 */ sw $at, ($t5) -/* 0810C8 7F04C598 8DC10008 */ lw $at, 8($t6) -/* 0810CC 7F04C59C ADAC0004 */ sw $t4, 4($t5) -/* 0810D0 7F04C5A0 0FC225E6 */ jal get_curplayer_positiondata -/* 0810D4 7F04C5A4 ADA10008 */ sw $at, 8($t5) -/* 0810D8 7F04C5A8 8FAA0104 */ lw $t2, 0x104($sp) -/* 0810DC 7F04C5AC C4460008 */ lwc1 $f6, 8($v0) -/* 0810E0 7F04C5B0 C4480010 */ lwc1 $f8, 0x10($v0) -/* 0810E4 7F04C5B4 C54A0008 */ lwc1 $f10, 8($t2) -/* 0810E8 7F04C5B8 C5440010 */ lwc1 $f4, 0x10($t2) -/* 0810EC 7F04C5BC 46065301 */ sub.s $f12, $f10, $f6 -/* 0810F0 7F04C5C0 0FC16A8C */ jal atan2f -/* 0810F4 7F04C5C4 46082381 */ sub.s $f14, $f4, $f8 -/* 0810F8 7F04C5C8 0C002914 */ jal randomGetNext -/* 0810FC 7F04C5CC E7A00060 */ swc1 $f0, 0x60($sp) -/* 081100 7F04C5D0 AFA20050 */ sw $v0, 0x50($sp) -/* 081104 7F04C5D4 0FC15FAB */ jal sinf -/* 081108 7F04C5D8 C7AC0060 */ lwc1 $f12, 0x60($sp) -/* 08110C 7F04C5DC 8FB90050 */ lw $t9, 0x50($sp) -/* 081110 7F04C5E0 44998000 */ mtc1 $t9, $f16 -/* 081114 7F04C5E4 07210005 */ bgez $t9, .L7F04C5FC -/* 081118 7F04C5E8 468084A0 */ cvt.s.w $f18, $f16 -/* 08111C 7F04C5EC 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081120 7F04C5F0 44815000 */ mtc1 $at, $f10 -/* 081124 7F04C5F4 00000000 */ nop -/* 081128 7F04C5F8 460A9480 */ add.s $f18, $f18, $f10 -.L7F04C5FC: -/* 08112C 7F04C5FC 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081130 7F04C600 44813000 */ mtc1 $at, $f6 -/* 081134 7F04C604 3C018005 */ lui $at, %hi(D_80052D40) -/* 081138 7F04C608 C4282D40 */ lwc1 $f8, %lo(D_80052D40)($at) -/* 08113C 7F04C60C 46069102 */ mul.s $f4, $f18, $f6 -/* 081140 7F04C610 3C018005 */ lui $at, %hi(D_80052D44) -/* 081144 7F04C614 C42A2D44 */ lwc1 $f10, %lo(D_80052D44)($at) -/* 081148 7F04C618 46082082 */ mul.s $f2, $f4, $f8 -/* 08114C 7F04C61C 46021400 */ add.s $f16, $f2, $f2 -/* 081150 7F04C620 460A8480 */ add.s $f18, $f16, $f10 -/* 081154 7F04C624 46120182 */ mul.s $f6, $f0, $f18 -/* 081158 7F04C628 0C002914 */ jal randomGetNext -/* 08115C 7F04C62C E6260004 */ swc1 $f6, 4($s1) -/* 081160 7F04C630 44822000 */ mtc1 $v0, $f4 -/* 081164 7F04C634 04410005 */ bgez $v0, .L7F04C64C -/* 081168 7F04C638 46802220 */ cvt.s.w $f8, $f4 -/* 08116C 7F04C63C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081170 7F04C640 44818000 */ mtc1 $at, $f16 -/* 081174 7F04C644 00000000 */ nop -/* 081178 7F04C648 46104200 */ add.s $f8, $f8, $f16 -.L7F04C64C: -/* 08117C 7F04C64C 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081180 7F04C650 44815000 */ mtc1 $at, $f10 -/* 081184 7F04C654 3C018005 */ lui $at, %hi(D_80052D48) -/* 081188 7F04C658 C4262D48 */ lwc1 $f6, %lo(D_80052D48)($at) -/* 08118C 7F04C65C 460A4482 */ mul.s $f18, $f8, $f10 -/* 081190 7F04C660 00000000 */ nop -/* 081194 7F04C664 46069002 */ mul.s $f0, $f18, $f6 -/* 081198 7F04C668 46000100 */ add.s $f4, $f0, $f0 -/* 08119C 7F04C66C 0C002914 */ jal randomGetNext -/* 0811A0 7F04C670 E6240008 */ swc1 $f4, 8($s1) -/* 0811A4 7F04C674 AFA20050 */ sw $v0, 0x50($sp) -/* 0811A8 7F04C678 0FC15FA8 */ jal cosf -/* 0811AC 7F04C67C C7AC0060 */ lwc1 $f12, 0x60($sp) -/* 0811B0 7F04C680 8FA80050 */ lw $t0, 0x50($sp) -/* 0811B4 7F04C684 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0811B8 7F04C688 44888000 */ mtc1 $t0, $f16 -/* 0811BC 7F04C68C 05010004 */ bgez $t0, .L7F04C6A0 -/* 0811C0 7F04C690 46808220 */ cvt.s.w $f8, $f16 -/* 0811C4 7F04C694 44815000 */ mtc1 $at, $f10 -/* 0811C8 7F04C698 00000000 */ nop -/* 0811CC 7F04C69C 460A4200 */ add.s $f8, $f8, $f10 -.L7F04C6A0: -/* 0811D0 7F04C6A0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0811D4 7F04C6A4 44819000 */ mtc1 $at, $f18 -/* 0811D8 7F04C6A8 3C018005 */ lui $at, %hi(D_80052D4C) -/* 0811DC 7F04C6AC C4242D4C */ lwc1 $f4, %lo(D_80052D4C)($at) -/* 0811E0 7F04C6B0 46124182 */ mul.s $f6, $f8, $f18 -/* 0811E4 7F04C6B4 3C018005 */ lui $at, %hi(D_80052D50) -/* 0811E8 7F04C6B8 C42A2D50 */ lwc1 $f10, %lo(D_80052D50)($at) -/* 0811EC 7F04C6BC 46043082 */ mul.s $f2, $f6, $f4 -/* 0811F0 7F04C6C0 46021400 */ add.s $f16, $f2, $f2 -/* 0811F4 7F04C6C4 460A8200 */ add.s $f8, $f16, $f10 -/* 0811F8 7F04C6C8 46080482 */ mul.s $f18, $f0, $f8 -/* 0811FC 7F04C6CC 0C002914 */ jal randomGetNext -/* 081200 7F04C6D0 E632000C */ swc1 $f18, 0xc($s1) -/* 081204 7F04C6D4 44823000 */ mtc1 $v0, $f6 -/* 081208 7F04C6D8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08120C 7F04C6DC 04410004 */ bgez $v0, .L7F04C6F0 -/* 081210 7F04C6E0 46803120 */ cvt.s.w $f4, $f6 -/* 081214 7F04C6E4 44818000 */ mtc1 $at, $f16 -/* 081218 7F04C6E8 00000000 */ nop -/* 08121C 7F04C6EC 46102100 */ add.s $f4, $f4, $f16 -.L7F04C6F0: -/* 081220 7F04C6F0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081224 7F04C6F4 44815000 */ mtc1 $at, $f10 -/* 081228 7F04C6F8 3C018005 */ lui $at, %hi(D_80052D54) -/* 08122C 7F04C6FC C4322D54 */ lwc1 $f18, %lo(D_80052D54)($at) -/* 081230 7F04C700 460A2202 */ mul.s $f8, $f4, $f10 -/* 081234 7F04C704 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 081238 7F04C708 44818000 */ mtc1 $at, $f16 -/* 08123C 7F04C70C 3C018005 */ lui $at, %hi(D_80052D58) -/* 081240 7F04C710 C42A2D58 */ lwc1 $f10, %lo(D_80052D58)($at) -/* 081244 7F04C714 46124182 */ mul.s $f6, $f8, $f18 -/* 081248 7F04C718 00000000 */ nop -/* 08124C 7F04C71C 46103102 */ mul.s $f4, $f6, $f16 -/* 081250 7F04C720 460A2201 */ sub.s $f8, $f4, $f10 -/* 081254 7F04C724 0C002914 */ jal randomGetNext -/* 081258 7F04C728 E7A80070 */ swc1 $f8, 0x70($sp) -/* 08125C 7F04C72C 44829000 */ mtc1 $v0, $f18 -/* 081260 7F04C730 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081264 7F04C734 04410004 */ bgez $v0, .L7F04C748 -/* 081268 7F04C738 468091A0 */ cvt.s.w $f6, $f18 -/* 08126C 7F04C73C 44818000 */ mtc1 $at, $f16 -/* 081270 7F04C740 00000000 */ nop -/* 081274 7F04C744 46103180 */ add.s $f6, $f6, $f16 -.L7F04C748: -/* 081278 7F04C748 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08127C 7F04C74C 44812000 */ mtc1 $at, $f4 -/* 081280 7F04C750 3C018005 */ lui $at, %hi(D_80052D5C) -/* 081284 7F04C754 C4282D5C */ lwc1 $f8, %lo(D_80052D5C)($at) -/* 081288 7F04C758 46043282 */ mul.s $f10, $f6, $f4 -/* 08128C 7F04C75C 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 081290 7F04C760 44818000 */ mtc1 $at, $f16 -/* 081294 7F04C764 3C018005 */ lui $at, %hi(D_80052D60) -/* 081298 7F04C768 C4242D60 */ lwc1 $f4, %lo(D_80052D60)($at) -/* 08129C 7F04C76C 46085482 */ mul.s $f18, $f10, $f8 -/* 0812A0 7F04C770 00000000 */ nop -/* 0812A4 7F04C774 46109182 */ mul.s $f6, $f18, $f16 -/* 0812A8 7F04C778 46043281 */ sub.s $f10, $f6, $f4 -/* 0812AC 7F04C77C 0C002914 */ jal randomGetNext -/* 0812B0 7F04C780 E7AA0074 */ swc1 $f10, 0x74($sp) -/* 0812B4 7F04C784 44824000 */ mtc1 $v0, $f8 -/* 0812B8 7F04C788 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0812BC 7F04C78C 04410004 */ bgez $v0, .L7F04C7A0 -/* 0812C0 7F04C790 468044A0 */ cvt.s.w $f18, $f8 -/* 0812C4 7F04C794 44818000 */ mtc1 $at, $f16 -/* 0812C8 7F04C798 00000000 */ nop -/* 0812CC 7F04C79C 46109480 */ add.s $f18, $f18, $f16 -.L7F04C7A0: -/* 0812D0 7F04C7A0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0812D4 7F04C7A4 44813000 */ mtc1 $at, $f6 -/* 0812D8 7F04C7A8 3C018005 */ lui $at, %hi(D_80052D64) -/* 0812DC 7F04C7AC C42A2D64 */ lwc1 $f10, %lo(D_80052D64)($at) -/* 0812E0 7F04C7B0 46069102 */ mul.s $f4, $f18, $f6 -/* 0812E4 7F04C7B4 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 0812E8 7F04C7B8 44818000 */ mtc1 $at, $f16 -/* 0812EC 7F04C7BC 3C018005 */ lui $at, %hi(D_80052D68) -/* 0812F0 7F04C7C0 C4262D68 */ lwc1 $f6, %lo(D_80052D68)($at) -/* 0812F4 7F04C7C4 27A40070 */ addiu $a0, $sp, 0x70 -/* 0812F8 7F04C7C8 26250020 */ addiu $a1, $s1, 0x20 -/* 0812FC 7F04C7CC 460A2202 */ mul.s $f8, $f4, $f10 -/* 081300 7F04C7D0 00000000 */ nop -/* 081304 7F04C7D4 46104482 */ mul.s $f18, $f8, $f16 -/* 081308 7F04C7D8 46069101 */ sub.s $f4, $f18, $f6 -/* 08130C 7F04C7DC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 081310 7F04C7E0 E7A40078 */ swc1 $f4, 0x78($sp) -/* 081314 7F04C7E4 10000004 */ b .L7F04C7F8 -/* 081318 7F04C7E8 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C7EC: -/* 08131C 7F04C7EC 0FC15F05 */ jal sub_GAME_7F057C14 -/* 081320 7F04C7F0 26250020 */ addiu $a1, $s1, 0x20 -.L7F04C7F4: -/* 081324 7F04C7F4 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C7F8: -/* 081328 7F04C7F8 8D2F001C */ lw $t7, 0x1c($t1) -/* 08132C 7F04C7FC 51E00007 */ beql $t7, $zero, .L7F04C81C -/* 081330 7F04C800 8E0B0014 */ lw $t3, 0x14($s0) -/* 081334 7F04C804 8E02001C */ lw $v0, 0x1c($s0) -/* 081338 7F04C808 00408025 */ move $s0, $v0 -.L7F04C80C: -/* 08133C 7F04C80C 8C42001C */ lw $v0, 0x1c($v0) -/* 081340 7F04C810 5440FFFE */ bnezl $v0, .L7F04C80C -/* 081344 7F04C814 00408025 */ move $s0, $v0 -/* 081348 7F04C818 8E0B0014 */ lw $t3, 0x14($s0) -.L7F04C81C: -/* 08134C 7F04C81C 8FA20108 */ lw $v0, 0x108($sp) -/* 081350 7F04C820 AFAB00B0 */ sw $t3, 0xb0($sp) -/* 081354 7F04C824 90580001 */ lbu $t8, 1($v0) -/* 081358 7F04C828 330D0002 */ andi $t5, $t8, 2 -/* 08135C 7F04C82C 51A0004B */ beql $t5, $zero, .L7F04C95C -/* 081360 7F04C830 8E0A0014 */ lw $t2, 0x14($s0) -/* 081364 7F04C834 0FC10411 */ jal objGetWidth -/* 081368 7F04C838 02402025 */ move $a0, $s2 -/* 08136C 7F04C83C E7A0005C */ swc1 $f0, 0x5c($sp) -/* 081370 7F04C840 0FC1B1A8 */ jal getsubmatrix -/* 081374 7F04C844 8FA400F8 */ lw $a0, 0xf8($sp) -/* 081378 7F04C848 240E001F */ li $t6, 31 -/* 08137C 7F04C84C AFA20058 */ sw $v0, 0x58($sp) -/* 081380 7F04C850 0FC1E111 */ jal currentPlayerGetMatrix10D4 -/* 081384 7F04C854 AFAE0054 */ sw $t6, 0x54($sp) -/* 081388 7F04C858 00402025 */ move $a0, $v0 -/* 08138C 7F04C85C 8FA50058 */ lw $a1, 0x58($sp) -/* 081390 7F04C860 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 081394 7F04C864 27A600B8 */ addiu $a2, $sp, 0xb8 -/* 081398 7F04C868 8E2C0000 */ lw $t4, ($s1) -/* 08139C 7F04C86C 2419001D */ li $t9, 29 -/* 0813A0 7F04C870 02002025 */ move $a0, $s0 -/* 0813A4 7F04C874 318A0040 */ andi $t2, $t4, 0x40 -/* 0813A8 7F04C878 11400002 */ beqz $t2, .L7F04C884 -/* 0813AC 7F04C87C 00000000 */ nop -/* 0813B0 7F04C880 AFB90054 */ sw $t9, 0x54($sp) -.L7F04C884: -/* 0813B4 7F04C884 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0813B8 7F04C888 00002825 */ move $a1, $zero -/* 0813BC 7F04C88C 8E050008 */ lw $a1, 8($s0) -/* 0813C0 7F04C890 8E060010 */ lw $a2, 0x10($s0) -/* 0813C4 7F04C894 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0813C8 7F04C898 44811000 */ mtc1 $at, $f2 -/* 0813CC 7F04C89C 44800000 */ mtc1 $zero, $f0 -/* 0813D0 7F04C8A0 C7AA00F0 */ lwc1 $f10, 0xf0($sp) -/* 0813D4 7F04C8A4 8FA80054 */ lw $t0, 0x54($sp) -/* 0813D8 7F04C8A8 27B100B0 */ addiu $s1, $sp, 0xb0 -/* 0813DC 7F04C8AC 02202025 */ move $a0, $s1 -/* 0813E0 7F04C8B0 8FA700E8 */ lw $a3, 0xe8($sp) -/* 0813E4 7F04C8B4 E7A2001C */ swc1 $f2, 0x1c($sp) -/* 0813E8 7F04C8B8 E7A20024 */ swc1 $f2, 0x24($sp) -/* 0813EC 7F04C8BC E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0813F0 7F04C8C0 E7A00018 */ swc1 $f0, 0x18($sp) -/* 0813F4 7F04C8C4 E7A00020 */ swc1 $f0, 0x20($sp) -/* 0813F8 7F04C8C8 0FC2C389 */ jal sub_GAME_7F0B0E24 -/* 0813FC 7F04C8CC AFA80014 */ sw $t0, 0x14($sp) -/* 081400 7F04C8D0 10400011 */ beqz $v0, .L7F04C918 -/* 081404 7F04C8D4 02202025 */ move $a0, $s1 -/* 081408 7F04C8D8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08140C 7F04C8DC 44818000 */ mtc1 $at, $f16 -/* 081410 7F04C8E0 8FA90054 */ lw $t1, 0x54($sp) -/* 081414 7F04C8E4 44804000 */ mtc1 $zero, $f8 -/* 081418 7F04C8E8 8FA500E8 */ lw $a1, 0xe8($sp) -/* 08141C 7F04C8EC 8FA600F0 */ lw $a2, 0xf0($sp) -/* 081420 7F04C8F0 8FA7005C */ lw $a3, 0x5c($sp) -/* 081424 7F04C8F4 AFA90010 */ sw $t1, 0x10($sp) -/* 081428 7F04C8F8 E7B00018 */ swc1 $f16, 0x18($sp) -/* 08142C 7F04C8FC 0FC2C62E */ jal sub_GAME_7F0B18B8 -/* 081430 7F04C900 E7A80014 */ swc1 $f8, 0x14($sp) -/* 081434 7F04C904 04410004 */ bgez $v0, .L7F04C918 -/* 081438 7F04C908 8FAF00B0 */ lw $t7, 0xb0($sp) -/* 08143C 7F04C90C 8FAB0108 */ lw $t3, 0x108($sp) -/* 081440 7F04C910 10000008 */ b .L7F04C934 -/* 081444 7F04C914 AD6F0014 */ sw $t7, 0x14($t3) -.L7F04C918: -/* 081448 7F04C918 8E180014 */ lw $t8, 0x14($s0) -/* 08144C 7F04C91C 8FAD0108 */ lw $t5, 0x108($sp) -/* 081450 7F04C920 ADB80014 */ sw $t8, 0x14($t5) -/* 081454 7F04C924 C6120008 */ lwc1 $f18, 8($s0) -/* 081458 7F04C928 E7B200E8 */ swc1 $f18, 0xe8($sp) -/* 08145C 7F04C92C C6060010 */ lwc1 $f6, 0x10($s0) -/* 081460 7F04C930 E7A600F0 */ swc1 $f6, 0xf0($sp) -.L7F04C934: -/* 081464 7F04C934 02002025 */ move $a0, $s0 -/* 081468 7F04C938 0FC0F416 */ jal sub_GAME_7F03D058 -/* 08146C 7F04C93C 24050001 */ li $a1, 1 -/* 081470 7F04C940 8FAE0058 */ lw $t6, 0x58($sp) -/* 081474 7F04C944 8FAC0108 */ lw $t4, 0x108($sp) -/* 081478 7F04C948 C5C40038 */ lwc1 $f4, 0x38($t6) -/* 08147C 7F04C94C 46002287 */ neg.s $f10, $f4 -/* 081480 7F04C950 1000000C */ b .L7F04C984 -/* 081484 7F04C954 E58A0018 */ swc1 $f10, 0x18($t4) -/* 081488 7F04C958 8E0A0014 */ lw $t2, 0x14($s0) -.L7F04C95C: -/* 08148C 7F04C95C 27A400B8 */ addiu $a0, $sp, 0xb8 -/* 081490 7F04C960 0FC15FF4 */ jal matrix_4x4_set_identity -/* 081494 7F04C964 AC4A0014 */ sw $t2, 0x14($v0) -/* 081498 7F04C968 8FB900F8 */ lw $t9, 0xf8($sp) -/* 08149C 7F04C96C 27A500B8 */ addiu $a1, $sp, 0xb8 -/* 0814A0 7F04C970 0FC1629F */ jal matrix_scalar_multiply -/* 0814A4 7F04C974 C72C0014 */ lwc1 $f12, 0x14($t9) -/* 0814A8 7F04C978 26040008 */ addiu $a0, $s0, 8 -/* 0814AC 7F04C97C 0FC16266 */ jal matrix_4x4_set_position -/* 0814B0 7F04C980 27A500B8 */ addiu $a1, $sp, 0xb8 -.L7F04C984: -/* 0814B4 7F04C984 0FC13011 */ jal sub_GAME_7F04C044 -/* 0814B8 7F04C988 8FA40108 */ lw $a0, 0x108($sp) -/* 0814BC 7F04C98C 0FC0E929 */ jal chrpropActivate -/* 0814C0 7F04C990 8FA40108 */ lw $a0, 0x108($sp) -/* 0814C4 7F04C994 0FC0E901 */ jal chrpropEnable -/* 0814C8 7F04C998 8FA40108 */ lw $a0, 0x108($sp) -/* 0814CC 7F04C99C C7A000E8 */ lwc1 $f0, 0xe8($sp) -/* 0814D0 7F04C9A0 8FA80108 */ lw $t0, 0x108($sp) -/* 0814D4 7F04C9A4 44804000 */ mtc1 $zero, $f8 -/* 0814D8 7F04C9A8 44808000 */ mtc1 $zero, $f16 -/* 0814DC 7F04C9AC E5000008 */ swc1 $f0, 8($t0) -/* 0814E0 7F04C9B0 E6400058 */ swc1 $f0, 0x58($s2) -/* 0814E4 7F04C9B4 C7A000EC */ lwc1 $f0, 0xec($sp) -/* 0814E8 7F04C9B8 8FA90108 */ lw $t1, 0x108($sp) -/* 0814EC 7F04C9BC 44809000 */ mtc1 $zero, $f18 -/* 0814F0 7F04C9C0 27A400B8 */ addiu $a0, $sp, 0xb8 -/* 0814F4 7F04C9C4 E520000C */ swc1 $f0, 0xc($t1) -/* 0814F8 7F04C9C8 E640005C */ swc1 $f0, 0x5c($s2) -/* 0814FC 7F04C9CC C7A000F0 */ lwc1 $f0, 0xf0($sp) -/* 081500 7F04C9D0 8FAF0108 */ lw $t7, 0x108($sp) -/* 081504 7F04C9D4 26450018 */ addiu $a1, $s2, 0x18 -/* 081508 7F04C9D8 E5E00010 */ swc1 $f0, 0x10($t7) -/* 08150C 7F04C9DC E6400060 */ swc1 $f0, 0x60($s2) -/* 081510 7F04C9E0 E7A800E8 */ swc1 $f8, 0xe8($sp) -/* 081514 7F04C9E4 E7B000EC */ swc1 $f16, 0xec($sp) -/* 081518 7F04C9E8 0FC16008 */ jal matrix_4x4_copy -/* 08151C 7F04C9EC E7B200F0 */ swc1 $f18, 0xf0($sp) -/* 081520 7F04C9F0 8E440010 */ lw $a0, 0x10($s2) -/* 081524 7F04C9F4 0FC100AD */ jal sub_GAME_7F0402B4 -/* 081528 7F04C9F8 2645007C */ addiu $a1, $s2, 0x7c -/* 08152C 7F04C9FC 924B007C */ lbu $t3, 0x7c($s2) -/* 081530 7F04CA00 9258007D */ lbu $t8, 0x7d($s2) -/* 081534 7F04CA04 924D007E */ lbu $t5, 0x7e($s2) -/* 081538 7F04CA08 924E007F */ lbu $t6, 0x7f($s2) -/* 08153C 7F04CA0C 02402025 */ move $a0, $s2 -/* 081540 7F04CA10 A24B0078 */ sb $t3, 0x78($s2) -/* 081544 7F04CA14 A2580079 */ sb $t8, 0x79($s2) -/* 081548 7F04CA18 A24D007A */ sb $t5, 0x7a($s2) -/* 08154C 7F04CA1C 0FC15B28 */ jal setupUpdateObjectRoomPosition -/* 081550 7F04CA20 A24E007B */ sb $t6, 0x7b($s2) -/* 081554 7F04CA24 10000001 */ b .L7F04CA2C -/* 081558 7F04CA28 24020001 */ li $v0, 1 -.L7F04CA2C: -/* 08155C 7F04CA2C 8FBF003C */ lw $ra, 0x3c($sp) -/* 081560 7F04CA30 8FB00030 */ lw $s0, 0x30($sp) -/* 081564 7F04CA34 8FB10034 */ lw $s1, 0x34($sp) -/* 081568 7F04CA38 8FB20038 */ lw $s2, 0x38($sp) -/* 08156C 7F04CA3C 03E00008 */ jr $ra -/* 081570 7F04CA40 27BD0108 */ addiu $sp, $sp, 0x108 -) -#endif + if ((stanTestLineUnobstructed(&rootstan, root->pos.f[0], root->pos.f[2], spB8.m[3][0], spB8.m[3][2], sp54, 0.0f, 1.0f, 0.0f, 1.0f) != 0) + && (stanTestVolume(&rootstan, spB8.m[3][0], spB8.m[3][2], objwidth, sp54, 0.0f, 1.0f) < 0)) + { + prop->stan = rootstan; -#if !defined(LEFTOVERDEBUG) + } + else + { + prop->stan = root->stan; + spB8.m[3][0] = root->pos.x; + spB8.m[3][2] = root->pos.z; + } -/* same asm, different float .rodata */ + sub_GAME_7F03D058(root, TRUE); + prop->Unk18 = -sp58->m[3][2]; -GLOBAL_ASM( -.late_rodata -glabel D_80052CF8 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052CFC -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D00 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D04 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D08 -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D0C -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D10 -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D14 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D18 -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D1C -.word 0x41555555 /*13.333333*/ -glabel D_80052D20 -.word 0x40d55555 /*6.6666665*/ -glabel D_80052D24 -.word 0x41555555 /*13.333333*/ -glabel D_80052D28 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D2C -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D30 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D34 -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D38 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D3C -.word 0x3cf1463a /* 0.029452431947 */ -glabel D_80052D40 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D44 -.word 0x40555555 /*3.3333333*/ -glabel D_80052D48 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D4C -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D50 -.word 0x40555555 /*3.3333333*/ -glabel D_80052D54 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D58 -.word 0x3df1463a /* 0.117809727788 */ -glabel D_80052D5C -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D60 -.word 0x3df1463a /* 0.117809727788 */ -glabel D_80052D64 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D68 -.word 0x3df1463a /* 0.117809727788 */ -.text -glabel sub_GAME_7F04C130 -/* 080C60 7F04C130 27BDFEF8 */ addiu $sp, $sp, -0x108 -/* 080C64 7F04C134 AFBF003C */ sw $ra, 0x3c($sp) -/* 080C68 7F04C138 AFB20038 */ sw $s2, 0x38($sp) -/* 080C6C 7F04C13C AFB10034 */ sw $s1, 0x34($sp) -/* 080C70 7F04C140 AFB00030 */ sw $s0, 0x30($sp) -/* 080C74 7F04C144 AFA40108 */ sw $a0, 0x108($sp) -/* 080C78 7F04C148 8C8F001C */ lw $t7, 0x1c($a0) -/* 080C7C 7F04C14C AFAF0104 */ sw $t7, 0x104($sp) -/* 080C80 7F04C150 8C920004 */ lw $s2, 4($a0) -/* 080C84 7F04C154 8E580064 */ lw $t8, 0x64($s2) -/* 080C88 7F04C158 33190040 */ andi $t9, $t8, 0x40 -/* 080C8C 7F04C15C 5320000F */ beql $t9, $zero, .L7F04C19C -/* 080C90 7F04C160 8FAC0104 */ lw $t4, 0x104($sp) -/* 080C94 7F04C164 8E44006C */ lw $a0, 0x6c($s2) -/* 080C98 7F04C168 8C820044 */ lw $v0, 0x44($a0) -/* 080C9C 7F04C16C 5040000B */ beql $v0, $zero, .L7F04C19C -/* 080CA0 7F04C170 8FAC0104 */ lw $t4, 0x104($sp) -/* 080CA4 7F04C174 0FC0FFA2 */ jal sub_GAME_7F03FE88 -/* 080CA8 7F04C178 00408025 */ move $s0, $v0 -/* 080CAC 7F04C17C 8E480064 */ lw $t0, 0x64($s2) -/* 080CB0 7F04C180 2401FFBF */ li $at, -65 -/* 080CB4 7F04C184 AE50006C */ sw $s0, 0x6c($s2) -/* 080CB8 7F04C188 01014824 */ and $t1, $t0, $at -/* 080CBC 7F04C18C AE490064 */ sw $t1, 0x64($s2) -/* 080CC0 7F04C190 352B0080 */ ori $t3, $t1, 0x80 -/* 080CC4 7F04C194 AE4B0064 */ sw $t3, 0x64($s2) -/* 080CC8 7F04C198 8FAC0104 */ lw $t4, 0x104($sp) -.L7F04C19C: -/* 080CCC 7F04C19C 00001025 */ move $v0, $zero -/* 080CD0 7F04C1A0 11800222 */ beqz $t4, .L7F04CA2C -/* 080CD4 7F04C1A4 00000000 */ nop -/* 080CD8 7F04C1A8 8E4D0064 */ lw $t5, 0x64($s2) -/* 080CDC 7F04C1AC 31AF0080 */ andi $t7, $t5, 0x80 -/* 080CE0 7F04C1B0 11E0021E */ beqz $t7, .L7F04CA2C -/* 080CE4 7F04C1B4 00000000 */ nop -/* 080CE8 7F04C1B8 8E4E0014 */ lw $t6, 0x14($s2) -/* 080CEC 7F04C1BC 24010002 */ li $at, 2 -/* 080CF0 7F04C1C0 01808025 */ move $s0, $t4 -/* 080CF4 7F04C1C4 AFAE00F8 */ sw $t6, 0xf8($sp) -/* 080CF8 7F04C1C8 8E51006C */ lw $s1, 0x6c($s2) -/* 080CFC 7F04C1CC 8E380000 */ lw $t8, ($s1) -/* 080D00 7F04C1D0 8E2200B8 */ lw $v0, 0xb8($s1) -/* 080D04 7F04C1D4 37190001 */ ori $t9, $t8, 1 -/* 080D08 7F04C1D8 AE390000 */ sw $t9, ($s1) -/* 080D0C 7F04C1DC 8FA80104 */ lw $t0, 0x104($sp) -/* 080D10 7F04C1E0 1441007A */ bne $v0, $at, .L7F04C3CC -/* 080D14 7F04C1E4 AE280088 */ sw $t0, 0x88($s1) -/* 080D18 7F04C1E8 8FA90104 */ lw $t1, 0x104($sp) -/* 080D1C 7F04C1EC 24030003 */ li $v1, 3 -/* 080D20 7F04C1F0 3C0D8003 */ lui $t5, %hi(D_8003201C) -/* 080D24 7F04C1F4 912A0000 */ lbu $t2, ($t1) -/* 080D28 7F04C1F8 25AD201C */ addiu $t5, %lo(D_8003201C) # addiu $t5, $t5, 0x201c -/* 080D2C 7F04C1FC 27AB0098 */ addiu $t3, $sp, 0x98 -/* 080D30 7F04C200 546A0073 */ bnel $v1, $t2, .L7F04C3D0 -/* 080D34 7F04C204 24030003 */ li $v1, 3 -/* 080D38 7F04C208 8D220004 */ lw $v0, 4($t1) -/* 080D3C 7F04C20C 8DA10000 */ lw $at, ($t5) -/* 080D40 7F04C210 8DAE0004 */ lw $t6, 4($t5) -/* 080D44 7F04C214 8C44001C */ lw $a0, 0x1c($v0) -/* 080D48 7F04C218 AD610000 */ sw $at, ($t3) -/* 080D4C 7F04C21C 8DA10008 */ lw $at, 8($t5) -/* 080D50 7F04C220 AD6E0004 */ sw $t6, 4($t3) -/* 080D54 7F04C224 0FC1B320 */ jal getsubroty -/* 080D58 7F04C228 AD610008 */ sw $at, 8($t3) -/* 080D5C 7F04C22C E7A00094 */ swc1 $f0, 0x94($sp) -/* 080D60 7F04C230 0FC15FAB */ jal sinf -/* 080D64 7F04C234 46000306 */ mov.s $f12, $f0 -/* 080D68 7F04C238 3C018005 */ lui $at, %hi(D_80052CF8) -/* 080D6C 7F04C23C C4242CF8 */ lwc1 $f4, %lo(D_80052CF8)($at) -/* 080D70 7F04C240 46040182 */ mul.s $f6, $f0, $f4 -/* 080D74 7F04C244 0C002914 */ jal randomGetNext -/* 080D78 7F04C248 E6260004 */ swc1 $f6, 4($s1) -/* 080D7C 7F04C24C 44824000 */ mtc1 $v0, $f8 -/* 080D80 7F04C250 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080D84 7F04C254 04410004 */ bgez $v0, .L7F04C268 -/* 080D88 7F04C258 468042A0 */ cvt.s.w $f10, $f8 -/* 080D8C 7F04C25C 44818000 */ mtc1 $at, $f16 -/* 080D90 7F04C260 00000000 */ nop -/* 080D94 7F04C264 46105280 */ add.s $f10, $f10, $f16 -.L7F04C268: -/* 080D98 7F04C268 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080D9C 7F04C26C 44819000 */ mtc1 $at, $f18 -/* 080DA0 7F04C270 3C018005 */ lui $at, %hi(D_80052CFC) -/* 080DA4 7F04C274 C4282CFC */ lwc1 $f8, %lo(D_80052CFC)($at) -/* 080DA8 7F04C278 46125102 */ mul.s $f4, $f10, $f18 -/* 080DAC 7F04C27C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 080DB0 7F04C280 44815000 */ mtc1 $at, $f10 -/* 080DB4 7F04C284 46002187 */ neg.s $f6, $f4 -/* 080DB8 7F04C288 46083402 */ mul.s $f16, $f6, $f8 -/* 080DBC 7F04C28C 00000000 */ nop -/* 080DC0 7F04C290 460A8482 */ mul.s $f18, $f16, $f10 -/* 080DC4 7F04C294 E6320008 */ swc1 $f18, 8($s1) -/* 080DC8 7F04C298 0FC15FA8 */ jal cosf -/* 080DCC 7F04C29C C7AC0094 */ lwc1 $f12, 0x94($sp) -/* 080DD0 7F04C2A0 3C018005 */ lui $at, %hi(D_80052D00) -/* 080DD4 7F04C2A4 C4242D00 */ lwc1 $f4, %lo(D_80052D00)($at) -/* 080DD8 7F04C2A8 46040182 */ mul.s $f6, $f0, $f4 -/* 080DDC 7F04C2AC 0C002914 */ jal randomGetNext -/* 080DE0 7F04C2B0 E626000C */ swc1 $f6, 0xc($s1) -/* 080DE4 7F04C2B4 44824000 */ mtc1 $v0, $f8 -/* 080DE8 7F04C2B8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080DEC 7F04C2BC 04410004 */ bgez $v0, .L7F04C2D0 -/* 080DF0 7F04C2C0 46804420 */ cvt.s.w $f16, $f8 -/* 080DF4 7F04C2C4 44815000 */ mtc1 $at, $f10 -/* 080DF8 7F04C2C8 00000000 */ nop -/* 080DFC 7F04C2CC 460A8400 */ add.s $f16, $f16, $f10 -.L7F04C2D0: -/* 080E00 7F04C2D0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080E04 7F04C2D4 44819000 */ mtc1 $at, $f18 -/* 080E08 7F04C2D8 3C018005 */ lui $at, %hi(D_80052D04) -/* 080E0C 7F04C2DC C4262D04 */ lwc1 $f6, %lo(D_80052D04)($at) -/* 080E10 7F04C2E0 46128102 */ mul.s $f4, $f16, $f18 -/* 080E14 7F04C2E4 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080E18 7F04C2E8 44815000 */ mtc1 $at, $f10 -/* 080E1C 7F04C2EC 3C018005 */ lui $at, %hi(D_80052D08) -/* 080E20 7F04C2F0 C4322D08 */ lwc1 $f18, %lo(D_80052D08)($at) -/* 080E24 7F04C2F4 46062202 */ mul.s $f8, $f4, $f6 -/* 080E28 7F04C2F8 00000000 */ nop -/* 080E2C 7F04C2FC 460A4402 */ mul.s $f16, $f8, $f10 -/* 080E30 7F04C300 46128101 */ sub.s $f4, $f16, $f18 -/* 080E34 7F04C304 0C002914 */ jal randomGetNext -/* 080E38 7F04C308 E7A40098 */ swc1 $f4, 0x98($sp) -/* 080E3C 7F04C30C 44823000 */ mtc1 $v0, $f6 -/* 080E40 7F04C310 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080E44 7F04C314 04410004 */ bgez $v0, .L7F04C328 -/* 080E48 7F04C318 46803220 */ cvt.s.w $f8, $f6 -/* 080E4C 7F04C31C 44815000 */ mtc1 $at, $f10 -/* 080E50 7F04C320 00000000 */ nop -/* 080E54 7F04C324 460A4200 */ add.s $f8, $f8, $f10 -.L7F04C328: -/* 080E58 7F04C328 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080E5C 7F04C32C 44818000 */ mtc1 $at, $f16 -/* 080E60 7F04C330 3C018005 */ lui $at, %hi(D_80052D0C) -/* 080E64 7F04C334 C4242D0C */ lwc1 $f4, %lo(D_80052D0C)($at) -/* 080E68 7F04C338 46104482 */ mul.s $f18, $f8, $f16 -/* 080E6C 7F04C33C 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080E70 7F04C340 44815000 */ mtc1 $at, $f10 -/* 080E74 7F04C344 3C018005 */ lui $at, %hi(D_80052D10) -/* 080E78 7F04C348 C4302D10 */ lwc1 $f16, %lo(D_80052D10)($at) -/* 080E7C 7F04C34C 46049182 */ mul.s $f6, $f18, $f4 -/* 080E80 7F04C350 00000000 */ nop -/* 080E84 7F04C354 460A3202 */ mul.s $f8, $f6, $f10 -/* 080E88 7F04C358 46104481 */ sub.s $f18, $f8, $f16 -/* 080E8C 7F04C35C 0C002914 */ jal randomGetNext -/* 080E90 7F04C360 E7B2009C */ swc1 $f18, 0x9c($sp) -/* 080E94 7F04C364 44822000 */ mtc1 $v0, $f4 -/* 080E98 7F04C368 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080E9C 7F04C36C 04410004 */ bgez $v0, .L7F04C380 -/* 080EA0 7F04C370 468021A0 */ cvt.s.w $f6, $f4 -/* 080EA4 7F04C374 44815000 */ mtc1 $at, $f10 -/* 080EA8 7F04C378 00000000 */ nop -/* 080EAC 7F04C37C 460A3180 */ add.s $f6, $f6, $f10 -.L7F04C380: -/* 080EB0 7F04C380 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080EB4 7F04C384 44814000 */ mtc1 $at, $f8 -/* 080EB8 7F04C388 3C018005 */ lui $at, %hi(D_80052D14) -/* 080EBC 7F04C38C C4322D14 */ lwc1 $f18, %lo(D_80052D14)($at) -/* 080EC0 7F04C390 46083402 */ mul.s $f16, $f6, $f8 -/* 080EC4 7F04C394 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080EC8 7F04C398 44815000 */ mtc1 $at, $f10 -/* 080ECC 7F04C39C 3C018005 */ lui $at, %hi(D_80052D18) -/* 080ED0 7F04C3A0 C4282D18 */ lwc1 $f8, %lo(D_80052D18)($at) -/* 080ED4 7F04C3A4 27A40098 */ addiu $a0, $sp, 0x98 -/* 080ED8 7F04C3A8 26250020 */ addiu $a1, $s1, 0x20 -/* 080EDC 7F04C3AC 46128102 */ mul.s $f4, $f16, $f18 -/* 080EE0 7F04C3B0 00000000 */ nop -/* 080EE4 7F04C3B4 460A2182 */ mul.s $f6, $f4, $f10 -/* 080EE8 7F04C3B8 46083401 */ sub.s $f16, $f6, $f8 -/* 080EEC 7F04C3BC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 080EF0 7F04C3C0 E7B000A0 */ swc1 $f16, 0xa0($sp) -/* 080EF4 7F04C3C4 1000010C */ b .L7F04C7F8 -/* 080EF8 7F04C3C8 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C3CC: -/* 080EFC 7F04C3CC 24030003 */ li $v1, 3 -.L7F04C3D0: -/* 080F00 7F04C3D0 14620068 */ bne $v1, $v0, .L7F04C574 -/* 080F04 7F04C3D4 8FAC0104 */ lw $t4, 0x104($sp) -/* 080F08 7F04C3D8 91980000 */ lbu $t8, ($t4) -/* 080F0C 7F04C3DC 3C088003 */ lui $t0, %hi(D_80032028) -/* 080F10 7F04C3E0 25082028 */ addiu $t0, %lo(D_80032028) # addiu $t0, $t0, 0x2028 -/* 080F14 7F04C3E4 14780063 */ bne $v1, $t8, .L7F04C574 -/* 080F18 7F04C3E8 27B90080 */ addiu $t9, $sp, 0x80 -/* 080F1C 7F04C3EC 8D820004 */ lw $v0, 4($t4) -/* 080F20 7F04C3F0 8D010000 */ lw $at, ($t0) -/* 080F24 7F04C3F4 8D090004 */ lw $t1, 4($t0) -/* 080F28 7F04C3F8 8C44001C */ lw $a0, 0x1c($v0) -/* 080F2C 7F04C3FC AF210000 */ sw $at, ($t9) -/* 080F30 7F04C400 8D010008 */ lw $at, 8($t0) -/* 080F34 7F04C404 AF290004 */ sw $t1, 4($t9) -/* 080F38 7F04C408 0FC1B320 */ jal getsubroty -/* 080F3C 7F04C40C AF210008 */ sw $at, 8($t9) -/* 080F40 7F04C410 E7A0007C */ swc1 $f0, 0x7c($sp) -/* 080F44 7F04C414 0FC15FAB */ jal sinf -/* 080F48 7F04C418 46000306 */ mov.s $f12, $f0 -/* 080F4C 7F04C41C 3C018005 */ lui $at, %hi(D_80052D1C) -/* 080F50 7F04C420 C4322D1C */ lwc1 $f18, %lo(D_80052D1C)($at) -/* 080F54 7F04C424 3C018005 */ lui $at, %hi(D_80052D20) -/* 080F58 7F04C428 46120102 */ mul.s $f4, $f0, $f18 -/* 080F5C 7F04C42C E6240004 */ swc1 $f4, 4($s1) -/* 080F60 7F04C430 C42A2D20 */ lwc1 $f10, %lo(D_80052D20)($at) -/* 080F64 7F04C434 E62A0008 */ swc1 $f10, 8($s1) -/* 080F68 7F04C438 0FC15FA8 */ jal cosf -/* 080F6C 7F04C43C C7AC007C */ lwc1 $f12, 0x7c($sp) -/* 080F70 7F04C440 3C018005 */ lui $at, %hi(D_80052D24) -/* 080F74 7F04C444 C4262D24 */ lwc1 $f6, %lo(D_80052D24)($at) -/* 080F78 7F04C448 46060202 */ mul.s $f8, $f0, $f6 -/* 080F7C 7F04C44C 0C002914 */ jal randomGetNext -/* 080F80 7F04C450 E628000C */ swc1 $f8, 0xc($s1) -/* 080F84 7F04C454 44828000 */ mtc1 $v0, $f16 -/* 080F88 7F04C458 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080F8C 7F04C45C 04410004 */ bgez $v0, .L7F04C470 -/* 080F90 7F04C460 468084A0 */ cvt.s.w $f18, $f16 -/* 080F94 7F04C464 44812000 */ mtc1 $at, $f4 -/* 080F98 7F04C468 00000000 */ nop -/* 080F9C 7F04C46C 46049480 */ add.s $f18, $f18, $f4 -.L7F04C470: -/* 080FA0 7F04C470 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080FA4 7F04C474 44815000 */ mtc1 $at, $f10 -/* 080FA8 7F04C478 3C018005 */ lui $at, %hi(D_80052D28) -/* 080FAC 7F04C47C C4282D28 */ lwc1 $f8, %lo(D_80052D28)($at) -/* 080FB0 7F04C480 460A9182 */ mul.s $f6, $f18, $f10 -/* 080FB4 7F04C484 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 080FB8 7F04C488 44812000 */ mtc1 $at, $f4 -/* 080FBC 7F04C48C 3C018005 */ lui $at, %hi(D_80052D2C) -/* 080FC0 7F04C490 C42A2D2C */ lwc1 $f10, %lo(D_80052D2C)($at) -/* 080FC4 7F04C494 46083402 */ mul.s $f16, $f6, $f8 -/* 080FC8 7F04C498 00000000 */ nop -/* 080FCC 7F04C49C 46048482 */ mul.s $f18, $f16, $f4 -/* 080FD0 7F04C4A0 460A9181 */ sub.s $f6, $f18, $f10 -/* 080FD4 7F04C4A4 0C002914 */ jal randomGetNext -/* 080FD8 7F04C4A8 E7A60080 */ swc1 $f6, 0x80($sp) -/* 080FDC 7F04C4AC 44824000 */ mtc1 $v0, $f8 -/* 080FE0 7F04C4B0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 080FE4 7F04C4B4 04410004 */ bgez $v0, .L7F04C4C8 -/* 080FE8 7F04C4B8 46804420 */ cvt.s.w $f16, $f8 -/* 080FEC 7F04C4BC 44812000 */ mtc1 $at, $f4 -/* 080FF0 7F04C4C0 00000000 */ nop -/* 080FF4 7F04C4C4 46048400 */ add.s $f16, $f16, $f4 -.L7F04C4C8: -/* 080FF8 7F04C4C8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 080FFC 7F04C4CC 44819000 */ mtc1 $at, $f18 -/* 081000 7F04C4D0 3C018005 */ lui $at, %hi(D_80052D30) -/* 081004 7F04C4D4 C4262D30 */ lwc1 $f6, %lo(D_80052D30)($at) -/* 081008 7F04C4D8 46128282 */ mul.s $f10, $f16, $f18 -/* 08100C 7F04C4DC 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 081010 7F04C4E0 44812000 */ mtc1 $at, $f4 -/* 081014 7F04C4E4 3C018005 */ lui $at, %hi(D_80052D34) -/* 081018 7F04C4E8 C4322D34 */ lwc1 $f18, %lo(D_80052D34)($at) -/* 08101C 7F04C4EC 46065202 */ mul.s $f8, $f10, $f6 -/* 081020 7F04C4F0 00000000 */ nop -/* 081024 7F04C4F4 46044402 */ mul.s $f16, $f8, $f4 -/* 081028 7F04C4F8 46128281 */ sub.s $f10, $f16, $f18 -/* 08102C 7F04C4FC 0C002914 */ jal randomGetNext -/* 081030 7F04C500 E7AA0084 */ swc1 $f10, 0x84($sp) -/* 081034 7F04C504 44823000 */ mtc1 $v0, $f6 -/* 081038 7F04C508 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08103C 7F04C50C 04410004 */ bgez $v0, .L7F04C520 -/* 081040 7F04C510 46803220 */ cvt.s.w $f8, $f6 -/* 081044 7F04C514 44812000 */ mtc1 $at, $f4 -/* 081048 7F04C518 00000000 */ nop -/* 08104C 7F04C51C 46044200 */ add.s $f8, $f8, $f4 -.L7F04C520: -/* 081050 7F04C520 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081054 7F04C524 44818000 */ mtc1 $at, $f16 -/* 081058 7F04C528 3C018005 */ lui $at, %hi(D_80052D38) -/* 08105C 7F04C52C C42A2D38 */ lwc1 $f10, %lo(D_80052D38)($at) -/* 081060 7F04C530 46104482 */ mul.s $f18, $f8, $f16 -/* 081064 7F04C534 3C013C00 */ li $at, 0x3C000000 # 0.007812 -/* 081068 7F04C538 44812000 */ mtc1 $at, $f4 -/* 08106C 7F04C53C 3C018005 */ lui $at, %hi(D_80052D3C) -/* 081070 7F04C540 C4302D3C */ lwc1 $f16, %lo(D_80052D3C)($at) -/* 081074 7F04C544 27A40080 */ addiu $a0, $sp, 0x80 -/* 081078 7F04C548 26250020 */ addiu $a1, $s1, 0x20 -/* 08107C 7F04C54C 460A9182 */ mul.s $f6, $f18, $f10 -/* 081080 7F04C550 00000000 */ nop -/* 081084 7F04C554 46043202 */ mul.s $f8, $f6, $f4 -/* 081088 7F04C558 46104481 */ sub.s $f18, $f8, $f16 -/* 08108C 7F04C55C 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 081090 7F04C560 E7B20088 */ swc1 $f18, 0x88($sp) -/* 081094 7F04C564 8E2F0000 */ lw $t7, ($s1) -/* 081098 7F04C568 35EB0040 */ ori $t3, $t7, 0x40 -/* 08109C 7F04C56C 100000A1 */ b .L7F04C7F4 -/* 0810A0 7F04C570 AE2B0000 */ sw $t3, ($s1) -.L7F04C574: -/* 0810A4 7F04C574 24010004 */ li $at, 4 -/* 0810A8 7F04C578 1441009C */ bne $v0, $at, .L7F04C7EC -/* 0810AC 7F04C57C 26240004 */ addiu $a0, $s1, 4 -/* 0810B0 7F04C580 3C0E8003 */ lui $t6, %hi(D_80032034) -/* 0810B4 7F04C584 25CE2034 */ addiu $t6, %lo(D_80032034) # addiu $t6, $t6, 0x2034 -/* 0810B8 7F04C588 8DC10000 */ lw $at, ($t6) -/* 0810BC 7F04C58C 27AD0070 */ addiu $t5, $sp, 0x70 -/* 0810C0 7F04C590 8DCC0004 */ lw $t4, 4($t6) -/* 0810C4 7F04C594 ADA10000 */ sw $at, ($t5) -/* 0810C8 7F04C598 8DC10008 */ lw $at, 8($t6) -/* 0810CC 7F04C59C ADAC0004 */ sw $t4, 4($t5) -/* 0810D0 7F04C5A0 0FC225E6 */ jal get_curplayer_positiondata -/* 0810D4 7F04C5A4 ADA10008 */ sw $at, 8($t5) -/* 0810D8 7F04C5A8 8FAA0104 */ lw $t2, 0x104($sp) -/* 0810DC 7F04C5AC C4460008 */ lwc1 $f6, 8($v0) -/* 0810E0 7F04C5B0 C4480010 */ lwc1 $f8, 0x10($v0) -/* 0810E4 7F04C5B4 C54A0008 */ lwc1 $f10, 8($t2) -/* 0810E8 7F04C5B8 C5440010 */ lwc1 $f4, 0x10($t2) -/* 0810EC 7F04C5BC 46065301 */ sub.s $f12, $f10, $f6 -/* 0810F0 7F04C5C0 0FC16A8C */ jal atan2f -/* 0810F4 7F04C5C4 46082381 */ sub.s $f14, $f4, $f8 -/* 0810F8 7F04C5C8 0C002914 */ jal randomGetNext -/* 0810FC 7F04C5CC E7A00060 */ swc1 $f0, 0x60($sp) -/* 081100 7F04C5D0 AFA20050 */ sw $v0, 0x50($sp) -/* 081104 7F04C5D4 0FC15FAB */ jal sinf -/* 081108 7F04C5D8 C7AC0060 */ lwc1 $f12, 0x60($sp) -/* 08110C 7F04C5DC 8FB90050 */ lw $t9, 0x50($sp) -/* 081110 7F04C5E0 44998000 */ mtc1 $t9, $f16 -/* 081114 7F04C5E4 07210005 */ bgez $t9, .L7F04C5FC -/* 081118 7F04C5E8 468084A0 */ cvt.s.w $f18, $f16 -/* 08111C 7F04C5EC 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081120 7F04C5F0 44815000 */ mtc1 $at, $f10 -/* 081124 7F04C5F4 00000000 */ nop -/* 081128 7F04C5F8 460A9480 */ add.s $f18, $f18, $f10 -.L7F04C5FC: -/* 08112C 7F04C5FC 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081130 7F04C600 44813000 */ mtc1 $at, $f6 -/* 081134 7F04C604 3C018005 */ lui $at, %hi(D_80052D40) -/* 081138 7F04C608 C4282D40 */ lwc1 $f8, %lo(D_80052D40)($at) -/* 08113C 7F04C60C 46069102 */ mul.s $f4, $f18, $f6 -/* 081140 7F04C610 3C018005 */ lui $at, %hi(D_80052D44) -/* 081144 7F04C614 C42A2D44 */ lwc1 $f10, %lo(D_80052D44)($at) -/* 081148 7F04C618 46082082 */ mul.s $f2, $f4, $f8 -/* 08114C 7F04C61C 46021400 */ add.s $f16, $f2, $f2 -/* 081150 7F04C620 460A8480 */ add.s $f18, $f16, $f10 -/* 081154 7F04C624 46120182 */ mul.s $f6, $f0, $f18 -/* 081158 7F04C628 0C002914 */ jal randomGetNext -/* 08115C 7F04C62C E6260004 */ swc1 $f6, 4($s1) -/* 081160 7F04C630 44822000 */ mtc1 $v0, $f4 -/* 081164 7F04C634 04410005 */ bgez $v0, .L7F04C64C -/* 081168 7F04C638 46802220 */ cvt.s.w $f8, $f4 -/* 08116C 7F04C63C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081170 7F04C640 44818000 */ mtc1 $at, $f16 -/* 081174 7F04C644 00000000 */ nop -/* 081178 7F04C648 46104200 */ add.s $f8, $f8, $f16 -.L7F04C64C: -/* 08117C 7F04C64C 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081180 7F04C650 44815000 */ mtc1 $at, $f10 -/* 081184 7F04C654 3C018005 */ lui $at, %hi(D_80052D48) -/* 081188 7F04C658 C4262D48 */ lwc1 $f6, %lo(D_80052D48)($at) -/* 08118C 7F04C65C 460A4482 */ mul.s $f18, $f8, $f10 -/* 081190 7F04C660 00000000 */ nop -/* 081194 7F04C664 46069002 */ mul.s $f0, $f18, $f6 -/* 081198 7F04C668 46000100 */ add.s $f4, $f0, $f0 -/* 08119C 7F04C66C 0C002914 */ jal randomGetNext -/* 0811A0 7F04C670 E6240008 */ swc1 $f4, 8($s1) -/* 0811A4 7F04C674 AFA20050 */ sw $v0, 0x50($sp) -/* 0811A8 7F04C678 0FC15FA8 */ jal cosf -/* 0811AC 7F04C67C C7AC0060 */ lwc1 $f12, 0x60($sp) -/* 0811B0 7F04C680 8FA80050 */ lw $t0, 0x50($sp) -/* 0811B4 7F04C684 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0811B8 7F04C688 44888000 */ mtc1 $t0, $f16 -/* 0811BC 7F04C68C 05010004 */ bgez $t0, .L7F04C6A0 -/* 0811C0 7F04C690 46808220 */ cvt.s.w $f8, $f16 -/* 0811C4 7F04C694 44815000 */ mtc1 $at, $f10 -/* 0811C8 7F04C698 00000000 */ nop -/* 0811CC 7F04C69C 460A4200 */ add.s $f8, $f8, $f10 -.L7F04C6A0: -/* 0811D0 7F04C6A0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0811D4 7F04C6A4 44819000 */ mtc1 $at, $f18 -/* 0811D8 7F04C6A8 3C018005 */ lui $at, %hi(D_80052D4C) -/* 0811DC 7F04C6AC C4242D4C */ lwc1 $f4, %lo(D_80052D4C)($at) -/* 0811E0 7F04C6B0 46124182 */ mul.s $f6, $f8, $f18 -/* 0811E4 7F04C6B4 3C018005 */ lui $at, %hi(D_80052D50) -/* 0811E8 7F04C6B8 C42A2D50 */ lwc1 $f10, %lo(D_80052D50)($at) -/* 0811EC 7F04C6BC 46043082 */ mul.s $f2, $f6, $f4 -/* 0811F0 7F04C6C0 46021400 */ add.s $f16, $f2, $f2 -/* 0811F4 7F04C6C4 460A8200 */ add.s $f8, $f16, $f10 -/* 0811F8 7F04C6C8 46080482 */ mul.s $f18, $f0, $f8 -/* 0811FC 7F04C6CC 0C002914 */ jal randomGetNext -/* 081200 7F04C6D0 E632000C */ swc1 $f18, 0xc($s1) -/* 081204 7F04C6D4 44823000 */ mtc1 $v0, $f6 -/* 081208 7F04C6D8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08120C 7F04C6DC 04410004 */ bgez $v0, .L7F04C6F0 -/* 081210 7F04C6E0 46803120 */ cvt.s.w $f4, $f6 -/* 081214 7F04C6E4 44818000 */ mtc1 $at, $f16 -/* 081218 7F04C6E8 00000000 */ nop -/* 08121C 7F04C6EC 46102100 */ add.s $f4, $f4, $f16 -.L7F04C6F0: -/* 081220 7F04C6F0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 081224 7F04C6F4 44815000 */ mtc1 $at, $f10 -/* 081228 7F04C6F8 3C018005 */ lui $at, %hi(D_80052D54) -/* 08122C 7F04C6FC C4322D54 */ lwc1 $f18, %lo(D_80052D54)($at) -/* 081230 7F04C700 460A2202 */ mul.s $f8, $f4, $f10 -/* 081234 7F04C704 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 081238 7F04C708 44818000 */ mtc1 $at, $f16 -/* 08123C 7F04C70C 3C018005 */ lui $at, %hi(D_80052D58) -/* 081240 7F04C710 C42A2D58 */ lwc1 $f10, %lo(D_80052D58)($at) -/* 081244 7F04C714 46124182 */ mul.s $f6, $f8, $f18 -/* 081248 7F04C718 00000000 */ nop -/* 08124C 7F04C71C 46103102 */ mul.s $f4, $f6, $f16 -/* 081250 7F04C720 460A2201 */ sub.s $f8, $f4, $f10 -/* 081254 7F04C724 0C002914 */ jal randomGetNext -/* 081258 7F04C728 E7A80070 */ swc1 $f8, 0x70($sp) -/* 08125C 7F04C72C 44829000 */ mtc1 $v0, $f18 -/* 081260 7F04C730 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081264 7F04C734 04410004 */ bgez $v0, .L7F04C748 -/* 081268 7F04C738 468091A0 */ cvt.s.w $f6, $f18 -/* 08126C 7F04C73C 44818000 */ mtc1 $at, $f16 -/* 081270 7F04C740 00000000 */ nop -/* 081274 7F04C744 46103180 */ add.s $f6, $f6, $f16 -.L7F04C748: -/* 081278 7F04C748 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08127C 7F04C74C 44812000 */ mtc1 $at, $f4 -/* 081280 7F04C750 3C018005 */ lui $at, %hi(D_80052D5C) -/* 081284 7F04C754 C4282D5C */ lwc1 $f8, %lo(D_80052D5C)($at) -/* 081288 7F04C758 46043282 */ mul.s $f10, $f6, $f4 -/* 08128C 7F04C75C 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 081290 7F04C760 44818000 */ mtc1 $at, $f16 -/* 081294 7F04C764 3C018005 */ lui $at, %hi(D_80052D60) -/* 081298 7F04C768 C4242D60 */ lwc1 $f4, %lo(D_80052D60)($at) -/* 08129C 7F04C76C 46085482 */ mul.s $f18, $f10, $f8 -/* 0812A0 7F04C770 00000000 */ nop -/* 0812A4 7F04C774 46109182 */ mul.s $f6, $f18, $f16 -/* 0812A8 7F04C778 46043281 */ sub.s $f10, $f6, $f4 -/* 0812AC 7F04C77C 0C002914 */ jal randomGetNext -/* 0812B0 7F04C780 E7AA0074 */ swc1 $f10, 0x74($sp) -/* 0812B4 7F04C784 44824000 */ mtc1 $v0, $f8 -/* 0812B8 7F04C788 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0812BC 7F04C78C 04410004 */ bgez $v0, .L7F04C7A0 -/* 0812C0 7F04C790 468044A0 */ cvt.s.w $f18, $f8 -/* 0812C4 7F04C794 44818000 */ mtc1 $at, $f16 -/* 0812C8 7F04C798 00000000 */ nop -/* 0812CC 7F04C79C 46109480 */ add.s $f18, $f18, $f16 -.L7F04C7A0: -/* 0812D0 7F04C7A0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 0812D4 7F04C7A4 44813000 */ mtc1 $at, $f6 -/* 0812D8 7F04C7A8 3C018005 */ lui $at, %hi(D_80052D64) -/* 0812DC 7F04C7AC C42A2D64 */ lwc1 $f10, %lo(D_80052D64)($at) -/* 0812E0 7F04C7B0 46069102 */ mul.s $f4, $f18, $f6 -/* 0812E4 7F04C7B4 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 0812E8 7F04C7B8 44818000 */ mtc1 $at, $f16 -/* 0812EC 7F04C7BC 3C018005 */ lui $at, %hi(D_80052D68) -/* 0812F0 7F04C7C0 C4262D68 */ lwc1 $f6, %lo(D_80052D68)($at) -/* 0812F4 7F04C7C4 27A40070 */ addiu $a0, $sp, 0x70 -/* 0812F8 7F04C7C8 26250020 */ addiu $a1, $s1, 0x20 -/* 0812FC 7F04C7CC 460A2202 */ mul.s $f8, $f4, $f10 -/* 081300 7F04C7D0 00000000 */ nop -/* 081304 7F04C7D4 46104482 */ mul.s $f18, $f8, $f16 -/* 081308 7F04C7D8 46069101 */ sub.s $f4, $f18, $f6 -/* 08130C 7F04C7DC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 081310 7F04C7E0 E7A40078 */ swc1 $f4, 0x78($sp) -/* 081314 7F04C7E4 10000004 */ b .L7F04C7F8 -/* 081318 7F04C7E8 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C7EC: -/* 08131C 7F04C7EC 0FC15F05 */ jal sub_GAME_7F057C14 -/* 081320 7F04C7F0 26250020 */ addiu $a1, $s1, 0x20 -.L7F04C7F4: -/* 081324 7F04C7F4 8FA90104 */ lw $t1, 0x104($sp) -.L7F04C7F8: -/* 081328 7F04C7F8 8D2F001C */ lw $t7, 0x1c($t1) -/* 08132C 7F04C7FC 51E00007 */ beql $t7, $zero, .L7F04C81C -/* 081330 7F04C800 8E0B0014 */ lw $t3, 0x14($s0) -/* 081334 7F04C804 8E02001C */ lw $v0, 0x1c($s0) -/* 081338 7F04C808 00408025 */ move $s0, $v0 -.L7F04C80C: -/* 08133C 7F04C80C 8C42001C */ lw $v0, 0x1c($v0) -/* 081340 7F04C810 5440FFFE */ bnezl $v0, .L7F04C80C -/* 081344 7F04C814 00408025 */ move $s0, $v0 -/* 081348 7F04C818 8E0B0014 */ lw $t3, 0x14($s0) -.L7F04C81C: -/* 08134C 7F04C81C 8FA20108 */ lw $v0, 0x108($sp) -/* 081350 7F04C820 AFAB00B0 */ sw $t3, 0xb0($sp) -/* 081354 7F04C824 90580001 */ lbu $t8, 1($v0) -/* 081358 7F04C828 330D0002 */ andi $t5, $t8, 2 -/* 08135C 7F04C82C 51A0004B */ beql $t5, $zero, .L7F04C95C -/* 081360 7F04C830 8E0A0014 */ lw $t2, 0x14($s0) -/* 081364 7F04C834 0FC10411 */ jal objGetWidth -/* 081368 7F04C838 02402025 */ move $a0, $s2 -/* 08136C 7F04C83C E7A0005C */ swc1 $f0, 0x5c($sp) -/* 081370 7F04C840 0FC1B1A8 */ jal getsubmatrix -/* 081374 7F04C844 8FA400F8 */ lw $a0, 0xf8($sp) -/* 081378 7F04C848 240E001F */ li $t6, 31 -/* 08137C 7F04C84C AFA20058 */ sw $v0, 0x58($sp) -/* 081380 7F04C850 0FC1E111 */ jal currentPlayerGetMatrix10D4 -/* 081384 7F04C854 AFAE0054 */ sw $t6, 0x54($sp) -/* 081388 7F04C858 00402025 */ move $a0, $v0 -/* 08138C 7F04C85C 8FA50058 */ lw $a1, 0x58($sp) -/* 081390 7F04C860 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 081394 7F04C864 27A600B8 */ addiu $a2, $sp, 0xb8 -/* 081398 7F04C868 8E2C0000 */ lw $t4, ($s1) -/* 08139C 7F04C86C 2419001D */ li $t9, 29 -/* 0813A0 7F04C870 02002025 */ move $a0, $s0 -/* 0813A4 7F04C874 318A0040 */ andi $t2, $t4, 0x40 -/* 0813A8 7F04C878 11400002 */ beqz $t2, .L7F04C884 -/* 0813AC 7F04C87C 00000000 */ nop -/* 0813B0 7F04C880 AFB90054 */ sw $t9, 0x54($sp) -.L7F04C884: -/* 0813B4 7F04C884 0FC0F416 */ jal sub_GAME_7F03D058 -/* 0813B8 7F04C888 00002825 */ move $a1, $zero -/* 0813BC 7F04C88C 8E050008 */ lw $a1, 8($s0) -/* 0813C0 7F04C890 8E060010 */ lw $a2, 0x10($s0) -/* 0813C4 7F04C894 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0813C8 7F04C898 44811000 */ mtc1 $at, $f2 -/* 0813CC 7F04C89C 44800000 */ mtc1 $zero, $f0 -/* 0813D0 7F04C8A0 C7AA00F0 */ lwc1 $f10, 0xf0($sp) -/* 0813D4 7F04C8A4 8FA80054 */ lw $t0, 0x54($sp) -/* 0813D8 7F04C8A8 27B100B0 */ addiu $s1, $sp, 0xb0 -/* 0813DC 7F04C8AC 02202025 */ move $a0, $s1 -/* 0813E0 7F04C8B0 8FA700E8 */ lw $a3, 0xe8($sp) -/* 0813E4 7F04C8B4 E7A2001C */ swc1 $f2, 0x1c($sp) -/* 0813E8 7F04C8B8 E7A20024 */ swc1 $f2, 0x24($sp) -/* 0813EC 7F04C8BC E7AA0010 */ swc1 $f10, 0x10($sp) -/* 0813F0 7F04C8C0 E7A00018 */ swc1 $f0, 0x18($sp) -/* 0813F4 7F04C8C4 E7A00020 */ swc1 $f0, 0x20($sp) -/* 0813F8 7F04C8C8 0FC2C389 */ jal sub_GAME_7F0B0E24 -/* 0813FC 7F04C8CC AFA80014 */ sw $t0, 0x14($sp) -/* 081400 7F04C8D0 10400011 */ beqz $v0, .L7F04C918 -/* 081404 7F04C8D4 02202025 */ move $a0, $s1 -/* 081408 7F04C8D8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08140C 7F04C8DC 44818000 */ mtc1 $at, $f16 -/* 081410 7F04C8E0 8FA90054 */ lw $t1, 0x54($sp) -/* 081414 7F04C8E4 44804000 */ mtc1 $zero, $f8 -/* 081418 7F04C8E8 8FA500E8 */ lw $a1, 0xe8($sp) -/* 08141C 7F04C8EC 8FA600F0 */ lw $a2, 0xf0($sp) -/* 081420 7F04C8F0 8FA7005C */ lw $a3, 0x5c($sp) -/* 081424 7F04C8F4 AFA90010 */ sw $t1, 0x10($sp) -/* 081428 7F04C8F8 E7B00018 */ swc1 $f16, 0x18($sp) -/* 08142C 7F04C8FC 0FC2C62E */ jal sub_GAME_7F0B18B8 -/* 081430 7F04C900 E7A80014 */ swc1 $f8, 0x14($sp) -/* 081434 7F04C904 04410004 */ bgez $v0, .L7F04C918 -/* 081438 7F04C908 8FAF00B0 */ lw $t7, 0xb0($sp) -/* 08143C 7F04C90C 8FAB0108 */ lw $t3, 0x108($sp) -/* 081440 7F04C910 10000008 */ b .L7F04C934 -/* 081444 7F04C914 AD6F0014 */ sw $t7, 0x14($t3) -.L7F04C918: -/* 081448 7F04C918 8E180014 */ lw $t8, 0x14($s0) -/* 08144C 7F04C91C 8FAD0108 */ lw $t5, 0x108($sp) -/* 081450 7F04C920 ADB80014 */ sw $t8, 0x14($t5) -/* 081454 7F04C924 C6120008 */ lwc1 $f18, 8($s0) -/* 081458 7F04C928 E7B200E8 */ swc1 $f18, 0xe8($sp) -/* 08145C 7F04C92C C6060010 */ lwc1 $f6, 0x10($s0) -/* 081460 7F04C930 E7A600F0 */ swc1 $f6, 0xf0($sp) -.L7F04C934: -/* 081464 7F04C934 02002025 */ move $a0, $s0 -/* 081468 7F04C938 0FC0F416 */ jal sub_GAME_7F03D058 -/* 08146C 7F04C93C 24050001 */ li $a1, 1 -/* 081470 7F04C940 8FAE0058 */ lw $t6, 0x58($sp) -/* 081474 7F04C944 8FAC0108 */ lw $t4, 0x108($sp) -/* 081478 7F04C948 C5C40038 */ lwc1 $f4, 0x38($t6) -/* 08147C 7F04C94C 46002287 */ neg.s $f10, $f4 -/* 081480 7F04C950 1000000C */ b .L7F04C984 -/* 081484 7F04C954 E58A0018 */ swc1 $f10, 0x18($t4) -/* 081488 7F04C958 8E0A0014 */ lw $t2, 0x14($s0) -.L7F04C95C: -/* 08148C 7F04C95C 27A400B8 */ addiu $a0, $sp, 0xb8 -/* 081490 7F04C960 0FC15FF4 */ jal matrix_4x4_set_identity -/* 081494 7F04C964 AC4A0014 */ sw $t2, 0x14($v0) -/* 081498 7F04C968 8FB900F8 */ lw $t9, 0xf8($sp) -/* 08149C 7F04C96C 27A500B8 */ addiu $a1, $sp, 0xb8 -/* 0814A0 7F04C970 0FC1629F */ jal matrix_scalar_multiply -/* 0814A4 7F04C974 C72C0014 */ lwc1 $f12, 0x14($t9) -/* 0814A8 7F04C978 26040008 */ addiu $a0, $s0, 8 -/* 0814AC 7F04C97C 0FC16266 */ jal matrix_4x4_set_position -/* 0814B0 7F04C980 27A500B8 */ addiu $a1, $sp, 0xb8 -.L7F04C984: -/* 0814B4 7F04C984 0FC13011 */ jal sub_GAME_7F04C044 -/* 0814B8 7F04C988 8FA40108 */ lw $a0, 0x108($sp) -/* 0814BC 7F04C98C 0FC0E929 */ jal chrpropActivate -/* 0814C0 7F04C990 8FA40108 */ lw $a0, 0x108($sp) -/* 0814C4 7F04C994 0FC0E901 */ jal chrpropEnable -/* 0814C8 7F04C998 8FA40108 */ lw $a0, 0x108($sp) -/* 0814CC 7F04C99C C7A000E8 */ lwc1 $f0, 0xe8($sp) -/* 0814D0 7F04C9A0 8FA80108 */ lw $t0, 0x108($sp) -/* 0814D4 7F04C9A4 44804000 */ mtc1 $zero, $f8 -/* 0814D8 7F04C9A8 44808000 */ mtc1 $zero, $f16 -/* 0814DC 7F04C9AC E5000008 */ swc1 $f0, 8($t0) -/* 0814E0 7F04C9B0 E6400058 */ swc1 $f0, 0x58($s2) -/* 0814E4 7F04C9B4 C7A000EC */ lwc1 $f0, 0xec($sp) -/* 0814E8 7F04C9B8 8FA90108 */ lw $t1, 0x108($sp) -/* 0814EC 7F04C9BC 44809000 */ mtc1 $zero, $f18 -/* 0814F0 7F04C9C0 27A400B8 */ addiu $a0, $sp, 0xb8 -/* 0814F4 7F04C9C4 E520000C */ swc1 $f0, 0xc($t1) -/* 0814F8 7F04C9C8 E640005C */ swc1 $f0, 0x5c($s2) -/* 0814FC 7F04C9CC C7A000F0 */ lwc1 $f0, 0xf0($sp) -/* 081500 7F04C9D0 8FAF0108 */ lw $t7, 0x108($sp) -/* 081504 7F04C9D4 26450018 */ addiu $a1, $s2, 0x18 -/* 081508 7F04C9D8 E5E00010 */ swc1 $f0, 0x10($t7) -/* 08150C 7F04C9DC E6400060 */ swc1 $f0, 0x60($s2) -/* 081510 7F04C9E0 E7A800E8 */ swc1 $f8, 0xe8($sp) -/* 081514 7F04C9E4 E7B000EC */ swc1 $f16, 0xec($sp) -/* 081518 7F04C9E8 0FC16008 */ jal matrix_4x4_copy -/* 08151C 7F04C9EC E7B200F0 */ swc1 $f18, 0xf0($sp) -/* 081520 7F04C9F0 8E440010 */ lw $a0, 0x10($s2) -/* 081524 7F04C9F4 0FC100AD */ jal sub_GAME_7F0402B4 -/* 081528 7F04C9F8 2645007C */ addiu $a1, $s2, 0x7c -/* 08152C 7F04C9FC 924B007C */ lbu $t3, 0x7c($s2) -/* 081530 7F04CA00 9258007D */ lbu $t8, 0x7d($s2) -/* 081534 7F04CA04 924D007E */ lbu $t5, 0x7e($s2) -/* 081538 7F04CA08 924E007F */ lbu $t6, 0x7f($s2) -/* 08153C 7F04CA0C 02402025 */ move $a0, $s2 -/* 081540 7F04CA10 A24B0078 */ sb $t3, 0x78($s2) -/* 081544 7F04CA14 A2580079 */ sb $t8, 0x79($s2) -/* 081548 7F04CA18 A24D007A */ sb $t5, 0x7a($s2) -/* 08154C 7F04CA1C 0FC15B28 */ jal setupUpdateObjectRoomPosition -/* 081550 7F04CA20 A24E007B */ sb $t6, 0x7b($s2) -/* 081554 7F04CA24 10000001 */ b .L7F04CA2C -/* 081558 7F04CA28 24020001 */ li $v0, 1 -.L7F04CA2C: -/* 08155C 7F04CA2C 8FBF003C */ lw $ra, 0x3c($sp) -/* 081560 7F04CA30 8FB00030 */ lw $s0, 0x30($sp) -/* 081564 7F04CA34 8FB10034 */ lw $s1, 0x34($sp) -/* 081568 7F04CA38 8FB20038 */ lw $s2, 0x38($sp) -/* 08156C 7F04CA3C 03E00008 */ jr $ra -/* 081570 7F04CA40 27BD0108 */ addiu $sp, $sp, 0x108 -) -#endif + } + else + { + // No collision checks + // Helpful for throwing mines through doors during speedruns + prop->stan = root->stan; + matrix_4x4_set_identity(&spB8); + matrix_scalar_multiply(model->scale, spB8.m[0]); + matrix_4x4_set_position(&root->pos, &spB8); + } -#endif + objDetach(prop); + chrpropActivate(prop); + chrpropEnable(prop); + obj->runtime_pos.x = prop->pos.x = spB8.m[3][0]; + obj->runtime_pos.y = prop->pos.y = spB8.m[3][1]; + obj->runtime_pos.z = prop->pos.z = spB8.m[3][2]; + spB8.m[3][0] = 0.0f; + spB8.m[3][1] = 0.0f; + spB8.m[3][2] = 0.0f; + matrix_4x4_copy(&spB8, &obj->mtx); + sub_GAME_7F0402B4(obj->prop, &obj->nextcol); + obj->shadecol.r = obj->nextcol.r; + obj->shadecol.g = obj->nextcol.g; + obj->shadecol.b = obj->nextcol.b; + obj->shadecol.a = obj->nextcol.a; -#ifdef NONMATCHING -void sub_GAME_7F04CA44(void) { + setupUpdateObjectRoomPosition(obj); + + return TRUE; + } + return FALSE; } -#else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -glabel D_80052D6C -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D70 -.word 0x3f555555 /*0.83333331*/ -glabel D_80052D74 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D78 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D7C -.word 0x3f555555 /*0.83333331*/ -glabel D_80052D80 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D84 -.word 0x3C20D97C /*0.009817477*/ -glabel D_80052D88 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D8C -.word 0x3C20D97C /*0.009817477*/ -glabel D_80052D90 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052D94 -.word 0x3C20D97C /*0.009817477*/ -.text -glabel sub_GAME_7F04CA44 -/* 081574 7F04CA44 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 081578 7F04CA48 AFBF0024 */ sw $ra, 0x24($sp) -/* 08157C 7F04CA4C AFB10020 */ sw $s1, 0x20($sp) -/* 081580 7F04CA50 AFB0001C */ sw $s0, 0x1c($sp) -/* 081584 7F04CA54 F7B40010 */ sdc1 $f20, 0x10($sp) -/* 081588 7F04CA58 8C8E0064 */ lw $t6, 0x64($a0) -/* 08158C 7F04CA5C 3C01FFF9 */ lui $at, (0xFFF9FFFF >> 16) # lui $at, 0xfff9 -/* 081590 7F04CA60 8C89000C */ lw $t1, 0xc($a0) -/* 081594 7F04CA64 3421FFFF */ ori $at, (0xFFF9FFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 081598 7F04CA68 01C17824 */ and $t7, $t6, $at -/* 08159C 7F04CA6C 0005CC40 */ sll $t9, $a1, 0x11 -/* 0815A0 7F04CA70 AC8F0064 */ sw $t7, 0x64($a0) -/* 0815A4 7F04CA74 01F94025 */ or $t0, $t7, $t9 -/* 0815A8 7F04CA78 312A0100 */ andi $t2, $t1, 0x100 -/* 0815AC 7F04CA7C 00808025 */ move $s0, $a0 -/* 0815B0 7F04CA80 1540009A */ bnez $t2, .L7F04CCEC -/* 0815B4 7F04CA84 AC880064 */ sw $t0, 0x64($a0) -/* 0815B8 7F04CA88 8C8B0008 */ lw $t3, 8($a0) -/* 0815BC 7F04CA8C 310E00C0 */ andi $t6, $t0, 0xc0 -/* 0815C0 7F04CA90 316C0001 */ andi $t4, $t3, 1 -/* 0815C4 7F04CA94 51800096 */ beql $t4, $zero, .L7F04CCF0 -/* 0815C8 7F04CA98 8FBF0024 */ lw $ra, 0x24($sp) -/* 0815CC 7F04CA9C 15C00093 */ bnez $t6, .L7F04CCEC -/* 0815D0 7F04CAA0 3C188003 */ lui $t8, %hi(D_80032040) -/* 0815D4 7F04CAA4 27182040 */ addiu $t8, %lo(D_80032040) # addiu $t8, $t8, 0x2040 -/* 0815D8 7F04CAA8 8F010000 */ lw $at, ($t8) -/* 0815DC 7F04CAAC 27AF0034 */ addiu $t7, $sp, 0x34 -/* 0815E0 7F04CAB0 8F080004 */ lw $t0, 4($t8) -/* 0815E4 7F04CAB4 ADE10000 */ sw $at, ($t7) -/* 0815E8 7F04CAB8 8F010008 */ lw $at, 8($t8) -/* 0815EC 7F04CABC ADE80004 */ sw $t0, 4($t7) -/* 0815F0 7F04CAC0 00008825 */ move $s1, $zero -/* 0815F4 7F04CAC4 ADE10008 */ sw $at, 8($t7) -/* 0815F8 7F04CAC8 0FC0FF6A */ jal sub_GAME_7F03FDA8 -/* 0815FC 7F04CACC 8C840010 */ lw $a0, 0x10($a0) -/* 081600 7F04CAD0 8E090064 */ lw $t1, 0x64($s0) -/* 081604 7F04CAD4 312A0080 */ andi $t2, $t1, 0x80 -/* 081608 7F04CAD8 11400002 */ beqz $t2, .L7F04CAE4 -/* 08160C 7F04CADC 00000000 */ nop -/* 081610 7F04CAE0 8E11006C */ lw $s1, 0x6c($s0) -.L7F04CAE4: -/* 081614 7F04CAE4 52200082 */ beql $s1, $zero, .L7F04CCF0 -/* 081618 7F04CAE8 8FBF0024 */ lw $ra, 0x24($sp) -/* 08161C 7F04CAEC 0C002914 */ jal randomGetNext -/* 081620 7F04CAF0 00000000 */ nop -/* 081624 7F04CAF4 44822000 */ mtc1 $v0, $f4 -/* 081628 7F04CAF8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08162C 7F04CAFC 4481A000 */ mtc1 $at, $f20 -/* 081630 7F04CB00 04410005 */ bgez $v0, .L7F04CB18 -/* 081634 7F04CB04 468021A0 */ cvt.s.w $f6, $f4 -/* 081638 7F04CB08 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08163C 7F04CB0C 44814000 */ mtc1 $at, $f8 -/* 081640 7F04CB10 00000000 */ nop -/* 081644 7F04CB14 46083180 */ add.s $f6, $f6, $f8 -.L7F04CB18: -/* 081648 7F04CB18 46143282 */ mul.s $f10, $f6, $f20 -/* 08164C 7F04CB1C 3C018005 */ lui $at, %hi(D_80052D6C) -/* 081650 7F04CB20 C4302D6C */ lwc1 $f16, %lo(D_80052D6C)($at) -/* 081654 7F04CB24 3C018005 */ lui $at, %hi(D_80052D70) -/* 081658 7F04CB28 C4242D70 */ lwc1 $f4, %lo(D_80052D70)($at) -/* 08165C 7F04CB2C 46105482 */ mul.s $f18, $f10, $f16 -/* 081660 7F04CB30 46049201 */ sub.s $f8, $f18, $f4 -/* 081664 7F04CB34 0C002914 */ jal randomGetNext -/* 081668 7F04CB38 E6280004 */ swc1 $f8, 4($s1) -/* 08166C 7F04CB3C 44823000 */ mtc1 $v0, $f6 -/* 081670 7F04CB40 3C018005 */ lui $at, %hi(D_80052D74) -/* 081674 7F04CB44 C4222D74 */ lwc1 $f2, %lo(D_80052D74)($at) -/* 081678 7F04CB48 04410005 */ bgez $v0, .L7F04CB60 -/* 08167C 7F04CB4C 468032A0 */ cvt.s.w $f10, $f6 -/* 081680 7F04CB50 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081684 7F04CB54 44818000 */ mtc1 $at, $f16 -/* 081688 7F04CB58 00000000 */ nop -/* 08168C 7F04CB5C 46105280 */ add.s $f10, $f10, $f16 -.L7F04CB60: -/* 081690 7F04CB60 46145482 */ mul.s $f18, $f10, $f20 -/* 081694 7F04CB64 00000000 */ nop -/* 081698 7F04CB68 46029002 */ mul.s $f0, $f18, $f2 -/* 08169C 7F04CB6C 46000100 */ add.s $f4, $f0, $f0 -/* 0816A0 7F04CB70 46022200 */ add.s $f8, $f4, $f2 -/* 0816A4 7F04CB74 0C002914 */ jal randomGetNext -/* 0816A8 7F04CB78 E6280008 */ swc1 $f8, 8($s1) -/* 0816AC 7F04CB7C 44823000 */ mtc1 $v0, $f6 -/* 0816B0 7F04CB80 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0816B4 7F04CB84 04410004 */ bgez $v0, .L7F04CB98 -/* 0816B8 7F04CB88 46803420 */ cvt.s.w $f16, $f6 -/* 0816BC 7F04CB8C 44815000 */ mtc1 $at, $f10 -/* 0816C0 7F04CB90 00000000 */ nop -/* 0816C4 7F04CB94 460A8400 */ add.s $f16, $f16, $f10 -.L7F04CB98: -/* 0816C8 7F04CB98 46148482 */ mul.s $f18, $f16, $f20 -/* 0816CC 7F04CB9C 3C018005 */ lui $at, %hi(D_80052D78) -/* 0816D0 7F04CBA0 C4242D78 */ lwc1 $f4, %lo(D_80052D78)($at) -/* 0816D4 7F04CBA4 3C018005 */ lui $at, %hi(D_80052D7C) -/* 0816D8 7F04CBA8 C4262D7C */ lwc1 $f6, %lo(D_80052D7C)($at) -/* 0816DC 7F04CBAC 46049202 */ mul.s $f8, $f18, $f4 -/* 0816E0 7F04CBB0 46064281 */ sub.s $f10, $f8, $f6 -/* 0816E4 7F04CBB4 E62A000C */ swc1 $f10, 0xc($s1) -/* 0816E8 7F04CBB8 8E0B000C */ lw $t3, 0xc($s0) -/* 0816EC 7F04CBBC 316C0200 */ andi $t4, $t3, 0x200 -/* 0816F0 7F04CBC0 5580003C */ bnezl $t4, .L7F04CCB4 -/* 0816F4 7F04CBC4 27A40034 */ addiu $a0, $sp, 0x34 -/* 0816F8 7F04CBC8 0C002914 */ jal randomGetNext -/* 0816FC 7F04CBCC 00000000 */ nop -/* 081700 7F04CBD0 44828000 */ mtc1 $v0, $f16 -/* 081704 7F04CBD4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081708 7F04CBD8 04410004 */ bgez $v0, .L7F04CBEC -/* 08170C 7F04CBDC 468084A0 */ cvt.s.w $f18, $f16 -/* 081710 7F04CBE0 44812000 */ mtc1 $at, $f4 -/* 081714 7F04CBE4 00000000 */ nop -/* 081718 7F04CBE8 46049480 */ add.s $f18, $f18, $f4 -.L7F04CBEC: -/* 08171C 7F04CBEC 46149202 */ mul.s $f8, $f18, $f20 -/* 081720 7F04CBF0 3C018005 */ lui $at, %hi(D_80052D80) -/* 081724 7F04CBF4 C4262D80 */ lwc1 $f6, %lo(D_80052D80)($at) -/* 081728 7F04CBF8 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 08172C 7F04CBFC 44818000 */ mtc1 $at, $f16 -/* 081730 7F04CC00 3C018005 */ lui $at, %hi(D_80052D84) -/* 081734 7F04CC04 C4322D84 */ lwc1 $f18, %lo(D_80052D84)($at) -/* 081738 7F04CC08 46064282 */ mul.s $f10, $f8, $f6 -/* 08173C 7F04CC0C 46105103 */ div.s $f4, $f10, $f16 -/* 081740 7F04CC10 46122201 */ sub.s $f8, $f4, $f18 -/* 081744 7F04CC14 0C002914 */ jal randomGetNext -/* 081748 7F04CC18 E7A80034 */ swc1 $f8, 0x34($sp) -/* 08174C 7F04CC1C 44823000 */ mtc1 $v0, $f6 -/* 081750 7F04CC20 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081754 7F04CC24 04410004 */ bgez $v0, .L7F04CC38 -/* 081758 7F04CC28 468032A0 */ cvt.s.w $f10, $f6 -/* 08175C 7F04CC2C 44818000 */ mtc1 $at, $f16 -/* 081760 7F04CC30 00000000 */ nop -/* 081764 7F04CC34 46105280 */ add.s $f10, $f10, $f16 -.L7F04CC38: -/* 081768 7F04CC38 46145102 */ mul.s $f4, $f10, $f20 -/* 08176C 7F04CC3C 3C018005 */ lui $at, %hi(D_80052D88) -/* 081770 7F04CC40 C4322D88 */ lwc1 $f18, %lo(D_80052D88)($at) -/* 081774 7F04CC44 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 081778 7F04CC48 44813000 */ mtc1 $at, $f6 -/* 08177C 7F04CC4C 3C018005 */ lui $at, %hi(D_80052D8C) -/* 081780 7F04CC50 C42A2D8C */ lwc1 $f10, %lo(D_80052D8C)($at) -/* 081784 7F04CC54 46122202 */ mul.s $f8, $f4, $f18 -/* 081788 7F04CC58 46064403 */ div.s $f16, $f8, $f6 -/* 08178C 7F04CC5C 460A8101 */ sub.s $f4, $f16, $f10 -/* 081790 7F04CC60 0C002914 */ jal randomGetNext -/* 081794 7F04CC64 E7A40038 */ swc1 $f4, 0x38($sp) -/* 081798 7F04CC68 44829000 */ mtc1 $v0, $f18 -/* 08179C 7F04CC6C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0817A0 7F04CC70 04410004 */ bgez $v0, .L7F04CC84 -/* 0817A4 7F04CC74 46809220 */ cvt.s.w $f8, $f18 -/* 0817A8 7F04CC78 44813000 */ mtc1 $at, $f6 -/* 0817AC 7F04CC7C 00000000 */ nop -/* 0817B0 7F04CC80 46064200 */ add.s $f8, $f8, $f6 -.L7F04CC84: -/* 0817B4 7F04CC84 46144402 */ mul.s $f16, $f8, $f20 -/* 0817B8 7F04CC88 3C018005 */ lui $at, %hi(D_80052D90) -/* 0817BC 7F04CC8C C42A2D90 */ lwc1 $f10, %lo(D_80052D90)($at) -/* 0817C0 7F04CC90 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 0817C4 7F04CC94 44819000 */ mtc1 $at, $f18 -/* 0817C8 7F04CC98 3C018005 */ lui $at, %hi(D_80052D94) -/* 0817CC 7F04CC9C C4282D94 */ lwc1 $f8, %lo(D_80052D94)($at) -/* 0817D0 7F04CCA0 460A8102 */ mul.s $f4, $f16, $f10 -/* 0817D4 7F04CCA4 46122183 */ div.s $f6, $f4, $f18 -/* 0817D8 7F04CCA8 46083401 */ sub.s $f16, $f6, $f8 -/* 0817DC 7F04CCAC E7B0003C */ swc1 $f16, 0x3c($sp) -/* 0817E0 7F04CCB0 27A40034 */ addiu $a0, $sp, 0x34 -.L7F04CCB4: -/* 0817E4 7F04CCB4 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 0817E8 7F04CCB8 26250020 */ addiu $a1, $s1, 0x20 -/* 0817EC 7F04CCBC 8E2D0000 */ lw $t5, ($s1) -/* 0817F0 7F04CCC0 2401FEFF */ li $at, -257 -/* 0817F4 7F04CCC4 35AE0001 */ ori $t6, $t5, 1 -/* 0817F8 7F04CCC8 AE2E0000 */ sw $t6, ($s1) -/* 0817FC 7F04CCCC 8E190008 */ lw $t9, 8($s0) -/* 081800 7F04CCD0 8E180064 */ lw $t8, 0x64($s0) -/* 081804 7F04CCD4 03217824 */ and $t7, $t9, $at -/* 081808 7F04CCD8 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff -/* 08180C 7F04CCDC 34217FFF */ ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff -/* 081810 7F04CCE0 03014024 */ and $t0, $t8, $at -/* 081814 7F04CCE4 AE0F0008 */ sw $t7, 8($s0) -/* 081818 7F04CCE8 AE080064 */ sw $t0, 0x64($s0) -.L7F04CCEC: -/* 08181C 7F04CCEC 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04CCF0: -/* 081820 7F04CCF0 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 081824 7F04CCF4 8FB0001C */ lw $s0, 0x1c($sp) -/* 081828 7F04CCF8 8FB10020 */ lw $s1, 0x20($sp) -/* 08182C 7F04CCFC 03E00008 */ jr $ra -/* 081830 7F04CD00 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif -#if !defined(LEFTOVERDEBUG) +/** + * Make an object fall. Eg. due to it sitting on a table which is now destroyed, + * or because it was a chopper that is now destroyed. + */ +void objFall(ObjectRecord *obj, s32 playernum) +{ + obj->runtime_bitflags &= ~(RUNTIMEBITFLAG_OWNER); + obj->runtime_bitflags |= (playernum << RUNTIMEBITSHIFT_OWNER); -/* same asm, different float .rodata */ + if ((obj->flags2 & PROPFLAG2_NOFALL) == 0 + && (obj->flags & PROPFLAG_RENDERPOSTBG) + && (obj->runtime_bitflags & (RUNTIMEBITFLAG_EMBEDDED | RUNTIMEBITFLAG_DEPOSIT)) == 0) + { -GLOBAL_ASM( -.late_rodata -glabel D_80052D6C -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D70 -.word 0x3f555555 /*0.83333331*/ -glabel D_80052D74 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D78 -.word 0x3fd55555 /*1.6666666*/ -glabel D_80052D7C -.word 0x3f555555 /*0.83333331*/ -glabel D_80052D80 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D84 -.word 0x3c4104fb /* 0.0117809725925 */ -glabel D_80052D88 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D8C -.word 0x3c4104fb /* 0.0117809725925 */ -glabel D_80052D90 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80052D94 -.word 0x3c4104fb /* 0.0117809725925 */ -.text -glabel sub_GAME_7F04CA44 -/* 081574 7F04CA44 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 081578 7F04CA48 AFBF0024 */ sw $ra, 0x24($sp) -/* 08157C 7F04CA4C AFB10020 */ sw $s1, 0x20($sp) -/* 081580 7F04CA50 AFB0001C */ sw $s0, 0x1c($sp) -/* 081584 7F04CA54 F7B40010 */ sdc1 $f20, 0x10($sp) -/* 081588 7F04CA58 8C8E0064 */ lw $t6, 0x64($a0) -/* 08158C 7F04CA5C 3C01FFF9 */ lui $at, (0xFFF9FFFF >> 16) # lui $at, 0xfff9 -/* 081590 7F04CA60 8C89000C */ lw $t1, 0xc($a0) -/* 081594 7F04CA64 3421FFFF */ ori $at, (0xFFF9FFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 081598 7F04CA68 01C17824 */ and $t7, $t6, $at -/* 08159C 7F04CA6C 0005CC40 */ sll $t9, $a1, 0x11 -/* 0815A0 7F04CA70 AC8F0064 */ sw $t7, 0x64($a0) -/* 0815A4 7F04CA74 01F94025 */ or $t0, $t7, $t9 -/* 0815A8 7F04CA78 312A0100 */ andi $t2, $t1, 0x100 -/* 0815AC 7F04CA7C 00808025 */ move $s0, $a0 -/* 0815B0 7F04CA80 1540009A */ bnez $t2, .L7F04CCEC -/* 0815B4 7F04CA84 AC880064 */ sw $t0, 0x64($a0) -/* 0815B8 7F04CA88 8C8B0008 */ lw $t3, 8($a0) -/* 0815BC 7F04CA8C 310E00C0 */ andi $t6, $t0, 0xc0 -/* 0815C0 7F04CA90 316C0001 */ andi $t4, $t3, 1 -/* 0815C4 7F04CA94 51800096 */ beql $t4, $zero, .L7F04CCF0 -/* 0815C8 7F04CA98 8FBF0024 */ lw $ra, 0x24($sp) -/* 0815CC 7F04CA9C 15C00093 */ bnez $t6, .L7F04CCEC -/* 0815D0 7F04CAA0 3C188003 */ lui $t8, %hi(D_80032040) -/* 0815D4 7F04CAA4 27182040 */ addiu $t8, %lo(D_80032040) # addiu $t8, $t8, 0x2040 -/* 0815D8 7F04CAA8 8F010000 */ lw $at, ($t8) -/* 0815DC 7F04CAAC 27AF0034 */ addiu $t7, $sp, 0x34 -/* 0815E0 7F04CAB0 8F080004 */ lw $t0, 4($t8) -/* 0815E4 7F04CAB4 ADE10000 */ sw $at, ($t7) -/* 0815E8 7F04CAB8 8F010008 */ lw $at, 8($t8) -/* 0815EC 7F04CABC ADE80004 */ sw $t0, 4($t7) -/* 0815F0 7F04CAC0 00008825 */ move $s1, $zero -/* 0815F4 7F04CAC4 ADE10008 */ sw $at, 8($t7) -/* 0815F8 7F04CAC8 0FC0FF6A */ jal sub_GAME_7F03FDA8 -/* 0815FC 7F04CACC 8C840010 */ lw $a0, 0x10($a0) -/* 081600 7F04CAD0 8E090064 */ lw $t1, 0x64($s0) -/* 081604 7F04CAD4 312A0080 */ andi $t2, $t1, 0x80 -/* 081608 7F04CAD8 11400002 */ beqz $t2, .L7F04CAE4 -/* 08160C 7F04CADC 00000000 */ nop -/* 081610 7F04CAE0 8E11006C */ lw $s1, 0x6c($s0) -.L7F04CAE4: -/* 081614 7F04CAE4 52200082 */ beql $s1, $zero, .L7F04CCF0 -/* 081618 7F04CAE8 8FBF0024 */ lw $ra, 0x24($sp) -/* 08161C 7F04CAEC 0C002914 */ jal randomGetNext -/* 081620 7F04CAF0 00000000 */ nop -/* 081624 7F04CAF4 44822000 */ mtc1 $v0, $f4 -/* 081628 7F04CAF8 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08162C 7F04CAFC 4481A000 */ mtc1 $at, $f20 -/* 081630 7F04CB00 04410005 */ bgez $v0, .L7F04CB18 -/* 081634 7F04CB04 468021A0 */ cvt.s.w $f6, $f4 -/* 081638 7F04CB08 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08163C 7F04CB0C 44814000 */ mtc1 $at, $f8 -/* 081640 7F04CB10 00000000 */ nop -/* 081644 7F04CB14 46083180 */ add.s $f6, $f6, $f8 -.L7F04CB18: -/* 081648 7F04CB18 46143282 */ mul.s $f10, $f6, $f20 -/* 08164C 7F04CB1C 3C018005 */ lui $at, %hi(D_80052D6C) -/* 081650 7F04CB20 C4302D6C */ lwc1 $f16, %lo(D_80052D6C)($at) -/* 081654 7F04CB24 3C018005 */ lui $at, %hi(D_80052D70) -/* 081658 7F04CB28 C4242D70 */ lwc1 $f4, %lo(D_80052D70)($at) -/* 08165C 7F04CB2C 46105482 */ mul.s $f18, $f10, $f16 -/* 081660 7F04CB30 46049201 */ sub.s $f8, $f18, $f4 -/* 081664 7F04CB34 0C002914 */ jal randomGetNext -/* 081668 7F04CB38 E6280004 */ swc1 $f8, 4($s1) -/* 08166C 7F04CB3C 44823000 */ mtc1 $v0, $f6 -/* 081670 7F04CB40 3C018005 */ lui $at, %hi(D_80052D74) -/* 081674 7F04CB44 C4222D74 */ lwc1 $f2, %lo(D_80052D74)($at) -/* 081678 7F04CB48 04410005 */ bgez $v0, .L7F04CB60 -/* 08167C 7F04CB4C 468032A0 */ cvt.s.w $f10, $f6 -/* 081680 7F04CB50 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081684 7F04CB54 44818000 */ mtc1 $at, $f16 -/* 081688 7F04CB58 00000000 */ nop -/* 08168C 7F04CB5C 46105280 */ add.s $f10, $f10, $f16 -.L7F04CB60: -/* 081690 7F04CB60 46145482 */ mul.s $f18, $f10, $f20 -/* 081694 7F04CB64 00000000 */ nop -/* 081698 7F04CB68 46029002 */ mul.s $f0, $f18, $f2 -/* 08169C 7F04CB6C 46000100 */ add.s $f4, $f0, $f0 -/* 0816A0 7F04CB70 46022200 */ add.s $f8, $f4, $f2 -/* 0816A4 7F04CB74 0C002914 */ jal randomGetNext -/* 0816A8 7F04CB78 E6280008 */ swc1 $f8, 8($s1) -/* 0816AC 7F04CB7C 44823000 */ mtc1 $v0, $f6 -/* 0816B0 7F04CB80 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0816B4 7F04CB84 04410004 */ bgez $v0, .L7F04CB98 -/* 0816B8 7F04CB88 46803420 */ cvt.s.w $f16, $f6 -/* 0816BC 7F04CB8C 44815000 */ mtc1 $at, $f10 -/* 0816C0 7F04CB90 00000000 */ nop -/* 0816C4 7F04CB94 460A8400 */ add.s $f16, $f16, $f10 -.L7F04CB98: -/* 0816C8 7F04CB98 46148482 */ mul.s $f18, $f16, $f20 -/* 0816CC 7F04CB9C 3C018005 */ lui $at, %hi(D_80052D78) -/* 0816D0 7F04CBA0 C4242D78 */ lwc1 $f4, %lo(D_80052D78)($at) -/* 0816D4 7F04CBA4 3C018005 */ lui $at, %hi(D_80052D7C) -/* 0816D8 7F04CBA8 C4262D7C */ lwc1 $f6, %lo(D_80052D7C)($at) -/* 0816DC 7F04CBAC 46049202 */ mul.s $f8, $f18, $f4 -/* 0816E0 7F04CBB0 46064281 */ sub.s $f10, $f8, $f6 -/* 0816E4 7F04CBB4 E62A000C */ swc1 $f10, 0xc($s1) -/* 0816E8 7F04CBB8 8E0B000C */ lw $t3, 0xc($s0) -/* 0816EC 7F04CBBC 316C0200 */ andi $t4, $t3, 0x200 -/* 0816F0 7F04CBC0 5580003C */ bnezl $t4, .L7F04CCB4 -/* 0816F4 7F04CBC4 27A40034 */ addiu $a0, $sp, 0x34 -/* 0816F8 7F04CBC8 0C002914 */ jal randomGetNext -/* 0816FC 7F04CBCC 00000000 */ nop -/* 081700 7F04CBD0 44828000 */ mtc1 $v0, $f16 -/* 081704 7F04CBD4 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081708 7F04CBD8 04410004 */ bgez $v0, .L7F04CBEC -/* 08170C 7F04CBDC 468084A0 */ cvt.s.w $f18, $f16 -/* 081710 7F04CBE0 44812000 */ mtc1 $at, $f4 -/* 081714 7F04CBE4 00000000 */ nop -/* 081718 7F04CBE8 46049480 */ add.s $f18, $f18, $f4 -.L7F04CBEC: -/* 08171C 7F04CBEC 46149202 */ mul.s $f8, $f18, $f20 -/* 081720 7F04CBF0 3C018005 */ lui $at, %hi(D_80052D80) -/* 081724 7F04CBF4 C4262D80 */ lwc1 $f6, %lo(D_80052D80)($at) -/* 081728 7F04CBF8 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 08172C 7F04CBFC 44818000 */ mtc1 $at, $f16 -/* 081730 7F04CC00 3C018005 */ lui $at, %hi(D_80052D84) -/* 081734 7F04CC04 C4322D84 */ lwc1 $f18, %lo(D_80052D84)($at) -/* 081738 7F04CC08 46064282 */ mul.s $f10, $f8, $f6 -/* 08173C 7F04CC0C 46105103 */ div.s $f4, $f10, $f16 -/* 081740 7F04CC10 46122201 */ sub.s $f8, $f4, $f18 -/* 081744 7F04CC14 0C002914 */ jal randomGetNext -/* 081748 7F04CC18 E7A80034 */ swc1 $f8, 0x34($sp) -/* 08174C 7F04CC1C 44823000 */ mtc1 $v0, $f6 -/* 081750 7F04CC20 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 081754 7F04CC24 04410004 */ bgez $v0, .L7F04CC38 -/* 081758 7F04CC28 468032A0 */ cvt.s.w $f10, $f6 -/* 08175C 7F04CC2C 44818000 */ mtc1 $at, $f16 -/* 081760 7F04CC30 00000000 */ nop -/* 081764 7F04CC34 46105280 */ add.s $f10, $f10, $f16 -.L7F04CC38: -/* 081768 7F04CC38 46145102 */ mul.s $f4, $f10, $f20 -/* 08176C 7F04CC3C 3C018005 */ lui $at, %hi(D_80052D88) -/* 081770 7F04CC40 C4322D88 */ lwc1 $f18, %lo(D_80052D88)($at) -/* 081774 7F04CC44 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 081778 7F04CC48 44813000 */ mtc1 $at, $f6 -/* 08177C 7F04CC4C 3C018005 */ lui $at, %hi(D_80052D8C) -/* 081780 7F04CC50 C42A2D8C */ lwc1 $f10, %lo(D_80052D8C)($at) -/* 081784 7F04CC54 46122202 */ mul.s $f8, $f4, $f18 -/* 081788 7F04CC58 46064403 */ div.s $f16, $f8, $f6 -/* 08178C 7F04CC5C 460A8101 */ sub.s $f4, $f16, $f10 -/* 081790 7F04CC60 0C002914 */ jal randomGetNext -/* 081794 7F04CC64 E7A40038 */ swc1 $f4, 0x38($sp) -/* 081798 7F04CC68 44829000 */ mtc1 $v0, $f18 -/* 08179C 7F04CC6C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 0817A0 7F04CC70 04410004 */ bgez $v0, .L7F04CC84 -/* 0817A4 7F04CC74 46809220 */ cvt.s.w $f8, $f18 -/* 0817A8 7F04CC78 44813000 */ mtc1 $at, $f6 -/* 0817AC 7F04CC7C 00000000 */ nop -/* 0817B0 7F04CC80 46064200 */ add.s $f8, $f8, $f6 -.L7F04CC84: -/* 0817B4 7F04CC84 46144402 */ mul.s $f16, $f8, $f20 -/* 0817B8 7F04CC88 3C018005 */ lui $at, %hi(D_80052D90) -/* 0817BC 7F04CC8C C42A2D90 */ lwc1 $f10, %lo(D_80052D90)($at) -/* 0817C0 7F04CC90 3C0143A0 */ li $at, 0x43A00000 # 320.000000 -/* 0817C4 7F04CC94 44819000 */ mtc1 $at, $f18 -/* 0817C8 7F04CC98 3C018005 */ lui $at, %hi(D_80052D94) -/* 0817CC 7F04CC9C C4282D94 */ lwc1 $f8, %lo(D_80052D94)($at) -/* 0817D0 7F04CCA0 460A8102 */ mul.s $f4, $f16, $f10 -/* 0817D4 7F04CCA4 46122183 */ div.s $f6, $f4, $f18 -/* 0817D8 7F04CCA8 46083401 */ sub.s $f16, $f6, $f8 -/* 0817DC 7F04CCAC E7B0003C */ swc1 $f16, 0x3c($sp) -/* 0817E0 7F04CCB0 27A40034 */ addiu $a0, $sp, 0x34 -.L7F04CCB4: -/* 0817E4 7F04CCB4 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 0817E8 7F04CCB8 26250020 */ addiu $a1, $s1, 0x20 -/* 0817EC 7F04CCBC 8E2D0000 */ lw $t5, ($s1) -/* 0817F0 7F04CCC0 2401FEFF */ li $at, -257 -/* 0817F4 7F04CCC4 35AE0001 */ ori $t6, $t5, 1 -/* 0817F8 7F04CCC8 AE2E0000 */ sw $t6, ($s1) -/* 0817FC 7F04CCCC 8E190008 */ lw $t9, 8($s0) -/* 081800 7F04CCD0 8E180064 */ lw $t8, 0x64($s0) -/* 081804 7F04CCD4 03217824 */ and $t7, $t9, $at -/* 081808 7F04CCD8 3C01FFFF */ lui $at, (0xFFFF7FFF >> 16) # lui $at, 0xffff -/* 08180C 7F04CCDC 34217FFF */ ori $at, (0xFFFF7FFF & 0xFFFF) # ori $at, $at, 0x7fff -/* 081810 7F04CCE0 03014024 */ and $t0, $t8, $at -/* 081814 7F04CCE4 AE0F0008 */ sw $t7, 8($s0) -/* 081818 7F04CCE8 AE080064 */ sw $t0, 0x64($s0) -.L7F04CCEC: -/* 08181C 7F04CCEC 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04CCF0: -/* 081820 7F04CCF0 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 081824 7F04CCF4 8FB0001C */ lw $s0, 0x1c($sp) -/* 081828 7F04CCF8 8FB10020 */ lw $s1, 0x20($sp) -/* 08182C 7F04CCFC 03E00008 */ jr $ra -/* 081830 7F04CD00 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif + coord3d rot = {0, 0, 0}; + Projectile *projectile = NULL; + s32 unused; -#endif + sub_GAME_7F03FDA8(obj->prop); + if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) + { + projectile = obj->projectile; + } + if (projectile) + { + projectile->speed.x = RANDOMFRAC() * 1.6666666f - 0.8333333f; + projectile->speed.y = RANDOMFRAC() * 1.6666666f * 2.0f + 1.6666666f; + projectile->speed.z = RANDOMFRAC() * 1.6666666f - 0.8333333f; + if ((obj->flags2 & PROPFLAG2_FALLWITHOUTROTATION) == 0) + { +#ifdef VERSION_EU + rot.x = ((RANDOMFRAC() * 7.5398226f) / 320.0f) - 0.011780973f; + rot.y = ((RANDOMFRAC() * 7.5398226f) / 320.0f) - 0.011780973f; + rot.z = ((RANDOMFRAC() * 7.5398226f) / 320.0f) - 0.011780973f; +#else + rot.x = ((RANDOMFRAC() * M_TAU_F) / 320.0f) - 0.009817477f; + rot.y = ((RANDOMFRAC() * M_TAU_F) / 320.0f) - 0.009817477f; + rot.z = ((RANDOMFRAC() * M_TAU_F) / 320.0f) - 0.009817477f; +#endif + } + matrix_4x4_set_rotation_around_xyz(rot.f, &projectile->mtx); -#ifdef NONMATCHING -void sub_GAME_7F04CD04(void) { + projectile->flags |= PROJECTILEFLAG_AIRBORNE; + obj->flags &= ~PROPFLAG_00000100; + obj->runtime_bitflags &= ~RUNTIMEBITFLAG_00008000; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04CD04 -/* 081834 7F04CD04 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 081838 7F04CD08 AFBF0034 */ sw $ra, 0x34($sp) -/* 08183C 7F04CD0C AFB60030 */ sw $s6, 0x30($sp) -/* 081840 7F04CD10 AFB5002C */ sw $s5, 0x2c($sp) -/* 081844 7F04CD14 AFB40028 */ sw $s4, 0x28($sp) -/* 081848 7F04CD18 AFB30024 */ sw $s3, 0x24($sp) -/* 08184C 7F04CD1C AFB20020 */ sw $s2, 0x20($sp) -/* 081850 7F04CD20 AFB1001C */ sw $s1, 0x1c($sp) -/* 081854 7F04CD24 AFB00018 */ sw $s0, 0x18($sp) -/* 081858 7F04CD28 8C8E0014 */ lw $t6, 0x14($a0) -/* 08185C 7F04CD2C 00A0B025 */ move $s6, $a1 -/* 081860 7F04CD30 8C940004 */ lw $s4, 4($a0) -/* 081864 7F04CD34 27A50048 */ addiu $a1, $sp, 0x48 -/* 081868 7F04CD38 27A60044 */ addiu $a2, $sp, 0x44 -/* 08186C 7F04CD3C 0FC0F32C */ jal chraiGetCollisionBoundsWithoutY -/* 081870 7F04CD40 91D50003 */ lbu $s5, 3($t6) -/* 081874 7F04CD44 8FAF0044 */ lw $t7, 0x44($sp) -/* 081878 7F04CD48 59E00027 */ blezl $t7, .L7F04CDE8 -/* 08187C 7F04CD4C 8FBF0034 */ lw $ra, 0x34($sp) -/* 081880 7F04CD50 0FC0E909 */ jal get_ptr_obj_pos_list_current_entry -/* 081884 7F04CD54 00000000 */ nop -/* 081888 7F04CD58 10400022 */ beqz $v0, .L7F04CDE4 -/* 08188C 7F04CD5C 00408825 */ move $s1, $v0 -/* 081890 7F04CD60 24130004 */ li $s3, 4 -/* 081894 7F04CD64 24120001 */ li $s2, 1 -/* 081898 7F04CD68 92220000 */ lbu $v0, ($s1) -.L7F04CD6C: -/* 08189C 7F04CD6C 52420004 */ beql $s2, $v0, .L7F04CD80 -/* 0818A0 7F04CD70 8E380014 */ lw $t8, 0x14($s1) -/* 0818A4 7F04CD74 56620019 */ bnel $s3, $v0, .L7F04CDDC -/* 0818A8 7F04CD78 8E310024 */ lw $s1, 0x24($s1) -/* 0818AC 7F04CD7C 8E380014 */ lw $t8, 0x14($s1) -.L7F04CD80: -/* 0818B0 7F04CD80 93190003 */ lbu $t9, 3($t8) -/* 0818B4 7F04CD84 56B90015 */ bnel $s5, $t9, .L7F04CDDC -/* 0818B8 7F04CD88 8E310024 */ lw $s1, 0x24($s1) -/* 0818BC 7F04CD8C 8E300004 */ lw $s0, 4($s1) -/* 0818C0 7F04CD90 C684005C */ lwc1 $f4, 0x5c($s4) -/* 0818C4 7F04CD94 C606005C */ lwc1 $f6, 0x5c($s0) -/* 0818C8 7F04CD98 4606203C */ c.lt.s $f4, $f6 -/* 0818CC 7F04CD9C 00000000 */ nop -/* 0818D0 7F04CDA0 4502000E */ bc1fl .L7F04CDDC -/* 0818D4 7F04CDA4 8E310024 */ lw $s1, 0x24($s1) -/* 0818D8 7F04CDA8 8E080064 */ lw $t0, 0x64($s0) -/* 0818DC 7F04CDAC 26040058 */ addiu $a0, $s0, 0x58 -/* 0818E0 7F04CDB0 8FA50048 */ lw $a1, 0x48($sp) -/* 0818E4 7F04CDB4 31098000 */ andi $t1, $t0, 0x8000 -/* 0818E8 7F04CDB8 51200008 */ beql $t1, $zero, .L7F04CDDC -/* 0818EC 7F04CDBC 8E310024 */ lw $s1, 0x24($s1) -/* 0818F0 7F04CDC0 0FC0F336 */ jal chrpropTestPointInPolygon -/* 0818F4 7F04CDC4 8FA60044 */ lw $a2, 0x44($sp) -/* 0818F8 7F04CDC8 10400003 */ beqz $v0, .L7F04CDD8 -/* 0818FC 7F04CDCC 02002025 */ move $a0, $s0 -/* 081900 7F04CDD0 0FC13291 */ jal sub_GAME_7F04CA44 -/* 081904 7F04CDD4 02C02825 */ move $a1, $s6 -.L7F04CDD8: -/* 081908 7F04CDD8 8E310024 */ lw $s1, 0x24($s1) -.L7F04CDDC: -/* 08190C 7F04CDDC 5620FFE3 */ bnezl $s1, .L7F04CD6C -/* 081910 7F04CDE0 92220000 */ lbu $v0, ($s1) -.L7F04CDE4: -/* 081914 7F04CDE4 8FBF0034 */ lw $ra, 0x34($sp) -.L7F04CDE8: -/* 081918 7F04CDE8 8FB00018 */ lw $s0, 0x18($sp) -/* 08191C 7F04CDEC 8FB1001C */ lw $s1, 0x1c($sp) -/* 081920 7F04CDF0 8FB20020 */ lw $s2, 0x20($sp) -/* 081924 7F04CDF4 8FB30024 */ lw $s3, 0x24($sp) -/* 081928 7F04CDF8 8FB40028 */ lw $s4, 0x28($sp) -/* 08192C 7F04CDFC 8FB5002C */ lw $s5, 0x2c($sp) -/* 081930 7F04CE00 8FB60030 */ lw $s6, 0x30($sp) -/* 081934 7F04CE04 03E00008 */ jr $ra -/* 081938 7F04CE08 27BD0058 */ addiu $sp, $sp, 0x58 -) -#endif +/** + * Destroy the objects that the given prop is supporting. + * + * For example, destroying a table will also destroy all the props that are + * sitting on that table. + */ +void objDestroySupportedObjects(PropRecord* tableprop, s32 playernum) +{ + ObjectRecord* obj; + ObjectRecord* tableobj; + PropRecord* prop; + rect4f* rect; + s32 sp44; + u8 room; + tableobj = tableprop->obj; + room = tableprop->stan->room; + + chraiGetCollisionBoundsWithoutY(tableprop, &rect, &sp44); + + if (sp44 > 0) + { + prop = get_ptr_obj_pos_list_current_entry(); + while (prop) + { + if (((prop->type == PROP_TYPE_OBJ) || (prop->type == PROP_TYPE_WEAPON)) && (prop->stan->room == room)) + { + obj = prop->obj; + if ((tableobj->runtime_pos.y < obj->runtime_pos.y) + && ((s32) obj->runtime_bitflags & RUNTIMEBITFLAG_00008000) + && (chrpropTestPointInPolygon(&obj->runtime_pos, rect, sp44) != 0)) + { + objFall(obj, playernum); + } + } + prop = prop->prev; + } + } +} #ifdef NONMATCHING @@ -31269,7 +29525,7 @@ glabel object_explosion_related /* 081964 7F04CE34 00000000 */ nop /* 081968 7F04CE38 45030006 */ bc1tl .L7F04CE54 /* 08196C 7F04CE3C 862E0004 */ lh $t6, 4($s1) -/* 081970 7F04CE40 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 081970 7F04CE40 0FC0FFF0 */ jal objGetDestroyedLevel /* 081974 7F04CE44 00000000 */ nop /* 081978 7F04CE48 504000C4 */ beql $v0, $zero, .L7F04D15C /* 08197C 7F04CE4C 8FBF002C */ lw $ra, 0x2c($sp) @@ -31297,7 +29553,7 @@ glabel object_explosion_related /* 0819CC 7F04CE9C 8E080014 */ lw $t0, 0x14($s0) .L7F04CEA0: /* 0819D0 7F04CEA0 AFA30044 */ sw $v1, 0x44($sp) -/* 0819D4 7F04CEA4 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0819D4 7F04CEA4 0FC0FFF0 */ jal objGetDestroyedLevel /* 0819D8 7F04CEA8 AFA80038 */ sw $t0, 0x38($sp) /* 0819DC 7F04CEAC 14400056 */ bnez $v0, .L7F04D008 /* 0819E0 7F04CEB0 00000000 */ nop @@ -31368,7 +29624,7 @@ glabel object_explosion_related /* 081AD4 7F04CFA4 8FA40044 */ lw $a0, 0x44($sp) /* 081AD8 7F04CFA8 5604006C */ bnel $s0, $a0, .L7F04D15C /* 081ADC 7F04CFAC 8FBF002C */ lw $ra, 0x2c($sp) -/* 081AE0 7F04CFB0 0FC13341 */ jal sub_GAME_7F04CD04 +/* 081AE0 7F04CFB0 0FC13341 */ jal objDestroySupportedObjects /* 081AE4 7F04CFB4 8FA50050 */ lw $a1, 0x50($sp) /* 081AE8 7F04CFB8 8E220064 */ lw $v0, 0x64($s1) /* 081AEC 7F04CFBC 30588000 */ andi $t8, $v0, 0x8000 @@ -31387,12 +29643,12 @@ glabel object_explosion_related /* 081B1C 7F04CFEC 00414025 */ or $t0, $v0, $at /* 081B20 7F04CFF0 AE280064 */ sw $t0, 0x64($s1) /* 081B24 7F04CFF4 8FA50050 */ lw $a1, 0x50($sp) -/* 081B28 7F04CFF8 0FC13291 */ jal sub_GAME_7F04CA44 +/* 081B28 7F04CFF8 0FC13291 */ jal objFall /* 081B2C 7F04CFFC 02202025 */ move $a0, $s1 /* 081B30 7F04D000 10000056 */ b .L7F04D15C /* 081B34 7F04D004 8FBF002C */ lw $ra, 0x2c($sp) .L7F04D008: -/* 081B38 7F04D008 0FC0FFD8 */ jal sub_GAME_7F03FF60 +/* 081B38 7F04D008 0FC0FFD8 */ jal objGetShotsTaken /* 081B3C 7F04D00C 02202025 */ move $a0, $s1 /* 081B40 7F04D010 30490003 */ andi $t1, $v0, 3 /* 081B44 7F04D014 15200031 */ bnez $t1, .L7F04D0DC @@ -31448,7 +29704,7 @@ glabel object_explosion_related /* 081C04 7F04D0D4 0FC27094 */ jal explosionCreate /* 081C08 7F04D0D8 AFA90014 */ sw $t1, 0x14($sp) .L7F04D0DC: -/* 081C0C 7F04D0DC 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 081C0C 7F04D0DC 0FC0FFF0 */ jal objGetDestroyedLevel /* 081C10 7F04D0E0 02202025 */ move $a0, $s1 /* 081C14 7F04D0E4 58400012 */ blezl $v0, .L7F04D130 /* 081C18 7F04D0E8 8FA90034 */ lw $t1, 0x34($sp) @@ -31508,7 +29764,7 @@ glabel object_explosion_related /* 07FA18 7F04D028 00000000 */ nop /* 07FA1C 7F04D02C 45030006 */ bc1tl .L7F04D048 /* 07FA20 7F04D030 862E0004 */ lh $t6, 4($s1) -/* 07FA24 7F04D034 0FC10020 */ jal do_something_if_object_destroyed +/* 07FA24 7F04D034 0FC10020 */ jal objGetDestroyedLevel /* 07FA28 7F04D038 00000000 */ nop /* 07FA2C 7F04D03C 504000C1 */ beql $v0, $zero, .L7F04D344 /* 07FA30 7F04D040 8FBF002C */ lw $ra, 0x2c($sp) @@ -31533,7 +29789,7 @@ glabel object_explosion_related /* 07FA74 7F04D084 8E190014 */ lw $t9, 0x14($s0) .L7F04D088: /* 07FA78 7F04D088 AFA30044 */ sw $v1, 0x44($sp) -/* 07FA7C 7F04D08C 0FC10020 */ jal do_something_if_object_destroyed +/* 07FA7C 7F04D08C 0FC10020 */ jal objGetDestroyedLevel /* 07FA80 7F04D090 AFB90038 */ sw $t9, 0x38($sp) /* 07FA84 7F04D094 14400056 */ bnez $v0, .L7F04D1F0 /* 07FA88 7F04D098 00000000 */ nop @@ -31604,7 +29860,7 @@ glabel object_explosion_related /* 07FB7C 7F04D18C 8FA40044 */ lw $a0, 0x44($sp) /* 07FB80 7F04D190 5604006C */ bnel $s0, $a0, .L7F04D344 /* 07FB84 7F04D194 8FBF002C */ lw $ra, 0x2c($sp) -/* 07FB88 7F04D198 0FC133BE */ jal sub_GAME_7F04CD04 +/* 07FB88 7F04D198 0FC133BE */ jal objDestroySupportedObjects /* 07FB8C 7F04D19C 8FA50050 */ lw $a1, 0x50($sp) /* 07FB90 7F04D1A0 8E220064 */ lw $v0, 0x64($s1) /* 07FB94 7F04D1A4 304F8000 */ andi $t7, $v0, 0x8000 @@ -31623,12 +29879,12 @@ glabel object_explosion_related /* 07FBC4 7F04D1D4 0041C825 */ or $t9, $v0, $at /* 07FBC8 7F04D1D8 AE390064 */ sw $t9, 0x64($s1) /* 07FBCC 7F04D1DC 8FA50050 */ lw $a1, 0x50($sp) -/* 07FBD0 7F04D1E0 0FC1330E */ jal sub_GAME_7F04CA44 +/* 07FBD0 7F04D1E0 0FC1330E */ jal objFall /* 07FBD4 7F04D1E4 02202025 */ move $a0, $s1 /* 07FBD8 7F04D1E8 10000056 */ b .L7F04D344 /* 07FBDC 7F04D1EC 8FBF002C */ lw $ra, 0x2c($sp) .L7F04D1F0: -/* 07FBE0 7F04D1F0 0FC10008 */ jal sub_GAME_7F03FF60 +/* 07FBE0 7F04D1F0 0FC10008 */ jal objGetShotsTaken /* 07FBE4 7F04D1F4 02202025 */ move $a0, $s1 /* 07FBE8 7F04D1F8 30480003 */ andi $t0, $v0, 3 /* 07FBEC 7F04D1FC 15000031 */ bnez $t0, .L7F04D2C4eu @@ -31684,7 +29940,7 @@ glabel object_explosion_related /* 07FCAC 7F04D2BC 0FC26DE4 */ jal explosionCreate /* 07FCB0 7F04D2C0 AFA80014 */ sw $t0, 0x14($sp) .L7F04D2C4eu: -/* 07FCB4 7F04D2C4 0FC10020 */ jal do_something_if_object_destroyed +/* 07FCB4 7F04D2C4 0FC10020 */ jal objGetDestroyedLevel /* 07FCB8 7F04D2C8 02202025 */ move $a0, $s1 /* 07FCBC 7F04D2CC 58400012 */ blezl $v0, .L7F04D318 /* 07FCC0 7F04D2D0 8FA80034 */ lw $t0, 0x34($sp) @@ -31732,13 +29988,32 @@ glabel object_explosion_related #ifdef NONMATCHING -void sub_GAME_7F04D16C(void) { +bool bgTestHitOnObj(coord3d *arg0, coord3d *arg1, coord3d *arg2, Gfx *gdl, Gfx *gdl2, Vertex *vertices, struct HitThing *hitthing) { } #else +bool bgTestHitOnObj(coord3d *arg0, coord3d *arg1, coord3d *arg2, Gfx *gdl, Gfx *gdl2, Vertex *vertices, struct HitThing *hitthing); +u32 D_8003204C = 0x7FFF; +u32 D_80032050 = 0x7FFF; +u32 D_80032054 = 0x7FFF; +u32 D_80032058 = 0xFFFF8000; +u32 D_8003205C = 0xFFFF8000; +u32 D_80032060 = 0xFFFF8000; +u32 D_80032064 = 0; +u32 D_80032068 = 0; +u32 D_8003206C = 0; +u32 D_80032070 = 0x7FFF; +u32 D_80032074 = 0x7FFF; +u32 D_80032078 = 0x7FFF; +u32 D_8003207C = 0xFFFF8000; +u32 D_80032080 = 0xFFFF8000; +u32 D_80032084 = 0xFFFF8000; +u32 D_80032088 = 0; +u32 D_8003208C = 0; +u32 D_80032090 = 0; GLOBAL_ASM( .text -glabel sub_GAME_7F04D16C +glabel bgTestHitOnObj /* 081C9C 7F04D16C 27BDFEB0 */ addiu $sp, $sp, -0x150 /* 081CA0 7F04D170 F7B40028 */ sdc1 $f20, 0x28($sp) /* 081CA4 7F04D174 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 @@ -31911,7 +30186,7 @@ glabel sub_GAME_7F04D16C /* 081F00 7F04D3D0 8C980000 */ lw $t8, ($a0) /* 081F04 7F04D3D4 02E02025 */ move $a0, $s7 /* 081F08 7F04D3D8 27A600E8 */ addiu $a2, $sp, 0xe8 -/* 081F0C 7F04D3DC 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 081F0C 7F04D3DC 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 081F10 7F04D3E0 27A700DC */ addiu $a3, $sp, 0xdc /* 081F14 7F04D3E4 10400162 */ beqz $v0, .L7F04D970 /* 081F18 7F04D3E8 3C0D8003 */ lui $t5, %hi(D_80032064) @@ -32162,7 +30437,7 @@ glabel sub_GAME_7F04D16C /* 0822A8 7F04D778 02E02025 */ move $a0, $s7 /* 0822AC 7F04D77C 03C02825 */ move $a1, $fp /* 0822B0 7F04D780 27A60094 */ addiu $a2, $sp, 0x94 -/* 0822B4 7F04D784 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 0822B4 7F04D784 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 0822B8 7F04D788 27A70088 */ addiu $a3, $sp, 0x88 /* 0822BC 7F04D78C 10400074 */ beqz $v0, .L7F04D960 /* 0822C0 7F04D790 3C0D8003 */ lui $t5, %hi(D_80032088) @@ -32313,327 +30588,175 @@ glabel sub_GAME_7F04D16C #endif +bool sub_GAME_7F04D9B0(Model *model, ModelNode *nodearg, coord3d *arg2, coord3d *arg3, struct HitThing *hitthing, s32 *dstmtxindex, ModelNode **dstnode) +{ + coord3d spec; + coord3d spe0; + coord3d spd4; + Mtxf *spd0; + bool done; + ModelNode *node; + Vertex *vertices; + + spd0 = NULL; + done = FALSE; + node = nodearg; + vertices = NULL; + + while (node && !done) + { + u32 type = node->Opcode & 0xff; + Gfx *s3 = NULL; + void *s5 = NULL; + switch (type) + { + case MODELNODE_OPCODE_DLCOLLISION: + { + ModelRoData_DisplayList_CollisionRecord *rodata = &node->Data->DisplayListCollisions; + ModelRwData_DisplayList_CollisionRecord *rwdata = modelGetNodeRwData(model, node); + if (rwdata->gdl != NULL) + { + if (rwdata->gdl == rodata->Primary) + { + s3 = (Gfx *)((uintptr_t)rodata->BaseAddr + ((u32)rodata->Primary & 0xffffff)); + } + else + { + s3 = rwdata->gdl; + } -#ifdef NONMATCHING -void sub_GAME_7F04D9B0(void) { + if (rodata->Secondary != NULL) + { + s5 = (void *)((uintptr_t)rodata->BaseAddr + ((u32)rodata->Secondary & 0xffffff)); + } -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80052D98 -.word 0x46fffe00 /*32767.0*/ -/*D:80052D9C*/ -glabel jpt_80052D9C -.word loc_CODE_7F04DAA4 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word loc_CODE_7F04DAD8 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word loc_CODE_7F04DAEC -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word def_7F04DA40 -.word loc_CODE_7F04DB00 -.word loc_CODE_7F04DA48 + vertices = rwdata->Vertices; + } + } + break; + case MODELNODE_OPCODE_DL: + { + ModelRoData_DisplayListRecord *rodata = &node->Data->DisplayList; + if (rodata->Primary != NULL) + { + s3 = (Gfx *)((uintptr_t)rodata->BaseAddr + ((u32)rodata->Primary & 0xffffff)); -.text -glabel sub_GAME_7F04D9B0 -/* 0824E0 7F04D9B0 27BDFF08 */ addiu $sp, $sp, -0xf8 -/* 0824E4 7F04D9B4 AFBE0050 */ sw $fp, 0x50($sp) -/* 0824E8 7F04D9B8 AFB60048 */ sw $s6, 0x48($sp) -/* 0824EC 7F04D9BC AFB20038 */ sw $s2, 0x38($sp) -/* 0824F0 7F04D9C0 AFB00030 */ sw $s0, 0x30($sp) -/* 0824F4 7F04D9C4 00A09025 */ move $s2, $a1 -/* 0824F8 7F04D9C8 0080B025 */ move $s6, $a0 -/* 0824FC 7F04D9CC AFBF0054 */ sw $ra, 0x54($sp) -/* 082500 7F04D9D0 AFB7004C */ sw $s7, 0x4c($sp) -/* 082504 7F04D9D4 AFB50044 */ sw $s5, 0x44($sp) -/* 082508 7F04D9D8 AFB40040 */ sw $s4, 0x40($sp) -/* 08250C 7F04D9DC AFB3003C */ sw $s3, 0x3c($sp) -/* 082510 7F04D9E0 AFB10034 */ sw $s1, 0x34($sp) -/* 082514 7F04D9E4 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 082518 7F04D9E8 AFA60100 */ sw $a2, 0x100($sp) -/* 08251C 7F04D9EC AFA70104 */ sw $a3, 0x104($sp) -/* 082520 7F04D9F0 AFA000D0 */ sw $zero, 0xd0($sp) -/* 082524 7F04D9F4 AFA000CC */ sw $zero, 0xcc($sp) -/* 082528 7F04D9F8 00A08025 */ move $s0, $a1 -/* 08252C 7F04D9FC 10A0009F */ beqz $a1, .L7F04DC7C -/* 082530 7F04DA00 0000F025 */ move $fp, $zero -/* 082534 7F04DA04 3C018005 */ lui $at, %hi(D_80052D98) -/* 082538 7F04DA08 3C1700FF */ lui $s7, (0x00FFFFFF >> 16) # lui $s7, 0xff -/* 08253C 7F04DA0C 36F7FFFF */ ori $s7, (0x00FFFFFF & 0xFFFF) # ori $s7, $s7, 0xffff -/* 082540 7F04DA10 C4342D98 */ lwc1 $f20, %lo(D_80052D98)($at) -/* 082544 7F04DA14 96020000 */ lhu $v0, ($s0) -.L7F04DA18: -/* 082548 7F04DA18 00009825 */ move $s3, $zero -/* 08254C 7F04DA1C 0000A825 */ move $s5, $zero -/* 082550 7F04DA20 304E00FF */ andi $t6, $v0, 0xff -/* 082554 7F04DA24 25CFFFFC */ addiu $t7, $t6, -4 -/* 082558 7F04DA28 2DE10015 */ sltiu $at, $t7, 0x15 -/* 08255C 7F04DA2C 10200037 */ beqz $at, .L7F04DB0C -/* 082560 7F04DA30 000F7880 */ sll $t7, $t7, 2 -/* 082564 7F04DA34 3C018005 */ lui $at, %hi(jpt_80052D9C) -/* 082568 7F04DA38 002F0821 */ addu $at, $at, $t7 -/* 08256C 7F04DA3C 8C2F2D9C */ lw $t7, %lo(jpt_80052D9C)($at) -/* 082570 7F04DA40 01E00008 */ jr $t7 -/* 082574 7F04DA44 00000000 */ nop -loc_CODE_7F04DA48: -/* 082578 7F04DA48 8E110004 */ lw $s1, 4($s0) -/* 08257C 7F04DA4C 02C02025 */ move $a0, $s6 -/* 082580 7F04DA50 0FC1B1E7 */ jal modelGetNodeRwData -/* 082584 7F04DA54 02002825 */ move $a1, $s0 -/* 082588 7F04DA58 8C430004 */ lw $v1, 4($v0) -/* 08258C 7F04DA5C 1060002B */ beqz $v1, .L7F04DB0C -/* 082590 7F04DA60 00000000 */ nop -/* 082594 7F04DA64 8E240000 */ lw $a0, ($s1) -/* 082598 7F04DA68 00609825 */ move $s3, $v1 -/* 08259C 7F04DA6C 14830005 */ bne $a0, $v1, .L7F04DA84 -/* 0825A0 7F04DA70 00000000 */ nop -/* 0825A4 7F04DA74 8E38001C */ lw $t8, 0x1c($s1) -/* 0825A8 7F04DA78 0097C824 */ and $t9, $a0, $s7 -/* 0825AC 7F04DA7C 10000001 */ b .L7F04DA84 -/* 0825B0 7F04DA80 03199821 */ addu $s3, $t8, $t9 -.L7F04DA84: -/* 0825B4 7F04DA84 8E230004 */ lw $v1, 4($s1) -/* 0825B8 7F04DA88 10600004 */ beqz $v1, .L7F04DA9C -/* 0825BC 7F04DA8C 00000000 */ nop -/* 0825C0 7F04DA90 8E28001C */ lw $t0, 0x1c($s1) -/* 0825C4 7F04DA94 00774824 */ and $t1, $v1, $s7 -/* 0825C8 7F04DA98 0109A821 */ addu $s5, $t0, $t1 -.L7F04DA9C: -/* 0825CC 7F04DA9C 1000001B */ b .L7F04DB0C -/* 0825D0 7F04DAA0 8C5E0000 */ lw $fp, ($v0) -loc_CODE_7F04DAA4: -/* 0825D4 7F04DAA4 8E020004 */ lw $v0, 4($s0) -/* 0825D8 7F04DAA8 8C440000 */ lw $a0, ($v0) -/* 0825DC 7F04DAAC 10800017 */ beqz $a0, .L7F04DB0C -/* 0825E0 7F04DAB0 00000000 */ nop -/* 0825E4 7F04DAB4 8C450004 */ lw $a1, 4($v0) -/* 0825E8 7F04DAB8 8C430008 */ lw $v1, 8($v0) -/* 0825EC 7F04DABC 00975024 */ and $t2, $a0, $s7 -/* 0825F0 7F04DAC0 10A00003 */ beqz $a1, .L7F04DAD0 -/* 0825F4 7F04DAC4 006A9821 */ addu $s3, $v1, $t2 -/* 0825F8 7F04DAC8 00B75824 */ and $t3, $a1, $s7 -/* 0825FC 7F04DACC 006BA821 */ addu $s5, $v1, $t3 -.L7F04DAD0: -/* 082600 7F04DAD0 1000000E */ b .L7F04DB0C -/* 082604 7F04DAD4 0060F025 */ move $fp, $v1 -loc_CODE_7F04DAD8: -/* 082608 7F04DAD8 02C02025 */ move $a0, $s6 -/* 08260C 7F04DADC 0FC1BA5C */ jal sub_GAME_7F06E970 -/* 082610 7F04DAE0 02002825 */ move $a1, $s0 -/* 082614 7F04DAE4 10000009 */ b .L7F04DB0C -/* 082618 7F04DAE8 00000000 */ nop -loc_CODE_7F04DAEC: -/* 08261C 7F04DAEC 02C02025 */ move $a0, $s6 -/* 082620 7F04DAF0 0FC1BA6F */ jal process_12_handle_switch -/* 082624 7F04DAF4 02002825 */ move $a1, $s0 -/* 082628 7F04DAF8 10000004 */ b .L7F04DB0C -/* 08262C 7F04DAFC 00000000 */ nop -loc_CODE_7F04DB00: -/* 082630 7F04DB00 02C02025 */ move $a0, $s6 -/* 082634 7F04DB04 0FC1BA82 */ jal process_17_pointer_to_head -/* 082638 7F04DB08 02002825 */ move $a1, $s0 -def_7F04DA40: -.L7F04DB0C: -/* 08263C 7F04DB0C 12600043 */ beqz $s3, .L7F04DC1C -/* 082640 7F04DB10 02002025 */ move $a0, $s0 -/* 082644 7F04DB14 00002825 */ move $a1, $zero -/* 082648 7F04DB18 0FC1B15C */ jal sub_GAME_7F06C570 -/* 08264C 7F04DB1C 00008825 */ move $s1, $zero -/* 082650 7F04DB20 04400004 */ bltz $v0, .L7F04DB34 -/* 082654 7F04DB24 0040A025 */ move $s4, $v0 -/* 082658 7F04DB28 8ECC000C */ lw $t4, 0xc($s6) -/* 08265C 7F04DB2C 00026980 */ sll $t5, $v0, 6 -/* 082660 7F04DB30 018D8821 */ addu $s1, $t4, $t5 -.L7F04DB34: -/* 082664 7F04DB34 12200029 */ beqz $s1, .L7F04DBDC -/* 082668 7F04DB38 8FAE00D0 */ lw $t6, 0xd0($sp) -/* 08266C 7F04DB3C 122E0027 */ beq $s1, $t6, .L7F04DBDC -/* 082670 7F04DB40 02202025 */ move $a0, $s1 -/* 082674 7F04DB44 AFB100D0 */ sw $s1, 0xd0($sp) -/* 082678 7F04DB48 0FC167EE */ jal sub_GAME_7F059FB8 -/* 08267C 7F04DB4C 27A50064 */ addiu $a1, $sp, 0x64 -/* 082680 7F04DB50 8FAF0100 */ lw $t7, 0x100($sp) -/* 082684 7F04DB54 27A40064 */ addiu $a0, $sp, 0x64 -/* 082688 7F04DB58 27A500EC */ addiu $a1, $sp, 0xec -/* 08268C 7F04DB5C C5E40000 */ lwc1 $f4, ($t7) -/* 082690 7F04DB60 E7A400EC */ swc1 $f4, 0xec($sp) -/* 082694 7F04DB64 C5E60004 */ lwc1 $f6, 4($t7) -/* 082698 7F04DB68 E7A600F0 */ swc1 $f6, 0xf0($sp) -/* 08269C 7F04DB6C C5E80008 */ lwc1 $f8, 8($t7) -/* 0826A0 7F04DB70 0FC1611D */ jal matrix_4x4_transform_vector_in_place -/* 0826A4 7F04DB74 E7A800F4 */ swc1 $f8, 0xf4($sp) -/* 0826A8 7F04DB78 8FB80104 */ lw $t8, 0x104($sp) -/* 0826AC 7F04DB7C 27A40064 */ addiu $a0, $sp, 0x64 -/* 0826B0 7F04DB80 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 0826B4 7F04DB84 C70A0000 */ lwc1 $f10, ($t8) -/* 0826B8 7F04DB88 E7AA00D4 */ swc1 $f10, 0xd4($sp) -/* 0826BC 7F04DB8C C7100004 */ lwc1 $f16, 4($t8) -/* 0826C0 7F04DB90 E7B000D8 */ swc1 $f16, 0xd8($sp) -/* 0826C4 7F04DB94 C7120008 */ lwc1 $f18, 8($t8) -/* 0826C8 7F04DB98 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place -/* 0826CC 7F04DB9C E7B200DC */ swc1 $f18, 0xdc($sp) -/* 0826D0 7F04DBA0 C7A400D4 */ lwc1 $f4, 0xd4($sp) -/* 0826D4 7F04DBA4 C7A800EC */ lwc1 $f8, 0xec($sp) -/* 0826D8 7F04DBA8 C7B000D8 */ lwc1 $f16, 0xd8($sp) -/* 0826DC 7F04DBAC 46142182 */ mul.s $f6, $f4, $f20 -/* 0826E0 7F04DBB0 C7A400F0 */ lwc1 $f4, 0xf0($sp) -/* 0826E4 7F04DBB4 46148482 */ mul.s $f18, $f16, $f20 -/* 0826E8 7F04DBB8 C7B000F4 */ lwc1 $f16, 0xf4($sp) -/* 0826EC 7F04DBBC 46083280 */ add.s $f10, $f6, $f8 -/* 0826F0 7F04DBC0 C7A800DC */ lwc1 $f8, 0xdc($sp) -/* 0826F4 7F04DBC4 46049180 */ add.s $f6, $f18, $f4 -/* 0826F8 7F04DBC8 E7AA00E0 */ swc1 $f10, 0xe0($sp) -/* 0826FC 7F04DBCC 46144282 */ mul.s $f10, $f8, $f20 -/* 082700 7F04DBD0 E7A600E4 */ swc1 $f6, 0xe4($sp) -/* 082704 7F04DBD4 46105480 */ add.s $f18, $f10, $f16 -/* 082708 7F04DBD8 E7B200E8 */ swc1 $f18, 0xe8($sp) -.L7F04DBDC: -/* 08270C 7F04DBDC 8FB90108 */ lw $t9, 0x108($sp) -/* 082710 7F04DBE0 27A400EC */ addiu $a0, $sp, 0xec -/* 082714 7F04DBE4 27A500E0 */ addiu $a1, $sp, 0xe0 -/* 082718 7F04DBE8 27A600D4 */ addiu $a2, $sp, 0xd4 -/* 08271C 7F04DBEC 02603825 */ move $a3, $s3 -/* 082720 7F04DBF0 AFB50010 */ sw $s5, 0x10($sp) -/* 082724 7F04DBF4 AFBE0014 */ sw $fp, 0x14($sp) -/* 082728 7F04DBF8 0FC1345B */ jal sub_GAME_7F04D16C -/* 08272C 7F04DBFC AFB90018 */ sw $t9, 0x18($sp) -/* 082730 7F04DC00 10400006 */ beqz $v0, .L7F04DC1C -/* 082734 7F04DC04 8FA8010C */ lw $t0, 0x10c($sp) -/* 082738 7F04DC08 AD140000 */ sw $s4, ($t0) -/* 08273C 7F04DC0C 8FA90110 */ lw $t1, 0x110($sp) -/* 082740 7F04DC10 240A0001 */ li $t2, 1 -/* 082744 7F04DC14 AD300000 */ sw $s0, ($t1) -/* 082748 7F04DC18 AFAA00CC */ sw $t2, 0xcc($sp) -.L7F04DC1C: -/* 08274C 7F04DC1C 8E020014 */ lw $v0, 0x14($s0) -/* 082750 7F04DC20 8FAB00CC */ lw $t3, 0xcc($sp) -/* 082754 7F04DC24 10400003 */ beqz $v0, .L7F04DC34 -/* 082758 7F04DC28 00000000 */ nop -/* 08275C 7F04DC2C 1000000F */ b .L7F04DC6C -/* 082760 7F04DC30 00408025 */ move $s0, $v0 -.L7F04DC34: -/* 082764 7F04DC34 1200000D */ beqz $s0, .L7F04DC6C -/* 082768 7F04DC38 00000000 */ nop -.L7F04DC3C: -/* 08276C 7F04DC3C 56120004 */ bnel $s0, $s2, .L7F04DC50 -/* 082770 7F04DC40 8E02000C */ lw $v0, 0xc($s0) -/* 082774 7F04DC44 10000009 */ b .L7F04DC6C -/* 082778 7F04DC48 00008025 */ move $s0, $zero -/* 08277C 7F04DC4C 8E02000C */ lw $v0, 0xc($s0) -.L7F04DC50: -/* 082780 7F04DC50 50400004 */ beql $v0, $zero, .L7F04DC64 -/* 082784 7F04DC54 8E100008 */ lw $s0, 8($s0) -/* 082788 7F04DC58 10000004 */ b .L7F04DC6C -/* 08278C 7F04DC5C 00408025 */ move $s0, $v0 -/* 082790 7F04DC60 8E100008 */ lw $s0, 8($s0) -.L7F04DC64: -/* 082794 7F04DC64 1600FFF5 */ bnez $s0, .L7F04DC3C -/* 082798 7F04DC68 00000000 */ nop -.L7F04DC6C: -/* 08279C 7F04DC6C 52000004 */ beql $s0, $zero, .L7F04DC80 -/* 0827A0 7F04DC70 8FBF0054 */ lw $ra, 0x54($sp) -/* 0827A4 7F04DC74 5160FF68 */ beql $t3, $zero, .L7F04DA18 -/* 0827A8 7F04DC78 96020000 */ lhu $v0, ($s0) -.L7F04DC7C: -/* 0827AC 7F04DC7C 8FBF0054 */ lw $ra, 0x54($sp) -.L7F04DC80: -/* 0827B0 7F04DC80 8FA200CC */ lw $v0, 0xcc($sp) -/* 0827B4 7F04DC84 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 0827B8 7F04DC88 8FB00030 */ lw $s0, 0x30($sp) -/* 0827BC 7F04DC8C 8FB10034 */ lw $s1, 0x34($sp) -/* 0827C0 7F04DC90 8FB20038 */ lw $s2, 0x38($sp) -/* 0827C4 7F04DC94 8FB3003C */ lw $s3, 0x3c($sp) -/* 0827C8 7F04DC98 8FB40040 */ lw $s4, 0x40($sp) -/* 0827CC 7F04DC9C 8FB50044 */ lw $s5, 0x44($sp) -/* 0827D0 7F04DCA0 8FB60048 */ lw $s6, 0x48($sp) -/* 0827D4 7F04DCA4 8FB7004C */ lw $s7, 0x4c($sp) -/* 0827D8 7F04DCA8 8FBE0050 */ lw $fp, 0x50($sp) -/* 0827DC 7F04DCAC 03E00008 */ jr $ra -/* 0827E0 7F04DCB0 27BD00F8 */ addiu $sp, $sp, 0xf8 -) -#endif + if (rodata->Secondary != NULL) + { + s5 = (Gfx *)((uintptr_t)rodata->BaseAddr + ((u32)rodata->Secondary & 0xffffff)); + } + vertices = (void *)(uintptr_t)rodata->BaseAddr; + } + } + break; + case MODELNODE_OPCODE_LOD: + modelApplyDistanceRelations(model, node); + break; + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(model, node); + break; + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); + break; + } -#ifdef NONMATCHING -void sub_GAME_7F04DCB4(void) { + if (s3 != NULL) + { + s32 mtxindex = modelFindNodeMtxIndex(node, 0); + Mtxf *mtx = NULL; + Mtxf sp64; -} -#else -GLOBAL_ASM( + if (mtxindex >= 0) + { + mtx = (Mtxf *)&model->render_pos[mtxindex]; // TODO: adjust + } + if (mtx && mtx != spd0) + { + spd0 = mtx; -.text -glabel sub_GAME_7F04DCB4 -/* 0827E4 7F04DCB4 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 0827E8 7F04DCB8 AFBF0034 */ sw $ra, 0x34($sp) -/* 0827EC 7F04DCBC AFB00030 */ sw $s0, 0x30($sp) -/* 0827F0 7F04DCC0 8C8E0010 */ lw $t6, 0x10($a0) -/* 0827F4 7F04DCC4 00808025 */ move $s0, $a0 -/* 0827F8 7F04DCC8 0FC1001E */ jal sub_GAME_7F040078 -/* 0827FC 7F04DCCC AFAE003C */ sw $t6, 0x3c($sp) -/* 082800 7F04DCD0 8FA4003C */ lw $a0, 0x3c($sp) -/* 082804 7F04DCD4 00002825 */ move $a1, $zero -/* 082808 7F04DCD8 0FC28333 */ jal sub_GAME_7F0A0CCC -/* 08280C 7F04DCDC AFA20038 */ sw $v0, 0x38($sp) -/* 082810 7F04DCE0 8FA4003C */ lw $a0, 0x3c($sp) -/* 082814 7F04DCE4 0FC28333 */ jal sub_GAME_7F0A0CCC -/* 082818 7F04DCE8 24050001 */ li $a1, 1 -/* 08281C 7F04DCEC 8FA30038 */ lw $v1, 0x38($sp) -/* 082820 7F04DCF0 26040058 */ addiu $a0, $s0, 0x58 -/* 082824 7F04DCF4 26050018 */ addiu $a1, $s0, 0x18 -/* 082828 7F04DCF8 C4640004 */ lwc1 $f4, 4($v1) -/* 08282C 7F04DCFC 26060028 */ addiu $a2, $s0, 0x28 -/* 082830 7F04DD00 26070038 */ addiu $a3, $s0, 0x38 -/* 082834 7F04DD04 E7A40010 */ swc1 $f4, 0x10($sp) -/* 082838 7F04DD08 C4660008 */ lwc1 $f6, 8($v1) -/* 08283C 7F04DD0C E7A60014 */ swc1 $f6, 0x14($sp) -/* 082840 7F04DD10 C468000C */ lwc1 $f8, 0xc($v1) -/* 082844 7F04DD14 E7A80018 */ swc1 $f8, 0x18($sp) -/* 082848 7F04DD18 C46A0010 */ lwc1 $f10, 0x10($v1) -/* 08284C 7F04DD1C E7AA001C */ swc1 $f10, 0x1c($sp) -/* 082850 7F04DD20 C4700014 */ lwc1 $f16, 0x14($v1) -/* 082854 7F04DD24 E7B00020 */ swc1 $f16, 0x20($sp) -/* 082858 7F04DD28 C4720018 */ lwc1 $f18, 0x18($v1) -/* 08285C 7F04DD2C 0FC28768 */ jal sub_GAME_7F0A1DA0 -/* 082860 7F04DD30 E7B20024 */ swc1 $f18, 0x24($sp) -/* 082864 7F04DD34 8E0F0064 */ lw $t7, 0x64($s0) -/* 082868 7F04DD38 92190002 */ lbu $t9, 2($s0) -/* 08286C 7F04DD3C 44802000 */ mtc1 $zero, $f4 -/* 082870 7F04DD40 35F80004 */ ori $t8, $t7, 4 -/* 082874 7F04DD44 37280080 */ ori $t0, $t9, 0x80 -/* 082878 7F04DD48 AE180064 */ sw $t8, 0x64($s0) -/* 08287C 7F04DD4C A2080002 */ sb $t0, 2($s0) -/* 082880 7F04DD50 E6040070 */ swc1 $f4, 0x70($s0) -/* 082884 7F04DD54 8FBF0034 */ lw $ra, 0x34($sp) -/* 082888 7F04DD58 8FB00030 */ lw $s0, 0x30($sp) -/* 08288C 7F04DD5C 27BD0040 */ addiu $sp, $sp, 0x40 -/* 082890 7F04DD60 03E00008 */ jr $ra -/* 082894 7F04DD64 00000000 */ nop -) -#endif + sub_GAME_7F059FB8(mtx->m, sp64.m); + + spec.x = arg2->x; + spec.y = arg2->y; + spec.z = arg2->z; + mtx4TransformVecInPlace(&sp64, &spec); + spd4.x = arg3->x; + spd4.y = arg3->y; + spd4.z = arg3->z; + + mtx4RotateVecInPlace(&sp64, &spd4); + + spe0.x = spd4.x * 32767.0f + spec.x; + spe0.y = spd4.y * 32767.0f + spec.y; + spe0.z = spd4.z * 32767.0f + spec.z; + } + + if (bgTestHitOnObj(&spec, &spe0, &spd4, s3, s5, vertices, hitthing)) + { + *dstmtxindex = mtxindex; + *dstnode = node; + done = TRUE; + } + } + if (node->Child) + { + node = node->Child; + } else { + while (node) + { + if (node == nodearg) + { + node = NULL; + break; + } + + if (node->Next) + { + node = node->Next; + break; + } + + node = node->Parent; + } + } + } + + return done; +} + + +void sub_GAME_7F04DCB4(ObjectRecord* obj) +{ + PropRecord* prop; + struct ModelRoData_BoundingBoxRecord *bbox; + + prop = obj->prop; + bbox = chrobjGetBboxFromObjectRecord(obj); + sub_GAME_7F0A0CCC(prop, FALSE); + sub_GAME_7F0A0CCC(prop, TRUE); + + sub_GAME_7F0A1DA0(&obj->runtime_pos.f[0], + &obj->mtx.m[0][0], &obj->mtx.m[1][0], &obj->mtx.m[2][0], + bbox->Bounds.xmin, bbox->Bounds.xmax, + bbox->Bounds.ymin, bbox->Bounds.ymax, + bbox->Bounds.zmin, bbox->Bounds.zmax); + + obj->runtime_bitflags |= RUNTIMEBITFLAG_REMOVE; + obj->state |= PROPSTATE_DESTROYED; + obj->maxdamage = 0.0f; +} #ifdef NONMATCHING @@ -32719,7 +30842,7 @@ glabel sub_GAME_7F04DE18 /* 082980 7F04DE50 8C490008 */ lw $t1, 8($v0) /* 082984 7F04DE54 8C450004 */ lw $a1, 4($v0) /* 082988 7F04DE58 8D230004 */ lw $v1, 4($t1) -/* 08298C 7F04DE5C 0FC1B198 */ jal sub_GAME_7F06C660 +/* 08298C 7F04DE5C 0FC1B198 */ jal modelFindNodeMtx /* 082990 7F04DE60 AFA30088 */ sw $v1, 0x88($sp) /* 082994 7F04DE64 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 082998 7F04DE68 AFA20084 */ sw $v0, 0x84($sp) @@ -32770,28 +30893,28 @@ glabel sub_GAME_7F04DE18 /** * Address 0x7F04DEFC. */ -void sub_GAME_7F04DEFC(PropRecord *arg0, f32 arg1, struct coord3d *arg2, s32 arg3, s32 owner) +void maybe_detonate_object_and_its_children(PropRecord *prop, f32 damage, struct coord3d *pos, s32 arg3, s32 owner) { PropRecord *node; ObjectRecord *prop_obj; - prop_obj = arg0->obj; + prop_obj = prop->obj; prop_obj->runtime_bitflags &= ~(RUNTIMEBITFLAG_OWNER); prop_obj->runtime_bitflags |= (owner << RUNTIMEBITSHIFT_OWNER); if ((s32)(prop_obj->runtime_bitflags << 0xc) >= 0) { - node = arg0->child; + node = prop->child; while (node != NULL) { PropRecord *iter_next = node->prev; // recursive call: - sub_GAME_7F04DEFC(node, arg1, arg2, arg3, owner); + maybe_detonate_object_and_its_children(node, damage, pos, arg3, owner); node = iter_next; } - maybe_detonate_object(arg0->obj, arg1, arg2, arg3, owner); + maybe_detonate_object(prop->obj, damage, pos, arg3, owner); } } @@ -32826,7 +30949,7 @@ bool check_if_destroyable_object_type(PropDefHeaderRecord *obj)//#MATCH } -bool check_if_collectable_object(PropDefHeaderRecord *obj)//#MATCH +bool objIsCollectable(PropDefHeaderRecord *obj) { switch (obj->type) { @@ -32843,92 +30966,35 @@ bool check_if_collectable_object(PropDefHeaderRecord *obj)//#MATCH } - - - - -#ifdef NONMATCHING -bool check_if_destroyable_not_invincible(ObjectRecord *obj) { +bool objIsMortal(ObjectRecord* obj) +{ if (obj->type == PROPDEF_DOOR) { return FALSE; } - - if (check_if_collectable_object(obj) && obj->type != 21) + if ((objIsCollectable((PropDefHeaderRecord* ) obj) != 0) && (obj->type != PROPDEF_ARMOUR)) { - // Can't get this one right - // 82bc0: bltzl t9,0x82bec | 82bc0: beqzl t9,0x82bec - if ((obj->flags << 0xf) != 0) + if (!(obj->flags & PROPFLAG_FORCEMORTAL)) { return FALSE; } } - // Can't get this one right - // 82bd8: bgezl t1,0x82bec | 82bd8: bnezl t1,0x82bec - else if ((obj->flags << 0xe) == 0) + else if (obj->flags & PROPFLAG_INVINCIBLE) { return FALSE; } - return TRUE; } -#else -GLOBAL_ASM( -.text -glabel check_if_destroyable_not_invincible -/* 082B78 7F04E048 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 082B7C 7F04E04C AFBF0014 */ sw $ra, 0x14($sp) -/* 082B80 7F04E050 908E0003 */ lbu $t6, 3($a0) -/* 082B84 7F04E054 24010001 */ li $at, 1 -/* 082B88 7F04E058 15C10003 */ bne $t6, $at, .L7F04E068 -/* 082B8C 7F04E05C 00000000 */ nop -/* 082B90 7F04E060 10000016 */ b .L7F04E0BC -/* 082B94 7F04E064 00001025 */ move $v0, $zero -.L7F04E068: -/* 082B98 7F04E068 0FC13803 */ jal check_if_collectable_object -/* 082B9C 7F04E06C AFA40018 */ sw $a0, 0x18($sp) -/* 082BA0 7F04E070 1040000B */ beqz $v0, .L7F04E0A0 -/* 082BA4 7F04E074 8FA40018 */ lw $a0, 0x18($sp) -/* 082BA8 7F04E078 908F0003 */ lbu $t7, 3($a0) -/* 082BAC 7F04E07C 24010015 */ li $at, 21 -/* 082BB0 7F04E080 51E10008 */ beql $t7, $at, .L7F04E0A4 -/* 082BB4 7F04E084 8C880008 */ lw $t0, 8($a0) -/* 082BB8 7F04E088 8C980008 */ lw $t8, 8($a0) -/* 082BBC 7F04E08C 0018CBC0 */ sll $t9, $t8, 0xf -/* 082BC0 7F04E090 0722000A */ bltzl $t9, .L7F04E0BC -/* 082BC4 7F04E094 24020001 */ li $v0, 1 -/* 082BC8 7F04E098 10000008 */ b .L7F04E0BC -/* 082BCC 7F04E09C 00001025 */ move $v0, $zero -.L7F04E0A0: -/* 082BD0 7F04E0A0 8C880008 */ lw $t0, 8($a0) -.L7F04E0A4: -/* 082BD4 7F04E0A4 00084B80 */ sll $t1, $t0, 0xe -/* 082BD8 7F04E0A8 05230004 */ bgezl $t1, .L7F04E0BC -/* 082BDC 7F04E0AC 24020001 */ li $v0, 1 -/* 082BE0 7F04E0B0 10000002 */ b .L7F04E0BC -/* 082BE4 7F04E0B4 00001025 */ move $v0, $zero -/* 082BE8 7F04E0B8 24020001 */ li $v0, 1 -.L7F04E0BC: -/* 082BEC 7F04E0BC 8FBF0014 */ lw $ra, 0x14($sp) -/* 082BF0 7F04E0C0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 082BF4 7F04E0C4 03E00008 */ jr $ra -/* 082BF8 7F04E0C8 00000000 */ nop -) -#endif - - - - /** * Address 0x7F04E0CC. */ -void chrobjMaybeDetonateObjectIfFlags(ObjectRecord *arg0, f32 arg1, coord3d *arg2, ITEM_IDS item, s32 arg4) +void chrobjMaybeDetonateObjectIfFlags(ObjectRecord *obj, f32 damage, coord3d *pos, ITEM_IDS item, s32 owner) { - if ((arg0->flags2 & 0x4000) == 0) + if ((obj->flags2 & 0x4000) == 0) { - maybe_detonate_object(arg0, arg1, arg2, item, arg4); + maybe_detonate_object(obj, damage, pos, item, owner); } } @@ -32937,6 +31003,31 @@ void chrobjMaybeDetonateObjectIfFlags(ObjectRecord *arg0, f32 arg1, coord3d *arg #ifdef NONMATCHING //https://decomp.me/scratch/UWQzo 44% +ObjectRecord blank_07_object = { + 0x0100, //extrascale + 0x0, //state + 0x07, //type + 0, //obj + 0xFFFF, //pad + 0x00000001, //flags + 0, //flags2 + NULL, //prop + NULL, //model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + {0.0, 0.0, 0.0},//runtime_pos + {0x00000000}, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f, //damage + {0xFF, 0xFF, 0xFF, 0x00}, //shadecol + {0xFF, 0xFF, 0xFF, 0x00}, //nextcol +}; void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool flag, bool flag2) { u32 spC8; @@ -33013,16 +31104,16 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f #define OBJECT_DESTROYED 0 - temp_t7 = self->runtime_bitflags & 0xFFF9FFFF; + temp_t7 = self->runtime_bitflags & ~(RUNTIMEBITFLAG_OWNER); self->runtime_bitflags = temp_t7; - self->runtime_bitflags = temp_t7 | (flag2 << 0x11); + self->runtime_bitflags = temp_t7 | (flag2 << RUNTIMEBITSHIFT_OWNER); - if ((self->Head.type != PROPDEF_GAS_RELEASING) || (do_something_if_object_destroyed(self) != OBJECT_UNTOUCHED)) + if ((self->Head.type != PROPDEF_GAS_RELEASING) || (objGetDestroyedLevel(self) != OBJECT_UNTOUCHED)) { if (!flag) { - if (check_if_collectable_object(self)) + if (objIsCollectable(self)) { if (self->flags << 8 >= 0) { @@ -33079,20 +31170,20 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f return; } } - if (!check_if_destroyable_not_invincible(damage, self, 8) ) + if (!objIsMortal(damage, self, 8) ) { return; } } // if flag - if (do_something_if_object_destroyed(self) == OBJECT_DESTROYED) + if (objGetDestroyedLevel(self) == OBJECT_DESTROYED) { self->maxdamage += damage * 250.0f; } else { - temp_f0 = 4 - (sub_GAME_7F03FF60(damage, self) % 4); + temp_f0 = 4 - (objGetShotsTaken(damage, self) % 4); phi_f0 = temp_f0; if (temp_f0 < damage) { @@ -33119,7 +31210,7 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f propobjSetDropped(self->prop, 1); object_explosion_related(self, pos, flag2); } - if ((self->Head.type == PROPDEF_AMMO) && (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED)) + if ((self->Head.type == PROPDEF_AMMO) && (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED)) { randAmmoType = randomGetNext() % 0xD; do @@ -33129,7 +31220,7 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f if (ammoAmmount > 0 && (ammoAmmount != -1) ) { - temp_v0_5 = sub_GAME_7F0518D0(randAmmoType, randAmmoType); + temp_v0_5 = ammocrateAllocate(randAmmoType, randAmmoType); if (temp_v0_5) { //spawn magazine @@ -33142,7 +31233,7 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f { //temp_v0_5->unk80 = 1; } - if (sub_GAME_7F0406F8(&temp_a2, *(PitemZ_entries + (temp_a3 * 0xC)), &temp_a2, temp_a3) != 0) + if (objInitWithModelDef(&temp_a2, *(PitemZ_entries + (temp_a3 * 0xC)), &temp_a2, temp_a3) != 0) { //temp_a0 = temp_a2->unk14; @@ -33168,28 +31259,28 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f case 13: { self->flags |= 0x40000000; - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { self->flags |= 0x10000000; } } case 6: { - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { self->flags |= 0x10000000; } } case 10: { - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { //save_ptr_monitor_ani_code_to_obj_ani_slot(self + 0x80, &D_80031EE8); } } case 11: { - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { //save_ptr_monitor_ani_code_to_obj_ani_slot(self + 0x80, &D_80031EE8); // save_ptr_monitor_ani_code_to_obj_ani_slot(self + 0xF4, &D_80031EE8); @@ -33199,14 +31290,14 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f } case 36: { - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { //init_trigger_toxic_gas_effect(&self->Pos); } } case 21: { - if (do_something_if_object_destroyed(self) == OBJECT_DESTROYED) + if (objGetDestroyedLevel(self) == OBJECT_DESTROYED) { temp_f0_2 = self->damage; //self->unk84 = ((bitwise f32) self->unk80 * (temp_f0_2 - self->maxdamage)) / temp_f0_2; @@ -33217,7 +31308,7 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f } } } - if (do_something_if_object_destroyed(self) == OBJECT_UNTOUCHED) + if (objGetDestroyedLevel(self) == OBJECT_UNTOUCHED) { PropRecord *temp_a0_2 = self->prop->child; @@ -33236,6 +31327,31 @@ void maybe_detonate_object(ObjectRecord* self, f32 damage, coord3d* pos, bool f } #else +ObjectRecord blank_07_object = { + 0x0100, //extrascale + 0x0, //state + 0x07, //type + 0, //obj + 0xFFFF, //pad + 0x00000001, //flags + 0, //flags2 + NULL, //prop + NULL, //model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + {0.0, 0.0, 0.0},//runtime_pos + {0x00000000}, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f, //damage + {0xFF, 0xFF, 0xFF, 0x00}, //shadecol + {0xFF, 0xFF, 0xFF, 0x00}, //nextcol +}; GLOBAL_ASM( .text glabel maybe_detonate_object @@ -33258,7 +31374,7 @@ glabel maybe_detonate_object /* 082C78 7F04E148 00808025 */ move $s0, $a0 /* 082C7C 7F04E14C 15610006 */ bne $t3, $at, .L7F04E168 /* 082C80 7F04E150 AC8A0064 */ sw $t2, 0x64($a0) -/* 082C84 7F04E154 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 082C84 7F04E154 0FC0FFF0 */ jal objGetDestroyedLevel /* 082C88 7F04E158 E7AC00E4 */ swc1 $f12, 0xe4($sp) /* 082C8C 7F04E15C 24010001 */ li $at, 1 /* 082C90 7F04E160 1041016A */ beq $v0, $at, .L7F04E70C @@ -33268,7 +31384,7 @@ glabel maybe_detonate_object /* 082C9C 7F04E16C 02002025 */ move $a0, $s0 /* 082CA0 7F04E170 55800012 */ bnezl $t4, .L7F04E1BC /* 082CA4 7F04E174 8E030008 */ lw $v1, 8($s0) -/* 082CA8 7F04E178 0FC13803 */ jal check_if_collectable_object +/* 082CA8 7F04E178 0FC13803 */ jal objIsCollectable /* 082CAC 7F04E17C E7AC00E4 */ swc1 $f12, 0xe4($sp) /* 082CB0 7F04E180 10400007 */ beqz $v0, .L7F04E1A0 /* 082CB4 7F04E184 C7AC00E4 */ lwc1 $f12, 0xe4($sp) @@ -33346,13 +31462,13 @@ glabel maybe_detonate_object /* 082DBC 7F04E28C AE090008 */ sw $t1, 8($s0) /* 082DC0 7F04E290 02002025 */ move $a0, $s0 .L7F04E294: -/* 082DC4 7F04E294 0FC13812 */ jal check_if_destroyable_not_invincible +/* 082DC4 7F04E294 0FC13812 */ jal objIsMortal /* 082DC8 7F04E298 E7AC00E4 */ swc1 $f12, 0xe4($sp) /* 082DCC 7F04E29C 1040011B */ beqz $v0, .L7F04E70C /* 082DD0 7F04E2A0 C7AC00E4 */ lwc1 $f12, 0xe4($sp) /* 082DD4 7F04E2A4 02002025 */ move $a0, $s0 .L7F04E2A8: -/* 082DD8 7F04E2A8 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 082DD8 7F04E2A8 0FC0FFF0 */ jal objGetDestroyedLevel /* 082DDC 7F04E2AC E7AC00E4 */ swc1 $f12, 0xe4($sp) /* 082DE0 7F04E2B0 14400008 */ bnez $v0, .L7F04E2D4 /* 082DE4 7F04E2B4 C7AC00E4 */ lwc1 $f12, 0xe4($sp) @@ -33365,7 +31481,7 @@ glabel maybe_detonate_object /* 082E00 7F04E2D0 E60A0070 */ swc1 $f10, 0x70($s0) .L7F04E2D4: /* 082E04 7F04E2D4 02002025 */ move $a0, $s0 -/* 082E08 7F04E2D8 0FC0FFD8 */ jal sub_GAME_7F03FF60 +/* 082E08 7F04E2D8 0FC0FFD8 */ jal objGetShotsTaken /* 082E0C 7F04E2DC E7AC00E4 */ swc1 $f12, 0xe4($sp) /* 082E10 7F04E2E0 240B0004 */ li $t3, 4 /* 082E14 7F04E2E4 C7AC00E4 */ lwc1 $f12, 0xe4($sp) @@ -33429,7 +31545,7 @@ glabel maybe_detonate_object .L7F04E3AC: /* 082EDC 7F04E3AC 54410065 */ bnel $v0, $at, .L7F04E544 /* 082EE0 7F04E3B0 92020003 */ lbu $v0, 3($s0) -/* 082EE4 7F04E3B4 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 082EE4 7F04E3B4 0FC0FFF0 */ jal objGetDestroyedLevel /* 082EE8 7F04E3B8 02002025 */ move $a0, $s0 /* 082EEC 7F04E3BC 24010001 */ li $at, 1 /* 082EF0 7F04E3C0 54410060 */ bnel $v0, $at, .L7F04E544 @@ -33453,7 +31569,7 @@ glabel maybe_detonate_object /* 082F34 7F04E404 24840001 */ addiu $a0, $a0, 1 /* 082F38 7F04E408 AFA30024 */ sw $v1, 0x24($sp) /* 082F3C 7F04E40C AFA400C4 */ sw $a0, 0xc4($sp) -/* 082F40 7F04E410 0FC14634 */ jal sub_GAME_7F0518D0 +/* 082F40 7F04E410 0FC14634 */ jal ammocrateAllocate /* 082F44 7F04E414 AFA500C8 */ sw $a1, 0xc8($sp) /* 082F48 7F04E418 8FA30024 */ lw $v1, 0x24($sp) /* 082F4C 7F04E41C 8FA400C4 */ lw $a0, 0xc4($sp) @@ -33512,7 +31628,7 @@ glabel maybe_detonate_object /* 083014 7F04E4E4 3C058004 */ lui $a1, %hi(PitemZ_entries) /* 083018 7F04E4E8 00B82821 */ addu $a1, $a1, $t8 /* 08301C 7F04E4EC 8CA5A228 */ lw $a1, %lo(PitemZ_entries)($a1) -/* 083020 7F04E4F0 0FC101BE */ jal sub_GAME_7F0406F8 +/* 083020 7F04E4F0 0FC101BE */ jal objInitWithModelDef /* 083024 7F04E4F4 AFA600C0 */ sw $a2, 0xc0($sp) /* 083028 7F04E4F8 10400011 */ beqz $v0, .L7F04E540 /* 08302C 7F04E4FC 8FA600C0 */ lw $a2, 0xc0($sp) @@ -33544,7 +31660,7 @@ glabel maybe_detonate_object /* 083084 7F04E554 3C014000 */ lui $at, 0x4000 /* 083088 7F04E558 02002025 */ move $a0, $s0 /* 08308C 7F04E55C 03215825 */ or $t3, $t9, $at -/* 083090 7F04E560 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 083090 7F04E560 0FC0FFF0 */ jal objGetDestroyedLevel /* 083094 7F04E564 AE0B0008 */ sw $t3, 8($s0) /* 083098 7F04E568 24010001 */ li $at, 1 /* 08309C 7F04E56C 14410057 */ bne $v0, $at, .L7F04E6CC @@ -33558,7 +31674,7 @@ glabel maybe_detonate_object .L7F04E58C: /* 0830BC 7F04E58C 5441000C */ bnel $v0, $at, .L7F04E5C0 /* 0830C0 7F04E590 2401000A */ li $at, 10 -/* 0830C4 7F04E594 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0830C4 7F04E594 0FC0FFF0 */ jal objGetDestroyedLevel /* 0830C8 7F04E598 02002025 */ move $a0, $s0 /* 0830CC 7F04E59C 24010001 */ li $at, 1 /* 0830D0 7F04E5A0 1441004A */ bne $v0, $at, .L7F04E6CC @@ -33572,7 +31688,7 @@ glabel maybe_detonate_object .L7F04E5C0: /* 0830F0 7F04E5C0 5441000C */ bnel $v0, $at, .L7F04E5F4 /* 0830F4 7F04E5C4 2401000B */ li $at, 11 -/* 0830F8 7F04E5C8 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0830F8 7F04E5C8 0FC0FFF0 */ jal objGetDestroyedLevel /* 0830FC 7F04E5CC 02002025 */ move $a0, $s0 /* 083100 7F04E5D0 24010001 */ li $at, 1 /* 083104 7F04E5D4 1441003D */ bne $v0, $at, .L7F04E6CC @@ -33586,7 +31702,7 @@ glabel maybe_detonate_object .L7F04E5F4: /* 083124 7F04E5F4 54410018 */ bnel $v0, $at, .L7F04E658 /* 083128 7F04E5F8 24010024 */ li $at, 36 -/* 08312C 7F04E5FC 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 08312C 7F04E5FC 0FC0FFF0 */ jal objGetDestroyedLevel /* 083130 7F04E600 02002025 */ move $a0, $s0 /* 083134 7F04E604 24010001 */ li $at, 1 /* 083138 7F04E608 14410030 */ bne $v0, $at, .L7F04E6CC @@ -33612,7 +31728,7 @@ glabel maybe_detonate_object .L7F04E658: /* 083188 7F04E658 5441000B */ bnel $v0, $at, .L7F04E688 /* 08318C 7F04E65C 24010015 */ li $at, 21 -/* 083190 7F04E660 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 083190 7F04E660 0FC0FFF0 */ jal objGetDestroyedLevel /* 083194 7F04E664 02002025 */ move $a0, $s0 /* 083198 7F04E668 24010001 */ li $at, 1 /* 08319C 7F04E66C 14410017 */ bne $v0, $at, .L7F04E6CC @@ -33625,7 +31741,7 @@ glabel maybe_detonate_object .L7F04E688: /* 0831B8 7F04E688 14410010 */ bne $v0, $at, .L7F04E6CC /* 0831BC 7F04E68C 00000000 */ nop -/* 0831C0 7F04E690 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0831C0 7F04E690 0FC0FFF0 */ jal objGetDestroyedLevel /* 0831C4 7F04E694 02002025 */ move $a0, $s0 /* 0831C8 7F04E698 5440000A */ bnezl $v0, .L7F04E6C4 /* 0831CC 7F04E69C 44804000 */ mtc1 $zero, $f8 @@ -33642,7 +31758,7 @@ glabel maybe_detonate_object /* 0831F4 7F04E6C4 00000000 */ nop /* 0831F8 7F04E6C8 E6080084 */ swc1 $f8, 0x84($s0) .L7F04E6CC: -/* 0831FC 7F04E6CC 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0831FC 7F04E6CC 0FC0FFF0 */ jal objGetDestroyedLevel /* 083200 7F04E6D0 02002025 */ move $a0, $s0 /* 083204 7F04E6D4 24010001 */ li $at, 1 /* 083208 7F04E6D8 5441000D */ bnel $v0, $at, .L7F04E710 @@ -33674,10 +31790,11 @@ glabel maybe_detonate_object #ifdef NONMATCHING -void sub_GAME_7F04E720(void) { +void sub_GAME_7F04E720(PropRecord* prop, struct ShotData* shotdata) { } #else +void sub_GAME_7F04E720(PropRecord*, struct ShotData*); GLOBAL_ASM( .text glabel sub_GAME_7F04E720 @@ -33793,7 +31910,7 @@ glabel sub_GAME_7F04E720 /* 0833E4 7F04E8B4 018E2021 */ addu $a0, $t4, $t6 /* 0833E8 7F04E8B8 E7A40068 */ swc1 $f4, 0x68($sp) /* 0833EC 7F04E8BC E7A6006C */ swc1 $f6, 0x6c($sp) -/* 0833F0 7F04E8C0 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 0833F0 7F04E8C0 0FC1611D */ jal mtx4TransformVecInPlace /* 0833F4 7F04E8C4 E7A80070 */ swc1 $f8, 0x70($sp) /* 0833F8 7F04E8C8 C7A00070 */ lwc1 $f0, 0x70($sp) /* 0833FC 7F04E8CC C66A0034 */ lwc1 $f10, 0x34($s3) @@ -33866,67 +31983,27 @@ glabel sub_GAME_7F04E720 #endif +void sub_GAME_7F04E9BC(PropRecord* prop, struct ShotData* shotdata) +{ + ObjectRecord *obj; + f32 tmp; + Model *model; + struct ModelRoData_BoundingBoxRecord *bbox; + obj = prop->obj; + model = obj->model; + bbox = chrobjGetBboxFromObjectRecord(obj); + if ((prop->flags & PROPFLAG_ONSCREEN) + && (obj->runtime_bitflags & RUNTIMEBITFLAG_00001000) == 0 + && (obj->flags2 & PROPFLAG2_SHOOTTHROUGH) == 0) { + tmp = -(model->render_pos->pos.m[3][2] + chrpropSumMatrixNegZ(bbox, (Mtxf*)model->render_pos)); -#ifdef NONMATCHING -void sub_GAME_7F04E9BC(void) { - + if (tmp <= shotdata->unk34) { + sub_GAME_7F04E720(prop, (void*)shotdata); + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F04E9BC -/* 0834EC 7F04E9BC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0834F0 7F04E9C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0834F4 7F04E9C4 AFA40028 */ sw $a0, 0x28($sp) -/* 0834F8 7F04E9C8 AFA5002C */ sw $a1, 0x2c($sp) -/* 0834FC 7F04E9CC 8C840004 */ lw $a0, 4($a0) -/* 083500 7F04E9D0 8C8F0014 */ lw $t7, 0x14($a0) -/* 083504 7F04E9D4 AFA40024 */ sw $a0, 0x24($sp) -/* 083508 7F04E9D8 0FC1001E */ jal sub_GAME_7F040078 -/* 08350C 7F04E9DC AFAF001C */ sw $t7, 0x1c($sp) -/* 083510 7F04E9E0 8FB80028 */ lw $t8, 0x28($sp) -/* 083514 7F04E9E4 8FA40024 */ lw $a0, 0x24($sp) -/* 083518 7F04E9E8 93190001 */ lbu $t9, 1($t8) -/* 08351C 7F04E9EC 33280002 */ andi $t0, $t9, 2 -/* 083520 7F04E9F0 5100001A */ beql $t0, $zero, .L7F04EA5C -/* 083524 7F04E9F4 8FBF0014 */ lw $ra, 0x14($sp) -/* 083528 7F04E9F8 8C890064 */ lw $t1, 0x64($a0) -/* 08352C 7F04E9FC 312A1000 */ andi $t2, $t1, 0x1000 -/* 083530 7F04EA00 55400016 */ bnezl $t2, .L7F04EA5C -/* 083534 7F04EA04 8FBF0014 */ lw $ra, 0x14($sp) -/* 083538 7F04EA08 8C8B000C */ lw $t3, 0xc($a0) -/* 08353C 7F04EA0C 8FAD001C */ lw $t5, 0x1c($sp) -/* 083540 7F04EA10 316C8000 */ andi $t4, $t3, 0x8000 -/* 083544 7F04EA14 15800010 */ bnez $t4, .L7F04EA58 -/* 083548 7F04EA18 00402025 */ move $a0, $v0 -/* 08354C 7F04EA1C 0FC0FAE7 */ jal chrpropSumMatrixNegZ -/* 083550 7F04EA20 8DA5000C */ lw $a1, 0xc($t5) -/* 083554 7F04EA24 8FAE001C */ lw $t6, 0x1c($sp) -/* 083558 7F04EA28 8FA5002C */ lw $a1, 0x2c($sp) -/* 08355C 7F04EA2C 8DCF000C */ lw $t7, 0xc($t6) -/* 083560 7F04EA30 C4A60034 */ lwc1 $f6, 0x34($a1) -/* 083564 7F04EA34 C5E40038 */ lwc1 $f4, 0x38($t7) -/* 083568 7F04EA38 46040080 */ add.s $f2, $f0, $f4 -/* 08356C 7F04EA3C 46001087 */ neg.s $f2, $f2 -/* 083570 7F04EA40 4606103E */ c.le.s $f2, $f6 -/* 083574 7F04EA44 00000000 */ nop -/* 083578 7F04EA48 45020004 */ bc1fl .L7F04EA5C -/* 08357C 7F04EA4C 8FBF0014 */ lw $ra, 0x14($sp) -/* 083580 7F04EA50 0FC139C8 */ jal sub_GAME_7F04E720 -/* 083584 7F04EA54 8FA40028 */ lw $a0, 0x28($sp) -.L7F04EA58: -/* 083588 7F04EA58 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04EA5C: -/* 08358C 7F04EA5C 27BD0028 */ addiu $sp, $sp, 0x28 -/* 083590 7F04EA60 03E00008 */ jr $ra -/* 083594 7F04EA64 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -33995,7 +32072,7 @@ glabel sub_GAME_7F04EA68 /* 08366C 7F04EB3C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 083670 7F04EB40 E7AA0068 */ swc1 $f10, 0x68($sp) /* 083674 7F04EB44 00402025 */ move $a0, $v0 -/* 083678 7F04EB48 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 083678 7F04EB48 0FC1611D */ jal mtx4TransformVecInPlace /* 08367C 7F04EB4C 27A50060 */ addiu $a1, $sp, 0x60 /* 083680 7F04EB50 8E0E004C */ lw $t6, 0x4c($s0) /* 083684 7F04EB54 8FA3005C */ lw $v1, 0x5c($sp) @@ -34015,7 +32092,7 @@ glabel sub_GAME_7F04EA68 /* 0836B8 7F04EB88 02202025 */ move $a0, $s1 /* 0836BC 7F04EB8C 5040000D */ beql $v0, $zero, .L7F04EBC4 /* 0836C0 7F04EB90 8E0B004C */ lw $t3, 0x4c($s0) -/* 0836C4 7F04EB94 0FC13812 */ jal check_if_destroyable_not_invincible +/* 0836C4 7F04EB94 0FC13812 */ jal objIsMortal /* 0836C8 7F04EB98 02202025 */ move $a0, $s1 /* 0836CC 7F04EB9C 50400009 */ beql $v0, $zero, .L7F04EBC4 /* 0836D0 7F04EBA0 8E0B004C */ lw $t3, 0x4c($s0) @@ -34221,10 +32298,10 @@ glabel sub_GAME_7F04EA68 /* 0839B4 7F04EE84 0FC1375A */ jal sub_GAME_7F04DD68 /* 0839B8 7F04EE88 02202025 */ move $a0, $s1 .L7F04EE8C: -/* 0839BC 7F04EE8C 0FC11080 */ jal sub_GAME_7F044200 +/* 0839BC 7F04EE8C 0FC11080 */ jal objDropRecursively /* 0839C0 7F04EE90 8E040004 */ lw $a0, 4($s0) /* 0839C4 7F04EE94 00008025 */ move $s0, $zero -/* 0839C8 7F04EE98 0FC13803 */ jal check_if_collectable_object +/* 0839C8 7F04EE98 0FC13803 */ jal objIsCollectable /* 0839CC 7F04EE9C 02202025 */ move $a0, $s1 /* 0839D0 7F04EEA0 50400008 */ beql $v0, $zero, .L7F04EEC4 /* 0839D4 7F04EEA4 8E2B0008 */ lw $t3, 8($s1) @@ -34261,7 +32338,7 @@ glabel sub_GAME_7F04EA68 .L7F04EF10: /* 083A40 7F04EF10 52000004 */ beql $s0, $zero, .L7F04EF24 /* 083A44 7F04EF14 8FBF002C */ lw $ra, 0x2c($sp) -/* 083A48 7F04EF18 0FC12F37 */ jal sub_GAME_7F04BCDC +/* 083A48 7F04EF18 0FC12F37 */ jal objBounce /* 083A4C 7F04EF1C 02202025 */ move $a0, $s1 /* 083A50 7F04EF20 8FBF002C */ lw $ra, 0x2c($sp) .L7F04EF24: @@ -34278,181 +32355,89 @@ glabel sub_GAME_7F04EA68 bool objIsHealthy(ObjectRecord *self) //#MATCH { - return do_something_if_object_destroyed(self) == 0; + return objGetDestroyedLevel(self) == 0; } +bool objTestForInteract(PropRecord* prop) +{ + f32 xdiff; + ObjectRecord *obj; + PropRecord *player; + f32 var_f2; + f32 ydiff; + f32 zdiff; + f32 var_f0; + f32 anglediff; + f32 playerangle; + f32 sp30; + StandTile *stan; + f32 xzdiff; + f32 angle; + obj = prop->obj; -#ifdef NONMATCHING -void sub_GAME_7F04EF58(void) { + if (((obj->type == PROP_TYPE_PLAYER) + || (obj->flags & PROPFLAG_00080000) + || (obj->runtime_bitflags & (RUNTIMEBITFLAG_00000001 | RUNTIMEBITFLAG_00000002 | RUNTIMEBITFLAG_00000010)))) + { + if ((prop->flags & PROPFLAG_ONSCREEN) + && (objIsHealthy(obj) != 0) + && !(obj->flags & PROPFLAG_CANNOT_ACTIVATE)) + { -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80052EF4 -.word 0x481c4000 /*160000.0*/ -glabel D_80052EF8 -.word 0x40060a92 /*2.0943952*/ -glabel D_80052EFC -.word 0x471c4000 /*40000.0*/ -glabel D_80052F00 -.word 0x3ec90fdb /*0.39269909*/ -glabel D_80052F04 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80052F08 -.word 0x40490fdb /*3.1415927*/ -glabel D_80052F0C -.word 0x40c90fdb /*6.2831855*/ -.text -glabel sub_GAME_7F04EF58 -/* 083A88 7F04EF58 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 083A8C 7F04EF5C AFBF001C */ sw $ra, 0x1c($sp) -/* 083A90 7F04EF60 8C850004 */ lw $a1, 4($a0) -/* 083A94 7F04EF64 24010005 */ li $at, 5 -/* 083A98 7F04EF68 00803025 */ move $a2, $a0 -/* 083A9C 7F04EF6C 90AE0003 */ lbu $t6, 3($a1) -/* 083AA0 7F04EF70 51C1000A */ beql $t6, $at, .L7F04EF9C -/* 083AA4 7F04EF74 90C90001 */ lbu $t1, 1($a2) -/* 083AA8 7F04EF78 8CAF0008 */ lw $t7, 8($a1) -/* 083AAC 7F04EF7C 000FC300 */ sll $t8, $t7, 0xc -/* 083AB0 7F04EF80 07020006 */ bltzl $t8, .L7F04EF9C -/* 083AB4 7F04EF84 90C90001 */ lbu $t1, 1($a2) -/* 083AB8 7F04EF88 8CB90064 */ lw $t9, 0x64($a1) -/* 083ABC 7F04EF8C 33280013 */ andi $t0, $t9, 0x13 -/* 083AC0 7F04EF90 51000073 */ beql $t0, $zero, .L7F04F160 -/* 083AC4 7F04EF94 8FBF001C */ lw $ra, 0x1c($sp) -/* 083AC8 7F04EF98 90C90001 */ lbu $t1, 1($a2) -.L7F04EF9C: -/* 083ACC 7F04EF9C 00A02025 */ move $a0, $a1 -/* 083AD0 7F04EFA0 312A0002 */ andi $t2, $t1, 2 -/* 083AD4 7F04EFA4 5140006E */ beql $t2, $zero, .L7F04F160 -/* 083AD8 7F04EFA8 8FBF001C */ lw $ra, 0x1c($sp) -/* 083ADC 7F04EFAC AFA50050 */ sw $a1, 0x50($sp) -/* 083AE0 7F04EFB0 0FC13BCD */ jal objIsHealthy -/* 083AE4 7F04EFB4 AFA60058 */ sw $a2, 0x58($sp) -/* 083AE8 7F04EFB8 10400068 */ beqz $v0, .L7F04F15C -/* 083AEC 7F04EFBC 8FA50050 */ lw $a1, 0x50($sp) -/* 083AF0 7F04EFC0 8CAB0008 */ lw $t3, 8($a1) -/* 083AF4 7F04EFC4 000B6180 */ sll $t4, $t3, 6 -/* 083AF8 7F04EFC8 05820065 */ bltzl $t4, .L7F04F160 -/* 083AFC 7F04EFCC 8FBF001C */ lw $ra, 0x1c($sp) -/* 083B00 7F04EFD0 0FC225E6 */ jal get_curplayer_positiondata -/* 083B04 7F04EFD4 AFA50050 */ sw $a1, 0x50($sp) -/* 083B08 7F04EFD8 8FA50050 */ lw $a1, 0x50($sp) -/* 083B0C 7F04EFDC C4460008 */ lwc1 $f6, 8($v0) -/* 083B10 7F04EFE0 C44A000C */ lwc1 $f10, 0xc($v0) -/* 083B14 7F04EFE4 C4A40058 */ lwc1 $f4, 0x58($a1) -/* 083B18 7F04EFE8 C4A8005C */ lwc1 $f8, 0x5c($a1) -/* 083B1C 7F04EFEC 8C4D0014 */ lw $t5, 0x14($v0) -/* 083B20 7F04EFF0 46062301 */ sub.s $f12, $f4, $f6 -/* 083B24 7F04EFF4 C4460010 */ lwc1 $f6, 0x10($v0) -/* 083B28 7F04EFF8 C4A40060 */ lwc1 $f4, 0x60($a1) -/* 083B2C 7F04EFFC 460A4401 */ sub.s $f16, $f8, $f10 -/* 083B30 7F04F000 460C6202 */ mul.s $f8, $f12, $f12 -/* 083B34 7F04F004 AFAD002C */ sw $t5, 0x2c($sp) -/* 083B38 7F04F008 46062381 */ sub.s $f14, $f4, $f6 -/* 083B3C 7F04F00C 90AE0003 */ lbu $t6, 3($a1) -/* 083B40 7F04F010 24010028 */ li $at, 40 -/* 083B44 7F04F014 00401825 */ move $v1, $v0 -/* 083B48 7F04F018 460E7282 */ mul.s $f10, $f14, $f14 -/* 083B4C 7F04F01C 55C1000D */ bnel $t6, $at, .L7F04F054 -/* 083B50 7F04F020 3C014348 */ lui $at, 0x4348 -/* 083B54 7F04F024 8CAF0008 */ lw $t7, 8($a1) -/* 083B58 7F04F028 3C0143C8 */ lui $at, 0x43c8 -/* 083B5C 7F04F02C 000FC080 */ sll $t8, $t7, 2 -/* 083B60 7F04F030 07030008 */ bgezl $t8, .L7F04F054 -/* 083B64 7F04F034 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 083B68 7F04F038 44810000 */ mtc1 $at, $f0 -/* 083B6C 7F04F03C 3C018005 */ lui $at, %hi(D_80052EF4) -/* 083B70 7F04F040 C4222EF4 */ lwc1 $f2, %lo(D_80052EF4)($at) -/* 083B74 7F04F044 3C018005 */ lui $at, %hi(D_80052EF8) -/* 083B78 7F04F048 10000007 */ b .L7F04F068 -/* 083B7C 7F04F04C C4322EF8 */ lwc1 $f18, %lo(D_80052EF8)($at) -/* 083B80 7F04F050 3C014348 */ li $at, 0x43480000 # 200.000000 -.L7F04F054: -/* 083B84 7F04F054 44810000 */ mtc1 $at, $f0 -/* 083B88 7F04F058 3C018005 */ lui $at, %hi(D_80052EFC) -/* 083B8C 7F04F05C C4222EFC */ lwc1 $f2, %lo(D_80052EFC)($at) -/* 083B90 7F04F060 3C018005 */ lui $at, %hi(D_80052F00) -/* 083B94 7F04F064 C4322F00 */ lwc1 $f18, %lo(D_80052F00)($at) -.L7F04F068: -/* 083B98 7F04F068 460A4100 */ add.s $f4, $f8, $f10 -/* 083B9C 7F04F06C 4602203C */ c.lt.s $f4, $f2 -/* 083BA0 7F04F070 00000000 */ nop -/* 083BA4 7F04F074 4502003A */ bc1fl .L7F04F160 -/* 083BA8 7F04F078 8FBF001C */ lw $ra, 0x1c($sp) -/* 083BAC 7F04F07C 4600803C */ c.lt.s $f16, $f0 -/* 083BB0 7F04F080 00000000 */ nop -/* 083BB4 7F04F084 45020036 */ bc1fl .L7F04F160 -/* 083BB8 7F04F088 8FBF001C */ lw $ra, 0x1c($sp) -/* 083BBC 7F04F08C 46000187 */ neg.s $f6, $f0 -/* 083BC0 7F04F090 4610303C */ c.lt.s $f6, $f16 -/* 083BC4 7F04F094 00000000 */ nop -/* 083BC8 7F04F098 45020031 */ bc1fl .L7F04F160 -/* 083BCC 7F04F09C 8FBF001C */ lw $ra, 0x1c($sp) -/* 083BD0 7F04F0A0 AFA3004C */ sw $v1, 0x4c($sp) -/* 083BD4 7F04F0A4 AFA50050 */ sw $a1, 0x50($sp) -/* 083BD8 7F04F0A8 0FC16A8C */ jal atan2f -/* 083BDC 7F04F0AC E7B20030 */ swc1 $f18, 0x30($sp) -/* 083BE0 7F04F0B0 0FC227B9 */ jal get_curplay_horizontal_rotation_in_degrees -/* 083BE4 7F04F0B4 E7A00024 */ swc1 $f0, 0x24($sp) -/* 083BE8 7F04F0B8 C7AC0024 */ lwc1 $f12, 0x24($sp) -/* 083BEC 7F04F0BC 8FA3004C */ lw $v1, 0x4c($sp) -/* 083BF0 7F04F0C0 8FA50050 */ lw $a1, 0x50($sp) -/* 083BF4 7F04F0C4 4600603C */ c.lt.s $f12, $f0 -/* 083BF8 7F04F0C8 C7B20030 */ lwc1 $f18, 0x30($sp) -/* 083BFC 7F04F0CC 46006381 */ sub.s $f14, $f12, $f0 -/* 083C00 7F04F0D0 3C018005 */ lui $at, %hi(D_80052F04) -/* 083C04 7F04F0D4 45000003 */ bc1f .L7F04F0E4 -/* 083C08 7F04F0D8 46007086 */ mov.s $f2, $f14 -/* 083C0C 7F04F0DC C4282F04 */ lwc1 $f8, %lo(D_80052F04)($at) -/* 083C10 7F04F0E0 46087080 */ add.s $f2, $f14, $f8 -.L7F04F0E4: -/* 083C14 7F04F0E4 3C018005 */ lui $at, %hi(D_80052F08) -/* 083C18 7F04F0E8 C42A2F08 */ lwc1 $f10, %lo(D_80052F08)($at) -/* 083C1C 7F04F0EC 3C018005 */ lui $at, %hi(D_80052F0C) -/* 083C20 7F04F0F0 4602503C */ c.lt.s $f10, $f2 -/* 083C24 7F04F0F4 00000000 */ nop -/* 083C28 7F04F0F8 45020004 */ bc1fl .L7F04F10C -/* 083C2C 7F04F0FC 4612103E */ c.le.s $f2, $f18 -/* 083C30 7F04F100 C4242F0C */ lwc1 $f4, %lo(D_80052F0C)($at) -/* 083C34 7F04F104 46022081 */ sub.s $f2, $f4, $f2 -/* 083C38 7F04F108 4612103E */ c.le.s $f2, $f18 -.L7F04F10C: -/* 083C3C 7F04F10C 00000000 */ nop -/* 083C40 7F04F110 45020013 */ bc1fl .L7F04F160 -/* 083C44 7F04F114 8FBF001C */ lw $ra, 0x1c($sp) -/* 083C48 7F04F118 8CB9000C */ lw $t9, 0xc($a1) -/* 083C4C 7F04F11C 8FA20058 */ lw $v0, 0x58($sp) -/* 083C50 7F04F120 27A4002C */ addiu $a0, $sp, 0x2c -/* 083C54 7F04F124 33280800 */ andi $t0, $t9, 0x800 -/* 083C58 7F04F128 5100000A */ beql $t0, $zero, .L7F04F154 -/* 083C5C 7F04F12C 8FA90058 */ lw $t1, 0x58($sp) -/* 083C60 7F04F130 C4460010 */ lwc1 $f6, 0x10($v0) -/* 083C64 7F04F134 8C650008 */ lw $a1, 8($v1) -/* 083C68 7F04F138 8C660010 */ lw $a2, 0x10($v1) -/* 083C6C 7F04F13C 8C470008 */ lw $a3, 8($v0) -/* 083C70 7F04F140 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 083C74 7F04F144 E7A60010 */ swc1 $f6, 0x10($sp) -/* 083C78 7F04F148 50400005 */ beql $v0, $zero, .L7F04F160 -/* 083C7C 7F04F14C 8FBF001C */ lw $ra, 0x1c($sp) -/* 083C80 7F04F150 8FA90058 */ lw $t1, 0x58($sp) -.L7F04F154: -/* 083C84 7F04F154 3C018007 */ lui $at, %hi(dword_CODE_bss_80071DF8) -/* 083C88 7F04F158 AC291DF8 */ sw $t1, %lo(dword_CODE_bss_80071DF8)($at) -.L7F04F15C: -/* 083C8C 7F04F15C 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04F160: -/* 083C90 7F04F160 27BD0058 */ addiu $sp, $sp, 0x58 -/* 083C94 7F04F164 24020001 */ li $v0, 1 -/* 083C98 7F04F168 03E00008 */ jr $ra -/* 083C9C 7F04F16C 00000000 */ nop -) -#endif + player = get_curplayer_positiondata(); + + xdiff = obj->runtime_pos.x - player->pos.x; + ydiff = obj->runtime_pos.y - player->pos.y; + zdiff = obj->runtime_pos.z - player->pos.z; + stan = player->stan; + if ((obj->type == 0x28) && (obj->flags & PROPFLAG_DOOR_OPENTOFRONT)) + { + var_f0 = 400.0f; + var_f2 = 160000.0f; + sp30 = 2.0943952f; + } + else + { + var_f0 = 200.0f; + var_f2 = 40000.0f; + sp30 = 0.3926991f; + } + + xzdiff = ((xdiff * xdiff) + (zdiff * zdiff)); + + if ((xzdiff < var_f2) && (ydiff < var_f0) && (-var_f0 < ydiff)) + { + + angle = atan2f(xdiff, zdiff); + playerangle = get_curplay_horizontal_rotation_in_degrees(); + anglediff = angle - playerangle; + + if (angle < playerangle) + { + anglediff += M_TAU_F; + } + + if (anglediff > M_PI_F) + { + anglediff = M_TAU_F - anglediff; + } + + if (anglediff <= sp30) + { + if (!(obj->flags2 & PROPFLAG2_INTERACTCHECKLOS) || (walkTilesBetweenPoints_NoCallback(&stan, player->pos.x, player->pos.z, prop->pos.x, prop->pos.z) != 0)) + { + g_InteractProp = prop; + } + } + } + } + } + return TRUE; +} /* @@ -34522,7 +32507,7 @@ void append_text_picked_up(u8 *buffer,u8 * param2,u8 * param3) { u8 *puVar1; - puVar1 = langGet(TEXT(LPROPOBJ,0x00)); //Picked up + puVar1 = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_00)); //Picked up strcat(buffer,puVar1); return; } @@ -34540,7 +32525,7 @@ void append_text_ammo_amount_word(u8 *buffer, AMMOTYPE ammotype,u32 amount) case AMMO_9MM_2: case AMMO_RIFLE: case AMMO_PLASTIQUE: - textfiletext = langGet(TEXT(LPROPOBJ,0x01)); //some + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_01)); //some strcat(buffer,textfiletext); break; case AMMO_SHOTGUN: @@ -34560,33 +32545,33 @@ void append_text_ammo_amount_word(u8 *buffer, AMMOTYPE ammotype,u32 amount) case AMMO_BUG: case AMMO_MICRO_CAMERA: if (amount == 1) { - textfiletext = langGet(TEXT(LPROPOBJ,0x02)); //a + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_02)); //a strcat(buffer,textfiletext); } else { - textfiletext = langGet(TEXT(LPROPOBJ,0x01)); //some + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_01)); //some strcat(buffer,textfiletext); } break; case AMMO_EXPLOSIVEPEN: case AMMO_BOMBCASE: if (amount == 1) { - textfiletext = langGet(TEXT(LPROPOBJ,0x03)); //an + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_03)); //an strcat(buffer,textfiletext); } else { - textfiletext = langGet(TEXT(LPROPOBJ,0x01)); //some + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_01)); //some strcat(buffer,textfiletext); } break; case AMMO_GEKEY: case AMMO_TOKEN: if (amount == 1) { - textfiletext = langGet(TEXT(LPROPOBJ,0x04)); //the + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_04)); //the strcat(buffer,textfiletext); } else { - textfiletext = langGet(TEXT(LPROPOBJ,0x01)); //some + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_01)); //some strcat(buffer,textfiletext); } } @@ -34594,509 +32579,213 @@ void append_text_ammo_amount_word(u8 *buffer, AMMOTYPE ammotype,u32 amount) } - - - - - -#ifdef NONMATCHING// -void apped_text_ammotype(u8 *buffer,AMMOTYPE ammotype,u32 amount) +void apped_text_ammotype(u8 *buffer, AMMOTYPE ammotype, s32 amount) { u8 *textfiletext; - - if (((ammotype == AMMO_9MM) || (ammotype == AMMO_9MM_2)) || (ammotype == AMMO_RIFLE)) { - textfiletext = langGet(TEXT(LPROPOBJ,0x05)); //ammo + if (((ammotype == AMMO_9MM) || (ammotype == AMMO_9MM_2)) || (ammotype == AMMO_RIFLE)) + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_05)); //ammo strcat(buffer,textfiletext); } - else { - if (ammotype == AMMO_KNIFE) { - textfiletext = langGet(TEXT(LPROPOBJ,0x0F)); //throwing + else + { + if (ammotype == AMMO_KNIFE) + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0F)); //throwing strcat(buffer,textfiletext); - if (amount == 1) { - textfiletext = langGet(TEXT(LPROPOBJ, 0x10)); //knife + if (amount == 1) + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_10)); //knife strcat(buffer,textfiletext); } - else { - textfiletext = langGet(TEXT(LPROPOBJ, 0x11)); //knives + else + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_11)); //knives strcat(buffer,textfiletext); } } - else { - if (ammotype == AMMO_DYNAMITE) { - if (amount == 1) { - textfiletext = langGet(TEXT(LPROPOBJ, 0x19)); //stick + else + { + if (ammotype == AMMO_DYNAMITE) + { + if (amount == 1) + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_19)); //stick strcat(buffer,textfiletext); } - else { - textfiletext = langGet(TEXT(LPROPOBJ, 0x1A)); //sticks + else + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1A)); //sticks strcat(buffer,textfiletext); } - textfiletext = langGet(TEXT(LPROPOBJ, 0x18)); //of dynamite + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_18)); //of dynamite strcat(buffer,textfiletext); } - else { - switch(ammotype) { - case AMMO_SHOTGUN: - textfiletext = langGet(TEXT(LPROPOBJ,0x06)); //shotgun cartridge - strcat(buffer,textfiletext); - break; - case AMMO_GRENADE: - textfiletext = langGet(TEXT(LPROPOBJ,0x09)); //hand grenade - strcat(buffer,textfiletext); - break; - case AMMO_ROCKETS: - textfiletext = langGet(TEXT(LPROPOBJ,0x0B)); //rocket - strcat(buffer,textfiletext); - break; - case AMMO_REMOTEMINE: - textfiletext = langGet(TEXT(LPROPOBJ,0x0C)); //remote mine - strcat(buffer,textfiletext); - break; - case AMMO_PROXMINE: - textfiletext = langGet(TEXT(LPROPOBJ,0x0D)); //proximity mine - strcat(buffer,textfiletext); - break; - case AMMO_TIMEDMINE: - textfiletext = langGet(TEXT(LPROPOBJ,0x0E)); //timed mine - strcat(buffer,textfiletext); - break; - case AMMO_GRENADEROUND: - textfiletext = langGet(TEXT(LPROPOBJ,0x0A)); //grenade round - strcat(buffer,textfiletext); - break; - case AMMO_MAGNUM: - textfiletext = langGet(TEXT(LPROPOBJ,0x07)); //magnum bullet - strcat(buffer,textfiletext); - break; - case AMMO_GGUN: - textfiletext = langGet(TEXT(LPROPOBJ,0x08)); //golden bullet - strcat(buffer,textfiletext); - break; - case AMMO_DARTS: - textfiletext = langGet(TEXT(LPROPOBJ, 0x13)); //dart - strcat(buffer,textfiletext); - break; - case AMMO_EXPLOSIVEPEN: - textfiletext = langGet(TEXT(LPROPOBJ, 0x14)); //explosive pen - strcat(buffer,textfiletext); - break; - case AMMO_BOMBCASE: - textfiletext = langGet(TEXT(LPROPOBJ, 0x15)); //explosive case - strcat(buffer,textfiletext); - break; - case AMMO_FLARE: - textfiletext = langGet(TEXT(LPROPOBJ, 0x16)); //flare - strcat(buffer,textfiletext); - break; - case AMMO_PITON: - textfiletext = langGet(TEXT(LPROPOBJ, 0x17)); //piton - strcat(buffer,textfiletext); - break; - case AMMO_BUG: - textfiletext = langGet(TEXT(LPROPOBJ, 0x1b)); //bug - strcat(buffer,textfiletext); - break; - case AMMO_MICRO_CAMERA: - textfiletext = langGet(TEXT(LPROPOBJ, 0x1c)); //micro camera - strcat(buffer,textfiletext); - break; - case AMMO_GEKEY: - textfiletext = langGet(TEXT(LPROPOBJ, 0x1d)); //GoldenEye key - strcat(buffer,textfiletext); - break; - case AMMO_PLASTIQUE: - textfiletext = langGet(TEXT(LPROPOBJ, 0x1f)); //plastique - strcat(buffer,textfiletext); - break; - case AMMO_TOKEN: - textfiletext = langGet(TEXT(LPROPOBJ, 0x1e)); //token - strcat(buffer,textfiletext); + else + { + switch(ammotype) + { + case AMMO_SHOTGUN: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_06)); //shotgun cartridge + strcat(buffer,textfiletext); + break; + case AMMO_MAGNUM: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_07)); //magnum bullet + strcat(buffer,textfiletext); + break; + case AMMO_GGUN: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_08)); //golden bullet + strcat(buffer,textfiletext); + break; + case AMMO_GRENADE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_09)); //hand grenade + strcat(buffer,textfiletext); + break; + case AMMO_GRENADEROUND: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0A)); //grenade round + strcat(buffer,textfiletext); + break; + case AMMO_ROCKETS: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0B)); //rocket + strcat(buffer,textfiletext); + break; + case AMMO_REMOTEMINE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0C)); //remote mine + strcat(buffer,textfiletext); + break; + case AMMO_PROXMINE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0D)); //proximity mine + strcat(buffer,textfiletext); + break; + case AMMO_TIMEDMINE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_0E)); //timed mine + strcat(buffer,textfiletext); + break; + case AMMO_DARTS: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_13)); //dart + strcat(buffer,textfiletext); + break; + case AMMO_EXPLOSIVEPEN: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_14)); //explosive pen + strcat(buffer,textfiletext); + break; + case AMMO_BOMBCASE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_15)); //explosive case + strcat(buffer,textfiletext); + break; + case AMMO_FLARE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_16)); //flare + strcat(buffer,textfiletext); + break; + case AMMO_PITON: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_17)); //piton + strcat(buffer,textfiletext); + break; + case AMMO_BUG: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1B)); //bug + strcat(buffer,textfiletext); + break; + case AMMO_MICRO_CAMERA: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1C)); //micro camera + strcat(buffer,textfiletext); + break; + case AMMO_GEKEY: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1D)); //GoldenEye key + strcat(buffer,textfiletext); + break; + case AMMO_TOKEN: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1E)); //token + strcat(buffer,textfiletext); + break; + case AMMO_PLASTIQUE: + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_1F)); //plastique + strcat(buffer,textfiletext); + break; } - if (1 < (int)amount) { - textfiletext = langGet(TEXT(LPROPOBJ, 0x12)); //s + if (1 < amount) + { + textfiletext = langGet(TEXT(LPROPOBJ,PROPOBJ_STR_12)); //s strcat(buffer,textfiletext); } } } } - return; } -#else -GLOBAL_ASM( -.late_rodata -/*D:80052F84*/ -glabel jpt_80052F84 -.word text_pickup_shotgun_cartridge -.word text_pickup_hand_grenade -.word text_pickup_rocket -.word text_pickup_remote_mine -.word text_pickup_proximity_mine -.word text_pickup_timed_mine -.word pluralize_multiples -.word text_pickup_grenade_round -.word text_pickup_magnum_bullet -.word text_pickup_golden_bullet -.word text_pickup_dart -.word text_pickup_explosive_pen -.word text_pickup_explosive_case -.word text_pickup_flare -.word text_pickup_piton -.word pluralize_multiples -.word text_pickup_bug -.word text_pickup_micro_camera -.word text_pickup_goldeneye_key -.word text_pickup_plastique -.word pluralize_multiples -.word pluralize_multiples -.word pluralize_multiples -.word pluralize_multiples -.word pluralize_multiples -.word text_pickup_token - - - -.text -glabel apped_text_ammotype -/* 083F3C 7F04F40C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 083F40 7F04F410 AFB00018 */ sw $s0, 0x18($sp) -/* 083F44 7F04F414 24020001 */ li $v0, 1 -/* 083F48 7F04F418 00808025 */ move $s0, $a0 -/* 083F4C 7F04F41C AFBF001C */ sw $ra, 0x1c($sp) -/* 083F50 7F04F420 10A20006 */ beq $a1, $v0, .L7F04F43C -/* 083F54 7F04F424 AFA60028 */ sw $a2, 0x28($sp) -/* 083F58 7F04F428 24010002 */ li $at, 2 -/* 083F5C 7F04F42C 10A10003 */ beq $a1, $at, .L7F04F43C -/* 083F60 7F04F430 24010003 */ li $at, 3 -/* 083F64 7F04F434 54A10009 */ bnel $a1, $at, .L7F04F45C -/* 083F68 7F04F438 2401000A */ li $at, 10 -.L7F04F43C: -/* 083F6C 7F04F43C 0FC30776 */ jal langGet -/* 083F70 7F04F440 3404A405 */ li $a0, 41989 -/* 083F74 7F04F444 02002025 */ move $a0, $s0 -/* 083F78 7F04F448 0C0029FF */ jal strcat -/* 083F7C 7F04F44C 00402825 */ move $a1, $v0 -/* 083F80 7F04F450 100000C9 */ b .L7F04F778 -/* 083F84 7F04F454 8FBF001C */ lw $ra, 0x1c($sp) -/* 083F88 7F04F458 2401000A */ li $at, 10 -.L7F04F45C: -/* 083F8C 7F04F45C 54A10019 */ bnel $a1, $at, .L7F04F4C4 -/* 083F90 7F04F460 24010013 */ li $at, 19 -/* 083F94 7F04F464 0FC30776 */ jal langGet -/* 083F98 7F04F468 3404A40F */ li $a0, 41999 -/* 083F9C 7F04F46C 02002025 */ move $a0, $s0 -/* 083FA0 7F04F470 0C0029FF */ jal strcat -/* 083FA4 7F04F474 00402825 */ move $a1, $v0 -/* 083FA8 7F04F478 8FAE0028 */ lw $t6, 0x28($sp) -/* 083FAC 7F04F47C 24010001 */ li $at, 1 -/* 083FB0 7F04F480 15C10008 */ bne $t6, $at, .L7F04F4A4 -/* 083FB4 7F04F484 00000000 */ nop -/* 083FB8 7F04F488 0FC30776 */ jal langGet -/* 083FBC 7F04F48C 3404A410 */ li $a0, 42000 -/* 083FC0 7F04F490 02002025 */ move $a0, $s0 -/* 083FC4 7F04F494 0C0029FF */ jal strcat -/* 083FC8 7F04F498 00402825 */ move $a1, $v0 -/* 083FCC 7F04F49C 100000B6 */ b .L7F04F778 -/* 083FD0 7F04F4A0 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04F4A4: -/* 083FD4 7F04F4A4 0FC30776 */ jal langGet -/* 083FD8 7F04F4A8 3404A411 */ li $a0, 42001 -/* 083FDC 7F04F4AC 02002025 */ move $a0, $s0 -/* 083FE0 7F04F4B0 0C0029FF */ jal strcat -/* 083FE4 7F04F4B4 00402825 */ move $a1, $v0 -/* 083FE8 7F04F4B8 100000AF */ b .L7F04F778 -/* 083FEC 7F04F4BC 8FBF001C */ lw $ra, 0x1c($sp) -/* 083FF0 7F04F4C0 24010013 */ li $at, 19 -.L7F04F4C4: -/* 083FF4 7F04F4C4 14A10017 */ bne $a1, $at, .L7F04F524 -/* 083FF8 7F04F4C8 24B8FFFC */ addiu $t8, $a1, -4 -/* 083FFC 7F04F4CC 8FAF0028 */ lw $t7, 0x28($sp) -/* 084000 7F04F4D0 15E20008 */ bne $t7, $v0, .L7F04F4F4 -/* 084004 7F04F4D4 00000000 */ nop -/* 084008 7F04F4D8 0FC30776 */ jal langGet -/* 08400C 7F04F4DC 3404A419 */ li $a0, 42009 -/* 084010 7F04F4E0 02002025 */ move $a0, $s0 -/* 084014 7F04F4E4 0C0029FF */ jal strcat -/* 084018 7F04F4E8 00402825 */ move $a1, $v0 -/* 08401C 7F04F4EC 10000006 */ b .L7F04F508 -/* 084020 7F04F4F0 00000000 */ nop -.L7F04F4F4: -/* 084024 7F04F4F4 0FC30776 */ jal langGet -/* 084028 7F04F4F8 3404A41A */ li $a0, 42010 -/* 08402C 7F04F4FC 02002025 */ move $a0, $s0 -/* 084030 7F04F500 0C0029FF */ jal strcat -/* 084034 7F04F504 00402825 */ move $a1, $v0 -.L7F04F508: -/* 084038 7F04F508 0FC30776 */ jal langGet -/* 08403C 7F04F50C 3404A418 */ li $a0, 42008 -/* 084040 7F04F510 02002025 */ move $a0, $s0 -/* 084044 7F04F514 0C0029FF */ jal strcat -/* 084048 7F04F518 00402825 */ move $a1, $v0 -/* 08404C 7F04F51C 10000096 */ b .L7F04F778 -/* 084050 7F04F520 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04F524: -/* 084054 7F04F524 2F01001A */ sltiu $at, $t8, 0x1a -/* 084058 7F04F528 10200089 */ beqz $at, .L7F04F750 -/* 08405C 7F04F52C 0018C080 */ sll $t8, $t8, 2 -/* 084060 7F04F530 3C018005 */ lui $at, %hi(jpt_80052F84) -/* 084064 7F04F534 00380821 */ addu $at, $at, $t8 -/* 084068 7F04F538 8C382F84 */ lw $t8, %lo(jpt_80052F84)($at) -/* 08406C 7F04F53C 03000008 */ jr $t8 -/* 084070 7F04F540 00000000 */ nop -text_pickup_shotgun_cartridge: -/* 084074 7F04F544 0FC30776 */ jal langGet -/* 084078 7F04F548 3404A406 */ li $a0, 41990 -/* 08407C 7F04F54C 02002025 */ move $a0, $s0 -/* 084080 7F04F550 0C0029FF */ jal strcat -/* 084084 7F04F554 00402825 */ move $a1, $v0 -/* 084088 7F04F558 1000007E */ b .L7F04F754 -/* 08408C 7F04F55C 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_magnum_bullet: -/* 084090 7F04F560 0FC30776 */ jal langGet -/* 084094 7F04F564 3404A407 */ li $a0, 41991 -/* 084098 7F04F568 02002025 */ move $a0, $s0 -/* 08409C 7F04F56C 0C0029FF */ jal strcat -/* 0840A0 7F04F570 00402825 */ move $a1, $v0 -/* 0840A4 7F04F574 10000077 */ b .L7F04F754 -/* 0840A8 7F04F578 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_golden_bullet: -/* 0840AC 7F04F57C 0FC30776 */ jal langGet -/* 0840B0 7F04F580 3404A408 */ li $a0, 41992 -/* 0840B4 7F04F584 02002025 */ move $a0, $s0 -/* 0840B8 7F04F588 0C0029FF */ jal strcat -/* 0840BC 7F04F58C 00402825 */ move $a1, $v0 -/* 0840C0 7F04F590 10000070 */ b .L7F04F754 -/* 0840C4 7F04F594 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_hand_grenade: -/* 0840C8 7F04F598 0FC30776 */ jal langGet -/* 0840CC 7F04F59C 3404A409 */ li $a0, 41993 -/* 0840D0 7F04F5A0 02002025 */ move $a0, $s0 -/* 0840D4 7F04F5A4 0C0029FF */ jal strcat -/* 0840D8 7F04F5A8 00402825 */ move $a1, $v0 -/* 0840DC 7F04F5AC 10000069 */ b .L7F04F754 -/* 0840E0 7F04F5B0 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_grenade_round: -/* 0840E4 7F04F5B4 0FC30776 */ jal langGet -/* 0840E8 7F04F5B8 3404A40A */ li $a0, 41994 -/* 0840EC 7F04F5BC 02002025 */ move $a0, $s0 -/* 0840F0 7F04F5C0 0C0029FF */ jal strcat -/* 0840F4 7F04F5C4 00402825 */ move $a1, $v0 -/* 0840F8 7F04F5C8 10000062 */ b .L7F04F754 -/* 0840FC 7F04F5CC 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_rocket: -/* 084100 7F04F5D0 0FC30776 */ jal langGet -/* 084104 7F04F5D4 3404A40B */ li $a0, 41995 -/* 084108 7F04F5D8 02002025 */ move $a0, $s0 -/* 08410C 7F04F5DC 0C0029FF */ jal strcat -/* 084110 7F04F5E0 00402825 */ move $a1, $v0 -/* 084114 7F04F5E4 1000005B */ b .L7F04F754 -/* 084118 7F04F5E8 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_remote_mine: -/* 08411C 7F04F5EC 0FC30776 */ jal langGet -/* 084120 7F04F5F0 3404A40C */ li $a0, 41996 -/* 084124 7F04F5F4 02002025 */ move $a0, $s0 -/* 084128 7F04F5F8 0C0029FF */ jal strcat -/* 08412C 7F04F5FC 00402825 */ move $a1, $v0 -/* 084130 7F04F600 10000054 */ b .L7F04F754 -/* 084134 7F04F604 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_proximity_mine: -/* 084138 7F04F608 0FC30776 */ jal langGet -/* 08413C 7F04F60C 3404A40D */ li $a0, 41997 -/* 084140 7F04F610 02002025 */ move $a0, $s0 -/* 084144 7F04F614 0C0029FF */ jal strcat -/* 084148 7F04F618 00402825 */ move $a1, $v0 -/* 08414C 7F04F61C 1000004D */ b .L7F04F754 -/* 084150 7F04F620 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_timed_mine: -/* 084154 7F04F624 0FC30776 */ jal langGet -/* 084158 7F04F628 3404A40E */ li $a0, 41998 -/* 08415C 7F04F62C 02002025 */ move $a0, $s0 -/* 084160 7F04F630 0C0029FF */ jal strcat -/* 084164 7F04F634 00402825 */ move $a1, $v0 -/* 084168 7F04F638 10000046 */ b .L7F04F754 -/* 08416C 7F04F63C 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_dart: -/* 084170 7F04F640 0FC30776 */ jal langGet -/* 084174 7F04F644 3404A413 */ li $a0, 42003 -/* 084178 7F04F648 02002025 */ move $a0, $s0 -/* 08417C 7F04F64C 0C0029FF */ jal strcat -/* 084180 7F04F650 00402825 */ move $a1, $v0 -/* 084184 7F04F654 1000003F */ b .L7F04F754 -/* 084188 7F04F658 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_explosive_pen: -/* 08418C 7F04F65C 0FC30776 */ jal langGet -/* 084190 7F04F660 3404A414 */ li $a0, 42004 -/* 084194 7F04F664 02002025 */ move $a0, $s0 -/* 084198 7F04F668 0C0029FF */ jal strcat -/* 08419C 7F04F66C 00402825 */ move $a1, $v0 -/* 0841A0 7F04F670 10000038 */ b .L7F04F754 -/* 0841A4 7F04F674 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_explosive_case: -/* 0841A8 7F04F678 0FC30776 */ jal langGet -/* 0841AC 7F04F67C 3404A415 */ li $a0, 42005 -/* 0841B0 7F04F680 02002025 */ move $a0, $s0 -/* 0841B4 7F04F684 0C0029FF */ jal strcat -/* 0841B8 7F04F688 00402825 */ move $a1, $v0 -/* 0841BC 7F04F68C 10000031 */ b .L7F04F754 -/* 0841C0 7F04F690 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_flare: -/* 0841C4 7F04F694 0FC30776 */ jal langGet -/* 0841C8 7F04F698 3404A416 */ li $a0, 42006 -/* 0841CC 7F04F69C 02002025 */ move $a0, $s0 -/* 0841D0 7F04F6A0 0C0029FF */ jal strcat -/* 0841D4 7F04F6A4 00402825 */ move $a1, $v0 -/* 0841D8 7F04F6A8 1000002A */ b .L7F04F754 -/* 0841DC 7F04F6AC 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_piton: -/* 0841E0 7F04F6B0 0FC30776 */ jal langGet -/* 0841E4 7F04F6B4 3404A417 */ li $a0, 42007 -/* 0841E8 7F04F6B8 02002025 */ move $a0, $s0 -/* 0841EC 7F04F6BC 0C0029FF */ jal strcat -/* 0841F0 7F04F6C0 00402825 */ move $a1, $v0 -/* 0841F4 7F04F6C4 10000023 */ b .L7F04F754 -/* 0841F8 7F04F6C8 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_bug: -/* 0841FC 7F04F6CC 0FC30776 */ jal langGet -/* 084200 7F04F6D0 3404A41B */ li $a0, 42011 -/* 084204 7F04F6D4 02002025 */ move $a0, $s0 -/* 084208 7F04F6D8 0C0029FF */ jal strcat -/* 08420C 7F04F6DC 00402825 */ move $a1, $v0 -/* 084210 7F04F6E0 1000001C */ b .L7F04F754 -/* 084214 7F04F6E4 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_micro_camera: -/* 084218 7F04F6E8 0FC30776 */ jal langGet -/* 08421C 7F04F6EC 3404A41C */ li $a0, 42012 -/* 084220 7F04F6F0 02002025 */ move $a0, $s0 -/* 084224 7F04F6F4 0C0029FF */ jal strcat -/* 084228 7F04F6F8 00402825 */ move $a1, $v0 -/* 08422C 7F04F6FC 10000015 */ b .L7F04F754 -/* 084230 7F04F700 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_goldeneye_key: -/* 084234 7F04F704 0FC30776 */ jal langGet -/* 084238 7F04F708 3404A41D */ li $a0, 42013 -/* 08423C 7F04F70C 02002025 */ move $a0, $s0 -/* 084240 7F04F710 0C0029FF */ jal strcat -/* 084244 7F04F714 00402825 */ move $a1, $v0 -/* 084248 7F04F718 1000000E */ b .L7F04F754 -/* 08424C 7F04F71C 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_token: -/* 084250 7F04F720 0FC30776 */ jal langGet -/* 084254 7F04F724 3404A41E */ li $a0, 42014 -/* 084258 7F04F728 02002025 */ move $a0, $s0 -/* 08425C 7F04F72C 0C0029FF */ jal strcat -/* 084260 7F04F730 00402825 */ move $a1, $v0 -/* 084264 7F04F734 10000007 */ b .L7F04F754 -/* 084268 7F04F738 8FB90028 */ lw $t9, 0x28($sp) -text_pickup_plastique: -/* 08426C 7F04F73C 0FC30776 */ jal langGet -/* 084270 7F04F740 3404A41F */ li $a0, 42015 -/* 084274 7F04F744 02002025 */ move $a0, $s0 -/* 084278 7F04F748 0C0029FF */ jal strcat -/* 08427C 7F04F74C 00402825 */ move $a1, $v0 -pluralize_multiples: -.L7F04F750: -/* 084280 7F04F750 8FB90028 */ lw $t9, 0x28($sp) -.L7F04F754: -/* 084284 7F04F754 2B210002 */ slti $at, $t9, 2 -/* 084288 7F04F758 54200007 */ bnezl $at, .L7F04F778 -/* 08428C 7F04F75C 8FBF001C */ lw $ra, 0x1c($sp) -/* 084290 7F04F760 0FC30776 */ jal langGet -/* 084294 7F04F764 3404A412 */ li $a0, 42002 -/* 084298 7F04F768 02002025 */ move $a0, $s0 -/* 08429C 7F04F76C 0C0029FF */ jal strcat -/* 0842A0 7F04F770 00402825 */ move $a1, $v0 -/* 0842A4 7F04F774 8FBF001C */ lw $ra, 0x1c($sp) -.L7F04F778: -/* 0842A8 7F04F778 8FB00018 */ lw $s0, 0x18($sp) -/* 0842AC 7F04F77C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0842B0 7F04F780 03E00008 */ jr $ra -/* 0842B4 7F04F784 00000000 */ nop -) -#endif - - - - void set_sound_effect_for_ammo_collection(AMMOTYPE ammotype) - { switch(ammotype) { - case AMMO_9MM: - case AMMO_9MM_2: - case AMMO_RIFLE: - case AMMO_SHOTGUN: - case AMMO_GRENADE: - case AMMO_ROCKETS: - case AMMO_GRENADEROUND: - case AMMO_MAGNUM: - case AMMO_GGUN: - case AMMO_DARTS: - case AMMO_EXPLOSIVEPEN: - case AMMO_FLARE: - case AMMO_PITON: - case AMMO_DYNAMITE: - case AMMO_GEKEY: - case AMMO_TOKEN: - sndPlaySfx(g_musicSfxBufferPtr,PICKUP_AMMO_SFX,0); - break; - case AMMO_REMOTEMINE: - case AMMO_PROXMINE: - case AMMO_TIMEDMINE: - case AMMO_BOMBCASE: - case AMMO_BUG: - case AMMO_MICRO_CAMERA: - case AMMO_PLASTIQUE: - sndPlaySfx(g_musicSfxBufferPtr,PICKUP_MINE_SFX,0); - break; - case AMMO_KNIFE: - sndPlaySfx(g_musicSfxBufferPtr,PICKUP_KNIFE_SFX,0); + case AMMO_9MM: + case AMMO_9MM_2: + case AMMO_RIFLE: + case AMMO_SHOTGUN: + case AMMO_GRENADE: + case AMMO_ROCKETS: + case AMMO_GRENADEROUND: + case AMMO_MAGNUM: + case AMMO_GGUN: + case AMMO_DARTS: + case AMMO_EXPLOSIVEPEN: + case AMMO_FLARE: + case AMMO_PITON: + case AMMO_DYNAMITE: + case AMMO_GEKEY: + case AMMO_TOKEN: + sndPlaySfx(g_musicSfxBufferPtr,PICKUP_AMMO_SFX,0); + break; + case AMMO_REMOTEMINE: + case AMMO_PROXMINE: + case AMMO_TIMEDMINE: + case AMMO_BOMBCASE: + case AMMO_BUG: + case AMMO_MICRO_CAMERA: + case AMMO_PLASTIQUE: + sndPlaySfx(g_musicSfxBufferPtr,PICKUP_MINE_SFX,0); + break; + case AMMO_KNIFE: + sndPlaySfx(g_musicSfxBufferPtr,PICKUP_KNIFE_SFX,0); } - return; } - - - - void set_sound_effect_for_weapontype_collection(ITEM_IDS weapontype) { - if ((weapontype == ITEM_KNIFE) || (weapontype == ITEM_THROWKNIFE)) { + if ((weapontype == ITEM_KNIFE) || (weapontype == ITEM_THROWKNIFE)) + { sndPlaySfx(g_musicSfxBufferPtr,PICKUP_KNIFE_SFX,0); } - else { - if (((((weapontype == ITEM_REMOTEMINE) || (weapontype == ITEM_PROXIMITYMINE)) || - (weapontype == ITEM_TIMEDMINE)) || - ((weapontype == ITEM_BOMBCASE || (weapontype == ITEM_BUG)))) || - ((weapontype == ITEM_MICROCAMERA || (weapontype == ITEM_PLASTIQUE)))) { + else + { + if ((weapontype == ITEM_REMOTEMINE) || (weapontype == ITEM_PROXIMITYMINE) || (weapontype == ITEM_TIMEDMINE) || + (weapontype == ITEM_BOMBCASE) || (weapontype == ITEM_BUG) || (weapontype == ITEM_MICROCAMERA) || + (weapontype == ITEM_PLASTIQUE)) + { sndPlaySfx(g_musicSfxBufferPtr,PICKUP_MINE_SFX,0); } - else { - if (((weapontype == ITEM_GRENADE) || (weapontype == ITEM_NULL87)) || (weapontype == ITEM_NULL86) - ) { + else + { + if ((weapontype == ITEM_GRENADE) || (weapontype == ITEM_NULL87) || (weapontype == ITEM_NULL86)) + { sndPlaySfx(g_musicSfxBufferPtr,PICKUP_AMMO_SFX,0); } - else { - if (weapontype == ITEM_LASER) { + else + { + if (weapontype == ITEM_LASER) + { sndPlaySfx(g_musicSfxBufferPtr,PICKUP_LASER_SFX,0); } - else { + else + { sndPlaySfx(g_musicSfxBufferPtr,PICKUP_GUN_SFX,0); } } } } - return; } - //!FIXME, i need to be properly split from chrai.c -#ifdef NONMATCHING -extern char * D_800529D0; -extern char * D_800529D4; - void prepare_ammo_type_collection_text(u8 *finaltext, AMMOTYPE ammotype, u32 quantity) { *finaltext = 0; @@ -35107,7 +32796,7 @@ void prepare_ammo_type_collection_text(u8 *finaltext, AMMOTYPE ammotype, u32 qua { append_text_picked_up(finaltext, ammotype, quantity); } - strcat(finaltext, (char *)D_800529D0); + strcat(finaltext, "\n"); return; } if (getPlayerCount() < 3) @@ -35116,205 +32805,20 @@ void prepare_ammo_type_collection_text(u8 *finaltext, AMMOTYPE ammotype, u32 qua append_text_ammo_amount_word(finaltext, ammotype, quantity); } apped_text_ammotype(finaltext, ammotype, quantity); - strcat(finaltext, (char *)D_800529D4); + strcat(finaltext, ".\n"); } -#else -GLOBAL_ASM( -.late_rodata - -.text -glabel prepare_ammo_type_collection_text -/* 084450 7F04F920 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 084454 7F04F924 AFBF0024 */ sw $ra, 0x24($sp) -/* 084458 7F04F928 AFB20020 */ sw $s2, 0x20($sp) -/* 08445C 7F04F92C AFB1001C */ sw $s1, 0x1c($sp) -/* 084460 7F04F930 AFB00018 */ sw $s0, 0x18($sp) -/* 084464 7F04F934 A0800000 */ sb $zero, ($a0) -/* 084468 7F04F938 3C0E8005 */ lui $t6, %hi(j_text_trigger) -/* 08446C 7F04F93C 8DCE84D0 */ lw $t6, %lo(j_text_trigger)($t6) -/* 084470 7F04F940 00808025 */ move $s0, $a0 -/* 084474 7F04F944 00A08825 */ move $s1, $a1 -/* 084478 7F04F948 11C00011 */ beqz $t6, .L7F04F990 -/* 08447C 7F04F94C 00C09025 */ move $s2, $a2 -/* 084480 7F04F950 0FC13D03 */ jal apped_text_ammotype -/* 084484 7F04F954 00000000 */ nop -/* 084488 7F04F958 0FC26919 */ jal getPlayerCount -/* 08448C 7F04F95C 00000000 */ nop -/* 084490 7F04F960 28410003 */ slti $at, $v0, 3 -/* 084494 7F04F964 10200004 */ beqz $at, .L7F04F978 -/* 084498 7F04F968 02002025 */ move $a0, $s0 -/* 08449C 7F04F96C 02202825 */ move $a1, $s1 -/* 0844A0 7F04F970 0FC13CAD */ jal append_text_picked_up -/* 0844A4 7F04F974 02403025 */ move $a2, $s2 -.L7F04F978: -/* 0844A8 7F04F978 3C058005 */ lui $a1, %hi(D_800529D0) -/* 0844AC 7F04F97C 24A529D0 */ addiu $a1, %lo(D_800529D0) # addiu $a1, $a1, 0x29d0 -/* 0844B0 7F04F980 0C0029FF */ jal strcat -/* 0844B4 7F04F984 02002025 */ move $a0, $s0 -/* 0844B8 7F04F988 10000016 */ b .L7F04F9E4 -/* 0844BC 7F04F98C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04F990: -/* 0844C0 7F04F990 0FC26919 */ jal getPlayerCount -/* 0844C4 7F04F994 00000000 */ nop -/* 0844C8 7F04F998 28410003 */ slti $at, $v0, 3 -/* 0844CC 7F04F99C 10200008 */ beqz $at, .L7F04F9C0 -/* 0844D0 7F04F9A0 02002025 */ move $a0, $s0 -/* 0844D4 7F04F9A4 02202825 */ move $a1, $s1 -/* 0844D8 7F04F9A8 0FC13CAD */ jal append_text_picked_up -/* 0844DC 7F04F9AC 02403025 */ move $a2, $s2 -/* 0844E0 7F04F9B0 02002025 */ move $a0, $s0 -/* 0844E4 7F04F9B4 02202825 */ move $a1, $s1 -/* 0844E8 7F04F9B8 0FC13CBB */ jal append_text_ammo_amount_word -/* 0844EC 7F04F9BC 02403025 */ move $a2, $s2 -.L7F04F9C0: -/* 0844F0 7F04F9C0 02002025 */ move $a0, $s0 -/* 0844F4 7F04F9C4 02202825 */ move $a1, $s1 -/* 0844F8 7F04F9C8 0FC13D03 */ jal apped_text_ammotype -/* 0844FC 7F04F9CC 02403025 */ move $a2, $s2 -/* 084500 7F04F9D0 3C058005 */ lui $a1, %hi(D_800529D4) -/* 084504 7F04F9D4 24A529D4 */ addiu $a1, %lo(D_800529D4) # addiu $a1, $a1, 0x29d4 -/* 084508 7F04F9D8 0C0029FF */ jal strcat -/* 08450C 7F04F9DC 02002025 */ move $a0, $s0 -/* 084510 7F04F9E0 8FBF0024 */ lw $ra, 0x24($sp) -.L7F04F9E4: -/* 084514 7F04F9E4 8FB00018 */ lw $s0, 0x18($sp) -/* 084518 7F04F9E8 8FB1001C */ lw $s1, 0x1c($sp) -/* 08451C 7F04F9EC 8FB20020 */ lw $s2, 0x20($sp) -/* 084520 7F04F9F0 03E00008 */ jr $ra -/* 084524 7F04F9F4 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif - - - -#ifdef NONMATCHING -void display_text_when_ammo_collected(void) { - -} -#else +void display_text_when_ammo_collected(s32 ammotype, s32 quantity) +{ + char buffer[100] = ""; + prepare_ammo_type_collection_text(buffer, ammotype, quantity); #ifdef VERSION_US -GLOBAL_ASM( -.late_rodata - - -.text -glabel display_text_when_ammo_collected -/* 084528 7F04F9F8 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 08452C 7F04F9FC AFA40080 */ sw $a0, 0x80($sp) -/* 084530 7F04FA00 3C0E8005 */ lui $t6, %hi(D_800529D8) -/* 084534 7F04FA04 27A4001C */ addiu $a0, $sp, 0x1c -/* 084538 7F04FA08 00A03025 */ move $a2, $a1 -/* 08453C 7F04FA0C 25CE29D8 */ addiu $t6, %lo(D_800529D8) # addiu $t6, $t6, 0x29d8 -/* 084540 7F04FA10 8FA50080 */ lw $a1, 0x80($sp) -/* 084544 7F04FA14 AFBF0014 */ sw $ra, 0x14($sp) -/* 084548 7F04FA18 25D90060 */ addiu $t9, $t6, 0x60 -/* 08454C 7F04FA1C 00804025 */ move $t0, $a0 -.L7F04FA20: -/* 084550 7F04FA20 8DC10000 */ lw $at, ($t6) -/* 084554 7F04FA24 25CE000C */ addiu $t6, $t6, 0xc -/* 084558 7F04FA28 2508000C */ addiu $t0, $t0, 0xc -/* 08455C 7F04FA2C AD01FFF4 */ sw $at, -0xc($t0) -/* 084560 7F04FA30 8DC1FFF8 */ lw $at, -8($t6) -/* 084564 7F04FA34 AD01FFF8 */ sw $at, -8($t0) -/* 084568 7F04FA38 8DC1FFFC */ lw $at, -4($t6) -/* 08456C 7F04FA3C 15D9FFF8 */ bne $t6, $t9, .L7F04FA20 -/* 084570 7F04FA40 AD01FFFC */ sw $at, -4($t0) -/* 084574 7F04FA44 8DC10000 */ lw $at, ($t6) -/* 084578 7F04FA48 0FC13E48 */ jal prepare_ammo_type_collection_text -/* 08457C 7F04FA4C AD010000 */ sw $at, ($t0) -/* 084580 7F04FA50 0FC228F2 */ jal hudmsgBottomShow -/* 084584 7F04FA54 27A4001C */ addiu $a0, $sp, 0x1c -/* 084588 7F04FA58 8FBF0014 */ lw $ra, 0x14($sp) -/* 08458C 7F04FA5C 27BD0080 */ addiu $sp, $sp, 0x80 -/* 084590 7F04FA60 03E00008 */ jr $ra -/* 084594 7F04FA64 00000000 */ nop -) -#endif -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata - - -.text -glabel display_text_when_ammo_collected -/* 084528 7F04F9F8 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 08452C 7F04F9FC AFA40080 */ sw $a0, 0x80($sp) -/* 084530 7F04FA00 3C0E8005 */ lui $t6, %hi(D_800529D8) -/* 084534 7F04FA04 27A4001C */ addiu $a0, $sp, 0x1c -/* 084538 7F04FA08 00A03025 */ move $a2, $a1 -/* 08453C 7F04FA0C 25CE29D8 */ addiu $t6, %lo(D_800529D8) # addiu $t6, $t6, 0x29d8 -/* 084540 7F04FA10 8FA50080 */ lw $a1, 0x80($sp) -/* 084544 7F04FA14 AFBF0014 */ sw $ra, 0x14($sp) -/* 084548 7F04FA18 25D90060 */ addiu $t9, $t6, 0x60 -/* 08454C 7F04FA1C 00804025 */ move $t0, $a0 -.L7F04FA20: -/* 084550 7F04FA20 8DC10000 */ lw $at, ($t6) -/* 084554 7F04FA24 25CE000C */ addiu $t6, $t6, 0xc -/* 084558 7F04FA28 2508000C */ addiu $t0, $t0, 0xc -/* 08455C 7F04FA2C AD01FFF4 */ sw $at, -0xc($t0) -/* 084560 7F04FA30 8DC1FFF8 */ lw $at, -8($t6) -/* 084564 7F04FA34 AD01FFF8 */ sw $at, -8($t0) -/* 084568 7F04FA38 8DC1FFFC */ lw $at, -4($t6) -/* 08456C 7F04FA3C 15D9FFF8 */ bne $t6, $t9, .L7F04FA20 -/* 084570 7F04FA40 AD01FFFC */ sw $at, -4($t0) -/* 084574 7F04FA44 8DC10000 */ lw $at, ($t6) -/* 084578 7F04FA48 0FC13E48 */ jal prepare_ammo_type_collection_text -/* 08457C 7F04FA4C AD010000 */ sw $at, ($t0) -/* 084580 7F04FA50 0FC228F2 */ jal jp_hudmsgBottomShow -/* 084584 7F04FA54 27A4001C */ addiu $a0, $sp, 0x1c -/* 084588 7F04FA58 8FBF0014 */ lw $ra, 0x14($sp) -/* 08458C 7F04FA5C 27BD0080 */ addiu $sp, $sp, 0x80 -/* 084590 7F04FA60 03E00008 */ jr $ra -/* 084594 7F04FA64 00000000 */ nop -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata - - -.text -glabel display_text_when_ammo_collected -/* 084528 7F04F9F8 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 08452C 7F04F9FC AFA40080 */ sw $a0, 0x80($sp) -/* 084530 7F04FA00 3C0E8005 */ lui $t6, %hi(D_800529D8) -/* 084534 7F04FA04 27A4001C */ addiu $a0, $sp, 0x1c -/* 084538 7F04FA08 00A03025 */ move $a2, $a1 -/* 08453C 7F04FA0C 25CE29D8 */ addiu $t6, %lo(D_800529D8) # addiu $t6, $t6, 0x29d8 -/* 084540 7F04FA10 8FA50080 */ lw $a1, 0x80($sp) -/* 084544 7F04FA14 AFBF0014 */ sw $ra, 0x14($sp) -/* 084548 7F04FA18 25D90060 */ addiu $t9, $t6, 0x60 -/* 08454C 7F04FA1C 00804025 */ move $t0, $a0 -.L7F04FA20: -/* 084550 7F04FA20 8DC10000 */ lw $at, ($t6) -/* 084554 7F04FA24 25CE000C */ addiu $t6, $t6, 0xc -/* 084558 7F04FA28 2508000C */ addiu $t0, $t0, 0xc -/* 08455C 7F04FA2C AD01FFF4 */ sw $at, -0xc($t0) -/* 084560 7F04FA30 8DC1FFF8 */ lw $at, -8($t6) -/* 084564 7F04FA34 AD01FFF8 */ sw $at, -8($t0) -/* 084568 7F04FA38 8DC1FFFC */ lw $at, -4($t6) -/* 08456C 7F04FA3C 15D9FFF8 */ bne $t6, $t9, .L7F04FA20 -/* 084570 7F04FA40 AD01FFFC */ sw $at, -4($t0) -/* 084574 7F04FA44 8DC10000 */ lw $at, ($t6) -/* 084578 7F04FA48 0FC13E48 */ jal prepare_ammo_type_collection_text -/* 08457C 7F04FA4C AD010000 */ sw $at, ($t0) -/* 084580 7F04FA50 0FC228F2 */ jal jp_hudmsgBottomShow -/* 084584 7F04FA54 27A4001C */ addiu $a0, $sp, 0x1c -/* 084588 7F04FA58 8FBF0014 */ lw $ra, 0x14($sp) -/* 08458C 7F04FA5C 27BD0080 */ addiu $sp, $sp, 0x80 -/* 084590 7F04FA60 03E00008 */ jr $ra -/* 084594 7F04FA64 00000000 */ nop -) -#endif - - + hudmsgBottomShow(buffer); +#else + jp_hudmsgBottomShow(buffer); #endif - - - +} void add_ammo_to_inventory(AMMOTYPE ammotype,int amount,int doplaysound,int dodisplaytext) { @@ -35394,775 +32898,229 @@ void add_ammo_to_inventory(AMMOTYPE ammotype,int amount,int doplaysound,int dodi } +s32 get_ammo_in_magazine(AmmoCrateRecord *crate) +{ + s32 qty = 1; + switch (crate->ammoType) + { + case AMMO_9MM: qty = 10; break; + case AMMO_9MM_2: qty = 10; break; + case AMMO_RIFLE: qty = 10; break; + case AMMO_SHOTGUN: qty = 5; break; + case AMMO_MAGNUM: qty = 5; break; + case AMMO_GGUN: qty = 3; break; + case AMMO_DARTS: qty = 4; break; + } -#ifdef NONMATCHING -void get_ammo_in_magazine(void) { + if (qty > 1 && getPlayerCount() == 1) + { + qty *= g_SoloAmmoMultiplier; + } + return qty; } -#else -GLOBAL_ASM( -.late_rodata -/*D:80053060*/ -glabel ammo_collected_from_magazine -.word magazine_has_10_rounds_type1 -.word magazine_has_10_rounds_type2 -.word magazine_has_10_rounds_type3 -.word magazine_has_5_rounds_type4 -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_default_ammo_rounds -.word magazine_has_5_rounds_typeC -.word magazine_has_3_rounds_typeD -.word magazine_has_4_rounds_typeE - -.text -glabel get_ammo_in_magazine -/* 08476C 7F04FC3C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 084770 7F04FC40 AFBF0014 */ sw $ra, 0x14($sp) -/* 084774 7F04FC44 8C8E0080 */ lw $t6, 0x80($a0) -/* 084778 7F04FC48 24030001 */ li $v1, 1 -/* 08477C 7F04FC4C 25CFFFFF */ addiu $t7, $t6, -1 -/* 084780 7F04FC50 2DE1000E */ sltiu $at, $t7, 0xe -/* 084784 7F04FC54 10200013 */ beqz $at, .L7F04FCA4 -/* 084788 7F04FC58 000F7880 */ sll $t7, $t7, 2 -/* 08478C 7F04FC5C 3C018005 */ lui $at, %hi(ammo_collected_from_magazine) -/* 084790 7F04FC60 002F0821 */ addu $at, $at, $t7 -/* 084794 7F04FC64 8C2F3060 */ lw $t7, %lo(ammo_collected_from_magazine)($at) -/* 084798 7F04FC68 01E00008 */ jr $t7 -/* 08479C 7F04FC6C 00000000 */ nop -magazine_has_10_rounds_type1: -/* 0847A0 7F04FC70 1000000C */ b .L7F04FCA4 -/* 0847A4 7F04FC74 2403000A */ li $v1, 10 -magazine_has_10_rounds_type2: -/* 0847A8 7F04FC78 1000000A */ b .L7F04FCA4 -/* 0847AC 7F04FC7C 2403000A */ li $v1, 10 -magazine_has_10_rounds_type3: -/* 0847B0 7F04FC80 10000008 */ b .L7F04FCA4 -/* 0847B4 7F04FC84 2403000A */ li $v1, 10 -magazine_has_5_rounds_type4: -/* 0847B8 7F04FC88 10000006 */ b .L7F04FCA4 -/* 0847BC 7F04FC8C 24030005 */ li $v1, 5 -magazine_has_5_rounds_typeC: -/* 0847C0 7F04FC90 10000004 */ b .L7F04FCA4 -/* 0847C4 7F04FC94 24030005 */ li $v1, 5 -magazine_has_3_rounds_typeD: -/* 0847C8 7F04FC98 10000002 */ b .L7F04FCA4 -/* 0847CC 7F04FC9C 24030003 */ li $v1, 3 -magazine_has_4_rounds_typeE: -/* 0847D0 7F04FCA0 24030004 */ li $v1, 4 -magazine_has_default_ammo_rounds: -.L7F04FCA4: -/* 0847D4 7F04FCA4 28610002 */ slti $at, $v1, 2 -/* 0847D8 7F04FCA8 5420000F */ bnezl $at, .L7F04FCE8 -/* 0847DC 7F04FCAC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0847E0 7F04FCB0 0FC26919 */ jal getPlayerCount -/* 0847E4 7F04FCB4 AFA3001C */ sw $v1, 0x1c($sp) -/* 0847E8 7F04FCB8 24010001 */ li $at, 1 -/* 0847EC 7F04FCBC 14410009 */ bne $v0, $at, .L7F04FCE4 -/* 0847F0 7F04FCC0 8FA3001C */ lw $v1, 0x1c($sp) -/* 0847F4 7F04FCC4 44832000 */ mtc1 $v1, $f4 -/* 0847F8 7F04FCC8 3C018003 */ lui $at, %hi(g_SoloAmmoMultiplier) -/* 0847FC 7F04FCCC C4280B28 */ lwc1 $f8, %lo(g_SoloAmmoMultiplier)($at) -/* 084800 7F04FCD0 468021A0 */ cvt.s.w $f6, $f4 -/* 084804 7F04FCD4 46083282 */ mul.s $f10, $f6, $f8 -/* 084808 7F04FCD8 4600540D */ trunc.w.s $f16, $f10 -/* 08480C 7F04FCDC 44038000 */ mfc1 $v1, $f16 -/* 084810 7F04FCE0 00000000 */ nop -.L7F04FCE4: -/* 084814 7F04FCE4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F04FCE8: -/* 084818 7F04FCE8 27BD0020 */ addiu $sp, $sp, 0x20 -/* 08481C 7F04FCEC 00601025 */ move $v0, $v1 -/* 084820 7F04FCF0 03E00008 */ jr $ra -/* 084824 7F04FCF4 00000000 */ nop -) -#endif +s32 ammo_collected_from_weapon(WeaponObjRecord *weapon) +{ + s32 ammotype; + s32 qty; + ammotype = get_ammo_type_for_weapon(weapon->weaponnum); + qty = 1; + if (weapon->flags & PROPFLAG_NO_AMMO) + { + return 0; + } + switch (ammotype) + { + case AMMO_9MM: qty = 10; break; + case AMMO_9MM_2: qty = 10; break; + case AMMO_RIFLE: qty = 10; break; + case AMMO_SHOTGUN: qty = 5; break; + case AMMO_MAGNUM: qty = 5; break; + case AMMO_GGUN: qty = 3; break; + case AMMO_DARTS: qty = 4; break; + case AMMO_GRENADEROUND: qty = 3; break; + } -#ifdef NONMATCHING -void ammo_collected_from_weapon(void) { + if (qty > 1 && getPlayerCount() == 1) + { + qty *= g_SoloAmmoMultiplier; + } + return qty; } -#else -GLOBAL_ASM( -.late_rodata -/*D:80053098*/ -glabel ammo_in_weapon -.word weapon_has_10_rounds_type1 -.word weapon_has_10_rounds_type2 -.word weapon_has_10_rounds_type3 -.word weapon_has_5_rounds_type4 -.word weapon_has_default_ammo -.word weapon_has_default_ammo -.word weapon_has_default_ammo -.word weapon_has_default_ammo -.word weapon_has_default_ammo -.word weapon_has_default_ammo -.word weapon_has_3_rounds_typeB -.word weapon_has_5_rounds_typeC -.word weapon_has_3_rounds_typeD -.word weapon_has_4_rounds_typeE - -.text -glabel ammo_collected_from_weapon -/* 084828 7F04FCF8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 08482C 7F04FCFC AFBF0014 */ sw $ra, 0x14($sp) -/* 084830 7F04FD00 AFA40020 */ sw $a0, 0x20($sp) -/* 084834 7F04FD04 0FC1A50B */ jal get_ammo_type_for_weapon -/* 084838 7F04FD08 80840080 */ lb $a0, 0x80($a0) -/* 08483C 7F04FD0C 8FAF0020 */ lw $t7, 0x20($sp) -/* 084840 7F04FD10 2448FFFF */ addiu $t0, $v0, -1 -/* 084844 7F04FD14 24030001 */ li $v1, 1 -/* 084848 7F04FD18 8DF80008 */ lw $t8, 8($t7) -/* 08484C 7F04FD1C 2D01000E */ sltiu $at, $t0, 0xe -/* 084850 7F04FD20 0018C840 */ sll $t9, $t8, 1 -/* 084854 7F04FD24 07210003 */ bgez $t9, .L7F04FD34 -/* 084858 7F04FD28 00000000 */ nop -/* 08485C 7F04FD2C 10000028 */ b .L7F04FDD0 -/* 084860 7F04FD30 00001025 */ move $v0, $zero -.L7F04FD34: -/* 084864 7F04FD34 10200015 */ beqz $at, .L7F04FD8C -/* 084868 7F04FD38 00084080 */ sll $t0, $t0, 2 -/* 08486C 7F04FD3C 3C018005 */ lui $at, %hi(ammo_in_weapon) -/* 084870 7F04FD40 00280821 */ addu $at, $at, $t0 -/* 084874 7F04FD44 8C283098 */ lw $t0, %lo(ammo_in_weapon)($at) -/* 084878 7F04FD48 01000008 */ jr $t0 -/* 08487C 7F04FD4C 00000000 */ nop -weapon_has_10_rounds_type1: -/* 084880 7F04FD50 1000000E */ b .L7F04FD8C -/* 084884 7F04FD54 2403000A */ li $v1, 10 -weapon_has_10_rounds_type2: -/* 084888 7F04FD58 1000000C */ b .L7F04FD8C -/* 08488C 7F04FD5C 2403000A */ li $v1, 10 -weapon_has_10_rounds_type3: -/* 084890 7F04FD60 1000000A */ b .L7F04FD8C -/* 084894 7F04FD64 2403000A */ li $v1, 10 -weapon_has_5_rounds_type4: -/* 084898 7F04FD68 10000008 */ b .L7F04FD8C -/* 08489C 7F04FD6C 24030005 */ li $v1, 5 -weapon_has_5_rounds_typeC: -/* 0848A0 7F04FD70 10000006 */ b .L7F04FD8C -/* 0848A4 7F04FD74 24030005 */ li $v1, 5 -weapon_has_3_rounds_typeD: -/* 0848A8 7F04FD78 10000004 */ b .L7F04FD8C -/* 0848AC 7F04FD7C 24030003 */ li $v1, 3 -weapon_has_4_rounds_typeE: -/* 0848B0 7F04FD80 10000002 */ b .L7F04FD8C -/* 0848B4 7F04FD84 24030004 */ li $v1, 4 -weapon_has_3_rounds_typeB: -/* 0848B8 7F04FD88 24030003 */ li $v1, 3 -weapon_has_default_ammo: -.L7F04FD8C: -/* 0848BC 7F04FD8C 28610002 */ slti $at, $v1, 2 -/* 0848C0 7F04FD90 5420000F */ bnezl $at, .L7F04FDD0 -/* 0848C4 7F04FD94 00601025 */ move $v0, $v1 -/* 0848C8 7F04FD98 0FC26919 */ jal getPlayerCount -/* 0848CC 7F04FD9C AFA30018 */ sw $v1, 0x18($sp) -/* 0848D0 7F04FDA0 24010001 */ li $at, 1 -/* 0848D4 7F04FDA4 14410009 */ bne $v0, $at, .L7F04FDCC -/* 0848D8 7F04FDA8 8FA30018 */ lw $v1, 0x18($sp) -/* 0848DC 7F04FDAC 44832000 */ mtc1 $v1, $f4 -/* 0848E0 7F04FDB0 3C018003 */ lui $at, %hi(g_SoloAmmoMultiplier) -/* 0848E4 7F04FDB4 C4280B28 */ lwc1 $f8, %lo(g_SoloAmmoMultiplier)($at) -/* 0848E8 7F04FDB8 468021A0 */ cvt.s.w $f6, $f4 -/* 0848EC 7F04FDBC 46083282 */ mul.s $f10, $f6, $f8 -/* 0848F0 7F04FDC0 4600540D */ trunc.w.s $f16, $f10 -/* 0848F4 7F04FDC4 44038000 */ mfc1 $v1, $f16 -/* 0848F8 7F04FDC8 00000000 */ nop -.L7F04FDCC: -/* 0848FC 7F04FDCC 00601025 */ move $v0, $v1 -.L7F04FDD0: -/* 084900 7F04FDD0 8FBF0014 */ lw $ra, 0x14($sp) -/* 084904 7F04FDD4 27BD0020 */ addiu $sp, $sp, 0x20 -/* 084908 7F04FDD8 03E00008 */ jr $ra -/* 08490C 7F04FDDC 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -void generate_language_specific_text_for_weapon(char *finalstring,ITEM_IDS itemtype) +void generate_language_specific_text_for_weapon(u8 *finalstring, ITEM_IDS itemtype) { u32 morethan2players; - //u32 numplayers; - //AMMOTYPE ammotype; - //char *textfiletext; - //size_t strlength; - + morethan2players = FALSE; - if (j_text_trigger==0) { + + if (j_text_trigger != 0) + { strcpy(finalstring,""); - if (2 < getPlayerCount()) { + if (2 < getPlayerCount()) + { morethan2players = TRUE; } } - else { - if (getPlayerCount() < 3) { + else + { + if (getPlayerCount() < 3) + { //Picked up - strcpy(finalstring, langGet(TEXT(LPROPOBJ,0x00))); + strcpy(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_00))); } } - switch(itemtype) { - case ITEM_KNIFE: - //a hunting knife. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x20))); - break; - case ITEM_THROWKNIFE: - case ITEM_GRENADE: - case ITEM_TIMEDMINE: - case ITEM_PROXIMITYMINE: - case ITEM_REMOTEMINE: - case ITEM_BOMBCASE: - case ITEM_PLASTIQUE: - case ITEM_BUG: - case ITEM_MICROCAMERA: - case ITEM_GOLDENEYEKEY: - case ITEM_NULL86: - case ITEM_NULL87: - case ITEM_TOKEN: - prepare_ammo_type_collection_text(finalstring,get_ammo_type_for_weapon(itemtype),1); - return; - case ITEM_WPPK: - //a PP7. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x21))); - break; - case ITEM_WPPKSIL: - //a silenced PP7. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x22))); - break; - case ITEM_TT33: - //a DD44 Dostovei. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x23))); - break; - case ITEM_SKORPION: - //a Klobb. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x24))); - break; - case ITEM_AK47: - //a KF7 Soviet. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x25))); - break; - case ITEM_UZI: - //a ZMG (9mm). - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x26))); - break; - case ITEM_MP5K: - //a D5K Deutsche. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x27))); - break; - case ITEM_MP5KSIL: - //a silenced D5K. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x28))); - break; - case ITEM_SPECTRE: - //a Phantom. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x29))); - break; - case ITEM_M16: - //an AR33 assault rifle. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2a))); - break; - case ITEM_FNP90: - //an RC-P90. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2b))); - break; - case ITEM_SHOTGUN: - //a shotgun. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2c))); - break; - case ITEM_AUTOSHOT: - //an automatic shotgun. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2d))); - break; - case ITEM_SNIPERRIFLE: - //a sniper rifle. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2e))); - break; - case ITEM_RUGER: - //a Cougar Magnum. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x31))); - break; - case ITEM_GOLDENGUN: - //the Golden Gun. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x32))); - break; - case ITEM_SILVERWPPK: - //a silver PP7. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x36))); - break; - case ITEM_GOLDWPPK: - //a gold PP7. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x37))); - break; - case ITEM_LASER: - //a Moonraker laser. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x33))); - break; - default: - //a new weapon. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x3b))); - break; - case ITEM_GRENADELAUNCH: - //a grenade launcher. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x2f))); - break; - case ITEM_ROCKETLAUNCH: - //a rocket launcher. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x30))); - break; - case ITEM_FLAREPISTOL: - //a flare pistol. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x34))); - break; - case ITEM_PITONGUN: - //a piton gun. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x35))); - break; - case ITEM_KEYCARD: - //a keycard. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x38))); - break; - case ITEM_KEYYALE: - //a yale key. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x39))); - break; - case ITEM_KEYBOLT: - //a bolt key. - strcat(finalstring, langGet(TEXT(LPROPOBJ, 0x3a))); + + switch(itemtype) + { + case ITEM_THROWKNIFE: + case ITEM_GRENADE: + case ITEM_TIMEDMINE: + case ITEM_PROXIMITYMINE: + case ITEM_REMOTEMINE: + case ITEM_BOMBCASE: + case ITEM_PLASTIQUE: + case ITEM_BUG: + case ITEM_MICROCAMERA: + case ITEM_GOLDENEYEKEY: + case ITEM_NULL86: + case ITEM_NULL87: + case ITEM_TOKEN: + prepare_ammo_type_collection_text(finalstring,get_ammo_type_for_weapon(itemtype),1); + return; + case ITEM_KNIFE: + //a hunting knife. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_20))); + break; + case ITEM_WPPK: + //a PP7. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_21))); + break; + case ITEM_WPPKSIL: + //a silenced PP7. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_22))); + break; + case ITEM_TT33: + //a DD44 Dostovei. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_23))); + break; + case ITEM_SKORPION: + //a Klobb. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_24))); + break; + case ITEM_AK47: + //a KF7 Soviet. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_25))); + break; + case ITEM_UZI: + //a ZMG (9mm). + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_26))); + break; + case ITEM_MP5K: + //a D5K Deutsche. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_27))); + break; + case ITEM_MP5KSIL: + //a silenced D5K. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_28))); + break; + case ITEM_SPECTRE: + //a Phantom. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_29))); + break; + case ITEM_M16: + //an AR33 assault rifle. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2A))); + break; + case ITEM_FNP90: + //an RC-P90. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2B))); + break; + case ITEM_SHOTGUN: + //a shotgun. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2C))); + break; + case ITEM_AUTOSHOT: + //an automatic shotgun. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2D))); + break; + case ITEM_SNIPERRIFLE: + //a sniper rifle. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2E))); + break; + case ITEM_GRENADELAUNCH: + //a grenade launcher. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_2F))); + break; + case ITEM_ROCKETLAUNCH: + //a rocket launcher. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_30))); + break; + case ITEM_RUGER: + //a Cougar Magnum. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_31))); + break; + case ITEM_GOLDENGUN: + //the Golden Gun. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_32))); + break; + case ITEM_LASER: + //a Moonraker laser. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_33))); + break; + case ITEM_FLAREPISTOL: + //a flare pistol. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_34))); + break; + case ITEM_PITONGUN: + //a piton gun. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_35))); + break; + case ITEM_SILVERWPPK: + //a silver PP7. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_36))); + break; + case ITEM_GOLDWPPK: + //a gold PP7. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_37))); + break; + case ITEM_KEYCARD: + //a keycard. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_38))); + break; + case ITEM_KEYYALE: + //a yale key. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_39))); + break; + case ITEM_KEYBOLT: + //a bolt key. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_3A))); + break; + default: + //a new weapon. + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_3B))); + break; } + if ((j_text_trigger != 0) && (!morethan2players)) { if (finalstring[strlen(finalstring) - 1] == '\n') { finalstring[strlen(finalstring) - 1] = '\0'; } - //Picked up - strcat(finalstring, langGet(TEXT(LPROPOBJ,0x00))); + //Picked up + strcat(finalstring, langGet(TEXT(LPROPOBJ,PROPOBJ_STR_00))); strcat(finalstring,"\n"); } - return; -} -#else -GLOBAL_ASM( -.late_rodata -/*D:800530D0*/ -glabel jpt_800530D0 -.word weapon_collect_msg_a_hunting_knife -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_a_pp7 -.word weapon_collect_msg_a_silenced_pp7 -.word weapon_collect_msg_a_dd44 -.word weapon_collect_msg_a_klobb -.word weapon_collect_msg_a_kf7 -.word weapon_collect_msg_a_zmg -.word weapon_collect_msg_a_d5k -.word weapon_collect_msg_a_silenced_d5k -.word weapon_collect_msg_a_phantom -.word weapon_collect_msg_a_ar33 -.word weapon_collect_msg_a_rcp90 -.word weapon_collect_msg_a_shotgun -.word weapon_collect_msg_an_auto_shotgun -.word weapon_collect_msg_a_sniper -.word weapon_collect_msg_a_cougar_magnum -.word weapon_collect_msg_a_golden_gun -.word weapon_collect_msg_a_silver_pp7 -.word weapon_collect_msg_a_gold_pp7 -.word weapon_collect_msg_a_moonraker_laser -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_grenade_launcher -.word weapon_collect_msg_a_rocket_launcher -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_a_flare_pistol -.word weapon_collect_msg_a_piton_gun -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_keycard -.word weapon_collect_msg_a_yale_key -.word weapon_collect_msg_a_bolt_key -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_a_new_weapon -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK -.word weapon_collect_msg_BLANK - -.text -glabel generate_language_specific_text_for_weapon -/* 084910 7F04FDE0 3C0E8005 */ lui $t6, %hi(j_text_trigger) -/* 084914 7F04FDE4 8DCE84D0 */ lw $t6, %lo(j_text_trigger)($t6) -/* 084918 7F04FDE8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 08491C 7F04FDEC AFB00018 */ sw $s0, 0x18($sp) -/* 084920 7F04FDF0 00808025 */ move $s0, $a0 -/* 084924 7F04FDF4 AFBF001C */ sw $ra, 0x1c($sp) -/* 084928 7F04FDF8 AFA5002C */ sw $a1, 0x2c($sp) -/* 08492C 7F04FDFC 11C0000B */ beqz $t6, .L7F04FE2C -/* 084930 7F04FE00 AFA00024 */ sw $zero, 0x24($sp) -/* 084934 7F04FE04 3C058005 */ lui $a1, %hi(D_80052A3C) -/* 084938 7F04FE08 0C0029DC */ jal strcpy -/* 08493C 7F04FE0C 24A52A3C */ addiu $a1, %lo(D_80052A3C) # addiu $a1, $a1, 0x2a3c -/* 084940 7F04FE10 0FC26919 */ jal getPlayerCount -/* 084944 7F04FE14 00000000 */ nop -/* 084948 7F04FE18 28410003 */ slti $at, $v0, 3 -/* 08494C 7F04FE1C 1420000D */ bnez $at, .L7F04FE54 -/* 084950 7F04FE20 240F0001 */ li $t7, 1 -/* 084954 7F04FE24 1000000B */ b .L7F04FE54 -/* 084958 7F04FE28 AFAF0024 */ sw $t7, 0x24($sp) -.L7F04FE2C: -/* 08495C 7F04FE2C 0FC26919 */ jal getPlayerCount -/* 084960 7F04FE30 00000000 */ nop -/* 084964 7F04FE34 28410003 */ slti $at, $v0, 3 -/* 084968 7F04FE38 50200007 */ beql $at, $zero, .L7F04FE58 -/* 08496C 7F04FE3C 8FB8002C */ lw $t8, 0x2c($sp) -/* 084970 7F04FE40 0FC30776 */ jal langGet -/* 084974 7F04FE44 3404A400 */ li $a0, 41984 -/* 084978 7F04FE48 02002025 */ move $a0, $s0 -/* 08497C 7F04FE4C 0C0029DC */ jal strcpy -/* 084980 7F04FE50 00402825 */ move $a1, $v0 -.L7F04FE54: -/* 084984 7F04FE54 8FB8002C */ lw $t8, 0x2c($sp) -.L7F04FE58: -/* 084988 7F04FE58 2719FFFE */ addiu $t9, $t8, -2 -/* 08498C 7F04FE5C 2F210057 */ sltiu $at, $t9, 0x57 -/* 084990 7F04FE60 102000CB */ beqz $at, .L7F050190 -/* 084994 7F04FE64 0019C880 */ sll $t9, $t9, 2 -/* 084998 7F04FE68 3C018005 */ lui $at, %hi(jpt_800530D0) -/* 08499C 7F04FE6C 00390821 */ addu $at, $at, $t9 -/* 0849A0 7F04FE70 8C3930D0 */ lw $t9, %lo(jpt_800530D0)($at) -/* 0849A4 7F04FE74 03200008 */ jr $t9 -/* 0849A8 7F04FE78 00000000 */ nop -weapon_collect_msg_BLANK: -/* 0849AC 7F04FE7C 0FC1A50B */ jal get_ammo_type_for_weapon -/* 0849B0 7F04FE80 8FA4002C */ lw $a0, 0x2c($sp) -/* 0849B4 7F04FE84 02002025 */ move $a0, $s0 -/* 0849B8 7F04FE88 00402825 */ move $a1, $v0 -/* 0849BC 7F04FE8C 0FC13E48 */ jal prepare_ammo_type_collection_text -/* 0849C0 7F04FE90 24060001 */ li $a2, 1 -/* 0849C4 7F04FE94 100000DF */ b .L7F050214 -/* 0849C8 7F04FE98 8FBF001C */ lw $ra, 0x1c($sp) -weapon_collect_msg_a_hunting_knife: -/* 0849CC 7F04FE9C 0FC30776 */ jal langGet -/* 0849D0 7F04FEA0 3404A420 */ li $a0, 42016 -/* 0849D4 7F04FEA4 02002025 */ move $a0, $s0 -/* 0849D8 7F04FEA8 0C0029FF */ jal strcat -/* 0849DC 7F04FEAC 00402825 */ move $a1, $v0 -/* 0849E0 7F04FEB0 100000BC */ b .L7F0501A4 -/* 0849E4 7F04FEB4 00000000 */ nop -weapon_collect_msg_a_pp7: -/* 0849E8 7F04FEB8 0FC30776 */ jal langGet -/* 0849EC 7F04FEBC 3404A421 */ li $a0, 42017 -/* 0849F0 7F04FEC0 02002025 */ move $a0, $s0 -/* 0849F4 7F04FEC4 0C0029FF */ jal strcat -/* 0849F8 7F04FEC8 00402825 */ move $a1, $v0 -/* 0849FC 7F04FECC 100000B5 */ b .L7F0501A4 -/* 084A00 7F04FED0 00000000 */ nop -weapon_collect_msg_a_silenced_pp7: -/* 084A04 7F04FED4 0FC30776 */ jal langGet -/* 084A08 7F04FED8 3404A422 */ li $a0, 42018 -/* 084A0C 7F04FEDC 02002025 */ move $a0, $s0 -/* 084A10 7F04FEE0 0C0029FF */ jal strcat -/* 084A14 7F04FEE4 00402825 */ move $a1, $v0 -/* 084A18 7F04FEE8 100000AE */ b .L7F0501A4 -/* 084A1C 7F04FEEC 00000000 */ nop -weapon_collect_msg_a_dd44: -/* 084A20 7F04FEF0 0FC30776 */ jal langGet -/* 084A24 7F04FEF4 3404A423 */ li $a0, 42019 -/* 084A28 7F04FEF8 02002025 */ move $a0, $s0 -/* 084A2C 7F04FEFC 0C0029FF */ jal strcat -/* 084A30 7F04FF00 00402825 */ move $a1, $v0 -/* 084A34 7F04FF04 100000A7 */ b .L7F0501A4 -/* 084A38 7F04FF08 00000000 */ nop -weapon_collect_msg_a_klobb: -/* 084A3C 7F04FF0C 0FC30776 */ jal langGet -/* 084A40 7F04FF10 3404A424 */ li $a0, 42020 -/* 084A44 7F04FF14 02002025 */ move $a0, $s0 -/* 084A48 7F04FF18 0C0029FF */ jal strcat -/* 084A4C 7F04FF1C 00402825 */ move $a1, $v0 -/* 084A50 7F04FF20 100000A0 */ b .L7F0501A4 -/* 084A54 7F04FF24 00000000 */ nop -weapon_collect_msg_a_kf7: -/* 084A58 7F04FF28 0FC30776 */ jal langGet -/* 084A5C 7F04FF2C 3404A425 */ li $a0, 42021 -/* 084A60 7F04FF30 02002025 */ move $a0, $s0 -/* 084A64 7F04FF34 0C0029FF */ jal strcat -/* 084A68 7F04FF38 00402825 */ move $a1, $v0 -/* 084A6C 7F04FF3C 10000099 */ b .L7F0501A4 -/* 084A70 7F04FF40 00000000 */ nop -weapon_collect_msg_a_zmg: -/* 084A74 7F04FF44 0FC30776 */ jal langGet -/* 084A78 7F04FF48 3404A426 */ li $a0, 42022 -/* 084A7C 7F04FF4C 02002025 */ move $a0, $s0 -/* 084A80 7F04FF50 0C0029FF */ jal strcat -/* 084A84 7F04FF54 00402825 */ move $a1, $v0 -/* 084A88 7F04FF58 10000092 */ b .L7F0501A4 -/* 084A8C 7F04FF5C 00000000 */ nop -weapon_collect_msg_a_d5k: -/* 084A90 7F04FF60 0FC30776 */ jal langGet -/* 084A94 7F04FF64 3404A427 */ li $a0, 42023 -/* 084A98 7F04FF68 02002025 */ move $a0, $s0 -/* 084A9C 7F04FF6C 0C0029FF */ jal strcat -/* 084AA0 7F04FF70 00402825 */ move $a1, $v0 -/* 084AA4 7F04FF74 1000008B */ b .L7F0501A4 -/* 084AA8 7F04FF78 00000000 */ nop -weapon_collect_msg_a_silenced_d5k: -/* 084AAC 7F04FF7C 0FC30776 */ jal langGet -/* 084AB0 7F04FF80 3404A428 */ li $a0, 42024 -/* 084AB4 7F04FF84 02002025 */ move $a0, $s0 -/* 084AB8 7F04FF88 0C0029FF */ jal strcat -/* 084ABC 7F04FF8C 00402825 */ move $a1, $v0 -/* 084AC0 7F04FF90 10000084 */ b .L7F0501A4 -/* 084AC4 7F04FF94 00000000 */ nop -weapon_collect_msg_a_phantom: -/* 084AC8 7F04FF98 0FC30776 */ jal langGet -/* 084ACC 7F04FF9C 3404A429 */ li $a0, 42025 -/* 084AD0 7F04FFA0 02002025 */ move $a0, $s0 -/* 084AD4 7F04FFA4 0C0029FF */ jal strcat -/* 084AD8 7F04FFA8 00402825 */ move $a1, $v0 -/* 084ADC 7F04FFAC 1000007D */ b .L7F0501A4 -/* 084AE0 7F04FFB0 00000000 */ nop -weapon_collect_msg_a_ar33: -/* 084AE4 7F04FFB4 0FC30776 */ jal langGet -/* 084AE8 7F04FFB8 3404A42A */ li $a0, 42026 -/* 084AEC 7F04FFBC 02002025 */ move $a0, $s0 -/* 084AF0 7F04FFC0 0C0029FF */ jal strcat -/* 084AF4 7F04FFC4 00402825 */ move $a1, $v0 -/* 084AF8 7F04FFC8 10000076 */ b .L7F0501A4 -/* 084AFC 7F04FFCC 00000000 */ nop -weapon_collect_msg_a_rcp90: -/* 084B00 7F04FFD0 0FC30776 */ jal langGet -/* 084B04 7F04FFD4 3404A42B */ li $a0, 42027 -/* 084B08 7F04FFD8 02002025 */ move $a0, $s0 -/* 084B0C 7F04FFDC 0C0029FF */ jal strcat -/* 084B10 7F04FFE0 00402825 */ move $a1, $v0 -/* 084B14 7F04FFE4 1000006F */ b .L7F0501A4 -/* 084B18 7F04FFE8 00000000 */ nop -weapon_collect_msg_a_shotgun: -/* 084B1C 7F04FFEC 0FC30776 */ jal langGet -/* 084B20 7F04FFF0 3404A42C */ li $a0, 42028 -/* 084B24 7F04FFF4 02002025 */ move $a0, $s0 -/* 084B28 7F04FFF8 0C0029FF */ jal strcat -/* 084B2C 7F04FFFC 00402825 */ move $a1, $v0 -/* 084B30 7F050000 10000068 */ b .L7F0501A4 -/* 084B34 7F050004 00000000 */ nop -weapon_collect_msg_an_auto_shotgun: -/* 084B38 7F050008 0FC30776 */ jal langGet -/* 084B3C 7F05000C 3404A42D */ li $a0, 42029 -/* 084B40 7F050010 02002025 */ move $a0, $s0 -/* 084B44 7F050014 0C0029FF */ jal strcat -/* 084B48 7F050018 00402825 */ move $a1, $v0 -/* 084B4C 7F05001C 10000061 */ b .L7F0501A4 -/* 084B50 7F050020 00000000 */ nop -weapon_collect_msg_a_sniper: -/* 084B54 7F050024 0FC30776 */ jal langGet -/* 084B58 7F050028 3404A42E */ li $a0, 42030 -/* 084B5C 7F05002C 02002025 */ move $a0, $s0 -/* 084B60 7F050030 0C0029FF */ jal strcat -/* 084B64 7F050034 00402825 */ move $a1, $v0 -/* 084B68 7F050038 1000005A */ b .L7F0501A4 -/* 084B6C 7F05003C 00000000 */ nop -weapon_collect_msg_a_grenade_launcher: -/* 084B70 7F050040 0FC30776 */ jal langGet -/* 084B74 7F050044 3404A42F */ li $a0, 42031 -/* 084B78 7F050048 02002025 */ move $a0, $s0 -/* 084B7C 7F05004C 0C0029FF */ jal strcat -/* 084B80 7F050050 00402825 */ move $a1, $v0 -/* 084B84 7F050054 10000053 */ b .L7F0501A4 -/* 084B88 7F050058 00000000 */ nop -weapon_collect_msg_a_rocket_launcher: -/* 084B8C 7F05005C 0FC30776 */ jal langGet -/* 084B90 7F050060 3404A430 */ li $a0, 42032 -/* 084B94 7F050064 02002025 */ move $a0, $s0 -/* 084B98 7F050068 0C0029FF */ jal strcat -/* 084B9C 7F05006C 00402825 */ move $a1, $v0 -/* 084BA0 7F050070 1000004C */ b .L7F0501A4 -/* 084BA4 7F050074 00000000 */ nop -weapon_collect_msg_a_cougar_magnum: -/* 084BA8 7F050078 0FC30776 */ jal langGet -/* 084BAC 7F05007C 3404A431 */ li $a0, 42033 -/* 084BB0 7F050080 02002025 */ move $a0, $s0 -/* 084BB4 7F050084 0C0029FF */ jal strcat -/* 084BB8 7F050088 00402825 */ move $a1, $v0 -/* 084BBC 7F05008C 10000045 */ b .L7F0501A4 -/* 084BC0 7F050090 00000000 */ nop -weapon_collect_msg_a_golden_gun: -/* 084BC4 7F050094 0FC30776 */ jal langGet -/* 084BC8 7F050098 3404A432 */ li $a0, 42034 -/* 084BCC 7F05009C 02002025 */ move $a0, $s0 -/* 084BD0 7F0500A0 0C0029FF */ jal strcat -/* 084BD4 7F0500A4 00402825 */ move $a1, $v0 -/* 084BD8 7F0500A8 1000003E */ b .L7F0501A4 -/* 084BDC 7F0500AC 00000000 */ nop -weapon_collect_msg_a_moonraker_laser: -/* 084BE0 7F0500B0 0FC30776 */ jal langGet -/* 084BE4 7F0500B4 3404A433 */ li $a0, 42035 -/* 084BE8 7F0500B8 02002025 */ move $a0, $s0 -/* 084BEC 7F0500BC 0C0029FF */ jal strcat -/* 084BF0 7F0500C0 00402825 */ move $a1, $v0 -/* 084BF4 7F0500C4 10000037 */ b .L7F0501A4 -/* 084BF8 7F0500C8 00000000 */ nop -weapon_collect_msg_a_flare_pistol: -/* 084BFC 7F0500CC 0FC30776 */ jal langGet -/* 084C00 7F0500D0 3404A434 */ li $a0, 42036 -/* 084C04 7F0500D4 02002025 */ move $a0, $s0 -/* 084C08 7F0500D8 0C0029FF */ jal strcat -/* 084C0C 7F0500DC 00402825 */ move $a1, $v0 -/* 084C10 7F0500E0 10000030 */ b .L7F0501A4 -/* 084C14 7F0500E4 00000000 */ nop -weapon_collect_msg_a_piton_gun: -/* 084C18 7F0500E8 0FC30776 */ jal langGet -/* 084C1C 7F0500EC 3404A435 */ li $a0, 42037 -/* 084C20 7F0500F0 02002025 */ move $a0, $s0 -/* 084C24 7F0500F4 0C0029FF */ jal strcat -/* 084C28 7F0500F8 00402825 */ move $a1, $v0 -/* 084C2C 7F0500FC 10000029 */ b .L7F0501A4 -/* 084C30 7F050100 00000000 */ nop -weapon_collect_msg_a_silver_pp7: -/* 084C34 7F050104 0FC30776 */ jal langGet -/* 084C38 7F050108 3404A436 */ li $a0, 42038 -/* 084C3C 7F05010C 02002025 */ move $a0, $s0 -/* 084C40 7F050110 0C0029FF */ jal strcat -/* 084C44 7F050114 00402825 */ move $a1, $v0 -/* 084C48 7F050118 10000022 */ b .L7F0501A4 -/* 084C4C 7F05011C 00000000 */ nop -weapon_collect_msg_a_gold_pp7: -/* 084C50 7F050120 0FC30776 */ jal langGet -/* 084C54 7F050124 3404A437 */ li $a0, 42039 -/* 084C58 7F050128 02002025 */ move $a0, $s0 -/* 084C5C 7F05012C 0C0029FF */ jal strcat -/* 084C60 7F050130 00402825 */ move $a1, $v0 -/* 084C64 7F050134 1000001B */ b .L7F0501A4 -/* 084C68 7F050138 00000000 */ nop -weapon_collect_msg_a_keycard: -/* 084C6C 7F05013C 0FC30776 */ jal langGet -/* 084C70 7F050140 3404A438 */ li $a0, 42040 -/* 084C74 7F050144 02002025 */ move $a0, $s0 -/* 084C78 7F050148 0C0029FF */ jal strcat -/* 084C7C 7F05014C 00402825 */ move $a1, $v0 -/* 084C80 7F050150 10000014 */ b .L7F0501A4 -/* 084C84 7F050154 00000000 */ nop -weapon_collect_msg_a_yale_key: -/* 084C88 7F050158 0FC30776 */ jal langGet -/* 084C8C 7F05015C 3404A439 */ li $a0, 42041 -/* 084C90 7F050160 02002025 */ move $a0, $s0 -/* 084C94 7F050164 0C0029FF */ jal strcat -/* 084C98 7F050168 00402825 */ move $a1, $v0 -/* 084C9C 7F05016C 1000000D */ b .L7F0501A4 -/* 084CA0 7F050170 00000000 */ nop -weapon_collect_msg_a_bolt_key: -/* 084CA4 7F050174 0FC30776 */ jal langGet -/* 084CA8 7F050178 3404A43A */ li $a0, 42042 -/* 084CAC 7F05017C 02002025 */ move $a0, $s0 -/* 084CB0 7F050180 0C0029FF */ jal strcat -/* 084CB4 7F050184 00402825 */ move $a1, $v0 -/* 084CB8 7F050188 10000006 */ b .L7F0501A4 -/* 084CBC 7F05018C 00000000 */ nop -weapon_collect_msg_a_new_weapon: -.L7F050190: -/* 084CC0 7F050190 0FC30776 */ jal langGet -/* 084CC4 7F050194 3404A43B */ li $a0, 42043 -/* 084CC8 7F050198 02002025 */ move $a0, $s0 -/* 084CCC 7F05019C 0C0029FF */ jal strcat -/* 084CD0 7F0501A0 00402825 */ move $a1, $v0 -.L7F0501A4: -/* 084CD4 7F0501A4 3C088005 */ lui $t0, %hi(j_text_trigger) -/* 084CD8 7F0501A8 8D0884D0 */ lw $t0, %lo(j_text_trigger)($t0) -/* 084CDC 7F0501AC 8FA90024 */ lw $t1, 0x24($sp) -/* 084CE0 7F0501B0 51000018 */ beql $t0, $zero, .L7F050214 -/* 084CE4 7F0501B4 8FBF001C */ lw $ra, 0x1c($sp) -/* 084CE8 7F0501B8 55200016 */ bnezl $t1, .L7F050214 -/* 084CEC 7F0501BC 8FBF001C */ lw $ra, 0x1c($sp) -/* 084CF0 7F0501C0 0C004E1F */ jal strlen -/* 084CF4 7F0501C4 02002025 */ move $a0, $s0 -/* 084CF8 7F0501C8 00505021 */ addu $t2, $v0, $s0 -/* 084CFC 7F0501CC 914BFFFF */ lbu $t3, -1($t2) -/* 084D00 7F0501D0 2401000A */ li $at, 10 -/* 084D04 7F0501D4 15610005 */ bne $t3, $at, .L7F0501EC -/* 084D08 7F0501D8 00000000 */ nop -/* 084D0C 7F0501DC 0C004E1F */ jal strlen -/* 084D10 7F0501E0 02002025 */ move $a0, $s0 -/* 084D14 7F0501E4 02026021 */ addu $t4, $s0, $v0 -/* 084D18 7F0501E8 A180FFFF */ sb $zero, -1($t4) -.L7F0501EC: -/* 084D1C 7F0501EC 0FC30776 */ jal langGet -/* 084D20 7F0501F0 3404A400 */ li $a0, 41984 -/* 084D24 7F0501F4 02002025 */ move $a0, $s0 -/* 084D28 7F0501F8 0C0029FF */ jal strcat -/* 084D2C 7F0501FC 00402825 */ move $a1, $v0 -/* 084D30 7F050200 3C058005 */ lui $a1, %hi(D_80052A40) -/* 084D34 7F050204 24A52A40 */ addiu $a1, %lo(D_80052A40) # addiu $a1, $a1, 0x2a40 -/* 084D38 7F050208 0C0029FF */ jal strcat -/* 084D3C 7F05020C 02002025 */ move $a0, $s0 -/* 084D40 7F050210 8FBF001C */ lw $ra, 0x1c($sp) -.L7F050214: -/* 084D44 7F050214 8FB00018 */ lw $s0, 0x18($sp) -/* 084D48 7F050218 27BD0028 */ addiu $sp, $sp, 0x28 -/* 084D4C 7F05021C 03E00008 */ jr $ra -/* 084D50 7F050220 00000000 */ nop -) -#endif - - - +} void display_text_for_weapon_in_lower_left_corner(ITEM_IDS weaponid) @@ -37571,7 +34529,7 @@ s32 object_collectability_routines(PropRecord *arg0) temp_a0 = arg0->chr; sp84 = temp_a0; phi_a0 = temp_a0; - if ((check_if_collectable_object(temp_a0) != 0) && (temp_a0->Head.type != 0x11)) + if ((objIsCollectable(temp_a0) != 0) && (temp_a0->Head.type != 0x11)) { temp_v0 = temp_a0->flags; phi_v0 = temp_v0; @@ -37601,7 +34559,7 @@ s32 object_collectability_routines(PropRecord *arg0) return 0; } } - if (sub_GAME_7F03E7AC(phi_a0) == 0) + if (objCanPickupFromSafe(phi_a0) == 0) { return 0; } @@ -37681,7 +34639,7 @@ s32 object_collectability_routines(PropRecord *arg0) sp6C = 1; sp70 = arg0->chr; phi_v1 = sp70; - if (do_something_if_object_destroyed(sp84) != 0) + if (objGetDestroyedLevel(sp84) != 0) { return 0; } @@ -37804,7 +34762,7 @@ s32 object_collectability_routines(PropRecord *arg0) if (phi_a2 != 0) { temp_a0_3 = &sp3C; - if (((sp84->flags2 & 0x1000) == 0) && ((sp3C = temp_v0_7->stan, sp40 = phi_a2, phi_v1_3 = phi_a2, (sub_GAME_7F0B0E24(temp_a0_3, temp_v0_7->pos.AsArray[0], temp_v0_7->pos.AsArray[2], arg0->pos.AsArray[0], arg0->pos.AsArray[2], 2, 30.0f, 30.0f, 0.0f, 1.0f) == 0)) || (sp3C != arg0->stan))) + if (((sp84->flags2 & 0x1000) == 0) && ((sp3C = temp_v0_7->stan, sp40 = phi_a2, phi_v1_3 = phi_a2, (stanTestLineUnobstructed(temp_a0_3, temp_v0_7->pos.AsArray[0], temp_v0_7->pos.AsArray[2], arg0->pos.AsArray[0], arg0->pos.AsArray[2], 2, 30.0f, 30.0f, 0.0f, 1.0f) == 0)) || (sp3C != arg0->stan))) { phi_v1_3 = 0; } @@ -37834,7 +34792,7 @@ glabel object_collectability_routines /* 085210 7F0506E0 AFBF002C */ sw $ra, 0x2c($sp) /* 085214 7F0506E4 AFA40088 */ sw $a0, 0x88($sp) /* 085218 7F0506E8 8C840004 */ lw $a0, 4($a0) -/* 08521C 7F0506EC 0FC13803 */ jal check_if_collectable_object +/* 08521C 7F0506EC 0FC13803 */ jal objIsCollectable /* 085220 7F0506F0 AFA40084 */ sw $a0, 0x84($sp) /* 085224 7F0506F4 1040000B */ beqz $v0, .L7F050724 /* 085228 7F0506F8 8FA40084 */ lw $a0, 0x84($sp) @@ -37878,7 +34836,7 @@ glabel object_collectability_routines /* 0852B0 7F050780 10000167 */ b .L7F050D20 /* 0852B4 7F050784 00001025 */ move $v0, $zero .L7F050788: -/* 0852B8 7F050788 0FC0F9EB */ jal sub_GAME_7F03E7AC +/* 0852B8 7F050788 0FC0F9EB */ jal objCanPickupFromSafe /* 0852BC 7F05078C 00000000 */ nop /* 0852C0 7F050790 14400003 */ bnez $v0, .L7F0507A0 /* 0852C4 7F050794 8FA50084 */ lw $a1, 0x84($sp) @@ -38026,7 +34984,7 @@ glabel object_collectability_routines /* 0854C0 7F050990 240B0001 */ li $t3, 1 /* 0854C4 7F050994 AFAB006C */ sw $t3, 0x6c($sp) /* 0854C8 7F050998 00A02025 */ move $a0, $a1 -/* 0854CC 7F05099C 0FC0FFF0 */ jal do_something_if_object_destroyed +/* 0854CC 7F05099C 0FC0FFF0 */ jal objGetDestroyedLevel /* 0854D0 7F0509A0 AFAA0070 */ sw $t2, 0x70($sp) /* 0854D4 7F0509A4 10400003 */ beqz $v0, .L7F0509B4 /* 0854D8 7F0509A8 8FA30070 */ lw $v1, 0x70($sp) @@ -38254,7 +35212,7 @@ glabel object_collectability_routines /* 085800 7F050CD0 E7A00018 */ swc1 $f0, 0x18($sp) /* 085804 7F050CD4 E7A80010 */ swc1 $f8, 0x10($sp) /* 085808 7F050CD8 E7B00024 */ swc1 $f16, 0x24($sp) -/* 08580C 7F050CDC 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 08580C 7F050CDC 0FC2C389 */ jal stanTestLineUnobstructed /* 085810 7F050CE0 E7AA0020 */ swc1 $f10, 0x20($sp) /* 085814 7F050CE4 10400006 */ beqz $v0, .L7F050D00 /* 085818 7F050CE8 8FA30040 */ lw $v1, 0x40($sp) @@ -38298,7 +35256,7 @@ glabel object_collectability_routines /* 085658 7F050AE8 AFB00030 */ sw $s0, 0x30($sp) /* 08565C 7F050AEC AFA40090 */ sw $a0, 0x90($sp) /* 085660 7F050AF0 8C840004 */ lw $a0, 4($a0) -/* 085664 7F050AF4 0FC13904 */ jal check_if_collectable_object +/* 085664 7F050AF4 0FC13904 */ jal objIsCollectable /* 085668 7F050AF8 AFA4008C */ sw $a0, 0x8c($sp) /* 08566C 7F050AFC 1040000B */ beqz $v0, .Ljp7F050B2C /* 085670 7F050B00 8FA4008C */ lw $a0, 0x8c($sp) @@ -38342,7 +35300,7 @@ glabel object_collectability_routines /* 0856F8 7F050B88 100001A3 */ b .Ljp7F051218 /* 0856FC 7F050B8C 00001025 */ move $v0, $zero .Ljp7F050B90: -/* 085700 7F050B90 0FC0FAAB */ jal sub_GAME_7F03E7AC +/* 085700 7F050B90 0FC0FAAB */ jal objCanPickupFromSafe /* 085704 7F050B94 00000000 */ nop /* 085708 7F050B98 14400003 */ bnez $v0, .Ljp7F050BA8 /* 08570C 7F050B9C 8FA5008C */ lw $a1, 0x8c($sp) @@ -38528,7 +35486,7 @@ glabel object_collectability_routines /* 08598C 7F050E1C 8D300004 */ lw $s0, 4($t1) /* 085990 7F050E20 240A0001 */ li $t2, 1 /* 085994 7F050E24 AFAA0074 */ sw $t2, 0x74($sp) -/* 085998 7F050E28 0FC100B0 */ jal do_something_if_object_destroyed +/* 085998 7F050E28 0FC100B0 */ jal objGetDestroyedLevel /* 08599C 7F050E2C 00A02025 */ move $a0, $a1 /* 0859A0 7F050E30 10400003 */ beqz $v0, .Ljp7F050E40 /* 0859A4 7F050E34 02001825 */ move $v1, $s0 @@ -38790,7 +35748,7 @@ glabel object_collectability_routines /* 085D3C 7F0511CC E7A00018 */ swc1 $f0, 0x18($sp) /* 085D40 7F0511D0 E7A80010 */ swc1 $f8, 0x10($sp) /* 085D44 7F0511D4 E7B00024 */ swc1 $f16, 0x24($sp) -/* 085D48 7F0511D8 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 085D48 7F0511D8 0FC2C675 */ jal stanTestLineUnobstructed /* 085D4C 7F0511DC E7AA0020 */ swc1 $f10, 0x20($sp) /* 085D50 7F0511E0 10400005 */ beqz $v0, .Ljp7F0511F8 /* 085D54 7F0511E4 8FAC0090 */ lw $t4, 0x90($sp) @@ -38834,7 +35792,7 @@ glabel object_collectability_routines /* 085658 7F050AE8 AFB00030 */ sw $s0, 0x30($sp) /* 08565C 7F050AEC AFA40090 */ sw $a0, 0x90($sp) /* 085660 7F050AF0 8C840004 */ lw $a0, 4($a0) -/* 085664 7F050AF4 0FC13904 */ jal check_if_collectable_object +/* 085664 7F050AF4 0FC13904 */ jal objIsCollectable /* 085668 7F050AF8 AFA4008C */ sw $a0, 0x8c($sp) /* 08566C 7F050AFC 1040000B */ beqz $v0, .Ljp7F050B2C /* 085670 7F050B00 8FA4008C */ lw $a0, 0x8c($sp) @@ -38878,7 +35836,7 @@ glabel object_collectability_routines /* 0856F8 7F050B88 100001A3 */ b .Ljp7F051218 /* 0856FC 7F050B8C 00001025 */ move $v0, $zero .Ljp7F050B90: -/* 085700 7F050B90 0FC0FAAB */ jal sub_GAME_7F03E7AC +/* 085700 7F050B90 0FC0FAAB */ jal objCanPickupFromSafe /* 085704 7F050B94 00000000 */ nop /* 085708 7F050B98 14400003 */ bnez $v0, .Ljp7F050BA8 /* 08570C 7F050B9C 8FA5008C */ lw $a1, 0x8c($sp) @@ -39064,7 +36022,7 @@ glabel object_collectability_routines /* 08598C 7F050E1C 8D300004 */ lw $s0, 4($t1) /* 085990 7F050E20 240A0001 */ li $t2, 1 /* 085994 7F050E24 AFAA0074 */ sw $t2, 0x74($sp) -/* 085998 7F050E28 0FC100B0 */ jal do_something_if_object_destroyed +/* 085998 7F050E28 0FC100B0 */ jal objGetDestroyedLevel /* 08599C 7F050E2C 00A02025 */ move $a0, $a1 /* 0859A0 7F050E30 10400003 */ beqz $v0, .Ljp7F050E40 /* 0859A4 7F050E34 02001825 */ move $v1, $s0 @@ -39326,7 +36284,7 @@ glabel object_collectability_routines /* 085D3C 7F0511CC E7A00018 */ swc1 $f0, 0x18($sp) /* 085D40 7F0511D0 E7A80010 */ swc1 $f8, 0x10($sp) /* 085D44 7F0511D4 E7B00024 */ swc1 $f16, 0x24($sp) -/* 085D48 7F0511D8 0FC2C675 */ jal sub_GAME_7F0B0E24 +/* 085D48 7F0511D8 0FC2C675 */ jal stanTestLineUnobstructed /* 085D4C 7F0511DC E7AA0020 */ swc1 $f10, 0x20($sp) /* 085D50 7F0511E0 10400005 */ beqz $v0, .Ljp7F0511F8 /* 085D54 7F0511E4 8FAC0090 */ lw $t4, 0x90($sp) @@ -39387,131 +36345,73 @@ bool sub_GAME_7F050D30(PropRecord *prop, coord3d *arg1, f32 *arg2, f32 *arg3) } -#ifdef NONMATCHING -void sub_GAME_7F050DE8(void) { +void sub_GAME_7F050DE8(Model* model) +{ + ModelNode* node; + ModelFileHeader* header; + union ModelRoData* rodata; + union ModelRwData* rwdata; + + header = model->obj; + node = header->RootNode; + + while (node != NULL) + { + switch (node->Opcode & 0xFF) + { + case MODELNODE_OPCODE_DLCOLLISION: + rodata = node->Data; + rwdata = modelGetNodeRwData(model, node); + + if ((rwdata->DisplayListCollisions.Vertices != rodata->DisplayListCollisions.Vertices) && (sub_GAME_7F04B590(header, node) != 0)) + { + sub_GAME_7F09C044(rwdata->DisplayListCollisions.Vertices); + rwdata->DisplayListCollisions.Vertices = rodata->DisplayListCollisions.Vertices; + } + break; + case MODELNODE_OPCODE_LOD: + modelApplyDistanceRelations(model, node); + break; + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(model, node); + break; + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); + break; + } + if (node->Child) + { + node = node->Child; + } + else + { + while (node) + { + if (node->Next) + { + node = node->Next; + break; + } + + node = node->Parent; + } + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F050DE8 -/* 085918 7F050DE8 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 08591C 7F050DEC AFBF003C */ sw $ra, 0x3c($sp) -/* 085920 7F050DF0 AFBE0038 */ sw $fp, 0x38($sp) -/* 085924 7F050DF4 AFB70034 */ sw $s7, 0x34($sp) -/* 085928 7F050DF8 AFB60030 */ sw $s6, 0x30($sp) -/* 08592C 7F050DFC AFB5002C */ sw $s5, 0x2c($sp) -/* 085930 7F050E00 AFB40028 */ sw $s4, 0x28($sp) -/* 085934 7F050E04 AFB30024 */ sw $s3, 0x24($sp) -/* 085938 7F050E08 AFB20020 */ sw $s2, 0x20($sp) -/* 08593C 7F050E0C AFB1001C */ sw $s1, 0x1c($sp) -/* 085940 7F050E10 AFB00018 */ sw $s0, 0x18($sp) -/* 085944 7F050E14 8C940008 */ lw $s4, 8($a0) -/* 085948 7F050E18 00809825 */ move $s3, $a0 -/* 08594C 7F050E1C 24150008 */ li $s5, 8 -/* 085950 7F050E20 8E900000 */ lw $s0, ($s4) -/* 085954 7F050E24 24160012 */ li $s6, 18 -/* 085958 7F050E28 24170017 */ li $s7, 23 -/* 08595C 7F050E2C 1200003C */ beqz $s0, .L7F050F20 -/* 085960 7F050E30 241E0018 */ li $fp, 24 -/* 085964 7F050E34 96020000 */ lhu $v0, ($s0) -.L7F050E38: -/* 085968 7F050E38 02602025 */ move $a0, $s3 -/* 08596C 7F050E3C 304E00FF */ andi $t6, $v0, 0xff -/* 085970 7F050E40 11D5001C */ beq $t6, $s5, .L7F050EB4 -/* 085974 7F050E44 00000000 */ nop -/* 085978 7F050E48 11D6001E */ beq $t6, $s6, .L7F050EC4 -/* 08597C 7F050E4C 02602025 */ move $a0, $s3 -/* 085980 7F050E50 11D70020 */ beq $t6, $s7, .L7F050ED4 -/* 085984 7F050E54 02602025 */ move $a0, $s3 -/* 085988 7F050E58 11DE0003 */ beq $t6, $fp, .L7F050E68 -/* 08598C 7F050E5C 02602025 */ move $a0, $s3 -/* 085990 7F050E60 1000001F */ b .L7F050EE0 -/* 085994 7F050E64 8E020014 */ lw $v0, 0x14($s0) -.L7F050E68: -/* 085998 7F050E68 8E120004 */ lw $s2, 4($s0) -/* 08599C 7F050E6C 0FC1B1E7 */ jal modelGetNodeRwData -/* 0859A0 7F050E70 02002825 */ move $a1, $s0 -/* 0859A4 7F050E74 8E4F0008 */ lw $t7, 8($s2) -/* 0859A8 7F050E78 8C580000 */ lw $t8, ($v0) -/* 0859AC 7F050E7C 00408825 */ move $s1, $v0 -/* 0859B0 7F050E80 02802025 */ move $a0, $s4 -/* 0859B4 7F050E84 11F80009 */ beq $t7, $t8, .L7F050EAC -/* 0859B8 7F050E88 00000000 */ nop -/* 0859BC 7F050E8C 0FC12D64 */ jal sub_GAME_7F04B590 -/* 0859C0 7F050E90 02002825 */ move $a1, $s0 -/* 0859C4 7F050E94 10400005 */ beqz $v0, .L7F050EAC -/* 0859C8 7F050E98 00000000 */ nop -/* 0859CC 7F050E9C 0FC27011 */ jal sub_GAME_7F09C044 -/* 0859D0 7F050EA0 8E240000 */ lw $a0, ($s1) -/* 0859D4 7F050EA4 8E590008 */ lw $t9, 8($s2) -/* 0859D8 7F050EA8 AE390000 */ sw $t9, ($s1) -.L7F050EAC: -/* 0859DC 7F050EAC 1000000C */ b .L7F050EE0 -/* 0859E0 7F050EB0 8E020014 */ lw $v0, 0x14($s0) -.L7F050EB4: -/* 0859E4 7F050EB4 0FC1BA5C */ jal sub_GAME_7F06E970 -/* 0859E8 7F050EB8 02002825 */ move $a1, $s0 -/* 0859EC 7F050EBC 10000008 */ b .L7F050EE0 -/* 0859F0 7F050EC0 8E020014 */ lw $v0, 0x14($s0) -.L7F050EC4: -/* 0859F4 7F050EC4 0FC1BA6F */ jal process_12_handle_switch -/* 0859F8 7F050EC8 02002825 */ move $a1, $s0 -/* 0859FC 7F050ECC 10000004 */ b .L7F050EE0 -/* 085A00 7F050ED0 8E020014 */ lw $v0, 0x14($s0) -.L7F050ED4: -/* 085A04 7F050ED4 0FC1BA82 */ jal process_17_pointer_to_head -/* 085A08 7F050ED8 02002825 */ move $a1, $s0 -/* 085A0C 7F050EDC 8E020014 */ lw $v0, 0x14($s0) -.L7F050EE0: -/* 085A10 7F050EE0 10400003 */ beqz $v0, .L7F050EF0 -/* 085A14 7F050EE4 00000000 */ nop -/* 085A18 7F050EE8 1000000B */ b .L7F050F18 -/* 085A1C 7F050EEC 00408025 */ move $s0, $v0 -.L7F050EF0: -/* 085A20 7F050EF0 12000009 */ beqz $s0, .L7F050F18 -/* 085A24 7F050EF4 00000000 */ nop -/* 085A28 7F050EF8 8E02000C */ lw $v0, 0xc($s0) -.L7F050EFC: -/* 085A2C 7F050EFC 50400004 */ beql $v0, $zero, .L7F050F10 -/* 085A30 7F050F00 8E100008 */ lw $s0, 8($s0) -/* 085A34 7F050F04 10000004 */ b .L7F050F18 -/* 085A38 7F050F08 00408025 */ move $s0, $v0 -/* 085A3C 7F050F0C 8E100008 */ lw $s0, 8($s0) -.L7F050F10: -/* 085A40 7F050F10 5600FFFA */ bnezl $s0, .L7F050EFC -/* 085A44 7F050F14 8E02000C */ lw $v0, 0xc($s0) -.L7F050F18: -/* 085A48 7F050F18 5600FFC7 */ bnezl $s0, .L7F050E38 -/* 085A4C 7F050F1C 96020000 */ lhu $v0, ($s0) -.L7F050F20: -/* 085A50 7F050F20 8FBF003C */ lw $ra, 0x3c($sp) -/* 085A54 7F050F24 8FB00018 */ lw $s0, 0x18($sp) -/* 085A58 7F050F28 8FB1001C */ lw $s1, 0x1c($sp) -/* 085A5C 7F050F2C 8FB20020 */ lw $s2, 0x20($sp) -/* 085A60 7F050F30 8FB30024 */ lw $s3, 0x24($sp) -/* 085A64 7F050F34 8FB40028 */ lw $s4, 0x28($sp) -/* 085A68 7F050F38 8FB5002C */ lw $s5, 0x2c($sp) -/* 085A6C 7F050F3C 8FB60030 */ lw $s6, 0x30($sp) -/* 085A70 7F050F40 8FB70034 */ lw $s7, 0x34($sp) -/* 085A74 7F050F44 8FBE0038 */ lw $fp, 0x38($sp) -/* 085A78 7F050F48 03E00008 */ jr $ra -/* 085A7C 7F050F4C 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif -PropRecord *sub_GAME_7F050F50(WeaponObjRecord *weapon, ChrRecord *chr, ModelFileHeader *filedata, PropRecord *prop, Model *model) +PropRecord *hatApplyToChr(HatRecord *hat, ChrRecord *chr, ModelFileHeader *filedata, PropRecord *prop, Model *model) { - prop = init_standard_object((ObjectRecord*)weapon, filedata, prop, model); + prop = objInit((ObjectRecord*)hat, filedata, prop, model); - if (prop && weapon->model) + if (prop && hat->model) { - f32 scale = weapon->extrascale * (1.0f / 256.0f); + f32 scale = hat->extrascale * (1.0f / 256.0f); - modelSetScale(weapon->model, weapon->model->scale * scale); - weapon->model->attachedto = chr->model; - weapon->model->attachedto_objinst = chr->model->obj->Switches[6]; + modelSetScale(hat->model, hat->model->scale * scale); + hat->model->attachedto = chr->model; + hat->model->attachedto_objinst = chr->model->obj->Switches[6]; chrpropReparent(prop, chr->prop); chr->handle_positiondata_hat = prop; @@ -39521,822 +36421,377 @@ PropRecord *sub_GAME_7F050F50(WeaponObjRecord *weapon, ChrRecord *chr, ModelFile } -void sub_GAME_7F051028(ObjectRecord *arg0, PropRecord *arg1) +void hatLoadAndApplyToChr(HatRecord *hat, PropRecord *arg1) { s32 unused; s32 obj_idx; - obj_idx = (u32) arg0->obj; + obj_idx = (u32) hat->obj; modelLoad(obj_idx); - sub_GAME_7F050F50(arg0, arg1, PitemZ_entries[obj_idx].header, NULL, 0); + hatApplyToChr(hat, arg1, PitemZ_entries[obj_idx].header, NULL, 0); } -void hatAssignToChr(ObjectRecord* hat, ChrRecord* chr) +void hatAssignToChr(HatRecord* hat, ChrRecord* chr) { hat->damage = (*(s32*)&hat->damage / M_U16_MAX_VALUE_F); - sub_GAME_7F051028(hat, chr); + hatLoadAndApplyToChr(hat, chr); } -#ifdef NONMATCHING -//chrTryEquipHat -PropRecord *chrTryEquipHat(ChrRecord *self, s32 index, s32 flags) +PropRecord *hatCreateForChr(ChrRecord *chr, s32 modelnum, u32 flags) { - ItemModelFileRecord *model; - s32 sp30; - PropRecord *lastprop; - PropRecord *prop; - s32 *temp_t1; - s32 *temp_t4; - s32 *temp_t8; - ObjectRecord *obj; - void *temp_t5; - s32 *phi_t8; - s32 *phi_t1; - s32 *phi_t4; - void *phi_t5; - - model = &PitemZ_entries[index]; - modelLoad(index); - lastprop = chrpropAllocate(); - prop = get_obj_instance_controller_for_header(model); - prop = prop; - obj = hatCreate(lastprop == 0, prop == 0, model); - lastprop = lastprop; - if (lastprop == 0) - { - lastprop = chrpropAllocate(); - } - prop = prop; - lastprop = lastprop; - if (prop == 0) - { - prop = get_obj_instance_controller_for_header(model); - } - if ((obj != 0) && (lastprop != 0) && (prop != 0)) - { - *obj = blank_11_object; - - obj->obj = index; - obj->flags = flags | 0x4000; - obj->pad = self->chrnum; - lastprop = sub_GAME_7F050F50(obj, self, model, lastprop, prop); + ModelFileHeader *modeldef; + PropRecord *prop; + Model *model; + HatRecord *hat; + + modeldef = PitemZ_entries[modelnum].header; + + modelLoad(modelnum); + prop = propAllocate(); + model = get_obj_instance_controller_for_header(modeldef); + hat = hatCreate(prop == NULL, model == NULL, modeldef); + + if (prop == NULL) + { + prop = propAllocate(); + } + + if (model == NULL) + { + model = get_obj_instance_controller_for_header(modeldef); + } + + if (hat && prop && model) + { + HatRecord tmp = { + 0x0100, // extrascale + 0x0, // state + 0x11, // type + 0, // obj + 0, // pad + 0x00004000, // flags + 0, // flags2 + NULL, // prop + NULL, // model + + { 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, // mtx + + { 0.0f, 0.0f, 0.0f }, // runtime_pos + + { 0x00000000 }, // runtime_bitflags + NULL, // ptr_allocated_collisiondata_block + NULL, // projectile/embedment + 0.0f, // maxdamage + 1000.0f, // damage + { 0xFF, 0xFF, 0xFF, 0x00 }, // shadecol + { 0xFF, 0xFF, 0xFF, 0x00 }, // nextcol + }; + + *hat = tmp; + + hat->obj = modelnum; + hat->flags = flags | PROPFLAG_ASSIGNEDTOCHR; + hat->pad = chr->chrnum; + + prop = hatApplyToChr(hat, chr, modeldef, prop, model); } else { - if (prop != 0) + if (model) { - clear_model_obj(prop); + clear_model_obj(model); } - if (lastprop != 0) + + if (prop) { - chrpropFree(lastprop); - lastprop = NULL; + chrpropFree(prop); + prop = NULL; } } - return lastprop; + + return prop; } -#else -GLOBAL_ASM( -.text -glabel chrTryEquipHat -/* 085BF0 7F0510C0 27BDFF40 */ addiu $sp, $sp, -0xc0 -/* 085BF4 7F0510C4 00057080 */ sll $t6, $a1, 2 -/* 085BF8 7F0510C8 01C57023 */ subu $t6, $t6, $a1 -/* 085BFC 7F0510CC 000E7080 */ sll $t6, $t6, 2 -/* 085C00 7F0510D0 3C0F8004 */ lui $t7, %hi(PitemZ_entries) -/* 085C04 7F0510D4 01EE7821 */ addu $t7, $t7, $t6 -/* 085C08 7F0510D8 8DEFA228 */ lw $t7, %lo(PitemZ_entries)($t7) -/* 085C0C 7F0510DC AFBF002C */ sw $ra, 0x2c($sp) -/* 085C10 7F0510E0 AFA400C0 */ sw $a0, 0xc0($sp) -/* 085C14 7F0510E4 AFB20028 */ sw $s2, 0x28($sp) -/* 085C18 7F0510E8 AFB10024 */ sw $s1, 0x24($sp) -/* 085C1C 7F0510EC AFB00020 */ sw $s0, 0x20($sp) -/* 085C20 7F0510F0 AFA600C8 */ sw $a2, 0xc8($sp) -/* 085C24 7F0510F4 00A02025 */ move $a0, $a1 -/* 085C28 7F0510F8 AFA500C4 */ sw $a1, 0xc4($sp) -/* 085C2C 7F0510FC 0FC15B0E */ jal modelLoad -/* 085C30 7F051100 AFAF00BC */ sw $t7, 0xbc($sp) -/* 085C34 7F051104 0FC0E90C */ jal chrpropAllocate -/* 085C38 7F051108 00000000 */ nop -/* 085C3C 7F05110C 00408025 */ move $s0, $v0 -/* 085C40 7F051110 0FC1B025 */ jal get_obj_instance_controller_for_header -/* 085C44 7F051114 8FA400BC */ lw $a0, 0xbc($sp) -/* 085C48 7F051118 00408825 */ move $s1, $v0 -/* 085C4C 7F05111C 2E040001 */ sltiu $a0, $s0, 1 -/* 085C50 7F051120 2C450001 */ sltiu $a1, $v0, 1 -/* 085C54 7F051124 0FC1456C */ jal hatCreate -/* 085C58 7F051128 8FA600BC */ lw $a2, 0xbc($sp) -/* 085C5C 7F05112C 16000004 */ bnez $s0, .L7F051140 -/* 085C60 7F051130 00409025 */ move $s2, $v0 -/* 085C64 7F051134 0FC0E90C */ jal chrpropAllocate -/* 085C68 7F051138 00000000 */ nop -/* 085C6C 7F05113C 00408025 */ move $s0, $v0 -.L7F051140: -/* 085C70 7F051140 16200004 */ bnez $s1, .L7F051154 -/* 085C74 7F051144 00000000 */ nop -/* 085C78 7F051148 0FC1B025 */ jal get_obj_instance_controller_for_header -/* 085C7C 7F05114C 8FA400BC */ lw $a0, 0xbc($sp) -/* 085C80 7F051150 00408825 */ move $s1, $v0 -.L7F051154: -/* 085C84 7F051154 12400035 */ beqz $s2, .L7F05122C -/* 085C88 7F051158 00000000 */ nop -/* 085C8C 7F05115C 12000033 */ beqz $s0, .L7F05122C -/* 085C90 7F051160 00000000 */ nop -/* 085C94 7F051164 12200031 */ beqz $s1, .L7F05122C -/* 085C98 7F051168 27A20030 */ addiu $v0, $sp, 0x30 -/* 085C9C 7F05116C 3C188003 */ lui $t8, %hi(blank_11_object) -/* 085CA0 7F051170 27182114 */ addiu $t8, %lo(blank_11_object) # addiu $t8, $t8, 0x2114 -/* 085CA4 7F051174 8FA500C0 */ lw $a1, 0xc0($sp) -/* 085CA8 7F051178 27080078 */ addiu $t0, $t8, 0x78 -/* 085CAC 7F05117C 00404825 */ move $t1, $v0 -.L7F051180: -/* 085CB0 7F051180 8F010000 */ lw $at, ($t8) -/* 085CB4 7F051184 2718000C */ addiu $t8, $t8, 0xc -/* 085CB8 7F051188 2529000C */ addiu $t1, $t1, 0xc -/* 085CBC 7F05118C AD21FFF4 */ sw $at, -0xc($t1) -/* 085CC0 7F051190 8F01FFF8 */ lw $at, -8($t8) -/* 085CC4 7F051194 AD21FFF8 */ sw $at, -8($t1) -/* 085CC8 7F051198 8F01FFFC */ lw $at, -4($t8) -/* 085CCC 7F05119C 1708FFF8 */ bne $t8, $t0, .L7F051180 -/* 085CD0 7F0511A0 AD21FFFC */ sw $at, -4($t1) -/* 085CD4 7F0511A4 8F010000 */ lw $at, ($t8) -/* 085CD8 7F0511A8 00406025 */ move $t4, $v0 -/* 085CDC 7F0511AC 02406825 */ move $t5, $s2 -/* 085CE0 7F0511B0 AD210000 */ sw $at, ($t1) -/* 085CE4 7F0511B4 8F080004 */ lw $t0, 4($t8) -/* 085CE8 7F0511B8 244B0078 */ addiu $t3, $v0, 0x78 -/* 085CEC 7F0511BC AD280004 */ sw $t0, 4($t1) -.L7F0511C0: -/* 085CF0 7F0511C0 8D810000 */ lw $at, ($t4) -/* 085CF4 7F0511C4 258C000C */ addiu $t4, $t4, 0xc -/* 085CF8 7F0511C8 25AD000C */ addiu $t5, $t5, 0xc -/* 085CFC 7F0511CC ADA1FFF4 */ sw $at, -0xc($t5) -/* 085D00 7F0511D0 8D81FFF8 */ lw $at, -8($t4) -/* 085D04 7F0511D4 ADA1FFF8 */ sw $at, -8($t5) -/* 085D08 7F0511D8 8D81FFFC */ lw $at, -4($t4) -/* 085D0C 7F0511DC 158BFFF8 */ bne $t4, $t3, .L7F0511C0 -/* 085D10 7F0511E0 ADA1FFFC */ sw $at, -4($t5) -/* 085D14 7F0511E4 8D810000 */ lw $at, ($t4) -/* 085D18 7F0511E8 02402025 */ move $a0, $s2 -/* 085D1C 7F0511EC 02003825 */ move $a3, $s0 -/* 085D20 7F0511F0 ADA10000 */ sw $at, ($t5) -/* 085D24 7F0511F4 8D8B0004 */ lw $t3, 4($t4) -/* 085D28 7F0511F8 ADAB0004 */ sw $t3, 4($t5) -/* 085D2C 7F0511FC 8FAE00C4 */ lw $t6, 0xc4($sp) -/* 085D30 7F051200 A64E0004 */ sh $t6, 4($s2) -/* 085D34 7F051204 8FAF00C8 */ lw $t7, 0xc8($sp) -/* 085D38 7F051208 35F94000 */ ori $t9, $t7, 0x4000 -/* 085D3C 7F05120C AE590008 */ sw $t9, 8($s2) -/* 085D40 7F051210 84A80000 */ lh $t0, ($a1) -/* 085D44 7F051214 A6480006 */ sh $t0, 6($s2) -/* 085D48 7F051218 AFB10010 */ sw $s1, 0x10($sp) -/* 085D4C 7F05121C 0FC143D4 */ jal sub_GAME_7F050F50 -/* 085D50 7F051220 8FA600BC */ lw $a2, 0xbc($sp) -/* 085D54 7F051224 1000000A */ b .L7F051250 -/* 085D58 7F051228 00408025 */ move $s0, $v0 -.L7F05122C: -/* 085D5C 7F05122C 12200003 */ beqz $s1, .L7F05123C -/* 085D60 7F051230 00000000 */ nop -/* 085D64 7F051234 0FC1B08D */ jal clear_model_obj -/* 085D68 7F051238 02202025 */ move $a0, $s1 -.L7F05123C: -/* 085D6C 7F05123C 52000005 */ beql $s0, $zero, .L7F051254 -/* 085D70 7F051240 8FBF002C */ lw $ra, 0x2c($sp) -/* 085D74 7F051244 0FC0E921 */ jal chrpropFree -/* 085D78 7F051248 02002025 */ move $a0, $s0 -/* 085D7C 7F05124C 00008025 */ move $s0, $zero -.L7F051250: -/* 085D80 7F051250 8FBF002C */ lw $ra, 0x2c($sp) -.L7F051254: -/* 085D84 7F051254 02001025 */ move $v0, $s0 -/* 085D88 7F051258 8FB00020 */ lw $s0, 0x20($sp) -/* 085D8C 7F05125C 8FB10024 */ lw $s1, 0x24($sp) -/* 085D90 7F051260 8FB20028 */ lw $s2, 0x28($sp) -/* 085D94 7F051264 03E00008 */ jr $ra -/* 085D98 7F051268 27BD00C0 */ addiu $sp, $sp, 0xc0 -) -#endif +// PD: weaponCreate +WeaponObjRecord* weaponCreate(bool musthaveprop, bool musthavemodel, ModelFileHeader *modeldef) +{ + s32 i; + WeaponObjRecord *tmp; + WeaponObjRecord *sp4c = NULL; + WeaponObjRecord *sp48 = NULL; + s32 sp44 = -1; + s32 sp40 = -1; + s32 sp3c = -1; + + for (i = g_NextWeaponSlot; TRUE; ) + { + if (g_WeaponSlots[i].prop == NULL) + { + if (!musthaveprop && !musthavemodel) + { + sp44 = i; + break; + } + } else if ((g_WeaponSlots[i].runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0 && (g_WeaponSlots[i].state & 4) == 0) + { + WeaponObjRecord* slot = &g_WeaponSlots[i]; + if (((slot->timer <= 0) && (slot->prop->parent == NULL)) + || (((slot->weaponnum == ITEM_REMOTEMINE) || (slot->weaponnum == ITEM_PROXIMITYMINE) || (slot->weaponnum == ITEM_TIMEDMINE)) + && ((slot->prop->parent == NULL) || (slot->prop->parent->type == PROP_TYPE_OBJ) || (slot->prop->parent->type == PROP_TYPE_DOOR) || (slot->prop->parent->type == PROP_TYPE_WEAPON)))) + { + if (!musthavemodel || modelmgrCanSlotFitRwdata(slot->model, modeldef)) + { + if ((slot->prop->flags & PROPFLAG_ONSCREEN) == 0 && sp40 < 0) + { + sp40 = i; + } + if (sp3c < 0) + { + sp3c = i; + } + } + } + } -#ifdef NONMATCHING -void sub_GAME_7F05126C(void) { + i = (i + 1) % MAX_WEAPON_SLOTS; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05126C -/* 085D9C 7F05126C 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 085DA0 7F051270 AFB10020 */ sw $s1, 0x20($sp) -/* 085DA4 7F051274 240EFFFF */ li $t6, -1 -/* 085DA8 7F051278 3C078003 */ lui $a3, %hi(D_80030AF8) -/* 085DAC 7F05127C 3C0B8007 */ lui $t3, %hi(ProjectileData_start_address) -/* 085DB0 7F051280 00A08825 */ move $s1, $a1 -/* 085DB4 7F051284 AFBF0024 */ sw $ra, 0x24($sp) -/* 085DB8 7F051288 AFB0001C */ sw $s0, 0x1c($sp) -/* 085DBC 7F05128C AFA40058 */ sw $a0, 0x58($sp) -/* 085DC0 7F051290 AFA60060 */ sw $a2, 0x60($sp) -/* 085DC4 7F051294 AFA0004C */ sw $zero, 0x4c($sp) -/* 085DC8 7F051298 AFA00048 */ sw $zero, 0x48($sp) -/* 085DCC 7F05129C AFAE0044 */ sw $t6, 0x44($sp) -/* 085DD0 7F0512A0 2408FFFF */ li $t0, -1 -/* 085DD4 7F0512A4 2409FFFF */ li $t1, -1 -/* 085DD8 7F0512A8 256B1E80 */ addiu $t3, %lo(ProjectileData_start_address) # addiu $t3, $t3, 0x1e80 -/* 085DDC 7F0512AC 8CE70AF8 */ lw $a3, %lo(D_80030AF8)($a3) -/* 085DE0 7F0512B0 240A0088 */ li $t2, 136 -.L7F0512B4: -/* 085DE4 7F0512B4 00EA0019 */ multu $a3, $t2 -/* 085DE8 7F0512B8 8FB80058 */ lw $t8, 0x58($sp) -/* 085DEC 7F0512BC 00007812 */ mflo $t7 -/* 085DF0 7F0512C0 016F8021 */ addu $s0, $t3, $t7 -/* 085DF4 7F0512C4 8E040010 */ lw $a0, 0x10($s0) -/* 085DF8 7F0512C8 54800008 */ bnezl $a0, .L7F0512EC -/* 085DFC 7F0512CC 8E190064 */ lw $t9, 0x64($s0) -/* 085E00 7F0512D0 57000040 */ bnezl $t8, .L7F0513D4 -/* 085E04 7F0512D4 24E70001 */ addiu $a3, $a3, 1 -/* 085E08 7F0512D8 5620003E */ bnezl $s1, .L7F0513D4 -/* 085E0C 7F0512DC 24E70001 */ addiu $a3, $a3, 1 -/* 085E10 7F0512E0 10000043 */ b .L7F0513F0 -/* 085E14 7F0512E4 AFA70044 */ sw $a3, 0x44($sp) -/* 085E18 7F0512E8 8E190064 */ lw $t9, 0x64($s0) -.L7F0512EC: -/* 085E1C 7F0512EC 332C0080 */ andi $t4, $t9, 0x80 -/* 085E20 7F0512F0 55800038 */ bnezl $t4, .L7F0513D4 -/* 085E24 7F0512F4 24E70001 */ addiu $a3, $a3, 1 -/* 085E28 7F0512F8 920D0002 */ lbu $t5, 2($s0) -/* 085E2C 7F0512FC 31AE0004 */ andi $t6, $t5, 4 -/* 085E30 7F051300 55C00034 */ bnezl $t6, .L7F0513D4 -/* 085E34 7F051304 24E70001 */ addiu $a3, $a3, 1 -/* 085E38 7F051308 860F0082 */ lh $t7, 0x82($s0) -/* 085E3C 7F05130C 5DE00005 */ bgtzl $t7, .L7F051324 -/* 085E40 7F051310 82020080 */ lb $v0, 0x80($s0) -/* 085E44 7F051314 8C98001C */ lw $t8, 0x1c($a0) -/* 085E48 7F051318 13000014 */ beqz $t8, .L7F05136C -/* 085E4C 7F05131C 00000000 */ nop -/* 085E50 7F051320 82020080 */ lb $v0, 0x80($s0) -.L7F051324: -/* 085E54 7F051324 2401001D */ li $at, 29 -/* 085E58 7F051328 10410005 */ beq $v0, $at, .L7F051340 -/* 085E5C 7F05132C 2401001C */ li $at, 28 -/* 085E60 7F051330 10410003 */ beq $v0, $at, .L7F051340 -/* 085E64 7F051334 2401001B */ li $at, 27 -/* 085E68 7F051338 54410026 */ bnel $v0, $at, .L7F0513D4 -/* 085E6C 7F05133C 24E70001 */ addiu $a3, $a3, 1 -.L7F051340: -/* 085E70 7F051340 8C83001C */ lw $v1, 0x1c($a0) -/* 085E74 7F051344 10600009 */ beqz $v1, .L7F05136C -/* 085E78 7F051348 00000000 */ nop -/* 085E7C 7F05134C 90620000 */ lbu $v0, ($v1) -/* 085E80 7F051350 24010001 */ li $at, 1 -/* 085E84 7F051354 10410005 */ beq $v0, $at, .L7F05136C -/* 085E88 7F051358 24010002 */ li $at, 2 -/* 085E8C 7F05135C 10410003 */ beq $v0, $at, .L7F05136C -/* 085E90 7F051360 24010004 */ li $at, 4 -/* 085E94 7F051364 5441001B */ bnel $v0, $at, .L7F0513D4 -/* 085E98 7F051368 24E70001 */ addiu $a3, $a3, 1 -.L7F05136C: -/* 085E9C 7F05136C 1220000E */ beqz $s1, .L7F0513A8 -/* 085EA0 7F051370 8FA50060 */ lw $a1, 0x60($sp) -/* 085EA4 7F051374 8E040014 */ lw $a0, 0x14($s0) -/* 085EA8 7F051378 AFA70054 */ sw $a3, 0x54($sp) -/* 085EAC 7F05137C AFA80040 */ sw $t0, 0x40($sp) -/* 085EB0 7F051380 0FC1B018 */ jal modelmgrCanSlotFitRwdata -/* 085EB4 7F051384 AFA9003C */ sw $t1, 0x3c($sp) -/* 085EB8 7F051388 3C0B8007 */ lui $t3, %hi(ProjectileData_start_address) -/* 085EBC 7F05138C 256B1E80 */ addiu $t3, %lo(ProjectileData_start_address) # addiu $t3, $t3, 0x1e80 -/* 085EC0 7F051390 8FA70054 */ lw $a3, 0x54($sp) -/* 085EC4 7F051394 8FA80040 */ lw $t0, 0x40($sp) -/* 085EC8 7F051398 8FA9003C */ lw $t1, 0x3c($sp) -/* 085ECC 7F05139C 1040000C */ beqz $v0, .L7F0513D0 -/* 085ED0 7F0513A0 240A0088 */ li $t2, 136 -/* 085ED4 7F0513A4 8E040010 */ lw $a0, 0x10($s0) -.L7F0513A8: -/* 085ED8 7F0513A8 90990001 */ lbu $t9, 1($a0) -/* 085EDC 7F0513AC 332C0002 */ andi $t4, $t9, 2 -/* 085EE0 7F0513B0 15800004 */ bnez $t4, .L7F0513C4 -/* 085EE4 7F0513B4 00000000 */ nop -/* 085EE8 7F0513B8 05010002 */ bgez $t0, .L7F0513C4 -/* 085EEC 7F0513BC 00000000 */ nop -/* 085EF0 7F0513C0 00E04025 */ move $t0, $a3 -.L7F0513C4: -/* 085EF4 7F0513C4 05230003 */ bgezl $t1, .L7F0513D4 -/* 085EF8 7F0513C8 24E70001 */ addiu $a3, $a3, 1 -/* 085EFC 7F0513CC 00E04825 */ move $t1, $a3 -.L7F0513D0: -/* 085F00 7F0513D0 24E70001 */ addiu $a3, $a3, 1 -.L7F0513D4: -/* 085F04 7F0513D4 2401001E */ li $at, 30 -/* 085F08 7F0513D8 00E1001A */ div $zero, $a3, $at -/* 085F0C 7F0513DC 3C0E8003 */ lui $t6, %hi(D_80030AF8) -/* 085F10 7F0513E0 8DCE0AF8 */ lw $t6, %lo(D_80030AF8)($t6) -/* 085F14 7F0513E4 00003810 */ mfhi $a3 -/* 085F18 7F0513E8 14EEFFB2 */ bne $a3, $t6, .L7F0512B4 -/* 085F1C 7F0513EC 00000000 */ nop -.L7F0513F0: -/* 085F20 7F0513F0 8FAF0044 */ lw $t7, 0x44($sp) -/* 085F24 7F0513F4 24040008 */ li $a0, 8 -/* 085F28 7F0513F8 27A5004C */ addiu $a1, $sp, 0x4c -/* 085F2C 7F0513FC 05E0000C */ bltz $t7, .L7F051430 -/* 085F30 7F051400 27A60048 */ addiu $a2, $sp, 0x48 -/* 085F34 7F051404 25F80001 */ addiu $t8, $t7, 1 -/* 085F38 7F051408 2401001E */ li $at, 30 -/* 085F3C 7F05140C 0301001A */ div $zero, $t8, $at -/* 085F40 7F051410 0000C810 */ mfhi $t9 -/* 085F44 7F051414 3C018003 */ lui $at, %hi(D_80030AF8) -/* 085F48 7F051418 AC390AF8 */ sw $t9, %lo(D_80030AF8)($at) -/* 085F4C 7F05141C 01EA0019 */ multu $t7, $t2 -/* 085F50 7F051420 00006012 */ mflo $t4 -/* 085F54 7F051424 016C1021 */ addu $v0, $t3, $t4 -/* 085F58 7F051428 10000053 */ b .L7F051578 -/* 085F5C 7F05142C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F051430: -/* 085F60 7F051430 8FAD0060 */ lw $t5, 0x60($sp) -/* 085F64 7F051434 8FA70058 */ lw $a3, 0x58($sp) -/* 085F68 7F051438 AFB10010 */ sw $s1, 0x10($sp) -/* 085F6C 7F05143C AFA80040 */ sw $t0, 0x40($sp) -/* 085F70 7F051440 AFA9003C */ sw $t1, 0x3c($sp) -/* 085F74 7F051444 0FC15BC2 */ jal setupFindObjForReuse -/* 085F78 7F051448 AFAD0014 */ sw $t5, 0x14($sp) -/* 085F7C 7F05144C 3C0B8007 */ lui $t3, %hi(ProjectileData_start_address) -/* 085F80 7F051450 256B1E80 */ addiu $t3, %lo(ProjectileData_start_address) # addiu $t3, $t3, 0x1e80 -/* 085F84 7F051454 8FA80040 */ lw $t0, 0x40($sp) -/* 085F88 7F051458 8FA9003C */ lw $t1, 0x3c($sp) -/* 085F8C 7F05145C 10400003 */ beqz $v0, .L7F05146C -/* 085F90 7F051460 240A0088 */ li $t2, 136 -/* 085F94 7F051464 10000044 */ b .L7F051578 -/* 085F98 7F051468 8FBF0024 */ lw $ra, 0x24($sp) -.L7F05146C: -/* 085F9C 7F05146C 05000015 */ bltz $t0, .L7F0514C4 -/* 085FA0 7F051470 8FAF004C */ lw $t7, 0x4c($sp) -/* 085FA4 7F051474 010A0019 */ multu $t0, $t2 -/* 085FA8 7F051478 24050001 */ li $a1, 1 -/* 085FAC 7F05147C 00008012 */ mflo $s0 -/* 085FB0 7F051480 01702021 */ addu $a0, $t3, $s0 -/* 085FB4 7F051484 8C8E0010 */ lw $t6, 0x10($a0) -/* 085FB8 7F051488 51C00007 */ beql $t6, $zero, .L7F0514A8 -/* 085FBC 7F05148C 25180001 */ addiu $t8, $t0, 1 -/* 085FC0 7F051490 0FC10409 */ jal objFreePermanently -/* 085FC4 7F051494 AFA80040 */ sw $t0, 0x40($sp) -/* 085FC8 7F051498 3C0B8007 */ lui $t3, %hi(ProjectileData_start_address) -/* 085FCC 7F05149C 256B1E80 */ addiu $t3, %lo(ProjectileData_start_address) # addiu $t3, $t3, 0x1e80 -/* 085FD0 7F0514A0 8FA80040 */ lw $t0, 0x40($sp) -/* 085FD4 7F0514A4 25180001 */ addiu $t8, $t0, 1 -.L7F0514A8: -/* 085FD8 7F0514A8 2401001E */ li $at, 30 -/* 085FDC 7F0514AC 0301001A */ div $zero, $t8, $at -/* 085FE0 7F0514B0 0000C810 */ mfhi $t9 -/* 085FE4 7F0514B4 3C018003 */ lui $at, %hi(D_80030AF8) -/* 085FE8 7F0514B8 AC390AF8 */ sw $t9, %lo(D_80030AF8)($at) -/* 085FEC 7F0514BC 1000002D */ b .L7F051574 -/* 085FF0 7F0514C0 01701021 */ addu $v0, $t3, $s0 -.L7F0514C4: -/* 085FF4 7F0514C4 11E00009 */ beqz $t7, .L7F0514EC -/* 085FF8 7F0514C8 00000000 */ nop -/* 085FFC 7F0514CC 8DEC0010 */ lw $t4, 0x10($t7) -/* 086000 7F0514D0 01E02025 */ move $a0, $t7 -/* 086004 7F0514D4 11800003 */ beqz $t4, .L7F0514E4 -/* 086008 7F0514D8 00000000 */ nop -/* 08600C 7F0514DC 0FC10409 */ jal objFreePermanently -/* 086010 7F0514E0 24050001 */ li $a1, 1 -.L7F0514E4: -/* 086014 7F0514E4 10000023 */ b .L7F051574 -/* 086018 7F0514E8 8FA2004C */ lw $v0, 0x4c($sp) -.L7F0514EC: -/* 08601C 7F0514EC 05220016 */ bltzl $t1, .L7F051548 -/* 086020 7F0514F0 8FB90048 */ lw $t9, 0x48($sp) -/* 086024 7F0514F4 012A0019 */ multu $t1, $t2 -/* 086028 7F0514F8 24050001 */ li $a1, 1 -/* 08602C 7F0514FC 00008012 */ mflo $s0 -/* 086030 7F051500 01702021 */ addu $a0, $t3, $s0 -/* 086034 7F051504 8C8D0010 */ lw $t5, 0x10($a0) -/* 086038 7F051508 51A00007 */ beql $t5, $zero, .L7F051528 -/* 08603C 7F05150C 252E0001 */ addiu $t6, $t1, 1 -/* 086040 7F051510 0FC10409 */ jal objFreePermanently -/* 086044 7F051514 AFA9003C */ sw $t1, 0x3c($sp) -/* 086048 7F051518 3C0B8007 */ lui $t3, %hi(ProjectileData_start_address) -/* 08604C 7F05151C 256B1E80 */ addiu $t3, %lo(ProjectileData_start_address) # addiu $t3, $t3, 0x1e80 -/* 086050 7F051520 8FA9003C */ lw $t1, 0x3c($sp) -/* 086054 7F051524 252E0001 */ addiu $t6, $t1, 1 -.L7F051528: -/* 086058 7F051528 2401001E */ li $at, 30 -/* 08605C 7F05152C 01C1001A */ div $zero, $t6, $at -/* 086060 7F051530 0000C010 */ mfhi $t8 -/* 086064 7F051534 3C018003 */ lui $at, %hi(D_80030AF8) -/* 086068 7F051538 AC380AF8 */ sw $t8, %lo(D_80030AF8)($at) -/* 08606C 7F05153C 1000000D */ b .L7F051574 -/* 086070 7F051540 01701021 */ addu $v0, $t3, $s0 -/* 086074 7F051544 8FB90048 */ lw $t9, 0x48($sp) -.L7F051548: -/* 086078 7F051548 5320000A */ beql $t9, $zero, .L7F051574 -/* 08607C 7F05154C 00001025 */ move $v0, $zero -/* 086080 7F051550 8F2C0010 */ lw $t4, 0x10($t9) -/* 086084 7F051554 03202025 */ move $a0, $t9 -/* 086088 7F051558 11800003 */ beqz $t4, .L7F051568 -/* 08608C 7F05155C 00000000 */ nop -/* 086090 7F051560 0FC10409 */ jal objFreePermanently -/* 086094 7F051564 24050001 */ li $a1, 1 -.L7F051568: -/* 086098 7F051568 10000002 */ b .L7F051574 -/* 08609C 7F05156C 8FA20048 */ lw $v0, 0x48($sp) -/* 0860A0 7F051570 00001025 */ move $v0, $zero -.L7F051574: -/* 0860A4 7F051574 8FBF0024 */ lw $ra, 0x24($sp) -.L7F051578: -/* 0860A8 7F051578 8FB0001C */ lw $s0, 0x1c($sp) -/* 0860AC 7F05157C 8FB10020 */ lw $s1, 0x20($sp) -/* 0860B0 7F051580 03E00008 */ jr $ra -/* 0860B4 7F051584 27BD0058 */ addiu $sp, $sp, 0x58 -) -#endif + if (i == g_NextWeaponSlot) + { + break; + } + } + if (sp44 >= 0) + { + g_NextWeaponSlot = (sp44 + 1) % MAX_WEAPON_SLOTS; + return &g_WeaponSlots[sp44]; + } + tmp = (WeaponObjRecord *)setupFindObjForReuse(PROPDEF_COLLECTABLE, (ObjectRecord **)&sp4c, (ObjectRecord **)&sp48, musthaveprop, musthavemodel, modeldef); + if (tmp) + { + return tmp; + } + if (sp40 >= 0) + { + if (g_WeaponSlots[sp40].prop) + { + objFreePermanently((ObjectRecord *)&g_WeaponSlots[sp40], TRUE); + } -#ifdef NONMATCHING -void sub_GAME_7F051588(void) { + g_NextWeaponSlot = (sp40 + 1) % MAX_WEAPON_SLOTS; + return (g_WeaponSlots + sp40); + } -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F051588 -/* 0860B8 7F051588 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0860BC 7F05158C AFBF0014 */ sw $ra, 0x14($sp) -/* 0860C0 7F051590 00002025 */ move $a0, $zero -/* 0860C4 7F051594 00002825 */ move $a1, $zero -/* 0860C8 7F051598 0FC1449B */ jal sub_GAME_7F05126C -/* 0860CC 7F05159C 00003025 */ move $a2, $zero -/* 0860D0 7F0515A0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0860D4 7F0515A4 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0860D8 7F0515A8 03E00008 */ jr $ra -/* 0860DC 7F0515AC 00000000 */ nop -) -#endif + if (sp4c) + { + if (sp4c->prop) + { + objFreePermanently((ObjectRecord *)sp4c, TRUE); + } + + return sp4c; + } + if (sp3c >= 0) + { + if (g_WeaponSlots[sp3c].prop) + { + objFreePermanently((ObjectRecord *)&g_WeaponSlots[sp3c], TRUE); + } + g_NextWeaponSlot = (sp3c + 1) % MAX_WEAPON_SLOTS; + return (g_WeaponSlots + sp3c); + } + if (sp48) + { + if (sp48->prop) + { + objFreePermanently((ObjectRecord *)sp48, TRUE); + } + return sp48; + } + + return NULL; +} -#ifdef NONMATCHING -void hatCreate(void) { +void sub_GAME_7F051588(void) +{ + weaponCreate(FALSE, FALSE, NULL); } -#else -GLOBAL_ASM( -.text -glabel hatCreate -/* 0860E0 7F0515B0 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 0860E4 7F0515B4 AFB50034 */ sw $s5, 0x34($sp) -/* 0860E8 7F0515B8 3C158003 */ lui $s5, %hi(D_80030AFC) -/* 0860EC 7F0515BC AFB40030 */ sw $s4, 0x30($sp) -/* 0860F0 7F0515C0 26B50AFC */ addiu $s5, %lo(D_80030AFC) # addiu $s5, $s5, 0xafc -/* 0860F4 7F0515C4 AFB60038 */ sw $s6, 0x38($sp) -/* 0860F8 7F0515C8 AFB3002C */ sw $s3, 0x2c($sp) -/* 0860FC 7F0515CC AFB20028 */ sw $s2, 0x28($sp) -/* 086100 7F0515D0 AFB10024 */ sw $s1, 0x24($sp) -/* 086104 7F0515D4 240EFFFF */ li $t6, -1 -/* 086108 7F0515D8 3C148007 */ lui $s4, %hi(dword_CODE_bss_80072E70) -/* 08610C 7F0515DC 00A09025 */ move $s2, $a1 -/* 086110 7F0515E0 AFBF003C */ sw $ra, 0x3c($sp) -/* 086114 7F0515E4 AFB00020 */ sw $s0, 0x20($sp) -/* 086118 7F0515E8 AFA60070 */ sw $a2, 0x70($sp) -/* 08611C 7F0515EC 00803825 */ move $a3, $a0 -/* 086120 7F0515F0 AFA0005C */ sw $zero, 0x5c($sp) -/* 086124 7F0515F4 AFA00058 */ sw $zero, 0x58($sp) -/* 086128 7F0515F8 AFAE0054 */ sw $t6, 0x54($sp) -/* 08612C 7F0515FC 2411FFFF */ li $s1, -1 -/* 086130 7F051600 2413FFFF */ li $s3, -1 -/* 086134 7F051604 26942E70 */ addiu $s4, %lo(dword_CODE_bss_80072E70) # addiu $s4, $s4, 0x2e70 -/* 086138 7F051608 2416000A */ li $s6, 10 -/* 08613C 7F05160C 8EA30000 */ lw $v1, ($s5) -/* 086140 7F051610 000379C0 */ sll $t7, $v1, 7 -.L7F051614: -/* 086144 7F051614 028F8021 */ addu $s0, $s4, $t7 -/* 086148 7F051618 8E020010 */ lw $v0, 0x10($s0) -/* 08614C 7F05161C 54400008 */ bnezl $v0, .L7F051640 -/* 086150 7F051620 8E180064 */ lw $t8, 0x64($s0) -/* 086154 7F051624 54E00022 */ bnezl $a3, .L7F0516B0 -/* 086158 7F051628 246B0001 */ addiu $t3, $v1, 1 -/* 08615C 7F05162C 56400020 */ bnezl $s2, .L7F0516B0 -/* 086160 7F051630 246B0001 */ addiu $t3, $v1, 1 -/* 086164 7F051634 1000002C */ b .L7F0516E8 -/* 086168 7F051638 AFA30054 */ sw $v1, 0x54($sp) -/* 08616C 7F05163C 8E180064 */ lw $t8, 0x64($s0) -.L7F051640: -/* 086170 7F051640 33190080 */ andi $t9, $t8, 0x80 -/* 086174 7F051644 5720001A */ bnezl $t9, .L7F0516B0 -/* 086178 7F051648 246B0001 */ addiu $t3, $v1, 1 -/* 08617C 7F05164C 8C48001C */ lw $t0, 0x1c($v0) -/* 086180 7F051650 55000017 */ bnezl $t0, .L7F0516B0 -/* 086184 7F051654 246B0001 */ addiu $t3, $v1, 1 -/* 086188 7F051658 5240000B */ beql $s2, $zero, .L7F051688 -/* 08618C 7F05165C 90490001 */ lbu $t1, 1($v0) -/* 086190 7F051660 8E040014 */ lw $a0, 0x14($s0) -/* 086194 7F051664 8FA50070 */ lw $a1, 0x70($sp) -/* 086198 7F051668 AFA30064 */ sw $v1, 0x64($sp) -/* 08619C 7F05166C 0FC1B018 */ jal modelmgrCanSlotFitRwdata -/* 0861A0 7F051670 AFA70068 */ sw $a3, 0x68($sp) -/* 0861A4 7F051674 8FA30064 */ lw $v1, 0x64($sp) -/* 0861A8 7F051678 1040000C */ beqz $v0, .L7F0516AC -/* 0861AC 7F05167C 8FA70068 */ lw $a3, 0x68($sp) -/* 0861B0 7F051680 8E020010 */ lw $v0, 0x10($s0) -/* 0861B4 7F051684 90490001 */ lbu $t1, 1($v0) -.L7F051688: -/* 0861B8 7F051688 312A0002 */ andi $t2, $t1, 2 -/* 0861BC 7F05168C 15400004 */ bnez $t2, .L7F0516A0 -/* 0861C0 7F051690 00000000 */ nop -/* 0861C4 7F051694 06210002 */ bgez $s1, .L7F0516A0 -/* 0861C8 7F051698 00000000 */ nop -/* 0861CC 7F05169C 00608825 */ move $s1, $v1 -.L7F0516A0: -/* 0861D0 7F0516A0 06630003 */ bgezl $s3, .L7F0516B0 -/* 0861D4 7F0516A4 246B0001 */ addiu $t3, $v1, 1 -/* 0861D8 7F0516A8 00609825 */ move $s3, $v1 -.L7F0516AC: -/* 0861DC 7F0516AC 246B0001 */ addiu $t3, $v1, 1 -.L7F0516B0: -/* 0861E0 7F0516B0 0176001A */ div $zero, $t3, $s6 -/* 0861E4 7F0516B4 8EAC0000 */ lw $t4, ($s5) -/* 0861E8 7F0516B8 00001810 */ mfhi $v1 -/* 0861EC 7F0516BC 16C00002 */ bnez $s6, .L7F0516C8 -/* 0861F0 7F0516C0 00000000 */ nop -/* 0861F4 7F0516C4 0007000D */ break 7 -.L7F0516C8: -/* 0861F8 7F0516C8 2401FFFF */ li $at, -1 -/* 0861FC 7F0516CC 16C10004 */ bne $s6, $at, .L7F0516E0 -/* 086200 7F0516D0 3C018000 */ lui $at, 0x8000 -/* 086204 7F0516D4 15610002 */ bne $t3, $at, .L7F0516E0 -/* 086208 7F0516D8 00000000 */ nop -/* 08620C 7F0516DC 0006000D */ break 6 -.L7F0516E0: -/* 086210 7F0516E0 546CFFCC */ bnel $v1, $t4, .L7F051614 -/* 086214 7F0516E4 000379C0 */ sll $t7, $v1, 7 -.L7F0516E8: -/* 086218 7F0516E8 8FAD0054 */ lw $t5, 0x54($sp) -/* 08621C 7F0516EC 05A00011 */ bltz $t5, .L7F051734 -/* 086220 7F0516F0 25AE0001 */ addiu $t6, $t5, 1 -/* 086224 7F0516F4 01D6001A */ div $zero, $t6, $s6 -/* 086228 7F0516F8 8FB80054 */ lw $t8, 0x54($sp) -/* 08622C 7F0516FC 00007810 */ mfhi $t7 -/* 086230 7F051700 AEAF0000 */ sw $t7, ($s5) -/* 086234 7F051704 16C00002 */ bnez $s6, .L7F051710 -/* 086238 7F051708 00000000 */ nop -/* 08623C 7F05170C 0007000D */ break 7 -.L7F051710: -/* 086240 7F051710 2401FFFF */ li $at, -1 -/* 086244 7F051714 16C10004 */ bne $s6, $at, .L7F051728 -/* 086248 7F051718 3C018000 */ lui $at, 0x8000 -/* 08624C 7F05171C 15C10002 */ bne $t6, $at, .L7F051728 -/* 086250 7F051720 00000000 */ nop -/* 086254 7F051724 0006000D */ break 6 -.L7F051728: -/* 086258 7F051728 0018C9C0 */ sll $t9, $t8, 7 -/* 08625C 7F05172C 10000054 */ b .L7F051880 -/* 086260 7F051730 02991021 */ addu $v0, $s4, $t9 -.L7F051734: -/* 086264 7F051734 8FA80070 */ lw $t0, 0x70($sp) -/* 086268 7F051738 24040011 */ li $a0, 17 -/* 08626C 7F05173C 27A5005C */ addiu $a1, $sp, 0x5c -/* 086270 7F051740 27A60058 */ addiu $a2, $sp, 0x58 -/* 086274 7F051744 AFB20010 */ sw $s2, 0x10($sp) -/* 086278 7F051748 0FC15BC2 */ jal setupFindObjForReuse -/* 08627C 7F05174C AFA80014 */ sw $t0, 0x14($sp) -/* 086280 7F051750 10400003 */ beqz $v0, .L7F051760 -/* 086284 7F051754 00401825 */ move $v1, $v0 -/* 086288 7F051758 10000049 */ b .L7F051880 -/* 08628C 7F05175C 00601025 */ move $v0, $v1 -.L7F051760: -/* 086290 7F051760 06220019 */ bltzl $s1, .L7F0517C8 -/* 086294 7F051764 8FAE005C */ lw $t6, 0x5c($sp) -/* 086298 7F051768 001149C0 */ sll $t1, $s1, 7 -/* 08629C 7F05176C 02892021 */ addu $a0, $s4, $t1 -/* 0862A0 7F051770 8C8A0010 */ lw $t2, 0x10($a0) -/* 0862A4 7F051774 51400004 */ beql $t2, $zero, .L7F051788 -/* 0862A8 7F051778 262B0001 */ addiu $t3, $s1, 1 -/* 0862AC 7F05177C 0FC10409 */ jal objFreePermanently -/* 0862B0 7F051780 24050001 */ li $a1, 1 -/* 0862B4 7F051784 262B0001 */ addiu $t3, $s1, 1 -.L7F051788: -/* 0862B8 7F051788 0176001A */ div $zero, $t3, $s6 -/* 0862BC 7F05178C 00006010 */ mfhi $t4 -/* 0862C0 7F051790 001169C0 */ sll $t5, $s1, 7 -/* 0862C4 7F051794 16C00002 */ bnez $s6, .L7F0517A0 -/* 0862C8 7F051798 00000000 */ nop -/* 0862CC 7F05179C 0007000D */ break 7 -.L7F0517A0: -/* 0862D0 7F0517A0 2401FFFF */ li $at, -1 -/* 0862D4 7F0517A4 16C10004 */ bne $s6, $at, .L7F0517B8 -/* 0862D8 7F0517A8 3C018000 */ lui $at, 0x8000 -/* 0862DC 7F0517AC 15610002 */ bne $t3, $at, .L7F0517B8 -/* 0862E0 7F0517B0 00000000 */ nop -/* 0862E4 7F0517B4 0006000D */ break 6 -.L7F0517B8: -/* 0862E8 7F0517B8 AEAC0000 */ sw $t4, ($s5) -/* 0862EC 7F0517BC 10000030 */ b .L7F051880 -/* 0862F0 7F0517C0 028D1021 */ addu $v0, $s4, $t5 -/* 0862F4 7F0517C4 8FAE005C */ lw $t6, 0x5c($sp) -.L7F0517C8: -/* 0862F8 7F0517C8 11C00009 */ beqz $t6, .L7F0517F0 -/* 0862FC 7F0517CC 00000000 */ nop -/* 086300 7F0517D0 8DCF0010 */ lw $t7, 0x10($t6) -/* 086304 7F0517D4 01C02025 */ move $a0, $t6 -/* 086308 7F0517D8 11E00003 */ beqz $t7, .L7F0517E8 -/* 08630C 7F0517DC 00000000 */ nop -/* 086310 7F0517E0 0FC10409 */ jal objFreePermanently -/* 086314 7F0517E4 24050001 */ li $a1, 1 -.L7F0517E8: -/* 086318 7F0517E8 10000025 */ b .L7F051880 -/* 08631C 7F0517EC 8FA2005C */ lw $v0, 0x5c($sp) -.L7F0517F0: -/* 086320 7F0517F0 06600017 */ bltz $s3, .L7F051850 -/* 086324 7F0517F4 0013C1C0 */ sll $t8, $s3, 7 -/* 086328 7F0517F8 02982021 */ addu $a0, $s4, $t8 -/* 08632C 7F0517FC 8C990010 */ lw $t9, 0x10($a0) -/* 086330 7F051800 53200004 */ beql $t9, $zero, .L7F051814 -/* 086334 7F051804 26680001 */ addiu $t0, $s3, 1 -/* 086338 7F051808 0FC10409 */ jal objFreePermanently -/* 08633C 7F05180C 24050001 */ li $a1, 1 -/* 086340 7F051810 26680001 */ addiu $t0, $s3, 1 -.L7F051814: -/* 086344 7F051814 0116001A */ div $zero, $t0, $s6 -/* 086348 7F051818 00004810 */ mfhi $t1 -/* 08634C 7F05181C 001351C0 */ sll $t2, $s3, 7 -/* 086350 7F051820 16C00002 */ bnez $s6, .L7F05182C -/* 086354 7F051824 00000000 */ nop -/* 086358 7F051828 0007000D */ break 7 -.L7F05182C: -/* 08635C 7F05182C 2401FFFF */ li $at, -1 -/* 086360 7F051830 16C10004 */ bne $s6, $at, .L7F051844 -/* 086364 7F051834 3C018000 */ lui $at, 0x8000 -/* 086368 7F051838 15010002 */ bne $t0, $at, .L7F051844 -/* 08636C 7F05183C 00000000 */ nop -/* 086370 7F051840 0006000D */ break 6 -.L7F051844: -/* 086374 7F051844 AEA90000 */ sw $t1, ($s5) -/* 086378 7F051848 1000000D */ b .L7F051880 -/* 08637C 7F05184C 028A1021 */ addu $v0, $s4, $t2 -.L7F051850: -/* 086380 7F051850 8FAB0058 */ lw $t3, 0x58($sp) -/* 086384 7F051854 5160000A */ beql $t3, $zero, .L7F051880 -/* 086388 7F051858 00001025 */ move $v0, $zero -/* 08638C 7F05185C 8D6C0010 */ lw $t4, 0x10($t3) -/* 086390 7F051860 01602025 */ move $a0, $t3 -/* 086394 7F051864 11800003 */ beqz $t4, .L7F051874 -/* 086398 7F051868 00000000 */ nop -/* 08639C 7F05186C 0FC10409 */ jal objFreePermanently -/* 0863A0 7F051870 24050001 */ li $a1, 1 -.L7F051874: -/* 0863A4 7F051874 10000002 */ b .L7F051880 -/* 0863A8 7F051878 8FA20058 */ lw $v0, 0x58($sp) -/* 0863AC 7F05187C 00001025 */ move $v0, $zero -.L7F051880: -/* 0863B0 7F051880 8FBF003C */ lw $ra, 0x3c($sp) -/* 0863B4 7F051884 8FB00020 */ lw $s0, 0x20($sp) -/* 0863B8 7F051888 8FB10024 */ lw $s1, 0x24($sp) -/* 0863BC 7F05188C 8FB20028 */ lw $s2, 0x28($sp) -/* 0863C0 7F051890 8FB3002C */ lw $s3, 0x2c($sp) -/* 0863C4 7F051894 8FB40030 */ lw $s4, 0x30($sp) -/* 0863C8 7F051898 8FB50034 */ lw $s5, 0x34($sp) -/* 0863CC 7F05189C 8FB60038 */ lw $s6, 0x38($sp) -/* 0863D0 7F0518A0 03E00008 */ jr $ra -/* 0863D4 7F0518A4 27BD0068 */ addiu $sp, $sp, 0x68 -) -#endif +HatRecord *hatCreate(bool musthaveprop, bool musthavemodel, ModelFileHeader *modeldef) +{ + s32 i; + HatRecord *tmp; + HatRecord *sp5c = NULL; + HatRecord *sp58 = NULL; + s32 sp54 = -1; + s32 var_s1 = -1; + s32 var_s3 = -1; + + for (i = g_NextHatSlot; TRUE; ) + { + if (g_HatSlots[i].prop == NULL) + { + if (!musthaveprop && !musthavemodel) + { + sp54 = i; + break; + } + } + else if ((g_HatSlots[i].runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0 + && g_HatSlots[i].prop->parent == NULL + && (!musthavemodel || modelmgrCanSlotFitRwdata(g_HatSlots[i].model, modeldef))) + { + if ((g_HatSlots[i].prop->flags & PROPFLAG_ONSCREEN) == 0 && var_s1 < 0) + { + var_s1 = i; + } + + if (var_s3 < 0) + { + var_s3 = i; + } + } + i = (i + 1) % MAX_HAT_SLOTS; -// Returns struct hatobj* in PD -void* sub_GAME_7F0518A8(void) { - return hatCreate(0, 0, NULL); -} + if (i == g_NextHatSlot) + { + break; + } + } + + if (sp54 >= 0) + { + g_NextHatSlot = (sp54 + 1) % MAX_HAT_SLOTS; + return (g_HatSlots + sp54); + } + + tmp = (HatRecord *)setupFindObjForReuse(PROPDEF_HAT, (ObjectRecord **)&sp5c, (ObjectRecord **)&sp58, musthaveprop, musthavemodel, modeldef); + + if (tmp) + { + return tmp; + } + + if (var_s1 >= 0) + { + if (g_HatSlots[var_s1].prop) + { + objFreePermanently((ObjectRecord*)&g_HatSlots[var_s1], TRUE); + } + g_NextHatSlot = (var_s1 + 1) % MAX_HAT_SLOTS; + return (g_HatSlots + var_s1); + } + if (sp5c) + { + if (sp5c->prop) + { + objFreePermanently((ObjectRecord*)sp5c, TRUE); + } + return sp5c; + } + if (var_s3 >= 0) + { + if (g_HatSlots[var_s3].prop) + { + objFreePermanently((ObjectRecord*)&g_HatSlots[var_s3], TRUE); + } -#ifdef NONMATCHING -void sub_GAME_7F0518D0(void) { + g_NextHatSlot = (var_s3 + 1) % MAX_HAT_SLOTS; + return (g_HatSlots + var_s3); + } + + if (sp58) + { + if (sp58->prop) + { + objFreePermanently((ObjectRecord*)sp58, TRUE); + } + return sp58; + } + + return NULL; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0518D0 -/* 086400 7F0518D0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 086404 7F0518D4 3C048007 */ lui $a0, %hi(dword_CODE_bss_80073370) -/* 086408 7F0518D8 3C028007 */ lui $v0, %hi(dword_CODE_bss_80073DC0) -/* 08640C 7F0518DC AFBF0014 */ sw $ra, 0x14($sp) -/* 086410 7F0518E0 24423DC0 */ addiu $v0, %lo(dword_CODE_bss_80073DC0) # addiu $v0, $v0, 0x3dc0 -/* 086414 7F0518E4 24843370 */ addiu $a0, %lo(dword_CODE_bss_80073370) # addiu $a0, $a0, 0x3370 -/* 086418 7F0518E8 00001825 */ move $v1, $zero -.L7F0518EC: -/* 08641C 7F0518EC 8C8E0010 */ lw $t6, 0x10($a0) -/* 086420 7F0518F0 24840084 */ addiu $a0, $a0, 0x84 -/* 086424 7F0518F4 0082082B */ sltu $at, $a0, $v0 -/* 086428 7F0518F8 15C00004 */ bnez $t6, .L7F05190C -/* 08642C 7F0518FC 3C0F8007 */ lui $t7, %hi(dword_CODE_bss_80073370) -/* 086430 7F051900 25EF3370 */ addiu $t7, %lo(dword_CODE_bss_80073370) # addiu $t7, $t7, 0x3370 -/* 086434 7F051904 10000040 */ b .L7F051A08 -/* 086438 7F051908 006F1021 */ addu $v0, $v1, $t7 -.L7F05190C: -/* 08643C 7F05190C 1420FFF7 */ bnez $at, .L7F0518EC -/* 086440 7F051910 24630084 */ addiu $v1, $v1, 0x84 -/* 086444 7F051914 3C048007 */ lui $a0, %hi(dword_CODE_bss_80073370) -/* 086448 7F051918 3C058007 */ lui $a1, %hi(dword_CODE_bss_80073DC0) -/* 08644C 7F05191C 24A53DC0 */ addiu $a1, %lo(dword_CODE_bss_80073DC0) # addiu $a1, $a1, 0x3dc0 -/* 086450 7F051920 24843370 */ addiu $a0, %lo(dword_CODE_bss_80073370) # addiu $a0, $a0, 0x3370 -/* 086454 7F051924 00001825 */ move $v1, $zero -.L7F051928: -/* 086458 7F051928 8C980064 */ lw $t8, 0x64($a0) -/* 08645C 7F05192C 33190080 */ andi $t9, $t8, 0x80 -/* 086460 7F051930 57200016 */ bnezl $t9, .L7F05198C -/* 086464 7F051934 24840084 */ addiu $a0, $a0, 0x84 -/* 086468 7F051938 90880002 */ lbu $t0, 2($a0) -/* 08646C 7F05193C 31090004 */ andi $t1, $t0, 4 -/* 086470 7F051940 55200012 */ bnezl $t1, .L7F05198C -/* 086474 7F051944 24840084 */ addiu $a0, $a0, 0x84 -/* 086478 7F051948 8C820010 */ lw $v0, 0x10($a0) -/* 08647C 7F05194C 8C4A001C */ lw $t2, 0x1c($v0) -/* 086480 7F051950 5540000E */ bnezl $t2, .L7F05198C -/* 086484 7F051954 24840084 */ addiu $a0, $a0, 0x84 -/* 086488 7F051958 904B0001 */ lbu $t3, 1($v0) -/* 08648C 7F05195C 316C0002 */ andi $t4, $t3, 2 -/* 086490 7F051960 5580000A */ bnezl $t4, .L7F05198C -/* 086494 7F051964 24840084 */ addiu $a0, $a0, 0x84 -/* 086498 7F051968 24050001 */ li $a1, 1 -/* 08649C 7F05196C 0FC10409 */ jal objFreePermanently -/* 0864A0 7F051970 AFA30018 */ sw $v1, 0x18($sp) -/* 0864A4 7F051974 8FA30018 */ lw $v1, 0x18($sp) -/* 0864A8 7F051978 3C0D8007 */ lui $t5, %hi(dword_CODE_bss_80073370) -/* 0864AC 7F05197C 25AD3370 */ addiu $t5, %lo(dword_CODE_bss_80073370) # addiu $t5, $t5, 0x3370 -/* 0864B0 7F051980 10000021 */ b .L7F051A08 -/* 0864B4 7F051984 006D1021 */ addu $v0, $v1, $t5 -/* 0864B8 7F051988 24840084 */ addiu $a0, $a0, 0x84 -.L7F05198C: -/* 0864BC 7F05198C 0085082B */ sltu $at, $a0, $a1 -/* 0864C0 7F051990 1420FFE5 */ bnez $at, .L7F051928 -/* 0864C4 7F051994 24630084 */ addiu $v1, $v1, 0x84 -/* 0864C8 7F051998 3C048007 */ lui $a0, %hi(dword_CODE_bss_80073370) -/* 0864CC 7F05199C 3C028007 */ lui $v0, %hi(dword_CODE_bss_80073DC0) -/* 0864D0 7F0519A0 24423DC0 */ addiu $v0, %lo(dword_CODE_bss_80073DC0) # addiu $v0, $v0, 0x3dc0 -/* 0864D4 7F0519A4 24843370 */ addiu $a0, %lo(dword_CODE_bss_80073370) # addiu $a0, $a0, 0x3370 -/* 0864D8 7F0519A8 00001825 */ move $v1, $zero -.L7F0519AC: -/* 0864DC 7F0519AC 8C8E0064 */ lw $t6, 0x64($a0) -/* 0864E0 7F0519B0 31CF0080 */ andi $t7, $t6, 0x80 -/* 0864E4 7F0519B4 55E00011 */ bnezl $t7, .L7F0519FC -/* 0864E8 7F0519B8 24840084 */ addiu $a0, $a0, 0x84 -/* 0864EC 7F0519BC 90980002 */ lbu $t8, 2($a0) -/* 0864F0 7F0519C0 33190004 */ andi $t9, $t8, 4 -/* 0864F4 7F0519C4 5720000D */ bnezl $t9, .L7F0519FC -/* 0864F8 7F0519C8 24840084 */ addiu $a0, $a0, 0x84 -/* 0864FC 7F0519CC 8C880010 */ lw $t0, 0x10($a0) -/* 086500 7F0519D0 8D09001C */ lw $t1, 0x1c($t0) -/* 086504 7F0519D4 15200008 */ bnez $t1, .L7F0519F8 -/* 086508 7F0519D8 24050001 */ li $a1, 1 -/* 08650C 7F0519DC 0FC10409 */ jal objFreePermanently -/* 086510 7F0519E0 AFA30018 */ sw $v1, 0x18($sp) -/* 086514 7F0519E4 8FA30018 */ lw $v1, 0x18($sp) -/* 086518 7F0519E8 3C0A8007 */ lui $t2, %hi(dword_CODE_bss_80073370) -/* 08651C 7F0519EC 254A3370 */ addiu $t2, %lo(dword_CODE_bss_80073370) # addiu $t2, $t2, 0x3370 -/* 086520 7F0519F0 10000005 */ b .L7F051A08 -/* 086524 7F0519F4 006A1021 */ addu $v0, $v1, $t2 -.L7F0519F8: -/* 086528 7F0519F8 24840084 */ addiu $a0, $a0, 0x84 -.L7F0519FC: -/* 08652C 7F0519FC 1482FFEB */ bne $a0, $v0, .L7F0519AC -/* 086530 7F051A00 24630084 */ addiu $v1, $v1, 0x84 -/* 086534 7F051A04 00001025 */ move $v0, $zero -.L7F051A08: -/* 086538 7F051A08 8FBF0014 */ lw $ra, 0x14($sp) -/* 08653C 7F051A0C 27BD0020 */ addiu $sp, $sp, 0x20 -/* 086540 7F051A10 03E00008 */ jr $ra -/* 086544 7F051A14 00000000 */ nop -) -#endif +HatRecord* sub_GAME_7F0518A8(void) +{ + return hatCreate(0, 0, NULL); +} + +AmmoCrateRecord *ammocrateAllocate(void) +{ + s32 i; + + // Try to find a free one + for (i = 0; i < MAX_AMMO_CRATES; i++) + { + if (g_AmmoCrates[i].prop == NULL) + { + return (g_AmmoCrates + i); + } + } + + // Find one that can be freed off-screen + for (i = 0; i < MAX_AMMO_CRATES; i++) + { + if ((g_AmmoCrates[i].runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0 + && (g_AmmoCrates[i].state & 0x04) == 0 + && g_AmmoCrates[i].prop->parent == NULL + && (g_AmmoCrates[i].prop->flags & 0x02) == 0) + { + objFreePermanently(&g_AmmoCrates[i], TRUE); + return (g_AmmoCrates + i); + } + } + + // Find one that can be freed on-screen + for (i = 0; i < MAX_AMMO_CRATES; i++) + { + if ((g_AmmoCrates[i].runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0 + && (g_AmmoCrates[i].state & 0x04) == 0 + && g_AmmoCrates[i].prop->parent == NULL) + { + objFreePermanently(&g_AmmoCrates[i], TRUE); + return (g_AmmoCrates + i); + } + } + + return NULL; +} void trigger_remote_mine_detonation(void) { u32 uVar1 = 1 << (get_cur_playernum()); - D_80030AF4 = uVar1 | D_80030AF4; + g_RemoteMineOwnerTriggerFlag = uVar1 | g_RemoteMineOwnerTriggerFlag; sndPlaySfx(g_musicSfxBufferPtr, WATCH_DETONATE_MINE_SFX, NULL); } - - - - KeyRecord *check_if_entry_is_collectable(s32 ID, PropRecord *prop) //#MATCH { KeyRecord * key; @@ -40363,10 +36818,7 @@ KeyRecord *check_if_entry_is_collectable(s32 ID, PropRecord *prop) //#MATCH } - - - -ObjectRecord *weaponFindThrown(s32 ID) //MATCH +ObjectRecord *weaponFindThrown(s32 ID) { ObjectRecord *obj; PropRecord * prop; @@ -40383,45 +36835,45 @@ ObjectRecord *weaponFindThrown(s32 ID) //MATCH return NULL; } - - - - -void add_obj_to_temp_proxmine_table(WeaponObjRecord* proxy) { +void add_obj_to_temp_proxmine_table(WeaponObjRecord* proxy) +{ s32 i = 0; while (1) { - if (temp_mine_table[i] == NULL) { + if (temp_mine_table[i] == NULL) + { temp_mine_table[i] = proxy; return; } i++; - if (i == 30) { + if (i == 30) + { return; } } } - - - - -void remove_obj_from_temp_proxmine_table(WeaponObjRecord* proxy) { +void remove_obj_from_temp_proxmine_table(WeaponObjRecord* proxy) +{ s32 i = 0; - while (1) { - if (temp_mine_table[i] == proxy) { + while (1) + { + if (temp_mine_table[i] == proxy) + { temp_mine_table[i] = NULL; return; } i++; - if (i == 30) { + if (i == 30) + { return; } } } + void detonate_proxmine_In_range(coord3d* pos) { s32 i; @@ -40452,14 +36904,14 @@ void detonate_proxmine_In_range(coord3d* pos) void check_guard_detonate_proxmine(void) { ChrRecord* guard; - s32 num_guards; + s32 g_NumChrSlots; s32 i; - num_guards = get_numguards(); + g_NumChrSlots = get_numguards(); - for (i = 0; i < num_guards; i++) + for (i = 0; i < g_NumChrSlots; i++) { - guard = &ptr_guard_data[i]; + guard = &g_ChrSlots[i]; if ((guard->model != NULL) && (guard->hidden & 0x200)) { coord3d pos; @@ -40479,13 +36931,13 @@ void propweaponSetDual(WeaponObjRecord *leftweapon, WeaponObjRecord *rightweapon } -PropRecord* complete_object_data_block_return_position_entry(ObjectRecord* obj, ModelFileHeader* model_header, PropRecord* prop, Model* model) +PropRecord* complete_object_data_block_return_position_entry(WeaponObjRecord* obj, ModelFileHeader* model_header, PropRecord* prop, Model* model) { - prop = init_standard_object(obj, model_header, prop, model); + prop = objInit((ObjectRecord*)obj, model_header, prop, model); if (prop != NULL) { prop->type = 4; - sub_GAME_7F052574(prop, 0); + weaponSetGunfireVisible(prop, 0); } return prop; @@ -40496,23 +36948,22 @@ PropRecord* sub_GAME_7F051DD8(s32* arg0, ModelFileHeader* arg1) { PropRecord* prop; - prop = sub_GAME_7F0406F8(arg0, arg1); + prop = objInitWithModelDef(arg0, arg1); if (prop != NULL) { prop->type = PROP_TYPE_WEAPON; - sub_GAME_7F052574(prop, 0); + weaponSetGunfireVisible(prop, 0); } return prop; } -#ifdef NONMATCHING -//https://decomp.me/scratch/O9GXq -bool sub_GAME_7F051E1C(WeaponObjRecord *wep, ChrRecord *chr) //#99% nop missing and t out by 1 +bool chrEquipWeapon(WeaponObjRecord *wep, ChrRecord *chr) { - GUNHAND hand = wep->flags & 0x10000000; + WeaponObjRecord *wep2; + GUNHAND hand = wep->flags & PROPFLAG_WEAPON_LEFTHANDED; - if (wep->flags & 0x10000000) //if bit 28 true + if (wep->flags & PROPFLAG_WEAPON_LEFTHANDED) { hand = GUNLEFT; } @@ -40521,30 +36972,29 @@ bool sub_GAME_7F051E1C(WeaponObjRecord *wep, ChrRecord *chr) //#99% nop missing hand = GUNRIGHT; } - if (wep->prop && wep->model) + wep2 = wep; + if (wep2->prop && wep2->model) { - if (!(wep->flags & 0x20000000)) //if bit 29 false + if (!(wep2->flags & PROPFLAG_CONCEAL_GUN)) { - //need a NOP here - if (!chr->weapons_held[hand]) //if not has gun in hand already + if (!chr->weapons_held[hand]) { - wep->model->attachedto = chr->model; + wep2->model->attachedto = chr->model; - if (hand == GUNRIGHT) //normal + if (hand == GUNRIGHT) { - wep->model->unk1c = chr->model->obj->Switches[3]; + wep2->model->attachedto_objinst = chr->model->obj->Switches[3]; } else { - wep->model->unk1c = chr->model->obj->Switches[5]; + wep2->model->attachedto_objinst = chr->model->obj->Switches[5]; } - chr->weapons_held[hand] = wep->prop; //equip hand with prop. + chr->weapons_held[hand] = wep2->prop; - // check if duel wield - if (wep->flags & 0x80000000 && chr->weapons_held[1 - hand]) + if (wep2->flags & PROPFLAG_IS_DOUBLE && chr->weapons_held[1 - hand]) { - propweaponSetDual(wep, chr->weapons_held[1 - hand]->obj); + propweaponSetDual(wep2, chr->weapons_held[1 - hand]->obj); } } else @@ -40552,222 +37002,44 @@ bool sub_GAME_7F051E1C(WeaponObjRecord *wep, ChrRecord *chr) //#99% nop missing return FALSE; } } - chrpropReparent(wep->prop, chr->prop); + chrpropReparent(wep2->prop, chr->prop); } return TRUE; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F051E1C -/* 08694C 7F051E1C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 086950 7F051E20 AFBF0014 */ sw $ra, 0x14($sp) -/* 086954 7F051E24 8C820008 */ lw $v0, 8($a0) -/* 086958 7F051E28 00A03825 */ move $a3, $a1 -/* 08695C 7F051E2C 00803025 */ move $a2, $a0 -/* 086960 7F051E30 000270C0 */ sll $t6, $v0, 3 -/* 086964 7F051E34 05C10003 */ bgez $t6, .L7F051E44 -/* 086968 7F051E38 00002825 */ move $a1, $zero -/* 08696C 7F051E3C 10000001 */ b .L7F051E44 -/* 086970 7F051E40 24050001 */ li $a1, 1 -.L7F051E44: -/* 086974 7F051E44 8CC40010 */ lw $a0, 0x10($a2) -/* 086978 7F051E48 50800035 */ beql $a0, $zero, .L7F051F20 -/* 08697C 7F051E4C 24020001 */ li $v0, 1 -/* 086980 7F051E50 8CC30014 */ lw $v1, 0x14($a2) -/* 086984 7F051E54 00027880 */ sll $t7, $v0, 2 -/* 086988 7F051E58 50600031 */ beql $v1, $zero, .L7F051F20 -/* 08698C 7F051E5C 24020001 */ li $v0, 1 -/* 086990 7F051E60 05E0002C */ bltz $t7, .L7F051F14 -/* 086994 7F051E64 00000000 */ nop -/* 086998 7F051E68 00052080 */ sll $a0, $a1, 2 -/* 08699C 7F051E6C 00E41021 */ addu $v0, $a3, $a0 -/* 0869A0 7F051E70 8C580160 */ lw $t8, 0x160($v0) -/* 0869A4 7F051E74 17000025 */ bnez $t8, .L7F051F0C -/* 0869A8 7F051E78 00000000 */ nop -/* 0869AC 7F051E7C 8CF9001C */ lw $t9, 0x1c($a3) -/* 0869B0 7F051E80 14800008 */ bnez $a0, .L7F051EA4 -/* 0869B4 7F051E84 AC790018 */ sw $t9, 0x18($v1) -/* 0869B8 7F051E88 8CE8001C */ lw $t0, 0x1c($a3) -/* 0869BC 7F051E8C 8CCC0014 */ lw $t4, 0x14($a2) -/* 0869C0 7F051E90 8D090008 */ lw $t1, 8($t0) -/* 0869C4 7F051E94 8D2A0008 */ lw $t2, 8($t1) -/* 0869C8 7F051E98 8D4B000C */ lw $t3, 0xc($t2) -/* 0869CC 7F051E9C 10000007 */ b .L7F051EBC -/* 0869D0 7F051EA0 AD8B001C */ sw $t3, 0x1c($t4) -.L7F051EA4: -/* 0869D4 7F051EA4 8CED001C */ lw $t5, 0x1c($a3) -/* 0869D8 7F051EA8 8CD90014 */ lw $t9, 0x14($a2) -/* 0869DC 7F051EAC 8DAE0008 */ lw $t6, 8($t5) -/* 0869E0 7F051EB0 8DCF0008 */ lw $t7, 8($t6) -/* 0869E4 7F051EB4 8DF80014 */ lw $t8, 0x14($t7) -/* 0869E8 7F051EB8 AF38001C */ sw $t8, 0x1c($t9) -.L7F051EBC: -/* 0869EC 7F051EBC 8CC80010 */ lw $t0, 0x10($a2) -/* 0869F0 7F051EC0 00045823 */ negu $t3, $a0 -/* 0869F4 7F051EC4 00EB6021 */ addu $t4, $a3, $t3 -/* 0869F8 7F051EC8 AC480160 */ sw $t0, 0x160($v0) -/* 0869FC 7F051ECC 8CC90008 */ lw $t1, 8($a2) -/* 086A00 7F051ED0 00095000 */ sll $t2, $t1, 0 -/* 086A04 7F051ED4 0541000B */ bgez $t2, .L7F051F04 -/* 086A08 7F051ED8 00000000 */ nop -/* 086A0C 7F051EDC 8D820164 */ lw $v0, 0x164($t4) -/* 086A10 7F051EE0 00C02025 */ move $a0, $a2 -/* 086A14 7F051EE4 10400007 */ beqz $v0, .L7F051F04 -/* 086A18 7F051EE8 00000000 */ nop -/* 086A1C 7F051EEC 8C450004 */ lw $a1, 4($v0) -/* 086A20 7F051EF0 AFA7001C */ sw $a3, 0x1c($sp) -/* 086A24 7F051EF4 0FC1475D */ jal propweaponSetDual -/* 086A28 7F051EF8 AFA60018 */ sw $a2, 0x18($sp) -/* 086A2C 7F051EFC 8FA60018 */ lw $a2, 0x18($sp) -/* 086A30 7F051F00 8FA7001C */ lw $a3, 0x1c($sp) -.L7F051F04: -/* 086A34 7F051F04 10000003 */ b .L7F051F14 -/* 086A38 7F051F08 8CC40010 */ lw $a0, 0x10($a2) -.L7F051F0C: -/* 086A3C 7F051F0C 10000004 */ b .L7F051F20 -/* 086A40 7F051F10 00001025 */ move $v0, $zero -.L7F051F14: -/* 086A44 7F051F14 0FC0E969 */ jal chrpropReparent -/* 086A48 7F051F18 8CE50018 */ lw $a1, 0x18($a3) -/* 086A4C 7F051F1C 24020001 */ li $v0, 1 -.L7F051F20: -/* 086A50 7F051F20 8FBF0014 */ lw $ra, 0x14($sp) -/* 086A54 7F051F24 27BD0018 */ addiu $sp, $sp, 0x18 -/* 086A58 7F051F28 03E00008 */ jr $ra -/* 086A5C 7F051F2C 00000000 */ nop -) -#endif - +PropRecord *sub_GAME_7F051F30(WeaponObjRecord *weapon, ChrRecord *chr, ModelFileHeader *modeldef, PropRecord *prop, Model *model) +{ + prop = complete_object_data_block_return_position_entry(weapon, modeldef, prop, model); + if (prop && weapon->model) + { + f32 scale = weapon->extrascale * (1.0f / 256.0f); -#ifdef NONMATCHING -void sub_GAME_7F051F30(void) { + modelSetScale(weapon->model, weapon->model->scale * scale); + chrEquipWeapon(weapon, chr); + if (weapon->model); + } + return prop; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F051F30 -/* 086A60 7F051F30 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 086A64 7F051F34 AFA50024 */ sw $a1, 0x24($sp) -/* 086A68 7F051F38 AFA60028 */ sw $a2, 0x28($sp) -/* 086A6C 7F051F3C 00C02825 */ move $a1, $a2 -/* 086A70 7F051F40 AFBF001C */ sw $ra, 0x1c($sp) -/* 086A74 7F051F44 AFB00018 */ sw $s0, 0x18($sp) -/* 086A78 7F051F48 AFA7002C */ sw $a3, 0x2c($sp) -/* 086A7C 7F051F4C 00E03025 */ move $a2, $a3 -/* 086A80 7F051F50 00808025 */ move $s0, $a0 -/* 086A84 7F051F54 0FC14764 */ jal complete_object_data_block_return_position_entry -/* 086A88 7F051F58 8FA70030 */ lw $a3, 0x30($sp) -/* 086A8C 7F051F5C 10400018 */ beqz $v0, .L7F051FC0 -/* 086A90 7F051F60 AFA2002C */ sw $v0, 0x2c($sp) -/* 086A94 7F051F64 8E040014 */ lw $a0, 0x14($s0) -/* 086A98 7F051F68 50800016 */ beql $a0, $zero, .L7F051FC4 -/* 086A9C 7F051F6C 8FBF001C */ lw $ra, 0x1c($sp) -/* 086AA0 7F051F70 960E0000 */ lhu $t6, ($s0) -/* 086AA4 7F051F74 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 086AA8 7F051F78 448E2000 */ mtc1 $t6, $f4 -/* 086AAC 7F051F7C 05C10004 */ bgez $t6, .L7F051F90 -/* 086AB0 7F051F80 468021A0 */ cvt.s.w $f6, $f4 -/* 086AB4 7F051F84 44814000 */ mtc1 $at, $f8 -/* 086AB8 7F051F88 00000000 */ nop -/* 086ABC 7F051F8C 46083180 */ add.s $f6, $f6, $f8 -.L7F051F90: -/* 086AC0 7F051F90 3C013B80 */ li $at, 0x3B800000 # 0.003906 -/* 086AC4 7F051F94 44815000 */ mtc1 $at, $f10 -/* 086AC8 7F051F98 C4900014 */ lwc1 $f16, 0x14($a0) -/* 086ACC 7F051F9C 460A3002 */ mul.s $f0, $f6, $f10 -/* 086AD0 7F051FA0 00000000 */ nop -/* 086AD4 7F051FA4 46008482 */ mul.s $f18, $f16, $f0 -/* 086AD8 7F051FA8 44059000 */ mfc1 $a1, $f18 -/* 086ADC 7F051FAC 0FC1B39E */ jal modelSetScale -/* 086AE0 7F051FB0 00000000 */ nop -/* 086AE4 7F051FB4 02002025 */ move $a0, $s0 -/* 086AE8 7F051FB8 0FC14787 */ jal sub_GAME_7F051E1C -/* 086AEC 7F051FBC 8FA50024 */ lw $a1, 0x24($sp) -.L7F051FC0: -/* 086AF0 7F051FC0 8FBF001C */ lw $ra, 0x1c($sp) -.L7F051FC4: -/* 086AF4 7F051FC4 8FA2002C */ lw $v0, 0x2c($sp) -/* 086AF8 7F051FC8 8FB00018 */ lw $s0, 0x18($sp) -/* 086AFC 7F051FCC 03E00008 */ jr $ra -/* 086B00 7F051FD0 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F051FD4(void) { +void sub_GAME_7F051FD4(WeaponObjRecord *weapon, ChrRecord *chr) +{ + u32 stack; + s32 modelnum = weapon->obj; + modelLoad(modelnum); + sub_GAME_7F051F30(weapon, chr, PitemZ_entries[modelnum].header, 0, 0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F051FD4 -/* 086B04 7F051FD4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 086B08 7F051FD8 AFBF001C */ sw $ra, 0x1c($sp) -/* 086B0C 7F051FDC AFA40028 */ sw $a0, 0x28($sp) -/* 086B10 7F051FE0 AFA5002C */ sw $a1, 0x2c($sp) -/* 086B14 7F051FE4 84840004 */ lh $a0, 4($a0) -/* 086B18 7F051FE8 0FC15B0E */ jal modelLoad -/* 086B1C 7F051FEC AFA40020 */ sw $a0, 0x20($sp) -/* 086B20 7F051FF0 8FAF0020 */ lw $t7, 0x20($sp) -/* 086B24 7F051FF4 3C068004 */ lui $a2, %hi(PitemZ_entries) -/* 086B28 7F051FF8 8FA40028 */ lw $a0, 0x28($sp) -/* 086B2C 7F051FFC 000FC080 */ sll $t8, $t7, 2 -/* 086B30 7F052000 030FC023 */ subu $t8, $t8, $t7 -/* 086B34 7F052004 0018C080 */ sll $t8, $t8, 2 -/* 086B38 7F052008 00D83021 */ addu $a2, $a2, $t8 -/* 086B3C 7F05200C 8CC6A228 */ lw $a2, %lo(PitemZ_entries)($a2) -/* 086B40 7F052010 8FA5002C */ lw $a1, 0x2c($sp) -/* 086B44 7F052014 00003825 */ move $a3, $zero -/* 086B48 7F052018 0FC147CC */ jal sub_GAME_7F051F30 -/* 086B4C 7F05201C AFA00010 */ sw $zero, 0x10($sp) -/* 086B50 7F052020 8FBF001C */ lw $ra, 0x1c($sp) -/* 086B54 7F052024 27BD0028 */ addiu $sp, $sp, 0x28 -/* 086B58 7F052028 03E00008 */ jr $ra -/* 086B5C 7F05202C 00000000 */ nop -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F052030(WeaponObjRecord *weapon, ChrRecord *chr) +void sub_GAME_7F052030(WeaponObjRecord* arg0, ChrRecord* arg1) { + arg0->damage = (*(s32*)&arg0->damage) / M_U16_MAX_VALUE_F; + sub_GAME_7F051FD4(arg0, arg1); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F052030 -/* 086B60 7F052030 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 086B64 7F052034 AFBF0014 */ sw $ra, 0x14($sp) -/* 086B68 7F052038 8C8E0074 */ lw $t6, 0x74($a0) -/* 086B6C 7F05203C 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 086B70 7F052040 44814000 */ mtc1 $at, $f8 -/* 086B74 7F052044 448E2000 */ mtc1 $t6, $f4 -/* 086B78 7F052048 00000000 */ nop -/* 086B7C 7F05204C 468021A0 */ cvt.s.w $f6, $f4 -/* 086B80 7F052050 46083283 */ div.s $f10, $f6, $f8 -/* 086B84 7F052054 0FC147F5 */ jal sub_GAME_7F051FD4 -/* 086B88 7F052058 E48A0074 */ swc1 $f10, 0x74($a0) -/* 086B8C 7F05205C 8FBF0014 */ lw $ra, 0x14($sp) -/* 086B90 7F052060 27BD0018 */ addiu $sp, $sp, 0x18 -/* 086B94 7F052064 03E00008 */ jr $ra -/* 086B98 7F052068 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -40777,6 +37049,35 @@ glabel sub_GAME_7F052030 * * Address 0x7F05206C. */ +WeaponObjRecord blank_08_object_preset_1 = { + 0x0100, //extrascale + 0x0, //state + 0x08, //type + 0, //obj + 1, //pad + 0x00000000, //flags + 0, //flags2 + NULL, // prop + NULL, // model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + { 0.0, 0.0, 0.0 }, //runtime_pos + {0x00000000 }, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f,//damage + { 0xFF, 0xFF, 0xFF, 0x00 }, // shadecol + { 0xFF, 0xFF, 0xFF, 0x00 }, // nextcol + ITEM_UNARMED, //weaponnum + -1, //LinkedWeaponType + -1, //timer + NULL //dualweapon +}; WeaponObjRecord *create_new_item_instance_of_model(s32 modelnum, ITEM_IDS weaponid) { WeaponObjRecord *itemModel; @@ -40800,17 +37101,17 @@ WeaponObjRecord *create_new_item_instance_of_model(s32 modelnum, ITEM_IDS weapon itemModel = PitemZ_entries[modelnum]; modelLoad(); - lastObj = chrpropAllocate(); + lastObj = propAllocate(); ObjInst = get_obj_instance_controller_for_header(itemModel); isObjInstAvailable = ObjInst == 0; ObjInst = ObjInst; - NewGun = sub_GAME_7F05126C(lastObj == 0, isObjInstAvailable, itemModel); + NewGun = weaponCreate(lastObj == 0, isObjInstAvailable, itemModel); lastObj = lastObj; NewGun = NewGun; if (lastObj == 0) { ObjInst = ObjInst; - lastObj = chrpropAllocate(); + lastObj = propAllocate(); } ObjInst = ObjInst; if (ObjInst == 0) @@ -40872,6 +37173,35 @@ WeaponObjRecord *create_new_item_instance_of_model(s32 modelnum, ITEM_IDS weapon } #else +WeaponObjRecord blank_08_object_preset_1 = { + 0x0100, //extrascale + 0x0, //state + 0x08, //type + 0, //obj + 1, //pad + 0x00000000, //flags + 0, //flags2 + NULL, // prop + NULL, // model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + { 0.0, 0.0, 0.0 }, //runtime_pos + {0x00000000 }, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f,//damage + { 0xFF, 0xFF, 0xFF, 0x00 }, // shadecol + { 0xFF, 0xFF, 0xFF, 0x00 }, // nextcol + ITEM_UNARMED, //weaponnum + -1, //LinkedWeaponType + -1, //timer + NULL //dualweapon +}; GLOBAL_ASM( .text glabel create_new_item_instance_of_model @@ -40889,7 +37219,7 @@ glabel create_new_item_instance_of_model /* 086BC8 7F052098 AFA400B8 */ sw $a0, 0xb8($sp) /* 086BCC 7F05209C 0FC15B0E */ jal modelLoad /* 086BD0 7F0520A0 AFAF00B4 */ sw $t7, 0xb4($sp) -/* 086BD4 7F0520A4 0FC0E90C */ jal chrpropAllocate +/* 086BD4 7F0520A4 0FC0E90C */ jal propAllocate /* 086BD8 7F0520A8 00000000 */ nop /* 086BDC 7F0520AC 00408025 */ move $s0, $v0 /* 086BE0 7F0520B0 0FC1B025 */ jal get_obj_instance_controller_for_header @@ -40897,12 +37227,12 @@ glabel create_new_item_instance_of_model /* 086BE8 7F0520B8 2E040001 */ sltiu $a0, $s0, 1 /* 086BEC 7F0520BC 2C450001 */ sltiu $a1, $v0, 1 /* 086BF0 7F0520C0 8FA600B4 */ lw $a2, 0xb4($sp) -/* 086BF4 7F0520C4 0FC1449B */ jal sub_GAME_7F05126C +/* 086BF4 7F0520C4 0FC1449B */ jal weaponCreate /* 086BF8 7F0520C8 AFA200AC */ sw $v0, 0xac($sp) /* 086BFC 7F0520CC 8FA700AC */ lw $a3, 0xac($sp) /* 086C00 7F0520D0 16000005 */ bnez $s0, .L7F0520E8 /* 086C04 7F0520D4 00408825 */ move $s1, $v0 -/* 086C08 7F0520D8 0FC0E90C */ jal chrpropAllocate +/* 086C08 7F0520D8 0FC0E90C */ jal propAllocate /* 086C0C 7F0520DC AFA700AC */ sw $a3, 0xac($sp) /* 086C10 7F0520E0 8FA700AC */ lw $a3, 0xac($sp) /* 086C14 7F0520E4 00408025 */ move $s0, $v0 @@ -40997,6 +37327,35 @@ void chrSetWeaponFlag4(ChrRecord *chr, GUNHAND hand) //#MATCH #ifdef NONMATCHING +WeaponObjRecord blank_08_object_preset_4001 = { + 0x0100, //extrascale + 0x0, //state + 0x08, //type + 0, //obj + 0x4001, //pad + 0x00000000, //flags + 0, //flags2 + NULL, //prop + NULL, //model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + {0.0, 0.0, 0.0},//runtime_pos + {0x00000000}, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f, //damage + { 0xFF, 0xFF, 0xFF, 0x00 }, // shadecol + { 0xFF, 0xFF, 0xFF, 0x00 }, // nextcol + ITEM_UNARMED, //weaponnu + -1, //LinkedWeaponType + -1, //timer + NULL //dualweapon +}; //https://decomp.me/scratch/pEmVO PropRecord *something_with_generating_object(ChrRecord *self, s32 PropID, ITEM_IDS ItemID, s32 flags, WeaponObjRecord *Weapon, ItemModelFileRecord *PropItem) //#90.8% { @@ -41008,16 +37367,16 @@ PropRecord *something_with_generating_object(ChrRecord *self, s32 PropID, ITEM_I PropItem = &PitemZ_entries[PropID]; modelLoad(PropID); //move a0a1 and t9,0xd4(sp) swapped here... } - lastobjentry = chrpropAllocate(); + lastobjentry = propAllocate(); objinst = get_obj_instance_controller_for_header(PropItem); if (!Weapon) { - Weapon = sub_GAME_7F05126C(lastobjentry == NULL, objinst == NULL, PropItem); + Weapon = weaponCreate(lastobjentry == NULL, objinst == NULL, PropItem); } if (!lastobjentry) { - lastobjentry = chrpropAllocate(); + lastobjentry = propAllocate(); } if (!objinst) { @@ -41051,6 +37410,35 @@ PropRecord *something_with_generating_object(ChrRecord *self, s32 PropID, ITEM_I } #else +WeaponObjRecord blank_08_object_preset_4001 = { + 0x0100, //extrascale + 0x0, //state + 0x08, //type + 0, //obj + 0x4001, //pad + 0x00000000, //flags + 0, //flags2 + NULL, //prop + NULL, //model + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + }, //mtx + {0.0, 0.0, 0.0},//runtime_pos + {0x00000000}, //runtime_bitflags + NULL, //ptr_allocated_collisiondata_block + NULL, //projectile/embedment + 0.0f, //maxdamage + 1000.0f, //damage + { 0xFF, 0xFF, 0xFF, 0x00 }, // shadecol + { 0xFF, 0xFF, 0xFF, 0x00 }, // nextcol + ITEM_UNARMED, //weaponnu + -1, //LinkedWeaponType + -1, //timer + NULL //dualweapon +}; GLOBAL_ASM( .text glabel something_with_generating_object @@ -41075,7 +37463,7 @@ glabel something_with_generating_object /* 086D8C 7F05225C 0FC15B0E */ jal modelLoad /* 086D90 7F052260 AFB900D4 */ sw $t9, 0xd4($sp) .L7F052264: -/* 086D94 7F052264 0FC0E90C */ jal chrpropAllocate +/* 086D94 7F052264 0FC0E90C */ jal propAllocate /* 086D98 7F052268 00000000 */ nop /* 086D9C 7F05226C 00408825 */ move $s1, $v0 /* 086DA0 7F052270 0FC1B025 */ jal get_obj_instance_controller_for_header @@ -41085,13 +37473,13 @@ glabel something_with_generating_object /* 086DB0 7F052280 2E240001 */ sltiu $a0, $s1, 1 /* 086DB4 7F052284 16000004 */ bnez $s0, .L7F052298 /* 086DB8 7F052288 2C450001 */ sltiu $a1, $v0, 1 -/* 086DBC 7F05228C 0FC1449B */ jal sub_GAME_7F05126C +/* 086DBC 7F05228C 0FC1449B */ jal weaponCreate /* 086DC0 7F052290 8FA600D4 */ lw $a2, 0xd4($sp) /* 086DC4 7F052294 00408025 */ move $s0, $v0 .L7F052298: /* 086DC8 7F052298 16200004 */ bnez $s1, .L7F0522AC /* 086DCC 7F05229C 00000000 */ nop -/* 086DD0 7F0522A0 0FC0E90C */ jal chrpropAllocate +/* 086DD0 7F0522A0 0FC0E90C */ jal propAllocate /* 086DD4 7F0522A4 00000000 */ nop /* 086DD8 7F0522A8 00408825 */ move $s1, $v0 .L7F0522AC: @@ -41199,6 +37587,10 @@ void sub_GAME_7F0523F8(void) { } #else +u32 D_800322A4 = 0; +u32 D_800322A8[] = {1, 3}; +u32 D_800322B0[] = {0, 0, 0, 0}; +u32 D_800322C0[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; GLOBAL_ASM( .late_rodata glabel D_800532F0 @@ -41248,7 +37640,7 @@ glabel sub_GAME_7F0523F8 /* 086FC4 7F052494 8CE4001C */ lw $a0, 0x1c($a3) /* 086FC8 7F052498 358D0002 */ ori $t5, $t4, 2 /* 086FCC 7F05249C A06D0001 */ sb $t5, 1($v1) -/* 086FD0 7F0524A0 0FC1B198 */ jal sub_GAME_7F06C660 +/* 086FD0 7F0524A0 0FC1B198 */ jal modelFindNodeMtx /* 086FD4 7F0524A4 8E25001C */ lw $a1, 0x1c($s1) /* 086FD8 7F0524A8 8FAE00BC */ lw $t6, 0xbc($sp) /* 086FDC 7F0524AC 24010001 */ li $at, 1 @@ -41305,7 +37697,8 @@ glabel sub_GAME_7F0523F8 -void redirect_object_collectability_routines(void) { +void redirect_object_collectability_routines(void) +{ object_collectability_routines(); } @@ -41313,103 +37706,51 @@ void redirect_object_collectability_routines(void) { -#ifdef NONMATCHING -void sub_GAME_7F052574(void) { +void weaponSetGunfireVisible(PropRecord *prop, s32 firing) +{ + ObjectRecord *obj = prop->obj; + Model *model = obj->model; + ModelNode *node; + + if (model && model->obj->Skeleton == &skeleton_prop_weapon) { + node = model->obj->Switches[0]; + if (node) { + struct ModelRwData_GunfireRecord *rwdata = modelGetNodeRwData(model, node); + rwdata->visible = firing; + } + node = model->obj->Switches[2]; + if (node) { + struct ModelRwData_BSPRecord *rwdata = modelGetNodeRwData(model, node); + rwdata->visible = firing; + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F052574 -/* 0870A4 7F052574 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0870A8 7F052578 AFBF0014 */ sw $ra, 0x14($sp) -/* 0870AC 7F05257C AFA50024 */ sw $a1, 0x24($sp) -/* 0870B0 7F052580 8C820004 */ lw $v0, 4($a0) -/* 0870B4 7F052584 8C460014 */ lw $a2, 0x14($v0) -/* 0870B8 7F052588 50C0001B */ beql $a2, $zero, .L7F0525F8 -/* 0870BC 7F05258C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0870C0 7F052590 8CC20008 */ lw $v0, 8($a2) -/* 0870C4 7F052594 3C0E8004 */ lui $t6, %hi(skeleton_prop_weapon) -/* 0870C8 7F052598 25CEC4FC */ addiu $t6, %lo(skeleton_prop_weapon) # addiu $t6, $t6, -0x3b04 -/* 0870CC 7F05259C 8C4F0004 */ lw $t7, 4($v0) -/* 0870D0 7F0525A0 55CF0015 */ bnel $t6, $t7, .L7F0525F8 -/* 0870D4 7F0525A4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0870D8 7F0525A8 8C430008 */ lw $v1, 8($v0) -/* 0870DC 7F0525AC 00C02025 */ move $a0, $a2 -/* 0870E0 7F0525B0 8C650000 */ lw $a1, ($v1) -/* 0870E4 7F0525B4 50A00009 */ beql $a1, $zero, .L7F0525DC -/* 0870E8 7F0525B8 8C650008 */ lw $a1, 8($v1) -/* 0870EC 7F0525BC 0FC1B1E7 */ jal modelGetNodeRwData -/* 0870F0 7F0525C0 AFA60018 */ sw $a2, 0x18($sp) -/* 0870F4 7F0525C4 8FB80024 */ lw $t8, 0x24($sp) -/* 0870F8 7F0525C8 8FA60018 */ lw $a2, 0x18($sp) -/* 0870FC 7F0525CC A4580000 */ sh $t8, ($v0) -/* 087100 7F0525D0 8CD90008 */ lw $t9, 8($a2) -/* 087104 7F0525D4 8F230008 */ lw $v1, 8($t9) -/* 087108 7F0525D8 8C650008 */ lw $a1, 8($v1) -.L7F0525DC: -/* 08710C 7F0525DC 50A00006 */ beql $a1, $zero, .L7F0525F8 -/* 087110 7F0525E0 8FBF0014 */ lw $ra, 0x14($sp) -/* 087114 7F0525E4 0FC1B1E7 */ jal modelGetNodeRwData -/* 087118 7F0525E8 00C02025 */ move $a0, $a2 -/* 08711C 7F0525EC 8FA80024 */ lw $t0, 0x24($sp) -/* 087120 7F0525F0 AC480000 */ sw $t0, ($v0) -/* 087124 7F0525F4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0525F8: -/* 087128 7F0525F8 27BD0020 */ addiu $sp, $sp, 0x20 -/* 08712C 7F0525FC 03E00008 */ jr $ra -/* 087130 7F052600 00000000 */ nop -) -#endif - +s32 weaponIsGunfireVisible(PropRecord *prop) +{ + ObjectRecord *obj = prop->obj; + Model *model = obj->model; + ModelNode *node; + + if (model && model->obj->Skeleton == &skeleton_prop_weapon) { + node = model->obj->Switches[0]; + if (node) { + struct ModelRwData_GunfireRecord *rwdata = modelGetNodeRwData(model, node); + return rwdata->visible; + } -#ifdef NONMATCHING -void sub_GAME_7F052604(void) { + node = model->obj->Switches[2]; + if (node) { + struct ModelRwData_BSPRecord *rwdata = modelGetNodeRwData(model, node); + return rwdata->visible; + } + } + return FALSE; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F052604 -/* 087134 7F052604 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 087138 7F052608 AFBF0014 */ sw $ra, 0x14($sp) -/* 08713C 7F05260C 8C820004 */ lw $v0, 4($a0) -/* 087140 7F052610 8C460014 */ lw $a2, 0x14($v0) -/* 087144 7F052614 50C00017 */ beql $a2, $zero, .L7F052674 -/* 087148 7F052618 00001025 */ move $v0, $zero -/* 08714C 7F05261C 8CC20008 */ lw $v0, 8($a2) -/* 087150 7F052620 3C0E8004 */ lui $t6, %hi(skeleton_prop_weapon) -/* 087154 7F052624 25CEC4FC */ addiu $t6, %lo(skeleton_prop_weapon) # addiu $t6, $t6, -0x3b04 -/* 087158 7F052628 8C4F0004 */ lw $t7, 4($v0) -/* 08715C 7F05262C 55CF0011 */ bnel $t6, $t7, .L7F052674 -/* 087160 7F052630 00001025 */ move $v0, $zero -/* 087164 7F052634 8C430008 */ lw $v1, 8($v0) -/* 087168 7F052638 8C650000 */ lw $a1, ($v1) -/* 08716C 7F05263C 50A00006 */ beql $a1, $zero, .L7F052658 -/* 087170 7F052640 8C650008 */ lw $a1, 8($v1) -/* 087174 7F052644 0FC1B1E7 */ jal modelGetNodeRwData -/* 087178 7F052648 00C02025 */ move $a0, $a2 -/* 08717C 7F05264C 10000009 */ b .L7F052674 -/* 087180 7F052650 84420000 */ lh $v0, ($v0) -/* 087184 7F052654 8C650008 */ lw $a1, 8($v1) -.L7F052658: -/* 087188 7F052658 50A00006 */ beql $a1, $zero, .L7F052674 -/* 08718C 7F05265C 00001025 */ move $v0, $zero -/* 087190 7F052660 0FC1B1E7 */ jal modelGetNodeRwData -/* 087194 7F052664 00C02025 */ move $a0, $a2 -/* 087198 7F052668 10000002 */ b .L7F052674 -/* 08719C 7F05266C 8C420000 */ lw $v0, ($v0) -/* 0871A0 7F052670 00001025 */ move $v0, $zero -.L7F052674: -/* 0871A4 7F052674 8FBF0014 */ lw $ra, 0x14($sp) -/* 0871A8 7F052678 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0871AC 7F05267C 03E00008 */ jr $ra -/* 0871B0 7F052680 00000000 */ nop -) -#endif @@ -41467,56 +37808,60 @@ HATTYPE get_hat_model(PropRecord *prop) //#MATCH -#ifdef NONMATCHING +/** + * US address 7F0526EC. +*/ void sub_GAME_7F0526EC(DoorRecord *door, Mtxf *rhs) { - Mtxf *lhs; - vec3d sp54; - vec3d sp48; - vec3d sp38; - vec3d sp2C; + Mtxf lhs; + struct coord3d sp54; + struct coord3d sp48; BoundPadRecord* temp_v0_2; + struct coord3d sp38; + struct coord3d sp2C; if ((door->doorType == 5) || (door->doorType == 9)) { temp_v0_2 = &g_CurrentSetup.boundpads[door->pad]; - sp38.x = (temp_v0_2->up.y * temp_v0_2->look.z) - (temp_v0_2->look.y * temp_v0_2->up.z); // cross product - sp38.y = (temp_v0_2->up.z * temp_v0_2->look.x) - (temp_v0_2->look.z * temp_v0_2->up.x); // cross product - sp38.z = (temp_v0_2->up.x * temp_v0_2->look.y) - (temp_v0_2->look.x * temp_v0_2->up.y); // cross product - sp54.x = (temp_v0_2->up.x * temp_v0_2->bbox.ymin) + temp_v0_2->pos.x; - sp54.y = (temp_v0_2->up.y * temp_v0_2->bbox.ymin) + temp_v0_2->pos.y; - sp54.z = (temp_v0_2->up.z * temp_v0_2->bbox.ymin) + temp_v0_2->pos.z; + + sp38.f[0] = (temp_v0_2->up.f[1] * temp_v0_2->look.f[2]) - (temp_v0_2->up.f[2] * temp_v0_2->look.f[1]); // cross product + sp38.f[1] = (temp_v0_2->up.f[2] * temp_v0_2->look.f[0]) - (temp_v0_2->up.f[0] * temp_v0_2->look.f[2]); // cross product + sp38.f[2] = (temp_v0_2->up.f[0] * temp_v0_2->look.f[1]) - (temp_v0_2->up.f[1] * temp_v0_2->look.f[0]); // cross product + + sp54.f[0] = temp_v0_2->pos.f[0] + (temp_v0_2->up.f[0] * temp_v0_2->bbox.ymin); + sp54.f[1] = temp_v0_2->pos.f[1] + (temp_v0_2->up.f[1] * temp_v0_2->bbox.ymin); + sp54.f[2] = temp_v0_2->pos.f[2] + (temp_v0_2->up.f[2] * temp_v0_2->bbox.ymin); if (door->doorType == 9) { - sp54.x = sp54.x + (sp38.x * temp_v0_2->bbox.xmax); - sp54.y = sp54.y + (sp38.y * temp_v0_2->bbox.xmax); - sp54.z = sp54.z + (sp38.z * temp_v0_2->bbox.xmax); + sp54.f[0] += sp38.f[0] * temp_v0_2->bbox.xmax; + sp54.f[1] += sp38.f[1] * temp_v0_2->bbox.xmax; + sp54.f[2] += sp38.f[2] * temp_v0_2->bbox.xmax; } - else if (door->flags & PROPFLAG_NO_AI_INTERACTION) + else if (door->flags & PROPFLAG_DOOR_OPENTOFRONT) { - sp54.x += sp38.x * temp_v0_2->bbox.xmax; - sp54.y += sp38.y * temp_v0_2->bbox.xmax; - sp54.z += sp38.z * temp_v0_2->bbox.xmax; + sp54.f[0] += sp38.f[0] * temp_v0_2->bbox.xmax; + sp54.f[1] += sp38.f[1] * temp_v0_2->bbox.xmax; + sp54.f[2] += sp38.f[2] * temp_v0_2->bbox.xmax; } else { - sp54.x += sp38.x * temp_v0_2->bbox.xmin; - sp54.y += sp38.y * temp_v0_2->bbox.xmin; - sp54.z += sp38.z * temp_v0_2->bbox.xmin; + sp54.f[0] += sp38.f[0] * temp_v0_2->bbox.xmin; + sp54.f[1] += sp38.f[1] * temp_v0_2->bbox.xmin; + sp54.f[2] += sp38.f[2] * temp_v0_2->bbox.xmin; } - sp48.x = door->runtime_pos.x - sp54.x; - sp48.y = door->runtime_pos.y - sp54.y; - sp48.z = door->runtime_pos.z - sp54.z; + sp48.f[0] = door->runtime_pos.f[0] - sp54.f[0]; + sp48.f[1] = door->runtime_pos.f[1] - sp54.f[1]; + sp48.f[2] = door->runtime_pos.f[2] - sp54.f[2]; - matrix_4x4_copy(&door->mtx, &rhs); + matrix_4x4_copy(&door->mtx, rhs); matrix_4x4_set_identity_and_position(&sp48, &lhs); - matrix_4x4_multiply_in_place(&lhs, &rhs); + matrix_4x4_multiply_in_place(&lhs, rhs); if (door->doorType == 9) { - if (door->flags & PROPFLAG_NO_AI_INTERACTION) + if (door->flags & PROPFLAG_DOOR_OPENTOFRONT) { matrix_4x4_set_rotation_around_z(M_TAU_F - ((door->openPosition * M_TAU_F) / 360.0f), &lhs); } @@ -41525,7 +37870,7 @@ void sub_GAME_7F0526EC(DoorRecord *door, Mtxf *rhs) matrix_4x4_set_rotation_around_z((door->openPosition * M_TAU_F) / 360.0f, &lhs); } } - else if (door->flags & PROPFLAG_NO_AI_INTERACTION) + else if (door->flags & PROPFLAG_DOOR_OPENTOFRONT) { matrix_4x4_set_rotation_around_y(M_TAU_F - ((door->openPosition * M_TAU_F) / 360.0f), &lhs); } @@ -41534,331 +37879,30 @@ void sub_GAME_7F0526EC(DoorRecord *door, Mtxf *rhs) matrix_4x4_set_rotation_around_y((door->openPosition * M_TAU_F) / 360.0f, &lhs); } - matrix_4x4_multiply_in_place(&lhs, &rhs); + matrix_4x4_multiply_in_place(&lhs, rhs); matrix_4x4_set_identity_and_position(&sp54, &lhs); - matrix_4x4_multiply_in_place(&lhs, &rhs); + matrix_4x4_multiply_in_place(&lhs, rhs); } else if ((door->doorType == 6) || (door->doorType == 7)) { - matrix_4x4_copy(&door->mtx, &rhs); - matrix_4x4_set_position(&door->runtime_pos, &rhs); + matrix_4x4_copy(&door->mtx, rhs); + matrix_4x4_set_position(&door->runtime_pos, rhs); } else { - sp2C.x = (door->frac * door->openPosition) + door->runtime_pos.x; - sp2C.y = (door->unkac * door->openPosition) + door->runtime_pos.y; - sp2C.z = (door->unkb0 * door->openPosition) + door->runtime_pos.z; - matrix_4x4_copy(&door->mtx, &rhs); - matrix_4x4_set_position(&sp2C, &rhs); + sp2C.f[0] = (door->frac * door->openPosition) + door->runtime_pos.x; + sp2C.f[1] = (door->unkac * door->openPosition) + door->runtime_pos.y; + sp2C.f[2] = (door->unkb0 * door->openPosition) + door->runtime_pos.z; + + matrix_4x4_copy(&door->mtx, rhs); + matrix_4x4_set_position(&sp2C, rhs); } if (door->doorFlags & 8) { - matrix_column_3_scalar_multiply_2(-1.0f, &rhs); + matrix_column_3_scalar_multiply_2(-1.0f, rhs); } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80053324 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053328 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005332C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053330 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053334 -.word 0x461c4000 /*10000.0*/ -glabel D_80053338 -.word 0x3ecccccd /*0.40000001*/ -glabel D_8005333C -.word 0x3ecccccd /*0.40000001*/ -glabel D_80053340 -.word 0x461c4000 /*10000.0*/ -glabel D_80053344 -.word 0x46b1de00 /*22767.0*/ -glabel D_80053348 -.word 0x459c4000 /*5000.0*/ -.text -glabel sub_GAME_7F0526EC -/* 08721C 7F0526EC 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* 087220 7F0526F0 AFBF001C */ sw $ra, 0x1c($sp) -/* 087224 7F0526F4 AFB00018 */ sw $s0, 0x18($sp) -/* 087228 7F0526F8 AFA500A4 */ sw $a1, 0xa4($sp) -/* 08722C 7F0526FC 9482009A */ lhu $v0, 0x9a($a0) -/* 087230 7F052700 24010005 */ li $at, 5 -/* 087234 7F052704 00808025 */ move $s0, $a0 -/* 087238 7F052708 10410003 */ beq $v0, $at, .L7F052718 -/* 08723C 7F05270C 24010009 */ li $at, 9 -/* 087240 7F052710 544100CA */ bnel $v0, $at, .L7F052A3C -/* 087244 7F052714 24010006 */ li $at, 6 -.L7F052718: -/* 087248 7F052718 86190006 */ lh $t9, 6($s0) -/* 08724C 7F05271C 3C098007 */ lui $t1, %hi(g_CurrentSetup+0x1C) -/* 087250 7F052720 8D295D1C */ lw $t1, %lo(g_CurrentSetup+0x1C)($t1) -/* 087254 7F052724 00194100 */ sll $t0, $t9, 4 -/* 087258 7F052728 01194021 */ addu $t0, $t0, $t9 -/* 08725C 7F05272C 00084080 */ sll $t0, $t0, 2 -/* 087260 7F052730 01091021 */ addu $v0, $t0, $t1 -/* 087264 7F052734 C4460010 */ lwc1 $f6, 0x10($v0) -/* 087268 7F052738 C4480020 */ lwc1 $f8, 0x20($v0) -/* 08726C 7F05273C C452001C */ lwc1 $f18, 0x1c($v0) -/* 087270 7F052740 C44A0014 */ lwc1 $f10, 0x14($v0) -/* 087274 7F052744 46083102 */ mul.s $f4, $f6, $f8 -/* 087278 7F052748 24010009 */ li $at, 9 -/* 08727C 7F05274C 460A9402 */ mul.s $f16, $f18, $f10 -/* 087280 7F052750 46102181 */ sub.s $f6, $f4, $f16 -/* 087284 7F052754 E7A60038 */ swc1 $f6, 0x38($sp) -/* 087288 7F052758 C4480014 */ lwc1 $f8, 0x14($v0) -/* 08728C 7F05275C C4520018 */ lwc1 $f18, 0x18($v0) -/* 087290 7F052760 C450000C */ lwc1 $f16, 0xc($v0) -/* 087294 7F052764 C4440020 */ lwc1 $f4, 0x20($v0) -/* 087298 7F052768 46124282 */ mul.s $f10, $f8, $f18 -/* 08729C 7F05276C 00000000 */ nop -/* 0872A0 7F052770 46102202 */ mul.s $f8, $f4, $f16 -/* 0872A4 7F052774 46085481 */ sub.s $f18, $f10, $f8 -/* 0872A8 7F052778 E7B2003C */ swc1 $f18, 0x3c($sp) -/* 0872AC 7F05277C C444000C */ lwc1 $f4, 0xc($v0) -/* 0872B0 7F052780 C450001C */ lwc1 $f16, 0x1c($v0) -/* 0872B4 7F052784 C4480018 */ lwc1 $f8, 0x18($v0) -/* 0872B8 7F052788 46102282 */ mul.s $f10, $f4, $f16 -/* 0872BC 7F05278C C4440010 */ lwc1 $f4, 0x10($v0) -/* 0872C0 7F052790 46044402 */ mul.s $f16, $f8, $f4 -/* 0872C4 7F052794 46105201 */ sub.s $f8, $f10, $f16 -/* 0872C8 7F052798 E7A80040 */ swc1 $f8, 0x40($sp) -/* 0872CC 7F05279C C44A0034 */ lwc1 $f10, 0x34($v0) -/* 0872D0 7F0527A0 C444000C */ lwc1 $f4, 0xc($v0) -/* 0872D4 7F0527A4 460A2402 */ mul.s $f16, $f4, $f10 -/* 0872D8 7F0527A8 C4440000 */ lwc1 $f4, ($v0) -/* 0872DC 7F0527AC 46048280 */ add.s $f10, $f16, $f4 -/* 0872E0 7F0527B0 E7AA0054 */ swc1 $f10, 0x54($sp) -/* 0872E4 7F0527B4 C4440034 */ lwc1 $f4, 0x34($v0) -/* 0872E8 7F0527B8 C4500010 */ lwc1 $f16, 0x10($v0) -/* 0872EC 7F0527BC 46048402 */ mul.s $f16, $f16, $f4 -/* 0872F0 7F0527C0 C4440004 */ lwc1 $f4, 4($v0) -/* 0872F4 7F0527C4 46048400 */ add.s $f16, $f16, $f4 -/* 0872F8 7F0527C8 E7B00058 */ swc1 $f16, 0x58($sp) -/* 0872FC 7F0527CC C4440014 */ lwc1 $f4, 0x14($v0) -/* 087300 7F0527D0 E7A60020 */ swc1 $f6, 0x20($sp) -/* 087304 7F0527D4 C4460034 */ lwc1 $f6, 0x34($v0) -/* 087308 7F0527D8 46062102 */ mul.s $f4, $f4, $f6 -/* 08730C 7F0527DC C4460008 */ lwc1 $f6, 8($v0) -/* 087310 7F0527E0 46062100 */ add.s $f4, $f4, $f6 -/* 087314 7F0527E4 C7A60020 */ lwc1 $f6, 0x20($sp) -/* 087318 7F0527E8 E7A4005C */ swc1 $f4, 0x5c($sp) -/* 08731C 7F0527EC 960A009A */ lhu $t2, 0x9a($s0) -/* 087320 7F0527F0 15410010 */ bne $t2, $at, .L7F052834 -/* 087324 7F0527F4 00000000 */ nop -/* 087328 7F0527F8 E7B20020 */ swc1 $f18, 0x20($sp) -/* 08732C 7F0527FC C4520030 */ lwc1 $f18, 0x30($v0) -/* 087330 7F052800 46123182 */ mul.s $f6, $f6, $f18 -/* 087334 7F052804 46065480 */ add.s $f18, $f10, $f6 -/* 087338 7F052808 C7AA0020 */ lwc1 $f10, 0x20($sp) -/* 08733C 7F05280C E7B20054 */ swc1 $f18, 0x54($sp) -/* 087340 7F052810 C4460030 */ lwc1 $f6, 0x30($v0) -/* 087344 7F052814 46065482 */ mul.s $f18, $f10, $f6 -/* 087348 7F052818 46128280 */ add.s $f10, $f16, $f18 -/* 08734C 7F05281C E7AA0058 */ swc1 $f10, 0x58($sp) -/* 087350 7F052820 C4460030 */ lwc1 $f6, 0x30($v0) -/* 087354 7F052824 46064402 */ mul.s $f16, $f8, $f6 -/* 087358 7F052828 46102480 */ add.s $f18, $f4, $f16 -/* 08735C 7F05282C 1000002A */ b .L7F0528D8 -/* 087360 7F052830 E7B2005C */ swc1 $f18, 0x5c($sp) -.L7F052834: -/* 087364 7F052834 8E0B0008 */ lw $t3, 8($s0) -/* 087368 7F052838 C7AA0038 */ lwc1 $f10, 0x38($sp) -/* 08736C 7F05283C C7A60038 */ lwc1 $f6, 0x38($sp) -/* 087370 7F052840 000B6080 */ sll $t4, $t3, 2 -/* 087374 7F052844 05830014 */ bgezl $t4, .L7F052898 -/* 087378 7F052848 C450002C */ lwc1 $f16, 0x2c($v0) -/* 08737C 7F05284C C4480030 */ lwc1 $f8, 0x30($v0) -/* 087380 7F052850 C7A40054 */ lwc1 $f4, 0x54($sp) -/* 087384 7F052854 C7B2003C */ lwc1 $f18, 0x3c($sp) -/* 087388 7F052858 46085182 */ mul.s $f6, $f10, $f8 -/* 08738C 7F05285C 46062400 */ add.s $f16, $f4, $f6 -/* 087390 7F052860 C7A40058 */ lwc1 $f4, 0x58($sp) -/* 087394 7F052864 E7B00054 */ swc1 $f16, 0x54($sp) -/* 087398 7F052868 C44A0030 */ lwc1 $f10, 0x30($v0) -/* 08739C 7F05286C C7B00040 */ lwc1 $f16, 0x40($sp) -/* 0873A0 7F052870 460A9202 */ mul.s $f8, $f18, $f10 -/* 0873A4 7F052874 46082180 */ add.s $f6, $f4, $f8 -/* 0873A8 7F052878 C7A4005C */ lwc1 $f4, 0x5c($sp) -/* 0873AC 7F05287C E7A60058 */ swc1 $f6, 0x58($sp) -/* 0873B0 7F052880 C4520030 */ lwc1 $f18, 0x30($v0) -/* 0873B4 7F052884 46128282 */ mul.s $f10, $f16, $f18 -/* 0873B8 7F052888 460A2200 */ add.s $f8, $f4, $f10 -/* 0873BC 7F05288C 10000012 */ b .L7F0528D8 -/* 0873C0 7F052890 E7A8005C */ swc1 $f8, 0x5c($sp) -/* 0873C4 7F052894 C450002C */ lwc1 $f16, 0x2c($v0) -.L7F052898: -/* 0873C8 7F052898 C7A40054 */ lwc1 $f4, 0x54($sp) -/* 0873CC 7F05289C C7A8003C */ lwc1 $f8, 0x3c($sp) -/* 0873D0 7F0528A0 46103482 */ mul.s $f18, $f6, $f16 -/* 0873D4 7F0528A4 46122280 */ add.s $f10, $f4, $f18 -/* 0873D8 7F0528A8 C7A40058 */ lwc1 $f4, 0x58($sp) -/* 0873DC 7F0528AC E7AA0054 */ swc1 $f10, 0x54($sp) -/* 0873E0 7F0528B0 C446002C */ lwc1 $f6, 0x2c($v0) -/* 0873E4 7F0528B4 C7AA0040 */ lwc1 $f10, 0x40($sp) -/* 0873E8 7F0528B8 46064402 */ mul.s $f16, $f8, $f6 -/* 0873EC 7F0528BC 46102480 */ add.s $f18, $f4, $f16 -/* 0873F0 7F0528C0 C7A4005C */ lwc1 $f4, 0x5c($sp) -/* 0873F4 7F0528C4 E7B20058 */ swc1 $f18, 0x58($sp) -/* 0873F8 7F0528C8 C448002C */ lwc1 $f8, 0x2c($v0) -/* 0873FC 7F0528CC 46085182 */ mul.s $f6, $f10, $f8 -/* 087400 7F0528D0 46062400 */ add.s $f16, $f4, $f6 -/* 087404 7F0528D4 E7B0005C */ swc1 $f16, 0x5c($sp) -.L7F0528D8: -/* 087408 7F0528D8 C6120058 */ lwc1 $f18, 0x58($s0) -/* 08740C 7F0528DC C7AA0054 */ lwc1 $f10, 0x54($sp) -/* 087410 7F0528E0 C7A60058 */ lwc1 $f6, 0x58($sp) -/* 087414 7F0528E4 26040018 */ addiu $a0, $s0, 0x18 -/* 087418 7F0528E8 460A9201 */ sub.s $f8, $f18, $f10 -/* 08741C 7F0528EC C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 087420 7F0528F0 8FA500A4 */ lw $a1, 0xa4($sp) -/* 087424 7F0528F4 E7A80048 */ swc1 $f8, 0x48($sp) -/* 087428 7F0528F8 C604005C */ lwc1 $f4, 0x5c($s0) -/* 08742C 7F0528FC 46062401 */ sub.s $f16, $f4, $f6 -/* 087430 7F052900 E7B0004C */ swc1 $f16, 0x4c($sp) -/* 087434 7F052904 C6120060 */ lwc1 $f18, 0x60($s0) -/* 087438 7F052908 460A9201 */ sub.s $f8, $f18, $f10 -/* 08743C 7F05290C 0FC16008 */ jal matrix_4x4_copy -/* 087440 7F052910 E7A80050 */ swc1 $f8, 0x50($sp) -/* 087444 7F052914 27A40048 */ addiu $a0, $sp, 0x48 -/* 087448 7F052918 0FC16259 */ jal matrix_4x4_set_identity_and_position -/* 08744C 7F05291C 27A50060 */ addiu $a1, $sp, 0x60 -/* 087450 7F052920 27A40060 */ addiu $a0, $sp, 0x60 -/* 087454 7F052924 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 087458 7F052928 8FA500A4 */ lw $a1, 0xa4($sp) -/* 08745C 7F05292C 960D009A */ lhu $t5, 0x9a($s0) -/* 087460 7F052930 24010009 */ li $at, 9 -/* 087464 7F052934 55A1001D */ bnel $t5, $at, .L7F0529AC -/* 087468 7F052938 8E180008 */ lw $t8, 8($s0) -/* 08746C 7F05293C 8E0E0008 */ lw $t6, 8($s0) -/* 087470 7F052940 3C018005 */ lui $at, %hi(D_80053328) -/* 087474 7F052944 000E7880 */ sll $t7, $t6, 2 -/* 087478 7F052948 05E1000D */ bgez $t7, .L7F052980 -/* 08747C 7F05294C 00000000 */ nop -/* 087480 7F052950 3C018005 */ lui $at, %hi(D_80053324) -/* 087484 7F052954 C4203324 */ lwc1 $f0, %lo(D_80053324)($at) -/* 087488 7F052958 C60400B4 */ lwc1 $f4, 0xb4($s0) -/* 08748C 7F05295C 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 087490 7F052960 44818000 */ mtc1 $at, $f16 -/* 087494 7F052964 46002182 */ mul.s $f6, $f4, $f0 -/* 087498 7F052968 27A50060 */ addiu $a1, $sp, 0x60 -/* 08749C 7F05296C 46103483 */ div.s $f18, $f6, $f16 -/* 0874A0 7F052970 0FC161A2 */ jal matrix_4x4_set_rotation_around_z -/* 0874A4 7F052974 46120301 */ sub.s $f12, $f0, $f18 -/* 0874A8 7F052978 10000025 */ b .L7F052A10 -/* 0874AC 7F05297C 27A40060 */ addiu $a0, $sp, 0x60 -.L7F052980: -/* 0874B0 7F052980 C4203328 */ lwc1 $f0, %lo(D_80053328)($at) -/* 0874B4 7F052984 C60A00B4 */ lwc1 $f10, 0xb4($s0) -/* 0874B8 7F052988 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0874BC 7F05298C 44812000 */ mtc1 $at, $f4 -/* 0874C0 7F052990 46005202 */ mul.s $f8, $f10, $f0 -/* 0874C4 7F052994 27A50060 */ addiu $a1, $sp, 0x60 -/* 0874C8 7F052998 0FC161A2 */ jal matrix_4x4_set_rotation_around_z -/* 0874CC 7F05299C 46044303 */ div.s $f12, $f8, $f4 -/* 0874D0 7F0529A0 1000001B */ b .L7F052A10 -/* 0874D4 7F0529A4 27A40060 */ addiu $a0, $sp, 0x60 -/* 0874D8 7F0529A8 8E180008 */ lw $t8, 8($s0) -.L7F0529AC: -/* 0874DC 7F0529AC 3C018005 */ lui $at, %hi(D_80053330) -/* 0874E0 7F0529B0 0018C880 */ sll $t9, $t8, 2 -/* 0874E4 7F0529B4 0721000D */ bgez $t9, .L7F0529EC -/* 0874E8 7F0529B8 00000000 */ nop -/* 0874EC 7F0529BC 3C018005 */ lui $at, %hi(D_8005332C) -/* 0874F0 7F0529C0 C420332C */ lwc1 $f0, %lo(D_8005332C)($at) -/* 0874F4 7F0529C4 C60600B4 */ lwc1 $f6, 0xb4($s0) -/* 0874F8 7F0529C8 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 0874FC 7F0529CC 44819000 */ mtc1 $at, $f18 -/* 087500 7F0529D0 46003402 */ mul.s $f16, $f6, $f0 -/* 087504 7F0529D4 27A50060 */ addiu $a1, $sp, 0x60 -/* 087508 7F0529D8 46128283 */ div.s $f10, $f16, $f18 -/* 08750C 7F0529DC 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 087510 7F0529E0 460A0301 */ sub.s $f12, $f0, $f10 -/* 087514 7F0529E4 1000000A */ b .L7F052A10 -/* 087518 7F0529E8 27A40060 */ addiu $a0, $sp, 0x60 -.L7F0529EC: -/* 08751C 7F0529EC C4203330 */ lwc1 $f0, %lo(D_80053330)($at) -/* 087520 7F0529F0 C60800B4 */ lwc1 $f8, 0xb4($s0) -/* 087524 7F0529F4 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 087528 7F0529F8 44813000 */ mtc1 $at, $f6 -/* 08752C 7F0529FC 46004102 */ mul.s $f4, $f8, $f0 -/* 087530 7F052A00 27A50060 */ addiu $a1, $sp, 0x60 -/* 087534 7F052A04 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 087538 7F052A08 46062303 */ div.s $f12, $f4, $f6 -/* 08753C 7F052A0C 27A40060 */ addiu $a0, $sp, 0x60 -.L7F052A10: -/* 087540 7F052A10 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 087544 7F052A14 8FA500A4 */ lw $a1, 0xa4($sp) -/* 087548 7F052A18 27A40054 */ addiu $a0, $sp, 0x54 -/* 08754C 7F052A1C 0FC16259 */ jal matrix_4x4_set_identity_and_position -/* 087550 7F052A20 27A50060 */ addiu $a1, $sp, 0x60 -/* 087554 7F052A24 27A40060 */ addiu $a0, $sp, 0x60 -/* 087558 7F052A28 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 08755C 7F052A2C 8FA500A4 */ lw $a1, 0xa4($sp) -/* 087560 7F052A30 10000027 */ b .L7F052AD0 -/* 087564 7F052A34 96080098 */ lhu $t0, 0x98($s0) -/* 087568 7F052A38 24010006 */ li $at, 6 -.L7F052A3C: -/* 08756C 7F052A3C 10410004 */ beq $v0, $at, .L7F052A50 -/* 087570 7F052A40 26040018 */ addiu $a0, $s0, 0x18 -/* 087574 7F052A44 24010007 */ li $at, 7 -/* 087578 7F052A48 54410009 */ bnel $v0, $at, .L7F052A70 -/* 08757C 7F052A4C C61000A8 */ lwc1 $f16, 0xa8($s0) -.L7F052A50: -/* 087580 7F052A50 0FC16008 */ jal matrix_4x4_copy -/* 087584 7F052A54 8FA500A4 */ lw $a1, 0xa4($sp) -/* 087588 7F052A58 26040058 */ addiu $a0, $s0, 0x58 -/* 08758C 7F052A5C 0FC16266 */ jal matrix_4x4_set_position -/* 087590 7F052A60 8FA500A4 */ lw $a1, 0xa4($sp) -/* 087594 7F052A64 1000001A */ b .L7F052AD0 -/* 087598 7F052A68 96080098 */ lhu $t0, 0x98($s0) -/* 08759C 7F052A6C C61000A8 */ lwc1 $f16, 0xa8($s0) -.L7F052A70: -/* 0875A0 7F052A70 C61200B4 */ lwc1 $f18, 0xb4($s0) -/* 0875A4 7F052A74 C6080058 */ lwc1 $f8, 0x58($s0) -/* 0875A8 7F052A78 26040018 */ addiu $a0, $s0, 0x18 -/* 0875AC 7F052A7C 46128282 */ mul.s $f10, $f16, $f18 -/* 0875B0 7F052A80 8FA500A4 */ lw $a1, 0xa4($sp) -/* 0875B4 7F052A84 46085100 */ add.s $f4, $f10, $f8 -/* 0875B8 7F052A88 E7A4002C */ swc1 $f4, 0x2c($sp) -/* 0875BC 7F052A8C C61000B4 */ lwc1 $f16, 0xb4($s0) -/* 0875C0 7F052A90 C60600AC */ lwc1 $f6, 0xac($s0) -/* 0875C4 7F052A94 C60A005C */ lwc1 $f10, 0x5c($s0) -/* 0875C8 7F052A98 46103482 */ mul.s $f18, $f6, $f16 -/* 0875CC 7F052A9C 460A9200 */ add.s $f8, $f18, $f10 -/* 0875D0 7F052AA0 E7A80030 */ swc1 $f8, 0x30($sp) -/* 0875D4 7F052AA4 C60600B4 */ lwc1 $f6, 0xb4($s0) -/* 0875D8 7F052AA8 C60400B0 */ lwc1 $f4, 0xb0($s0) -/* 0875DC 7F052AAC C6120060 */ lwc1 $f18, 0x60($s0) -/* 0875E0 7F052AB0 46062402 */ mul.s $f16, $f4, $f6 -/* 0875E4 7F052AB4 46128280 */ add.s $f10, $f16, $f18 -/* 0875E8 7F052AB8 0FC16008 */ jal matrix_4x4_copy -/* 0875EC 7F052ABC E7AA0034 */ swc1 $f10, 0x34($sp) -/* 0875F0 7F052AC0 27A4002C */ addiu $a0, $sp, 0x2c -/* 0875F4 7F052AC4 0FC16266 */ jal matrix_4x4_set_position -/* 0875F8 7F052AC8 8FA500A4 */ lw $a1, 0xa4($sp) -/* 0875FC 7F052ACC 96080098 */ lhu $t0, 0x98($s0) -.L7F052AD0: -/* 087600 7F052AD0 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 087604 7F052AD4 31090008 */ andi $t1, $t0, 8 -/* 087608 7F052AD8 51200005 */ beql $t1, $zero, .L7F052AF0 -/* 08760C 7F052ADC 8FBF001C */ lw $ra, 0x1c($sp) -/* 087610 7F052AE0 44816000 */ mtc1 $at, $f12 -/* 087614 7F052AE4 0FC16293 */ jal matrix_column_3_scalar_multiply_2 -/* 087618 7F052AE8 8FA500A4 */ lw $a1, 0xa4($sp) -/* 08761C 7F052AEC 8FBF001C */ lw $ra, 0x1c($sp) -.L7F052AF0: -/* 087620 7F052AF0 8FB00018 */ lw $s0, 0x18($sp) -/* 087624 7F052AF4 27BD00A0 */ addiu $sp, $sp, 0xa0 -/* 087628 7F052AF8 03E00008 */ jr $ra -/* 08762C 7F052AFC 00000000 */ nop -) -#endif - @@ -41949,6 +37993,13 @@ void sub_GAME_7F052B00(DoorRecord *door) } #else GLOBAL_ASM( +.late_rodata +glabel D_80053334 +.word 0x461c4000 /*10000.0*/ +glabel D_80053338 +.word 0x3ecccccd /*0.40000001*/ +glabel D_8005333C +.word 0x3ecccccd /*0.40000001*/ .text glabel sub_GAME_7F052B00 /* 087630 7F052B00 27BDFF90 */ addiu $sp, $sp, -0x70 @@ -42137,10 +38188,11 @@ glabel sub_GAME_7F052B00 #ifdef NONMATCHING -void sub_GAME_7F052D8C(void) { +void sub_GAME_7F052D8C(DoorRecord* door) { } #else +void sub_GAME_7F052D8C(DoorRecord*); GLOBAL_ASM( .text glabel sub_GAME_7F052D8C @@ -42732,143 +38784,71 @@ void doorDeactivatePortal(DoorRecord *door) { } -#ifdef NONMATCHING -void initialize_door(void) { +PropRecord* doorInit(DoorRecord* door, coord3d* pos, Mtxf* mtx, StandTile* stan, coord3d* coord, coord3d* centre) { + PropRecord* prop; + f32 scale; -} -#else -GLOBAL_ASM( -.text -glabel initialize_door -/* 088120 7F0535F0 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 088124 7F0535F4 AFBF001C */ sw $ra, 0x1c($sp) -/* 088128 7F0535F8 AFB00014 */ sw $s0, 0x14($sp) -/* 08812C 7F0535FC 00808025 */ move $s0, $a0 -/* 088130 7F053600 AFB10018 */ sw $s1, 0x18($sp) -/* 088134 7F053604 AFA50034 */ sw $a1, 0x34($sp) -/* 088138 7F053608 AFA60038 */ sw $a2, 0x38($sp) -/* 08813C 7F05360C 0FC101C7 */ jal objInitWithAutoModel -/* 088140 7F053610 AFA7003C */ sw $a3, 0x3c($sp) -/* 088144 7F053614 860E0004 */ lh $t6, 4($s0) -/* 088148 7F053618 3C018004 */ lui $at, %hi(PitemZ_entries+8) -/* 08814C 7F05361C 00408825 */ move $s1, $v0 -/* 088150 7F053620 000E7880 */ sll $t7, $t6, 2 -/* 088154 7F053624 01EE7823 */ subu $t7, $t7, $t6 -/* 088158 7F053628 000F7880 */ sll $t7, $t7, 2 -/* 08815C 7F05362C 002F0821 */ addu $at, $at, $t7 -/* 088160 7F053630 C424A230 */ lwc1 $f4, %lo(PitemZ_entries+8)($at) -/* 088164 7F053634 24040050 */ li $a0, 80 -/* 088168 7F053638 24050004 */ li $a1, 4 -/* 08816C 7F05363C 0C0025C8 */ jal mempAllocBytesInBank -/* 088170 7F053640 E7A40028 */ swc1 $f4, 0x28($sp) -/* 088174 7F053644 AE020068 */ sw $v0, 0x68($s0) -/* 088178 7F053648 26050018 */ addiu $a1, $s0, 0x18 -/* 08817C 7F05364C AFA50020 */ sw $a1, 0x20($sp) -/* 088180 7F053650 0FC16008 */ jal matrix_4x4_copy -/* 088184 7F053654 8FA40038 */ lw $a0, 0x38($sp) -/* 088188 7F053658 8FA50020 */ lw $a1, 0x20($sp) -/* 08818C 7F05365C 0FC1629F */ jal matrix_scalar_multiply -/* 088190 7F053660 C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 088194 7F053664 8FA20040 */ lw $v0, 0x40($sp) -/* 088198 7F053668 8E180008 */ lw $t8, 8($s0) -/* 08819C 7F05366C 44802000 */ mtc1 $zero, $f4 -/* 0881A0 7F053670 C4460000 */ lwc1 $f6, ($v0) -/* 0881A4 7F053674 0018C800 */ sll $t9, $t8, 0 -/* 0881A8 7F053678 E60600A8 */ swc1 $f6, 0xa8($s0) -/* 0881AC 7F05367C C4480004 */ lwc1 $f8, 4($v0) -/* 0881B0 7F053680 E60800AC */ swc1 $f8, 0xac($s0) -/* 0881B4 7F053684 C44A0008 */ lwc1 $f10, 8($v0) -/* 0881B8 7F053688 07210004 */ bgez $t9, .L7F05369C -/* 0881BC 7F05368C E60A00B0 */ swc1 $f10, 0xb0($s0) -/* 0881C0 7F053690 C6100084 */ lwc1 $f16, 0x84($s0) -/* 0881C4 7F053694 10000004 */ b .L7F0536A8 -/* 0881C8 7F053698 E61000B4 */ swc1 $f16, 0xb4($s0) -.L7F05369C: -/* 0881CC 7F05369C 44809000 */ mtc1 $zero, $f18 -/* 0881D0 7F0536A0 00000000 */ nop -/* 0881D4 7F0536A4 E61200B4 */ swc1 $f18, 0xb4($s0) -.L7F0536A8: -/* 0881D8 7F0536A8 96080098 */ lhu $t0, 0x98($s0) -/* 0881DC 7F0536AC E60400B8 */ swc1 $f4, 0xb8($s0) -/* 0881E0 7F0536B0 A20000BC */ sb $zero, 0xbc($s0) -/* 0881E4 7F0536B4 31090004 */ andi $t1, $t0, 4 -/* 0881E8 7F0536B8 A20000BD */ sb $zero, 0xbd($s0) -/* 0881EC 7F0536BC 1120000E */ beqz $t1, .L7F0536F8 -/* 0881F0 7F0536C0 AE0000C8 */ sw $zero, 0xc8($s0) -/* 0881F4 7F0536C4 8E0A0014 */ lw $t2, 0x14($s0) -/* 0881F8 7F0536C8 24050004 */ li $a1, 4 -/* 0881FC 7F0536CC 8D4B0008 */ lw $t3, 8($t2) -/* 088200 7F0536D0 8D6C0000 */ lw $t4, ($t3) -/* 088204 7F0536D4 8D8D0014 */ lw $t5, 0x14($t4) -/* 088208 7F0536D8 8DAE0014 */ lw $t6, 0x14($t5) -/* 08820C 7F0536DC 8DC20004 */ lw $v0, 4($t6) -/* 088210 7F0536E0 8444000C */ lh $a0, 0xc($v0) -/* 088214 7F0536E4 00047900 */ sll $t7, $a0, 4 -/* 088218 7F0536E8 0C0025C8 */ jal mempAllocBytesInBank -/* 08821C 7F0536EC 01E02025 */ move $a0, $t7 -/* 088220 7F0536F0 10000002 */ b .L7F0536FC -/* 088224 7F0536F4 AE0200CC */ sw $v0, 0xcc($s0) -.L7F0536F8: -/* 088228 7F0536F8 AE0000CC */ sw $zero, 0xcc($s0) -.L7F0536FC: -/* 08822C 7F0536FC 8FA30034 */ lw $v1, 0x34($sp) -/* 088230 7F053700 8FA20044 */ lw $v0, 0x44($sp) -/* 088234 7F053704 2418FFFF */ li $t8, -1 -/* 088238 7F053708 AE1800F0 */ sw $t8, 0xf0($s0) -/* 08823C 7F05370C AE0000F4 */ sw $zero, 0xf4($s0) -/* 088240 7F053710 AE0000F8 */ sw $zero, 0xf8($s0) -/* 088244 7F053714 24190002 */ li $t9, 2 -/* 088248 7F053718 A2390000 */ sb $t9, ($s1) -/* 08824C 7F05371C AE300004 */ sw $s0, 4($s1) -/* 088250 7F053720 C4660000 */ lwc1 $f6, ($v1) -/* 088254 7F053724 02002025 */ move $a0, $s0 -/* 088258 7F053728 E6260008 */ swc1 $f6, 8($s1) -/* 08825C 7F05372C C4680004 */ lwc1 $f8, 4($v1) -/* 088260 7F053730 E628000C */ swc1 $f8, 0xc($s1) -/* 088264 7F053734 C46A0008 */ lwc1 $f10, 8($v1) -/* 088268 7F053738 E62A0010 */ swc1 $f10, 0x10($s1) -/* 08826C 7F05373C 8FA8003C */ lw $t0, 0x3c($sp) -/* 088270 7F053740 AE280014 */ sw $t0, 0x14($s1) -/* 088274 7F053744 C4500000 */ lwc1 $f16, ($v0) -/* 088278 7F053748 8E090008 */ lw $t1, 8($s0) -/* 08827C 7F05374C E6100058 */ swc1 $f16, 0x58($s0) -/* 088280 7F053750 C4520004 */ lwc1 $f18, 4($v0) -/* 088284 7F053754 352A0100 */ ori $t2, $t1, 0x100 -/* 088288 7F053758 E612005C */ swc1 $f18, 0x5c($s0) -/* 08828C 7F05375C C4440008 */ lwc1 $f4, 8($v0) -/* 088290 7F053760 AE0A0008 */ sw $t2, 8($s0) -/* 088294 7F053764 0FC14AC0 */ jal sub_GAME_7F052B00 -/* 088298 7F053768 E6040060 */ swc1 $f4, 0x60($s0) -/* 08829C 7F05376C 0FC14B63 */ jal sub_GAME_7F052D8C -/* 0882A0 7F053770 02002025 */ move $a0, $s0 -/* 0882A4 7F053774 8E040010 */ lw $a0, 0x10($s0) -/* 0882A8 7F053778 0FC100AD */ jal sub_GAME_7F0402B4 -/* 0882AC 7F05377C 2605007C */ addiu $a1, $s0, 0x7c -/* 0882B0 7F053780 920B007C */ lbu $t3, 0x7c($s0) -/* 0882B4 7F053784 920C007D */ lbu $t4, 0x7d($s0) -/* 0882B8 7F053788 920D007E */ lbu $t5, 0x7e($s0) -/* 0882BC 7F05378C 920E007F */ lbu $t6, 0x7f($s0) -/* 0882C0 7F053790 A20B0078 */ sb $t3, 0x78($s0) -/* 0882C4 7F053794 A20C0079 */ sb $t4, 0x79($s0) -/* 0882C8 7F053798 A20D007A */ sb $t5, 0x7a($s0) -/* 0882CC 7F05379C A20E007B */ sb $t6, 0x7b($s0) -/* 0882D0 7F0537A0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0882D4 7F0537A4 02201025 */ move $v0, $s1 -/* 0882D8 7F0537A8 8FB10018 */ lw $s1, 0x18($sp) -/* 0882DC 7F0537AC 8FB00014 */ lw $s0, 0x14($sp) -/* 0882E0 7F0537B0 03E00008 */ jr $ra -/* 0882E4 7F0537B4 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif + prop = objInitWithAutoModel((ObjectRecord* ) door); + scale = PitemZ_entries[door->obj].scale; + door->ptr_allocated_collisiondata_block = mempAllocBytesInBank(0x50U, 4U); + + matrix_4x4_copy(mtx, &door->mtx); + matrix_scalar_multiply(scale, door->mtx.m[0]); + + door->frac = (f32) coord->x; + door->unkac = (f32) coord->y; + door->unkb0 = (f32) coord->z; + + if (door->flags & PROPFLAG_80000000) { + door->openPosition = door->maxFrac; + } else { + door->openPosition = 0.0f; + } + door->speed = 0.0f; + door->openstate = 0; + door->unkbd = 0; + door->linkedDoor = NULL; + if (door->doorFlags & 4) { + union ModelRoData *rodata = door->model->obj->RootNode->Child->Child->Data; + door->unkcc = mempAllocBytesInBank(rodata->DisplayListCollisions.numVertices * sizeof(Vertex), 4U); + } else { + door->unkcc = NULL; + } + + door->portalNumber = -1; + door->openSoundState = 0; + door->closeSoundState = 0; + + prop->type = PROP_TYPE_DOOR; + prop->door = door; + prop->pos.x = pos->x; + prop->pos.y = pos->y; + prop->pos.z = pos->z; + prop->stan = stan; + + door->runtime_pos.x = centre->x; + door->runtime_pos.y = centre->y; + door->runtime_pos.z = centre->z; + door->flags |= PROPFLAG_00000100; + + sub_GAME_7F052B00(door); + sub_GAME_7F052D8C(door); + sub_GAME_7F0402B4(door->prop, &door->nextcol); + + door->shadecol.r = door->nextcol.r; + door->shadecol.g = door->nextcol.g; + door->shadecol.b = door->nextcol.b; + door->shadecol.a = door->nextcol.a; + + return prop; +} -//todo: Code matches however, some data is tied to an earlier func -#ifdef NONMATCHING -s32 sub_GAME_7F0537B8(f32 distance, f32 min, f32 max) //#MATCH +s32 sub_GAME_7F0537B8(f32 distance, f32 min, f32 max) { - s32 retval; //var is needed + s32 retval; if (distance <= 200.0f) { @@ -42884,93 +38864,26 @@ s32 sub_GAME_7F0537B8(f32 distance, f32 min, f32 max) //#MATCH } else { - retval = SHRT_MAX - (s32)((sqrtf(distance - 200.0f) * SHRT_MAX) / sqrtf(min - 200.0f)); + retval = SHRT_MAX - (s32)((sqrtf(distance - 200.0f) * 22767.0f) / sqrtf(min - 200.0f)); } + return retval; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0537B8 -/* 0882E8 7F0537B8 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0882EC 7F0537BC 44810000 */ mtc1 $at, $f0 -/* 0882F0 7F0537C0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0882F4 7F0537C4 F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0882F8 7F0537C8 4600603E */ c.le.s $f12, $f0 -/* 0882FC 7F0537CC AFA60028 */ sw $a2, 0x28($sp) -/* 088300 7F0537D0 46006506 */ mov.s $f20, $f12 -/* 088304 7F0537D4 AFBF001C */ sw $ra, 0x1c($sp) -/* 088308 7F0537D8 45000003 */ bc1f .L7F0537E8 -/* 08830C 7F0537DC C7A40028 */ lwc1 $f4, 0x28($sp) -/* 088310 7F0537E0 10000027 */ b .L7F053880 -/* 088314 7F0537E4 24037FFF */ li $v1, 32767 -.L7F0537E8: -/* 088318 7F0537E8 4614203E */ c.le.s $f4, $f20 -/* 08831C 7F0537EC 00000000 */ nop -/* 088320 7F0537F0 45020004 */ bc1fl .L7F053804 -/* 088324 7F0537F4 4614703E */ c.le.s $f14, $f20 -/* 088328 7F0537F8 10000021 */ b .L7F053880 -/* 08832C 7F0537FC 00001825 */ move $v1, $zero -/* 088330 7F053800 4614703E */ c.le.s $f14, $f20 -.L7F053804: -/* 088334 7F053804 C7A60028 */ lwc1 $f6, 0x28($sp) -/* 088338 7F053808 3C018005 */ lui $at, %hi(D_80053340) -/* 08833C 7F05380C 4502000B */ bc1fl .L7F05383C -/* 088340 7F053810 4600A301 */ sub.s $f12, $f20, $f0 -/* 088344 7F053814 46143201 */ sub.s $f8, $f6, $f20 -/* 088348 7F053818 C42A3340 */ lwc1 $f10, %lo(D_80053340)($at) -/* 08834C 7F05381C 460E3481 */ sub.s $f18, $f6, $f14 -/* 088350 7F053820 460A4402 */ mul.s $f16, $f8, $f10 -/* 088354 7F053824 46128103 */ div.s $f4, $f16, $f18 -/* 088358 7F053828 4600220D */ trunc.w.s $f8, $f4 -/* 08835C 7F05382C 44034000 */ mfc1 $v1, $f8 -/* 088360 7F053830 10000014 */ b .L7F053884 -/* 088364 7F053834 8FBF001C */ lw $ra, 0x1c($sp) -/* 088368 7F053838 4600A301 */ sub.s $f12, $f20, $f0 -.L7F05383C: -/* 08836C 7F05383C 0C007DF8 */ jal sqrtf -/* 088370 7F053840 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 088374 7F053844 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 088378 7F053848 44815000 */ mtc1 $at, $f10 -/* 08837C 7F05384C C7AE0024 */ lwc1 $f14, 0x24($sp) -/* 088380 7F053850 46000506 */ mov.s $f20, $f0 -/* 088384 7F053854 0C007DF8 */ jal sqrtf -/* 088388 7F053858 460A7301 */ sub.s $f12, $f14, $f10 -/* 08838C 7F05385C 3C018005 */ lui $at, %hi(D_80053344) -/* 088390 7F053860 C4263344 */ lwc1 $f6, %lo(D_80053344)($at) -/* 088394 7F053864 24197FFF */ li $t9, 32767 -/* 088398 7F053868 4606A402 */ mul.s $f16, $f20, $f6 -/* 08839C 7F05386C 46008483 */ div.s $f18, $f16, $f0 -/* 0883A0 7F053870 4600910D */ trunc.w.s $f4, $f18 -/* 0883A4 7F053874 44182000 */ mfc1 $t8, $f4 -/* 0883A8 7F053878 00000000 */ nop -/* 0883AC 7F05387C 03381823 */ subu $v1, $t9, $t8 -.L7F053880: -/* 0883B0 7F053880 8FBF001C */ lw $ra, 0x1c($sp) -.L7F053884: -/* 0883B4 7F053884 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 0883B8 7F053888 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0883BC 7F05388C 03E00008 */ jr $ra -/* 0883C0 7F053890 00601025 */ move $v0, $v1 -) -#endif - - - -#ifdef NONMATCHING -// some sp offsets are wrong, the rest matches s32 sub_GAME_7F053894(coord3d *pos, f32 low, f32 high) { PropRecord *prop; s32 index; - f32 shortest_distance = high; + f32 shortest_distance; f32 diffx; f32 diffy; f32 diffz; f32 distance; - s32 count = getPlayerCount(); + s32 count; + + shortest_distance = high; + count = getPlayerCount(); for (index = 0; index < count; index++) { @@ -42987,150 +38900,29 @@ s32 sub_GAME_7F053894(coord3d *pos, f32 low, f32 high) } return sub_GAME_7F0537B8(shortest_distance, low, high); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F053894 -/* 0883C4 7F053894 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0883C8 7F053898 AFBF002C */ sw $ra, 0x2c($sp) -/* 0883CC 7F05389C AFB10020 */ sw $s1, 0x20($sp) -/* 0883D0 7F0538A0 F7B40010 */ sdc1 $f20, 0x10($sp) -/* 0883D4 7F0538A4 AFA60038 */ sw $a2, 0x38($sp) -/* 0883D8 7F0538A8 00808825 */ move $s1, $a0 -/* 0883DC 7F0538AC AFB30028 */ sw $s3, 0x28($sp) -/* 0883E0 7F0538B0 AFB20024 */ sw $s2, 0x24($sp) -/* 0883E4 7F0538B4 AFB0001C */ sw $s0, 0x1c($sp) -/* 0883E8 7F0538B8 AFA50034 */ sw $a1, 0x34($sp) -/* 0883EC 7F0538BC 0FC26919 */ jal getPlayerCount -/* 0883F0 7F0538C0 C7B40038 */ lwc1 $f20, 0x38($sp) -/* 0883F4 7F0538C4 1840001D */ blez $v0, .L7F05393C -/* 0883F8 7F0538C8 3C0E8008 */ lui $t6, %hi(g_playerPointers) -/* 0883FC 7F0538CC 25D09EE0 */ addiu $s0, $t6, %lo(g_playerPointers) -/* 088400 7F0538D0 00027880 */ sll $t7, $v0, 2 -/* 088404 7F0538D4 01F09021 */ addu $s2, $t7, $s0 -/* 088408 7F0538D8 8E180000 */ lw $t8, ($s0) -.L7F0538DC: -/* 08840C 7F0538DC C6260000 */ lwc1 $f6, ($s1) -/* 088410 7F0538E0 C62A0004 */ lwc1 $f10, 4($s1) -/* 088414 7F0538E4 8F0200A8 */ lw $v0, 0xa8($t8) -/* 088418 7F0538E8 C6320008 */ lwc1 $f18, 8($s1) -/* 08841C 7F0538EC C4440008 */ lwc1 $f4, 8($v0) -/* 088420 7F0538F0 C448000C */ lwc1 $f8, 0xc($v0) -/* 088424 7F0538F4 C4500010 */ lwc1 $f16, 0x10($v0) -/* 088428 7F0538F8 46062001 */ sub.s $f0, $f4, $f6 -/* 08842C 7F0538FC 460A4081 */ sub.s $f2, $f8, $f10 -/* 088430 7F053900 46000102 */ mul.s $f4, $f0, $f0 -/* 088434 7F053904 46128381 */ sub.s $f14, $f16, $f18 -/* 088438 7F053908 46021182 */ mul.s $f6, $f2, $f2 -/* 08843C 7F05390C 46062200 */ add.s $f8, $f4, $f6 -/* 088440 7F053910 460E7282 */ mul.s $f10, $f14, $f14 -/* 088444 7F053914 0C007DF8 */ jal sqrtf -/* 088448 7F053918 460A4300 */ add.s $f12, $f8, $f10 -/* 08844C 7F05391C 4614003C */ c.lt.s $f0, $f20 -/* 088450 7F053920 26100004 */ addiu $s0, $s0, 4 -/* 088454 7F053924 0212082B */ sltu $at, $s0, $s2 -/* 088458 7F053928 45000002 */ bc1f .L7F053934 -/* 08845C 7F05392C 00000000 */ nop -/* 088460 7F053930 46000506 */ mov.s $f20, $f0 -.L7F053934: -/* 088464 7F053934 5420FFE9 */ bnezl $at, .L7F0538DC -/* 088468 7F053938 8E180000 */ lw $t8, ($s0) -.L7F05393C: -/* 08846C 7F05393C 4600A306 */ mov.s $f12, $f20 -/* 088470 7F053940 C7AE0034 */ lwc1 $f14, 0x34($sp) -/* 088474 7F053944 0FC14DEE */ jal sub_GAME_7F0537B8 -/* 088478 7F053948 8FA60038 */ lw $a2, 0x38($sp) -/* 08847C 7F05394C 8FBF002C */ lw $ra, 0x2c($sp) -/* 088480 7F053950 D7B40010 */ ldc1 $f20, 0x10($sp) -/* 088484 7F053954 8FB0001C */ lw $s0, 0x1c($sp) -/* 088488 7F053958 8FB10020 */ lw $s1, 0x20($sp) -/* 08848C 7F05395C 8FB20024 */ lw $s2, 0x24($sp) -/* 088490 7F053960 8FB30028 */ lw $s3, 0x28($sp) -/* 088494 7F053964 03E00008 */ jr $ra -/* 088498 7F053968 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - - - -#ifdef NONMATCHING -void sub_GAME_7F05396C(ALSoundState *state, coord3d *pos, f32 low, f32 high) { - +void chrobjSndCreatePostEvent(ALSoundState *state, coord3d *pos, f32 low, f32 high) +{ sndCreatePostEvent(state, 8, sub_GAME_7F053894(pos, low, high)); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05396C -/* 08849C 7F05396C 44866000 */ mtc1 $a2, $f12 -/* 0884A0 7F053970 44877000 */ mtc1 $a3, $f14 -/* 0884A4 7F053974 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0884A8 7F053978 AFA40018 */ sw $a0, 0x18($sp) -/* 0884AC 7F05397C AFA5001C */ sw $a1, 0x1c($sp) -/* 0884B0 7F053980 00A02025 */ move $a0, $a1 -/* 0884B4 7F053984 AFBF0014 */ sw $ra, 0x14($sp) -/* 0884B8 7F053988 44056000 */ mfc1 $a1, $f12 -/* 0884BC 7F05398C 44067000 */ mfc1 $a2, $f14 -/* 0884C0 7F053990 0FC14E25 */ jal sub_GAME_7F053894 -/* 0884C4 7F053994 00000000 */ nop -/* 0884C8 7F053998 8FA40018 */ lw $a0, 0x18($sp) -/* 0884CC 7F05399C 24050008 */ li $a1, 8 -/* 0884D0 7F0539A0 0C002461 */ jal sndCreatePostEvent -/* 0884D4 7F0539A4 00403025 */ move $a2, $v0 -/* 0884D8 7F0539A8 8FBF0014 */ lw $ra, 0x14($sp) -/* 0884DC 7F0539AC 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0884E0 7F0539B0 03E00008 */ jr $ra -/* 0884E4 7F0539B4 00000000 */ nop -) -#endif - - -//todo: code matches however variables refer to earlier funcs -#ifdef NONMATCHING -s32 sub_GAME_7F0539B8(f32 vol) //#MATCH +s32 sub_GAME_7F0539B8(f32 vol) { return sub_GAME_7F0537B8(vol, 5000.0f, 6000.0f); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0539B8 -/* 0884E8 7F0539B8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0884EC 7F0539BC AFBF0014 */ sw $ra, 0x14($sp) -/* 0884F0 7F0539C0 3C018005 */ lui $at, %hi(D_80053348) -/* 0884F4 7F0539C4 3C0645BB */ lui $a2, (0x45BB8000 >> 16) # lui $a2, 0x45bb -/* 0884F8 7F0539C8 34C68000 */ ori $a2, (0x45BB8000 & 0xFFFF) # ori $a2, $a2, 0x8000 -/* 0884FC 7F0539CC 0FC14DEE */ jal sub_GAME_7F0537B8 -/* 088500 7F0539D0 C42E3348 */ lwc1 $f14, %lo(D_80053348)($at) -/* 088504 7F0539D4 8FBF0014 */ lw $ra, 0x14($sp) -/* 088508 7F0539D8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 08850C 7F0539DC 03E00008 */ jr $ra -/* 088510 7F0539E0 00000000 */ nop -) -#endif - - - s32 sub_GAME_7F0539E4(coord3d *pos) { - //return sub_GAME_7F053894(pos, 5000.0f, 6000.0f); - return sub_GAME_7F053894(pos, 0x459C4000, 0x45BB8000); + return sub_GAME_7F053894(pos, 5000.0f, 6000.0f); } - - - -void sub_GAME_7F053A10(ALSoundState *state, coord3d *pos) +void chrobjSndCreatePostEventDefault(ALSoundState *state, coord3d *pos) { - //sub_GAME_7F05396C(state, pos, 5000.0f, 6000.0f); - sub_GAME_7F05396C(state, pos, 0x459C4000, 0x45BB8000); + chrobjSndCreatePostEvent(state, pos, 5000.0f, 6000.0f); } @@ -43288,7 +39080,7 @@ void play_door_opening_soundeffect_0(DoorRecord *door) { soundState = sndPlaySfx(g_musicSfxBufferPtr, 0x07, NULL); if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } soundState = sndPlaySfx(g_musicSfxBufferPtr, 0xCA, NULL); if (pendingState != NULL) @@ -43300,7 +39092,7 @@ void play_door_opening_soundeffect_0(DoorRecord *door) { if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } sub_GAME_7F053A3C(door); @@ -43402,7 +39194,7 @@ void play_door_opening_soundeffect_1(DoorRecord *door) { soundState = sndPlaySfx(g_musicSfxBufferPtr, 0x07, NULL); if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } soundState = sndPlaySfx(g_musicSfxBufferPtr, 0xCA, NULL); if (pendingState != NULL) @@ -43414,7 +39206,7 @@ void play_door_opening_soundeffect_1(DoorRecord *door) { if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } sub_GAME_7F053A3C(door); @@ -43473,7 +39265,7 @@ void play_door_closing_soundeffect_0(DoorRecord *door) { if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } sub_GAME_7F053A3C(door); @@ -43547,7 +39339,7 @@ void play_door_closing_soundeffect_1(DoorRecord *door) if (door); // Fix for recomp not matching if (soundState != NULL) { - sub_GAME_7F053A10(soundState, &door->prop->pos); + chrobjSndCreatePostEventDefault(soundState, &door->prop->pos); } sub_GAME_7F053A3C(door); @@ -43597,16 +39389,17 @@ void doorFinishOpen(DoorRecord *door) if (door->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - door->unk6C->flags |= 1; - matrix_4x4_set_identity(&door->unk6C->m); + door->projectile->flags |= 1; + matrix_4x4_set_identity(&door->projectile->mtx); } } } -void doorFinishClose(s32 arg0) { - play_door_closing_soundeffect_1(arg0); - doorDeactivatePortal(arg0); +void doorFinishClose(DoorRecord* door) +{ + play_door_closing_soundeffect_1(door); + doorDeactivatePortal(door); } @@ -43736,14 +39529,17 @@ s32 sub_GAME_7F054A64(PropRecord *prop, bbox2d *bbox) } -#if defined(LEFTOVERDEBUG) /** * Address 0x7F054B80. */ f32 chrobjFogVisRangeRelated(PropRecord *prop, f32 size) { f32 ret; +#if defined(LEFTOVERDEBUG) struct NearFogRecord *nfd; +#else + struct NearFogRecordF *nfd; +#endif f32 temp_f12; ret = 1.0f; @@ -43769,282 +39565,95 @@ f32 chrobjFogVisRangeRelated(PropRecord *prop, f32 size) return ret; } -#endif -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel chrobjFogVisRangeRelated -/* 087850 7F054E60 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 087854 7F054E64 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 087858 7F054E68 44818000 */ mtc1 $at, $f16 -/* 08785C 7F054E6C AFBF0014 */ sw $ra, 0x14($sp) -/* 087860 7F054E70 AFA40020 */ sw $a0, 0x20($sp) -/* 087864 7F054E74 AFA50024 */ sw $a1, 0x24($sp) -/* 087868 7F054E78 0FC2E9E6 */ jal fogGetNearFogValuesP -/* 08786C 7F054E7C E7B0001C */ swc1 $f16, 0x1c($sp) -/* 087870 7F054E80 10400028 */ beqz $v0, .L7F054F24 -/* 087874 7F054E84 C7B0001C */ lwc1 $f16, 0x1c($sp) -/* 087878 7F054E88 8FAE0020 */ lw $t6, 0x20($sp) -/* 08787C 7F054E8C C4440008 */ lwc1 $f4, 8($v0) -/* 087880 7F054E90 C5C60018 */ lwc1 $f6, 0x18($t6) -/* 087884 7F054E94 4606203C */ c.lt.s $f4, $f6 -/* 087888 7F054E98 00000000 */ nop -/* 08788C 7F054E9C 45020022 */ bc1fl .L7F054F28 -/* 087890 7F054EA0 8FBF0014 */ lw $ra, 0x14($sp) -/* 087894 7F054EA4 AFA20018 */ sw $v0, 0x18($sp) -/* 087898 7F054EA8 0FC1E141 */ jal getPlayer_c_lodscalez -/* 08789C 7F054EAC E7B0001C */ swc1 $f16, 0x1c($sp) -/* 0878A0 7F054EB0 8FA30018 */ lw $v1, 0x18($sp) -/* 0878A4 7F054EB4 8FAF0020 */ lw $t7, 0x20($sp) -/* 0878A8 7F054EB8 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0878AC 7F054EBC C4620008 */ lwc1 $f2, 8($v1) -/* 0878B0 7F054EC0 C5E80018 */ lwc1 $f8, 0x18($t7) -/* 0878B4 7F054EC4 44819000 */ mtc1 $at, $f18 -/* 0878B8 7F054EC8 C7A60024 */ lwc1 $f6, 0x24($sp) -/* 0878BC 7F054ECC 46024281 */ sub.s $f10, $f8, $f2 -/* 0878C0 7F054ED0 C46E0004 */ lwc1 $f14, 4($v1) -/* 0878C4 7F054ED4 C7B0001C */ lwc1 $f16, 0x1c($sp) -/* 0878C8 7F054ED8 46125102 */ mul.s $f4, $f10, $f18 -/* 0878CC 7F054EDC 46062203 */ div.s $f8, $f4, $f6 -/* 0878D0 7F054EE0 46024280 */ add.s $f10, $f8, $f2 -/* 0878D4 7F054EE4 46005302 */ mul.s $f12, $f10, $f0 -/* 0878D8 7F054EE8 460C703E */ c.le.s $f14, $f12 -/* 0878DC 7F054EEC 00000000 */ nop -/* 0878E0 7F054EF0 45020005 */ bc1fl .L7F054F08 -/* 0878E4 7F054EF4 C4600000 */ lwc1 $f0, ($v1) -/* 0878E8 7F054EF8 44808000 */ mtc1 $zero, $f16 -/* 0878EC 7F054EFC 1000000A */ b .L7F054F28 -/* 0878F0 7F054F00 8FBF0014 */ lw $ra, 0x14($sp) -/* 0878F4 7F054F04 C4600000 */ lwc1 $f0, ($v1) -.L7F054F08: -/* 0878F8 7F054F08 460C003C */ c.lt.s $f0, $f12 -/* 0878FC 7F054F0C 00000000 */ nop -/* 087900 7F054F10 45020005 */ bc1fl .L7F054F28 -/* 087904 7F054F14 8FBF0014 */ lw $ra, 0x14($sp) -/* 087908 7F054F18 460C7481 */ sub.s $f18, $f14, $f12 -/* 08790C 7F054F1C 46007101 */ sub.s $f4, $f14, $f0 -/* 087910 7F054F20 46049403 */ div.s $f16, $f18, $f4 -.L7F054F24: -/* 087914 7F054F24 8FBF0014 */ lw $ra, 0x14($sp) -.L7F054F28: -/* 087918 7F054F28 27BD0020 */ addiu $sp, $sp, 0x20 -/* 08791C 7F054F2C 46008006 */ mov.s $f0, $f16 -/* 087920 7F054F30 03E00008 */ jr $ra -/* 087924 7F054F34 00000000 */ nop -) -#endif +bool sub_GAME_7F054C58(coord3d *coord, f32 arg1) +{ + bool result = TRUE; + coord3d *ptr = (coord3d*)fogGetNearFogValuesP(); + coord3d tmp; + f32 sp20; + if (ptr != NULL) + { + coord3d *campos = bondviewGetCurrentPlayersPosition(); + Mtxf *mtx = camGetWorldToScreenMtxf(); -#ifdef NONMATCHING -void sub_GAME_7F054C58(void) { + tmp.x = coord->x - campos->x; + tmp.y = coord->y - campos->y; + tmp.z = coord->z - campos->z; + sp20 = tmp.f[0] * mtx->m[0][0] + tmp.f[1] * mtx->m[0][1] + tmp.f[2] * mtx->m[0][2]; + + if (sp20 > ptr->z) + { + f32 scalez = getPlayer_c_lodscalez(); + sp20 = ((sp20 - ptr->z) * 100 / arg1 + ptr->z) * scalez; + + if (sp20 >= ptr->y) + { + result = FALSE; + } + } + } + + return result; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F054C58 -/* 089788 7F054C58 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 08978C 7F054C5C AFBF0014 */ sw $ra, 0x14($sp) -/* 089790 7F054C60 240E0001 */ li $t6, 1 -/* 089794 7F054C64 AFA40038 */ sw $a0, 0x38($sp) -/* 089798 7F054C68 AFA5003C */ sw $a1, 0x3c($sp) -/* 08979C 7F054C6C 0FC2ECE6 */ jal fogGetNearFogValuesP -/* 0897A0 7F054C70 AFAE0034 */ sw $t6, 0x34($sp) -/* 0897A4 7F054C74 50400039 */ beql $v0, $zero, .L7F054D5C -/* 0897A8 7F054C78 8FBF0014 */ lw $ra, 0x14($sp) -/* 0897AC 7F054C7C 0FC227F5 */ jal bondviewGetCurrentPlayersPosition -/* 0897B0 7F054C80 AFA20030 */ sw $v0, 0x30($sp) -/* 0897B4 7F054C84 0FC1E0F1 */ jal currentPlayerGetMatrix10CC -/* 0897B8 7F054C88 AFA2001C */ sw $v0, 0x1c($sp) -/* 0897BC 7F054C8C 8FA3001C */ lw $v1, 0x1c($sp) -/* 0897C0 7F054C90 8FA50038 */ lw $a1, 0x38($sp) -/* 0897C4 7F054C94 8FA40030 */ lw $a0, 0x30($sp) -/* 0897C8 7F054C98 C4660000 */ lwc1 $f6, ($v1) -/* 0897CC 7F054C9C C4A40000 */ lwc1 $f4, ($a1) -/* 0897D0 7F054CA0 46062201 */ sub.s $f8, $f4, $f6 -/* 0897D4 7F054CA4 E7A80024 */ swc1 $f8, 0x24($sp) -/* 0897D8 7F054CA8 C4700004 */ lwc1 $f16, 4($v1) -/* 0897DC 7F054CAC C4AA0004 */ lwc1 $f10, 4($a1) -/* 0897E0 7F054CB0 46105481 */ sub.s $f18, $f10, $f16 -/* 0897E4 7F054CB4 C7AA0024 */ lwc1 $f10, 0x24($sp) -/* 0897E8 7F054CB8 E7B20028 */ swc1 $f18, 0x28($sp) -/* 0897EC 7F054CBC C4660008 */ lwc1 $f6, 8($v1) -/* 0897F0 7F054CC0 C4A40008 */ lwc1 $f4, 8($a1) -/* 0897F4 7F054CC4 46062201 */ sub.s $f8, $f4, $f6 -/* 0897F8 7F054CC8 C7A40028 */ lwc1 $f4, 0x28($sp) -/* 0897FC 7F054CCC E7A8002C */ swc1 $f8, 0x2c($sp) -/* 089800 7F054CD0 C4500000 */ lwc1 $f16, ($v0) -/* 089804 7F054CD4 C4460004 */ lwc1 $f6, 4($v0) -/* 089808 7F054CD8 46105482 */ mul.s $f18, $f10, $f16 -/* 08980C 7F054CDC C4500008 */ lwc1 $f16, 8($v0) -/* 089810 7F054CE0 46062202 */ mul.s $f8, $f4, $f6 -/* 089814 7F054CE4 C7A4002C */ lwc1 $f4, 0x2c($sp) -/* 089818 7F054CE8 46048182 */ mul.s $f6, $f16, $f4 -/* 08981C 7F054CEC 46089280 */ add.s $f10, $f18, $f8 -/* 089820 7F054CF0 C4920008 */ lwc1 $f18, 8($a0) -/* 089824 7F054CF4 460A3300 */ add.s $f12, $f6, $f10 -/* 089828 7F054CF8 460C903C */ c.lt.s $f18, $f12 -/* 08982C 7F054CFC 00000000 */ nop -/* 089830 7F054D00 45020016 */ bc1fl .L7F054D5C -/* 089834 7F054D04 8FBF0014 */ lw $ra, 0x14($sp) -/* 089838 7F054D08 AFA40030 */ sw $a0, 0x30($sp) -/* 08983C 7F054D0C 0FC1E121 */ jal getPlayer_c_lodscalez -/* 089840 7F054D10 E7AC0020 */ swc1 $f12, 0x20($sp) -/* 089844 7F054D14 8FA40030 */ lw $a0, 0x30($sp) -/* 089848 7F054D18 C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 08984C 7F054D1C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 089850 7F054D20 C4820008 */ lwc1 $f2, 8($a0) -/* 089854 7F054D24 44818000 */ mtc1 $at, $f16 -/* 089858 7F054D28 C7A6003C */ lwc1 $f6, 0x3c($sp) -/* 08985C 7F054D2C 46026201 */ sub.s $f8, $f12, $f2 -/* 089860 7F054D30 46104102 */ mul.s $f4, $f8, $f16 -/* 089864 7F054D34 C4880004 */ lwc1 $f8, 4($a0) -/* 089868 7F054D38 46062283 */ div.s $f10, $f4, $f6 -/* 08986C 7F054D3C 46025480 */ add.s $f18, $f10, $f2 -/* 089870 7F054D40 46009302 */ mul.s $f12, $f18, $f0 -/* 089874 7F054D44 460C403E */ c.le.s $f8, $f12 -/* 089878 7F054D48 00000000 */ nop -/* 08987C 7F054D4C 45020003 */ bc1fl .L7F054D5C -/* 089880 7F054D50 8FBF0014 */ lw $ra, 0x14($sp) -/* 089884 7F054D54 AFA00034 */ sw $zero, 0x34($sp) -/* 089888 7F054D58 8FBF0014 */ lw $ra, 0x14($sp) -.L7F054D5C: -/* 08988C 7F054D5C 8FA20034 */ lw $v0, 0x34($sp) -/* 089890 7F054D60 27BD0038 */ addiu $sp, $sp, 0x38 -/* 089894 7F054D64 03E00008 */ jr $ra -/* 089898 7F054D68 00000000 */ nop -) -#endif +// PD: func0f08e8ac +bool sub_GAME_7F054D6C(PropRecord *prop, coord3d *pos, f32 arg2, bool arg3) +{ + s32 room_ids[8]; + s32 *rooms; + s32 roomnum; + bool result; + bbox2d bbox; + + result = FALSE; + chraiGetPropRoomIds(prop, room_ids); + rooms = room_ids; + roomnum = *rooms; + + while (roomnum >= 0) + { + if (getROOMID_Bitflags(roomnum) != 0) + { + if (fogPositionIsVisibleThroughFog(pos, arg2) && (!arg3 || sub_GAME_7F054C58(pos, arg2))) + { + if (sub_GAME_7F054A64(prop, &bbox) != 0) + { + result = camIsPosInScreenBox(pos, arg2, &bbox); + } + else + { + result = sub_GAME_7F078A58(pos, arg2); + } + if (result) + { + coord3d *campos = bondviewGetCurrentPlayersPosition(); + f32 xdiff = pos->x - campos->x; + f32 ydiff = pos->y - campos->y; + f32 zdiff = pos->z - campos->z; + if (xdiff * xdiff + ydiff * ydiff + zdiff * zdiff > 32000 * 32000) + { + result = FALSE; + } + } + } + break; + } -#ifdef NONMATCHING -void sub_GAME_7F054D6C(void) { + rooms++; + roomnum = *rooms; + result = FALSE; + } + return result; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_8005345C -.word 0x4e742400 /*1.024e9*/ -glabel D_80053460 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053464 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053468 -.word 0x40490fdb /*3.1415927*/ -glabel D_8005346C -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053470 -.word 0x40490fdb /*3.1415927*/ -glabel D_80053474 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053478 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005347C -.word 0x40490fdb /*3.1415927*/ -glabel D_80053480 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053484 -.word 0x3eb2b8c3 /*0.34906587*/ -glabel D_80053488 -.word 0x40490fdb /*3.1415927*/ -glabel D_8005348C -.word 0x471c4000 /*40000.0*/ -.text -glabel sub_GAME_7F054D6C -/* 08989C 7F054D6C 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 0898A0 7F054D70 AFB10018 */ sw $s1, 0x18($sp) -/* 0898A4 7F054D74 00A08825 */ move $s1, $a1 -/* 0898A8 7F054D78 AFBF001C */ sw $ra, 0x1c($sp) -/* 0898AC 7F054D7C AFB00014 */ sw $s0, 0x14($sp) -/* 0898B0 7F054D80 AFA40070 */ sw $a0, 0x70($sp) -/* 0898B4 7F054D84 AFA60078 */ sw $a2, 0x78($sp) -/* 0898B8 7F054D88 AFA7007C */ sw $a3, 0x7c($sp) -/* 0898BC 7F054D8C AFA00044 */ sw $zero, 0x44($sp) -/* 0898C0 7F054D90 0FC0F2E3 */ jal chraiGetPropRoomIds -/* 0898C4 7F054D94 27A50050 */ addiu $a1, $sp, 0x50 -/* 0898C8 7F054D98 8FA40050 */ lw $a0, 0x50($sp) -/* 0898CC 7F054D9C 27B00050 */ addiu $s0, $sp, 0x50 -/* 0898D0 7F054DA0 0482003C */ bltzl $a0, .L7F054E94 -/* 0898D4 7F054DA4 8FBF001C */ lw $ra, 0x1c($sp) -.L7F054DA8: -/* 0898D8 7F054DA8 0FC2D794 */ jal getROOMID_Bitflags -/* 0898DC 7F054DAC 00000000 */ nop -/* 0898E0 7F054DB0 10400033 */ beqz $v0, .L7F054E80 -/* 0898E4 7F054DB4 02202025 */ move $a0, $s1 -/* 0898E8 7F054DB8 0FC2ECB2 */ jal fogPositionIsVisibleThroughFog -/* 0898EC 7F054DBC 8FA50078 */ lw $a1, 0x78($sp) -/* 0898F0 7F054DC0 10400033 */ beqz $v0, .L7F054E90 -/* 0898F4 7F054DC4 8FAE007C */ lw $t6, 0x7c($sp) -/* 0898F8 7F054DC8 11C00004 */ beqz $t6, .L7F054DDC -/* 0898FC 7F054DCC 02202025 */ move $a0, $s1 -/* 089900 7F054DD0 0FC15316 */ jal sub_GAME_7F054C58 -/* 089904 7F054DD4 8FA50078 */ lw $a1, 0x78($sp) -/* 089908 7F054DD8 1040002D */ beqz $v0, .L7F054E90 -.L7F054DDC: -/* 08990C 7F054DDC 27B00034 */ addiu $s0, $sp, 0x34 -/* 089910 7F054DE0 02002825 */ move $a1, $s0 -/* 089914 7F054DE4 0FC15299 */ jal sub_GAME_7F054A64 -/* 089918 7F054DE8 8FA40070 */ lw $a0, 0x70($sp) -/* 08991C 7F054DEC 10400007 */ beqz $v0, .L7F054E0C -/* 089920 7F054DF0 02202025 */ move $a0, $s1 -/* 089924 7F054DF4 02202025 */ move $a0, $s1 -/* 089928 7F054DF8 8FA50078 */ lw $a1, 0x78($sp) -/* 08992C 7F054DFC 0FC1E2FD */ jal camIsPosInScreenBox -/* 089930 7F054E00 02003025 */ move $a2, $s0 -/* 089934 7F054E04 10000004 */ b .L7F054E18 -/* 089938 7F054E08 AFA20044 */ sw $v0, 0x44($sp) -.L7F054E0C: -/* 08993C 7F054E0C 0FC1E296 */ jal sub_GAME_7F078A58 -/* 089940 7F054E10 8FA50078 */ lw $a1, 0x78($sp) -/* 089944 7F054E14 AFA20044 */ sw $v0, 0x44($sp) -.L7F054E18: -/* 089948 7F054E18 5040001E */ beql $v0, $zero, .L7F054E94 -/* 08994C 7F054E1C 8FBF001C */ lw $ra, 0x1c($sp) -/* 089950 7F054E20 0FC227F5 */ jal bondviewGetCurrentPlayersPosition -/* 089954 7F054E24 00000000 */ nop -/* 089958 7F054E28 C6240000 */ lwc1 $f4, ($s1) -/* 08995C 7F054E2C C4460000 */ lwc1 $f6, ($v0) -/* 089960 7F054E30 C6280004 */ lwc1 $f8, 4($s1) -/* 089964 7F054E34 C44A0004 */ lwc1 $f10, 4($v0) -/* 089968 7F054E38 46062001 */ sub.s $f0, $f4, $f6 -/* 08996C 7F054E3C C6300008 */ lwc1 $f16, 8($s1) -/* 089970 7F054E40 C4520008 */ lwc1 $f18, 8($v0) -/* 089974 7F054E44 460A4081 */ sub.s $f2, $f8, $f10 -/* 089978 7F054E48 46000182 */ mul.s $f6, $f0, $f0 -/* 08997C 7F054E4C 3C018005 */ lui $at, %hi(D_8005345C) -/* 089980 7F054E50 46128301 */ sub.s $f12, $f16, $f18 -/* 089984 7F054E54 46021202 */ mul.s $f8, $f2, $f2 -/* 089988 7F054E58 C424345C */ lwc1 $f4, %lo(D_8005345C)($at) -/* 08998C 7F054E5C 460C6402 */ mul.s $f16, $f12, $f12 -/* 089990 7F054E60 46083280 */ add.s $f10, $f6, $f8 -/* 089994 7F054E64 46105480 */ add.s $f18, $f10, $f16 -/* 089998 7F054E68 4612203C */ c.lt.s $f4, $f18 -/* 08999C 7F054E6C 00000000 */ nop -/* 0899A0 7F054E70 45020008 */ bc1fl .L7F054E94 -/* 0899A4 7F054E74 8FBF001C */ lw $ra, 0x1c($sp) -/* 0899A8 7F054E78 10000005 */ b .L7F054E90 -/* 0899AC 7F054E7C AFA00044 */ sw $zero, 0x44($sp) -.L7F054E80: -/* 0899B0 7F054E80 8E040004 */ lw $a0, 4($s0) -/* 0899B4 7F054E84 26100004 */ addiu $s0, $s0, 4 -/* 0899B8 7F054E88 0481FFC7 */ bgez $a0, .L7F054DA8 -/* 0899BC 7F054E8C 00000000 */ nop -.L7F054E90: -/* 0899C0 7F054E90 8FBF001C */ lw $ra, 0x1c($sp) -.L7F054E94: -/* 0899C4 7F054E94 8FA20044 */ lw $v0, 0x44($sp) -/* 0899C8 7F054E98 8FB00014 */ lw $s0, 0x14($sp) -/* 0899CC 7F054E9C 8FB10018 */ lw $s1, 0x18($sp) -/* 0899D0 7F054EA0 03E00008 */ jr $ra -/* 0899D4 7F054EA4 27BD0070 */ addiu $sp, $sp, 0x70 -) -#endif + /** * Loaded to 7F054EA8. @@ -44285,552 +39894,251 @@ glabel sub_GAME_7F054FB4 #endif +// PD: door0f08f604 +void sub_GAME_7F05522C(DoorRecord *door, f32 *arg1, f32 *arg2, s32 altcoordsystem) +{ + f32 anglediff; + PropRecord *playerprop; + BoundPadRecord *pad; + coord3d field_10; + coord3d normal; + f32 xmin; + f32 xmax; + coord3d playerpos; + f32 angle2; + f32 cosine; + f32 sine; + f32 angle; + f32 y1; + f32 x1; + f32 playerangle; + f32 anglediff2; + f32 scale; + f32 xbound; + + pad = &g_CurrentSetup.boundpads[door->pad]; + playerprop = get_curplayer_positiondata(); + + if (1) { scale = 1.0f; } + playerpos.f[0] = (((g_CurrentPlayer->field_488.theta_transform.x * 30.0f) * scale) * 0.75f) + playerprop->pos.x; + playerpos.f[1] = playerprop->pos.y; + playerpos.f[2] = (((g_CurrentPlayer->field_488.theta_transform.z * 30.0f) * scale) * 0.75f) + playerprop->pos.z; + + if (altcoordsystem != 0) + { + xmin = pad->bbox.xmin; + xmax = pad->bbox.xmax; + normal.f[0] = (pad->up.y * pad->look.z) - (pad->look.y * pad->up.z); + normal.f[1] = (pad->up.z * pad->look.x) - (pad->look.z * pad->up.x); + normal.f[2] = (pad->up.x * pad->look.y) - (pad->look.x * pad->up.y); + } + else + { + xmin = pad->bbox.ymin; + xmax = pad->bbox.ymax; + normal.f[0] = pad->up.x; + normal.f[1] = pad->up.y; + normal.f[2] = pad->up.z; + } + + x1 = (pad->pos.x + (normal.x * xmin)) - playerpos.x; + y1 = (pad->pos.z + (normal.z * xmin)) - playerpos.z; + angle = atan2f(x1, y1); + + playerangle = get_curplay_horizontal_rotation_in_degrees(); + anglediff = angle - playerangle; + scale = (angle - playerangle) + M_TAU_F; + if (angle < playerangle) + { + anglediff = scale; + } + if (anglediff > M_PI_F) + { + anglediff = anglediff - M_TAU_F; + } -#ifdef NONMATCHING -void sub_GAME_7F05522C(void) { + if (door->doorType == 5) + { + angle2 = (door->openPosition * M_TAU_F) / 360.0f; + if (door->flags & 0x20000000) + { + angle2 = M_TAU_F - angle2; + } -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05522C -/* 089D5C 7F05522C 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 089D60 7F055230 AFBF0014 */ sw $ra, 0x14($sp) -/* 089D64 7F055234 AFA40068 */ sw $a0, 0x68($sp) -/* 089D68 7F055238 AFA5006C */ sw $a1, 0x6c($sp) -/* 089D6C 7F05523C AFA60070 */ sw $a2, 0x70($sp) -/* 089D70 7F055240 AFA70074 */ sw $a3, 0x74($sp) -/* 089D74 7F055244 84990006 */ lh $t9, 6($a0) -/* 089D78 7F055248 3C098007 */ lui $t1, %hi(g_CurrentSetup+0x1C) -/* 089D7C 7F05524C 8D295D1C */ lw $t1, %lo(g_CurrentSetup+0x1C)($t1) -/* 089D80 7F055250 00194100 */ sll $t0, $t9, 4 -/* 089D84 7F055254 01194021 */ addu $t0, $t0, $t9 -/* 089D88 7F055258 00084080 */ sll $t0, $t0, 2 -/* 089D8C 7F05525C 01091821 */ addu $v1, $t0, $t1 -/* 089D90 7F055260 0FC225E6 */ jal get_curplayer_positiondata -/* 089D94 7F055264 AFA3005C */ sw $v1, 0x5c($sp) -/* 089D98 7F055268 3C048008 */ lui $a0, %hi(g_CurrentPlayer) -/* 089D9C 7F05526C 8C84A0B0 */ lw $a0, %lo(g_CurrentPlayer)($a0) -/* 089DA0 7F055270 3C0141F0 */ li $at, 0x41F00000 # 30.000000 -/* 089DA4 7F055274 44810000 */ mtc1 $at, $f0 -/* 089DA8 7F055278 C4840498 */ lwc1 $f4, 0x498($a0) -/* 089DAC 7F05527C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 089DB0 7F055280 44811000 */ mtc1 $at, $f2 -/* 089DB4 7F055284 46002282 */ mul.s $f10, $f4, $f0 -/* 089DB8 7F055288 3C013F40 */ li $at, 0x3F400000 # 0.750000 -/* 089DBC 7F05528C 44816000 */ mtc1 $at, $f12 -/* 089DC0 7F055290 C4440008 */ lwc1 $f4, 8($v0) -/* 089DC4 7F055294 8FAA0074 */ lw $t2, 0x74($sp) -/* 089DC8 7F055298 8FA3005C */ lw $v1, 0x5c($sp) -/* 089DCC 7F05529C 46025202 */ mul.s $f8, $f10, $f2 -/* 089DD0 7F0552A0 00000000 */ nop -/* 089DD4 7F0552A4 460C4182 */ mul.s $f6, $f8, $f12 -/* 089DD8 7F0552A8 46043280 */ add.s $f10, $f6, $f4 -/* 089DDC 7F0552AC E7AA0030 */ swc1 $f10, 0x30($sp) -/* 089DE0 7F0552B0 C448000C */ lwc1 $f8, 0xc($v0) -/* 089DE4 7F0552B4 E7A80034 */ swc1 $f8, 0x34($sp) -/* 089DE8 7F0552B8 C48604A0 */ lwc1 $f6, 0x4a0($a0) -/* 089DEC 7F0552BC 46003102 */ mul.s $f4, $f6, $f0 -/* 089DF0 7F0552C0 C4460010 */ lwc1 $f6, 0x10($v0) -/* 089DF4 7F0552C4 46022282 */ mul.s $f10, $f4, $f2 -/* 089DF8 7F0552C8 00000000 */ nop -/* 089DFC 7F0552CC 460C5202 */ mul.s $f8, $f10, $f12 -/* 089E00 7F0552D0 46064100 */ add.s $f4, $f8, $f6 -/* 089E04 7F0552D4 1140001D */ beqz $t2, .L7F05534C -/* 089E08 7F0552D8 E7A40038 */ swc1 $f4, 0x38($sp) -/* 089E0C 7F0552DC C46A0030 */ lwc1 $f10, 0x30($v1) -/* 089E10 7F0552E0 C472002C */ lwc1 $f18, 0x2c($v1) -/* 089E14 7F0552E4 E7AA003C */ swc1 $f10, 0x3c($sp) -/* 089E18 7F0552E8 C4680010 */ lwc1 $f8, 0x10($v1) -/* 089E1C 7F0552EC C4660020 */ lwc1 $f6, 0x20($v1) -/* 089E20 7F0552F0 C46A001C */ lwc1 $f10, 0x1c($v1) -/* 089E24 7F0552F4 46064102 */ mul.s $f4, $f8, $f6 -/* 089E28 7F0552F8 C4680014 */ lwc1 $f8, 0x14($v1) -/* 089E2C 7F0552FC 46085182 */ mul.s $f6, $f10, $f8 -/* 089E30 7F055300 46062281 */ sub.s $f10, $f4, $f6 -/* 089E34 7F055304 E7AA0044 */ swc1 $f10, 0x44($sp) -/* 089E38 7F055308 C4640018 */ lwc1 $f4, 0x18($v1) -/* 089E3C 7F05530C C4680014 */ lwc1 $f8, 0x14($v1) -/* 089E40 7F055310 C46A0020 */ lwc1 $f10, 0x20($v1) -/* 089E44 7F055314 46044182 */ mul.s $f6, $f8, $f4 -/* 089E48 7F055318 C468000C */ lwc1 $f8, 0xc($v1) -/* 089E4C 7F05531C 46085102 */ mul.s $f4, $f10, $f8 -/* 089E50 7F055320 46043281 */ sub.s $f10, $f6, $f4 -/* 089E54 7F055324 E7AA0048 */ swc1 $f10, 0x48($sp) -/* 089E58 7F055328 C466001C */ lwc1 $f6, 0x1c($v1) -/* 089E5C 7F05532C C468000C */ lwc1 $f8, 0xc($v1) -/* 089E60 7F055330 C46A0018 */ lwc1 $f10, 0x18($v1) -/* 089E64 7F055334 46064102 */ mul.s $f4, $f8, $f6 -/* 089E68 7F055338 C4680010 */ lwc1 $f8, 0x10($v1) -/* 089E6C 7F05533C 46085182 */ mul.s $f6, $f10, $f8 -/* 089E70 7F055340 46062281 */ sub.s $f10, $f4, $f6 -/* 089E74 7F055344 1000000A */ b .L7F055370 -/* 089E78 7F055348 E7AA004C */ swc1 $f10, 0x4c($sp) -.L7F05534C: -/* 089E7C 7F05534C C4680038 */ lwc1 $f8, 0x38($v1) -/* 089E80 7F055350 C4720034 */ lwc1 $f18, 0x34($v1) -/* 089E84 7F055354 E7A8003C */ swc1 $f8, 0x3c($sp) -/* 089E88 7F055358 C464000C */ lwc1 $f4, 0xc($v1) -/* 089E8C 7F05535C E7A40044 */ swc1 $f4, 0x44($sp) -/* 089E90 7F055360 C4660010 */ lwc1 $f6, 0x10($v1) -/* 089E94 7F055364 E7A60048 */ swc1 $f6, 0x48($sp) -/* 089E98 7F055368 C46A0014 */ lwc1 $f10, 0x14($v1) -/* 089E9C 7F05536C E7AA004C */ swc1 $f10, 0x4c($sp) -.L7F055370: -/* 089EA0 7F055370 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 089EA4 7F055374 C4680000 */ lwc1 $f8, ($v1) -/* 089EA8 7F055378 46122182 */ mul.s $f6, $f4, $f18 -/* 089EAC 7F05537C C7A40030 */ lwc1 $f4, 0x30($sp) -/* 089EB0 7F055380 46064280 */ add.s $f10, $f8, $f6 -/* 089EB4 7F055384 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 089EB8 7F055388 C4680008 */ lwc1 $f8, 8($v1) -/* 089EBC 7F05538C E7B20040 */ swc1 $f18, 0x40($sp) -/* 089EC0 7F055390 46045301 */ sub.s $f12, $f10, $f4 -/* 089EC4 7F055394 46123282 */ mul.s $f10, $f6, $f18 -/* 089EC8 7F055398 C7A60038 */ lwc1 $f6, 0x38($sp) -/* 089ECC 7F05539C AFA3005C */ sw $v1, 0x5c($sp) -/* 089ED0 7F0553A0 460A4100 */ add.s $f4, $f8, $f10 -/* 089ED4 7F0553A4 0FC16A8C */ jal atan2f -/* 089ED8 7F0553A8 46062381 */ sub.s $f14, $f4, $f6 -/* 089EDC 7F0553AC 0FC227B9 */ jal get_curplay_horizontal_rotation_in_degrees -/* 089EE0 7F0553B0 E7A00020 */ swc1 $f0, 0x20($sp) -/* 089EE4 7F0553B4 C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 089EE8 7F0553B8 8FA3005C */ lw $v1, 0x5c($sp) -/* 089EEC 7F0553BC C7B20040 */ lwc1 $f18, 0x40($sp) -/* 089EF0 7F0553C0 4600603C */ c.lt.s $f12, $f0 -/* 089EF4 7F0553C4 3C018005 */ lui $at, %hi(D_80053460) -/* 089EF8 7F0553C8 46006381 */ sub.s $f14, $f12, $f0 -/* 089EFC 7F0553CC 8FA20068 */ lw $v0, 0x68($sp) -/* 089F00 7F0553D0 C7B0003C */ lwc1 $f16, 0x3c($sp) -/* 089F04 7F0553D4 45000003 */ bc1f .L7F0553E4 -/* 089F08 7F0553D8 46007086 */ mov.s $f2, $f14 -/* 089F0C 7F0553DC C4203460 */ lwc1 $f0, %lo(D_80053460)($at) -/* 089F10 7F0553E0 46007080 */ add.s $f2, $f14, $f0 -.L7F0553E4: -/* 089F14 7F0553E4 3C018005 */ lui $at, %hi(D_80053464) -/* 089F18 7F0553E8 C4203464 */ lwc1 $f0, %lo(D_80053464)($at) -/* 089F1C 7F0553EC 3C018005 */ lui $at, %hi(D_80053468) -/* 089F20 7F0553F0 C4283468 */ lwc1 $f8, %lo(D_80053468)($at) -/* 089F24 7F0553F4 C7AA0044 */ lwc1 $f10, 0x44($sp) -/* 089F28 7F0553F8 4602403C */ c.lt.s $f8, $f2 -/* 089F2C 7F0553FC 00000000 */ nop -/* 089F30 7F055400 45020003 */ bc1fl .L7F055410 -/* 089F34 7F055404 944B009A */ lhu $t3, 0x9a($v0) -/* 089F38 7F055408 46001081 */ sub.s $f2, $f2, $f0 -/* 089F3C 7F05540C 944B009A */ lhu $t3, 0x9a($v0) -.L7F055410: -/* 089F40 7F055410 24010005 */ li $at, 5 -/* 089F44 7F055414 15610046 */ bne $t3, $at, .L7F055530 -/* 089F48 7F055418 00000000 */ nop -/* 089F4C 7F05541C C44A00B4 */ lwc1 $f10, 0xb4($v0) -/* 089F50 7F055420 8C4C0008 */ lw $t4, 8($v0) -/* 089F54 7F055424 3C0143B4 */ li $at, 0x43B40000 # 360.000000 -/* 089F58 7F055428 46005102 */ mul.s $f4, $f10, $f0 -/* 089F5C 7F05542C 44813000 */ mtc1 $at, $f6 -/* 089F60 7F055430 000C6880 */ sll $t5, $t4, 2 -/* 089F64 7F055434 05A10002 */ bgez $t5, .L7F055440 -/* 089F68 7F055438 46062303 */ div.s $f12, $f4, $f6 -/* 089F6C 7F05543C 460C0301 */ sub.s $f12, $f0, $f12 -.L7F055440: -/* 089F70 7F055440 AFA3005C */ sw $v1, 0x5c($sp) -/* 089F74 7F055444 E7A20064 */ swc1 $f2, 0x64($sp) -/* 089F78 7F055448 E7AC002C */ swc1 $f12, 0x2c($sp) -/* 089F7C 7F05544C 0FC15FA8 */ jal cosf -/* 089F80 7F055450 E7B20040 */ swc1 $f18, 0x40($sp) -/* 089F84 7F055454 C7AC002C */ lwc1 $f12, 0x2c($sp) -/* 089F88 7F055458 0FC15FAB */ jal sinf -/* 089F8C 7F05545C E7A00028 */ swc1 $f0, 0x28($sp) -/* 089F90 7F055460 C7B20040 */ lwc1 $f18, 0x40($sp) -/* 089F94 7F055464 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 089F98 7F055468 8FA3005C */ lw $v1, 0x5c($sp) -/* 089F9C 7F05546C C7A8003C */ lwc1 $f8, 0x3c($sp) -/* 089FA0 7F055470 46122182 */ mul.s $f6, $f4, $f18 -/* 089FA4 7F055474 C46A0000 */ lwc1 $f10, ($v1) -/* 089FA8 7F055478 46124081 */ sub.s $f2, $f8, $f18 -/* 089FAC 7F05547C C7B00028 */ lwc1 $f16, 0x28($sp) -/* 089FB0 7F055480 46065200 */ add.s $f8, $f10, $f6 -/* 089FB4 7F055484 46102282 */ mul.s $f10, $f4, $f16 -/* 089FB8 7F055488 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 089FBC 7F05548C E7A80018 */ swc1 $f8, 0x18($sp) -/* 089FC0 7F055490 46003202 */ mul.s $f8, $f6, $f0 -/* 089FC4 7F055494 46085280 */ add.s $f10, $f10, $f8 -/* 089FC8 7F055498 460A1202 */ mul.s $f8, $f2, $f10 -/* 089FCC 7F05549C C7AA0018 */ lwc1 $f10, 0x18($sp) -/* 089FD0 7F0554A0 46085280 */ add.s $f10, $f10, $f8 -/* 089FD4 7F0554A4 C7A80030 */ lwc1 $f8, 0x30($sp) -/* 089FD8 7F0554A8 46085301 */ sub.s $f12, $f10, $f8 -/* 089FDC 7F0554AC 46123202 */ mul.s $f8, $f6, $f18 -/* 089FE0 7F0554B0 C46A0008 */ lwc1 $f10, 8($v1) -/* 089FE4 7F0554B4 46085280 */ add.s $f10, $f10, $f8 -/* 089FE8 7F0554B8 46002207 */ neg.s $f8, $f4 -/* 089FEC 7F0554BC 46004102 */ mul.s $f4, $f8, $f0 -/* 089FF0 7F0554C0 00000000 */ nop -/* 089FF4 7F0554C4 46103202 */ mul.s $f8, $f6, $f16 -/* 089FF8 7F0554C8 46082180 */ add.s $f6, $f4, $f8 -/* 089FFC 7F0554CC 46061102 */ mul.s $f4, $f2, $f6 -/* 08A000 7F0554D0 C7A60038 */ lwc1 $f6, 0x38($sp) -/* 08A004 7F0554D4 46045200 */ add.s $f8, $f10, $f4 -/* 08A008 7F0554D8 0FC16A8C */ jal atan2f -/* 08A00C 7F0554DC 46064381 */ sub.s $f14, $f8, $f6 -/* 08A010 7F0554E0 0FC227B9 */ jal get_curplay_horizontal_rotation_in_degrees -/* 08A014 7F0554E4 E7A00020 */ swc1 $f0, 0x20($sp) -/* 08A018 7F0554E8 C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 08A01C 7F0554EC 3C018005 */ lui $at, %hi(D_8005346C) -/* 08A020 7F0554F0 4600603C */ c.lt.s $f12, $f0 -/* 08A024 7F0554F4 46006381 */ sub.s $f14, $f12, $f0 -/* 08A028 7F0554F8 45000003 */ bc1f .L7F055508 -/* 08A02C 7F0554FC 46007086 */ mov.s $f2, $f14 -/* 08A030 7F055500 C42A346C */ lwc1 $f10, %lo(D_8005346C)($at) -/* 08A034 7F055504 460A7080 */ add.s $f2, $f14, $f10 -.L7F055508: -/* 08A038 7F055508 3C018005 */ lui $at, %hi(D_80053470) -/* 08A03C 7F05550C C4243470 */ lwc1 $f4, %lo(D_80053470)($at) -/* 08A040 7F055510 3C018005 */ lui $at, %hi(D_80053474) -/* 08A044 7F055514 4602203C */ c.lt.s $f4, $f2 -/* 08A048 7F055518 00000000 */ nop -/* 08A04C 7F05551C 45020025 */ bc1fl .L7F0555B4 -/* 08A050 7F055520 C7A00064 */ lwc1 $f0, 0x64($sp) -/* 08A054 7F055524 C4283474 */ lwc1 $f8, %lo(D_80053474)($at) -/* 08A058 7F055528 10000021 */ b .L7F0555B0 -/* 08A05C 7F05552C 46081081 */ sub.s $f2, $f2, $f8 -.L7F055530: -/* 08A060 7F055530 46105102 */ mul.s $f4, $f10, $f16 -/* 08A064 7F055534 C4660000 */ lwc1 $f6, ($v1) -/* 08A068 7F055538 C7AA0030 */ lwc1 $f10, 0x30($sp) -/* 08A06C 7F05553C 46043200 */ add.s $f8, $f6, $f4 -/* 08A070 7F055540 C7A4004C */ lwc1 $f4, 0x4c($sp) -/* 08A074 7F055544 C4660008 */ lwc1 $f6, 8($v1) -/* 08A078 7F055548 E7A20064 */ swc1 $f2, 0x64($sp) -/* 08A07C 7F05554C 460A4301 */ sub.s $f12, $f8, $f10 -/* 08A080 7F055550 46102202 */ mul.s $f8, $f4, $f16 -/* 08A084 7F055554 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 08A088 7F055558 46083280 */ add.s $f10, $f6, $f8 -/* 08A08C 7F05555C 0FC16A8C */ jal atan2f -/* 08A090 7F055560 46045381 */ sub.s $f14, $f10, $f4 -/* 08A094 7F055564 0FC227B9 */ jal get_curplay_horizontal_rotation_in_degrees -/* 08A098 7F055568 E7A00020 */ swc1 $f0, 0x20($sp) -/* 08A09C 7F05556C C7AC0020 */ lwc1 $f12, 0x20($sp) -/* 08A0A0 7F055570 3C018005 */ lui $at, %hi(D_80053478) -/* 08A0A4 7F055574 4600603C */ c.lt.s $f12, $f0 -/* 08A0A8 7F055578 46006381 */ sub.s $f14, $f12, $f0 -/* 08A0AC 7F05557C 45000003 */ bc1f .L7F05558C -/* 08A0B0 7F055580 46007086 */ mov.s $f2, $f14 -/* 08A0B4 7F055584 C4263478 */ lwc1 $f6, %lo(D_80053478)($at) -/* 08A0B8 7F055588 46067080 */ add.s $f2, $f14, $f6 -.L7F05558C: -/* 08A0BC 7F05558C 3C018005 */ lui $at, %hi(D_8005347C) -/* 08A0C0 7F055590 C428347C */ lwc1 $f8, %lo(D_8005347C)($at) -/* 08A0C4 7F055594 3C018005 */ lui $at, %hi(D_80053480) -/* 08A0C8 7F055598 4602403C */ c.lt.s $f8, $f2 -/* 08A0CC 7F05559C 00000000 */ nop -/* 08A0D0 7F0555A0 45020004 */ bc1fl .L7F0555B4 -/* 08A0D4 7F0555A4 C7A00064 */ lwc1 $f0, 0x64($sp) -/* 08A0D8 7F0555A8 C42A3480 */ lwc1 $f10, %lo(D_80053480)($at) -/* 08A0DC 7F0555AC 460A1081 */ sub.s $f2, $f2, $f10 -.L7F0555B0: -/* 08A0E0 7F0555B0 C7A00064 */ lwc1 $f0, 0x64($sp) -.L7F0555B4: -/* 08A0E4 7F0555B4 8FAE006C */ lw $t6, 0x6c($sp) -/* 08A0E8 7F0555B8 8FB8006C */ lw $t8, 0x6c($sp) -/* 08A0EC 7F0555BC 4602003C */ c.lt.s $f0, $f2 -/* 08A0F0 7F0555C0 00000000 */ nop -/* 08A0F4 7F0555C4 45020006 */ bc1fl .L7F0555E0 -/* 08A0F8 7F0555C8 E7020000 */ swc1 $f2, ($t8) -/* 08A0FC 7F0555CC E5C00000 */ swc1 $f0, ($t6) -/* 08A100 7F0555D0 8FAF0070 */ lw $t7, 0x70($sp) -/* 08A104 7F0555D4 10000004 */ b .L7F0555E8 -/* 08A108 7F0555D8 E5E20000 */ swc1 $f2, ($t7) -/* 08A10C 7F0555DC E7020000 */ swc1 $f2, ($t8) -.L7F0555E0: -/* 08A110 7F0555E0 8FB90070 */ lw $t9, 0x70($sp) -/* 08A114 7F0555E4 E7200000 */ swc1 $f0, ($t9) -.L7F0555E8: -/* 08A118 7F0555E8 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A11C 7F0555EC 27BD0068 */ addiu $sp, $sp, 0x68 -/* 08A120 7F0555F0 03E00008 */ jr $ra -/* 08A124 7F0555F4 00000000 */ nop -) -#endif + cosine = cosf(angle2); + sine = sinf(angle2); + + xbound = xmax - xmin; + x1 = ((pad->pos.x + (normal.x * xmin)) + (xbound * ((normal.x * cosine) + (normal.z * sine)))) - playerpos.x; + y1 = ((pad->pos.z + (normal.z * xmin)) + (xbound * (((-normal.x) * sine) + (normal.z * cosine)))) - playerpos.z; + + angle = atan2f(x1, y1); + playerangle = get_curplay_horizontal_rotation_in_degrees(); + anglediff2 = angle - playerangle; + if (angle < playerangle) + { + anglediff2 += M_TAU_F; + } + if (anglediff2 > M_PI_F) + { + anglediff2 -= M_TAU_F; + } + } + else + { + x1 = (pad->pos.x + (normal.x * xmax)) - playerpos.x; + y1 = (pad->pos.z + (normal.z * xmax)) - playerpos.z; + angle = atan2f(x1, y1); + playerangle = get_curplay_horizontal_rotation_in_degrees(); + anglediff2 = angle - playerangle; + if (normal.x); + if (xmax); -#ifdef NONMATCHING -void sub_GAME_7F0555F8(void) { + if (angle < playerangle) + { + anglediff2 += M_TAU_F; + } + + if (anglediff2 > M_PI_F) + { + anglediff2 -= M_TAU_F; + } + } + if (anglediff < anglediff2) + { + *arg1 = anglediff; + *arg2 = anglediff2; + } + else + { + *arg1 = anglediff2; + *arg2 = anglediff; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0555F8 -/* 08A128 7F0555F8 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* 08A12C 7F0555FC 3C0F8007 */ lui $t7, %hi(dword_CODE_bss_80071DF8) -/* 08A130 7F055600 8DEF1DF8 */ lw $t7, %lo(dword_CODE_bss_80071DF8)($t7) -/* 08A134 7F055604 AFB40030 */ sw $s4, 0x30($sp) -/* 08A138 7F055608 AFB3002C */ sw $s3, 0x2c($sp) -/* 08A13C 7F05560C 240E0001 */ li $t6, 1 -/* 08A140 7F055610 00809825 */ move $s3, $a0 -/* 08A144 7F055614 00A0A025 */ move $s4, $a1 -/* 08A148 7F055618 AFBF0034 */ sw $ra, 0x34($sp) -/* 08A14C 7F05561C AFB20028 */ sw $s2, 0x28($sp) -/* 08A150 7F055620 AFB10024 */ sw $s1, 0x24($sp) -/* 08A154 7F055624 AFB00020 */ sw $s0, 0x20($sp) -/* 08A158 7F055628 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 08A15C 7F05562C 15E0006B */ bnez $t7, .L7F0557DC -/* 08A160 7F055630 AFAE0054 */ sw $t6, 0x54($sp) -/* 08A164 7F055634 27A50050 */ addiu $a1, $sp, 0x50 -/* 08A168 7F055638 27A6004C */ addiu $a2, $sp, 0x4c -/* 08A16C 7F05563C 0FC1548B */ jal sub_GAME_7F05522C -/* 08A170 7F055640 02803825 */ move $a3, $s4 -/* 08A174 7F055644 3C018005 */ lui $at, %hi(D_80053484) -/* 08A178 7F055648 C4223484 */ lwc1 $f2, %lo(D_80053484)($at) -/* 08A17C 7F05564C C7A40050 */ lwc1 $f4, 0x50($sp) -/* 08A180 7F055650 46001007 */ neg.s $f0, $f2 -/* 08A184 7F055654 4604003E */ c.le.s $f0, $f4 -/* 08A188 7F055658 00000000 */ nop -/* 08A18C 7F05565C 45020012 */ bc1fl .L7F0556A8 -/* 08A190 7F055660 8E7000C8 */ lw $s0, 0xc8($s3) -/* 08A194 7F055664 4602203E */ c.le.s $f4, $f2 -/* 08A198 7F055668 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 08A19C 7F05566C 4502000E */ bc1fl .L7F0556A8 -/* 08A1A0 7F055670 8E7000C8 */ lw $s0, 0xc8($s3) -/* 08A1A4 7F055674 4606003E */ c.le.s $f0, $f6 -/* 08A1A8 7F055678 00000000 */ nop -/* 08A1AC 7F05567C 4502000A */ bc1fl .L7F0556A8 -/* 08A1B0 7F055680 8E7000C8 */ lw $s0, 0xc8($s3) -/* 08A1B4 7F055684 4602303E */ c.le.s $f6, $f2 -/* 08A1B8 7F055688 3C018007 */ lui $at, %hi(dword_CODE_bss_80071DF8) -/* 08A1BC 7F05568C 45020006 */ bc1fl .L7F0556A8 -/* 08A1C0 7F055690 8E7000C8 */ lw $s0, 0xc8($s3) -/* 08A1C4 7F055694 8E780010 */ lw $t8, 0x10($s3) -/* 08A1C8 7F055698 AFA00054 */ sw $zero, 0x54($sp) -/* 08A1CC 7F05569C 1000004F */ b .L7F0557DC -/* 08A1D0 7F0556A0 AC381DF8 */ sw $t8, %lo(dword_CODE_bss_80071DF8)($at) -/* 08A1D4 7F0556A4 8E7000C8 */ lw $s0, 0xc8($s3) -.L7F0556A8: -/* 08A1D8 7F0556A8 52000037 */ beql $s0, $zero, .L7F055788 -/* 08A1DC 7F0556AC C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 08A1E0 7F0556B0 12130034 */ beq $s0, $s3, .L7F055784 -/* 08A1E4 7F0556B4 C7A80050 */ lwc1 $f8, 0x50($sp) -/* 08A1E8 7F0556B8 4480A000 */ mtc1 $zero, $f20 -/* 08A1EC 7F0556BC C7AA004C */ lwc1 $f10, 0x4c($sp) -/* 08A1F0 7F0556C0 4608A03E */ c.le.s $f20, $f8 -/* 08A1F4 7F0556C4 00000000 */ nop -/* 08A1F8 7F0556C8 45030005 */ bc1tl .L7F0556E0 -/* 08A1FC 7F0556CC 27A50040 */ addiu $a1, $sp, 0x40 -/* 08A200 7F0556D0 4614503C */ c.lt.s $f10, $f20 -/* 08A204 7F0556D4 00000000 */ nop -/* 08A208 7F0556D8 4500002A */ bc1f .L7F055784 -/* 08A20C 7F0556DC 27A50040 */ addiu $a1, $sp, 0x40 -.L7F0556E0: -/* 08A210 7F0556E0 27A6003C */ addiu $a2, $sp, 0x3c -/* 08A214 7F0556E4 02002025 */ move $a0, $s0 -/* 08A218 7F0556E8 0FC1548B */ jal sub_GAME_7F05522C -/* 08A21C 7F0556EC 02803825 */ move $a3, $s4 -/* 08A220 7F0556F0 C7B00050 */ lwc1 $f16, 0x50($sp) -/* 08A224 7F0556F4 C7A00040 */ lwc1 $f0, 0x40($sp) -/* 08A228 7F0556F8 4610A03C */ c.lt.s $f20, $f16 -/* 08A22C 7F0556FC 00000000 */ nop -/* 08A230 7F055700 45020007 */ bc1fl .L7F055720 -/* 08A234 7F055704 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 08A238 7F055708 4610003C */ c.lt.s $f0, $f16 -/* 08A23C 7F05570C 00000000 */ nop -/* 08A240 7F055710 45020003 */ bc1fl .L7F055720 -/* 08A244 7F055714 C7B2004C */ lwc1 $f18, 0x4c($sp) -/* 08A248 7F055718 E7A00050 */ swc1 $f0, 0x50($sp) -/* 08A24C 7F05571C C7B2004C */ lwc1 $f18, 0x4c($sp) -.L7F055720: -/* 08A250 7F055720 C7A0003C */ lwc1 $f0, 0x3c($sp) -/* 08A254 7F055724 4614903C */ c.lt.s $f18, $f20 -/* 08A258 7F055728 00000000 */ nop -/* 08A25C 7F05572C 45020007 */ bc1fl .L7F05574C -/* 08A260 7F055730 8E1000C8 */ lw $s0, 0xc8($s0) -/* 08A264 7F055734 4600903C */ c.lt.s $f18, $f0 -/* 08A268 7F055738 00000000 */ nop -/* 08A26C 7F05573C 45020003 */ bc1fl .L7F05574C -/* 08A270 7F055740 8E1000C8 */ lw $s0, 0xc8($s0) -/* 08A274 7F055744 E7A0004C */ swc1 $f0, 0x4c($sp) -/* 08A278 7F055748 8E1000C8 */ lw $s0, 0xc8($s0) -.L7F05574C: -/* 08A27C 7F05574C C7A40050 */ lwc1 $f4, 0x50($sp) -/* 08A280 7F055750 5200000D */ beql $s0, $zero, .L7F055788 -/* 08A284 7F055754 C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 08A288 7F055758 5213000B */ beql $s0, $s3, .L7F055788 -/* 08A28C 7F05575C C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 08A290 7F055760 4604A03E */ c.le.s $f20, $f4 -/* 08A294 7F055764 00000000 */ nop -/* 08A298 7F055768 4503FFDD */ bc1tl .L7F0556E0 -/* 08A29C 7F05576C 27A50040 */ addiu $a1, $sp, 0x40 -/* 08A2A0 7F055770 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* 08A2A4 7F055774 4614303C */ c.lt.s $f6, $f20 -/* 08A2A8 7F055778 00000000 */ nop -/* 08A2AC 7F05577C 4503FFD8 */ bc1tl .L7F0556E0 -/* 08A2B0 7F055780 27A50040 */ addiu $a1, $sp, 0x40 -.L7F055784: -/* 08A2B4 7F055784 C7A8004C */ lwc1 $f8, 0x4c($sp) -.L7F055788: -/* 08A2B8 7F055788 C7AA0050 */ lwc1 $f10, 0x50($sp) -/* 08A2BC 7F05578C 3C018005 */ lui $at, %hi(D_80053488) -/* 08A2C0 7F055790 C4323488 */ lwc1 $f18, %lo(D_80053488)($at) -/* 08A2C4 7F055794 460A4401 */ sub.s $f16, $f8, $f10 -/* 08A2C8 7F055798 4480A000 */ mtc1 $zero, $f20 -/* 08A2CC 7F05579C 4612803C */ c.lt.s $f16, $f18 -/* 08A2D0 7F0557A0 00000000 */ nop -/* 08A2D4 7F0557A4 4502000E */ bc1fl .L7F0557E0 -/* 08A2D8 7F0557A8 8FBF0034 */ lw $ra, 0x34($sp) -/* 08A2DC 7F0557AC 4614503C */ c.lt.s $f10, $f20 -/* 08A2E0 7F0557B0 00000000 */ nop -/* 08A2E4 7F0557B4 4502000A */ bc1fl .L7F0557E0 -/* 08A2E8 7F0557B8 8FBF0034 */ lw $ra, 0x34($sp) -/* 08A2EC 7F0557BC 4608A03C */ c.lt.s $f20, $f8 -/* 08A2F0 7F0557C0 00000000 */ nop -/* 08A2F4 7F0557C4 45020006 */ bc1fl .L7F0557E0 -/* 08A2F8 7F0557C8 8FBF0034 */ lw $ra, 0x34($sp) -/* 08A2FC 7F0557CC 8E790010 */ lw $t9, 0x10($s3) -/* 08A300 7F0557D0 3C018007 */ lui $at, %hi(dword_CODE_bss_80071DF8) -/* 08A304 7F0557D4 AFA00054 */ sw $zero, 0x54($sp) -/* 08A308 7F0557D8 AC391DF8 */ sw $t9, %lo(dword_CODE_bss_80071DF8)($at) -.L7F0557DC: -/* 08A30C 7F0557DC 8FBF0034 */ lw $ra, 0x34($sp) -.L7F0557E0: -/* 08A310 7F0557E0 8FA20054 */ lw $v0, 0x54($sp) -/* 08A314 7F0557E4 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 08A318 7F0557E8 8FB00020 */ lw $s0, 0x20($sp) -/* 08A31C 7F0557EC 8FB10024 */ lw $s1, 0x24($sp) -/* 08A320 7F0557F0 8FB20028 */ lw $s2, 0x28($sp) -/* 08A324 7F0557F4 8FB3002C */ lw $s3, 0x2c($sp) -/* 08A328 7F0557F8 8FB40030 */ lw $s4, 0x30($sp) -/* 08A32C 7F0557FC 03E00008 */ jr $ra -/* 08A330 7F055800 27BD0058 */ addiu $sp, $sp, 0x58 -) -#endif +// PD: func0f08f968 +bool sub_GAME_7F0555F8(DoorRecord *door, bool altcoordsystem) +{ + bool checkmore; + f32 sp50; + f32 sp4c; + DoorRecord *sibling; + f32 limit; + f32 sp40; + f32 sp3c; + + checkmore = TRUE; + limit = 0.34906587f; + + if (g_InteractProp == NULL) + { + sub_GAME_7F05522C(door, &sp50, &sp4c, altcoordsystem); + + if ((sp50 >= -limit) && (sp50 <= limit) && (sp4c >= -limit) && (sp4c <= limit)) + { + g_InteractProp = door->prop; + checkmore = FALSE; + } + else + { + sibling = door->linkedDoor; + while (sibling != NULL && sibling != door && (sp50 >= 0.0f || sp4c < 0.0f)) + { + sub_GAME_7F05522C(sibling, &sp40, &sp3c, altcoordsystem); + if ((sp50 > 0.0f) && (sp40 < sp50)) + { + sp50 = sp40; + } -#ifdef NONMATCHING -void sub_GAME_7F055804(void) { + if ((sp4c < 0.0f) && (sp4c < sp3c)) + { + sp4c = sp3c; + } + + sibling = sibling->linkedDoor; + } + if ((sp4c - sp50) < M_PI_F && (sp50 < 0.0f) && (sp4c > 0.0f)) + { + g_InteractProp = door->prop; + checkmore = FALSE; + } + } + } + + return checkmore; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F055804 -/* 08A334 7F055804 27BDFF78 */ addiu $sp, $sp, -0x88 -/* 08A338 7F055808 240E0001 */ li $t6, 1 -/* 08A33C 7F05580C AFBF001C */ sw $ra, 0x1c($sp) -/* 08A340 7F055810 AFB00018 */ sw $s0, 0x18($sp) -/* 08A344 7F055814 AFAE0084 */ sw $t6, 0x84($sp) -/* 08A348 7F055818 8C900004 */ lw $s0, 4($a0) -/* 08A34C 7F05581C 8E0F0008 */ lw $t7, 8($s0) -/* 08A350 7F055820 000FC180 */ sll $t8, $t7, 6 -/* 08A354 7F055824 07020059 */ bltzl $t8, .L7F05598C -/* 08A358 7F055828 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A35C 7F05582C 44802000 */ mtc1 $zero, $f4 -/* 08A360 7F055830 C6060084 */ lwc1 $f6, 0x84($s0) -/* 08A364 7F055834 4606203C */ c.lt.s $f4, $f6 -/* 08A368 7F055838 00000000 */ nop -/* 08A36C 7F05583C 45020053 */ bc1fl .L7F05598C -/* 08A370 7F055840 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A374 7F055844 90990001 */ lbu $t9, 1($a0) -/* 08A378 7F055848 33280002 */ andi $t0, $t9, 2 -/* 08A37C 7F05584C 5100004F */ beql $t0, $zero, .L7F05598C -/* 08A380 7F055850 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A384 7F055854 AFA0007C */ sw $zero, 0x7c($sp) -/* 08A388 7F055858 0FC225E6 */ jal get_curplayer_positiondata -/* 08A38C 7F05585C AFA40088 */ sw $a0, 0x88($sp) -/* 08A390 7F055860 AFA20078 */ sw $v0, 0x78($sp) -/* 08A394 7F055864 C44A0008 */ lwc1 $f10, 8($v0) -/* 08A398 7F055868 C6080058 */ lwc1 $f8, 0x58($s0) -/* 08A39C 7F05586C C4460010 */ lwc1 $f6, 0x10($v0) -/* 08A3A0 7F055870 C6040060 */ lwc1 $f4, 0x60($s0) -/* 08A3A4 7F055874 460A4001 */ sub.s $f0, $f8, $f10 -/* 08A3A8 7F055878 C452000C */ lwc1 $f18, 0xc($v0) -/* 08A3AC 7F05587C C610005C */ lwc1 $f16, 0x5c($s0) -/* 08A3B0 7F055880 46062081 */ sub.s $f2, $f4, $f6 -/* 08A3B4 7F055884 46000202 */ mul.s $f8, $f0, $f0 -/* 08A3B8 7F055888 3C018005 */ lui $at, %hi(D_8005348C) -/* 08A3BC 7F05588C 46128301 */ sub.s $f12, $f16, $f18 -/* 08A3C0 7F055890 46021282 */ mul.s $f10, $f2, $f2 -/* 08A3C4 7F055894 C432348C */ lwc1 $f18, %lo(D_8005348C)($at) -/* 08A3C8 7F055898 8FA40088 */ lw $a0, 0x88($sp) -/* 08A3CC 7F05589C 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 08A3D0 7F0558A0 460A4400 */ add.s $f16, $f8, $f10 -/* 08A3D4 7F0558A4 4612803C */ c.lt.s $f16, $f18 -/* 08A3D8 7F0558A8 00000000 */ nop -/* 08A3DC 7F0558AC 4500000F */ bc1f .L7F0558EC -/* 08A3E0 7F0558B0 00000000 */ nop -/* 08A3E4 7F0558B4 44812000 */ mtc1 $at, $f4 -/* 08A3E8 7F0558B8 3C01C348 */ li $at, 0xC3480000 # -200.000000 -/* 08A3EC 7F0558BC 4604603C */ c.lt.s $f12, $f4 -/* 08A3F0 7F0558C0 00000000 */ nop -/* 08A3F4 7F0558C4 45000009 */ bc1f .L7F0558EC -/* 08A3F8 7F0558C8 00000000 */ nop -/* 08A3FC 7F0558CC 44813000 */ mtc1 $at, $f6 -/* 08A400 7F0558D0 24090001 */ li $t1, 1 -/* 08A404 7F0558D4 460C303C */ c.lt.s $f6, $f12 -/* 08A408 7F0558D8 00000000 */ nop -/* 08A40C 7F0558DC 45000003 */ bc1f .L7F0558EC -/* 08A410 7F0558E0 00000000 */ nop -/* 08A414 7F0558E4 10000018 */ b .L7F055948 -/* 08A418 7F0558E8 AFA9007C */ sw $t1, 0x7c($sp) -.L7F0558EC: -/* 08A41C 7F0558EC 0FC0F2E3 */ jal chraiGetPropRoomIds -/* 08A420 7F0558F0 27A50048 */ addiu $a1, $sp, 0x48 -/* 08A424 7F0558F4 8FA40078 */ lw $a0, 0x78($sp) -/* 08A428 7F0558F8 0FC0F2E3 */ jal chraiGetPropRoomIds -/* 08A42C 7F0558FC 27A50028 */ addiu $a1, $sp, 0x28 -/* 08A430 7F055900 27A40048 */ addiu $a0, $sp, 0x48 -/* 08A434 7F055904 0FC0F6DC */ jal sub_GAME_7F03DB70 -/* 08A438 7F055908 27A50028 */ addiu $a1, $sp, 0x28 -/* 08A43C 7F05590C 1040000E */ beqz $v0, .L7F055948 -/* 08A440 7F055910 3C0C8007 */ lui $t4, %hi(g_CurrentSetup+0x1C) -/* 08A444 7F055914 860A0006 */ lh $t2, 6($s0) -/* 08A448 7F055918 8D8C5D1C */ lw $t4, %lo(g_CurrentSetup+0x1C)($t4) -/* 08A44C 7F05591C 8FA40078 */ lw $a0, 0x78($sp) -/* 08A450 7F055920 000A5900 */ sll $t3, $t2, 4 -/* 08A454 7F055924 016A5821 */ addu $t3, $t3, $t2 -/* 08A458 7F055928 000B5880 */ sll $t3, $t3, 2 -/* 08A45C 7F05592C 3C054316 */ lui $a1, 0x4316 -/* 08A460 7F055930 016C3021 */ addu $a2, $t3, $t4 -/* 08A464 7F055934 0FC0FD66 */ jal sub_GAME_7F03F598 -/* 08A468 7F055938 24840008 */ addiu $a0, $a0, 8 -/* 08A46C 7F05593C 10400002 */ beqz $v0, .L7F055948 -/* 08A470 7F055940 240D0001 */ li $t5, 1 -/* 08A474 7F055944 AFAD007C */ sw $t5, 0x7c($sp) -.L7F055948: -/* 08A478 7F055948 8FAE007C */ lw $t6, 0x7c($sp) -/* 08A47C 7F05594C 02002025 */ move $a0, $s0 -/* 08A480 7F055950 51C0000E */ beql $t6, $zero, .L7F05598C -/* 08A484 7F055954 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A488 7F055958 0FC1557E */ jal sub_GAME_7F0555F8 -/* 08A48C 7F05595C 00002825 */ move $a1, $zero -/* 08A490 7F055960 10400009 */ beqz $v0, .L7F055988 -/* 08A494 7F055964 AFA20084 */ sw $v0, 0x84($sp) -/* 08A498 7F055968 8E0F000C */ lw $t7, 0xc($s0) -/* 08A49C 7F05596C 02002025 */ move $a0, $s0 -/* 08A4A0 7F055970 000FC000 */ sll $t8, $t7, 0 -/* 08A4A4 7F055974 07030005 */ bgezl $t8, .L7F05598C -/* 08A4A8 7F055978 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A4AC 7F05597C 0FC1557E */ jal sub_GAME_7F0555F8 -/* 08A4B0 7F055980 24050001 */ li $a1, 1 -/* 08A4B4 7F055984 AFA20084 */ sw $v0, 0x84($sp) -.L7F055988: -/* 08A4B8 7F055988 8FBF001C */ lw $ra, 0x1c($sp) -.L7F05598C: -/* 08A4BC 7F05598C 8FA20084 */ lw $v0, 0x84($sp) -/* 08A4C0 7F055990 8FB00018 */ lw $s0, 0x18($sp) -/* 08A4C4 7F055994 03E00008 */ jr $ra -/* 08A4C8 7F055998 27BD0088 */ addiu $sp, $sp, 0x88 -) -#endif +bool doorTestForInteract(PropRecord *prop) +{ + bool checkmore; + DoorRecord *door; + bool maybe; + PropRecord *playerprop; + f32 xdiff; + f32 ydiff; + f32 zdiff; + BoundPadRecord *boundpads; + u8 rooms1[32]; + u8 rooms2[32]; + s32 unused[2]; + + checkmore = TRUE; + door = prop->door; + + if ((door->flags & PROPFLAG_CANNOT_ACTIVATE) == 0 + && door->maxFrac > 0 + && (prop->flags & PROPFLAG_ONSCREEN)) + { + maybe = FALSE; + playerprop = get_curplayer_positiondata(); + + xdiff = door->runtime_pos.x - playerprop->pos.x; + ydiff = door->runtime_pos.y - playerprop->pos.y; + zdiff = door->runtime_pos.z - playerprop->pos.z; + + if (xdiff * xdiff + zdiff * zdiff < 40000.0f && ydiff < 200.0f && ydiff > -200.0f) + { + maybe = TRUE; + } + else + { + chraiGetPropRoomIds(prop, (s32*)rooms1); + chraiGetPropRoomIds(playerprop, (s32*)rooms2); + if (sub_GAME_7F03DB70((s32*)rooms1, (s32*)rooms2) != 0) + { + boundpads = &g_CurrentSetup.boundpads[door->pad]; + if (sub_GAME_7F03F598(&playerprop->pos, 150.0f, boundpads) != 0) + { + maybe = TRUE; + } + } + } + + if (maybe) + { + checkmore = sub_GAME_7F0555F8(door, FALSE); + if (checkmore && (door->flags2 & PROPFLAG2_DOOR_ALTCOORDSYSTEM)) + { + checkmore = sub_GAME_7F0555F8(door, TRUE); + } + } + } + + return checkmore; +} void doorActivateWrapper(PropRecord *prop) //#MATCH @@ -44865,13 +40173,50 @@ void doorActivateWrapper(PropRecord *prop) //#MATCH #ifdef NONMATCHING -void sub_GAME_7F055A70(void) { +// https://decomp.me/scratch/B63wV 79.17% +s32 posIsInFrontOfDoor(PropRecord* prop, DoorRecord* door) +{ + BoundPadRecord* pad; + f32 other; + struct coord3d normal; + f32 value = 0; + + pad = (BoundPadRecord*)&g_CurrentSetup.boundpads[door->pad]; + + normal.f[0] = (pad->up.f[1] * pad->look.f[2]) - (pad->up.f[2] * pad->look.f[1]); + normal.f[1] = (pad->up.f[2] * pad->look.f[0]) - (pad->up.f[0] * pad->look.f[2]); + normal.f[2] = (pad->up.f[0] * pad->look.f[1]) - (pad->up.f[1] * pad->look.f[0]); + value += (normal.f[0] * (prop->pos.f[0] - pad->pos.f[0])); + value += (normal.f[1] * (prop->pos.f[1] - pad->pos.f[1])); + value += (normal.f[2] * (prop->pos.f[2] - pad->pos.f[2])); + + other = value; + + if (door->doorFlags & 8) + { + other = -value; + } + + if (other < 0) + { + return 0; + } + + if (other > 0) + { + return 1; + } + + + return 1; } + #else +s32 posIsInFrontOfDoor(PropRecord* prop, DoorRecord* door); GLOBAL_ASM( .text -glabel sub_GAME_7F055A70 +glabel posIsInFrontOfDoor /* 08A5A0 7F055A70 84AE0006 */ lh $t6, 6($a1) /* 08A5A4 7F055A74 3C188007 */ lui $t8, %hi(g_CurrentSetup+0x1C) /* 08A5A8 7F055A78 8F185D1C */ lw $t8, %lo(g_CurrentSetup+0x1C)($t8) @@ -44945,436 +40290,113 @@ glabel sub_GAME_7F055A70 #endif +void doorsChooseSwingDirection(PropRecord *chrprop, DoorRecord *door) +{ + if ((door->flags & PROPFLAG_DOOR_TWOWAY) && door->openstate == PROPSTATE_NONE && door->openPosition == 0.0f) + { + bool infront = posIsInFrontOfDoor(chrprop, door); + u32 wantflag = 0; + if ((door->doorFlags & 8) == 0) + { + if (!infront) + { + wantflag = PROPFLAG_DOOR_OPENTOFRONT; + } + } + else + { + if (infront) + { + wantflag = PROPFLAG_DOOR_OPENTOFRONT; + } + } + // If flags are different + if ((s32)((door->flags ^ wantflag) << 2) < 0) + { + // Toggle direction on door and siblings + DoorRecord *sibling = door; -#ifdef NONMATCHING -void sub_GAME_7F055B78(void) { - + do + { + sibling->flags ^= PROPFLAG_DOOR_OPENTOFRONT; + sibling = sibling->linkedDoor; + } while (sibling && sibling != door); + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F055B78 -/* 08A6A8 7F055B78 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 08A6AC 7F055B7C AFBF0014 */ sw $ra, 0x14($sp) -/* 08A6B0 7F055B80 8CAE0008 */ lw $t6, 8($a1) -/* 08A6B4 7F055B84 000E7900 */ sll $t7, $t6, 4 -/* 08A6B8 7F055B88 05E3002A */ bgezl $t7, .L7F055C34 -/* 08A6BC 7F055B8C 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A6C0 7F055B90 80B800BC */ lb $t8, 0xbc($a1) -/* 08A6C4 7F055B94 57000027 */ bnezl $t8, .L7F055C34 -/* 08A6C8 7F055B98 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A6CC 7F055B9C 44802000 */ mtc1 $zero, $f4 -/* 08A6D0 7F055BA0 C4A600B4 */ lwc1 $f6, 0xb4($a1) -/* 08A6D4 7F055BA4 46062032 */ c.eq.s $f4, $f6 -/* 08A6D8 7F055BA8 00000000 */ nop -/* 08A6DC 7F055BAC 45020021 */ bc1fl .L7F055C34 -/* 08A6E0 7F055BB0 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A6E4 7F055BB4 0FC1569C */ jal sub_GAME_7F055A70 -/* 08A6E8 7F055BB8 AFA5001C */ sw $a1, 0x1c($sp) -/* 08A6EC 7F055BBC 8FA5001C */ lw $a1, 0x1c($sp) -/* 08A6F0 7F055BC0 00002025 */ move $a0, $zero -/* 08A6F4 7F055BC4 94B90098 */ lhu $t9, 0x98($a1) -/* 08A6F8 7F055BC8 33280008 */ andi $t0, $t9, 8 -/* 08A6FC 7F055BCC 15000006 */ bnez $t0, .L7F055BE8 -/* 08A700 7F055BD0 00000000 */ nop -/* 08A704 7F055BD4 14400002 */ bnez $v0, .L7F055BE0 -/* 08A708 7F055BD8 00000000 */ nop -/* 08A70C 7F055BDC 3C042000 */ lui $a0, 0x2000 -.L7F055BE0: -/* 08A710 7F055BE0 10000005 */ b .L7F055BF8 -/* 08A714 7F055BE4 8CA90008 */ lw $t1, 8($a1) -.L7F055BE8: -/* 08A718 7F055BE8 50400003 */ beql $v0, $zero, .L7F055BF8 -/* 08A71C 7F055BEC 8CA90008 */ lw $t1, 8($a1) -/* 08A720 7F055BF0 3C042000 */ lui $a0, 0x2000 -/* 08A724 7F055BF4 8CA90008 */ lw $t1, 8($a1) -.L7F055BF8: -/* 08A728 7F055BF8 3C032000 */ lui $v1, 0x2000 -/* 08A72C 7F055BFC 00A01025 */ move $v0, $a1 -/* 08A730 7F055C00 01245026 */ xor $t2, $t1, $a0 -/* 08A734 7F055C04 000A5880 */ sll $t3, $t2, 2 -/* 08A738 7F055C08 0563000A */ bgezl $t3, .L7F055C34 -/* 08A73C 7F055C0C 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A740 7F055C10 8C4C0008 */ lw $t4, 8($v0) -.L7F055C14: -/* 08A744 7F055C14 01836826 */ xor $t5, $t4, $v1 -/* 08A748 7F055C18 AC4D0008 */ sw $t5, 8($v0) -/* 08A74C 7F055C1C 8C4200C8 */ lw $v0, 0xc8($v0) -/* 08A750 7F055C20 50400004 */ beql $v0, $zero, .L7F055C34 -/* 08A754 7F055C24 8FBF0014 */ lw $ra, 0x14($sp) -/* 08A758 7F055C28 5445FFFA */ bnel $v0, $a1, .L7F055C14 -/* 08A75C 7F055C2C 8C4C0008 */ lw $t4, 8($v0) -/* 08A760 7F055C30 8FBF0014 */ lw $ra, 0x14($sp) -.L7F055C34: -/* 08A764 7F055C34 27BD0018 */ addiu $sp, $sp, 0x18 -/* 08A768 7F055C38 03E00008 */ jr $ra -/* 08A76C 7F055C3C 00000000 */ nop -) -#endif +s32 propdoorInteract(PropRecord* doorprop) +{ + s32 unused; + s32 sp28; + PropRecord* playerprop; + DoorRecord* door; + textoverride* txt; + door = doorprop->door; + sp28 = 0; + playerprop = get_curplayer_positiondata(); + if (door->keyflags == 0) + { + sp28 = 1; + } + else if (bondinvCheckHasKeyFlags(door->keyflags) != 0) + { + sp28 = 1; + } + else if (posIsInFrontOfDoor(playerprop, door) != 0) + { + if ((door->flags2 & PROPFLAG2_10000000) && !(door->flags2 & PROPFLAG2_08000000)) + { + sp28 = 1; + } + } + else if (!(door->flags2 & PROPFLAG2_10000000) && (door->flags2 & PROPFLAG2_08000000)) + { + sp28 = 1; + } -#ifdef NONMATCHING -void sub_GAME_7F055C40(void) { + if (doorIsPadlockFree(door) == 0) + { + sp28 = 0; + } -} -#else + if (sp28 != 0) + { + doorsChooseSwingDirection(playerprop, door); + doorActivateWrapper(doorprop); + } + else if ((door->openstate == DOORSTATE_STATIONARY) && (door->openPosition < 0.5f)) + { + if (!(door->flags2 & PROPFLAG2_00000004)) + { + txt = bondinvGetTextbyObj((ObjectRecord*)door); + if ((txt != NULL) && (txt->pickuptext != 0)) + { #ifdef VERSION_US -GLOBAL_ASM( -.text -glabel sub_GAME_7F055C40 -/* 08A770 7F055C40 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 08A774 7F055C44 AFBF001C */ sw $ra, 0x1c($sp) -/* 08A778 7F055C48 AFB00018 */ sw $s0, 0x18($sp) -/* 08A77C 7F055C4C AFA40030 */ sw $a0, 0x30($sp) -/* 08A780 7F055C50 8C900004 */ lw $s0, 4($a0) -/* 08A784 7F055C54 0FC225E6 */ jal get_curplayer_positiondata -/* 08A788 7F055C58 AFA00028 */ sw $zero, 0x28($sp) -/* 08A78C 7F055C5C AFA20024 */ sw $v0, 0x24($sp) -/* 08A790 7F055C60 8E04009C */ lw $a0, 0x9c($s0) -/* 08A794 7F055C64 8FA30028 */ lw $v1, 0x28($sp) -/* 08A798 7F055C68 14800003 */ bnez $a0, .L7F055C78 -/* 08A79C 7F055C6C 00000000 */ nop -/* 08A7A0 7F055C70 1000001C */ b .L7F055CE4 -/* 08A7A4 7F055C74 24030001 */ li $v1, 1 -.L7F055C78: -/* 08A7A8 7F055C78 0FC2339C */ jal bondinvCheckHasKeyFlags -/* 08A7AC 7F055C7C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7B0 7F055C80 10400003 */ beqz $v0, .L7F055C90 -/* 08A7B4 7F055C84 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7B8 7F055C88 10000016 */ b .L7F055CE4 -/* 08A7BC 7F055C8C 24030001 */ li $v1, 1 -.L7F055C90: -/* 08A7C0 7F055C90 8FA40024 */ lw $a0, 0x24($sp) -/* 08A7C4 7F055C94 02002825 */ move $a1, $s0 -/* 08A7C8 7F055C98 0FC1569C */ jal sub_GAME_7F055A70 -/* 08A7CC 7F055C9C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7D0 7F055CA0 10400009 */ beqz $v0, .L7F055CC8 -/* 08A7D4 7F055CA4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7D8 7F055CA8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7DC 7F055CAC 000278C0 */ sll $t7, $v0, 3 -/* 08A7E0 7F055CB0 05E1000C */ bgez $t7, .L7F055CE4 -/* 08A7E4 7F055CB4 0002C100 */ sll $t8, $v0, 4 -/* 08A7E8 7F055CB8 0702000B */ bltzl $t8, .L7F055CE8 -/* 08A7EC 7F055CBC 02002025 */ move $a0, $s0 -/* 08A7F0 7F055CC0 10000008 */ b .L7F055CE4 -/* 08A7F4 7F055CC4 24030001 */ li $v1, 1 -.L7F055CC8: -/* 08A7F8 7F055CC8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7FC 7F055CCC 0002C8C0 */ sll $t9, $v0, 3 -/* 08A800 7F055CD0 07200004 */ bltz $t9, .L7F055CE4 -/* 08A804 7F055CD4 00024100 */ sll $t0, $v0, 4 -/* 08A808 7F055CD8 05030003 */ bgezl $t0, .L7F055CE8 -/* 08A80C 7F055CDC 02002025 */ move $a0, $s0 -/* 08A810 7F055CE0 24030001 */ li $v1, 1 -.L7F055CE4: -/* 08A814 7F055CE4 02002025 */ move $a0, $s0 -.L7F055CE8: -/* 08A818 7F055CE8 0FC0F9C6 */ jal sub_GAME_7F03E718 -/* 08A81C 7F055CEC AFA30028 */ sw $v1, 0x28($sp) -/* 08A820 7F055CF0 14400002 */ bnez $v0, .L7F055CFC -/* 08A824 7F055CF4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A828 7F055CF8 00001825 */ move $v1, $zero -.L7F055CFC: -/* 08A82C 7F055CFC 10600007 */ beqz $v1, .L7F055D1C -/* 08A830 7F055D00 8FA40024 */ lw $a0, 0x24($sp) -/* 08A834 7F055D04 0FC156DE */ jal sub_GAME_7F055B78 -/* 08A838 7F055D08 02002825 */ move $a1, $s0 -/* 08A83C 7F055D0C 0FC15667 */ jal doorActivateWrapper -/* 08A840 7F055D10 8FA40030 */ lw $a0, 0x30($sp) -/* 08A844 7F055D14 10000028 */ b .L7F055DB8 -/* 08A848 7F055D18 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055D1C: -/* 08A84C 7F055D1C 820900BC */ lb $t1, 0xbc($s0) -/* 08A850 7F055D20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 08A854 7F055D24 55200024 */ bnezl $t1, .L7F055DB8 -/* 08A858 7F055D28 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A85C 7F055D2C C60400B4 */ lwc1 $f4, 0xb4($s0) -/* 08A860 7F055D30 44813000 */ mtc1 $at, $f6 -/* 08A864 7F055D34 00000000 */ nop -/* 08A868 7F055D38 4606203C */ c.lt.s $f4, $f6 -/* 08A86C 7F055D3C 00000000 */ nop -/* 08A870 7F055D40 4502001D */ bc1fl .L7F055DB8 -/* 08A874 7F055D44 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A878 7F055D48 8E02000C */ lw $v0, 0xc($s0) -/* 08A87C 7F055D4C 304A0004 */ andi $t2, $v0, 4 -/* 08A880 7F055D50 55400014 */ bnezl $t2, .L7F055DA4 -/* 08A884 7F055D54 8E0C0064 */ lw $t4, 0x64($s0) -/* 08A888 7F055D58 0FC23487 */ jal bondinvGetTextbyObj -/* 08A88C 7F055D5C 02002025 */ move $a0, $s0 -/* 08A890 7F055D60 1040000A */ beqz $v0, .L7F055D8C -/* 08A894 7F055D64 00000000 */ nop -/* 08A898 7F055D68 8C4B001C */ lw $t3, 0x1c($v0) -/* 08A89C 7F055D6C 11600007 */ beqz $t3, .L7F055D8C -/* 08A8A0 7F055D70 00000000 */ nop -/* 08A8A4 7F055D74 0FC30776 */ jal langGet -/* 08A8A8 7F055D78 8C44001C */ lw $a0, 0x1c($v0) -/* 08A8AC 7F055D7C 0FC228F2 */ jal hudmsgBottomShow -/* 08A8B0 7F055D80 00402025 */ move $a0, $v0 -/* 08A8B4 7F055D84 10000006 */ b .L7F055DA0 -/* 08A8B8 7F055D88 8E02000C */ lw $v0, 0xc($s0) -.L7F055D8C: -/* 08A8BC 7F055D8C 0FC30776 */ jal langGet -/* 08A8C0 7F055D90 3404A440 */ li $a0, 42048 -/* 08A8C4 7F055D94 0FC228F2 */ jal hudmsgBottomShow -/* 08A8C8 7F055D98 00402025 */ move $a0, $v0 -/* 08A8CC 7F055D9C 8E02000C */ lw $v0, 0xc($s0) -.L7F055DA0: -/* 08A8D0 7F055DA0 8E0C0064 */ lw $t4, 0x64($s0) -.L7F055DA4: -/* 08A8D4 7F055DA4 344E0008 */ ori $t6, $v0, 8 -/* 08A8D8 7F055DA8 AE0E000C */ sw $t6, 0xc($s0) -/* 08A8DC 7F055DAC 358D4000 */ ori $t5, $t4, 0x4000 -/* 08A8E0 7F055DB0 AE0D0064 */ sw $t5, 0x64($s0) -/* 08A8E4 7F055DB4 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055DB8: -/* 08A8E8 7F055DB8 8FB00018 */ lw $s0, 0x18($sp) -/* 08A8EC 7F055DBC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 08A8F0 7F055DC0 03E00008 */ jr $ra -/* 08A8F4 7F055DC4 00001025 */ move $v0, $zero -) -#endif -#ifdef VERSION_JP -GLOBAL_ASM( -.text -glabel sub_GAME_7F055C40 -/* 08A770 7F055C40 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 08A774 7F055C44 AFBF001C */ sw $ra, 0x1c($sp) -/* 08A778 7F055C48 AFB00018 */ sw $s0, 0x18($sp) -/* 08A77C 7F055C4C AFA40030 */ sw $a0, 0x30($sp) -/* 08A780 7F055C50 8C900004 */ lw $s0, 4($a0) -/* 08A784 7F055C54 0FC225E6 */ jal get_curplayer_positiondata -/* 08A788 7F055C58 AFA00028 */ sw $zero, 0x28($sp) -/* 08A78C 7F055C5C AFA20024 */ sw $v0, 0x24($sp) -/* 08A790 7F055C60 8E04009C */ lw $a0, 0x9c($s0) -/* 08A794 7F055C64 8FA30028 */ lw $v1, 0x28($sp) -/* 08A798 7F055C68 14800003 */ bnez $a0, .L7F055C78 -/* 08A79C 7F055C6C 00000000 */ nop -/* 08A7A0 7F055C70 1000001C */ b .L7F055CE4 -/* 08A7A4 7F055C74 24030001 */ li $v1, 1 -.L7F055C78: -/* 08A7A8 7F055C78 0FC2339C */ jal bondinvCheckHasKeyFlags -/* 08A7AC 7F055C7C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7B0 7F055C80 10400003 */ beqz $v0, .L7F055C90 -/* 08A7B4 7F055C84 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7B8 7F055C88 10000016 */ b .L7F055CE4 -/* 08A7BC 7F055C8C 24030001 */ li $v1, 1 -.L7F055C90: -/* 08A7C0 7F055C90 8FA40024 */ lw $a0, 0x24($sp) -/* 08A7C4 7F055C94 02002825 */ move $a1, $s0 -/* 08A7C8 7F055C98 0FC1569C */ jal sub_GAME_7F055A70 -/* 08A7CC 7F055C9C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7D0 7F055CA0 10400009 */ beqz $v0, .L7F055CC8 -/* 08A7D4 7F055CA4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7D8 7F055CA8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7DC 7F055CAC 000278C0 */ sll $t7, $v0, 3 -/* 08A7E0 7F055CB0 05E1000C */ bgez $t7, .L7F055CE4 -/* 08A7E4 7F055CB4 0002C100 */ sll $t8, $v0, 4 -/* 08A7E8 7F055CB8 0702000B */ bltzl $t8, .L7F055CE8 -/* 08A7EC 7F055CBC 02002025 */ move $a0, $s0 -/* 08A7F0 7F055CC0 10000008 */ b .L7F055CE4 -/* 08A7F4 7F055CC4 24030001 */ li $v1, 1 -.L7F055CC8: -/* 08A7F8 7F055CC8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7FC 7F055CCC 0002C8C0 */ sll $t9, $v0, 3 -/* 08A800 7F055CD0 07200004 */ bltz $t9, .L7F055CE4 -/* 08A804 7F055CD4 00024100 */ sll $t0, $v0, 4 -/* 08A808 7F055CD8 05030003 */ bgezl $t0, .L7F055CE8 -/* 08A80C 7F055CDC 02002025 */ move $a0, $s0 -/* 08A810 7F055CE0 24030001 */ li $v1, 1 -.L7F055CE4: -/* 08A814 7F055CE4 02002025 */ move $a0, $s0 -.L7F055CE8: -/* 08A818 7F055CE8 0FC0F9C6 */ jal sub_GAME_7F03E718 -/* 08A81C 7F055CEC AFA30028 */ sw $v1, 0x28($sp) -/* 08A820 7F055CF0 14400002 */ bnez $v0, .L7F055CFC -/* 08A824 7F055CF4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A828 7F055CF8 00001825 */ move $v1, $zero -.L7F055CFC: -/* 08A82C 7F055CFC 10600007 */ beqz $v1, .L7F055D1C -/* 08A830 7F055D00 8FA40024 */ lw $a0, 0x24($sp) -/* 08A834 7F055D04 0FC156DE */ jal sub_GAME_7F055B78 -/* 08A838 7F055D08 02002825 */ move $a1, $s0 -/* 08A83C 7F055D0C 0FC15667 */ jal doorActivateWrapper -/* 08A840 7F055D10 8FA40030 */ lw $a0, 0x30($sp) -/* 08A844 7F055D14 10000028 */ b .L7F055DB8 -/* 08A848 7F055D18 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055D1C: -/* 08A84C 7F055D1C 820900BC */ lb $t1, 0xbc($s0) -/* 08A850 7F055D20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 08A854 7F055D24 55200024 */ bnezl $t1, .L7F055DB8 -/* 08A858 7F055D28 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A85C 7F055D2C C60400B4 */ lwc1 $f4, 0xb4($s0) -/* 08A860 7F055D30 44813000 */ mtc1 $at, $f6 -/* 08A864 7F055D34 00000000 */ nop -/* 08A868 7F055D38 4606203C */ c.lt.s $f4, $f6 -/* 08A86C 7F055D3C 00000000 */ nop -/* 08A870 7F055D40 4502001D */ bc1fl .L7F055DB8 -/* 08A874 7F055D44 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A878 7F055D48 8E02000C */ lw $v0, 0xc($s0) -/* 08A87C 7F055D4C 304A0004 */ andi $t2, $v0, 4 -/* 08A880 7F055D50 55400014 */ bnezl $t2, .L7F055DA4 -/* 08A884 7F055D54 8E0C0064 */ lw $t4, 0x64($s0) -/* 08A888 7F055D58 0FC23487 */ jal bondinvGetTextbyObj -/* 08A88C 7F055D5C 02002025 */ move $a0, $s0 -/* 08A890 7F055D60 1040000A */ beqz $v0, .L7F055D8C -/* 08A894 7F055D64 00000000 */ nop -/* 08A898 7F055D68 8C4B001C */ lw $t3, 0x1c($v0) -/* 08A89C 7F055D6C 11600007 */ beqz $t3, .L7F055D8C -/* 08A8A0 7F055D70 00000000 */ nop -/* 08A8A4 7F055D74 0FC30776 */ jal langGet -/* 08A8A8 7F055D78 8C44001C */ lw $a0, 0x1c($v0) -/* 08A8AC 7F055D7C 0FC228F2 */ jal jp_hudmsgBottomShow -/* 08A8B0 7F055D80 00402025 */ move $a0, $v0 -/* 08A8B4 7F055D84 10000006 */ b .L7F055DA0 -/* 08A8B8 7F055D88 8E02000C */ lw $v0, 0xc($s0) -.L7F055D8C: -/* 08A8BC 7F055D8C 0FC30776 */ jal langGet -/* 08A8C0 7F055D90 3404A440 */ li $a0, 42048 -/* 08A8C4 7F055D94 0FC228F2 */ jal jp_hudmsgBottomShow -/* 08A8C8 7F055D98 00402025 */ move $a0, $v0 -/* 08A8CC 7F055D9C 8E02000C */ lw $v0, 0xc($s0) -.L7F055DA0: -/* 08A8D0 7F055DA0 8E0C0064 */ lw $t4, 0x64($s0) -.L7F055DA4: -/* 08A8D4 7F055DA4 344E0008 */ ori $t6, $v0, 8 -/* 08A8D8 7F055DA8 AE0E000C */ sw $t6, 0xc($s0) -/* 08A8DC 7F055DAC 358D4000 */ ori $t5, $t4, 0x4000 -/* 08A8E0 7F055DB0 AE0D0064 */ sw $t5, 0x64($s0) -/* 08A8E4 7F055DB4 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055DB8: -/* 08A8E8 7F055DB8 8FB00018 */ lw $s0, 0x18($sp) -/* 08A8EC 7F055DBC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 08A8F0 7F055DC0 03E00008 */ jr $ra -/* 08A8F4 7F055DC4 00001025 */ move $v0, $zero -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.text -glabel sub_GAME_7F055C40 -/* 08A770 7F055C40 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 08A774 7F055C44 AFBF001C */ sw $ra, 0x1c($sp) -/* 08A778 7F055C48 AFB00018 */ sw $s0, 0x18($sp) -/* 08A77C 7F055C4C AFA40030 */ sw $a0, 0x30($sp) -/* 08A780 7F055C50 8C900004 */ lw $s0, 4($a0) -/* 08A784 7F055C54 0FC225E6 */ jal get_curplayer_positiondata -/* 08A788 7F055C58 AFA00028 */ sw $zero, 0x28($sp) -/* 08A78C 7F055C5C AFA20024 */ sw $v0, 0x24($sp) -/* 08A790 7F055C60 8E04009C */ lw $a0, 0x9c($s0) -/* 08A794 7F055C64 8FA30028 */ lw $v1, 0x28($sp) -/* 08A798 7F055C68 14800003 */ bnez $a0, .L7F055C78 -/* 08A79C 7F055C6C 00000000 */ nop -/* 08A7A0 7F055C70 1000001C */ b .L7F055CE4 -/* 08A7A4 7F055C74 24030001 */ li $v1, 1 -.L7F055C78: -/* 08A7A8 7F055C78 0FC2339C */ jal bondinvCheckHasKeyFlags -/* 08A7AC 7F055C7C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7B0 7F055C80 10400003 */ beqz $v0, .L7F055C90 -/* 08A7B4 7F055C84 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7B8 7F055C88 10000016 */ b .L7F055CE4 -/* 08A7BC 7F055C8C 24030001 */ li $v1, 1 -.L7F055C90: -/* 08A7C0 7F055C90 8FA40024 */ lw $a0, 0x24($sp) -/* 08A7C4 7F055C94 02002825 */ move $a1, $s0 -/* 08A7C8 7F055C98 0FC1569C */ jal sub_GAME_7F055A70 -/* 08A7CC 7F055C9C AFA30028 */ sw $v1, 0x28($sp) -/* 08A7D0 7F055CA0 10400009 */ beqz $v0, .L7F055CC8 -/* 08A7D4 7F055CA4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A7D8 7F055CA8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7DC 7F055CAC 000278C0 */ sll $t7, $v0, 3 -/* 08A7E0 7F055CB0 05E1000C */ bgez $t7, .L7F055CE4 -/* 08A7E4 7F055CB4 0002C100 */ sll $t8, $v0, 4 -/* 08A7E8 7F055CB8 0702000B */ bltzl $t8, .L7F055CE8 -/* 08A7EC 7F055CBC 02002025 */ move $a0, $s0 -/* 08A7F0 7F055CC0 10000008 */ b .L7F055CE4 -/* 08A7F4 7F055CC4 24030001 */ li $v1, 1 -.L7F055CC8: -/* 08A7F8 7F055CC8 8E02000C */ lw $v0, 0xc($s0) -/* 08A7FC 7F055CCC 0002C8C0 */ sll $t9, $v0, 3 -/* 08A800 7F055CD0 07200004 */ bltz $t9, .L7F055CE4 -/* 08A804 7F055CD4 00024100 */ sll $t0, $v0, 4 -/* 08A808 7F055CD8 05030003 */ bgezl $t0, .L7F055CE8 -/* 08A80C 7F055CDC 02002025 */ move $a0, $s0 -/* 08A810 7F055CE0 24030001 */ li $v1, 1 -.L7F055CE4: -/* 08A814 7F055CE4 02002025 */ move $a0, $s0 -.L7F055CE8: -/* 08A818 7F055CE8 0FC0F9C6 */ jal sub_GAME_7F03E718 -/* 08A81C 7F055CEC AFA30028 */ sw $v1, 0x28($sp) -/* 08A820 7F055CF0 14400002 */ bnez $v0, .L7F055CFC -/* 08A824 7F055CF4 8FA30028 */ lw $v1, 0x28($sp) -/* 08A828 7F055CF8 00001825 */ move $v1, $zero -.L7F055CFC: -/* 08A82C 7F055CFC 10600007 */ beqz $v1, .L7F055D1C -/* 08A830 7F055D00 8FA40024 */ lw $a0, 0x24($sp) -/* 08A834 7F055D04 0FC156DE */ jal sub_GAME_7F055B78 -/* 08A838 7F055D08 02002825 */ move $a1, $s0 -/* 08A83C 7F055D0C 0FC15667 */ jal doorActivateWrapper -/* 08A840 7F055D10 8FA40030 */ lw $a0, 0x30($sp) -/* 08A844 7F055D14 10000028 */ b .L7F055DB8 -/* 08A848 7F055D18 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055D1C: -/* 08A84C 7F055D1C 820900BC */ lb $t1, 0xbc($s0) -/* 08A850 7F055D20 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 08A854 7F055D24 55200024 */ bnezl $t1, .L7F055DB8 -/* 08A858 7F055D28 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A85C 7F055D2C C60400B4 */ lwc1 $f4, 0xb4($s0) -/* 08A860 7F055D30 44813000 */ mtc1 $at, $f6 -/* 08A864 7F055D34 00000000 */ nop -/* 08A868 7F055D38 4606203C */ c.lt.s $f4, $f6 -/* 08A86C 7F055D3C 00000000 */ nop -/* 08A870 7F055D40 4502001D */ bc1fl .L7F055DB8 -/* 08A874 7F055D44 8FBF001C */ lw $ra, 0x1c($sp) -/* 08A878 7F055D48 8E02000C */ lw $v0, 0xc($s0) -/* 08A87C 7F055D4C 304A0004 */ andi $t2, $v0, 4 -/* 08A880 7F055D50 55400014 */ bnezl $t2, .L7F055DA4 -/* 08A884 7F055D54 8E0C0064 */ lw $t4, 0x64($s0) -/* 08A888 7F055D58 0FC23487 */ jal bondinvGetTextbyObj -/* 08A88C 7F055D5C 02002025 */ move $a0, $s0 -/* 08A890 7F055D60 1040000A */ beqz $v0, .L7F055D8C -/* 08A894 7F055D64 00000000 */ nop -/* 08A898 7F055D68 8C4B001C */ lw $t3, 0x1c($v0) -/* 08A89C 7F055D6C 11600007 */ beqz $t3, .L7F055D8C -/* 08A8A0 7F055D70 00000000 */ nop -/* 08A8A4 7F055D74 0FC30776 */ jal langGet -/* 08A8A8 7F055D78 8C44001C */ lw $a0, 0x1c($v0) -/* 08A8AC 7F055D7C 0FC228F2 */ jal jp_hudmsgBottomShow -/* 08A8B0 7F055D80 00402025 */ move $a0, $v0 -/* 08A8B4 7F055D84 10000006 */ b .L7F055DA0 -/* 08A8B8 7F055D88 8E02000C */ lw $v0, 0xc($s0) -.L7F055D8C: -/* 08A8BC 7F055D8C 0FC30776 */ jal langGet -/* 08A8C0 7F055D90 3404A440 */ li $a0, 42048 -/* 08A8C4 7F055D94 0FC228F2 */ jal jp_hudmsgBottomShow -/* 08A8C8 7F055D98 00402025 */ move $a0, $v0 -/* 08A8CC 7F055D9C 8E02000C */ lw $v0, 0xc($s0) -.L7F055DA0: -/* 08A8D0 7F055DA0 8E0C0064 */ lw $t4, 0x64($s0) -.L7F055DA4: -/* 08A8D4 7F055DA4 344E0008 */ ori $t6, $v0, 8 -/* 08A8D8 7F055DA8 AE0E000C */ sw $t6, 0xc($s0) -/* 08A8DC 7F055DAC 358D4000 */ ori $t5, $t4, 0x4000 -/* 08A8E0 7F055DB0 AE0D0064 */ sw $t5, 0x64($s0) -/* 08A8E4 7F055DB4 8FBF001C */ lw $ra, 0x1c($sp) -.L7F055DB8: -/* 08A8E8 7F055DB8 8FB00018 */ lw $s0, 0x18($sp) -/* 08A8EC 7F055DBC 27BD0030 */ addiu $sp, $sp, 0x30 -/* 08A8F0 7F055DC0 03E00008 */ jr $ra -/* 08A8F4 7F055DC4 00001025 */ move $v0, $zero -) + hudmsgBottomShow(langGet((s32) txt->pickuptext)); +#else + jp_hudmsgBottomShow(langGet((s32) txt->pickuptext)); #endif - - + } + else + { +#ifdef VERSION_US + hudmsgBottomShow(langGet(0xA440)); +#else + jp_hudmsgBottomShow(langGet(0xA440)); #endif - - - + } + } + door->runtime_bitflags |= RUNTIMEBITFLAG_ACTIVATED; + door->flags2 |= PROPFLAG2_00000008; + } + return 0; +} void alarmActivate(void) @@ -45491,7 +40513,7 @@ void handle_gas_damage(void) } if (ptr_gas_sound != NULL) { - sub_GAME_7F053A10(ptr_gas_sound, &D_80030AD0); + chrobjSndCreatePostEventDefault(ptr_gas_sound, &D_80030AD0); } } else @@ -45547,568 +40569,68 @@ void if_enabled_reset_clock(void) } } +const char D_80052A44[] = ":\n"; -#ifdef NONMATCHING - -/* DISPLAY WARNING: Type casts are NOT being printed */ - -Gfx * sub_GAME_7F056210(Gfx *DL) -{ - Gfx *DL; - short viGetViewTop(); - short viGetViewHeight(); - int iVar3; - int iVar4; - //float timedivtemp; - int hours; - float time; - - if (clock_drawn_flag == 0) { - time = clock_time; - if (clock_time < 0.0) { - time = -clock_time; - } - //timedivtemp = floorFloat(time / 3600.0); - hours = floorFloat(time / 3600.0); - //timedivtemp = floorFloat(time / 60.0); - iVar4 = floorFloat(time / 60.0) + hours * -0x3c; - time = floorFloat((time * 100.0) / 60.0); - iVar3 = time + hours * -6000 + iVar4 * -100; - DL = microcode_constructor(DL); - DL = display_ammo_total_in_a1(DL, (hours % 100) / 10, 0x82, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = display_ammo_total_in_a1(DL, hours % 10, 0x8a, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = some_kind_of_display_routine(DL, ":\n", 0x93, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = display_ammo_total_in_a1(DL, (iVar4 % 0x3c) / 10, 0x9c, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = display_ammo_total_in_a1(DL, iVar4 % 10, 0xa4, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = some_kind_of_display_routine(DL, ":\n", 0xad, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = display_ammo_total_in_a1(DL, (iVar3 % 100) / 10, 0xb6, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = display_ammo_total_in_a1(DL, iVar3 % 10, 0xbe, 2, (viGetViewHeight() + viGetViewTop()) - 0x12, 2, 1); - DL = combiner_bayer_lod_perspective(DL); - } - return DL; -} - - -#else - -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.text -glabel sub_GAME_7F056210 -/* 08AD40 7F056210 3C0E8003 */ lui $t6, %hi(clock_drawn_flag) -/* 08AD44 7F056214 8DCE0AE8 */ lw $t6, %lo(clock_drawn_flag)($t6) -/* 08AD48 7F056218 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 08AD4C 7F05621C AFB10028 */ sw $s1, 0x28($sp) -/* 08AD50 7F056220 00808825 */ move $s1, $a0 -/* 08AD54 7F056224 AFBF002C */ sw $ra, 0x2c($sp) -/* 08AD58 7F056228 15C000EB */ bnez $t6, .L7F0565D8 -/* 08AD5C 7F05622C AFB00024 */ sw $s0, 0x24($sp) -/* 08AD60 7F056230 3C018003 */ lui $at, %hi(clock_time) -/* 08AD64 7F056234 C4220AF0 */ lwc1 $f2, %lo(clock_time)($at) -/* 08AD68 7F056238 44802000 */ mtc1 $zero, $f4 -/* 08AD6C 7F05623C 3C014561 */ li $at, 0x45610000 # 3600.000000 -/* 08AD70 7F056240 44813000 */ mtc1 $at, $f6 -/* 08AD74 7F056244 4604103C */ c.lt.s $f2, $f4 -/* 08AD78 7F056248 00000000 */ nop -/* 08AD7C 7F05624C 45020003 */ bc1fl .L7F05625C -/* 08AD80 7F056250 46061303 */ div.s $f12, $f2, $f6 -/* 08AD84 7F056254 46001087 */ neg.s $f2, $f2 -/* 08AD88 7F056258 46061303 */ div.s $f12, $f2, $f6 -.L7F05625C: -/* 08AD8C 7F05625C 0FC170D8 */ jal floorFloat -/* 08AD90 7F056260 E7A20030 */ swc1 $f2, 0x30($sp) -/* 08AD94 7F056264 4600020D */ trunc.w.s $f8, $f0 -/* 08AD98 7F056268 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 08AD9C 7F05626C C7A20030 */ lwc1 $f2, 0x30($sp) -/* 08ADA0 7F056270 44815000 */ mtc1 $at, $f10 -/* 08ADA4 7F056274 44184000 */ mfc1 $t8, $f8 -/* 08ADA8 7F056278 460A1303 */ div.s $f12, $f2, $f10 -/* 08ADAC 7F05627C 0FC170D8 */ jal floorFloat -/* 08ADB0 7F056280 AFB80044 */ sw $t8, 0x44($sp) -/* 08ADB4 7F056284 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 08ADB8 7F056288 C7A20030 */ lwc1 $f2, 0x30($sp) -/* 08ADBC 7F05628C 44819000 */ mtc1 $at, $f18 -/* 08ADC0 7F056290 4600040D */ trunc.w.s $f16, $f0 -/* 08ADC4 7F056294 8FA90044 */ lw $t1, 0x44($sp) -/* 08ADC8 7F056298 46121102 */ mul.s $f4, $f2, $f18 -/* 08ADCC 7F05629C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 08ADD0 7F0562A0 44088000 */ mfc1 $t0, $f16 -/* 08ADD4 7F0562A4 00095100 */ sll $t2, $t1, 4 -/* 08ADD8 7F0562A8 01495023 */ subu $t2, $t2, $t1 -/* 08ADDC 7F0562AC 44813000 */ mtc1 $at, $f6 -/* 08ADE0 7F0562B0 000A5080 */ sll $t2, $t2, 2 -/* 08ADE4 7F0562B4 010A5823 */ subu $t3, $t0, $t2 -/* 08ADE8 7F0562B8 AFAB0040 */ sw $t3, 0x40($sp) -/* 08ADEC 7F0562BC 0FC170D8 */ jal floorFloat -/* 08ADF0 7F0562C0 46062303 */ div.s $f12, $f4, $f6 -/* 08ADF4 7F0562C4 8FAE0044 */ lw $t6, 0x44($sp) -/* 08ADF8 7F0562C8 4600020D */ trunc.w.s $f8, $f0 -/* 08ADFC 7F0562CC 8FB90040 */ lw $t9, 0x40($sp) -/* 08AE00 7F0562D0 000E7880 */ sll $t7, $t6, 2 -/* 08AE04 7F0562D4 01EE7823 */ subu $t7, $t7, $t6 -/* 08AE08 7F0562D8 000F7900 */ sll $t7, $t7, 4 -/* 08AE0C 7F0562DC 01EE7823 */ subu $t7, $t7, $t6 -/* 08AE10 7F0562E0 00194880 */ sll $t1, $t9, 2 -/* 08AE14 7F0562E4 440D4000 */ mfc1 $t5, $f8 -/* 08AE18 7F0562E8 000F78C0 */ sll $t7, $t7, 3 -/* 08AE1C 7F0562EC 01394823 */ subu $t1, $t1, $t9 -/* 08AE20 7F0562F0 000948C0 */ sll $t1, $t1, 3 -/* 08AE24 7F0562F4 01EE7823 */ subu $t7, $t7, $t6 -/* 08AE28 7F0562F8 000F7900 */ sll $t7, $t7, 4 -/* 08AE2C 7F0562FC 01394821 */ addu $t1, $t1, $t9 -/* 08AE30 7F056300 00094880 */ sll $t1, $t1, 2 -/* 08AE34 7F056304 01AFC023 */ subu $t8, $t5, $t7 -/* 08AE38 7F056308 03094023 */ subu $t0, $t8, $t1 -/* 08AE3C 7F05630C AFA8003C */ sw $t0, 0x3c($sp) -/* 08AE40 7F056310 0FC2B366 */ jal microcode_constructor -/* 08AE44 7F056314 02202025 */ move $a0, $s1 -/* 08AE48 7F056318 0C001149 */ jal viGetViewTop -/* 08AE4C 7F05631C 00408825 */ move $s1, $v0 -/* 08AE50 7F056320 00028400 */ sll $s0, $v0, 0x10 -/* 08AE54 7F056324 00105403 */ sra $t2, $s0, 0x10 -/* 08AE58 7F056328 0C00112B */ jal viGetViewHeight -/* 08AE5C 7F05632C 01408025 */ move $s0, $t2 -/* 08AE60 7F056330 8FA50044 */ lw $a1, 0x44($sp) -/* 08AE64 7F056334 24010064 */ li $at, 100 -/* 08AE68 7F056338 00507021 */ addu $t6, $v0, $s0 -/* 08AE6C 7F05633C 00A1001A */ div $zero, $a1, $at -/* 08AE70 7F056340 00005810 */ mfhi $t3 -/* 08AE74 7F056344 2401000A */ li $at, 10 -/* 08AE78 7F056348 25CDFFEE */ addiu $t5, $t6, -0x12 -/* 08AE7C 7F05634C 0161001A */ div $zero, $t3, $at -/* 08AE80 7F056350 00002812 */ mflo $a1 -/* 08AE84 7F056354 240F0002 */ li $t7, 2 -/* 08AE88 7F056358 24190001 */ li $t9, 1 -/* 08AE8C 7F05635C AFB90018 */ sw $t9, 0x18($sp) -/* 08AE90 7F056360 AFAF0014 */ sw $t7, 0x14($sp) -/* 08AE94 7F056364 AFAD0010 */ sw $t5, 0x10($sp) -/* 08AE98 7F056368 02202025 */ move $a0, $s1 -/* 08AE9C 7F05636C 24060082 */ li $a2, 130 -/* 08AEA0 7F056370 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08AEA4 7F056374 24070002 */ li $a3, 2 -/* 08AEA8 7F056378 0C001149 */ jal viGetViewTop -/* 08AEAC 7F05637C 00408825 */ move $s1, $v0 -/* 08AEB0 7F056380 00028400 */ sll $s0, $v0, 0x10 -/* 08AEB4 7F056384 0010C403 */ sra $t8, $s0, 0x10 -/* 08AEB8 7F056388 0C00112B */ jal viGetViewHeight -/* 08AEBC 7F05638C 03008025 */ move $s0, $t8 -/* 08AEC0 7F056390 8FA50044 */ lw $a1, 0x44($sp) -/* 08AEC4 7F056394 2401000A */ li $at, 10 -/* 08AEC8 7F056398 00504021 */ addu $t0, $v0, $s0 -/* 08AECC 7F05639C 00A1001A */ div $zero, $a1, $at -/* 08AED0 7F0563A0 00002810 */ mfhi $a1 -/* 08AED4 7F0563A4 250AFFEE */ addiu $t2, $t0, -0x12 -/* 08AED8 7F0563A8 240B0002 */ li $t3, 2 -/* 08AEDC 7F0563AC 240C0001 */ li $t4, 1 -/* 08AEE0 7F0563B0 AFAC0018 */ sw $t4, 0x18($sp) -/* 08AEE4 7F0563B4 AFAB0014 */ sw $t3, 0x14($sp) -/* 08AEE8 7F0563B8 AFAA0010 */ sw $t2, 0x10($sp) -/* 08AEEC 7F0563BC 02202025 */ move $a0, $s1 -/* 08AEF0 7F0563C0 2406008A */ li $a2, 138 -/* 08AEF4 7F0563C4 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08AEF8 7F0563C8 24070002 */ li $a3, 2 -/* 08AEFC 7F0563CC 0C001149 */ jal viGetViewTop -/* 08AF00 7F0563D0 00408825 */ move $s1, $v0 -/* 08AF04 7F0563D4 00028400 */ sll $s0, $v0, 0x10 -/* 08AF08 7F0563D8 00107403 */ sra $t6, $s0, 0x10 -/* 08AF0C 7F0563DC 0C00112B */ jal viGetViewHeight -/* 08AF10 7F0563E0 01C08025 */ move $s0, $t6 -/* 08AF14 7F0563E4 00506821 */ addu $t5, $v0, $s0 -/* 08AF18 7F0563E8 25AFFFEE */ addiu $t7, $t5, -0x12 -/* 08AF1C 7F0563EC 3C058005 */ lui $a1, %hi(D_80052A44) -/* 08AF20 7F0563F0 24190002 */ li $t9, 2 -/* 08AF24 7F0563F4 24180001 */ li $t8, 1 -/* 08AF28 7F0563F8 AFB80018 */ sw $t8, 0x18($sp) -/* 08AF2C 7F0563FC AFB90014 */ sw $t9, 0x14($sp) -/* 08AF30 7F056400 24A52A44 */ addiu $a1, %lo(D_80052A44) # addiu $a1, $a1, 0x2a44 -/* 08AF34 7F056404 AFAF0010 */ sw $t7, 0x10($sp) -/* 08AF38 7F056408 02202025 */ move $a0, $s1 -/* 08AF3C 7F05640C 24060093 */ li $a2, 147 -/* 08AF40 7F056410 0FC1A694 */ jal some_kind_of_display_routine -/* 08AF44 7F056414 24070002 */ li $a3, 2 -/* 08AF48 7F056418 0C001149 */ jal viGetViewTop -/* 08AF4C 7F05641C 00408825 */ move $s1, $v0 -/* 08AF50 7F056420 00028400 */ sll $s0, $v0, 0x10 -/* 08AF54 7F056424 00104C03 */ sra $t1, $s0, 0x10 -/* 08AF58 7F056428 0C00112B */ jal viGetViewHeight -/* 08AF5C 7F05642C 01208025 */ move $s0, $t1 -/* 08AF60 7F056430 8FA50040 */ lw $a1, 0x40($sp) -/* 08AF64 7F056434 2401003C */ li $at, 60 -/* 08AF68 7F056438 00505821 */ addu $t3, $v0, $s0 -/* 08AF6C 7F05643C 00A1001A */ div $zero, $a1, $at -/* 08AF70 7F056440 00004010 */ mfhi $t0 -/* 08AF74 7F056444 2401000A */ li $at, 10 -/* 08AF78 7F056448 256CFFEE */ addiu $t4, $t3, -0x12 -/* 08AF7C 7F05644C 0101001A */ div $zero, $t0, $at -/* 08AF80 7F056450 00002812 */ mflo $a1 -/* 08AF84 7F056454 240E0002 */ li $t6, 2 -/* 08AF88 7F056458 240D0001 */ li $t5, 1 -/* 08AF8C 7F05645C AFAD0018 */ sw $t5, 0x18($sp) -/* 08AF90 7F056460 AFAE0014 */ sw $t6, 0x14($sp) -/* 08AF94 7F056464 AFAC0010 */ sw $t4, 0x10($sp) -/* 08AF98 7F056468 02202025 */ move $a0, $s1 -/* 08AF9C 7F05646C 2406009C */ li $a2, 156 -/* 08AFA0 7F056470 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08AFA4 7F056474 24070002 */ li $a3, 2 -/* 08AFA8 7F056478 0C001149 */ jal viGetViewTop -/* 08AFAC 7F05647C 00408825 */ move $s1, $v0 -/* 08AFB0 7F056480 00028400 */ sll $s0, $v0, 0x10 -/* 08AFB4 7F056484 00107C03 */ sra $t7, $s0, 0x10 -/* 08AFB8 7F056488 0C00112B */ jal viGetViewHeight -/* 08AFBC 7F05648C 01E08025 */ move $s0, $t7 -/* 08AFC0 7F056490 8FA50040 */ lw $a1, 0x40($sp) -/* 08AFC4 7F056494 2401000A */ li $at, 10 -/* 08AFC8 7F056498 0050C021 */ addu $t8, $v0, $s0 -/* 08AFCC 7F05649C 00A1001A */ div $zero, $a1, $at -/* 08AFD0 7F0564A0 00002810 */ mfhi $a1 -/* 08AFD4 7F0564A4 2709FFEE */ addiu $t1, $t8, -0x12 -/* 08AFD8 7F0564A8 24080002 */ li $t0, 2 -/* 08AFDC 7F0564AC 240A0001 */ li $t2, 1 -/* 08AFE0 7F0564B0 AFAA0018 */ sw $t2, 0x18($sp) -/* 08AFE4 7F0564B4 AFA80014 */ sw $t0, 0x14($sp) -/* 08AFE8 7F0564B8 AFA90010 */ sw $t1, 0x10($sp) -/* 08AFEC 7F0564BC 02202025 */ move $a0, $s1 -/* 08AFF0 7F0564C0 240600A4 */ li $a2, 164 -/* 08AFF4 7F0564C4 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08AFF8 7F0564C8 24070002 */ li $a3, 2 -/* 08AFFC 7F0564CC 0C001149 */ jal viGetViewTop -/* 08B000 7F0564D0 00408825 */ move $s1, $v0 -/* 08B004 7F0564D4 00028400 */ sll $s0, $v0, 0x10 -/* 08B008 7F0564D8 00105C03 */ sra $t3, $s0, 0x10 -/* 08B00C 7F0564DC 0C00112B */ jal viGetViewHeight -/* 08B010 7F0564E0 01608025 */ move $s0, $t3 -/* 08B014 7F0564E4 00506021 */ addu $t4, $v0, $s0 -/* 08B018 7F0564E8 258EFFEE */ addiu $t6, $t4, -0x12 -/* 08B01C 7F0564EC 3C058005 */ lui $a1, %hi(D_80052A44) -/* 08B020 7F0564F0 240D0002 */ li $t5, 2 -/* 08B024 7F0564F4 240F0001 */ li $t7, 1 -/* 08B028 7F0564F8 AFAF0018 */ sw $t7, 0x18($sp) -/* 08B02C 7F0564FC AFAD0014 */ sw $t5, 0x14($sp) -/* 08B030 7F056500 24A52A44 */ addiu $a1, %lo(D_80052A44) # addiu $a1, $a1, 0x2a44 -/* 08B034 7F056504 AFAE0010 */ sw $t6, 0x10($sp) -/* 08B038 7F056508 02202025 */ move $a0, $s1 -/* 08B03C 7F05650C 240600AD */ li $a2, 173 -/* 08B040 7F056510 0FC1A694 */ jal some_kind_of_display_routine -/* 08B044 7F056514 24070002 */ li $a3, 2 -/* 08B048 7F056518 0C001149 */ jal viGetViewTop -/* 08B04C 7F05651C 00408825 */ move $s1, $v0 -/* 08B050 7F056520 00028400 */ sll $s0, $v0, 0x10 -/* 08B054 7F056524 0010CC03 */ sra $t9, $s0, 0x10 -/* 08B058 7F056528 0C00112B */ jal viGetViewHeight -/* 08B05C 7F05652C 03208025 */ move $s0, $t9 -/* 08B060 7F056530 8FA5003C */ lw $a1, 0x3c($sp) -/* 08B064 7F056534 24010064 */ li $at, 100 -/* 08B068 7F056538 00504021 */ addu $t0, $v0, $s0 -/* 08B06C 7F05653C 00A1001A */ div $zero, $a1, $at -/* 08B070 7F056540 0000C010 */ mfhi $t8 -/* 08B074 7F056544 2401000A */ li $at, 10 -/* 08B078 7F056548 250AFFEE */ addiu $t2, $t0, -0x12 -/* 08B07C 7F05654C 0301001A */ div $zero, $t8, $at -/* 08B080 7F056550 00002812 */ mflo $a1 -/* 08B084 7F056554 240B0002 */ li $t3, 2 -/* 08B088 7F056558 240C0001 */ li $t4, 1 -/* 08B08C 7F05655C AFAC0018 */ sw $t4, 0x18($sp) -/* 08B090 7F056560 AFAB0014 */ sw $t3, 0x14($sp) -/* 08B094 7F056564 AFAA0010 */ sw $t2, 0x10($sp) -/* 08B098 7F056568 02202025 */ move $a0, $s1 -/* 08B09C 7F05656C 240600B6 */ li $a2, 182 -/* 08B0A0 7F056570 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08B0A4 7F056574 24070002 */ li $a3, 2 -/* 08B0A8 7F056578 0C001149 */ jal viGetViewTop -/* 08B0AC 7F05657C 00408825 */ move $s1, $v0 -/* 08B0B0 7F056580 00028400 */ sll $s0, $v0, 0x10 -/* 08B0B4 7F056584 00107403 */ sra $t6, $s0, 0x10 -/* 08B0B8 7F056588 0C00112B */ jal viGetViewHeight -/* 08B0BC 7F05658C 01C08025 */ move $s0, $t6 -/* 08B0C0 7F056590 8FA5003C */ lw $a1, 0x3c($sp) -/* 08B0C4 7F056594 2401000A */ li $at, 10 -/* 08B0C8 7F056598 00507821 */ addu $t7, $v0, $s0 -/* 08B0CC 7F05659C 00A1001A */ div $zero, $a1, $at -/* 08B0D0 7F0565A0 00002810 */ mfhi $a1 -/* 08B0D4 7F0565A4 25F9FFEE */ addiu $t9, $t7, -0x12 -/* 08B0D8 7F0565A8 24180002 */ li $t8, 2 -/* 08B0DC 7F0565AC 24090001 */ li $t1, 1 -/* 08B0E0 7F0565B0 AFA90018 */ sw $t1, 0x18($sp) -/* 08B0E4 7F0565B4 AFB80014 */ sw $t8, 0x14($sp) -/* 08B0E8 7F0565B8 AFB90010 */ sw $t9, 0x10($sp) -/* 08B0EC 7F0565BC 02202025 */ move $a0, $s1 -/* 08B0F0 7F0565C0 240600BE */ li $a2, 190 -/* 08B0F4 7F0565C4 0FC1A723 */ jal display_ammo_total_in_a1 -/* 08B0F8 7F0565C8 24070002 */ li $a3, 2 -/* 08B0FC 7F0565CC 0FC2B3BC */ jal combiner_bayer_lod_perspective -/* 08B100 7F0565D0 00402025 */ move $a0, $v0 -/* 08B104 7F0565D4 00408825 */ move $s1, $v0 -.L7F0565D8: -/* 08B108 7F0565D8 8FBF002C */ lw $ra, 0x2c($sp) -/* 08B10C 7F0565DC 02201025 */ move $v0, $s1 -/* 08B110 7F0565E0 8FB10028 */ lw $s1, 0x28($sp) -/* 08B114 7F0565E4 8FB00024 */ lw $s0, 0x24($sp) -/* 08B118 7F0565E8 03E00008 */ jr $ra -/* 08B11C 7F0565EC 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif - -#if defined(VERSION_EU) -GLOBAL_ASM( -.text -glabel sub_GAME_7F056210 -/* 088EE0 7F0564F0 3C0E8003 */ lui $t6, %hi(clock_drawn_flag) # $t6, 0x8003 -/* 088EE4 7F0564F4 8DCEC038 */ lw $t6, %lo(clock_drawn_flag)($t6) -/* 088EE8 7F0564F8 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 088EEC 7F0564FC AFB10028 */ sw $s1, 0x28($sp) -/* 088EF0 7F056500 00808825 */ move $s1, $a0 -/* 088EF4 7F056504 AFBF002C */ sw $ra, 0x2c($sp) -/* 088EF8 7F056508 15C000EB */ bnez $t6, .L7F0568B8 -/* 088EFC 7F05650C AFB00024 */ sw $s0, 0x24($sp) -/* 088F00 7F056510 3C018003 */ lui $at, %hi(clock_time) # $at, 0x8003 -/* 088F04 7F056514 C422C040 */ lwc1 $f2, %lo(clock_time)($at) -/* 088F08 7F056518 44802000 */ mtc1 $zero, $f4 -/* 088F0C 7F05651C 3C014561 */ li $at, 0x45610000 # 3600.000000 -/* 088F10 7F056520 44813000 */ mtc1 $at, $f6 -/* 088F14 7F056524 4604103C */ c.lt.s $f2, $f4 -/* 088F18 7F056528 00000000 */ nop -/* 088F1C 7F05652C 45020003 */ bc1fl .L7F05653C -/* 088F20 7F056530 46061303 */ div.s $f12, $f2, $f6 -/* 088F24 7F056534 46001087 */ neg.s $f2, $f2 -/* 088F28 7F056538 46061303 */ div.s $f12, $f2, $f6 -.L7F05653C: -/* 088F2C 7F05653C 0FC17204 */ jal floorFloat -/* 088F30 7F056540 E7A20030 */ swc1 $f2, 0x30($sp) -/* 088F34 7F056544 4600020D */ trunc.w.s $f8, $f0 -/* 088F38 7F056548 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 088F3C 7F05654C C7A20030 */ lwc1 $f2, 0x30($sp) -/* 088F40 7F056550 44815000 */ mtc1 $at, $f10 -/* 088F44 7F056554 44184000 */ mfc1 $t8, $f8 -/* 088F48 7F056558 460A1303 */ div.s $f12, $f2, $f10 -/* 088F4C 7F05655C 0FC17204 */ jal floorFloat -/* 088F50 7F056560 AFB80044 */ sw $t8, 0x44($sp) -/* 088F54 7F056564 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 088F58 7F056568 C7A20030 */ lwc1 $f2, 0x30($sp) -/* 088F5C 7F05656C 44819000 */ mtc1 $at, $f18 -/* 088F60 7F056570 4600040D */ trunc.w.s $f16, $f0 -/* 088F64 7F056574 8FA90044 */ lw $t1, 0x44($sp) -/* 088F68 7F056578 46121102 */ mul.s $f4, $f2, $f18 -/* 088F6C 7F05657C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 088F70 7F056580 44088000 */ mfc1 $t0, $f16 -/* 088F74 7F056584 00095100 */ sll $t2, $t1, 4 -/* 088F78 7F056588 01495023 */ subu $t2, $t2, $t1 -/* 088F7C 7F05658C 44813000 */ mtc1 $at, $f6 -/* 088F80 7F056590 000A5080 */ sll $t2, $t2, 2 -/* 088F84 7F056594 010A5823 */ subu $t3, $t0, $t2 -/* 088F88 7F056598 AFAB0040 */ sw $t3, 0x40($sp) -/* 088F8C 7F05659C 0FC17204 */ jal floorFloat -/* 088F90 7F0565A0 46062303 */ div.s $f12, $f4, $f6 -/* 088F94 7F0565A4 8FAE0044 */ lw $t6, 0x44($sp) -/* 088F98 7F0565A8 4600020D */ trunc.w.s $f8, $f0 -/* 088F9C 7F0565AC 8FB90040 */ lw $t9, 0x40($sp) -/* 088FA0 7F0565B0 000E7880 */ sll $t7, $t6, 2 -/* 088FA4 7F0565B4 01EE7823 */ subu $t7, $t7, $t6 -/* 088FA8 7F0565B8 000F7900 */ sll $t7, $t7, 4 -/* 088FAC 7F0565BC 01EE7823 */ subu $t7, $t7, $t6 -/* 088FB0 7F0565C0 00194880 */ sll $t1, $t9, 2 -/* 088FB4 7F0565C4 440D4000 */ mfc1 $t5, $f8 -/* 088FB8 7F0565C8 000F78C0 */ sll $t7, $t7, 3 -/* 088FBC 7F0565CC 01394823 */ subu $t1, $t1, $t9 -/* 088FC0 7F0565D0 000948C0 */ sll $t1, $t1, 3 -/* 088FC4 7F0565D4 01EE7823 */ subu $t7, $t7, $t6 -/* 088FC8 7F0565D8 000F7900 */ sll $t7, $t7, 4 -/* 088FCC 7F0565DC 01394821 */ addu $t1, $t1, $t9 -/* 088FD0 7F0565E0 00094880 */ sll $t1, $t1, 2 -/* 088FD4 7F0565E4 01AFC023 */ subu $t8, $t5, $t7 -/* 088FD8 7F0565E8 03094023 */ subu $t0, $t8, $t1 -/* 088FDC 7F0565EC AFA8003C */ sw $t0, 0x3c($sp) -/* 088FE0 7F0565F0 0FC2B016 */ jal microcode_constructor -/* 088FE4 7F0565F4 02202025 */ move $a0, $s1 -/* 088FE8 7F0565F8 0C000FDD */ jal viGetViewTop -/* 088FEC 7F0565FC 00408825 */ move $s1, $v0 -/* 088FF0 7F056600 00028400 */ sll $s0, $v0, 0x10 -/* 088FF4 7F056604 00105403 */ sra $t2, $s0, 0x10 -/* 088FF8 7F056608 0C000FBF */ jal viGetViewHeight -/* 088FFC 7F05660C 01408025 */ move $s0, $t2 -/* 089000 7F056610 8FA50044 */ lw $a1, 0x44($sp) -/* 089004 7F056614 24010064 */ li $at, 100 -/* 089008 7F056618 00507021 */ addu $t6, $v0, $s0 -/* 08900C 7F05661C 00A1001A */ div $zero, $a1, $at -/* 089010 7F056620 00005810 */ mfhi $t3 -/* 089014 7F056624 2401000A */ li $at, 10 -/* 089018 7F056628 25CDFFE4 */ addiu $t5, $t6, -0x1c -/* 08901C 7F05662C 0161001A */ div $zero, $t3, $at -/* 089020 7F056630 00002812 */ mflo $a1 -/* 089024 7F056634 240F0002 */ li $t7, 2 -/* 089028 7F056638 24190001 */ li $t9, 1 -/* 08902C 7F05663C AFB90018 */ sw $t9, 0x18($sp) -/* 089030 7F056640 AFAF0014 */ sw $t7, 0x14($sp) -/* 089034 7F056644 AFAD0010 */ sw $t5, 0x10($sp) -/* 089038 7F056648 02202025 */ move $a0, $s1 -/* 08903C 7F05664C 24060082 */ li $a2, 130 -/* 089040 7F056650 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089044 7F056654 24070002 */ li $a3, 2 -/* 089048 7F056658 0C000FDD */ jal viGetViewTop -/* 08904C 7F05665C 00408825 */ move $s1, $v0 -/* 089050 7F056660 00028400 */ sll $s0, $v0, 0x10 -/* 089054 7F056664 0010C403 */ sra $t8, $s0, 0x10 -/* 089058 7F056668 0C000FBF */ jal viGetViewHeight -/* 08905C 7F05666C 03008025 */ move $s0, $t8 -/* 089060 7F056670 8FA50044 */ lw $a1, 0x44($sp) -/* 089064 7F056674 2401000A */ li $at, 10 -/* 089068 7F056678 00504021 */ addu $t0, $v0, $s0 -/* 08906C 7F05667C 00A1001A */ div $zero, $a1, $at -/* 089070 7F056680 00002810 */ mfhi $a1 -/* 089074 7F056684 250AFFE4 */ addiu $t2, $t0, -0x1c -/* 089078 7F056688 240B0002 */ li $t3, 2 -/* 08907C 7F05668C 240C0001 */ li $t4, 1 -/* 089080 7F056690 AFAC0018 */ sw $t4, 0x18($sp) -/* 089084 7F056694 AFAB0014 */ sw $t3, 0x14($sp) -/* 089088 7F056698 AFAA0010 */ sw $t2, 0x10($sp) -/* 08908C 7F05669C 02202025 */ move $a0, $s1 -/* 089090 7F0566A0 2406008A */ li $a2, 138 -/* 089094 7F0566A4 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089098 7F0566A8 24070002 */ li $a3, 2 -/* 08909C 7F0566AC 0C000FDD */ jal viGetViewTop -/* 0890A0 7F0566B0 00408825 */ move $s1, $v0 -/* 0890A4 7F0566B4 00028400 */ sll $s0, $v0, 0x10 -/* 0890A8 7F0566B8 00107403 */ sra $t6, $s0, 0x10 -/* 0890AC 7F0566BC 0C000FBF */ jal viGetViewHeight -/* 0890B0 7F0566C0 01C08025 */ move $s0, $t6 -/* 0890B4 7F0566C4 00506821 */ addu $t5, $v0, $s0 -/* 0890B8 7F0566C8 25AFFFE4 */ addiu $t7, $t5, -0x1c -/* 0890BC 7F0566CC 3C058005 */ lui $a1, %hi(D_80052A44) # $a1, 0x8005 -/* 0890C0 7F0566D0 24190002 */ li $t9, 2 -/* 0890C4 7F0566D4 24180001 */ li $t8, 1 -/* 0890C8 7F0566D8 AFB80018 */ sw $t8, 0x18($sp) -/* 0890CC 7F0566DC AFB90014 */ sw $t9, 0x14($sp) -/* 0890D0 7F0566E0 24A58B84 */ addiu $a1, %lo(D_80052A44) # addiu $a1, $a1, -0x747c -/* 0890D4 7F0566E4 AFAF0010 */ sw $t7, 0x10($sp) -/* 0890D8 7F0566E8 02202025 */ move $a0, $s1 -/* 0890DC 7F0566EC 24060093 */ li $a2, 147 -/* 0890E0 7F0566F0 0FC1A879 */ jal some_kind_of_display_routine -/* 0890E4 7F0566F4 24070002 */ li $a3, 2 -/* 0890E8 7F0566F8 0C000FDD */ jal viGetViewTop -/* 0890EC 7F0566FC 00408825 */ move $s1, $v0 -/* 0890F0 7F056700 00028400 */ sll $s0, $v0, 0x10 -/* 0890F4 7F056704 00104C03 */ sra $t1, $s0, 0x10 -/* 0890F8 7F056708 0C000FBF */ jal viGetViewHeight -/* 0890FC 7F05670C 01208025 */ move $s0, $t1 -/* 089100 7F056710 8FA50040 */ lw $a1, 0x40($sp) -/* 089104 7F056714 2401003C */ li $at, 60 -/* 089108 7F056718 00505821 */ addu $t3, $v0, $s0 -/* 08910C 7F05671C 00A1001A */ div $zero, $a1, $at -/* 089110 7F056720 00004010 */ mfhi $t0 -/* 089114 7F056724 2401000A */ li $at, 10 -/* 089118 7F056728 256CFFE4 */ addiu $t4, $t3, -0x1c -/* 08911C 7F05672C 0101001A */ div $zero, $t0, $at -/* 089120 7F056730 00002812 */ mflo $a1 -/* 089124 7F056734 240E0002 */ li $t6, 2 -/* 089128 7F056738 240D0001 */ li $t5, 1 -/* 08912C 7F05673C AFAD0018 */ sw $t5, 0x18($sp) -/* 089130 7F056740 AFAE0014 */ sw $t6, 0x14($sp) -/* 089134 7F056744 AFAC0010 */ sw $t4, 0x10($sp) -/* 089138 7F056748 02202025 */ move $a0, $s1 -/* 08913C 7F05674C 2406009C */ li $a2, 156 -/* 089140 7F056750 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089144 7F056754 24070002 */ li $a3, 2 -/* 089148 7F056758 0C000FDD */ jal viGetViewTop -/* 08914C 7F05675C 00408825 */ move $s1, $v0 -/* 089150 7F056760 00028400 */ sll $s0, $v0, 0x10 -/* 089154 7F056764 00107C03 */ sra $t7, $s0, 0x10 -/* 089158 7F056768 0C000FBF */ jal viGetViewHeight -/* 08915C 7F05676C 01E08025 */ move $s0, $t7 -/* 089160 7F056770 8FA50040 */ lw $a1, 0x40($sp) -/* 089164 7F056774 2401000A */ li $at, 10 -/* 089168 7F056778 0050C021 */ addu $t8, $v0, $s0 -/* 08916C 7F05677C 00A1001A */ div $zero, $a1, $at -/* 089170 7F056780 00002810 */ mfhi $a1 -/* 089174 7F056784 2709FFE4 */ addiu $t1, $t8, -0x1c -/* 089178 7F056788 24080002 */ li $t0, 2 -/* 08917C 7F05678C 240A0001 */ li $t2, 1 -/* 089180 7F056790 AFAA0018 */ sw $t2, 0x18($sp) -/* 089184 7F056794 AFA80014 */ sw $t0, 0x14($sp) -/* 089188 7F056798 AFA90010 */ sw $t1, 0x10($sp) -/* 08918C 7F05679C 02202025 */ move $a0, $s1 -/* 089190 7F0567A0 240600A4 */ li $a2, 164 -/* 089194 7F0567A4 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089198 7F0567A8 24070002 */ li $a3, 2 -/* 08919C 7F0567AC 0C000FDD */ jal viGetViewTop -/* 0891A0 7F0567B0 00408825 */ move $s1, $v0 -/* 0891A4 7F0567B4 00028400 */ sll $s0, $v0, 0x10 -/* 0891A8 7F0567B8 00105C03 */ sra $t3, $s0, 0x10 -/* 0891AC 7F0567BC 0C000FBF */ jal viGetViewHeight -/* 0891B0 7F0567C0 01608025 */ move $s0, $t3 -/* 0891B4 7F0567C4 00506021 */ addu $t4, $v0, $s0 -/* 0891B8 7F0567C8 258EFFE4 */ addiu $t6, $t4, -0x1c -/* 0891BC 7F0567CC 3C058005 */ lui $a1, %hi(D_80052A44) # $a1, 0x8005 -/* 0891C0 7F0567D0 240D0002 */ li $t5, 2 -/* 0891C4 7F0567D4 240F0001 */ li $t7, 1 -/* 0891C8 7F0567D8 AFAF0018 */ sw $t7, 0x18($sp) -/* 0891CC 7F0567DC AFAD0014 */ sw $t5, 0x14($sp) -/* 0891D0 7F0567E0 24A58B84 */ addiu $a1, %lo(D_80052A44) # addiu $a1, $a1, -0x747c -/* 0891D4 7F0567E4 AFAE0010 */ sw $t6, 0x10($sp) -/* 0891D8 7F0567E8 02202025 */ move $a0, $s1 -/* 0891DC 7F0567EC 240600AD */ li $a2, 173 -/* 0891E0 7F0567F0 0FC1A879 */ jal some_kind_of_display_routine -/* 0891E4 7F0567F4 24070002 */ li $a3, 2 -/* 0891E8 7F0567F8 0C000FDD */ jal viGetViewTop -/* 0891EC 7F0567FC 00408825 */ move $s1, $v0 -/* 0891F0 7F056800 00028400 */ sll $s0, $v0, 0x10 -/* 0891F4 7F056804 0010CC03 */ sra $t9, $s0, 0x10 -/* 0891F8 7F056808 0C000FBF */ jal viGetViewHeight -/* 0891FC 7F05680C 03208025 */ move $s0, $t9 -/* 089200 7F056810 8FA5003C */ lw $a1, 0x3c($sp) -/* 089204 7F056814 24010064 */ li $at, 100 -/* 089208 7F056818 00504021 */ addu $t0, $v0, $s0 -/* 08920C 7F05681C 00A1001A */ div $zero, $a1, $at -/* 089210 7F056820 0000C010 */ mfhi $t8 -/* 089214 7F056824 2401000A */ li $at, 10 -/* 089218 7F056828 250AFFE4 */ addiu $t2, $t0, -0x1c -/* 08921C 7F05682C 0301001A */ div $zero, $t8, $at -/* 089220 7F056830 00002812 */ mflo $a1 -/* 089224 7F056834 240B0002 */ li $t3, 2 -/* 089228 7F056838 240C0001 */ li $t4, 1 -/* 08922C 7F05683C AFAC0018 */ sw $t4, 0x18($sp) -/* 089230 7F056840 AFAB0014 */ sw $t3, 0x14($sp) -/* 089234 7F056844 AFAA0010 */ sw $t2, 0x10($sp) -/* 089238 7F056848 02202025 */ move $a0, $s1 -/* 08923C 7F05684C 240600B6 */ li $a2, 182 -/* 089240 7F056850 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089244 7F056854 24070002 */ li $a3, 2 -/* 089248 7F056858 0C000FDD */ jal viGetViewTop -/* 08924C 7F05685C 00408825 */ move $s1, $v0 -/* 089250 7F056860 00028400 */ sll $s0, $v0, 0x10 -/* 089254 7F056864 00107403 */ sra $t6, $s0, 0x10 -/* 089258 7F056868 0C000FBF */ jal viGetViewHeight -/* 08925C 7F05686C 01C08025 */ move $s0, $t6 -/* 089260 7F056870 8FA5003C */ lw $a1, 0x3c($sp) -/* 089264 7F056874 2401000A */ li $at, 10 -/* 089268 7F056878 00507821 */ addu $t7, $v0, $s0 -/* 08926C 7F05687C 00A1001A */ div $zero, $a1, $at -/* 089270 7F056880 00002810 */ mfhi $a1 -/* 089274 7F056884 25F9FFE4 */ addiu $t9, $t7, -0x1c -/* 089278 7F056888 24180002 */ li $t8, 2 -/* 08927C 7F05688C 24090001 */ li $t1, 1 -/* 089280 7F056890 AFA90018 */ sw $t1, 0x18($sp) -/* 089284 7F056894 AFB80014 */ sw $t8, 0x14($sp) -/* 089288 7F056898 AFB90010 */ sw $t9, 0x10($sp) -/* 08928C 7F05689C 02202025 */ move $a0, $s1 -/* 089290 7F0568A0 240600BE */ li $a2, 190 -/* 089294 7F0568A4 0FC1A908 */ jal display_ammo_total_in_a1 -/* 089298 7F0568A8 24070002 */ li $a3, 2 -/* 08929C 7F0568AC 0FC2B06C */ jal combiner_bayer_lod_perspective -/* 0892A0 7F0568B0 00402025 */ move $a0, $v0 -/* 0892A4 7F0568B4 00408825 */ move $s1, $v0 -.L7F0568B8: -/* 0892A8 7F0568B8 8FBF002C */ lw $ra, 0x2c($sp) -/* 0892AC 7F0568BC 02201025 */ move $v0, $s1 -/* 0892B0 7F0568C0 8FB10028 */ lw $s1, 0x28($sp) -/* 0892B4 7F0568C4 8FB00024 */ lw $s0, 0x24($sp) -/* 0892B8 7F0568C8 03E00008 */ jr $ra -/* 0892BC 7F0568CC 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif -#endif - +/* + Renders the on-screen countdown timer + using minutes, seconds and milliseconds + in the following format + + 00 : 00 : 00 + Timer value is set using countdownTimerSetValue() +*/ +Gfx *countdownTimerRender(Gfx *DL) { + + s32 mins; + s32 secs; + s32 ms; + s32 valign_offset; + s32 unused; + f32 time; + if (clock_drawn_flag == 0) { + + time = clock_time; + if (time < 0.0f) { + time = -time; + } + + mins = (s32) floorFloat(time / 3600.0f); + secs = (s32) floorFloat(time / 60.0f) - (mins * 60); + ms = ((s32) floorFloat((time * 100.0f) / 60.0f) - (mins * 6000)) - (secs * 100); + + DL = microcode_constructor(DL); + + #if defined(VERSION_US) || defined(VERSION_JP) + valign_offset = 18; + #else + valign_offset = 28; + #endif + + // Minutes + DL = gunDrawHudInteger(DL, (mins % 100) / 10, 0x82, HUDHALIGN_MIDDLE, ( viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + DL = gunDrawHudInteger(DL, mins % 10, 0x8A, HUDHALIGN_MIDDLE, ( viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + + // : + DL = gunDrawHudString(DL, &D_80052A44, 0x93, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + + // Seconds + DL = gunDrawHudInteger(DL, (secs % 60) / 10, 0x9C, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + DL = gunDrawHudInteger(DL, secs % 10, 0xA4, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + + // : + DL = gunDrawHudString(DL, &D_80052A44, 0xAD, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + + // Milliseconds + DL = gunDrawHudInteger(DL, (ms % 100) / 10, 0xB6, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + DL = gunDrawHudInteger(DL, ms % 10, 0xBE, HUDHALIGN_MIDDLE, (viGetViewTop() + viGetViewHeight()) - valign_offset, HUDVALIGN_MIDDLE, 1); + DL = combiner_bayer_lod_perspective(DL); + } + + return DL; +} void handle_alarm_gas_timer_calldamage(void) { @@ -46130,7 +40652,7 @@ void handle_alarm_gas_timer_calldamage(void) handle_gas_damage(); if_enabled_reset_clock(); check_guard_detonate_proxmine(); - D_80030AF4 = 0; + g_RemoteMineOwnerTriggerFlag = 0; return; } @@ -46247,7 +40769,7 @@ glabel drop_inventory /* 08B2F4 7F0567C4 24140059 */ li $s4, 89 /* 08B2F8 7F0567C8 3C132000 */ lui $s3, 0x2000 .L7F0567CC: -/* 08B2FC 7F0567CC 0FC26C91 */ jal sub_GAME_7F09B244 +/* 08B2FC 7F0567CC 0FC26C91 */ jal getPropForHeldItem /* 08B300 7F0567D0 02002025 */ move $a0, $s0 /* 08B304 7F0567D4 04400012 */ bltz $v0, .L7F056820 /* 08B308 7F0567D8 00408825 */ move $s1, $v0 @@ -46266,7 +40788,7 @@ glabel drop_inventory /* 08B33C 7F05680C 00402025 */ move $a0, $v0 /* 08B340 7F056810 0FC12FF4 */ jal propobjSetDropped /* 08B344 7F056814 24050001 */ li $a1, 1 -/* 08B348 7F056818 0FC1304C */ jal sub_GAME_7F04C130 +/* 08B348 7F056818 0FC1304C */ jal objDrop /* 08B34C 7F05681C 02202025 */ move $a0, $s1 .L7F056820: /* 08B350 7F056820 26100001 */ addiu $s0, $s0, 1 diff --git a/src/game/chrobjhandler.h b/src/game/chrobjhandler.h index bddc9aab..2616a859 100644 --- a/src/game/chrobjhandler.h +++ b/src/game/chrobjhandler.h @@ -6,10 +6,40 @@ #include #include +struct ShotData { + // temporary definition for GE: + /*0x00*/ s32 unk00[13]; + /*0x34*/ f32 unk34; + + // the following is from PD, it seems to line up: + /*0x00*/ //struct coord unk00; + /*0x0c*/ //struct coord unk0c; + /*0x18*/ //struct gset gset; + /*0x1c*/ //struct coord gunpos; + /*0x28*/ //struct coord dir; + /*0x34*/ //f32 unk34; + /*0x38*/ //s32 penetration; + /*0x3c*/ //struct hit hits[10]; +}; + +struct HitThing { + // the following is taken from PD + // may need adjustments + coord3d unk00; + coord3d unk0c; + Vertex *unk18; + Vertex *unk1c; + Vertex *unk20; + Gfx *tricmd; + s16 unk28; + s16 texturenum; + s16 unk2c; +}; + extern f32 F_80030B14; extern f32 F_80030B18; -extern f32 F_80030B1C; -extern f32 F_80030B20; +extern f32 g_AutogunPendingDamageTick; +extern f32 g_AutogunDamageScalar; extern f32 F_80030B24; extern f32 g_SoloAmmoMultiplier; @@ -24,18 +54,18 @@ extern ALSoundState *ptr_gas_sound; extern s32 clock_drawn_flag; extern s32 clock_enable; extern f32 clock_time; -extern s32 D_80030AF4; -extern s32 D_80030AF8; -extern s32 D_80030AFC; +extern s32 g_RemoteMineOwnerTriggerFlag; +extern s32 g_NextWeaponSlot; +extern s32 g_NextHatSlot; extern ObjectRecord *g_LevelLoadPropSwitch; -extern ObjectRecord *g_LevelLoadPropLockDoor; +extern LockDoorRecord *g_LevelLoadPropLockDoor; extern ObjectRecord *g_LevelLoadPropSafeItem; -extern s32 D_80030B0C; +extern struct PropRecord *D_80030B0C; extern s32 bodypartshot; extern f32 F_80030B14; extern f32 F_80030B18; -extern f32 F_80030B1C; -extern f32 F_80030B20; +extern f32 g_AutogunPendingDamageTick; +extern f32 g_AutogunDamageScalar; extern f32 F_80030B24; extern f32 g_SoloAmmoMultiplier; @@ -51,24 +81,24 @@ void chrobjApplySpeed(f32 *openPosition, f32 maxFrac, f32 *speed void chrobjCallsApplySpeed(f32 *openPosition, f32 maxFrac, f32 *speedPtr, f32 accel, f32 decel, f32 maxSpeed); Gfx *sub_GAME_7F049B58(Gfx *arg0); void set_color_shading_from_tile(PropRecord *, rgba_u8 *); -void propobjSetDropped(PropRecord *, s32); -void sub_GAME_7F053A10(ALSoundState *, coord3d *); +void propobjSetDropped(PropRecord *prop, DROPTYPE droptype); +void chrobjSndCreatePostEventDefault(ALSoundState *, coord3d *); void alarmActivate(void); -void sub_GAME_7F052574(PropRecord *, s32); -s32 sub_GAME_7F052604(PropRecord *); +void weaponSetGunfireVisible(PropRecord *prop, s32 firing); +s32 weaponIsGunfireVisible(PropRecord *); s32 sub_GAME_7F0539E4(coord3d *pos); //getVolume? ObjectRecord *create_new_item_instance_of_model(PROP propid, s32 arg1); -void maybe_detonate_object(ObjectRecord *arg0, f32 arg1, coord3d *arg2, ITEM_IDS item, s32 arg4); +void maybe_detonate_object(ObjectRecord *obj, f32 damage, coord3d *pos, ITEM_IDS item, s32 owner); void chrobjMaybeDetonateObjectIfFlags(ObjectRecord *arg0, f32 arg1, coord3d *arg2, ITEM_IDS item, s32 arg4); void sub_GAME_7F03FDA8(PropRecord *); -void sub_GAME_7F03FE14(PropRecord *); +void projectileSetSticky(PropRecord *); void chrobjCollisionRelated(ObjectRecord *); -void sub_GAME_7F040754(ObjectRecord *, coord3d *, Mtxf *, StandTile *); +void objChangeShading(ObjectRecord *, coord3d *, Mtxf *, StandTile *); s32 sub_GAME_7F041074(coord3d *arg0, coord3d *arg1, coord3d *arg2, f32 arg3); void sub_GAME_7F04F244(PropRecord *arg0, struct rect4f **arg1, s32 *arg2, f32 *arg3, f32 *arg4); void doorActivate(DoorRecord *door, DOORSTATE State); -s32 sub_GAME_7F055A70(PropRecord *arg0, DoorRecord *arg1); -void sub_GAME_7F055B78(PropRecord *arg0, DoorRecord *arg1); +s32 posIsInFrontOfDoor(PropRecord *arg0, DoorRecord *arg1); +void doorsChooseSwingDirection(PropRecord *arg0, DoorRecord *arg1); Gfx *chrobjRenderProp(PropRecord *arg0, Gfx *arg1, s32 arg2); f32 chrobjFogVisRangeRelated(PropRecord *prop, f32 size); @@ -78,8 +108,8 @@ s32 sub_GAME_7F054A64(PropRecord *prop, bbox2d *bbox); void sub_GAME_7F040384(rgba_s32 *arg0, s32 arg1, rgba_f32 *arg2); void trigger_remote_mine_detonation(void); -void sub_GAME_7F04C044(PropRecord *prop); -void sub_GAME_7F040CF0(PropRecord *); +void objDetach(PropRecord *prop); +void objFreeEmbedmentOrProjectile(PropRecord *); bool alarmIsActive(); void init_trigger_toxic_gas_effect(coord3d *source); void chrSetWeaponFlag4(ChrRecord *chr, GUNHAND hand); @@ -95,19 +125,27 @@ void countdownTimerSetRunning(bool enable); void countdownTimerSetValue(f32 time); void countdownTimerSetVisible(int clocklockbits, bool unset); void sub_GAME_7F04088C(ObjectRecord *baseobj, PadRecord *pad, Mtxf *matrix, StandTile *stan, PadRecord *pad2); -bool sub_GAME_7F051E1C(WeaponObjRecord *wep, ChrRecord *chr); +bool chrEquipWeapon(WeaponObjRecord *wep, ChrRecord *chr); INV_ITEM_TYPE collect_or_interact_object(PropRecord *prop, bool showstring); INV_ITEM_TYPE propobjInteract(PropRecord *prop); -s32 do_something_if_object_destroyed(ObjectRecord *obj); +s32 objGetDestroyedLevel(ObjectRecord *obj); void doorActivateWrapper(PropRecord *prop); bool objIsHealthy(ObjectRecord *self); ObjectRecord *weaponFindThrown(s32 ID); bool check_if_toxic_gas_activated(); -PropRecord *chrTryEquipHat(ChrRecord *self, s32 index, s32 flags); -void sub_GAME_7F04C044(PropRecord *prop); +HatRecord *hatCreate(bool musthaveprop, bool musthavemodel, ModelFileHeader *modeldef); +PropRecord* objInitWithAutoModel(ObjectRecord* obj); +Embedment *embedmentAllocate(void); +void objDetach(PropRecord *prop); void sub_GAME_7F043650(struct WeaponObjRecord *arg0); s32 sub_GAME_7F0446B8(struct rect4f *arg0, s32 arg1, struct rect4f *arg2, s32 arg3); s32 chrobjTestPointPolygonCollision(struct coord3d *arg0, f32 arg1, struct rect4f *arg2, s32 arg3); -void sub_GAME_7F04DEFC(PropRecord *arg0, f32 arg1, struct coord3d *arg2, s32 arg3, s32 owner); -struct modeldata_unk_pos * sub_GAME_7F040078(ObjectRecord *arg0); +void maybe_detonate_object_and_its_children(PropRecord *arg0, f32 arg1, struct coord3d *arg2, s32 arg3, s32 owner); +struct ModelRoData_BoundingBoxRecord* chrobjGetBboxFromObjectRecord(ObjectRecord *arg0); +void deactivate_alarm_sound_effect(void); +s32 sub_GAME_7F03F598(coord3d* pos, f32 arg1, BoundPadRecord *boundpads); +void sub_GAME_7F0A1DA0(f32*, f32*, f32*, f32*, f32, f32, f32, f32, f32, f32); +void sub_GAME_7F03F90C(Model *model, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4); +s32 sub_GAME_7F0448A8(struct PropRecord *arg0); + #endif diff --git a/src/game/chrprop.c b/src/game/chrprop.c index 84eaee0b..cbf20dc4 100644 --- a/src/game/chrprop.c +++ b/src/game/chrprop.c @@ -37,6 +37,7 @@ #include "file.h" #include "fog.h" #include "stan.h" +#include "explosions.h" // bss @@ -53,10 +54,10 @@ u32 num_obj_position_data_entries; PropRecord pos_data_entry[POS_DATA_ENTRY_LEN]; //CODE.bss:80071618 -s16 *ptr_room_lookup_buffer_maybe; +s16 *RoomPropListChunkIndexes; //CODE.bss:8007161C -struct unk_8007161c *dword_CODE_bss_8007161C; +struct roomproplistchunk *RoomPropListChunks; /** * Array of pointers, containing onscreen props. @@ -78,7 +79,7 @@ PropRecord **g_LastOnScreenProp; s32 g_OnScreenPropCount; //CODE.bss:80071DF8 -u32 dword_CODE_bss_80071DF8; +PropRecord *g_InteractProp; //CODE.bss:80071DFC u32 dword_CODE_bss_80071DFC; //CODE.bss:80071E00 @@ -92,53 +93,45 @@ u32 gas_cutoff_flag; /** * Address 0x80071E80. */ -struct projectile_data ProjectileData_start_address[PROJECTILEDATA_START_ADDRESS_LEN]; +WeaponObjRecord g_WeaponSlots[MAX_WEAPON_SLOTS]; /** * Address 0x80072E70. */ -struct bss_80072E70 dword_CODE_bss_80072E70[BSS_80072E70_DATA_LEN]; +HatRecord g_HatSlots[MAX_HAT_SLOTS]; /** * Address 0x80073370. */ -struct bss_80073370 dword_CODE_bss_80073370[BSS_80073370_DATA_LEN]; +AmmoCrateRecord g_AmmoCrates[MAX_AMMO_CRATES]; /** * Address 0x80073DC0. */ -struct bss_80073DC0 dword_CODE_bss_80073DC0[BSS_80073DC0_DATA_LEN]; +Projectile g_Projectiles[PROJECTILES_ARR_MAX]; /** * Address 0x80075030. */ -struct bss_80075030 dword_CODE_bss_80075030[BSS_80075030_DATA_LEN]; +Embedment g_Embedments[EMBEDMENT_ARR_MAX]; //CODE.bss:80075B70 -u32 objinst; +struct Model *g_CurrentProjectileModel; //CODE.bss:80075B74 -u32 dword_CODE_bss_80075B74; +struct ModelNode * dword_CODE_bss_80075B74; //CODE.bss:80075B78 -f32 flt_CODE_bss_80075B78; -//CODE.bss:80075B7C -f32 flt_CODE_bss_80075B7C; -//CODE.bss:80075B80 -f32 flt_CODE_bss_80075B80; +coord3d flt_CODE_bss_80075B78; //CODE.bss:80075B84 f32 flt_CODE_bss_80075B84; //CODE.bss:80075B88 -f32 flt_CODE_bss_80075B88; -//CODE.bss:80075B8C -f32 flt_CODE_bss_80075B8C; -//CODE.bss:80075B90 -f32 flt_CODE_bss_80075B90; +coord3d flt_CODE_bss_80075B88; //CODE.bss:80075B94 f32 flt_CODE_bss_80075B94; /** * Address 0x80075B98. */ -struct object_animation_controller g_MonitorAnimController; +MonitorRecord g_MonitorAnimController; /** * Unused / unreferenced (from padding / align?) @@ -180,7 +173,7 @@ PropRecord *ptr_obj_pos_list_current_entry = 0; PropRecord *ptr_obj_pos_list_first_entry = 0; PropRecord *ptr_obj_pos_list_final_entry = 0; f32 difficulty = 1.0; -s32 D_80030AB0 = 0; +struct coord2d g_DefaultAutoAimCoord = { 0 }; @@ -190,7 +183,7 @@ Gfx *chrpropRender(Gfx *arg0, PropRecord *arg1, s32 withalpha); void chraiCheckUseHeldItem(s32 hand); void chraiDefaultWeaponFireHandler(s32); void chraiFistAttackHandler(s32, s32); -void sub_GAME_7F03C2BC(PropRecord *prop, INV_ITEM_TYPE type) ; +void propExecuteTickOperation(PropRecord *prop, INV_ITEM_TYPE op); // end forward declarations @@ -231,7 +224,7 @@ void chraiUpdateOnscreenPropCount(void) } g_LastOnScreenProp = (PropRecord *)&g_OnScreenPropList[count]; - + for (i=0; imaxbounds.f[0]; sp30 = (s32) temp_v0->maxbounds.f[1]; sp34 = (s32) temp_v0->maxbounds.f[2]; - if (sub_GAME_7F0B6CEC(arg1, arg2, &sp20, &sp2C) != 0) { + if (bgTestLineIntersectsBbox(arg1, arg2, &sp20, &sp2C) != 0) { return 1; } } @@ -861,7 +854,7 @@ glabel sub_GAME_7F03A97C /* 06F53C 7F03AA0C AFAC0028 */ sw $t4, 0x28($sp) /* 06F540 7F03AA10 AFAE002C */ sw $t6, 0x2c($sp) /* 06F544 7F03AA14 AFB80030 */ sw $t8, 0x30($sp) -/* 06F548 7F03AA18 0FC2DB3B */ jal sub_GAME_7F0B6CEC +/* 06F548 7F03AA18 0FC2DB3B */ jal bgTestLineIntersectsBbox /* 06F54C 7F03AA1C AFA80034 */ sw $t0, 0x34($sp) /* 06F550 7F03AA20 50400004 */ beql $v0, $zero, .L7F03AA34 /* 06F554 7F03AA24 00001025 */ move $v0, $zero @@ -1449,7 +1442,7 @@ glabel chraiDefaultWeaponFireHandler /* 06FCC8 7F03B198 02402025 */ move $a0, $s2 /* 06FCCC 7F03B19C 27A501A0 */ addiu $a1, $sp, 0x1a0 /* 06FCD0 7F03B1A0 02003025 */ move $a2, $s0 -/* 06FCD4 7F03B1A4 0FC1A073 */ jal sub_GAME_7F0681CC +/* 06FCD4 7F03B1A4 0FC1A073 */ jal bullet_path_from_screen_center /* 06FCD8 7F03B1A8 AFAE04F8 */ sw $t6, 0x4f8($sp) /* 06FCDC 7F03B1AC 0FC17674 */ jal getCurrentPlayerWeaponId /* 06FCE0 7F03B1B0 02002025 */ move $a0, $s0 @@ -1488,7 +1481,7 @@ glabel chraiDefaultWeaponFireHandler /* 06FD60 7F03B230 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 06FD64 7F03B234 E7AA01B8 */ swc1 $f10, 0x1b8($sp) /* 06FD68 7F03B238 00402025 */ move $a0, $v0 -/* 06FD6C 7F03B23C 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 06FD6C 7F03B23C 0FC1611D */ jal mtx4TransformVecInPlace /* 06FD70 7F03B240 27A501B0 */ addiu $a1, $sp, 0x1b0 /* 06FD74 7F03B244 C7B001A0 */ lwc1 $f16, 0x1a0($sp) /* 06FD78 7F03B248 C7B201A4 */ lwc1 $f18, 0x1a4($sp) @@ -1498,7 +1491,7 @@ glabel chraiDefaultWeaponFireHandler /* 06FD88 7F03B258 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 06FD8C 7F03B25C E7A401C4 */ swc1 $f4, 0x1c4($sp) /* 06FD90 7F03B260 00402025 */ move $a0, $v0 -/* 06FD94 7F03B264 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 06FD94 7F03B264 0FC160F6 */ jal mtx4RotateVecInPlace /* 06FD98 7F03B268 27A501BC */ addiu $a1, $sp, 0x1bc /* 06FD9C 7F03B26C 3C014780 */ li $at, 0x47800000 # 65536.000000 /* 06FDA0 7F03B270 44810000 */ mtc1 $at, $f0 @@ -1605,10 +1598,10 @@ glabel chraiDefaultWeaponFireHandler /* 06FF24 7F03B3F4 03B14021 */ addu $t0, $sp, $s1 /* 06FF28 7F03B3F8 A119008C */ sb $t9, 0x8c($t0) /* 06FF2C 7F03B3FC 8FA90544 */ lw $t1, 0x544($sp) -/* 06FF30 7F03B400 3C0A8008 */ lui $t2, %hi(ptr_bgdata_portals) +/* 06FF30 7F03B400 3C0A8008 */ lui $t2, %hi(g_BgPortals) /* 06FF34 7F03B404 5D200027 */ bgtzl $t1, .L7F03B4A4 /* 06FF38 7F03B408 8FA80544 */ lw $t0, 0x544($sp) -/* 06FF3C 7F03B40C 8D4AFF80 */ lw $t2, %lo(ptr_bgdata_portals)($t2) +/* 06FF3C 7F03B40C 8D4AFF80 */ lw $t2, %lo(g_BgPortals)($t2) /* 06FF40 7F03B410 8D4B0000 */ lw $t3, ($t2) /* 06FF44 7F03B414 11600012 */ beqz $t3, .L7F03B460 /* 06FF48 7F03B418 00000000 */ nop @@ -1710,10 +1703,10 @@ glabel chraiDefaultWeaponFireHandler /* 0700B0 7F03B580 5300000B */ beql $t8, $zero, .L7F03B5B0 /* 0700B4 7F03B584 8FB901AC */ lw $t9, 0x1ac($sp) .L7F03B588: -/* 0700B8 7F03B588 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0700B8 7F03B588 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0700BC 7F03B58C 00000000 */ nop /* 0700C0 7F03B590 00402025 */ move $a0, $v0 -/* 0700C4 7F03B594 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 0700C4 7F03B594 0FC1611D */ jal mtx4TransformVecInPlace /* 0700C8 7F03B598 27A50500 */ addiu $a1, $sp, 0x500 /* 0700CC 7F03B59C C7A40508 */ lwc1 $f4, 0x508($sp) /* 0700D0 7F03B5A0 46002207 */ neg.s $f8, $f4 @@ -1756,7 +1749,7 @@ glabel chraiDefaultWeaponFireHandler /* 070158 7F03B628 8E090004 */ lw $t1, 4($s0) /* 07015C 7F03B62C 5120000D */ beql $t1, $zero, .L7F03B664 /* 070160 7F03B630 92020000 */ lbu $v0, ($s0) -/* 070164 7F03B634 0FC26C57 */ jal sub_GAME_7F09B15C +/* 070164 7F03B634 0FC26C57 */ jal getPlayerPointerIndex /* 070168 7F03B638 02002025 */ move $a0, $s0 /* 07016C 7F03B63C 0FC26C54 */ jal get_cur_playernum /* 070170 7F03B640 AFA2004C */ sw $v0, 0x4c($sp) @@ -2383,7 +2376,7 @@ glabel chraiFistAttackHandler /* 0709D8 7F03BEA8 8E0F0004 */ lw $t7, 4($s0) /* 0709DC 7F03BEAC 11E00073 */ beqz $t7, .L7F03C07C /* 0709E0 7F03BEB0 00000000 */ nop -/* 0709E4 7F03BEB4 0FC26C57 */ jal sub_GAME_7F09B15C +/* 0709E4 7F03BEB4 0FC26C57 */ jal getPlayerPointerIndex /* 0709E8 7F03BEB8 02002025 */ move $a0, $s0 /* 0709EC 7F03BEBC 0FC26C54 */ jal get_cur_playernum /* 0709F0 7F03BEC0 00408825 */ move $s1, $v0 @@ -2457,7 +2450,7 @@ glabel chraiFistAttackHandler /* 070AF8 7F03BFC8 E7B80018 */ swc1 $f24, 0x18($sp) /* 070AFC 7F03BFCC AFB90014 */ sw $t9, 0x14($sp) /* 070B00 7F03BFD0 E7B00024 */ swc1 $f16, 0x24($sp) -/* 070B04 7F03BFD4 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 070B04 7F03BFD4 0FC2C389 */ jal stanTestLineUnobstructed /* 070B08 7F03BFD8 E7AA0010 */ swc1 $f10, 0x10($sp) /* 070B0C 7F03BFDC 10400027 */ beqz $v0, .L7F03C07C /* 070B10 7F03BFE0 8FA80090 */ lw $t0, 0x90($sp) @@ -2481,12 +2474,12 @@ glabel chraiFistAttackHandler /* 070B50 7F03C020 27A40084 */ addiu $a0, $sp, 0x84 .L7F03C024: /* 070B54 7F03C024 02A02825 */ move $a1, $s5 -/* 070B58 7F03C028 0FC1A073 */ jal sub_GAME_7F0681CC +/* 070B58 7F03C028 0FC1A073 */ jal bullet_path_from_screen_center /* 070B5C 7F03C02C 8FA600C8 */ lw $a2, 0xc8($sp) /* 070B60 7F03C030 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 070B64 7F03C034 00000000 */ nop /* 070B68 7F03C038 00402025 */ move $a0, $v0 -/* 070B6C 7F03C03C 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 070B6C 7F03C03C 0FC160F6 */ jal mtx4RotateVecInPlace /* 070B70 7F03C040 02A02825 */ move $a1, $s5 /* 070B74 7F03C044 240A0001 */ li $t2, 1 /* 070B78 7F03C048 AFAA0010 */ sw $t2, 0x10($sp) @@ -2628,7 +2621,7 @@ void chraiCheckUseHeldItems(void) -void sub_GAME_7F03C2BC(PropRecord *prop, INV_ITEM_TYPE type) //#MATCH +void propExecuteTickOperation(PropRecord *prop, INV_ITEM_TYPE type) //#MATCH { ObjectRecord *propobj; @@ -2669,161 +2662,93 @@ void sub_GAME_7F03C2BC(PropRecord *prop, INV_ITEM_TYPE type) //#MATCH chrpropDeregisterRooms(prop); chrpropDelist(prop); chrpropDisable(prop); - sub_GAME_7F04C044(prop); - sub_GAME_7F040CF0(prop); + objDetach(prop); + objFreeEmbedmentOrProjectile(prop); chrpropReparent(prop, get_curplayer_positiondata()); } } +PropRecord *propFindForInteract(void) +{ + PropRecord **ptr; + s32 i; + bool checkmore = TRUE; + g_InteractProp = NULL; + // Iterate onscreen list near to far + for (ptr = g_LastOnScreenProp - 1; ptr >= g_OnScreenPropList; ptr--) + { + PropRecord *prop = *ptr; + if (prop) + { + if (prop->type == PROP_TYPE_CHR) + { + // empty + } + else if (prop->type == PROP_TYPE_OBJ || prop->type == PROP_TYPE_WEAPON) + { + checkmore = objTestForInteract(prop); + } + else if (prop->type == PROP_TYPE_DOOR) + { + checkmore = doorTestForInteract(prop); + } + else if (prop->type == PROP_TYPE_EXPLOSION) + { + // empty + } + else if (prop->type == PROP_TYPE_SMOKE) + { + // empty + } -#ifdef NONMATCHING -void sub_GAME_7F03C3FC(void) { + if (!checkmore) + { + break; + } + } + } + return g_InteractProp; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03C3FC -/* 070F2C 7F03C3FC 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 070F30 7F03C400 AFB00014 */ sw $s0, 0x14($sp) -/* 070F34 7F03C404 3C108007 */ lui $s0, %hi(g_LastOnScreenProp) -/* 070F38 7F03C408 8E101DF0 */ lw $s0, %lo(g_LastOnScreenProp)($s0) -/* 070F3C 7F03C40C AFB70030 */ sw $s7, 0x30($sp) -/* 070F40 7F03C410 3C178007 */ lui $s7, %hi(g_OnScreenPropList) -/* 070F44 7F03C414 3C018007 */ lui $at, %hi(dword_CODE_bss_80071DF8) -/* 070F48 7F03C418 26F71620 */ addiu $s7, %lo(g_OnScreenPropList) # addiu $s7, $s7, 0x1620 -/* 070F4C 7F03C41C AC201DF8 */ sw $zero, %lo(dword_CODE_bss_80071DF8)($at) -/* 070F50 7F03C420 2610FFFC */ addiu $s0, $s0, -4 -/* 070F54 7F03C424 0217082B */ sltu $at, $s0, $s7 -/* 070F58 7F03C428 AFBF0034 */ sw $ra, 0x34($sp) -/* 070F5C 7F03C42C AFB6002C */ sw $s6, 0x2c($sp) -/* 070F60 7F03C430 AFB50028 */ sw $s5, 0x28($sp) -/* 070F64 7F03C434 AFB40024 */ sw $s4, 0x24($sp) -/* 070F68 7F03C438 AFB30020 */ sw $s3, 0x20($sp) -/* 070F6C 7F03C43C AFB2001C */ sw $s2, 0x1c($sp) -/* 070F70 7F03C440 AFB10018 */ sw $s1, 0x18($sp) -/* 070F74 7F03C444 1420001D */ bnez $at, .L7F03C4BC -/* 070F78 7F03C448 24030001 */ li $v1, 1 -/* 070F7C 7F03C44C 24140002 */ li $s4, 2 -/* 070F80 7F03C450 24130004 */ li $s3, 4 -/* 070F84 7F03C454 24120001 */ li $s2, 1 -/* 070F88 7F03C458 24110003 */ li $s1, 3 -/* 070F8C 7F03C45C 8E040000 */ lw $a0, ($s0) -.L7F03C460: -/* 070F90 7F03C460 50800013 */ beql $a0, $zero, .L7F03C4B0 -/* 070F94 7F03C464 2610FFFC */ addiu $s0, $s0, -4 -/* 070F98 7F03C468 90820000 */ lbu $v0, ($a0) -/* 070F9C 7F03C46C 1222000E */ beq $s1, $v0, .L7F03C4A8 -/* 070FA0 7F03C470 00000000 */ nop -/* 070FA4 7F03C474 12420003 */ beq $s2, $v0, .L7F03C484 -/* 070FA8 7F03C478 00000000 */ nop -/* 070FAC 7F03C47C 16620005 */ bne $s3, $v0, .L7F03C494 -/* 070FB0 7F03C480 00000000 */ nop -.L7F03C484: -/* 070FB4 7F03C484 0FC13BD6 */ jal sub_GAME_7F04EF58 -/* 070FB8 7F03C488 00000000 */ nop -/* 070FBC 7F03C48C 10000006 */ b .L7F03C4A8 -/* 070FC0 7F03C490 00401825 */ move $v1, $v0 -.L7F03C494: -/* 070FC4 7F03C494 16820004 */ bne $s4, $v0, .L7F03C4A8 -/* 070FC8 7F03C498 00000000 */ nop -/* 070FCC 7F03C49C 0FC15601 */ jal sub_GAME_7F055804 -/* 070FD0 7F03C4A0 00000000 */ nop -/* 070FD4 7F03C4A4 00401825 */ move $v1, $v0 -.L7F03C4A8: -/* 070FD8 7F03C4A8 10600004 */ beqz $v1, .L7F03C4BC -/* 070FDC 7F03C4AC 2610FFFC */ addiu $s0, $s0, -4 -.L7F03C4B0: -/* 070FE0 7F03C4B0 0217082B */ sltu $at, $s0, $s7 -/* 070FE4 7F03C4B4 5020FFEA */ beql $at, $zero, .L7F03C460 -/* 070FE8 7F03C4B8 8E040000 */ lw $a0, ($s0) -.L7F03C4BC: -/* 070FEC 7F03C4BC 8FBF0034 */ lw $ra, 0x34($sp) -/* 070FF0 7F03C4C0 3C028007 */ lui $v0, %hi(dword_CODE_bss_80071DF8) -/* 070FF4 7F03C4C4 8C421DF8 */ lw $v0, %lo(dword_CODE_bss_80071DF8)($v0) -/* 070FF8 7F03C4C8 8FB00014 */ lw $s0, 0x14($sp) -/* 070FFC 7F03C4CC 8FB10018 */ lw $s1, 0x18($sp) -/* 071000 7F03C4D0 8FB2001C */ lw $s2, 0x1c($sp) -/* 071004 7F03C4D4 8FB30020 */ lw $s3, 0x20($sp) -/* 071008 7F03C4D8 8FB40024 */ lw $s4, 0x24($sp) -/* 07100C 7F03C4DC 8FB50028 */ lw $s5, 0x28($sp) -/* 071010 7F03C4E0 8FB6002C */ lw $s6, 0x2c($sp) -/* 071014 7F03C4E4 8FB70030 */ lw $s7, 0x30($sp) -/* 071018 7F03C4E8 03E00008 */ jr $ra -/* 07101C 7F03C4EC 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif - +bool bond_interact_object(void) +{ + PropRecord *prop; + bool op; + prop = propFindForInteract(); + op = INV_ITEM_NONE; -#ifdef NONMATCHING -void bond_interact_object(void) { + if (prop) + { + switch (prop->type) + { + case PROP_TYPE_OBJ: + case PROP_TYPE_WEAPON: + op = propobjInteract(prop); + break; + case PROP_TYPE_DOOR: + op = propdoorInteract(prop); + break; + case PROP_TYPE_CHR: + case PROP_TYPE_PLAYER: + case PROP_TYPE_EXPLOSION: + case PROP_TYPE_SMOKE: + break; + } -} -#else -GLOBAL_ASM( -.late_rodata -/*D:80052980*/ -glabel jpt_80052980 -.word loc_CODE_7F03C534 -.word loc_CODE_7F03C544 -.word def_7F03C52C -.word loc_CODE_7F03C534 -.word def_7F03C52C -.word def_7F03C52C -.word def_7F03C52C -.word def_7F03C52C + propExecuteTickOperation(prop, op); -.text -glabel bond_interact_object -/* 071020 7F03C4F0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 071024 7F03C4F4 AFBF0014 */ sw $ra, 0x14($sp) -/* 071028 7F03C4F8 0FC0F0FF */ jal sub_GAME_7F03C3FC -/* 07102C 7F03C4FC 00000000 */ nop -/* 071030 7F03C500 AFA2001C */ sw $v0, 0x1c($sp) -/* 071034 7F03C504 10400016 */ beqz $v0, .L7F03C560 -/* 071038 7F03C508 00002825 */ move $a1, $zero -/* 07103C 7F03C50C 904E0000 */ lbu $t6, ($v0) -/* 071040 7F03C510 25CFFFFF */ addiu $t7, $t6, -1 -/* 071044 7F03C514 2DE10008 */ sltiu $at, $t7, 8 -/* 071048 7F03C518 1020000D */ beqz $at, .L7F03C550 -/* 07104C 7F03C51C 000F7880 */ sll $t7, $t7, 2 -/* 071050 7F03C520 3C018005 */ lui $at, %hi(jpt_80052980) -/* 071054 7F03C524 002F0821 */ addu $at, $at, $t7 -/* 071058 7F03C528 8C2F2980 */ lw $t7, %lo(jpt_80052980)($at) -/* 07105C 7F03C52C 01E00008 */ jr $t7 -/* 071060 7F03C530 00000000 */ nop -loc_CODE_7F03C534: -/* 071064 7F03C534 0FC13C5C */ jal propobjInteract -/* 071068 7F03C538 8FA4001C */ lw $a0, 0x1c($sp) -/* 07106C 7F03C53C 10000004 */ b .L7F03C550 -/* 071070 7F03C540 00402825 */ move $a1, $v0 -loc_CODE_7F03C544: -/* 071074 7F03C544 0FC15710 */ jal sub_GAME_7F055C40 -/* 071078 7F03C548 8FA4001C */ lw $a0, 0x1c($sp) -/* 07107C 7F03C54C 00402825 */ move $a1, $v0 -def_7F03C52C: -.L7F03C550: -/* 071080 7F03C550 0FC0F0AF */ jal sub_GAME_7F03C2BC -/* 071084 7F03C554 8FA4001C */ lw $a0, 0x1c($sp) -/* 071088 7F03C558 10000002 */ b .L7F03C564 -/* 07108C 7F03C55C 00001025 */ move $v0, $zero -.L7F03C560: -/* 071090 7F03C560 24020001 */ li $v0, 1 -.L7F03C564: -/* 071094 7F03C564 8FBF0014 */ lw $ra, 0x14($sp) -/* 071098 7F03C568 27BD0020 */ addiu $sp, $sp, 0x20 -/* 07109C 7F03C56C 03E00008 */ jr $ra -/* 0710A0 7F03C570 00000000 */ nop -) -#endif + return FALSE; + } + return TRUE; +} /* Not quite sure what to name this, it returns true when the given prop isn't within 400 units of any player prop */ @@ -2851,7 +2776,7 @@ s32 sub_GAME_7F03C574(PropRecord* prop) break; } } - + return rc; } @@ -2860,7 +2785,135 @@ s32 sub_GAME_7F03C574(PropRecord* prop) #ifdef NONMATCHING void handle_mp_respawn_and_some_things(void) { - + void *prev_prop;//sp4C + s32 sp38; + s32 sp30; + s32 pad; // sp2C is pad + void *sp28; + s16 prop_time_to_regen; //temp_v0_3 + s16 prop_time_to_regen_2; //temp_v0_4 + s32 var_s2; + s32 var_s3; + s32 var_v1; + u8 prop_type; //temp_v0_2 + void *temp_a0; + void *temp_s0; + ObjectRecord *temp_s0_2; + void *temp_s0_3; + PropRecord *prop; //temp_v0 + void *temp_v0_5; + void *prop_s0; // var_s0 + PropRecord *prop_s1; //var_s1 + + chrlvAllChrTick(); + prop = get_ptr_obj_pos_list_current_entry(); + prop_s1 = prop; + if (prop != NULL) { + do { + var_s2 = 0; + prev_prop = prop_s1->prev; //unk24 + prop_type = prop_s1->type; + if (prop_type == 3) { + temp_s0 = prop_s1->obj; //unk4 + sub_GAME_7F062B00(temp_s0 + 0x180); // function receives ChrRecord_f180 + sub_GAME_7F062B00(temp_s0 + 0x1AC); // function receives ChrRecord_f180 + } else if ((prop_type == PROP_TYPE_OBJ) || (prop_type == PROP_TYPE_WEAPON) || (prop_type == PROP_TYPE_DOOR)) { + prop_time_to_regen = prop_s1->timetoregen; //unk2 + temp_s0_2 = prop_s1->obj; //unk4 + var_s3 = 0; + if (prop_time_to_regen > 0) { + var_v1 = 1; + if (prop_time_to_regen >= 0x3C) { + var_v1 = 0; + } + prop_s1->timetoregen = (s16) (prop_time_to_regen - g_ClockTimer); + if ((prop_s1->timetoregen < 0x3C) && (var_v1 == 0)) { + sp38 = var_v1; + if (sub_GAME_7F03C574(prop_s1) == 0) { + prop_s1->timetoregen = (s16) (prop_s1->timetoregen + 0x3C); + } + } + prop_time_to_regen_2 = prop_s1->timetoregen; + if (prop_time_to_regen_2 <= 0) { + prop_s1->timetoregen = 0; + if (temp_s0_2->state & 0x10) { + temp_s0_2->runtime_bitflags = (s32) (temp_s0_2->runtime_bitflags | 0x1000); + } else { + temp_s0_2->runtime_bitflags = (s32) (temp_s0_2->runtime_bitflags & ~0x1000); + } + } else if ((prop_time_to_regen_2 < 0x3C) && (var_v1 == 0)) { + if ((temp_s0_2->maxdamage == 0.0f) && !(temp_s0_2->state & 0x80)) { + if (temp_s0_2->flags & 0x8000) { + chrpropDeregisterRooms(prop_s1); + chrpropDelist(prop_s1); + temp_s0_2->runtime_bitflags = (s32) (temp_s0_2->runtime_bitflags & ~0x800); + sp30 = setupGetCommandIndexByProp(prop_s1); + pad = (s32) temp_s0_2->pad; + temp_v0_5 = setupCommandGetObject(lvlGetCurrentStageToLoad(), sp30 + pad); + if ((temp_v0_5 != NULL) && (temp_v0_5->prop != 0)) { //unk10 is prop + temp_a0 = temp_s0_2->model; //unk14 + sp28 = temp_v0_5; + modelSetScale(temp_a0, temp_a0->unk14); + chrpropReparent(temp_s0_2->unk10, sp28->unk10); + var_s3 = 1; + } + } else { + chrpropEnable(prop_s1); + sub_GAME_7F03E134(prop_s1); + temp_s0_2->runtime_bitflags = (s32) (temp_s0_2->runtime_bitflags & ~0x800); + } + } else { + if (temp_s0_2->state & 8) { + temp_s0_2->flags = (s32) (temp_s0_2->flags | 0x100); + } else { + temp_s0_2->flags = (s32) (temp_s0_2->flags & ~0x100); + } + temp_s0_2->maxdamage = 0.0f; + temp_s0_2->state = (u8) (temp_s0_2->state & 0xFF7F); + sub_GAME_7F050DE8(temp_s0_2->model); + } + if (temp_s0_2->type == 0x15) { + temp_s0_2->unk84 = (f32) temp_s0_2->unk80; // unk80 and unk84 invalid?? + } + if (var_s3 == 0) { + chrobjSndCreatePostEventDefault(sndPlaySfx(g_musicSfxBufferPtr, 0x52, 0), prop_s1->pos); + } + } + } + if (temp_s0_2->unk3 == 0xD) { // type == unk3 == 0xD ??? invald?? + sub_GAME_7F062B00(prop_s1->unk4->unkCC); // unkCC invalid??, function receives ChrRecord_f180 + // 0x04 is chr, obj, door, weapon + } + } else if (prop_type == PROP_TYPE_EXPLOSION) { + var_s2 = sub_GAME_7F09CEE8(prop_s1); // explosions related + } else if (prop_type == PROP_TYPE_SMOKE) { + var_s2 = sub_GAME_7F09E8AC(prop_s1); // smoke related + } else if (prop_type == PROP_TYPE_VIEWER) { + sub_GAME_7F062B00(*(&g_playerPointers + (getPlayerPointerIndex(prop_s1) * 4)) + 0xA54); // function receives ChrRecord_f180 + sub_GAME_7F062B00(*(&g_playerPointers + (getPlayerPointerIndex(prop_s1) * 4)) + 0xDFC); // function receives ChrRecord_f180 + if ((prop_s1->unk4 != NULL) && (getPlayerCount() >= 2)) { + temp_s0_3 = prop_s1->unk4; + sub_GAME_7F062B00(temp_s0_3 + 0x180); // function receives ChrRecord_f180 + sub_GAME_7F062B00(temp_s0_3 + 0x1AC); // function receives ChrRecord_f180 + } + } + if (var_s2 == 5) { + prop_s0 = prev_prop; + } else { + prop_s0 = prop_s1->prev; + if (var_s2 == 3) { + chrpropDelist(prop_s1); + chrpropActivateThisFrame(prop_s1); + if (prop_s0 == NULL) { + prop_s0 = prop_s1; + } + } else { + propExecuteTickOperation(prop_s1, var_s2); + } + } + prop_s1 = prop_s0; // next prop in list + } while (prop_s0 != NULL); + } } #else @@ -3048,7 +3101,7 @@ glabel handle_mp_respawn_and_some_things /* 071400 7F03C8D0 0C002382 */ jal sndPlaySfx /* 071404 7F03C8D4 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 071408 7F03C8D8 00402025 */ move $a0, $v0 -/* 07140C 7F03C8DC 0FC14E84 */ jal sub_GAME_7F053A10 +/* 07140C 7F03C8DC 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 071410 7F03C8E0 26250008 */ addiu $a1, $s1, 8 .L7F03C8E4: /* 071414 7F03C8E4 92190003 */ lbu $t9, 3($s0) @@ -3081,7 +3134,7 @@ glabel handle_mp_respawn_and_some_things .L7F03C944: /* 071474 7F03C944 5441001F */ bnel $v0, $at, .L7F03C9C4 /* 071478 7F03C948 24010005 */ li $at, 5 -/* 07147C 7F03C94C 0FC26C57 */ jal sub_GAME_7F09B15C +/* 07147C 7F03C94C 0FC26C57 */ jal getPlayerPointerIndex /* 071480 7F03C950 02202025 */ move $a0, $s1 /* 071484 7F03C954 00024080 */ sll $t0, $v0, 2 /* 071488 7F03C958 3C048008 */ lui $a0, %hi(g_playerPointers) @@ -3089,7 +3142,7 @@ glabel handle_mp_respawn_and_some_things /* 071490 7F03C960 8C849EE0 */ lw $a0, %lo(g_playerPointers)($a0) /* 071494 7F03C964 0FC18AC0 */ jal sub_GAME_7F062B00 /* 071498 7F03C968 24840A54 */ addiu $a0, $a0, 0xa54 -/* 07149C 7F03C96C 0FC26C57 */ jal sub_GAME_7F09B15C +/* 07149C 7F03C96C 0FC26C57 */ jal getPlayerPointerIndex /* 0714A0 7F03C970 02202025 */ move $a0, $s1 /* 0714A4 7F03C974 00024880 */ sll $t1, $v0, 2 /* 0714A8 7F03C978 3C048008 */ lui $a0, %hi(g_playerPointers) @@ -3131,7 +3184,7 @@ glabel handle_mp_respawn_and_some_things /* 07152C 7F03C9FC 02208025 */ move $s0, $s1 .L7F03CA00: /* 071530 7F03CA00 02202025 */ move $a0, $s1 -/* 071534 7F03CA04 0FC0F0AF */ jal sub_GAME_7F03C2BC +/* 071534 7F03CA04 0FC0F0AF */ jal propExecuteTickOperation /* 071538 7F03CA08 02402825 */ move $a1, $s2 .L7F03CA0C: /* 07153C 7F03CA0C 1600FF19 */ bnez $s0, .L7F03C674 @@ -3331,7 +3384,7 @@ glabel handle_mp_respawn_and_some_things /* 06F380 7F03C990 0C00209A */ jal sndPlaySfx /* 06F384 7F03C994 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) /* 06F388 7F03C998 00402025 */ move $a0, $v0 -/* 06F38C 7F03C99C 0FC14F3C */ jal sub_GAME_7F053A10 +/* 06F38C 7F03C99C 0FC14F3C */ jal chrobjSndCreatePostEventDefault /* 06F390 7F03C9A0 26250008 */ addiu $a1, $s1, 8 .L7F03C9A4: /* 06F394 7F03C9A4 92190003 */ lbu $t9, 3($s0) @@ -3364,7 +3417,7 @@ glabel handle_mp_respawn_and_some_things .L7F03CA04: /* 06F3F4 7F03CA04 5441001F */ bnel $v0, $at, .L7F03CA84 /* 06F3F8 7F03CA08 24010005 */ li $at, 5 -/* 06F3FC 7F03CA0C 0FC269A7 */ jal sub_GAME_7F09B15C +/* 06F3FC 7F03CA0C 0FC269A7 */ jal getPlayerPointerIndex /* 06F400 7F03CA10 02202025 */ move $a0, $s1 /* 06F404 7F03CA14 00024080 */ sll $t0, $v0, 2 /* 06F408 7F03CA18 3C048007 */ lui $a0, %hi(g_playerPointers) @@ -3372,7 +3425,7 @@ glabel handle_mp_respawn_and_some_things /* 06F410 7F03CA20 8C8489F0 */ lw $a0, %lo(g_playerPointers)($a0) /* 06F414 7F03CA24 0FC18BF1 */ jal sub_GAME_7F062B00 /* 06F418 7F03CA28 24840A4C */ addiu $a0, $a0, 0xa4c -/* 06F41C 7F03CA2C 0FC269A7 */ jal sub_GAME_7F09B15C +/* 06F41C 7F03CA2C 0FC269A7 */ jal getPlayerPointerIndex /* 06F420 7F03CA30 02202025 */ move $a0, $s1 /* 06F424 7F03CA34 00024880 */ sll $t1, $v0, 2 /* 06F428 7F03CA38 3C048007 */ lui $a0, %hi(g_playerPointers) @@ -3414,7 +3467,7 @@ glabel handle_mp_respawn_and_some_things /* 06F4AC 7F03CABC 02208025 */ move $s0, $s1 .L7F03CAC0: /* 06F4B0 7F03CAC0 02202025 */ move $a0, $s1 -/* 06F4B4 7F03CAC4 0FC0F0DF */ jal sub_GAME_7F03C2BC +/* 06F4B4 7F03CAC4 0FC0F0DF */ jal propExecuteTickOperation /* 06F4B8 7F03CAC8 02402825 */ move $a1, $s2 .L7F03CACC: /* 06F4BC 7F03CACC 1600FF19 */ bnez $s0, .L7F03C734 @@ -3517,7 +3570,7 @@ glabel determing_type_of_object_and_detection /* 071658 7F03CB28 10000003 */ b .L7F03CB38 /* 07165C 7F03CB2C 02008825 */ move $s1, $s0 .L7F03CB30: -/* 071660 7F03CB30 0FC0F0AF */ jal sub_GAME_7F03C2BC +/* 071660 7F03CB30 0FC0F0AF */ jal propExecuteTickOperation /* 071664 7F03CB34 02002025 */ move $a0, $s0 .L7F03CB38: /* 071668 7F03CB38 1620FFC7 */ bnez $s1, .L7F03CA58 @@ -3533,7 +3586,7 @@ glabel determing_type_of_object_and_detection /* 07168C 7F03CB5C 00000000 */ nop /* 071690 7F03CB60 0FC0D239 */ jal loop_set_sound_effect_all_slots /* 071694 7F03CB64 00000000 */ nop -/* 071698 7F03CB68 0FC0F93C */ jal sub_GAME_7F03E4F0 +/* 071698 7F03CB68 0FC0F93C */ jal propsDefragRoomProps /* 07169C 7F03CB6C 00000000 */ nop /* 0716A0 7F03CB70 8FBF0024 */ lw $ra, 0x24($sp) .L7F03CB74: @@ -3581,7 +3634,7 @@ void chraiGetPropRoomIds(PropRecord *self, s32 *roomids) { roomids[i] = self->rooms[i]; } - + roomids[i] = -1; } } @@ -3715,7 +3768,7 @@ s32 chrpropTestPointInPolygon(coord3d *point, struct rect4f *polygon, s32 edges) { return 0; } - + if ((ret == 0) && (diff > 0.0f)) { return 0; @@ -3748,7 +3801,7 @@ void chrpropGetCollisionBounds(PropRecord *arg0, f32 *collision_radius, f32 *hei if (arg0->type == PROP_TYPE_VIEWER) { - bondviewCollisionRadiusRelated(arg0, collision_radius, height, arg3); + bondviewGetCollisionRadius(arg0, collision_radius, height, arg3); return; } @@ -3770,7 +3823,7 @@ f32 sub_GAME_7F03CFE8(PropRecord *arg0) if (arg0->type == PROP_TYPE_VIEWER) { - return bondviewGetPlayerStanHeight(g_playerPointers[sub_GAME_7F09B15C(arg0)]); + return bondviewGetPlayerStanHeight(g_playerPointers[getPlayerPointerIndex(arg0)]); } return 0.0f; @@ -3785,7 +3838,7 @@ void sub_GAME_7F03D058(PropRecord *prop, bool unset) //#MATCH { if (prop->type == PROP_TYPE_CHR) { - set_or_unset_GUARDdata_flag(prop->chr, unset); + chrSetMoving(prop->chr, unset); } else if (prop->type == PROP_TYPE_VIEWER) { @@ -3862,7 +3915,7 @@ glabel sub_GAME_7F03D0D4 .L7F03D160: /* 071C90 7F03D160 8E300024 */ lw $s0, 0x24($s1) .L7F03D164: -/* 071C94 7F03D164 0FC0F0AF */ jal sub_GAME_7F03C2BC +/* 071C94 7F03D164 0FC0F0AF */ jal propExecuteTickOperation /* 071C98 7F03D168 02202025 */ move $a0, $s1 /* 071C9C 7F03D16C 1600FFE7 */ bnez $s0, .L7F03D10C /* 071CA0 7F03D170 02008825 */ move $s1, $s0 @@ -3959,7 +4012,7 @@ f32 sub_GAME_7F03D188(PropRecord *prop, coord3d *arg1, f32 *arg2, f32 *arg3, f32 ducking_height_related = bondviewGetPlayerDuckingHeightRelated(g_CurrentPlayer); bondviewUpdateGuardTankFlagsRelated(playerprop, FALSE); - if ((sub_GAME_7F0B0E24(&stan, playerprop->pos.f[0], playerprop->pos.f[2], prop->pos.f[0], prop->pos.f[2], 0x13, ducking_height_related, ducking_height_related, 0.0f, 1.0f) != 0)) + if ((stanTestLineUnobstructed(&stan, playerprop->pos.f[0], playerprop->pos.f[2], prop->pos.f[0], prop->pos.f[2], 0x13, ducking_height_related, ducking_height_related, 0.0f, 1.0f) != 0)) { if (stan == prop->stan) { @@ -4016,195 +4069,116 @@ f32 sub_GAME_7F03D188(PropRecord *prop, coord3d *arg1, f32 *arg2, f32 *arg3, f32 } -#ifdef NONMATCHING -void sub_GAME_7F03D78C(void) { +/** + * Iterates on screen props to find autoaim target. + * + * US address 7F03D78C. +*/ +void chrpropUpdateAutoaimTarget(void) +{ + f32 var_f20; + struct coord2d sp9C; + f32 var_f0; + struct PropRecord **pprop_iter; + struct coord3d sp88; + struct coord2d sp80; + struct coord2d sp78; + struct PropRecord *prop; + struct coord2d sp6C; + struct PropRecord *winning_prop; + struct ChrRecord *chr; + + winning_prop = NULL; + sp9C = g_DefaultAutoAimCoord; + + if (redirect_get_BONDdata_autoaim_y() != 0) + { + var_f20 = -1.0f; + + for (pprop_iter = g_LastOnScreenProp - 1; pprop_iter >= &g_OnScreenPropList[0]; pprop_iter--) + { + prop = *pprop_iter; + + if (prop == NULL) + { + continue; + } + + if ((prop->type != PROP_TYPE_CHR) + && ((prop->type != PROP_TYPE_VIEWER) + || (prop->obj == NULL) + || (getPlayerPointerIndex(prop) == get_cur_playernum()))) + { + continue; + } + + chr = prop->chr; + + if (((chrGetEquippedWeaponProp(chr, GUNRIGHT) == 0) && (chrGetEquippedWeaponProp(chr, GUNLEFT) == 0))) + { + continue; + } + if ((sub_GAME_7F023194(prop, &sp88, &sp80, &sp78) == 0)) + { + continue; + } + + var_f0 = sub_GAME_7F03D188(prop, &sp88, &sp80.x, &sp78.x, &sp6C.x); + + if (var_f20 < var_f0) + { + var_f20 = var_f0; + + winning_prop = prop; + sp9C.x = sp6C.x; + sp9C.y = sp6C.y; + + if (1.0f <= var_f0) + { + break; + } + } + } + } + + if (winning_prop != NULL) + { + if (sp9C.x > 1.0f); + + bondviewUpdateYAutoAimTime(winning_prop, ((sp9C.y - getPlayer_c_screentop()) / (getPlayer_c_screenheight() * 0.5f)) - 1.0f); + + if (redirect_get_BONDdata_autoaim_x() != 0) + { + bondviewUpdateXAutoAimTime(winning_prop, ((sp9C.x - getPlayer_c_screenleft()) / (getPlayer_c_screenwidth() * 0.5f)) - 1.0f); + } + } + else + { + bondviewUpdateYAutoAimTime(NULL, 0.0f); + bondviewUpdateXAutoAimTime(NULL, 0.0f); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03D78C -/* 0722BC 7F03D78C 27BDFF58 */ addiu $sp, $sp, -0xa8 -/* 0722C0 7F03D790 3C0F8003 */ lui $t7, %hi(D_80030AB0) -/* 0722C4 7F03D794 AFBF004C */ sw $ra, 0x4c($sp) -/* 0722C8 7F03D798 AFB60048 */ sw $s6, 0x48($sp) -/* 0722CC 7F03D79C AFB50044 */ sw $s5, 0x44($sp) -/* 0722D0 7F03D7A0 AFB40040 */ sw $s4, 0x40($sp) -/* 0722D4 7F03D7A4 AFB3003C */ sw $s3, 0x3c($sp) -/* 0722D8 7F03D7A8 AFB20038 */ sw $s2, 0x38($sp) -/* 0722DC 7F03D7AC AFB10034 */ sw $s1, 0x34($sp) -/* 0722E0 7F03D7B0 AFB00030 */ sw $s0, 0x30($sp) -/* 0722E4 7F03D7B4 F7B60028 */ sdc1 $f22, 0x28($sp) -/* 0722E8 7F03D7B8 F7B40020 */ sdc1 $f20, 0x20($sp) -/* 0722EC 7F03D7BC 25EF0AB0 */ addiu $t7, %lo(D_80030AB0) # addiu $t7, $t7, 0xab0 -/* 0722F0 7F03D7C0 8DE10000 */ lw $at, ($t7) -/* 0722F4 7F03D7C4 8DE80004 */ lw $t0, 4($t7) -/* 0722F8 7F03D7C8 27AE009C */ addiu $t6, $sp, 0x9c -/* 0722FC 7F03D7CC 0000B025 */ move $s6, $zero -/* 072300 7F03D7D0 ADC10000 */ sw $at, ($t6) -/* 072304 7F03D7D4 0FC1F170 */ jal redirect_get_BONDdata_autoaim_y -/* 072308 7F03D7D8 ADC80004 */ sw $t0, 4($t6) -/* 07230C 7F03D7DC 10400047 */ beqz $v0, .L7F03D8FC -/* 072310 7F03D7E0 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 072314 7F03D7E4 3C128007 */ lui $s2, %hi(g_LastOnScreenProp) -/* 072318 7F03D7E8 8E521DF0 */ lw $s2, %lo(g_LastOnScreenProp)($s2) -/* 07231C 7F03D7EC 3C098007 */ lui $t1, %hi(g_OnScreenPropList) -/* 072320 7F03D7F0 4481A000 */ mtc1 $at, $f20 -/* 072324 7F03D7F4 25291620 */ addiu $t1, %lo(g_OnScreenPropList) # addiu $t1, $t1, 0x1620 -/* 072328 7F03D7F8 2652FFFC */ addiu $s2, $s2, -4 -/* 07232C 7F03D7FC 0249082B */ sltu $at, $s2, $t1 -/* 072330 7F03D800 1420003E */ bnez $at, .L7F03D8FC -/* 072334 7F03D804 27B50078 */ addiu $s5, $sp, 0x78 -/* 072338 7F03D808 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 07233C 7F03D80C 4481B000 */ mtc1 $at, $f22 -/* 072340 7F03D810 27B40080 */ addiu $s4, $sp, 0x80 -/* 072344 7F03D814 27B30088 */ addiu $s3, $sp, 0x88 -/* 072348 7F03D818 8E500000 */ lw $s0, ($s2) -.L7F03D81C: -/* 07234C 7F03D81C 12000031 */ beqz $s0, .L7F03D8E4 -/* 072350 7F03D820 00000000 */ nop -/* 072354 7F03D824 92020000 */ lbu $v0, ($s0) -/* 072358 7F03D828 24010003 */ li $at, 3 -/* 07235C 7F03D82C 1041000C */ beq $v0, $at, .L7F03D860 -/* 072360 7F03D830 24010006 */ li $at, 6 -/* 072364 7F03D834 1441002B */ bne $v0, $at, .L7F03D8E4 -/* 072368 7F03D838 00000000 */ nop -/* 07236C 7F03D83C 8E0A0004 */ lw $t2, 4($s0) -/* 072370 7F03D840 11400028 */ beqz $t2, .L7F03D8E4 -/* 072374 7F03D844 00000000 */ nop -/* 072378 7F03D848 0FC26C57 */ jal sub_GAME_7F09B15C -/* 07237C 7F03D84C 02002025 */ move $a0, $s0 -/* 072380 7F03D850 0FC26C54 */ jal get_cur_playernum -/* 072384 7F03D854 00408825 */ move $s1, $v0 -/* 072388 7F03D858 10510022 */ beq $v0, $s1, .L7F03D8E4 -/* 07238C 7F03D85C 00000000 */ nop -.L7F03D860: -/* 072390 7F03D860 8E110004 */ lw $s1, 4($s0) -/* 072394 7F03D864 00002825 */ move $a1, $zero -/* 072398 7F03D868 0FC08C0B */ jal chrGetEquippedWeaponProp -/* 07239C 7F03D86C 02202025 */ move $a0, $s1 -/* 0723A0 7F03D870 14400004 */ bnez $v0, .L7F03D884 -/* 0723A4 7F03D874 02202025 */ move $a0, $s1 -/* 0723A8 7F03D878 0FC08C0B */ jal chrGetEquippedWeaponProp -/* 0723AC 7F03D87C 24050001 */ li $a1, 1 -/* 0723B0 7F03D880 10400018 */ beqz $v0, .L7F03D8E4 -.L7F03D884: -/* 0723B4 7F03D884 02002025 */ move $a0, $s0 -/* 0723B8 7F03D888 02602825 */ move $a1, $s3 -/* 0723BC 7F03D88C 02803025 */ move $a2, $s4 -/* 0723C0 7F03D890 0FC08C65 */ jal sub_GAME_7F023194 -/* 0723C4 7F03D894 02A03825 */ move $a3, $s5 -/* 0723C8 7F03D898 10400012 */ beqz $v0, .L7F03D8E4 -/* 0723CC 7F03D89C 02002025 */ move $a0, $s0 -/* 0723D0 7F03D8A0 27AB006C */ addiu $t3, $sp, 0x6c -/* 0723D4 7F03D8A4 AFAB0010 */ sw $t3, 0x10($sp) -/* 0723D8 7F03D8A8 02602825 */ move $a1, $s3 -/* 0723DC 7F03D8AC 02803025 */ move $a2, $s4 -/* 0723E0 7F03D8B0 0FC0F462 */ jal sub_GAME_7F03D188 -/* 0723E4 7F03D8B4 02A03825 */ move $a3, $s5 -/* 0723E8 7F03D8B8 4600A03C */ c.lt.s $f20, $f0 -/* 0723EC 7F03D8BC C7A4006C */ lwc1 $f4, 0x6c($sp) -/* 0723F0 7F03D8C0 45000008 */ bc1f .L7F03D8E4 -/* 0723F4 7F03D8C4 00000000 */ nop -/* 0723F8 7F03D8C8 4600B03E */ c.le.s $f22, $f0 -/* 0723FC 7F03D8CC C7A60070 */ lwc1 $f6, 0x70($sp) -/* 072400 7F03D8D0 46000506 */ mov.s $f20, $f0 -/* 072404 7F03D8D4 0200B025 */ move $s6, $s0 -/* 072408 7F03D8D8 E7A4009C */ swc1 $f4, 0x9c($sp) -/* 07240C 7F03D8DC 45010007 */ bc1t .L7F03D8FC -/* 072410 7F03D8E0 E7A600A0 */ swc1 $f6, 0xa0($sp) -.L7F03D8E4: -/* 072414 7F03D8E4 3C0C8007 */ lui $t4, %hi(g_OnScreenPropList) -/* 072418 7F03D8E8 258C1620 */ addiu $t4, %lo(g_OnScreenPropList) # addiu $t4, $t4, 0x1620 -/* 07241C 7F03D8EC 2652FFFC */ addiu $s2, $s2, -4 -/* 072420 7F03D8F0 024C082B */ sltu $at, $s2, $t4 -/* 072424 7F03D8F4 5020FFC9 */ beql $at, $zero, .L7F03D81C -/* 072428 7F03D8F8 8E500000 */ lw $s0, ($s2) -.L7F03D8FC: -/* 07242C 7F03D8FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 072430 7F03D900 4481B000 */ mtc1 $at, $f22 -/* 072434 7F03D904 52C00026 */ beql $s6, $zero, .L7F03D9A0 -/* 072438 7F03D908 4480A000 */ mtc1 $zero, $f20 -/* 07243C 7F03D90C 0FC1E135 */ jal getPlayer_c_screentop -/* 072440 7F03D910 00000000 */ nop -/* 072444 7F03D914 0FC1E12D */ jal getPlayer_c_screenheight -/* 072448 7F03D918 46000506 */ mov.s $f20, $f0 -/* 07244C 7F03D91C 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 072450 7F03D920 44818000 */ mtc1 $at, $f16 -/* 072454 7F03D924 C7A800A0 */ lwc1 $f8, 0xa0($sp) -/* 072458 7F03D928 02C02025 */ move $a0, $s6 -/* 07245C 7F03D92C 46100482 */ mul.s $f18, $f0, $f16 -/* 072460 7F03D930 46144281 */ sub.s $f10, $f8, $f20 -/* 072464 7F03D934 46125103 */ div.s $f4, $f10, $f18 -/* 072468 7F03D938 46162181 */ sub.s $f6, $f4, $f22 -/* 07246C 7F03D93C 44053000 */ mfc1 $a1, $f6 -/* 072470 7F03D940 0FC1F17C */ jal bondviewUpdateYAutoAimTime -/* 072474 7F03D944 00000000 */ nop -/* 072478 7F03D948 0FC1F1AA */ jal redirect_get_BONDdata_autoaim_x -/* 07247C 7F03D94C 00000000 */ nop -/* 072480 7F03D950 5040001B */ beql $v0, $zero, .L7F03D9C0 -/* 072484 7F03D954 8FBF004C */ lw $ra, 0x4c($sp) -/* 072488 7F03D958 0FC1E131 */ jal getPlayer_c_screenleft -/* 07248C 7F03D95C 00000000 */ nop -/* 072490 7F03D960 0FC1E129 */ jal getPlayer_c_screenwidth -/* 072494 7F03D964 46000506 */ mov.s $f20, $f0 -/* 072498 7F03D968 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 07249C 7F03D96C 44815000 */ mtc1 $at, $f10 -/* 0724A0 7F03D970 C7A8009C */ lwc1 $f8, 0x9c($sp) -/* 0724A4 7F03D974 02C02025 */ move $a0, $s6 -/* 0724A8 7F03D978 460A0482 */ mul.s $f18, $f0, $f10 -/* 0724AC 7F03D97C 46144401 */ sub.s $f16, $f8, $f20 -/* 0724B0 7F03D980 46128103 */ div.s $f4, $f16, $f18 -/* 0724B4 7F03D984 46162181 */ sub.s $f6, $f4, $f22 -/* 0724B8 7F03D988 44053000 */ mfc1 $a1, $f6 -/* 0724BC 7F03D98C 0FC1F1B2 */ jal bondviewUpdateXAutoAimTime -/* 0724C0 7F03D990 00000000 */ nop -/* 0724C4 7F03D994 1000000A */ b .L7F03D9C0 -/* 0724C8 7F03D998 8FBF004C */ lw $ra, 0x4c($sp) -/* 0724CC 7F03D99C 4480A000 */ mtc1 $zero, $f20 -.L7F03D9A0: -/* 0724D0 7F03D9A0 00002025 */ move $a0, $zero -/* 0724D4 7F03D9A4 4405A000 */ mfc1 $a1, $f20 -/* 0724D8 7F03D9A8 0FC1F17C */ jal bondviewUpdateYAutoAimTime -/* 0724DC 7F03D9AC 00000000 */ nop -/* 0724E0 7F03D9B0 4405A000 */ mfc1 $a1, $f20 -/* 0724E4 7F03D9B4 0FC1F1B2 */ jal bondviewUpdateXAutoAimTime -/* 0724E8 7F03D9B8 00002025 */ move $a0, $zero -/* 0724EC 7F03D9BC 8FBF004C */ lw $ra, 0x4c($sp) -.L7F03D9C0: -/* 0724F0 7F03D9C0 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 0724F4 7F03D9C4 D7B60028 */ ldc1 $f22, 0x28($sp) -/* 0724F8 7F03D9C8 8FB00030 */ lw $s0, 0x30($sp) -/* 0724FC 7F03D9CC 8FB10034 */ lw $s1, 0x34($sp) -/* 072500 7F03D9D0 8FB20038 */ lw $s2, 0x38($sp) -/* 072504 7F03D9D4 8FB3003C */ lw $s3, 0x3c($sp) -/* 072508 7F03D9D8 8FB40040 */ lw $s4, 0x40($sp) -/* 07250C 7F03D9DC 8FB50044 */ lw $s5, 0x44($sp) -/* 072510 7F03D9E0 8FB60048 */ lw $s6, 0x48($sp) -/* 072514 7F03D9E4 03E00008 */ jr $ra -/* 072518 7F03D9E8 27BD00A8 */ addiu $sp, $sp, 0xa8 -) -#endif -s32 sub_GAME_7F03D9EC(PropRecord* arg0) +s32 propDoorGetCdTypes(PropRecord* arg0) { s32 var_v1; if (arg0->door->openPosition <= 0.0f) { - var_v1 = 0x1000; + var_v1 = CDTYPE_CLOSEDDOORS; } else { var_v1 = (arg0->door->maxFrac <= arg0->door->openPosition) - ? 0x2000 - : 0x4000; + ? CDTYPE_OPENDOORS + : CDTYPE_AJARDOORS; } if (((s32)arg0->door->flags2 * 4) < 0) { - var_v1 |= 0x8000; + var_v1 |= CDTYPE_DOORSLOCKEDTOAI; } return var_v1; @@ -4238,7 +4212,7 @@ glabel sub_GAME_7F03DA50 /* 0725BC 7F03DA8C 57200034 */ bnezl $t9, .L7F03DB60 /* 0725C0 7F03DA90 8FBF0014 */ lw $ra, 0x14($sp) /* 0725C4 7F03DA94 AFA50024 */ sw $a1, 0x24($sp) -/* 0725C8 7F03DA98 0FC0F67B */ jal sub_GAME_7F03D9EC +/* 0725C8 7F03DA98 0FC0F67B */ jal propDoorGetCdTypes /* 0725CC 7F03DA9C AFA6001C */ sw $a2, 0x1c($sp) /* 0725D0 7F03DAA0 8FA50024 */ lw $a1, 0x24($sp) /* 0725D4 7F03DAA4 8FA6001C */ lw $a2, 0x1c($sp) @@ -4344,8 +4318,8 @@ void sub_GAME_7F03DBCC(void) { GLOBAL_ASM( .text glabel sub_GAME_7F03DBCC -/* 0726FC 7F03DBCC 3C0F8007 */ lui $t7, %hi(dword_CODE_bss_8007161C) -/* 072700 7F03DBD0 8DEF161C */ lw $t7, %lo(dword_CODE_bss_8007161C)($t7) +/* 0726FC 7F03DBCC 3C0F8007 */ lui $t7, %hi(RoomPropListChunks) +/* 072700 7F03DBD0 8DEF161C */ lw $t7, %lo(RoomPropListChunks)($t7) /* 072704 7F03DBD4 0005C140 */ sll $t8, $a1, 5 /* 072708 7F03DBD8 AFA40000 */ sw $a0, ($sp) /* 07270C 7F03DBDC 01F81821 */ addu $v1, $t7, $t8 @@ -4433,8 +4407,8 @@ GLOBAL_ASM( .text glabel sub_GAME_7F03DCB8 /* 0727E8 7F03DCB8 00803025 */ move $a2, $a0 -/* 0727EC 7F03DCBC 3C028007 */ lui $v0, %hi(dword_CODE_bss_8007161C) -/* 0727F0 7F03DCC0 8C42161C */ lw $v0, %lo(dword_CODE_bss_8007161C)($v0) +/* 0727EC 7F03DCBC 3C028007 */ lui $v0, %hi(RoomPropListChunks) +/* 0727F0 7F03DCC0 8C42161C */ lw $v0, %lo(RoomPropListChunks)($v0) /* 0727F4 7F03DCC4 2404FFFE */ li $a0, -2 /* 0727F8 7F03DCC8 00001825 */ move $v1, $zero /* 0727FC 7F03DCCC 24070100 */ li $a3, 256 @@ -4442,8 +4416,8 @@ glabel sub_GAME_7F03DCB8 /* 072800 7F03DCD0 844E0000 */ lh $t6, ($v0) /* 072804 7F03DCD4 548E002C */ bnel $a0, $t6, .L7F03DD88 /* 072808 7F03DCD8 24630001 */ addiu $v1, $v1, 1 -/* 07280C 7F03DCDC 3C028007 */ lui $v0, %hi(dword_CODE_bss_8007161C) -/* 072810 7F03DCE0 2442161C */ addiu $v0, %lo(dword_CODE_bss_8007161C) # addiu $v0, $v0, 0x161c +/* 07280C 7F03DCDC 3C028007 */ lui $v0, %hi(RoomPropListChunks) +/* 072810 7F03DCE0 2442161C */ addiu $v0, %lo(RoomPropListChunks) # addiu $v0, $v0, 0x161c /* 072814 7F03DCE4 00002025 */ move $a0, $zero /* 072818 7F03DCE8 24080020 */ li $t0, 32 /* 07281C 7F03DCEC 2407FFFF */ li $a3, -1 @@ -4480,8 +4454,8 @@ glabel sub_GAME_7F03DCB8 /* 072894 7F03DD64 A5E3001E */ sh $v1, 0x1e($t7) .L7F03DD68: -/* 072898 7F03DD68 3C188007 */ lui $t8, %hi(ptr_room_lookup_buffer_maybe) -/* 07289C 7F03DD6C 8F181618 */ lw $t8, %lo(ptr_room_lookup_buffer_maybe)($t8) +/* 072898 7F03DD68 3C188007 */ lui $t8, %hi(RoomPropListChunkIndexes) +/* 07289C 7F03DD6C 8F181618 */ lw $t8, %lo(RoomPropListChunkIndexes)($t8) /* 0728A0 7F03DD70 0006C840 */ sll $t9, $a2, 1 /* 0728A4 7F03DD74 03194821 */ addu $t1, $t8, $t9 /* 0728A8 7F03DD78 A5230000 */ sh $v1, ($t1) @@ -4516,14 +4490,14 @@ void chrpropRegisterRoom(PropRecord *arg0, s16 arg1) phi_a2_2 = -1; if (arg1 >= 0) { - temp_s0 = *(ptr_room_lookup_buffer_maybe + (arg1 * 2)); + temp_s0 = *(RoomPropListChunkIndexes + (arg1 * 2)); phi_s0 = temp_s0; if (temp_s0 >= 0) { loop_3: if (sub_GAME_7F03DBCC((arg0 - pos_data_entry) / 52, phi_s0, phi_a2) == 0) { - temp_s0_2 = (dword_CODE_bss_8007161C + (phi_s0 << 5))->unk1E; + temp_s0_2 = (RoomPropListChunks + (phi_s0 << 5))->unk1E; phi_s0 = temp_s0_2; phi_a2 = phi_s0; phi_a2_2 = phi_s0; @@ -4561,8 +4535,8 @@ glabel chrpropRegisterRoom /* 0728EC 7F03DDBC 05C0002F */ bltz $t6, .L7F03DE7C /* 0728F0 7F03DDC0 2406FFFF */ li $a2, -1 /* 0728F4 7F03DDC4 87B8002E */ lh $t8, 0x2e($sp) -/* 0728F8 7F03DDC8 3C0F8007 */ lui $t7, %hi(ptr_room_lookup_buffer_maybe) -/* 0728FC 7F03DDCC 8DEF1618 */ lw $t7, %lo(ptr_room_lookup_buffer_maybe)($t7) +/* 0728F8 7F03DDC8 3C0F8007 */ lui $t7, %hi(RoomPropListChunkIndexes) +/* 0728FC 7F03DDCC 8DEF1618 */ lw $t7, %lo(RoomPropListChunkIndexes)($t7) /* 072900 7F03DDD0 0018C840 */ sll $t9, $t8, 1 /* 072904 7F03DDD4 3C0A8007 */ lui $t2, %hi(pos_data_entry) /* 072908 7F03DDD8 01F94021 */ addu $t0, $t7, $t9 @@ -4574,8 +4548,8 @@ glabel chrpropRegisterRoom /* 072920 7F03DDF0 0221001A */ div $zero, $s1, $at /* 072924 7F03DDF4 00005812 */ mflo $t3 /* 072928 7F03DDF8 000B6400 */ sll $t4, $t3, 0x10 -/* 07292C 7F03DDFC 3C128007 */ lui $s2, %hi(dword_CODE_bss_8007161C) -/* 072930 7F03DE00 2652161C */ addiu $s2, %lo(dword_CODE_bss_8007161C) # addiu $s2, $s2, 0x161c +/* 07292C 7F03DDFC 3C128007 */ lui $s2, %hi(RoomPropListChunks) +/* 072930 7F03DE00 2652161C */ addiu $s2, %lo(RoomPropListChunks) # addiu $s2, $s2, 0x161c /* 072934 7F03DE04 000C8C03 */ sra $s1, $t4, 0x10 /* 072938 7F03DE08 00112400 */ sll $a0, $s1, 0x10 .L7F03DE0C: @@ -4667,12 +4641,12 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (arg1 >= 0) { temp_t2 = arg1 * 2; - temp_v1 = *(ptr_room_lookup_buffer_maybe + temp_t2); + temp_v1 = *(RoomPropListChunkIndexes + temp_t2); phi_v1 = temp_v1; if (temp_v1 >= 0) { temp_lo = (arg0 - pos_data_entry) / 52; - phi_t5 = dword_CODE_bss_8007161C; + phi_t5 = RoomPropListChunks; loop_3: temp_s0 = phi_t5 + (phi_v1 << 5); temp_s1 = *temp_s0; @@ -4681,7 +4655,7 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (temp_lo == temp_s1) { *temp_s0 = -1; - phi_s0 = dword_CODE_bss_8007161C + (phi_v1 << 5); + phi_s0 = RoomPropListChunks + (phi_v1 << 5); phi_a2 = 1; } else if (temp_s1 >= 0) @@ -4694,7 +4668,7 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (temp_lo == temp_t5) { phi_s0->unk2 = -1; - phi_s0_2 = dword_CODE_bss_8007161C + (phi_v1 << 5); + phi_s0_2 = RoomPropListChunks + (phi_v1 << 5); phi_a2 = 1; } else if ((phi_v0 == 0) && (temp_t5 >= 0)) @@ -4715,14 +4689,14 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) phi_s0_3 = 6; do { - temp_t5_3 = dword_CODE_bss_8007161C + (phi_v1 << 5) + phi_s0_3; + temp_t5_3 = RoomPropListChunks + (phi_v1 << 5) + phi_s0_3; temp_s1_2 = *temp_t5_3; phi_t5_2 = temp_t5_3; phi_v0_4 = phi_v0_3; if (temp_lo == temp_s1_2) { *temp_t5_3 = -1; - phi_t5_2 = dword_CODE_bss_8007161C + (phi_v1 << 5) + phi_s0_3; + phi_t5_2 = RoomPropListChunks + (phi_v1 << 5) + phi_s0_3; phi_a2 = 1; } else if ((phi_v0_3 == 0) && (temp_s1_2 >= 0)) @@ -4735,7 +4709,7 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (temp_lo == temp_s1_3) { phi_t5_2->unk2 = -1; - phi_t5_3 = dword_CODE_bss_8007161C + (phi_v1 << 5) + phi_s0_3; + phi_t5_3 = RoomPropListChunks + (phi_v1 << 5) + phi_s0_3; phi_a2 = 1; } else if ((phi_v0_4 == 0) && (temp_s1_3 >= 0)) @@ -4748,7 +4722,7 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (temp_lo == temp_s1_4) { phi_t5_3->unk4 = -1; - phi_t5_4 = dword_CODE_bss_8007161C + (phi_v1 << 5) + phi_s0_3; + phi_t5_4 = RoomPropListChunks + (phi_v1 << 5) + phi_s0_3; phi_a2 = 1; } else if ((phi_v0_5 == 0) && (temp_s1_4 >= 0)) @@ -4773,15 +4747,15 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) if (phi_v0_7 == 0) { temp_v0 = phi_v1 << 5; - *(dword_CODE_bss_8007161C + temp_v0) = -2; + *(RoomPropListChunks + temp_v0) = -2; if (phi_t1 >= 0) { - temp_t5_4 = dword_CODE_bss_8007161C; + temp_t5_4 = RoomPropListChunks; (temp_t5_4 + (phi_t1 << 5))->unk1E = (temp_t5_4 + temp_v0)->unk1E; } else { - *(ptr_room_lookup_buffer_maybe + temp_t2) = (dword_CODE_bss_8007161C + temp_v0)->unk1E; + *(RoomPropListChunkIndexes + temp_t2) = (RoomPropListChunks + temp_v0)->unk1E; } } else @@ -4790,7 +4764,7 @@ void chrpropDeregisterRoom(PropRecord *arg0, s16 arg1) } if (phi_a2 == 0) { - temp_t5_5 = dword_CODE_bss_8007161C; + temp_t5_5 = RoomPropListChunks; temp_v1_2 = (temp_t5_5 + (phi_v1 << 5))->unk1E; phi_t5 = temp_t5_5; phi_v1 = temp_v1_2; @@ -4817,8 +4791,8 @@ glabel chrpropDeregisterRoom /* 0729DC 7F03DEAC 00003025 */ move $a2, $zero /* 0729E0 7F03DEB0 05E0009C */ bltz $t7, .L7F03E124 /* 0729E4 7F03DEB4 2409FFFF */ li $t1, -1 -/* 0729E8 7F03DEB8 3C0B8007 */ lui $t3, %hi(ptr_room_lookup_buffer_maybe) -/* 0729EC 7F03DEBC 256B1618 */ addiu $t3, %lo(ptr_room_lookup_buffer_maybe) # addiu $t3, $t3, 0x1618 +/* 0729E8 7F03DEB8 3C0B8007 */ lui $t3, %hi(RoomPropListChunkIndexes) +/* 0729EC 7F03DEBC 256B1618 */ addiu $t3, %lo(RoomPropListChunkIndexes) # addiu $t3, $t3, 0x1618 /* 0729F0 7F03DEC0 8D780000 */ lw $t8, ($t3) /* 0729F4 7F03DEC4 000F5040 */ sll $t2, $t7, 1 /* 0729F8 7F03DEC8 3C0E8007 */ lui $t6, %hi(pos_data_entry) @@ -4827,15 +4801,15 @@ glabel chrpropDeregisterRoom /* 072A04 7F03DED4 25CE9C38 */ addiu $t6, %lo(pos_data_entry) # addiu $t6, $t6, -0x63c8 /* 072A08 7F03DED8 008E2023 */ subu $a0, $a0, $t6 /* 072A0C 7F03DEDC 04600091 */ bltz $v1, .L7F03E124 -/* 072A10 7F03DEE0 3C0D8007 */ lui $t5, %hi(dword_CODE_bss_8007161C) +/* 072A10 7F03DEE0 3C0D8007 */ lui $t5, %hi(RoomPropListChunks) /* 072A14 7F03DEE4 24010034 */ li $at, 52 /* 072A18 7F03DEE8 0081001A */ div $zero, $a0, $at /* 072A1C 7F03DEEC 00007812 */ mflo $t7 /* 072A20 7F03DEF0 000FC400 */ sll $t8, $t7, 0x10 -/* 072A24 7F03DEF4 3C078007 */ lui $a3, %hi(dword_CODE_bss_8007161C) -/* 072A28 7F03DEF8 24E7161C */ addiu $a3, %lo(dword_CODE_bss_8007161C) # addiu $a3, $a3, 0x161c +/* 072A24 7F03DEF4 3C078007 */ lui $a3, %hi(RoomPropListChunks) +/* 072A28 7F03DEF8 24E7161C */ addiu $a3, %lo(RoomPropListChunks) # addiu $a3, $a3, 0x161c /* 072A2C 7F03DEFC 00182403 */ sra $a0, $t8, 0x10 -/* 072A30 7F03DF00 8DAD161C */ lw $t5, %lo(dword_CODE_bss_8007161C)($t5) +/* 072A30 7F03DF00 8DAD161C */ lw $t5, %lo(RoomPropListChunks)($t5) /* 072A34 7F03DF04 240CFFFE */ li $t4, -2 /* 072A38 7F03DF08 2408001E */ li $t0, 30 /* 072A3C 7F03DF0C 2405FFFF */ li $a1, -1 @@ -5178,243 +5152,143 @@ glabel sub_GAME_7F03E27C #endif - - - -#ifdef NONMATCHING /** - * Iterate ptr_list_object_lookup_indices based on arg0 and update num_obj_position_data_entries. - * Address 0x7F03E3FC. - * @param arg0: (probably) array of s16 -*/ -void sub_GAME_7F03E3FC(s16 *arg0) + * Given a list of rooms (terminated by -1), populate the propnums + * list based on which props are in any of those rooms. + * PD: roomGetProps + */ +void roomGetProps(s32 *rooms) { + s16 *writeptr = ptr_list_object_lookup_indices; + s32 room; + s32 i; + s32 j; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03E3FC -/* 072F2C 7F03E3FC 8C830000 */ lw $v1, ($a0) -/* 072F30 7F03E400 3C098007 */ lui $t1, %hi(ptr_list_object_lookup_indices) -/* 072F34 7F03E404 25299C30 */ addiu $t1, %lo(ptr_list_object_lookup_indices) # addiu $t1, $t1, -0x63d0 -/* 072F38 7F03E408 04600030 */ bltz $v1, .L7F03E4CC -/* 072F3C 7F03E40C 8D220000 */ lw $v0, ($t1) -/* 072F40 7F03E410 3C0A8007 */ lui $t2, %hi(ptr_room_lookup_buffer_maybe) -/* 072F44 7F03E414 254A1618 */ addiu $t2, %lo(ptr_room_lookup_buffer_maybe) # addiu $t2, $t2, 0x1618 -/* 072F48 7F03E418 240B001E */ li $t3, 30 -/* 072F4C 7F03E41C 8D4E0000 */ lw $t6, ($t2) -.L7F03E420: -/* 072F50 7F03E420 00037840 */ sll $t7, $v1, 1 -/* 072F54 7F03E424 3C068007 */ lui $a2, %hi(dword_CODE_bss_8007161C) -/* 072F58 7F03E428 01CFC021 */ addu $t8, $t6, $t7 -/* 072F5C 7F03E42C 87050000 */ lh $a1, ($t8) -/* 072F60 7F03E430 04A20023 */ bltzl $a1, .L7F03E4C0 -/* 072F64 7F03E434 8C830004 */ lw $v1, 4($a0) -/* 072F68 7F03E438 8CC6161C */ lw $a2, %lo(dword_CODE_bss_8007161C)($a2) -/* 072F6C 7F03E43C 00003825 */ move $a3, $zero -.L7F03E440: -/* 072F70 7F03E440 0005C940 */ sll $t9, $a1, 5 -.L7F03E444: -/* 072F74 7F03E444 00D96021 */ addu $t4, $a2, $t9 -/* 072F78 7F03E448 01876821 */ addu $t5, $t4, $a3 -/* 072F7C 7F03E44C 85A30000 */ lh $v1, ($t5) -/* 072F80 7F03E450 24E70002 */ addiu $a3, $a3, 2 -/* 072F84 7F03E454 04600012 */ bltz $v1, .L7F03E4A0 -/* 072F88 7F03E458 00000000 */ nop -/* 072F8C 7F03E45C 8D280000 */ lw $t0, ($t1) -/* 072F90 7F03E460 0102082B */ sltu $at, $t0, $v0 -/* 072F94 7F03E464 10200008 */ beqz $at, .L7F03E488 -/* 072F98 7F03E468 00000000 */ nop -/* 072F9C 7F03E46C 850E0000 */ lh $t6, ($t0) -.L7F03E470: -/* 072FA0 7F03E470 106E0005 */ beq $v1, $t6, .L7F03E488 -/* 072FA4 7F03E474 00000000 */ nop -/* 072FA8 7F03E478 25080002 */ addiu $t0, $t0, 2 -/* 072FAC 7F03E47C 0102082B */ sltu $at, $t0, $v0 -/* 072FB0 7F03E480 5420FFFB */ bnezl $at, .L7F03E470 -/* 072FB4 7F03E484 850E0000 */ lh $t6, ($t0) -.L7F03E488: -/* 072FB8 7F03E488 15020005 */ bne $t0, $v0, .L7F03E4A0 -/* 072FBC 7F03E48C 00000000 */ nop -/* 072FC0 7F03E490 A4430000 */ sh $v1, ($v0) -/* 072FC4 7F03E494 3C068007 */ lui $a2, %hi(dword_CODE_bss_8007161C) -/* 072FC8 7F03E498 8CC6161C */ lw $a2, %lo(dword_CODE_bss_8007161C)($a2) -/* 072FCC 7F03E49C 24420002 */ addiu $v0, $v0, 2 -.L7F03E4A0: -/* 072FD0 7F03E4A0 54EBFFE8 */ bnel $a3, $t3, .L7F03E444 -/* 072FD4 7F03E4A4 0005C940 */ sll $t9, $a1, 5 -/* 072FD8 7F03E4A8 00057940 */ sll $t7, $a1, 5 -/* 072FDC 7F03E4AC 00CFC021 */ addu $t8, $a2, $t7 -/* 072FE0 7F03E4B0 8705001E */ lh $a1, 0x1e($t8) -/* 072FE4 7F03E4B4 04A3FFE2 */ bgezl $a1, .L7F03E440 -/* 072FE8 7F03E4B8 00003825 */ move $a3, $zero -/* 072FEC 7F03E4BC 8C830004 */ lw $v1, 4($a0) -.L7F03E4C0: -/* 072FF0 7F03E4C0 24840004 */ addiu $a0, $a0, 4 -/* 072FF4 7F03E4C4 0463FFD6 */ bgezl $v1, .L7F03E420 -/* 072FF8 7F03E4C8 8D4E0000 */ lw $t6, ($t2) -.L7F03E4CC: -/* 072FFC 7F03E4CC 2419FFFF */ li $t9, -1 -/* 073000 7F03E4D0 A4590000 */ sh $t9, ($v0) -/* 073004 7F03E4D4 8D2C0000 */ lw $t4, ($t1) -/* 073008 7F03E4D8 24420002 */ addiu $v0, $v0, 2 -/* 07300C 7F03E4DC 3C018007 */ lui $at, %hi(num_obj_position_data_entries) -/* 073010 7F03E4E0 004C6823 */ subu $t5, $v0, $t4 -/* 073014 7F03E4E4 000D7043 */ sra $t6, $t5, 1 -/* 073018 7F03E4E8 03E00008 */ jr $ra -/* 07301C 7F03E4EC AC2E9C34 */ sw $t6, %lo(num_obj_position_data_entries)($at) -) -#endif + room = *rooms; + + // Iterate rooms + while (room >= 0) + { + // Find the chunk to start at + s32 chunkindex = RoomPropListChunkIndexes[room]; + + // Iterate the chunks + while (chunkindex >= 0) + { + // Iterate the propnums within each chunk + for (i = 0; i < 15; i++) + { + s32 propnum = RoomPropListChunks[chunkindex].propnums[i]; + if (propnum >= 0) + { + // Check if it's in the list already + s16 *ptr = ptr_list_object_lookup_indices; + while (ptr < writeptr) + { + if (*ptr == propnum) { break; } + ptr++; + } + if (ptr == writeptr) + { + // Prop is not in the list, so insert it + *writeptr = propnum; + writeptr++; + } + } + } + chunkindex = RoomPropListChunks[chunkindex].propnums[15]; + } -#ifdef NONMATCHING -void sub_GAME_7F03E4F0(void) { + rooms++; + room = *rooms; + } + *writeptr = -1; + writeptr++; + num_obj_position_data_entries = writeptr - ptr_list_object_lookup_indices; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03E4F0 -/* 073020 7F03E4F0 3C038004 */ lui $v1, %hi(MaxNumRooms) -/* 073024 7F03E4F4 8C6342F4 */ lw $v1, %lo(MaxNumRooms)($v1) -/* 073028 7F03E4F8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 07302C 7F03E4FC AFB30014 */ sw $s3, 0x14($sp) -/* 073030 7F03E500 AFB20010 */ sw $s2, 0x10($sp) -/* 073034 7F03E504 AFB1000C */ sw $s1, 0xc($sp) -/* 073038 7F03E508 AFB00008 */ sw $s0, 8($sp) -/* 07303C 7F03E50C 1860005C */ blez $v1, .L7F03E680 -/* 073040 7F03E510 00001025 */ move $v0, $zero -/* 073044 7F03E514 3C0D8007 */ lui $t5, %hi(dword_CODE_bss_8007161C) -/* 073048 7F03E518 3C0C8007 */ lui $t4, %hi(ptr_room_lookup_buffer_maybe) -/* 07304C 7F03E51C 258C1618 */ addiu $t4, %lo(ptr_room_lookup_buffer_maybe) # addiu $t4, $t4, 0x1618 -/* 073050 7F03E520 25AD161C */ addiu $t5, %lo(dword_CODE_bss_8007161C) # addiu $t5, $t5, 0x161c -/* 073054 7F03E524 00002825 */ move $a1, $zero -/* 073058 7F03E528 2413001E */ li $s3, 30 -/* 07305C 7F03E52C 2412FFFE */ li $s2, -2 -/* 073060 7F03E530 2411001E */ li $s1, 30 -/* 073064 7F03E534 2410FFFF */ li $s0, -1 -.L7F03E538: -/* 073068 7F03E538 8D8E0000 */ lw $t6, ($t4) -/* 07306C 7F03E53C 24420001 */ addiu $v0, $v0, 1 -/* 073070 7F03E540 01C57821 */ addu $t7, $t6, $a1 -/* 073074 7F03E544 85E40000 */ lh $a0, ($t7) -/* 073078 7F03E548 0482004B */ bltzl $a0, .L7F03E678 -/* 07307C 7F03E54C 0043082A */ slt $at, $v0, $v1 -/* 073080 7F03E550 8DB80000 */ lw $t8, ($t5) -/* 073084 7F03E554 0004C940 */ sll $t9, $a0, 5 -/* 073088 7F03E558 03197021 */ addu $t6, $t8, $t9 -/* 07308C 7F03E55C 85C6001E */ lh $a2, 0x1e($t6) -/* 073090 7F03E560 04C00044 */ bltz $a2, .L7F03E674 -/* 073094 7F03E564 00004025 */ move $t0, $zero -.L7F03E568: -/* 073098 7F03E568 8DA30000 */ lw $v1, ($t5) -.L7F03E56C: -/* 07309C 7F03E56C 00047940 */ sll $t7, $a0, 5 -/* 0730A0 7F03E570 00067140 */ sll $t6, $a2, 5 -/* 0730A4 7F03E574 006FC021 */ addu $t8, $v1, $t7 -/* 0730A8 7F03E578 03083821 */ addu $a3, $t8, $t0 -/* 0730AC 7F03E57C 84F90000 */ lh $t9, ($a3) -/* 0730B0 7F03E580 25080002 */ addiu $t0, $t0, 2 -/* 0730B4 7F03E584 00005025 */ move $t2, $zero -/* 0730B8 7F03E588 0721002C */ bgez $t9, .L7F03E63C -/* 0730BC 7F03E58C 006E5821 */ addu $t3, $v1, $t6 -.L7F03E590: -/* 0730C0 7F03E590 85630000 */ lh $v1, ($t3) -/* 0730C4 7F03E594 04620009 */ bltzl $v1, .L7F03E5BC -/* 0730C8 7F03E598 254A0002 */ addiu $t2, $t2, 2 -/* 0730CC 7F03E59C A4E30000 */ sh $v1, ($a3) -/* 0730D0 7F03E5A0 8DAF0000 */ lw $t7, ($t5) -/* 0730D4 7F03E5A4 0006C140 */ sll $t8, $a2, 5 -/* 0730D8 7F03E5A8 01F8C821 */ addu $t9, $t7, $t8 -/* 0730DC 7F03E5AC 032A7021 */ addu $t6, $t9, $t2 -/* 0730E0 7F03E5B0 10000004 */ b .L7F03E5C4 -/* 0730E4 7F03E5B4 A5D00000 */ sh $s0, ($t6) -/* 0730E8 7F03E5B8 254A0002 */ addiu $t2, $t2, 2 -.L7F03E5BC: -/* 0730EC 7F03E5BC 1553FFF4 */ bne $t2, $s3, .L7F03E590 -/* 0730F0 7F03E5C0 256B0002 */ addiu $t3, $t3, 2 -.L7F03E5C4: -/* 0730F4 7F03E5C4 2941001E */ slti $at, $t2, 0x1e -/* 0730F8 7F03E5C8 1020000C */ beqz $at, .L7F03E5FC -/* 0730FC 7F03E5CC 00000000 */ nop -/* 073100 7F03E5D0 8DAF0000 */ lw $t7, ($t5) -/* 073104 7F03E5D4 0006C140 */ sll $t8, $a2, 5 -/* 073108 7F03E5D8 01F8C821 */ addu $t9, $t7, $t8 -/* 07310C 7F03E5DC 032A5821 */ addu $t3, $t9, $t2 -.L7F03E5E0: -/* 073110 7F03E5E0 856E0000 */ lh $t6, ($t3) -/* 073114 7F03E5E4 05C10005 */ bgez $t6, .L7F03E5FC -/* 073118 7F03E5E8 00000000 */ nop -/* 07311C 7F03E5EC 254A0002 */ addiu $t2, $t2, 2 -/* 073120 7F03E5F0 2941001E */ slti $at, $t2, 0x1e -/* 073124 7F03E5F4 1420FFFA */ bnez $at, .L7F03E5E0 -/* 073128 7F03E5F8 256B0002 */ addiu $t3, $t3, 2 -.L7F03E5FC: -/* 07312C 7F03E5FC 55510010 */ bnel $t2, $s1, .L7F03E640 -/* 073130 7F03E600 2901001E */ slti $at, $t0, 0x1e -/* 073134 7F03E604 8DAF0000 */ lw $t7, ($t5) -/* 073138 7F03E608 00064940 */ sll $t1, $a2, 5 -/* 07313C 7F03E60C 00043940 */ sll $a3, $a0, 5 -/* 073140 7F03E610 01E9C021 */ addu $t8, $t7, $t1 -/* 073144 7F03E614 A7120000 */ sh $s2, ($t8) -/* 073148 7F03E618 8DA30000 */ lw $v1, ($t5) -/* 07314C 7F03E61C 0069C821 */ addu $t9, $v1, $t1 -/* 073150 7F03E620 872E001E */ lh $t6, 0x1e($t9) -/* 073154 7F03E624 00677821 */ addu $t7, $v1, $a3 -/* 073158 7F03E628 A5EE001E */ sh $t6, 0x1e($t7) -/* 07315C 7F03E62C 8DB80000 */ lw $t8, ($t5) -/* 073160 7F03E630 0307C821 */ addu $t9, $t8, $a3 -/* 073164 7F03E634 8726001E */ lh $a2, 0x1e($t9) -/* 073168 7F03E638 04C00003 */ bltz $a2, .L7F03E648 -.L7F03E63C: -/* 07316C 7F03E63C 2901001E */ slti $at, $t0, 0x1e -.L7F03E640: -/* 073170 7F03E640 5420FFCA */ bnezl $at, .L7F03E56C -/* 073174 7F03E644 8DA30000 */ lw $v1, ($t5) -.L7F03E648: -/* 073178 7F03E648 04C00006 */ bltz $a2, .L7F03E664 -/* 07317C 7F03E64C 00000000 */ nop -/* 073180 7F03E650 8DAE0000 */ lw $t6, ($t5) -/* 073184 7F03E654 00067940 */ sll $t7, $a2, 5 -/* 073188 7F03E658 00C02025 */ move $a0, $a2 -/* 07318C 7F03E65C 01CFC021 */ addu $t8, $t6, $t7 -/* 073190 7F03E660 8706001E */ lh $a2, 0x1e($t8) -.L7F03E664: -/* 073194 7F03E664 04C3FFC0 */ bgezl $a2, .L7F03E568 -/* 073198 7F03E668 00004025 */ move $t0, $zero -/* 07319C 7F03E66C 3C038004 */ lui $v1, %hi(MaxNumRooms) -/* 0731A0 7F03E670 8C6342F4 */ lw $v1, %lo(MaxNumRooms)($v1) -.L7F03E674: -/* 0731A4 7F03E674 0043082A */ slt $at, $v0, $v1 -.L7F03E678: -/* 0731A8 7F03E678 1420FFAF */ bnez $at, .L7F03E538 -/* 0731AC 7F03E67C 24A50002 */ addiu $a1, $a1, 2 -.L7F03E680: -/* 0731B0 7F03E680 8FB00008 */ lw $s0, 8($sp) -/* 0731B4 7F03E684 8FB1000C */ lw $s1, 0xc($sp) -/* 0731B8 7F03E688 8FB20010 */ lw $s2, 0x10($sp) -/* 0731BC 7F03E68C 8FB30014 */ lw $s3, 0x14($sp) -/* 0731C0 7F03E690 03E00008 */ jr $ra -/* 0731C4 7F03E694 27BD0018 */ addiu $sp, $sp, 0x18 -) -#endif +void propsDefragRoomProps(void) +{ + s32 i; + s32 j; + s32 k; + // Iterate rooms + for (i = 0; i < MaxNumRooms; i++) + { + s32 previndex = RoomPropListChunkIndexes[i]; + if (previndex >= 0) + { + s32 nextindex = RoomPropListChunks[previndex].propnums[0xF]; + // Iterate this room's chunks but skip the first + while (nextindex >= 0) + { + // Iterate propnums within this chunk + for (j = 0; j < 15; j++) + { + // If this propnum is unallocated + if (RoomPropListChunks[previndex].propnums[j] < 0) + { + // Iterate forward through the chunk list and find a + // propnum to move back to the prev chunk + for (k = 0; k < 15; k++) + { + if (RoomPropListChunks[nextindex].propnums[k] >= 0) + { + RoomPropListChunks[previndex].propnums[j] = RoomPropListChunks[nextindex].propnums[k]; + RoomPropListChunks[nextindex].propnums[k] = -1; + break; + } + } + + // Check if there are more propnums in the future chunk + for (; k < 15; k++) + { + if (RoomPropListChunks[nextindex].propnums[k] >= 0) + { + break; + } + } -void removed_debug_roomblocks_feature(void) { + if (k == 15) + { + // There's no more propnums, so this chunk can be removed + RoomPropListChunks[nextindex].propnums[0] = -2; + RoomPropListChunks[previndex].propnums[15] = RoomPropListChunks[nextindex].propnums[15]; -} + nextindex = RoomPropListChunks[previndex].propnums[15]; + if (nextindex < 0) + { + break; + } + } + } + } + if (nextindex >= 0) + { + previndex = nextindex; + nextindex = RoomPropListChunks[nextindex].propnums[15]; + } + } + } + } +} +void removed_debug_roomblocks_feature(void) +{ + +} #ifdef NONMATCHING @@ -5462,111 +5336,54 @@ glabel sub_GAME_7F03E6A0 #endif +bool doorIsPadlockFree(DoorRecord* door) +{ + if (door->runtime_bitflags & RUNTIMEBITFLAG_PADLOCKEDDOOR) + { + LockDoorRecord *padlockeddoor = g_LevelLoadPropLockDoor; + while (padlockeddoor) + { + if (door == padlockeddoor->door + && padlockeddoor->lock + && padlockeddoor->lock->prop + && objIsHealthy(padlockeddoor->lock)) { + return FALSE; + } + padlockeddoor = padlockeddoor->next; + } + } -#ifdef NONMATCHING -void sub_GAME_7F03E718(void) { - + return TRUE; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03E718 -/* 073248 7F03E718 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 07324C 7F03E71C AFBF001C */ sw $ra, 0x1c($sp) -/* 073250 7F03E720 AFB10018 */ sw $s1, 0x18($sp) -/* 073254 7F03E724 AFB00014 */ sw $s0, 0x14($sp) -/* 073258 7F03E728 8C8E0064 */ lw $t6, 0x64($a0) -/* 07325C 7F03E72C 00808825 */ move $s1, $a0 -/* 073260 7F03E730 3C108003 */ lui $s0, %hi(g_LevelLoadPropLockDoor) -/* 073264 7F03E734 31CF2000 */ andi $t7, $t6, 0x2000 -/* 073268 7F03E738 51E00017 */ beql $t7, $zero, .L7F03E798 -/* 07326C 7F03E73C 24020001 */ li $v0, 1 -/* 073270 7F03E740 8E100B04 */ lw $s0, %lo(g_LevelLoadPropLockDoor)($s0) -/* 073274 7F03E744 52000014 */ beql $s0, $zero, .L7F03E798 -/* 073278 7F03E748 24020001 */ li $v0, 1 -/* 07327C 7F03E74C 8E180004 */ lw $t8, 4($s0) -.L7F03E750: -/* 073280 7F03E750 5638000E */ bnel $s1, $t8, .L7F03E78C -/* 073284 7F03E754 8E10000C */ lw $s0, 0xc($s0) -/* 073288 7F03E758 8E040008 */ lw $a0, 8($s0) -/* 07328C 7F03E75C 5080000B */ beql $a0, $zero, .L7F03E78C -/* 073290 7F03E760 8E10000C */ lw $s0, 0xc($s0) -/* 073294 7F03E764 8C990010 */ lw $t9, 0x10($a0) -/* 073298 7F03E768 53200008 */ beql $t9, $zero, .L7F03E78C -/* 07329C 7F03E76C 8E10000C */ lw $s0, 0xc($s0) -/* 0732A0 7F03E770 0FC13BCD */ jal objIsHealthy -/* 0732A4 7F03E774 00000000 */ nop -/* 0732A8 7F03E778 50400004 */ beql $v0, $zero, .L7F03E78C -/* 0732AC 7F03E77C 8E10000C */ lw $s0, 0xc($s0) -/* 0732B0 7F03E780 10000005 */ b .L7F03E798 -/* 0732B4 7F03E784 00001025 */ move $v0, $zero -/* 0732B8 7F03E788 8E10000C */ lw $s0, 0xc($s0) -.L7F03E78C: -/* 0732BC 7F03E78C 5600FFF0 */ bnezl $s0, .L7F03E750 -/* 0732C0 7F03E790 8E180004 */ lw $t8, 4($s0) -/* 0732C4 7F03E794 24020001 */ li $v0, 1 -.L7F03E798: -/* 0732C8 7F03E798 8FBF001C */ lw $ra, 0x1c($sp) -/* 0732CC 7F03E79C 8FB00014 */ lw $s0, 0x14($sp) -/* 0732D0 7F03E7A0 8FB10018 */ lw $s1, 0x18($sp) -/* 0732D4 7F03E7A4 03E00008 */ jr $ra -/* 0732D8 7F03E7A8 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif +bool objCanPickupFromSafe(ObjectRecord *obj) +{ + if (obj->flags2 & PROPFLAG2_LINKEDTOSAFE) + { + SafeObjectRecord *link = g_LevelLoadPropSafeItem; + while (link) + { + ObjectRecord *loopobj = link->item; + if (obj == link->item && link->door && link->door->prop) + { + if (link->door->openPosition <= 0.5f) + { + return FALSE; + } + } -#ifdef NONMATCHING -void sub_GAME_7F03E7AC(void) { + link = link->next; + } + } + return TRUE; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03E7AC -/* 0732DC 7F03E7AC 8C8E000C */ lw $t6, 0xc($a0) -/* 0732E0 7F03E7B0 3C028003 */ lui $v0, %hi(g_LevelLoadPropSafeItem) -/* 0732E4 7F03E7B4 31CF0400 */ andi $t7, $t6, 0x400 -/* 0732E8 7F03E7B8 51E0001B */ beql $t7, $zero, .L7F03E828 -/* 0732EC 7F03E7BC 24020001 */ li $v0, 1 -/* 0732F0 7F03E7C0 8C420B08 */ lw $v0, %lo(g_LevelLoadPropSafeItem)($v0) -/* 0732F4 7F03E7C4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0732F8 7F03E7C8 50400017 */ beql $v0, $zero, .L7F03E828 -/* 0732FC 7F03E7CC 24020001 */ li $v0, 1 -/* 073300 7F03E7D0 44810000 */ mtc1 $at, $f0 -/* 073304 7F03E7D4 00000000 */ nop -/* 073308 7F03E7D8 8C580004 */ lw $t8, 4($v0) -.L7F03E7DC: -/* 07330C 7F03E7DC 5498000F */ bnel $a0, $t8, .L7F03E81C -/* 073310 7F03E7E0 8C420010 */ lw $v0, 0x10($v0) -/* 073314 7F03E7E4 8C43000C */ lw $v1, 0xc($v0) -/* 073318 7F03E7E8 5060000C */ beql $v1, $zero, .L7F03E81C -/* 07331C 7F03E7EC 8C420010 */ lw $v0, 0x10($v0) -/* 073320 7F03E7F0 8C790010 */ lw $t9, 0x10($v1) -/* 073324 7F03E7F4 53200009 */ beql $t9, $zero, .L7F03E81C -/* 073328 7F03E7F8 8C420010 */ lw $v0, 0x10($v0) -/* 07332C 7F03E7FC C46400B4 */ lwc1 $f4, 0xb4($v1) -/* 073330 7F03E800 4600203E */ c.le.s $f4, $f0 -/* 073334 7F03E804 00000000 */ nop -/* 073338 7F03E808 45020004 */ bc1fl .L7F03E81C -/* 07333C 7F03E80C 8C420010 */ lw $v0, 0x10($v0) -/* 073340 7F03E810 03E00008 */ jr $ra -/* 073344 7F03E814 00001025 */ move $v0, $zero - -/* 073348 7F03E818 8C420010 */ lw $v0, 0x10($v0) -.L7F03E81C: -/* 07334C 7F03E81C 5440FFEF */ bnezl $v0, .L7F03E7DC -/* 073350 7F03E820 8C580004 */ lw $t8, 4($v0) -/* 073354 7F03E824 24020001 */ li $v0, 1 -.L7F03E828: -/* 073358 7F03E828 03E00008 */ jr $ra -/* 07335C 7F03E82C 00000000 */ nop -) -#endif + void sub_GAME_7F03E830(ObjectRecord* arg0) { @@ -5602,7 +5419,7 @@ f32 chrpropBBOXGetZmin(ModelRoData_BoundingBoxRecord *modelBoundingBox) /** * Address 0x7F03E87C. */ -f32 chrpropSumMatrixPosX(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixPosX(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5610,29 +5427,29 @@ f32 chrpropSumMatrixPosX(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][0] >= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][0]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][0]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][0]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][0]); } if (arg1->m[1][0] >= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][0]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][0]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][0]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][0]); } if (arg1->m[2][0] >= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][0]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][0]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][0]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][0]); } return phi_f2; @@ -5644,7 +5461,7 @@ f32 chrpropSumMatrixPosX(struct modeldata_unk_pos *arg0, Mtxf *arg1) /** * Address 0x7F03E91C. */ -f32 chrpropSumMatrixNegX(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixNegX(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5652,29 +5469,29 @@ f32 chrpropSumMatrixNegX(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][0] <= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][0]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][0]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][0]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][0]); } if (arg1->m[1][0] <= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][0]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][0]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][0]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][0]); } if (arg1->m[2][0] <= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][0]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][0]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][0]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][0]); } return phi_f2; @@ -5686,7 +5503,7 @@ f32 chrpropSumMatrixNegX(struct modeldata_unk_pos *arg0, Mtxf *arg1) /** * Address 0x7F03E9BC. */ -f32 chrpropSumMatrixPosY(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixPosY(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5694,29 +5511,29 @@ f32 chrpropSumMatrixPosY(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][1] >= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][1]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][1]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][1]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][1]); } if (arg1->m[1][1] >= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][1]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][1]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][1]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][1]); } if (arg1->m[2][1] >= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][1]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][1]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][1]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][1]); } return phi_f2; @@ -5727,7 +5544,7 @@ f32 chrpropSumMatrixPosY(struct modeldata_unk_pos *arg0, Mtxf *arg1) /** * Address 0x7F03EA5C. */ -f32 chrpropSumMatrixNegY(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixNegY(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5735,29 +5552,29 @@ f32 chrpropSumMatrixNegY(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][1] <= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][1]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][1]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][1]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][1]); } if (arg1->m[1][1] <= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][1]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][1]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][1]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][1]); } if (arg1->m[2][1] <= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][1]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][1]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][1]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][1]); } return phi_f2; @@ -5768,7 +5585,7 @@ f32 chrpropSumMatrixNegY(struct modeldata_unk_pos *arg0, Mtxf *arg1) /** * Address 0x7F03EAFC. */ -f32 chrpropSumMatrixPosZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixPosZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5776,29 +5593,29 @@ f32 chrpropSumMatrixPosZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][2] >= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][2]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][2]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][2]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][2]); } if (arg1->m[1][2] >= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][2]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][2]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][2]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][2]); } if (arg1->m[2][2] >= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][2]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][2]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][2]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][2]); } return phi_f2; @@ -5809,7 +5626,7 @@ f32 chrpropSumMatrixPosZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) /** * Address 0x7F03EB9C. */ -f32 chrpropSumMatrixNegZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) +f32 chrpropSumMatrixNegZ(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1) { f32 phi_f2; @@ -5817,29 +5634,29 @@ f32 chrpropSumMatrixNegZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) if (arg1->m[0][2] <= 0.0f) { - phi_f2 += (arg0->p1[0] * arg1->m[0][2]); + phi_f2 += (bbox->Bounds.xmin * arg1->m[0][2]); } else { - phi_f2 += (arg0->p1[1] * arg1->m[0][2]); + phi_f2 += (bbox->Bounds.xmax * arg1->m[0][2]); } if (arg1->m[1][2] <= 0.0f) { - phi_f2 += (arg0->p2[0] * arg1->m[1][2]); + phi_f2 += (bbox->Bounds.ymin * arg1->m[1][2]); } else { - phi_f2 += (arg0->p2[1] * arg1->m[1][2]); + phi_f2 += (bbox->Bounds.ymax * arg1->m[1][2]); } if (arg1->m[2][2] <= 0.0f) { - phi_f2 += (arg0->p3[0] * arg1->m[2][2]); + phi_f2 += (bbox->Bounds.zmin * arg1->m[2][2]); } else { - phi_f2 += (arg0->p3[1] * arg1->m[2][2]); + phi_f2 += (bbox->Bounds.zmax * arg1->m[2][2]); } return phi_f2; @@ -5852,33 +5669,33 @@ f32 chrpropSumMatrixNegZ(struct modeldata_unk_pos *arg0, Mtxf *arg1) * Unreferenced. * 0x7F03EC3C. */ -void sub_GAME_7F03EC3C(struct modeldata_unk_pos *arg0, Mtxf *arg1, struct coord3d *arg2) +void sub_GAME_7F03EC3C(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf *arg1, struct coord3d *arg2) { if (arg1->m[0][2] <= 0.0f) { - arg2->f[0] = arg0->p1[0]; + arg2->f[0] = bbox->Bounds.xmin; } else { - arg2->f[0] = arg0->p1[1]; + arg2->f[0] = bbox->Bounds.xmax; } if (arg1->m[1][2] <= 0.0f) { - arg2->f[1] = arg0->p2[0]; + arg2->f[1] = bbox->Bounds.ymin; } else { - arg2->f[1] = arg0->p2[1]; + arg2->f[1] = bbox->Bounds.ymax; } if (arg1->m[2][2] <= 0.0f) { - arg2->f[2] = arg0->p3[0]; + arg2->f[2] = bbox->Bounds.zmin; } else { - arg2->f[2] = arg0->p3[1]; + arg2->f[2] = bbox->Bounds.zmax; } } @@ -5892,7 +5709,7 @@ void sub_GAME_7F03ECC0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg } #else /* This forward declaration is required for sub_GAME_7F03F540() to link until sub_GAME_7F03ECC0() is properly decompiled */ -void sub_GAME_7F03ECC0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, void* arg6, void* arg7, s32* arg8); +void sub_GAME_7F03ECC0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, Mtxf* arg6, struct rect4f* arg7, struct collision_data* arg8); GLOBAL_ASM( .text glabel sub_GAME_7F03ECC0 @@ -6478,17 +6295,18 @@ glabel sub_GAME_7F03ECC0 -void sub_GAME_7F03F540(struct modeldata_unk_pos* arg0, Mtxf* arg1, s32* arg2, struct collision_data* arg3) +void sub_GAME_7F03F540(struct ModelRoData_BoundingBoxRecord *bbox, Mtxf* arg1, struct rect4f* arg2, struct collision_data* arg3) { - sub_GAME_7F03ECC0(arg0->p1[0], arg0->p1[1], arg0->p2[0], arg0->p2[1], arg0->p3[0], arg0->p3[1], arg1, arg2, arg3); + sub_GAME_7F03ECC0(bbox->Bounds.xmin, bbox->Bounds.xmax, bbox->Bounds.ymin, bbox->Bounds.ymax, bbox->Bounds.zmin, bbox->Bounds.zmax, arg1, arg2, arg3); } #ifdef NONMATCHING -void sub_GAME_7F03F598(void) { +s32 sub_GAME_7F03F598(coord3d* pos, f32 arg1, BoundPadRecord *boundpads) { } #else +s32 sub_GAME_7F03F598(coord3d* pos, f32 arg1, BoundPadRecord *boundpads); GLOBAL_ASM( .text glabel sub_GAME_7F03F598 @@ -6610,147 +6428,74 @@ glabel sub_GAME_7F03F598 #endif +void sub_GAME_7F03F748(Model* model, f32* max, f32* min, s32 axis) +{ + ModelNode *node = model->obj->RootNode; + bool first = TRUE; + while (node) + { + u32 type = node->Opcode & 0xFF; + if (type == MODELNODE_OPCODE_BBOX) + { + struct ModelRoData_BoundingBoxRecord *bbox = &node->Data->BoundingBox; + Mtxf *mtx = modelFindNodeMtx(model, node, 0); + f32 dist1; + f32 dist2; -#ifdef NONMATCHING -void sub_GAME_7F03F748(void) { + if (axis == 0) + { + dist1 = chrpropSumMatrixNegX(bbox, mtx) + mtx->m[3][0]; + dist2 = chrpropSumMatrixPosX(bbox, mtx) + mtx->m[3][0]; + } + else if (axis == 1) + { + dist1 = chrpropSumMatrixNegY(bbox, mtx) + mtx->m[3][1]; + dist2 = chrpropSumMatrixPosY(bbox, mtx) + mtx->m[3][1]; + } + else + { + dist1 = chrpropSumMatrixNegZ(bbox, mtx) + mtx->m[3][2]; + dist2 = chrpropSumMatrixPosZ(bbox, mtx) + mtx->m[3][2]; + } + + if (first || dist1 > *max) + { + *max = dist1; + } + + if (first || dist2 < *min) + { + *min = dist2; + } + first = FALSE; + } + else + { + // empty + } + + if (node->Child) + { + node = node->Child; + } + else + { + while (node) + { + if (node->Next) + { + node = node->Next; + break; + } + + node = node->Parent; + } + } + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F03F748 -/* 074278 7F03F748 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 07427C 7F03F74C AFBF0044 */ sw $ra, 0x44($sp) -/* 074280 7F03F750 AFBE0040 */ sw $fp, 0x40($sp) -/* 074284 7F03F754 AFB7003C */ sw $s7, 0x3c($sp) -/* 074288 7F03F758 AFB60038 */ sw $s6, 0x38($sp) -/* 07428C 7F03F75C AFB50034 */ sw $s5, 0x34($sp) -/* 074290 7F03F760 AFB40030 */ sw $s4, 0x30($sp) -/* 074294 7F03F764 AFB3002C */ sw $s3, 0x2c($sp) -/* 074298 7F03F768 AFB20028 */ sw $s2, 0x28($sp) -/* 07429C 7F03F76C AFB10024 */ sw $s1, 0x24($sp) -/* 0742A0 7F03F770 AFB00020 */ sw $s0, 0x20($sp) -/* 0742A4 7F03F774 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0742A8 7F03F778 AFA40048 */ sw $a0, 0x48($sp) -/* 0742AC 7F03F77C 8C8F0008 */ lw $t7, 8($a0) -/* 0742B0 7F03F780 00E0A025 */ move $s4, $a3 -/* 0742B4 7F03F784 00A0A825 */ move $s5, $a1 -/* 0742B8 7F03F788 8DF00000 */ lw $s0, ($t7) -/* 0742BC 7F03F78C 00C0B025 */ move $s6, $a2 -/* 0742C0 7F03F790 24130001 */ li $s3, 1 -/* 0742C4 7F03F794 12000050 */ beqz $s0, .L7F03F8D8 -/* 0742C8 7F03F798 241E0001 */ li $fp, 1 -/* 0742CC 7F03F79C 2417000A */ li $s7, 10 -/* 0742D0 7F03F7A0 96020000 */ lhu $v0, ($s0) -.L7F03F7A4: -/* 0742D4 7F03F7A4 8FA40048 */ lw $a0, 0x48($sp) -/* 0742D8 7F03F7A8 02002825 */ move $a1, $s0 -/* 0742DC 7F03F7AC 305800FF */ andi $t8, $v0, 0xff -/* 0742E0 7F03F7B0 17170038 */ bne $t8, $s7, .L7F03F894 -/* 0742E4 7F03F7B4 00003025 */ move $a2, $zero -/* 0742E8 7F03F7B8 0FC1B198 */ jal sub_GAME_7F06C660 -/* 0742EC 7F03F7BC 8E120004 */ lw $s2, 4($s0) -/* 0742F0 7F03F7C0 1680000C */ bnez $s4, .L7F03F7F4 -/* 0742F4 7F03F7C4 00408825 */ move $s1, $v0 -/* 0742F8 7F03F7C8 02402025 */ move $a0, $s2 -/* 0742FC 7F03F7CC 0FC0FA47 */ jal chrpropSumMatrixNegX -/* 074300 7F03F7D0 00402825 */ move $a1, $v0 -/* 074304 7F03F7D4 C6240030 */ lwc1 $f4, 0x30($s1) -/* 074308 7F03F7D8 02402025 */ move $a0, $s2 -/* 07430C 7F03F7DC 02202825 */ move $a1, $s1 -/* 074310 7F03F7E0 0FC0FA1F */ jal chrpropSumMatrixPosX -/* 074314 7F03F7E4 46002500 */ add.s $f20, $f4, $f0 -/* 074318 7F03F7E8 C6260030 */ lwc1 $f6, 0x30($s1) -/* 07431C 7F03F7EC 10000017 */ b .L7F03F84C -/* 074320 7F03F7F0 46003080 */ add.s $f2, $f6, $f0 -.L7F03F7F4: -/* 074324 7F03F7F4 169E000C */ bne $s4, $fp, .L7F03F828 -/* 074328 7F03F7F8 02402025 */ move $a0, $s2 -/* 07432C 7F03F7FC 02402025 */ move $a0, $s2 -/* 074330 7F03F800 0FC0FA97 */ jal chrpropSumMatrixNegY -/* 074334 7F03F804 02202825 */ move $a1, $s1 -/* 074338 7F03F808 C6280034 */ lwc1 $f8, 0x34($s1) -/* 07433C 7F03F80C 02402025 */ move $a0, $s2 -/* 074340 7F03F810 02202825 */ move $a1, $s1 -/* 074344 7F03F814 0FC0FA6F */ jal chrpropSumMatrixPosY -/* 074348 7F03F818 46004500 */ add.s $f20, $f8, $f0 -/* 07434C 7F03F81C C62A0034 */ lwc1 $f10, 0x34($s1) -/* 074350 7F03F820 1000000A */ b .L7F03F84C -/* 074354 7F03F824 46005080 */ add.s $f2, $f10, $f0 -.L7F03F828: -/* 074358 7F03F828 0FC0FAE7 */ jal chrpropSumMatrixNegZ -/* 07435C 7F03F82C 02202825 */ move $a1, $s1 -/* 074360 7F03F830 C6300038 */ lwc1 $f16, 0x38($s1) -/* 074364 7F03F834 02402025 */ move $a0, $s2 -/* 074368 7F03F838 02202825 */ move $a1, $s1 -/* 07436C 7F03F83C 0FC0FABF */ jal chrpropSumMatrixPosZ -/* 074370 7F03F840 46008500 */ add.s $f20, $f16, $f0 -/* 074374 7F03F844 C6320038 */ lwc1 $f18, 0x38($s1) -/* 074378 7F03F848 46009080 */ add.s $f2, $f18, $f0 -.L7F03F84C: -/* 07437C 7F03F84C 16600006 */ bnez $s3, .L7F03F868 -/* 074380 7F03F850 0013102B */ sltu $v0, $zero, $s3 -/* 074384 7F03F854 C6A40000 */ lwc1 $f4, ($s5) -/* 074388 7F03F858 4614203C */ c.lt.s $f4, $f20 -/* 07438C 7F03F85C 00000000 */ nop -/* 074390 7F03F860 45000002 */ bc1f .L7F03F86C -/* 074394 7F03F864 00000000 */ nop -.L7F03F868: -/* 074398 7F03F868 E6B40000 */ swc1 $f20, ($s5) -.L7F03F86C: -/* 07439C 7F03F86C 14400006 */ bnez $v0, .L7F03F888 -/* 0743A0 7F03F870 00009825 */ move $s3, $zero -/* 0743A4 7F03F874 C6C60000 */ lwc1 $f6, ($s6) -/* 0743A8 7F03F878 4606103C */ c.lt.s $f2, $f6 -/* 0743AC 7F03F87C 00000000 */ nop -/* 0743B0 7F03F880 45000002 */ bc1f .L7F03F88C -/* 0743B4 7F03F884 00000000 */ nop -.L7F03F888: -/* 0743B8 7F03F888 E6C20000 */ swc1 $f2, ($s6) -.L7F03F88C: -/* 0743BC 7F03F88C 10000002 */ b .L7F03F898 -/* 0743C0 7F03F890 8E020014 */ lw $v0, 0x14($s0) -.L7F03F894: -/* 0743C4 7F03F894 8E020014 */ lw $v0, 0x14($s0) -.L7F03F898: -/* 0743C8 7F03F898 10400003 */ beqz $v0, .L7F03F8A8 -/* 0743CC 7F03F89C 00000000 */ nop -/* 0743D0 7F03F8A0 1000000B */ b .L7F03F8D0 -/* 0743D4 7F03F8A4 00408025 */ move $s0, $v0 -.L7F03F8A8: -/* 0743D8 7F03F8A8 12000009 */ beqz $s0, .L7F03F8D0 -/* 0743DC 7F03F8AC 00000000 */ nop -/* 0743E0 7F03F8B0 8E02000C */ lw $v0, 0xc($s0) -.L7F03F8B4: -/* 0743E4 7F03F8B4 50400004 */ beql $v0, $zero, .L7F03F8C8 -/* 0743E8 7F03F8B8 8E100008 */ lw $s0, 8($s0) -/* 0743EC 7F03F8BC 10000004 */ b .L7F03F8D0 -/* 0743F0 7F03F8C0 00408025 */ move $s0, $v0 -/* 0743F4 7F03F8C4 8E100008 */ lw $s0, 8($s0) -.L7F03F8C8: -/* 0743F8 7F03F8C8 5600FFFA */ bnezl $s0, .L7F03F8B4 -/* 0743FC 7F03F8CC 8E02000C */ lw $v0, 0xc($s0) -.L7F03F8D0: -/* 074400 7F03F8D0 5600FFB4 */ bnezl $s0, .L7F03F7A4 -/* 074404 7F03F8D4 96020000 */ lhu $v0, ($s0) -.L7F03F8D8: -/* 074408 7F03F8D8 8FBF0044 */ lw $ra, 0x44($sp) -/* 07440C 7F03F8DC D7B40018 */ ldc1 $f20, 0x18($sp) -/* 074410 7F03F8E0 8FB00020 */ lw $s0, 0x20($sp) -/* 074414 7F03F8E4 8FB10024 */ lw $s1, 0x24($sp) -/* 074418 7F03F8E8 8FB20028 */ lw $s2, 0x28($sp) -/* 07441C 7F03F8EC 8FB3002C */ lw $s3, 0x2c($sp) -/* 074420 7F03F8F0 8FB40030 */ lw $s4, 0x30($sp) -/* 074424 7F03F8F4 8FB50034 */ lw $s5, 0x34($sp) -/* 074428 7F03F8F8 8FB60038 */ lw $s6, 0x38($sp) -/* 07442C 7F03F8FC 8FB7003C */ lw $s7, 0x3c($sp) -/* 074430 7F03F900 8FBE0040 */ lw $fp, 0x40($sp) -/* 074434 7F03F904 03E00008 */ jr $ra -/* 074438 7F03F908 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif void sub_GAME_7F03F90C(Model *model, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4) diff --git a/src/game/cleanplayersound.c b/src/game/cleanplayersound.c index e286306a..6ed085ea 100644 --- a/src/game/cleanplayersound.c +++ b/src/game/cleanplayersound.c @@ -2,137 +2,25 @@ #include #include "game/player.h" - -#ifdef NONMATCHING +// Address 0x7F007980 NTSC. +// Address 0x7F007900 PAL. void cleanupplayersoundrelated(void) { int i; - int j=0; + int j; - for(i=0; i < getPlayerCount(); i++) + for (i = 0; i < getPlayerCount(); i++) { - for(;j<2;j++) + for (j = 0; j < 2; j++) { - if((&g_playerPointers[i]->hands[j])->field_A44 && sndGetPlayingState((&g_playerPointers[i]->hands[j])->field_A44)) + struct hand *hand = &g_playerPointers[i]->hands[j]; + + if (hand->audioHandle != NULL && sndGetPlayingState(hand->audioHandle)) { - sndDeactivate((&g_playerPointers[i]->hands[j])->field_A44); + sndDeactivate(hand->audioHandle); } } } } -#else - -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.text -glabel cleanupplayersoundrelated -/* 03C4B0 7F007980 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 03C4B4 7F007984 AFBF002C */ sw $ra, 0x2c($sp) -/* 03C4B8 7F007988 AFB40028 */ sw $s4, 0x28($sp) -/* 03C4BC 7F00798C AFB30024 */ sw $s3, 0x24($sp) -/* 03C4C0 7F007990 AFB20020 */ sw $s2, 0x20($sp) -/* 03C4C4 7F007994 AFB1001C */ sw $s1, 0x1c($sp) -/* 03C4C8 7F007998 AFB00018 */ sw $s0, 0x18($sp) -/* 03C4CC 7F00799C 0FC26919 */ jal getPlayerCount -/* 03C4D0 7F0079A0 0000A025 */ move $s4, $zero -/* 03C4D4 7F0079A4 1840001B */ blez $v0, .L7F007A14 -/* 03C4D8 7F0079A8 00147080 */ sll $t6, $s4, 2 -/* 03C4DC 7F0079AC 3C0F8008 */ lui $t7, %hi(g_playerPointers) -/* 03C4E0 7F0079B0 25EF9EE0 */ addiu $t7, %lo(g_playerPointers) # addiu $t7, $t7, -0x6120 -/* 03C4E4 7F0079B4 01CF9021 */ addu $s2, $t6, $t7 -/* 03C4E8 7F0079B8 24130750 */ li $s3, 1872 -/* 03C4EC 7F0079BC 00008825 */ move $s1, $zero -.L7F0079C0: -/* 03C4F0 7F0079C0 8E580000 */ lw $t8, ($s2) -.L7F0079C4: -/* 03C4F4 7F0079C4 03118021 */ addu $s0, $t8, $s1 -/* 03C4F8 7F0079C8 8E040A44 */ lw $a0, 0xa44($s0) -/* 03C4FC 7F0079CC 26100870 */ addiu $s0, $s0, 0x870 -/* 03C500 7F0079D0 50800008 */ beql $a0, $zero, .L7F0079F4 -/* 03C504 7F0079D4 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 03C508 7F0079D8 0C00237C */ jal sndGetPlayingState -/* 03C50C 7F0079DC 00000000 */ nop -/* 03C510 7F0079E0 50400004 */ beql $v0, $zero, .L7F0079F4 -/* 03C514 7F0079E4 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 03C518 7F0079E8 0C002408 */ jal sndDeactivate -/* 03C51C 7F0079EC 8E0401D4 */ lw $a0, 0x1d4($s0) -/* 03C520 7F0079F0 263103A8 */ addiu $s1, $s1, 0x3a8 -.L7F0079F4: -/* 03C524 7F0079F4 5633FFF3 */ bnel $s1, $s3, .L7F0079C4 -/* 03C528 7F0079F8 8E580000 */ lw $t8, ($s2) -/* 03C52C 7F0079FC 26940001 */ addiu $s4, $s4, 1 -/* 03C530 7F007A00 0FC26919 */ jal getPlayerCount -/* 03C534 7F007A04 26520004 */ addiu $s2, $s2, 4 -/* 03C538 7F007A08 0282082A */ slt $at, $s4, $v0 -/* 03C53C 7F007A0C 5420FFEC */ bnezl $at, .L7F0079C0 -/* 03C540 7F007A10 00008825 */ move $s1, $zero -.L7F007A14: -/* 03C544 7F007A14 8FBF002C */ lw $ra, 0x2c($sp) -/* 03C548 7F007A18 8FB00018 */ lw $s0, 0x18($sp) -/* 03C54C 7F007A1C 8FB1001C */ lw $s1, 0x1c($sp) -/* 03C550 7F007A20 8FB20020 */ lw $s2, 0x20($sp) -/* 03C554 7F007A24 8FB30024 */ lw $s3, 0x24($sp) -/* 03C558 7F007A28 8FB40028 */ lw $s4, 0x28($sp) -/* 03C55C 7F007A2C 03E00008 */ jr $ra -/* 03C560 7F007A30 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - -#if defined(VERSION_EU) -GLOBAL_ASM( -.text -glabel cleanupplayersoundrelated -/* 03A2F0 7F007900 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 03A2F4 7F007904 AFBF002C */ sw $ra, 0x2c($sp) -/* 03A2F8 7F007908 AFB40028 */ sw $s4, 0x28($sp) -/* 03A2FC 7F00790C AFB30024 */ sw $s3, 0x24($sp) -/* 03A300 7F007910 AFB20020 */ sw $s2, 0x20($sp) -/* 03A304 7F007914 AFB1001C */ sw $s1, 0x1c($sp) -/* 03A308 7F007918 AFB00018 */ sw $s0, 0x18($sp) -/* 03A30C 7F00791C 0FC26669 */ jal getPlayerCount -/* 03A310 7F007920 0000A025 */ move $s4, $zero -/* 03A314 7F007924 1840001B */ blez $v0, .L7F007994 -/* 03A318 7F007928 00147080 */ sll $t6, $s4, 2 -/* 03A31C 7F00792C 3C0F8007 */ lui $t7, %hi(g_playerPointers) # $t7, 0x8007 -/* 03A320 7F007930 25EF89F0 */ addiu $t7, %lo(g_playerPointers) # addiu $t7, $t7, -0x7610 -/* 03A324 7F007934 01CF9021 */ addu $s2, $t6, $t7 -/* 03A328 7F007938 24130750 */ li $s3, 1872 -/* 03A32C 7F00793C 00008825 */ move $s1, $zero -.L7F007940: -/* 03A330 7F007940 8E580000 */ lw $t8, ($s2) -.L7F007944: -/* 03A334 7F007944 03118021 */ addu $s0, $t8, $s1 -/* 03A338 7F007948 8E040A3C */ lw $a0, 0xa3c($s0) -/* 03A33C 7F00794C 26100868 */ addiu $s0, $s0, 0x868 -/* 03A340 7F007950 50800008 */ beql $a0, $zero, .L7F007974 -/* 03A344 7F007954 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 03A348 7F007958 0C002094 */ jal sndGetPlayingState -/* 03A34C 7F00795C 00000000 */ nop -/* 03A350 7F007960 50400004 */ beql $v0, $zero, .L7F007974 -/* 03A354 7F007964 263103A8 */ addiu $s1, $s1, 0x3a8 -/* 03A358 7F007968 0C002120 */ jal sndDeactivate -/* 03A35C 7F00796C 8E0401D4 */ lw $a0, 0x1d4($s0) -/* 03A360 7F007970 263103A8 */ addiu $s1, $s1, 0x3a8 -.L7F007974: -/* 03A364 7F007974 5633FFF3 */ bnel $s1, $s3, .L7F007944 -/* 03A368 7F007978 8E580000 */ lw $t8, ($s2) -/* 03A36C 7F00797C 26940001 */ addiu $s4, $s4, 1 -/* 03A370 7F007980 0FC26669 */ jal getPlayerCount -/* 03A374 7F007984 26520004 */ addiu $s2, $s2, 4 -/* 03A378 7F007988 0282082A */ slt $at, $s4, $v0 -/* 03A37C 7F00798C 5420FFEC */ bnezl $at, .L7F007940 -/* 03A380 7F007990 00008825 */ move $s1, $zero -.L7F007994: -/* 03A384 7F007994 8FBF002C */ lw $ra, 0x2c($sp) -/* 03A388 7F007998 8FB00018 */ lw $s0, 0x18($sp) -/* 03A38C 7F00799C 8FB1001C */ lw $s1, 0x1c($sp) -/* 03A390 7F0079A0 8FB20020 */ lw $s2, 0x20($sp) -/* 03A394 7F0079A4 8FB30024 */ lw $s3, 0x24($sp) -/* 03A398 7F0079A8 8FB40028 */ lw $s4, 0x28($sp) -/* 03A39C 7F0079AC 03E00008 */ jr $ra -/* 03A3A0 7F0079B0 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif -#endif diff --git a/src/game/cleanupSFXRelated.c b/src/game/cleanupSFXRelated.c index 9e55781d..67795076 100644 --- a/src/game/cleanupSFXRelated.c +++ b/src/game/cleanupSFXRelated.c @@ -4,19 +4,19 @@ #include "bondview.h" void cleanupSFXRelated(void) { - if (SFX_80036458[0] != 0) + if (g_TankSfxState[0] != 0) { - if (sndGetPlayingState(SFX_80036458[0]) != AL_STOPPED) + if (sndGetPlayingState(g_TankSfxState[0]) != AL_STOPPED) { - sndDeactivate(SFX_80036458[0]); + sndDeactivate(g_TankSfxState[0]); } } - if (SFX_80036458[1] != 0) + if (g_TankSfxState[1] != 0) { - if (sndGetPlayingState(SFX_80036458[1]) != AL_STOPPED) + if (sndGetPlayingState(g_TankSfxState[1]) != AL_STOPPED) { - sndDeactivate(SFX_80036458[1]); + sndDeactivate(g_TankSfxState[1]); } } diff --git a/src/game/cleanup_guard_data.c b/src/game/cleanup_guard_data.c index c638b180..acd4af68 100644 --- a/src/game/cleanup_guard_data.c +++ b/src/game/cleanup_guard_data.c @@ -12,23 +12,23 @@ void cleanupGuardData(void) { s32 phi_v1; // Node 0 - if (num_guards > 0) + if (g_NumChrSlots > 0) { // Node 1 phi_s0 = 0; phi_s2 = 0; - phi_v1 = num_guards; + phi_v1 = g_NumChrSlots; loop_2: // Node 2 - temp_v0 = (ptr_guard_data + phi_s0); + temp_v0 = (g_ChrSlots + phi_s0); if (temp_v0->unk1C != 0) { // Node 3 disable_sounds_attached_to_player_then_something(temp_v0->unk18); - chrpropDelist((ptr_guard_data + phi_s0)->unk18); - chrpropDisable((ptr_guard_data + phi_s0)->unk18); - chrpropFree((ptr_guard_data + phi_s0)->unk18); - phi_v1 = num_guards; + chrpropDelist((g_ChrSlots + phi_s0)->unk18); + chrpropDisable((g_ChrSlots + phi_s0)->unk18); + chrpropFree((g_ChrSlots + phi_s0)->unk18); + phi_v1 = g_NumChrSlots; } // Node 4 temp_s2 = (phi_s2 + 1); @@ -47,8 +47,8 @@ void cleanupGuardData(void) { GLOBAL_ASM( .text glabel cleanupGuardData -/* 03BEE0 7F0073B0 3C038003 */ lui $v1, %hi(num_guards) -/* 03BEE4 7F0073B4 8C63CC68 */ lw $v1, %lo(num_guards)($v1) +/* 03BEE0 7F0073B0 3C038003 */ lui $v1, %hi(g_NumChrSlots) +/* 03BEE4 7F0073B4 8C63CC68 */ lw $v1, %lo(g_NumChrSlots)($v1) /* 03BEE8 7F0073B8 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 03BEEC 7F0073BC AFB20020 */ sw $s2, 0x20($sp) /* 03BEF0 7F0073C0 AFBF0024 */ sw $ra, 0x24($sp) @@ -56,8 +56,8 @@ glabel cleanupGuardData /* 03BEF8 7F0073C8 AFB00018 */ sw $s0, 0x18($sp) /* 03BEFC 7F0073CC 1860001D */ blez $v1, .L7F007444 /* 03BF00 7F0073D0 00009025 */ move $s2, $zero -/* 03BF04 7F0073D4 3C118003 */ lui $s1, %hi(ptr_guard_data) -/* 03BF08 7F0073D8 2631CC64 */ addiu $s1, %lo(ptr_guard_data) # addiu $s1, $s1, -0x339c +/* 03BF04 7F0073D4 3C118003 */ lui $s1, %hi(g_ChrSlots) +/* 03BF08 7F0073D8 2631CC64 */ addiu $s1, %lo(g_ChrSlots) # addiu $s1, $s1, -0x339c /* 03BF0C 7F0073DC 00008025 */ move $s0, $zero .L7F0073E0: /* 03BF10 7F0073E0 8E2E0000 */ lw $t6, ($s1) @@ -79,8 +79,8 @@ glabel cleanupGuardData /* 03BF50 7F007420 01505821 */ addu $t3, $t2, $s0 /* 03BF54 7F007424 0FC0E921 */ jal chrpropFree /* 03BF58 7F007428 8D640018 */ lw $a0, 0x18($t3) -/* 03BF5C 7F00742C 3C038003 */ lui $v1, %hi(num_guards) -/* 03BF60 7F007430 8C63CC68 */ lw $v1, %lo(num_guards)($v1) +/* 03BF5C 7F00742C 3C038003 */ lui $v1, %hi(g_NumChrSlots) +/* 03BF60 7F007430 8C63CC68 */ lw $v1, %lo(g_NumChrSlots)($v1) /* 03BF64 7F007434 26520001 */ addiu $s2, $s2, 1 .L7F007438: /* 03BF68 7F007438 0243082A */ slt $at, $s2, $v1 diff --git a/src/game/deb_loadallmodels.c b/src/game/deb_loadallmodels.c index 59301b96..787c48d6 100644 --- a/src/game/deb_loadallmodels.c +++ b/src/game/deb_loadallmodels.c @@ -8,6 +8,7 @@ #include "aicommands2.h" #include "dyn.h" #include "memp.h" +#include //i belong in a header, probably to another file diff --git a/src/game/debugmenu_08FE00.c b/src/game/debugmenu_08FE00.c index 1c4f1846..72f60ea5 100644 --- a/src/game/debugmenu_08FE00.c +++ b/src/game/debugmenu_08FE00.c @@ -181,234 +181,103 @@ void gotoBelowDebugOption(void) -#ifdef NONMATCHING +#if defined(LEFTOVERDEBUG) void gotoRightDebugOption(void) { s32 i; - if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) { - if (g_DMenuNumGroups >= 2) { - g_DMenuSelectedOption += g_DMenuCurOffsets[0]; + if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) + { + g_DMenuSelectedOption += g_DMenuCurOffsets[0]; - if (g_DMenuSelectedOption >= g_DMenuCurOffsets[1]) { - g_DMenuSelectedOption = g_DMenuCurOffsets[1] - 1; - } - } + if (g_DMenuSelectedOption >= g_DMenuCurOffsets[1]) + { + g_DMenuSelectedOption = g_DMenuCurOffsets[1] - 1; + } + return; } - for (i = 0; i < g_DMenuNumGroups; i++) { - if (g_DMenuSelectedOption < g_DMenuCurOffsets[i]) { + for (i = 0; i < g_DMenuNumGroups; i++) + { + if (g_DMenuSelectedOption < g_DMenuCurOffsets[i]) + { g_DMenuSelectedOption = g_DMenuSelectedOption + g_DMenuCurOffsets[i] - g_DMenuCurOffsets[i - 1]; - if (g_DMenuCurOffsets[i + 1] < 0) { + if (g_DMenuCurOffsets[i + 1] < 0) + { g_DMenuSelectedOption -= g_DMenuCurOffsets[i]; - if (g_DMenuSelectedOption >= g_DMenuCurOffsets[0]) { + if (g_DMenuSelectedOption >= g_DMenuCurOffsets[0]) + { g_DMenuSelectedOption = g_DMenuCurOffsets[0] - 1; } - } else { - if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i + 1]) { + } + else + { + if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i + 1]) + { g_DMenuSelectedOption = g_DMenuCurOffsets[i + 1] - 1; } } + return; } } } #else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel gotoRightDebugOption -/* 0C4DF0 7F0902C0 3C038003 */ lui $v1, %hi(g_DMenuCurOffsets) -/* 0C4DF4 7F0902C4 8C636B84 */ lw $v1, %lo(g_DMenuCurOffsets)($v1) -/* 0C4DF8 7F0902C8 3C088003 */ lui $t0, %hi(g_DMenuSelectedOption) -/* 0C4DFC 7F0902CC 25086B70 */ addiu $t0, %lo(g_DMenuSelectedOption) # addiu $t0, $t0, 0x6b70 -/* 0C4E00 7F0902D0 8D020000 */ lw $v0, ($t0) -/* 0C4E04 7F0902D4 8C640000 */ lw $a0, ($v1) -/* 0C4E08 7F0902D8 3C058003 */ lui $a1, %hi(g_DMenuNumGroups ) -/* 0C4E0C 7F0902DC 0044082A */ slt $at, $v0, $a0 -/* 0C4E10 7F0902E0 10200008 */ beqz $at, .L7F090304 -/* 0C4E14 7F0902E4 00447021 */ addu $t6, $v0, $a0 -/* 0C4E18 7F0902E8 AD0E0000 */ sw $t6, ($t0) -/* 0C4E1C 7F0902EC 8C650004 */ lw $a1, 4($v1) -/* 0C4E20 7F0902F0 01C5082A */ slt $at, $t6, $a1 -/* 0C4E24 7F0902F4 14200027 */ bnez $at, .L7F090394 -/* 0C4E28 7F0902F8 24B8FFFF */ addiu $t8, $a1, -1 -/* 0C4E2C 7F0902FC 03E00008 */ jr $ra -/* 0C4E30 7F090300 AD180000 */ sw $t8, ($t0) - -.L7F090304: -/* 0C4E34 7F090304 8CA56B80 */ lw $a1, %lo(g_DMenuNumGroups )($a1) -/* 0C4E38 7F090308 00002025 */ move $a0, $zero -/* 0C4E3C 7F09030C 00603025 */ move $a2, $v1 -/* 0C4E40 7F090310 18A00020 */ blez $a1, .L7F090394 -/* 0C4E44 7F090314 00000000 */ nop -.L7F090318: -/* 0C4E48 7F090318 8CC70000 */ lw $a3, ($a2) -/* 0C4E4C 7F09031C 24840001 */ addiu $a0, $a0, 1 -/* 0C4E50 7F090320 0047082A */ slt $at, $v0, $a3 -/* 0C4E54 7F090324 50200019 */ beql $at, $zero, .L7F09038C -/* 0C4E58 7F090328 0085082A */ slt $at, $a0, $a1 -/* 0C4E5C 7F09032C 8CC9FFFC */ lw $t1, -4($a2) -/* 0C4E60 7F090330 0047C821 */ addu $t9, $v0, $a3 -/* 0C4E64 7F090334 03295023 */ subu $t2, $t9, $t1 -/* 0C4E68 7F090338 AD0A0000 */ sw $t2, ($t0) -/* 0C4E6C 7F09033C 8CC40004 */ lw $a0, 4($a2) -/* 0C4E70 7F090340 0483000B */ bgezl $a0, .L7F090370 -/* 0C4E74 7F090344 8D180000 */ lw $t8, ($t0) -/* 0C4E78 7F090348 8CCC0000 */ lw $t4, ($a2) -/* 0C4E7C 7F09034C 014C6823 */ subu $t5, $t2, $t4 -/* 0C4E80 7F090350 AD0D0000 */ sw $t5, ($t0) -/* 0C4E84 7F090354 8C640000 */ lw $a0, ($v1) -/* 0C4E88 7F090358 01A4082A */ slt $at, $t5, $a0 -/* 0C4E8C 7F09035C 1420000D */ bnez $at, .L7F090394 -/* 0C4E90 7F090360 248FFFFF */ addiu $t7, $a0, -1 -/* 0C4E94 7F090364 03E00008 */ jr $ra -/* 0C4E98 7F090368 AD0F0000 */ sw $t7, ($t0) - -/* 0C4E9C 7F09036C 8D180000 */ lw $t8, ($t0) -.L7F090370: -/* 0C4EA0 7F090370 2499FFFF */ addiu $t9, $a0, -1 -/* 0C4EA4 7F090374 0304082A */ slt $at, $t8, $a0 -/* 0C4EA8 7F090378 14200006 */ bnez $at, .L7F090394 -/* 0C4EAC 7F09037C 00000000 */ nop -/* 0C4EB0 7F090380 03E00008 */ jr $ra -/* 0C4EB4 7F090384 AD190000 */ sw $t9, ($t0) - -/* 0C4EB8 7F090388 0085082A */ slt $at, $a0, $a1 -.L7F09038C: -/* 0C4EBC 7F09038C 1420FFE2 */ bnez $at, .L7F090318 -/* 0C4EC0 7F090390 24C60004 */ addiu $a2, $a2, 4 -.L7F090394: -/* 0C4EC4 7F090394 03E00008 */ jr $ra -/* 0C4EC8 7F090398 00000000 */ nop -) -#else void gotoRightDebugOption(void) { } #endif -#endif - -#ifdef NONMATCHING +#if defined(LEFTOVERDEBUG) void gotoLeftDebugOption(void) { s32 i; // First group - if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) { + if (g_DMenuSelectedOption < g_DMenuCurOffsets[0]) + { s32 i; - for (i = 0; i < g_DMenuNumGroups - 1; i++); + for (i = 0; i < g_DMenuNumGroups - 1; i++) + {} - if (i > 0) { - g_DMenuSelectedOption += g_DMenuCurOffsets[i - 1]; + g_DMenuSelectedOption += g_DMenuCurOffsets[i - 1]; - if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i]) { - g_DMenuSelectedOption = g_DMenuCurOffsets[i] - 1; - } - } + if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i]) + { + g_DMenuSelectedOption = g_DMenuCurOffsets[i] - 1; + } + return; } // Any other group - for (i = 0; g_DMenuSelectedOption >= g_DMenuCurOffsets[i]; i++); + for (i = 0; g_DMenuSelectedOption >= g_DMenuCurOffsets[i]; i++) + {} g_DMenuSelectedOption -= g_DMenuCurOffsets[i - 1]; - if (i - 2 >= 0) { + if (i - 2 >= 0) + { g_DMenuSelectedOption += g_DMenuCurOffsets[i - 2]; } - if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i - 1]) { + if (g_DMenuSelectedOption >= g_DMenuCurOffsets[i - 1]) + { g_DMenuSelectedOption = g_DMenuCurOffsets[i - 1] - 1; } } #else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel gotoLeftDebugOption -/* 0C4ECC 7F09039C 3C038003 */ lui $v1, %hi(g_DMenuCurOffsets) -/* 0C4ED0 7F0903A0 8C636B84 */ lw $v1, %lo(g_DMenuCurOffsets)($v1) -/* 0C4ED4 7F0903A4 3C078003 */ lui $a3, %hi(g_DMenuSelectedOption) -/* 0C4ED8 7F0903A8 24E76B70 */ addiu $a3, %lo(g_DMenuSelectedOption) # addiu $a3, $a3, 0x6b70 -/* 0C4EDC 7F0903AC 8CE20000 */ lw $v0, ($a3) -/* 0C4EE0 7F0903B0 8C640000 */ lw $a0, ($v1) -/* 0C4EE4 7F0903B4 3C058003 */ lui $a1, %hi(g_DMenuNumGroups ) -/* 0C4EE8 7F0903B8 0044082A */ slt $at, $v0, $a0 -/* 0C4EEC 7F0903BC 50200016 */ beql $at, $zero, .L7F090418 -/* 0C4EF0 7F0903C0 0044082A */ slt $at, $v0, $a0 -/* 0C4EF4 7F0903C4 8CA56B80 */ lw $a1, %lo(g_DMenuNumGroups )($a1) -/* 0C4EF8 7F0903C8 00002025 */ move $a0, $zero -/* 0C4EFC 7F0903CC 24A5FFFF */ addiu $a1, $a1, -1 -/* 0C4F00 7F0903D0 58A00006 */ blezl $a1, .L7F0903EC -/* 0C4F04 7F0903D4 00047080 */ sll $t6, $a0, 2 -/* 0C4F08 7F0903D8 24840001 */ addiu $a0, $a0, 1 -.L7F0903DC: -/* 0C4F0C 7F0903DC 0085082A */ slt $at, $a0, $a1 -/* 0C4F10 7F0903E0 5420FFFE */ bnezl $at, .L7F0903DC -/* 0C4F14 7F0903E4 24840001 */ addiu $a0, $a0, 1 -/* 0C4F18 7F0903E8 00047080 */ sll $t6, $a0, 2 -.L7F0903EC: -/* 0C4F1C 7F0903EC 006E2821 */ addu $a1, $v1, $t6 -/* 0C4F20 7F0903F0 8CAFFFFC */ lw $t7, -4($a1) -/* 0C4F24 7F0903F4 004FC021 */ addu $t8, $v0, $t7 -/* 0C4F28 7F0903F8 ACF80000 */ sw $t8, ($a3) -/* 0C4F2C 7F0903FC 8CA60000 */ lw $a2, ($a1) -/* 0C4F30 7F090400 0306082A */ slt $at, $t8, $a2 -/* 0C4F34 7F090404 1420001E */ bnez $at, .L7F090480 -/* 0C4F38 7F090408 24C8FFFF */ addiu $t0, $a2, -1 -/* 0C4F3C 7F09040C 03E00008 */ jr $ra -/* 0C4F40 7F090410 ACE80000 */ sw $t0, ($a3) - -/* 0C4F44 7F090414 0044082A */ slt $at, $v0, $a0 -.L7F090418: -/* 0C4F48 7F090418 14200008 */ bnez $at, .L7F09043C -/* 0C4F4C 7F09041C 00002825 */ move $a1, $zero -/* 0C4F50 7F090420 00602025 */ move $a0, $v1 -/* 0C4F54 7F090424 8C890004 */ lw $t1, 4($a0) -.L7F090428: -/* 0C4F58 7F090428 24A50001 */ addiu $a1, $a1, 1 -/* 0C4F5C 7F09042C 24840004 */ addiu $a0, $a0, 4 -/* 0C4F60 7F090430 0049082A */ slt $at, $v0, $t1 -/* 0C4F64 7F090434 5020FFFC */ beql $at, $zero, .L7F090428 -/* 0C4F68 7F090438 8C890004 */ lw $t1, 4($a0) -.L7F09043C: -/* 0C4F6C 7F09043C 00055080 */ sll $t2, $a1, 2 -/* 0C4F70 7F090440 006A2021 */ addu $a0, $v1, $t2 -/* 0C4F74 7F090444 8C8BFFFC */ lw $t3, -4($a0) -/* 0C4F78 7F090448 24ADFFFE */ addiu $t5, $a1, -2 -/* 0C4F7C 7F09044C 004B6023 */ subu $t4, $v0, $t3 -/* 0C4F80 7F090450 05A00004 */ bltz $t5, .L7F090464 -/* 0C4F84 7F090454 ACEC0000 */ sw $t4, ($a3) -/* 0C4F88 7F090458 8C8FFFF8 */ lw $t7, -8($a0) -/* 0C4F8C 7F09045C 018FC021 */ addu $t8, $t4, $t7 -/* 0C4F90 7F090460 ACF80000 */ sw $t8, ($a3) -.L7F090464: -/* 0C4F94 7F090464 8C82FFFC */ lw $v0, -4($a0) -/* 0C4F98 7F090468 8CF90000 */ lw $t9, ($a3) -/* 0C4F9C 7F09046C 2448FFFF */ addiu $t0, $v0, -1 -/* 0C4FA0 7F090470 0322082A */ slt $at, $t9, $v0 -/* 0C4FA4 7F090474 14200002 */ bnez $at, .L7F090480 -/* 0C4FA8 7F090478 00000000 */ nop -/* 0C4FAC 7F09047C ACE80000 */ sw $t0, ($a3) -.L7F090480: -/* 0C4FB0 7F090480 03E00008 */ jr $ra -/* 0C4FB4 7F090484 00000000 */ nop -) -#else void gotoLeftDebugOption(void) { } #endif -#endif diff --git a/src/game/debugmenu_handler.c b/src/game/debugmenu_handler.c index 3707a9cd..d96d0166 100644 --- a/src/game/debugmenu_handler.c +++ b/src/game/debugmenu_handler.c @@ -258,7 +258,7 @@ s32 debug_profile_flag = 0; //D:80036FC4 s32 debug_enable_taskgrab_flag = 0; //D:80036FC8 -s32 debug_testingmanpos_flag = 0; +s32 g_DebugManPos = 0; #endif //D:80036FCC @@ -287,10 +287,17 @@ u32 dword_D_80036FE8[] = { //D:80036FF8 s32 show_debug_menu_flag = 0; + + +struct ScreenshotFlag { + s32 flag; +}; + //D:80036FFC -s32 g_DebugScreenshotRgb = 0; +struct ScreenshotFlag g_DebugScreenshotFlagRgb = { 0 }; //D:80037000 -s32 g_DebugScreenshotJpg = 0; +struct ScreenshotFlag g_DebugScreenshotFlagJpg = { 0 }; + //D:80037004 coord3d player_pos_x = {0}; @@ -347,169 +354,235 @@ void removed_do_debug_profile_flag_true(void) { -#ifdef NONMATCHING -// -// https://decomp.me/scratch/KyqfX -// +#if defined(LEFTOVERDEBUG) +/** + * Address 0x7F0905A0 NTSC +*/ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pressed) { - s32 i; -// f32 tempx; -// f32 tempz; -// f32 tempy; - s32 debug_profile_flag; - PropRecord *playerprop; - - - if (g_DebugScreenshotRgb != 0) + s32 i1; + s32 i2; + s32 sp54; + struct PropRecord *playerprop; + s32 varv0; + s32 padding_0; + s32 padding_1; + s32 padding_2; + struct ScreenshotFlag *pscreehshotFlagRgb = &g_DebugScreenshotFlagRgb; + struct ScreenshotFlag *pscreehshotFlagJpg = &g_DebugScreenshotFlagJpg; + s32 padding_5; + s32* p32; + s32 padding_7; + f32 tempx; + f32 tempz; + f32 tempy; + + if(pscreehshotFlagRgb == NULL); + + if (pscreehshotFlagRgb->flag && pscreehshotFlagRgb->flag++ == 3) { - g_DebugScreenshotRgb++; - if ((g_DebugScreenshotRgb ^ 3) == 0) - { - indyGrabRgb32bit(); - g_DebugScreenshotRgb = 0; - viSetColorMode16Bit(); - osViBlack(0U); - } + indyGrabRgb32bit(); + pscreehshotFlagRgb->flag = 0; + viSetColorMode16Bit(); + osViBlack(0U); } - if (g_DebugScreenshotJpg != 0) + if (pscreehshotFlagJpg->flag && pscreehshotFlagJpg->flag++ == 3) { - g_DebugScreenshotJpg++; - if ((g_DebugScreenshotJpg ^ 3) == 0) - { - indyGrabJpg32bit(); - g_DebugScreenshotJpg = 0; - viSetColorMode16Bit(); - osViBlack(0U); - } + indyGrabJpg32bit(); + pscreehshotFlagJpg->flag = 0; + viSetColorMode16Bit(); + osViBlack(0U); } - if (show_debug_menu_flag == 0) - { - show_debug_menu_flag = (button_held & U_CBUTTONS) != 0; - if (show_debug_menu_flag != 0) - { - show_debug_menu_flag = (button_held & D_CBUTTONS) != 0; - } + if (!show_debug_menu_flag) + { + varv0 = (button_held & U_CBUTTONS) && (button_held & D_CBUTTONS); + + show_debug_menu_flag = varv0; - if (show_debug_menu_flag != 0) + if (varv0) { stop_recording_ramrom(button_held); } + + return show_debug_menu_flag; } else - { - - if (g_DebugMode != -2U) + { + if (g_DebugMode != -2) { g_DebugHighlightedOption = g_DebugMode; - g_DebugMode = -2U; + g_DebugMode = -2; } - button_pressed = (s32) button_pressed; - if ((button_pressed & L_JPAD) != 0) + + if ((button_pressed & L_JPAD)) { - gotoLeftDebugOption(g_DebugMode); - g_DebugMode = -2U; + gotoLeftDebugOption(); + g_DebugMode = -2; } - if ((button_pressed & R_JPAD) != 0) + if ((button_pressed & R_JPAD)) { - gotoRightDebugOption(g_DebugMode); - g_DebugMode = -2U; + gotoRightDebugOption(); + g_DebugMode = -2; } - if ((button_pressed & U_JPAD) != 0) + if ((button_pressed & U_JPAD)) { - gotoAboveDebugOption(g_DebugMode); - g_DebugMode = -2U; + gotoAboveDebugOption(); + g_DebugMode = -2; } - if ((button_pressed & D_JPAD) != 0) + if ((button_pressed & D_JPAD)) { - gotoBelowDebugOption(g_DebugMode); - g_DebugMode = -2U; + gotoBelowDebugOption(); + g_DebugMode = -2; } - if ((button_pressed & START_BUTTON|A_BUTTON) != 0) + + if ((button_pressed & (START_BUTTON | A_BUTTON))) { - switch (get_highlighted_debug_option(g_DebugMode)) { + switch (get_highlighted_debug_option()) { + case 0: // move view debmenuHandleMoveView(); break; + case 1: // stan view debmenuHandleStanView(); break; + case 2: // bond view debmenuHandleBondView(); break; + case 3: // level g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 4: // region g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 5: // scale g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 8: // select anim g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 9: // gun pos g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 10: // flash colour g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 11: // hit colour g_DebugHighlightedOption = get_highlighted_debug_option(); break; - //case 50: //marg top - //case 51: //marg bot - //case 52: //marg left - //case 53: //marg right - //case 54: //marg reset +#ifdef XBLADEBUG + case 50: //marg top + /* + printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n", + Function_82395958(1.0,0.0,0), + Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,1), + Function_82395958(1.0,0.0,2), + Function_82395958(1.0,0.0,3)); + //*/ + case 51: //marg bot + /* + printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n", + Function_82395958(1.0,0.0,0), + Function_82395958(1.0,0.0,1), + Function_82395958(1.0,0.0,2), + Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,3)); + //*/ + case 52: //marg left + /* + printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n", + Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,0), + Function_82395958(1.0,0.0,1), + Function_82395958(1.0,0.0,2), + Function_82395958(1.0,0.0,3)); + //*/ + case 53: //marg right + /* + printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n", + Function_82395958(1.0,0.0,0), + Function_82395958(1.0,0.0,1), + Function_82395958(1.0,(((button_pressed & 1) >> 5 & 1 ^ 1) - ((button_pressed & 2) >> 5 & 1 ^ 1)) * 4.0,2), + Function_82395958(1.0,0.0,3)); + //*/ + case 54: //marg reset + /* + printf("Margins: %5.2f.0F %5.2f.0F %5.2f.0F %5.2f.0F\n", + Function_82395958(1.0,0.0,0), + Function_82395958(1.0,0.0,1), + Function_82395958(1.0,0.0,2), + Function_82395958(1.0,0.0,3)); + //*/ + break; +#endif case 55: // screen size g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 56: // screen pos g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 12: // music g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 26: // port close case 27: // port inf case 28: // port approx debug_portal_flag ^= 1; break; + case 13: // sfx g_DebugHighlightedOption = get_highlighted_debug_option(); break; + case 14: // invincible set_bondata_invincible_flag(get_bondata_invincible_flag() == 0); break; + case 15: // visible bondviewSetVisibleToGuardsFlag(bondviewGetVisibleToGuardsFlag() == 0); break; + case 16: // collisions set_obj_collision_flag(get_obj_collision_flag() == 0); break; + case 17: // all guns - for (i = 0; i < getPlayerCount(); i++) + { + for (i1 = 0; i1 < getPlayerCount(); i1++) { - set_cur_player(i); + set_cur_player(i1); bondinvSetAllGunsFlag(bondinvGetAllGunsFlag() == 0); } break; + } + case 18: // max ammo - for (i = 0; i < getPlayerCount(); i++) + { + sp54 = get_cur_playernum(); + for (i2 = 0; i2 < getPlayerCount(); i2++) { - set_cur_player(i); + set_cur_player(i2); set_max_ammo_for_cur_player(); } - set_cur_player(get_cur_playernum()); + set_cur_player(sp54); break; + } + case 19: // display speed memusage_display_flag ^= 1; if (memusage_display_flag == 0) @@ -517,114 +590,145 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre debmenuReset(); } break; + case 20: // background debug_do_draw_bg ^= 1; break; + case 21: // props debug_do_draw_obj ^= 1; break; + case 22: // stan hit debug_stanhit_flag ^= 1; break; + case 23: // stan region debug_stanregion_flag ^= 1; break; + case 24: // stan problems debug_stan_problems_flag ^= 1; break; + case 25: // print man pos debug_man_pos_flag ^= 1; break; + case 75: // testing man pos - debug_testingmanpos_flag ^= 1; + g_DebugManPos ^= 1; break; + case 6: // play title - bossSetLoadedStage(0x5A); + bossSetLoadedStage(LEVELID_TITLE); break; + case 7: // bond die bondviewKillCurrentPlayer(); break; + case 29: // pr room loads debug_prroomloads_flag ^= 1; break; + case 30: // show mem use bossEnableShowMemUseFlag(); break; + case 31: // show mem bars bossMemBarsFlagToggle(); break; + case 32: // grab rgb - g_DebugScreenshotRgb = 1; - osViBlack(1U); + pscreehshotFlagRgb->flag = 1; + osViBlack(1); viSetColorMode32Bit(); break; + case 33: // grab jpeg - g_DebugScreenshotJpg = 1; - osViBlack(1U); + pscreehshotFlagJpg->flag = 1; + osViBlack(1); viSetColorMode32Bit(); break; + case 34: // grab task debug_enable_taskgrab_flag ^= 1; break; - //case 35: //rnd walk - // break; + + case 35: //rnd walk + break; + case 36: // record ramrom setRamRomRecordSlot(0); break; + case 37: // record 1 setRamRomRecordSlot(1); break; + case 38: // record 2 setRamRomRecordSlot(2); break; + case 39: // record 3 setRamRomRecordSlot(3); break; + case 40: // replay ramrom replay_recorded_ramrom_from_indy(); break; + case 41: // save ramrom save_ramrom_to_devtool(); break; + case 42: // load ramrom load_ramrom_from_devtool(); break; + case 43: // auto y aim set_BONDdata_autoaim_y(get_BONDdata_autoaim_y() == 0); break; + case 44: // auto x aim set_BONDdata_autoaim_x(get_BONDdata_autoaim_x() == 0); break; + case 45: // 007 debug_007_unlock_flag ^= 1; break; + case 46: // agent debug_enable_agent_levels_flag ^= 1; break; + case 47: // all debug_enable_all_levels_flag ^= 1; break; + case 48: // fast debug_fast_bond_flag ^= 1; break; + case 49: // objectives debug_all_obj_complete_flag ^= 1; break; - - - + case 57: // show patrols set_show_patrols_flag(get_show_patrols_flag() == 0); break; + case 58: // intro - set_camera_mode(3); + set_camera_mode(CAMERAMODE_SWIRL); break; + case 60: // intro pos if (debug_render_raster == 0) { handle_debug_intropos(); } break; + case 61: // world pos if (debug_render_raster == 0) { @@ -635,68 +739,80 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre playerprop = get_curplayer_positiondata(); if (playerprop) { - //tempx = playerprop->position.x - player_pos_x.x; - //tempy = playerprop->position.y - player_pos_x.y; - //tempz = playerprop->position.z - player_pos_x.z; - sqrtf(((playerprop->position.x - player_pos_x.x) * (playerprop->position.x - player_pos_x.x)) + - ((playerprop->position.y - player_pos_x.y) * (playerprop->position.y - player_pos_x.y)) + - ((playerprop->position.z - player_pos_x.z) * (playerprop->position.z - player_pos_x.z))); - player_pos_x.x = (f32) playerprop->position.x; - player_pos_x.y = (f32) playerprop->position.y; - player_pos_x.z = (f32) playerprop->position.z; + + tempx = playerprop->pos.f[0] - player_pos_x.x; + tempy = playerprop->pos.f[1] - player_pos_x.y; + tempz = playerprop->pos.f[2] - player_pos_x.z; + sqrtf(((tempx) * (tempx)) + + ((tempy) * (tempy)) + + ((tempz) * (tempz))); + player_pos_x.x = (f32) playerprop->pos.f[0]; + player_pos_x.y = (f32) playerprop->pos.f[1]; + player_pos_x.z = (f32) playerprop->pos.f[2]; + #ifdef ENABLE_LOG osSyncPrintf("%s%sbond world pos=%f,%f,%f dist from prev=%f\n", "", "", - playerprop->position.x, - playerprop->position.y, - playerprop->position.z, - sqrtf(((playerprop->position.x - player_pos_x.x) * (playerprop->position.x - player_pos_x.x)) + - ((playerprop->position.y - player_pos_x.y) * (playerprop->position.y - player_pos_x.y)) + - ((playerprop->position.z - player_pos_x.z) * (playerprop->position.z - player_pos_x.z)))); + playerprop->pos.f[0], + playerprop->pos.f[1], + playerprop->pos.f[2], + sqrtf(((tempx) * (tempx)) + + ((tempy) * (tempy)) + + ((tempz) * (tempz)))); #endif } } break; + case 62: // gun key pos g_DebugHighlightedOption = get_highlighted_debug_option(); - break; + case 64: // chr num debug_chrnum_flag ^= 1; break; + case 63: // vis cvg debug_VisCVG_flag ^= 1; break; + case 69: // joy2 sky edit debug_joy2skyedit_flag ^= 1; break; + case 70: // joy2 hits edit debug_joy2hitsedit_flag ^= 1; break; + case 71: // joy2 detail edit debug_joy2detailedit_flag ^= 1; break; + case 72: // explosion info debug_explosioninfo_flag ^= 1; break; + case 73: // magic fog g_DebugHighlightedOption = get_highlighted_debug_option(); - break; + case 76: // fog g_DebugHighlightedOption = get_highlighted_debug_option(); - break; + case 74: // gun watch pos debug_gunwatchpos_flags ^= 1; break; + case 65: // room blocks removed_debug_roomblocks_feature(); break; + case 66: // profile + { debug_profile_flag ^= 1; - if (debug_profile_flag != 0) + if (debug_profile_flag) { removed_do_debug_profile_flag_false(); } @@ -705,836 +821,56 @@ s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pre removed_do_debug_profile_flag_true(); } break; + } + case 67: // obj load debug_object_load_all_models(); break; + case 68: // weapon load debug_weapon_load_table(); break; + case 59: // intro edit g_DebugHighlightedOption = get_highlighted_debug_option(); - break; } } - if ((button_pressed & (R_CBUTTONS|L_CBUTTONS))) + + if ((button_pressed & (R_CBUTTONS | L_CBUTTONS))) { switch (get_highlighted_debug_option()) // switch 2; jump table: jpt_80055830 { - case 0: - case 1: - case 2: - case 3: - case 4: - break; + case 50: // marg top + case 51: // marg bot + case 52: // marg left + case 53: // marg right + case 54: // marg reset + break; } - } - if ((button_pressed & START_BUTTON)) + + p32 = &show_debug_menu_flag; + if (button_pressed & START_BUTTON) { - if (show_debug_menu_flag == 1) + if (*p32 == 1) { debmenuReset(); } + show_debug_menu_flag = 0; } + + return show_debug_menu_flag; } - return show_debug_menu_flag; } #else -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.late_rodata -/*D:800556FC*/ -glabel jpt_debug_menu_options -.word debug_stanview -.word debug_bondview -.word .L7F090798 -.word debug_level -.word .L7F0907BC -.word debug_scale -.word debug_playtitle -.word debug_bonddie -.word debug_selectanim -.word debug_gunpos -.word debug_flashcolor -.word debug_hitcolor -.word debug_music -.word debug_sfx -.word debug_invincible -.word debug_visible -.word debug_collisions -.word debug_allguns -.word debug_maxammo -.word debug_displayspeed -.word debug_dodrawbg -.word debug_dodrawobj -.word debug_stanhit -.word debug_stanregion -.word debug_turbo -.word debug_printmanpos -.word portal_close_inf_approx -.word portal_close_inf_approx -.word portal_close_inf_approx -.word debug_prroomloads -.word debug_showmemuse -.word debug_showmembars -.word debug_grabrgb -.word debug_grabjpeg -.word debug_taskgrab -.word def_7F090770 -.word debug_recordramrom -.word debug_ramrom_record1 -.word debug_ramrom_record2 -.word debug_ramrom_record3 -.word debug_replayramrom -.word debug_saveramrom -.word debug_loadramrom -.word debug_autoyaim -.word debug_autoxaim -.word debug_007 -.word debug_agent -.word debug_all -.word fast_bond_debug -.word debug_objectives -.word def_7F090770 -.word def_7F090770 -.word def_7F090770 -.word def_7F090770 -.word def_7F090770 -.word .L7F090834 -.word debug_screenpos -.word debug_showpatrols -.word debug_intro -.word debug_introedit -.word debug_intropos -.word debug_worldpos -.word debug_chrkeypos -.word debug_viscvg -.word debug_chrnum -.word debug_roomblocks -.word debug_profile -.word debug_objload -.word debug_weaponload -.word debug_joy2skyedit -.word debug_joy2hitsedit -.word debug_joy2detailedit -.word debug_explosioninfo -.word debug_magicfog -.word debug_gunwatchpos -.word debug_testingmanpos -.word debug_fog - -/*D:80055830*/ -glabel jpt_80055830 -.word def_7F090EA8 -.word def_7F090EA8 -.word def_7F090EA8 -.word def_7F090EA8 -.word def_7F090EA8 - -.text -glabel debug_menu_processor -/* 0C50D0 7F0905A0 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0C50D4 7F0905A4 3C038003 */ lui $v1, %hi(g_DebugScreenshotRgb) -/* 0C50D8 7F0905A8 8C636FFC */ lw $v1, %lo(g_DebugScreenshotRgb)($v1) -/* 0C50DC 7F0905AC AFBF0014 */ sw $ra, 0x14($sp) -/* 0C50E0 7F0905B0 AFA40060 */ sw $a0, 0x60($sp) -/* 0C50E4 7F0905B4 AFA50064 */ sw $a1, 0x64($sp) -/* 0C50E8 7F0905B8 AFA60068 */ sw $a2, 0x68($sp) -/* 0C50EC 7F0905BC 1060000D */ beqz $v1, .L7F0905F4 -/* 0C50F0 7F0905C0 AFA7006C */ sw $a3, 0x6c($sp) -/* 0C50F4 7F0905C4 38620003 */ xori $v0, $v1, 3 -/* 0C50F8 7F0905C8 24630001 */ addiu $v1, $v1, 1 -/* 0C50FC 7F0905CC 3C018003 */ lui $at, %hi(g_DebugScreenshotRgb) -/* 0C5100 7F0905D0 14400008 */ bnez $v0, .L7F0905F4 -/* 0C5104 7F0905D4 AC236FFC */ sw $v1, %lo(g_DebugScreenshotRgb)($at) -/* 0C5108 7F0905D8 0C0012ED */ jal indyGrabRgb32bit -/* 0C510C 7F0905DC 00000000 */ nop -/* 0C5110 7F0905E0 3C018003 */ lui $at, %hi(g_DebugScreenshotRgb) -/* 0C5114 7F0905E4 0C000F00 */ jal viSetColorMode16Bit -/* 0C5118 7F0905E8 AC206FFC */ sw $zero, %lo(g_DebugScreenshotRgb)($at) -/* 0C511C 7F0905EC 0C0038B4 */ jal osViBlack -/* 0C5120 7F0905F0 00002025 */ move $a0, $zero -.L7F0905F4: -/* 0C5124 7F0905F4 3C038003 */ lui $v1, %hi(g_DebugScreenshotJpg) -/* 0C5128 7F0905F8 8C637000 */ lw $v1, %lo(g_DebugScreenshotJpg)($v1) -/* 0C512C 7F0905FC 3C018003 */ lui $at, %hi(g_DebugScreenshotJpg) -/* 0C5130 7F090600 1060000B */ beqz $v1, .L7F090630 -/* 0C5134 7F090604 38620003 */ xori $v0, $v1, 3 -/* 0C5138 7F090608 24630001 */ addiu $v1, $v1, 1 -/* 0C513C 7F09060C 14400008 */ bnez $v0, .L7F090630 -/* 0C5140 7F090610 AC237000 */ sw $v1, %lo(g_DebugScreenshotJpg)($at) -/* 0C5144 7F090614 0C001235 */ jal indyGrabJpg32bit -/* 0C5148 7F090618 00000000 */ nop -/* 0C514C 7F09061C 3C018003 */ lui $at, %hi(g_DebugScreenshotJpg) -/* 0C5150 7F090620 0C000F00 */ jal viSetColorMode16Bit -/* 0C5154 7F090624 AC207000 */ sw $zero, %lo(g_DebugScreenshotJpg)($at) -/* 0C5158 7F090628 0C0038B4 */ jal osViBlack -/* 0C515C 7F09062C 00002025 */ move $a0, $zero -.L7F090630: -/* 0C5160 7F090630 3C0E8003 */ lui $t6, %hi(show_debug_menu_flag) -/* 0C5164 7F090634 8DCE6FF8 */ lw $t6, %lo(show_debug_menu_flag)($t6) -/* 0C5168 7F090638 3C048003 */ lui $a0, %hi(g_DebugMode) -/* 0C516C 7F09063C 3C018003 */ lui $at, %hi(show_debug_menu_flag) -/* 0C5170 7F090640 15C00010 */ bnez $t6, .L7F090684 -/* 0C5174 7F090644 24846F6C */ addiu $a0, %lo(g_DebugMode) # addiu $a0, $a0, 0x6f6c -/* 0C5178 7F090648 97A4006A */ lhu $a0, 0x6a($sp) -/* 0C517C 7F09064C 30830008 */ andi $v1, $a0, 8 -/* 0C5180 7F090650 0003102B */ sltu $v0, $zero, $v1 -/* 0C5184 7F090654 10400004 */ beqz $v0, .L7F090668 -/* 0C5188 7F090658 00000000 */ nop -/* 0C518C 7F09065C 30820004 */ andi $v0, $a0, 4 -/* 0C5190 7F090660 0002C02B */ sltu $t8, $zero, $v0 -/* 0C5194 7F090664 03001025 */ move $v0, $t8 -.L7F090668: -/* 0C5198 7F090668 10400003 */ beqz $v0, .L7F090678 -/* 0C519C 7F09066C AC226FF8 */ sw $v0, %lo(show_debug_menu_flag)($at) -/* 0C51A0 7F090670 0FC301F5 */ jal stop_recording_ramrom -/* 0C51A4 7F090674 00000000 */ nop -.L7F090678: -/* 0C51A8 7F090678 3C028003 */ lui $v0, %hi(show_debug_menu_flag) -/* 0C51AC 7F09067C 1000021B */ b .L7F090EEC -/* 0C51B0 7F090680 8C426FF8 */ lw $v0, %lo(show_debug_menu_flag)($v0) -.L7F090684: -/* 0C51B4 7F090684 8C820000 */ lw $v0, ($a0) -/* 0C51B8 7F090688 2403FFFE */ li $v1, -2 -/* 0C51BC 7F09068C 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C51C0 7F090690 50620004 */ beql $v1, $v0, .L7F0906A4 -/* 0C51C4 7F090694 97B9006E */ lhu $t9, 0x6e($sp) -/* 0C51C8 7F090698 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -/* 0C51CC 7F09069C AC830000 */ sw $v1, ($a0) -/* 0C51D0 7F0906A0 97B9006E */ lhu $t9, 0x6e($sp) -.L7F0906A4: -/* 0C51D4 7F0906A4 33280200 */ andi $t0, $t9, 0x200 -/* 0C51D8 7F0906A8 11000007 */ beqz $t0, .L7F0906C8 -/* 0C51DC 7F0906AC AFB90018 */ sw $t9, 0x18($sp) -/* 0C51E0 7F0906B0 0FC240E7 */ jal gotoLeftDebugOption -/* 0C51E4 7F0906B4 00000000 */ nop -/* 0C51E8 7F0906B8 3C048003 */ lui $a0, %hi(g_DebugMode) -/* 0C51EC 7F0906BC 24846F6C */ addiu $a0, %lo(g_DebugMode) # addiu $a0, $a0, 0x6f6c -/* 0C51F0 7F0906C0 2403FFFE */ li $v1, -2 -/* 0C51F4 7F0906C4 AC830000 */ sw $v1, ($a0) -.L7F0906C8: -/* 0C51F8 7F0906C8 8FA90018 */ lw $t1, 0x18($sp) -/* 0C51FC 7F0906CC 312A0100 */ andi $t2, $t1, 0x100 -/* 0C5200 7F0906D0 51400008 */ beql $t2, $zero, .L7F0906F4 -/* 0C5204 7F0906D4 8FAB0018 */ lw $t3, 0x18($sp) -/* 0C5208 7F0906D8 0FC240B0 */ jal gotoRightDebugOption -/* 0C520C 7F0906DC 00000000 */ nop -/* 0C5210 7F0906E0 3C048003 */ lui $a0, %hi(g_DebugMode) -/* 0C5214 7F0906E4 24846F6C */ addiu $a0, %lo(g_DebugMode) # addiu $a0, $a0, 0x6f6c -/* 0C5218 7F0906E8 2403FFFE */ li $v1, -2 -/* 0C521C 7F0906EC AC830000 */ sw $v1, ($a0) -/* 0C5220 7F0906F0 8FAB0018 */ lw $t3, 0x18($sp) -.L7F0906F4: -/* 0C5224 7F0906F4 316C0800 */ andi $t4, $t3, 0x800 -/* 0C5228 7F0906F8 51800008 */ beql $t4, $zero, .L7F09071C -/* 0C522C 7F0906FC 8FAD0018 */ lw $t5, 0x18($sp) -/* 0C5230 7F090700 0FC24072 */ jal gotoAboveDebugOption -/* 0C5234 7F090704 00000000 */ nop -/* 0C5238 7F090708 3C048003 */ lui $a0, %hi(g_DebugMode) -/* 0C523C 7F09070C 24846F6C */ addiu $a0, %lo(g_DebugMode) # addiu $a0, $a0, 0x6f6c -/* 0C5240 7F090710 2403FFFE */ li $v1, -2 -/* 0C5244 7F090714 AC830000 */ sw $v1, ($a0) -/* 0C5248 7F090718 8FAD0018 */ lw $t5, 0x18($sp) -.L7F09071C: -/* 0C524C 7F09071C 31AE0400 */ andi $t6, $t5, 0x400 -/* 0C5250 7F090720 51C00008 */ beql $t6, $zero, .L7F090744 -/* 0C5254 7F090724 8FAF0018 */ lw $t7, 0x18($sp) -/* 0C5258 7F090728 0FC24092 */ jal gotoBelowDebugOption -/* 0C525C 7F09072C 00000000 */ nop -/* 0C5260 7F090730 3C048003 */ lui $a0, %hi(g_DebugMode) -/* 0C5264 7F090734 24846F6C */ addiu $a0, %lo(g_DebugMode) # addiu $a0, $a0, 0x6f6c -/* 0C5268 7F090738 2403FFFE */ li $v1, -2 -/* 0C526C 7F09073C AC830000 */ sw $v1, ($a0) -/* 0C5270 7F090740 8FAF0018 */ lw $t7, 0x18($sp) -.L7F090744: -/* 0C5274 7F090744 31F89000 */ andi $t8, $t7, 0x9000 -/* 0C5278 7F090748 530001CB */ beql $t8, $zero, .L7F090E78 -/* 0C527C 7F09074C 8FB80018 */ lw $t8, 0x18($sp) -/* 0C5280 7F090750 0FC2406C */ jal get_highlighted_debug_option -/* 0C5284 7F090754 00000000 */ nop -/* 0C5288 7F090758 2C41004D */ sltiu $at, $v0, 0x4d -/* 0C528C 7F09075C 102001C5 */ beqz $at, .L7F090E74 -/* 0C5290 7F090760 0002C880 */ sll $t9, $v0, 2 -/* 0C5294 7F090764 3C018005 */ lui $at, %hi(jpt_debug_menu_options) -/* 0C5298 7F090768 00390821 */ addu $at, $at, $t9 -/* 0C529C 7F09076C 8C3956FC */ lw $t9, %lo(jpt_debug_menu_options)($at) -/* 0C52A0 7F090770 03200008 */ jr $t9 -/* 0C52A4 7F090774 00000000 */ nop -debug_stanview: -/* 0C52A8 7F090778 0FC24131 */ jal debmenuHandleMoveView -/* 0C52AC 7F09077C 00000000 */ nop -/* 0C52B0 7F090780 100001BD */ b .L7F090E78 -/* 0C52B4 7F090784 8FB80018 */ lw $t8, 0x18($sp) -debug_bondview: -/* 0C52B8 7F090788 0FC24142 */ jal debmenuHandleStanView -/* 0C52BC 7F09078C 00000000 */ nop -/* 0C52C0 7F090790 100001B9 */ b .L7F090E78 -/* 0C52C4 7F090794 8FB80018 */ lw $t8, 0x18($sp) -.L7F090798: -/* 0C52C8 7F090798 0FC24153 */ jal debmenuHandleBondView -/* 0C52CC 7F09079C 00000000 */ nop -/* 0C52D0 7F0907A0 100001B5 */ b .L7F090E78 -/* 0C52D4 7F0907A4 8FB80018 */ lw $t8, 0x18($sp) -debug_level: -/* 0C52D8 7F0907A8 0FC2406C */ jal get_highlighted_debug_option -/* 0C52DC 7F0907AC 00000000 */ nop -/* 0C52E0 7F0907B0 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C52E4 7F0907B4 100001AF */ b .L7F090E74 -/* 0C52E8 7F0907B8 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -.L7F0907BC: -/* 0C52EC 7F0907BC 0FC2406C */ jal get_highlighted_debug_option -/* 0C52F0 7F0907C0 00000000 */ nop -/* 0C52F4 7F0907C4 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C52F8 7F0907C8 100001AA */ b .L7F090E74 -/* 0C52FC 7F0907CC AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_scale: -/* 0C5300 7F0907D0 0FC2406C */ jal get_highlighted_debug_option -/* 0C5304 7F0907D4 00000000 */ nop -/* 0C5308 7F0907D8 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C530C 7F0907DC 100001A5 */ b .L7F090E74 -/* 0C5310 7F0907E0 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_selectanim: -/* 0C5314 7F0907E4 0FC2406C */ jal get_highlighted_debug_option -/* 0C5318 7F0907E8 00000000 */ nop -/* 0C531C 7F0907EC 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5320 7F0907F0 100001A0 */ b .L7F090E74 -/* 0C5324 7F0907F4 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_gunpos: -/* 0C5328 7F0907F8 0FC2406C */ jal get_highlighted_debug_option -/* 0C532C 7F0907FC 00000000 */ nop -/* 0C5330 7F090800 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5334 7F090804 1000019B */ b .L7F090E74 -/* 0C5338 7F090808 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_flashcolor: -/* 0C533C 7F09080C 0FC2406C */ jal get_highlighted_debug_option -/* 0C5340 7F090810 00000000 */ nop -/* 0C5344 7F090814 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5348 7F090818 10000196 */ b .L7F090E74 -/* 0C534C 7F09081C AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_hitcolor: -/* 0C5350 7F090820 0FC2406C */ jal get_highlighted_debug_option -/* 0C5354 7F090824 00000000 */ nop -/* 0C5358 7F090828 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C535C 7F09082C 10000191 */ b .L7F090E74 -/* 0C5360 7F090830 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -.L7F090834: -/* 0C5364 7F090834 0FC2406C */ jal get_highlighted_debug_option -/* 0C5368 7F090838 00000000 */ nop -/* 0C536C 7F09083C 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5370 7F090840 1000018C */ b .L7F090E74 -/* 0C5374 7F090844 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_screenpos: -/* 0C5378 7F090848 0FC2406C */ jal get_highlighted_debug_option -/* 0C537C 7F09084C 00000000 */ nop -/* 0C5380 7F090850 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5384 7F090854 10000187 */ b .L7F090E74 -/* 0C5388 7F090858 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_music: -/* 0C538C 7F09085C 0FC2406C */ jal get_highlighted_debug_option -/* 0C5390 7F090860 00000000 */ nop -/* 0C5394 7F090864 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5398 7F090868 10000182 */ b .L7F090E74 -/* 0C539C 7F09086C AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -portal_close_inf_approx: -/* 0C53A0 7F090870 3C028003 */ lui $v0, %hi(debug_portal_flag) -/* 0C53A4 7F090874 24426FD4 */ addiu $v0, %lo(debug_portal_flag) # addiu $v0, $v0, 0x6fd4 -/* 0C53A8 7F090878 8C480000 */ lw $t0, ($v0) -/* 0C53AC 7F09087C 39090001 */ xori $t1, $t0, 1 -/* 0C53B0 7F090880 1000017C */ b .L7F090E74 -/* 0C53B4 7F090884 AC490000 */ sw $t1, ($v0) -debug_sfx: -/* 0C53B8 7F090888 0FC2406C */ jal get_highlighted_debug_option -/* 0C53BC 7F09088C 00000000 */ nop -/* 0C53C0 7F090890 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C53C4 7F090894 10000177 */ b .L7F090E74 -/* 0C53C8 7F090898 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_invincible: -/* 0C53CC 7F09089C 0FC227D6 */ jal get_bondata_invincible_flag -/* 0C53D0 7F0908A0 00000000 */ nop -/* 0C53D4 7F0908A4 0FC227D2 */ jal set_bondata_invincible_flag -/* 0C53D8 7F0908A8 2C440001 */ sltiu $a0, $v0, 1 -/* 0C53DC 7F0908AC 10000172 */ b .L7F090E78 -/* 0C53E0 7F0908B0 8FB80018 */ lw $t8, 0x18($sp) -debug_visible: -/* 0C53E4 7F0908B4 0FC227DD */ jal bondviewGetVisibleToGuardsFlag -/* 0C53E8 7F0908B8 00000000 */ nop -/* 0C53EC 7F0908BC 0FC227DA */ jal bondviewSetVisibleToGuardsFlag -/* 0C53F0 7F0908C0 2C440001 */ sltiu $a0, $v0, 1 -/* 0C53F4 7F0908C4 1000016C */ b .L7F090E78 -/* 0C53F8 7F0908C8 8FB80018 */ lw $t8, 0x18($sp) -debug_collisions: -/* 0C53FC 7F0908CC 0FC227E3 */ jal get_obj_collision_flag -/* 0C5400 7F0908D0 00000000 */ nop -/* 0C5404 7F0908D4 0FC227E0 */ jal set_obj_collision_flag -/* 0C5408 7F0908D8 2C440001 */ sltiu $a0, $v0, 1 -/* 0C540C 7F0908DC 10000166 */ b .L7F090E78 -/* 0C5410 7F0908E0 8FB80018 */ lw $t8, 0x18($sp) -debug_allguns: -/* 0C5414 7F0908E4 0FC26919 */ jal getPlayerCount -/* 0C5418 7F0908E8 AFA0005C */ sw $zero, 0x5c($sp) -/* 0C541C 7F0908EC 58400162 */ blezl $v0, .L7F090E78 -/* 0C5420 7F0908F0 8FB80018 */ lw $t8, 0x18($sp) -.L7F0908F4: -/* 0C5424 7F0908F4 0FC26C43 */ jal set_cur_player -/* 0C5428 7F0908F8 8FA4005C */ lw $a0, 0x5c($sp) -/* 0C542C 7F0908FC 0FC230AB */ jal bondinvGetAllGunsFlag -/* 0C5430 7F090900 00000000 */ nop -/* 0C5434 7F090904 0FC230A7 */ jal bondinvSetAllGunsFlag -/* 0C5438 7F090908 2C440001 */ sltiu $a0, $v0, 1 -/* 0C543C 7F09090C 8FAA005C */ lw $t2, 0x5c($sp) -/* 0C5440 7F090910 254B0001 */ addiu $t3, $t2, 1 -/* 0C5444 7F090914 0FC26919 */ jal getPlayerCount -/* 0C5448 7F090918 AFAB005C */ sw $t3, 0x5c($sp) -/* 0C544C 7F09091C 8FAC005C */ lw $t4, 0x5c($sp) -/* 0C5450 7F090920 0182082A */ slt $at, $t4, $v0 -/* 0C5454 7F090924 1420FFF3 */ bnez $at, .L7F0908F4 -/* 0C5458 7F090928 00000000 */ nop -/* 0C545C 7F09092C 10000152 */ b .L7F090E78 -/* 0C5460 7F090930 8FB80018 */ lw $t8, 0x18($sp) -debug_maxammo: -/* 0C5464 7F090934 0FC26C54 */ jal get_cur_playernum -/* 0C5468 7F090938 00000000 */ nop -/* 0C546C 7F09093C AFA20054 */ sw $v0, 0x54($sp) -/* 0C5470 7F090940 0FC26919 */ jal getPlayerCount -/* 0C5474 7F090944 AFA00058 */ sw $zero, 0x58($sp) -/* 0C5478 7F090948 1840000D */ blez $v0, .L7F090980 -/* 0C547C 7F09094C 00000000 */ nop -.L7F090950: -/* 0C5480 7F090950 0FC26C43 */ jal set_cur_player -/* 0C5484 7F090954 8FA40058 */ lw $a0, 0x58($sp) -/* 0C5488 7F090958 0FC1A4BC */ jal set_max_ammo_for_cur_player -/* 0C548C 7F09095C 00000000 */ nop -/* 0C5490 7F090960 8FAD0058 */ lw $t5, 0x58($sp) -/* 0C5494 7F090964 25AE0001 */ addiu $t6, $t5, 1 -/* 0C5498 7F090968 0FC26919 */ jal getPlayerCount -/* 0C549C 7F09096C AFAE0058 */ sw $t6, 0x58($sp) -/* 0C54A0 7F090970 8FAF0058 */ lw $t7, 0x58($sp) -/* 0C54A4 7F090974 01E2082A */ slt $at, $t7, $v0 -/* 0C54A8 7F090978 1420FFF5 */ bnez $at, .L7F090950 -/* 0C54AC 7F09097C 00000000 */ nop -.L7F090980: -/* 0C54B0 7F090980 0FC26C43 */ jal set_cur_player -/* 0C54B4 7F090984 8FA40054 */ lw $a0, 0x54($sp) -/* 0C54B8 7F090988 1000013B */ b .L7F090E78 -/* 0C54BC 7F09098C 8FB80018 */ lw $t8, 0x18($sp) -debug_displayspeed: -/* 0C54C0 7F090990 3C028003 */ lui $v0, %hi(memusage_display_flag) -/* 0C54C4 7F090994 24426F74 */ addiu $v0, %lo(memusage_display_flag) # addiu $v0, $v0, 0x6f74 -/* 0C54C8 7F090998 8C580000 */ lw $t8, ($v0) -/* 0C54CC 7F09099C 3B190001 */ xori $t9, $t8, 1 -/* 0C54D0 7F0909A0 17200134 */ bnez $t9, .L7F090E74 -/* 0C54D4 7F0909A4 AC590000 */ sw $t9, ($v0) -/* 0C54D8 7F0909A8 0C002BC0 */ jal debmenuReset -/* 0C54DC 7F0909AC 00000000 */ nop -/* 0C54E0 7F0909B0 10000131 */ b .L7F090E78 -/* 0C54E4 7F0909B4 8FB80018 */ lw $t8, 0x18($sp) -debug_dodrawbg: -/* 0C54E8 7F0909B8 3C028003 */ lui $v0, %hi(debug_do_draw_bg) -/* 0C54EC 7F0909BC 24426F78 */ addiu $v0, %lo(debug_do_draw_bg) # addiu $v0, $v0, 0x6f78 -/* 0C54F0 7F0909C0 8C490000 */ lw $t1, ($v0) -/* 0C54F4 7F0909C4 392A0001 */ xori $t2, $t1, 1 -/* 0C54F8 7F0909C8 1000012A */ b .L7F090E74 -/* 0C54FC 7F0909CC AC4A0000 */ sw $t2, ($v0) -debug_dodrawobj: -/* 0C5500 7F0909D0 3C028003 */ lui $v0, %hi(debug_do_draw_obj) -/* 0C5504 7F0909D4 24426F7C */ addiu $v0, %lo(debug_do_draw_obj) # addiu $v0, $v0, 0x6f7c -/* 0C5508 7F0909D8 8C4B0000 */ lw $t3, ($v0) -/* 0C550C 7F0909DC 396C0001 */ xori $t4, $t3, 1 -/* 0C5510 7F0909E0 10000124 */ b .L7F090E74 -/* 0C5514 7F0909E4 AC4C0000 */ sw $t4, ($v0) -debug_stanhit: -/* 0C5518 7F0909E8 3C028003 */ lui $v0, %hi(debug_stanhit_flag) -/* 0C551C 7F0909EC 24426F84 */ addiu $v0, %lo(debug_stanhit_flag) # addiu $v0, $v0, 0x6f84 -/* 0C5520 7F0909F0 8C4D0000 */ lw $t5, ($v0) -/* 0C5524 7F0909F4 39AE0001 */ xori $t6, $t5, 1 -/* 0C5528 7F0909F8 1000011E */ b .L7F090E74 -/* 0C552C 7F0909FC AC4E0000 */ sw $t6, ($v0) -debug_stanregion: -/* 0C5530 7F090A00 3C028003 */ lui $v0, %hi(debug_stanregion_flag) -/* 0C5534 7F090A04 24426F88 */ addiu $v0, %lo(debug_stanregion_flag) # addiu $v0, $v0, 0x6f88 -/* 0C5538 7F090A08 8C4F0000 */ lw $t7, ($v0) -/* 0C553C 7F090A0C 39F80001 */ xori $t8, $t7, 1 -/* 0C5540 7F090A10 10000118 */ b .L7F090E74 -/* 0C5544 7F090A14 AC580000 */ sw $t8, ($v0) -debug_turbo: -/* 0C5548 7F090A18 3C028003 */ lui $v0, %hi(debug_stan_problems_flag) -/* 0C554C 7F090A1C 24426F8C */ addiu $v0, %lo(debug_stan_problems_flag) # addiu $v0, $v0, 0x6f8c -/* 0C5550 7F090A20 8C590000 */ lw $t9, ($v0) -/* 0C5554 7F090A24 3B280001 */ xori $t0, $t9, 1 -/* 0C5558 7F090A28 10000112 */ b .L7F090E74 -/* 0C555C 7F090A2C AC480000 */ sw $t0, ($v0) -debug_printmanpos: -/* 0C5560 7F090A30 3C028003 */ lui $v0, %hi(debug_man_pos_flag) -/* 0C5564 7F090A34 24426F90 */ addiu $v0, %lo(debug_man_pos_flag) # addiu $v0, $v0, 0x6f90 -/* 0C5568 7F090A38 8C490000 */ lw $t1, ($v0) -/* 0C556C 7F090A3C 392A0001 */ xori $t2, $t1, 1 -/* 0C5570 7F090A40 1000010C */ b .L7F090E74 -/* 0C5574 7F090A44 AC4A0000 */ sw $t2, ($v0) -debug_testingmanpos: -/* 0C5578 7F090A48 3C028003 */ lui $v0, %hi(debug_testingmanpos_flag) -/* 0C557C 7F090A4C 24426FC8 */ addiu $v0, %lo(debug_testingmanpos_flag) # addiu $v0, $v0, 0x6fc8 -/* 0C5580 7F090A50 8C4B0000 */ lw $t3, ($v0) -/* 0C5584 7F090A54 396C0001 */ xori $t4, $t3, 1 -/* 0C5588 7F090A58 10000106 */ b .L7F090E74 -/* 0C558C 7F090A5C AC4C0000 */ sw $t4, ($v0) -debug_playtitle: -/* 0C5590 7F090A60 0C001A54 */ jal bossSetLoadedStage -/* 0C5594 7F090A64 2404005A */ li $a0, 90 -/* 0C5598 7F090A68 10000103 */ b .L7F090E78 -/* 0C559C 7F090A6C 8FB80018 */ lw $t8, 0x18($sp) -debug_bonddie: -/* 0C55A0 7F090A70 0FC225EA */ jal bondviewKillCurrentPlayer -/* 0C55A4 7F090A74 00000000 */ nop -/* 0C55A8 7F090A78 100000FF */ b .L7F090E78 -/* 0C55AC 7F090A7C 8FB80018 */ lw $t8, 0x18($sp) -debug_prroomloads: -/* 0C55B0 7F090A80 3C028003 */ lui $v0, %hi(debug_prroomloads_flag) -/* 0C55B4 7F090A84 24426F94 */ addiu $v0, %lo(debug_prroomloads_flag) # addiu $v0, $v0, 0x6f94 -/* 0C55B8 7F090A88 8C4D0000 */ lw $t5, ($v0) -/* 0C55BC 7F090A8C 39AE0001 */ xori $t6, $t5, 1 -/* 0C55C0 7F090A90 100000F8 */ b .L7F090E74 -/* 0C55C4 7F090A94 AC4E0000 */ sw $t6, ($v0) -debug_showmemuse: -/* 0C55C8 7F090A98 0C0017FD */ jal bossEnableShowMemUseFlag -/* 0C55CC 7F090A9C 00000000 */ nop -/* 0C55D0 7F090AA0 100000F5 */ b .L7F090E78 -/* 0C55D4 7F090AA4 8FB80018 */ lw $t8, 0x18($sp) -debug_showmembars: -/* 0C55D8 7F090AA8 0C001801 */ jal bossMemBarsFlagToggle -/* 0C55DC 7F090AAC 00000000 */ nop -/* 0C55E0 7F090AB0 100000F1 */ b .L7F090E78 -/* 0C55E4 7F090AB4 8FB80018 */ lw $t8, 0x18($sp) -debug_grabrgb: -/* 0C55E8 7F090AB8 24030001 */ li $v1, 1 -/* 0C55EC 7F090ABC 3C018003 */ lui $at, %hi(g_DebugScreenshotRgb) -/* 0C55F0 7F090AC0 AC236FFC */ sw $v1, %lo(g_DebugScreenshotRgb)($at) -/* 0C55F4 7F090AC4 0C0038B4 */ jal osViBlack -/* 0C55F8 7F090AC8 24040001 */ li $a0, 1 -/* 0C55FC 7F090ACC 0C000F04 */ jal viSetColorMode32Bit -/* 0C5600 7F090AD0 00000000 */ nop -/* 0C5604 7F090AD4 100000E8 */ b .L7F090E78 -/* 0C5608 7F090AD8 8FB80018 */ lw $t8, 0x18($sp) -debug_grabjpeg: -/* 0C560C 7F090ADC 24030001 */ li $v1, 1 -/* 0C5610 7F090AE0 3C018003 */ lui $at, %hi(g_DebugScreenshotJpg) -/* 0C5614 7F090AE4 AC237000 */ sw $v1, %lo(g_DebugScreenshotJpg)($at) -/* 0C5618 7F090AE8 0C0038B4 */ jal osViBlack -/* 0C561C 7F090AEC 24040001 */ li $a0, 1 -/* 0C5620 7F090AF0 0C000F04 */ jal viSetColorMode32Bit -/* 0C5624 7F090AF4 00000000 */ nop -/* 0C5628 7F090AF8 100000DF */ b .L7F090E78 -/* 0C562C 7F090AFC 8FB80018 */ lw $t8, 0x18($sp) -debug_taskgrab: -/* 0C5630 7F090B00 3C028003 */ lui $v0, %hi(debug_enable_taskgrab_flag) -/* 0C5634 7F090B04 24426FC4 */ addiu $v0, %lo(debug_enable_taskgrab_flag) # addiu $v0, $v0, 0x6fc4 -/* 0C5638 7F090B08 8C4F0000 */ lw $t7, ($v0) -/* 0C563C 7F090B0C 39F80001 */ xori $t8, $t7, 1 -/* 0C5640 7F090B10 100000D8 */ b .L7F090E74 -/* 0C5644 7F090B14 AC580000 */ sw $t8, ($v0) -debug_recordramrom: -/* 0C5648 7F090B18 0FC301EF */ jal setRamRomRecordSlot -/* 0C564C 7F090B1C 00002025 */ move $a0, $zero -/* 0C5650 7F090B20 100000D5 */ b .L7F090E78 -/* 0C5654 7F090B24 8FB80018 */ lw $t8, 0x18($sp) -debug_ramrom_record1: -/* 0C5658 7F090B28 0FC301EF */ jal setRamRomRecordSlot -/* 0C565C 7F090B2C 24040001 */ li $a0, 1 -/* 0C5660 7F090B30 100000D1 */ b .L7F090E78 -/* 0C5664 7F090B34 8FB80018 */ lw $t8, 0x18($sp) -debug_ramrom_record2: -/* 0C5668 7F090B38 0FC301EF */ jal setRamRomRecordSlot -/* 0C566C 7F090B3C 24040002 */ li $a0, 2 -/* 0C5670 7F090B40 100000CD */ b .L7F090E78 -/* 0C5674 7F090B44 8FB80018 */ lw $t8, 0x18($sp) -debug_ramrom_record3: -/* 0C5678 7F090B48 0FC301EF */ jal setRamRomRecordSlot -/* 0C567C 7F090B4C 24040003 */ li $a0, 3 -/* 0C5680 7F090B50 100000C9 */ b .L7F090E78 -/* 0C5684 7F090B54 8FB80018 */ lw $t8, 0x18($sp) -debug_replayramrom: -/* 0C5688 7F090B58 0FC3022A */ jal replay_recorded_ramrom_from_indy -/* 0C568C 7F090B5C 00000000 */ nop -/* 0C5690 7F090B60 100000C5 */ b .L7F090E78 -/* 0C5694 7F090B64 8FB80018 */ lw $t8, 0x18($sp) -debug_saveramrom: -/* 0C5698 7F090B68 0FC2FF58 */ jal save_ramrom_to_devtool -/* 0C569C 7F090B6C 00000000 */ nop -/* 0C56A0 7F090B70 100000C1 */ b .L7F090E78 -/* 0C56A4 7F090B74 8FB80018 */ lw $t8, 0x18($sp) -debug_loadramrom: -/* 0C56A8 7F090B78 0FC2FF80 */ jal load_ramrom_from_devtool -/* 0C56AC 7F090B7C 00000000 */ nop -/* 0C56B0 7F090B80 100000BD */ b .L7F090E78 -/* 0C56B4 7F090B84 8FB80018 */ lw $t8, 0x18($sp) -debug_autoyaim: -/* 0C56B8 7F090B88 0FC1F160 */ jal get_BONDdata_autoaim_y -/* 0C56BC 7F090B8C 00000000 */ nop -/* 0C56C0 7F090B90 0FC1F15C */ jal set_BONDdata_autoaim_y -/* 0C56C4 7F090B94 2C440001 */ sltiu $a0, $v0, 1 -/* 0C56C8 7F090B98 100000B7 */ b .L7F090E78 -/* 0C56CC 7F090B9C 8FB80018 */ lw $t8, 0x18($sp) -debug_autoxaim: -/* 0C56D0 7F090BA0 0FC1F19A */ jal get_BONDdata_autoaim_x -/* 0C56D4 7F090BA4 00000000 */ nop -/* 0C56D8 7F090BA8 0FC1F196 */ jal set_BONDdata_autoaim_x -/* 0C56DC 7F090BAC 2C440001 */ sltiu $a0, $v0, 1 -/* 0C56E0 7F090BB0 100000B1 */ b .L7F090E78 -/* 0C56E4 7F090BB4 8FB80018 */ lw $t8, 0x18($sp) -debug_007: -/* 0C56E8 7F090BB8 3C028003 */ lui $v0, %hi(debug_007_unlock_flag) -/* 0C56EC 7F090BBC 24426FAC */ addiu $v0, %lo(debug_007_unlock_flag) # addiu $v0, $v0, 0x6fac -/* 0C56F0 7F090BC0 8C590000 */ lw $t9, ($v0) -/* 0C56F4 7F090BC4 3B280001 */ xori $t0, $t9, 1 -/* 0C56F8 7F090BC8 100000AA */ b .L7F090E74 -/* 0C56FC 7F090BCC AC480000 */ sw $t0, ($v0) -debug_agent: -/* 0C5700 7F090BD0 3C028003 */ lui $v0, %hi(debug_enable_agent_levels_flag) -/* 0C5704 7F090BD4 24426FB0 */ addiu $v0, %lo(debug_enable_agent_levels_flag) # addiu $v0, $v0, 0x6fb0 -/* 0C5708 7F090BD8 8C490000 */ lw $t1, ($v0) -/* 0C570C 7F090BDC 392A0001 */ xori $t2, $t1, 1 -/* 0C5710 7F090BE0 100000A4 */ b .L7F090E74 -/* 0C5714 7F090BE4 AC4A0000 */ sw $t2, ($v0) -debug_all: -/* 0C5718 7F090BE8 3C028003 */ lui $v0, %hi(debug_enable_all_levels_flag) -/* 0C571C 7F090BEC 24426FB4 */ addiu $v0, %lo(debug_enable_all_levels_flag) # addiu $v0, $v0, 0x6fb4 -/* 0C5720 7F090BF0 8C4B0000 */ lw $t3, ($v0) -/* 0C5724 7F090BF4 396C0001 */ xori $t4, $t3, 1 -/* 0C5728 7F090BF8 1000009E */ b .L7F090E74 -/* 0C572C 7F090BFC AC4C0000 */ sw $t4, ($v0) -fast_bond_debug: -/* 0C5730 7F090C00 3C028003 */ lui $v0, %hi(debug_fast_bond_flag) -/* 0C5734 7F090C04 24426FCC */ addiu $v0, %lo(debug_fast_bond_flag) # addiu $v0, $v0, 0x6fcc -/* 0C5738 7F090C08 8C4D0000 */ lw $t5, ($v0) -/* 0C573C 7F090C0C 39AE0001 */ xori $t6, $t5, 1 -/* 0C5740 7F090C10 10000098 */ b .L7F090E74 -/* 0C5744 7F090C14 AC4E0000 */ sw $t6, ($v0) -debug_objectives: -/* 0C5748 7F090C18 3C028003 */ lui $v0, %hi(debug_all_obj_complete_flag) -/* 0C574C 7F090C1C 24426FD0 */ addiu $v0, %lo(debug_all_obj_complete_flag) # addiu $v0, $v0, 0x6fd0 -/* 0C5750 7F090C20 8C4F0000 */ lw $t7, ($v0) -/* 0C5754 7F090C24 39F80001 */ xori $t8, $t7, 1 -/* 0C5758 7F090C28 10000092 */ b .L7F090E74 -/* 0C575C 7F090C2C AC580000 */ sw $t8, ($v0) -debug_showpatrols: -/* 0C5760 7F090C30 0FC07D5A */ jal get_show_patrols_flag -/* 0C5764 7F090C34 00000000 */ nop -/* 0C5768 7F090C38 0FC07D57 */ jal set_show_patrols_flag -/* 0C576C 7F090C3C 2C440001 */ sltiu $a0, $v0, 1 -/* 0C5770 7F090C40 1000008D */ b .L7F090E78 -/* 0C5774 7F090C44 8FB80018 */ lw $t8, 0x18($sp) -debug_intro: -/* 0C5778 7F090C48 0FC1EA6E */ jal set_camera_mode -/* 0C577C 7F090C4C 24040003 */ li $a0, 3 -/* 0C5780 7F090C50 10000089 */ b .L7F090E78 -/* 0C5784 7F090C54 8FB80018 */ lw $t8, 0x18($sp) -debug_intropos: -/* 0C5788 7F090C58 3C198003 */ lui $t9, %hi(debug_render_raster) -/* 0C578C 7F090C5C 8F396F64 */ lw $t9, %lo(debug_render_raster)($t9) -/* 0C5790 7F090C60 57200085 */ bnezl $t9, .L7F090E78 -/* 0C5794 7F090C64 8FB80018 */ lw $t8, 0x18($sp) -/* 0C5798 7F090C68 0FC24586 */ jal handle_debug_intropos -/* 0C579C 7F090C6C 00000000 */ nop -/* 0C57A0 7F090C70 10000081 */ b .L7F090E78 -/* 0C57A4 7F090C74 8FB80018 */ lw $t8, 0x18($sp) -debug_worldpos: -/* 0C57A8 7F090C78 3C088003 */ lui $t0, %hi(debug_render_raster) -/* 0C57AC 7F090C7C 8D086F64 */ lw $t0, %lo(debug_render_raster)($t0) -/* 0C57B0 7F090C80 15000005 */ bnez $t0, .L7F090C98 -/* 0C57B4 7F090C84 00000000 */ nop -/* 0C57B8 7F090C88 0FC2459B */ jal debugSetWorldPos -/* 0C57BC 7F090C8C 00000000 */ nop -/* 0C57C0 7F090C90 10000079 */ b .L7F090E78 -/* 0C57C4 7F090C94 8FB80018 */ lw $t8, 0x18($sp) -.L7F090C98: -/* 0C57C8 7F090C98 0FC225E6 */ jal get_curplayer_positiondata -/* 0C57CC 7F090C9C 00000000 */ nop -/* 0C57D0 7F090CA0 10400074 */ beqz $v0, .L7F090E74 -/* 0C57D4 7F090CA4 00401825 */ move $v1, $v0 -/* 0C57D8 7F090CA8 3C028003 */ lui $v0, %hi(player_pos_x) -/* 0C57DC 7F090CAC 24427004 */ addiu $v0, %lo(player_pos_x) # addiu $v0, $v0, 0x7004 -/* 0C57E0 7F090CB0 C4460000 */ lwc1 $f6, ($v0) -/* 0C57E4 7F090CB4 C4640008 */ lwc1 $f4, 8($v1) -/* 0C57E8 7F090CB8 C44A0004 */ lwc1 $f10, 4($v0) -/* 0C57EC 7F090CBC C468000C */ lwc1 $f8, 0xc($v1) -/* 0C57F0 7F090CC0 46062001 */ sub.s $f0, $f4, $f6 -/* 0C57F4 7F090CC4 C4520008 */ lwc1 $f18, 8($v0) -/* 0C57F8 7F090CC8 C4700010 */ lwc1 $f16, 0x10($v1) -/* 0C57FC 7F090CCC 460A4081 */ sub.s $f2, $f8, $f10 -/* 0C5800 7F090CD0 46000102 */ mul.s $f4, $f0, $f0 -/* 0C5804 7F090CD4 AFA30050 */ sw $v1, 0x50($sp) -/* 0C5808 7F090CD8 46128381 */ sub.s $f14, $f16, $f18 -/* 0C580C 7F090CDC 46021182 */ mul.s $f6, $f2, $f2 -/* 0C5810 7F090CE0 46062200 */ add.s $f8, $f4, $f6 -/* 0C5814 7F090CE4 460E7282 */ mul.s $f10, $f14, $f14 -/* 0C5818 7F090CE8 0C007DF8 */ jal sqrtf -/* 0C581C 7F090CEC 460A4300 */ add.s $f12, $f8, $f10 -/* 0C5820 7F090CF0 8FA30050 */ lw $v1, 0x50($sp) -/* 0C5824 7F090CF4 3C028003 */ lui $v0, %hi(player_pos_x) -/* 0C5828 7F090CF8 24427004 */ addiu $v0, %lo(player_pos_x) # addiu $v0, $v0, 0x7004 -/* 0C582C 7F090CFC C4700008 */ lwc1 $f16, 8($v1) -/* 0C5830 7F090D00 E4500000 */ swc1 $f16, ($v0) -/* 0C5834 7F090D04 C472000C */ lwc1 $f18, 0xc($v1) -/* 0C5838 7F090D08 E4520004 */ swc1 $f18, 4($v0) -/* 0C583C 7F090D0C C4640010 */ lwc1 $f4, 0x10($v1) -/* 0C5840 7F090D10 10000058 */ b .L7F090E74 -/* 0C5844 7F090D14 E4440008 */ swc1 $f4, 8($v0) -debug_chrkeypos: -/* 0C5848 7F090D18 0FC2406C */ jal get_highlighted_debug_option -/* 0C584C 7F090D1C 00000000 */ nop -/* 0C5850 7F090D20 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C5854 7F090D24 10000053 */ b .L7F090E74 -/* 0C5858 7F090D28 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_chrnum: -/* 0C585C 7F090D2C 3C028003 */ lui $v0, %hi(debug_chrnum_flag) -/* 0C5860 7F090D30 24426FB8 */ addiu $v0, %lo(debug_chrnum_flag) # addiu $v0, $v0, 0x6fb8 -/* 0C5864 7F090D34 8C490000 */ lw $t1, ($v0) -/* 0C5868 7F090D38 392A0001 */ xori $t2, $t1, 1 -/* 0C586C 7F090D3C 1000004D */ b .L7F090E74 -/* 0C5870 7F090D40 AC4A0000 */ sw $t2, ($v0) -debug_viscvg: -/* 0C5874 7F090D44 3C028003 */ lui $v0, %hi(debug_VisCVG_flag) -/* 0C5878 7F090D48 24426FA8 */ addiu $v0, %lo(debug_VisCVG_flag) # addiu $v0, $v0, 0x6fa8 -/* 0C587C 7F090D4C 8C4B0000 */ lw $t3, ($v0) -/* 0C5880 7F090D50 396C0001 */ xori $t4, $t3, 1 -/* 0C5884 7F090D54 10000047 */ b .L7F090E74 -/* 0C5888 7F090D58 AC4C0000 */ sw $t4, ($v0) -debug_joy2skyedit: -/* 0C588C 7F090D5C 3C028003 */ lui $v0, %hi(debug_joy2skyedit_flag) -/* 0C5890 7F090D60 24426F98 */ addiu $v0, %lo(debug_joy2skyedit_flag) # addiu $v0, $v0, 0x6f98 -/* 0C5894 7F090D64 8C4D0000 */ lw $t5, ($v0) -/* 0C5898 7F090D68 39AE0001 */ xori $t6, $t5, 1 -/* 0C589C 7F090D6C 10000041 */ b .L7F090E74 -/* 0C58A0 7F090D70 AC4E0000 */ sw $t6, ($v0) -debug_joy2hitsedit: -/* 0C58A4 7F090D74 3C028003 */ lui $v0, %hi(debug_joy2hitsedit_flag) -/* 0C58A8 7F090D78 24426F9C */ addiu $v0, %lo(debug_joy2hitsedit_flag) # addiu $v0, $v0, 0x6f9c -/* 0C58AC 7F090D7C 8C4F0000 */ lw $t7, ($v0) -/* 0C58B0 7F090D80 39F80001 */ xori $t8, $t7, 1 -/* 0C58B4 7F090D84 1000003B */ b .L7F090E74 -/* 0C58B8 7F090D88 AC580000 */ sw $t8, ($v0) -debug_joy2detailedit: -/* 0C58BC 7F090D8C 3C028003 */ lui $v0, %hi(debug_joy2detailedit_flag) -/* 0C58C0 7F090D90 24426FA0 */ addiu $v0, %lo(debug_joy2detailedit_flag) # addiu $v0, $v0, 0x6fa0 -/* 0C58C4 7F090D94 8C590000 */ lw $t9, ($v0) -/* 0C58C8 7F090D98 3B280001 */ xori $t0, $t9, 1 -/* 0C58CC 7F090D9C 10000035 */ b .L7F090E74 -/* 0C58D0 7F090DA0 AC480000 */ sw $t0, ($v0) -debug_explosioninfo: -/* 0C58D4 7F090DA4 3C028003 */ lui $v0, %hi(debug_explosioninfo_flag) -/* 0C58D8 7F090DA8 24426FA4 */ addiu $v0, %lo(debug_explosioninfo_flag) # addiu $v0, $v0, 0x6fa4 -/* 0C58DC 7F090DAC 8C490000 */ lw $t1, ($v0) -/* 0C58E0 7F090DB0 392A0001 */ xori $t2, $t1, 1 -/* 0C58E4 7F090DB4 1000002F */ b .L7F090E74 -/* 0C58E8 7F090DB8 AC4A0000 */ sw $t2, ($v0) -debug_magicfog: -/* 0C58EC 7F090DBC 0FC2406C */ jal get_highlighted_debug_option -/* 0C58F0 7F090DC0 00000000 */ nop -/* 0C58F4 7F090DC4 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C58F8 7F090DC8 1000002A */ b .L7F090E74 -/* 0C58FC 7F090DCC AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_fog: -/* 0C5900 7F090DD0 0FC2406C */ jal get_highlighted_debug_option -/* 0C5904 7F090DD4 00000000 */ nop -/* 0C5908 7F090DD8 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C590C 7F090DDC 10000025 */ b .L7F090E74 -/* 0C5910 7F090DE0 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -debug_gunwatchpos: -/* 0C5914 7F090DE4 3C028003 */ lui $v0, %hi(debug_gunwatchpos_flags) -/* 0C5918 7F090DE8 24426FBC */ addiu $v0, %lo(debug_gunwatchpos_flags) # addiu $v0, $v0, 0x6fbc -/* 0C591C 7F090DEC 8C4B0000 */ lw $t3, ($v0) -/* 0C5920 7F090DF0 396C0001 */ xori $t4, $t3, 1 -/* 0C5924 7F090DF4 1000001F */ b .L7F090E74 -/* 0C5928 7F090DF8 AC4C0000 */ sw $t4, ($v0) -debug_roomblocks: -/* 0C592C 7F090DFC 0FC0F9A6 */ jal removed_debug_roomblocks_feature -/* 0C5930 7F090E00 00000000 */ nop -/* 0C5934 7F090E04 1000001C */ b .L7F090E78 -/* 0C5938 7F090E08 8FB80018 */ lw $t8, 0x18($sp) -debug_profile: -/* 0C593C 7F090E0C 3C028003 */ lui $v0, %hi(debug_profile_flag) -/* 0C5940 7F090E10 24426FC0 */ addiu $v0, %lo(debug_profile_flag) # addiu $v0, $v0, 0x6fc0 -/* 0C5944 7F090E14 8C4D0000 */ lw $t5, ($v0) -/* 0C5948 7F090E18 39AE0001 */ xori $t6, $t5, 1 -/* 0C594C 7F090E1C 11C00005 */ beqz $t6, .L7F090E34 -/* 0C5950 7F090E20 AC4E0000 */ sw $t6, ($v0) -/* 0C5954 7F090E24 0FC24164 */ jal removed_do_debug_profile_flag_false -/* 0C5958 7F090E28 00000000 */ nop -/* 0C595C 7F090E2C 10000012 */ b .L7F090E78 -/* 0C5960 7F090E30 8FB80018 */ lw $t8, 0x18($sp) -.L7F090E34: -/* 0C5964 7F090E34 0FC24166 */ jal removed_do_debug_profile_flag_true -/* 0C5968 7F090E38 00000000 */ nop -/* 0C596C 7F090E3C 1000000E */ b .L7F090E78 -/* 0C5970 7F090E40 8FB80018 */ lw $t8, 0x18($sp) -debug_objload: -/* 0C5974 7F090E44 0FC00496 */ jal debug_object_load_all_models -/* 0C5978 7F090E48 00000000 */ nop -/* 0C597C 7F090E4C 1000000A */ b .L7F090E78 -/* 0C5980 7F090E50 8FB80018 */ lw $t8, 0x18($sp) -debug_weaponload: -/* 0C5984 7F090E54 0FC00503 */ jal debug_weapon_load_table -/* 0C5988 7F090E58 00000000 */ nop -/* 0C598C 7F090E5C 10000006 */ b .L7F090E78 -/* 0C5990 7F090E60 8FB80018 */ lw $t8, 0x18($sp) -debug_introedit: -/* 0C5994 7F090E64 0FC2406C */ jal get_highlighted_debug_option -/* 0C5998 7F090E68 00000000 */ nop -/* 0C599C 7F090E6C 3C018003 */ lui $at, %hi(g_DebugHighlightedOption) -/* 0C59A0 7F090E70 AC226F70 */ sw $v0, %lo(g_DebugHighlightedOption)($at) -def_7F090770: -.L7F090E74: -/* 0C59A4 7F090E74 8FB80018 */ lw $t8, 0x18($sp) -.L7F090E78: -/* 0C59A8 7F090E78 33190003 */ andi $t9, $t8, 3 -/* 0C59AC 7F090E7C 5320000D */ beql $t9, $zero, .L7F090EB4 -/* 0C59B0 7F090E80 8FA90018 */ lw $t1, 0x18($sp) -/* 0C59B4 7F090E84 0FC2406C */ jal get_highlighted_debug_option -/* 0C59B8 7F090E88 00000000 */ nop -/* 0C59BC 7F090E8C 2448FFCE */ addiu $t0, $v0, -0x32 -/* 0C59C0 7F090E90 2D010005 */ sltiu $at, $t0, 5 -/* 0C59C4 7F090E94 10200006 */ beqz $at, .L7F090EB0 -/* 0C59C8 7F090E98 00084080 */ sll $t0, $t0, 2 -/* 0C59CC 7F090E9C 3C018005 */ lui $at, %hi(jpt_80055830) -/* 0C59D0 7F090EA0 00280821 */ addu $at, $at, $t0 -/* 0C59D4 7F090EA4 8C285830 */ lw $t0, %lo(jpt_80055830)($at) -/* 0C59D8 7F090EA8 01000008 */ jr $t0 -/* 0C59DC 7F090EAC 00000000 */ nop -def_7F090EA8: -.L7F090EB0: -/* 0C59E0 7F090EB0 8FA90018 */ lw $t1, 0x18($sp) -.L7F090EB4: -/* 0C59E4 7F090EB4 3C0B8003 */ lui $t3, %hi(show_debug_menu_flag) -/* 0C59E8 7F090EB8 312A1000 */ andi $t2, $t1, 0x1000 -/* 0C59EC 7F090EBC 11400009 */ beqz $t2, .L7F090EE4 -/* 0C59F0 7F090EC0 00000000 */ nop -/* 0C59F4 7F090EC4 8D6B6FF8 */ lw $t3, %lo(show_debug_menu_flag)($t3) -/* 0C59F8 7F090EC8 24010001 */ li $at, 1 -/* 0C59FC 7F090ECC 15610003 */ bne $t3, $at, .L7F090EDC -/* 0C5A00 7F090ED0 00000000 */ nop -/* 0C5A04 7F090ED4 0C002BC0 */ jal debmenuReset -/* 0C5A08 7F090ED8 00000000 */ nop -.L7F090EDC: -/* 0C5A0C 7F090EDC 3C018003 */ lui $at, %hi(show_debug_menu_flag) -/* 0C5A10 7F090EE0 AC206FF8 */ sw $zero, %lo(show_debug_menu_flag)($at) -.L7F090EE4: -/* 0C5A14 7F090EE4 3C028003 */ lui $v0, %hi(show_debug_menu_flag) -/* 0C5A18 7F090EE8 8C426FF8 */ lw $v0, %lo(show_debug_menu_flag)($v0) -.L7F090EEC: -/* 0C5A1C 7F090EEC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0C5A20 7F090EF0 27BD0060 */ addiu $sp, $sp, 0x60 -/* 0C5A24 7F090EF4 03E00008 */ jr $ra -/* 0C5A28 7F090EF8 00000000 */ nop -) -#else s32 debug_menu_processor(s8 stick_h, s8 stick_v, u16 button_held, u16 button_pressed) { return 0; } #endif -#endif + s32 get_debug_render_raster(void) { #if defined(LEFTOVERDEBUG) @@ -1624,7 +960,7 @@ s32 get_debug_man_pos_flag(void) { s32 get_debug_testingmanpos_flag(void) { #if defined(LEFTOVERDEBUG) - return debug_testingmanpos_flag; + return g_DebugManPos; #else return 0; #endif @@ -1632,7 +968,7 @@ s32 get_debug_testingmanpos_flag(void) { void set_debug_testingmanpos_flag(s32 flag) { #if defined(LEFTOVERDEBUG) - debug_testingmanpos_flag = flag; + g_DebugManPos = flag; #endif } @@ -1668,7 +1004,7 @@ s32 get_debug_explosioninfo_flag(void) { #endif } -s32 get_debug_prroomloads_flag(void) { +s32 debugIsRoomStateDebugEnabled(void) { #if defined(LEFTOVERDEBUG) return debug_prroomloads_flag; #else diff --git a/src/game/debugmenu_handler.h b/src/game/debugmenu_handler.h index e9df7042..24ea55a1 100644 --- a/src/game/debugmenu_handler.h +++ b/src/game/debugmenu_handler.h @@ -31,7 +31,7 @@ s32 get_debug_joy2skyedit_flag(void); s32 get_debug_joy2hitsedit_flag(void); s32 get_debug_joy2detailedit_flag(void); s32 get_debug_explosioninfo_flag(void); -s32 get_debug_prroomloads_flag(void); +s32 debugIsRoomStateDebugEnabled(void); s32 get_debug_VisCVG_flag(void); void set_debug_VisCVG_flag(s32 flag); s32 get_debug_007_unlock_flag(void); diff --git a/src/game/decompress.c b/src/game/decompress.c index 72d73508..549a851f 100644 --- a/src/game/decompress.c +++ b/src/game/decompress.c @@ -13,27 +13,71 @@ const u8 rz_header_bytes[40] = { #ifdef NONMATCHING -// -u32 decompressdata(u8 *src, u8 *dst, struct huft *hlist) -{ - rz_inbuf = src; - rz_outbuf = dst; - rz_hlist = hlist; - if ((src[0] != rz_header_bytes[0]) || (src[1] != rz_header_bytes[5])) +// https://decomp.me/scratch/IRSKp 96% + +struct aaa { + u8 unk00; + u8 unk01; + u8 unk02; + u8 unk03; + u8 unk04; + u8 unk05; + u8 unk06; + u8 unk07; + u8 unk08; + u8 unk09; + u8 unk0A; + u8 unk0B; + s32 unk0C; + s32 unk10; + s32 unk14; + u8 unk18; +}; + +u32 decompressdata(u8 *arg0, u8 *arg1, struct huft *arg2) +{ + s32 unused = 0; + struct aaa *p = &rz_header_bytes; + + rz_inbuf = arg0; + rz_outbuf = arg1; + rz_hlist = arg2; + + //if(1); + + //if ((arg0[0] != rz_header_bytes[0]) || (arg0[1] != rz_header_bytes[5])) + if ((arg0[0] != p->unk00) || (arg0[1] != p->unk05)) { - if (src[1] != rz_header_bytes[8]) + u8 a0m1;// = arg0[-1]; + u8 a0m2;// = arg0[-2]; + + //if(arg0[-1]); + a0m1 = arg0[-1]; + + //if (arg0[-1] == rz_header_bytes[8]) + if (a0m1 == p->unk08) { - + unused = 2; } - if (src[2] != rz_header_bytes[0x18]) - { + //if(arg0[-2]); + a0m2 = arg0[-2]; + + //if (arg0[-2] == rz_header_bytes[24]) + if (a0m2 == p->unk18) + { + unused = 1; } } - rz_inbuf = (s32) (rz_inbuf + 2); + + if (unused); + + rz_inbuf += 2; rz_wp = 0; rz_inptr = 0; + zlib_inflate(); + return rz_wp; } #else diff --git a/src/game/dyn.c b/src/game/dyn.c index 3c66a780..d5f50b7e 100644 --- a/src/game/dyn.c +++ b/src/game/dyn.c @@ -3,6 +3,7 @@ #include #include #include +#include /** * This file handles memory usage for graphics related tasks. @@ -40,7 +41,7 @@ char membars_string1[] = ">>>>>>>>>>>>>>>>>>>>>>>>>"; char membars_string2[] = "========================="; char membars_string3[] = "-------------------------"; -void dynInitDebugNoticeList(void) { +void dynInit(void) { debTryAdd(&D_800482E0, "dyn_c_debug"); } @@ -118,40 +119,26 @@ s32 dynGetFreeVtx(void) { return g_VtxBuffers[g_GfxActiveBufferIndex + 1] - g_GfxMemPos; } -#ifdef NONMATCHING -// $f2 is used for 0.0f instead of $f0 -f32 dynCalculateMembarLength(const char* arg0, f32 arg1, f32 arg2) { - strlen(arg0); +// Address 0x7F0BD7CC NTSC +void dynCalculateMembarLength(const char* arg0, f32 arg1, f32 arg2) +{ + s32 len; + f32 zero = 0; + + len = strlen(arg0); + arg1 /= arg2; - if (arg1 < 0.0f) { - return 0.0f; + + if(zero); + + if (arg1 < zero && len > 1) + { + if (len > 1) + { + + } } } -#else -f32 dynCalculateMembarLength(const char* arg0, f32 arg1, f32 arg2); -GLOBAL_ASM( -.text -glabel dynCalculateMembarLength -/* 0F22FC 7F0BD7CC 44856000 */ mtc1 $a1, $f12 -/* 0F2300 7F0BD7D0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0F2304 7F0BD7D4 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F2308 7F0BD7D8 AFA60020 */ sw $a2, 0x20($sp) -/* 0F230C 7F0BD7DC 0C004E1F */ jal strlen -/* 0F2310 7F0BD7E0 E7AC001C */ swc1 $f12, 0x1c($sp) -/* 0F2314 7F0BD7E4 C7AC001C */ lwc1 $f12, 0x1c($sp) -/* 0F2318 7F0BD7E8 C7A40020 */ lwc1 $f4, 0x20($sp) -/* 0F231C 7F0BD7EC 44800000 */ mtc1 $zero, $f0 -/* 0F2320 7F0BD7F0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F2324 7F0BD7F4 46046303 */ div.s $f12, $f12, $f4 -/* 0F2328 7F0BD7F8 4600603C */ c.lt.s $f12, $f0 -/* 0F232C 7F0BD7FC 00000000 */ nop -/* 0F2330 7F0BD800 45000001 */ bc1f .L7F0BD808 -/* 0F2334 7F0BD804 00000000 */ nop -.L7F0BD808: -/* 0F2338 7F0BD808 03E00008 */ jr $ra -/* 0F233C 7F0BD80C 27BD0018 */ addiu $sp, $sp, 0x18 -) -#endif void dynDrawMembars(Gfx *gdl) { dynCalculateMembarLength(membars_string2, ((Gfx*)g_GfxBuffers[g_GfxActiveBufferIndex + 1] - gdl), ((Gfx*)g_GfxBuffers[g_GfxActiveBufferIndex + 1] - (Gfx*)g_GfxBuffers[g_GfxActiveBufferIndex])); diff --git a/src/game/dyn.h b/src/game/dyn.h index b9d4d756..eaac570f 100644 --- a/src/game/dyn.h +++ b/src/game/dyn.h @@ -3,12 +3,7 @@ #include -/* -* Align to 16 bit boundary. Version "a", with preliminary addition. -*/ -#define ALIGN16_a(val) (((val) + 0xf | 0xf) ^ 0xf) - -void dynInitDebugNoticeList(void); +void dynInit(void); void dynInitMemory(void); Gfx *dynGetMasterDisplayList(void); s32 dynGetFreeGfx2(Gfx *gdl); diff --git a/src/game/explosions.c b/src/game/explosions.c index 6f377653..15c01fd7 100644 --- a/src/game/explosions.c +++ b/src/game/explosions.c @@ -59,18 +59,18 @@ f32 D_80040178 = 1.0; #if defined(VERSION_EU) s_smoketype array_smoke_types[] = { - // dur, appr, dis, size, bgrate, r, g, b, fgrate, propclouds - { 0x0001, 0x0032, 0x0063, 0x0000, 0.0f, 0x80, 0x80, 0x80, 0.300000011921f, 0x0096 }, - { 0x0190, 0x0032, 0x0025, 0x003C, 0.019999999553f, 0x50, 0x50, 0x60, 0.300000011921f, 0x0096 }, - { 0x0190, 0x0032, 0x002A, 0x0014, 0.00999999977648f, 0x80, 0x80, 0x80, 0.300000011921f, 0x0096 }, - { 0x020D, 0x0032, 0x0064, 0x0064, 0.00999999977648f, 0xC0, 0xC0, 0xC0, 0.300000011921f, 0x0096 }, - { 0x020D, 0x0032, 0x0032, 0x0050, 0.019999999553f, 0x40, 0x40, 0x40, 0.300000011921f, 0x0096 }, - { 0x0280, 0x0032, 0x002A, 0x00BE, 0.15000000596f, 0x40, 0x40, 0x40, 0.300000011921f, 0x0096 }, - { 0x02EE, 0x0032, 0x003A, 0x012C, 0.00999999977648f, 0x40, 0x40, 0x40, 0.300000011921f, 0x0096 }, - { 0x0032, 0x0032, 0x0007, 0x000F, 0.0299999993294f, 0xFF, 0xFF, 0xFF, 0.300000011921f, 0x0096 }, - { 0x0011, 0x0001, 0x0005, 0x001E, 0.0299999993294f, 0xFF, 0xFF, 0xFF, 2.0f, 0x0019 }, - { 0x0015, 0x0001, 0x0006, 0x0010, 0.0299999993294f, 0xE0, 0xE0, 0xE0, 3.0f, 0x0019 }, - { 0x02EE, 0x0032, 0x003A, 0x0384, 0.00999999977648f, 0x40, 0x40, 0x40, 0.300000011921f, 0x0096 } + // dur, appr, dis, size, bgrate, r, g, b, fgrate, propclouds + { 1, 50, 99, 0, 0.0f, 128, 128, 128, 0.3f, 150 }, + { 400, 50, 37, 60, 0.02f, 80, 80, 96, 0.3f, 150 }, + { 400, 50, 42, 20, 0.01f, 128, 128, 128, 0.3f, 150 }, + { 525, 50, 100, 100, 0.01f, 192, 192, 192, 0.3f, 150 }, + { 525, 50, 50, 80, 0.02f, 64, 64, 64, 0.3f, 150 }, + { 640, 50, 42, 190, 0.15f, 64, 64, 64, 0.3f, 150 }, + { 750, 50, 58, 300, 0.01f, 64, 64, 64, 0.3f, 150 }, + { 50, 50, 7, 15, 0.03f, 255, 255, 255, 0.3f, 150 }, + { 17, 1, 5, 30, 0.03f, 255, 255, 255, 2.0f, 25 }, + { 21, 1, 6, 16, 0.03f, 224, 224, 224, 3.0f, 25 }, + { 750, 50, 58, 900, 0.01f, 64, 64, 64, 0.3f, 150 } }; #else //D:8004017C @@ -106,12 +106,14 @@ s_explosiontype array_explosion_types[] = { { 40.0f, 40.0f, 0.5f, 0.239999994635582f, 70.0f, 100.0f, 180.0f, 162, 4, 5.0f, 120, 6.0f, 30.0f, 2.5f, 6.0f, 4, EXPLOSION_5A_SFX, 1.0f}, { 50.0f, 50.0f, 0.699999988079071f, 0.5f, 100.0f, 150.0f, 260.0f, 150, 1, 4.0f, 150, 6.0f, 30.0f, 3.0f, 6.0f, 4, EXPLOSION_4A_SFX, 2.0f}, { 70.0f, 60.0f, 1.20000004768372f, 0.699999988079071f, 150.0f, 225.0f, 320.0f, 150, 2, 5.0f, 150, 6.0f, 30.0f, 4.0f, 12.0f, 5, EXPLOSION_4A_SFX, 4.0f}, + /* standard explosion for grenades and mines */ { 80.0f, 60.0f, 2.40000009536743f, 0.899999976158142f, 200.0f, 300.0f, 480.0f, 150, 2, 5.0f, 200, 6.0f, 30.0f, 6.0f, 15.0f, 6, EXPLOSION_4B_SFX, 4.0f}, { 50.0f, 50.0f, 0.0f, 0.0f, 120.0f, 200.0f, 400.0f, 125, 4, 4.0f, 150, 6.0f, 30.0f, 3.0f, 6.0f, 4, EXPLOSION_4B_SFX, 4.0f}, { 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1, 1, 1.0f, 150, 6.0f, 30.0f, 2.5f, 6.0f, 7, EXPLOSION_2B_SFX, 0.0f}, { 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1, 1, 1.0f, 100, 6.0f, 30.0f, 2.5f, 6.0f, 7, EXPLOSION_2B_SFX, 0.0f}, { 80.0f, 60.0f, 18.0f, 6.0f, 1500.0f, 2200.0f, 3600.0f, 250, 1, 2.0f, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0, EXPLOSION_4B_SFX, 4.0f}, { 80.0f, 60.0f, 3.59999990463257f, 1.20000004768372f, 300.0f, 450.0f, 640.0f, 50, 1, 2.0f, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0, EXPLOSION_4B_SFX, 4.0f}, + /* facility remote mine */ { 90.0f, 75.0f, 3.0f, 1.0f, 250.0f, 375.0f, 600.0f, 150, 2, 5.0f, 200, 6.0f, 30.0f, 6.0f, 15.0f, 6, EXPLOSION_4B_SFX, 4.0f}, {160.0f, 120.0f, 7.19999980926514f, 2.40000009536743f, 600.0f, 450.0f, 640.0f, 50, 1, 2.0f, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0, EXPLOSION_4B_SFX, 4.0f}, }; @@ -284,7 +286,7 @@ glabel explosionCreate /* 0D0E1C 7F09C2EC 51000129 */ beql $t0, $zero, .L7F09C794 /* 0D0E20 7F09C2F0 8FBF002C */ lw $ra, 0x2c($sp) /* 0D0E24 7F09C2F4 A7A70056 */ sh $a3, 0x56($sp) -/* 0D0E28 7F09C2F8 0FC0E90C */ jal chrpropAllocate +/* 0D0E28 7F09C2F8 0FC0E90C */ jal propAllocate /* 0D0E2C 7F09C2FC AFA80040 */ sw $t0, 0x40($sp) /* 0D0E30 7F09C300 92230039 */ lbu $v1, 0x39($s1) /* 0D0E34 7F09C304 8FA80040 */ lw $t0, 0x40($sp) @@ -300,7 +302,7 @@ glabel explosionCreate /* 0D0E5C 7F09C32C 0C002382 */ jal sndPlaySfx /* 0D0E60 7F09C330 AFA80040 */ sw $t0, 0x40($sp) /* 0D0E64 7F09C334 00402025 */ move $a0, $v0 -/* 0D0E68 7F09C338 0FC14E84 */ jal sub_GAME_7F053A10 +/* 0D0E68 7F09C338 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 0D0E6C 7F09C33C 02602825 */ move $a1, $s3 /* 0D0E70 7F09C340 8FA70030 */ lw $a3, 0x30($sp) /* 0D0E74 7F09C344 8FA80040 */ lw $t0, 0x40($sp) @@ -651,7 +653,7 @@ glabel explosionCreate .Ljp7F09CE6C: /* 0D19DC 7F09CE6C 52800124 */ beql $s4, $zero, .Ljp7F09D300 /* 0D19E0 7F09CE70 8FBF0034 */ lw $ra, 0x34($sp) -/* 0D19E4 7F09CE74 0FC0E9CC */ jal chrpropAllocate +/* 0D19E4 7F09CE74 0FC0E9CC */ jal propAllocate /* 0D19E8 7F09CE78 00000000 */ nop /* 0D19EC 7F09CE7C 87AE005E */ lh $t6, 0x5e($sp) /* 0D19F0 7F09CE80 24010010 */ li $at, 16 @@ -674,7 +676,7 @@ glabel explosionCreate /* 0D1A30 7F09CEC0 0C002386 */ jal sndPlaySfx /* 0D1A34 7F09CEC4 AFA70038 */ sw $a3, 0x38($sp) /* 0D1A38 7F09CEC8 00402025 */ move $a0, $v0 -/* 0D1A3C 7F09CECC 0FC14FC3 */ jal sub_GAME_7F053A10 +/* 0D1A3C 7F09CECC 0FC14FC3 */ jal chrobjSndCreatePostEventDefault /* 0D1A40 7F09CED0 02602825 */ move $a1, $s3 /* 0D1A44 7F09CED4 8FA70038 */ lw $a3, 0x38($sp) .Ljp7F09CED8: @@ -1093,7 +1095,7 @@ glabel sub_GAME_7F09C9D8 /* 0D1578 7F09CA48 27B000E0 */ addiu $s0, $sp, 0xe0 /* 0D157C 7F09CA4C 0FC0F2E3 */ jal chraiGetPropRoomIds /* 0D1580 7F09CA50 02002825 */ move $a1, $s0 -/* 0D1584 7F09CA54 0FC0F8FF */ jal sub_GAME_7F03E3FC +/* 0D1584 7F09CA54 0FC0F8FF */ jal roomGetProps /* 0D1588 7F09CA58 02002025 */ move $a0, $s0 /* 0D158C 7F09CA5C 3C138007 */ lui $s3, %hi(ptr_list_object_lookup_indices) /* 0D1590 7F09CA60 8E739C30 */ lw $s3, %lo(ptr_list_object_lookup_indices)($s3) @@ -1236,7 +1238,7 @@ glabel sub_GAME_7F09C9D8 /* 0D1790 7F09CC60 46163200 */ add.s $f8, $f6, $f22 /* 0D1794 7F09CC64 46144102 */ mul.s $f4, $f8, $f20 /* 0D1798 7F09CC68 44052000 */ mfc1 $a1, $f4 -/* 0D179C 7F09CC6C 0FC137BF */ jal sub_GAME_7F04DEFC +/* 0D179C 7F09CC6C 0FC137BF */ jal maybe_detonate_object_and_its_children /* 0D17A0 7F09CC70 00000000 */ nop .L7F09CC74: /* 0D17A4 7F09CC74 10000084 */ b .L7F09CE88 @@ -1358,7 +1360,7 @@ glabel sub_GAME_7F09C9D8 /* 0D194C 7F09CE1C 0FC26C54 */ jal get_cur_playernum /* 0D1950 7F09CE20 00000000 */ nop /* 0D1954 7F09CE24 AFA20090 */ sw $v0, 0x90($sp) -/* 0D1958 7F09CE28 0FC26C57 */ jal sub_GAME_7F09B15C +/* 0D1958 7F09CE28 0FC26C57 */ jal getPlayerPointerIndex /* 0D195C 7F09CE2C 02002025 */ move $a0, $s0 /* 0D1960 7F09CE30 0FC26C43 */ jal set_cur_player /* 0D1964 7F09CE34 00402025 */ move $a0, $v0 @@ -1851,7 +1853,7 @@ u8 sub_GAME_7F09D4EC(PropRecord* prop) { Mtxf* player_matrix; - player_matrix = currentPlayerGetMatrix10CC(); + player_matrix = camGetWorldToScreenMtxf(); prop->Unk18 = -((((player_matrix->m[0][2] * prop->pos.x) + (player_matrix->m[1][2] * prop->pos.y)) + (player_matrix->m[2][2] * prop->pos.z)) + player_matrix->m[3][2]); if (prop->Unk18 < 100.0f) @@ -3094,7 +3096,7 @@ void sub_GAME_7F09E700(coord3d *pos, StandTile *stan, s16 arg2, u8 *rooms, s32 a if (smoke == NULL) { return; } - prop = chrpropAllocate(); + prop = propAllocate(); if (prop == NULL) { return; } prop->type = 8; @@ -3631,7 +3633,7 @@ u8 sub_GAME_7F09EF9C(PropRecord* prop) { Mtxf* player_matrix; - player_matrix = currentPlayerGetMatrix10CC(); + player_matrix = camGetWorldToScreenMtxf(); prop->Unk18 = -((((player_matrix->m[0][2] * prop->pos.x) + (player_matrix->m[1][2] * prop->pos.y)) + (player_matrix->m[2][2] * prop->pos.z)) + player_matrix->m[3][2]); if (prop->Unk18 < 100.0f) @@ -4055,7 +4057,7 @@ glabel sub_GAME_7F0A0034 /* 0D4C64 7F0A0134 00000000 */ nop /* 0D4C68 7F0A0138 0FC1624B */ jal matrix_4x4_set_position_and_rotation_around_xyz /* 0D4C6C 7F0A013C 02803025 */ move $a2, $s4 -/* 0D4C70 7F0A0140 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0D4C70 7F0A0140 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0D4C74 7F0A0144 00000000 */ nop /* 0D4C78 7F0A0148 00402025 */ move $a0, $v0 /* 0D4C7C 7F0A014C 0FC16026 */ jal matrix_4x4_multiply_homogeneous_in_place @@ -4761,7 +4763,7 @@ s32 sub_GAME_7F0A0C74(f32 arg0) -void sub_GAME_7F0A0CCC(s32 arg0, s8 arg1) +void sub_GAME_7F0A0CCC(PropRecord* arg0, s8 arg1) { s32 i; for (i = 0; i < BULLET_IMPACT_BUFFER_LEN; i++) @@ -4775,7 +4777,7 @@ void sub_GAME_7F0A0CCC(s32 arg0, s8 arg1) -void sub_GAME_7F0A0D90(s32 arg0) +void sub_GAME_7F0A0D90(PropRecord* arg0) { s32 i; for (i = 0; i < BULLET_IMPACT_BUFFER_LEN; i++) @@ -4943,10 +4945,10 @@ glabel sub_GAME_7F0A108C /* 0D5D9C 7F0A126C E7A60080 */ swc1 $f6, 0x80($sp) /* 0D5DA0 7F0A1270 E7A4006C */ swc1 $f4, 0x6c($sp) /* 0D5DA4 7F0A1274 E7A80070 */ swc1 $f8, 0x70($sp) -/* 0D5DA8 7F0A1278 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 0D5DA8 7F0A1278 0FC160F6 */ jal mtx4RotateVecInPlace /* 0D5DAC 7F0A127C E7AA0074 */ swc1 $f10, 0x74($sp) /* 0D5DB0 7F0A1280 02202025 */ move $a0, $s1 -/* 0D5DB4 7F0A1284 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 0D5DB4 7F0A1284 0FC160F6 */ jal mtx4RotateVecInPlace /* 0D5DB8 7F0A1288 27A5006C */ addiu $a1, $sp, 0x6c /* 0D5DBC 7F0A128C C7A00078 */ lwc1 $f0, 0x78($sp) /* 0D5DC0 7F0A1290 C7A2007C */ lwc1 $f2, 0x7c($sp) diff --git a/src/game/explosions.h b/src/game/explosions.h index ca2eca24..a6253386 100644 --- a/src/game/explosions.h +++ b/src/game/explosions.h @@ -159,7 +159,7 @@ struct BulletImpact { u16 unk44; s8 unk46; s8 unk47; - u32 unk48; + PropRecord* unk48; s8 unk4C; s8 unk4D; s16 unk4E; @@ -237,4 +237,12 @@ Gfx *unk09c250RenderPropSmoke(PropRecord *arg0, Gfx *arg1); Gfx *explosionRenderBulletImpactOnProp(Gfx *arg0, PropRecord *arg1, s32 arg2); +void sub_GAME_7F09E700(coord3d *pos, StandTile *stan, s16 arg2, u8 *rooms, s32 arg4); + +#if defined(VERSION_JP) || defined(VERSION_EU) +s32 explosionCreate(void *, struct coord3d *pos, struct StandTile *stan, s16 /* enum EXPLOSION_DEF */ explosionType, s32 flag, s32 playernum, u8 *rooms, s32 flag2); +#else +void explosionCreate(void *, struct coord3d *pos, struct StandTile *stan, s16 /* enum EXPLOSION_DEF */ explosionType, s32 flag, s32 playernum, u8 *rooms, s32 flag2); +#endif + #endif diff --git a/src/game/file.c b/src/game/file.c index a2c1d152..4fef22bd 100644 --- a/src/game/file.c +++ b/src/game/file.c @@ -111,15 +111,15 @@ void set_solo_and_ptr_briefing(LEVELID stage) briefingpage = pull_and_display_text_for_folder_a0(stage); } -void sub_GAME_7F01D61C(struct save_file *savefile) +void sub_GAME_7F01D61C(struct save_data *savefile) { - fileCopySave(selected_folder_num,savefile); + fileCopySave(selected_folder_num, savefile); } //this feels fake, generated with a permuter session i forgot was running -void set_selected_foldernum_and_copy_demo_eeprom(struct save_file *eeprom) +void set_selected_foldernum_and_copy_demo_eeprom(struct save_data *eeprom) { int new_var; long long new_var2; diff --git a/src/game/file.h b/src/game/file.h index 2cc85199..8541f6fe 100644 --- a/src/game/file.h +++ b/src/game/file.h @@ -4,10 +4,6 @@ #include -// unknown/unused struct. Adding so that a definition exists. -//Private Struct, Move to C -struct save_file { s32* data; }; - typedef struct save_data { s32 chksum1; @@ -63,8 +59,8 @@ s32 getSelectedFolderBond(void); void set_selected_folder_num(u32 foldernum); void set_selected_difficulty(DIFFICULTY difficulty); void set_solo_and_ptr_briefing(LEVELID stage); -void sub_GAME_7F01D61C(struct save_file *savefile); -void set_selected_foldernum_and_copy_demo_eeprom(struct save_file *eeprom); +void sub_GAME_7F01D61C(struct save_data *savefile); +void set_selected_foldernum_and_copy_demo_eeprom(struct save_data *eeprom); void store_favorite_weapon_current_player(u32 right,u32 left); #endif diff --git a/src/game/file2.h b/src/game/file2.h index b6e9ca80..05b837df 100644 --- a/src/game/file2.h +++ b/src/game/file2.h @@ -30,5 +30,11 @@ STAGESTATUS fileIsStageUnlockedAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE s void fileUnlockStageInFolderAtDifficulty(s32 foldernum, LEVEL_SOLO_SEQUENCE stage, DIFFICULTY difficulty, s32 newtime); void sub_GAME_7F01E760(s32 foldernum, s32 cheat); void fileLoadSettingsForFolder(u32 folder); +void fileDeleteSaveForFolder(s32 foldernum); + +void fileGetHighestStageDifficultyCompletedForFolder(s32 foldernum, LEVEL_SOLO_SEQUENCE *stage, DIFFICULTY *difficulty); +bool check_aztec_completed_any_folder_secret_00(void); +bool fileIsEgyptCompletedOn00AnyFolder(void); +LEVEL_SOLO_SEQUENCE fileGetHighestStageUnlockedAnyFolder(void); #endif diff --git a/src/game/fog.c b/src/game/fog.c index 83a9ab2d..a9f6bfce 100644 --- a/src/game/fog.c +++ b/src/game/fog.c @@ -63,6 +63,11 @@ EnvironmentRecord * g_EnvironmentAltp; */ s32 D_800825F4; +#if defined(VERSION_EU) +EnvironmentRecord dword_CODE_bss_800825F8; +s32 bss_800825F8_padding[2]; +#endif + /** * Unreferenced. * @@ -623,7 +628,7 @@ void fogRemoved7F0BAA5C(s32 a) return; } -#if defined(VERSION_US) || defined(VERSION_JP) + /** * Address 0x7F0BAA64. */ @@ -724,179 +729,6 @@ void fogLoadLevelEnvironment(s32 level_id, s32 arg1) fogLoadFoglessCurrentEnvironment(sp1C); g_EnvironmentFoundp = NULL; } -#endif -#if defined(VERSION_EU) -GLOBAL_ASM( -.late_rodata -glabel default_near_fog -.word 0x7f7fffff /*3.4028235e38*/ -glabel D_80058D74 -.word 0x461c4000 /*10000.0*/ -.text -glabel fogLoadLevelEnvironment -/* 0EC824 7F0B9E34 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0EC828 7F0B9E38 AFBF0014 */ sw $ra, 0x14($sp) -/* 0EC82C 7F0B9E3C AFA5002C */ sw $a1, 0x2c($sp) -/* 0EC830 7F0B9E40 AFA0001C */ sw $zero, 0x1c($sp) -/* 0EC834 7F0B9E44 0FC26669 */ jal getPlayerCount -/* 0EC838 7F0B9E48 AFA40028 */ sw $a0, 0x28($sp) -/* 0EC83C 7F0B9E4C 24010001 */ li $at, 1 -/* 0EC840 7F0B9E50 8FA6001C */ lw $a2, 0x1c($sp) -/* 0EC844 7F0B9E54 8FA70028 */ lw $a3, 0x28($sp) -/* 0EC848 7F0B9E58 14410002 */ bne $v0, $at, .L7F0B9E64 -/* 0EC84C 7F0B9E5C 00404025 */ move $t0, $v0 -/* 0EC850 7F0B9E60 00004025 */ move $t0, $zero -.L7F0B9E64: -/* 0EC854 7F0B9E64 3C018005 */ lui $at, %hi(default_near_fog) # $at, 0x8005 -/* 0EC858 7F0B9E68 C424D7C0 */ lwc1 $f4, %lo(default_near_fog)($at) -/* 0EC85C 7F0B9E6C 8FAE002C */ lw $t6, 0x2c($sp) -/* 0EC860 7F0B9E70 3C018004 */ lui $at, %hi(g_ScaledFarFogIntensity) # $at, 0x8004 -/* 0EC864 7F0B9E74 44803000 */ mtc1 $zero, $f6 -/* 0EC868 7F0B9E78 E424E2B4 */ swc1 $f4, %lo(g_ScaledFarFogIntensity)($at) -/* 0EC86C 7F0B9E7C 3C018004 */ lui $at, %hi(g_ScaledDifferenceFromFarFogIntensity) # $at, 0x8004 -/* 0EC870 7F0B9E80 11C0001A */ beqz $t6, .L7F0B9EEC -/* 0EC874 7F0B9E84 E426E2B8 */ swc1 $f6, %lo(g_ScaledDifferenceFromFarFogIntensity)($at) -/* 0EC878 7F0B9E88 3C098004 */ lui $t1, %hi(fog_tables) -/* 0EC87C 7F0B9E8C 2523E300 */ addiu $v1, $t1, %lo(fog_tables) -/* 0EC880 7F0B9E90 846F0000 */ lh $t7, ($v1) -/* 0EC884 7F0B9E94 3C188004 */ lui $t8, %hi(fog_tables) # $t8, 0x8004 -/* 0EC888 7F0B9E98 2718E300 */ addiu $t8, %lo(fog_tables) # addiu $t8, $t8, -0x1d00 -/* 0EC88C 7F0B9E9C 11E00013 */ beqz $t7, .L7F0B9EEC -/* 0EC890 7F0B9EA0 24E40384 */ addiu $a0, $a3, 0x384 -/* 0EC894 7F0B9EA4 87020000 */ lh $v0, ($t8) -.L7F0B9EA8: -/* 0EC898 7F0B9EA8 1482000C */ bne $a0, $v0, .L7F0B9EDC -/* 0EC89C 7F0B9EAC 3C028007 */ lui $v0, %hi(g_EnvironmentFoundp) # $v0, 0x8007 -/* 0EC8A0 7F0B9EB0 2442CF88 */ addiu $v0, %lo(g_EnvironmentFoundp) # addiu $v0, $v0, -0x3078 -/* 0EC8A4 7F0B9EB4 AC430000 */ sw $v1, ($v0) -/* 0EC8A8 7F0B9EB8 3C018007 */ lui $at, %hi(g_EnvironmentMainp) # $at, 0x8007 -/* 0EC8AC 7F0B9EBC AC23CF8C */ sw $v1, %lo(g_EnvironmentMainp)($at) -/* 0EC8B0 7F0B9EC0 3C018007 */ lui $at, %hi(g_EnvironmentAltp) # $at, 0x8007 -/* 0EC8B4 7F0B9EC4 24790024 */ addiu $t9, $v1, 0x24 -/* 0EC8B8 7F0B9EC8 AC39CF90 */ sw $t9, %lo(g_EnvironmentAltp)($at) -/* 0EC8BC 7F0B9ECC 0FC2E67E */ jal fogLoadCurrentEnvironment -/* 0EC8C0 7F0B9ED0 8C440000 */ lw $a0, ($v0) -/* 0EC8C4 7F0B9ED4 10000065 */ b .L7F0BA06C -/* 0EC8C8 7F0B9ED8 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0B9EDC: -/* 0EC8CC 7F0B9EDC 84620024 */ lh $v0, 0x24($v1) -/* 0EC8D0 7F0B9EE0 24630024 */ addiu $v1, $v1, 0x24 -/* 0EC8D4 7F0B9EE4 1440FFF0 */ bnez $v0, .L7F0B9EA8 -/* 0EC8D8 7F0B9EE8 00000000 */ nop -.L7F0B9EEC: -/* 0EC8DC 7F0B9EEC 3C098004 */ lui $t1, %hi(fog_tables) # $t1, 0x8004 -/* 0EC8E0 7F0B9EF0 2529E300 */ addiu $t1, %lo(fog_tables) # addiu $t1, $t1, -0x1d00 -/* 0EC8E4 7F0B9EF4 85250000 */ lh $a1, ($t1) -/* 0EC8E8 7F0B9EF8 3C0A8004 */ lui $t2, %hi(fog_tables) # $t2, 0x8004 -/* 0EC8EC 7F0B9EFC 254AE300 */ addiu $t2, %lo(fog_tables) # addiu $t2, $t2, -0x1d00 -/* 0EC8F0 7F0B9F00 10A00019 */ beqz $a1, .L7F0B9F68 -/* 0EC8F4 7F0B9F04 01201825 */ move $v1, $t1 -/* 0EC8F8 7F0B9F08 00085880 */ sll $t3, $t0, 2 -/* 0EC8FC 7F0B9F0C 01685823 */ subu $t3, $t3, $t0 -/* 0EC900 7F0B9F10 000B58C0 */ sll $t3, $t3, 3 -/* 0EC904 7F0B9F14 01685821 */ addu $t3, $t3, $t0 -/* 0EC908 7F0B9F18 000B5880 */ sll $t3, $t3, 2 -/* 0EC90C 7F0B9F1C 00EB2021 */ addu $a0, $a3, $t3 -/* 0EC910 7F0B9F20 85420000 */ lh $v0, ($t2) -.L7F0B9F24: -/* 0EC914 7F0B9F24 1482000C */ bne $a0, $v0, .L7F0B9F58 -/* 0EC918 7F0B9F28 3C028007 */ lui $v0, %hi(g_EnvironmentFoundp) # $v0, 0x8007 -/* 0EC91C 7F0B9F2C 2442CF88 */ addiu $v0, %lo(g_EnvironmentFoundp) # addiu $v0, $v0, -0x3078 -/* 0EC920 7F0B9F30 AC430000 */ sw $v1, ($v0) -/* 0EC924 7F0B9F34 3C018007 */ lui $at, %hi(g_EnvironmentMainp) # $at, 0x8007 -/* 0EC928 7F0B9F38 AC23CF8C */ sw $v1, %lo(g_EnvironmentMainp)($at) -/* 0EC92C 7F0B9F3C 3C018007 */ lui $at, %hi(g_EnvironmentAltp) # $at, 0x8007 -/* 0EC930 7F0B9F40 246C0024 */ addiu $t4, $v1, 0x24 -/* 0EC934 7F0B9F44 AC2CCF90 */ sw $t4, %lo(g_EnvironmentAltp)($at) -/* 0EC938 7F0B9F48 0FC2E67E */ jal fogLoadCurrentEnvironment -/* 0EC93C 7F0B9F4C 8C440000 */ lw $a0, ($v0) -/* 0EC940 7F0B9F50 10000046 */ b .L7F0BA06C -/* 0EC944 7F0B9F54 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0B9F58: -/* 0EC948 7F0B9F58 84620024 */ lh $v0, 0x24($v1) -/* 0EC94C 7F0B9F5C 24630024 */ addiu $v1, $v1, 0x24 -/* 0EC950 7F0B9F60 1440FFF0 */ bnez $v0, .L7F0B9F24 -/* 0EC954 7F0B9F64 00000000 */ nop -.L7F0B9F68: -/* 0EC958 7F0B9F68 29010002 */ slti $at, $t0, 2 -/* 0EC95C 7F0B9F6C 5420001D */ bnezl $at, .L7F0B9FE4 -/* 0EC960 7F0B9F70 3C014170 */ lui $at, 0x4170 -/* 0EC964 7F0B9F74 10A0001A */ beqz $a1, .L7F0B9FE0 -/* 0EC968 7F0B9F78 01201825 */ move $v1, $t1 -/* 0EC96C 7F0B9F7C 00082080 */ sll $a0, $t0, 2 -/* 0EC970 7F0B9F80 00882023 */ subu $a0, $a0, $t0 -/* 0EC974 7F0B9F84 000420C0 */ sll $a0, $a0, 3 -/* 0EC978 7F0B9F88 3C0D8004 */ lui $t5, %hi(fog_tables) # $t5, 0x8004 -/* 0EC97C 7F0B9F8C 25ADE300 */ addiu $t5, %lo(fog_tables) # addiu $t5, $t5, -0x1d00 -/* 0EC980 7F0B9F90 00882021 */ addu $a0, $a0, $t0 -/* 0EC984 7F0B9F94 00042080 */ sll $a0, $a0, 2 -/* 0EC988 7F0B9F98 85A20000 */ lh $v0, ($t5) -.L7F0B9F9C: -/* 0EC98C 7F0B9F9C 1482000C */ bne $a0, $v0, .L7F0B9FD0 -/* 0EC990 7F0B9FA0 3C028007 */ lui $v0, %hi(g_EnvironmentFoundp) # $v0, 0x8007 -/* 0EC994 7F0B9FA4 2442CF88 */ addiu $v0, %lo(g_EnvironmentFoundp) # addiu $v0, $v0, -0x3078 -/* 0EC998 7F0B9FA8 AC430000 */ sw $v1, ($v0) -/* 0EC99C 7F0B9FAC 3C018007 */ lui $at, %hi(g_EnvironmentMainp) # $at, 0x8007 -/* 0EC9A0 7F0B9FB0 AC23CF8C */ sw $v1, %lo(g_EnvironmentMainp)($at) -/* 0EC9A4 7F0B9FB4 3C018007 */ lui $at, %hi(g_EnvironmentAltp) # $at, 0x8007 -/* 0EC9A8 7F0B9FB8 246E0024 */ addiu $t6, $v1, 0x24 -/* 0EC9AC 7F0B9FBC AC2ECF90 */ sw $t6, %lo(g_EnvironmentAltp)($at) -/* 0EC9B0 7F0B9FC0 0FC2E67E */ jal fogLoadCurrentEnvironment -/* 0EC9B4 7F0B9FC4 8C440000 */ lw $a0, ($v0) -/* 0EC9B8 7F0B9FC8 10000028 */ b .L7F0BA06C -/* 0EC9BC 7F0B9FCC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0B9FD0: -/* 0EC9C0 7F0B9FD0 84620024 */ lh $v0, 0x24($v1) -/* 0EC9C4 7F0B9FD4 24630024 */ addiu $v1, $v1, 0x24 -/* 0EC9C8 7F0B9FD8 1440FFF0 */ bnez $v0, .L7F0B9F9C -/* 0EC9CC 7F0B9FDC 00000000 */ nop -.L7F0B9FE0: -/* 0EC9D0 7F0B9FE0 3C014170 */ li $at, 0x41700000 # 15.000000 -.L7F0B9FE4: -/* 0EC9D4 7F0B9FE4 44816000 */ mtc1 $at, $f12 -/* 0EC9D8 7F0B9FE8 3C018005 */ lui $at, %hi(D_80058D74) # $at, 0x8005 -/* 0EC9DC 7F0B9FEC C42ED7C4 */ lwc1 $f14, %lo(D_80058D74)($at) -/* 0EC9E0 7F0B9FF0 AFA6001C */ sw $a2, 0x1c($sp) -/* 0EC9E4 7F0B9FF4 0C001028 */ jal viSetZRange -/* 0EC9E8 7F0B9FF8 AFA70028 */ sw $a3, 0x28($sp) -/* 0EC9EC 7F0B9FFC 3C048004 */ lui $a0, %hi(fog_tables2) # $a0, 0x8004 -/* 0EC9F0 7F0BA000 3C018007 */ lui $at, %hi(g_FogSkyIsEnabled) # $at, 0x8007 -/* 0EC9F4 7F0BA004 2484E9C0 */ addiu $a0, %lo(fog_tables2) # addiu $a0, $a0, -0x1640 -/* 0EC9F8 7F0BA008 AC20CF60 */ sw $zero, %lo(g_FogSkyIsEnabled)($at) -/* 0EC9FC 7F0BA00C 8C8F0000 */ lw $t7, ($a0) -/* 0ECA00 7F0BA010 8FA6001C */ lw $a2, 0x1c($sp) -/* 0ECA04 7F0BA014 8FA70028 */ lw $a3, 0x28($sp) -/* 0ECA08 7F0BA018 11E0000B */ beqz $t7, .L7F0BA048 -/* 0ECA0C 7F0BA01C 00801825 */ move $v1, $a0 -/* 0ECA10 7F0BA020 3C188004 */ lui $t8, %hi(fog_tables2) # $t8, 0x8004 -/* 0ECA14 7F0BA024 2718E9C0 */ addiu $t8, %lo(fog_tables2) # addiu $t8, $t8, -0x1640 -/* 0ECA18 7F0BA028 8F020000 */ lw $v0, ($t8) -.L7F0BA02C: -/* 0ECA1C 7F0BA02C 54E20003 */ bnel $a3, $v0, .L7F0BA03C -/* 0ECA20 7F0BA030 8C620038 */ lw $v0, 0x38($v1) -/* 0ECA24 7F0BA034 00603025 */ move $a2, $v1 -/* 0ECA28 7F0BA038 8C620038 */ lw $v0, 0x38($v1) -.L7F0BA03C: -/* 0ECA2C 7F0BA03C 24630038 */ addiu $v1, $v1, 0x38 -/* 0ECA30 7F0BA040 1440FFFA */ bnez $v0, .L7F0BA02C -/* 0ECA34 7F0BA044 00000000 */ nop -.L7F0BA048: -/* 0ECA38 7F0BA048 14C00002 */ bnez $a2, .L7F0BA054 -/* 0ECA3C 7F0BA04C 00000000 */ nop -/* 0ECA40 7F0BA050 00803025 */ move $a2, $a0 -.L7F0BA054: -/* 0ECA44 7F0BA054 0FC2E768 */ jal fogLoadFoglessCurrentEnvironment -/* 0ECA48 7F0BA058 00C02025 */ move $a0, $a2 -/* 0ECA4C 7F0BA05C 3C028007 */ lui $v0, %hi(g_EnvironmentFoundp) # $v0, 0x8007 -/* 0ECA50 7F0BA060 2442CF88 */ addiu $v0, %lo(g_EnvironmentFoundp) # addiu $v0, $v0, -0x3078 -/* 0ECA54 7F0BA064 AC400000 */ sw $zero, ($v0) -/* 0ECA58 7F0BA068 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0BA06C: -/* 0ECA5C 7F0BA06C 27BD0028 */ addiu $sp, $sp, 0x28 -/* 0ECA60 7F0BA070 03E00008 */ jr $ra -/* 0ECA64 7F0BA074 00000000 */ nop -) -#endif #if defined(VERSION_US) || defined(VERSION_JP) /** @@ -906,17 +738,27 @@ glabel fogLoadLevelEnvironment */ void fogSwitchToSolosky2(f32 arg0) { +#if defined(VERSION_US) || defined(VERSION_JP) static EnvironmentRecord dword_CODE_bss_800825F8; +#endif dword_CODE_bss_800825F8 = *g_EnvironmentMainp; dword_CODE_bss_800825F8.Visibility.BlendMultiplier = g_EnvironmentMainp->Visibility.BlendMultiplier +#if defined(VERSION_EU) + + (arg0 * ((f32)g_EnvironmentAltp->Visibility.BlendMultiplier - (f32)g_EnvironmentMainp->Visibility.BlendMultiplier)); +#else + (arg0 * (g_EnvironmentAltp->Visibility.BlendMultiplier - g_EnvironmentMainp->Visibility.BlendMultiplier)); +#endif dword_CODE_bss_800825F8.Visibility.FarFog = g_EnvironmentMainp->Visibility.FarFog +#if defined(VERSION_EU) + + (arg0 * ((f32)g_EnvironmentAltp->Visibility.FarFog - (f32)g_EnvironmentMainp->Visibility.FarFog)); +#else + (arg0 * (g_EnvironmentAltp->Visibility.FarFog - g_EnvironmentMainp->Visibility.FarFog)); +#endif dword_CODE_bss_800825F8.Fog.DifferenceFromFarIntensity = (f32)g_EnvironmentMainp->Fog.DifferenceFromFarIntensity @@ -944,9 +786,18 @@ void fogSwitchToSolosky2(f32 arg0) fogLoadCurrentEnvironment(&dword_CODE_bss_800825F8); } -#endif -#if defined(VERSION_EU) +#else + +/** + * + * .bss +glabel dword_CODE_bss_800825F8 +.word 0,0,0,0 +.word 0,0,0,0 +.word 0,0,0,0 + * +*/ /** * hack: * variables referenced in the following asm are wrong, just used @@ -955,11 +806,7 @@ void fogSwitchToSolosky2(f32 arg0) GLOBAL_ASM( -.bss -glabel dword_CODE_bss_800825F8 -.word 0,0,0,0 -.word 0,0,0,0 -.word 0,0,0,0 + .text glabel fogSwitchToSolosky2 @@ -1302,7 +1149,7 @@ s32 fogPositionIsVisibleThroughFog(coord3d *pos, f32 range) } player_pos = bondviewGetCurrentPlayersPosition(); - player_mtx = currentPlayerGetMatrix10CC(); + player_mtx = camGetWorldToScreenMtxf(); sp24.f[0] = pos->f[0] - player_pos->f[0]; sp24.f[1] = pos->f[1] - player_pos->f[1]; diff --git a/src/game/fog.h b/src/game/fog.h index 405cd315..97501386 100644 --- a/src/game/fog.h +++ b/src/game/fog.h @@ -4,18 +4,37 @@ #include #include -typedef struct NearFogRecord { #if defined(VERSION_EU) + +// TODO: FIXME: +// There's something terrible going on with NearFogRecord on EU +// the function chrobjFogVisRangeRelated() treats it as a struct +// with 3 floats, but declaring it as such makes the struct too big. +// NearFogRecordF was created so we can cast it where applicable... +// but it isn't an ideal fix. + +typedef struct NearFogRecord { s16 NearFog; s16 MaxVisRange; s16 MaxObfuscationRange; +} NearFogRecord; + +typedef struct NearFogRecordF { + f32 NearFog; + f32 MaxVisRange; + f32 MaxObfuscationRange; +} NearFogRecordF; + #else + +typedef struct NearFogRecord { f32 NearFog; f32 MaxVisRange; f32 MaxObfuscationRange; -#endif } NearFogRecord; +#endif + //New Definitions below // SubRecords @@ -125,7 +144,7 @@ typedef struct EnvironmentRecord * ID = StageID + Token eg, Bunker Cinema is 9 + 900 = 909 */ #if defined(VERSION_EU) - u16 Id; + s16 Id; #else u32 Id; #endif diff --git a/src/game/front.c b/src/game/front.c index 3f39d3b7..c6f1d845 100644 --- a/src/game/front.c +++ b/src/game/front.c @@ -33,19 +33,30 @@ #include "game/file2.h" #include "objecthandler.h" #include "dyn.h" +#include "assets/obseg/text/LtitleE.h" +#include "textrelated.h" +#include "matrixmath.h" +#include "bg.h" +#include "chrai.h" +#include "title.h" +#include +#include "image.h" +#include "ob.h" +#include "gbi_extension.h" + struct BriefingDataSomething { - u16 difficulty_related; - u16 selected_difficulty; + u16 textid; + u16 enabled_difficulty; }; + struct BriefingData { - s32 unk00; - s32 unk04; - struct BriefingDataSomething datas[10]; + u16 brief[4]; + struct BriefingDataSomething objective[OBJECTIVES_MAX]; }; @@ -71,43 +82,29 @@ f32 flt_CODE_bss_800695C0; //CODE.bss:800695C4 f32 flt_CODE_bss_800695C4; //CODE.bss:800695C8 -f32 flt_CODE_bss_800695C8; -//CODE.bss:800695CC -f32 flt_CODE_bss_800695CC; -//CODE.bss:800695D0 -f32 flt_CODE_bss_800695D0; +struct coord3d flt_CODE_bss_800695C8; //CODE.bss:800695D4 f32 flt_CODE_bss_800695D4; //CODE.bss:800695D8 -f32 flt_CODE_bss_800695D8; -//CODE.bss:800695DC -f32 flt_CODE_bss_800695DC; -//CODE.bss:800695E0 -f32 flt_CODE_bss_800695E0; +struct coord3d flt_CODE_bss_800695D8; + //CODE.bss:800695E4 -f32 flt_CODE_bss_800695E4; +s32 bss_800695E4; + //CODE.bss:800695E8 -f32 flt_CODE_bss_800695E8; -//CODE.bss:800695EC -f32 flt_CODE_bss_800695EC; -//CODE.bss:800695F0 -f32 flt_CODE_bss_800695F0; +struct coord3d flt_CODE_bss_800695E8; + //CODE.bss:800695F4 f32 flt_CODE_bss_800695F4; //CODE.bss:800695F8 -f32 flt_CODE_bss_800695F8; -//CODE.bss:800695FC -f32 flt_CODE_bss_800695FC; -//CODE.bss:80069600 -f32 flt_CODE_bss_80069600; +struct coord3d flt_CODE_bss_800695F8; //CODE.bss:80069604 f32 flt_CODE_bss_80069604; + //CODE.bss:80069608 -f32 flt_CODE_bss_80069608; -//CODE.bss:8006960C -f32 flt_CODE_bss_8006960C; -//CODE.bss:80069610 -f32 flt_CODE_bss_80069610; +struct coord3d flt_CODE_bss_80069608; + + //CODE.bss:80069614 f32 ninLogoRotRate; @@ -120,7 +117,7 @@ f32 ninLogoScale; //CODE.bss:8006961C f32 flt_CODE_bss_8006961C; //CODE.bss:80069620 -coord3d dword_CODE_bss_80069620[MAX_PLAYER_COUNT]; +coord3d dword_CODE_bss_80069620[MAX_FOLDER_COUNT]; //CODE.bss:80069650 u8 cheat_available[CHEAT_MAX]; @@ -175,13 +172,7 @@ s32 dword_CODE_bss_80069730[MAX_PLAYER_COUNT]; bool player_has_selected_char[MAX_PLAYER_COUNT]; //CODE.bss:80069750 -s32 size_mp_select_image_player1; -//CODE.bss:80069754 -s32 size_mp_select_image_player2; -//CODE.bss:80069758 -s32 size_mp_select_image_player3; -//CODE.bss:8006975C -s32 size_mp_select_image_player4; +s32 size_mp_select_image_player[MAX_PLAYER_COUNT]; //CODE.bss:80069760 s32 dword_CODE_bss_80069760[MAX_PLAYER_COUNT]; //CODE.bss:80069770 @@ -218,7 +209,7 @@ s32 dword_CODE_bss_800697A4; s32 player_handicap[MAX_PLAYER_COUNT]; //CODE.bss:800697B8 -u32 controlstyle_player[MAX_PLAYER_COUNT]; +s32 controlstyle_player[MAX_PLAYER_COUNT]; //CODE.bss:800697C8 s32 highlight_players; @@ -244,7 +235,7 @@ s32 highlight_aimadjustment; * Address 0x800697F0 * EU .bss 0x80058730 */ -u32 arrayUnlockedCheats[75]; +u32 arrayUnlockedCheats[CHEAT_INVALID]; MENU current_menu = MENU_INVALID; @@ -289,7 +280,7 @@ s32 is_first_time_on_legal_screen = TRUE; s32 is_first_time_on_main_menu = TRUE; s32 prev_keypresses = 0; -s32 ge_logo_bool = 0; +s32 ge_logo_bool = FALSE; s32 maybe_is_in_menu = TRUE; s32 screen_size = SCREEN_SIZE_320x240; @@ -299,23 +290,24 @@ s32 is_emulating_spectrum = FALSE; s32 is_cheat_menu_available = FALSE; -Gfx * ptr_logo_and_walletbond_DL = 0; +u8 * ptr_logo_and_walletbond_DL = NULL; s32 ptr_menu_videobuffer = 0; struct Model *logoinst = NULL; struct Model * walletinst[] = { NULL, NULL, NULL, NULL}; s32 D_8002A96C = 0; -struct rgba_u8 RGBA_8002A970 = {0x96, 0x96, 0x96, 0}; -struct rgba_u8 RGBA_8002A974 = {0x96, 0x96, 0x96, 0}; -struct rgba_u8 RGBA_8002A978 = {0xFF, 0xFF, 0xFF, 0}; -struct rgba_u8 RGBA_8002A97C = {0xFF, 0xFF, 0xFF, 0}; -struct rgba_u8 RGBA_8002A980 = {0x4D, 0x4D, 0x2E, 0}; -struct rgba_u8 RGBA_8002A984 = {0}; -struct rgba_u8 RGBA_8002A988 = {0xFF, 0xFF, 0xFF, 0}; -struct rgba_u8 RGBA_8002A98C = {0xFF, 0xFF, 0xFF, 0}; -u32 D_8002A990 = 0; -u32 D_8002A994 = 0; -u32 D_8002A998 = 0; -u32 D_8002A99C = 0; + +Lights1 gelogolight = gdSPDefLights1( + 0x96, 0x96, 0x96, + 0xFF, 0xFF, 0xFF, + 77, 77, 46 +); + +Lights1 ninlogolight = gdSPDefLights1( + 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, + 0, 0, 0 +); + f32 slider_007_mode_reaction = 0.0f; f32 slider_007_mode_health = 1.0f; @@ -330,136 +322,82 @@ rgba_u8 D_8002A9BC = { 0x8C, 0x00, 0x00, 0x00 }; struct coord3d legalpage_pos = {0.0f, 0.0f, 0.0f}; struct legal_screen_text legalpage_text_array[] = { - {220, 30, 1, 1, TEXT(LTITLE, 0x07), 0}, //"TWYCROSS BOARD OF GAME CLASSIFICATION\n" - { 34, 83, 0, 1, TEXT(LTITLE, 0x08), 0}, //"This is to certify\n" - {226, 84, 0, 1, TEXT(LTITLE, 0x09), 0}, //"(c) 1997 Nintendo/Rare\n" - {226, 97, 0, 1, TEXT(LTITLE, 0x0A), 0}, //"(c) 1962, 1995 Danjaq, LLC. &\n" - {226, 110, 0, 1, TEXT(LTITLE, 0x0B), 0}, //"U.A.C. All Rights Reserved\n" - {226, 122, 0, 1, TEXT(LTITLE, 0x0C), 0}, //"(c) 1997 Eon Productions\n" - {227, 134, 0, 1, TEXT(LTITLE, 0x0D), 0}, //"Ltd. & Mac B. Inc.\n" - {219, 211, 0, 1, TEXT(LTITLE, 0x0E), 0}, //"Suitable only for 1-4 persons\n" - { 60, 169, 0, 1, TEXT(LTITLE, 0x0F), 0}, //"PRESIDENT\n" - { 60, 201, 0, 1, TEXT(LTITLE, 0x10), 0}, //"VICE\n" - { 99, 266, 0, 1, TEXT(LTITLE, 0x11), 0}, //"James Bond theme by Monty Norman.\n" - { 80, 280, 0, 1, TEXT(LTITLE, 0x12), 0} //"Used by permission of EMI Unart Catalog Inc.\n" + {220, 30, CENTER_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_07), 0}, //"TWYCROSS BOARD OF GAME CLASSIFICATION\n" + { 34, 83, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_08), 0}, //"This is to certify\n" + {226, 84, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_09), 0}, //"(c) 1997 Nintendo/Rare\n" + {226, 97, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_10), 0}, //"(c) 1962, 1995 Danjaq, LLC. &\n" + {226, 110, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_11), 0}, //"U.A.C. All Rights Reserved\n" + {226, 122, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_12), 0}, //"(c) 1997 Eon Productions\n" + {227, 134, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_13), 0}, //"Ltd. & Mac B. Inc.\n" + {219, 211, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_14), 0}, //"Suitable only for 1-4 persons\n" + { 60, 169, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_15), 0}, //"PRESIDENT\n" + { 60, 201, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_16), 0}, //"VICE\n" + { 99, 266, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_17), 0}, //"James Bond theme by Monty Norman.\n" + { 80, 280, LEFT_ALIGN, CENTER_ALIGN, TEXT(LTITLE, TITLE_STR_18), 0} //"Used by permission of EMI Unart Catalog Inc.\n" }; struct unk_joint_list D_8002AABC = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; struct coord3d nintendologo_pos = {0}; -u32 D_8002AB08 = 0; - -u32 D_8002AB0C = 1; -u32 D_8002AB10 = 3; -u32 D_8002AB14 = 0; -u32 D_8002AB18 = 0; -u32 D_8002AB1C = 0; -u32 D_8002AB20 = 0; -u32 D_8002AB24 = 0; -u32 D_8002AB28 = 0; -u32 D_8002AB2C = 0; -u32 D_8002AB30 = 0; -u32 D_8002AB34 = 0; -u32 D_8002AB38 = 0; -u32 D_8002AB3C = 0; -u32 D_8002AB40 = 0; -u32 D_8002AB44 = 0; +struct unk_joint_list D_8002AB08 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; + + struct coord3d goldeneyelogo_pos = { 0 }; -u32 D_8002AB54 = 0; -u32 D_8002AB58 = 1; -u32 D_8002AB5C = 3; -u32 D_8002AB60 = 0; -u32 D_8002AB64 = 0; -u32 D_8002AB68 = 0; -u32 D_8002AB6C = 0; -u32 D_8002AB70 = 0; -u32 D_8002AB74 = 0; -u32 D_8002AB78 = 0; -u32 D_8002AB7C = 0; -u32 D_8002AB80 = 0; -u32 D_8002AB84 = 0; -u32 D_8002AB88 = 0; -u32 D_8002AB8C = 0; -u32 D_8002AB90 = 0; - -f32 D_8002AB94 = -900.0f; -f32 D_8002AB98 = 800.0f; -f32 D_8002AB9C = 0.0f; -f32 D_8002ABA0 = 1800.0f; -f32 D_8002ABA4 = 800.0f; -f32 D_8002ABA8 = 0.0f; -f32 D_8002ABAC = -1800.0f; -f32 D_8002ABB0 = -200.0f; -f32 D_8002ABB4 = 0.0f; -f32 D_8002ABB8 = 900.0f; -f32 D_8002ABBC = -200.0f; -f32 D_8002ABC0 = 0.0f; - -f32 folder_option_COPY_left_bound = 0.0f; -f32 folder_option_COPY_upper_bound = 0.0f; -f32 folder_option_COPY_right_bound = 0.0f; -f32 folder_option_COPY_lower_bound = 0.0f; -f32 folder_option_ERASE_left_bound = 0.0f; -f32 folder_option_ERASE_upper_bound = 0.0f; -f32 folder_option_ERASE_right_bound = 0.0f; -f32 folder_option_ERASE_lower_bound = 0.0f; +struct unk_joint_list D_8002AB54 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; + +struct coord3d D_8002AB94[] = { + {-900.0f, 800.0f, 0.0f}, + {1800.0f, 800.0f, 0.0f}, + {-1800.0f, -200.0f, 0.0f}, + {900.0f, -200.0f, 0.0f} +}; + +struct rectbbox folder_option_COPY_bound = { 0 }; +struct rectbbox folder_option_ERASE_bound = { 0 }; struct mission_folder_setup mission_folder_setup_entries[] = { - {"1", TEXT(LTITLE, 0x78), 0, LEVELID_NONE, 0, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x79), 0, LEVELID_DAM, 0, MISSION_PART, 0, "UbriefdamZ"}, - {"ii", TEXT(LTITLE, 0x7A), 0, LEVELID_FACILITY, 0, MISSION_PART, 1, "UbriefarkZ"}, - {"iii", TEXT(LTITLE, 0x7B), 0, LEVELID_RUNWAY, 0, MISSION_PART, 2, "UbriefrunZ"}, - {"2", TEXT(LTITLE, 0x7C), 0, LEVELID_NONE, 0, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x7D), 0, LEVELID_SURFACE, 0, MISSION_PART, 3, "UbriefsevxZ"}, - {"ii", TEXT(LTITLE, 0x7E), 0, LEVELID_BUNKER1, 0, MISSION_PART, 4, "UbriefsevbunkerZ"}, - {"3", TEXT(LTITLE, 0x7F), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x80), TEXT(LTITLE, 0x81), LEVELID_SILO, 1, MISSION_PART, 5, "UbriefsiloZ"}, - {"4", TEXT(LTITLE, 0x82), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x83), 0, LEVELID_FRIGATE, 1, MISSION_PART, 6, "UbriefdestZ"}, - {"5", TEXT(LTITLE, 0x7C), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x7D), 0, LEVELID_SURFACE2, 1, MISSION_PART, 7, "UbriefsevxbZ"}, - {"ii", TEXT(LTITLE, 0x7E), 0, LEVELID_BUNKER2, 1, MISSION_PART, 8, "UbriefsevbZ"}, - {"6", TEXT(LTITLE, 0x84), 0, LEVELID_NONE, 2, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x85), TEXT(LTITLE, 0x86), LEVELID_STATUE, 2, MISSION_PART, 9, "UbriefstatueZ"}, - {"ii", TEXT(LTITLE, 0x87), TEXT(LTITLE, 0x88), LEVELID_ARCHIVES, 2, MISSION_PART, 0xA, "UbriefarchZ"}, - {"iii", TEXT(LTITLE, 0x89), 0, LEVELID_STREETS, 2, MISSION_PART, 0xB, "UbriefpeteZ"}, - {"iv", TEXT(LTITLE, 0x8A), 0, LEVELID_DEPOT, 2, MISSION_PART, 0xC, "UbriefdepoZ"}, - {"v", TEXT(LTITLE, 0x8B), 0, LEVELID_TRAIN, 2, MISSION_PART, 0xD, "UbrieftraZ"}, - {"7", TEXT(LTITLE, 0x8C), 0, LEVELID_NONE, 3, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x8D), 0, LEVELID_JUNGLE, 3, MISSION_PART, 0xE, "UbriefjunZ"}, - {"ii", TEXT(LTITLE, 0x8E), TEXT(LTITLE, 0x8F), LEVELID_CONTROL, 3, MISSION_PART, 0xF, "UbriefcontrolZ"}, - {"iii", TEXT(LTITLE, 0x90), TEXT(LTITLE, 0x91), LEVELID_CAVERNS, 3, MISSION_PART, 0x10, "UbriefcaveZ"}, - {"iv", TEXT(LTITLE, 0x92), TEXT(LTITLE, 0x93), LEVELID_CRADLE, 3, MISSION_PART, 0x11, "UbriefcradZ"}, - {"8", TEXT(LTITLE, 0x94), 0, LEVELID_NONE, 4, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x95), TEXT(LTITLE, 0x96), LEVELID_AZTEC, 4, MISSION_PART, 0x12, "UbriefaztZ"}, - {"9", TEXT(LTITLE, 0x97), 0, LEVELID_NONE, 4, MISSION_HEADER, -1, 0}, - {"i", TEXT(LTITLE, 0x98), TEXT(LTITLE, 0x99), LEVELID_EGYPT, 4, MISSION_PART, 0x13, "UbriefcrypZ"}, + {"1", TEXT(LTITLE, TITLE_STR_120), 0, LEVELID_NONE, 0, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_121), 0, LEVELID_DAM, 0, MISSION_PART, 0, "UbriefdamZ"}, + {"ii", TEXT(LTITLE, TITLE_STR_122), 0, LEVELID_FACILITY, 0, MISSION_PART, 1, "UbriefarkZ"}, + {"iii", TEXT(LTITLE, TITLE_STR_123), 0, LEVELID_RUNWAY, 0, MISSION_PART, 2, "UbriefrunZ"}, + {"2", TEXT(LTITLE, TITLE_STR_124), 0, LEVELID_NONE, 0, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_125), 0, LEVELID_SURFACE, 0, MISSION_PART, 3, "UbriefsevxZ"}, + {"ii", TEXT(LTITLE, TITLE_STR_126), 0, LEVELID_BUNKER1, 0, MISSION_PART, 4, "UbriefsevbunkerZ"}, + {"3", TEXT(LTITLE, TITLE_STR_127), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_128), TEXT(LTITLE, TITLE_STR_129), LEVELID_SILO, 1, MISSION_PART, 5, "UbriefsiloZ"}, + {"4", TEXT(LTITLE, TITLE_STR_130), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_131), 0, LEVELID_FRIGATE, 1, MISSION_PART, 6, "UbriefdestZ"}, + {"5", TEXT(LTITLE, TITLE_STR_124), 0, LEVELID_NONE, 1, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_125), 0, LEVELID_SURFACE2, 1, MISSION_PART, 7, "UbriefsevxbZ"}, + {"ii", TEXT(LTITLE, TITLE_STR_126), 0, LEVELID_BUNKER2, 1, MISSION_PART, 8, "UbriefsevbZ"}, + {"6", TEXT(LTITLE, TITLE_STR_132), 0, LEVELID_NONE, 2, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_133), TEXT(LTITLE, TITLE_STR_134), LEVELID_STATUE, 2, MISSION_PART, 9, "UbriefstatueZ"}, + {"ii", TEXT(LTITLE, TITLE_STR_135), TEXT(LTITLE, TITLE_STR_136), LEVELID_ARCHIVES, 2, MISSION_PART, 0xA, "UbriefarchZ"}, + {"iii", TEXT(LTITLE, TITLE_STR_137), 0, LEVELID_STREETS, 2, MISSION_PART, 0xB, "UbriefpeteZ"}, + {"iv", TEXT(LTITLE, TITLE_STR_138), 0, LEVELID_DEPOT, 2, MISSION_PART, 0xC, "UbriefdepoZ"}, + {"v", TEXT(LTITLE, TITLE_STR_139), 0, LEVELID_TRAIN, 2, MISSION_PART, 0xD, "UbrieftraZ"}, + {"7", TEXT(LTITLE, TITLE_STR_140), 0, LEVELID_NONE, 3, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_141), 0, LEVELID_JUNGLE, 3, MISSION_PART, 0xE, "UbriefjunZ"}, + {"ii", TEXT(LTITLE, TITLE_STR_142), TEXT(LTITLE, TITLE_STR_143), LEVELID_CONTROL, 3, MISSION_PART, 0xF, "UbriefcontrolZ"}, + {"iii", TEXT(LTITLE, TITLE_STR_144), TEXT(LTITLE, TITLE_STR_145), LEVELID_CAVERNS, 3, MISSION_PART, 0x10, "UbriefcaveZ"}, + {"iv", TEXT(LTITLE, TITLE_STR_146), TEXT(LTITLE, TITLE_STR_147), LEVELID_CRADLE, 3, MISSION_PART, 0x11, "UbriefcradZ"}, + {"8", TEXT(LTITLE, TITLE_STR_148), 0, LEVELID_NONE, 4, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_149), TEXT(LTITLE, TITLE_STR_150), LEVELID_AZTEC, 4, MISSION_PART, 0x12, "UbriefaztZ"}, + {"9", TEXT(LTITLE, TITLE_STR_151), 0, LEVELID_NONE, 4, MISSION_HEADER, -1, 0}, + {"i", TEXT(LTITLE, TITLE_STR_152), TEXT(LTITLE, TITLE_STR_153), LEVELID_EGYPT, 4, MISSION_PART, 0x13, "UbriefcrypZ"}, {NULL, 0, 0, LEVELID_NONE, -1, MISSION_PART, -1, 0} }; -u32 unknown_folderselect_constructor = 0x14; -u32 D_8002AF30 = 0x14; -u32 D_8002AF34 = 0x14; -u32 unknown_folderselect_constructor_0 = 0x32; -u32 D_8002AF3C = 0x32; -u32 D_8002AF40 = 0x32; - -u32 unknown_folderselect[] = { - 0, 1, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0 -}; +struct FolderSelect unknown_folderselect_constructor = { 0x14, 0x14, 0x14 }; +struct FolderSelect unknown_folderselect_constructor_0 = { 0x32, 0x32, 0x32 }; -u32 D_8002AF84[] = { - 0, 1, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0 -}; -u32 D_8002AFC0 = 0; -u32 D_8002AFC4 = 0; +struct unk_joint_list unknown_folderselect = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; +struct unk_joint_list D_8002AF84 = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; + +f32 D_8002AFC4 = 0; f32 D_8002AFC8 = 190.0; f32 D_8002AFCC = -3300.0; s32 cursor_xpos_table_mission_select[] = {73, 142, 212, 282, 352}; @@ -471,229 +409,236 @@ s32 cursor_ypos_table_mission_select[] = {62, 131, 201, 270}; #endif struct MP_game_length_settings multi_game_lengths[] = { - {TEXT(LTITLE, 0x2D), 0, 0, 0}, /* unlimited */ - {TEXT(LTITLE, 0x2E), 0, MINS_TO_TIMER60(5), 0}, /* 5 minutes */ - {TEXT(LTITLE, 0x2F), 0, MINS_TO_TIMER60(10), 0}, /* 10 minutes */ - {TEXT(LTITLE, 0x30), 0, MINS_TO_TIMER60(20), 0}, /* 20 minutes */ - {TEXT(LTITLE, 0x31), 0, 0, 5}, /* first to 5 points */ - {TEXT(LTITLE, 0x32), 0, 0, 10}, /* first to 10 points */ - {TEXT(LTITLE, 0x33), 0, 0, 20}, /* first to 20 points */ - {TEXT(LTITLE, 0x34), 0, 0, 0} /* last person alive wins */ + {TEXT(LTITLE, TITLE_STR_45), 0, 0, 0}, /* unlimited */ + {TEXT(LTITLE, TITLE_STR_46), 0, MINS_TO_TIMER60(5), 0}, /* 5 minutes */ + {TEXT(LTITLE, TITLE_STR_47), 0, MINS_TO_TIMER60(10), 0}, /* 10 minutes */ + {TEXT(LTITLE, TITLE_STR_48), 0, MINS_TO_TIMER60(20), 0}, /* 20 minutes */ + {TEXT(LTITLE, TITLE_STR_49), 0, 0, 5}, /* first to 5 points */ + {TEXT(LTITLE, TITLE_STR_50), 0, 0, 10}, /* first to 10 points */ + {TEXT(LTITLE, TITLE_STR_51), 0, 0, 20}, /* first to 20 points */ + {TEXT(LTITLE, TITLE_STR_52), 0, 0, 0} /* last person alive wins */ }; struct mp_stage_playercount mp_player_counts[] = { - {TEXT(LTITLE, 0x35), 2, 4}, //"Normal" - {TEXT(LTITLE, 0x36), 2, 4}, //"You Only Live Twice" - {TEXT(LTITLE, 0x37), 2, 4}, //"The Living Daylights [Flag Tag]" - {TEXT(LTITLE, 0x38), 2, 4}, //"The Man With the Golden Gun" - {TEXT(LTITLE, 0x39), 2, 4}, //"License to Kill" - {TEXT(LTITLE, 0x3A), 4, 4}, //"Team: 2 vs 2" - {TEXT(LTITLE, 0x3B), 4, 4}, //"Team: 3 vs 1" - {TEXT(LTITLE, 0x3C), 3, 3} //"Team: 2 vs 1" + {TEXT(LTITLE, TITLE_STR_53), 2, 4}, //"Normal" + {TEXT(LTITLE, TITLE_STR_54), 2, 4}, //"You Only Live Twice" + {TEXT(LTITLE, TITLE_STR_55), 2, 4}, //"The Living Daylights [Flag Tag]" + {TEXT(LTITLE, TITLE_STR_56), 2, 4}, //"The Man With the Golden Gun" + {TEXT(LTITLE, TITLE_STR_57), 2, 4}, //"License to Kill" + {TEXT(LTITLE, TITLE_STR_58), 4, 4}, //"Team: 2 vs 2" + {TEXT(LTITLE, TITLE_STR_59), 4, 4}, //"Team: 3 vs 1" + {TEXT(LTITLE, TITLE_STR_60), 3, 3} //"Team: 2 vs 1" }; struct mp_stage_setup multi_stage_setups[] = { /* unlocked by default */ - {TEXT(LTITLE, 0x9A), TEXT(LTITLE, 0x9B), 16, LEVELID_NONE, -1, 1, 4}, - {TEXT(LTITLE, 0x9C), TEXT(LTITLE, 0x9D), 12, LEVELID_TEMPLE, -1, 1, 4}, - {TEXT(LTITLE, 0x9E), TEXT(LTITLE, 0x9F), 14, LEVELID_COMPLEX, -1, 1, 4}, - {TEXT(LTITLE, 0xA2), TEXT(LTITLE, 0xA3), 15, LEVELID_CAVES, -1, 1, 4}, - {TEXT(LTITLE, 0xA0), TEXT(LTITLE, 0xA1), 13, LEVELID_LIBRARY, -1, 1, 4}, - {TEXT(LTITLE, 0x10D), TEXT(LTITLE, 0x10E), 13, LEVELID_BASEMENT, -1, 1, 4}, - {TEXT(LTITLE, 0x10F), TEXT(LTITLE, 0x110), 13, LEVELID_STACK, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_154), TEXT(LTITLE, TITLE_STR_155), IMG_MP_RANDOM, LEVELID_NONE, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_156), TEXT(LTITLE, TITLE_STR_157), IMG_MP_TEMPLE, LEVELID_TEMPLE, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_158), TEXT(LTITLE, TITLE_STR_159), IMG_MP_COMPLEX, LEVELID_COMPLEX, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_162), TEXT(LTITLE, TITLE_STR_163), IMG_MP_CAVES, LEVELID_CAVES, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_160), TEXT(LTITLE, TITLE_STR_161), IMG_MP_BASEMENT, LEVELID_LIBRARY, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_269), TEXT(LTITLE, TITLE_STR_270), IMG_MP_BASEMENT, LEVELID_BASEMENT, -1, 1, 4}, + {TEXT(LTITLE, TITLE_STR_271), TEXT(LTITLE, TITLE_STR_272), IMG_MP_BASEMENT, LEVELID_STACK, -1, 1, 4}, /* unlocked on level progression */ - {TEXT(LTITLE, 0xA4), TEXT(LTITLE, 0xA5), 04, LEVELID_FACILITY, SP_LEVEL_FACILITY, 1, 4}, - {TEXT(LTITLE, 0xA6), TEXT(LTITLE, 0xA7), 00, LEVELID_BUNKER2, SP_LEVEL_BUNKER2, 1, 3}, - {TEXT(LTITLE, 0xA8), TEXT(LTITLE, 0xA9), 02, LEVELID_ARCHIVES, SP_LEVEL_ARCHIVES, 1, 3}, - {TEXT(LTITLE, 0xAA), TEXT(LTITLE, 0xAB), 01, LEVELID_CAVERNS, SP_LEVEL_CAVERNS, 1, 3}, - {TEXT(LTITLE, 0xAC), TEXT(LTITLE, 0xAD), 10, LEVELID_EGYPT, SP_LEVEL_EGYPT, 1, 2} + {TEXT(LTITLE, TITLE_STR_164), TEXT(LTITLE, TITLE_STR_165), IMG_MP_FACILITY, LEVELID_FACILITY, SP_LEVEL_FACILITY, 1, 4}, + {TEXT(LTITLE, TITLE_STR_166), TEXT(LTITLE, TITLE_STR_167), IMG_MP_BUNKER2, LEVELID_BUNKER2, SP_LEVEL_BUNKER2, 1, 3}, + {TEXT(LTITLE, TITLE_STR_168), TEXT(LTITLE, TITLE_STR_169), IMG_MP_ARCHIVES, LEVELID_ARCHIVES, SP_LEVEL_ARCHIVES, 1, 3}, + {TEXT(LTITLE, TITLE_STR_170), TEXT(LTITLE, TITLE_STR_171), IMG_MP_CAVERNS, LEVELID_CAVERNS, SP_LEVEL_CAVERNS, 1, 3}, + {TEXT(LTITLE, TITLE_STR_172), TEXT(LTITLE, TITLE_STR_173), IMG_MP_EGYPT, LEVELID_EGYPT, SP_LEVEL_EGYPT, 1, 2} + //{TEXT(LTITLE, TITLE_STR_174), TEXT(LTITLE, TITLE_STR_175), IMG_MP_RANDOM, LEVELID_CITADEL, -1, 1, 4}, //Citadel + //{TEXT(LTITLE, TITLE_STR_176), TEXT(LTITLE, TITLE_STR_177), IMG_MP_FRIGATE, LEVELID_FRIGATE, -1, 1, 4}, //dest + //{TEXT(LTITLE, TITLE_STR_178), TEXT(LTITLE, TITLE_STR_179), IMG_MP_STATUE, LEVELID_STATUE, -1, 1, 4}, //stat + //{TEXT(LTITLE, TITLE_STR_180), TEXT(LTITLE, TITLE_STR_181), IMG_MP_CRADLE, LEVELID_CRADLE, -1, 1, 4}, //crad + //{TEXT(LTITLE, TITLE_STR_182), TEXT(LTITLE, TITLE_STR_183), IMG_MP_AZTEC, LEVELID_AZTEC, -1, 1, 4}, //azt + }; -u32 num_chars_selectable_mp = 8; +s32 num_chars_selectable_mp = 8; -#ifdef VERSION_US +#ifdef BUGFIX_R0 struct MP_selectable_chars mp_chr_setup[] = { - {TEXT(LTITLE, 0xB8), MALE, 0, BODY_Tuxedo, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBF), FEMALE, 9, BODY_Natalya_Skirt, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.96609998}, - {TEXT(LTITLE, 0xBC), MALE, 6, BODY_Trevelyan_Janus, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBE), FEMALE, 8, BODY_Xenia, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBB), MALE, 5, BODY_Ourumov, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0778}, - {TEXT(LTITLE, 0xBA), MALE, 4, BODY_Boris, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.9702}, - {TEXT(LTITLE, 0xBD), MALE, 7, BODY_Valentin_, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.93239999}, - {TEXT(LTITLE, 0xB9), MALE, 0xF, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Mishkin, 1.0}, - {TEXT(LTITLE, 0xC2), FEMALE, 0xC, BODY_Mayday, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xC1), MALE, 0xB, BODY_Jaws, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.199}, - {TEXT(LTITLE, 0xC3), MALE, 0xD, BODY_Oddjob, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT,0.78780001}, - {TEXT(LTITLE, 0xC0), MALE, 0xA, BODY_Baron_Samedi, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xFD), MALE, 0xE, BODY_Russian_Soldier, HEAD_Male_Mark, 1.0}, - {TEXT(LTITLE, 0xFC), MALE, 0xE, BODY_Russian_Infantry, HEAD_Male_Karl, 1.0}, - {TEXT(LTITLE, 0x107), MALE, 0xE, BODY_Scientist_1_Male, HEAD_Male_Dave_Dr_Doak, 1.0}, - {TEXT(LTITLE, 0x107), FEMALE, 0xE, BODY_Scientist_2_Female, HEAD_Female_Sally, 1.0}, - {TEXT(LTITLE, 0x100), MALE, 0xE, BODY_Russian_Commandant, HEAD_Male_Martin, 1.0}, - {TEXT(LTITLE, 0xFE), MALE, 0xE, BODY_Janus_Marine, HEAD_Male_Steve_Ellis, 1.0}, - {TEXT(LTITLE, 0x101), MALE, 0xE, BODY_Naval_Officer, HEAD_Male_Duncan, 1.0}, - {TEXT(LTITLE, 0x106), MALE, 0xE, BODY_Helicopter_Pilot, HEAD_Male_Pete, 1.0}, - {TEXT(LTITLE, 0xFB), MALE, 0xE, BODY_St_Petersburg_Guard, HEAD_Male_Ken, 1.0}, - {TEXT(LTITLE, 0x108), FEMALE, 0xE, BODY_Civilian_1_Female, HEAD_Female_Marion_Rosika, 1.0}, - {TEXT(LTITLE, 0x108), MALE, 0xE, BODY_Civilian_2, HEAD_Male_Graeme, 1.0}, - {TEXT(LTITLE, 0x108), MALE, 0xE, BODY_Civilian_3, HEAD_Male_Grant, 1.0}, - {TEXT(LTITLE, 0x108), MALE, 0xE, BODY_Civilian_4, HEAD_Male_Dwayne, 1.0}, - {TEXT(LTITLE, 0x102), MALE, 0xE, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Lee, 1.0}, - {TEXT(LTITLE, 0x103), MALE, 0xE, BODY_Arctic_Commando, HEAD_Male_Chris, 1.0}, - {TEXT(LTITLE, 0x102), MALE, 0xE, BODY_Siberian_Guard_2, HEAD_Male_Scott, 1.0}, - {TEXT(LTITLE, 0x104), MALE, 0xE, BODY_Siberian_Special_Forces, HEAD_Male_Alan, 1.0}, - {TEXT(LTITLE, 0xFA), MALE, 0xE, BODY_Jungle_Commando, HEAD_Male_Joel, 1.0}, - {TEXT(LTITLE, 0xFF), MALE, 0xE, BODY_Janus_Special_Forces, HEAD_Male_B, 1.0}, - {TEXT(LTITLE, 0x105), MALE, 0xE, BODY_Moonraker_Elite_1_Male, HEAD_Male_Neil, 1.0}, - {TEXT(LTITLE, 0x105), FEMALE, 0xE, BODY_Moonraker_Elite_2_Female, HEAD_Female_Vivien, 1.0}, - {TEXT(LTITLE, 0xC4), FEMALE, 0xE, BODY_Rosika, HEAD_Female_Marion_Rosika, 0.88529998}, - {TEXT(LTITLE, 0xC5), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Karl, 1.0446}, - {TEXT(LTITLE, 0xC6), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Martin, 1.0446}, - {TEXT(LTITLE, 0xC7), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Mark, 1.0446}, - {TEXT(LTITLE, 0xC8), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Dave_Dr_Doak, 1.0446}, - {TEXT(LTITLE, 0xC9), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Duncan, 1.0446}, - {TEXT(LTITLE, 0xCA), FEMALE, 0xE, BODY_Tuxedo, HEAD_Male_B, 1.0446}, - {TEXT(LTITLE, 0xCB), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Steve_Ellis, 1.0446}, - {TEXT(LTITLE, 0xCC), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Grant, 1.0446}, - {TEXT(LTITLE, 0xCD), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Graeme, 1.0446}, - {TEXT(LTITLE, 0xCE), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Ken, 1.0446}, - {TEXT(LTITLE, 0xCF), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Alan, 1.0446}, - {TEXT(LTITLE, 0xD0), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Pete, 1.0446}, - {TEXT(LTITLE, 0xD1), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Shaun, 1.0446}, - {TEXT(LTITLE, 0xD2), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Dwayne, 1.0446}, - {TEXT(LTITLE, 0xD3), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Des, 1.0446}, - {TEXT(LTITLE, 0xD4), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Chris, 1.0446}, - {TEXT(LTITLE, 0xD5), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Lee, 1.0446}, - {TEXT(LTITLE, 0xD6), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Neil, 1.0446}, - {TEXT(LTITLE, 0xD7), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Jim, 1.0446}, - {TEXT(LTITLE, 0xD8), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Robin, 1.0446}, - {TEXT(LTITLE, 0xD9), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Steve_H, 1.0446}, - {TEXT(LTITLE, 0xDA), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Terrorist, 1.0446}, - {TEXT(LTITLE, 0xDB), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Biker, 1.0446}, - {TEXT(LTITLE, 0xDC), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Joel, 1.0446}, - {TEXT(LTITLE, 0xDD), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Scott, 1.0446}, - {TEXT(LTITLE, 0xDE), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Joe, 1.0446}, - {TEXT(LTITLE, 0xDF), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Sally, 1.0446}, - {TEXT(LTITLE, 0xE0), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Marion_Rosika, 1.0446}, - {TEXT(LTITLE, 0xE1), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Mandy, 1.0446}, - {TEXT(LTITLE, 0xE2), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Vivien, 1.0446} + {TEXT(LTITLE, TITLE_STR_184), MALE, IMG_MPC_BROSNAN, BODY_Brosnan_Tuxedo, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_191), FEMALE, IMG_MPC_NATALYA, BODY_Natalya_Skirt, HEAD_Male_Brosnan_Tuxedo, 0.96609998}, + {TEXT(LTITLE, TITLE_STR_188), MALE, IMG_MPC_TREVELYAN, BODY_Trevelyan_Janus, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_190), FEMALE, IMG_MPC_XENIA, BODY_Xenia, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_187), MALE, IMG_MPC_OURUMOV, BODY_Ourumov, HEAD_Male_Brosnan_Tuxedo, 1.0778}, + {TEXT(LTITLE, TITLE_STR_186), MALE, IMG_MPC_BORIS, BODY_Boris, HEAD_Male_Brosnan_Tuxedo, 0.9702}, + {TEXT(LTITLE, TITLE_STR_189), MALE, IMG_MPC_VALENTIN, BODY_Valentin_, HEAD_Male_Brosnan_Tuxedo, 0.93239999}, + {TEXT(LTITLE, TITLE_STR_185), MALE, IMG_MPC_MISHKIN, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Mishkin, 1.0}, + {TEXT(LTITLE, TITLE_STR_194), FEMALE, IMG_MPC_MAYDAY, BODY_Mayday, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_193), MALE, IMG_MPC_JAWS, BODY_Jaws, HEAD_Male_Brosnan_Tuxedo, 1.199}, + {TEXT(LTITLE, TITLE_STR_195), MALE, IMG_MPC_ODDJOB, BODY_Oddjob, HEAD_Male_Brosnan_Tuxedo,0.78780001}, + {TEXT(LTITLE, TITLE_STR_192), MALE, IMG_MPC_BARON, BODY_Baron_Samedi, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_253), MALE, IMG_MPC_RANDOM, BODY_Russian_Soldier, HEAD_Male_Mark, 1.0}, + {TEXT(LTITLE, TITLE_STR_252), MALE, IMG_MPC_RANDOM, BODY_Russian_Infantry, HEAD_Male_Karl, 1.0}, + {TEXT(LTITLE, TITLE_STR_263), MALE, IMG_MPC_RANDOM, BODY_Scientist_1_Male, HEAD_Male_Dave_Dr_Doak, 1.0}, + {TEXT(LTITLE, TITLE_STR_263), FEMALE, IMG_MPC_RANDOM, BODY_Scientist_2_Female, HEAD_Female_Sally, 1.0}, + {TEXT(LTITLE, TITLE_STR_256), MALE, IMG_MPC_RANDOM, BODY_Russian_Commandant, HEAD_Male_Martin, 1.0}, + {TEXT(LTITLE, TITLE_STR_254), MALE, IMG_MPC_RANDOM, BODY_Janus_Marine, HEAD_Male_Steve_Ellis, 1.0}, + {TEXT(LTITLE, TITLE_STR_257), MALE, IMG_MPC_RANDOM, BODY_Naval_Officer, HEAD_Male_Duncan, 1.0}, + {TEXT(LTITLE, TITLE_STR_262), MALE, IMG_MPC_RANDOM, BODY_Helicopter_Pilot, HEAD_Male_Pete, 1.0}, + {TEXT(LTITLE, TITLE_STR_251), MALE, IMG_MPC_RANDOM, BODY_St_Petersburg_Guard, HEAD_Male_Ken, 1.0}, + {TEXT(LTITLE, TITLE_STR_264), FEMALE, IMG_MPC_RANDOM, BODY_Civilian_1_Female, HEAD_Female_Marion_Rosika, 1.0}, + {TEXT(LTITLE, TITLE_STR_264), MALE, IMG_MPC_RANDOM, BODY_Civilian_2, HEAD_Male_Graeme, 1.0}, + {TEXT(LTITLE, TITLE_STR_264), MALE, IMG_MPC_RANDOM, BODY_Civilian_3, HEAD_Male_Grant, 1.0}, + {TEXT(LTITLE, TITLE_STR_264), MALE, IMG_MPC_RANDOM, BODY_Civilian_4, HEAD_Male_Dwayne, 1.0}, + {TEXT(LTITLE, TITLE_STR_258), MALE, IMG_MPC_RANDOM, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Lee, 1.0}, + {TEXT(LTITLE, TITLE_STR_259), MALE, IMG_MPC_RANDOM, BODY_Arctic_Commando, HEAD_Male_Chris, 1.0}, + {TEXT(LTITLE, TITLE_STR_258), MALE, IMG_MPC_RANDOM, BODY_Siberian_Guard_2, HEAD_Male_Scott, 1.0}, + {TEXT(LTITLE, TITLE_STR_260), MALE, IMG_MPC_RANDOM, BODY_Siberian_Special_Forces, HEAD_Male_Alan, 1.0}, + {TEXT(LTITLE, TITLE_STR_250), MALE, IMG_MPC_RANDOM, BODY_Jungle_Commando, HEAD_Male_Joel, 1.0}, + {TEXT(LTITLE, TITLE_STR_255), MALE, IMG_MPC_RANDOM, BODY_Janus_Special_Forces, HEAD_Male_B, 1.0}, + {TEXT(LTITLE, TITLE_STR_261), MALE, IMG_MPC_RANDOM, BODY_Moonraker_Elite_1_Male, HEAD_Male_Neil, 1.0}, + {TEXT(LTITLE, TITLE_STR_261), FEMALE, IMG_MPC_RANDOM, BODY_Moonraker_Elite_2_Female, HEAD_Female_Vivien, 1.0}, + {TEXT(LTITLE, TITLE_STR_196), FEMALE, IMG_MPC_RANDOM, BODY_Rosika, HEAD_Female_Marion_Rosika, 0.88529998}, + {TEXT(LTITLE, TITLE_STR_197), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Karl, 1.0446}, + {TEXT(LTITLE, TITLE_STR_198), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Martin, 1.0446}, + {TEXT(LTITLE, TITLE_STR_199), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Mark, 1.0446}, + {TEXT(LTITLE, TITLE_STR_200), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Dave_Dr_Doak, 1.0446}, + {TEXT(LTITLE, TITLE_STR_201), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Duncan, 1.0446}, + {TEXT(LTITLE, TITLE_STR_202), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_B, 1.0446}, + {TEXT(LTITLE, TITLE_STR_203), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Steve_Ellis, 1.0446}, + {TEXT(LTITLE, TITLE_STR_204), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Grant, 1.0446}, + {TEXT(LTITLE, TITLE_STR_205), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Graeme, 1.0446}, + {TEXT(LTITLE, TITLE_STR_206), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Ken, 1.0446}, + {TEXT(LTITLE, TITLE_STR_207), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Alan, 1.0446}, + {TEXT(LTITLE, TITLE_STR_208), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Pete, 1.0446}, + {TEXT(LTITLE, TITLE_STR_209), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Shaun, 1.0446}, + {TEXT(LTITLE, TITLE_STR_210), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Dwayne, 1.0446}, + {TEXT(LTITLE, TITLE_STR_211), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Des, 1.0446}, + {TEXT(LTITLE, TITLE_STR_212), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Chris, 1.0446}, + {TEXT(LTITLE, TITLE_STR_213), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Lee, 1.0446}, + {TEXT(LTITLE, TITLE_STR_214), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Neil, 1.0446}, + {TEXT(LTITLE, TITLE_STR_215), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Jim, 1.0446}, + {TEXT(LTITLE, TITLE_STR_216), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Robin, 1.0446}, + {TEXT(LTITLE, TITLE_STR_217), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Steve_H, 1.0446}, + {TEXT(LTITLE, TITLE_STR_218), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Terrorist, 1.0446}, + {TEXT(LTITLE, TITLE_STR_219), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Biker, 1.0446}, + {TEXT(LTITLE, TITLE_STR_220), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Joel, 1.0446}, + {TEXT(LTITLE, TITLE_STR_221), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Scott, 1.0446}, + {TEXT(LTITLE, TITLE_STR_222), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Joe, 1.0446}, + {TEXT(LTITLE, TITLE_STR_223), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Sally, 1.0446}, + {TEXT(LTITLE, TITLE_STR_224), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Marion_Rosika, 1.0446}, + {TEXT(LTITLE, TITLE_STR_225), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Mandy, 1.0446}, + {TEXT(LTITLE, TITLE_STR_226), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Vivien, 1.0446} }; #endif #if defined(BUGFIX_R1) struct MP_selectable_chars mp_chr_setup[] = { - {TEXT(LTITLE, 0xB8), MALE, 0, BODY_Tuxedo, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBF), FEMALE, 9, BODY_Natalya_Skirt, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.96609998}, - {TEXT(LTITLE, 0xBC), MALE, 6, BODY_Trevelyan_Janus, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBE), FEMALE, 8, BODY_Xenia, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xBB), MALE, 5, BODY_Ourumov, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0778}, - {TEXT(LTITLE, 0xBA), MALE, 4, BODY_Boris, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.9702}, - {TEXT(LTITLE, 0xBD), MALE, 7, BODY_Valentin_, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 0.93239999}, - {TEXT(LTITLE, 0xB9), MALE, 0xF, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Mishkin, 1.0}, - {TEXT(LTITLE, 0xC2), FEMALE, 0xC, BODY_Mayday, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0xC1), MALE, 0xB, BODY_Jaws, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.199}, - {TEXT(LTITLE, 0xC3), MALE, 0xD, BODY_Oddjob, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT,0.78780001}, - {TEXT(LTITLE, 0xC0), MALE, 0xA, BODY_Baron_Samedi, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, 1.0}, - {TEXT(LTITLE, 0x11F), MALE, 0xE, BODY_Russian_Soldier, HEAD_Male_Mark, 1.0}, - {TEXT(LTITLE, 0x120), MALE, 0xE, BODY_Russian_Infantry, HEAD_Male_Karl, 1.0}, - {TEXT(LTITLE, 0x121), MALE, 0xE, BODY_Scientist_1_Male, HEAD_Male_Dave_Dr_Doak, 1.0}, - {TEXT(LTITLE, 0x121), FEMALE, 0xE, BODY_Scientist_2_Female, HEAD_Female_Sally, 1.0}, - {TEXT(LTITLE, 0x122), MALE, 0xE, BODY_Russian_Commandant, HEAD_Male_Martin, 1.0}, - {TEXT(LTITLE, 0x123), MALE, 0xE, BODY_Janus_Marine, HEAD_Male_Steve_Ellis, 1.0}, - {TEXT(LTITLE, 0x124), MALE, 0xE, BODY_Naval_Officer, HEAD_Male_Duncan, 1.0}, - {TEXT(LTITLE, 0x125), MALE, 0xE, BODY_Helicopter_Pilot, HEAD_Male_Pete, 1.0}, - {TEXT(LTITLE, 0x126), MALE, 0xE, BODY_St_Petersburg_Guard, HEAD_Male_Ken, 1.0}, - {TEXT(LTITLE, 0x127), FEMALE, 0xE, BODY_Civilian_1_Female, HEAD_Female_Marion_Rosika, 1.0}, - {TEXT(LTITLE, 0x127), MALE, 0xE, BODY_Civilian_2, HEAD_Male_Graeme, 1.0}, - {TEXT(LTITLE, 0x127), MALE, 0xE, BODY_Civilian_3, HEAD_Male_Grant, 1.0}, - {TEXT(LTITLE, 0x127), MALE, 0xE, BODY_Civilian_4, HEAD_Male_Dwayne, 1.0}, - {TEXT(LTITLE, 0x128), MALE, 0xE, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Lee, 1.0}, - {TEXT(LTITLE, 0x129), MALE, 0xE, BODY_Arctic_Commando, HEAD_Male_Chris, 1.0}, - {TEXT(LTITLE, 0x128), MALE, 0xE, BODY_Siberian_Guard_2, HEAD_Male_Scott, 1.0}, - {TEXT(LTITLE, 0x12A), MALE, 0xE, BODY_Siberian_Special_Forces, HEAD_Male_Alan, 1.0}, - {TEXT(LTITLE, 0x12B), MALE, 0xE, BODY_Jungle_Commando, HEAD_Male_Joel, 1.0}, - {TEXT(LTITLE, 0x12C), MALE, 0xE, BODY_Janus_Special_Forces, HEAD_Male_B, 1.0}, - {TEXT(LTITLE, 0x12D), MALE, 0xE, BODY_Moonraker_Elite_1_Male, HEAD_Male_Neil, 1.0}, - {TEXT(LTITLE, 0x12D), FEMALE, 0xE, BODY_Moonraker_Elite_2_Female, HEAD_Female_Vivien, 1.0}, - {TEXT(LTITLE, 0xC4), FEMALE, 0xE, BODY_Rosika, HEAD_Female_Marion_Rosika, 0.88529998}, - {TEXT(LTITLE, 0xC5), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Karl, 1.0446}, - {TEXT(LTITLE, 0xC6), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Martin, 1.0446}, - {TEXT(LTITLE, 0xC7), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Mark, 1.0446}, - {TEXT(LTITLE, 0xC8), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Dave_Dr_Doak, 1.0446}, - {TEXT(LTITLE, 0xC9), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Duncan, 1.0446}, - {TEXT(LTITLE, 0xCA), FEMALE, 0xE, BODY_Tuxedo, HEAD_Male_B, 1.0446}, - {TEXT(LTITLE, 0xCB), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Steve_Ellis, 1.0446}, - {TEXT(LTITLE, 0xCC), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Grant, 1.0446}, - {TEXT(LTITLE, 0xCD), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Graeme, 1.0446}, - {TEXT(LTITLE, 0xCE), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Ken, 1.0446}, - {TEXT(LTITLE, 0xCF), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Alan, 1.0446}, - {TEXT(LTITLE, 0xD0), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Pete, 1.0446}, - {TEXT(LTITLE, 0xD1), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Shaun, 1.0446}, - {TEXT(LTITLE, 0xD2), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Dwayne, 1.0446}, - {TEXT(LTITLE, 0xD3), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Des, 1.0446}, - {TEXT(LTITLE, 0xD4), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Chris, 1.0446}, - {TEXT(LTITLE, 0xD5), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Lee, 1.0446}, - {TEXT(LTITLE, 0xD6), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Neil, 1.0446}, - {TEXT(LTITLE, 0xD7), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Jim, 1.0446}, - {TEXT(LTITLE, 0xD8), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Robin, 1.0446}, - {TEXT(LTITLE, 0xD9), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Steve_H, 1.0446}, - {TEXT(LTITLE, 0xDA), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Terrorist, 1.0446}, - {TEXT(LTITLE, 0xDB), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Biker, 1.0446}, - {TEXT(LTITLE, 0xDC), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Joel, 1.0446}, - {TEXT(LTITLE, 0xDD), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Scott, 1.0446}, - {TEXT(LTITLE, 0xDE), MALE, 0xE, BODY_Tuxedo, HEAD_Male_Joe, 1.0446}, - {TEXT(LTITLE, 0xDF), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Sally, 1.0446}, - {TEXT(LTITLE, 0xE0), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Marion_Rosika, 1.0446}, - {TEXT(LTITLE, 0xE1), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Mandy, 1.0446}, - {TEXT(LTITLE, 0xE2), FEMALE, 0xE, BODY_Tuxedo, HEAD_Female_Vivien, 1.0446} + {TEXT(LTITLE, TITLE_STR_184), MALE, IMG_MPC_BROSNAN, BODY_Brosnan_Tuxedo, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_191), FEMALE, IMG_MPC_NATALYA, BODY_Natalya_Skirt, HEAD_Male_Brosnan_Tuxedo, 0.96609998}, + {TEXT(LTITLE, TITLE_STR_188), MALE, IMG_MPC_TREVELYAN, BODY_Trevelyan_Janus, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_190), FEMALE, IMG_MPC_XENIA, BODY_Xenia, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_187), MALE, IMG_MPC_OURUMOV, BODY_Ourumov, HEAD_Male_Brosnan_Tuxedo, 1.0778}, + {TEXT(LTITLE, TITLE_STR_186), MALE, IMG_MPC_BORIS, BODY_Boris, HEAD_Male_Brosnan_Tuxedo, 0.9702}, + {TEXT(LTITLE, TITLE_STR_189), MALE, IMG_MPC_VALENTIN, BODY_Valentin_, HEAD_Male_Brosnan_Tuxedo, 0.93239999}, + {TEXT(LTITLE, TITLE_STR_185), MALE, IMG_MPC_MISHKIN, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Mishkin, 1.0}, + {TEXT(LTITLE, TITLE_STR_194), FEMALE, IMG_MPC_MAYDAY, BODY_Mayday, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_193), MALE, IMG_MPC_JAWS, BODY_Jaws, HEAD_Male_Brosnan_Tuxedo, 1.199}, + {TEXT(LTITLE, TITLE_STR_195), MALE, IMG_MPC_ODDJOB, BODY_Oddjob, HEAD_Male_Brosnan_Tuxedo,0.78780001}, + {TEXT(LTITLE, TITLE_STR_192), MALE, IMG_MPC_BARON, BODY_Baron_Samedi, HEAD_Male_Brosnan_Tuxedo, 1.0}, + {TEXT(LTITLE, TITLE_STR_287), MALE, IMG_MPC_RANDOM, BODY_Russian_Soldier, HEAD_Male_Mark, 1.0}, + {TEXT(LTITLE, TITLE_STR_288), MALE, IMG_MPC_RANDOM, BODY_Russian_Infantry, HEAD_Male_Karl, 1.0}, + {TEXT(LTITLE, TITLE_STR_289), MALE, IMG_MPC_RANDOM, BODY_Scientist_1_Male, HEAD_Male_Dave_Dr_Doak, 1.0}, + {TEXT(LTITLE, TITLE_STR_289), FEMALE, IMG_MPC_RANDOM, BODY_Scientist_2_Female, HEAD_Female_Sally, 1.0}, + {TEXT(LTITLE, TITLE_STR_290), MALE, IMG_MPC_RANDOM, BODY_Russian_Commandant, HEAD_Male_Martin, 1.0}, + {TEXT(LTITLE, TITLE_STR_291), MALE, IMG_MPC_RANDOM, BODY_Janus_Marine, HEAD_Male_Steve_Ellis, 1.0}, + {TEXT(LTITLE, TITLE_STR_292), MALE, IMG_MPC_RANDOM, BODY_Naval_Officer, HEAD_Male_Duncan, 1.0}, + {TEXT(LTITLE, TITLE_STR_293), MALE, IMG_MPC_RANDOM, BODY_Helicopter_Pilot, HEAD_Male_Pete, 1.0}, + {TEXT(LTITLE, TITLE_STR_294), MALE, IMG_MPC_RANDOM, BODY_St_Petersburg_Guard, HEAD_Male_Ken, 1.0}, + {TEXT(LTITLE, TITLE_STR_295), FEMALE, IMG_MPC_RANDOM, BODY_Civilian_1_Female, HEAD_Female_Marion_Rosika, 1.0}, + {TEXT(LTITLE, TITLE_STR_295), MALE, IMG_MPC_RANDOM, BODY_Civilian_2, HEAD_Male_Graeme, 1.0}, + {TEXT(LTITLE, TITLE_STR_295), MALE, IMG_MPC_RANDOM, BODY_Civilian_3, HEAD_Male_Grant, 1.0}, + {TEXT(LTITLE, TITLE_STR_295), MALE, IMG_MPC_RANDOM, BODY_Civilian_4, HEAD_Male_Dwayne, 1.0}, + {TEXT(LTITLE, TITLE_STR_296), MALE, IMG_MPC_RANDOM, BODY_Siberian_Guard_1_Mishkin, HEAD_Male_Lee, 1.0}, + {TEXT(LTITLE, TITLE_STR_297), MALE, IMG_MPC_RANDOM, BODY_Arctic_Commando, HEAD_Male_Chris, 1.0}, + {TEXT(LTITLE, TITLE_STR_296), MALE, IMG_MPC_RANDOM, BODY_Siberian_Guard_2, HEAD_Male_Scott, 1.0}, + {TEXT(LTITLE, TITLE_STR_298), MALE, IMG_MPC_RANDOM, BODY_Siberian_Special_Forces, HEAD_Male_Alan, 1.0}, + {TEXT(LTITLE, TITLE_STR_299), MALE, IMG_MPC_RANDOM, BODY_Jungle_Commando, HEAD_Male_Joel, 1.0}, + {TEXT(LTITLE, TITLE_STR_300), MALE, IMG_MPC_RANDOM, BODY_Janus_Special_Forces, HEAD_Male_B, 1.0}, + {TEXT(LTITLE, TITLE_STR_301), MALE, IMG_MPC_RANDOM, BODY_Moonraker_Elite_1_Male, HEAD_Male_Neil, 1.0}, + {TEXT(LTITLE, TITLE_STR_301), FEMALE, IMG_MPC_RANDOM, BODY_Moonraker_Elite_2_Female, HEAD_Female_Vivien, 1.0}, + {TEXT(LTITLE, TITLE_STR_196), FEMALE, IMG_MPC_RANDOM, BODY_Rosika, HEAD_Female_Marion_Rosika, 0.88529998}, + {TEXT(LTITLE, TITLE_STR_197), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Karl, 1.0446}, + {TEXT(LTITLE, TITLE_STR_198), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Martin, 1.0446}, + {TEXT(LTITLE, TITLE_STR_199), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Mark, 1.0446}, + {TEXT(LTITLE, TITLE_STR_200), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Dave_Dr_Doak, 1.0446}, + {TEXT(LTITLE, TITLE_STR_201), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Duncan, 1.0446}, + {TEXT(LTITLE, TITLE_STR_202), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_B, 1.0446}, + {TEXT(LTITLE, TITLE_STR_203), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Steve_Ellis, 1.0446}, + {TEXT(LTITLE, TITLE_STR_204), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Grant, 1.0446}, + {TEXT(LTITLE, TITLE_STR_205), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Graeme, 1.0446}, + {TEXT(LTITLE, TITLE_STR_206), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Ken, 1.0446}, + {TEXT(LTITLE, TITLE_STR_207), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Alan, 1.0446}, + {TEXT(LTITLE, TITLE_STR_208), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Pete, 1.0446}, + {TEXT(LTITLE, TITLE_STR_209), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Shaun, 1.0446}, + {TEXT(LTITLE, TITLE_STR_210), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Dwayne, 1.0446}, + {TEXT(LTITLE, TITLE_STR_211), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Des, 1.0446}, + {TEXT(LTITLE, TITLE_STR_212), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Chris, 1.0446}, + {TEXT(LTITLE, TITLE_STR_213), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Lee, 1.0446}, + {TEXT(LTITLE, TITLE_STR_214), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Neil, 1.0446}, + {TEXT(LTITLE, TITLE_STR_215), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Jim, 1.0446}, + {TEXT(LTITLE, TITLE_STR_216), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Robin, 1.0446}, + {TEXT(LTITLE, TITLE_STR_217), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Steve_H, 1.0446}, + {TEXT(LTITLE, TITLE_STR_218), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Terrorist, 1.0446}, + {TEXT(LTITLE, TITLE_STR_219), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Biker, 1.0446}, + {TEXT(LTITLE, TITLE_STR_220), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Joel, 1.0446}, + {TEXT(LTITLE, TITLE_STR_221), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Scott, 1.0446}, + {TEXT(LTITLE, TITLE_STR_222), MALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Male_Joe, 1.0446}, + {TEXT(LTITLE, TITLE_STR_223), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Sally, 1.0446}, + {TEXT(LTITLE, TITLE_STR_224), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Marion_Rosika, 1.0446}, + {TEXT(LTITLE, TITLE_STR_225), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Mandy, 1.0446}, + {TEXT(LTITLE, TITLE_STR_226), FEMALE, IMG_MPC_RANDOM, BODY_Brosnan_Tuxedo, HEAD_Female_Vivien, 1.0446} }; #endif struct MP_handicap_menu MP_handicap_table[] = { - {TEXT(LTITLE, 0x3D), 0, 10.0}, // "Health -10\n(Hero)" - {TEXT(LTITLE, 0x3E), 0, 2.8560996}, // "Health -4\n(Veteran)" - {TEXT(LTITLE, 0x3F), 0, 2.1969998}, // "Health -3\n(Veteran)" - {TEXT(LTITLE, 0x40), 0, 1.6899998}, // "Health -2\n(Veteran)" - {TEXT(LTITLE, 0x41), 0, 1.3}, // "Health -1\n(Veteran)" - {TEXT(LTITLE, 0x42), 0, 1.0}, // "Health +0\n(Normal)" - {TEXT(LTITLE, 0x43), 0, 0.76923078}, // "Health +1\n(Novice)" - {TEXT(LTITLE, 0x44), 0, 0.59171599}, // "Health +2\n(Novice)" - {TEXT(LTITLE, 0x45), 0, 0.45516616}, // "Health +3\n(Novice)" - {TEXT(LTITLE, 0x46), 0, 0.35012782}, // "Health +4\n(Novice)" - {TEXT(LTITLE, 0x47), 0, 0.1} // "Health +10\n(Rookie)" + {TEXT(LTITLE, TITLE_STR_61), 0, 10.0}, // "Health -10\n(Hero)" + {TEXT(LTITLE, TITLE_STR_62), 0, 2.8560996}, // "Health -4\n(Veteran)" + {TEXT(LTITLE, TITLE_STR_63), 0, 2.1969998}, // "Health -3\n(Veteran)" + {TEXT(LTITLE, TITLE_STR_64), 0, 1.6899998}, // "Health -2\n(Veteran)" + {TEXT(LTITLE, TITLE_STR_65), 0, 1.3}, // "Health -1\n(Veteran)" + {TEXT(LTITLE, TITLE_STR_66), 0, 1.0}, // "Health +0\n(Normal)" + {TEXT(LTITLE, TITLE_STR_67), 0, 0.76923078}, // "Health +1\n(Novice)" + {TEXT(LTITLE, TITLE_STR_68), 0, 0.59171599}, // "Health +2\n(Novice)" + {TEXT(LTITLE, TITLE_STR_69), 0, 0.45516616}, // "Health +3\n(Novice)" + {TEXT(LTITLE, TITLE_STR_70), 0, 0.35012782}, // "Health +4\n(Novice)" + {TEXT(LTITLE, TITLE_STR_71), 0, 0.1} // "Health +10\n(Rookie)" }; struct MP_controller_configuration_menu MP_controller_configuration_table[] = { - {TEXT(LTITLE, 0x115), 0, 1}, //1.1 Honey* - {TEXT(LTITLE, 0x116), 1, 1}, //1.2 Solitaire* - {TEXT(LTITLE, 0x117), 2, 1}, //1.3 Kissy* - {TEXT(LTITLE, 0x118), 3, 1}, //1.4 Goodnight* - {TEXT(LTITLE, 0x119), 4, 2}, //2.1 Plenty* - {TEXT(LTITLE, 0x11A), 5, 2}, //2.2 Galore* - {TEXT(LTITLE, 0x11B), 6, 2}, //2.3 Domino* - {TEXT(LTITLE, 0x11C), 7, 2} //2.4 Goodhead* + {TEXT(LTITLE, TITLE_STR_277), 0, 1}, //1.1 Honey* + {TEXT(LTITLE, TITLE_STR_278), 1, 1}, //1.2 Solitaire* + {TEXT(LTITLE, TITLE_STR_279), 2, 1}, //1.3 Kissy* + {TEXT(LTITLE, TITLE_STR_280), 3, 1}, //1.4 Goodnight* + {TEXT(LTITLE, TITLE_STR_281), 4, 2}, //2.1 Plenty* + {TEXT(LTITLE, TITLE_STR_282), 5, 2}, //2.2 Galore* + {TEXT(LTITLE, TITLE_STR_283), 6, 2}, //2.3 Domino* + {TEXT(LTITLE, TITLE_STR_284), 7, 2} //2.4 Goodhead* }; struct MP_sight_aim_settings mp_sight_adjust_table[] = { - {TEXT(LTITLE, 0x48), 0, 0}, // "Sight OFF, Auto Aim OFF" - {TEXT(LTITLE, 0x49), 1, 0}, // "Sight ON, Auto Aim OFF" - {TEXT(LTITLE, 0x4A), 0, 1}, // "Sight OFF, Auto Aim ON" - {TEXT(LTITLE, 0x4B), 1, 1} // "Sight ON, Auto Aim ON" + {TEXT(LTITLE, TITLE_STR_72), 0, 0}, // "Sight OFF, Auto Aim OFF" + {TEXT(LTITLE, TITLE_STR_73), 1, 0}, // "Sight ON, Auto Aim OFF" + {TEXT(LTITLE, TITLE_STR_74), 0, 1}, // "Sight OFF, Auto Aim ON" + {TEXT(LTITLE, TITLE_STR_75), 1, 1} // "Sight ON, Auto Aim ON" }; s32 selected_num_players = 0; s32 player_char[MAX_PLAYER_COUNT] = { -1, -1, -1, -1 }; s32 MP_stage_selected = MP_STAGE_TEMPLE; -s32 game_length = 2; //10minutes +s32 game_length = LEN_10MIN; //10minutes s32 aim_sight_adjustment = 3; //"Sight ON, Auto Aim ON" s32 scenario = SCENARIO_NORMAL; -s32 unlock_stage_select = 1; -s32 unlock_game_length = 1; -s32 unlock_chars = 1; -s32 unlock_weapon_select = 1; -s32 unlock_handicap = 1; -s32 unlock_control_style = 1; -s32 unlock_aim_sight = 1; + +s32 unlock_stage_select = TRUE; +s32 unlock_game_length = TRUE; +s32 unlock_chars = TRUE; +s32 unlock_weapon_select = TRUE; +s32 unlock_handicap = TRUE; +s32 unlock_control_style = TRUE; +s32 unlock_aim_sight = TRUE; u32 D_8002B560 = 0; @@ -720,53 +665,53 @@ s16 solo_target_time_array[20][3] = { {0, 0, 360} }; -u32 totalunlockedcheats = 0; -u32 D_8002B5E0 = 0; +s32 totalunlockedcheats = 0; +s32 D_8002B5E0 = 0; u32 MP_menu_selected_option = 0; -u32 intro_character_index = 0; +s32 intro_character_index = 0; u32 randomly_selected_intro_animation = ANIM_idle; u32 intro_animation_count = 0; -u32 objinstance = 0; -u32 ptrobjinstance = 0; +struct Model *cast_model = NULL; +struct Model *cast_model_weapon = NULL; u32 full_actor_intro = 0; struct intro_char intro_char_table[] = { - {BODY_Tuxedo, HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xE4), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Special_Operations_Uniform, HEAD_Male_Pierce_Bond_1, TEXT(LTITLE, 0xE5), TEXT(LTITLE, 0xE8), TEXT(LTITLE, 0xE9), 0, 0}, - {BODY_Natalya_Skirt, 0xFFFFFFFF, TEXT(LTITLE, 0xE5), TEXT(LTITLE, 0xEA), TEXT(LTITLE, 0xE3), 0, 0}, - {BODY_Trevelyan_006, 0xFFFFFFFF, TEXT(LTITLE, 0xE5), TEXT(LTITLE, 0xEB), TEXT(LTITLE, 0xEC), 0, 0}, - {BODY_Xenia, 0xFFFFFFFF, TEXT(LTITLE, 0xE6), TEXT(LTITLE, 0xED), TEXT(LTITLE, 0xEE), 0, 0}, - {BODY_Ourumov, 0xFFFFFFFF, TEXT(LTITLE, 0xE6), TEXT(LTITLE, 0xEF), TEXT(LTITLE, 0xF0), 0, 0}, - {BODY_Boris, 0xFFFFFFFF, TEXT(LTITLE, 0xE6), TEXT(LTITLE, 0xF1), TEXT(LTITLE, 0xE3), 0, 0}, - {BODY_Valentin_, 0xFFFFFFFF, TEXT(LTITLE, 0xE6), TEXT(LTITLE, 0xF2), TEXT(LTITLE, 0xF3), 0, 0}, - {BODY_Siberian_Guard_1_Mishkin, 0x45, TEXT(LTITLE, 0xE6), TEXT(LTITLE, 0xF4), TEXT(LTITLE, 0xF5), 0, 0}, - {BODY_Russian_Soldier, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFD), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Russian_Infantry, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFC), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Scientist_1_Male, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x107), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Scientist_2_Female, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x107), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Russian_Commandant, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x100), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Janus_Marine, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFE), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Naval_Officer, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x101), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Helicopter_Pilot, 0xFFFFFFFF, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x106), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_St_Petersburg_Guard, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFB), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Civilian_1_Female, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x108), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Civilian_2, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x108), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Civilian_3, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x108), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Civilian_4, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x108), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Siberian_Guard_1_Mishkin, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x102), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Arctic_Commando, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x103), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Siberian_Guard_2, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x102), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Siberian_Special_Forces, 0xFFFFFFFF, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x104), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Jungle_Commando, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFA), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Janus_Special_Forces, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0xFF), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Moonraker_Elite_1_Male, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x105), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Moonraker_Elite_2_Female, 0xFFFFFF9F, TEXT(LTITLE, 0xE3), TEXT(LTITLE, 0x105), TEXT(LTITLE, 0xE3), 0, 1}, - {BODY_Mayday, 0xFFFFFFFF, TEXT(LTITLE, 0xE7), TEXT(LTITLE, 0xF6), TEXT(LTITLE, 0xE3), 0, 0}, - {BODY_Jaws, 0xFFFFFFFF, TEXT(LTITLE, 0xE7), TEXT(LTITLE, 0xF7), TEXT(LTITLE, 0xE3), 0, 0}, - {BODY_Oddjob, 0xFFFFFFFF, TEXT(LTITLE, 0xE7), TEXT(LTITLE, 0xF8), TEXT(LTITLE, 0xE3), 0, 0}, - {BODY_Baron_Samedi, 0xFFFFFFFF, TEXT(LTITLE, 0xE7), TEXT(LTITLE, 0xF9), TEXT(LTITLE, 0xE3), 0, 0}, + {BODY_Brosnan_Tuxedo, HEAD_Male_Brosnan_Tuxedo, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_228), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Special_Operations_Uniform, HEAD_Male_Brosnan_Boiler, TEXT(LTITLE, TITLE_STR_229), TEXT(LTITLE, TITLE_STR_232), TEXT(LTITLE, TITLE_STR_233), 0, 0}, + {BODY_Natalya_Skirt, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_229), TEXT(LTITLE, TITLE_STR_234), TEXT(LTITLE, TITLE_STR_227), 0, 0}, + {BODY_Trevelyan_006, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_229), TEXT(LTITLE, TITLE_STR_235), TEXT(LTITLE, TITLE_STR_236), 0, 0}, + {BODY_Xenia, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_230), TEXT(LTITLE, TITLE_STR_237), TEXT(LTITLE, TITLE_STR_238), 0, 0}, + {BODY_Ourumov, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_230), TEXT(LTITLE, TITLE_STR_239), TEXT(LTITLE, TITLE_STR_240), 0, 0}, + {BODY_Boris, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_230), TEXT(LTITLE, TITLE_STR_241), TEXT(LTITLE, TITLE_STR_227), 0, 0}, + {BODY_Valentin_, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_230), TEXT(LTITLE, TITLE_STR_242), TEXT(LTITLE, TITLE_STR_243), 0, 0}, + {BODY_Siberian_Guard_1_Mishkin, 0x45, TEXT(LTITLE, TITLE_STR_230), TEXT(LTITLE, TITLE_STR_244), TEXT(LTITLE, TITLE_STR_245), 0, 0}, + {BODY_Russian_Soldier, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_253), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Russian_Infantry, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_252), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Scientist_1_Male, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_263), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Scientist_2_Female, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_263), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Russian_Commandant, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_256), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Janus_Marine, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_254), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Naval_Officer, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_257), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Helicopter_Pilot, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_262), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_St_Petersburg_Guard, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_251), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Civilian_1_Female, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_264), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Civilian_2, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_264), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Civilian_3, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_264), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Civilian_4, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_264), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Siberian_Guard_1_Mishkin, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_258), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Arctic_Commando, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_259), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Siberian_Guard_2, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_258), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Siberian_Special_Forces, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_260), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Jungle_Commando, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_250), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Janus_Special_Forces, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_255), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Moonraker_Elite_1_Male, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_261), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Moonraker_Elite_2_Female, 0xFFFFFF9F, TEXT(LTITLE, TITLE_STR_227), TEXT(LTITLE, TITLE_STR_261), TEXT(LTITLE, TITLE_STR_227), 0, 1}, + {BODY_Mayday, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_231), TEXT(LTITLE, TITLE_STR_246), TEXT(LTITLE, TITLE_STR_227), 0, 0}, + {BODY_Jaws, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_231), TEXT(LTITLE, TITLE_STR_247), TEXT(LTITLE, TITLE_STR_227), 0, 0}, + {BODY_Oddjob, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_231), TEXT(LTITLE, TITLE_STR_248), TEXT(LTITLE, TITLE_STR_227), 0, 0}, + {BODY_Baron_Samedi, 0xFFFFFFFF, TEXT(LTITLE, TITLE_STR_231), TEXT(LTITLE, TITLE_STR_249), TEXT(LTITLE, TITLE_STR_227), 0, 0}, {0xFFFFFFFF, 0, 0, 0, 0, 0, 0} }; @@ -796,12 +741,14 @@ struct intro_animation intro_animation_table[] = { {0xFFFFFFFF, 0.0, 0.0, 0} }; -u32 D_8002BA2C = 0; -u32 D_8002BA30 = 0; -u32 D_8002BA34 = 0; +struct coord3d D_8002BA2C = { 0 }; -PROP random_rifles_in_intro[] = +#define INTRO_RANDOM_RIFLE_LEN 6 +struct intro_random_rifles { + PROP props[INTRO_RANDOM_RIFLE_LEN]; +}; +struct intro_random_rifles random_rifles_in_intro = { PROP_CHRKALASH, PROP_CHRM16, PROP_CHRFNP90, @@ -810,8 +757,12 @@ PROP random_rifles_in_intro[] = PROP_CHRSNIPERRIFLE }; -PROP random_pistols_in_intro[] = +#define INTRO_RANDOM_PISTO_LEN 10 +struct intro_random_pistols { + PROP props[INTRO_RANDOM_PISTO_LEN]; +}; +struct intro_random_pistols random_pistols_in_intro = { PROP_CHRWPPK, PROP_CHRWPPKSIL, PROP_CHRSKORPION, @@ -824,38 +775,15 @@ PROP random_pistols_in_intro[] = PROP_CHRGOLDEN }; -f32 D_8002BA78 = 0.0f; -f32 D_8002BA7C = 0.0f; -f32 D_8002BA80 = 1.0f; - -f32 D_8002BA84 = 0.0f; -f32 D_8002BA88 = 0.0f; -f32 D_8002BA8C = 0.0f; - -f32 D_8002BA90 = 0.0f; -f32 D_8002BA94 = 1.0f; -f32 D_8002BA98 = 0.0f; - -u32 D_8002BA9C = 0; -u32 D_8002BAA0 = 1; -u32 D_8002BAA4 = 3; -u32 D_8002BAA8 = 0; -u32 D_8002BAAC = 0; -u32 D_8002BAB0 = 0; -u32 D_8002BAB4 = 0; -u32 D_8002BAB8 = 0; -u32 D_8002BABC = 0; -u32 D_8002BAC0 = 0; -u32 D_8002BAC4 = 0; -u32 D_8002BAC8 = 0; -u32 D_8002BACC = 0; -u32 D_8002BAD0 = 0; -u32 D_8002BAD4 = 0; -u32 D_8002BAD8 = 0; -u32 D_8002BADC = 0; - -f32 D_8002BAE0 = 40.0f; -f32 D_8002BAE4 = 25.0f; + +struct coord3d D_8002BA78 = { 0.0f, 0.0f, 1.0f }; +struct coord3d D_8002BA84 = { 0.0f, 0.0f, 0.0f }; +struct coord3d D_8002BA90 = { 0.0f, 1.0f, 0.0f }; + +struct unk_joint_list D_8002BA9C = {NULL, 1, 3, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0}; + +struct coord3d D_8002BADC = { 0.0f, 40.0f, 25.0f }; + u32 D_8002BAE8 = 0; u32 D_8002BAEC = 1; @@ -892,10 +820,12 @@ Gfx *constructor_menu16_nocontrollers(Gfx *DL); Gfx *constructor_menu17_switchscreens(Gfx *DL); Gfx *constructor_menu18_displaycast(Gfx *DL); Gfx *constructor_menu19_spectrum(Gfx *DL); -void disable_all_switches(void *arg0); +void disable_all_switches(Model *arg0); void set_item_visibility_in_objinstance(Model* objinstance, s32 item, s32 mode); void set_cursor_to_stage_solo(LEVEL_SOLO_SEQUENCE level); -Gfx *display_aligned_white_text_to_screen(Gfx *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, u8 *arg5, s32 arg6, s32 arg7); +Gfx *display_aligned_white_text_to_screen(Gfx *dl, s32 arg1, s32 arg2, s32 halign, s32 valign, u8 *arg5, s32 arg6, s32 arg7); +void setCursorPOSforMode(int mode); +void set_cursor_pos_difficulty(int difficulty); // end forward declarations. @@ -906,7 +836,7 @@ Gfx *write_text_at_abs_coord(Gfx *gdl, s32 *x, s32 *y, s8 *text, s32 second_font { if (j_text_trigger != 0) { - gdl = jp_text_write_stuff( + gdl = textRenderGlow( gdl, x, y, @@ -922,7 +852,18 @@ Gfx *write_text_at_abs_coord(Gfx *gdl, s32 *x, s32 *y, s8 *text, s32 second_font } else { - gdl = en_text_write_stuff(gdl, x, y, text, second_font_table, first_font_table, arg6, view_x, view_y, arg9, arga); + gdl = textRender( + gdl, + x, + y, + text, + second_font_table, + first_font_table, + arg6, + view_x, + view_y, + arg9, + arga); } return gdl; @@ -1088,12 +1029,12 @@ void menu_control_stick_tracking(void) { stickx = 0; } - if (stickx >= 0x47) { - stickx = 0x46; + if (stickx >= 71) { + stickx = 70; } else { - if (stickx < -0x46) { - stickx = -0x46; + if (stickx < -70) { + stickx = -70; } } @@ -1107,12 +1048,12 @@ void menu_control_stick_tracking(void) { sticky = 0; } - if (sticky >= 0x47) { - sticky = 0x46; + if (sticky >= 71) { + sticky = 70; } else { - if (sticky < -0x46) { - sticky = -0x46; + if (sticky < -70) { + sticky = -70; } } @@ -1163,10 +1104,10 @@ Gfx *load_draw_selected_icon_folder_select(Gfx *DL) image = crosshairimage; } else if (option == 1) { - image = mainfolderimages; + image = mainfolderimages + IMG_COPY; //COPY } else if (option == 2) { - image = mainfolderimages + 1; + image = mainfolderimages + IMG_DEL; } likely_generate_DL_for_image_declaration(&DL, image, 4, 0, 0); @@ -1189,35 +1130,35 @@ Gfx* add_tab1_start(Gfx* DL) s32 x; s32 y; - s32 sp4C; - s32 sp48; + s32 y2; + s32 x2; - g_textPtrTAB1 = langGet(TEXT(LTITLE, 0x04)); - setTextSpacingInverted(1); - sp48 = 0; - sp4C = 0; - sub_GAME_7F0AE98C(&sp4C, &sp48, g_textPtrTAB1, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0); - x = 0x33; - y = 0x19B - (sp4C / 2); + g_textPtrTAB1 = langGet(TEXT(LTITLE, TITLE_STR_04)); + setTextSpacingInverted(TRUE); + x2 = 0; + y2 = 0; + textMeasure(&y2, &x2, g_textPtrTAB1, ptrFontBankGothicChars, ptrFontBankGothic, 0); + x = 51; + y = 411 - (y2 / 2); - if (tab_start_highlight != 0) + if (tab_start_highlight) { - DL = microcode_constructor_related_to_menus(DL, (y - sp4C) + 1, 0x33, y, 0x75, 0x32); + DL = microcode_constructor_related_to_menus(DL, (y - y2) + 1, 51, y, 117, 50); } setTextOrientation(1); - x = 0x54 - (sp48 / 2); - DL = en_text_write_stuff(DL, &x, &y, g_textPtrTAB1, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFF, viGetY(), viGetX(), 0, 0); + x = 84 - (x2 / 2); + DL = textRender(DL, &x, &y, g_textPtrTAB1, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF, viGetY(), viGetX(), 0, 0); setTextOrientation(0); - setTextSpacingInverted(0); + setTextSpacingInverted(FALSE); return DL; } s32 isontab1(void) { - if ((390.00000000f < cursor_h_pos) && (cursor_v_pos <= 130.5f)) + if ((390.0f < cursor_h_pos) && (cursor_v_pos <= 130.5f)) { return TRUE; } @@ -1231,28 +1172,28 @@ Gfx* add_tab3_previous(Gfx* DL) s32 x; s32 y; - s32 sp4C; + s32 y2; s32 sp48; - g_textPtrTAB3 = langGet(TEXT(LTITLE, 0x06)); - setTextSpacingInverted(1); + g_textPtrTAB3 = langGet(TEXT(LTITLE, TITLE_STR_06)); + setTextSpacingInverted(TRUE); sp48 = 0; - sp4C = 0; - sub_GAME_7F0AE98C(&sp4C, &sp48, g_textPtrTAB3, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0); - x = 0xEC; - y = 0x19B - (sp4C / 2); + y2 = 0; + textMeasure(&y2, &sp48, g_textPtrTAB3, ptrFontBankGothicChars, ptrFontBankGothic, 0); + x = 236; + y = 411 - (y2 / 2); if (tab_prev_highlight != 0) { - DL = microcode_constructor_related_to_menus(DL, (y - sp4C) + 1, 0xEC, y, 0x12E, 0x32); + DL = microcode_constructor_related_to_menus(DL, (y - y2) + 1, 236, y, 302, 50); } setTextOrientation(1); - x = 0x10D - (sp48 / 2); - DL = en_text_write_stuff(DL, &x, &y, g_textPtrTAB3, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFF, viGetY(), viGetX(), 0, 0); + x = 269 - (sp48 / 2); + DL = textRender(DL, &x, &y, g_textPtrTAB3, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF, viGetY(), viGetX(), 0, 0); setTextOrientation(0); - setTextSpacingInverted(0); + setTextSpacingInverted(FALSE); return DL; } @@ -1285,32 +1226,32 @@ Gfx* add_tab2_next(Gfx* DL) s32 sp4C; s32 sp48; - g_textPtrTAB2 = langGet(TEXT(LTITLE, 0x05)); - setTextSpacingInverted(1); + g_textPtrTAB2 = langGet(TEXT(LTITLE, TITLE_STR_05)); //"NEXT\n" + setTextSpacingInverted(TRUE); sp48 = 0; sp4C = 0; - sub_GAME_7F0AE98C(&sp4C, &sp48, g_textPtrTAB2, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0); - x = 0x90; - y = 0x19B - (sp4C / 2); + textMeasure(&sp4C, &sp48, g_textPtrTAB2, ptrFontBankGothicChars, ptrFontBankGothic, 0); + x = 144; + y = 411 - (sp4C / 2); if (tab_next_highlight != 0) { - DL = microcode_constructor_related_to_menus(DL, (y - sp4C) + 1, 0x90, y, 0xD2, 0x32); + DL = microcode_constructor_related_to_menus(DL, (y - sp4C) + 1, 144, y, 210, 50); } setTextOrientation(1); - x = 0xB1 - (sp48 / 2); - DL = en_text_write_stuff(DL, &x, &y, g_textPtrTAB2, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFF, viGetY(), viGetX(), 0, 0); + x = 177 - (sp48 / 2); + DL = textRender(DL, &x, &y, g_textPtrTAB2, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF, viGetY(), viGetX(), 0, 0); setTextOrientation(0); - setTextSpacingInverted(0); + setTextSpacingInverted(FALSE); return DL; } u32 isontab2(void) { - if (((390.0f < cursor_h_pos) && (130.5f < cursor_v_pos)) && (cursor_v_pos <= 223.00000000f)) + if (((390.0f < cursor_h_pos) && (130.5f < cursor_v_pos)) && (cursor_v_pos <= 223.0f)) { return TRUE; } @@ -1361,14 +1302,14 @@ void interface_menu00_legalscreen(void) #define MENU_LEGALSCREEN_MENU_TIMER_MAX (60*4+1) #endif - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); #if defined(ISGOLDFINGER) || defined(USEEXPANSION) if (osGetMemSize != 0x00800000) { - set_menu_to_mode(MENU_NO_CONTROLLERS, 1); //double up as No expansion pak window + frontChangeMenu(MENU_NO_CONTROLLERS, TRUE); //double up as No expansion pak window return; } #endif @@ -1378,22 +1319,22 @@ void interface_menu00_legalscreen(void) { if ((joyGetControllerCount() < 1) && (is_first_time_on_legal_screen)) { - set_menu_to_mode(MENU_NO_CONTROLLERS, 1); + frontChangeMenu(MENU_NO_CONTROLLERS, TRUE); } else { - set_menu_to_mode(MENU_NINTENDO_LOGO, 1); + frontChangeMenu(MENU_NINTENDO_LOGO, TRUE); } } else if (joyGetButtonsPressedThisFrame(PLAYER_1, ANY_BUTTON) && (!is_first_time_on_legal_screen)) { if (!is_first_time_on_main_menu) { - set_menu_to_mode(MENU_FILE_SELECT, 1); + frontChangeMenu(MENU_FILE_SELECT, TRUE); } else { - set_menu_to_mode(MENU_NINTENDO_LOGO, 1); + frontChangeMenu(MENU_NINTENDO_LOGO, TRUE); } } } @@ -1401,7 +1342,7 @@ void interface_menu00_legalscreen(void) -Gfx *display_aligned_white_text_to_screen(Gfx *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, u8 *arg5, s32 arg6, s32 arg7) +Gfx *display_aligned_white_text_to_screen(Gfx *dl, s32 arg1, s32 arg2, s32 halign, s32 valign, u8 *text, s32 arg6, s32 arg7) { s32 sp4C; s32 sp48; @@ -1410,10 +1351,10 @@ Gfx *display_aligned_white_text_to_screen(Gfx *arg0, s32 arg1, s32 arg2, s32 arg sp48 = 0; sp4C = 0; - sub_GAME_7F0AE98C(&sp4C, &sp48, arg5, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); - x = arg1 - ((s32) (arg3 * sp48) / 2); - y = arg2 - ((s32) (arg4 * sp4C) / 2); - return en_text_write_stuff(arg0, &x, &y, arg5, arg6, arg7, -1, viGetX(), viGetY(), 0, 0); + textMeasure(&sp4C, &sp48, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + x = arg1 - ((s32) (halign * sp48) / 2); + y = arg2 - ((s32) (valign * sp4C) / 2); + return textRender(dl, &x, &y, text, arg6, arg7, -1, viGetX(), viGetY(), 0, 0); } @@ -1422,6 +1363,8 @@ Gfx *display_aligned_white_text_to_screen(Gfx *arg0, s32 arg1, s32 arg2, s32 arg #ifdef NONMATCHING /** + * https://decomp.me/scratch/hx7ye 99.27% + * * decomp notes: * compiles: yes * stack resize: match @@ -1473,11 +1416,11 @@ Gfx *constructor_menu00_legalscreen(Gfx *DL) DL, legal_text_ptr->h_pos, legal_text_ptr->v_pos, - legal_text_ptr->flag, - legal_text_ptr->flag2, + legal_text_ptr->halign, + legal_text_ptr->valign, txt, - ptrSecondFontTableLarge, - ptrFirstFontTableLarge); + ptrFontZurichBoldChars, + ptrFontZurichBold); } @@ -1588,13 +1531,13 @@ glabel constructor_menu00_legalscreen /* 03F58C 7F00AA5C 02802025 */ move $a0, $s4 /* 03F590 7F00AA60 3C108003 */ lui $s0, %hi(legalpage_text_array) /* 03F594 7F00AA64 3C118003 */ lui $s1, %hi(D_8002AABC) -/* 03F598 7F00AA68 3C138004 */ lui $s3, %hi(ptrFirstFontTableLarge) -/* 03F59C 7F00AA6C 3C128004 */ lui $s2, %hi(ptrSecondFontTableLarge) +/* 03F598 7F00AA68 3C138004 */ lui $s3, %hi(ptrFontZurichBold) +/* 03F59C 7F00AA6C 3C128004 */ lui $s2, %hi(ptrFontZurichBoldChars) /* 03F5A0 7F00AA70 0040A025 */ move $s4, $v0 /* 03F5A4 7F00AA74 2610A9CC */ addiu $s0, %lo(legalpage_text_array) # addiu $s0, $s0, -0x5634 /* 03F5A8 7F00AA78 2631AABC */ addiu $s1, %lo(D_8002AABC) # addiu $s1, $s1, -0x5544 -/* 03F5AC 7F00AA7C 26520EB8 */ addiu $s2, %lo(ptrSecondFontTableLarge) # addiu $s2, $s2, 0xeb8 -/* 03F5B0 7F00AA80 26730EB4 */ addiu $s3, %lo(ptrFirstFontTableLarge) # addiu $s3, $s3, 0xeb4 +/* 03F5AC 7F00AA7C 26520EB8 */ addiu $s2, %lo(ptrFontZurichBoldChars) # addiu $s2, $s2, 0xeb8 +/* 03F5B0 7F00AA80 26730EB4 */ addiu $s3, %lo(ptrFontZurichBold) # addiu $s3, $s3, 0xeb4 .L7F00AA84: /* 03F5B4 7F00AA84 0FC30776 */ jal langGet /* 03F5B8 7F00AA88 96040010 */ lhu $a0, 0x10($s0) @@ -1643,16 +1586,16 @@ void dummy7F00AAF8(void) { //******************************************************************************************************** void interface_menu17_switchscreens(void) { - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); g_MenuTimer++; - if ((g_MenuTimer >= 4) && (spectrum_related_flag == 0) && (is_emulating_spectrum == 0)) + if ((g_MenuTimer >= 4) && (!spectrum_related_flag) && (!is_emulating_spectrum)) { maybe_prev_menu = menu_update; - menu_update = -1; + menu_update = MENU_INVALID; } } @@ -1707,538 +1650,134 @@ void interface_menu01_nintendo(void) #define NINTENDO_TIMER_MAX 501 #endif - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); - g_MenuTimer = g_MenuTimer + g_ClockTimer; + g_MenuTimer += g_ClockTimer; if (g_MenuTimer >= NINTENDO_TIMER_MAX) { - set_menu_to_mode(MENU_RAREWARE_LOGO, 1); + frontChangeMenu(MENU_RAREWARE_LOGO, TRUE); } else if (joyGetButtonsPressedThisFrame(PLAYER_1, ANY_BUTTON)) { - if (is_first_time_on_main_menu == 0) + if (!is_first_time_on_main_menu) { - set_menu_to_mode(MENU_FILE_SELECT, 1); + frontChangeMenu(MENU_FILE_SELECT, TRUE); } else { prev_keypresses = 1; - set_menu_to_mode(MENU_RAREWARE_LOGO, 1); + frontChangeMenu(MENU_RAREWARE_LOGO, TRUE); } } } +Gfx *constructor_menu01_nintendo(Gfx *DL) +{ + struct unk_joint_list sp128; + s32 padding; + s32 var_v1; + Mtxf spE0; + s32 i; + + sp128 = D_8002AB08; + DL = insert_imageDL(DL); -#ifdef NONMATCHING -s32 constructor_menu01_nintendo(s32 arg0) -{ - s32 sp138; - s32 sp134; - s32 sp130; - s32 sp12C; - s32 sp128; - s32 spE0; - s32 sp90; - s32 sp50; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_s0; - s8 temp_v1; - void *temp_t0; - void *temp_t6; - void *phi_t6; - void *phi_t0; - s8 phi_v1; - s8 phi_v1_2; - s32 phi_s1; - s32 phi_s0; - - phi_t6 = &D_8002AB08; - phi_t0 = &sp128; -loop_1: - temp_t6 = phi_t6 + 0xc; - temp_t0 = phi_t0 + 0xc; - temp_t0->unk-C = (s32) *phi_t6; - temp_t0->unk-8 = (s32) temp_t6->unk-8; - temp_t0->unk-4 = (s32) temp_t6->unk-4; - phi_t6 = temp_t6; - phi_t0 = temp_t0; - if (temp_t6 != (&D_8002AB08 + 0x3c)) - { - goto loop_1; - } - temp_t0->unk0 = (s32) temp_t6->unk0; - temp_ret = insert_imageDL(); - temp_ret->unk0 = 0xbc000002; - temp_ret->unk4 = 0x80000040; - temp_ret->unk8 = 0x3860010; - temp_ret->unkC = &D_8002A990; - arg0 = (s32) (temp_ret + 0x18); - temp_ret->unk10 = 0x3880010; - temp_ret->unk14 = &RGBA_8002A988; - temp_v1 = 0xff - ((s32) ((g_MenuTimer * 0xff) + 0xfffe8f72) / 0x64); - phi_v1 = temp_v1; - if (temp_v1 >= 0x100) + // Lights macro? These need to be on one line. + gSPNumLights(DL++, 1); \ + gSPLight(DL++, &ninlogolight.l[0], 1); \ + gSPLight(DL++, &ninlogolight, 2); + +#if defined(VERSION_EU) + // 0x100000000 − 0xFFFECD34 = 0x132CC (78540 decimal) + var_v1 = 0xFF - ((s32) ((g_MenuTimer * 0xFF) + 0xFFFECD34) / 83); +#else + // 0x100000000 − 0xFFFE8F72 = 0x1708E (94350 decimal) + var_v1 = 0xFF - ((s32) ((g_MenuTimer * 0xFF) + 0xFFFE8F72) / 100); +#endif + if (var_v1 >= 0x100) { - phi_v1 = (u8)0xff; + var_v1 = 0xff; } - phi_v1_2 = phi_v1; - if (phi_v1 < 0) - { - phi_v1_2 = (u8)0; - } - RGBA_8002A988.unk6 = (s8) phi_v1_2; - RGBA_8002A988.unk5 = (s8) phi_v1_2; - RGBA_8002A988.unk4 = (s8) phi_v1_2; - RGBA_8002A988.unk2 = (s8) phi_v1_2; - RGBA_8002A988.unk1 = (s8) phi_v1_2; - RGBA_8002A988.unk0 = (s8) phi_v1_2; - ninLogoRotRate = (f32) (ninLogoRotRate + D_80051A04); - matrix_4x4_set_rotation_around_y(ninLogoRotRate, &RGBA_8002A988, &sp90); - matrix_scalar_multiply_3(ninLogoScale, &sp90); - ninLogoScale = (f32) (ninLogoScale * D_80051A0C); - if (D_80051A08 < ninLogoScale) + if (var_v1 < 0) { - ninLogoScale = (f32) D_80051A08; - } - matrix_4x4_7F059694(&spE0, 0.0f, 0.0f, 0x457a0000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); - matrix_4x4_multiply_in_place(&spE0, &sp90); - matrix_4x4_copy(&sp90, &spE0); - temp_ret_2 = dynAllocate(logoinst->unk8->unkE << 6); - sp138 = temp_ret_2; - matrix_4x4_copy(&spE0, temp_ret_2); - logoinst->unkC = sp138; - sub_GAME_7F06EFC4(logoinst); - sp130 = 3; - sp12C = 0; - sp134 = arg0; - subdraw(&sp128, logoinst); - arg0 = sp134; - phi_s1 = 0; - phi_s0 = 0; - if (logoinst->unk8->unkE > 0) + var_v1 = 0; + } + + ninlogolight.a.l.colc[2] = var_v1; + ninlogolight.a.l.colc[1] = var_v1; + ninlogolight.a.l.colc[0] = var_v1; + ninlogolight.a.l.col[2] = var_v1; + ninlogolight.a.l.col[1] = var_v1; + ninlogolight.a.l.col[0] = var_v1; + +#if defined(VERSION_EU) + ninLogoRotRate += 0.0209439527243f; +#else + ninLogoRotRate += 0.017453292f; +#endif + + // Not sure if this is actually an `if` block, but the sp90 variable + // needs to be declared here for the stack to match. + if(1) { -loop_9: - matrix_4x4_copy(logoinst->unkC + phi_s1, &sp50); - matrix_4x4_f32_to_s32(&sp50, logoinst->unkC + (phi_s0 << 6)); - temp_s0 = phi_s0 + 1; - phi_s1 = phi_s1 + 0x40; - phi_s0 = temp_s0; - if (temp_s0 < logoinst->unk8->unkE) + Mtxf sp90; + + matrix_4x4_set_rotation_around_y(ninLogoRotRate, &sp90); + matrix_scalar_multiply_3(ninLogoScale, (f32*)&sp90); + +#if defined(VERSION_EU) + ninLogoScale *= 1.09647190571f; +#else + ninLogoScale *= 1.07977f; +#endif + if (ninLogoScale > 1.1f) { - goto loop_9; + ninLogoScale = 1.1f; } + + matrix_4x4_7F059694(&spE0, 0.0f, 0.0f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + matrix_4x4_multiply_in_place(&spE0, &sp90); + matrix_4x4_copy(&sp90, &spE0); } - return arg0; -} -#else -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.late_rodata -glabel D_80051A04 -.word 0x3C8EFA35 /* 0.017453292;*/ -glabel D_80051A08 -.word 0x3F8CCCCD /* 1.1;*/ -glabel D_80051A0C -.word 0x3F8A35E7 /* 1.07977;*/ -.text -glabel constructor_menu01_nintendo -/* 03F8C8 7F00AD98 27BDFE98 */ addiu $sp, $sp, -0x168 -/* 03F8CC 7F00AD9C AFB20034 */ sw $s2, 0x34($sp) -/* 03F8D0 7F00ADA0 3C0E8003 */ lui $t6, %hi(D_8002AB08) -/* 03F8D4 7F00ADA4 27B20128 */ addiu $s2, $sp, 0x128 -/* 03F8D8 7F00ADA8 25CEAB08 */ addiu $t6, %lo(D_8002AB08) # addiu $t6, $t6, -0x54f8 -/* 03F8DC 7F00ADAC AFBF003C */ sw $ra, 0x3c($sp) -/* 03F8E0 7F00ADB0 AFB30038 */ sw $s3, 0x38($sp) -/* 03F8E4 7F00ADB4 AFB10030 */ sw $s1, 0x30($sp) -/* 03F8E8 7F00ADB8 AFB0002C */ sw $s0, 0x2c($sp) -/* 03F8EC 7F00ADBC 25D9003C */ addiu $t9, $t6, 0x3c -/* 03F8F0 7F00ADC0 02404025 */ move $t0, $s2 -.L7F00ADC4: -/* 03F8F4 7F00ADC4 8DC10000 */ lw $at, ($t6) -/* 03F8F8 7F00ADC8 25CE000C */ addiu $t6, $t6, 0xc -/* 03F8FC 7F00ADCC 2508000C */ addiu $t0, $t0, 0xc -/* 03F900 7F00ADD0 AD01FFF4 */ sw $at, -0xc($t0) -/* 03F904 7F00ADD4 8DC1FFF8 */ lw $at, -8($t6) -/* 03F908 7F00ADD8 AD01FFF8 */ sw $at, -8($t0) -/* 03F90C 7F00ADDC 8DC1FFFC */ lw $at, -4($t6) -/* 03F910 7F00ADE0 15D9FFF8 */ bne $t6, $t9, .L7F00ADC4 -/* 03F914 7F00ADE4 AD01FFFC */ sw $at, -4($t0) -/* 03F918 7F00ADE8 8DC10000 */ lw $at, ($t6) -/* 03F91C 7F00ADEC 0FC07034 */ jal insert_imageDL -/* 03F920 7F00ADF0 AD010000 */ sw $at, ($t0) -/* 03F924 7F00ADF4 3C09BC00 */ lui $t1, (0xBC000002 >> 16) # lui $t1, 0xbc00 -/* 03F928 7F00ADF8 3C0A8000 */ lui $t2, (0x80000040 >> 16) # lui $t2, 0x8000 -/* 03F92C 7F00ADFC 3C0B0386 */ lui $t3, (0x03860010 >> 16) # lui $t3, 0x386 -/* 03F930 7F00AE00 3C0C8003 */ lui $t4, %hi(D_8002A990) -/* 03F934 7F00AE04 258CA990 */ addiu $t4, %lo(D_8002A990) # addiu $t4, $t4, -0x5670 -/* 03F938 7F00AE08 356B0010 */ ori $t3, (0x03860010 & 0xFFFF) # ori $t3, $t3, 0x10 -/* 03F93C 7F00AE0C 354A0040 */ ori $t2, (0x80000040 & 0xFFFF) # ori $t2, $t2, 0x40 -/* 03F940 7F00AE10 35290002 */ ori $t1, (0xBC000002 & 0xFFFF) # ori $t1, $t1, 2 -/* 03F944 7F00AE14 AC490000 */ sw $t1, ($v0) -/* 03F948 7F00AE18 AC4A0004 */ sw $t2, 4($v0) -/* 03F94C 7F00AE1C AC4B0008 */ sw $t3, 8($v0) -/* 03F950 7F00AE20 AC4C000C */ sw $t4, 0xc($v0) -/* 03F954 7F00AE24 244D0018 */ addiu $t5, $v0, 0x18 -/* 03F958 7F00AE28 3C048003 */ lui $a0, %hi(RGBA_8002A988) -/* 03F95C 7F00AE2C AFAD0168 */ sw $t5, 0x168($sp) -/* 03F960 7F00AE30 3C180388 */ lui $t8, (0x03880010 >> 16) # lui $t8, 0x388 -/* 03F964 7F00AE34 2484A988 */ addiu $a0, %lo(RGBA_8002A988) # addiu $a0, $a0, -0x5678 -/* 03F968 7F00AE38 37180010 */ ori $t8, (0x03880010 & 0xFFFF) # ori $t8, $t8, 0x10 -/* 03F96C 7F00AE3C AC580010 */ sw $t8, 0x10($v0) -/* 03F970 7F00AE40 AC440014 */ sw $a0, 0x14($v0) -/* 03F974 7F00AE44 3C0F8003 */ lui $t7, %hi(g_MenuTimer) -/* 03F978 7F00AE48 8DEFA8CC */ lw $t7, %lo(g_MenuTimer)($t7) -/* 03F97C 7F00AE4C 240500FF */ li $a1, 255 -/* 03F980 7F00AE50 3C01FFFE */ lui $at, (0xFFFE8F72 >> 16) # lui $at, 0xfffe -/* 03F984 7F00AE54 01E50019 */ multu $t7, $a1 -/* 03F988 7F00AE58 34218F72 */ ori $at, (0xFFFE8F72 & 0xFFFF) # ori $at, $at, 0x8f72 -/* 03F98C 7F00AE5C 3C028007 */ lui $v0, %hi(ninLogoRotRate) -/* 03F990 7F00AE60 24429614 */ addiu $v0, %lo(ninLogoRotRate) # addiu $v0, $v0, -0x69ec -/* 03F994 7F00AE64 0000C812 */ mflo $t9 -/* 03F998 7F00AE68 03217021 */ addu $t6, $t9, $at -/* 03F99C 7F00AE6C 24010064 */ li $at, 100 -/* 03F9A0 7F00AE70 01C1001A */ div $zero, $t6, $at -/* 03F9A4 7F00AE74 00004012 */ mflo $t0 -/* 03F9A8 7F00AE78 00A81823 */ subu $v1, $a1, $t0 -/* 03F9AC 7F00AE7C 28610100 */ slti $at, $v1, 0x100 -/* 03F9B0 7F00AE80 14200002 */ bnez $at, .L7F00AE8C -/* 03F9B4 7F00AE84 00000000 */ nop -/* 03F9B8 7F00AE88 240300FF */ li $v1, 255 -.L7F00AE8C: -/* 03F9BC 7F00AE8C 04610002 */ bgez $v1, .L7F00AE98 -/* 03F9C0 7F00AE90 3C018005 */ lui $at, %hi(D_80051A04) -/* 03F9C4 7F00AE94 00001825 */ move $v1, $zero -.L7F00AE98: -/* 03F9C8 7F00AE98 A0830006 */ sb $v1, 6($a0) -/* 03F9CC 7F00AE9C A0830005 */ sb $v1, 5($a0) -/* 03F9D0 7F00AEA0 A0830004 */ sb $v1, 4($a0) -/* 03F9D4 7F00AEA4 A0830002 */ sb $v1, 2($a0) -/* 03F9D8 7F00AEA8 A0830001 */ sb $v1, 1($a0) -/* 03F9DC 7F00AEAC A0830000 */ sb $v1, ($a0) -/* 03F9E0 7F00AEB0 C4261A04 */ lwc1 $f6, %lo(D_80051A04)($at) -/* 03F9E4 7F00AEB4 C4440000 */ lwc1 $f4, ($v0) -/* 03F9E8 7F00AEB8 27B10090 */ addiu $s1, $sp, 0x90 -/* 03F9EC 7F00AEBC 02202825 */ move $a1, $s1 -/* 03F9F0 7F00AEC0 46062200 */ add.s $f8, $f4, $f6 -/* 03F9F4 7F00AEC4 E4480000 */ swc1 $f8, ($v0) -/* 03F9F8 7F00AEC8 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 03F9FC 7F00AECC C44C0000 */ lwc1 $f12, ($v0) -/* 03FA00 7F00AED0 3C108007 */ lui $s0, %hi(ninLogoScale) -/* 03FA04 7F00AED4 26109618 */ addiu $s0, %lo(ninLogoScale) # addiu $s0, $s0, -0x69e8 -/* 03FA08 7F00AED8 C60C0000 */ lwc1 $f12, ($s0) -/* 03FA0C 7F00AEDC 0FC162EE */ jal matrix_scalar_multiply_3 -/* 03FA10 7F00AEE0 02202825 */ move $a1, $s1 -/* 03FA14 7F00AEE4 3C018005 */ lui $at, %hi(D_80051A08) -/* 03FA18 7F00AEE8 C4201A08 */ lwc1 $f0, %lo(D_80051A08)($at) -/* 03FA1C 7F00AEEC 3C018005 */ lui $at, %hi(D_80051A0C) -/* 03FA20 7F00AEF0 C4301A0C */ lwc1 $f16, %lo(D_80051A0C)($at) -/* 03FA24 7F00AEF4 C60A0000 */ lwc1 $f10, ($s0) -/* 03FA28 7F00AEF8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 03FA2C 7F00AEFC 44813000 */ mtc1 $at, $f6 -/* 03FA30 7F00AF00 46105482 */ mul.s $f18, $f10, $f16 -/* 03FA34 7F00AF04 3C07457A */ lui $a3, 0x457a -/* 03FA38 7F00AF08 E6120000 */ swc1 $f18, ($s0) -/* 03FA3C 7F00AF0C C6040000 */ lwc1 $f4, ($s0) -/* 03FA40 7F00AF10 4604003C */ c.lt.s $f0, $f4 -/* 03FA44 7F00AF14 00000000 */ nop -/* 03FA48 7F00AF18 45020003 */ bc1fl .L7F00AF28 -/* 03FA4C 7F00AF1C 44800000 */ mtc1 $zero, $f0 -/* 03FA50 7F00AF20 E6000000 */ swc1 $f0, ($s0) -/* 03FA54 7F00AF24 44800000 */ mtc1 $zero, $f0 -.L7F00AF28: -/* 03FA58 7F00AF28 27B000E0 */ addiu $s0, $sp, 0xe0 -/* 03FA5C 7F00AF2C 02002025 */ move $a0, $s0 -/* 03FA60 7F00AF30 44050000 */ mfc1 $a1, $f0 -/* 03FA64 7F00AF34 44060000 */ mfc1 $a2, $f0 -/* 03FA68 7F00AF38 E7A60020 */ swc1 $f6, 0x20($sp) -/* 03FA6C 7F00AF3C E7A00010 */ swc1 $f0, 0x10($sp) -/* 03FA70 7F00AF40 E7A00014 */ swc1 $f0, 0x14($sp) -/* 03FA74 7F00AF44 E7A00018 */ swc1 $f0, 0x18($sp) -/* 03FA78 7F00AF48 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 03FA7C 7F00AF4C 0FC165A5 */ jal matrix_4x4_7F059694 -/* 03FA80 7F00AF50 E7A00024 */ swc1 $f0, 0x24($sp) -/* 03FA84 7F00AF54 02002025 */ move $a0, $s0 -/* 03FA88 7F00AF58 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 03FA8C 7F00AF5C 02202825 */ move $a1, $s1 -/* 03FA90 7F00AF60 02202025 */ move $a0, $s1 -/* 03FA94 7F00AF64 0FC16008 */ jal matrix_4x4_copy -/* 03FA98 7F00AF68 02002825 */ move $a1, $s0 -/* 03FA9C 7F00AF6C 3C138003 */ lui $s3, %hi(logoinst) -/* 03FAA0 7F00AF70 2673A958 */ addiu $s3, %lo(logoinst) # addiu $s3, $s3, -0x56a8 -/* 03FAA4 7F00AF74 8E690000 */ lw $t1, ($s3) -/* 03FAA8 7F00AF78 AFB00128 */ sw $s0, 0x128($sp) -/* 03FAAC 7F00AF7C 8D2A0008 */ lw $t2, 8($t1) -/* 03FAB0 7F00AF80 8544000E */ lh $a0, 0xe($t2) -/* 03FAB4 7F00AF84 00045980 */ sll $t3, $a0, 6 -/* 03FAB8 7F00AF88 0FC2F5C5 */ jal dynAllocate -/* 03FABC 7F00AF8C 01602025 */ move $a0, $t3 -/* 03FAC0 7F00AF90 AFA20138 */ sw $v0, 0x138($sp) -/* 03FAC4 7F00AF94 02002025 */ move $a0, $s0 -/* 03FAC8 7F00AF98 0FC16008 */ jal matrix_4x4_copy -/* 03FACC 7F00AF9C 00402825 */ move $a1, $v0 -/* 03FAD0 7F00AFA0 8FAC0138 */ lw $t4, 0x138($sp) -/* 03FAD4 7F00AFA4 8E6D0000 */ lw $t5, ($s3) -/* 03FAD8 7F00AFA8 ADAC000C */ sw $t4, 0xc($t5) -/* 03FADC 7F00AFAC 0FC1BBF1 */ jal sub_GAME_7F06EFC4 -/* 03FAE0 7F00AFB0 8E640000 */ lw $a0, ($s3) -/* 03FAE4 7F00AFB4 8FAF0168 */ lw $t7, 0x168($sp) -/* 03FAE8 7F00AFB8 24180003 */ li $t8, 3 -/* 03FAEC 7F00AFBC AFB80130 */ sw $t8, 0x130($sp) -/* 03FAF0 7F00AFC0 AFA0012C */ sw $zero, 0x12c($sp) -/* 03FAF4 7F00AFC4 02402025 */ move $a0, $s2 -/* 03FAF8 7F00AFC8 8E650000 */ lw $a1, ($s3) -/* 03FAFC 7F00AFCC 0FC1D1A1 */ jal subdraw -/* 03FB00 7F00AFD0 AFAF0134 */ sw $t7, 0x134($sp) -/* 03FB04 7F00AFD4 8FB90134 */ lw $t9, 0x134($sp) -/* 03FB08 7F00AFD8 8E620000 */ lw $v0, ($s3) -/* 03FB0C 7F00AFDC 00008025 */ move $s0, $zero -/* 03FB10 7F00AFE0 AFB90168 */ sw $t9, 0x168($sp) -/* 03FB14 7F00AFE4 8C4E0008 */ lw $t6, 8($v0) -/* 03FB18 7F00AFE8 00008825 */ move $s1, $zero -/* 03FB1C 7F00AFEC 27B20050 */ addiu $s2, $sp, 0x50 -/* 03FB20 7F00AFF0 85C8000E */ lh $t0, 0xe($t6) -/* 03FB24 7F00AFF4 59000014 */ blezl $t0, .L7F00B048 -/* 03FB28 7F00AFF8 8FBF003C */ lw $ra, 0x3c($sp) -/* 03FB2C 7F00AFFC 8C49000C */ lw $t1, 0xc($v0) -.L7F00B000: -/* 03FB30 7F00B000 02402825 */ move $a1, $s2 -/* 03FB34 7F00B004 0FC16008 */ jal matrix_4x4_copy -/* 03FB38 7F00B008 01312021 */ addu $a0, $t1, $s1 -/* 03FB3C 7F00B00C 8E6A0000 */ lw $t2, ($s3) -/* 03FB40 7F00B010 00106180 */ sll $t4, $s0, 6 -/* 03FB44 7F00B014 02402025 */ move $a0, $s2 -/* 03FB48 7F00B018 8D4B000C */ lw $t3, 0xc($t2) -/* 03FB4C 7F00B01C 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 03FB50 7F00B020 016C2821 */ addu $a1, $t3, $t4 -/* 03FB54 7F00B024 8E620000 */ lw $v0, ($s3) -/* 03FB58 7F00B028 26100001 */ addiu $s0, $s0, 1 -/* 03FB5C 7F00B02C 26310040 */ addiu $s1, $s1, 0x40 -/* 03FB60 7F00B030 8C4D0008 */ lw $t5, 8($v0) -/* 03FB64 7F00B034 85B8000E */ lh $t8, 0xe($t5) -/* 03FB68 7F00B038 0218082A */ slt $at, $s0, $t8 -/* 03FB6C 7F00B03C 5420FFF0 */ bnezl $at, .L7F00B000 -/* 03FB70 7F00B040 8C49000C */ lw $t1, 0xc($v0) -/* 03FB74 7F00B044 8FBF003C */ lw $ra, 0x3c($sp) -.L7F00B048: -/* 03FB78 7F00B048 8FA20168 */ lw $v0, 0x168($sp) -/* 03FB7C 7F00B04C 8FB0002C */ lw $s0, 0x2c($sp) -/* 03FB80 7F00B050 8FB10030 */ lw $s1, 0x30($sp) -/* 03FB84 7F00B054 8FB20034 */ lw $s2, 0x34($sp) -/* 03FB88 7F00B058 8FB30038 */ lw $s3, 0x38($sp) -/* 03FB8C 7F00B05C 03E00008 */ jr $ra -/* 03FB90 7F00B060 27BD0168 */ addiu $sp, $sp, 0x168 -) -#endif + sp128.unk_matrix = &spE0; + + sp128.mtxlist = dynAllocate(logoinst->obj->numMatrices << 6); -#if defined(VERSION_EU) + matrix_4x4_copy(&spE0, sp128.mtxlist); -GLOBAL_ASM( -.late_rodata -glabel D_80051A04 -.word 0x3cab92a7 /* 0.0209439527243 */ -glabel D_80051A08 -.word 0x3F8CCCCD /* 1.1;*/ -glabel D_80051A0C -.word 0x3f8c5931 /* 1.09647190571 */ -.text -glabel constructor_menu01_nintendo -/* 03F8C8 7F00AD98 27BDFE98 */ addiu $sp, $sp, -0x168 -/* 03F8CC 7F00AD9C AFB20034 */ sw $s2, 0x34($sp) -/* 03F8D0 7F00ADA0 3C0E8003 */ lui $t6, %hi(D_8002AB08) -/* 03F8D4 7F00ADA4 27B20128 */ addiu $s2, $sp, 0x128 -/* 03F8D8 7F00ADA8 25CEAB08 */ addiu $t6, %lo(D_8002AB08) # addiu $t6, $t6, -0x54f8 -/* 03F8DC 7F00ADAC AFBF003C */ sw $ra, 0x3c($sp) -/* 03F8E0 7F00ADB0 AFB30038 */ sw $s3, 0x38($sp) -/* 03F8E4 7F00ADB4 AFB10030 */ sw $s1, 0x30($sp) -/* 03F8E8 7F00ADB8 AFB0002C */ sw $s0, 0x2c($sp) -/* 03F8EC 7F00ADBC 25D9003C */ addiu $t9, $t6, 0x3c -/* 03F8F0 7F00ADC0 02404025 */ move $t0, $s2 -.L7F00ADC4: -/* 03F8F4 7F00ADC4 8DC10000 */ lw $at, ($t6) -/* 03F8F8 7F00ADC8 25CE000C */ addiu $t6, $t6, 0xc -/* 03F8FC 7F00ADCC 2508000C */ addiu $t0, $t0, 0xc -/* 03F900 7F00ADD0 AD01FFF4 */ sw $at, -0xc($t0) -/* 03F904 7F00ADD4 8DC1FFF8 */ lw $at, -8($t6) -/* 03F908 7F00ADD8 AD01FFF8 */ sw $at, -8($t0) -/* 03F90C 7F00ADDC 8DC1FFFC */ lw $at, -4($t6) -/* 03F910 7F00ADE0 15D9FFF8 */ bne $t6, $t9, .L7F00ADC4 -/* 03F914 7F00ADE4 AD01FFFC */ sw $at, -4($t0) -/* 03F918 7F00ADE8 8DC10000 */ lw $at, ($t6) -/* 03F91C 7F00ADEC 0FC07034 */ jal insert_imageDL -/* 03F920 7F00ADF0 AD010000 */ sw $at, ($t0) -/* 03F924 7F00ADF4 3C09BC00 */ lui $t1, (0xBC000002 >> 16) # lui $t1, 0xbc00 -/* 03F928 7F00ADF8 3C0A8000 */ lui $t2, (0x80000040 >> 16) # lui $t2, 0x8000 -/* 03F92C 7F00ADFC 3C0B0386 */ lui $t3, (0x03860010 >> 16) # lui $t3, 0x386 -/* 03F930 7F00AE00 3C0C8003 */ lui $t4, %hi(D_8002A990) -/* 03F934 7F00AE04 258CA990 */ addiu $t4, %lo(D_8002A990) # addiu $t4, $t4, -0x5670 -/* 03F938 7F00AE08 356B0010 */ ori $t3, (0x03860010 & 0xFFFF) # ori $t3, $t3, 0x10 -/* 03F93C 7F00AE0C 354A0040 */ ori $t2, (0x80000040 & 0xFFFF) # ori $t2, $t2, 0x40 -/* 03F940 7F00AE10 35290002 */ ori $t1, (0xBC000002 & 0xFFFF) # ori $t1, $t1, 2 -/* 03F944 7F00AE14 AC490000 */ sw $t1, ($v0) -/* 03F948 7F00AE18 AC4A0004 */ sw $t2, 4($v0) -/* 03F94C 7F00AE1C AC4B0008 */ sw $t3, 8($v0) -/* 03F950 7F00AE20 AC4C000C */ sw $t4, 0xc($v0) -/* 03F954 7F00AE24 244D0018 */ addiu $t5, $v0, 0x18 -/* 03F958 7F00AE28 3C048003 */ lui $a0, %hi(RGBA_8002A988) -/* 03F95C 7F00AE2C AFAD0168 */ sw $t5, 0x168($sp) -/* 03F960 7F00AE30 3C180388 */ lui $t8, (0x03880010 >> 16) # lui $t8, 0x388 -/* 03F964 7F00AE34 2484A988 */ addiu $a0, %lo(RGBA_8002A988) # addiu $a0, $a0, -0x5678 -/* 03F968 7F00AE38 37180010 */ ori $t8, (0x03880010 & 0xFFFF) # ori $t8, $t8, 0x10 -/* 03F96C 7F00AE3C AC580010 */ sw $t8, 0x10($v0) -/* 03F970 7F00AE40 AC440014 */ sw $a0, 0x14($v0) -/* 03F974 7F00AE44 3C0F8003 */ lui $t7, %hi(g_MenuTimer) -/* 03F978 7F00AE48 8DEFA8CC */ lw $t7, %lo(g_MenuTimer)($t7) -/* 03F97C 7F00AE4C 240500FF */ li $a1, 255 -/* 03F980 7F00AE50 3C01FFFE */ lui $at, (0xFFFEcd34 >> 16) # lui $at, 0xfffe -/* 03F984 7F00AE54 01E50019 */ multu $t7, $a1 -/* 03F988 7F00AE58 3421cd34 */ ori $at, (0xFFFEcd34 & 0xFFFF) # ori $at, $at, 0xcd34 -/* 03F98C 7F00AE5C 3C028007 */ lui $v0, %hi(ninLogoRotRate) -/* 03F990 7F00AE60 24429614 */ addiu $v0, %lo(ninLogoRotRate) # addiu $v0, $v0, -0x69ec -/* 03F994 7F00AE64 0000C812 */ mflo $t9 -/* 03F998 7F00AE68 03217021 */ addu $t6, $t9, $at -/* 03F99C 7F00AE6C 24010064 */ li $at, 0x53 -/* 03F9A0 7F00AE70 01C1001A */ div $zero, $t6, $at -/* 03F9A4 7F00AE74 00004012 */ mflo $t0 -/* 03F9A8 7F00AE78 00A81823 */ subu $v1, $a1, $t0 -/* 03F9AC 7F00AE7C 28610100 */ slti $at, $v1, 0x100 -/* 03F9B0 7F00AE80 14200002 */ bnez $at, .L7F00AE8C -/* 03F9B4 7F00AE84 00000000 */ nop -/* 03F9B8 7F00AE88 240300FF */ li $v1, 255 -.L7F00AE8C: -/* 03F9BC 7F00AE8C 04610002 */ bgez $v1, .L7F00AE98 -/* 03F9C0 7F00AE90 3C018005 */ lui $at, %hi(D_80051A04) -/* 03F9C4 7F00AE94 00001825 */ move $v1, $zero -.L7F00AE98: -/* 03F9C8 7F00AE98 A0830006 */ sb $v1, 6($a0) -/* 03F9CC 7F00AE9C A0830005 */ sb $v1, 5($a0) -/* 03F9D0 7F00AEA0 A0830004 */ sb $v1, 4($a0) -/* 03F9D4 7F00AEA4 A0830002 */ sb $v1, 2($a0) -/* 03F9D8 7F00AEA8 A0830001 */ sb $v1, 1($a0) -/* 03F9DC 7F00AEAC A0830000 */ sb $v1, ($a0) -/* 03F9E0 7F00AEB0 C4261A04 */ lwc1 $f6, %lo(D_80051A04)($at) -/* 03F9E4 7F00AEB4 C4440000 */ lwc1 $f4, ($v0) -/* 03F9E8 7F00AEB8 27B10090 */ addiu $s1, $sp, 0x90 -/* 03F9EC 7F00AEBC 02202825 */ move $a1, $s1 -/* 03F9F0 7F00AEC0 46062200 */ add.s $f8, $f4, $f6 -/* 03F9F4 7F00AEC4 E4480000 */ swc1 $f8, ($v0) -/* 03F9F8 7F00AEC8 0FC1617F */ jal matrix_4x4_set_rotation_around_y -/* 03F9FC 7F00AECC C44C0000 */ lwc1 $f12, ($v0) -/* 03FA00 7F00AED0 3C108007 */ lui $s0, %hi(ninLogoScale) -/* 03FA04 7F00AED4 26109618 */ addiu $s0, %lo(ninLogoScale) # addiu $s0, $s0, -0x69e8 -/* 03FA08 7F00AED8 C60C0000 */ lwc1 $f12, ($s0) -/* 03FA0C 7F00AEDC 0FC162EE */ jal matrix_scalar_multiply_3 -/* 03FA10 7F00AEE0 02202825 */ move $a1, $s1 -/* 03FA14 7F00AEE4 3C018005 */ lui $at, %hi(D_80051A08) -/* 03FA18 7F00AEE8 C4201A08 */ lwc1 $f0, %lo(D_80051A08)($at) -/* 03FA1C 7F00AEEC 3C018005 */ lui $at, %hi(D_80051A0C) -/* 03FA20 7F00AEF0 C4301A0C */ lwc1 $f16, %lo(D_80051A0C)($at) -/* 03FA24 7F00AEF4 C60A0000 */ lwc1 $f10, ($s0) -/* 03FA28 7F00AEF8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 03FA2C 7F00AEFC 44813000 */ mtc1 $at, $f6 -/* 03FA30 7F00AF00 46105482 */ mul.s $f18, $f10, $f16 -/* 03FA34 7F00AF04 3C07457A */ lui $a3, 0x457a -/* 03FA38 7F00AF08 E6120000 */ swc1 $f18, ($s0) -/* 03FA3C 7F00AF0C C6040000 */ lwc1 $f4, ($s0) -/* 03FA40 7F00AF10 4604003C */ c.lt.s $f0, $f4 -/* 03FA44 7F00AF14 00000000 */ nop -/* 03FA48 7F00AF18 45020003 */ bc1fl .L7F00AF28 -/* 03FA4C 7F00AF1C 44800000 */ mtc1 $zero, $f0 -/* 03FA50 7F00AF20 E6000000 */ swc1 $f0, ($s0) -/* 03FA54 7F00AF24 44800000 */ mtc1 $zero, $f0 -.L7F00AF28: -/* 03FA58 7F00AF28 27B000E0 */ addiu $s0, $sp, 0xe0 -/* 03FA5C 7F00AF2C 02002025 */ move $a0, $s0 -/* 03FA60 7F00AF30 44050000 */ mfc1 $a1, $f0 -/* 03FA64 7F00AF34 44060000 */ mfc1 $a2, $f0 -/* 03FA68 7F00AF38 E7A60020 */ swc1 $f6, 0x20($sp) -/* 03FA6C 7F00AF3C E7A00010 */ swc1 $f0, 0x10($sp) -/* 03FA70 7F00AF40 E7A00014 */ swc1 $f0, 0x14($sp) -/* 03FA74 7F00AF44 E7A00018 */ swc1 $f0, 0x18($sp) -/* 03FA78 7F00AF48 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 03FA7C 7F00AF4C 0FC165A5 */ jal matrix_4x4_7F059694 -/* 03FA80 7F00AF50 E7A00024 */ swc1 $f0, 0x24($sp) -/* 03FA84 7F00AF54 02002025 */ move $a0, $s0 -/* 03FA88 7F00AF58 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 03FA8C 7F00AF5C 02202825 */ move $a1, $s1 -/* 03FA90 7F00AF60 02202025 */ move $a0, $s1 -/* 03FA94 7F00AF64 0FC16008 */ jal matrix_4x4_copy -/* 03FA98 7F00AF68 02002825 */ move $a1, $s0 -/* 03FA9C 7F00AF6C 3C138003 */ lui $s3, %hi(logoinst) -/* 03FAA0 7F00AF70 2673A958 */ addiu $s3, %lo(logoinst) # addiu $s3, $s3, -0x56a8 -/* 03FAA4 7F00AF74 8E690000 */ lw $t1, ($s3) -/* 03FAA8 7F00AF78 AFB00128 */ sw $s0, 0x128($sp) -/* 03FAAC 7F00AF7C 8D2A0008 */ lw $t2, 8($t1) -/* 03FAB0 7F00AF80 8544000E */ lh $a0, 0xe($t2) -/* 03FAB4 7F00AF84 00045980 */ sll $t3, $a0, 6 -/* 03FAB8 7F00AF88 0FC2F5C5 */ jal dynAllocate -/* 03FABC 7F00AF8C 01602025 */ move $a0, $t3 -/* 03FAC0 7F00AF90 AFA20138 */ sw $v0, 0x138($sp) -/* 03FAC4 7F00AF94 02002025 */ move $a0, $s0 -/* 03FAC8 7F00AF98 0FC16008 */ jal matrix_4x4_copy -/* 03FACC 7F00AF9C 00402825 */ move $a1, $v0 -/* 03FAD0 7F00AFA0 8FAC0138 */ lw $t4, 0x138($sp) -/* 03FAD4 7F00AFA4 8E6D0000 */ lw $t5, ($s3) -/* 03FAD8 7F00AFA8 ADAC000C */ sw $t4, 0xc($t5) -/* 03FADC 7F00AFAC 0FC1BBF1 */ jal sub_GAME_7F06EFC4 -/* 03FAE0 7F00AFB0 8E640000 */ lw $a0, ($s3) -/* 03FAE4 7F00AFB4 8FAF0168 */ lw $t7, 0x168($sp) -/* 03FAE8 7F00AFB8 24180003 */ li $t8, 3 -/* 03FAEC 7F00AFBC AFB80130 */ sw $t8, 0x130($sp) -/* 03FAF0 7F00AFC0 AFA0012C */ sw $zero, 0x12c($sp) -/* 03FAF4 7F00AFC4 02402025 */ move $a0, $s2 -/* 03FAF8 7F00AFC8 8E650000 */ lw $a1, ($s3) -/* 03FAFC 7F00AFCC 0FC1D1A1 */ jal subdraw -/* 03FB00 7F00AFD0 AFAF0134 */ sw $t7, 0x134($sp) -/* 03FB04 7F00AFD4 8FB90134 */ lw $t9, 0x134($sp) -/* 03FB08 7F00AFD8 8E620000 */ lw $v0, ($s3) -/* 03FB0C 7F00AFDC 00008025 */ move $s0, $zero -/* 03FB10 7F00AFE0 AFB90168 */ sw $t9, 0x168($sp) -/* 03FB14 7F00AFE4 8C4E0008 */ lw $t6, 8($v0) -/* 03FB18 7F00AFE8 00008825 */ move $s1, $zero -/* 03FB1C 7F00AFEC 27B20050 */ addiu $s2, $sp, 0x50 -/* 03FB20 7F00AFF0 85C8000E */ lh $t0, 0xe($t6) -/* 03FB24 7F00AFF4 59000014 */ blezl $t0, .L7F00B048 -/* 03FB28 7F00AFF8 8FBF003C */ lw $ra, 0x3c($sp) -/* 03FB2C 7F00AFFC 8C49000C */ lw $t1, 0xc($v0) -.L7F00B000: -/* 03FB30 7F00B000 02402825 */ move $a1, $s2 -/* 03FB34 7F00B004 0FC16008 */ jal matrix_4x4_copy -/* 03FB38 7F00B008 01312021 */ addu $a0, $t1, $s1 -/* 03FB3C 7F00B00C 8E6A0000 */ lw $t2, ($s3) -/* 03FB40 7F00B010 00106180 */ sll $t4, $s0, 6 -/* 03FB44 7F00B014 02402025 */ move $a0, $s2 -/* 03FB48 7F00B018 8D4B000C */ lw $t3, 0xc($t2) -/* 03FB4C 7F00B01C 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 03FB50 7F00B020 016C2821 */ addu $a1, $t3, $t4 -/* 03FB54 7F00B024 8E620000 */ lw $v0, ($s3) -/* 03FB58 7F00B028 26100001 */ addiu $s0, $s0, 1 -/* 03FB5C 7F00B02C 26310040 */ addiu $s1, $s1, 0x40 -/* 03FB60 7F00B030 8C4D0008 */ lw $t5, 8($v0) -/* 03FB64 7F00B034 85B8000E */ lh $t8, 0xe($t5) -/* 03FB68 7F00B038 0218082A */ slt $at, $s0, $t8 -/* 03FB6C 7F00B03C 5420FFF0 */ bnezl $at, .L7F00B000 -/* 03FB70 7F00B040 8C49000C */ lw $t1, 0xc($v0) -/* 03FB74 7F00B044 8FBF003C */ lw $ra, 0x3c($sp) -.L7F00B048: -/* 03FB78 7F00B048 8FA20168 */ lw $v0, 0x168($sp) -/* 03FB7C 7F00B04C 8FB0002C */ lw $s0, 0x2c($sp) -/* 03FB80 7F00B050 8FB10030 */ lw $s1, 0x30($sp) -/* 03FB84 7F00B054 8FB20034 */ lw $s2, 0x34($sp) -/* 03FB88 7F00B058 8FB30038 */ lw $s3, 0x38($sp) -/* 03FB8C 7F00B05C 03E00008 */ jr $ra -/* 03FB90 7F00B060 27BD0168 */ addiu $sp, $sp, 0x168 -) -#endif + logoinst->render_pos = (union RenderPosView*)sp128.mtxlist; -#endif + sub_GAME_7F06EFC4(logoinst); + + sp128.unk08 = 3; + sp128.unk04 = 0; + sp128.gdl = DL; + + subdraw(&sp128, logoinst); + + DL = sp128.gdl; + + for (i=0; iobj->numMatrices; i++) + { + Mtxf sp50; + s32 padding2; + + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy(&((s8*)logoinst->render_pos)[i*0x40], &sp50); + matrix_4x4_f32_to_s32(&sp50, &((Mtxf*)logoinst->render_pos)[i]); + + if(i); + } + + return DL; +} @@ -2269,18 +1808,18 @@ void interface_menu02_rareware(void) viSetUseZBuf(0); if (isGunBarrelInMode2()) { - set_menu_to_mode(MENU_EYE_INTRO, 1); + frontChangeMenu(MENU_EYE_INTRO, TRUE); return; } if (joyGetButtonsPressedThisFrame(PLAYER_1, ANY_BUTTON)) { if (!is_first_time_on_main_menu) { - set_menu_to_mode(MENU_FILE_SELECT, 1); + frontChangeMenu(MENU_FILE_SELECT, TRUE); return; } prev_keypresses = 1; - set_menu_to_mode(MENU_EYE_INTRO, 1); + frontChangeMenu(MENU_EYE_INTRO, TRUE); } } @@ -2314,16 +1853,16 @@ void update_menu_03_eye(void) { void interface_menu03_eye(void) { viSetUseZBuf(0); if (isGunBarrelInMode9()) { - set_menu_to_mode(MENU_GOLDENEYE_LOGO, 1); + frontChangeMenu(MENU_GOLDENEYE_LOGO, TRUE); return; } if (joyGetButtonsPressedThisFrame(PLAYER_1, ANY_BUTTON)) { if (!is_first_time_on_main_menu) { - set_menu_to_mode(MENU_FILE_SELECT, 1); + frontChangeMenu(MENU_FILE_SELECT, TRUE); return; } prev_keypresses = 1; - set_menu_to_mode(MENU_GOLDENEYE_LOGO, 1); + frontChangeMenu(MENU_GOLDENEYE_LOGO, TRUE); } } @@ -2355,7 +1894,7 @@ void init_menu04_goldeneyelogo(void) void update_menu04_goldeneye(void) { - is_first_time_on_main_menu = 0; + is_first_time_on_main_menu = FALSE; clear_model_obj(logoinst); } @@ -2369,8 +1908,8 @@ void interface_menu04_goldeneyelogo(void) #define GOLDENEYELOGO_TIMER_2 (60/2)*3 #endif - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); g_MenuTimer += g_ClockTimer; @@ -2378,16 +1917,16 @@ void interface_menu04_goldeneyelogo(void) ((ge_logo_bool && (GOLDENEYELOGO_TIMER_2 < g_MenuTimer)))) { if (g_MenuTimer > GOLDENEYELOGO_TIMER_1) { if (prev_keypresses) { - set_menu_to_mode(MENU_FILE_SELECT,1); + frontChangeMenu(MENU_FILE_SELECT,TRUE); } else { do_extended_cast_display(FALSE); - set_menu_to_mode(MENU_DISPLAY_CAST,1); + frontChangeMenu(MENU_DISPLAY_CAST,TRUE); } } else { if ((joyGetButtonsPressedThisFrame(PLAYER_1,ANY_BUTTON)) || ((is_first_time_on_main_menu && ge_logo_bool))) { - set_menu_to_mode(MENU_FILE_SELECT,1); + frontChangeMenu(MENU_FILE_SELECT,TRUE); } } } @@ -2400,367 +1939,86 @@ void interface_menu04_goldeneyelogo(void) -#ifdef NONMATCHING -s32 constructor_menu04_goldeneyelogo(s32 arg0) +Gfx *constructor_menu04_goldeneyelogo(Gfx *DL) { - s32 sp150; - s32 sp148; - s32 sp144; - s32 sp140; - s32 spF8; - s32 spB0; - s32 sp5C; - s32 temp_a0; - s32 temp_ret; - s32 temp_s0; - s32 temp_s0_2; - s32 temp_s4; - s32 temp_v0; - s32 temp_v1; - void *temp_t1; - void *temp_t6; - void *phi_t6; - void *phi_t1; - s32 phi_s1; - s32 phi_s0; - - phi_t6 = &D_8002AB54; - phi_t1 = &sp140; -loop_1: - temp_t6 = phi_t6 + 0xc; - temp_t1 = phi_t1 + 0xc; - temp_t1->unk-C = (s32) *phi_t6; - temp_t1->unk-8 = (s32) temp_t6->unk-8; - temp_t1->unk-4 = (s32) temp_t6->unk-4; - phi_t6 = temp_t6; - phi_t1 = temp_t1; - if (temp_t6 != (&D_8002AB54 + 0x3c)) - { - goto loop_1; - } - temp_t1->unk0 = (s32) temp_t6->unk0; - temp_s4 = viFillScreen(viSetFillColor(arg0, 0, 0, 0)); - temp_ret = dynAllocate7F0BD6F8(2); - temp_s0 = temp_ret; - guLookAtReflect(&spB0, temp_ret, 0.0f, 0.0f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); - temp_v0 = temp_s4; - temp_s4 = temp_s4 + 8; - temp_v1 = temp_s4; - temp_s4 = temp_s4 + 8; - temp_v0->unk0 = 0xbc000002; - temp_v0->unk4 = 0x80000040; - temp_a0 = temp_s4; - temp_s4 = temp_s4 + 8; - temp_v1->unk0 = 0x3860010; - temp_v1->unk4 = &RGBA_8002A978; - temp_a0->unk0 = 0x3880010; - temp_a0->unk4 = &RGBA_8002A970; - temp_s4->unk0 = 0x3840010; - temp_s4->unk4 = temp_s0; - temp_s4 = temp_s4 + 8; - temp_s4->unk4 = (s32) (temp_s0 + 0x10); - temp_s4->unk0 = 0x3820010; - matrix_4x4_7F059694(&spF8, 0.0f, 0.0f, 0x453b8000, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); - sp150 = dynAllocate(logoinst->unk8->unkE << 6); - matrix_scalar_multiply(D_80051A18, &spF8); - matrix_4x4_copy(&spF8, sp150); - logoinst->unkC = sp150; + struct unk_joint_list sp140; + s32 padding[2]; + Mtxf spF8; + s32 i; + LookAt * temp_v0; + Mtxf spB0; + + sp140 = D_8002AB54; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + + temp_v0 = (LookAt *)dynAllocate7F0BD6F8(2); + guLookAtReflect(&spB0, temp_v0, 0.0f, 0.0f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + + // Lights macro? These need to be on one line. + gSPNumLights(DL++, 1); \ + gSPLight(DL++, &gelogolight.l[0], 1); \ + gSPLight(DL++, &gelogolight, 2); + + // gSPLookAt macro expands to gSPLookAtX + gSPLookAtY + gSPLookAt(DL++, temp_v0); + + matrix_4x4_7F059694(&spF8, 0.0f, 0.0f, 3000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + sp140.unk_matrix = &spF8; + sp140.mtxlist = dynAllocate(logoinst->obj->numMatrices << 6); + + matrix_scalar_multiply(1.2f, spF8.m[0]); + matrix_4x4_copy(&spF8, sp140.mtxlist); + logoinst->render_pos = (union RenderPosView*)sp140.mtxlist; + sub_GAME_7F06EFC4(logoinst); - sp148 = 3; - sp144 = 0; + + sp140.unk08 = 3; + sp140.unk04 = 0; + sp140.gdl = DL; + subdraw(&sp140, logoinst); - phi_s1 = 0; - phi_s0 = 0; - if (logoinst->unk8->unkE > 0) + + DL = sp140.gdl; + + for (i=0; iobj->numMatrices; i++) { -loop_3: - matrix_4x4_copy(logoinst->unkC + phi_s1, &sp5C); - matrix_4x4_f32_to_s32(&sp5C, logoinst->unkC + (phi_s0 << 6)); - temp_s0_2 = phi_s0 + 1; - phi_s1 = phi_s1 + 0x40; - phi_s0 = temp_s0_2; - if (temp_s0_2 < logoinst->unk8->unkE) - { - goto loop_3; - } + Mtxf sp50; + s32 padding2; + + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy(&((s8*)logoinst->render_pos)[i*0x40], &sp50); + matrix_4x4_f32_to_s32(&sp50, &((Mtxf*)logoinst->render_pos)[i]); + + if(i); } - return sp14C; + + return DL; } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80051A18 -.word 0x3F99999A /* 1.2;*/ -.text -glabel constructor_menu04_goldeneyelogo -/* 03FFAC 7F00B47C 27BDFE80 */ addiu $sp, $sp, -0x180 -/* 03FFB0 7F00B480 AFB20040 */ sw $s2, 0x40($sp) -/* 03FFB4 7F00B484 3C0E8003 */ lui $t6, %hi(D_8002AB54) -/* 03FFB8 7F00B488 27B20140 */ addiu $s2, $sp, 0x140 -/* 03FFBC 7F00B48C AFB40048 */ sw $s4, 0x48($sp) -/* 03FFC0 7F00B490 25CEAB54 */ addiu $t6, %lo(D_8002AB54) # addiu $t6, $t6, -0x54ac -/* 03FFC4 7F00B494 0080A025 */ move $s4, $a0 -/* 03FFC8 7F00B498 AFBF004C */ sw $ra, 0x4c($sp) -/* 03FFCC 7F00B49C AFB30044 */ sw $s3, 0x44($sp) -/* 03FFD0 7F00B4A0 AFB1003C */ sw $s1, 0x3c($sp) -/* 03FFD4 7F00B4A4 AFB00038 */ sw $s0, 0x38($sp) -/* 03FFD8 7F00B4A8 25D9003C */ addiu $t9, $t6, 0x3c -/* 03FFDC 7F00B4AC 02404825 */ move $t1, $s2 -.L7F00B4B0: -/* 03FFE0 7F00B4B0 8DC10000 */ lw $at, ($t6) -/* 03FFE4 7F00B4B4 25CE000C */ addiu $t6, $t6, 0xc -/* 03FFE8 7F00B4B8 2529000C */ addiu $t1, $t1, 0xc -/* 03FFEC 7F00B4BC AD21FFF4 */ sw $at, -0xc($t1) -/* 03FFF0 7F00B4C0 8DC1FFF8 */ lw $at, -8($t6) -/* 03FFF4 7F00B4C4 AD21FFF8 */ sw $at, -8($t1) -/* 03FFF8 7F00B4C8 8DC1FFFC */ lw $at, -4($t6) -/* 03FFFC 7F00B4CC 15D9FFF8 */ bne $t6, $t9, .L7F00B4B0 -/* 040000 7F00B4D0 AD21FFFC */ sw $at, -4($t1) -/* 040004 7F00B4D4 8DC10000 */ lw $at, ($t6) -/* 040008 7F00B4D8 02802025 */ move $a0, $s4 -/* 04000C 7F00B4DC 00002825 */ move $a1, $zero -/* 040010 7F00B4E0 00003025 */ move $a2, $zero -/* 040014 7F00B4E4 00003825 */ move $a3, $zero -/* 040018 7F00B4E8 0C0011B4 */ jal viSetFillColor -/* 04001C 7F00B4EC AD210000 */ sw $at, ($t1) -/* 040020 7F00B4F0 0C000FBE */ jal viFillScreen -/* 040024 7F00B4F4 00402025 */ move $a0, $v0 -/* 040028 7F00B4F8 0040A025 */ move $s4, $v0 -/* 04002C 7F00B4FC 0FC2F5BE */ jal dynAllocate7F0BD6F8 -/* 040030 7F00B500 24040002 */ li $a0, 2 -/* 040034 7F00B504 44800000 */ mtc1 $zero, $f0 -/* 040038 7F00B508 3C01457A */ li $at, 0x457A0000 # 4000.000000 -/* 04003C 7F00B50C 44812000 */ mtc1 $at, $f4 -/* 040040 7F00B510 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 040044 7F00B514 44813000 */ mtc1 $at, $f6 -/* 040048 7F00B518 44060000 */ mfc1 $a2, $f0 -/* 04004C 7F00B51C 44070000 */ mfc1 $a3, $f0 -/* 040050 7F00B520 00408025 */ move $s0, $v0 -/* 040054 7F00B524 27A400B0 */ addiu $a0, $sp, 0xb0 -/* 040058 7F00B528 00402825 */ move $a1, $v0 -/* 04005C 7F00B52C E7A00014 */ swc1 $f0, 0x14($sp) -/* 040060 7F00B530 E7A00018 */ swc1 $f0, 0x18($sp) -/* 040064 7F00B534 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 040068 7F00B538 E7A00020 */ swc1 $f0, 0x20($sp) -/* 04006C 7F00B53C E7A00028 */ swc1 $f0, 0x28($sp) -/* 040070 7F00B540 E7A40010 */ swc1 $f4, 0x10($sp) -/* 040074 7F00B544 0C005CDC */ jal guLookAtReflect -/* 040078 7F00B548 E7A60024 */ swc1 $f6, 0x24($sp) -/* 04007C 7F00B54C 02801025 */ move $v0, $s4 -/* 040080 7F00B550 26940008 */ addiu $s4, $s4, 8 -/* 040084 7F00B554 3C0ABC00 */ lui $t2, (0xBC000002 >> 16) # lui $t2, 0xbc00 -/* 040088 7F00B558 3C0B8000 */ lui $t3, (0x80000040 >> 16) # lui $t3, 0x8000 -/* 04008C 7F00B55C 356B0040 */ ori $t3, (0x80000040 & 0xFFFF) # ori $t3, $t3, 0x40 -/* 040090 7F00B560 354A0002 */ ori $t2, (0xBC000002 & 0xFFFF) # ori $t2, $t2, 2 -/* 040094 7F00B564 02801825 */ move $v1, $s4 -/* 040098 7F00B568 26940008 */ addiu $s4, $s4, 8 -/* 04009C 7F00B56C AC4A0000 */ sw $t2, ($v0) -/* 0400A0 7F00B570 AC4B0004 */ sw $t3, 4($v0) -/* 0400A4 7F00B574 3C0C0386 */ lui $t4, (0x03860010 >> 16) # lui $t4, 0x386 -/* 0400A8 7F00B578 3C0D8003 */ lui $t5, %hi(RGBA_8002A978) -/* 0400AC 7F00B57C 25ADA978 */ addiu $t5, %lo(RGBA_8002A978) # addiu $t5, $t5, -0x5688 -/* 0400B0 7F00B580 358C0010 */ ori $t4, (0x03860010 & 0xFFFF) # ori $t4, $t4, 0x10 -/* 0400B4 7F00B584 02802025 */ move $a0, $s4 -/* 0400B8 7F00B588 26940008 */ addiu $s4, $s4, 8 -/* 0400BC 7F00B58C AC6C0000 */ sw $t4, ($v1) -/* 0400C0 7F00B590 AC6D0004 */ sw $t5, 4($v1) -/* 0400C4 7F00B594 3C180388 */ lui $t8, (0x03880010 >> 16) # lui $t8, 0x388 -/* 0400C8 7F00B598 3C0F8003 */ lui $t7, %hi(RGBA_8002A970) -/* 0400CC 7F00B59C 25EFA970 */ addiu $t7, %lo(RGBA_8002A970) # addiu $t7, $t7, -0x5690 -/* 0400D0 7F00B5A0 37180010 */ ori $t8, (0x03880010 & 0xFFFF) # ori $t8, $t8, 0x10 -/* 0400D4 7F00B5A4 02802825 */ move $a1, $s4 -/* 0400D8 7F00B5A8 AC980000 */ sw $t8, ($a0) -/* 0400DC 7F00B5AC AC8F0004 */ sw $t7, 4($a0) -/* 0400E0 7F00B5B0 3C190384 */ lui $t9, (0x03840010 >> 16) # lui $t9, 0x384 -/* 0400E4 7F00B5B4 37390010 */ ori $t9, (0x03840010 & 0xFFFF) # ori $t9, $t9, 0x10 -/* 0400E8 7F00B5B8 44800000 */ mtc1 $zero, $f0 -/* 0400EC 7F00B5BC ACB90000 */ sw $t9, ($a1) -/* 0400F0 7F00B5C0 ACB00004 */ sw $s0, 4($a1) -/* 0400F4 7F00B5C4 26940008 */ addiu $s4, $s4, 8 -/* 0400F8 7F00B5C8 02804025 */ move $t0, $s4 -/* 0400FC 7F00B5CC 3C0E0382 */ lui $t6, (0x03820010 >> 16) # lui $t6, 0x382 -/* 040100 7F00B5D0 35CE0010 */ ori $t6, (0x03820010 & 0xFFFF) # ori $t6, $t6, 0x10 -/* 040104 7F00B5D4 26090010 */ addiu $t1, $s0, 0x10 -/* 040108 7F00B5D8 AD090004 */ sw $t1, 4($t0) -/* 04010C 7F00B5DC AD0E0000 */ sw $t6, ($t0) -/* 040110 7F00B5E0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 040114 7F00B5E4 44814000 */ mtc1 $at, $f8 -/* 040118 7F00B5E8 27B100F8 */ addiu $s1, $sp, 0xf8 -/* 04011C 7F00B5EC 3C07453B */ lui $a3, (0x453B8000 >> 16) # lui $a3, 0x453b -/* 040120 7F00B5F0 44050000 */ mfc1 $a1, $f0 -/* 040124 7F00B5F4 44060000 */ mfc1 $a2, $f0 -/* 040128 7F00B5F8 26940008 */ addiu $s4, $s4, 8 -/* 04012C 7F00B5FC 34E78000 */ ori $a3, (0x453B8000 & 0xFFFF) # ori $a3, $a3, 0x8000 -/* 040130 7F00B600 02202025 */ move $a0, $s1 -/* 040134 7F00B604 E7A00024 */ swc1 $f0, 0x24($sp) -/* 040138 7F00B608 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 04013C 7F00B60C E7A00018 */ swc1 $f0, 0x18($sp) -/* 040140 7F00B610 E7A00014 */ swc1 $f0, 0x14($sp) -/* 040144 7F00B614 E7A00010 */ swc1 $f0, 0x10($sp) -/* 040148 7F00B618 0FC165A5 */ jal matrix_4x4_7F059694 -/* 04014C 7F00B61C E7A80020 */ swc1 $f8, 0x20($sp) -/* 040150 7F00B620 3C138003 */ lui $s3, %hi(logoinst) -/* 040154 7F00B624 2673A958 */ addiu $s3, %lo(logoinst) # addiu $s3, $s3, -0x56a8 -/* 040158 7F00B628 8E6A0000 */ lw $t2, ($s3) -/* 04015C 7F00B62C AFB10140 */ sw $s1, 0x140($sp) -/* 040160 7F00B630 8D4B0008 */ lw $t3, 8($t2) -/* 040164 7F00B634 8564000E */ lh $a0, 0xe($t3) -/* 040168 7F00B638 00046180 */ sll $t4, $a0, 6 -/* 04016C 7F00B63C 0FC2F5C5 */ jal dynAllocate -/* 040170 7F00B640 01802025 */ move $a0, $t4 -/* 040174 7F00B644 3C018005 */ lui $at, %hi(D_80051A18) -/* 040178 7F00B648 AFA20150 */ sw $v0, 0x150($sp) -/* 04017C 7F00B64C C42C1A18 */ lwc1 $f12, %lo(D_80051A18)($at) -/* 040180 7F00B650 0FC1629F */ jal matrix_scalar_multiply -/* 040184 7F00B654 02202825 */ move $a1, $s1 -/* 040188 7F00B658 02202025 */ move $a0, $s1 -/* 04018C 7F00B65C 0FC16008 */ jal matrix_4x4_copy -/* 040190 7F00B660 8FA50150 */ lw $a1, 0x150($sp) -/* 040194 7F00B664 8FAD0150 */ lw $t5, 0x150($sp) -/* 040198 7F00B668 8E780000 */ lw $t8, ($s3) -/* 04019C 7F00B66C AF0D000C */ sw $t5, 0xc($t8) -/* 0401A0 7F00B670 0FC1BBF1 */ jal sub_GAME_7F06EFC4 -/* 0401A4 7F00B674 8E640000 */ lw $a0, ($s3) -/* 0401A8 7F00B678 240F0003 */ li $t7, 3 -/* 0401AC 7F00B67C AFAF0148 */ sw $t7, 0x148($sp) -/* 0401B0 7F00B680 AFA00144 */ sw $zero, 0x144($sp) -/* 0401B4 7F00B684 AFB4014C */ sw $s4, 0x14c($sp) -/* 0401B8 7F00B688 02402025 */ move $a0, $s2 -/* 0401BC 7F00B68C 0FC1D1A1 */ jal subdraw -/* 0401C0 7F00B690 8E650000 */ lw $a1, ($s3) -/* 0401C4 7F00B694 8E620000 */ lw $v0, ($s3) -/* 0401C8 7F00B698 8FB4014C */ lw $s4, 0x14c($sp) -/* 0401CC 7F00B69C 00008025 */ move $s0, $zero -/* 0401D0 7F00B6A0 8C590008 */ lw $t9, 8($v0) -/* 0401D4 7F00B6A4 00008825 */ move $s1, $zero -/* 0401D8 7F00B6A8 27B2005C */ addiu $s2, $sp, 0x5c -/* 0401DC 7F00B6AC 872E000E */ lh $t6, 0xe($t9) -/* 0401E0 7F00B6B0 59C00014 */ blezl $t6, .L7F00B704 -/* 0401E4 7F00B6B4 8FBF004C */ lw $ra, 0x4c($sp) -/* 0401E8 7F00B6B8 8C49000C */ lw $t1, 0xc($v0) -.L7F00B6BC: -/* 0401EC 7F00B6BC 02402825 */ move $a1, $s2 -/* 0401F0 7F00B6C0 0FC16008 */ jal matrix_4x4_copy -/* 0401F4 7F00B6C4 01312021 */ addu $a0, $t1, $s1 -/* 0401F8 7F00B6C8 8E6A0000 */ lw $t2, ($s3) -/* 0401FC 7F00B6CC 00106180 */ sll $t4, $s0, 6 -/* 040200 7F00B6D0 02402025 */ move $a0, $s2 -/* 040204 7F00B6D4 8D4B000C */ lw $t3, 0xc($t2) -/* 040208 7F00B6D8 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 04020C 7F00B6DC 016C2821 */ addu $a1, $t3, $t4 -/* 040210 7F00B6E0 8E620000 */ lw $v0, ($s3) -/* 040214 7F00B6E4 26100001 */ addiu $s0, $s0, 1 -/* 040218 7F00B6E8 26310040 */ addiu $s1, $s1, 0x40 -/* 04021C 7F00B6EC 8C4D0008 */ lw $t5, 8($v0) -/* 040220 7F00B6F0 85B8000E */ lh $t8, 0xe($t5) -/* 040224 7F00B6F4 0218082A */ slt $at, $s0, $t8 -/* 040228 7F00B6F8 5420FFF0 */ bnezl $at, .L7F00B6BC -/* 04022C 7F00B6FC 8C49000C */ lw $t1, 0xc($v0) -/* 040230 7F00B700 8FBF004C */ lw $ra, 0x4c($sp) -.L7F00B704: -/* 040234 7F00B704 02801025 */ move $v0, $s4 -/* 040238 7F00B708 8FB40048 */ lw $s4, 0x48($sp) -/* 04023C 7F00B70C 8FB00038 */ lw $s0, 0x38($sp) -/* 040240 7F00B710 8FB1003C */ lw $s1, 0x3c($sp) -/* 040244 7F00B714 8FB20040 */ lw $s2, 0x40($sp) -/* 040248 7F00B718 8FB30044 */ lw $s3, 0x44($sp) -/* 04024C 7F00B71C 03E00008 */ jr $ra -/* 040250 7F00B720 27BD0180 */ addiu $sp, $sp, 0x180 -) -#endif -#ifdef NONMATCHING -void disable_all_switches(void *arg0) +void disable_all_switches(Model *arg0) { - s32 temp_s0; - void *temp_t7; - void *phi_v1; - s32 phi_s1; - s32 phi_a2; - s32 phi_s0; - s32 phi_a2_2; - - phi_v1 = arg0->unk8; - phi_s1 = 0; - phi_a2 = arg0->unk8->unkC; - phi_s0 = 0; - if (arg0->unk8->unkC > 0) + s32 i; + ModelNode *mnode; + + for (i = 0; i < arg0->obj->numSwitches; i++) { -loop_1: - temp_t7 = phi_v1->unk8 + phi_s1; - phi_a2_2 = phi_a2; - phi_v1 = phi_v1; - if (*temp_t7 != 0) - { - phi_a2_2 = phi_a2; - phi_v1 = phi_v1; - if (0x12 == (**temp_t7 & 0xff)) - { - *modelGetNodeRwData(arg0, *temp_t7, phi_a2) = 0; - phi_a2_2 = arg0->unk8->unkC; - phi_v1 = arg0->unk8; - } - } - temp_s0 = phi_s0 + 1; - phi_s1 = phi_s1 + 4; - phi_a2 = phi_a2_2; - phi_s0 = temp_s0; - if (temp_s0 < phi_a2_2) + mnode = arg0->obj->Switches[i]; + + if (mnode != NULL && (mnode->Opcode & 0xff) == 0x12) { - goto loop_1; + union ModelRwData *unmrd; + struct ModelRwData_SwitchRecord *srecord; + + unmrd = modelGetNodeRwData(arg0, mnode); + srecord = (struct ModelRwData_SwitchRecord *)unmrd; + srecord->visible = 0; } } } -#else -GLOBAL_ASM( -.text -glabel disable_all_switches -/* 040254 7F00B724 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 040258 7F00B728 AFBF0024 */ sw $ra, 0x24($sp) -/* 04025C 7F00B72C AFB30020 */ sw $s3, 0x20($sp) -/* 040260 7F00B730 AFB2001C */ sw $s2, 0x1c($sp) -/* 040264 7F00B734 AFB10018 */ sw $s1, 0x18($sp) -/* 040268 7F00B738 AFB00014 */ sw $s0, 0x14($sp) -/* 04026C 7F00B73C 8C830008 */ lw $v1, 8($a0) -/* 040270 7F00B740 00809025 */ move $s2, $a0 -/* 040274 7F00B744 00008025 */ move $s0, $zero -/* 040278 7F00B748 8466000C */ lh $a2, 0xc($v1) -/* 04027C 7F00B74C 00008825 */ move $s1, $zero -/* 040280 7F00B750 24130012 */ li $s3, 18 -/* 040284 7F00B754 58C00014 */ blezl $a2, .L7F00B7A8 -/* 040288 7F00B758 8FBF0024 */ lw $ra, 0x24($sp) -.L7F00B75C: -/* 04028C 7F00B75C 8C6E0008 */ lw $t6, 8($v1) -/* 040290 7F00B760 01D17821 */ addu $t7, $t6, $s1 -/* 040294 7F00B764 8DE50000 */ lw $a1, ($t7) -/* 040298 7F00B768 50A0000B */ beql $a1, $zero, .L7F00B798 -/* 04029C 7F00B76C 26100001 */ addiu $s0, $s0, 1 -/* 0402A0 7F00B770 94B80000 */ lhu $t8, ($a1) -/* 0402A4 7F00B774 331900FF */ andi $t9, $t8, 0xff -/* 0402A8 7F00B778 56790007 */ bnel $s3, $t9, .L7F00B798 -/* 0402AC 7F00B77C 26100001 */ addiu $s0, $s0, 1 -/* 0402B0 7F00B780 0FC1B1E7 */ jal modelGetNodeRwData -/* 0402B4 7F00B784 02402025 */ move $a0, $s2 -/* 0402B8 7F00B788 AC400000 */ sw $zero, ($v0) -/* 0402BC 7F00B78C 8E430008 */ lw $v1, 8($s2) -/* 0402C0 7F00B790 8466000C */ lh $a2, 0xc($v1) -/* 0402C4 7F00B794 26100001 */ addiu $s0, $s0, 1 -.L7F00B798: -/* 0402C8 7F00B798 0206082A */ slt $at, $s0, $a2 -/* 0402CC 7F00B79C 1420FFEF */ bnez $at, .L7F00B75C -/* 0402D0 7F00B7A0 26310004 */ addiu $s1, $s1, 4 -/* 0402D4 7F00B7A4 8FBF0024 */ lw $ra, 0x24($sp) -.L7F00B7A8: -/* 0402D8 7F00B7A8 8FB00014 */ lw $s0, 0x14($sp) -/* 0402DC 7F00B7AC 8FB10018 */ lw $s1, 0x18($sp) -/* 0402E0 7F00B7B0 8FB2001C */ lw $s2, 0x1c($sp) -/* 0402E4 7F00B7B4 8FB30020 */ lw $s3, 0x20($sp) -/* 0402E8 7F00B7B8 03E00008 */ jr $ra -/* 0402EC 7F00B7BC 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif void set_item_visibility_in_objinstance(Model* objinstance, s32 item, s32 mode) @@ -2779,115 +2037,76 @@ void set_item_visibility_in_objinstance(Model* objinstance, s32 item, s32 mode) void select_load_bond_picture(Model *objinstance, u32 bondID) { - set_item_visibility_in_objinstance(objinstance,8,1); //brosnan picture - set_item_visibility_in_objinstance(objinstance,9,0); - set_item_visibility_in_objinstance(objinstance,10,0); - set_item_visibility_in_objinstance(objinstance,0xb,0); - set_item_visibility_in_objinstance(objinstance,0xf,1); //bigger brosnan picture - set_item_visibility_in_objinstance(objinstance,0x10,0); - set_item_visibility_in_objinstance(objinstance,0x11,0); - set_item_visibility_in_objinstance(objinstance,0x12,0); + set_item_visibility_in_objinstance(objinstance,SW_BROSNAN,1); //brosnan picture + set_item_visibility_in_objinstance(objinstance,SW_CONNERY,0); + set_item_visibility_in_objinstance(objinstance,SW_DALTON,0); + set_item_visibility_in_objinstance(objinstance,SW_MOORE,0); + set_item_visibility_in_objinstance(objinstance,SW_BROSNANCOVER,1); //bigger brosnan picture + set_item_visibility_in_objinstance(objinstance,SW_CONNERYCOVER,0); + set_item_visibility_in_objinstance(objinstance,SW_DALTONCOVER,0); + set_item_visibility_in_objinstance(objinstance,SW_MOORECOVER,0); } +struct unk_walletbond_struct { + s32 unk00; + s32 unk04; + s32 unk08; + s32 unk0C; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; +}; +struct unk_walletbond_struct_b { + s32 unk00; + struct unk_walletbond_struct *unk04; +}; - -#ifdef NONMATCHING +/** + * Address 0x7F00B8AC NTSC +*/ void load_walletbond(void) { - s32 temp_ret; - void *temp_s0; - void *phi_s0; + ModelNode *mnode; + s32 i; - if (walletinst[0] == 0) + if (walletinst[0] == NULL) { - load_object_fill_header(PitemZ_entries.unkD08, PitemZ_entries.unkD0C, ptr_logo_and_walletbond_DL, 0xa000, 0); - modelCalculateRwDataLen(PitemZ_entries.unkD08); - phi_s0 = &walletinst[0]; -loop_2: - temp_ret = get_aircraft_obj_instance_controller(PitemZ_entries.unkD08); - *phi_s0 = temp_ret; - modelSetScale(temp_ret, 0x3f800000); - temp_s0 = phi_s0 + 4; - phi_s0 = temp_s0; - if (temp_s0 != &D_8002A96C) + load_object_fill_header( + PitemZ_entries[PROP_WALLETBOND].header, + (s8*)PitemZ_entries[PROP_WALLETBOND].filename, + (u8*)ptr_logo_and_walletbond_DL, + 0xA000, + 0); + + modelCalculateRwDataLen(PitemZ_entries[PROP_WALLETBOND].header); + + for (i = 0; i < 4; i++) { - goto loop_2; + walletinst[i] = get_aircraft_obj_instance_controller(PitemZ_entries[PROP_WALLETBOND].header); + modelSetScale(walletinst[i], 1.0f); } - if (PitemZ_entries.unkD08->unk8->unk54 != 0) + + mnode = PitemZ_entries[PROP_WALLETBOND].header->Switches[0x15]; + + if (mnode != NULL) { - bgLoadFromDynamicCCRMLUT(PitemZ_entries.unkD08->unk8->unk54->unk4->unk1C + (PitemZ_entries.unkD08->unk8->unk54->unk4->unk0 & 0xffffff), 0, 8); + struct unk_walletbond_struct *srecord; + struct unk_walletbond_struct_b *b; + s32 arg0; + + b = (struct unk_walletbond_struct_b *)mnode; + srecord = b->unk04; + + arg0 = srecord->unk1C + (srecord->unk00 & 0xffffff); + bgLoadFromDynamicCCRMLUT(arg0, 0, 8); } } } -#else -GLOBAL_ASM( -.text -glabel load_walletbond -/* 0403DC 7F00B8AC 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0403E0 7F00B8B0 3C0E8003 */ lui $t6, %hi(walletinst) -/* 0403E4 7F00B8B4 8DCEA95C */ lw $t6, %lo(walletinst)($t6) -/* 0403E8 7F00B8B8 AFBF0034 */ sw $ra, 0x34($sp) -/* 0403EC 7F00B8BC AFB20030 */ sw $s2, 0x30($sp) -/* 0403F0 7F00B8C0 AFB1002C */ sw $s1, 0x2c($sp) -/* 0403F4 7F00B8C4 AFB00028 */ sw $s0, 0x28($sp) -/* 0403F8 7F00B8C8 15C0002A */ bnez $t6, .L7F00B974 -/* 0403FC 7F00B8CC F7B40020 */ sdc1 $f20, 0x20($sp) -/* 040400 7F00B8D0 3C128004 */ lui $s2, %hi(PitemZ_entries) -/* 040404 7F00B8D4 2652A228 */ addiu $s2, %lo(PitemZ_entries) # addiu $s2, $s2, -0x5dd8 -/* 040408 7F00B8D8 3C068003 */ lui $a2, %hi(ptr_logo_and_walletbond_DL) -/* 04040C 7F00B8DC 8CC6A950 */ lw $a2, %lo(ptr_logo_and_walletbond_DL)($a2) -/* 040410 7F00B8E0 8E440D08 */ lw $a0, 0xd08($s2) -/* 040414 7F00B8E4 8E450D0C */ lw $a1, 0xd0c($s2) -/* 040418 7F00B8E8 3407A000 */ li $a3, 40960 -/* 04041C 7F00B8EC 0FC1D929 */ jal load_object_fill_header -/* 040420 7F00B8F0 AFA00010 */ sw $zero, 0x10($sp) -/* 040424 7F00B8F4 0FC1D73D */ jal modelCalculateRwDataLen -/* 040428 7F00B8F8 8E440D08 */ lw $a0, 0xd08($s2) -/* 04042C 7F00B8FC 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 040430 7F00B900 3C108003 */ lui $s0, %hi(walletinst) -/* 040434 7F00B904 3C118003 */ lui $s1, %hi(walletinst+0x10) -/* 040438 7F00B908 4481A000 */ mtc1 $at, $f20 -/* 04043C 7F00B90C 2631A96C */ addiu $s1, %lo(walletinst+0x10) # addiu $s1, $s1, -0x5694 -/* 040440 7F00B910 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -.L7F00B914: -/* 040444 7F00B914 0FC1B08F */ jal get_aircraft_obj_instance_controller -/* 040448 7F00B918 8E440D08 */ lw $a0, 0xd08($s2) -/* 04044C 7F00B91C 4405A000 */ mfc1 $a1, $f20 -/* 040450 7F00B920 AE020000 */ sw $v0, ($s0) -/* 040454 7F00B924 0FC1B39E */ jal modelSetScale -/* 040458 7F00B928 00402025 */ move $a0, $v0 -/* 04045C 7F00B92C 26100004 */ addiu $s0, $s0, 4 -/* 040460 7F00B930 1611FFF8 */ bne $s0, $s1, .L7F00B914 -/* 040464 7F00B934 00000000 */ nop -/* 040468 7F00B938 8E4F0D08 */ lw $t7, 0xd08($s2) -/* 04046C 7F00B93C 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* 040470 7F00B940 8DF80008 */ lw $t8, 8($t7) -/* 040474 7F00B944 8F030054 */ lw $v1, 0x54($t8) -/* 040478 7F00B948 5060000B */ beql $v1, $zero, .L7F00B978 -/* 04047C 7F00B94C 8FBF0034 */ lw $ra, 0x34($sp) -/* 040480 7F00B950 8C620004 */ lw $v0, 4($v1) -/* 040484 7F00B954 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* 040488 7F00B958 00002825 */ move $a1, $zero -/* 04048C 7F00B95C 8C480000 */ lw $t0, ($v0) -/* 040490 7F00B960 8C59001C */ lw $t9, 0x1c($v0) -/* 040494 7F00B964 24060008 */ li $a2, 8 -/* 040498 7F00B968 01014824 */ and $t1, $t0, $at -/* 04049C 7F00B96C 0FC2E990 */ jal bgLoadFromDynamicCCRMLUT -/* 0404A0 7F00B970 03292021 */ addu $a0, $t9, $t1 -.L7F00B974: -/* 0404A4 7F00B974 8FBF0034 */ lw $ra, 0x34($sp) -.L7F00B978: -/* 0404A8 7F00B978 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 0404AC 7F00B97C 8FB00028 */ lw $s0, 0x28($sp) -/* 0404B0 7F00B980 8FB1002C */ lw $s1, 0x2c($sp) -/* 0404B4 7F00B984 8FB20030 */ lw $s2, 0x30($sp) -/* 0404B8 7F00B988 03E00008 */ jr $ra -/* 0404BC 7F00B98C 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif + @@ -2897,7 +2116,7 @@ void sub_GAME_7F00B990(void) for (i = 0; i < 4; i++) { if (walletinst[i] == NULL) { continue; } - set_aircraft_obj_inst_scale_to_zero(walletinst[i]); + clear_aircraft_model_obj(walletinst[i]); walletinst[i] = NULL; } } @@ -2907,16 +2126,15 @@ void sub_GAME_7F00B990(void) //******************************************************************************************************** //FILE SELECT //******************************************************************************************************** -#ifdef NONMATCHING void init_menu05_fileselect(void) { - s32 sp24; - Gfx* sp20; + s32 sp24 = 0x6e000; + Gfx* sp20 = (s32)(ptr_logo_and_walletbond_DL) + (s32)(4096*10); int i; prev_keypresses = 0; - sp24 = 0x6e000; - sp20 = ptr_logo_and_walletbond_DL + 0xa000; + + if (selected_folder_num < 0) { selected_folder_num = 0; @@ -2937,87 +2155,16 @@ void init_menu05_fileselect(void) } g_AppendCheatSinglePlayer = FALSE; g_AppendCheatMultiPlayer = FALSE; - //return temp_v0; } -#else -GLOBAL_ASM( -.text -glabel init_menu05_fileselect -/* 040518 7F00B9E8 3C0F8003 */ lui $t7, %hi(ptr_logo_and_walletbond_DL) -/* 04051C 7F00B9EC 8DEFA950 */ lw $t7, %lo(ptr_logo_and_walletbond_DL)($t7) -/* 040520 7F00B9F0 3401A000 */ li $at, 40960 -/* 040524 7F00B9F4 3C028003 */ lui $v0, %hi(selected_folder_num) -/* 040528 7F00B9F8 01E1C021 */ addu $t8, $t7, $at -/* 04052C 7F00B9FC 3C018003 */ lui $at, %hi(prev_keypresses) -/* 040530 7F00BA00 2442A8E8 */ addiu $v0, %lo(selected_folder_num) # addiu $v0, $v0, -0x5718 -/* 040534 7F00BA04 AC20A934 */ sw $zero, %lo(prev_keypresses)($at) -/* 040538 7F00BA08 8C590000 */ lw $t9, ($v0) -/* 04053C 7F00BA0C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 040540 7F00BA10 3C0E0006 */ lui $t6, (0x0006E000 >> 16) # lui $t6, 6 -/* 040544 7F00BA14 35CEE000 */ ori $t6, (0x0006E000 & 0xFFFF) # ori $t6, $t6, 0xe000 -/* 040548 7F00BA18 AFBF0014 */ sw $ra, 0x14($sp) -/* 04054C 7F00BA1C AFAE0024 */ sw $t6, 0x24($sp) -/* 040550 7F00BA20 07210002 */ bgez $t9, .L7F00BA2C -/* 040554 7F00BA24 AFB80020 */ sw $t8, 0x20($sp) -/* 040558 7F00BA28 AC400000 */ sw $zero, ($v0) -.L7F00BA2C: -/* 04055C 7F00BA2C 3C018003 */ lui $at, %hi(tab_next_selected) -/* 040560 7F00BA30 AC20A8D4 */ sw $zero, %lo(tab_next_selected)($at) -/* 040564 7F00BA34 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 040568 7F00BA38 AC20A8D8 */ sw $zero, %lo(tab_prev_selected)($at) -/* 04056C 7F00BA3C 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040570 7F00BA40 2408FFFF */ li $t0, -1 -/* 040574 7F00BA44 AC28A91C */ sw $t0, %lo(folder_selected_for_deletion)($at) -/* 040578 7F00BA48 3C018003 */ lui $at, %hi(folder_selected_for_deletion_choice) -/* 04057C 7F00BA4C 24090001 */ li $t1, 1 -/* 040580 7F00BA50 AC29A920 */ sw $t1, %lo(folder_selected_for_deletion_choice)($at) -/* 040584 7F00BA54 27A40020 */ addiu $a0, $sp, 0x20 -/* 040588 7F00BA58 0FC02379 */ jal sub_GAME_7F008DE4 -/* 04058C 7F00BA5C 27A50024 */ addiu $a1, $sp, 0x24 -/* 040590 7F00BA60 0FC02E2B */ jal load_walletbond -/* 040594 7F00BA64 00000000 */ nop -/* 040598 7F00BA68 3C0A8003 */ lui $t2, %hi(maybe_is_in_menu) -/* 04059C 7F00BA6C 8D4AA93C */ lw $t2, %lo(maybe_is_in_menu)($t2) -/* 0405A0 7F00BA70 11400005 */ beqz $t2, .L7F00BA88 -/* 0405A4 7F00BA74 00000000 */ nop -/* 0405A8 7F00BA78 0C001B9F */ jal musicTrack1Play -/* 0405AC 7F00BA7C 24040017 */ li $a0, 23 -/* 0405B0 7F00BA80 3C018003 */ lui $at, %hi(maybe_is_in_menu) -/* 0405B4 7F00BA84 AC20A93C */ sw $zero, %lo(maybe_is_in_menu)($at) -.L7F00BA88: -/* 0405B8 7F00BA88 3C018003 */ lui $at, %hi(g_MenuTimer) -/* 0405BC 7F00BA8C AC20A8CC */ sw $zero, %lo(g_MenuTimer)($at) -/* 0405C0 7F00BA90 3C018007 */ lui $at, %hi(g_CheatActivated + 1) -/* 0405C4 7F00BA94 3C028007 */ lui $v0, %hi(g_CheatActivated + 3) -/* 0405C8 7F00BA98 3C038007 */ lui $v1, %hi(g_CheatActivated + 75) -/* 0405CC 7F00BA9C 246396EB */ addiu $v1, %lo(g_CheatActivated + 75) # addiu $v1, $v1, -0x6915 -/* 0405D0 7F00BAA0 244296A3 */ addiu $v0, %lo(g_CheatActivated + 3) # addiu $v0, $v0, -0x695d -/* 0405D4 7F00BAA4 A02096A1 */ sb $zero, %lo(g_CheatActivated + 1)($at) -/* 0405D8 7F00BAA8 A02096A2 */ sb $zero, %lo(g_CheatActivated + 2)($at) -.L7F00BAAC: -/* 0405DC 7F00BAAC 24420004 */ addiu $v0, $v0, 4 -/* 0405E0 7F00BAB0 A040FFFD */ sb $zero, -3($v0) -/* 0405E4 7F00BAB4 A040FFFE */ sb $zero, -2($v0) -/* 0405E8 7F00BAB8 A040FFFF */ sb $zero, -1($v0) -/* 0405EC 7F00BABC 1443FFFB */ bne $v0, $v1, .L7F00BAAC -/* 0405F0 7F00BAC0 A040FFFC */ sb $zero, -4($v0) -/* 0405F4 7F00BAC4 8FBF0014 */ lw $ra, 0x14($sp) -/* 0405F8 7F00BAC8 3C018003 */ lui $at, %hi(g_AppendCheatSinglePlayer) -/* 0405FC 7F00BACC AC20A900 */ sw $zero, %lo(g_AppendCheatSinglePlayer)($at) -/* 040600 7F00BAD0 3C018003 */ lui $at, %hi(g_AppendCheatMultiPlayer) -/* 040604 7F00BAD4 AC20A904 */ sw $zero, %lo(g_AppendCheatMultiPlayer)($at) -/* 040608 7F00BAD8 03E00008 */ jr $ra -/* 04060C 7F00BADC 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif - -void update_menu05_filesel(void) { - if ((menu_update == 0) || (maybe_prev_menu == 0)) { - sub_GAME_7F00B990(); - } +void update_menu05_filesel(void) +{ + if ((menu_update == MENU_LEGAL_SCREEN) || (maybe_prev_menu == MENU_LEGAL_SCREEN)) + { + sub_GAME_7F00B990(); + } } @@ -3052,1333 +2199,216 @@ void toggle_deletion_menu_for_folder(int index) -#ifdef NONMATCHING +// address 0x7F00BBCC NTSC s32 interface_menu05_fileselect(void) { - s32 spC8; - s32 sp88; - s32 sp80; - s32 sp7C; - s32 sp78; - s32 sp74; - f32 sp6C; - f32 sp64; - s32 sp60; - s32 sp5C; - void *sp54; - s32 temp_ret; - s32 temp_s2; - s32 temp_s2_2; - void *temp_a0; - void *phi_s0; - void *phi_s1; - s32 phi_s2; - s32 phi_a0; - s32 phi_a0_2; - void *phi_s0_2; - void *phi_s1_2; - s32 phi_s2_2; - s32 phi_return; - + s32 i1; + s32 i2; + Mtxf spC8; + Mtxf sp88; + struct coord3d *sp54; + if (((((joyGetButtonsPressedThisFrame(PLAYER_1, ANY_BUTTON) != 0) || (joyGetStickX(0) < -5)) || (joyGetStickX(0) >= 6)) || (joyGetStickY(0) < -5)) || (joyGetStickY(0) >= 6)) { g_MenuTimer = 0; } else { - g_MenuTimer = (s32) (g_MenuTimer + g_ClockTimer); + g_MenuTimer += g_ClockTimer; } - viSetFovY(0x42700000); - viSetAspect(D_80051A1C); - viSetZRange(0x42c80000, D_80051A20); + + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); - sp54 = &D_8002AB94; - phi_s0 = &walletinst[0]; - phi_s1 = &dword_CODE_bss_80069620; - phi_s2 = 0; -loop_8: - matrix_4x4_7F059694(&spC8, 0, 0, 0x457a0000, 1.0f); - matrix_4x4_set_identity_and_position(sp54, &sp88); - matrix_scalar_multiply(D_80051A24, &sp88); - matrix_4x4_multiply_in_place(&spC8, &sp88); - (*phi_s0)->unkC = dynAllocate((*phi_s0)->unk8->unkE << 6); - matrix_4x4_copy(&sp88, (*phi_s0)->unkC); - temp_a0 = *phi_s0; - phi_s1->unk0 = (f32) temp_a0->unkC->unk30; - phi_s1->unk4 = (f32) temp_a0->unkC->unk34; - phi_s1->unk8 = (f32) temp_a0->unkC->unk38; - disable_all_switches(temp_a0); - select_load_bond_picture(*phi_s0, fileGetBondForFolder(phi_s2)); - set_item_visibility_in_objinstance(*phi_s0, 0xe, 1); - set_item_visibility_in_objinstance(*phi_s0, 0xd, 1); - temp_s2 = phi_s2 + 1; - sp54 = (void *) (sp54 + 0xc); - phi_s0 = phi_s0 + 4; - phi_s1 = phi_s1 + 0xc; - phi_s2 = temp_s2; - if (temp_s2 != 4) + + for (i1 = 0; i1 < 4; i1++) { - goto loop_8; + sp54 = &D_8002AB94[i1]; + + matrix_4x4_7F059694(&spC8, 0.0f, 0.0f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + matrix_4x4_set_identity_and_position(sp54, &sp88); + matrix_scalar_multiply(0.37f, (f32*)&sp88); + matrix_4x4_multiply_in_place(&spC8, &sp88); + + walletinst[i1]->render_pos = dynAllocate(walletinst[i1]->obj->numMatrices << 6); + matrix_4x4_copy(&sp88, &walletinst[i1]->render_pos->pos); + + dword_CODE_bss_80069620[i1].f[0] = walletinst[i1]->render_pos->pos.m[3][0]; + dword_CODE_bss_80069620[i1].f[1] = walletinst[i1]->render_pos->pos.m[3][1]; + dword_CODE_bss_80069620[i1].f[2] = walletinst[i1]->render_pos->pos.m[3][2]; + + disable_all_switches(walletinst[i1]); + + select_load_bond_picture(walletinst[i1], fileGetBondForFolder(i1)); + set_item_visibility_in_objinstance(walletinst[i1], 0xE, 1); + set_item_visibility_in_objinstance(walletinst[i1], 0xD, 1); } + if (selected_folder_num >= 0) { - phi_a0 = selected_folder_num; if (selected_folder_num == 0x64) { - selected_folder_num = (s32) selected_folder_num_copy; - phi_a0 = selected_folder_num_copy; + selected_folder_num = selected_folder_num_copy; } - if ((phi_a0 < 0) || (phi_a0 >= 4)) + + if ((selected_folder_num < 0) || (selected_folder_num >= 4)) { selected_folder_num = 0; - phi_a0_2 = 0; } - else - { - } - toggle_deletion_menu_for_folder(phi_a0_2); + toggle_deletion_menu_for_folder(selected_folder_num); selected_folder_num = -1; } + if (folder_selected_for_deletion >= 0) { - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0x222) != 0) && (folder_selected_for_deletion_choice == 0)) + if ((joyGetButtonsPressedThisFrame(0, 0x222U) != 0) && (folder_selected_for_deletion_choice == 0)) { folder_selected_for_deletion_choice = 1; - sndPlaySfx(g_musicSfxBufferPtr, OPTION_CLICK2_SFX, 0); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, OPTION_CLICK2_SFX, NULL); } - else + else if ((joyGetButtonsPressedThisFrame(0, 0x111U) != 0) && (folder_selected_for_deletion_choice != 0)) { - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0x111) != 0) - { - if (folder_selected_for_deletion_choice != 0) - { - folder_selected_for_deletion_choice = 0; - sndPlaySfx(g_musicSfxBufferPtr, OPTION_CLICK2_SFX, 0); - } - } + folder_selected_for_deletion_choice = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, OPTION_CLICK2_SFX, NULL); } - if ((joyGetStickX(0) < -0x2d) && (*&folder_selected_for_deletion_choice == 0)) + if ((joyGetStickX(0) < -0x2D) && (folder_selected_for_deletion_choice == 0)) { - *&folder_selected_for_deletion_choice = 1; - sndPlaySfx(g_musicSfxBufferPtr, OPTION_CLICK2_SFX, 0); + folder_selected_for_deletion_choice = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, OPTION_CLICK2_SFX, NULL); } - else + else if ((joyGetStickX(0) >= 0x2E) && (folder_selected_for_deletion_choice != 0)) { - if (joyGetStickX(0) >= 0x2e) - { - if (*&folder_selected_for_deletion_choice != 0) - { - *&folder_selected_for_deletion_choice = 0; - sndPlaySfx(g_musicSfxBufferPtr, OPTION_CLICK2_SFX, 0); - } - } + folder_selected_for_deletion_choice = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, OPTION_CLICK2_SFX, NULL); } - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0xb000) != 0) + if (joyGetButtonsPressedThisFrame(0, A_BUTTON | Z_TRIG | START_BUTTON) != 0) { - if (*&folder_selected_for_deletion_choice == 0) + if (folder_selected_for_deletion_choice == 0) { - fileDeleteSaveForFolder(folder_selected_for_deletion, 0x76, 0); - sndPlaySfx(g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, 0); + fileDeleteSaveForFolder(folder_selected_for_deletion); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, NULL); } else { - sndPlaySfx(g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, 0); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, NULL); } + toggle_deletion_menu_for_folder(folder_selected_for_deletion); folder_selected_for_deletion = -1; - phi_return = toggle_deletion_menu_for_folder(folder_selected_for_deletion); } - else + else if (joyGetButtonsPressedThisFrame(0, B_BUTTON) != 0) { - temp_ret = joyGetButtonsPressedThisFrame(PLAYER_1, 0x4000); - phi_return = temp_ret; - if (temp_ret != 0) - { - toggle_deletion_menu_for_folder(folder_selected_for_deletion); - folder_selected_for_deletion = -1; - phi_return = sndPlaySfx(g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, 0); - } + toggle_deletion_menu_for_folder(folder_selected_for_deletion); + folder_selected_for_deletion = -1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, NULL); } } else { - phi_s0_2 = 0x80030000 + -0x56a4; - phi_s1_2 = &dword_CODE_bss_80069620; - phi_s2_2 = 0; -loop_38: - sub_GAME_7F03F90C(*phi_s0_2, &sp80, &sp7C, &sp78, &sp74); - sub_GAME_7F03F948(phi_s1_2, &sp7C, &sp74, &sp6C, &sp64); - if (((((sp6C <= cursor_h_pos) && (cursor_h_pos <= sp64)) && (sp70 <= cursor_v_pos)) && (cursor_v_pos <= sp68)) && (joyGetButtonsPressedThisFrame(PLAYER_1, 0xb000) != 0)) + for (i2 = 0; i2 < 4; i2++) { - if (folder_selection_screen_option_icon == 0) - { - selected_folder_num = (s32) phi_s2_2; - sndPlaySfx(g_musicSfxBufferPtr, PAPER_TURN_SFX, 0); - } - else + f32 sp80; + f32 sp7C; + f32 sp78; + f32 sp74; + + struct rectbbox sp64; + + LEVEL_SOLO_SEQUENCE sp60; + DIFFICULTY sp5C; + + sub_GAME_7F03F90C(walletinst[i2], &sp80, &sp7C, &sp78, &sp74); + sub_GAME_7F03F948(&dword_CODE_bss_80069620[i2], &sp7C, &sp74, &sp64.right, &sp64.left); + + if ((sp64.right <= cursor_h_pos) + && (cursor_h_pos <= sp64.left) + && (sp64.down <= cursor_v_pos) + && (cursor_v_pos <= sp64.up)) { - if (folder_selection_screen_option_icon == 1) - { - sub_GAME_7F01EDA0(phi_s2_2); - folder_selection_screen_option_icon = 0; - sndPlaySfx(g_musicSfxBufferPtr, COPY_FILE_SFX, 0); - } - else + fileGetHighestStageDifficultyCompletedForFolder(i2, &sp60, &sp5C); + + if (joyGetButtonsPressedThisFrame(0, A_BUTTON | Z_TRIG | START_BUTTON) != 0) { - if (folder_selection_screen_option_icon == 2) + if (folder_selection_screen_option_icon == 0) { - if (sp60 >= 0) - { - if (sp5C >= 0) - { - folder_selected_for_deletion = (s32) phi_s2_2; - folder_selected_for_deletion_choice = 1; - } - } + selected_folder_num = i2; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, PAPER_TURN_SFX, NULL); + } + else if (folder_selection_screen_option_icon == 1) + { + sub_GAME_7F01EDA0(i2); folder_selection_screen_option_icon = 0; - sndPlaySfx(g_musicSfxBufferPtr, OPTION_CLICK2_SFX, 0); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, COPY_FILE_SFX, NULL); } - } + else if (folder_selection_screen_option_icon == 2) + { + if ((sp60 >= SP_LEVEL_DAM) && (sp5C >= DIFFICULTY_AGENT)) + { + folder_selected_for_deletion = i2; + folder_selected_for_deletion_choice = 1; + } + + folder_selection_screen_option_icon = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, OPTION_CLICK2_SFX, NULL); + } + + break; + } } } - else + + if (joyGetButtonsPressedThisFrame(0, A_BUTTON | Z_TRIG | START_BUTTON) != 0) { - temp_s2_2 = phi_s2_2 + 1; - phi_s0_2 = phi_s0_2 + 4; - phi_s1_2 = phi_s1_2 + 0xc; - phi_s2_2 = temp_s2_2; - if (temp_s2_2 != 4) + if ((folder_option_COPY_bound.left <= cursor_h_pos) + && (cursor_h_pos <= folder_option_COPY_bound.right) + && (folder_option_COPY_bound.up <= cursor_v_pos) + && (cursor_v_pos <= folder_option_COPY_bound.down)) { - goto loop_38; + folder_selection_screen_option_icon = 1; + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, DOOR_LOCK_SFX, NULL); } - } - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0xb000) != 0) - { - if ((((folder_option_COPY_left_bound.unk0 <= cursor_h_pos) && (cursor_h_pos <= folder_option_COPY_left_bound.unk8)) && (folder_option_COPY_left_bound.unk4 <= cursor_v_pos)) && (cursor_v_pos <= folder_option_COPY_left_bound.unkC)) + else if ((folder_option_ERASE_bound.left <= cursor_h_pos) + && (cursor_h_pos <= folder_option_ERASE_bound.right) + && (folder_option_ERASE_bound.up <= cursor_v_pos) + && (cursor_v_pos <= folder_option_ERASE_bound.down)) { - *&folder_selection_screen_option_icon = 1; - sndPlaySfx(*&g_musicSfxBufferPtr, DOOR_LOCK_SFX, 0); + folder_selection_screen_option_icon = 2; + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, DOOR_LOCK_SFX, NULL); } - else + else if (folder_selection_screen_option_icon != 0) { - if ((((folder_option_ERASE_left_bound.unk0 <= cursor_h_pos) && (cursor_h_pos <= folder_option_ERASE_left_bound.unk8)) && (folder_option_ERASE_left_bound.unk4 <= cursor_v_pos)) && (cursor_v_pos <= folder_option_ERASE_left_bound.unkC)) - { - *&folder_selection_screen_option_icon = 2; - sndPlaySfx(*&g_musicSfxBufferPtr, DOOR_LOCK_SFX, 0); - } - else - { - if (*&folder_selection_screen_option_icon != 0) - { - *&folder_selection_screen_option_icon = 0; - sndPlaySfx(*&g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, 0); - } - } + folder_selection_screen_option_icon = 0; + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, NULL); } } - else + else if ((joyGetButtonsPressedThisFrame(0, B_BUTTON) != 0) + && (folder_selection_screen_option_icon != 0)) { - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0x4000) != 0) - { - if (*&folder_selection_screen_option_icon != 0) - { - *&folder_selection_screen_option_icon = 0; - sndPlaySfx(*&g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, 0); - } - } + folder_selection_screen_option_icon = 0; + sndPlaySfx((struct ALBankAlt_s *)g_musicSfxBufferPtr, GUN_M60AMMGUN_3_SFX, NULL); } - phi_return = menu_control_stick_tracking(); + + menu_control_stick_tracking(); } + if (selected_folder_num >= 0) { - set_menu_to_mode(MENU_MODE_SELECT, 0); - return setCursorPOSforMode(0); + frontChangeMenu(MENU_MODE_SELECT, 0); + setCursorPOSforMode(0); + + return; } - if (g_MenuTimer >= 0x709) + +#if defined(VERSION_EU) + if (g_MenuTimer >= 1501) // PAL (50fps): 30 seconds + 1 frame +#else + if (g_MenuTimer >= 1801) // NTSC (60fps): 30 seconds + 1 frame +#endif { - phi_return = set_menu_to_mode(MENU_LEGAL_SCREEN, 1); + frontChangeMenu(MENU_LEGAL_SCREEN, 1); } - return phi_return; } -#else - -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.late_rodata -glabel D_80051A1C -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_80051A20 -.word 0x461C4000 /* 10000.0;*/ -glabel D_80051A24 -.word 0x3EBD70A4 /* 0.37;*/ -.text -glabel interface_menu05_fileselect -/* 0406FC 7F00BBCC 27BDFEF0 */ addiu $sp, $sp, -0x110 -/* 040700 7F00BBD0 AFBF0044 */ sw $ra, 0x44($sp) -/* 040704 7F00BBD4 AFB30040 */ sw $s3, 0x40($sp) -/* 040708 7F00BBD8 AFB2003C */ sw $s2, 0x3c($sp) -/* 04070C 7F00BBDC AFB10038 */ sw $s1, 0x38($sp) -/* 040710 7F00BBE0 AFB00034 */ sw $s0, 0x34($sp) -/* 040714 7F00BBE4 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 040718 7F00BBE8 00002025 */ move $a0, $zero -/* 04071C 7F00BBEC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040720 7F00BBF0 3405FFFF */ li $a1, 65535 -/* 040724 7F00BBF4 14400015 */ bnez $v0, .L7F00BC4C -/* 040728 7F00BBF8 00000000 */ nop -/* 04072C 7F00BBFC 0C00303B */ jal joyGetStickX -/* 040730 7F00BC00 00002025 */ move $a0, $zero -/* 040734 7F00BC04 2841FFFB */ slti $at, $v0, -5 -/* 040738 7F00BC08 14200010 */ bnez $at, .L7F00BC4C -/* 04073C 7F00BC0C 00000000 */ nop -/* 040740 7F00BC10 0C00303B */ jal joyGetStickX -/* 040744 7F00BC14 00002025 */ move $a0, $zero -/* 040748 7F00BC18 28410006 */ slti $at, $v0, 6 -/* 04074C 7F00BC1C 1020000B */ beqz $at, .L7F00BC4C -/* 040750 7F00BC20 00000000 */ nop -/* 040754 7F00BC24 0C00307F */ jal joyGetStickY -/* 040758 7F00BC28 00002025 */ move $a0, $zero -/* 04075C 7F00BC2C 2841FFFB */ slti $at, $v0, -5 -/* 040760 7F00BC30 14200006 */ bnez $at, .L7F00BC4C -/* 040764 7F00BC34 00000000 */ nop -/* 040768 7F00BC38 0C00307F */ jal joyGetStickY -/* 04076C 7F00BC3C 00002025 */ move $a0, $zero -/* 040770 7F00BC40 28410006 */ slti $at, $v0, 6 -/* 040774 7F00BC44 14200004 */ bnez $at, .L7F00BC58 -/* 040778 7F00BC48 3C0E8003 */ lui $t6, %hi(g_MenuTimer) -.L7F00BC4C: -/* 04077C 7F00BC4C 3C018003 */ lui $at, %hi(g_MenuTimer) -/* 040780 7F00BC50 10000007 */ b .L7F00BC70 -/* 040784 7F00BC54 AC20A8CC */ sw $zero, %lo(g_MenuTimer)($at) -.L7F00BC58: -/* 040788 7F00BC58 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 04078C 7F00BC5C 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 040790 7F00BC60 8DCEA8CC */ lw $t6, %lo(g_MenuTimer)($t6) -/* 040794 7F00BC64 3C018003 */ lui $at, %hi(g_MenuTimer) -/* 040798 7F00BC68 01CFC021 */ addu $t8, $t6, $t7 -/* 04079C 7F00BC6C AC38A8CC */ sw $t8, %lo(g_MenuTimer)($at) -.L7F00BC70: -/* 0407A0 7F00BC70 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0407A4 7F00BC74 44816000 */ mtc1 $at, $f12 -/* 0407A8 7F00BC78 0C001151 */ jal viSetFovY -/* 0407AC 7F00BC7C 00000000 */ nop -/* 0407B0 7F00BC80 3C018005 */ lui $at, %hi(D_80051A1C) -/* 0407B4 7F00BC84 0C001164 */ jal viSetAspect -/* 0407B8 7F00BC88 C42C1A1C */ lwc1 $f12, %lo(D_80051A1C)($at) -/* 0407BC 7F00BC8C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0407C0 7F00BC90 44816000 */ mtc1 $at, $f12 -/* 0407C4 7F00BC94 3C018005 */ lui $at, %hi(D_80051A20) -/* 0407C8 7F00BC98 0C001194 */ jal viSetZRange -/* 0407CC 7F00BC9C C42E1A20 */ lwc1 $f14, %lo(D_80051A20)($at) -/* 0407D0 7F00BCA0 0C00114D */ jal viSetUseZBuf -/* 0407D4 7F00BCA4 00002025 */ move $a0, $zero -/* 0407D8 7F00BCA8 3C198003 */ lui $t9, %hi(D_8002AB94) -/* 0407DC 7F00BCAC 2739AB94 */ addiu $t9, %lo(D_8002AB94) # addiu $t9, $t9, -0x546c -/* 0407E0 7F00BCB0 3C108003 */ lui $s0, %hi(walletinst) -/* 0407E4 7F00BCB4 3C118007 */ lui $s1, %hi(dword_CODE_bss_80069620) -/* 0407E8 7F00BCB8 4480A000 */ mtc1 $zero, $f20 -/* 0407EC 7F00BCBC 26319620 */ addiu $s1, %lo(dword_CODE_bss_80069620) # addiu $s1, $s1, -0x69e0 -/* 0407F0 7F00BCC0 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 0407F4 7F00BCC4 AFB90054 */ sw $t9, 0x54($sp) -/* 0407F8 7F00BCC8 00009025 */ move $s2, $zero -/* 0407FC 7F00BCCC 27B30088 */ addiu $s3, $sp, 0x88 -.L7F00BCD0: -/* 040800 7F00BCD0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 040804 7F00BCD4 44812000 */ mtc1 $at, $f4 -/* 040808 7F00BCD8 4405A000 */ mfc1 $a1, $f20 -/* 04080C 7F00BCDC 4406A000 */ mfc1 $a2, $f20 -/* 040810 7F00BCE0 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 040814 7F00BCE4 3C07457A */ lui $a3, 0x457a -/* 040818 7F00BCE8 E7B40010 */ swc1 $f20, 0x10($sp) -/* 04081C 7F00BCEC E7B40014 */ swc1 $f20, 0x14($sp) -/* 040820 7F00BCF0 E7B40018 */ swc1 $f20, 0x18($sp) -/* 040824 7F00BCF4 E7B4001C */ swc1 $f20, 0x1c($sp) -/* 040828 7F00BCF8 E7B40024 */ swc1 $f20, 0x24($sp) -/* 04082C 7F00BCFC 0FC165A5 */ jal matrix_4x4_7F059694 -/* 040830 7F00BD00 E7A40020 */ swc1 $f4, 0x20($sp) -/* 040834 7F00BD04 8FA40054 */ lw $a0, 0x54($sp) -/* 040838 7F00BD08 0FC16259 */ jal matrix_4x4_set_identity_and_position -/* 04083C 7F00BD0C 02602825 */ move $a1, $s3 -/* 040840 7F00BD10 3C018005 */ lui $at, %hi(D_80051A24) -/* 040844 7F00BD14 C42C1A24 */ lwc1 $f12, %lo(D_80051A24)($at) -/* 040848 7F00BD18 0FC1629F */ jal matrix_scalar_multiply -/* 04084C 7F00BD1C 02602825 */ move $a1, $s3 -/* 040850 7F00BD20 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 040854 7F00BD24 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 040858 7F00BD28 02602825 */ move $a1, $s3 -/* 04085C 7F00BD2C 8E080000 */ lw $t0, ($s0) -/* 040860 7F00BD30 8D090008 */ lw $t1, 8($t0) -/* 040864 7F00BD34 8524000E */ lh $a0, 0xe($t1) -/* 040868 7F00BD38 00045180 */ sll $t2, $a0, 6 -/* 04086C 7F00BD3C 0FC2F5C5 */ jal dynAllocate -/* 040870 7F00BD40 01402025 */ move $a0, $t2 -/* 040874 7F00BD44 8E0B0000 */ lw $t3, ($s0) -/* 040878 7F00BD48 02602025 */ move $a0, $s3 -/* 04087C 7F00BD4C AD62000C */ sw $v0, 0xc($t3) -/* 040880 7F00BD50 8E0C0000 */ lw $t4, ($s0) -/* 040884 7F00BD54 0FC16008 */ jal matrix_4x4_copy -/* 040888 7F00BD58 8D85000C */ lw $a1, 0xc($t4) -/* 04088C 7F00BD5C 8E040000 */ lw $a0, ($s0) -/* 040890 7F00BD60 8C8D000C */ lw $t5, 0xc($a0) -/* 040894 7F00BD64 C5A60030 */ lwc1 $f6, 0x30($t5) -/* 040898 7F00BD68 E6260000 */ swc1 $f6, ($s1) -/* 04089C 7F00BD6C 8C8E000C */ lw $t6, 0xc($a0) -/* 0408A0 7F00BD70 C5C80034 */ lwc1 $f8, 0x34($t6) -/* 0408A4 7F00BD74 E6280004 */ swc1 $f8, 4($s1) -/* 0408A8 7F00BD78 8C8F000C */ lw $t7, 0xc($a0) -/* 0408AC 7F00BD7C C5EA0038 */ lwc1 $f10, 0x38($t7) -/* 0408B0 7F00BD80 0FC02DC9 */ jal disable_all_switches -/* 0408B4 7F00BD84 E62A0008 */ swc1 $f10, 8($s1) -/* 0408B8 7F00BD88 0FC07AF0 */ jal fileGetBondForFolder -/* 0408BC 7F00BD8C 02402025 */ move $a0, $s2 -/* 0408C0 7F00BD90 8E040000 */ lw $a0, ($s0) -/* 0408C4 7F00BD94 0FC02E02 */ jal select_load_bond_picture -/* 0408C8 7F00BD98 00402825 */ move $a1, $v0 -/* 0408CC 7F00BD9C 8E040000 */ lw $a0, ($s0) -/* 0408D0 7F00BDA0 2405000E */ li $a1, 14 -/* 0408D4 7F00BDA4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0408D8 7F00BDA8 24060001 */ li $a2, 1 -/* 0408DC 7F00BDAC 8E040000 */ lw $a0, ($s0) -/* 0408E0 7F00BDB0 2405000D */ li $a1, 13 -/* 0408E4 7F00BDB4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0408E8 7F00BDB8 24060001 */ li $a2, 1 -/* 0408EC 7F00BDBC 8FB80054 */ lw $t8, 0x54($sp) -/* 0408F0 7F00BDC0 26520001 */ addiu $s2, $s2, 1 -/* 0408F4 7F00BDC4 24010004 */ li $at, 4 -/* 0408F8 7F00BDC8 2719000C */ addiu $t9, $t8, 0xc -/* 0408FC 7F00BDCC AFB90054 */ sw $t9, 0x54($sp) -/* 040900 7F00BDD0 26100004 */ addiu $s0, $s0, 4 -/* 040904 7F00BDD4 1641FFBE */ bne $s2, $at, .L7F00BCD0 -/* 040908 7F00BDD8 2631000C */ addiu $s1, $s1, 0xc -/* 04090C 7F00BDDC 3C028003 */ lui $v0, %hi(selected_folder_num) -/* 040910 7F00BDE0 2442A8E8 */ addiu $v0, %lo(selected_folder_num) # addiu $v0, $v0, -0x5718 -/* 040914 7F00BDE4 8C440000 */ lw $a0, ($v0) -/* 040918 7F00BDE8 24010064 */ li $at, 100 -/* 04091C 7F00BDEC 04800010 */ bltz $a0, .L7F00BE30 -/* 040920 7F00BDF0 00000000 */ nop -/* 040924 7F00BDF4 14810003 */ bne $a0, $at, .L7F00BE04 -/* 040928 7F00BDF8 3C088003 */ lui $t0, %hi(selected_folder_num_copy) -/* 04092C 7F00BDFC 8D04A8EC */ lw $a0, %lo(selected_folder_num_copy)($t0) -/* 040930 7F00BE00 AC440000 */ sw $a0, ($v0) -.L7F00BE04: -/* 040934 7F00BE04 04800003 */ bltz $a0, .L7F00BE14 -/* 040938 7F00BE08 28810004 */ slti $at, $a0, 4 -/* 04093C 7F00BE0C 14200003 */ bnez $at, .L7F00BE1C -/* 040940 7F00BE10 00000000 */ nop -.L7F00BE14: -/* 040944 7F00BE14 AC400000 */ sw $zero, ($v0) -/* 040948 7F00BE18 00002025 */ move $a0, $zero -.L7F00BE1C: -/* 04094C 7F00BE1C 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040950 7F00BE20 00000000 */ nop -/* 040954 7F00BE24 2411FFFF */ li $s1, -1 -/* 040958 7F00BE28 3C018003 */ lui $at, %hi(selected_folder_num) -/* 04095C 7F00BE2C AC31A8E8 */ sw $s1, %lo(selected_folder_num)($at) -.L7F00BE30: -/* 040960 7F00BE30 3C098003 */ lui $t1, %hi(folder_selected_for_deletion) -/* 040964 7F00BE34 8D29A91C */ lw $t1, %lo(folder_selected_for_deletion)($t1) -/* 040968 7F00BE38 2411FFFF */ li $s1, -1 -/* 04096C 7F00BE3C 00009025 */ move $s2, $zero -/* 040970 7F00BE40 0520006A */ bltz $t1, .L7F00BFEC -/* 040974 7F00BE44 3C108003 */ lui $s0, %hi(walletinst) -/* 040978 7F00BE48 00002025 */ move $a0, $zero -/* 04097C 7F00BE4C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040980 7F00BE50 24050222 */ li $a1, 546 -/* 040984 7F00BE54 1040000E */ beqz $v0, .L7F00BE90 -/* 040988 7F00BE58 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 04098C 7F00BE5C 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 040990 7F00BE60 8E0A0000 */ lw $t2, ($s0) -/* 040994 7F00BE64 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040998 7F00BE68 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 04099C 7F00BE6C 15400008 */ bnez $t2, .L7F00BE90 -/* 0409A0 7F00BE70 240B0001 */ li $t3, 1 -/* 0409A4 7F00BE74 AE0B0000 */ sw $t3, ($s0) -/* 0409A8 7F00BE78 8E640000 */ lw $a0, ($s3) -/* 0409AC 7F00BE7C 24050012 */ li $a1, 18 -/* 0409B0 7F00BE80 0C002382 */ jal sndPlaySfx -/* 0409B4 7F00BE84 00003025 */ move $a2, $zero -/* 0409B8 7F00BE88 10000011 */ b .L7F00BED0 -/* 0409BC 7F00BE8C 00000000 */ nop -.L7F00BE90: -/* 0409C0 7F00BE90 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 0409C4 7F00BE94 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 0409C8 7F00BE98 00002025 */ move $a0, $zero -/* 0409CC 7F00BE9C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0409D0 7F00BEA0 24050111 */ li $a1, 273 -/* 0409D4 7F00BEA4 1040000A */ beqz $v0, .L7F00BED0 -/* 0409D8 7F00BEA8 00000000 */ nop -/* 0409DC 7F00BEAC 8E0C0000 */ lw $t4, ($s0) -/* 0409E0 7F00BEB0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 0409E4 7F00BEB4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 0409E8 7F00BEB8 11800005 */ beqz $t4, .L7F00BED0 -/* 0409EC 7F00BEBC 24050012 */ li $a1, 18 -/* 0409F0 7F00BEC0 AE000000 */ sw $zero, ($s0) -/* 0409F4 7F00BEC4 8E640000 */ lw $a0, ($s3) -/* 0409F8 7F00BEC8 0C002382 */ jal sndPlaySfx -/* 0409FC 7F00BECC 00003025 */ move $a2, $zero -.L7F00BED0: -/* 040A00 7F00BED0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040A04 7F00BED4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040A08 7F00BED8 0C00303B */ jal joyGetStickX -/* 040A0C 7F00BEDC 00002025 */ move $a0, $zero -/* 040A10 7F00BEE0 2841FFD3 */ slti $at, $v0, -0x2d -/* 040A14 7F00BEE4 1020000B */ beqz $at, .L7F00BF14 -/* 040A18 7F00BEE8 00000000 */ nop -/* 040A1C 7F00BEEC 8E0D0000 */ lw $t5, ($s0) -/* 040A20 7F00BEF0 240E0001 */ li $t6, 1 -/* 040A24 7F00BEF4 24050012 */ li $a1, 18 -/* 040A28 7F00BEF8 15A00006 */ bnez $t5, .L7F00BF14 -/* 040A2C 7F00BEFC 00003025 */ move $a2, $zero -/* 040A30 7F00BF00 AE0E0000 */ sw $t6, ($s0) -/* 040A34 7F00BF04 0C002382 */ jal sndPlaySfx -/* 040A38 7F00BF08 8E640000 */ lw $a0, ($s3) -/* 040A3C 7F00BF0C 1000000F */ b .L7F00BF4C -/* 040A40 7F00BF10 00002025 */ move $a0, $zero -.L7F00BF14: -/* 040A44 7F00BF14 0C00303B */ jal joyGetStickX -/* 040A48 7F00BF18 00002025 */ move $a0, $zero -/* 040A4C 7F00BF1C 2841002E */ slti $at, $v0, 0x2e -/* 040A50 7F00BF20 5420000A */ bnezl $at, .L7F00BF4C -/* 040A54 7F00BF24 00002025 */ move $a0, $zero -/* 040A58 7F00BF28 8E0F0000 */ lw $t7, ($s0) -/* 040A5C 7F00BF2C 24050012 */ li $a1, 18 -/* 040A60 7F00BF30 00003025 */ move $a2, $zero -/* 040A64 7F00BF34 51E00005 */ beql $t7, $zero, .L7F00BF4C -/* 040A68 7F00BF38 00002025 */ move $a0, $zero -/* 040A6C 7F00BF3C AE000000 */ sw $zero, ($s0) -/* 040A70 7F00BF40 0C002382 */ jal sndPlaySfx -/* 040A74 7F00BF44 8E640000 */ lw $a0, ($s3) -/* 040A78 7F00BF48 00002025 */ move $a0, $zero -.L7F00BF4C: -/* 040A7C 7F00BF4C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040A80 7F00BF50 3405B000 */ li $a1, 45056 -/* 040A84 7F00BF54 50400017 */ beql $v0, $zero, .L7F00BFB4 -/* 040A88 7F00BF58 00002025 */ move $a0, $zero -/* 040A8C 7F00BF5C 8E180000 */ lw $t8, ($s0) -/* 040A90 7F00BF60 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040A94 7F00BF64 24050076 */ li $a1, 118 -/* 040A98 7F00BF68 17000009 */ bnez $t8, .L7F00BF90 -/* 040A9C 7F00BF6C 00003025 */ move $a2, $zero -/* 040AA0 7F00BF70 0FC07B01 */ jal fileDeleteSaveForFolder -/* 040AA4 7F00BF74 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AA8 7F00BF78 8E640000 */ lw $a0, ($s3) -/* 040AAC 7F00BF7C 24050076 */ li $a1, 118 -/* 040AB0 7F00BF80 0C002382 */ jal sndPlaySfx -/* 040AB4 7F00BF84 00003025 */ move $a2, $zero -/* 040AB8 7F00BF88 10000003 */ b .L7F00BF98 -/* 040ABC 7F00BF8C 00000000 */ nop -.L7F00BF90: -/* 040AC0 7F00BF90 0C002382 */ jal sndPlaySfx -/* 040AC4 7F00BF94 8E640000 */ lw $a0, ($s3) -.L7F00BF98: -/* 040AC8 7F00BF98 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040ACC 7F00BF9C 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040AD0 7F00BFA0 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AD4 7F00BFA4 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040AD8 7F00BFA8 100000DC */ b .L7F00C31C -/* 040ADC 7F00BFAC AC31A91C */ sw $s1, %lo(folder_selected_for_deletion)($at) -/* 040AE0 7F00BFB0 00002025 */ move $a0, $zero -.L7F00BFB4: -/* 040AE4 7F00BFB4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040AE8 7F00BFB8 24054000 */ li $a1, 16384 -/* 040AEC 7F00BFBC 104000D7 */ beqz $v0, .L7F00C31C -/* 040AF0 7F00BFC0 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040AF4 7F00BFC4 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040AF8 7F00BFC8 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AFC 7F00BFCC 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040B00 7F00BFD0 AC31A91C */ sw $s1, %lo(folder_selected_for_deletion)($at) -/* 040B04 7F00BFD4 8E640000 */ lw $a0, ($s3) -/* 040B08 7F00BFD8 24050076 */ li $a1, 118 -/* 040B0C 7F00BFDC 0C002382 */ jal sndPlaySfx -/* 040B10 7F00BFE0 00003025 */ move $a2, $zero -/* 040B14 7F00BFE4 100000CD */ b .L7F00C31C -/* 040B18 7F00BFE8 00000000 */ nop -.L7F00BFEC: -/* 040B1C 7F00BFEC 3C118007 */ lui $s1, %hi(dword_CODE_bss_80069620) -/* 040B20 7F00BFF0 26319620 */ addiu $s1, %lo(dword_CODE_bss_80069620) # addiu $s1, $s1, -0x69e0 -/* 040B24 7F00BFF4 2610A95C */ addiu $s0, $s0, %lo(walletinst) -/* 040B28 7F00BFF8 27B3007C */ addiu $s3, $sp, 0x7c -.L7F00BFFC: -/* 040B2C 7F00BFFC 27B90074 */ addiu $t9, $sp, 0x74 -/* 040B30 7F00C000 AFB90010 */ sw $t9, 0x10($sp) -/* 040B34 7F00C004 8E040000 */ lw $a0, ($s0) -/* 040B38 7F00C008 27A50080 */ addiu $a1, $sp, 0x80 -/* 040B3C 7F00C00C 02603025 */ move $a2, $s3 -/* 040B40 7F00C010 0FC0FE43 */ jal sub_GAME_7F03F90C -/* 040B44 7F00C014 27A70078 */ addiu $a3, $sp, 0x78 -/* 040B48 7F00C018 27A80064 */ addiu $t0, $sp, 0x64 -/* 040B4C 7F00C01C AFA80010 */ sw $t0, 0x10($sp) -/* 040B50 7F00C020 02202025 */ move $a0, $s1 -/* 040B54 7F00C024 02602825 */ move $a1, $s3 -/* 040B58 7F00C028 27A60074 */ addiu $a2, $sp, 0x74 -/* 040B5C 7F00C02C 0FC0FE52 */ jal sub_GAME_7F03F948 -/* 040B60 7F00C030 27A7006C */ addiu $a3, $sp, 0x6c -/* 040B64 7F00C034 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 040B68 7F00C038 C422A908 */ lwc1 $f2, %lo(cursor_h_pos)($at) -/* 040B6C 7F00C03C C7B0006C */ lwc1 $f16, 0x6c($sp) -/* 040B70 7F00C040 C7B20064 */ lwc1 $f18, 0x64($sp) -/* 040B74 7F00C044 4602803E */ c.le.s $f16, $f2 -/* 040B78 7F00C048 00000000 */ nop -/* 040B7C 7F00C04C 4502004E */ bc1fl .L7F00C188 -/* 040B80 7F00C050 26520001 */ addiu $s2, $s2, 1 -/* 040B84 7F00C054 4612103E */ c.le.s $f2, $f18 -/* 040B88 7F00C058 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040B8C 7F00C05C C7A40070 */ lwc1 $f4, 0x70($sp) -/* 040B90 7F00C060 45020049 */ bc1fl .L7F00C188 -/* 040B94 7F00C064 26520001 */ addiu $s2, $s2, 1 -/* 040B98 7F00C068 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040B9C 7F00C06C C7A60068 */ lwc1 $f6, 0x68($sp) -/* 040BA0 7F00C070 4600203E */ c.le.s $f4, $f0 -/* 040BA4 7F00C074 00000000 */ nop -/* 040BA8 7F00C078 45020043 */ bc1fl .L7F00C188 -/* 040BAC 7F00C07C 26520001 */ addiu $s2, $s2, 1 -/* 040BB0 7F00C080 4606003E */ c.le.s $f0, $f6 -/* 040BB4 7F00C084 02402025 */ move $a0, $s2 -/* 040BB8 7F00C088 27A50060 */ addiu $a1, $sp, 0x60 -/* 040BBC 7F00C08C 4502003E */ bc1fl .L7F00C188 -/* 040BC0 7F00C090 26520001 */ addiu $s2, $s2, 1 -/* 040BC4 7F00C094 0FC07A1D */ jal fileGetHighestStageDifficultyCompletedForFolder -/* 040BC8 7F00C098 27A6005C */ addiu $a2, $sp, 0x5c -/* 040BCC 7F00C09C 00002025 */ move $a0, $zero -/* 040BD0 7F00C0A0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040BD4 7F00C0A4 3405B000 */ li $a1, 45056 -/* 040BD8 7F00C0A8 50400037 */ beql $v0, $zero, .L7F00C188 -/* 040BDC 7F00C0AC 26520001 */ addiu $s2, $s2, 1 -/* 040BE0 7F00C0B0 3C118003 */ lui $s1, %hi(folder_selection_screen_option_icon) -/* 040BE4 7F00C0B4 2631A918 */ addiu $s1, %lo(folder_selection_screen_option_icon) # addiu $s1, $s1, -0x56e8 -/* 040BE8 7F00C0B8 8E220000 */ lw $v0, ($s1) -/* 040BEC 7F00C0BC 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040BF0 7F00C0C0 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040BF4 7F00C0C4 14400009 */ bnez $v0, .L7F00C0EC -/* 040BF8 7F00C0C8 3C018003 */ lui $at, %hi(selected_folder_num) -/* 040BFC 7F00C0CC AC32A8E8 */ sw $s2, %lo(selected_folder_num)($at) -/* 040C00 7F00C0D0 8E640000 */ lw $a0, ($s3) -/* 040C04 7F00C0D4 2405004D */ li $a1, 77 -/* 040C08 7F00C0D8 0C002382 */ jal sndPlaySfx -/* 040C0C 7F00C0DC 00003025 */ move $a2, $zero -/* 040C10 7F00C0E0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C14 7F00C0E4 10000030 */ b .L7F00C1A8 -/* 040C18 7F00C0E8 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -.L7F00C0EC: -/* 040C1C 7F00C0EC 24010001 */ li $at, 1 -/* 040C20 7F00C0F0 5441000E */ bnel $v0, $at, .L7F00C12C -/* 040C24 7F00C0F4 24010002 */ li $at, 2 -/* 040C28 7F00C0F8 0FC07B68 */ jal sub_GAME_7F01EDA0 -/* 040C2C 7F00C0FC 02402025 */ move $a0, $s2 -/* 040C30 7F00C100 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C34 7F00C104 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C38 7F00C108 AE200000 */ sw $zero, ($s1) -/* 040C3C 7F00C10C 8E640000 */ lw $a0, ($s3) -/* 040C40 7F00C110 2405004F */ li $a1, 79 -/* 040C44 7F00C114 0C002382 */ jal sndPlaySfx -/* 040C48 7F00C118 00003025 */ move $a2, $zero -/* 040C4C 7F00C11C 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C50 7F00C120 10000021 */ b .L7F00C1A8 -/* 040C54 7F00C124 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C58 7F00C128 24010002 */ li $at, 2 -.L7F00C12C: -/* 040C5C 7F00C12C 14410012 */ bne $v0, $at, .L7F00C178 -/* 040C60 7F00C130 00000000 */ nop -/* 040C64 7F00C134 8FA90060 */ lw $t1, 0x60($sp) -/* 040C68 7F00C138 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C6C 7F00C13C 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C70 7F00C140 05200009 */ bltz $t1, .L7F00C168 -/* 040C74 7F00C144 24050012 */ li $a1, 18 -/* 040C78 7F00C148 8FAA005C */ lw $t2, 0x5c($sp) -/* 040C7C 7F00C14C 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 040C80 7F00C150 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 040C84 7F00C154 05400004 */ bltz $t2, .L7F00C168 -/* 040C88 7F00C158 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040C8C 7F00C15C AC32A91C */ sw $s2, %lo(folder_selected_for_deletion)($at) -/* 040C90 7F00C160 240B0001 */ li $t3, 1 -/* 040C94 7F00C164 AE0B0000 */ sw $t3, ($s0) -.L7F00C168: -/* 040C98 7F00C168 AE200000 */ sw $zero, ($s1) -/* 040C9C 7F00C16C 8E640000 */ lw $a0, ($s3) -/* 040CA0 7F00C170 0C002382 */ jal sndPlaySfx -/* 040CA4 7F00C174 00003025 */ move $a2, $zero -.L7F00C178: -/* 040CA8 7F00C178 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040CAC 7F00C17C 1000000A */ b .L7F00C1A8 -/* 040CB0 7F00C180 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040CB4 7F00C184 26520001 */ addiu $s2, $s2, 1 -.L7F00C188: -/* 040CB8 7F00C188 24010004 */ li $at, 4 -/* 040CBC 7F00C18C 26100004 */ addiu $s0, $s0, 4 -/* 040CC0 7F00C190 1641FF9A */ bne $s2, $at, .L7F00BFFC -/* 040CC4 7F00C194 2631000C */ addiu $s1, $s1, 0xc -/* 040CC8 7F00C198 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040CCC 7F00C19C 3C118003 */ lui $s1, %hi(folder_selection_screen_option_icon) -/* 040CD0 7F00C1A0 2631A918 */ addiu $s1, %lo(folder_selection_screen_option_icon) # addiu $s1, $s1, -0x56e8 -/* 040CD4 7F00C1A4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -.L7F00C1A8: -/* 040CD8 7F00C1A8 00002025 */ move $a0, $zero -/* 040CDC 7F00C1AC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040CE0 7F00C1B0 3405B000 */ li $a1, 45056 -/* 040CE4 7F00C1B4 1040004A */ beqz $v0, .L7F00C2E0 -/* 040CE8 7F00C1B8 3C028003 */ lui $v0, %hi(folder_option_COPY_left_bound) -/* 040CEC 7F00C1BC 2442ABC4 */ addiu $v0, %lo(folder_option_COPY_left_bound) # addiu $v0, $v0, -0x543c -/* 040CF0 7F00C1C0 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 040CF4 7F00C1C4 C422A908 */ lwc1 $f2, %lo(cursor_h_pos)($at) -/* 040CF8 7F00C1C8 C4480000 */ lwc1 $f8, ($v0) -/* 040CFC 7F00C1CC 4602403E */ c.le.s $f8, $f2 -/* 040D00 7F00C1D0 00000000 */ nop -/* 040D04 7F00C1D4 45000019 */ bc1f .L7F00C23C -/* 040D08 7F00C1D8 00000000 */ nop -/* 040D0C 7F00C1DC C44A0008 */ lwc1 $f10, 8($v0) -/* 040D10 7F00C1E0 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040D14 7F00C1E4 460A103E */ c.le.s $f2, $f10 -/* 040D18 7F00C1E8 00000000 */ nop -/* 040D1C 7F00C1EC 45000013 */ bc1f .L7F00C23C -/* 040D20 7F00C1F0 00000000 */ nop -/* 040D24 7F00C1F4 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040D28 7F00C1F8 C4500004 */ lwc1 $f16, 4($v0) -/* 040D2C 7F00C1FC 4600803E */ c.le.s $f16, $f0 -/* 040D30 7F00C200 00000000 */ nop -/* 040D34 7F00C204 4500000D */ bc1f .L7F00C23C -/* 040D38 7F00C208 00000000 */ nop -/* 040D3C 7F00C20C C452000C */ lwc1 $f18, 0xc($v0) -/* 040D40 7F00C210 240C0001 */ li $t4, 1 -/* 040D44 7F00C214 240500DE */ li $a1, 222 -/* 040D48 7F00C218 4612003E */ c.le.s $f0, $f18 -/* 040D4C 7F00C21C 00003025 */ move $a2, $zero -/* 040D50 7F00C220 45000006 */ bc1f .L7F00C23C -/* 040D54 7F00C224 00000000 */ nop -/* 040D58 7F00C228 AE2C0000 */ sw $t4, ($s1) -/* 040D5C 7F00C22C 0C002382 */ jal sndPlaySfx -/* 040D60 7F00C230 8E640000 */ lw $a0, ($s3) -/* 040D64 7F00C234 10000037 */ b .L7F00C314 -/* 040D68 7F00C238 00000000 */ nop -.L7F00C23C: -/* 040D6C 7F00C23C 3C028003 */ lui $v0, %hi(folder_option_ERASE_left_bound) -/* 040D70 7F00C240 2442ABD4 */ addiu $v0, %lo(folder_option_ERASE_left_bound) # addiu $v0, $v0, -0x542c -/* 040D74 7F00C244 C4440000 */ lwc1 $f4, ($v0) -/* 040D78 7F00C248 4602203E */ c.le.s $f4, $f2 -/* 040D7C 7F00C24C 00000000 */ nop -/* 040D80 7F00C250 4502001A */ bc1fl .L7F00C2BC -/* 040D84 7F00C254 8E2E0000 */ lw $t6, ($s1) -/* 040D88 7F00C258 C4460008 */ lwc1 $f6, 8($v0) -/* 040D8C 7F00C25C 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040D90 7F00C260 4606103E */ c.le.s $f2, $f6 -/* 040D94 7F00C264 00000000 */ nop -/* 040D98 7F00C268 45020014 */ bc1fl .L7F00C2BC -/* 040D9C 7F00C26C 8E2E0000 */ lw $t6, ($s1) -/* 040DA0 7F00C270 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040DA4 7F00C274 C4480004 */ lwc1 $f8, 4($v0) -/* 040DA8 7F00C278 4600403E */ c.le.s $f8, $f0 -/* 040DAC 7F00C27C 00000000 */ nop -/* 040DB0 7F00C280 4502000E */ bc1fl .L7F00C2BC -/* 040DB4 7F00C284 8E2E0000 */ lw $t6, ($s1) -/* 040DB8 7F00C288 C44A000C */ lwc1 $f10, 0xc($v0) -/* 040DBC 7F00C28C 240D0002 */ li $t5, 2 -/* 040DC0 7F00C290 240500DE */ li $a1, 222 -/* 040DC4 7F00C294 460A003E */ c.le.s $f0, $f10 -/* 040DC8 7F00C298 00003025 */ move $a2, $zero -/* 040DCC 7F00C29C 45020007 */ bc1fl .L7F00C2BC -/* 040DD0 7F00C2A0 8E2E0000 */ lw $t6, ($s1) -/* 040DD4 7F00C2A4 AE2D0000 */ sw $t5, ($s1) -/* 040DD8 7F00C2A8 0C002382 */ jal sndPlaySfx -/* 040DDC 7F00C2AC 8E640000 */ lw $a0, ($s3) -/* 040DE0 7F00C2B0 10000018 */ b .L7F00C314 -/* 040DE4 7F00C2B4 00000000 */ nop -/* 040DE8 7F00C2B8 8E2E0000 */ lw $t6, ($s1) -.L7F00C2BC: -/* 040DEC 7F00C2BC 24050076 */ li $a1, 118 -/* 040DF0 7F00C2C0 00003025 */ move $a2, $zero -/* 040DF4 7F00C2C4 11C00013 */ beqz $t6, .L7F00C314 -/* 040DF8 7F00C2C8 00000000 */ nop -/* 040DFC 7F00C2CC AE200000 */ sw $zero, ($s1) -/* 040E00 7F00C2D0 0C002382 */ jal sndPlaySfx -/* 040E04 7F00C2D4 8E640000 */ lw $a0, ($s3) -/* 040E08 7F00C2D8 1000000E */ b .L7F00C314 -/* 040E0C 7F00C2DC 00000000 */ nop -.L7F00C2E0: -/* 040E10 7F00C2E0 00002025 */ move $a0, $zero -/* 040E14 7F00C2E4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040E18 7F00C2E8 24054000 */ li $a1, 16384 -/* 040E1C 7F00C2EC 10400009 */ beqz $v0, .L7F00C314 -/* 040E20 7F00C2F0 00000000 */ nop -/* 040E24 7F00C2F4 8E2F0000 */ lw $t7, ($s1) -/* 040E28 7F00C2F8 24050076 */ li $a1, 118 -/* 040E2C 7F00C2FC 00003025 */ move $a2, $zero -/* 040E30 7F00C300 11E00004 */ beqz $t7, .L7F00C314 -/* 040E34 7F00C304 00000000 */ nop -/* 040E38 7F00C308 AE200000 */ sw $zero, ($s1) -/* 040E3C 7F00C30C 0C002382 */ jal sndPlaySfx -/* 040E40 7F00C310 8E640000 */ lw $a0, ($s3) -.L7F00C314: -/* 040E44 7F00C314 0FC026E1 */ jal menu_control_stick_tracking -/* 040E48 7F00C318 00000000 */ nop -.L7F00C31C: -/* 040E4C 7F00C31C 3C188003 */ lui $t8, %hi(selected_folder_num) -/* 040E50 7F00C320 8F18A8E8 */ lw $t8, %lo(selected_folder_num)($t8) -/* 040E54 7F00C324 07000007 */ bltz $t8, .L7F00C344 -/* 040E58 7F00C328 24040006 */ li $a0, 6 -/* 040E5C 7F00C32C 0FC06975 */ jal set_menu_to_mode -/* 040E60 7F00C330 00002825 */ move $a1, $zero -/* 040E64 7F00C334 0FC035FF */ jal setCursorPOSforMode -/* 040E68 7F00C338 00002025 */ move $a0, $zero -/* 040E6C 7F00C33C 1000000A */ b .L7F00C368 -/* 040E70 7F00C340 8FBF0044 */ lw $ra, 0x44($sp) -.L7F00C344: -/* 040E74 7F00C344 3C198003 */ lui $t9, %hi(g_MenuTimer) -/* 040E78 7F00C348 8F39A8CC */ lw $t9, %lo(g_MenuTimer)($t9) -/* 040E7C 7F00C34C 00002025 */ move $a0, $zero -/* 040E80 7F00C350 2B210709 */ slti $at, $t9, 0x709 -/* 040E84 7F00C354 54200004 */ bnezl $at, .L7F00C368 -/* 040E88 7F00C358 8FBF0044 */ lw $ra, 0x44($sp) -/* 040E8C 7F00C35C 0FC06975 */ jal set_menu_to_mode -/* 040E90 7F00C360 24050001 */ li $a1, 1 -/* 040E94 7F00C364 8FBF0044 */ lw $ra, 0x44($sp) -.L7F00C368: -/* 040E98 7F00C368 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 040E9C 7F00C36C 8FB00034 */ lw $s0, 0x34($sp) -/* 040EA0 7F00C370 8FB10038 */ lw $s1, 0x38($sp) -/* 040EA4 7F00C374 8FB2003C */ lw $s2, 0x3c($sp) -/* 040EA8 7F00C378 8FB30040 */ lw $s3, 0x40($sp) -/* 040EAC 7F00C37C 03E00008 */ jr $ra -/* 040EB0 7F00C380 27BD0110 */ addiu $sp, $sp, 0x110 -) -#endif - -#if defined(VERSION_EU) -GLOBAL_ASM( -.late_rodata -glabel D_80051A1C -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_80051A20 -.word 0x461C4000 /* 10000.0;*/ -glabel D_80051A24 -.word 0x3EBD70A4 /* 0.37;*/ -.text -glabel interface_menu05_fileselect -/* 0406FC 7F00BBCC 27BDFEF0 */ addiu $sp, $sp, -0x110 -/* 040700 7F00BBD0 AFBF0044 */ sw $ra, 0x44($sp) -/* 040704 7F00BBD4 AFB30040 */ sw $s3, 0x40($sp) -/* 040708 7F00BBD8 AFB2003C */ sw $s2, 0x3c($sp) -/* 04070C 7F00BBDC AFB10038 */ sw $s1, 0x38($sp) -/* 040710 7F00BBE0 AFB00034 */ sw $s0, 0x34($sp) -/* 040714 7F00BBE4 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 040718 7F00BBE8 00002025 */ move $a0, $zero -/* 04071C 7F00BBEC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040720 7F00BBF0 3405FFFF */ li $a1, 65535 -/* 040724 7F00BBF4 14400015 */ bnez $v0, .L7F00BC4C -/* 040728 7F00BBF8 00000000 */ nop -/* 04072C 7F00BBFC 0C00303B */ jal joyGetStickX -/* 040730 7F00BC00 00002025 */ move $a0, $zero -/* 040734 7F00BC04 2841FFFB */ slti $at, $v0, -5 -/* 040738 7F00BC08 14200010 */ bnez $at, .L7F00BC4C -/* 04073C 7F00BC0C 00000000 */ nop -/* 040740 7F00BC10 0C00303B */ jal joyGetStickX -/* 040744 7F00BC14 00002025 */ move $a0, $zero -/* 040748 7F00BC18 28410006 */ slti $at, $v0, 6 -/* 04074C 7F00BC1C 1020000B */ beqz $at, .L7F00BC4C -/* 040750 7F00BC20 00000000 */ nop -/* 040754 7F00BC24 0C00307F */ jal joyGetStickY -/* 040758 7F00BC28 00002025 */ move $a0, $zero -/* 04075C 7F00BC2C 2841FFFB */ slti $at, $v0, -5 -/* 040760 7F00BC30 14200006 */ bnez $at, .L7F00BC4C -/* 040764 7F00BC34 00000000 */ nop -/* 040768 7F00BC38 0C00307F */ jal joyGetStickY -/* 04076C 7F00BC3C 00002025 */ move $a0, $zero -/* 040770 7F00BC40 28410006 */ slti $at, $v0, 6 -/* 040774 7F00BC44 14200004 */ bnez $at, .L7F00BC58 -/* 040778 7F00BC48 3C0E8003 */ lui $t6, %hi(g_MenuTimer) -.L7F00BC4C: -/* 04077C 7F00BC4C 3C018003 */ lui $at, %hi(g_MenuTimer) -/* 040780 7F00BC50 10000007 */ b .L7F00BC70 -/* 040784 7F00BC54 AC20A8CC */ sw $zero, %lo(g_MenuTimer)($at) -.L7F00BC58: -/* 040788 7F00BC58 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 04078C 7F00BC5C 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 040790 7F00BC60 8DCEA8CC */ lw $t6, %lo(g_MenuTimer)($t6) -/* 040794 7F00BC64 3C018003 */ lui $at, %hi(g_MenuTimer) -/* 040798 7F00BC68 01CFC021 */ addu $t8, $t6, $t7 -/* 04079C 7F00BC6C AC38A8CC */ sw $t8, %lo(g_MenuTimer)($at) -.L7F00BC70: -/* 0407A0 7F00BC70 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0407A4 7F00BC74 44816000 */ mtc1 $at, $f12 -/* 0407A8 7F00BC78 0C001151 */ jal viSetFovY -/* 0407AC 7F00BC7C 00000000 */ nop -/* 0407B0 7F00BC80 3C018005 */ lui $at, %hi(D_80051A1C) -/* 0407B4 7F00BC84 0C001164 */ jal viSetAspect -/* 0407B8 7F00BC88 C42C1A1C */ lwc1 $f12, %lo(D_80051A1C)($at) -/* 0407BC 7F00BC8C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0407C0 7F00BC90 44816000 */ mtc1 $at, $f12 -/* 0407C4 7F00BC94 3C018005 */ lui $at, %hi(D_80051A20) -/* 0407C8 7F00BC98 0C001194 */ jal viSetZRange -/* 0407CC 7F00BC9C C42E1A20 */ lwc1 $f14, %lo(D_80051A20)($at) -/* 0407D0 7F00BCA0 0C00114D */ jal viSetUseZBuf -/* 0407D4 7F00BCA4 00002025 */ move $a0, $zero -/* 0407D8 7F00BCA8 3C198003 */ lui $t9, %hi(D_8002AB94) -/* 0407DC 7F00BCAC 2739AB94 */ addiu $t9, %lo(D_8002AB94) # addiu $t9, $t9, -0x546c -/* 0407E0 7F00BCB0 3C108003 */ lui $s0, %hi(walletinst) -/* 0407E4 7F00BCB4 3C118007 */ lui $s1, %hi(dword_CODE_bss_80069620) -/* 0407E8 7F00BCB8 4480A000 */ mtc1 $zero, $f20 -/* 0407EC 7F00BCBC 26319620 */ addiu $s1, %lo(dword_CODE_bss_80069620) # addiu $s1, $s1, -0x69e0 -/* 0407F0 7F00BCC0 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 0407F4 7F00BCC4 AFB90054 */ sw $t9, 0x54($sp) -/* 0407F8 7F00BCC8 00009025 */ move $s2, $zero -/* 0407FC 7F00BCCC 27B30088 */ addiu $s3, $sp, 0x88 -.L7F00BCD0: -/* 040800 7F00BCD0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 040804 7F00BCD4 44812000 */ mtc1 $at, $f4 -/* 040808 7F00BCD8 4405A000 */ mfc1 $a1, $f20 -/* 04080C 7F00BCDC 4406A000 */ mfc1 $a2, $f20 -/* 040810 7F00BCE0 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 040814 7F00BCE4 3C07457A */ lui $a3, 0x457a -/* 040818 7F00BCE8 E7B40010 */ swc1 $f20, 0x10($sp) -/* 04081C 7F00BCEC E7B40014 */ swc1 $f20, 0x14($sp) -/* 040820 7F00BCF0 E7B40018 */ swc1 $f20, 0x18($sp) -/* 040824 7F00BCF4 E7B4001C */ swc1 $f20, 0x1c($sp) -/* 040828 7F00BCF8 E7B40024 */ swc1 $f20, 0x24($sp) -/* 04082C 7F00BCFC 0FC165A5 */ jal matrix_4x4_7F059694 -/* 040830 7F00BD00 E7A40020 */ swc1 $f4, 0x20($sp) -/* 040834 7F00BD04 8FA40054 */ lw $a0, 0x54($sp) -/* 040838 7F00BD08 0FC16259 */ jal matrix_4x4_set_identity_and_position -/* 04083C 7F00BD0C 02602825 */ move $a1, $s3 -/* 040840 7F00BD10 3C018005 */ lui $at, %hi(D_80051A24) -/* 040844 7F00BD14 C42C1A24 */ lwc1 $f12, %lo(D_80051A24)($at) -/* 040848 7F00BD18 0FC1629F */ jal matrix_scalar_multiply -/* 04084C 7F00BD1C 02602825 */ move $a1, $s3 -/* 040850 7F00BD20 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 040854 7F00BD24 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 040858 7F00BD28 02602825 */ move $a1, $s3 -/* 04085C 7F00BD2C 8E080000 */ lw $t0, ($s0) -/* 040860 7F00BD30 8D090008 */ lw $t1, 8($t0) -/* 040864 7F00BD34 8524000E */ lh $a0, 0xe($t1) -/* 040868 7F00BD38 00045180 */ sll $t2, $a0, 6 -/* 04086C 7F00BD3C 0FC2F5C5 */ jal dynAllocate -/* 040870 7F00BD40 01402025 */ move $a0, $t2 -/* 040874 7F00BD44 8E0B0000 */ lw $t3, ($s0) -/* 040878 7F00BD48 02602025 */ move $a0, $s3 -/* 04087C 7F00BD4C AD62000C */ sw $v0, 0xc($t3) -/* 040880 7F00BD50 8E0C0000 */ lw $t4, ($s0) -/* 040884 7F00BD54 0FC16008 */ jal matrix_4x4_copy -/* 040888 7F00BD58 8D85000C */ lw $a1, 0xc($t4) -/* 04088C 7F00BD5C 8E040000 */ lw $a0, ($s0) -/* 040890 7F00BD60 8C8D000C */ lw $t5, 0xc($a0) -/* 040894 7F00BD64 C5A60030 */ lwc1 $f6, 0x30($t5) -/* 040898 7F00BD68 E6260000 */ swc1 $f6, ($s1) -/* 04089C 7F00BD6C 8C8E000C */ lw $t6, 0xc($a0) -/* 0408A0 7F00BD70 C5C80034 */ lwc1 $f8, 0x34($t6) -/* 0408A4 7F00BD74 E6280004 */ swc1 $f8, 4($s1) -/* 0408A8 7F00BD78 8C8F000C */ lw $t7, 0xc($a0) -/* 0408AC 7F00BD7C C5EA0038 */ lwc1 $f10, 0x38($t7) -/* 0408B0 7F00BD80 0FC02DC9 */ jal disable_all_switches -/* 0408B4 7F00BD84 E62A0008 */ swc1 $f10, 8($s1) -/* 0408B8 7F00BD88 0FC07AF0 */ jal fileGetBondForFolder -/* 0408BC 7F00BD8C 02402025 */ move $a0, $s2 -/* 0408C0 7F00BD90 8E040000 */ lw $a0, ($s0) -/* 0408C4 7F00BD94 0FC02E02 */ jal select_load_bond_picture -/* 0408C8 7F00BD98 00402825 */ move $a1, $v0 -/* 0408CC 7F00BD9C 8E040000 */ lw $a0, ($s0) -/* 0408D0 7F00BDA0 2405000E */ li $a1, 14 -/* 0408D4 7F00BDA4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0408D8 7F00BDA8 24060001 */ li $a2, 1 -/* 0408DC 7F00BDAC 8E040000 */ lw $a0, ($s0) -/* 0408E0 7F00BDB0 2405000D */ li $a1, 13 -/* 0408E4 7F00BDB4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0408E8 7F00BDB8 24060001 */ li $a2, 1 -/* 0408EC 7F00BDBC 8FB80054 */ lw $t8, 0x54($sp) -/* 0408F0 7F00BDC0 26520001 */ addiu $s2, $s2, 1 -/* 0408F4 7F00BDC4 24010004 */ li $at, 4 -/* 0408F8 7F00BDC8 2719000C */ addiu $t9, $t8, 0xc -/* 0408FC 7F00BDCC AFB90054 */ sw $t9, 0x54($sp) -/* 040900 7F00BDD0 26100004 */ addiu $s0, $s0, 4 -/* 040904 7F00BDD4 1641FFBE */ bne $s2, $at, .L7F00BCD0 -/* 040908 7F00BDD8 2631000C */ addiu $s1, $s1, 0xc -/* 04090C 7F00BDDC 3C028003 */ lui $v0, %hi(selected_folder_num) -/* 040910 7F00BDE0 2442A8E8 */ addiu $v0, %lo(selected_folder_num) # addiu $v0, $v0, -0x5718 -/* 040914 7F00BDE4 8C440000 */ lw $a0, ($v0) -/* 040918 7F00BDE8 24010064 */ li $at, 100 -/* 04091C 7F00BDEC 04800010 */ bltz $a0, .L7F00BE30 -/* 040920 7F00BDF0 00000000 */ nop -/* 040924 7F00BDF4 14810003 */ bne $a0, $at, .L7F00BE04 -/* 040928 7F00BDF8 3C088003 */ lui $t0, %hi(selected_folder_num_copy) -/* 04092C 7F00BDFC 8D04A8EC */ lw $a0, %lo(selected_folder_num_copy)($t0) -/* 040930 7F00BE00 AC440000 */ sw $a0, ($v0) -.L7F00BE04: -/* 040934 7F00BE04 04800003 */ bltz $a0, .L7F00BE14 -/* 040938 7F00BE08 28810004 */ slti $at, $a0, 4 -/* 04093C 7F00BE0C 14200003 */ bnez $at, .L7F00BE1C -/* 040940 7F00BE10 00000000 */ nop -.L7F00BE14: -/* 040944 7F00BE14 AC400000 */ sw $zero, ($v0) -/* 040948 7F00BE18 00002025 */ move $a0, $zero -.L7F00BE1C: -/* 04094C 7F00BE1C 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040950 7F00BE20 00000000 */ nop -/* 040954 7F00BE24 2411FFFF */ li $s1, -1 -/* 040958 7F00BE28 3C018003 */ lui $at, %hi(selected_folder_num) -/* 04095C 7F00BE2C AC31A8E8 */ sw $s1, %lo(selected_folder_num)($at) -.L7F00BE30: -/* 040960 7F00BE30 3C098003 */ lui $t1, %hi(folder_selected_for_deletion) -/* 040964 7F00BE34 8D29A91C */ lw $t1, %lo(folder_selected_for_deletion)($t1) -/* 040968 7F00BE38 2411FFFF */ li $s1, -1 -/* 04096C 7F00BE3C 00009025 */ move $s2, $zero -/* 040970 7F00BE40 0520006A */ bltz $t1, .L7F00BFEC -/* 040974 7F00BE44 3C108003 */ lui $s0, %hi(walletinst) -/* 040978 7F00BE48 00002025 */ move $a0, $zero -/* 04097C 7F00BE4C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040980 7F00BE50 24050222 */ li $a1, 546 -/* 040984 7F00BE54 1040000E */ beqz $v0, .L7F00BE90 -/* 040988 7F00BE58 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 04098C 7F00BE5C 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 040990 7F00BE60 8E0A0000 */ lw $t2, ($s0) -/* 040994 7F00BE64 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040998 7F00BE68 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 04099C 7F00BE6C 15400008 */ bnez $t2, .L7F00BE90 -/* 0409A0 7F00BE70 240B0001 */ li $t3, 1 -/* 0409A4 7F00BE74 AE0B0000 */ sw $t3, ($s0) -/* 0409A8 7F00BE78 8E640000 */ lw $a0, ($s3) -/* 0409AC 7F00BE7C 24050012 */ li $a1, 18 -/* 0409B0 7F00BE80 0C002382 */ jal sndPlaySfx -/* 0409B4 7F00BE84 00003025 */ move $a2, $zero -/* 0409B8 7F00BE88 10000011 */ b .L7F00BED0 -/* 0409BC 7F00BE8C 00000000 */ nop -.L7F00BE90: -/* 0409C0 7F00BE90 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 0409C4 7F00BE94 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 0409C8 7F00BE98 00002025 */ move $a0, $zero -/* 0409CC 7F00BE9C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0409D0 7F00BEA0 24050111 */ li $a1, 273 -/* 0409D4 7F00BEA4 1040000A */ beqz $v0, .L7F00BED0 -/* 0409D8 7F00BEA8 00000000 */ nop -/* 0409DC 7F00BEAC 8E0C0000 */ lw $t4, ($s0) -/* 0409E0 7F00BEB0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 0409E4 7F00BEB4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 0409E8 7F00BEB8 11800005 */ beqz $t4, .L7F00BED0 -/* 0409EC 7F00BEBC 24050012 */ li $a1, 18 -/* 0409F0 7F00BEC0 AE000000 */ sw $zero, ($s0) -/* 0409F4 7F00BEC4 8E640000 */ lw $a0, ($s3) -/* 0409F8 7F00BEC8 0C002382 */ jal sndPlaySfx -/* 0409FC 7F00BECC 00003025 */ move $a2, $zero -.L7F00BED0: -/* 040A00 7F00BED0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040A04 7F00BED4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040A08 7F00BED8 0C00303B */ jal joyGetStickX -/* 040A0C 7F00BEDC 00002025 */ move $a0, $zero -/* 040A10 7F00BEE0 2841FFD3 */ slti $at, $v0, -0x2d -/* 040A14 7F00BEE4 1020000B */ beqz $at, .L7F00BF14 -/* 040A18 7F00BEE8 00000000 */ nop -/* 040A1C 7F00BEEC 8E0D0000 */ lw $t5, ($s0) -/* 040A20 7F00BEF0 240E0001 */ li $t6, 1 -/* 040A24 7F00BEF4 24050012 */ li $a1, 18 -/* 040A28 7F00BEF8 15A00006 */ bnez $t5, .L7F00BF14 -/* 040A2C 7F00BEFC 00003025 */ move $a2, $zero -/* 040A30 7F00BF00 AE0E0000 */ sw $t6, ($s0) -/* 040A34 7F00BF04 0C002382 */ jal sndPlaySfx -/* 040A38 7F00BF08 8E640000 */ lw $a0, ($s3) -/* 040A3C 7F00BF0C 1000000F */ b .L7F00BF4C -/* 040A40 7F00BF10 00002025 */ move $a0, $zero -.L7F00BF14: -/* 040A44 7F00BF14 0C00303B */ jal joyGetStickX -/* 040A48 7F00BF18 00002025 */ move $a0, $zero -/* 040A4C 7F00BF1C 2841002E */ slti $at, $v0, 0x2e -/* 040A50 7F00BF20 5420000A */ bnezl $at, .L7F00BF4C -/* 040A54 7F00BF24 00002025 */ move $a0, $zero -/* 040A58 7F00BF28 8E0F0000 */ lw $t7, ($s0) -/* 040A5C 7F00BF2C 24050012 */ li $a1, 18 -/* 040A60 7F00BF30 00003025 */ move $a2, $zero -/* 040A64 7F00BF34 51E00005 */ beql $t7, $zero, .L7F00BF4C -/* 040A68 7F00BF38 00002025 */ move $a0, $zero -/* 040A6C 7F00BF3C AE000000 */ sw $zero, ($s0) -/* 040A70 7F00BF40 0C002382 */ jal sndPlaySfx -/* 040A74 7F00BF44 8E640000 */ lw $a0, ($s3) -/* 040A78 7F00BF48 00002025 */ move $a0, $zero -.L7F00BF4C: -/* 040A7C 7F00BF4C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040A80 7F00BF50 3405B000 */ li $a1, 45056 -/* 040A84 7F00BF54 50400017 */ beql $v0, $zero, .L7F00BFB4 -/* 040A88 7F00BF58 00002025 */ move $a0, $zero -/* 040A8C 7F00BF5C 8E180000 */ lw $t8, ($s0) -/* 040A90 7F00BF60 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040A94 7F00BF64 24050076 */ li $a1, 118 -/* 040A98 7F00BF68 17000009 */ bnez $t8, .L7F00BF90 -/* 040A9C 7F00BF6C 00003025 */ move $a2, $zero -/* 040AA0 7F00BF70 0FC07B01 */ jal fileDeleteSaveForFolder -/* 040AA4 7F00BF74 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AA8 7F00BF78 8E640000 */ lw $a0, ($s3) -/* 040AAC 7F00BF7C 24050076 */ li $a1, 118 -/* 040AB0 7F00BF80 0C002382 */ jal sndPlaySfx -/* 040AB4 7F00BF84 00003025 */ move $a2, $zero -/* 040AB8 7F00BF88 10000003 */ b .L7F00BF98 -/* 040ABC 7F00BF8C 00000000 */ nop -.L7F00BF90: -/* 040AC0 7F00BF90 0C002382 */ jal sndPlaySfx -/* 040AC4 7F00BF94 8E640000 */ lw $a0, ($s3) -.L7F00BF98: -/* 040AC8 7F00BF98 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040ACC 7F00BF9C 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040AD0 7F00BFA0 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AD4 7F00BFA4 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040AD8 7F00BFA8 100000DC */ b .L7F00C31C -/* 040ADC 7F00BFAC AC31A91C */ sw $s1, %lo(folder_selected_for_deletion)($at) -/* 040AE0 7F00BFB0 00002025 */ move $a0, $zero -.L7F00BFB4: -/* 040AE4 7F00BFB4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040AE8 7F00BFB8 24054000 */ li $a1, 16384 -/* 040AEC 7F00BFBC 104000D7 */ beqz $v0, .L7F00C31C -/* 040AF0 7F00BFC0 3C048003 */ lui $a0, %hi(folder_selected_for_deletion) -/* 040AF4 7F00BFC4 0FC02EDA */ jal toggle_deletion_menu_for_folder -/* 040AF8 7F00BFC8 8C84A91C */ lw $a0, %lo(folder_selected_for_deletion)($a0) -/* 040AFC 7F00BFCC 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040B00 7F00BFD0 AC31A91C */ sw $s1, %lo(folder_selected_for_deletion)($at) -/* 040B04 7F00BFD4 8E640000 */ lw $a0, ($s3) -/* 040B08 7F00BFD8 24050076 */ li $a1, 118 -/* 040B0C 7F00BFDC 0C002382 */ jal sndPlaySfx -/* 040B10 7F00BFE0 00003025 */ move $a2, $zero -/* 040B14 7F00BFE4 100000CD */ b .L7F00C31C -/* 040B18 7F00BFE8 00000000 */ nop -.L7F00BFEC: -/* 040B1C 7F00BFEC 3C118007 */ lui $s1, %hi(dword_CODE_bss_80069620) -/* 040B20 7F00BFF0 26319620 */ addiu $s1, %lo(dword_CODE_bss_80069620) # addiu $s1, $s1, -0x69e0 -/* 040B24 7F00BFF4 2610A95C */ addiu $s0, $s0, %lo(walletinst) -/* 040B28 7F00BFF8 27B3007C */ addiu $s3, $sp, 0x7c -.L7F00BFFC: -/* 040B2C 7F00BFFC 27B90074 */ addiu $t9, $sp, 0x74 -/* 040B30 7F00C000 AFB90010 */ sw $t9, 0x10($sp) -/* 040B34 7F00C004 8E040000 */ lw $a0, ($s0) -/* 040B38 7F00C008 27A50080 */ addiu $a1, $sp, 0x80 -/* 040B3C 7F00C00C 02603025 */ move $a2, $s3 -/* 040B40 7F00C010 0FC0FE43 */ jal sub_GAME_7F03F90C -/* 040B44 7F00C014 27A70078 */ addiu $a3, $sp, 0x78 -/* 040B48 7F00C018 27A80064 */ addiu $t0, $sp, 0x64 -/* 040B4C 7F00C01C AFA80010 */ sw $t0, 0x10($sp) -/* 040B50 7F00C020 02202025 */ move $a0, $s1 -/* 040B54 7F00C024 02602825 */ move $a1, $s3 -/* 040B58 7F00C028 27A60074 */ addiu $a2, $sp, 0x74 -/* 040B5C 7F00C02C 0FC0FE52 */ jal sub_GAME_7F03F948 -/* 040B60 7F00C030 27A7006C */ addiu $a3, $sp, 0x6c -/* 040B64 7F00C034 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 040B68 7F00C038 C422A908 */ lwc1 $f2, %lo(cursor_h_pos)($at) -/* 040B6C 7F00C03C C7B0006C */ lwc1 $f16, 0x6c($sp) -/* 040B70 7F00C040 C7B20064 */ lwc1 $f18, 0x64($sp) -/* 040B74 7F00C044 4602803E */ c.le.s $f16, $f2 -/* 040B78 7F00C048 00000000 */ nop -/* 040B7C 7F00C04C 4502004E */ bc1fl .L7F00C188 -/* 040B80 7F00C050 26520001 */ addiu $s2, $s2, 1 -/* 040B84 7F00C054 4612103E */ c.le.s $f2, $f18 -/* 040B88 7F00C058 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040B8C 7F00C05C C7A40070 */ lwc1 $f4, 0x70($sp) -/* 040B90 7F00C060 45020049 */ bc1fl .L7F00C188 -/* 040B94 7F00C064 26520001 */ addiu $s2, $s2, 1 -/* 040B98 7F00C068 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040B9C 7F00C06C C7A60068 */ lwc1 $f6, 0x68($sp) -/* 040BA0 7F00C070 4600203E */ c.le.s $f4, $f0 -/* 040BA4 7F00C074 00000000 */ nop -/* 040BA8 7F00C078 45020043 */ bc1fl .L7F00C188 -/* 040BAC 7F00C07C 26520001 */ addiu $s2, $s2, 1 -/* 040BB0 7F00C080 4606003E */ c.le.s $f0, $f6 -/* 040BB4 7F00C084 02402025 */ move $a0, $s2 -/* 040BB8 7F00C088 27A50060 */ addiu $a1, $sp, 0x60 -/* 040BBC 7F00C08C 4502003E */ bc1fl .L7F00C188 -/* 040BC0 7F00C090 26520001 */ addiu $s2, $s2, 1 -/* 040BC4 7F00C094 0FC07A1D */ jal fileGetHighestStageDifficultyCompletedForFolder -/* 040BC8 7F00C098 27A6005C */ addiu $a2, $sp, 0x5c -/* 040BCC 7F00C09C 00002025 */ move $a0, $zero -/* 040BD0 7F00C0A0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040BD4 7F00C0A4 3405B000 */ li $a1, 45056 -/* 040BD8 7F00C0A8 50400037 */ beql $v0, $zero, .L7F00C188 -/* 040BDC 7F00C0AC 26520001 */ addiu $s2, $s2, 1 -/* 040BE0 7F00C0B0 3C118003 */ lui $s1, %hi(folder_selection_screen_option_icon) -/* 040BE4 7F00C0B4 2631A918 */ addiu $s1, %lo(folder_selection_screen_option_icon) # addiu $s1, $s1, -0x56e8 -/* 040BE8 7F00C0B8 8E220000 */ lw $v0, ($s1) -/* 040BEC 7F00C0BC 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040BF0 7F00C0C0 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040BF4 7F00C0C4 14400009 */ bnez $v0, .L7F00C0EC -/* 040BF8 7F00C0C8 3C018003 */ lui $at, %hi(selected_folder_num) -/* 040BFC 7F00C0CC AC32A8E8 */ sw $s2, %lo(selected_folder_num)($at) -/* 040C00 7F00C0D0 8E640000 */ lw $a0, ($s3) -/* 040C04 7F00C0D4 2405004D */ li $a1, 77 -/* 040C08 7F00C0D8 0C002382 */ jal sndPlaySfx -/* 040C0C 7F00C0DC 00003025 */ move $a2, $zero -/* 040C10 7F00C0E0 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C14 7F00C0E4 10000030 */ b .L7F00C1A8 -/* 040C18 7F00C0E8 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -.L7F00C0EC: -/* 040C1C 7F00C0EC 24010001 */ li $at, 1 -/* 040C20 7F00C0F0 5441000E */ bnel $v0, $at, .L7F00C12C -/* 040C24 7F00C0F4 24010002 */ li $at, 2 -/* 040C28 7F00C0F8 0FC07B68 */ jal sub_GAME_7F01EDA0 -/* 040C2C 7F00C0FC 02402025 */ move $a0, $s2 -/* 040C30 7F00C100 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C34 7F00C104 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C38 7F00C108 AE200000 */ sw $zero, ($s1) -/* 040C3C 7F00C10C 8E640000 */ lw $a0, ($s3) -/* 040C40 7F00C110 2405004F */ li $a1, 79 -/* 040C44 7F00C114 0C002382 */ jal sndPlaySfx -/* 040C48 7F00C118 00003025 */ move $a2, $zero -/* 040C4C 7F00C11C 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C50 7F00C120 10000021 */ b .L7F00C1A8 -/* 040C54 7F00C124 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C58 7F00C128 24010002 */ li $at, 2 -.L7F00C12C: -/* 040C5C 7F00C12C 14410012 */ bne $v0, $at, .L7F00C178 -/* 040C60 7F00C130 00000000 */ nop -/* 040C64 7F00C134 8FA90060 */ lw $t1, 0x60($sp) -/* 040C68 7F00C138 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040C6C 7F00C13C 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040C70 7F00C140 05200009 */ bltz $t1, .L7F00C168 -/* 040C74 7F00C144 24050012 */ li $a1, 18 -/* 040C78 7F00C148 8FAA005C */ lw $t2, 0x5c($sp) -/* 040C7C 7F00C14C 3C108003 */ lui $s0, %hi(folder_selected_for_deletion_choice) -/* 040C80 7F00C150 2610A920 */ addiu $s0, %lo(folder_selected_for_deletion_choice) # addiu $s0, $s0, -0x56e0 -/* 040C84 7F00C154 05400004 */ bltz $t2, .L7F00C168 -/* 040C88 7F00C158 3C018003 */ lui $at, %hi(folder_selected_for_deletion) -/* 040C8C 7F00C15C AC32A91C */ sw $s2, %lo(folder_selected_for_deletion)($at) -/* 040C90 7F00C160 240B0001 */ li $t3, 1 -/* 040C94 7F00C164 AE0B0000 */ sw $t3, ($s0) -.L7F00C168: -/* 040C98 7F00C168 AE200000 */ sw $zero, ($s1) -/* 040C9C 7F00C16C 8E640000 */ lw $a0, ($s3) -/* 040CA0 7F00C170 0C002382 */ jal sndPlaySfx -/* 040CA4 7F00C174 00003025 */ move $a2, $zero -.L7F00C178: -/* 040CA8 7F00C178 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040CAC 7F00C17C 1000000A */ b .L7F00C1A8 -/* 040CB0 7F00C180 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -/* 040CB4 7F00C184 26520001 */ addiu $s2, $s2, 1 -.L7F00C188: -/* 040CB8 7F00C188 24010004 */ li $at, 4 -/* 040CBC 7F00C18C 26100004 */ addiu $s0, $s0, 4 -/* 040CC0 7F00C190 1641FF9A */ bne $s2, $at, .L7F00BFFC -/* 040CC4 7F00C194 2631000C */ addiu $s1, $s1, 0xc -/* 040CC8 7F00C198 3C138006 */ lui $s3, %hi(g_musicSfxBufferPtr) -/* 040CCC 7F00C19C 3C118003 */ lui $s1, %hi(folder_selection_screen_option_icon) -/* 040CD0 7F00C1A0 2631A918 */ addiu $s1, %lo(folder_selection_screen_option_icon) # addiu $s1, $s1, -0x56e8 -/* 040CD4 7F00C1A4 26733720 */ addiu $s3, %lo(g_musicSfxBufferPtr) # addiu $s3, $s3, 0x3720 -.L7F00C1A8: -/* 040CD8 7F00C1A8 00002025 */ move $a0, $zero -/* 040CDC 7F00C1AC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040CE0 7F00C1B0 3405B000 */ li $a1, 45056 -/* 040CE4 7F00C1B4 1040004A */ beqz $v0, .L7F00C2E0 -/* 040CE8 7F00C1B8 3C028003 */ lui $v0, %hi(folder_option_COPY_left_bound) -/* 040CEC 7F00C1BC 2442ABC4 */ addiu $v0, %lo(folder_option_COPY_left_bound) # addiu $v0, $v0, -0x543c -/* 040CF0 7F00C1C0 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 040CF4 7F00C1C4 C422A908 */ lwc1 $f2, %lo(cursor_h_pos)($at) -/* 040CF8 7F00C1C8 C4480000 */ lwc1 $f8, ($v0) -/* 040CFC 7F00C1CC 4602403E */ c.le.s $f8, $f2 -/* 040D00 7F00C1D0 00000000 */ nop -/* 040D04 7F00C1D4 45000019 */ bc1f .L7F00C23C -/* 040D08 7F00C1D8 00000000 */ nop -/* 040D0C 7F00C1DC C44A0008 */ lwc1 $f10, 8($v0) -/* 040D10 7F00C1E0 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040D14 7F00C1E4 460A103E */ c.le.s $f2, $f10 -/* 040D18 7F00C1E8 00000000 */ nop -/* 040D1C 7F00C1EC 45000013 */ bc1f .L7F00C23C -/* 040D20 7F00C1F0 00000000 */ nop -/* 040D24 7F00C1F4 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040D28 7F00C1F8 C4500004 */ lwc1 $f16, 4($v0) -/* 040D2C 7F00C1FC 4600803E */ c.le.s $f16, $f0 -/* 040D30 7F00C200 00000000 */ nop -/* 040D34 7F00C204 4500000D */ bc1f .L7F00C23C -/* 040D38 7F00C208 00000000 */ nop -/* 040D3C 7F00C20C C452000C */ lwc1 $f18, 0xc($v0) -/* 040D40 7F00C210 240C0001 */ li $t4, 1 -/* 040D44 7F00C214 240500DE */ li $a1, 222 -/* 040D48 7F00C218 4612003E */ c.le.s $f0, $f18 -/* 040D4C 7F00C21C 00003025 */ move $a2, $zero -/* 040D50 7F00C220 45000006 */ bc1f .L7F00C23C -/* 040D54 7F00C224 00000000 */ nop -/* 040D58 7F00C228 AE2C0000 */ sw $t4, ($s1) -/* 040D5C 7F00C22C 0C002382 */ jal sndPlaySfx -/* 040D60 7F00C230 8E640000 */ lw $a0, ($s3) -/* 040D64 7F00C234 10000037 */ b .L7F00C314 -/* 040D68 7F00C238 00000000 */ nop -.L7F00C23C: -/* 040D6C 7F00C23C 3C028003 */ lui $v0, %hi(folder_option_ERASE_left_bound) -/* 040D70 7F00C240 2442ABD4 */ addiu $v0, %lo(folder_option_ERASE_left_bound) # addiu $v0, $v0, -0x542c -/* 040D74 7F00C244 C4440000 */ lwc1 $f4, ($v0) -/* 040D78 7F00C248 4602203E */ c.le.s $f4, $f2 -/* 040D7C 7F00C24C 00000000 */ nop -/* 040D80 7F00C250 4502001A */ bc1fl .L7F00C2BC -/* 040D84 7F00C254 8E2E0000 */ lw $t6, ($s1) -/* 040D88 7F00C258 C4460008 */ lwc1 $f6, 8($v0) -/* 040D8C 7F00C25C 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 040D90 7F00C260 4606103E */ c.le.s $f2, $f6 -/* 040D94 7F00C264 00000000 */ nop -/* 040D98 7F00C268 45020014 */ bc1fl .L7F00C2BC -/* 040D9C 7F00C26C 8E2E0000 */ lw $t6, ($s1) -/* 040DA0 7F00C270 C420A90C */ lwc1 $f0, %lo(cursor_v_pos)($at) -/* 040DA4 7F00C274 C4480004 */ lwc1 $f8, 4($v0) -/* 040DA8 7F00C278 4600403E */ c.le.s $f8, $f0 -/* 040DAC 7F00C27C 00000000 */ nop -/* 040DB0 7F00C280 4502000E */ bc1fl .L7F00C2BC -/* 040DB4 7F00C284 8E2E0000 */ lw $t6, ($s1) -/* 040DB8 7F00C288 C44A000C */ lwc1 $f10, 0xc($v0) -/* 040DBC 7F00C28C 240D0002 */ li $t5, 2 -/* 040DC0 7F00C290 240500DE */ li $a1, 222 -/* 040DC4 7F00C294 460A003E */ c.le.s $f0, $f10 -/* 040DC8 7F00C298 00003025 */ move $a2, $zero -/* 040DCC 7F00C29C 45020007 */ bc1fl .L7F00C2BC -/* 040DD0 7F00C2A0 8E2E0000 */ lw $t6, ($s1) -/* 040DD4 7F00C2A4 AE2D0000 */ sw $t5, ($s1) -/* 040DD8 7F00C2A8 0C002382 */ jal sndPlaySfx -/* 040DDC 7F00C2AC 8E640000 */ lw $a0, ($s3) -/* 040DE0 7F00C2B0 10000018 */ b .L7F00C314 -/* 040DE4 7F00C2B4 00000000 */ nop -/* 040DE8 7F00C2B8 8E2E0000 */ lw $t6, ($s1) -.L7F00C2BC: -/* 040DEC 7F00C2BC 24050076 */ li $a1, 118 -/* 040DF0 7F00C2C0 00003025 */ move $a2, $zero -/* 040DF4 7F00C2C4 11C00013 */ beqz $t6, .L7F00C314 -/* 040DF8 7F00C2C8 00000000 */ nop -/* 040DFC 7F00C2CC AE200000 */ sw $zero, ($s1) -/* 040E00 7F00C2D0 0C002382 */ jal sndPlaySfx -/* 040E04 7F00C2D4 8E640000 */ lw $a0, ($s3) -/* 040E08 7F00C2D8 1000000E */ b .L7F00C314 -/* 040E0C 7F00C2DC 00000000 */ nop -.L7F00C2E0: -/* 040E10 7F00C2E0 00002025 */ move $a0, $zero -/* 040E14 7F00C2E4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 040E18 7F00C2E8 24054000 */ li $a1, 16384 -/* 040E1C 7F00C2EC 10400009 */ beqz $v0, .L7F00C314 -/* 040E20 7F00C2F0 00000000 */ nop -/* 040E24 7F00C2F4 8E2F0000 */ lw $t7, ($s1) -/* 040E28 7F00C2F8 24050076 */ li $a1, 118 -/* 040E2C 7F00C2FC 00003025 */ move $a2, $zero -/* 040E30 7F00C300 11E00004 */ beqz $t7, .L7F00C314 -/* 040E34 7F00C304 00000000 */ nop -/* 040E38 7F00C308 AE200000 */ sw $zero, ($s1) -/* 040E3C 7F00C30C 0C002382 */ jal sndPlaySfx -/* 040E40 7F00C310 8E640000 */ lw $a0, ($s3) -.L7F00C314: -/* 040E44 7F00C314 0FC026E1 */ jal menu_control_stick_tracking -/* 040E48 7F00C318 00000000 */ nop -.L7F00C31C: -/* 040E4C 7F00C31C 3C188003 */ lui $t8, %hi(selected_folder_num) -/* 040E50 7F00C320 8F18A8E8 */ lw $t8, %lo(selected_folder_num)($t8) -/* 040E54 7F00C324 07000007 */ bltz $t8, .L7F00C344 -/* 040E58 7F00C328 24040006 */ li $a0, 6 -/* 040E5C 7F00C32C 0FC06975 */ jal set_menu_to_mode -/* 040E60 7F00C330 00002825 */ move $a1, $zero -/* 040E64 7F00C334 0FC035FF */ jal setCursorPOSforMode -/* 040E68 7F00C338 00002025 */ move $a0, $zero -/* 040E6C 7F00C33C 1000000A */ b .L7F00C368 -/* 040E70 7F00C340 8FBF0044 */ lw $ra, 0x44($sp) -.L7F00C344: -/* 040E74 7F00C344 3C198003 */ lui $t9, %hi(g_MenuTimer) -/* 040E78 7F00C348 8F39A8CC */ lw $t9, %lo(g_MenuTimer)($t9) -/* 040E7C 7F00C34C 00002025 */ move $a0, $zero -/* 040E80 7F00C350 2B2105dd */ slti $at, $t9, 0x5dd -/* 040E84 7F00C354 54200004 */ bnezl $at, .L7F00C368 -/* 040E88 7F00C358 8FBF0044 */ lw $ra, 0x44($sp) -/* 040E8C 7F00C35C 0FC06975 */ jal set_menu_to_mode -/* 040E90 7F00C360 24050001 */ li $a1, 1 -/* 040E94 7F00C364 8FBF0044 */ lw $ra, 0x44($sp) -.L7F00C368: -/* 040E98 7F00C368 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 040E9C 7F00C36C 8FB00034 */ lw $s0, 0x34($sp) -/* 040EA0 7F00C370 8FB10038 */ lw $s1, 0x38($sp) -/* 040EA4 7F00C374 8FB2003C */ lw $s2, 0x3c($sp) -/* 040EA8 7F00C378 8FB30040 */ lw $s3, 0x40($sp) -/* 040EAC 7F00C37C 03E00008 */ jr $ra -/* 040EB0 7F00C380 27BD0110 */ addiu $sp, $sp, 0x110 -) -#endif -#endif - @@ -4388,16 +2418,16 @@ char* get_ptr_difficulty_name(s32 difficulty) switch (difficulty) { case 0: - text = langGet(TEXT(LTITLE, 0x13)); //Agent + text = langGet(TEXT(LTITLE, TITLE_STR_19)); //Agent break; case 1: - text = langGet(TEXT(LTITLE, 0x14)); //Secret Agent + text = langGet(TEXT(LTITLE, TITLE_STR_20)); //Secret Agent break; case 2: - text = langGet(TEXT(LTITLE, 0x15)); //00 Agent + text = langGet(TEXT(LTITLE, TITLE_STR_21)); //00 Agent break; case 3: - text = langGet(TEXT(LTITLE, 0x16)); //007 + text = langGet(TEXT(LTITLE, TITLE_STR_22)); //007 break; } return text; @@ -4406,1329 +2436,274 @@ char* get_ptr_difficulty_name(s32 difficulty) - -#ifdef NONMATCHING -void *constructor_menu05_fileselect(void *arg0) +// Warning: The declaration of spD0 is likely incorrect, if this if this function is modified +// make sure to extend spD0 to avoid overflow. +Gfx *constructor_menu05_fileselect(Gfx *DL) { s32 sp1B4; - s32 sp1A8; - s32 sp19C; - void *sp158; - s32 sp154; - s32 sp150; - s32 sp14C; - s32 sp108; - s32 sp100; - s32 spFC; - s32 spF8; - s32 spF4; - s32 spF0; - s32 spEC; - s32 spE4; - s32 spD0; - s32 spBC; - f32 spB0; - f32 spAC; - f32 spA8; - f32 spA4; - f32 spA0; - f32 sp9C; - f32 sp98; - f32 sp94; - f32 sp90; - f32 sp8C; - f32 sp88; - f32 sp84; - void *sp74; - f32 temp_f10; - f32 temp_f10_2; - f32 temp_f18; - f32 temp_f6; - f32 temp_f6_2; - s32 temp_a2; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_ret_5; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s1_3; - s32 temp_s1_4; - s32 temp_t0; - s32 temp_v0; - s32 temp_v0_2; - u32 temp_s2; - void *temp_a0; - void *temp_a0_2; - void *temp_a1; - void *temp_a1_2; - void *temp_t2; - void *temp_t4; - void *temp_t7; - void *temp_t9; - void *temp_v0_3; - void *phi_t9; - void *phi_t2; - void *phi_s2; - s32 phi_s0; - s32 phi_s1; - void *phi_s0_2; - s32 phi_s1_2; - s32 phi_s2_2; - s32 phi_s1_3; - f32 phi_f6; - f32 phi_f18; - f32 phi_f6_2; - f32 phi_f10; - - sp1A8.unk0 = (s32) unknown_folderselect_constructor.unk0; - sp1A8.unk4 = (s32) unknown_folderselect_constructor.unk4; - sp1A8.unk8 = (s32) unknown_folderselect_constructor.unk8; - sp19C.unk0 = (s32) unknown_folderselect_constructor_0.unk0; - sp19C.unk4 = (s32) unknown_folderselect_constructor_0.unk4; - sp19C.unk8 = (s32) unknown_folderselect_constructor_0.unk8; - temp_ret = insert_imageDL(arg0); - arg0 = (void *) (temp_ret + 8); - temp_v0 = temp_ret; - temp_v0->unk0 = 0xfc167e2c; - temp_v0->unk4 = 0x33fdf6fb; - temp_t7 = arg0; - arg0 = (void *) (temp_t7 + 8); - temp_t7->unk4 = -0xec; - temp_t7->unk0 = &0xFB00000C; - temp_ret_2 = sub_GAME_7F007CC8(arg0, (s32) floorFloat(((f32) viGetX() * -80.0f) / 1280.0f), &sp1A8, &sp19C); - arg0 = (void *) (temp_ret_2 + 8); - temp_v0_2 = temp_ret_2; - temp_v0_2->unk4 = 0x1000000; - temp_v0_2->unk0 = 0x6000000; - temp_t4 = arg0; - arg0 = (void *) (temp_t4 + 8); - temp_t4->unk4 = &fontDL_0x040; - temp_t4->unk0 = 0x6000000; - phi_s2 = &D_8002A968; -loop_1: - phi_t9 = &unknown_folderselect; - phi_t2 = &sp14C; -loop_2: - temp_t9 = phi_t9; - temp_t2 = phi_t2 + 0xc; - temp_t2->unk-C = (s32) phi_t9->unk0; - temp_t2->unk-8 = (s32) temp_t9->unk-8; - temp_t2->unk-4 = (s32) temp_t9->unk-4; - phi_t9 = temp_t9; - phi_t2 = temp_t2; - if (temp_t9 != (&unknown_folderselect + 0x3c)) - { - goto loop_2; - } - temp_t2->unk0 = (s32) temp_t9->unk0; - sp154 = 3; - sp150 = 0; - sp158 = arg0; - subdraw(&sp14C, *phi_s2); - arg0 = sp158; - phi_s0 = 0; - phi_s1 = 0; - if ((*phi_s2)->unk8->unkE > 0) + struct FolderSelect sp1A8; + struct FolderSelect sp19C; + s32 j; + s32 i; + u8 *langp; + s32 var_s2_2; + struct unk_joint_list sp14C; + s32 var_s1_2; + Mtxf sp108; + f32 temp_f4; + struct point2d spFC; + struct point2d spF4; + LEVEL_SOLO_SEQUENCE spF0; + DIFFICULTY spEC; + struct coord2d spE4; + + sp1A8 = unknown_folderselect_constructor; + sp19C = unknown_folderselect_constructor_0; + + DL = insert_imageDL(DL); + + gDPSetCombineLERP(DL++, TEXEL0, PRIMITIVE, ENV_ALPHA, PRIMITIVE, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, ENV_ALPHA, PRIMITIVE, 0, 0, 0, PRIMITIVE); + gDPSetEnvColor(DL++, 0xFF, 0xFF, 0xFF, 0x14); + + DL = sub_GAME_7F007CC8(DL, (s32) floorFloat(((f32) viGetX() * -80.0f) / 1280.0f), &sp1A8, &sp19C); + + gSPDisplayList(DL++, &fontDL_0x000); + gSPDisplayList(DL++, &fontDL_0x040); + + for (j = 3; j >= 0; j--) { -loop_4: - matrix_4x4_copy(temp_v0_3->unkC + phi_s0, &sp108); - matrix_4x4_f32_to_s32(&sp108, (*phi_s2)->unkC + (phi_s1 << 6)); - temp_v0_3 = *phi_s2; - temp_s1 = phi_s1 + 1; - phi_s0 = phi_s0 + 0x40; - phi_s1 = temp_s1; - if (temp_s1 < temp_v0_3->unk8->unkE) + // struct copy + sp14C = unknown_folderselect; + + sp14C.unk08 = 3; + sp14C.unk04 = 0; + sp14C.gdl = DL; + + subdraw(&sp14C, walletinst[j]); + + DL = sp14C.gdl; + + for (i=0; i < walletinst[j]->obj->numMatrices; i++) { - goto loop_4; + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy( + (Mtxf*)&((s8*)walletinst[j]->render_pos)[i*0x40], + &sp108); + + matrix_4x4_f32_to_s32(&sp108, &((Mtxf*)walletinst[j]->render_pos)[i]); + } } - temp_s2 = phi_s2 + -4; - phi_s2 = temp_s2; - if (temp_s2 >= &walletinst[0]) - { - goto loop_1; - } - arg0 = microcode_constructor(arg0); + + DL = microcode_constructor(DL); setTextSpacingInverted(0); - sp74 = &dword_CODE_bss_80069620; - sp1B4 = 0; -loop_7: - sub_GAME_7F077FF4(sp74, &spE4); - if (sp1B4 == folder_selected_for_deletion) + + for (sp1B4 = 0; sp1B4 < 4; sp1B4++) { - floorFloat(spE4, sp1B4, &spF0); - temp_a2 = (s32) floorFloat(spE8) + 0x19; - arg0 = microcode_constructor_related_to_menus(arg0, sp100, temp_a2, sp100 + 0x63, (s32) (temp_a2 + 0x2a), 0x32); - floorFloat(spE4); - floorFloat(spE8); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, langGet(TEXT(LTITLE, 0x17)), (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, viGetY(), 0, 0); - temp_s1_2 = langGet(TEXT(LTITLE, 0x18)); - floorFloat(spE4); - floorFloat(spE8); - temp_a0 = &spF8; - temp_a1 = &spF4; - if (folder_selected_for_deletion_choice != 0) - { - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(temp_a0, temp_a1, temp_s1_2, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - arg0 = microcode_constructor_related_to_menus(arg0, sp100 + -1, spFC + -1, (sp100 + spF4) + 3, (s32) (spFC + spF8), 0x32); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_s1_2, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, -1, viGetY(), 0, 0); - } - else - { - viGetX(temp_a0, temp_a1, temp_s1_2); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_s1_2, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, viGetY(), 0, 0); - } - temp_s1_3 = langGet(TEXT(LTITLE, 0x19)); - floorFloat(spE4); - if (j_text_trigger != 0) - { + // HACK: + char spD0[4]; // this needs to be at least 14 characters. + char spBC[18]; + s32 padding3; + struct coord3d * sp74; - } - floorFloat(spE8); - temp_a0_2 = &spF8; - temp_a1_2 = &spF4; - if (folder_selected_for_deletion_choice != 0) + sp74 = &dword_CODE_bss_80069620[sp1B4]; + + sub_GAME_7F077FF4(sp74, &spE4); + + if (sp1B4 == folder_selected_for_deletion) { - viGetX(temp_a0_2, temp_a1_2, temp_s1_3); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_s1_3, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, viGetY(), 0, 0); + spFC.p[1] = (s32) floorFloat(spE4.f[0]) - 0x31; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x19; + + DL = microcode_constructor_related_to_menus(DL, spFC.p[1], spFC.p[0], spFC.p[1] + 0x63, spFC.p[0] + 0x2A, 0x32); + + langp = langGet(0x9C17); + spFC.p[1] = (s32) floorFloat(spE4.f[0]) - 0x2F; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x1E; + + // 0xEBD879FF + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0xEBD879FF, viGetX(), viGetY(), 0, 0); + + langp = langGet(0x9C18); + spFC.p[1] = (s32) floorFloat(spE4.f[0]) - 0x2F; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x32; + + if (folder_selected_for_deletion_choice != 0) + { + spF4.p[0] = 0; + spF4.p[1] = 0; + textMeasure(&spF4.p[1], &spF4.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + DL = microcode_constructor_related_to_menus(DL, spFC.p[1] - 1, spFC.p[0] - 1, spF4.p[0] + spFC.p[1] + 3, spF4.p[1] + spFC.p[0], 0x32); + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); + } + else + { + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0xEBD879FF, viGetX(), viGetY(), 0, 0); + } + + langp = langGet(0x9C19); + + temp_f4 = floorFloat(spE4.f[0]); + spFC.p[1] = (((j_text_trigger != 0) ? 0x17 : -1) + (s32) temp_f4) - 1; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x32; + + if (folder_selected_for_deletion_choice != 0) + { + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0xEBD879FF, viGetX(), viGetY(), 0, 0); + } + else + { + spF4.p[0] = 0; + spF4.p[1] = 0; + textMeasure(&spF4.p[1], &spF4.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + DL = microcode_constructor_related_to_menus(DL, spFC.p[1] - 1, spFC.p[0] - 1, spF4.p[0] + spFC.p[1] + 3, spF4.p[1] + spFC.p[0], 0x32); + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); + } + } else { - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(temp_a0_2, temp_a1_2, temp_s1_3, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - arg0 = microcode_constructor_related_to_menus(arg0, sp100 + -1, spFC + -1, (sp100 + spF4) + 3, (s32) (spFC + spF8), 0x32); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_s1_3, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, -1, viGetY(), 0, 0); - } - } - else - { - fileGetHighestStageDifficultyCompletedForFolder(sp1B4, &spF0, &spEC); - if (spF0 >= 0) - { - if (spEC >= 0) + + fileGetHighestStageDifficultyCompletedForFolder(sp1B4, &spF0, &spEC); + + if ((spF0 >= SP_LEVEL_DAM) && (spEC >= DIFFICULTY_AGENT)) { - temp_ret_3 = get_ptr_difficulty_name(spEC); - if (temp_ret_3 != 0) + langp = get_ptr_difficulty_name(spEC); + + if (langp != NULL) { - strcpy(&spD0, temp_ret_3); - strcat(&spD0, &asc_D_8004F488); - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(&spF8, &spF4, &spD0, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - floorFloat(spE4); - if (spF4 < 0) - { - - } - floorFloat(spE8); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, &spD0, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, viGetY(), 0, 0); + strcpy((char *)&spD0, langp); + strcat((char *)&spD0, "\n"); + + spF4.p[0] = 0; + spF4.p[1] = 0; + + textMeasure(&spF4.p[1], &spF4.p[0], (char *)&spD0, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + spFC.p[1] = ((s32) floorFloat(spE4.f[0]) - (spF4.p[0] / 2)) - 1; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x15; + DL = textRender(DL, &spFC.p[1], &spFC.p[0], (char *)&spD0, ptrFontZurichBoldChars, ptrFontZurichBold, 0xEBD879FF, viGetX(), viGetY(), 0, 0); } - if (spEC != 3) + + if (spEC != DIFFICULTY_007) { - strcpy(&spBC, langGet(TEXT(LTITLE, 0x1a)); - phi_s0_2 = &mission_folder_setup_entries; - phi_s1_2 = 0; - phi_s2_2 = -1; - phi_s1_3 = 0; - if (D_8002ABE8 != 0) + var_s2_2 = -1; + + strcpy(spBC, langGet(0x9C1A)); + + for (var_s1_2 = 0; mission_folder_setup_entries[var_s1_2].folder_text_preset != 0; var_s1_2++) { -loop_24: - if (spF0 == phi_s0_2->unk14) - { - phi_s2_2 = get_chapter_briefing_entry(phi_s1_2); - phi_s1_3 = phi_s1_2; - } - else + if (spF0 == mission_folder_setup_entries[var_s1_2].mission_num) { - temp_s1_4 = phi_s1_2 + 1; - phi_s0_2 = phi_s0_2 + 0x1c; - phi_s1_2 = temp_s1_4; - phi_s2_2 = -1; - phi_s1_3 = temp_s1_4; - if (phi_s0_2->unk20 != 0) - { - goto loop_24; - } + var_s2_2 = get_chapter_briefing_entry(var_s1_2); + break; } } - if (phi_s2_2 >= 0) + + if (var_s2_2 >= 0) { - strcat(&spBC, *((((phi_s2_2 * 8) - phi_s2_2) * 4) + &mission_folder_setup_entries)); - strcat(&spBC, &a_); + strcat((char *)spBC, (char *)mission_folder_setup_entries[var_s2_2].string_ptr); + strcat((char *)spBC, "."); } - strcat(&spBC, *((((phi_s1_3 * 8) - phi_s1_3) * 4) + &mission_folder_setup_entries)); - strcat(&spBC, &asc_D_8004F490); - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(&spF8, &spF4, &spBC, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - floorFloat(spE4); - if (spF4 < 0) - { - - } - floorFloat(spE8); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, &spBC, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, viGetY(), 0, 0); + + strcat((char *)spBC, (char *)mission_folder_setup_entries[var_s1_2].string_ptr); + strcat((char *)spBC, "\n"); + spF4.p[0] = 0; + spF4.p[1] = 0; + + textMeasure(&spF4.p[1], &spF4.p[0], (char *)spBC, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + spFC.p[1] = ((s32) floorFloat(spE4.f[0]) - (spF4.p[0] / 2)) - 1; + spFC.p[0] = (s32) floorFloat(spE4.f[1]) + 0x2D; + + DL = textRender(DL, &spFC.p[1], &spFC.p[0], (char *)spBC, ptrFontZurichBoldChars, ptrFontZurichBold, 0xEBD879FF, viGetX(), viGetY(), 0, 0); } } } } - temp_t0 = sp1B4 + 1; - sp74 = (void *) (sp74 + 0xc); - sp1B4 = temp_t0; - if (temp_t0 != 4) - { - goto loop_7; - } - setTextSpacingInverted(0); - temp_ret_4 = langGet(TEXT(LTITLE, 0x1b)); - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(&spF8, &spF4, temp_ret_4, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - if (spF8 < 0) - { - } - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_ret_4, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, -1, viGetY(), 0, 0); - folder_option_COPY_left_bound.unk8 = (f32) (sp100 + spF4); - temp_ret_5 = langGet(TEXT(LTITLE, 0x1c)); - spF4 = 0; - spF8 = 0; - sub_GAME_7F0AE98C(&spF8, &spF4, temp_ret_5, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - if (spF8 < 0) + if(1) { + // The above for loops makes a lot of compiler temp variables on the stack, + // These need to be declared sometime after the above for loop. + struct coord2d spAC; + struct coord2d spA4; + struct coord2d sp9C; + struct coord2d sp94; + struct coord2d sp8C; + struct coord2d sp84; + + setTextSpacingInverted(0); + + langp = langGet(0x9C1B); + + spF4.p[0] = 0; + spF4.p[1] = 0; + + textMeasure(&spF4.p[1], &spF4.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spFC.p[0] = 0x11D - (spF4.p[1] / 2); + spFC.p[1] = 0xF7; + + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); + folder_option_COPY_bound.right = (f32) (spF4.p[0] + spFC.p[1]); + + langp = langGet(0x9C1C); + + spF4.p[0] = 0; + spF4.p[1] = 0; + + textMeasure(&spF4.p[1], &spF4.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spFC.p[1] = 0x165; + spFC.p[0] = 0x11D - (spF4.p[1] / 2); + + DL = textRender(DL, &spFC.p[1], &spFC.p[0], langp, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); + + folder_option_ERASE_bound.right = (f32) (spF4.p[0] + spFC.p[1]); + + spAC.f[0] = 225.0f; + spAC.f[1] = 285.0f; + + spA4.f[0] = (f32) (mainfolderimages + IMG_COPY)->width * 0.5f; + spA4.f[1] = (f32) (mainfolderimages + IMG_COPY)->height * 0.5f; + + likely_generate_DL_for_image_declaration(&DL, mainfolderimages, 4, 0, 0); + display_image_at_on_screen_coord(&DL, &spAC.f[0], &spA4.f[0], mainfolderimages->width, mainfolderimages->height, 0, 0, 1, 0xFF, 0xFF, 0xFF, 0xFF, (s32) mainfolderimages->level > 0, 0); + + folder_option_COPY_bound.left = spAC.f[0] - spA4.f[0]; + folder_option_COPY_bound.up = spAC.f[1] - spA4.f[1]; + folder_option_COPY_bound.down = spAC.f[1] + spA4.f[1]; + + sp9C.f[0] = 335.0f; + sp9C.f[1] = 285.0f; + + sp94.f[0] = (mainfolderimages + IMG_DEL)->width * 0.5f; + sp94.f[1] = (mainfolderimages + IMG_DEL)->height * 0.5f; + + likely_generate_DL_for_image_declaration(&DL, mainfolderimages + IMG_DEL, 4, 0, 0); + display_image_at_on_screen_coord(&DL, &sp9C.f[0], &sp94.f[0], (mainfolderimages + IMG_DEL)->width, (mainfolderimages + IMG_DEL)->height, 0, 0, 1, 0xFF, 0xFF, 0xFF, 0xFF, (s32) (mainfolderimages + IMG_DEL)->level > 0, 0); + + folder_option_ERASE_bound.left = (f32) (sp9C.f[0] - sp94.f[0]); + folder_option_ERASE_bound.up = (f32) (sp9C.f[1] - sp94.f[1]); + folder_option_ERASE_bound.down = (f32) (sp9C.f[1] + sp94.f[1]); + sp8C.f[0] = 110.0f; + sp8C.f[1] = 285.0f; + + sp84.f[0] = (mainfolderimages + IMG_SEL)->width * 0.5f; + sp84.f[1] = (mainfolderimages + IMG_SEL)->height * 0.5f; + + likely_generate_DL_for_image_declaration(&DL, mainfolderimages + IMG_SEL, 4, 0, 0); + display_image_at_on_screen_coord(&DL, &sp8C.f[0], &sp84.f[0], (mainfolderimages + IMG_SEL)->width, (mainfolderimages + IMG_SEL)->height, 0, 0, 1, 0xFF, 0xFF, 0xFF, 0xFF, (s32) (mainfolderimages + IMG_SEL)->level > 0, 0); } - viGetX(); - folder_option_ERASE_left_bound.unk8 = (f32) (sp100 + spF4); - arg0 = en_text_write_stuff(arg0, &sp100, &spFC, temp_ret_5, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, -1, viGetY(), 0, 0); - spAC = 225.0f; - spB0 = (f32) D_80051A28; - temp_f10 = (f32) (u32) mainfolderimages->unk4 * 0.5f; - spA4 = temp_f10; - spA8 = (f32) ((f32) (u32) mainfolderimages->unk5 * 0.5f); - likely_generate_DL_for_image_declaration(&arg0, mainfolderimages, 4, 0, 0); - display_image_at_on_screen_coord(&arg0, &spAC, &spA4, mainfolderimages->unk4, (s32) mainfolderimages->unk5, 0, 0, 1, 0xff, 0xff, 0xff, 0xff, (s32) (0 < mainfolderimages->unk6), 0); - folder_option_COPY_left_bound.unk0 = (f32) (spAC - temp_f10); - folder_option_COPY_left_bound.unk4 = (f32) (spB0 - spA8); - folder_option_COPY_left_bound.unkC = (f32) (spA8 + spB0); - sp9C = (f32) D_80051A2C; - spA0 = (f32) D_80051A30; - temp_f6 = (f32) mainfolderimages->unk10; - phi_f6 = temp_f6; - if (mainfolderimages->unk10 < 0) - { - phi_f6 = temp_f6 + M_U32_MAX_VALUE_F; - } - sp94 = (f32) (phi_f6 * 0.5f); - temp_f18 = (f32) mainfolderimages->unk11; - phi_f18 = temp_f18; - if (mainfolderimages->unk11 < 0) - { - phi_f18 = temp_f18 + M_U32_MAX_VALUE_F; - } - sp98 = (f32) (phi_f18 * 0.5f); - likely_generate_DL_for_image_declaration(&arg0, mainfolderimages + 0xc, 4, 0, 0); - display_image_at_on_screen_coord(&arg0, &sp9C, &sp94, mainfolderimages->unk10, (s32) mainfolderimages->unk11, 0, 0, 1, 0xff, 0xff, 0xff, 0xff, (s32) (0 < mainfolderimages->unk12), 0); - folder_option_ERASE_left_bound.unk0 = (f32) (sp9C - sp94); - folder_option_ERASE_left_bound.unk4 = (f32) (spA0 - sp98); - folder_option_ERASE_left_bound.unkC = (f32) (sp98 + spA0); - sp8C = 110.0f; - sp90 = (f32) D_80051A34; - temp_f6_2 = (f32) mainfolderimages->unk1C; - phi_f6_2 = temp_f6_2; - if (mainfolderimages->unk1C < 0) - { - phi_f6_2 = temp_f6_2 + M_U32_MAX_VALUE_F; - } - sp84 = (f32) (phi_f6_2 * 0.5f); - temp_f10_2 = (f32) mainfolderimages->unk1D; - phi_f10 = temp_f10_2; - if (mainfolderimages->unk1D < 0) - { - phi_f10 = temp_f10_2 + M_U32_MAX_VALUE_F; - } - sp88 = (f32) (phi_f10 * 0.5f); - likely_generate_DL_for_image_declaration(&arg0, mainfolderimages + 0x18, 4, 0, 0); - display_image_at_on_screen_coord(&arg0, &sp8C, &sp84, mainfolderimages->unk1C, (s32) mainfolderimages->unk1D, 0, 0, 1, 0xff, 0xff, 0xff, 0xff, (s32) (0 < mainfolderimages->unk1E), 0); + if (folder_selected_for_deletion < 0) { - arg0 = load_draw_selected_icon_folder_select(arg0); + DL = load_draw_selected_icon_folder_select(DL); } - return arg0; + + return DL; } -#else -const char asc_D_8004F488[] = "\n"; -const char a_[] = "."; -const char asc_D_8004F490[] = "\n"; -GLOBAL_ASM( -.rdata -.late_rodata -glabel D_80051A28 -.word 0x438E8000 /* 285.0;*/ -glabel D_80051A2C -.word 0x43A78000 /* 335.0;*/ -glabel D_80051A30 -.word 0x438E8000 /* 285.0;*/ -glabel D_80051A34 -.word 0x438E8000 /* 285.0;*/ -.text -glabel constructor_menu05_fileselect -/* 040F38 7F00C408 27BDFE48 */ addiu $sp, $sp, -0x1b8 -/* 040F3C 7F00C40C 3C0E8003 */ lui $t6, %hi(unknown_folderselect_constructor) -/* 040F40 7F00C410 AFBF0064 */ sw $ra, 0x64($sp) -/* 040F44 7F00C414 AFBE0060 */ sw $fp, 0x60($sp) -/* 040F48 7F00C418 AFB7005C */ sw $s7, 0x5c($sp) -/* 040F4C 7F00C41C AFB60058 */ sw $s6, 0x58($sp) -/* 040F50 7F00C420 AFB50054 */ sw $s5, 0x54($sp) -/* 040F54 7F00C424 AFB40050 */ sw $s4, 0x50($sp) -/* 040F58 7F00C428 AFB3004C */ sw $s3, 0x4c($sp) -/* 040F5C 7F00C42C AFB20048 */ sw $s2, 0x48($sp) -/* 040F60 7F00C430 AFB10044 */ sw $s1, 0x44($sp) -/* 040F64 7F00C434 AFB00040 */ sw $s0, 0x40($sp) -/* 040F68 7F00C438 AFA401B8 */ sw $a0, 0x1b8($sp) -/* 040F6C 7F00C43C 25CEAF2C */ addiu $t6, %lo(unknown_folderselect_constructor) # addiu $t6, $t6, -0x50d4 -/* 040F70 7F00C440 8DC10000 */ lw $at, ($t6) -/* 040F74 7F00C444 27B001A8 */ addiu $s0, $sp, 0x1a8 -/* 040F78 7F00C448 3C088003 */ lui $t0, %hi(unknown_folderselect_constructor_0) -/* 040F7C 7F00C44C AE010000 */ sw $at, ($s0) -/* 040F80 7F00C450 8DD90004 */ lw $t9, 4($t6) -/* 040F84 7F00C454 2508AF38 */ addiu $t0, %lo(unknown_folderselect_constructor_0) # addiu $t0, $t0, -0x50c8 -/* 040F88 7F00C458 27B1019C */ addiu $s1, $sp, 0x19c -/* 040F8C 7F00C45C AE190004 */ sw $t9, 4($s0) -/* 040F90 7F00C460 8DC10008 */ lw $at, 8($t6) -/* 040F94 7F00C464 AE010008 */ sw $at, 8($s0) -/* 040F98 7F00C468 8D010000 */ lw $at, ($t0) -/* 040F9C 7F00C46C AE210000 */ sw $at, ($s1) -/* 040FA0 7F00C470 8D0B0004 */ lw $t3, 4($t0) -/* 040FA4 7F00C474 AE2B0004 */ sw $t3, 4($s1) -/* 040FA8 7F00C478 8D010008 */ lw $at, 8($t0) -/* 040FAC 7F00C47C AE210008 */ sw $at, 8($s1) -/* 040FB0 7F00C480 0FC07034 */ jal insert_imageDL -/* 040FB4 7F00C484 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 040FB8 7F00C488 244C0008 */ addiu $t4, $v0, 8 -/* 040FBC 7F00C48C AFAC01B8 */ sw $t4, 0x1b8($sp) -/* 040FC0 7F00C490 3C0DFC16 */ lui $t5, (0xFC167E2C >> 16) # lui $t5, 0xfc16 -/* 040FC4 7F00C494 3C1833FD */ lui $t8, (0x33FDF6FB >> 16) # lui $t8, 0x33fd -/* 040FC8 7F00C498 3718F6FB */ ori $t8, (0x33FDF6FB & 0xFFFF) # ori $t8, $t8, 0xf6fb -/* 040FCC 7F00C49C 35AD7E2C */ ori $t5, (0xFC167E2C & 0xFFFF) # ori $t5, $t5, 0x7e2c -/* 040FD0 7F00C4A0 AC4D0000 */ sw $t5, ($v0) -/* 040FD4 7F00C4A4 AC580004 */ sw $t8, 4($v0) -/* 040FD8 7F00C4A8 8FAF01B8 */ lw $t7, 0x1b8($sp) -/* 040FDC 7F00C4AC 3C19FB00 */ lui $t9, %hi(0xFB00000C) # $t9, 0xfb00 -/* 040FE0 7F00C4B0 240AFF14 */ li $t2, -236 -/* 040FE4 7F00C4B4 25EE0008 */ addiu $t6, $t7, 8 -/* 040FE8 7F00C4B8 AFAE01B8 */ sw $t6, 0x1b8($sp) -/* 040FEC 7F00C4BC ADEA0004 */ sw $t2, 4($t7) -/* 040FF0 7F00C4C0 0C001107 */ jal viGetX -/* 040FF4 7F00C4C4 ADF90000 */ sw $t9, ($t7) -/* 040FF8 7F00C4C8 44822000 */ mtc1 $v0, $f4 -/* 040FFC 7F00C4CC 3C01C2A0 */ li $at, 0xC2A00000 # -80.000000 -/* 041000 7F00C4D0 44814000 */ mtc1 $at, $f8 -/* 041004 7F00C4D4 468021A0 */ cvt.s.w $f6, $f4 -/* 041008 7F00C4D8 3C0144A0 */ li $at, 0x44A00000 # 1280.000000 -/* 04100C 7F00C4DC 44818000 */ mtc1 $at, $f16 -/* 041010 7F00C4E0 46083282 */ mul.s $f10, $f6, $f8 -/* 041014 7F00C4E4 0FC170D8 */ jal floorFloat -/* 041018 7F00C4E8 46105303 */ div.s $f12, $f10, $f16 -/* 04101C 7F00C4EC 4600048D */ trunc.w.s $f18, $f0 -/* 041020 7F00C4F0 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041024 7F00C4F4 02003025 */ move $a2, $s0 -/* 041028 7F00C4F8 02203825 */ move $a3, $s1 -/* 04102C 7F00C4FC 44059000 */ mfc1 $a1, $f18 -/* 041030 7F00C500 0FC01F32 */ jal sub_GAME_7F007CC8 -/* 041034 7F00C504 00000000 */ nop -/* 041038 7F00C508 24480008 */ addiu $t0, $v0, 8 -/* 04103C 7F00C50C AFA801B8 */ sw $t0, 0x1b8($sp) -/* 041040 7F00C510 3C0B0100 */ lui $t3, 0x100 -/* 041044 7F00C514 3C050600 */ lui $a1, 0x600 -/* 041048 7F00C518 256B0000 */ addiu $t3, $t3, 0 -/* 04104C 7F00C51C AC4B0004 */ sw $t3, 4($v0) -/* 041050 7F00C520 AC450000 */ sw $a1, ($v0) -/* 041054 7F00C524 8FAC01B8 */ lw $t4, 0x1b8($sp) -/* 041058 7F00C528 3C180100 */ lui $t8, 0x100 -/* 04105C 7F00C52C 27180040 */ addiu $t8, $t8, 0x40 -/* 041060 7F00C530 258D0008 */ addiu $t5, $t4, 8 -/* 041064 7F00C534 AFAD01B8 */ sw $t5, 0x1b8($sp) -/* 041068 7F00C538 3C128003 */ lui $s2, %hi(walletinst+0xc) -/* 04106C 7F00C53C 3C148003 */ lui $s4, %hi(unknown_folderselect) -/* 041070 7F00C540 2694AF44 */ addiu $s4, %lo(unknown_folderselect) # addiu $s4, $s4, -0x50bc -/* 041074 7F00C544 2652A968 */ addiu $s2, %lo(walletinst+0xc) # addiu $s2, $s2, -0x5698 -/* 041078 7F00C548 27B30108 */ addiu $s3, $sp, 0x108 -/* 04107C 7F00C54C AD980004 */ sw $t8, 4($t4) -/* 041080 7F00C550 AD850000 */ sw $a1, ($t4) -/* 041084 7F00C554 27A4014C */ addiu $a0, $sp, 0x14c -.L7F00C558: -/* 041088 7F00C558 00805025 */ move $t2, $a0 -/* 04108C 7F00C55C 0280C825 */ move $t9, $s4 -/* 041090 7F00C560 268E003C */ addiu $t6, $s4, 0x3c -.L7F00C564: -/* 041094 7F00C564 8F210000 */ lw $at, ($t9) -/* 041098 7F00C568 2739000C */ addiu $t9, %lo(0xFB00000C) # addiu $t9, $t9, 0xc -/* 04109C 7F00C56C 254A000C */ addiu $t2, $t2, 0xc -/* 0410A0 7F00C570 AD41FFF4 */ sw $at, -0xc($t2) -/* 0410A4 7F00C574 8F21FFF8 */ lw $at, -8($t9) -/* 0410A8 7F00C578 AD41FFF8 */ sw $at, -8($t2) -/* 0410AC 7F00C57C 8F21FFFC */ lw $at, -4($t9) -/* 0410B0 7F00C580 172EFFF8 */ bne $t9, $t6, .L7F00C564 -/* 0410B4 7F00C584 AD41FFFC */ sw $at, -4($t2) -/* 0410B8 7F00C588 8F210000 */ lw $at, ($t9) -/* 0410BC 7F00C58C 24090003 */ li $t1, 3 -/* 0410C0 7F00C590 00008825 */ move $s1, $zero -/* 0410C4 7F00C594 AD410000 */ sw $at, ($t2) -/* 0410C8 7F00C598 8FA801B8 */ lw $t0, 0x1b8($sp) -/* 0410CC 7F00C59C AFA90154 */ sw $t1, 0x154($sp) -/* 0410D0 7F00C5A0 AFA00150 */ sw $zero, 0x150($sp) -/* 0410D4 7F00C5A4 8E450000 */ lw $a1, ($s2) -/* 0410D8 7F00C5A8 0FC1D1A1 */ jal subdraw -/* 0410DC 7F00C5AC AFA80158 */ sw $t0, 0x158($sp) -/* 0410E0 7F00C5B0 8FAB0158 */ lw $t3, 0x158($sp) -/* 0410E4 7F00C5B4 8E420000 */ lw $v0, ($s2) -/* 0410E8 7F00C5B8 00008025 */ move $s0, $zero -/* 0410EC 7F00C5BC AFAB01B8 */ sw $t3, 0x1b8($sp) -/* 0410F0 7F00C5C0 8C4C0008 */ lw $t4, 8($v0) -/* 0410F4 7F00C5C4 858D000E */ lh $t5, 0xe($t4) -/* 0410F8 7F00C5C8 19A00013 */ blez $t5, .L7F00C618 -/* 0410FC 7F00C5CC 00000000 */ nop -/* 041100 7F00C5D0 8C58000C */ lw $t8, 0xc($v0) -.L7F00C5D4: -/* 041104 7F00C5D4 02602825 */ move $a1, $s3 -/* 041108 7F00C5D8 0FC16008 */ jal matrix_4x4_copy -/* 04110C 7F00C5DC 03102021 */ addu $a0, $t8, $s0 -/* 041110 7F00C5E0 8E4F0000 */ lw $t7, ($s2) -/* 041114 7F00C5E4 0011C980 */ sll $t9, $s1, 6 -/* 041118 7F00C5E8 02602025 */ move $a0, $s3 -/* 04111C 7F00C5EC 8DEE000C */ lw $t6, 0xc($t7) -/* 041120 7F00C5F0 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 041124 7F00C5F4 01D92821 */ addu $a1, $t6, $t9 -/* 041128 7F00C5F8 8E420000 */ lw $v0, ($s2) -/* 04112C 7F00C5FC 26310001 */ addiu $s1, $s1, 1 -/* 041130 7F00C600 26100040 */ addiu $s0, $s0, 0x40 -/* 041134 7F00C604 8C4A0008 */ lw $t2, 8($v0) -/* 041138 7F00C608 8549000E */ lh $t1, 0xe($t2) -/* 04113C 7F00C60C 0229082A */ slt $at, $s1, $t1 -/* 041140 7F00C610 5420FFF0 */ bnezl $at, .L7F00C5D4 -/* 041144 7F00C614 8C58000C */ lw $t8, 0xc($v0) -.L7F00C618: -/* 041148 7F00C618 3C088003 */ lui $t0, %hi(walletinst) -/* 04114C 7F00C61C 2508A95C */ addiu $t0, %lo(walletinst) # addiu $t0, $t0, -0x56a4 -/* 041150 7F00C620 2652FFFC */ addiu $s2, $s2, -4 -/* 041154 7F00C624 0248082B */ sltu $at, $s2, $t0 -/* 041158 7F00C628 5020FFCB */ beql $at, $zero, .L7F00C558 -/* 04115C 7F00C62C 27A4014C */ addiu $a0, $sp, 0x14c -/* 041160 7F00C630 0FC2B366 */ jal microcode_constructor -/* 041164 7F00C634 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041168 7F00C638 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 04116C 7F00C63C 0FC2B2DE */ jal setTextSpacingInverted -/* 041170 7F00C640 00002025 */ move $a0, $zero -/* 041174 7F00C644 3C0B8007 */ lui $t3, %hi(dword_CODE_bss_80069620) -/* 041178 7F00C648 256B9620 */ addiu $t3, %lo(dword_CODE_bss_80069620) # addiu $t3, $t3, -0x69e0 -/* 04117C 7F00C64C 3C1EEBD8 */ lui $fp, (0xEBD879FF >> 16) # lui $fp, 0xebd8 -/* 041180 7F00C650 3C148004 */ lui $s4, %hi(ptrFirstFontTableLarge) -/* 041184 7F00C654 3C138004 */ lui $s3, %hi(ptrSecondFontTableLarge) -/* 041188 7F00C658 26730EB8 */ addiu $s3, %lo(ptrSecondFontTableLarge) # addiu $s3, $s3, 0xeb8 -/* 04118C 7F00C65C 26940EB4 */ addiu $s4, %lo(ptrFirstFontTableLarge) # addiu $s4, $s4, 0xeb4 -/* 041190 7F00C660 37DE79FF */ ori $fp, (0xEBD879FF & 0xFFFF) # ori $fp, $fp, 0x79ff -/* 041194 7F00C664 AFAB0074 */ sw $t3, 0x74($sp) -/* 041198 7F00C668 AFA001B4 */ sw $zero, 0x1b4($sp) -/* 04119C 7F00C66C 27B700FC */ addiu $s7, $sp, 0xfc -/* 0411A0 7F00C670 27B60100 */ addiu $s6, $sp, 0x100 -/* 0411A4 7F00C674 27B500BC */ addiu $s5, $sp, 0xbc -.L7F00C678: -/* 0411A8 7F00C678 8FA40074 */ lw $a0, 0x74($sp) -/* 0411AC 7F00C67C 0FC1DFFD */ jal sub_GAME_7F077FF4 -/* 0411B0 7F00C680 27A500E4 */ addiu $a1, $sp, 0xe4 -/* 0411B4 7F00C684 3C0C8003 */ lui $t4, %hi(folder_selected_for_deletion) -/* 0411B8 7F00C688 8FA401B4 */ lw $a0, 0x1b4($sp) -/* 0411BC 7F00C68C 8D8CA91C */ lw $t4, %lo(folder_selected_for_deletion)($t4) -/* 0411C0 7F00C690 27A500F0 */ addiu $a1, $sp, 0xf0 -/* 0411C4 7F00C694 148C00F2 */ bne $a0, $t4, .L7F00CA60 -/* 0411C8 7F00C698 00000000 */ nop -/* 0411CC 7F00C69C 0FC170D8 */ jal floorFloat -/* 0411D0 7F00C6A0 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 0411D4 7F00C6A4 4600010D */ trunc.w.s $f4, $f0 -/* 0411D8 7F00C6A8 C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 0411DC 7F00C6AC 44122000 */ mfc1 $s2, $f4 -/* 0411E0 7F00C6B0 00000000 */ nop -/* 0411E4 7F00C6B4 2652FFCF */ addiu $s2, $s2, -0x31 -/* 0411E8 7F00C6B8 0FC170D8 */ jal floorFloat -/* 0411EC 7F00C6BC AFB20100 */ sw $s2, 0x100($sp) -/* 0411F0 7F00C6C0 4600018D */ trunc.w.s $f6, $f0 -/* 0411F4 7F00C6C4 8FA50100 */ lw $a1, 0x100($sp) -/* 0411F8 7F00C6C8 240E0032 */ li $t6, 50 -/* 0411FC 7F00C6CC AFAE0014 */ sw $t6, 0x14($sp) -/* 041200 7F00C6D0 44103000 */ mfc1 $s0, $f6 -/* 041204 7F00C6D4 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041208 7F00C6D8 24A70063 */ addiu $a3, $a1, 0x63 -/* 04120C 7F00C6DC 26060019 */ addiu $a2, $s0, 0x19 -/* 041210 7F00C6E0 24CF002A */ addiu $t7, $a2, 0x2a -/* 041214 7F00C6E4 AFAF0010 */ sw $t7, 0x10($sp) -/* 041218 7F00C6E8 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04121C 7F00C6EC AFA600FC */ sw $a2, 0xfc($sp) -/* 041220 7F00C6F0 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 041224 7F00C6F4 0FC30776 */ jal langGet -/* 041228 7F00C6F8 34049C17 */ li $a0, 39959 -/* 04122C 7F00C6FC 00408825 */ move $s1, $v0 -/* 041230 7F00C700 0FC170D8 */ jal floorFloat -/* 041234 7F00C704 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 041238 7F00C708 4600020D */ trunc.w.s $f8, $f0 -/* 04123C 7F00C70C C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 041240 7F00C710 44124000 */ mfc1 $s2, $f8 -/* 041244 7F00C714 00000000 */ nop -/* 041248 7F00C718 2652FFD1 */ addiu $s2, $s2, -0x2f -/* 04124C 7F00C71C 0FC170D8 */ jal floorFloat -/* 041250 7F00C720 AFB20100 */ sw $s2, 0x100($sp) -/* 041254 7F00C724 4600028D */ trunc.w.s $f10, $f0 -/* 041258 7F00C728 44105000 */ mfc1 $s0, $f10 -/* 04125C 7F00C72C 00000000 */ nop -/* 041260 7F00C730 2610001E */ addiu $s0, $s0, 0x1e -/* 041264 7F00C734 0C001107 */ jal viGetX -/* 041268 7F00C738 AFB000FC */ sw $s0, 0xfc($sp) -/* 04126C 7F00C73C 00028400 */ sll $s0, $v0, 0x10 -/* 041270 7F00C740 00104C03 */ sra $t1, $s0, 0x10 -/* 041274 7F00C744 0C00110B */ jal viGetY -/* 041278 7F00C748 01208025 */ move $s0, $t1 -/* 04127C 7F00C74C 8E680000 */ lw $t0, ($s3) -/* 041280 7F00C750 8E8B0000 */ lw $t3, ($s4) -/* 041284 7F00C754 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041288 7F00C758 02C02825 */ move $a1, $s6 -/* 04128C 7F00C75C 02E03025 */ move $a2, $s7 -/* 041290 7F00C760 02203825 */ move $a3, $s1 -/* 041294 7F00C764 AFBE0018 */ sw $fp, 0x18($sp) -/* 041298 7F00C768 AFB0001C */ sw $s0, 0x1c($sp) -/* 04129C 7F00C76C AFA20020 */ sw $v0, 0x20($sp) -/* 0412A0 7F00C770 AFA00024 */ sw $zero, 0x24($sp) -/* 0412A4 7F00C774 AFA00028 */ sw $zero, 0x28($sp) -/* 0412A8 7F00C778 AFA80010 */ sw $t0, 0x10($sp) -/* 0412AC 7F00C77C 0FC2B6AF */ jal en_text_write_stuff -/* 0412B0 7F00C780 AFAB0014 */ sw $t3, 0x14($sp) -/* 0412B4 7F00C784 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 0412B8 7F00C788 0FC30776 */ jal langGet -/* 0412BC 7F00C78C 34049C18 */ li $a0, 39960 -/* 0412C0 7F00C790 00408825 */ move $s1, $v0 -/* 0412C4 7F00C794 0FC170D8 */ jal floorFloat -/* 0412C8 7F00C798 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 0412CC 7F00C79C 4600040D */ trunc.w.s $f16, $f0 -/* 0412D0 7F00C7A0 C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 0412D4 7F00C7A4 44128000 */ mfc1 $s2, $f16 -/* 0412D8 7F00C7A8 00000000 */ nop -/* 0412DC 7F00C7AC 2652FFD1 */ addiu $s2, $s2, -0x2f -/* 0412E0 7F00C7B0 0FC170D8 */ jal floorFloat -/* 0412E4 7F00C7B4 AFB20100 */ sw $s2, 0x100($sp) -/* 0412E8 7F00C7B8 4600048D */ trunc.w.s $f18, $f0 -/* 0412EC 7F00C7BC 3C188003 */ lui $t8, %hi(folder_selected_for_deletion_choice) -/* 0412F0 7F00C7C0 8F18A920 */ lw $t8, %lo(folder_selected_for_deletion_choice)($t8) -/* 0412F4 7F00C7C4 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 0412F8 7F00C7C8 44109000 */ mfc1 $s0, $f18 -/* 0412FC 7F00C7CC 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 041300 7F00C7D0 02203025 */ move $a2, $s1 -/* 041304 7F00C7D4 26100032 */ addiu $s0, $s0, 0x32 -/* 041308 7F00C7D8 1300002D */ beqz $t8, .L7F00C890 -/* 04130C 7F00C7DC AFB000FC */ sw $s0, 0xfc($sp) -/* 041310 7F00C7E0 8E8F0000 */ lw $t7, ($s4) -/* 041314 7F00C7E4 AFA000F4 */ sw $zero, 0xf4($sp) -/* 041318 7F00C7E8 AFA000F8 */ sw $zero, 0xf8($sp) -/* 04131C 7F00C7EC 8E670000 */ lw $a3, ($s3) -/* 041320 7F00C7F0 AFA00014 */ sw $zero, 0x14($sp) -/* 041324 7F00C7F4 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 041328 7F00C7F8 AFAF0010 */ sw $t7, 0x10($sp) -/* 04132C 7F00C7FC 8FB000FC */ lw $s0, 0xfc($sp) -/* 041330 7F00C800 8FB20100 */ lw $s2, 0x100($sp) -/* 041334 7F00C804 8FAE00F4 */ lw $t6, 0xf4($sp) -/* 041338 7F00C808 8FB900F8 */ lw $t9, 0xf8($sp) -/* 04133C 7F00C80C 24090032 */ li $t1, 50 -/* 041340 7F00C810 024E3821 */ addu $a3, $s2, $t6 -/* 041344 7F00C814 02195021 */ addu $t2, $s0, $t9 -/* 041348 7F00C818 AFAA0010 */ sw $t2, 0x10($sp) -/* 04134C 7F00C81C 24E70003 */ addiu $a3, $a3, 3 -/* 041350 7F00C820 AFA90014 */ sw $t1, 0x14($sp) -/* 041354 7F00C824 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041358 7F00C828 2606FFFF */ addiu $a2, $s0, -1 -/* 04135C 7F00C82C 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 041360 7F00C830 2645FFFF */ addiu $a1, $s2, -1 -/* 041364 7F00C834 0C001107 */ jal viGetX -/* 041368 7F00C838 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 04136C 7F00C83C 00028400 */ sll $s0, $v0, 0x10 -/* 041370 7F00C840 00104403 */ sra $t0, $s0, 0x10 -/* 041374 7F00C844 0C00110B */ jal viGetY -/* 041378 7F00C848 01008025 */ move $s0, $t0 -/* 04137C 7F00C84C 8E6B0000 */ lw $t3, ($s3) -/* 041380 7F00C850 8E8C0000 */ lw $t4, ($s4) -/* 041384 7F00C854 240DFFFF */ li $t5, -1 -/* 041388 7F00C858 AFAD0018 */ sw $t5, 0x18($sp) -/* 04138C 7F00C85C 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041390 7F00C860 02C02825 */ move $a1, $s6 -/* 041394 7F00C864 02E03025 */ move $a2, $s7 -/* 041398 7F00C868 02203825 */ move $a3, $s1 -/* 04139C 7F00C86C AFB0001C */ sw $s0, 0x1c($sp) -/* 0413A0 7F00C870 AFA20020 */ sw $v0, 0x20($sp) -/* 0413A4 7F00C874 AFA00024 */ sw $zero, 0x24($sp) -/* 0413A8 7F00C878 AFA00028 */ sw $zero, 0x28($sp) -/* 0413AC 7F00C87C AFAB0010 */ sw $t3, 0x10($sp) -/* 0413B0 7F00C880 0FC2B6AF */ jal en_text_write_stuff -/* 0413B4 7F00C884 AFAC0014 */ sw $t4, 0x14($sp) -/* 0413B8 7F00C888 10000016 */ b .L7F00C8E4 -/* 0413BC 7F00C88C AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00C890: -/* 0413C0 7F00C890 0C001107 */ jal viGetX -/* 0413C4 7F00C894 00000000 */ nop -/* 0413C8 7F00C898 00028400 */ sll $s0, $v0, 0x10 -/* 0413CC 7F00C89C 0010C403 */ sra $t8, $s0, 0x10 -/* 0413D0 7F00C8A0 0C00110B */ jal viGetY -/* 0413D4 7F00C8A4 03008025 */ move $s0, $t8 -/* 0413D8 7F00C8A8 8E6F0000 */ lw $t7, ($s3) -/* 0413DC 7F00C8AC 8E8E0000 */ lw $t6, ($s4) -/* 0413E0 7F00C8B0 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 0413E4 7F00C8B4 02C02825 */ move $a1, $s6 -/* 0413E8 7F00C8B8 02E03025 */ move $a2, $s7 -/* 0413EC 7F00C8BC 02203825 */ move $a3, $s1 -/* 0413F0 7F00C8C0 AFBE0018 */ sw $fp, 0x18($sp) -/* 0413F4 7F00C8C4 AFB0001C */ sw $s0, 0x1c($sp) -/* 0413F8 7F00C8C8 AFA20020 */ sw $v0, 0x20($sp) -/* 0413FC 7F00C8CC AFA00024 */ sw $zero, 0x24($sp) -/* 041400 7F00C8D0 AFA00028 */ sw $zero, 0x28($sp) -/* 041404 7F00C8D4 AFAF0010 */ sw $t7, 0x10($sp) -/* 041408 7F00C8D8 0FC2B6AF */ jal en_text_write_stuff -/* 04140C 7F00C8DC AFAE0014 */ sw $t6, 0x14($sp) -/* 041410 7F00C8E0 AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00C8E4: -/* 041414 7F00C8E4 0FC30776 */ jal langGet -/* 041418 7F00C8E8 34049C19 */ li $a0, 39961 -/* 04141C 7F00C8EC 00408825 */ move $s1, $v0 -/* 041420 7F00C8F0 0FC170D8 */ jal floorFloat -/* 041424 7F00C8F4 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 041428 7F00C8F8 3C198005 */ lui $t9, %hi(j_text_trigger) -/* 04142C 7F00C8FC 8F3984D0 */ lw $t9, %lo(j_text_trigger)($t9) -/* 041430 7F00C900 46000086 */ mov.s $f2, $f0 -/* 041434 7F00C904 4600110D */ trunc.w.s $f4, $f2 -/* 041438 7F00C908 13200003 */ beqz $t9, .L7F00C918 -/* 04143C 7F00C90C 2402FFFF */ li $v0, -1 -/* 041440 7F00C910 10000001 */ b .L7F00C918 -/* 041444 7F00C914 24020017 */ li $v0, 23 -.L7F00C918: -/* 041448 7F00C918 44092000 */ mfc1 $t1, $f4 -/* 04144C 7F00C91C C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 041450 7F00C920 00499021 */ addu $s2, $v0, $t1 -/* 041454 7F00C924 2652FFFF */ addiu $s2, $s2, -1 -/* 041458 7F00C928 0FC170D8 */ jal floorFloat -/* 04145C 7F00C92C AFB20100 */ sw $s2, 0x100($sp) -/* 041460 7F00C930 4600018D */ trunc.w.s $f6, $f0 -/* 041464 7F00C934 3C0B8003 */ lui $t3, %hi(folder_selected_for_deletion_choice) -/* 041468 7F00C938 8D6BA920 */ lw $t3, %lo(folder_selected_for_deletion_choice)($t3) -/* 04146C 7F00C93C 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 041470 7F00C940 44103000 */ mfc1 $s0, $f6 -/* 041474 7F00C944 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 041478 7F00C948 02203025 */ move $a2, $s1 -/* 04147C 7F00C94C 26100032 */ addiu $s0, $s0, 0x32 -/* 041480 7F00C950 11600017 */ beqz $t3, .L7F00C9B0 -/* 041484 7F00C954 AFB000FC */ sw $s0, 0xfc($sp) -/* 041488 7F00C958 0C001107 */ jal viGetX -/* 04148C 7F00C95C 00000000 */ nop -/* 041490 7F00C960 00028400 */ sll $s0, $v0, 0x10 -/* 041494 7F00C964 00106403 */ sra $t4, $s0, 0x10 -/* 041498 7F00C968 0C00110B */ jal viGetY -/* 04149C 7F00C96C 01808025 */ move $s0, $t4 -/* 0414A0 7F00C970 8E6D0000 */ lw $t5, ($s3) -/* 0414A4 7F00C974 8E980000 */ lw $t8, ($s4) -/* 0414A8 7F00C978 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 0414AC 7F00C97C 02C02825 */ move $a1, $s6 -/* 0414B0 7F00C980 02E03025 */ move $a2, $s7 -/* 0414B4 7F00C984 02203825 */ move $a3, $s1 -/* 0414B8 7F00C988 AFBE0018 */ sw $fp, 0x18($sp) -/* 0414BC 7F00C98C AFB0001C */ sw $s0, 0x1c($sp) -/* 0414C0 7F00C990 AFA20020 */ sw $v0, 0x20($sp) -/* 0414C4 7F00C994 AFA00024 */ sw $zero, 0x24($sp) -/* 0414C8 7F00C998 AFA00028 */ sw $zero, 0x28($sp) -/* 0414CC 7F00C99C AFAD0010 */ sw $t5, 0x10($sp) -/* 0414D0 7F00C9A0 0FC2B6AF */ jal en_text_write_stuff -/* 0414D4 7F00C9A4 AFB80014 */ sw $t8, 0x14($sp) -/* 0414D8 7F00C9A8 100000D6 */ b .L7F00CD04 -/* 0414DC 7F00C9AC AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00C9B0: -/* 0414E0 7F00C9B0 8E8F0000 */ lw $t7, ($s4) -/* 0414E4 7F00C9B4 AFA000F4 */ sw $zero, 0xf4($sp) -/* 0414E8 7F00C9B8 AFA000F8 */ sw $zero, 0xf8($sp) -/* 0414EC 7F00C9BC 8E670000 */ lw $a3, ($s3) -/* 0414F0 7F00C9C0 AFA00014 */ sw $zero, 0x14($sp) -/* 0414F4 7F00C9C4 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0414F8 7F00C9C8 AFAF0010 */ sw $t7, 0x10($sp) -/* 0414FC 7F00C9CC 8FB000FC */ lw $s0, 0xfc($sp) -/* 041500 7F00C9D0 8FB20100 */ lw $s2, 0x100($sp) -/* 041504 7F00C9D4 8FAE00F4 */ lw $t6, 0xf4($sp) -/* 041508 7F00C9D8 8FB900F8 */ lw $t9, 0xf8($sp) -/* 04150C 7F00C9DC 24090032 */ li $t1, 50 -/* 041510 7F00C9E0 024E3821 */ addu $a3, $s2, $t6 -/* 041514 7F00C9E4 02195021 */ addu $t2, $s0, $t9 -/* 041518 7F00C9E8 AFAA0010 */ sw $t2, 0x10($sp) -/* 04151C 7F00C9EC 24E70003 */ addiu $a3, $a3, 3 -/* 041520 7F00C9F0 AFA90014 */ sw $t1, 0x14($sp) -/* 041524 7F00C9F4 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041528 7F00C9F8 2606FFFF */ addiu $a2, $s0, -1 -/* 04152C 7F00C9FC 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 041530 7F00CA00 2645FFFF */ addiu $a1, $s2, -1 -/* 041534 7F00CA04 0C001107 */ jal viGetX -/* 041538 7F00CA08 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 04153C 7F00CA0C 00028400 */ sll $s0, $v0, 0x10 -/* 041540 7F00CA10 00104403 */ sra $t0, $s0, 0x10 -/* 041544 7F00CA14 0C00110B */ jal viGetY -/* 041548 7F00CA18 01008025 */ move $s0, $t0 -/* 04154C 7F00CA1C 8E6B0000 */ lw $t3, ($s3) -/* 041550 7F00CA20 8E8C0000 */ lw $t4, ($s4) -/* 041554 7F00CA24 240DFFFF */ li $t5, -1 -/* 041558 7F00CA28 AFAD0018 */ sw $t5, 0x18($sp) -/* 04155C 7F00CA2C 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041560 7F00CA30 02C02825 */ move $a1, $s6 -/* 041564 7F00CA34 02E03025 */ move $a2, $s7 -/* 041568 7F00CA38 02203825 */ move $a3, $s1 -/* 04156C 7F00CA3C AFB0001C */ sw $s0, 0x1c($sp) -/* 041570 7F00CA40 AFA20020 */ sw $v0, 0x20($sp) -/* 041574 7F00CA44 AFA00024 */ sw $zero, 0x24($sp) -/* 041578 7F00CA48 AFA00028 */ sw $zero, 0x28($sp) -/* 04157C 7F00CA4C AFAB0010 */ sw $t3, 0x10($sp) -/* 041580 7F00CA50 0FC2B6AF */ jal en_text_write_stuff -/* 041584 7F00CA54 AFAC0014 */ sw $t4, 0x14($sp) -/* 041588 7F00CA58 100000AA */ b .L7F00CD04 -/* 04158C 7F00CA5C AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00CA60: -/* 041590 7F00CA60 0FC07A1D */ jal fileGetHighestStageDifficultyCompletedForFolder -/* 041594 7F00CA64 27A600EC */ addiu $a2, $sp, 0xec -/* 041598 7F00CA68 8FA200F0 */ lw $v0, 0xf0($sp) -/* 04159C 7F00CA6C 8FA400EC */ lw $a0, 0xec($sp) -/* 0415A0 7F00CA70 044200A5 */ bltzl $v0, .L7F00CD08 -/* 0415A4 7F00CA74 8FA901B4 */ lw $t1, 0x1b4($sp) -/* 0415A8 7F00CA78 048200A3 */ bltzl $a0, .L7F00CD08 -/* 0415AC 7F00CA7C 8FA901B4 */ lw $t1, 0x1b4($sp) -/* 0415B0 7F00CA80 0FC030E1 */ jal get_ptr_difficulty_name -/* 0415B4 7F00CA84 00000000 */ nop -/* 0415B8 7F00CA88 10400038 */ beqz $v0, .L7F00CB6C -/* 0415BC 7F00CA8C 27A400D0 */ addiu $a0, $sp, 0xd0 -/* 0415C0 7F00CA90 0C0029DC */ jal strcpy -/* 0415C4 7F00CA94 00402825 */ move $a1, $v0 -/* 0415C8 7F00CA98 3C058005 */ lui $a1, %hi(asc_D_8004F488) -/* 0415CC 7F00CA9C 24A5F488 */ addiu $a1, %lo(asc_D_8004F488) # addiu $a1, $a1, -0xb78 -/* 0415D0 7F00CAA0 0C0029FF */ jal strcat -/* 0415D4 7F00CAA4 27A400D0 */ addiu $a0, $sp, 0xd0 -/* 0415D8 7F00CAA8 8E980000 */ lw $t8, ($s4) -/* 0415DC 7F00CAAC AFA000F4 */ sw $zero, 0xf4($sp) -/* 0415E0 7F00CAB0 AFA000F8 */ sw $zero, 0xf8($sp) -/* 0415E4 7F00CAB4 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 0415E8 7F00CAB8 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 0415EC 7F00CABC 27A600D0 */ addiu $a2, $sp, 0xd0 -/* 0415F0 7F00CAC0 8E670000 */ lw $a3, ($s3) -/* 0415F4 7F00CAC4 AFA00014 */ sw $zero, 0x14($sp) -/* 0415F8 7F00CAC8 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0415FC 7F00CACC AFB80010 */ sw $t8, 0x10($sp) -/* 041600 7F00CAD0 0FC170D8 */ jal floorFloat -/* 041604 7F00CAD4 C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 041608 7F00CAD8 4600020D */ trunc.w.s $f8, $f0 -/* 04160C 7F00CADC 8FB900F4 */ lw $t9, 0xf4($sp) -/* 041610 7F00CAE0 C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 041614 7F00CAE4 440E4000 */ mfc1 $t6, $f8 -/* 041618 7F00CAE8 07210003 */ bgez $t9, .L7F00CAF8 -/* 04161C 7F00CAEC 00195043 */ sra $t2, $t9, 1 -/* 041620 7F00CAF0 27210001 */ addiu $at, $t9, 1 -/* 041624 7F00CAF4 00015043 */ sra $t2, $at, 1 -.L7F00CAF8: -/* 041628 7F00CAF8 01CA9023 */ subu $s2, $t6, $t2 -/* 04162C 7F00CAFC 2652FFFF */ addiu $s2, $s2, -1 -/* 041630 7F00CB00 0FC170D8 */ jal floorFloat -/* 041634 7F00CB04 AFB20100 */ sw $s2, 0x100($sp) -/* 041638 7F00CB08 4600028D */ trunc.w.s $f10, $f0 -/* 04163C 7F00CB0C 44105000 */ mfc1 $s0, $f10 -/* 041640 7F00CB10 00000000 */ nop -/* 041644 7F00CB14 26100015 */ addiu $s0, $s0, 0x15 -/* 041648 7F00CB18 0C001107 */ jal viGetX -/* 04164C 7F00CB1C AFB000FC */ sw $s0, 0xfc($sp) -/* 041650 7F00CB20 00028400 */ sll $s0, $v0, 0x10 -/* 041654 7F00CB24 00104403 */ sra $t0, $s0, 0x10 -/* 041658 7F00CB28 0C00110B */ jal viGetY -/* 04165C 7F00CB2C 01008025 */ move $s0, $t0 -/* 041660 7F00CB30 8E6B0000 */ lw $t3, ($s3) -/* 041664 7F00CB34 8E8C0000 */ lw $t4, ($s4) -/* 041668 7F00CB38 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 04166C 7F00CB3C 02C02825 */ move $a1, $s6 -/* 041670 7F00CB40 02E03025 */ move $a2, $s7 -/* 041674 7F00CB44 27A700D0 */ addiu $a3, $sp, 0xd0 -/* 041678 7F00CB48 AFBE0018 */ sw $fp, 0x18($sp) -/* 04167C 7F00CB4C AFB0001C */ sw $s0, 0x1c($sp) -/* 041680 7F00CB50 AFA20020 */ sw $v0, 0x20($sp) -/* 041684 7F00CB54 AFA00024 */ sw $zero, 0x24($sp) -/* 041688 7F00CB58 AFA00028 */ sw $zero, 0x28($sp) -/* 04168C 7F00CB5C AFAB0010 */ sw $t3, 0x10($sp) -/* 041690 7F00CB60 0FC2B6AF */ jal en_text_write_stuff -/* 041694 7F00CB64 AFAC0014 */ sw $t4, 0x14($sp) -/* 041698 7F00CB68 AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00CB6C: -/* 04169C 7F00CB6C 8FA400EC */ lw $a0, 0xec($sp) -/* 0416A0 7F00CB70 24010003 */ li $at, 3 -/* 0416A4 7F00CB74 2412FFFF */ li $s2, -1 -/* 0416A8 7F00CB78 10810062 */ beq $a0, $at, .L7F00CD04 -/* 0416AC 7F00CB7C 00008825 */ move $s1, $zero -/* 0416B0 7F00CB80 0FC30776 */ jal langGet -/* 0416B4 7F00CB84 34049C1A */ li $a0, 39962 -/* 0416B8 7F00CB88 02A02025 */ move $a0, $s5 -/* 0416BC 7F00CB8C 0C0029DC */ jal strcpy -/* 0416C0 7F00CB90 00402825 */ move $a1, $v0 -/* 0416C4 7F00CB94 3C0D8003 */ lui $t5, %hi(mission_folder_setup_entries+0x4) -/* 0416C8 7F00CB98 95ADABE8 */ lhu $t5, %lo(mission_folder_setup_entries+0x4)($t5) -/* 0416CC 7F00CB9C 3C108003 */ lui $s0, %hi(mission_folder_setup_entries) -/* 0416D0 7F00CBA0 2610ABE4 */ addiu $s0, %lo(mission_folder_setup_entries) # addiu $s0, $s0, -0x541c -/* 0416D4 7F00CBA4 11A0000D */ beqz $t5, .L7F00CBDC -/* 0416D8 7F00CBA8 8FA200F0 */ lw $v0, 0xf0($sp) -/* 0416DC 7F00CBAC 8E180014 */ lw $t8, 0x14($s0) -.L7F00CBB0: -/* 0416E0 7F00CBB0 54580006 */ bnel $v0, $t8, .L7F00CBCC -/* 0416E4 7F00CBB4 960F0020 */ lhu $t7, 0x20($s0) -/* 0416E8 7F00CBB8 0FC02EC7 */ jal get_chapter_briefing_entry -/* 0416EC 7F00CBBC 02202025 */ move $a0, $s1 -/* 0416F0 7F00CBC0 10000006 */ b .L7F00CBDC -/* 0416F4 7F00CBC4 00409025 */ move $s2, $v0 -/* 0416F8 7F00CBC8 960F0020 */ lhu $t7, 0x20($s0) -.L7F00CBCC: -/* 0416FC 7F00CBCC 26310001 */ addiu $s1, $s1, 1 -/* 041700 7F00CBD0 2610001C */ addiu $s0, $s0, 0x1c -/* 041704 7F00CBD4 55E0FFF6 */ bnezl $t7, .L7F00CBB0 -/* 041708 7F00CBD8 8E180014 */ lw $t8, 0x14($s0) -.L7F00CBDC: -/* 04170C 7F00CBDC 0011C8C0 */ sll $t9, $s1, 3 -/* 041710 7F00CBE0 0331C823 */ subu $t9, $t9, $s1 -/* 041714 7F00CBE4 3C0E8003 */ lui $t6, %hi(mission_folder_setup_entries) -/* 041718 7F00CBE8 25CEABE4 */ addiu $t6, %lo(mission_folder_setup_entries) # addiu $t6, $t6, -0x541c -/* 04171C 7F00CBEC 0019C880 */ sll $t9, $t9, 2 -/* 041720 7F00CBF0 0640000C */ bltz $s2, .L7F00CC24 -/* 041724 7F00CBF4 032E8021 */ addu $s0, $t9, $t6 -/* 041728 7F00CBF8 001250C0 */ sll $t2, $s2, 3 -/* 04172C 7F00CBFC 01525023 */ subu $t2, $t2, $s2 -/* 041730 7F00CC00 000A5080 */ sll $t2, $t2, 2 -/* 041734 7F00CC04 014E4821 */ addu $t1, $t2, $t6 -/* 041738 7F00CC08 8D250000 */ lw $a1, ($t1) -/* 04173C 7F00CC0C 0C0029FF */ jal strcat -/* 041740 7F00CC10 02A02025 */ move $a0, $s5 -/* 041744 7F00CC14 3C058005 */ lui $a1, %hi(a_) -/* 041748 7F00CC18 24A5F48C */ addiu $a1, %lo(a_) # addiu $a1, $a1, -0xb74 -/* 04174C 7F00CC1C 0C0029FF */ jal strcat -/* 041750 7F00CC20 02A02025 */ move $a0, $s5 -.L7F00CC24: -/* 041754 7F00CC24 02A02025 */ move $a0, $s5 -/* 041758 7F00CC28 0C0029FF */ jal strcat -/* 04175C 7F00CC2C 8E050000 */ lw $a1, ($s0) -/* 041760 7F00CC30 3C058005 */ lui $a1, %hi(asc_D_8004F490) -/* 041764 7F00CC34 24A5F490 */ addiu $a1, %lo(asc_D_8004F490) # addiu $a1, $a1, -0xb70 -/* 041768 7F00CC38 0C0029FF */ jal strcat -/* 04176C 7F00CC3C 02A02025 */ move $a0, $s5 -/* 041770 7F00CC40 8E880000 */ lw $t0, ($s4) -/* 041774 7F00CC44 AFA000F4 */ sw $zero, 0xf4($sp) -/* 041778 7F00CC48 AFA000F8 */ sw $zero, 0xf8($sp) -/* 04177C 7F00CC4C 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 041780 7F00CC50 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 041784 7F00CC54 02A03025 */ move $a2, $s5 -/* 041788 7F00CC58 8E670000 */ lw $a3, ($s3) -/* 04178C 7F00CC5C AFA00014 */ sw $zero, 0x14($sp) -/* 041790 7F00CC60 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 041794 7F00CC64 AFA80010 */ sw $t0, 0x10($sp) -/* 041798 7F00CC68 0FC170D8 */ jal floorFloat -/* 04179C 7F00CC6C C7AC00E4 */ lwc1 $f12, 0xe4($sp) -/* 0417A0 7F00CC70 4600040D */ trunc.w.s $f16, $f0 -/* 0417A4 7F00CC74 8FAD00F4 */ lw $t5, 0xf4($sp) -/* 0417A8 7F00CC78 C7AC00E8 */ lwc1 $f12, 0xe8($sp) -/* 0417AC 7F00CC7C 440C8000 */ mfc1 $t4, $f16 -/* 0417B0 7F00CC80 05A10003 */ bgez $t5, .L7F00CC90 -/* 0417B4 7F00CC84 000DC043 */ sra $t8, $t5, 1 -/* 0417B8 7F00CC88 25A10001 */ addiu $at, $t5, 1 -/* 0417BC 7F00CC8C 0001C043 */ sra $t8, $at, 1 -.L7F00CC90: -/* 0417C0 7F00CC90 01989023 */ subu $s2, $t4, $t8 -/* 0417C4 7F00CC94 2652FFFF */ addiu $s2, $s2, -1 -/* 0417C8 7F00CC98 0FC170D8 */ jal floorFloat -/* 0417CC 7F00CC9C AFB20100 */ sw $s2, 0x100($sp) -/* 0417D0 7F00CCA0 4600048D */ trunc.w.s $f18, $f0 -/* 0417D4 7F00CCA4 44109000 */ mfc1 $s0, $f18 -/* 0417D8 7F00CCA8 00000000 */ nop -/* 0417DC 7F00CCAC 2610002D */ addiu $s0, $s0, 0x2d -/* 0417E0 7F00CCB0 0C001107 */ jal viGetX -/* 0417E4 7F00CCB4 AFB000FC */ sw $s0, 0xfc($sp) -/* 0417E8 7F00CCB8 00028400 */ sll $s0, $v0, 0x10 -/* 0417EC 7F00CCBC 0010CC03 */ sra $t9, $s0, 0x10 -/* 0417F0 7F00CCC0 0C00110B */ jal viGetY -/* 0417F4 7F00CCC4 03208025 */ move $s0, $t9 -/* 0417F8 7F00CCC8 8E6A0000 */ lw $t2, ($s3) -/* 0417FC 7F00CCCC 8E8E0000 */ lw $t6, ($s4) -/* 041800 7F00CCD0 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041804 7F00CCD4 02C02825 */ move $a1, $s6 -/* 041808 7F00CCD8 02E03025 */ move $a2, $s7 -/* 04180C 7F00CCDC 02A03825 */ move $a3, $s5 -/* 041810 7F00CCE0 AFBE0018 */ sw $fp, 0x18($sp) -/* 041814 7F00CCE4 AFB0001C */ sw $s0, 0x1c($sp) -/* 041818 7F00CCE8 AFA20020 */ sw $v0, 0x20($sp) -/* 04181C 7F00CCEC AFA00024 */ sw $zero, 0x24($sp) -/* 041820 7F00CCF0 AFA00028 */ sw $zero, 0x28($sp) -/* 041824 7F00CCF4 AFAA0010 */ sw $t2, 0x10($sp) -/* 041828 7F00CCF8 0FC2B6AF */ jal en_text_write_stuff -/* 04182C 7F00CCFC AFAE0014 */ sw $t6, 0x14($sp) -/* 041830 7F00CD00 AFA201B8 */ sw $v0, 0x1b8($sp) -.L7F00CD04: -/* 041834 7F00CD04 8FA901B4 */ lw $t1, 0x1b4($sp) -.L7F00CD08: -/* 041838 7F00CD08 8FAB0074 */ lw $t3, 0x74($sp) -/* 04183C 7F00CD0C 24010004 */ li $at, 4 -/* 041840 7F00CD10 25280001 */ addiu $t0, $t1, 1 -/* 041844 7F00CD14 256D000C */ addiu $t5, $t3, 0xc -/* 041848 7F00CD18 AFAD0074 */ sw $t5, 0x74($sp) -/* 04184C 7F00CD1C 1501FE56 */ bne $t0, $at, .L7F00C678 -/* 041850 7F00CD20 AFA801B4 */ sw $t0, 0x1b4($sp) -/* 041854 7F00CD24 0FC2B2DE */ jal setTextSpacingInverted -/* 041858 7F00CD28 00002025 */ move $a0, $zero -/* 04185C 7F00CD2C 0FC30776 */ jal langGet -/* 041860 7F00CD30 34049C1B */ li $a0, 39963 -/* 041864 7F00CD34 8E8C0000 */ lw $t4, ($s4) -/* 041868 7F00CD38 00408825 */ move $s1, $v0 -/* 04186C 7F00CD3C AFA000F4 */ sw $zero, 0xf4($sp) -/* 041870 7F00CD40 AFA000F8 */ sw $zero, 0xf8($sp) -/* 041874 7F00CD44 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 041878 7F00CD48 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 04187C 7F00CD4C 00403025 */ move $a2, $v0 -/* 041880 7F00CD50 8E670000 */ lw $a3, ($s3) -/* 041884 7F00CD54 AFA00014 */ sw $zero, 0x14($sp) -/* 041888 7F00CD58 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04188C 7F00CD5C AFAC0010 */ sw $t4, 0x10($sp) -/* 041890 7F00CD60 8FB800F8 */ lw $t8, 0xf8($sp) -/* 041894 7F00CD64 241E011D */ li $fp, 285 -/* 041898 7F00CD68 241200F7 */ li $s2, 247 -/* 04189C 7F00CD6C 07010003 */ bgez $t8, .L7F00CD7C -/* 0418A0 7F00CD70 00187843 */ sra $t7, $t8, 1 -/* 0418A4 7F00CD74 27010001 */ addiu $at, $t8, 1 -/* 0418A8 7F00CD78 00017843 */ sra $t7, $at, 1 -.L7F00CD7C: -/* 0418AC 7F00CD7C 03CF8023 */ subu $s0, $fp, $t7 -/* 0418B0 7F00CD80 AFB000FC */ sw $s0, 0xfc($sp) -/* 0418B4 7F00CD84 0C001107 */ jal viGetX -/* 0418B8 7F00CD88 AFB20100 */ sw $s2, 0x100($sp) -/* 0418BC 7F00CD8C 00028400 */ sll $s0, $v0, 0x10 -/* 0418C0 7F00CD90 0010CC03 */ sra $t9, $s0, 0x10 -/* 0418C4 7F00CD94 0C00110B */ jal viGetY -/* 0418C8 7F00CD98 03208025 */ move $s0, $t9 -/* 0418CC 7F00CD9C 8E6A0000 */ lw $t2, ($s3) -/* 0418D0 7F00CDA0 8E8E0000 */ lw $t6, ($s4) -/* 0418D4 7F00CDA4 2409FFFF */ li $t1, -1 -/* 0418D8 7F00CDA8 AFA90018 */ sw $t1, 0x18($sp) -/* 0418DC 7F00CDAC 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 0418E0 7F00CDB0 02C02825 */ move $a1, $s6 -/* 0418E4 7F00CDB4 02E03025 */ move $a2, $s7 -/* 0418E8 7F00CDB8 02203825 */ move $a3, $s1 -/* 0418EC 7F00CDBC AFB0001C */ sw $s0, 0x1c($sp) -/* 0418F0 7F00CDC0 AFA20020 */ sw $v0, 0x20($sp) -/* 0418F4 7F00CDC4 AFA00024 */ sw $zero, 0x24($sp) -/* 0418F8 7F00CDC8 AFA00028 */ sw $zero, 0x28($sp) -/* 0418FC 7F00CDCC AFAA0010 */ sw $t2, 0x10($sp) -/* 041900 7F00CDD0 0FC2B6AF */ jal en_text_write_stuff -/* 041904 7F00CDD4 AFAE0014 */ sw $t6, 0x14($sp) -/* 041908 7F00CDD8 8FB20100 */ lw $s2, 0x100($sp) -/* 04190C 7F00CDDC 8FAB00F4 */ lw $t3, 0xf4($sp) -/* 041910 7F00CDE0 3C158003 */ lui $s5, %hi(folder_option_COPY_left_bound) -/* 041914 7F00CDE4 26B5ABC4 */ addiu $s5, %lo(folder_option_COPY_left_bound) # addiu $s5, $s5, -0x543c -/* 041918 7F00CDE8 024B6821 */ addu $t5, $s2, $t3 -/* 04191C 7F00CDEC 448D2000 */ mtc1 $t5, $f4 -/* 041920 7F00CDF0 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 041924 7F00CDF4 34049C1C */ li $a0, 39964 -/* 041928 7F00CDF8 468021A0 */ cvt.s.w $f6, $f4 -/* 04192C 7F00CDFC 0FC30776 */ jal langGet -/* 041930 7F00CE00 E6A60008 */ swc1 $f6, 8($s5) -/* 041934 7F00CE04 8E880000 */ lw $t0, ($s4) -/* 041938 7F00CE08 00408825 */ move $s1, $v0 -/* 04193C 7F00CE0C AFA000F4 */ sw $zero, 0xf4($sp) -/* 041940 7F00CE10 AFA000F8 */ sw $zero, 0xf8($sp) -/* 041944 7F00CE14 27A400F8 */ addiu $a0, $sp, 0xf8 -/* 041948 7F00CE18 27A500F4 */ addiu $a1, $sp, 0xf4 -/* 04194C 7F00CE1C 00403025 */ move $a2, $v0 -/* 041950 7F00CE20 8E670000 */ lw $a3, ($s3) -/* 041954 7F00CE24 AFA00014 */ sw $zero, 0x14($sp) -/* 041958 7F00CE28 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04195C 7F00CE2C AFA80010 */ sw $t0, 0x10($sp) -/* 041960 7F00CE30 8FAC00F8 */ lw $t4, 0xf8($sp) -/* 041964 7F00CE34 24120165 */ li $s2, 357 -/* 041968 7F00CE38 AFB20100 */ sw $s2, 0x100($sp) -/* 04196C 7F00CE3C 05810003 */ bgez $t4, .L7F00CE4C -/* 041970 7F00CE40 000CC043 */ sra $t8, $t4, 1 -/* 041974 7F00CE44 25810001 */ addiu $at, $t4, 1 -/* 041978 7F00CE48 0001C043 */ sra $t8, $at, 1 -.L7F00CE4C: -/* 04197C 7F00CE4C 03D88023 */ subu $s0, $fp, $t8 -/* 041980 7F00CE50 0C001107 */ jal viGetX -/* 041984 7F00CE54 AFB000FC */ sw $s0, 0xfc($sp) -/* 041988 7F00CE58 00028400 */ sll $s0, $v0, 0x10 -/* 04198C 7F00CE5C 00107C03 */ sra $t7, $s0, 0x10 -/* 041990 7F00CE60 0C00110B */ jal viGetY -/* 041994 7F00CE64 01E08025 */ move $s0, $t7 -/* 041998 7F00CE68 8E790000 */ lw $t9, ($s3) -/* 04199C 7F00CE6C 8E8A0000 */ lw $t2, ($s4) -/* 0419A0 7F00CE70 240EFFFF */ li $t6, -1 -/* 0419A4 7F00CE74 AFAE0018 */ sw $t6, 0x18($sp) -/* 0419A8 7F00CE78 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 0419AC 7F00CE7C 02C02825 */ move $a1, $s6 -/* 0419B0 7F00CE80 02E03025 */ move $a2, $s7 -/* 0419B4 7F00CE84 02203825 */ move $a3, $s1 -/* 0419B8 7F00CE88 AFB0001C */ sw $s0, 0x1c($sp) -/* 0419BC 7F00CE8C AFA20020 */ sw $v0, 0x20($sp) -/* 0419C0 7F00CE90 AFA00024 */ sw $zero, 0x24($sp) -/* 0419C4 7F00CE94 AFA00028 */ sw $zero, 0x28($sp) -/* 0419C8 7F00CE98 AFB90010 */ sw $t9, 0x10($sp) -/* 0419CC 7F00CE9C 0FC2B6AF */ jal en_text_write_stuff -/* 0419D0 7F00CEA0 AFAA0014 */ sw $t2, 0x14($sp) -/* 0419D4 7F00CEA4 8FA90100 */ lw $t1, 0x100($sp) -/* 0419D8 7F00CEA8 8FAB00F4 */ lw $t3, 0xf4($sp) -/* 0419DC 7F00CEAC 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 0419E0 7F00CEB0 44810000 */ mtc1 $at, $f0 -/* 0419E4 7F00CEB4 012B6821 */ addu $t5, $t1, $t3 -/* 0419E8 7F00CEB8 448D4000 */ mtc1 $t5, $f8 -/* 0419EC 7F00CEBC 3C138003 */ lui $s3, %hi(folder_option_ERASE_left_bound) -/* 0419F0 7F00CEC0 3C014361 */ li $at, 0x43610000 # 225.000000 -/* 0419F4 7F00CEC4 468042A0 */ cvt.s.w $f10, $f8 -/* 0419F8 7F00CEC8 44818000 */ mtc1 $at, $f16 -/* 0419FC 7F00CECC 2673ABD4 */ addiu $s3, %lo(folder_option_ERASE_left_bound) # addiu $s3, $s3, -0x542c -/* 041A00 7F00CED0 3C118009 */ lui $s1, %hi(mainfolderimages) -/* 041A04 7F00CED4 3C018005 */ lui $at, %hi(D_80051A28) -/* 041A08 7F00CED8 2631D128 */ addiu $s1, %lo(mainfolderimages) # addiu $s1, $s1, -0x2ed8 -/* 041A0C 7F00CEDC E66A0008 */ swc1 $f10, 8($s3) -/* 041A10 7F00CEE0 C4321A28 */ lwc1 $f18, %lo(D_80051A28)($at) -/* 041A14 7F00CEE4 8E300000 */ lw $s0, ($s1) -/* 041A18 7F00CEE8 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 041A1C 7F00CEEC E7B000AC */ swc1 $f16, 0xac($sp) -/* 041A20 7F00CEF0 E7B200B0 */ swc1 $f18, 0xb0($sp) -/* 041A24 7F00CEF4 92080004 */ lbu $t0, 4($s0) -/* 041A28 7F00CEF8 27B201B8 */ addiu $s2, $sp, 0x1b8 -/* 041A2C 7F00CEFC 44882000 */ mtc1 $t0, $f4 -/* 041A30 7F00CF00 05010005 */ bgez $t0, .L7F00CF18 -/* 041A34 7F00CF04 468021A0 */ cvt.s.w $f6, $f4 -/* 041A38 7F00CF08 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041A3C 7F00CF0C 44814000 */ mtc1 $at, $f8 -/* 041A40 7F00CF10 00000000 */ nop -/* 041A44 7F00CF14 46083180 */ add.s $f6, $f6, $f8 -.L7F00CF18: -/* 041A48 7F00CF18 46003282 */ mul.s $f10, $f6, $f0 -/* 041A4C 7F00CF1C E7AA00A4 */ swc1 $f10, 0xa4($sp) -/* 041A50 7F00CF20 920C0005 */ lbu $t4, 5($s0) -/* 041A54 7F00CF24 448C8000 */ mtc1 $t4, $f16 -/* 041A58 7F00CF28 05810005 */ bgez $t4, .L7F00CF40 -/* 041A5C 7F00CF2C 468084A0 */ cvt.s.w $f18, $f16 -/* 041A60 7F00CF30 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041A64 7F00CF34 44812000 */ mtc1 $at, $f4 -/* 041A68 7F00CF38 00000000 */ nop -/* 041A6C 7F00CF3C 46049480 */ add.s $f18, $f18, $f4 -.L7F00CF40: -/* 041A70 7F00CF40 46009202 */ mul.s $f8, $f18, $f0 -/* 041A74 7F00CF44 02402025 */ move $a0, $s2 -/* 041A78 7F00CF48 02002825 */ move $a1, $s0 -/* 041A7C 7F00CF4C 24060004 */ li $a2, 4 -/* 041A80 7F00CF50 00003825 */ move $a3, $zero -/* 041A84 7F00CF54 AFA00010 */ sw $zero, 0x10($sp) -/* 041A88 7F00CF58 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 041A8C 7F00CF5C E7A800A8 */ swc1 $f8, 0xa8($sp) -/* 041A90 7F00CF60 8E300000 */ lw $s0, ($s1) -/* 041A94 7F00CF64 240F0001 */ li $t7, 1 -/* 041A98 7F00CF68 241900FF */ li $t9, 255 -/* 041A9C 7F00CF6C 92180005 */ lbu $t8, 5($s0) -/* 041AA0 7F00CF70 92070004 */ lbu $a3, 4($s0) -/* 041AA4 7F00CF74 240A00FF */ li $t2, 255 -/* 041AA8 7F00CF78 240E00FF */ li $t6, 255 -/* 041AAC 7F00CF7C 240900FF */ li $t1, 255 -/* 041AB0 7F00CF80 AFA9002C */ sw $t1, 0x2c($sp) -/* 041AB4 7F00CF84 AFAE0028 */ sw $t6, 0x28($sp) -/* 041AB8 7F00CF88 AFAA0024 */ sw $t2, 0x24($sp) -/* 041ABC 7F00CF8C AFB90020 */ sw $t9, 0x20($sp) -/* 041AC0 7F00CF90 AFAF001C */ sw $t7, 0x1c($sp) -/* 041AC4 7F00CF94 AFA00018 */ sw $zero, 0x18($sp) -/* 041AC8 7F00CF98 AFA00014 */ sw $zero, 0x14($sp) -/* 041ACC 7F00CF9C AFB80010 */ sw $t8, 0x10($sp) -/* 041AD0 7F00CFA0 920B0006 */ lbu $t3, 6($s0) -/* 041AD4 7F00CFA4 AFA00034 */ sw $zero, 0x34($sp) -/* 041AD8 7F00CFA8 02402025 */ move $a0, $s2 -/* 041ADC 7F00CFAC 000B682A */ slt $t5, $zero, $t3 -/* 041AE0 7F00CFB0 AFAD0030 */ sw $t5, 0x30($sp) -/* 041AE4 7F00CFB4 27A500AC */ addiu $a1, $sp, 0xac -/* 041AE8 7F00CFB8 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 041AEC 7F00CFBC 27A600A4 */ addiu $a2, $sp, 0xa4 -/* 041AF0 7F00CFC0 C7A600AC */ lwc1 $f6, 0xac($sp) -/* 041AF4 7F00CFC4 C7AA00A4 */ lwc1 $f10, 0xa4($sp) -/* 041AF8 7F00CFC8 C7A400B0 */ lwc1 $f4, 0xb0($sp) -/* 041AFC 7F00CFCC C7B200A8 */ lwc1 $f18, 0xa8($sp) -/* 041B00 7F00CFD0 460A3401 */ sub.s $f16, $f6, $f10 -/* 041B04 7F00CFD4 C7AA00B0 */ lwc1 $f10, 0xb0($sp) -/* 041B08 7F00CFD8 C7A600A8 */ lwc1 $f6, 0xa8($sp) -/* 041B0C 7F00CFDC 46122201 */ sub.s $f8, $f4, $f18 -/* 041B10 7F00CFE0 E6B00000 */ swc1 $f16, ($s5) -/* 041B14 7F00CFE4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 041B18 7F00CFE8 460A3400 */ add.s $f16, $f6, $f10 -/* 041B1C 7F00CFEC 44810000 */ mtc1 $at, $f0 -/* 041B20 7F00CFF0 E6A80004 */ swc1 $f8, 4($s5) -/* 041B24 7F00CFF4 3C018005 */ lui $at, %hi(D_80051A2C) -/* 041B28 7F00CFF8 E6B0000C */ swc1 $f16, 0xc($s5) -/* 041B2C 7F00CFFC C4241A2C */ lwc1 $f4, %lo(D_80051A2C)($at) -/* 041B30 7F00D000 3C018005 */ lui $at, %hi(D_80051A30) -/* 041B34 7F00D004 C4321A30 */ lwc1 $f18, %lo(D_80051A30)($at) -/* 041B38 7F00D008 8E300000 */ lw $s0, ($s1) -/* 041B3C 7F00D00C E7A4009C */ swc1 $f4, 0x9c($sp) -/* 041B40 7F00D010 E7B200A0 */ swc1 $f18, 0xa0($sp) -/* 041B44 7F00D014 92080010 */ lbu $t0, 0x10($s0) -/* 041B48 7F00D018 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041B4C 7F00D01C 44884000 */ mtc1 $t0, $f8 -/* 041B50 7F00D020 05010004 */ bgez $t0, .L7F00D034 -/* 041B54 7F00D024 468041A0 */ cvt.s.w $f6, $f8 -/* 041B58 7F00D028 44815000 */ mtc1 $at, $f10 -/* 041B5C 7F00D02C 00000000 */ nop -/* 041B60 7F00D030 460A3180 */ add.s $f6, $f6, $f10 -.L7F00D034: -/* 041B64 7F00D034 46003402 */ mul.s $f16, $f6, $f0 -/* 041B68 7F00D038 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041B6C 7F00D03C E7B00094 */ swc1 $f16, 0x94($sp) -/* 041B70 7F00D040 920C0011 */ lbu $t4, 0x11($s0) -/* 041B74 7F00D044 448C2000 */ mtc1 $t4, $f4 -/* 041B78 7F00D048 05810004 */ bgez $t4, .L7F00D05C -/* 041B7C 7F00D04C 468024A0 */ cvt.s.w $f18, $f4 -/* 041B80 7F00D050 44814000 */ mtc1 $at, $f8 -/* 041B84 7F00D054 00000000 */ nop -/* 041B88 7F00D058 46089480 */ add.s $f18, $f18, $f8 -.L7F00D05C: -/* 041B8C 7F00D05C 46009282 */ mul.s $f10, $f18, $f0 -/* 041B90 7F00D060 02402025 */ move $a0, $s2 -/* 041B94 7F00D064 2605000C */ addiu $a1, $s0, 0xc -/* 041B98 7F00D068 24060004 */ li $a2, 4 -/* 041B9C 7F00D06C 00003825 */ move $a3, $zero -/* 041BA0 7F00D070 AFA00010 */ sw $zero, 0x10($sp) -/* 041BA4 7F00D074 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 041BA8 7F00D078 E7AA0098 */ swc1 $f10, 0x98($sp) -/* 041BAC 7F00D07C 8E300000 */ lw $s0, ($s1) -/* 041BB0 7F00D080 240F0001 */ li $t7, 1 -/* 041BB4 7F00D084 241900FF */ li $t9, 255 -/* 041BB8 7F00D088 92180011 */ lbu $t8, 0x11($s0) -/* 041BBC 7F00D08C 92070010 */ lbu $a3, 0x10($s0) -/* 041BC0 7F00D090 240A00FF */ li $t2, 255 -/* 041BC4 7F00D094 240E00FF */ li $t6, 255 -/* 041BC8 7F00D098 240900FF */ li $t1, 255 -/* 041BCC 7F00D09C AFA9002C */ sw $t1, 0x2c($sp) -/* 041BD0 7F00D0A0 AFAE0028 */ sw $t6, 0x28($sp) -/* 041BD4 7F00D0A4 AFAA0024 */ sw $t2, 0x24($sp) -/* 041BD8 7F00D0A8 AFB90020 */ sw $t9, 0x20($sp) -/* 041BDC 7F00D0AC AFAF001C */ sw $t7, 0x1c($sp) -/* 041BE0 7F00D0B0 AFA00018 */ sw $zero, 0x18($sp) -/* 041BE4 7F00D0B4 AFA00014 */ sw $zero, 0x14($sp) -/* 041BE8 7F00D0B8 AFB80010 */ sw $t8, 0x10($sp) -/* 041BEC 7F00D0BC 920B0012 */ lbu $t3, 0x12($s0) -/* 041BF0 7F00D0C0 AFA00034 */ sw $zero, 0x34($sp) -/* 041BF4 7F00D0C4 02402025 */ move $a0, $s2 -/* 041BF8 7F00D0C8 000B682A */ slt $t5, $zero, $t3 -/* 041BFC 7F00D0CC AFAD0030 */ sw $t5, 0x30($sp) -/* 041C00 7F00D0D0 27A5009C */ addiu $a1, $sp, 0x9c -/* 041C04 7F00D0D4 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 041C08 7F00D0D8 27A60094 */ addiu $a2, $sp, 0x94 -/* 041C0C 7F00D0DC C7A6009C */ lwc1 $f6, 0x9c($sp) -/* 041C10 7F00D0E0 C7B00094 */ lwc1 $f16, 0x94($sp) -/* 041C14 7F00D0E4 C7A800A0 */ lwc1 $f8, 0xa0($sp) -/* 041C18 7F00D0E8 C7B20098 */ lwc1 $f18, 0x98($sp) -/* 041C1C 7F00D0EC 46103101 */ sub.s $f4, $f6, $f16 -/* 041C20 7F00D0F0 C7B000A0 */ lwc1 $f16, 0xa0($sp) -/* 041C24 7F00D0F4 C7A60098 */ lwc1 $f6, 0x98($sp) -/* 041C28 7F00D0F8 46124281 */ sub.s $f10, $f8, $f18 -/* 041C2C 7F00D0FC E6640000 */ swc1 $f4, ($s3) -/* 041C30 7F00D100 3C0142DC */ li $at, 0x42DC0000 # 110.000000 -/* 041C34 7F00D104 46103100 */ add.s $f4, $f6, $f16 -/* 041C38 7F00D108 44814000 */ mtc1 $at, $f8 -/* 041C3C 7F00D10C E66A0004 */ swc1 $f10, 4($s3) -/* 041C40 7F00D110 3C018005 */ lui $at, %hi(D_80051A34) -/* 041C44 7F00D114 E664000C */ swc1 $f4, 0xc($s3) -/* 041C48 7F00D118 C4321A34 */ lwc1 $f18, %lo(D_80051A34)($at) -/* 041C4C 7F00D11C 8E300000 */ lw $s0, ($s1) -/* 041C50 7F00D120 E7A8008C */ swc1 $f8, 0x8c($sp) -/* 041C54 7F00D124 E7B20090 */ swc1 $f18, 0x90($sp) -/* 041C58 7F00D128 9208001C */ lbu $t0, 0x1c($s0) -/* 041C5C 7F00D12C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041C60 7F00D130 44885000 */ mtc1 $t0, $f10 -/* 041C64 7F00D134 05010004 */ bgez $t0, .L7F00D148 -/* 041C68 7F00D138 468051A0 */ cvt.s.w $f6, $f10 -/* 041C6C 7F00D13C 44818000 */ mtc1 $at, $f16 -/* 041C70 7F00D140 00000000 */ nop -/* 041C74 7F00D144 46103180 */ add.s $f6, $f6, $f16 -.L7F00D148: -/* 041C78 7F00D148 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 041C7C 7F00D14C 44812000 */ mtc1 $at, $f4 -/* 041C80 7F00D150 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 041C84 7F00D154 46043202 */ mul.s $f8, $f6, $f4 -/* 041C88 7F00D158 E7A80084 */ swc1 $f8, 0x84($sp) -/* 041C8C 7F00D15C 920C001D */ lbu $t4, 0x1d($s0) -/* 041C90 7F00D160 448C9000 */ mtc1 $t4, $f18 -/* 041C94 7F00D164 05810004 */ bgez $t4, .L7F00D178 -/* 041C98 7F00D168 468092A0 */ cvt.s.w $f10, $f18 -/* 041C9C 7F00D16C 44818000 */ mtc1 $at, $f16 -/* 041CA0 7F00D170 00000000 */ nop -/* 041CA4 7F00D174 46105280 */ add.s $f10, $f10, $f16 -.L7F00D178: -/* 041CA8 7F00D178 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 041CAC 7F00D17C 44813000 */ mtc1 $at, $f6 -/* 041CB0 7F00D180 02402025 */ move $a0, $s2 -/* 041CB4 7F00D184 26050018 */ addiu $a1, $s0, 0x18 -/* 041CB8 7F00D188 46065102 */ mul.s $f4, $f10, $f6 -/* 041CBC 7F00D18C 24060004 */ li $a2, 4 -/* 041CC0 7F00D190 00003825 */ move $a3, $zero -/* 041CC4 7F00D194 AFA00010 */ sw $zero, 0x10($sp) -/* 041CC8 7F00D198 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 041CCC 7F00D19C E7A40088 */ swc1 $f4, 0x88($sp) -/* 041CD0 7F00D1A0 8E300000 */ lw $s0, ($s1) -/* 041CD4 7F00D1A4 240F0001 */ li $t7, 1 -/* 041CD8 7F00D1A8 241900FF */ li $t9, 255 -/* 041CDC 7F00D1AC 9218001D */ lbu $t8, 0x1d($s0) -/* 041CE0 7F00D1B0 9207001C */ lbu $a3, 0x1c($s0) -/* 041CE4 7F00D1B4 240A00FF */ li $t2, 255 -/* 041CE8 7F00D1B8 240E00FF */ li $t6, 255 -/* 041CEC 7F00D1BC 240900FF */ li $t1, 255 -/* 041CF0 7F00D1C0 AFA9002C */ sw $t1, 0x2c($sp) -/* 041CF4 7F00D1C4 AFAE0028 */ sw $t6, 0x28($sp) -/* 041CF8 7F00D1C8 AFAA0024 */ sw $t2, 0x24($sp) -/* 041CFC 7F00D1CC AFB90020 */ sw $t9, 0x20($sp) -/* 041D00 7F00D1D0 AFAF001C */ sw $t7, 0x1c($sp) -/* 041D04 7F00D1D4 AFA00018 */ sw $zero, 0x18($sp) -/* 041D08 7F00D1D8 AFA00014 */ sw $zero, 0x14($sp) -/* 041D0C 7F00D1DC AFB80010 */ sw $t8, 0x10($sp) -/* 041D10 7F00D1E0 920B001E */ lbu $t3, 0x1e($s0) -/* 041D14 7F00D1E4 AFA00034 */ sw $zero, 0x34($sp) -/* 041D18 7F00D1E8 02402025 */ move $a0, $s2 -/* 041D1C 7F00D1EC 000B682A */ slt $t5, $zero, $t3 -/* 041D20 7F00D1F0 AFAD0030 */ sw $t5, 0x30($sp) -/* 041D24 7F00D1F4 27A5008C */ addiu $a1, $sp, 0x8c -/* 041D28 7F00D1F8 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 041D2C 7F00D1FC 27A60084 */ addiu $a2, $sp, 0x84 -/* 041D30 7F00D200 3C088003 */ lui $t0, %hi(folder_selected_for_deletion) -/* 041D34 7F00D204 8D08A91C */ lw $t0, %lo(folder_selected_for_deletion)($t0) -/* 041D38 7F00D208 05030005 */ bgezl $t0, .L7F00D220 -/* 041D3C 7F00D20C 8FBF0064 */ lw $ra, 0x64($sp) -/* 041D40 7F00D210 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 041D44 7F00D214 8FA401B8 */ lw $a0, 0x1b8($sp) -/* 041D48 7F00D218 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 041D4C 7F00D21C 8FBF0064 */ lw $ra, 0x64($sp) -.L7F00D220: -/* 041D50 7F00D220 8FA201B8 */ lw $v0, 0x1b8($sp) -/* 041D54 7F00D224 8FB00040 */ lw $s0, 0x40($sp) -/* 041D58 7F00D228 8FB10044 */ lw $s1, 0x44($sp) -/* 041D5C 7F00D22C 8FB20048 */ lw $s2, 0x48($sp) -/* 041D60 7F00D230 8FB3004C */ lw $s3, 0x4c($sp) -/* 041D64 7F00D234 8FB40050 */ lw $s4, 0x50($sp) -/* 041D68 7F00D238 8FB50054 */ lw $s5, 0x54($sp) -/* 041D6C 7F00D23C 8FB60058 */ lw $s6, 0x58($sp) -/* 041D70 7F00D240 8FB7005C */ lw $s7, 0x5c($sp) -/* 041D74 7F00D244 8FBE0060 */ lw $fp, 0x60($sp) -/* 041D78 7F00D248 03E00008 */ jr $ra -/* 041D7C 7F00D24C 27BD01B8 */ addiu $sp, $sp, 0x1b8 -) -#endif //******************************************************************************************************** @@ -5765,18 +2740,18 @@ void interface_menu06_modesel(void) cheat_available[i] = FALSE; } } - viSetFovY(60.f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); disable_all_switches(walletinst[0]); select_load_bond_picture(walletinst[0], fileGetBondForFolder(selected_folder_num)); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 7, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 2, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PHOTOBOND, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_EYESONLY, 1); tab_prev_highlight = FALSE; mission_difficulty_highlighted = DIFFICULTY_MULTI; if (isontab3()) @@ -5824,241 +2799,78 @@ void interface_menu06_modesel(void) menu_control_stick_tracking(); if (gamemode == GAMEMODE_SOLO) { - set_menu_to_mode(MENU_MISSION_SELECT, 0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo(0); return; } if (gamemode == GAMEMODE_MULTI) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); + frontChangeMenu(MENU_MP_OPTIONS, FALSE); return; } if (gamemode == GAMEMODE_CHEATS) { - set_menu_to_mode(MENU_CHEAT, 0); + frontChangeMenu(MENU_CHEAT, FALSE); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_FILE_SELECT, 0); + frontChangeMenu(MENU_FILE_SELECT, FALSE); } } - -#ifdef NONMATCHING -s32 sub_GAME_7F00D5E8(s32 arg0) +// Address 0x7F00D5E8 NTSC +Gfx *sub_GAME_7F00D5E8(Gfx *DL) { - s32 sp11C; - s32 sp118; - s32 sp114; - s32 sp110; - s32 sp10C; - s32 spC8; - s32 sp88; - s32 sp48; + s32 padding; f32 temp_f0; f32 temp_f2; - s32 temp_ret; - s32 temp_s0; - void *temp_t8; - void *temp_t9; - void *temp_v0; - void *phi_t9; - void *phi_t8; - s32 phi_s1; - s32 phi_s0; - - temp_v0 = &D_8002AB94 + (selected_folder_num * 0xc); - phi_t9 = &D_8002AF84; - phi_t8 = &sp10C; -loop_1: - temp_t9 = phi_t9 + 0xc; - temp_t8 = phi_t8 + 0xc; - temp_t8->unk-C = (s32) *phi_t9; - temp_t8->unk-8 = (s32) temp_t9->unk-8; - temp_t8->unk-4 = (s32) temp_t9->unk-4; - phi_t9 = temp_t9; - phi_t8 = temp_t8; - if (temp_t9 != (&D_8002AF84 + 0x3c)) - { - goto loop_1; - } - temp_t8->unk0 = (s32) temp_t9->unk0; - temp_f0 = temp_v0->unk0 + D_8002AFC4; - temp_f2 = temp_v0->unk4 + D_8002AFC8; - matrix_4x4_7F059694(0, &spC8, temp_f0, temp_f2, 4000.0f + D_8002AFCC, temp_f0, temp_f2, 1.0f); - matrix_4x4_set_identity_and_position(&D_8002AB94 + (selected_folder_num * 0xc), &sp88); - matrix_scalar_multiply(0x3e800000, &sp88); + struct unk_joint_list sp10C; + s32 i; + Mtxf spC8; + Mtxf sp88; + Mtxf sp48; + + temp_f0 = D_8002AB94[selected_folder_num].f[0]; + temp_f2 = D_8002AB94[selected_folder_num].f[1]; + + sp10C = D_8002AF84; + + temp_f0 += D_8002AFC4; + temp_f2 += D_8002AFC8; + + matrix_4x4_7F059694(&spC8, temp_f0, temp_f2, 4000.0f + D_8002AFCC, temp_f0, temp_f2, 0.0f, 0.0f, 1.0f, 0.0f); + matrix_4x4_set_identity_and_position(&D_8002AB94[selected_folder_num], &sp88); + matrix_scalar_multiply(0.25f, sp88.m[0]); matrix_4x4_multiply_in_place(&spC8, &sp88); - temp_ret = dynAllocate(walletinst[0]->unk8->unkE << 6); - sp11C = temp_ret; - matrix_4x4_copy(&sp88, temp_ret); - walletinst[0]->unkC = sp11C; - sp114 = 3; - sp110 = 0; - sp118 = arg0; + + sp10C.unk_matrix = &sp88; + + sp10C.mtxlist = dynAllocate(walletinst[0]->obj->numMatrices << 6); + + matrix_4x4_copy(&sp88, sp10C.mtxlist); + + walletinst[0]->render_pos = (union RenderPosView*)sp10C.mtxlist; + + sp10C.unk08 = 3; + sp10C.unk04 = 0; + sp10C.gdl = DL; + subdraw(&sp10C, walletinst[0]); - arg0 = sp118; - phi_s1 = 0; - phi_s0 = 0; - if (walletinst[0]->unk8->unkE > 0) + + DL = sp10C.gdl; + + for (i=0; iobj->numMatrices; i++) { -loop_3: - matrix_4x4_copy(walletinst[0]->unkC + phi_s1, &sp48); - matrix_4x4_f32_to_s32(&sp48, walletinst[0]->unkC + (phi_s0 << 6)); - temp_s0 = phi_s0 + 1; - phi_s1 = phi_s1 + 0x40; - phi_s0 = temp_s0; - if (temp_s0 < walletinst[0]->unk8->unkE) - { - goto loop_3; - } + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy(&((s8*)walletinst[0]->render_pos)[i*0x40], &sp48); + matrix_4x4_f32_to_s32(&sp48, &((Mtxf*)walletinst[0]->render_pos)[i]); } - return arg0; + + + return DL; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F00D5E8 -/* 042118 7F00D5E8 27BDFEA8 */ addiu $sp, $sp, -0x158 -/* 04211C 7F00D5EC AFB20034 */ sw $s2, 0x34($sp) -/* 042120 7F00D5F0 3C128003 */ lui $s2, %hi(selected_folder_num) -/* 042124 7F00D5F4 2652A8E8 */ addiu $s2, %lo(selected_folder_num) # addiu $s2, $s2, -0x5718 -/* 042128 7F00D5F8 8E4E0000 */ lw $t6, ($s2) -/* 04212C 7F00D5FC AFB30038 */ sw $s3, 0x38($sp) -/* 042130 7F00D600 2413000C */ li $s3, 12 -/* 042134 7F00D604 01D30019 */ multu $t6, $s3 -/* 042138 7F00D608 AFB10030 */ sw $s1, 0x30($sp) -/* 04213C 7F00D60C 3C118003 */ lui $s1, %hi(D_8002AB94) -/* 042140 7F00D610 2631AB94 */ addiu $s1, %lo(D_8002AB94) # addiu $s1, $s1, -0x546c -/* 042144 7F00D614 3C198003 */ lui $t9, %hi(D_8002AF84) -/* 042148 7F00D618 2739AF84 */ addiu $t9, %lo(D_8002AF84) # addiu $t9, $t9, -0x507c -/* 04214C 7F00D61C 44806000 */ mtc1 $zero, $f12 -/* 042150 7F00D620 AFBF003C */ sw $ra, 0x3c($sp) -/* 042154 7F00D624 AFB0002C */ sw $s0, 0x2c($sp) -/* 042158 7F00D628 AFA40158 */ sw $a0, 0x158($sp) -/* 04215C 7F00D62C 00007812 */ mflo $t7 -/* 042160 7F00D630 022F1021 */ addu $v0, $s1, $t7 -/* 042164 7F00D634 C4400000 */ lwc1 $f0, ($v0) -/* 042168 7F00D638 C4420004 */ lwc1 $f2, 4($v0) -/* 04216C 7F00D63C 272A003C */ addiu $t2, $t9, 0x3c -/* 042170 7F00D640 27B8010C */ addiu $t8, $sp, 0x10c -.L7F00D644: -/* 042174 7F00D644 8F210000 */ lw $at, ($t9) -/* 042178 7F00D648 2739000C */ addiu $t9, $t9, 0xc -/* 04217C 7F00D64C 2718000C */ addiu $t8, $t8, 0xc -/* 042180 7F00D650 AF01FFF4 */ sw $at, -0xc($t8) -/* 042184 7F00D654 8F21FFF8 */ lw $at, -8($t9) -/* 042188 7F00D658 AF01FFF8 */ sw $at, -8($t8) -/* 04218C 7F00D65C 8F21FFFC */ lw $at, -4($t9) -/* 042190 7F00D660 172AFFF8 */ bne $t9, $t2, .L7F00D644 -/* 042194 7F00D664 AF01FFFC */ sw $at, -4($t8) -/* 042198 7F00D668 8F210000 */ lw $at, ($t9) -/* 04219C 7F00D66C 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 0421A0 7F00D670 AF010000 */ sw $at, ($t8) -/* 0421A4 7F00D674 3C018003 */ lui $at, %hi(D_8002AFC4) -/* 0421A8 7F00D678 C424AFC4 */ lwc1 $f4, %lo(D_8002AFC4)($at) -/* 0421AC 7F00D67C 3C018003 */ lui $at, %hi(D_8002AFC8) -/* 0421B0 7F00D680 C426AFC8 */ lwc1 $f6, %lo(D_8002AFC8)($at) -/* 0421B4 7F00D684 3C01457A */ li $at, 0x457A0000 # 4000.000000 -/* 0421B8 7F00D688 44814000 */ mtc1 $at, $f8 -/* 0421BC 7F00D68C 3C018003 */ lui $at, %hi(D_8002AFCC) -/* 0421C0 7F00D690 C42AAFCC */ lwc1 $f10, %lo(D_8002AFCC)($at) -/* 0421C4 7F00D694 46040000 */ add.s $f0, $f0, $f4 -/* 0421C8 7F00D698 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0421CC 7F00D69C 44819000 */ mtc1 $at, $f18 -/* 0421D0 7F00D6A0 46061080 */ add.s $f2, $f2, $f6 -/* 0421D4 7F00D6A4 44050000 */ mfc1 $a1, $f0 -/* 0421D8 7F00D6A8 E7A00010 */ swc1 $f0, 0x10($sp) -/* 0421DC 7F00D6AC 460A4400 */ add.s $f16, $f8, $f10 -/* 0421E0 7F00D6B0 44061000 */ mfc1 $a2, $f2 -/* 0421E4 7F00D6B4 E7A20014 */ swc1 $f2, 0x14($sp) -/* 0421E8 7F00D6B8 E7AC0024 */ swc1 $f12, 0x24($sp) -/* 0421EC 7F00D6BC 44078000 */ mfc1 $a3, $f16 -/* 0421F0 7F00D6C0 E7AC001C */ swc1 $f12, 0x1c($sp) -/* 0421F4 7F00D6C4 E7AC0018 */ swc1 $f12, 0x18($sp) -/* 0421F8 7F00D6C8 0FC165A5 */ jal matrix_4x4_7F059694 -/* 0421FC 7F00D6CC E7B20020 */ swc1 $f18, 0x20($sp) -/* 042200 7F00D6D0 8E4B0000 */ lw $t3, ($s2) -/* 042204 7F00D6D4 27B00088 */ addiu $s0, $sp, 0x88 -/* 042208 7F00D6D8 02002825 */ move $a1, $s0 -/* 04220C 7F00D6DC 01730019 */ multu $t3, $s3 -/* 042210 7F00D6E0 00006012 */ mflo $t4 -/* 042214 7F00D6E4 022C2021 */ addu $a0, $s1, $t4 -/* 042218 7F00D6E8 0FC16259 */ jal matrix_4x4_set_identity_and_position -/* 04221C 7F00D6EC 00000000 */ nop -/* 042220 7F00D6F0 3C013E80 */ li $at, 0x3E800000 # 0.250000 -/* 042224 7F00D6F4 44816000 */ mtc1 $at, $f12 -/* 042228 7F00D6F8 0FC1629F */ jal matrix_scalar_multiply -/* 04222C 7F00D6FC 02002825 */ move $a1, $s0 -/* 042230 7F00D700 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 042234 7F00D704 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 042238 7F00D708 02002825 */ move $a1, $s0 -/* 04223C 7F00D70C 3C138003 */ lui $s3, %hi(walletinst) -/* 042240 7F00D710 2673A95C */ addiu $s3, %lo(walletinst) # addiu $s3, $s3, -0x56a4 -/* 042244 7F00D714 8E6D0000 */ lw $t5, ($s3) -/* 042248 7F00D718 AFB0010C */ sw $s0, 0x10c($sp) -/* 04224C 7F00D71C 8DAE0008 */ lw $t6, 8($t5) -/* 042250 7F00D720 85C4000E */ lh $a0, 0xe($t6) -/* 042254 7F00D724 00047980 */ sll $t7, $a0, 6 -/* 042258 7F00D728 0FC2F5C5 */ jal dynAllocate -/* 04225C 7F00D72C 01E02025 */ move $a0, $t7 -/* 042260 7F00D730 AFA2011C */ sw $v0, 0x11c($sp) -/* 042264 7F00D734 02002025 */ move $a0, $s0 -/* 042268 7F00D738 0FC16008 */ jal matrix_4x4_copy -/* 04226C 7F00D73C 00402825 */ move $a1, $v0 -/* 042270 7F00D740 8FA9011C */ lw $t1, 0x11c($sp) -/* 042274 7F00D744 8E680000 */ lw $t0, ($s3) -/* 042278 7F00D748 240A0003 */ li $t2, 3 -/* 04227C 7F00D74C 27A4010C */ addiu $a0, $sp, 0x10c -/* 042280 7F00D750 AD09000C */ sw $t1, 0xc($t0) -/* 042284 7F00D754 8FB90158 */ lw $t9, 0x158($sp) -/* 042288 7F00D758 AFAA0114 */ sw $t2, 0x114($sp) -/* 04228C 7F00D75C AFA00110 */ sw $zero, 0x110($sp) -/* 042290 7F00D760 8E650000 */ lw $a1, ($s3) -/* 042294 7F00D764 0FC1D1A1 */ jal subdraw -/* 042298 7F00D768 AFB90118 */ sw $t9, 0x118($sp) -/* 04229C 7F00D76C 8FB80118 */ lw $t8, 0x118($sp) -/* 0422A0 7F00D770 8E620000 */ lw $v0, ($s3) -/* 0422A4 7F00D774 00008025 */ move $s0, $zero -/* 0422A8 7F00D778 AFB80158 */ sw $t8, 0x158($sp) -/* 0422AC 7F00D77C 8C4B0008 */ lw $t3, 8($v0) -/* 0422B0 7F00D780 00008825 */ move $s1, $zero -/* 0422B4 7F00D784 27B20048 */ addiu $s2, $sp, 0x48 -/* 0422B8 7F00D788 856C000E */ lh $t4, 0xe($t3) -/* 0422BC 7F00D78C 59800014 */ blezl $t4, .L7F00D7E0 -/* 0422C0 7F00D790 8FBF003C */ lw $ra, 0x3c($sp) -/* 0422C4 7F00D794 8C4D000C */ lw $t5, 0xc($v0) -.L7F00D798: -/* 0422C8 7F00D798 02402825 */ move $a1, $s2 -/* 0422CC 7F00D79C 0FC16008 */ jal matrix_4x4_copy -/* 0422D0 7F00D7A0 01B12021 */ addu $a0, $t5, $s1 -/* 0422D4 7F00D7A4 8E6E0000 */ lw $t6, ($s3) -/* 0422D8 7F00D7A8 00104980 */ sll $t1, $s0, 6 -/* 0422DC 7F00D7AC 02402025 */ move $a0, $s2 -/* 0422E0 7F00D7B0 8DCF000C */ lw $t7, 0xc($t6) -/* 0422E4 7F00D7B4 0FC16327 */ jal matrix_4x4_f32_to_s32 -/* 0422E8 7F00D7B8 01E92821 */ addu $a1, $t7, $t1 -/* 0422EC 7F00D7BC 8E620000 */ lw $v0, ($s3) -/* 0422F0 7F00D7C0 26100001 */ addiu $s0, $s0, 1 -/* 0422F4 7F00D7C4 26310040 */ addiu $s1, $s1, 0x40 -/* 0422F8 7F00D7C8 8C480008 */ lw $t0, 8($v0) -/* 0422FC 7F00D7CC 850A000E */ lh $t2, 0xe($t0) -/* 042300 7F00D7D0 020A082A */ slt $at, $s0, $t2 -/* 042304 7F00D7D4 5420FFF0 */ bnezl $at, .L7F00D798 -/* 042308 7F00D7D8 8C4D000C */ lw $t5, 0xc($v0) -/* 04230C 7F00D7DC 8FBF003C */ lw $ra, 0x3c($sp) -.L7F00D7E0: -/* 042310 7F00D7E0 8FA20158 */ lw $v0, 0x158($sp) -/* 042314 7F00D7E4 8FB0002C */ lw $s0, 0x2c($sp) -/* 042318 7F00D7E8 8FB10030 */ lw $s1, 0x30($sp) -/* 04231C 7F00D7EC 8FB20034 */ lw $s2, 0x34($sp) -/* 042320 7F00D7F0 8FB30038 */ lw $s3, 0x38($sp) -/* 042324 7F00D7F4 03E00008 */ jr $ra -/* 042328 7F00D7F8 27BD0158 */ addiu $sp, $sp, 0x158 -) -#endif @@ -6091,11 +2903,11 @@ Gfx* constructor_menu06_modesel(Gfx* DL) x = 0x96; y = 0xdc; - DL = write_text_at_abs_coord(DL, &x, &y, "1.\n", ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, "1.\n", ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - textstring = langGet((g_AppendCheatSinglePlayer != 0) ? TEXT(LTITLE, 0x75) : TEXT(LTITLE, 0x1d)); + textstring = langGet((g_AppendCheatSinglePlayer != 0) ? TEXT(LTITLE, TITLE_STR_117) : TEXT(LTITLE, TITLE_STR_29)); - sub_GAME_7F0AE98C(&x2, &y2, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&x2, &y2, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0xAA; y = 0xdc; @@ -6104,7 +2916,7 @@ Gfx* constructor_menu06_modesel(Gfx* DL) DL = microcode_constructor_related_to_menus(DL, 0x94, 0xDA, y2 + 0xAF, 0xEA, 0x32); } - DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); x = 0x96; y = 0xFC; @@ -6116,11 +2928,11 @@ Gfx* constructor_menu06_modesel(Gfx* DL) { text_color = 0x70; } - DL = write_text_at_abs_coord(DL, &x, &y, "2.\n", ptrSecondFontTableLarge, ptrFirstFontTableLarge, text_color, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, "2.\n", ptrFontZurichBoldChars, ptrFontZurichBold, text_color, viGetX(), viGetY(), 0, 0); - textstring = langGet((g_AppendCheatMultiPlayer != 0) ? TEXT(LTITLE, 0x114) : TEXT(LTITLE, 0x1e)); + textstring = langGet((g_AppendCheatMultiPlayer != 0) ? TEXT(LTITLE, TITLE_STR_276) : TEXT(LTITLE, TITLE_STR_30)); - sub_GAME_7F0AE98C(&x2, &y2, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&x2, &y2, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0xAA; y = 0xFC; @@ -6128,16 +2940,16 @@ Gfx* constructor_menu06_modesel(Gfx* DL) { DL = microcode_constructor_related_to_menus(DL, 0x94, 0xFA, y2 + 0xAF, 0x10A, 0x32); } - DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, text_color, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, text_color, viGetX(), viGetY(), 0, 0); if (is_cheat_menu_available != 0) { x = 0x96; y = 0x11C; - DL = write_text_at_abs_coord(DL, &x, &y, "3.\n", ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); - textstring = langGet(TEXT(LTITLE, 0x1f)); + DL = write_text_at_abs_coord(DL, &x, &y, "3.\n", ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + textstring = langGet(TEXT(LTITLE, TITLE_STR_31)); - sub_GAME_7F0AE98C(&x2, &y2, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&x2, &y2, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0xAA; y = 0x11C; @@ -6145,7 +2957,7 @@ Gfx* constructor_menu06_modesel(Gfx* DL) { DL = microcode_constructor_related_to_menus(DL, 0x94, 0x11A, y2 + 0xAF, 0x12A, 0x32); } - DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, textstring, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } DL = add_tab3_previous(DL); @@ -6247,45 +3059,22 @@ void update_menu07_missionsel(void) { -#ifdef NONMATCHING +// Address 0x7F00DEB8 NTSC void interface_menu07_missionsel(void) { - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s2; - s32 temp_s2_2; - s32 temp_s2_3; - s32 temp_s4; - s32 temp_s4_2; - s32 temp_s4_3; - s32 temp_s5; - void *temp_t1; - void *temp_t3; - void *temp_v0; - void *temp_v0_2; - s32 phi_s4; - s32 phi_s2; - s32 phi_s2_2; - s32 phi_s0; - s32 phi_s1; - s32 phi_s1_2; - s32 phi_s2_3; - s32 phi_s4_2; - s32 phi_s0_2; - s32 phi_s4_3; - s32 phi_s4_4; - s32 phi_s0_3; - s32 phi_s4_5; - s32 phi_s2_4; - s32 phi_s4_6; - s32 phi_s0_4; - s32 phi_s2_5; - s32 phi_a0; - s32 phi_s5; - - viSetFovY(0x42700000); - viSetAspect(D_80051A44); - viSetZRange(0x42c80000, D_80051A48); + s32 var_s4; + s32 var_s2; + struct ModelRwData_DisplayList_CollisionRecord *temp_s1; + s32 temp_a0; + s32 i; + s32 var_s1; + struct ModelRoData_DisplayList_CollisionRecord *temp_s4; + ModelNode *mnode; + s32 padding; + + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); disable_all_switches(walletinst[0]); set_item_visibility_in_objinstance(walletinst[0], 0, 1); @@ -6293,1347 +3082,171 @@ void interface_menu07_missionsel(void) set_item_visibility_in_objinstance(walletinst[0], 0x14, 1); tab_prev_highlight = 0; mission_difficulty_highlighted = -1; + if (isontab3() != 0) { tab_prev_highlight = 1; } else { - phi_s4 = 0; -loop_3: - phi_s4_2 = phi_s4; - if (phi_s4 < 4) + for (var_s4 = 0; var_s4 < 5; ) { - temp_v0 = &cursor_xpos_table_mission_select + (phi_s4 * 4); - phi_s4_2 = phi_s4; - if (!(cursor_h_pos < ((f32) (temp_v0->unk4 + temp_v0->unk0) * 0.5f))) + if (var_s4 < 4) { - temp_s4 = phi_s4 + 1; - phi_s4 = temp_s4; - phi_s4_2 = temp_s4; - if (temp_s4 != 5) + if(!((cursor_xpos_table_mission_select[var_s4] + cursor_xpos_table_mission_select[var_s4+1]) * 0.5f > cursor_h_pos)) { - goto loop_3; + var_s4++; + continue; } } + + break; } - phi_s2 = 0; -loop_7: - phi_s2_2 = phi_s2; - if (phi_s2 < 3) + + for (var_s2 = 0; var_s2 < 4; ) { - temp_v0_2 = &cursor_ypos_table_mission_select + (phi_s2 * 4); - phi_s2_2 = phi_s2; - if (!(cursor_v_pos < ((f32) (temp_v0_2->unk4 + temp_v0_2->unk0) * 0.5f))) + if (var_s2 < 3) { - temp_s2 = phi_s2 + 1; - phi_s2 = temp_s2; - phi_s2_2 = temp_s2; - if (temp_s2 != 4) + if(!((cursor_ypos_table_mission_select[var_s2] + cursor_ypos_table_mission_select[var_s2+1]) * 0.5f > cursor_v_pos)) { - goto loop_7; + var_s2++; + continue; } } + + break; } - phi_s2_4 = phi_s2_2; - if (phi_s2_2 > 0) + + for ( ; var_s2 > 0; var_s2--) { - phi_s2_3 = phi_s2_2; - phi_s5 = (phi_s2_2 * 4) + phi_s2_2; -loop_12: - phi_s0 = phi_s5; - phi_s1 = 0; -loop_13: - phi_s1_2 = phi_s1; - if (get_highest_unlocked_difficulty_for_level(phi_s0) < 0) + for (var_s1 = 0; var_s1 < 5; var_s1++) { - temp_s1 = phi_s1 + 1; - phi_s0 = phi_s0 + 1; - phi_s1 = temp_s1; - phi_s1_2 = temp_s1; - if (temp_s1 != 5) + if (get_highest_unlocked_difficulty_for_level((var_s2 * 5) + var_s1) >= 0) { - goto loop_13; + break; } } - phi_s2_4 = phi_s2_3; - if (phi_s1_2 >= 5) + + if (var_s1 < 5) { - temp_s2_2 = phi_s2_3 + -1; - phi_s2_3 = temp_s2_2; - phi_s2_4 = temp_s2_2; - phi_s5 = phi_s5 + -5; - if (temp_s2_2 > 0) - { - goto loop_12; - } + break; } + + if (1); } - temp_s5 = (phi_s2_4 * 4) + phi_s2_4; - phi_s4_4 = phi_s4_2; - if (phi_s4_2 >= 0) + + for ( ; var_s4 >= 0; var_s4--) { - phi_s0_2 = temp_s5 + phi_s4_2; - phi_s4_3 = phi_s4_2; -loop_19: - phi_s4_4 = phi_s4_3; - if (get_highest_unlocked_difficulty_for_level(phi_s0_2) < 0) + if (get_highest_unlocked_difficulty_for_level((var_s2 * 5) + var_s4) >= 0) { - temp_s4_2 = phi_s4_3 + -1; - phi_s0_2 = phi_s0_2 + -1; - phi_s4_3 = temp_s4_2; - phi_s4_4 = temp_s4_2; - if (temp_s4_2 >= 0) - { - goto loop_19; - } + break; } } - phi_s4_6 = phi_s4_4; - if (phi_s4_4 < 0) + + if (var_s4 < 0) { - phi_s0_3 = temp_s5; - phi_s4_5 = 0; -loop_23: - phi_s4_6 = phi_s4_5; - if (get_highest_unlocked_difficulty_for_level(phi_s0_3) < 0) + for (var_s4 = 0; var_s4 < 5; var_s4++) { - temp_s4_3 = phi_s4_5 + 1; - phi_s0_3 = phi_s0_3 + 1; - phi_s4_5 = temp_s4_3; - phi_s4_6 = temp_s4_3; - if (temp_s4_3 != 5) + if (get_highest_unlocked_difficulty_for_level((var_s2 * 5) + var_s4) >= 0) { - goto loop_23; + break; } } } - mission_difficulty_highlighted = (s32) (temp_s5 + phi_s4_6); + + mission_difficulty_highlighted = (var_s2 * 5) + var_s4; } - if (walletinst[0]->unk8->unk8->unk54 != 0) + + mnode = walletinst[0]->obj->Switches[0x15]; + + if (mnode != NULL) { - temp_s1_2 = modelGetNodeRwData(walletinst[0], walletinst[0]->unk8->unk8->unk54); - *temp_s1_2 = dynAllocate7F0BD6C4(walletinst[0]->unk8->unk8->unk54->unk4->unkC); - if (walletinst[0]->unk8->unk8->unk54->unk4->unkC > 0) + temp_s4 = (struct ModelRoData_DisplayList_CollisionRecord *)mnode->Data; + + temp_s1 = (struct ModelRwData_DisplayList_CollisionRecord *)modelGetNodeRwData(walletinst[0], mnode); + temp_s1->Vertices = dynAllocate7F0BD6C4(temp_s4->numVertices); + + for (i = 0; i < temp_s4->numVertices; i++) { - phi_s0_4 = 0; - phi_s2_5 = 0; -loop_29: - temp_t3 = walletinst[0]->unk8->unk8->unk54->unk4->unk8 + phi_s0_4; - temp_t1 = *temp_s1_2 + phi_s0_4; - temp_t1->unk0 = (s32) temp_t3->unk0; - temp_t1->unk4 = (s32) temp_t3->unk4; - temp_t1->unk8 = (s32) temp_t3->unk8; - temp_t1->unkC = (s32) temp_t3->unkC; - phi_a0 = (s32) phi_s2_5 >> 2; - if (phi_s2_5 < 0) - { - phi_a0 = (s32) (phi_s2_5 + 3) >> 2; - } - if (get_highest_unlocked_difficulty_for_level(phi_a0) >= 0) + // struct copy + temp_s1->Vertices[i] = temp_s4->Vertices[i]; + + temp_a0 = i / 4; + + if (get_highest_unlocked_difficulty_for_level(temp_a0) >= 0) { - if (sp30 == mission_difficulty_highlighted) + if (temp_a0 == mission_difficulty_highlighted) { - (*temp_s1_2 + phi_s0_4)->unkC = (u8)0xff; - (*temp_s1_2 + phi_s0_4)->unkD = (u8)0xff; - (*temp_s1_2 + phi_s0_4)->unkE = (u8)0xff; - (*temp_s1_2 + phi_s0_4)->unkF = (u8)0xf5; + temp_s1->Vertices[i].r = 0xff; + temp_s1->Vertices[i].g = 0xff; + temp_s1->Vertices[i].b = 0xff; + temp_s1->Vertices[i].a = 0xf5; } else { - (*temp_s1_2 + phi_s0_4)->unkC = (u8)0x6e; - (*temp_s1_2 + phi_s0_4)->unkD = (u8)0x6e; - (*temp_s1_2 + phi_s0_4)->unkE = (u8)0x6e; - (*temp_s1_2 + phi_s0_4)->unkF = (u8)0xff; + temp_s1->Vertices[i].r = 0x6e; + temp_s1->Vertices[i].g = 0x6e; + temp_s1->Vertices[i].b = 0x6e; + temp_s1->Vertices[i].a = 0xff; } } else { - (*temp_s1_2 + phi_s0_4)->unkC = (u8)0xf; - (*temp_s1_2 + phi_s0_4)->unkD = (u8)0xf; - (*temp_s1_2 + phi_s0_4)->unkE = (u8)0xf; - (*temp_s1_2 + phi_s0_4)->unkF = (u8)0xff; - } - temp_s2_3 = phi_s2_5 + 1; - phi_s0_4 = phi_s0_4 + 0x10; - phi_s2_5 = temp_s2_3; - if (temp_s2_3 < walletinst[0]->unk8->unk8->unk54->unk4->unkC) - { - goto loop_29; + temp_s1->Vertices[i].r = 0xf; + temp_s1->Vertices[i].g = 0xf; + temp_s1->Vertices[i].b = 0xf; + temp_s1->Vertices[i].a = 0xff; } } } - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0xb000) != 0) + + if (joyGetButtonsPressedThisFrame(0, A_BUTTON | START_BUTTON | Z_TRIG) != 0) { if (tab_prev_highlight != 0) { tab_prev_selected = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - else + else if (mission_difficulty_highlighted >= 0) { - if ((void *)0x80070000->unk-687C >= 0) - { - briefingpage = pull_and_display_text_for_folder_a0((void *)0x80070000->unk-687C); - selected_stage = (s32) (0x80030000 + (briefingpage * 0x1c))->unk-5414; - tab_next_selected = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + briefingpage = pull_and_display_text_for_folder_a0(mission_difficulty_highlighted); + selected_stage = mission_folder_setup_entries[briefingpage].stage_id; + tab_next_selected = 1; + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } } - else + else if (joyGetButtonsPressedThisFrame(0, B_BUTTON) != 0) { - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0x4000) != 0) - { - tab_prev_selected = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + tab_prev_selected = 1; + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } + menu_control_stick_tracking(); + if (tab_next_selected != 0) { - set_menu_to_mode(MENU_DIFFICULTY, 0); - set_cursor_pos_difficulty(get_highest_unlocked_difficulty_for_level((0x80030000 + (briefingpage * 0x1c))->unk-5408)); - return; + frontChangeMenu(MENU_DIFFICULTY, 0); + +#if defined(VERSION_JP) || defined(VERSION_EU) + if (j_text_trigger != 0) + { + set_cursor_pos_difficulty(0); + } + else +#endif + { + set_cursor_pos_difficulty(get_highest_unlocked_difficulty_for_level(mission_folder_setup_entries[briefingpage].mission_num)); + } } - if (tab_prev_selected != 0) + else if (tab_prev_selected != 0) { - set_menu_to_mode(MENU_MODE_SELECT, 0); + frontChangeMenu(MENU_MODE_SELECT, 0); setCursorPOSforMode(0); } } -#else - -#ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_80051A44 -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_80051A48 -.word 0x461C4000 /* 10000.0;*/ -.text -glabel interface_menu07_missionsel -/* 0429E8 7F00DEB8 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0429EC 7F00DEBC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0429F0 7F00DEC0 AFBF002C */ sw $ra, 0x2c($sp) -/* 0429F4 7F00DEC4 44816000 */ mtc1 $at, $f12 -/* 0429F8 7F00DEC8 AFB50028 */ sw $s5, 0x28($sp) -/* 0429FC 7F00DECC AFB40024 */ sw $s4, 0x24($sp) -/* 042A00 7F00DED0 AFB30020 */ sw $s3, 0x20($sp) -/* 042A04 7F00DED4 AFB2001C */ sw $s2, 0x1c($sp) -/* 042A08 7F00DED8 AFB10018 */ sw $s1, 0x18($sp) -/* 042A0C 7F00DEDC 0C001151 */ jal viSetFovY -/* 042A10 7F00DEE0 AFB00014 */ sw $s0, 0x14($sp) -/* 042A14 7F00DEE4 3C018005 */ lui $at, %hi(D_80051A44) -/* 042A18 7F00DEE8 0C001164 */ jal viSetAspect -/* 042A1C 7F00DEEC C42C1A44 */ lwc1 $f12, %lo(D_80051A44)($at) -/* 042A20 7F00DEF0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 042A24 7F00DEF4 44816000 */ mtc1 $at, $f12 -/* 042A28 7F00DEF8 3C018005 */ lui $at, %hi(D_80051A48) -/* 042A2C 7F00DEFC 0C001194 */ jal viSetZRange -/* 042A30 7F00DF00 C42E1A48 */ lwc1 $f14, %lo(D_80051A48)($at) -/* 042A34 7F00DF04 0C00114D */ jal viSetUseZBuf -/* 042A38 7F00DF08 00002025 */ move $a0, $zero -/* 042A3C 7F00DF0C 3C048003 */ lui $a0, %hi(walletinst) -/* 042A40 7F00DF10 0FC02DC9 */ jal disable_all_switches -/* 042A44 7F00DF14 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 042A48 7F00DF18 3C048003 */ lui $a0, %hi(walletinst) -/* 042A4C 7F00DF1C 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 042A50 7F00DF20 00002825 */ move $a1, $zero -/* 042A54 7F00DF24 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 042A58 7F00DF28 24060001 */ li $a2, 1 -/* 042A5C 7F00DF2C 3C048003 */ lui $a0, %hi(walletinst) -/* 042A60 7F00DF30 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 042A64 7F00DF34 24050013 */ li $a1, 19 -/* 042A68 7F00DF38 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 042A6C 7F00DF3C 24060001 */ li $a2, 1 -/* 042A70 7F00DF40 3C048003 */ lui $a0, %hi(walletinst) -/* 042A74 7F00DF44 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 042A78 7F00DF48 24050014 */ li $a1, 20 -/* 042A7C 7F00DF4C 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 042A80 7F00DF50 24060001 */ li $a2, 1 -/* 042A84 7F00DF54 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 042A88 7F00DF58 AC20A8E4 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 042A8C 7F00DF5C 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) -/* 042A90 7F00DF60 240EFFFF */ li $t6, -1 -/* 042A94 7F00DF64 0FC028E7 */ jal isontab3 -/* 042A98 7F00DF68 AC2E9784 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -/* 042A9C 7F00DF6C 10400005 */ beqz $v0, .L7F00DF84 -/* 042AA0 7F00DF70 0000A025 */ move $s4, $zero -/* 042AA4 7F00DF74 240F0001 */ li $t7, 1 -/* 042AA8 7F00DF78 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 042AAC 7F00DF7C 1000005E */ b .L7F00E0F8 -/* 042AB0 7F00DF80 AC2FA8E4 */ sw $t7, %lo(tab_prev_highlight)($at) -.L7F00DF84: -/* 042AB4 7F00DF84 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 042AB8 7F00DF88 3C048003 */ lui $a0, %hi(cursor_xpos_table_mission_select) -/* 042ABC 7F00DF8C 3C038003 */ lui $v1, %hi(cursor_h_pos) -/* 042AC0 7F00DF90 44810000 */ mtc1 $at, $f0 -/* 042AC4 7F00DF94 2463A908 */ addiu $v1, %lo(cursor_h_pos) # addiu $v1, $v1, -0x56f8 -/* 042AC8 7F00DF98 2484AFD0 */ addiu $a0, %lo(cursor_xpos_table_mission_select) # addiu $a0, $a0, -0x5030 -/* 042ACC 7F00DF9C 24130005 */ li $s3, 5 -/* 042AD0 7F00DFA0 2A810004 */ slti $at, $s4, 4 -.L7F00DFA4: -/* 042AD4 7F00DFA4 10200011 */ beqz $at, .L7F00DFEC -/* 042AD8 7F00DFA8 0014C080 */ sll $t8, $s4, 2 -/* 042ADC 7F00DFAC 00981021 */ addu $v0, $a0, $t8 -/* 042AE0 7F00DFB0 8C590004 */ lw $t9, 4($v0) -/* 042AE4 7F00DFB4 8C480000 */ lw $t0, ($v0) -/* 042AE8 7F00DFB8 C4640000 */ lwc1 $f4, ($v1) -/* 042AEC 7F00DFBC 03284821 */ addu $t1, $t9, $t0 -/* 042AF0 7F00DFC0 44893000 */ mtc1 $t1, $f6 -/* 042AF4 7F00DFC4 00000000 */ nop -/* 042AF8 7F00DFC8 46803220 */ cvt.s.w $f8, $f6 -/* 042AFC 7F00DFCC 46004282 */ mul.s $f10, $f8, $f0 -/* 042B00 7F00DFD0 460A203C */ c.lt.s $f4, $f10 -/* 042B04 7F00DFD4 00000000 */ nop -/* 042B08 7F00DFD8 45010004 */ bc1t .L7F00DFEC -/* 042B0C 7F00DFDC 00000000 */ nop -/* 042B10 7F00DFE0 26940001 */ addiu $s4, $s4, 1 -/* 042B14 7F00DFE4 5693FFEF */ bnel $s4, $s3, .L7F00DFA4 -/* 042B18 7F00DFE8 2A810004 */ slti $at, $s4, 4 -.L7F00DFEC: -/* 042B1C 7F00DFEC 3C048003 */ lui $a0, %hi(cursor_ypos_table_mission_select) -/* 042B20 7F00DFF0 3C038003 */ lui $v1, %hi(cursor_v_pos) -/* 042B24 7F00DFF4 2463A90C */ addiu $v1, %lo(cursor_v_pos) # addiu $v1, $v1, -0x56f4 -/* 042B28 7F00DFF8 2484AFE4 */ addiu $a0, %lo(cursor_ypos_table_mission_select) # addiu $a0, $a0, -0x501c -/* 042B2C 7F00DFFC 00009025 */ move $s2, $zero -/* 042B30 7F00E000 24050004 */ li $a1, 4 -/* 042B34 7F00E004 2A410003 */ slti $at, $s2, 3 -.L7F00E008: -/* 042B38 7F00E008 10200011 */ beqz $at, .L7F00E050 -/* 042B3C 7F00E00C 00125080 */ sll $t2, $s2, 2 -/* 042B40 7F00E010 008A1021 */ addu $v0, $a0, $t2 -/* 042B44 7F00E014 8C4B0004 */ lw $t3, 4($v0) -/* 042B48 7F00E018 8C4C0000 */ lw $t4, ($v0) -/* 042B4C 7F00E01C C4700000 */ lwc1 $f16, ($v1) -/* 042B50 7F00E020 016C6821 */ addu $t5, $t3, $t4 -/* 042B54 7F00E024 448D9000 */ mtc1 $t5, $f18 -/* 042B58 7F00E028 00000000 */ nop -/* 042B5C 7F00E02C 468091A0 */ cvt.s.w $f6, $f18 -/* 042B60 7F00E030 46003202 */ mul.s $f8, $f6, $f0 -/* 042B64 7F00E034 4608803C */ c.lt.s $f16, $f8 -/* 042B68 7F00E038 00000000 */ nop -/* 042B6C 7F00E03C 45010004 */ bc1t .L7F00E050 -/* 042B70 7F00E040 00000000 */ nop -/* 042B74 7F00E044 26520001 */ addiu $s2, $s2, 1 -/* 042B78 7F00E048 5645FFEF */ bnel $s2, $a1, .L7F00E008 -/* 042B7C 7F00E04C 2A410003 */ slti $at, $s2, 3 -.L7F00E050: -/* 042B80 7F00E050 1A400011 */ blez $s2, .L7F00E098 -/* 042B84 7F00E054 0012A880 */ sll $s5, $s2, 2 -/* 042B88 7F00E058 02B2A821 */ addu $s5, $s5, $s2 -.L7F00E05C: -/* 042B8C 7F00E05C 00008825 */ move $s1, $zero -/* 042B90 7F00E060 02A08025 */ move $s0, $s5 -.L7F00E064: -/* 042B94 7F00E064 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 042B98 7F00E068 02002025 */ move $a0, $s0 -/* 042B9C 7F00E06C 04430005 */ bgezl $v0, .L7F00E084 -/* 042BA0 7F00E070 2A210005 */ slti $at, $s1, 5 -/* 042BA4 7F00E074 26310001 */ addiu $s1, $s1, 1 -/* 042BA8 7F00E078 1633FFFA */ bne $s1, $s3, .L7F00E064 -/* 042BAC 7F00E07C 26100001 */ addiu $s0, $s0, 1 -/* 042BB0 7F00E080 2A210005 */ slti $at, $s1, 5 -.L7F00E084: -/* 042BB4 7F00E084 54200005 */ bnezl $at, .L7F00E09C -/* 042BB8 7F00E088 0012A880 */ sll $s5, $s2, 2 -/* 042BBC 7F00E08C 2652FFFF */ addiu $s2, $s2, -1 -/* 042BC0 7F00E090 1E40FFF2 */ bgtz $s2, .L7F00E05C -/* 042BC4 7F00E094 26B5FFFB */ addiu $s5, $s5, -5 -.L7F00E098: -/* 042BC8 7F00E098 0012A880 */ sll $s5, $s2, 2 -.L7F00E09C: -/* 042BCC 7F00E09C 06800009 */ bltz $s4, .L7F00E0C4 -/* 042BD0 7F00E0A0 02B2A821 */ addu $s5, $s5, $s2 -/* 042BD4 7F00E0A4 02B48021 */ addu $s0, $s5, $s4 -.L7F00E0A8: -/* 042BD8 7F00E0A8 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 042BDC 7F00E0AC 02002025 */ move $a0, $s0 -/* 042BE0 7F00E0B0 04410004 */ bgez $v0, .L7F00E0C4 -/* 042BE4 7F00E0B4 00000000 */ nop -/* 042BE8 7F00E0B8 2694FFFF */ addiu $s4, $s4, -1 -/* 042BEC 7F00E0BC 0681FFFA */ bgez $s4, .L7F00E0A8 -/* 042BF0 7F00E0C0 2610FFFF */ addiu $s0, $s0, -1 -.L7F00E0C4: -/* 042BF4 7F00E0C4 06810009 */ bgez $s4, .L7F00E0EC -/* 042BF8 7F00E0C8 02A08025 */ move $s0, $s5 -/* 042BFC 7F00E0CC 0000A025 */ move $s4, $zero -.L7F00E0D0: -/* 042C00 7F00E0D0 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 042C04 7F00E0D4 02002025 */ move $a0, $s0 -/* 042C08 7F00E0D8 04430005 */ bgezl $v0, .L7F00E0F0 -/* 042C0C 7F00E0DC 02B47021 */ addu $t6, $s5, $s4 -/* 042C10 7F00E0E0 26940001 */ addiu $s4, $s4, 1 -/* 042C14 7F00E0E4 1693FFFA */ bne $s4, $s3, .L7F00E0D0 -/* 042C18 7F00E0E8 26100001 */ addiu $s0, $s0, 1 -.L7F00E0EC: -/* 042C1C 7F00E0EC 02B47021 */ addu $t6, $s5, $s4 -.L7F00E0F0: -/* 042C20 7F00E0F0 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) -/* 042C24 7F00E0F4 AC2E9784 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -.L7F00E0F8: -/* 042C28 7F00E0F8 3C048003 */ lui $a0, %hi(walletinst) -/* 042C2C 7F00E0FC 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 042C30 7F00E100 8C8F0008 */ lw $t7, 8($a0) -/* 042C34 7F00E104 8DF80008 */ lw $t8, 8($t7) -/* 042C38 7F00E108 8F050054 */ lw $a1, 0x54($t8) -/* 042C3C 7F00E10C 50A00054 */ beql $a1, $zero, .L7F00E260 -/* 042C40 7F00E110 00002025 */ move $a0, $zero -/* 042C44 7F00E114 0FC1B1E7 */ jal modelGetNodeRwData -/* 042C48 7F00E118 8CB40004 */ lw $s4, 4($a1) -/* 042C4C 7F00E11C 00408825 */ move $s1, $v0 -/* 042C50 7F00E120 0FC2F5B1 */ jal dynAllocate7F0BD6C4 -/* 042C54 7F00E124 8684000C */ lh $a0, 0xc($s4) -/* 042C58 7F00E128 AE220000 */ sw $v0, ($s1) -/* 042C5C 7F00E12C 8699000C */ lh $t9, 0xc($s4) -/* 042C60 7F00E130 00009025 */ move $s2, $zero -/* 042C64 7F00E134 00008025 */ move $s0, $zero -/* 042C68 7F00E138 1B200048 */ blez $t9, .L7F00E25C -/* 042C6C 7F00E13C 241500F5 */ li $s5, 245 -/* 042C70 7F00E140 2413006E */ li $s3, 110 -/* 042C74 7F00E144 8E8A0008 */ lw $t2, 8($s4) -.L7F00E148: -/* 042C78 7F00E148 8E280000 */ lw $t0, ($s1) -/* 042C7C 7F00E14C 01505821 */ addu $t3, $t2, $s0 -/* 042C80 7F00E150 8D610000 */ lw $at, ($t3) -/* 042C84 7F00E154 01104821 */ addu $t1, $t0, $s0 -/* 042C88 7F00E158 AD210000 */ sw $at, ($t1) -/* 042C8C 7F00E15C 8D6D0004 */ lw $t5, 4($t3) -/* 042C90 7F00E160 AD2D0004 */ sw $t5, 4($t1) -/* 042C94 7F00E164 8D610008 */ lw $at, 8($t3) -/* 042C98 7F00E168 AD210008 */ sw $at, 8($t1) -/* 042C9C 7F00E16C 8D6D000C */ lw $t5, 0xc($t3) -/* 042CA0 7F00E170 AD2D000C */ sw $t5, 0xc($t1) -/* 042CA4 7F00E174 06410003 */ bgez $s2, .L7F00E184 -/* 042CA8 7F00E178 00122083 */ sra $a0, $s2, 2 -/* 042CAC 7F00E17C 26410003 */ addiu $at, $s2, 3 -/* 042CB0 7F00E180 00012083 */ sra $a0, $at, 2 -.L7F00E184: -/* 042CB4 7F00E184 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 042CB8 7F00E188 AFA40030 */ sw $a0, 0x30($sp) -/* 042CBC 7F00E18C 240300FF */ li $v1, 255 -/* 042CC0 7F00E190 8FA40030 */ lw $a0, 0x30($sp) -/* 042CC4 7F00E194 0440001F */ bltz $v0, .L7F00E214 -/* 042CC8 7F00E198 2405000F */ li $a1, 15 -/* 042CCC 7F00E19C 3C0E8007 */ lui $t6, %hi(mission_difficulty_highlighted) -/* 042CD0 7F00E1A0 8DCE9784 */ lw $t6, %lo(mission_difficulty_highlighted)($t6) -/* 042CD4 7F00E1A4 548E000F */ bnel $a0, $t6, .L7F00E1E4 -/* 042CD8 7F00E1A8 8E2D0000 */ lw $t5, ($s1) -/* 042CDC 7F00E1AC 8E2F0000 */ lw $t7, ($s1) -/* 042CE0 7F00E1B0 01F0C021 */ addu $t8, $t7, $s0 -/* 042CE4 7F00E1B4 A303000C */ sb $v1, 0xc($t8) -/* 042CE8 7F00E1B8 8E390000 */ lw $t9, ($s1) -/* 042CEC 7F00E1BC 03304021 */ addu $t0, $t9, $s0 -/* 042CF0 7F00E1C0 A103000D */ sb $v1, 0xd($t0) -/* 042CF4 7F00E1C4 8E2A0000 */ lw $t2, ($s1) -/* 042CF8 7F00E1C8 01506021 */ addu $t4, $t2, $s0 -/* 042CFC 7F00E1CC A183000E */ sb $v1, 0xe($t4) -/* 042D00 7F00E1D0 8E290000 */ lw $t1, ($s1) -/* 042D04 7F00E1D4 01305821 */ addu $t3, $t1, $s0 -/* 042D08 7F00E1D8 1000001A */ b .L7F00E244 -/* 042D0C 7F00E1DC A175000F */ sb $s5, 0xf($t3) -/* 042D10 7F00E1E0 8E2D0000 */ lw $t5, ($s1) -.L7F00E1E4: -/* 042D14 7F00E1E4 01B07021 */ addu $t6, $t5, $s0 -/* 042D18 7F00E1E8 A1D3000C */ sb $s3, 0xc($t6) -/* 042D1C 7F00E1EC 8E2F0000 */ lw $t7, ($s1) -/* 042D20 7F00E1F0 01F0C021 */ addu $t8, $t7, $s0 -/* 042D24 7F00E1F4 A313000D */ sb $s3, 0xd($t8) -/* 042D28 7F00E1F8 8E390000 */ lw $t9, ($s1) -/* 042D2C 7F00E1FC 03304021 */ addu $t0, $t9, $s0 -/* 042D30 7F00E200 A113000E */ sb $s3, 0xe($t0) -/* 042D34 7F00E204 8E2A0000 */ lw $t2, ($s1) -/* 042D38 7F00E208 01506021 */ addu $t4, $t2, $s0 -/* 042D3C 7F00E20C 1000000D */ b .L7F00E244 -/* 042D40 7F00E210 A183000F */ sb $v1, 0xf($t4) -.L7F00E214: -/* 042D44 7F00E214 8E290000 */ lw $t1, ($s1) -/* 042D48 7F00E218 01305821 */ addu $t3, $t1, $s0 -/* 042D4C 7F00E21C A165000C */ sb $a1, 0xc($t3) -/* 042D50 7F00E220 8E2D0000 */ lw $t5, ($s1) -/* 042D54 7F00E224 01B07021 */ addu $t6, $t5, $s0 -/* 042D58 7F00E228 A1C5000D */ sb $a1, 0xd($t6) -/* 042D5C 7F00E22C 8E2F0000 */ lw $t7, ($s1) -/* 042D60 7F00E230 01F0C021 */ addu $t8, $t7, $s0 -/* 042D64 7F00E234 A305000E */ sb $a1, 0xe($t8) -/* 042D68 7F00E238 8E390000 */ lw $t9, ($s1) -/* 042D6C 7F00E23C 03304021 */ addu $t0, $t9, $s0 -/* 042D70 7F00E240 A103000F */ sb $v1, 0xf($t0) -.L7F00E244: -/* 042D74 7F00E244 868A000C */ lh $t2, 0xc($s4) -/* 042D78 7F00E248 26520001 */ addiu $s2, $s2, 1 -/* 042D7C 7F00E24C 26100010 */ addiu $s0, $s0, 0x10 -/* 042D80 7F00E250 024A082A */ slt $at, $s2, $t2 -/* 042D84 7F00E254 5420FFBC */ bnezl $at, .L7F00E148 -/* 042D88 7F00E258 8E8A0008 */ lw $t2, 8($s4) -.L7F00E25C: -/* 042D8C 7F00E25C 00002025 */ move $a0, $zero -.L7F00E260: -/* 042D90 7F00E260 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 042D94 7F00E264 3405B000 */ li $a1, 45056 -/* 042D98 7F00E268 1040002A */ beqz $v0, .L7F00E314 -/* 042D9C 7F00E26C 00002025 */ move $a0, $zero -/* 042DA0 7F00E270 3C0C8003 */ lui $t4, %hi(tab_prev_highlight) -/* 042DA4 7F00E274 8D8CA8E4 */ lw $t4, %lo(tab_prev_highlight)($t4) -/* 042DA8 7F00E278 24090001 */ li $t1, 1 -/* 042DAC 7F00E27C 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 042DB0 7F00E280 11800009 */ beqz $t4, .L7F00E2A8 -/* 042DB4 7F00E284 3C048007 */ lui $a0, %hi(mission_difficulty_highlighted) -/* 042DB8 7F00E288 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 042DBC 7F00E28C AC29A8D8 */ sw $t1, %lo(tab_prev_selected)($at) -/* 042DC0 7F00E290 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042DC4 7F00E294 240500C7 */ li $a1, 199 -/* 042DC8 7F00E298 0C002382 */ jal sndPlaySfx -/* 042DCC 7F00E29C 00003025 */ move $a2, $zero -/* 042DD0 7F00E2A0 10000027 */ b .L7F00E340 -/* 042DD4 7F00E2A4 00000000 */ nop -.L7F00E2A8: -/* 042DD8 7F00E2A8 8C849784 */ lw $a0, %lo(mission_difficulty_highlighted)($a0) -/* 042DDC 7F00E2AC 04800024 */ bltz $a0, .L7F00E340 -/* 042DE0 7F00E2B0 00000000 */ nop -/* 042DE4 7F00E2B4 0FC03730 */ jal pull_and_display_text_for_folder_a0 -/* 042DE8 7F00E2B8 00000000 */ nop -/* 042DEC 7F00E2BC 3C018003 */ lui $at, %hi(briefingpage) -/* 042DF0 7F00E2C0 AC22A8F8 */ sw $v0, %lo(briefingpage)($at) -/* 042DF4 7F00E2C4 3C0B8003 */ lui $t3, %hi(briefingpage) -/* 042DF8 7F00E2C8 8D6BA8F8 */ lw $t3, %lo(briefingpage)($t3) -/* 042DFC 7F00E2CC 3C0E8003 */ lui $t6, %hi(mission_folder_setup_entries+8) -/* 042E00 7F00E2D0 3C018003 */ lui $at, %hi(selected_stage) -/* 042E04 7F00E2D4 000B68C0 */ sll $t5, $t3, 3 -/* 042E08 7F00E2D8 01AB6823 */ subu $t5, $t5, $t3 -/* 042E0C 7F00E2DC 000D6880 */ sll $t5, $t5, 2 -/* 042E10 7F00E2E0 01CD7021 */ addu $t6, $t6, $t5 -/* 042E14 7F00E2E4 8DCEABEC */ lw $t6, %lo(mission_folder_setup_entries+8)($t6) -/* 042E18 7F00E2E8 240F0001 */ li $t7, 1 -/* 042E1C 7F00E2EC 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 042E20 7F00E2F0 AC2EA8F4 */ sw $t6, %lo(selected_stage)($at) -/* 042E24 7F00E2F4 3C018003 */ lui $at, %hi(tab_next_selected) -/* 042E28 7F00E2F8 AC2FA8D4 */ sw $t7, %lo(tab_next_selected)($at) -/* 042E2C 7F00E2FC 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E30 7F00E300 240500C7 */ li $a1, 199 -/* 042E34 7F00E304 0C002382 */ jal sndPlaySfx -/* 042E38 7F00E308 00003025 */ move $a2, $zero -/* 042E3C 7F00E30C 1000000C */ b .L7F00E340 -/* 042E40 7F00E310 00000000 */ nop -.L7F00E314: -/* 042E44 7F00E314 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 042E48 7F00E318 24054000 */ li $a1, 16384 -/* 042E4C 7F00E31C 10400008 */ beqz $v0, .L7F00E340 -/* 042E50 7F00E320 24180001 */ li $t8, 1 -/* 042E54 7F00E324 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 042E58 7F00E328 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 042E5C 7F00E32C AC38A8D8 */ sw $t8, %lo(tab_prev_selected)($at) -/* 042E60 7F00E330 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E64 7F00E334 240500C7 */ li $a1, 199 -/* 042E68 7F00E338 0C002382 */ jal sndPlaySfx -/* 042E6C 7F00E33C 00003025 */ move $a2, $zero -.L7F00E340: -/* 042E70 7F00E340 0FC026E1 */ jal menu_control_stick_tracking -/* 042E74 7F00E344 00000000 */ nop -/* 042E78 7F00E348 3C198003 */ lui $t9, %hi(tab_next_selected) -/* 042E7C 7F00E34C 8F39A8D4 */ lw $t9, %lo(tab_next_selected)($t9) -/* 042E80 7F00E350 24040008 */ li $a0, 8 -/* 042E84 7F00E354 3C0C8003 */ lui $t4, %hi(tab_prev_selected) -/* 042E88 7F00E358 13200010 */ beqz $t9, .L7F00E39C -/* 042E8C 7F00E35C 00000000 */ nop -/* 042E90 7F00E360 0FC06975 */ jal set_menu_to_mode -/* 042E94 7F00E364 00002825 */ move $a1, $zero -/* 042E98 7F00E368 3C088003 */ lui $t0, %hi(briefingpage) -/* 042E9C 7F00E36C 8D08A8F8 */ lw $t0, %lo(briefingpage)($t0) -/* 042EA0 7F00E370 3C048003 */ lui $a0, %hi(mission_folder_setup_entries+20) -/* 042EA4 7F00E374 000850C0 */ sll $t2, $t0, 3 -/* 042EA8 7F00E378 01485023 */ subu $t2, $t2, $t0 -/* 042EAC 7F00E37C 000A5080 */ sll $t2, $t2, 2 -/* 042EB0 7F00E380 008A2021 */ addu $a0, $a0, $t2 -/* 042EB4 7F00E384 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 042EB8 7F00E388 8C84ABF8 */ lw $a0, %lo(mission_folder_setup_entries+20)($a0) -/* 042EBC 7F00E38C 0FC03B59 */ jal set_cursor_pos_difficulty -/* 042EC0 7F00E390 00402025 */ move $a0, $v0 -/* 042EC4 7F00E394 1000000A */ b .L7F00E3C0 -/* 042EC8 7F00E398 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E39C: -/* 042ECC 7F00E39C 8D8CA8D8 */ lw $t4, %lo(tab_prev_selected)($t4) -/* 042ED0 7F00E3A0 24040006 */ li $a0, 6 -/* 042ED4 7F00E3A4 51800006 */ beql $t4, $zero, .L7F00E3C0 -/* 042ED8 7F00E3A8 8FBF002C */ lw $ra, 0x2c($sp) -/* 042EDC 7F00E3AC 0FC06975 */ jal set_menu_to_mode -/* 042EE0 7F00E3B0 00002825 */ move $a1, $zero -/* 042EE4 7F00E3B4 0FC035FF */ jal setCursorPOSforMode -/* 042EE8 7F00E3B8 00002025 */ move $a0, $zero -/* 042EEC 7F00E3BC 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E3C0: -/* 042EF0 7F00E3C0 8FB00014 */ lw $s0, 0x14($sp) -/* 042EF4 7F00E3C4 8FB10018 */ lw $s1, 0x18($sp) -/* 042EF8 7F00E3C8 8FB2001C */ lw $s2, 0x1c($sp) -/* 042EFC 7F00E3CC 8FB30020 */ lw $s3, 0x20($sp) -/* 042F00 7F00E3D0 8FB40024 */ lw $s4, 0x24($sp) -/* 042F04 7F00E3D4 8FB50028 */ lw $s5, 0x28($sp) -/* 042F08 7F00E3D8 03E00008 */ jr $ra -/* 042F0C 7F00E3DC 27BD0060 */ addiu $sp, $sp, 0x60 -) -#endif - -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata -glabel D_80051A44 -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_80051A48 -.word 0x461C4000 /* 10000.0;*/ -.text -glabel interface_menu07_missionsel -/* 042A48 7F00DED8 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 042A4C 7F00DEDC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 042A50 7F00DEE0 AFBF002C */ sw $ra, 0x2c($sp) -/* 042A54 7F00DEE4 44816000 */ mtc1 $at, $f12 -/* 042A58 7F00DEE8 AFB50028 */ sw $s5, 0x28($sp) -/* 042A5C 7F00DEEC AFB40024 */ sw $s4, 0x24($sp) -/* 042A60 7F00DEF0 AFB30020 */ sw $s3, 0x20($sp) -/* 042A64 7F00DEF4 AFB2001C */ sw $s2, 0x1c($sp) -/* 042A68 7F00DEF8 AFB10018 */ sw $s1, 0x18($sp) -/* 042A6C 7F00DEFC 0C001151 */ jal viSetFovY -/* 042A70 7F00DF00 AFB00014 */ sw $s0, 0x14($sp) -/* 042A74 7F00DF04 3C018005 */ lui $at, %hi(D_80051A44) # $at, 0x8005 -/* 042A78 7F00DF08 0C001164 */ jal viSetAspect -/* 042A7C 7F00DF0C C42C1A74 */ lwc1 $f12, %lo(D_80051A44)($at) -/* 042A80 7F00DF10 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 042A84 7F00DF14 44816000 */ mtc1 $at, $f12 -/* 042A88 7F00DF18 3C018005 */ lui $at, %hi(D_80051A48) # $at, 0x8005 -/* 042A8C 7F00DF1C 0C001194 */ jal viSetZRange -/* 042A90 7F00DF20 C42E1A78 */ lwc1 $f14, %lo(D_80051A48)($at) -/* 042A94 7F00DF24 0C00114D */ jal viSetUseZBuf -/* 042A98 7F00DF28 00002025 */ move $a0, $zero -/* 042A9C 7F00DF2C 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AA0 7F00DF30 0FC02DD1 */ jal disable_all_switches -/* 042AA4 7F00DF34 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AA8 7F00DF38 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AAC 7F00DF3C 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AB0 7F00DF40 00002825 */ move $a1, $zero -/* 042AB4 7F00DF44 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042AB8 7F00DF48 24060001 */ li $a2, 1 -/* 042ABC 7F00DF4C 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AC0 7F00DF50 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AC4 7F00DF54 24050013 */ li $a1, 19 -/* 042AC8 7F00DF58 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042ACC 7F00DF5C 24060001 */ li $a2, 1 -/* 042AD0 7F00DF60 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AD4 7F00DF64 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AD8 7F00DF68 24050014 */ li $a1, 20 -/* 042ADC 7F00DF6C 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042AE0 7F00DF70 24060001 */ li $a2, 1 -/* 042AE4 7F00DF74 3C018003 */ lui $at, %hi(tab_prev_highlight) # $at, 0x8003 -/* 042AE8 7F00DF78 AC20A924 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 042AEC 7F00DF7C 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) # $at, 0x8007 -/* 042AF0 7F00DF80 240EFFFF */ li $t6, -1 -/* 042AF4 7F00DF84 0FC028EF */ jal isontab3 -/* 042AF8 7F00DF88 AC2E97C4 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -/* 042AFC 7F00DF8C 10400005 */ beqz $v0, .L7F00DFA4 -/* 042B00 7F00DF90 0000A025 */ move $s4, $zero -/* 042B04 7F00DF94 240F0001 */ li $t7, 1 -/* 042B08 7F00DF98 3C018003 */ lui $at, %hi(tab_prev_highlight) # $at, 0x8003 -/* 042B0C 7F00DF9C 1000005E */ b .L7F00E118 -/* 042B10 7F00DFA0 AC2FA924 */ sw $t7, %lo(tab_prev_highlight)($at) -.L7F00DFA4: -/* 042B14 7F00DFA4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 042B18 7F00DFA8 3C048003 */ lui $a0, %hi(cursor_xpos_table_mission_select) # $a0, 0x8003 -/* 042B1C 7F00DFAC 3C038003 */ lui $v1, %hi(cursor_h_pos) # $v1, 0x8003 -/* 042B20 7F00DFB0 44810000 */ mtc1 $at, $f0 -/* 042B24 7F00DFB4 2463A948 */ addiu $v1, %lo(cursor_h_pos) # addiu $v1, $v1, -0x56b8 -/* 042B28 7F00DFB8 2484B010 */ addiu $a0, %lo(cursor_xpos_table_mission_select) # addiu $a0, $a0, -0x4ff0 -/* 042B2C 7F00DFBC 24130005 */ li $s3, 5 -/* 042B30 7F00DFC0 2A810004 */ slti $at, $s4, 4 -.L7F00DFC4: -/* 042B34 7F00DFC4 10200011 */ beqz $at, .L7F00E00C -/* 042B38 7F00DFC8 0014C080 */ sll $t8, $s4, 2 -/* 042B3C 7F00DFCC 00981021 */ addu $v0, $a0, $t8 -/* 042B40 7F00DFD0 8C590004 */ lw $t9, 4($v0) -/* 042B44 7F00DFD4 8C480000 */ lw $t0, ($v0) -/* 042B48 7F00DFD8 C4640000 */ lwc1 $f4, ($v1) -/* 042B4C 7F00DFDC 03284821 */ addu $t1, $t9, $t0 -/* 042B50 7F00DFE0 44893000 */ mtc1 $t1, $f6 -/* 042B54 7F00DFE4 00000000 */ nop -/* 042B58 7F00DFE8 46803220 */ cvt.s.w $f8, $f6 -/* 042B5C 7F00DFEC 46004282 */ mul.s $f10, $f8, $f0 -/* 042B60 7F00DFF0 460A203C */ c.lt.s $f4, $f10 -/* 042B64 7F00DFF4 00000000 */ nop -/* 042B68 7F00DFF8 45010004 */ bc1t .L7F00E00C -/* 042B6C 7F00DFFC 00000000 */ nop -/* 042B70 7F00E000 26940001 */ addiu $s4, $s4, 1 -/* 042B74 7F00E004 5693FFEF */ bnel $s4, $s3, .L7F00DFC4 -/* 042B78 7F00E008 2A810004 */ slti $at, $s4, 4 -.L7F00E00C: -/* 042B7C 7F00E00C 3C048003 */ lui $a0, %hi(cursor_ypos_table_mission_select) # $a0, 0x8003 -/* 042B80 7F00E010 3C038003 */ lui $v1, %hi(cursor_v_pos) # $v1, 0x8003 -/* 042B84 7F00E014 2463A94C */ addiu $v1, %lo(cursor_v_pos) # addiu $v1, $v1, -0x56b4 -/* 042B88 7F00E018 2484B024 */ addiu $a0, %lo(cursor_ypos_table_mission_select) # addiu $a0, $a0, -0x4fdc -/* 042B8C 7F00E01C 00009025 */ move $s2, $zero -/* 042B90 7F00E020 24050004 */ li $a1, 4 -/* 042B94 7F00E024 2A410003 */ slti $at, $s2, 3 -.L7F00E028: -/* 042B98 7F00E028 10200011 */ beqz $at, .L7F00E070 -/* 042B9C 7F00E02C 00125080 */ sll $t2, $s2, 2 -/* 042BA0 7F00E030 008A1021 */ addu $v0, $a0, $t2 -/* 042BA4 7F00E034 8C4B0004 */ lw $t3, 4($v0) -/* 042BA8 7F00E038 8C4C0000 */ lw $t4, ($v0) -/* 042BAC 7F00E03C C4700000 */ lwc1 $f16, ($v1) -/* 042BB0 7F00E040 016C6821 */ addu $t5, $t3, $t4 -/* 042BB4 7F00E044 448D9000 */ mtc1 $t5, $f18 -/* 042BB8 7F00E048 00000000 */ nop -/* 042BBC 7F00E04C 468091A0 */ cvt.s.w $f6, $f18 -/* 042BC0 7F00E050 46003202 */ mul.s $f8, $f6, $f0 -/* 042BC4 7F00E054 4608803C */ c.lt.s $f16, $f8 -/* 042BC8 7F00E058 00000000 */ nop -/* 042BCC 7F00E05C 45010004 */ bc1t .L7F00E070 -/* 042BD0 7F00E060 00000000 */ nop -/* 042BD4 7F00E064 26520001 */ addiu $s2, $s2, 1 -/* 042BD8 7F00E068 5645FFEF */ bnel $s2, $a1, .L7F00E028 -/* 042BDC 7F00E06C 2A410003 */ slti $at, $s2, 3 -.L7F00E070: -/* 042BE0 7F00E070 1A400011 */ blez $s2, .L7F00E0B8 -/* 042BE4 7F00E074 0012A880 */ sll $s5, $s2, 2 -/* 042BE8 7F00E078 02B2A821 */ addu $s5, $s5, $s2 -.L7F00E07C: -/* 042BEC 7F00E07C 00008825 */ move $s1, $zero -/* 042BF0 7F00E080 02A08025 */ move $s0, $s5 -.L7F00E084: -/* 042BF4 7F00E084 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042BF8 7F00E088 02002025 */ move $a0, $s0 -/* 042BFC 7F00E08C 04430005 */ bgezl $v0, .L7F00E0A4 -/* 042C00 7F00E090 2A210005 */ slti $at, $s1, 5 -/* 042C04 7F00E094 26310001 */ addiu $s1, $s1, 1 -/* 042C08 7F00E098 1633FFFA */ bne $s1, $s3, .L7F00E084 -/* 042C0C 7F00E09C 26100001 */ addiu $s0, $s0, 1 -/* 042C10 7F00E0A0 2A210005 */ slti $at, $s1, 5 -.L7F00E0A4: -/* 042C14 7F00E0A4 54200005 */ bnezl $at, .L7F00E0BC -/* 042C18 7F00E0A8 0012A880 */ sll $s5, $s2, 2 -/* 042C1C 7F00E0AC 2652FFFF */ addiu $s2, $s2, -1 -/* 042C20 7F00E0B0 1E40FFF2 */ bgtz $s2, .L7F00E07C -/* 042C24 7F00E0B4 26B5FFFB */ addiu $s5, $s5, -5 -.L7F00E0B8: -/* 042C28 7F00E0B8 0012A880 */ sll $s5, $s2, 2 -.L7F00E0BC: -/* 042C2C 7F00E0BC 06800009 */ bltz $s4, .L7F00E0E4 -/* 042C30 7F00E0C0 02B2A821 */ addu $s5, $s5, $s2 -/* 042C34 7F00E0C4 02B48021 */ addu $s0, $s5, $s4 -.L7F00E0C8: -/* 042C38 7F00E0C8 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042C3C 7F00E0CC 02002025 */ move $a0, $s0 -/* 042C40 7F00E0D0 04410004 */ bgez $v0, .L7F00E0E4 -/* 042C44 7F00E0D4 00000000 */ nop -/* 042C48 7F00E0D8 2694FFFF */ addiu $s4, $s4, -1 -/* 042C4C 7F00E0DC 0681FFFA */ bgez $s4, .L7F00E0C8 -/* 042C50 7F00E0E0 2610FFFF */ addiu $s0, $s0, -1 -.L7F00E0E4: -/* 042C54 7F00E0E4 06810009 */ bgez $s4, .L7F00E10C -/* 042C58 7F00E0E8 02A08025 */ move $s0, $s5 -/* 042C5C 7F00E0EC 0000A025 */ move $s4, $zero -.L7F00E0F0: -/* 042C60 7F00E0F0 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042C64 7F00E0F4 02002025 */ move $a0, $s0 -/* 042C68 7F00E0F8 04430005 */ bgezl $v0, .L7F00E110 -/* 042C6C 7F00E0FC 02B47021 */ addu $t6, $s5, $s4 -/* 042C70 7F00E100 26940001 */ addiu $s4, $s4, 1 -/* 042C74 7F00E104 1693FFFA */ bne $s4, $s3, .L7F00E0F0 -/* 042C78 7F00E108 26100001 */ addiu $s0, $s0, 1 -.L7F00E10C: -/* 042C7C 7F00E10C 02B47021 */ addu $t6, $s5, $s4 -.L7F00E110: -/* 042C80 7F00E110 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) # $at, 0x8007 -/* 042C84 7F00E114 AC2E97C4 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -.L7F00E118: -/* 042C88 7F00E118 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042C8C 7F00E11C 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042C90 7F00E120 8C8F0008 */ lw $t7, 8($a0) -/* 042C94 7F00E124 8DF80008 */ lw $t8, 8($t7) -/* 042C98 7F00E128 8F050054 */ lw $a1, 0x54($t8) -/* 042C9C 7F00E12C 50A00054 */ beql $a1, $zero, .L7F00E280 -/* 042CA0 7F00E130 00002025 */ move $a0, $zero -/* 042CA4 7F00E134 0FC1B363 */ jal modelGetNodeRwData -/* 042CA8 7F00E138 8CB40004 */ lw $s4, 4($a1) -/* 042CAC 7F00E13C 00408825 */ move $s1, $v0 -/* 042CB0 7F00E140 0FC2F89D */ jal dynAllocate7F0BD6C4 -/* 042CB4 7F00E144 8684000C */ lh $a0, 0xc($s4) -/* 042CB8 7F00E148 AE220000 */ sw $v0, ($s1) -/* 042CBC 7F00E14C 8699000C */ lh $t9, 0xc($s4) -/* 042CC0 7F00E150 00009025 */ move $s2, $zero -/* 042CC4 7F00E154 00008025 */ move $s0, $zero -/* 042CC8 7F00E158 1B200048 */ blez $t9, .L7F00E27C -/* 042CCC 7F00E15C 241500F5 */ li $s5, 245 -/* 042CD0 7F00E160 2413006E */ li $s3, 110 -/* 042CD4 7F00E164 8E8A0008 */ lw $t2, 8($s4) -.L7F00E168: -/* 042CD8 7F00E168 8E280000 */ lw $t0, ($s1) -/* 042CDC 7F00E16C 01505821 */ addu $t3, $t2, $s0 -/* 042CE0 7F00E170 8D610000 */ lw $at, ($t3) -/* 042CE4 7F00E174 01104821 */ addu $t1, $t0, $s0 -/* 042CE8 7F00E178 AD210000 */ sw $at, ($t1) -/* 042CEC 7F00E17C 8D6D0004 */ lw $t5, 4($t3) -/* 042CF0 7F00E180 AD2D0004 */ sw $t5, 4($t1) -/* 042CF4 7F00E184 8D610008 */ lw $at, 8($t3) -/* 042CF8 7F00E188 AD210008 */ sw $at, 8($t1) -/* 042CFC 7F00E18C 8D6D000C */ lw $t5, 0xc($t3) -/* 042D00 7F00E190 AD2D000C */ sw $t5, 0xc($t1) -/* 042D04 7F00E194 06410003 */ bgez $s2, .L7F00E1A4 -/* 042D08 7F00E198 00122083 */ sra $a0, $s2, 2 -/* 042D0C 7F00E19C 26410003 */ addiu $at, $s2, 3 -/* 042D10 7F00E1A0 00012083 */ sra $a0, $at, 2 -.L7F00E1A4: -/* 042D14 7F00E1A4 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042D18 7F00E1A8 AFA40030 */ sw $a0, 0x30($sp) -/* 042D1C 7F00E1AC 240300FF */ li $v1, 255 -/* 042D20 7F00E1B0 8FA40030 */ lw $a0, 0x30($sp) -/* 042D24 7F00E1B4 0440001F */ bltz $v0, .L7F00E234 -/* 042D28 7F00E1B8 2405000F */ li $a1, 15 -/* 042D2C 7F00E1BC 3C0E8007 */ lui $t6, %hi(mission_difficulty_highlighted) # $t6, 0x8007 -/* 042D30 7F00E1C0 8DCE97C4 */ lw $t6, %lo(mission_difficulty_highlighted)($t6) -/* 042D34 7F00E1C4 548E000F */ bnel $a0, $t6, .L7F00E204 -/* 042D38 7F00E1C8 8E2D0000 */ lw $t5, ($s1) -/* 042D3C 7F00E1CC 8E2F0000 */ lw $t7, ($s1) -/* 042D40 7F00E1D0 01F0C021 */ addu $t8, $t7, $s0 -/* 042D44 7F00E1D4 A303000C */ sb $v1, 0xc($t8) -/* 042D48 7F00E1D8 8E390000 */ lw $t9, ($s1) -/* 042D4C 7F00E1DC 03304021 */ addu $t0, $t9, $s0 -/* 042D50 7F00E1E0 A103000D */ sb $v1, 0xd($t0) -/* 042D54 7F00E1E4 8E2A0000 */ lw $t2, ($s1) -/* 042D58 7F00E1E8 01506021 */ addu $t4, $t2, $s0 -/* 042D5C 7F00E1EC A183000E */ sb $v1, 0xe($t4) -/* 042D60 7F00E1F0 8E290000 */ lw $t1, ($s1) -/* 042D64 7F00E1F4 01305821 */ addu $t3, $t1, $s0 -/* 042D68 7F00E1F8 1000001A */ b .L7F00E264 -/* 042D6C 7F00E1FC A175000F */ sb $s5, 0xf($t3) -/* 042D70 7F00E200 8E2D0000 */ lw $t5, ($s1) -.L7F00E204: -/* 042D74 7F00E204 01B07021 */ addu $t6, $t5, $s0 -/* 042D78 7F00E208 A1D3000C */ sb $s3, 0xc($t6) -/* 042D7C 7F00E20C 8E2F0000 */ lw $t7, ($s1) -/* 042D80 7F00E210 01F0C021 */ addu $t8, $t7, $s0 -/* 042D84 7F00E214 A313000D */ sb $s3, 0xd($t8) -/* 042D88 7F00E218 8E390000 */ lw $t9, ($s1) -/* 042D8C 7F00E21C 03304021 */ addu $t0, $t9, $s0 -/* 042D90 7F00E220 A113000E */ sb $s3, 0xe($t0) -/* 042D94 7F00E224 8E2A0000 */ lw $t2, ($s1) -/* 042D98 7F00E228 01506021 */ addu $t4, $t2, $s0 -/* 042D9C 7F00E22C 1000000D */ b .L7F00E264 -/* 042DA0 7F00E230 A183000F */ sb $v1, 0xf($t4) -.L7F00E234: -/* 042DA4 7F00E234 8E290000 */ lw $t1, ($s1) -/* 042DA8 7F00E238 01305821 */ addu $t3, $t1, $s0 -/* 042DAC 7F00E23C A165000C */ sb $a1, 0xc($t3) -/* 042DB0 7F00E240 8E2D0000 */ lw $t5, ($s1) -/* 042DB4 7F00E244 01B07021 */ addu $t6, $t5, $s0 -/* 042DB8 7F00E248 A1C5000D */ sb $a1, 0xd($t6) -/* 042DBC 7F00E24C 8E2F0000 */ lw $t7, ($s1) -/* 042DC0 7F00E250 01F0C021 */ addu $t8, $t7, $s0 -/* 042DC4 7F00E254 A305000E */ sb $a1, 0xe($t8) -/* 042DC8 7F00E258 8E390000 */ lw $t9, ($s1) -/* 042DCC 7F00E25C 03304021 */ addu $t0, $t9, $s0 -/* 042DD0 7F00E260 A103000F */ sb $v1, 0xf($t0) -.L7F00E264: -/* 042DD4 7F00E264 868A000C */ lh $t2, 0xc($s4) -/* 042DD8 7F00E268 26520001 */ addiu $s2, $s2, 1 -/* 042DDC 7F00E26C 26100010 */ addiu $s0, $s0, 0x10 -/* 042DE0 7F00E270 024A082A */ slt $at, $s2, $t2 -/* 042DE4 7F00E274 5420FFBC */ bnezl $at, .L7F00E168 -/* 042DE8 7F00E278 8E8A0008 */ lw $t2, 8($s4) -.L7F00E27C: -/* 042DEC 7F00E27C 00002025 */ move $a0, $zero -.L7F00E280: -/* 042DF0 7F00E280 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 042DF4 7F00E284 3405B000 */ li $a1, 45056 -/* 042DF8 7F00E288 1040002A */ beqz $v0, .L7F00E334 -/* 042DFC 7F00E28C 00002025 */ move $a0, $zero -/* 042E00 7F00E290 3C0C8003 */ lui $t4, %hi(tab_prev_highlight) # $t4, 0x8003 -/* 042E04 7F00E294 8D8CA924 */ lw $t4, %lo(tab_prev_highlight)($t4) -/* 042E08 7F00E298 24090001 */ li $t1, 1 -/* 042E0C 7F00E29C 3C018003 */ lui $at, %hi(tab_prev_selected) # $at, 0x8003 -/* 042E10 7F00E2A0 11800009 */ beqz $t4, .L7F00E2C8 -/* 042E14 7F00E2A4 3C048007 */ lui $a0, %hi(mission_difficulty_highlighted) -/* 042E18 7F00E2A8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042E1C 7F00E2AC AC29A918 */ sw $t1, %lo(tab_prev_selected)($at) -/* 042E20 7F00E2B0 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E24 7F00E2B4 240500C7 */ li $a1, 199 -/* 042E28 7F00E2B8 0C002386 */ jal sndPlaySfx -/* 042E2C 7F00E2BC 00003025 */ move $a2, $zero -/* 042E30 7F00E2C0 10000027 */ b .L7F00E360 -/* 042E34 7F00E2C4 00000000 */ nop -.L7F00E2C8: -/* 042E38 7F00E2C8 8C8497C4 */ lw $a0, %lo(mission_difficulty_highlighted)($a0) -/* 042E3C 7F00E2CC 04800024 */ bltz $a0, .L7F00E360 -/* 042E40 7F00E2D0 00000000 */ nop -/* 042E44 7F00E2D4 0FC03738 */ jal pull_and_display_text_for_folder_a0 -/* 042E48 7F00E2D8 00000000 */ nop -/* 042E4C 7F00E2DC 3C018003 */ lui $at, %hi(briefingpage) # $at, 0x8003 -/* 042E50 7F00E2E0 AC22A938 */ sw $v0, %lo(briefingpage)($at) -/* 042E54 7F00E2E4 3C0B8003 */ lui $t3, %hi(briefingpage) # $t3, 0x8003 -/* 042E58 7F00E2E8 8D6BA938 */ lw $t3, %lo(briefingpage)($t3) -/* 042E5C 7F00E2EC 3C0E8003 */ lui $t6, %hi(mission_folder_setup_entries+8) -/* 042E60 7F00E2F0 3C018003 */ lui $at, %hi(selected_stage) # $at, 0x8003 -/* 042E64 7F00E2F4 000B68C0 */ sll $t5, $t3, 3 -/* 042E68 7F00E2F8 01AB6823 */ subu $t5, $t5, $t3 -/* 042E6C 7F00E2FC 000D6880 */ sll $t5, $t5, 2 -/* 042E70 7F00E300 01CD7021 */ addu $t6, $t6, $t5 -/* 042E74 7F00E304 8DCEAC2C */ lw $t6, %lo(mission_folder_setup_entries+8)($t6) -/* 042E78 7F00E308 240F0001 */ li $t7, 1 -/* 042E7C 7F00E30C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042E80 7F00E310 AC2EA934 */ sw $t6, %lo(selected_stage)($at) -/* 042E84 7F00E314 3C018003 */ lui $at, %hi(tab_next_selected) # $at, 0x8003 -/* 042E88 7F00E318 AC2FA914 */ sw $t7, %lo(tab_next_selected)($at) -/* 042E8C 7F00E31C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E90 7F00E320 240500C7 */ li $a1, 199 -/* 042E94 7F00E324 0C002386 */ jal sndPlaySfx -/* 042E98 7F00E328 00003025 */ move $a2, $zero -/* 042E9C 7F00E32C 1000000C */ b .L7F00E360 -/* 042EA0 7F00E330 00000000 */ nop -.L7F00E334: -/* 042EA4 7F00E334 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 042EA8 7F00E338 24054000 */ li $a1, 16384 -/* 042EAC 7F00E33C 10400008 */ beqz $v0, .L7F00E360 -/* 042EB0 7F00E340 24180001 */ li $t8, 1 -/* 042EB4 7F00E344 3C018003 */ lui $at, %hi(tab_prev_selected) # $at, 0x8003 -/* 042EB8 7F00E348 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042EBC 7F00E34C AC38A918 */ sw $t8, %lo(tab_prev_selected)($at) -/* 042EC0 7F00E350 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042EC4 7F00E354 240500C7 */ li $a1, 199 -/* 042EC8 7F00E358 0C002386 */ jal sndPlaySfx -/* 042ECC 7F00E35C 00003025 */ move $a2, $zero -.L7F00E360: -/* 042ED0 7F00E360 0FC026E9 */ jal menu_control_stick_tracking -/* 042ED4 7F00E364 00000000 */ nop -/* 042ED8 7F00E368 3C198003 */ lui $t9, %hi(tab_next_selected) # $t9, 0x8003 -/* 042EDC 7F00E36C 8F39A914 */ lw $t9, %lo(tab_next_selected)($t9) -/* 042EE0 7F00E370 24040008 */ li $a0, 8 -/* 042EE4 7F00E374 3C098003 */ lui $t1, %hi(tab_prev_selected) # $t1, 0x8003 -/* 042EE8 7F00E378 13200018 */ beqz $t9, .L7F00E3DC -/* 042EEC 7F00E37C 00000000 */ nop -/* 042EF0 7F00E380 0FC069E2 */ jal set_menu_to_mode -/* 042EF4 7F00E384 00002825 */ move $a1, $zero -/* 042EF8 7F00E388 3C088005 */ lui $t0, %hi(j_text_trigger) # $t0, 0x8005 -/* 042EFC 7F00E38C 8D088500 */ lw $t0, %lo(j_text_trigger)($t0) -/* 042F00 7F00E390 3C0A8003 */ lui $t2, %hi(briefingpage) # $t2, 0x8003 -/* 042F04 7F00E394 11000005 */ beqz $t0, .L7F00E3AC -/* 042F08 7F00E398 00000000 */ nop -/* 042F0C 7F00E39C 0FC03B69 */ jal set_cursor_pos_difficulty -/* 042F10 7F00E3A0 00002025 */ move $a0, $zero -/* 042F14 7F00E3A4 10000016 */ b .L7F00E400 -/* 042F18 7F00E3A8 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E3AC: -/* 042F1C 7F00E3AC 8D4AA938 */ lw $t2, %lo(briefingpage)($t2) -/* 042F20 7F00E3B0 3C048003 */ lui $a0, %hi(mission_folder_setup_entries+20) -/* 042F24 7F00E3B4 000A60C0 */ sll $t4, $t2, 3 -/* 042F28 7F00E3B8 018A6023 */ subu $t4, $t4, $t2 -/* 042F2C 7F00E3BC 000C6080 */ sll $t4, $t4, 2 -/* 042F30 7F00E3C0 008C2021 */ addu $a0, $a0, $t4 -/* 042F34 7F00E3C4 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042F38 7F00E3C8 8C84AC38 */ lw $a0, %lo(mission_folder_setup_entries+20)($a0) -/* 042F3C 7F00E3CC 0FC03B69 */ jal set_cursor_pos_difficulty -/* 042F40 7F00E3D0 00402025 */ move $a0, $v0 -/* 042F44 7F00E3D4 1000000A */ b .L7F00E400 -/* 042F48 7F00E3D8 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E3DC: -/* 042F4C 7F00E3DC 8D29A918 */ lw $t1, %lo(tab_prev_selected)($t1) -/* 042F50 7F00E3E0 24040006 */ li $a0, 6 -/* 042F54 7F00E3E4 51200006 */ beql $t1, $zero, .L7F00E400 -/* 042F58 7F00E3E8 8FBF002C */ lw $ra, 0x2c($sp) -/* 042F5C 7F00E3EC 0FC069E2 */ jal set_menu_to_mode -/* 042F60 7F00E3F0 00002825 */ move $a1, $zero -/* 042F64 7F00E3F4 0FC03607 */ jal setCursorPOSforMode -/* 042F68 7F00E3F8 00002025 */ move $a0, $zero -/* 042F6C 7F00E3FC 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E400: -/* 042F70 7F00E400 8FB00014 */ lw $s0, 0x14($sp) -/* 042F74 7F00E404 8FB10018 */ lw $s1, 0x18($sp) -/* 042F78 7F00E408 8FB2001C */ lw $s2, 0x1c($sp) -/* 042F7C 7F00E40C 8FB30020 */ lw $s3, 0x20($sp) -/* 042F80 7F00E410 8FB40024 */ lw $s4, 0x24($sp) -/* 042F84 7F00E414 8FB50028 */ lw $s5, 0x28($sp) -/* 042F88 7F00E418 03E00008 */ jr $ra -/* 042F8C 7F00E41C 27BD0060 */ addiu $sp, $sp, 0x60 - -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_80051A44 -.word 0x3FAAAAAB /* 1.3333334;*/ -glabel D_80051A48 -.word 0x461C4000 /* 10000.0;*/ -.text -glabel interface_menu07_missionsel -/* 042A48 7F00DED8 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 042A4C 7F00DEDC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 042A50 7F00DEE0 AFBF002C */ sw $ra, 0x2c($sp) -/* 042A54 7F00DEE4 44816000 */ mtc1 $at, $f12 -/* 042A58 7F00DEE8 AFB50028 */ sw $s5, 0x28($sp) -/* 042A5C 7F00DEEC AFB40024 */ sw $s4, 0x24($sp) -/* 042A60 7F00DEF0 AFB30020 */ sw $s3, 0x20($sp) -/* 042A64 7F00DEF4 AFB2001C */ sw $s2, 0x1c($sp) -/* 042A68 7F00DEF8 AFB10018 */ sw $s1, 0x18($sp) -/* 042A6C 7F00DEFC 0C001151 */ jal viSetFovY -/* 042A70 7F00DF00 AFB00014 */ sw $s0, 0x14($sp) -/* 042A74 7F00DF04 3C018005 */ lui $at, %hi(D_80051A44) # $at, 0x8005 -/* 042A78 7F00DF08 0C001164 */ jal viSetAspect -/* 042A7C 7F00DF0C C42C1A74 */ lwc1 $f12, %lo(D_80051A44)($at) -/* 042A80 7F00DF10 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 042A84 7F00DF14 44816000 */ mtc1 $at, $f12 -/* 042A88 7F00DF18 3C018005 */ lui $at, %hi(D_80051A48) # $at, 0x8005 -/* 042A8C 7F00DF1C 0C001194 */ jal viSetZRange -/* 042A90 7F00DF20 C42E1A78 */ lwc1 $f14, %lo(D_80051A48)($at) -/* 042A94 7F00DF24 0C00114D */ jal viSetUseZBuf -/* 042A98 7F00DF28 00002025 */ move $a0, $zero -/* 042A9C 7F00DF2C 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AA0 7F00DF30 0FC02DD1 */ jal disable_all_switches -/* 042AA4 7F00DF34 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AA8 7F00DF38 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AAC 7F00DF3C 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AB0 7F00DF40 00002825 */ move $a1, $zero -/* 042AB4 7F00DF44 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042AB8 7F00DF48 24060001 */ li $a2, 1 -/* 042ABC 7F00DF4C 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AC0 7F00DF50 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AC4 7F00DF54 24050013 */ li $a1, 19 -/* 042AC8 7F00DF58 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042ACC 7F00DF5C 24060001 */ li $a2, 1 -/* 042AD0 7F00DF60 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042AD4 7F00DF64 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042AD8 7F00DF68 24050014 */ li $a1, 20 -/* 042ADC 7F00DF6C 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 042AE0 7F00DF70 24060001 */ li $a2, 1 -/* 042AE4 7F00DF74 3C018003 */ lui $at, %hi(tab_prev_highlight) # $at, 0x8003 -/* 042AE8 7F00DF78 AC20A924 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 042AEC 7F00DF7C 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) # $at, 0x8007 -/* 042AF0 7F00DF80 240EFFFF */ li $t6, -1 -/* 042AF4 7F00DF84 0FC028EF */ jal isontab3 -/* 042AF8 7F00DF88 AC2E97C4 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -/* 042AFC 7F00DF8C 10400005 */ beqz $v0, .L7F00DFA4 -/* 042B00 7F00DF90 0000A025 */ move $s4, $zero -/* 042B04 7F00DF94 240F0001 */ li $t7, 1 -/* 042B08 7F00DF98 3C018003 */ lui $at, %hi(tab_prev_highlight) # $at, 0x8003 -/* 042B0C 7F00DF9C 1000005E */ b .L7F00E118 -/* 042B10 7F00DFA0 AC2FA924 */ sw $t7, %lo(tab_prev_highlight)($at) -.L7F00DFA4: -/* 042B14 7F00DFA4 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 042B18 7F00DFA8 3C048003 */ lui $a0, %hi(cursor_xpos_table_mission_select) # $a0, 0x8003 -/* 042B1C 7F00DFAC 3C038003 */ lui $v1, %hi(cursor_h_pos) # $v1, 0x8003 -/* 042B20 7F00DFB0 44810000 */ mtc1 $at, $f0 -/* 042B24 7F00DFB4 2463A948 */ addiu $v1, %lo(cursor_h_pos) # addiu $v1, $v1, -0x56b8 -/* 042B28 7F00DFB8 2484B010 */ addiu $a0, %lo(cursor_xpos_table_mission_select) # addiu $a0, $a0, -0x4ff0 -/* 042B2C 7F00DFBC 24130005 */ li $s3, 5 -/* 042B30 7F00DFC0 2A810004 */ slti $at, $s4, 4 -.L7F00DFC4: -/* 042B34 7F00DFC4 10200011 */ beqz $at, .L7F00E00C -/* 042B38 7F00DFC8 0014C080 */ sll $t8, $s4, 2 -/* 042B3C 7F00DFCC 00981021 */ addu $v0, $a0, $t8 -/* 042B40 7F00DFD0 8C590004 */ lw $t9, 4($v0) -/* 042B44 7F00DFD4 8C480000 */ lw $t0, ($v0) -/* 042B48 7F00DFD8 C4640000 */ lwc1 $f4, ($v1) -/* 042B4C 7F00DFDC 03284821 */ addu $t1, $t9, $t0 -/* 042B50 7F00DFE0 44893000 */ mtc1 $t1, $f6 -/* 042B54 7F00DFE4 00000000 */ nop -/* 042B58 7F00DFE8 46803220 */ cvt.s.w $f8, $f6 -/* 042B5C 7F00DFEC 46004282 */ mul.s $f10, $f8, $f0 -/* 042B60 7F00DFF0 460A203C */ c.lt.s $f4, $f10 -/* 042B64 7F00DFF4 00000000 */ nop -/* 042B68 7F00DFF8 45010004 */ bc1t .L7F00E00C -/* 042B6C 7F00DFFC 00000000 */ nop -/* 042B70 7F00E000 26940001 */ addiu $s4, $s4, 1 -/* 042B74 7F00E004 5693FFEF */ bnel $s4, $s3, .L7F00DFC4 -/* 042B78 7F00E008 2A810004 */ slti $at, $s4, 4 -.L7F00E00C: -/* 042B7C 7F00E00C 3C048003 */ lui $a0, %hi(cursor_ypos_table_mission_select) # $a0, 0x8003 -/* 042B80 7F00E010 3C038003 */ lui $v1, %hi(cursor_v_pos) # $v1, 0x8003 -/* 042B84 7F00E014 2463A94C */ addiu $v1, %lo(cursor_v_pos) # addiu $v1, $v1, -0x56b4 -/* 042B88 7F00E018 2484B024 */ addiu $a0, %lo(cursor_ypos_table_mission_select) # addiu $a0, $a0, -0x4fdc -/* 042B8C 7F00E01C 00009025 */ move $s2, $zero -/* 042B90 7F00E020 24050004 */ li $a1, 4 -/* 042B94 7F00E024 2A410003 */ slti $at, $s2, 3 -.L7F00E028: -/* 042B98 7F00E028 10200011 */ beqz $at, .L7F00E070 -/* 042B9C 7F00E02C 00125080 */ sll $t2, $s2, 2 -/* 042BA0 7F00E030 008A1021 */ addu $v0, $a0, $t2 -/* 042BA4 7F00E034 8C4B0004 */ lw $t3, 4($v0) -/* 042BA8 7F00E038 8C4C0000 */ lw $t4, ($v0) -/* 042BAC 7F00E03C C4700000 */ lwc1 $f16, ($v1) -/* 042BB0 7F00E040 016C6821 */ addu $t5, $t3, $t4 -/* 042BB4 7F00E044 448D9000 */ mtc1 $t5, $f18 -/* 042BB8 7F00E048 00000000 */ nop -/* 042BBC 7F00E04C 468091A0 */ cvt.s.w $f6, $f18 -/* 042BC0 7F00E050 46003202 */ mul.s $f8, $f6, $f0 -/* 042BC4 7F00E054 4608803C */ c.lt.s $f16, $f8 -/* 042BC8 7F00E058 00000000 */ nop -/* 042BCC 7F00E05C 45010004 */ bc1t .L7F00E070 -/* 042BD0 7F00E060 00000000 */ nop -/* 042BD4 7F00E064 26520001 */ addiu $s2, $s2, 1 -/* 042BD8 7F00E068 5645FFEF */ bnel $s2, $a1, .L7F00E028 -/* 042BDC 7F00E06C 2A410003 */ slti $at, $s2, 3 -.L7F00E070: -/* 042BE0 7F00E070 1A400011 */ blez $s2, .L7F00E0B8 -/* 042BE4 7F00E074 0012A880 */ sll $s5, $s2, 2 -/* 042BE8 7F00E078 02B2A821 */ addu $s5, $s5, $s2 -.L7F00E07C: -/* 042BEC 7F00E07C 00008825 */ move $s1, $zero -/* 042BF0 7F00E080 02A08025 */ move $s0, $s5 -.L7F00E084: -/* 042BF4 7F00E084 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042BF8 7F00E088 02002025 */ move $a0, $s0 -/* 042BFC 7F00E08C 04430005 */ bgezl $v0, .L7F00E0A4 -/* 042C00 7F00E090 2A210005 */ slti $at, $s1, 5 -/* 042C04 7F00E094 26310001 */ addiu $s1, $s1, 1 -/* 042C08 7F00E098 1633FFFA */ bne $s1, $s3, .L7F00E084 -/* 042C0C 7F00E09C 26100001 */ addiu $s0, $s0, 1 -/* 042C10 7F00E0A0 2A210005 */ slti $at, $s1, 5 -.L7F00E0A4: -/* 042C14 7F00E0A4 54200005 */ bnezl $at, .L7F00E0BC -/* 042C18 7F00E0A8 0012A880 */ sll $s5, $s2, 2 -/* 042C1C 7F00E0AC 2652FFFF */ addiu $s2, $s2, -1 -/* 042C20 7F00E0B0 1E40FFF2 */ bgtz $s2, .L7F00E07C -/* 042C24 7F00E0B4 26B5FFFB */ addiu $s5, $s5, -5 -.L7F00E0B8: -/* 042C28 7F00E0B8 0012A880 */ sll $s5, $s2, 2 -.L7F00E0BC: -/* 042C2C 7F00E0BC 06800009 */ bltz $s4, .L7F00E0E4 -/* 042C30 7F00E0C0 02B2A821 */ addu $s5, $s5, $s2 -/* 042C34 7F00E0C4 02B48021 */ addu $s0, $s5, $s4 -.L7F00E0C8: -/* 042C38 7F00E0C8 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042C3C 7F00E0CC 02002025 */ move $a0, $s0 -/* 042C40 7F00E0D0 04410004 */ bgez $v0, .L7F00E0E4 -/* 042C44 7F00E0D4 00000000 */ nop -/* 042C48 7F00E0D8 2694FFFF */ addiu $s4, $s4, -1 -/* 042C4C 7F00E0DC 0681FFFA */ bgez $s4, .L7F00E0C8 -/* 042C50 7F00E0E0 2610FFFF */ addiu $s0, $s0, -1 -.L7F00E0E4: -/* 042C54 7F00E0E4 06810009 */ bgez $s4, .L7F00E10C -/* 042C58 7F00E0E8 02A08025 */ move $s0, $s5 -/* 042C5C 7F00E0EC 0000A025 */ move $s4, $zero -.L7F00E0F0: -/* 042C60 7F00E0F0 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042C64 7F00E0F4 02002025 */ move $a0, $s0 -/* 042C68 7F00E0F8 04430005 */ bgezl $v0, .L7F00E110 -/* 042C6C 7F00E0FC 02B47021 */ addu $t6, $s5, $s4 -/* 042C70 7F00E100 26940001 */ addiu $s4, $s4, 1 -/* 042C74 7F00E104 1693FFFA */ bne $s4, $s3, .L7F00E0F0 -/* 042C78 7F00E108 26100001 */ addiu $s0, $s0, 1 -.L7F00E10C: -/* 042C7C 7F00E10C 02B47021 */ addu $t6, $s5, $s4 -.L7F00E110: -/* 042C80 7F00E110 3C018007 */ lui $at, %hi(mission_difficulty_highlighted) # $at, 0x8007 -/* 042C84 7F00E114 AC2E97C4 */ sw $t6, %lo(mission_difficulty_highlighted)($at) -.L7F00E118: -/* 042C88 7F00E118 3C048003 */ lui $a0, %hi(walletinst) # $a0, 0x8003 -/* 042C8C 7F00E11C 8C84A99C */ lw $a0, %lo(walletinst)($a0) -/* 042C90 7F00E120 8C8F0008 */ lw $t7, 8($a0) -/* 042C94 7F00E124 8DF80008 */ lw $t8, 8($t7) -/* 042C98 7F00E128 8F050054 */ lw $a1, 0x54($t8) -/* 042C9C 7F00E12C 50A00054 */ beql $a1, $zero, .L7F00E280 -/* 042CA0 7F00E130 00002025 */ move $a0, $zero -/* 042CA4 7F00E134 0FC1B363 */ jal modelGetNodeRwData -/* 042CA8 7F00E138 8CB40004 */ lw $s4, 4($a1) -/* 042CAC 7F00E13C 00408825 */ move $s1, $v0 -/* 042CB0 7F00E140 0FC2F89D */ jal dynAllocate7F0BD6C4 -/* 042CB4 7F00E144 8684000C */ lh $a0, 0xc($s4) -/* 042CB8 7F00E148 AE220000 */ sw $v0, ($s1) -/* 042CBC 7F00E14C 8699000C */ lh $t9, 0xc($s4) -/* 042CC0 7F00E150 00009025 */ move $s2, $zero -/* 042CC4 7F00E154 00008025 */ move $s0, $zero -/* 042CC8 7F00E158 1B200048 */ blez $t9, .L7F00E27C -/* 042CCC 7F00E15C 241500F5 */ li $s5, 245 -/* 042CD0 7F00E160 2413006E */ li $s3, 110 -/* 042CD4 7F00E164 8E8A0008 */ lw $t2, 8($s4) -.L7F00E168: -/* 042CD8 7F00E168 8E280000 */ lw $t0, ($s1) -/* 042CDC 7F00E16C 01505821 */ addu $t3, $t2, $s0 -/* 042CE0 7F00E170 8D610000 */ lw $at, ($t3) -/* 042CE4 7F00E174 01104821 */ addu $t1, $t0, $s0 -/* 042CE8 7F00E178 AD210000 */ sw $at, ($t1) -/* 042CEC 7F00E17C 8D6D0004 */ lw $t5, 4($t3) -/* 042CF0 7F00E180 AD2D0004 */ sw $t5, 4($t1) -/* 042CF4 7F00E184 8D610008 */ lw $at, 8($t3) -/* 042CF8 7F00E188 AD210008 */ sw $at, 8($t1) -/* 042CFC 7F00E18C 8D6D000C */ lw $t5, 0xc($t3) -/* 042D00 7F00E190 AD2D000C */ sw $t5, 0xc($t1) -/* 042D04 7F00E194 06410003 */ bgez $s2, .L7F00E1A4 -/* 042D08 7F00E198 00122083 */ sra $a0, $s2, 2 -/* 042D0C 7F00E19C 26410003 */ addiu $at, $s2, 3 -/* 042D10 7F00E1A0 00012083 */ sra $a0, $at, 2 -.L7F00E1A4: -/* 042D14 7F00E1A4 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042D18 7F00E1A8 AFA40030 */ sw $a0, 0x30($sp) -/* 042D1C 7F00E1AC 240300FF */ li $v1, 255 -/* 042D20 7F00E1B0 8FA40030 */ lw $a0, 0x30($sp) -/* 042D24 7F00E1B4 0440001F */ bltz $v0, .L7F00E234 -/* 042D28 7F00E1B8 2405000F */ li $a1, 15 -/* 042D2C 7F00E1BC 3C0E8007 */ lui $t6, %hi(mission_difficulty_highlighted) # $t6, 0x8007 -/* 042D30 7F00E1C0 8DCE97C4 */ lw $t6, %lo(mission_difficulty_highlighted)($t6) -/* 042D34 7F00E1C4 548E000F */ bnel $a0, $t6, .L7F00E204 -/* 042D38 7F00E1C8 8E2D0000 */ lw $t5, ($s1) -/* 042D3C 7F00E1CC 8E2F0000 */ lw $t7, ($s1) -/* 042D40 7F00E1D0 01F0C021 */ addu $t8, $t7, $s0 -/* 042D44 7F00E1D4 A303000C */ sb $v1, 0xc($t8) -/* 042D48 7F00E1D8 8E390000 */ lw $t9, ($s1) -/* 042D4C 7F00E1DC 03304021 */ addu $t0, $t9, $s0 -/* 042D50 7F00E1E0 A103000D */ sb $v1, 0xd($t0) -/* 042D54 7F00E1E4 8E2A0000 */ lw $t2, ($s1) -/* 042D58 7F00E1E8 01506021 */ addu $t4, $t2, $s0 -/* 042D5C 7F00E1EC A183000E */ sb $v1, 0xe($t4) -/* 042D60 7F00E1F0 8E290000 */ lw $t1, ($s1) -/* 042D64 7F00E1F4 01305821 */ addu $t3, $t1, $s0 -/* 042D68 7F00E1F8 1000001A */ b .L7F00E264 -/* 042D6C 7F00E1FC A175000F */ sb $s5, 0xf($t3) -/* 042D70 7F00E200 8E2D0000 */ lw $t5, ($s1) -.L7F00E204: -/* 042D74 7F00E204 01B07021 */ addu $t6, $t5, $s0 -/* 042D78 7F00E208 A1D3000C */ sb $s3, 0xc($t6) -/* 042D7C 7F00E20C 8E2F0000 */ lw $t7, ($s1) -/* 042D80 7F00E210 01F0C021 */ addu $t8, $t7, $s0 -/* 042D84 7F00E214 A313000D */ sb $s3, 0xd($t8) -/* 042D88 7F00E218 8E390000 */ lw $t9, ($s1) -/* 042D8C 7F00E21C 03304021 */ addu $t0, $t9, $s0 -/* 042D90 7F00E220 A113000E */ sb $s3, 0xe($t0) -/* 042D94 7F00E224 8E2A0000 */ lw $t2, ($s1) -/* 042D98 7F00E228 01506021 */ addu $t4, $t2, $s0 -/* 042D9C 7F00E22C 1000000D */ b .L7F00E264 -/* 042DA0 7F00E230 A183000F */ sb $v1, 0xf($t4) -.L7F00E234: -/* 042DA4 7F00E234 8E290000 */ lw $t1, ($s1) -/* 042DA8 7F00E238 01305821 */ addu $t3, $t1, $s0 -/* 042DAC 7F00E23C A165000C */ sb $a1, 0xc($t3) -/* 042DB0 7F00E240 8E2D0000 */ lw $t5, ($s1) -/* 042DB4 7F00E244 01B07021 */ addu $t6, $t5, $s0 -/* 042DB8 7F00E248 A1C5000D */ sb $a1, 0xd($t6) -/* 042DBC 7F00E24C 8E2F0000 */ lw $t7, ($s1) -/* 042DC0 7F00E250 01F0C021 */ addu $t8, $t7, $s0 -/* 042DC4 7F00E254 A305000E */ sb $a1, 0xe($t8) -/* 042DC8 7F00E258 8E390000 */ lw $t9, ($s1) -/* 042DCC 7F00E25C 03304021 */ addu $t0, $t9, $s0 -/* 042DD0 7F00E260 A103000F */ sb $v1, 0xf($t0) -.L7F00E264: -/* 042DD4 7F00E264 868A000C */ lh $t2, 0xc($s4) -/* 042DD8 7F00E268 26520001 */ addiu $s2, $s2, 1 -/* 042DDC 7F00E26C 26100010 */ addiu $s0, $s0, 0x10 -/* 042DE0 7F00E270 024A082A */ slt $at, $s2, $t2 -/* 042DE4 7F00E274 5420FFBC */ bnezl $at, .L7F00E168 -/* 042DE8 7F00E278 8E8A0008 */ lw $t2, 8($s4) -.L7F00E27C: -/* 042DEC 7F00E27C 00002025 */ move $a0, $zero -.L7F00E280: -/* 042DF0 7F00E280 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 042DF4 7F00E284 3405B000 */ li $a1, 45056 -/* 042DF8 7F00E288 1040002A */ beqz $v0, .L7F00E334 -/* 042DFC 7F00E28C 00002025 */ move $a0, $zero -/* 042E00 7F00E290 3C0C8003 */ lui $t4, %hi(tab_prev_highlight) # $t4, 0x8003 -/* 042E04 7F00E294 8D8CA924 */ lw $t4, %lo(tab_prev_highlight)($t4) -/* 042E08 7F00E298 24090001 */ li $t1, 1 -/* 042E0C 7F00E29C 3C018003 */ lui $at, %hi(tab_prev_selected) # $at, 0x8003 -/* 042E10 7F00E2A0 11800009 */ beqz $t4, .L7F00E2C8 -/* 042E14 7F00E2A4 3C048007 */ lui $a0, %hi(mission_difficulty_highlighted) -/* 042E18 7F00E2A8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042E1C 7F00E2AC AC29A918 */ sw $t1, %lo(tab_prev_selected)($at) -/* 042E20 7F00E2B0 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E24 7F00E2B4 240500C7 */ li $a1, 199 -/* 042E28 7F00E2B8 0C002386 */ jal sndPlaySfx -/* 042E2C 7F00E2BC 00003025 */ move $a2, $zero -/* 042E30 7F00E2C0 10000027 */ b .L7F00E360 -/* 042E34 7F00E2C4 00000000 */ nop -.L7F00E2C8: -/* 042E38 7F00E2C8 8C8497C4 */ lw $a0, %lo(mission_difficulty_highlighted)($a0) -/* 042E3C 7F00E2CC 04800024 */ bltz $a0, .L7F00E360 -/* 042E40 7F00E2D0 00000000 */ nop -/* 042E44 7F00E2D4 0FC03738 */ jal pull_and_display_text_for_folder_a0 -/* 042E48 7F00E2D8 00000000 */ nop -/* 042E4C 7F00E2DC 3C018003 */ lui $at, %hi(briefingpage) # $at, 0x8003 -/* 042E50 7F00E2E0 AC22A938 */ sw $v0, %lo(briefingpage)($at) -/* 042E54 7F00E2E4 3C0B8003 */ lui $t3, %hi(briefingpage) # $t3, 0x8003 -/* 042E58 7F00E2E8 8D6BA938 */ lw $t3, %lo(briefingpage)($t3) -/* 042E5C 7F00E2EC 3C0E8003 */ lui $t6, %hi(mission_folder_setup_entries+8) -/* 042E60 7F00E2F0 3C018003 */ lui $at, %hi(selected_stage) # $at, 0x8003 -/* 042E64 7F00E2F4 000B68C0 */ sll $t5, $t3, 3 -/* 042E68 7F00E2F8 01AB6823 */ subu $t5, $t5, $t3 -/* 042E6C 7F00E2FC 000D6880 */ sll $t5, $t5, 2 -/* 042E70 7F00E300 01CD7021 */ addu $t6, $t6, $t5 -/* 042E74 7F00E304 8DCEAC2C */ lw $t6, %lo(mission_folder_setup_entries+8)($t6) -/* 042E78 7F00E308 240F0001 */ li $t7, 1 -/* 042E7C 7F00E30C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042E80 7F00E310 AC2EA934 */ sw $t6, %lo(selected_stage)($at) -/* 042E84 7F00E314 3C018003 */ lui $at, %hi(tab_next_selected) # $at, 0x8003 -/* 042E88 7F00E318 AC2FA914 */ sw $t7, %lo(tab_next_selected)($at) -/* 042E8C 7F00E31C 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042E90 7F00E320 240500C7 */ li $a1, 199 -/* 042E94 7F00E324 0C002386 */ jal sndPlaySfx -/* 042E98 7F00E328 00003025 */ move $a2, $zero -/* 042E9C 7F00E32C 1000000C */ b .L7F00E360 -/* 042EA0 7F00E330 00000000 */ nop -.L7F00E334: -/* 042EA4 7F00E334 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 042EA8 7F00E338 24054000 */ li $a1, 16384 -/* 042EAC 7F00E33C 10400008 */ beqz $v0, .L7F00E360 -/* 042EB0 7F00E340 24180001 */ li $t8, 1 -/* 042EB4 7F00E344 3C018003 */ lui $at, %hi(tab_prev_selected) # $at, 0x8003 -/* 042EB8 7F00E348 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 042EBC 7F00E34C AC38A918 */ sw $t8, %lo(tab_prev_selected)($at) -/* 042EC0 7F00E350 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 042EC4 7F00E354 240500C7 */ li $a1, 199 -/* 042EC8 7F00E358 0C002386 */ jal sndPlaySfx -/* 042ECC 7F00E35C 00003025 */ move $a2, $zero -.L7F00E360: -/* 042ED0 7F00E360 0FC026E9 */ jal menu_control_stick_tracking -/* 042ED4 7F00E364 00000000 */ nop -/* 042ED8 7F00E368 3C198003 */ lui $t9, %hi(tab_next_selected) # $t9, 0x8003 -/* 042EDC 7F00E36C 8F39A914 */ lw $t9, %lo(tab_next_selected)($t9) -/* 042EE0 7F00E370 24040008 */ li $a0, 8 -/* 042EE4 7F00E374 3C098003 */ lui $t1, %hi(tab_prev_selected) # $t1, 0x8003 -/* 042EE8 7F00E378 13200018 */ beqz $t9, .L7F00E3DC -/* 042EEC 7F00E37C 00000000 */ nop -/* 042EF0 7F00E380 0FC069E2 */ jal set_menu_to_mode -/* 042EF4 7F00E384 00002825 */ move $a1, $zero -/* 042EF8 7F00E388 3C088005 */ lui $t0, %hi(j_text_trigger) # $t0, 0x8005 -/* 042EFC 7F00E38C 8D088500 */ lw $t0, %lo(j_text_trigger)($t0) -/* 042F00 7F00E390 3C0A8003 */ lui $t2, %hi(briefingpage) # $t2, 0x8003 -/* 042F04 7F00E394 11000005 */ beqz $t0, .L7F00E3AC -/* 042F08 7F00E398 00000000 */ nop -/* 042F0C 7F00E39C 0FC03B69 */ jal set_cursor_pos_difficulty -/* 042F10 7F00E3A0 00002025 */ move $a0, $zero -/* 042F14 7F00E3A4 10000016 */ b .L7F00E400 -/* 042F18 7F00E3A8 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E3AC: -/* 042F1C 7F00E3AC 8D4AA938 */ lw $t2, %lo(briefingpage)($t2) -/* 042F20 7F00E3B0 3C048003 */ lui $a0, %hi(mission_folder_setup_entries+20) -/* 042F24 7F00E3B4 000A60C0 */ sll $t4, $t2, 3 -/* 042F28 7F00E3B8 018A6023 */ subu $t4, $t4, $t2 -/* 042F2C 7F00E3BC 000C6080 */ sll $t4, $t4, 2 -/* 042F30 7F00E3C0 008C2021 */ addu $a0, $a0, $t4 -/* 042F34 7F00E3C4 0FC03760 */ jal get_highest_unlocked_difficulty_for_level -/* 042F38 7F00E3C8 8C84AC38 */ lw $a0, %lo(mission_folder_setup_entries+20)($a0) -/* 042F3C 7F00E3CC 0FC03B69 */ jal set_cursor_pos_difficulty -/* 042F40 7F00E3D0 00402025 */ move $a0, $v0 -/* 042F44 7F00E3D4 1000000A */ b .L7F00E400 -/* 042F48 7F00E3D8 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E3DC: -/* 042F4C 7F00E3DC 8D29A918 */ lw $t1, %lo(tab_prev_selected)($t1) -/* 042F50 7F00E3E0 24040006 */ li $a0, 6 -/* 042F54 7F00E3E4 51200006 */ beql $t1, $zero, .L7F00E400 -/* 042F58 7F00E3E8 8FBF002C */ lw $ra, 0x2c($sp) -/* 042F5C 7F00E3EC 0FC069E2 */ jal set_menu_to_mode -/* 042F60 7F00E3F0 00002825 */ move $a1, $zero -/* 042F64 7F00E3F4 0FC03607 */ jal setCursorPOSforMode -/* 042F68 7F00E3F8 00002025 */ move $a0, $zero -/* 042F6C 7F00E3FC 8FBF002C */ lw $ra, 0x2c($sp) -.L7F00E400: -/* 042F70 7F00E400 8FB00014 */ lw $s0, 0x14($sp) -/* 042F74 7F00E404 8FB10018 */ lw $s1, 0x18($sp) -/* 042F78 7F00E408 8FB2001C */ lw $s2, 0x1c($sp) -/* 042F7C 7F00E40C 8FB30020 */ lw $s3, 0x20($sp) -/* 042F80 7F00E410 8FB40024 */ lw $s4, 0x24($sp) -/* 042F84 7F00E414 8FB50028 */ lw $s5, 0x28($sp) -/* 042F88 7F00E418 03E00008 */ jr $ra -/* 042F8C 7F00E41C 27BD0060 */ addiu $sp, $sp, 0x60 -) -#endif - -#endif void set_cursor_to_stage_solo(LEVEL_SOLO_SEQUENCE level) @@ -7642,327 +3255,94 @@ void set_cursor_to_stage_solo(LEVEL_SOLO_SEQUENCE level) cursor_v_pos = cursor_ypos_table_mission_select[level / 5]; } - -#ifdef NONMATCHING -void constructor_menu07_missionsel(void) +// Address 0x7F00E458 NTSC +Gfx *constructor_menu07_missionsel(Gfx *DL) { + s32 i; s32 spD8; + s32 padding[3]; s32 spC8; s32 spC4; - s32 sp90; + s32 temp_s0; + s32 var_s5; + s32 padding2[5]; + u8 sp90[24]; s32 sp8C; s32 sp88; - s32 temp_a1; - s32 temp_a2; - s32 temp_ret; - s32 temp_s6; - s32 temp_t3; - s32 temp_v1; - s8 temp_v1_2; - u32 temp_v0_2; - void *temp_a0; - void *temp_s7; - void *temp_v0; - s32 phi_s3; - void *phi_v0; - s32 phi_s4; - s32 phi_s5; - s32 phi_s6; - s32 phi_s4_2; - - temp_ret = viFillScreen(viSetFillColor(0, 0, 0)); - temp_ret->unk4 = -1; - temp_ret->unk0 = 0xf8000000; - spD8 = 0; - phi_s4 = microcode_constructor(sub_GAME_7F00D5E8(temp_ret + 8)); -loop_1: - phi_s3 = spD8; - phi_s6 = 0; -loop_2: - phi_s4_2 = phi_s4; - if (get_highest_unlocked_difficulty_for_level(phi_s3) >= 0) - { - temp_s7 = (spD8 * 4) + &cursor_xpos_table_mission_select; - phi_s5 = 0x96969600; - if (phi_s3 == mission_difficulty_highlighted) - { - phi_s5 = -0x100; - } - temp_v0 = (pull_and_display_text_for_folder_a0(phi_s3) * 0x1c) + &mission_folder_setup_entries; - if (temp_v0->unk6 != 0) - { - strcpy(&sp90, langGet(temp_v0->unk6)); - } - else - { - strcpy(&sp90, langGet(temp_v0->unk4)); - } - if (j_text_trigger == 0) + s32 temp_v0_3; + u8 *var_v0; + s32 var_s3; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + gDPSetFogColor(DL++, 0xFF, 0xFF, 0xFF, 0xFF); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + + for (spD8 = 0; spD8 < 5; spD8++) + { + var_s3 = spD8; + + for (i = 0; i < 4 ; i++, var_s3 += 5) { - temp_v1 = strlen(&sp90) + -1; - phi_v0 = &sp90 + temp_v1; - if (temp_v1 >= 0) + temp_s0 = pull_and_display_text_for_folder_a0(var_s3); + + if (get_highest_unlocked_difficulty_for_level(var_s3) >= 0) { -loop_10: - temp_v1_2 = *phi_v0; - if (temp_v1_2 >= 0x61) + var_s5 = 0x96969600; + + if (var_s3 == mission_difficulty_highlighted) + { + var_s5 = -0x100; + } + + if (mission_folder_setup_entries[temp_s0].icon_text_preset) + { + strcpy(sp90, langGet(mission_folder_setup_entries[temp_s0].icon_text_preset)); + } + else { - *phi_v0 = (s8) (temp_v1_2 + -0x20); + strcpy(sp90, langGet(mission_folder_setup_entries[temp_s0].folder_text_preset)); } - temp_v0_2 = phi_v0 + -1; - phi_v0 = temp_v0_2; - if (temp_v0_2 >= &sp90) + + if (j_text_trigger == 0) { - goto loop_10; + temp_v0_3 = strlen(sp90) - 1; + for (; temp_v0_3 >= 0; temp_v0_3--) + { + if (sp90[temp_v0_3] >= 'a') + { + sp90[temp_v0_3] -= 0x20; + } + } } + + strcat(sp90, "\n"); + + spC4 = 0; + spC8 = 0; + + textMeasure(&spC8, &spC4, sp90, ptrFontBankGothicChars, ptrFontBankGothic, 0); + + sp8C = cursor_xpos_table_mission_select[spD8] - 0x1F; + sp88 = (cursor_ypos_table_mission_select[i] - spC8) + 0x1D; + + DL = microcode_constructor_related_to_menus(DL, sp8C, sp88, sp8C + spC4, sp88 + spC8, 0); + DL = textRender(DL, &sp8C, &sp88, sp90, ptrFontBankGothicChars, ptrFontBankGothic, var_s5 | 0xFF, viGetX(), viGetY(), 0, 0); + + sp8C = cursor_xpos_table_mission_select[spD8] - 0x1F; + sp88 = (cursor_ypos_table_mission_select[i] - spC8) + 0x1D; + + DL = textRender(DL, &sp8C, &sp88, sp90, ptrFontBankGothicChars, ptrFontBankGothic, var_s5 | 0x64, viGetX(), viGetY(), 0, 0); + } } - strcat(&sp90, &asc_D_8004F4A0); - spC4 = 0; - temp_a0 = &spC8; - spC8 = 0; - sub_GAME_7F0AE98C(temp_a0, &spC4, &sp90, ptrSecondFontTableSmall, (s32) ptrFirstFontTableSmall, 0); - temp_a2 = (subroutine_arg0 - spC8) + 0x1d; - temp_a1 = *temp_s7 + -0x1f; - viGetX(); - viGetX(*temp_s7 + -0x1f, (subroutine_arg0 - spC8) + 0x1d); - phi_s4_2 = en_text_write_stuff(en_text_write_stuff(microcode_constructor_related_to_menus(phi_s4, temp_a1, temp_a2, temp_a1 + spC4, (s32) (temp_a2 + spC8), 0), &sp8C, &sp88, &sp90, (s32) ptrSecondFontTableSmall, (s32) ptrFirstFontTableSmall, (s32) (phi_s5 | 0xff), viGetY(), 0, 0), &sp8C, &sp88, &sp90, (s32) ptrSecondFontTableSmall, (s32) ptrFirstFontTableSmall, (s32) (phi_s5 | 0x64), viGetY(), 0, 0); - } - temp_s6 = phi_s6 + 1; - phi_s3 = phi_s3 + 5; - phi_s4 = phi_s4_2; - phi_s6 = temp_s6; - if (temp_s6 != 4) - { - goto loop_2; - } - temp_t3 = spD8 + 1; - spD8 = temp_t3; - phi_s4 = phi_s4_2; - if (temp_t3 != 5) - { - goto loop_1; } - load_draw_selected_icon_folder_select(add_tab3_previous(phi_s4_2)); + + DL = add_tab3_previous(DL); + DL = load_draw_selected_icon_folder_select(DL); } -#else -const char asc_D_8004F4A0[] = "\n"; -GLOBAL_ASM( -.text -glabel constructor_menu07_missionsel -/* 042F88 7F00E458 27BDFF20 */ addiu $sp, $sp, -0xe0 -/* 042F8C 7F00E45C AFBF005C */ sw $ra, 0x5c($sp) -/* 042F90 7F00E460 AFBE0058 */ sw $fp, 0x58($sp) -/* 042F94 7F00E464 AFB70054 */ sw $s7, 0x54($sp) -/* 042F98 7F00E468 AFB60050 */ sw $s6, 0x50($sp) -/* 042F9C 7F00E46C AFB5004C */ sw $s5, 0x4c($sp) -/* 042FA0 7F00E470 AFB40048 */ sw $s4, 0x48($sp) -/* 042FA4 7F00E474 AFB30044 */ sw $s3, 0x44($sp) -/* 042FA8 7F00E478 AFB20040 */ sw $s2, 0x40($sp) -/* 042FAC 7F00E47C AFB1003C */ sw $s1, 0x3c($sp) -/* 042FB0 7F00E480 AFB00038 */ sw $s0, 0x38($sp) -/* 042FB4 7F00E484 00002825 */ move $a1, $zero -/* 042FB8 7F00E488 00003025 */ move $a2, $zero -/* 042FBC 7F00E48C 0C0011B4 */ jal viSetFillColor -/* 042FC0 7F00E490 00003825 */ move $a3, $zero -/* 042FC4 7F00E494 0C000FBE */ jal viFillScreen -/* 042FC8 7F00E498 00402025 */ move $a0, $v0 -/* 042FCC 7F00E49C 3C0EF800 */ lui $t6, 0xf800 -/* 042FD0 7F00E4A0 240FFFFF */ li $t7, -1 -/* 042FD4 7F00E4A4 AC4F0004 */ sw $t7, 4($v0) -/* 042FD8 7F00E4A8 AC4E0000 */ sw $t6, ($v0) -/* 042FDC 7F00E4AC 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 042FE0 7F00E4B0 24440008 */ addiu $a0, $v0, 8 -/* 042FE4 7F00E4B4 0FC2B366 */ jal microcode_constructor -/* 042FE8 7F00E4B8 00402025 */ move $a0, $v0 -/* 042FEC 7F00E4BC 27B10090 */ addiu $s1, $sp, 0x90 -/* 042FF0 7F00E4C0 0040A025 */ move $s4, $v0 -/* 042FF4 7F00E4C4 02209025 */ move $s2, $s1 -/* 042FF8 7F00E4C8 AFA000D8 */ sw $zero, 0xd8($sp) -.L7F00E4CC: -/* 042FFC 7F00E4CC 8FB300D8 */ lw $s3, 0xd8($sp) -/* 043000 7F00E4D0 0000B025 */ move $s6, $zero -.L7F00E4D4: -/* 043004 7F00E4D4 0FC03730 */ jal pull_and_display_text_for_folder_a0 -/* 043008 7F00E4D8 02602025 */ move $a0, $s3 -/* 04300C 7F00E4DC 00408025 */ move $s0, $v0 -/* 043010 7F00E4E0 0FC03758 */ jal get_highest_unlocked_difficulty_for_level -/* 043014 7F00E4E4 02602025 */ move $a0, $s3 -/* 043018 7F00E4E8 0440008C */ bltz $v0, .L7F00E71C -/* 04301C 7F00E4EC 3C159696 */ lui $s5, (0x96969600 >> 16) # lui $s5, 0x9696 -/* 043020 7F00E4F0 8FB900D8 */ lw $t9, 0xd8($sp) -/* 043024 7F00E4F4 3C0C8007 */ lui $t4, %hi(mission_difficulty_highlighted) -/* 043028 7F00E4F8 8D8C9784 */ lw $t4, %lo(mission_difficulty_highlighted)($t4) -/* 04302C 7F00E4FC 3C098003 */ lui $t1, %hi(cursor_xpos_table_mission_select) -/* 043030 7F00E500 3C0B8003 */ lui $t3, %hi(cursor_ypos_table_mission_select) -/* 043034 7F00E504 256BAFE4 */ addiu $t3, %lo(cursor_ypos_table_mission_select) # addiu $t3, $t3, -0x501c -/* 043038 7F00E508 2529AFD0 */ addiu $t1, %lo(cursor_xpos_table_mission_select) # addiu $t1, $t1, -0x5030 -/* 04303C 7F00E50C 00165080 */ sll $t2, $s6, 2 -/* 043040 7F00E510 00194080 */ sll $t0, $t9, 2 -/* 043044 7F00E514 36B59600 */ ori $s5, (0x96969600 & 0xFFFF) # ori $s5, $s5, 0x9600 -/* 043048 7F00E518 0109B821 */ addu $s7, $t0, $t1 -/* 04304C 7F00E51C 166C0002 */ bne $s3, $t4, .L7F00E528 -/* 043050 7F00E520 014BF021 */ addu $fp, $t2, $t3 -/* 043054 7F00E524 2415FF00 */ li $s5, -256 -.L7F00E528: -/* 043058 7F00E528 001068C0 */ sll $t5, $s0, 3 -/* 04305C 7F00E52C 01B06823 */ subu $t5, $t5, $s0 -/* 043060 7F00E530 3C0E8003 */ lui $t6, %hi(mission_folder_setup_entries) -/* 043064 7F00E534 25CEABE4 */ addiu $t6, %lo(mission_folder_setup_entries) # addiu $t6, $t6, -0x541c -/* 043068 7F00E538 000D6880 */ sll $t5, $t5, 2 -/* 04306C 7F00E53C 01AE1021 */ addu $v0, $t5, $t6 -/* 043070 7F00E540 94430006 */ lhu $v1, 6($v0) -/* 043074 7F00E544 10600008 */ beqz $v1, .L7F00E568 -/* 043078 7F00E548 00000000 */ nop -/* 04307C 7F00E54C 0FC30776 */ jal langGet -/* 043080 7F00E550 00602025 */ move $a0, $v1 -/* 043084 7F00E554 02402025 */ move $a0, $s2 -/* 043088 7F00E558 0C0029DC */ jal strcpy -/* 04308C 7F00E55C 00402825 */ move $a1, $v0 -/* 043090 7F00E560 10000006 */ b .L7F00E57C -/* 043094 7F00E564 00000000 */ nop -.L7F00E568: -/* 043098 7F00E568 0FC30776 */ jal langGet -/* 04309C 7F00E56C 94440004 */ lhu $a0, 4($v0) -/* 0430A0 7F00E570 02402025 */ move $a0, $s2 -/* 0430A4 7F00E574 0C0029DC */ jal strcpy -/* 0430A8 7F00E578 00402825 */ move $a1, $v0 -.L7F00E57C: -/* 0430AC 7F00E57C 3C0F8005 */ lui $t7, %hi(j_text_trigger) -/* 0430B0 7F00E580 8DEF84D0 */ lw $t7, %lo(j_text_trigger)($t7) -/* 0430B4 7F00E584 15E0000F */ bnez $t7, .L7F00E5C4 -/* 0430B8 7F00E588 00000000 */ nop -/* 0430BC 7F00E58C 0C004E1F */ jal strlen -/* 0430C0 7F00E590 02402025 */ move $a0, $s2 -/* 0430C4 7F00E594 2443FFFF */ addiu $v1, $v0, -1 -/* 0430C8 7F00E598 0460000A */ bltz $v1, .L7F00E5C4 -/* 0430CC 7F00E59C 02431021 */ addu $v0, $s2, $v1 -/* 0430D0 7F00E5A0 90430000 */ lbu $v1, ($v0) -.L7F00E5A4: -/* 0430D4 7F00E5A4 28610061 */ slti $at, $v1, 0x61 -/* 0430D8 7F00E5A8 14200002 */ bnez $at, .L7F00E5B4 -/* 0430DC 7F00E5AC 2478FFE0 */ addiu $t8, $v1, -0x20 -/* 0430E0 7F00E5B0 A0580000 */ sb $t8, ($v0) -.L7F00E5B4: -/* 0430E4 7F00E5B4 2442FFFF */ addiu $v0, $v0, -1 -/* 0430E8 7F00E5B8 0051082B */ sltu $at, $v0, $s1 -/* 0430EC 7F00E5BC 5020FFF9 */ beql $at, $zero, .L7F00E5A4 -/* 0430F0 7F00E5C0 90430000 */ lbu $v1, ($v0) -.L7F00E5C4: -/* 0430F4 7F00E5C4 3C058005 */ lui $a1, %hi(asc_D_8004F4A0) -/* 0430F8 7F00E5C8 24A5F4A0 */ addiu $a1, %lo(asc_D_8004F4A0) # addiu $a1, $a1, -0xb60 -/* 0430FC 7F00E5CC 0C0029FF */ jal strcat -/* 043100 7F00E5D0 02402025 */ move $a0, $s2 -/* 043104 7F00E5D4 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 043108 7F00E5D8 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 04310C 7F00E5DC 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 043110 7F00E5E0 AFA000C4 */ sw $zero, 0xc4($sp) -/* 043114 7F00E5E4 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) -/* 043118 7F00E5E8 27A400C8 */ addiu $a0, $sp, 0xc8 -/* 04311C 7F00E5EC 27A500C4 */ addiu $a1, $sp, 0xc4 -/* 043120 7F00E5F0 02403025 */ move $a2, $s2 -/* 043124 7F00E5F4 AFA00014 */ sw $zero, 0x14($sp) -/* 043128 7F00E5F8 AFA000C8 */ sw $zero, 0xc8($sp) -/* 04312C 7F00E5FC 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 043130 7F00E600 AFB90010 */ sw $t9, 0x10($sp) -/* 043134 7F00E604 8FA300C8 */ lw $v1, 0xc8($sp) -/* 043138 7F00E608 8FC80000 */ lw $t0, ($fp) -/* 04313C 7F00E60C 8EE50000 */ lw $a1, ($s7) -/* 043140 7F00E610 8FA900C4 */ lw $t1, 0xc4($sp) -/* 043144 7F00E614 01033023 */ subu $a2, $t0, $v1 -/* 043148 7F00E618 24C6001D */ addiu $a2, $a2, 0x1d -/* 04314C 7F00E61C 00C35021 */ addu $t2, $a2, $v1 -/* 043150 7F00E620 24A5FFE1 */ addiu $a1, $a1, -0x1f -/* 043154 7F00E624 AFA5008C */ sw $a1, 0x8c($sp) -/* 043158 7F00E628 AFAA0010 */ sw $t2, 0x10($sp) -/* 04315C 7F00E62C AFA60088 */ sw $a2, 0x88($sp) -/* 043160 7F00E630 02802025 */ move $a0, $s4 -/* 043164 7F00E634 AFA00014 */ sw $zero, 0x14($sp) -/* 043168 7F00E638 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04316C 7F00E63C 00A93821 */ addu $a3, $a1, $t1 -/* 043170 7F00E640 0C001107 */ jal viGetX -/* 043174 7F00E644 0040A025 */ move $s4, $v0 -/* 043178 7F00E648 00028400 */ sll $s0, $v0, 0x10 -/* 04317C 7F00E64C 00105C03 */ sra $t3, $s0, 0x10 -/* 043180 7F00E650 0C00110B */ jal viGetY -/* 043184 7F00E654 01608025 */ move $s0, $t3 -/* 043188 7F00E658 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) -/* 04318C 7F00E65C 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 043190 7F00E660 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 043194 7F00E664 8D8C0EB0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) -/* 043198 7F00E668 36AE00FF */ ori $t6, $s5, 0xff -/* 04319C 7F00E66C AFAE0018 */ sw $t6, 0x18($sp) -/* 0431A0 7F00E670 02802025 */ move $a0, $s4 -/* 0431A4 7F00E674 27A5008C */ addiu $a1, $sp, 0x8c -/* 0431A8 7F00E678 27A60088 */ addiu $a2, $sp, 0x88 -/* 0431AC 7F00E67C 02403825 */ move $a3, $s2 -/* 0431B0 7F00E680 AFB0001C */ sw $s0, 0x1c($sp) -/* 0431B4 7F00E684 AFA20020 */ sw $v0, 0x20($sp) -/* 0431B8 7F00E688 AFA00024 */ sw $zero, 0x24($sp) -/* 0431BC 7F00E68C AFA00028 */ sw $zero, 0x28($sp) -/* 0431C0 7F00E690 AFAD0014 */ sw $t5, 0x14($sp) -/* 0431C4 7F00E694 0FC2B6AF */ jal en_text_write_stuff -/* 0431C8 7F00E698 AFAC0010 */ sw $t4, 0x10($sp) -/* 0431CC 7F00E69C 8FA300C8 */ lw $v1, 0xc8($sp) -/* 0431D0 7F00E6A0 8FCF0000 */ lw $t7, ($fp) -/* 0431D4 7F00E6A4 8EE50000 */ lw $a1, ($s7) -/* 0431D8 7F00E6A8 0040A025 */ move $s4, $v0 -/* 0431DC 7F00E6AC 01E33023 */ subu $a2, $t7, $v1 -/* 0431E0 7F00E6B0 24C6001D */ addiu $a2, $a2, 0x1d -/* 0431E4 7F00E6B4 24A5FFE1 */ addiu $a1, $a1, -0x1f -/* 0431E8 7F00E6B8 AFA5008C */ sw $a1, 0x8c($sp) -/* 0431EC 7F00E6BC 0C001107 */ jal viGetX -/* 0431F0 7F00E6C0 AFA60088 */ sw $a2, 0x88($sp) -/* 0431F4 7F00E6C4 00028400 */ sll $s0, $v0, 0x10 -/* 0431F8 7F00E6C8 0010C403 */ sra $t8, $s0, 0x10 -/* 0431FC 7F00E6CC 0C00110B */ jal viGetY -/* 043200 7F00E6D0 03008025 */ move $s0, $t8 -/* 043204 7F00E6D4 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 043208 7F00E6D8 3C088004 */ lui $t0, %hi(ptrFirstFontTableSmall) -/* 04320C 7F00E6DC 8D080EAC */ lw $t0, %lo(ptrFirstFontTableSmall)($t0) -/* 043210 7F00E6E0 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) -/* 043214 7F00E6E4 36A90064 */ ori $t1, $s5, 0x64 -/* 043218 7F00E6E8 AFA90018 */ sw $t1, 0x18($sp) -/* 04321C 7F00E6EC 02802025 */ move $a0, $s4 -/* 043220 7F00E6F0 27A5008C */ addiu $a1, $sp, 0x8c -/* 043224 7F00E6F4 27A60088 */ addiu $a2, $sp, 0x88 -/* 043228 7F00E6F8 02403825 */ move $a3, $s2 -/* 04322C 7F00E6FC AFB0001C */ sw $s0, 0x1c($sp) -/* 043230 7F00E700 AFA20020 */ sw $v0, 0x20($sp) -/* 043234 7F00E704 AFA00024 */ sw $zero, 0x24($sp) -/* 043238 7F00E708 AFA00028 */ sw $zero, 0x28($sp) -/* 04323C 7F00E70C AFA80014 */ sw $t0, 0x14($sp) -/* 043240 7F00E710 0FC2B6AF */ jal en_text_write_stuff -/* 043244 7F00E714 AFB90010 */ sw $t9, 0x10($sp) -/* 043248 7F00E718 0040A025 */ move $s4, $v0 -.L7F00E71C: -/* 04324C 7F00E71C 26D60001 */ addiu $s6, $s6, 1 -/* 043250 7F00E720 24010004 */ li $at, 4 -/* 043254 7F00E724 16C1FF6B */ bne $s6, $at, .L7F00E4D4 -/* 043258 7F00E728 26730005 */ addiu $s3, $s3, 5 -/* 04325C 7F00E72C 8FAA00D8 */ lw $t2, 0xd8($sp) -/* 043260 7F00E730 24010005 */ li $at, 5 -/* 043264 7F00E734 254B0001 */ addiu $t3, $t2, 1 -/* 043268 7F00E738 1561FF64 */ bne $t3, $at, .L7F00E4CC -/* 04326C 7F00E73C AFAB00D8 */ sw $t3, 0xd8($sp) -/* 043270 7F00E740 0FC0288E */ jal add_tab3_previous -/* 043274 7F00E744 02802025 */ move $a0, $s4 -/* 043278 7F00E748 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 04327C 7F00E74C 00402025 */ move $a0, $v0 -/* 043280 7F00E750 8FBF005C */ lw $ra, 0x5c($sp) -/* 043284 7F00E754 8FB00038 */ lw $s0, 0x38($sp) -/* 043288 7F00E758 8FB1003C */ lw $s1, 0x3c($sp) -/* 04328C 7F00E75C 8FB20040 */ lw $s2, 0x40($sp) -/* 043290 7F00E760 8FB30044 */ lw $s3, 0x44($sp) -/* 043294 7F00E764 8FB40048 */ lw $s4, 0x48($sp) -/* 043298 7F00E768 8FB5004C */ lw $s5, 0x4c($sp) -/* 04329C 7F00E76C 8FB60050 */ lw $s6, 0x50($sp) -/* 0432A0 7F00E770 8FB70054 */ lw $s7, 0x54($sp) -/* 0432A4 7F00E774 8FBE0058 */ lw $fp, 0x58($sp) -/* 0432A8 7F00E778 03E00008 */ jr $ra -/* 0432AC 7F00E77C 27BD00E0 */ addiu $sp, $sp, 0xe0 -) -#endif + //******************************************************************************************************** @@ -7986,15 +3366,15 @@ void interface_menu08_difficulty(void) s32 unlockedDifficulty; unlockedDifficulty = get_highest_unlocked_difficulty_for_level(mission_folder_setup_entries[briefingpage].mission_num); - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 4, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CONFIDENTIAL, 1); tab_prev_highlight = FALSE; mission_difficulty_highlighted = DIFFICULTY_MULTI; @@ -8050,20 +3430,20 @@ void interface_menu08_difficulty(void) { if (selected_difficulty == DIFFICULTY_007) { - set_menu_to_mode(MENU_007_OPTIONS, 0); + frontChangeMenu(MENU_007_OPTIONS, FALSE); set_cursor_pos_tab2(); return; } - set_menu_to_mode(MENU_BRIEFING, 0); + frontChangeMenu(MENU_BRIEFING, FALSE); set_cursor_pos_tab2(); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_MISSION_SELECT, 0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo(mission_folder_setup_entries[briefingpage].mission_num); } } @@ -8079,33 +3459,33 @@ Gfx * print_current_solo_briefing_stage_name(Gfx *DL, char *text) if (selected_difficulty >= DIFFICULTY_AGENT) { strcpy(text, get_ptr_difficulty_name(selected_difficulty)); - strcat(text, langGet(TEXT(LTITLE, 0x20))); + strcat(text, langGet(TEXT(LTITLE, TITLE_STR_32))); x = 0x37; y = 0x57; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xff, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xff, viGetX(), viGetY(), 0, 0); } chapter = get_chapter_briefing_entry(briefingpage); if (chapter >=0 ) { - strcpy(text, langGet(TEXT(LTITLE, 0x21))); + strcpy(text, langGet(TEXT(LTITLE, TITLE_STR_33))); strcat(text, mission_folder_setup_entries[chapter].string_ptr); strcat(text, ": "); strcat(text, langGet(mission_folder_setup_entries[chapter].folder_text_preset)); strcat(text, "\n"); x = 0x37; y = 0x67; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xff, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xff, viGetX(), viGetY(), 0, 0); } - strcpy(text, langGet(TEXT(LTITLE, 0x22))); + strcpy(text, langGet(TEXT(LTITLE, TITLE_STR_34))); strcat(text, mission_folder_setup_entries[briefingpage].string_ptr); strcat(text, ": "); strcat(text, langGet(mission_folder_setup_entries[briefingpage].folder_text_preset)); strcat(text, "\n"); x = 0x37; y = 0x77; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xff, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xff, viGetX(), viGetY(), 0, 0); return DL; } @@ -8184,10 +3564,10 @@ Gfx *constructor_menu08_difficulty(Gfx *DL) DL = print_current_solo_briefing_stage_name(DL, &stagename_struct); // "DIFFICULTY:\n" - text_sp3180 = langGet(TEXT(LTITLE, 0x23)); + text_sp3180 = langGet(TEXT(LTITLE, TITLE_STR_35)); x = 0x37; y = 0x8F; - DL = write_text_at_abs_coord(DL, &x, &y, text_sp3180, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text_sp3180, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); if (mission_difficulty_highlighted >= 0) { @@ -8213,16 +3593,16 @@ Gfx *constructor_menu08_difficulty(Gfx *DL) switch (i) { case 0: - text_sp160 = langGet(TEXT(LTITLE, 0x109)); // "1.\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_265)); // "1.\n" break; case 1: - text_sp160 = langGet(TEXT(LTITLE, 0x10A)); // "2.\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_266)); // "2.\n" break; case 2: - text_sp160 = langGet(TEXT(LTITLE, 0x10B)); // "3.\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_267)); // "3.\n" break; case 3: - text_sp160 = langGet(TEXT(LTITLE, 0x10C)); // "4.\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_268)); // "4.\n" break; } } @@ -8232,31 +3612,31 @@ Gfx *constructor_menu08_difficulty(Gfx *DL) text_sp160 = &stagename_struct; } - sub_GAME_7F0AE98C(&sp98, &sp9C, text_sp160, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&sp98, &sp9C, text_sp160, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0x82 - (j_text_trigger ? (sp9C - 0xA) : 0); y = (i * 0x1E) + 0xB4; - DL = write_text_at_abs_coord(DL, &x, &y, text_sp160, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text_sp160, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); switch (i) { case 0: - text_sp160 = langGet(TEXT(LTITLE, 0x24)); // "Agent\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_36)); // "Agent\n" break; case 1: - text_sp160 = langGet(TEXT(LTITLE, 0x25)); // "Secret Agent\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_37)); // "Secret Agent\n" break; case 2: - text_sp160 = langGet(TEXT(LTITLE, 0x26)); // "00 Agent\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_38)); // "00 Agent\n" break; case 3: - text_sp160 = langGet(TEXT(LTITLE, 0x27)); // "007\n" + text_sp160 = langGet(TEXT(LTITLE, TITLE_STR_39)); // "007\n" break; } x = 0x96; y = (i * 0x1E) + 0xB4; - DL = write_text_at_abs_coord(DL, &x, &y, text_sp160, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text_sp160, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } } @@ -8316,8 +3696,8 @@ void interface_menu09_007options(void) f32 temp_x; s32 temp_y; - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); if (joyGetButtons(PLAYER_1, Z_TRIG|A_BUTTON) == 0) @@ -8422,24 +3802,24 @@ void interface_menu09_007options(void) } } disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 6, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); menu_control_stick_tracking(); if (tab_start_selected) { - set_menu_to_mode(MENU_RUN_STAGE, 1); + frontChangeMenu(MENU_RUN_STAGE, TRUE); return; } if (tab_next_selected) { - set_menu_to_mode(MENU_BRIEFING, 0); + frontChangeMenu(MENU_BRIEFING, FALSE); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_DIFFICULTY, 0); + frontChangeMenu(MENU_DIFFICULTY, FALSE); set_cursor_pos_difficulty(selected_difficulty); } } @@ -8447,1328 +3827,160 @@ void interface_menu09_007options(void) +#if !defined(VERSION_EU) +const struct MatchHack_front_rodata_3000 asc_D_80050074 = { "\n" }; +#endif -#ifdef NONMATCHING -void constructor_menu09_007options(void) +Gfx *constructor_menu09_007options(Gfx *DL) { - s32 spC14; + u8 *spC14; s32 spC10; s32 spC0C; - s32 sp54; + struct MatchHack_front_rodata_3000 sp54; s32 sp50; s32 sp4C; - s16 sp44; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_s0; - s32 temp_s0_2; - s32 temp_s0_3; - s32 temp_s0_4; - s32 temp_s0_5; - s32 temp_s0_6; - s32 temp_s0_7; - s32 temp_s0_8; - void *temp_t6; - void *temp_t7; - void *phi_t7; - void *phi_t6; - s32 phi_s0; - s32 phi_s0_2; - s32 phi_s0_3; - s32 phi_s0_4; - - phi_t7 = &asc_D_80050074; - phi_t6 = &sp54; -loop_1: - temp_t7 = phi_t7 + 0xc; - temp_t6 = phi_t6 + 0xc; - temp_t6->unk-C = (s32) *phi_t7; - temp_t6->unk-8 = (s32) temp_t7->unk-8; - temp_t6->unk-4 = (s32) temp_t7->unk-4; - phi_t7 = temp_t7; - phi_t6 = temp_t6; - if (temp_t7 != (&asc_D_80050074 + 0xbb8)) - { - goto loop_1; - } - spC14 = langGet(TEXT(LTITLE, 0x28)); + s32 val; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); +#if defined(VERSION_EU) + DL = viFillScreen(DL); + DL = viFillScreen(DL); +#endif + DL = sub_GAME_7F00D5E8(DL); + +#if !defined(VERSION_EU) + sp54 = asc_D_80050074; +#endif + + DL = microcode_constructor(DL); + DL = print_current_solo_briefing_stage_name(DL, (char*)&sp54); + + spC14 = langGet(TEXT(LTITLE, TITLE_STR_40)); + spC10 = 0x37; spC0C = 0x8f; - sp44 = viGetX(); - temp_s0 = write_text_at_abs_coord(print_current_solo_briefing_stage_name(microcode_constructor(sub_GAME_7F00D5E8(viFillScreen(viSetFillColor(0, 0, 0)))), &sp54), &spC10, &spC0C, spC14, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - spC14 = langGet(TEXT(LTITLE, 0x2a)); + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8 *)spC14, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + spC14 = langGet(TEXT(LTITLE, TITLE_STR_42)); + spC10 = 0x39; - spC0C = 0xa4; - temp_ret = microcode_constructor_related_to_menus(microcode_constructor_related_to_menus(temp_s0, 0x37, 0xb5, 0x163, 0xc0, 0x32), 0x37, 0xa4 + 0x11, (s32) (sqrtf(slider_007_mode_health / 10.0f) * 300.0f) + 0x37, (s32) (0xa4 + 0x1c), 0x64); - phi_s0 = temp_ret; + spC0C = 0xA4; + + DL = microcode_constructor_related_to_menus(DL, 0x37, 0xB5, 0x163, 0xC0, 0x32); + val = (sqrtf(slider_007_mode_health / 10.0f)) * 300.0f; + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C + 0x11, val + 0x37, spC0C + 0x1c, 0x64); + if (highlight_enemy_health != 0) { - phi_s0 = microcode_constructor_related_to_menus(temp_ret, 0x37, spC0C + -1, 0xc7, (s32) (spC0C + 0xe), 0x32); + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C - 1, 0xC7, spC0C + 0xE, 0x32); } - sp44 = viGetX(); - temp_s0_2 = write_text_at_abs_coord(phi_s0, &spC10, &spC0C, spC14, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - sprintf(&sp54, &aD, (s32) (slider_007_mode_health * 100.0f)); + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8 *)spC14, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + sprintf((char*)&sp54, "%d%%\n", (s32) (slider_007_mode_health * 100.0f)); + sp4C = 0; sp50 = 0; - sub_GAME_7F0AE98C(&sp50, &sp4C, &sp54, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - spC10 = (s32) (0x11d - sp4C); - spC0C = 0xa4; - sp44 = viGetX(); - temp_s0_3 = write_text_at_abs_coord(temp_s0_2, &spC10, &spC0C, &sp54, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - spC14 = langGet(TEXT(LTITLE, 0x2b)); + + textMeasure(&sp50, &sp4C, (char*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spC10 = 0x11D - sp4C; + spC0C = 0xA4; + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + spC14 = langGet(TEXT(LTITLE, TITLE_STR_43)); + spC10 = 0x39; - spC0C = 0xc5; - temp_ret_2 = microcode_constructor_related_to_menus(microcode_constructor_related_to_menus(temp_s0_3, 0x37, 0xd6, 0x163, 0xe1, 0x32), 0x37, 0xc5 + 0x11, (s32) (sqrtf(slider_007_mode_accuracy / 10.0f) * 300.0f) + 0x37, (s32) (0xc5 + 0x1c), 0x64); - phi_s0_2 = temp_ret_2; + spC0C = 0xC5; + + DL = microcode_constructor_related_to_menus(DL, 0x37, 0xD6, 0x163, 0xE1, 0x32); + val = (sqrtf(slider_007_mode_accuracy / 10.0f)) * 300.0f; + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C + 0x11, val + 0x37, spC0C + 0x1c, 0x64); + if (highlight_enemy_accuracy != 0) { - phi_s0_2 = microcode_constructor_related_to_menus(temp_ret_2, 0x37, spC0C + -1, 0xc7, (s32) (spC0C + 0xe), 0x32); + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C - 1, 0xC7, spC0C + 0xE, 0x32); } - sp44 = viGetX(); - temp_s0_4 = write_text_at_abs_coord(phi_s0_2, &spC10, &spC0C, spC14, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - sprintf(&sp54, &aD_0, (s32) (slider_007_mode_accuracy * 100.0f)); + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)spC14, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + sprintf((char*)&sp54, "%d%%\n", (s32) (slider_007_mode_accuracy * 100.0f)); + sp4C = 0; sp50 = 0; - sub_GAME_7F0AE98C(&sp50, &sp4C, &sp54, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - spC10 = (s32) (0x11d - sp4C); - spC0C = 0xc5; - sp44 = viGetX(); - temp_s0_5 = write_text_at_abs_coord(temp_s0_4, &spC10, &spC0C, &sp54, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - spC14 = langGet(TEXT(LTITLE, 0x2c)); + + textMeasure(&sp50, &sp4C, (char*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spC10 = 0x11D - sp4C; + spC0C = 0xC5; + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + spC14 = langGet(TEXT(LTITLE, TITLE_STR_44)); + spC10 = 0x39; - spC0C = 0xe6; - temp_ret_3 = microcode_constructor_related_to_menus(microcode_constructor_related_to_menus(temp_s0_5, 0x37, 0xf7, 0x163, 0x102, 0x32), 0x37, 0xe6 + 0x11, (s32) (sqrtf(slider_007_mode_damage / 10.0f) * 300.0f) + 0x37, (s32) (0xe6 + 0x1c), 0x64); - phi_s0_3 = temp_ret_3; + spC0C = 0xE6; + + DL = microcode_constructor_related_to_menus(DL, 0x37, 0xF7, 0x163, 0x102, 0x32); + val = (sqrtf(slider_007_mode_damage / 10.0f)) * 300.0f; + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C + 0x11, val + 0x37, spC0C + 0x1c, 0x64); + if (highlight_enemy_damage != 0) { - phi_s0_3 = microcode_constructor_related_to_menus(temp_ret_3, 0x37, spC0C + -1, 0xc7, (s32) (spC0C + 0xe), 0x32); + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C - 1, 0xC7, spC0C + 0xE, 0x32); } - sp44 = viGetX(); - temp_s0_6 = write_text_at_abs_coord(phi_s0_3, &spC10, &spC0C, spC14, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - sprintf(&sp54, &aD_1, (s32) (slider_007_mode_damage * 10.0f)); + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)spC14, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + sprintf((char*)&sp54, "%d%%\n", (s32) (slider_007_mode_damage * 10.0f)); + sp4C = 0; sp50 = 0; - sub_GAME_7F0AE98C(&sp50, &sp4C, &sp54, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - spC10 = (s32) (0x11d - sp4C); - spC0C = 0xe6; - sp44 = viGetX(); - temp_s0_7 = write_text_at_abs_coord(temp_s0_6, &spC10, &spC0C, &sp54, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - spC14 = langGet(TEXT(LTITLE, 0x29)); + + textMeasure(&sp50, &sp4C, (char*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spC10 = 0x11D - sp4C; + spC0C = 0xE6; + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + spC14 = langGet(TEXT(LTITLE, TITLE_STR_41)); + spC10 = 0x39; spC0C = 0x107; - temp_ret_4 = microcode_constructor_related_to_menus(microcode_constructor_related_to_menus(temp_s0_7, 0x37, 0x118, 0x163, 0x123, 0x32), 0x37, 0x107 + 0x11, (s32) ((slider_007_mode_reaction * 300.0f) * 1.0f) + 0x37, (s32) (0x107 + 0x1c), 0x64); - phi_s0_4 = temp_ret_4; + + DL = microcode_constructor_related_to_menus(DL, 0x37, 0x118, 0x163, 0x123, 0x32); + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C + 0x11, (s32) (slider_007_mode_reaction * 300.0f * 1) + 0x37, spC0C + 0x1c, 0x64); + if (highlight_enemy_reaction != 0) { - phi_s0_4 = microcode_constructor_related_to_menus(temp_ret_4, 0x37, spC0C + -1, 0xc7, (s32) (spC0C + 0xe), 0x32); + DL = microcode_constructor_related_to_menus(DL, 0x37, spC0C - 1, 0xC7, spC0C + 0xE, 0x32); } - sp44 = viGetX(); - temp_s0_8 = write_text_at_abs_coord(phi_s0_4, &spC10, &spC0C, spC14, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0); - sprintf(&sp54, &aD_2, (s32) (slider_007_mode_reaction * 100.0f)); + + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)spC14, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + sprintf((char*)&sp54, "%d%%\n", (s32) (slider_007_mode_reaction * 100.0f)); + sp4C = 0; sp50 = 0; - sub_GAME_7F0AE98C(&sp50, &sp4C, &sp54, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - spC10 = (s32) (0x11d - sp4C); + + textMeasure(&sp50, &sp4C, (char*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spC10 = 0x11D - sp4C; spC0C = 0x107; - sp44 = viGetX(); - load_draw_selected_icon_folder_select(add_tab2_next(add_tab3_previous(add_tab1_start(write_text_at_abs_coord(temp_s0_8, &spC10, &spC0C, &sp54, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, sp44, viGetY(), 0, 0))))); -} -#else -#ifndef VERSION_EU -const char asc_D_80050074[3000] = {0xA, 0}; -const char aD[] = "%d%%\n"; -const char aD_0[] = "%d%%\n"; -const char aD_1[] = "%d%%\n"; -const char aD_2[] = "%d%%\n"; -GLOBAL_ASM( -.text -glabel constructor_menu09_007options -/* 0442C8 7F00F798 27BDF3E8 */ addiu $sp, $sp, -0xc18 -/* 0442CC 7F00F79C AFBF003C */ sw $ra, 0x3c($sp) -/* 0442D0 7F00F7A0 AFB00038 */ sw $s0, 0x38($sp) -/* 0442D4 7F00F7A4 00002825 */ move $a1, $zero -/* 0442D8 7F00F7A8 00003025 */ move $a2, $zero -/* 0442DC 7F00F7AC 0C0011B4 */ jal viSetFillColor -/* 0442E0 7F00F7B0 00003825 */ move $a3, $zero -/* 0442E4 7F00F7B4 0C000FBE */ jal viFillScreen -/* 0442E8 7F00F7B8 00402025 */ move $a0, $v0 -/* 0442EC 7F00F7BC 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 0442F0 7F00F7C0 00402025 */ move $a0, $v0 -/* 0442F4 7F00F7C4 3C0F8005 */ lui $t7, %hi(asc_D_80050074) -/* 0442F8 7F00F7C8 25EF0074 */ addiu $t7, %lo(asc_D_80050074) # addiu $t7, $t7, 0x74 -/* 0442FC 7F00F7CC 25E80BB8 */ addiu $t0, $t7, 0xbb8 -/* 044300 7F00F7D0 27AE0054 */ addiu $t6, $sp, 0x54 -.L7F00F7D4: -/* 044304 7F00F7D4 8DE10000 */ lw $at, ($t7) -/* 044308 7F00F7D8 25EF000C */ addiu $t7, $t7, 0xc -/* 04430C 7F00F7DC 25CE000C */ addiu $t6, $t6, 0xc -/* 044310 7F00F7E0 ADC1FFF4 */ sw $at, -0xc($t6) -/* 044314 7F00F7E4 8DE1FFF8 */ lw $at, -8($t7) -/* 044318 7F00F7E8 ADC1FFF8 */ sw $at, -8($t6) -/* 04431C 7F00F7EC 8DE1FFFC */ lw $at, -4($t7) -/* 044320 7F00F7F0 15E8FFF8 */ bne $t7, $t0, .L7F00F7D4 -/* 044324 7F00F7F4 ADC1FFFC */ sw $at, -4($t6) -/* 044328 7F00F7F8 0FC2B366 */ jal microcode_constructor -/* 04432C 7F00F7FC 00402025 */ move $a0, $v0 -/* 044330 7F00F800 00402025 */ move $a0, $v0 -/* 044334 7F00F804 0FC03AAF */ jal print_current_solo_briefing_stage_name -/* 044338 7F00F808 27A50054 */ addiu $a1, $sp, 0x54 -/* 04433C 7F00F80C 00408025 */ move $s0, $v0 -/* 044340 7F00F810 0FC30776 */ jal langGet -/* 044344 7F00F814 34049C28 */ li $a0, 39976 -/* 044348 7F00F818 24090037 */ li $t1, 55 -/* 04434C 7F00F81C 2403008F */ li $v1, 143 -/* 044350 7F00F820 AFA20C14 */ sw $v0, 0xc14($sp) -/* 044354 7F00F824 AFA90C10 */ sw $t1, 0xc10($sp) -/* 044358 7F00F828 0C001107 */ jal viGetX -/* 04435C 7F00F82C AFA30C0C */ sw $v1, 0xc0c($sp) -/* 044360 7F00F830 0C00110B */ jal viGetY -/* 044364 7F00F834 A7A20044 */ sh $v0, 0x44($sp) -/* 044368 7F00F838 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableLarge) -/* 04436C 7F00F83C 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableLarge) -/* 044370 7F00F840 8D6B0EB4 */ lw $t3, %lo(ptrFirstFontTableLarge)($t3) -/* 044374 7F00F844 8D4A0EB8 */ lw $t2, %lo(ptrSecondFontTableLarge)($t2) -/* 044378 7F00F848 87AD0044 */ lh $t5, 0x44($sp) -/* 04437C 7F00F84C 240C00FF */ li $t4, 255 -/* 044380 7F00F850 AFAC0018 */ sw $t4, 0x18($sp) -/* 044384 7F00F854 02002025 */ move $a0, $s0 -/* 044388 7F00F858 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 04438C 7F00F85C 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 044390 7F00F860 8FA70C14 */ lw $a3, 0xc14($sp) -/* 044394 7F00F864 AFA20020 */ sw $v0, 0x20($sp) -/* 044398 7F00F868 AFA00024 */ sw $zero, 0x24($sp) -/* 04439C 7F00F86C AFA00028 */ sw $zero, 0x28($sp) -/* 0443A0 7F00F870 AFAB0014 */ sw $t3, 0x14($sp) -/* 0443A4 7F00F874 AFAA0010 */ sw $t2, 0x10($sp) -/* 0443A8 7F00F878 0FC025D8 */ jal write_text_at_abs_coord -/* 0443AC 7F00F87C AFAD001C */ sw $t5, 0x1c($sp) -/* 0443B0 7F00F880 00408025 */ move $s0, $v0 -/* 0443B4 7F00F884 0FC30776 */ jal langGet -/* 0443B8 7F00F888 34049C2A */ li $a0, 39978 -/* 0443BC 7F00F88C 24190039 */ li $t9, 57 -/* 0443C0 7F00F890 240300A4 */ li $v1, 164 -/* 0443C4 7F00F894 241800C0 */ li $t8, 192 -/* 0443C8 7F00F898 24080032 */ li $t0, 50 -/* 0443CC 7F00F89C AFA20C14 */ sw $v0, 0xc14($sp) -/* 0443D0 7F00F8A0 AFB90C10 */ sw $t9, 0xc10($sp) -/* 0443D4 7F00F8A4 AFA80014 */ sw $t0, 0x14($sp) -/* 0443D8 7F00F8A8 AFB80010 */ sw $t8, 0x10($sp) -/* 0443DC 7F00F8AC AFA30C0C */ sw $v1, 0xc0c($sp) -/* 0443E0 7F00F8B0 02002025 */ move $a0, $s0 -/* 0443E4 7F00F8B4 24050037 */ li $a1, 55 -/* 0443E8 7F00F8B8 240600B5 */ li $a2, 181 -/* 0443EC 7F00F8BC 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 0443F0 7F00F8C0 24070163 */ li $a3, 355 -/* 0443F4 7F00F8C4 3C018003 */ lui $at, %hi(slider_007_mode_health) -/* 0443F8 7F00F8C8 C424A9A4 */ lwc1 $f4, %lo(slider_007_mode_health)($at) -/* 0443FC 7F00F8CC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 044400 7F00F8D0 44813000 */ mtc1 $at, $f6 -/* 044404 7F00F8D4 00408025 */ move $s0, $v0 -/* 044408 7F00F8D8 0C007DF8 */ jal sqrtf -/* 04440C 7F00F8DC 46062303 */ div.s $f12, $f4, $f6 -/* 044410 7F00F8E0 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 044414 7F00F8E4 44814000 */ mtc1 $at, $f8 -/* 044418 7F00F8E8 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 04441C 7F00F8EC 24090064 */ li $t1, 100 -/* 044420 7F00F8F0 46080282 */ mul.s $f10, $f0, $f8 -/* 044424 7F00F8F4 246E001C */ addiu $t6, $v1, 0x1c -/* 044428 7F00F8F8 AFAE0010 */ sw $t6, 0x10($sp) -/* 04442C 7F00F8FC AFA90014 */ sw $t1, 0x14($sp) -/* 044430 7F00F900 02002025 */ move $a0, $s0 -/* 044434 7F00F904 24050037 */ li $a1, 55 -/* 044438 7F00F908 24660011 */ addiu $a2, $v1, 0x11 -/* 04443C 7F00F90C 4600540D */ trunc.w.s $f16, $f10 -/* 044440 7F00F910 44078000 */ mfc1 $a3, $f16 -/* 044444 7F00F914 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044448 7F00F918 24E70037 */ addiu $a3, $a3, 0x37 -/* 04444C 7F00F91C 3C0A8007 */ lui $t2, %hi(highlight_enemy_health) -/* 044450 7F00F920 8D4A9798 */ lw $t2, %lo(highlight_enemy_health)($t2) -/* 044454 7F00F924 00408025 */ move $s0, $v0 -/* 044458 7F00F928 1140000C */ beqz $t2, .L7F00F95C -/* 04445C 7F00F92C 00000000 */ nop -/* 044460 7F00F930 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044464 7F00F934 240C0032 */ li $t4, 50 -/* 044468 7F00F938 AFAC0014 */ sw $t4, 0x14($sp) -/* 04446C 7F00F93C 246B000E */ addiu $t3, $v1, 0xe -/* 044470 7F00F940 AFAB0010 */ sw $t3, 0x10($sp) -/* 044474 7F00F944 00402025 */ move $a0, $v0 -/* 044478 7F00F948 24050037 */ li $a1, 55 -/* 04447C 7F00F94C 240700C7 */ li $a3, 199 -/* 044480 7F00F950 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044484 7F00F954 2466FFFF */ addiu $a2, $v1, -1 -/* 044488 7F00F958 00408025 */ move $s0, $v0 -.L7F00F95C: -/* 04448C 7F00F95C 0C001107 */ jal viGetX -/* 044490 7F00F960 00000000 */ nop -/* 044494 7F00F964 0C00110B */ jal viGetY -/* 044498 7F00F968 A7A20044 */ sh $v0, 0x44($sp) -/* 04449C 7F00F96C 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableLarge) -/* 0444A0 7F00F970 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0444A4 7F00F974 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 0444A8 7F00F978 8DAD0EB8 */ lw $t5, %lo(ptrSecondFontTableLarge)($t5) -/* 0444AC 7F00F97C 87A80044 */ lh $t0, 0x44($sp) -/* 0444B0 7F00F980 241800FF */ li $t8, 255 -/* 0444B4 7F00F984 AFB80018 */ sw $t8, 0x18($sp) -/* 0444B8 7F00F988 02002025 */ move $a0, $s0 -/* 0444BC 7F00F98C 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 0444C0 7F00F990 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 0444C4 7F00F994 8FA70C14 */ lw $a3, 0xc14($sp) -/* 0444C8 7F00F998 AFA20020 */ sw $v0, 0x20($sp) -/* 0444CC 7F00F99C AFA00024 */ sw $zero, 0x24($sp) -/* 0444D0 7F00F9A0 AFA00028 */ sw $zero, 0x28($sp) -/* 0444D4 7F00F9A4 AFB90014 */ sw $t9, 0x14($sp) -/* 0444D8 7F00F9A8 AFAD0010 */ sw $t5, 0x10($sp) -/* 0444DC 7F00F9AC 0FC025D8 */ jal write_text_at_abs_coord -/* 0444E0 7F00F9B0 AFA8001C */ sw $t0, 0x1c($sp) -/* 0444E4 7F00F9B4 3C018003 */ lui $at, %hi(slider_007_mode_health) -/* 0444E8 7F00F9B8 C432A9A4 */ lwc1 $f18, %lo(slider_007_mode_health)($at) -/* 0444EC 7F00F9BC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0444F0 7F00F9C0 44812000 */ mtc1 $at, $f4 -/* 0444F4 7F00F9C4 3C058005 */ lui $a1, %hi(aD) -/* 0444F8 7F00F9C8 00408025 */ move $s0, $v0 -/* 0444FC 7F00F9CC 46049182 */ mul.s $f6, $f18, $f4 -/* 044500 7F00F9D0 24A50C2C */ addiu $a1, %lo(aD) # addiu $a1, $a1, 0xc2c -/* 044504 7F00F9D4 27A40054 */ addiu $a0, $sp, 0x54 -/* 044508 7F00F9D8 4600320D */ trunc.w.s $f8, $f6 -/* 04450C 7F00F9DC 44064000 */ mfc1 $a2, $f8 -/* 044510 7F00F9E0 0C002B25 */ jal sprintf -/* 044514 7F00F9E4 00000000 */ nop -/* 044518 7F00F9E8 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) -/* 04451C 7F00F9EC 8DCE0EB4 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 044520 7F00F9F0 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) -/* 044524 7F00F9F4 AFA0004C */ sw $zero, 0x4c($sp) -/* 044528 7F00F9F8 AFA00050 */ sw $zero, 0x50($sp) -/* 04452C 7F00F9FC 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 044530 7F00FA00 27A40050 */ addiu $a0, $sp, 0x50 -/* 044534 7F00FA04 27A5004C */ addiu $a1, $sp, 0x4c -/* 044538 7F00FA08 27A60054 */ addiu $a2, $sp, 0x54 -/* 04453C 7F00FA0C AFA00014 */ sw $zero, 0x14($sp) -/* 044540 7F00FA10 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 044544 7F00FA14 AFAE0010 */ sw $t6, 0x10($sp) -/* 044548 7F00FA18 8FA9004C */ lw $t1, 0x4c($sp) -/* 04454C 7F00FA1C 240A011D */ li $t2, 285 -/* 044550 7F00FA20 240300A4 */ li $v1, 164 -/* 044554 7F00FA24 01495823 */ subu $t3, $t2, $t1 -/* 044558 7F00FA28 AFAB0C10 */ sw $t3, 0xc10($sp) -/* 04455C 7F00FA2C 0C001107 */ jal viGetX -/* 044560 7F00FA30 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 044564 7F00FA34 0C00110B */ jal viGetY -/* 044568 7F00FA38 A7A20044 */ sh $v0, 0x44($sp) -/* 04456C 7F00FA3C 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableLarge) -/* 044570 7F00FA40 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 044574 7F00FA44 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 044578 7F00FA48 8D8C0EB8 */ lw $t4, %lo(ptrSecondFontTableLarge)($t4) -/* 04457C 7F00FA4C 87B80044 */ lh $t8, 0x44($sp) -/* 044580 7F00FA50 241900FF */ li $t9, 255 -/* 044584 7F00FA54 AFB90018 */ sw $t9, 0x18($sp) -/* 044588 7F00FA58 02002025 */ move $a0, $s0 -/* 04458C 7F00FA5C 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 044590 7F00FA60 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 044594 7F00FA64 27A70054 */ addiu $a3, $sp, 0x54 -/* 044598 7F00FA68 AFA20020 */ sw $v0, 0x20($sp) -/* 04459C 7F00FA6C AFA00024 */ sw $zero, 0x24($sp) -/* 0445A0 7F00FA70 AFA00028 */ sw $zero, 0x28($sp) -/* 0445A4 7F00FA74 AFAD0014 */ sw $t5, 0x14($sp) -/* 0445A8 7F00FA78 AFAC0010 */ sw $t4, 0x10($sp) -/* 0445AC 7F00FA7C 0FC025D8 */ jal write_text_at_abs_coord -/* 0445B0 7F00FA80 AFB8001C */ sw $t8, 0x1c($sp) -/* 0445B4 7F00FA84 00408025 */ move $s0, $v0 -/* 0445B8 7F00FA88 0FC30776 */ jal langGet -/* 0445BC 7F00FA8C 34049C2B */ li $a0, 39979 -/* 0445C0 7F00FA90 24080039 */ li $t0, 57 -/* 0445C4 7F00FA94 240300C5 */ li $v1, 197 -/* 0445C8 7F00FA98 240F00E1 */ li $t7, 225 -/* 0445CC 7F00FA9C 240E0032 */ li $t6, 50 -/* 0445D0 7F00FAA0 AFA20C14 */ sw $v0, 0xc14($sp) -/* 0445D4 7F00FAA4 AFA80C10 */ sw $t0, 0xc10($sp) -/* 0445D8 7F00FAA8 AFAE0014 */ sw $t6, 0x14($sp) -/* 0445DC 7F00FAAC AFAF0010 */ sw $t7, 0x10($sp) -/* 0445E0 7F00FAB0 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 0445E4 7F00FAB4 02002025 */ move $a0, $s0 -/* 0445E8 7F00FAB8 24050037 */ li $a1, 55 -/* 0445EC 7F00FABC 240600D6 */ li $a2, 214 -/* 0445F0 7F00FAC0 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 0445F4 7F00FAC4 24070163 */ li $a3, 355 -/* 0445F8 7F00FAC8 3C018003 */ lui $at, %hi(slider_007_mode_accuracy) -/* 0445FC 7F00FACC C42AA9A8 */ lwc1 $f10, %lo(slider_007_mode_accuracy)($at) -/* 044600 7F00FAD0 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 044604 7F00FAD4 44818000 */ mtc1 $at, $f16 -/* 044608 7F00FAD8 00408025 */ move $s0, $v0 -/* 04460C 7F00FADC 0C007DF8 */ jal sqrtf -/* 044610 7F00FAE0 46105303 */ div.s $f12, $f10, $f16 -/* 044614 7F00FAE4 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 044618 7F00FAE8 44819000 */ mtc1 $at, $f18 -/* 04461C 7F00FAEC 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044620 7F00FAF0 240B0064 */ li $t3, 100 -/* 044624 7F00FAF4 46120102 */ mul.s $f4, $f0, $f18 -/* 044628 7F00FAF8 2469001C */ addiu $t1, $v1, 0x1c -/* 04462C 7F00FAFC AFA90010 */ sw $t1, 0x10($sp) -/* 044630 7F00FB00 AFAB0014 */ sw $t3, 0x14($sp) -/* 044634 7F00FB04 02002025 */ move $a0, $s0 -/* 044638 7F00FB08 24050037 */ li $a1, 55 -/* 04463C 7F00FB0C 24660011 */ addiu $a2, $v1, 0x11 -/* 044640 7F00FB10 4600218D */ trunc.w.s $f6, $f4 -/* 044644 7F00FB14 44073000 */ mfc1 $a3, $f6 -/* 044648 7F00FB18 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04464C 7F00FB1C 24E70037 */ addiu $a3, $a3, 0x37 -/* 044650 7F00FB20 3C0C8007 */ lui $t4, %hi(highlight_enemy_accuracy) -/* 044654 7F00FB24 8D8C979C */ lw $t4, %lo(highlight_enemy_accuracy)($t4) -/* 044658 7F00FB28 00408025 */ move $s0, $v0 -/* 04465C 7F00FB2C 1180000C */ beqz $t4, .L7F00FB60 -/* 044660 7F00FB30 00000000 */ nop -/* 044664 7F00FB34 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044668 7F00FB38 24190032 */ li $t9, 50 -/* 04466C 7F00FB3C AFB90014 */ sw $t9, 0x14($sp) -/* 044670 7F00FB40 246D000E */ addiu $t5, $v1, 0xe -/* 044674 7F00FB44 AFAD0010 */ sw $t5, 0x10($sp) -/* 044678 7F00FB48 00402025 */ move $a0, $v0 -/* 04467C 7F00FB4C 24050037 */ li $a1, 55 -/* 044680 7F00FB50 240700C7 */ li $a3, 199 -/* 044684 7F00FB54 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044688 7F00FB58 2466FFFF */ addiu $a2, $v1, -1 -/* 04468C 7F00FB5C 00408025 */ move $s0, $v0 -.L7F00FB60: -/* 044690 7F00FB60 0C001107 */ jal viGetX -/* 044694 7F00FB64 00000000 */ nop -/* 044698 7F00FB68 0C00110B */ jal viGetY -/* 04469C 7F00FB6C A7A20044 */ sh $v0, 0x44($sp) -/* 0446A0 7F00FB70 3C188004 */ lui $t8, %hi(ptrSecondFontTableLarge) -/* 0446A4 7F00FB74 3C088004 */ lui $t0, %hi(ptrFirstFontTableLarge) -/* 0446A8 7F00FB78 8D080EB4 */ lw $t0, %lo(ptrFirstFontTableLarge)($t0) -/* 0446AC 7F00FB7C 8F180EB8 */ lw $t8, %lo(ptrSecondFontTableLarge)($t8) -/* 0446B0 7F00FB80 87AE0044 */ lh $t6, 0x44($sp) -/* 0446B4 7F00FB84 240F00FF */ li $t7, 255 -/* 0446B8 7F00FB88 AFAF0018 */ sw $t7, 0x18($sp) -/* 0446BC 7F00FB8C 02002025 */ move $a0, $s0 -/* 0446C0 7F00FB90 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 0446C4 7F00FB94 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 0446C8 7F00FB98 8FA70C14 */ lw $a3, 0xc14($sp) -/* 0446CC 7F00FB9C AFA20020 */ sw $v0, 0x20($sp) -/* 0446D0 7F00FBA0 AFA00024 */ sw $zero, 0x24($sp) -/* 0446D4 7F00FBA4 AFA00028 */ sw $zero, 0x28($sp) -/* 0446D8 7F00FBA8 AFA80014 */ sw $t0, 0x14($sp) -/* 0446DC 7F00FBAC AFB80010 */ sw $t8, 0x10($sp) -/* 0446E0 7F00FBB0 0FC025D8 */ jal write_text_at_abs_coord -/* 0446E4 7F00FBB4 AFAE001C */ sw $t6, 0x1c($sp) -/* 0446E8 7F00FBB8 3C018003 */ lui $at, %hi(slider_007_mode_accuracy) -/* 0446EC 7F00FBBC C428A9A8 */ lwc1 $f8, %lo(slider_007_mode_accuracy)($at) -/* 0446F0 7F00FBC0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0446F4 7F00FBC4 44815000 */ mtc1 $at, $f10 -/* 0446F8 7F00FBC8 3C058005 */ lui $a1, %hi(aD_0) -/* 0446FC 7F00FBCC 00408025 */ move $s0, $v0 -/* 044700 7F00FBD0 460A4402 */ mul.s $f16, $f8, $f10 -/* 044704 7F00FBD4 24A50C34 */ addiu $a1, %lo(aD_0) # addiu $a1, $a1, 0xc34 -/* 044708 7F00FBD8 27A40054 */ addiu $a0, $sp, 0x54 -/* 04470C 7F00FBDC 4600848D */ trunc.w.s $f18, $f16 -/* 044710 7F00FBE0 44069000 */ mfc1 $a2, $f18 -/* 044714 7F00FBE4 0C002B25 */ jal sprintf -/* 044718 7F00FBE8 00000000 */ nop -/* 04471C 7F00FBEC 3C098004 */ lui $t1, %hi(ptrFirstFontTableLarge) -/* 044720 7F00FBF0 8D290EB4 */ lw $t1, %lo(ptrFirstFontTableLarge)($t1) -/* 044724 7F00FBF4 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) -/* 044728 7F00FBF8 AFA0004C */ sw $zero, 0x4c($sp) -/* 04472C 7F00FBFC AFA00050 */ sw $zero, 0x50($sp) -/* 044730 7F00FC00 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 044734 7F00FC04 27A40050 */ addiu $a0, $sp, 0x50 -/* 044738 7F00FC08 27A5004C */ addiu $a1, $sp, 0x4c -/* 04473C 7F00FC0C 27A60054 */ addiu $a2, $sp, 0x54 -/* 044740 7F00FC10 AFA00014 */ sw $zero, 0x14($sp) -/* 044744 7F00FC14 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 044748 7F00FC18 AFA90010 */ sw $t1, 0x10($sp) -/* 04474C 7F00FC1C 8FAB004C */ lw $t3, 0x4c($sp) -/* 044750 7F00FC20 240C011D */ li $t4, 285 -/* 044754 7F00FC24 240300C5 */ li $v1, 197 -/* 044758 7F00FC28 018B6823 */ subu $t5, $t4, $t3 -/* 04475C 7F00FC2C AFAD0C10 */ sw $t5, 0xc10($sp) -/* 044760 7F00FC30 0C001107 */ jal viGetX -/* 044764 7F00FC34 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 044768 7F00FC38 0C00110B */ jal viGetY -/* 04476C 7F00FC3C A7A20044 */ sh $v0, 0x44($sp) -/* 044770 7F00FC40 3C198004 */ lui $t9, %hi(ptrSecondFontTableLarge) -/* 044774 7F00FC44 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) -/* 044778 7F00FC48 8F180EB4 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) -/* 04477C 7F00FC4C 8F390EB8 */ lw $t9, %lo(ptrSecondFontTableLarge)($t9) -/* 044780 7F00FC50 87AF0044 */ lh $t7, 0x44($sp) -/* 044784 7F00FC54 240800FF */ li $t0, 255 -/* 044788 7F00FC58 AFA80018 */ sw $t0, 0x18($sp) -/* 04478C 7F00FC5C 02002025 */ move $a0, $s0 -/* 044790 7F00FC60 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 044794 7F00FC64 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 044798 7F00FC68 27A70054 */ addiu $a3, $sp, 0x54 -/* 04479C 7F00FC6C AFA20020 */ sw $v0, 0x20($sp) -/* 0447A0 7F00FC70 AFA00024 */ sw $zero, 0x24($sp) -/* 0447A4 7F00FC74 AFA00028 */ sw $zero, 0x28($sp) -/* 0447A8 7F00FC78 AFB80014 */ sw $t8, 0x14($sp) -/* 0447AC 7F00FC7C AFB90010 */ sw $t9, 0x10($sp) -/* 0447B0 7F00FC80 0FC025D8 */ jal write_text_at_abs_coord -/* 0447B4 7F00FC84 AFAF001C */ sw $t7, 0x1c($sp) -/* 0447B8 7F00FC88 00408025 */ move $s0, $v0 -/* 0447BC 7F00FC8C 0FC30776 */ jal langGet -/* 0447C0 7F00FC90 34049C2C */ li $a0, 39980 -/* 0447C4 7F00FC94 240E0039 */ li $t6, 57 -/* 0447C8 7F00FC98 240300E6 */ li $v1, 230 -/* 0447CC 7F00FC9C 240A0102 */ li $t2, 258 -/* 0447D0 7F00FCA0 24090032 */ li $t1, 50 -/* 0447D4 7F00FCA4 AFA20C14 */ sw $v0, 0xc14($sp) -/* 0447D8 7F00FCA8 AFAE0C10 */ sw $t6, 0xc10($sp) -/* 0447DC 7F00FCAC AFA90014 */ sw $t1, 0x14($sp) -/* 0447E0 7F00FCB0 AFAA0010 */ sw $t2, 0x10($sp) -/* 0447E4 7F00FCB4 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 0447E8 7F00FCB8 02002025 */ move $a0, $s0 -/* 0447EC 7F00FCBC 24050037 */ li $a1, 55 -/* 0447F0 7F00FCC0 240600F7 */ li $a2, 247 -/* 0447F4 7F00FCC4 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 0447F8 7F00FCC8 24070163 */ li $a3, 355 -/* 0447FC 7F00FCCC 3C018003 */ lui $at, %hi(slider_007_mode_damage) -/* 044800 7F00FCD0 C424A9AC */ lwc1 $f4, %lo(slider_007_mode_damage)($at) -/* 044804 7F00FCD4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 044808 7F00FCD8 44813000 */ mtc1 $at, $f6 -/* 04480C 7F00FCDC 00408025 */ move $s0, $v0 -/* 044810 7F00FCE0 0C007DF8 */ jal sqrtf -/* 044814 7F00FCE4 46062303 */ div.s $f12, $f4, $f6 -/* 044818 7F00FCE8 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 04481C 7F00FCEC 44814000 */ mtc1 $at, $f8 -/* 044820 7F00FCF0 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044824 7F00FCF4 240D0064 */ li $t5, 100 -/* 044828 7F00FCF8 46080282 */ mul.s $f10, $f0, $f8 -/* 04482C 7F00FCFC 246B001C */ addiu $t3, $v1, 0x1c -/* 044830 7F00FD00 AFAB0010 */ sw $t3, 0x10($sp) -/* 044834 7F00FD04 AFAD0014 */ sw $t5, 0x14($sp) -/* 044838 7F00FD08 02002025 */ move $a0, $s0 -/* 04483C 7F00FD0C 24050037 */ li $a1, 55 -/* 044840 7F00FD10 24660011 */ addiu $a2, $v1, 0x11 -/* 044844 7F00FD14 4600540D */ trunc.w.s $f16, $f10 -/* 044848 7F00FD18 44078000 */ mfc1 $a3, $f16 -/* 04484C 7F00FD1C 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044850 7F00FD20 24E70037 */ addiu $a3, $a3, 0x37 -/* 044854 7F00FD24 3C198007 */ lui $t9, %hi(highlight_enemy_damage) -/* 044858 7F00FD28 8F3997A0 */ lw $t9, %lo(highlight_enemy_damage)($t9) -/* 04485C 7F00FD2C 00408025 */ move $s0, $v0 -/* 044860 7F00FD30 1320000C */ beqz $t9, .L7F00FD64 -/* 044864 7F00FD34 00000000 */ nop -/* 044868 7F00FD38 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 04486C 7F00FD3C 24080032 */ li $t0, 50 -/* 044870 7F00FD40 AFA80014 */ sw $t0, 0x14($sp) -/* 044874 7F00FD44 2478000E */ addiu $t8, $v1, 0xe -/* 044878 7F00FD48 AFB80010 */ sw $t8, 0x10($sp) -/* 04487C 7F00FD4C 00402025 */ move $a0, $v0 -/* 044880 7F00FD50 24050037 */ li $a1, 55 -/* 044884 7F00FD54 240700C7 */ li $a3, 199 -/* 044888 7F00FD58 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04488C 7F00FD5C 2466FFFF */ addiu $a2, $v1, -1 -/* 044890 7F00FD60 00408025 */ move $s0, $v0 -.L7F00FD64: -/* 044894 7F00FD64 0C001107 */ jal viGetX -/* 044898 7F00FD68 00000000 */ nop -/* 04489C 7F00FD6C 0C00110B */ jal viGetY -/* 0448A0 7F00FD70 A7A20044 */ sh $v0, 0x44($sp) -/* 0448A4 7F00FD74 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableLarge) -/* 0448A8 7F00FD78 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) -/* 0448AC 7F00FD7C 8DCE0EB4 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 0448B0 7F00FD80 8DEF0EB8 */ lw $t7, %lo(ptrSecondFontTableLarge)($t7) -/* 0448B4 7F00FD84 87A90044 */ lh $t1, 0x44($sp) -/* 0448B8 7F00FD88 240A00FF */ li $t2, 255 -/* 0448BC 7F00FD8C AFAA0018 */ sw $t2, 0x18($sp) -/* 0448C0 7F00FD90 02002025 */ move $a0, $s0 -/* 0448C4 7F00FD94 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 0448C8 7F00FD98 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 0448CC 7F00FD9C 8FA70C14 */ lw $a3, 0xc14($sp) -/* 0448D0 7F00FDA0 AFA20020 */ sw $v0, 0x20($sp) -/* 0448D4 7F00FDA4 AFA00024 */ sw $zero, 0x24($sp) -/* 0448D8 7F00FDA8 AFA00028 */ sw $zero, 0x28($sp) -/* 0448DC 7F00FDAC AFAE0014 */ sw $t6, 0x14($sp) -/* 0448E0 7F00FDB0 AFAF0010 */ sw $t7, 0x10($sp) -/* 0448E4 7F00FDB4 0FC025D8 */ jal write_text_at_abs_coord -/* 0448E8 7F00FDB8 AFA9001C */ sw $t1, 0x1c($sp) -/* 0448EC 7F00FDBC 3C018003 */ lui $at, %hi(slider_007_mode_damage) -/* 0448F0 7F00FDC0 C432A9AC */ lwc1 $f18, %lo(slider_007_mode_damage)($at) -/* 0448F4 7F00FDC4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0448F8 7F00FDC8 44812000 */ mtc1 $at, $f4 -/* 0448FC 7F00FDCC 3C058005 */ lui $a1, %hi(aD_1) -/* 044900 7F00FDD0 00408025 */ move $s0, $v0 -/* 044904 7F00FDD4 46049182 */ mul.s $f6, $f18, $f4 -/* 044908 7F00FDD8 24A50C3C */ addiu $a1, %lo(aD_1) # addiu $a1, $a1, 0xc3c -/* 04490C 7F00FDDC 27A40054 */ addiu $a0, $sp, 0x54 -/* 044910 7F00FDE0 4600320D */ trunc.w.s $f8, $f6 -/* 044914 7F00FDE4 44064000 */ mfc1 $a2, $f8 -/* 044918 7F00FDE8 0C002B25 */ jal sprintf -/* 04491C 7F00FDEC 00000000 */ nop -/* 044920 7F00FDF0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableLarge) -/* 044924 7F00FDF4 8D6B0EB4 */ lw $t3, %lo(ptrFirstFontTableLarge)($t3) -/* 044928 7F00FDF8 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) -/* 04492C 7F00FDFC AFA0004C */ sw $zero, 0x4c($sp) -/* 044930 7F00FE00 AFA00050 */ sw $zero, 0x50($sp) -/* 044934 7F00FE04 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 044938 7F00FE08 27A40050 */ addiu $a0, $sp, 0x50 -/* 04493C 7F00FE0C 27A5004C */ addiu $a1, $sp, 0x4c -/* 044940 7F00FE10 27A60054 */ addiu $a2, $sp, 0x54 -/* 044944 7F00FE14 AFA00014 */ sw $zero, 0x14($sp) -/* 044948 7F00FE18 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04494C 7F00FE1C AFAB0010 */ sw $t3, 0x10($sp) -/* 044950 7F00FE20 8FAD004C */ lw $t5, 0x4c($sp) -/* 044954 7F00FE24 2419011D */ li $t9, 285 -/* 044958 7F00FE28 240300E6 */ li $v1, 230 -/* 04495C 7F00FE2C 032DC023 */ subu $t8, $t9, $t5 -/* 044960 7F00FE30 AFB80C10 */ sw $t8, 0xc10($sp) -/* 044964 7F00FE34 0C001107 */ jal viGetX -/* 044968 7F00FE38 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 04496C 7F00FE3C 0C00110B */ jal viGetY -/* 044970 7F00FE40 A7A20044 */ sh $v0, 0x44($sp) -/* 044974 7F00FE44 3C088004 */ lui $t0, %hi(ptrSecondFontTableLarge) -/* 044978 7F00FE48 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) -/* 04497C 7F00FE4C 8DEF0EB4 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) -/* 044980 7F00FE50 8D080EB8 */ lw $t0, %lo(ptrSecondFontTableLarge)($t0) -/* 044984 7F00FE54 87AA0044 */ lh $t2, 0x44($sp) -/* 044988 7F00FE58 240E00FF */ li $t6, 255 -/* 04498C 7F00FE5C AFAE0018 */ sw $t6, 0x18($sp) -/* 044990 7F00FE60 02002025 */ move $a0, $s0 -/* 044994 7F00FE64 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 044998 7F00FE68 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 04499C 7F00FE6C 27A70054 */ addiu $a3, $sp, 0x54 -/* 0449A0 7F00FE70 AFA20020 */ sw $v0, 0x20($sp) -/* 0449A4 7F00FE74 AFA00024 */ sw $zero, 0x24($sp) -/* 0449A8 7F00FE78 AFA00028 */ sw $zero, 0x28($sp) -/* 0449AC 7F00FE7C AFAF0014 */ sw $t7, 0x14($sp) -/* 0449B0 7F00FE80 AFA80010 */ sw $t0, 0x10($sp) -/* 0449B4 7F00FE84 0FC025D8 */ jal write_text_at_abs_coord -/* 0449B8 7F00FE88 AFAA001C */ sw $t2, 0x1c($sp) -/* 0449BC 7F00FE8C 00408025 */ move $s0, $v0 -/* 0449C0 7F00FE90 0FC30776 */ jal langGet -/* 0449C4 7F00FE94 34049C29 */ li $a0, 39977 -/* 0449C8 7F00FE98 24090039 */ li $t1, 57 -/* 0449CC 7F00FE9C 24030107 */ li $v1, 263 -/* 0449D0 7F00FEA0 240C0123 */ li $t4, 291 -/* 0449D4 7F00FEA4 240B0032 */ li $t3, 50 -/* 0449D8 7F00FEA8 AFA20C14 */ sw $v0, 0xc14($sp) -/* 0449DC 7F00FEAC AFA90C10 */ sw $t1, 0xc10($sp) -/* 0449E0 7F00FEB0 AFAB0014 */ sw $t3, 0x14($sp) -/* 0449E4 7F00FEB4 AFAC0010 */ sw $t4, 0x10($sp) -/* 0449E8 7F00FEB8 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 0449EC 7F00FEBC 02002025 */ move $a0, $s0 -/* 0449F0 7F00FEC0 24050037 */ li $a1, 55 -/* 0449F4 7F00FEC4 24060118 */ li $a2, 280 -/* 0449F8 7F00FEC8 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 0449FC 7F00FECC 24070163 */ li $a3, 355 -/* 044A00 7F00FED0 3C018003 */ lui $at, %hi(slider_007_mode_reaction) -/* 044A04 7F00FED4 C42AA9A0 */ lwc1 $f10, %lo(slider_007_mode_reaction)($at) -/* 044A08 7F00FED8 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 044A0C 7F00FEDC 44818000 */ mtc1 $at, $f16 -/* 044A10 7F00FEE0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 044A14 7F00FEE4 44812000 */ mtc1 $at, $f4 -/* 044A18 7F00FEE8 46105482 */ mul.s $f18, $f10, $f16 -/* 044A1C 7F00FEEC 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044A20 7F00FEF0 24180064 */ li $t8, 100 -/* 044A24 7F00FEF4 AFB80014 */ sw $t8, 0x14($sp) -/* 044A28 7F00FEF8 246D001C */ addiu $t5, $v1, 0x1c -/* 044A2C 7F00FEFC AFAD0010 */ sw $t5, 0x10($sp) -/* 044A30 7F00FF00 00402025 */ move $a0, $v0 -/* 044A34 7F00FF04 46049182 */ mul.s $f6, $f18, $f4 -/* 044A38 7F00FF08 24050037 */ li $a1, 55 -/* 044A3C 7F00FF0C 24660011 */ addiu $a2, $v1, 0x11 -/* 044A40 7F00FF10 4600320D */ trunc.w.s $f8, $f6 -/* 044A44 7F00FF14 44074000 */ mfc1 $a3, $f8 -/* 044A48 7F00FF18 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044A4C 7F00FF1C 24E70037 */ addiu $a3, $a3, 0x37 -/* 044A50 7F00FF20 3C088007 */ lui $t0, %hi(highlight_enemy_reaction) -/* 044A54 7F00FF24 8D089794 */ lw $t0, %lo(highlight_enemy_reaction)($t0) -/* 044A58 7F00FF28 00408025 */ move $s0, $v0 -/* 044A5C 7F00FF2C 1100000C */ beqz $t0, .L7F00FF60 -/* 044A60 7F00FF30 00000000 */ nop -/* 044A64 7F00FF34 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 044A68 7F00FF38 240E0032 */ li $t6, 50 -/* 044A6C 7F00FF3C AFAE0014 */ sw $t6, 0x14($sp) -/* 044A70 7F00FF40 246F000E */ addiu $t7, $v1, 0xe -/* 044A74 7F00FF44 AFAF0010 */ sw $t7, 0x10($sp) -/* 044A78 7F00FF48 00402025 */ move $a0, $v0 -/* 044A7C 7F00FF4C 24050037 */ li $a1, 55 -/* 044A80 7F00FF50 240700C7 */ li $a3, 199 -/* 044A84 7F00FF54 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 044A88 7F00FF58 2466FFFF */ addiu $a2, $v1, -1 -/* 044A8C 7F00FF5C 00408025 */ move $s0, $v0 -.L7F00FF60: -/* 044A90 7F00FF60 0C001107 */ jal viGetX -/* 044A94 7F00FF64 00000000 */ nop -/* 044A98 7F00FF68 0C00110B */ jal viGetY -/* 044A9C 7F00FF6C A7A20044 */ sh $v0, 0x44($sp) -/* 044AA0 7F00FF70 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableLarge) -/* 044AA4 7F00FF74 3C098004 */ lui $t1, %hi(ptrFirstFontTableLarge) -/* 044AA8 7F00FF78 8D290EB4 */ lw $t1, %lo(ptrFirstFontTableLarge)($t1) -/* 044AAC 7F00FF7C 8D4A0EB8 */ lw $t2, %lo(ptrSecondFontTableLarge)($t2) -/* 044AB0 7F00FF80 87AB0044 */ lh $t3, 0x44($sp) -/* 044AB4 7F00FF84 240C00FF */ li $t4, 255 -/* 044AB8 7F00FF88 AFAC0018 */ sw $t4, 0x18($sp) -/* 044ABC 7F00FF8C 02002025 */ move $a0, $s0 -/* 044AC0 7F00FF90 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 044AC4 7F00FF94 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 044AC8 7F00FF98 8FA70C14 */ lw $a3, 0xc14($sp) -/* 044ACC 7F00FF9C AFA20020 */ sw $v0, 0x20($sp) -/* 044AD0 7F00FFA0 AFA00024 */ sw $zero, 0x24($sp) -/* 044AD4 7F00FFA4 AFA00028 */ sw $zero, 0x28($sp) -/* 044AD8 7F00FFA8 AFA90014 */ sw $t1, 0x14($sp) -/* 044ADC 7F00FFAC AFAA0010 */ sw $t2, 0x10($sp) -/* 044AE0 7F00FFB0 0FC025D8 */ jal write_text_at_abs_coord -/* 044AE4 7F00FFB4 AFAB001C */ sw $t3, 0x1c($sp) -/* 044AE8 7F00FFB8 3C018003 */ lui $at, %hi(slider_007_mode_reaction) -/* 044AEC 7F00FFBC C42AA9A0 */ lwc1 $f10, %lo(slider_007_mode_reaction)($at) -/* 044AF0 7F00FFC0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 044AF4 7F00FFC4 44818000 */ mtc1 $at, $f16 -/* 044AF8 7F00FFC8 3C058005 */ lui $a1, %hi(aD_2) -/* 044AFC 7F00FFCC 00408025 */ move $s0, $v0 -/* 044B00 7F00FFD0 46105482 */ mul.s $f18, $f10, $f16 -/* 044B04 7F00FFD4 24A50C44 */ addiu $a1, %lo(aD_2) # addiu $a1, $a1, 0xc44 -/* 044B08 7F00FFD8 27A40054 */ addiu $a0, $sp, 0x54 -/* 044B0C 7F00FFDC 4600910D */ trunc.w.s $f4, $f18 -/* 044B10 7F00FFE0 44062000 */ mfc1 $a2, $f4 -/* 044B14 7F00FFE4 0C002B25 */ jal sprintf -/* 044B18 7F00FFE8 00000000 */ nop -/* 044B1C 7F00FFEC 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 044B20 7F00FFF0 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 044B24 7F00FFF4 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) -/* 044B28 7F00FFF8 AFA0004C */ sw $zero, 0x4c($sp) -/* 044B2C 7F00FFFC AFA00050 */ sw $zero, 0x50($sp) -/* 044B30 7F010000 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 044B34 7F010004 27A40050 */ addiu $a0, $sp, 0x50 -/* 044B38 7F010008 27A5004C */ addiu $a1, $sp, 0x4c -/* 044B3C 7F01000C 27A60054 */ addiu $a2, $sp, 0x54 -/* 044B40 7F010010 AFA00014 */ sw $zero, 0x14($sp) -/* 044B44 7F010014 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 044B48 7F010018 AFAD0010 */ sw $t5, 0x10($sp) -/* 044B4C 7F01001C 8FB8004C */ lw $t8, 0x4c($sp) -/* 044B50 7F010020 2408011D */ li $t0, 285 -/* 044B54 7F010024 24030107 */ li $v1, 263 -/* 044B58 7F010028 01187823 */ subu $t7, $t0, $t8 -/* 044B5C 7F01002C AFAF0C10 */ sw $t7, 0xc10($sp) -/* 044B60 7F010030 0C001107 */ jal viGetX -/* 044B64 7F010034 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 044B68 7F010038 0C00110B */ jal viGetY -/* 044B6C 7F01003C A7A20044 */ sh $v0, 0x44($sp) -/* 044B70 7F010040 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableLarge) -/* 044B74 7F010044 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableLarge) -/* 044B78 7F010048 8D4A0EB4 */ lw $t2, %lo(ptrFirstFontTableLarge)($t2) -/* 044B7C 7F01004C 8DCE0EB8 */ lw $t6, %lo(ptrSecondFontTableLarge)($t6) -/* 044B80 7F010050 87AC0044 */ lh $t4, 0x44($sp) -/* 044B84 7F010054 240900FF */ li $t1, 255 -/* 044B88 7F010058 AFA90018 */ sw $t1, 0x18($sp) -/* 044B8C 7F01005C 02002025 */ move $a0, $s0 -/* 044B90 7F010060 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 044B94 7F010064 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 044B98 7F010068 27A70054 */ addiu $a3, $sp, 0x54 -/* 044B9C 7F01006C AFA20020 */ sw $v0, 0x20($sp) -/* 044BA0 7F010070 AFA00024 */ sw $zero, 0x24($sp) -/* 044BA4 7F010074 AFA00028 */ sw $zero, 0x28($sp) -/* 044BA8 7F010078 AFAA0014 */ sw $t2, 0x14($sp) -/* 044BAC 7F01007C AFAE0010 */ sw $t6, 0x10($sp) -/* 044BB0 7F010080 0FC025D8 */ jal write_text_at_abs_coord -/* 044BB4 7F010084 AFAC001C */ sw $t4, 0x1c($sp) -/* 044BB8 7F010088 0FC02820 */ jal add_tab1_start -/* 044BBC 7F01008C 00402025 */ move $a0, $v0 -/* 044BC0 7F010090 0FC0288E */ jal add_tab3_previous -/* 044BC4 7F010094 00402025 */ move $a0, $v0 -/* 044BC8 7F010098 0FC02905 */ jal add_tab2_next -/* 044BCC 7F01009C 00402025 */ move $a0, $v0 -/* 044BD0 7F0100A0 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 044BD4 7F0100A4 00402025 */ move $a0, $v0 -/* 044BD8 7F0100A8 8FBF003C */ lw $ra, 0x3c($sp) -/* 044BDC 7F0100AC 8FB00038 */ lw $s0, 0x38($sp) -/* 044BE0 7F0100B0 27BD0C18 */ addiu $sp, $sp, 0xc18 -/* 044BE4 7F0100B4 03E00008 */ jr $ra -/* 044BE8 7F0100B8 00000000 */ nop -) -#endif -#ifdef VERSION_EU -const char aD[] = "%d%%\n"; -const char aD_0[] = "%d%%\n"; -const char aD_1[] = "%d%%\n"; -const char aD_2[] = "%d%%\n"; -GLOBAL_ASM( -.text -glabel constructor_menu09_007options -/* 04209C 7F00F6AC 27BDF3E8 */ addiu $sp, $sp, -0xc18 -/* 0420A0 7F00F6B0 AFBF003C */ sw $ra, 0x3c($sp) -/* 0420A4 7F00F6B4 AFB00038 */ sw $s0, 0x38($sp) -/* 0420A8 7F00F6B8 00002825 */ move $a1, $zero -/* 0420AC 7F00F6BC 00003025 */ move $a2, $zero -/* 0420B0 7F00F6C0 0C001048 */ jal viSetFillColor -/* 0420B4 7F00F6C4 00003825 */ move $a3, $zero -/* 0420B8 7F00F6C8 0C000E52 */ jal viFillScreen -/* 0420BC 7F00F6CC 00402025 */ move $a0, $v0 -/* 0420C0 7F00F6D0 0C000E52 */ jal viFillScreen -/* 0420C4 7F00F6D4 00402025 */ move $a0, $v0 -/* 0420C8 7F00F6D8 0C000E52 */ jal viFillScreen -/* 0420CC 7F00F6DC 00402025 */ move $a0, $v0 -/* 0420D0 7F00F6E0 0FC0353A */ jal sub_GAME_7F00D5E8 -/* 0420D4 7F00F6E4 00402025 */ move $a0, $v0 -/* 0420D8 7F00F6E8 0FC2B016 */ jal microcode_constructor -/* 0420DC 7F00F6EC 00402025 */ move $a0, $v0 -/* 0420E0 7F00F6F0 00402025 */ move $a0, $v0 -/* 0420E4 7F00F6F4 0FC03A7B */ jal print_current_solo_briefing_stage_name -/* 0420E8 7F00F6F8 27A50054 */ addiu $a1, $sp, 0x54 -/* 0420EC 7F00F6FC 00408025 */ move $s0, $v0 -/* 0420F0 7F00F700 0FC304AE */ jal langGet -/* 0420F4 7F00F704 34049C28 */ li $a0, 39976 -/* 0420F8 7F00F708 240E0037 */ li $t6, 55 -/* 0420FC 7F00F70C 2403008F */ li $v1, 143 -/* 042100 7F00F710 AFA20C14 */ sw $v0, 0xc14($sp) -/* 042104 7F00F714 AFAE0C10 */ sw $t6, 0xc10($sp) -/* 042108 7F00F718 0C000F9B */ jal viGetX -/* 04210C 7F00F71C AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042110 7F00F720 0C000F9F */ jal viGetY -/* 042114 7F00F724 A7A20044 */ sh $v0, 0x44($sp) -/* 042118 7F00F728 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableLarge) # $t7, 0x8004 -/* 04211C 7F00F72C 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) # $t8, 0x8004 -/* 042120 7F00F730 8F18AB04 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) -/* 042124 7F00F734 8DEFAB08 */ lw $t7, %lo(ptrSecondFontTableLarge)($t7) -/* 042128 7F00F738 87A80044 */ lh $t0, 0x44($sp) -/* 04212C 7F00F73C 241900FF */ li $t9, 255 -/* 042130 7F00F740 AFB90018 */ sw $t9, 0x18($sp) -/* 042134 7F00F744 02002025 */ move $a0, $s0 -/* 042138 7F00F748 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 04213C 7F00F74C 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042140 7F00F750 8FA70C14 */ lw $a3, 0xc14($sp) -/* 042144 7F00F754 AFA20020 */ sw $v0, 0x20($sp) -/* 042148 7F00F758 AFA00024 */ sw $zero, 0x24($sp) -/* 04214C 7F00F75C AFA00028 */ sw $zero, 0x28($sp) -/* 042150 7F00F760 AFB80014 */ sw $t8, 0x14($sp) -/* 042154 7F00F764 AFAF0010 */ sw $t7, 0x10($sp) -/* 042158 7F00F768 0FC02598 */ jal write_text_at_abs_coord -/* 04215C 7F00F76C AFA8001C */ sw $t0, 0x1c($sp) -/* 042160 7F00F770 00408025 */ move $s0, $v0 -/* 042164 7F00F774 0FC304AE */ jal langGet -/* 042168 7F00F778 34049C2A */ li $a0, 39978 -/* 04216C 7F00F77C 24090039 */ li $t1, 57 -/* 042170 7F00F780 240300A4 */ li $v1, 164 -/* 042174 7F00F784 240A00C0 */ li $t2, 192 -/* 042178 7F00F788 240B0032 */ li $t3, 50 -/* 04217C 7F00F78C AFA20C14 */ sw $v0, 0xc14($sp) -/* 042180 7F00F790 AFA90C10 */ sw $t1, 0xc10($sp) -/* 042184 7F00F794 AFAB0014 */ sw $t3, 0x14($sp) -/* 042188 7F00F798 AFAA0010 */ sw $t2, 0x10($sp) -/* 04218C 7F00F79C AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042190 7F00F7A0 02002025 */ move $a0, $s0 -/* 042194 7F00F7A4 24050037 */ li $a1, 55 -/* 042198 7F00F7A8 240600B5 */ li $a2, 181 -/* 04219C 7F00F7AC 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0421A0 7F00F7B0 24070163 */ li $a3, 355 -/* 0421A4 7F00F7B4 3C018002 */ lui $at, %hi(slider_007_mode_health) # $at, 0x8002 -/* 0421A8 7F00F7B8 C4245EF4 */ lwc1 $f4, %lo(slider_007_mode_health)($at) -/* 0421AC 7F00F7BC 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0421B0 7F00F7C0 44813000 */ mtc1 $at, $f6 -/* 0421B4 7F00F7C4 00408025 */ move $s0, $v0 -/* 0421B8 7F00F7C8 0C007614 */ jal sqrtf -/* 0421BC 7F00F7CC 46062303 */ div.s $f12, $f4, $f6 -/* 0421C0 7F00F7D0 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0421C4 7F00F7D4 44814000 */ mtc1 $at, $f8 -/* 0421C8 7F00F7D8 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 0421CC 7F00F7DC 240E0064 */ li $t6, 100 -/* 0421D0 7F00F7E0 46080282 */ mul.s $f10, $f0, $f8 -/* 0421D4 7F00F7E4 246D001C */ addiu $t5, $v1, 0x1c -/* 0421D8 7F00F7E8 AFAD0010 */ sw $t5, 0x10($sp) -/* 0421DC 7F00F7EC AFAE0014 */ sw $t6, 0x14($sp) -/* 0421E0 7F00F7F0 02002025 */ move $a0, $s0 -/* 0421E4 7F00F7F4 24050037 */ li $a1, 55 -/* 0421E8 7F00F7F8 24660011 */ addiu $a2, $v1, 0x11 -/* 0421EC 7F00F7FC 4600540D */ trunc.w.s $f16, $f10 -/* 0421F0 7F00F800 44078000 */ mfc1 $a3, $f16 -/* 0421F4 7F00F804 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0421F8 7F00F808 24E70037 */ addiu $a3, $a3, 0x37 -/* 0421FC 7F00F80C 3C0F8006 */ lui $t7, %hi(highlight_enemy_health) # $t7, 0x8006 -/* 042200 7F00F810 8DEF86D8 */ lw $t7, %lo(highlight_enemy_health)($t7) -/* 042204 7F00F814 00408025 */ move $s0, $v0 -/* 042208 7F00F818 11E0000C */ beqz $t7, .L7F00F84C -/* 04220C 7F00F81C 00000000 */ nop -/* 042210 7F00F820 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 042214 7F00F824 24190032 */ li $t9, 50 -/* 042218 7F00F828 AFB90014 */ sw $t9, 0x14($sp) -/* 04221C 7F00F82C 2478000E */ addiu $t8, $v1, 0xe -/* 042220 7F00F830 AFB80010 */ sw $t8, 0x10($sp) -/* 042224 7F00F834 00402025 */ move $a0, $v0 -/* 042228 7F00F838 24050037 */ li $a1, 55 -/* 04222C 7F00F83C 240700C7 */ li $a3, 199 -/* 042230 7F00F840 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 042234 7F00F844 2466FFFF */ addiu $a2, $v1, -1 -/* 042238 7F00F848 00408025 */ move $s0, $v0 -.L7F00F84C: -/* 04223C 7F00F84C 0C000F9B */ jal viGetX -/* 042240 7F00F850 00000000 */ nop -/* 042244 7F00F854 0C000F9F */ jal viGetY -/* 042248 7F00F858 A7A20044 */ sh $v0, 0x44($sp) -/* 04224C 7F00F85C 3C088004 */ lui $t0, %hi(ptrSecondFontTableLarge) # $t0, 0x8004 -/* 042250 7F00F860 3C098004 */ lui $t1, %hi(ptrFirstFontTableLarge) # $t1, 0x8004 -/* 042254 7F00F864 8D29AB04 */ lw $t1, %lo(ptrFirstFontTableLarge)($t1) -/* 042258 7F00F868 8D08AB08 */ lw $t0, %lo(ptrSecondFontTableLarge)($t0) -/* 04225C 7F00F86C 87AB0044 */ lh $t3, 0x44($sp) -/* 042260 7F00F870 240A00FF */ li $t2, 255 -/* 042264 7F00F874 AFAA0018 */ sw $t2, 0x18($sp) -/* 042268 7F00F878 02002025 */ move $a0, $s0 -/* 04226C 7F00F87C 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042270 7F00F880 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042274 7F00F884 8FA70C14 */ lw $a3, 0xc14($sp) -/* 042278 7F00F888 AFA20020 */ sw $v0, 0x20($sp) -/* 04227C 7F00F88C AFA00024 */ sw $zero, 0x24($sp) -/* 042280 7F00F890 AFA00028 */ sw $zero, 0x28($sp) -/* 042284 7F00F894 AFA90014 */ sw $t1, 0x14($sp) -/* 042288 7F00F898 AFA80010 */ sw $t0, 0x10($sp) -/* 04228C 7F00F89C 0FC02598 */ jal write_text_at_abs_coord -/* 042290 7F00F8A0 AFAB001C */ sw $t3, 0x1c($sp) -/* 042294 7F00F8A4 3C018002 */ lui $at, %hi(slider_007_mode_health) # $at, 0x8002 -/* 042298 7F00F8A8 C4325EF4 */ lwc1 $f18, %lo(slider_007_mode_health)($at) -/* 04229C 7F00F8AC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0422A0 7F00F8B0 44812000 */ mtc1 $at, $f4 -/* 0422A4 7F00F8B4 3C058004 */ lui $a1, %hi(aD) # $a1, 0x8004 -/* 0422A8 7F00F8B8 00408025 */ move $s0, $v0 -/* 0422AC 7F00F8BC 46049182 */ mul.s $f6, $f18, $f4 -/* 0422B0 7F00F8C0 24A5790C */ addiu $a1, %lo(aD) # addiu $a1, $a1, 0x790c -/* 0422B4 7F00F8C4 27A40054 */ addiu $a0, $sp, 0x54 -/* 0422B8 7F00F8C8 4600320D */ trunc.w.s $f8, $f6 -/* 0422BC 7F00F8CC 44064000 */ mfc1 $a2, $f8 -/* 0422C0 7F00F8D0 0C00283D */ jal sprintf -/* 0422C4 7F00F8D4 00000000 */ nop -/* 0422C8 7F00F8D8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) # $t5, 0x8004 -/* 0422CC 7F00F8DC 8DADAB04 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 0422D0 7F00F8E0 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 -/* 0422D4 7F00F8E4 AFA0004C */ sw $zero, 0x4c($sp) -/* 0422D8 7F00F8E8 AFA00050 */ sw $zero, 0x50($sp) -/* 0422DC 7F00F8EC 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 0422E0 7F00F8F0 27A40050 */ addiu $a0, $sp, 0x50 -/* 0422E4 7F00F8F4 27A5004C */ addiu $a1, $sp, 0x4c -/* 0422E8 7F00F8F8 27A60054 */ addiu $a2, $sp, 0x54 -/* 0422EC 7F00F8FC AFA00014 */ sw $zero, 0x14($sp) -/* 0422F0 7F00F900 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 0422F4 7F00F904 AFAD0010 */ sw $t5, 0x10($sp) -/* 0422F8 7F00F908 8FAE004C */ lw $t6, 0x4c($sp) -/* 0422FC 7F00F90C 240F011D */ li $t7, 285 -/* 042300 7F00F910 240300A4 */ li $v1, 164 -/* 042304 7F00F914 01EEC023 */ subu $t8, $t7, $t6 -/* 042308 7F00F918 AFB80C10 */ sw $t8, 0xc10($sp) -/* 04230C 7F00F91C 0C000F9B */ jal viGetX -/* 042310 7F00F920 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042314 7F00F924 0C000F9F */ jal viGetY -/* 042318 7F00F928 A7A20044 */ sh $v0, 0x44($sp) -/* 04231C 7F00F92C 3C198004 */ lui $t9, %hi(ptrSecondFontTableLarge) # $t9, 0x8004 -/* 042320 7F00F930 3C088004 */ lui $t0, %hi(ptrFirstFontTableLarge) # $t0, 0x8004 -/* 042324 7F00F934 8D08AB04 */ lw $t0, %lo(ptrFirstFontTableLarge)($t0) -/* 042328 7F00F938 8F39AB08 */ lw $t9, %lo(ptrSecondFontTableLarge)($t9) -/* 04232C 7F00F93C 87AA0044 */ lh $t2, 0x44($sp) -/* 042330 7F00F940 240900FF */ li $t1, 255 -/* 042334 7F00F944 AFA90018 */ sw $t1, 0x18($sp) -/* 042338 7F00F948 02002025 */ move $a0, $s0 -/* 04233C 7F00F94C 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042340 7F00F950 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042344 7F00F954 27A70054 */ addiu $a3, $sp, 0x54 -/* 042348 7F00F958 AFA20020 */ sw $v0, 0x20($sp) -/* 04234C 7F00F95C AFA00024 */ sw $zero, 0x24($sp) -/* 042350 7F00F960 AFA00028 */ sw $zero, 0x28($sp) -/* 042354 7F00F964 AFA80014 */ sw $t0, 0x14($sp) -/* 042358 7F00F968 AFB90010 */ sw $t9, 0x10($sp) -/* 04235C 7F00F96C 0FC02598 */ jal write_text_at_abs_coord -/* 042360 7F00F970 AFAA001C */ sw $t2, 0x1c($sp) -/* 042364 7F00F974 00408025 */ move $s0, $v0 -/* 042368 7F00F978 0FC304AE */ jal langGet -/* 04236C 7F00F97C 34049C2B */ li $a0, 39979 -/* 042370 7F00F980 240B0039 */ li $t3, 57 -/* 042374 7F00F984 240300C5 */ li $v1, 197 -/* 042378 7F00F988 240C00E1 */ li $t4, 225 -/* 04237C 7F00F98C 240D0032 */ li $t5, 50 -/* 042380 7F00F990 AFA20C14 */ sw $v0, 0xc14($sp) -/* 042384 7F00F994 AFAB0C10 */ sw $t3, 0xc10($sp) -/* 042388 7F00F998 AFAD0014 */ sw $t5, 0x14($sp) -/* 04238C 7F00F99C AFAC0010 */ sw $t4, 0x10($sp) -/* 042390 7F00F9A0 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042394 7F00F9A4 02002025 */ move $a0, $s0 -/* 042398 7F00F9A8 24050037 */ li $a1, 55 -/* 04239C 7F00F9AC 240600D6 */ li $a2, 214 -/* 0423A0 7F00F9B0 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0423A4 7F00F9B4 24070163 */ li $a3, 355 -/* 0423A8 7F00F9B8 3C018002 */ lui $at, %hi(slider_007_mode_accuracy) # $at, 0x8002 -/* 0423AC 7F00F9BC C42A5EF8 */ lwc1 $f10, %lo(slider_007_mode_accuracy)($at) -/* 0423B0 7F00F9C0 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0423B4 7F00F9C4 44818000 */ mtc1 $at, $f16 -/* 0423B8 7F00F9C8 00408025 */ move $s0, $v0 -/* 0423BC 7F00F9CC 0C007614 */ jal sqrtf -/* 0423C0 7F00F9D0 46105303 */ div.s $f12, $f10, $f16 -/* 0423C4 7F00F9D4 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0423C8 7F00F9D8 44819000 */ mtc1 $at, $f18 -/* 0423CC 7F00F9DC 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 0423D0 7F00F9E0 24180064 */ li $t8, 100 -/* 0423D4 7F00F9E4 46120102 */ mul.s $f4, $f0, $f18 -/* 0423D8 7F00F9E8 246E001C */ addiu $t6, $v1, 0x1c -/* 0423DC 7F00F9EC AFAE0010 */ sw $t6, 0x10($sp) -/* 0423E0 7F00F9F0 AFB80014 */ sw $t8, 0x14($sp) -/* 0423E4 7F00F9F4 02002025 */ move $a0, $s0 -/* 0423E8 7F00F9F8 24050037 */ li $a1, 55 -/* 0423EC 7F00F9FC 24660011 */ addiu $a2, $v1, 0x11 -/* 0423F0 7F00FA00 4600218D */ trunc.w.s $f6, $f4 -/* 0423F4 7F00FA04 44073000 */ mfc1 $a3, $f6 -/* 0423F8 7F00FA08 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0423FC 7F00FA0C 24E70037 */ addiu $a3, $a3, 0x37 -/* 042400 7F00FA10 3C198006 */ lui $t9, %hi(highlight_enemy_accuracy) # $t9, 0x8006 -/* 042404 7F00FA14 8F3986DC */ lw $t9, %lo(highlight_enemy_accuracy)($t9) -/* 042408 7F00FA18 00408025 */ move $s0, $v0 -/* 04240C 7F00FA1C 1320000C */ beqz $t9, .L7F00FA50 -/* 042410 7F00FA20 00000000 */ nop -/* 042414 7F00FA24 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 042418 7F00FA28 24090032 */ li $t1, 50 -/* 04241C 7F00FA2C AFA90014 */ sw $t1, 0x14($sp) -/* 042420 7F00FA30 2468000E */ addiu $t0, $v1, 0xe -/* 042424 7F00FA34 AFA80010 */ sw $t0, 0x10($sp) -/* 042428 7F00FA38 00402025 */ move $a0, $v0 -/* 04242C 7F00FA3C 24050037 */ li $a1, 55 -/* 042430 7F00FA40 240700C7 */ li $a3, 199 -/* 042434 7F00FA44 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 042438 7F00FA48 2466FFFF */ addiu $a2, $v1, -1 -/* 04243C 7F00FA4C 00408025 */ move $s0, $v0 -.L7F00FA50: -/* 042440 7F00FA50 0C000F9B */ jal viGetX -/* 042444 7F00FA54 00000000 */ nop -/* 042448 7F00FA58 0C000F9F */ jal viGetY -/* 04244C 7F00FA5C A7A20044 */ sh $v0, 0x44($sp) -/* 042450 7F00FA60 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableLarge) # $t2, 0x8004 -/* 042454 7F00FA64 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableLarge) # $t3, 0x8004 -/* 042458 7F00FA68 8D6BAB04 */ lw $t3, %lo(ptrFirstFontTableLarge)($t3) -/* 04245C 7F00FA6C 8D4AAB08 */ lw $t2, %lo(ptrSecondFontTableLarge)($t2) -/* 042460 7F00FA70 87AD0044 */ lh $t5, 0x44($sp) -/* 042464 7F00FA74 240C00FF */ li $t4, 255 -/* 042468 7F00FA78 AFAC0018 */ sw $t4, 0x18($sp) -/* 04246C 7F00FA7C 02002025 */ move $a0, $s0 -/* 042470 7F00FA80 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042474 7F00FA84 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042478 7F00FA88 8FA70C14 */ lw $a3, 0xc14($sp) -/* 04247C 7F00FA8C AFA20020 */ sw $v0, 0x20($sp) -/* 042480 7F00FA90 AFA00024 */ sw $zero, 0x24($sp) -/* 042484 7F00FA94 AFA00028 */ sw $zero, 0x28($sp) -/* 042488 7F00FA98 AFAB0014 */ sw $t3, 0x14($sp) -/* 04248C 7F00FA9C AFAA0010 */ sw $t2, 0x10($sp) -/* 042490 7F00FAA0 0FC02598 */ jal write_text_at_abs_coord -/* 042494 7F00FAA4 AFAD001C */ sw $t5, 0x1c($sp) -/* 042498 7F00FAA8 3C018002 */ lui $at, %hi(slider_007_mode_accuracy) # $at, 0x8002 -/* 04249C 7F00FAAC C4285EF8 */ lwc1 $f8, %lo(slider_007_mode_accuracy)($at) -/* 0424A0 7F00FAB0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0424A4 7F00FAB4 44815000 */ mtc1 $at, $f10 -/* 0424A8 7F00FAB8 3C058004 */ lui $a1, %hi(aD_0) # $a1, 0x8004 -/* 0424AC 7F00FABC 00408025 */ move $s0, $v0 -/* 0424B0 7F00FAC0 460A4402 */ mul.s $f16, $f8, $f10 -/* 0424B4 7F00FAC4 24A57914 */ addiu $a1, %lo(aD_0) # addiu $a1, $a1, 0x7914 -/* 0424B8 7F00FAC8 27A40054 */ addiu $a0, $sp, 0x54 -/* 0424BC 7F00FACC 4600848D */ trunc.w.s $f18, $f16 -/* 0424C0 7F00FAD0 44069000 */ mfc1 $a2, $f18 -/* 0424C4 7F00FAD4 0C00283D */ jal sprintf -/* 0424C8 7F00FAD8 00000000 */ nop -/* 0424CC 7F00FADC 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) # $t6, 0x8004 -/* 0424D0 7F00FAE0 8DCEAB04 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 0424D4 7F00FAE4 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 -/* 0424D8 7F00FAE8 AFA0004C */ sw $zero, 0x4c($sp) -/* 0424DC 7F00FAEC AFA00050 */ sw $zero, 0x50($sp) -/* 0424E0 7F00FAF0 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 0424E4 7F00FAF4 27A40050 */ addiu $a0, $sp, 0x50 -/* 0424E8 7F00FAF8 27A5004C */ addiu $a1, $sp, 0x4c -/* 0424EC 7F00FAFC 27A60054 */ addiu $a2, $sp, 0x54 -/* 0424F0 7F00FB00 AFA00014 */ sw $zero, 0x14($sp) -/* 0424F4 7F00FB04 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 0424F8 7F00FB08 AFAE0010 */ sw $t6, 0x10($sp) -/* 0424FC 7F00FB0C 8FB8004C */ lw $t8, 0x4c($sp) -/* 042500 7F00FB10 2419011D */ li $t9, 285 -/* 042504 7F00FB14 240300C5 */ li $v1, 197 -/* 042508 7F00FB18 03384023 */ subu $t0, $t9, $t8 -/* 04250C 7F00FB1C AFA80C10 */ sw $t0, 0xc10($sp) -/* 042510 7F00FB20 0C000F9B */ jal viGetX -/* 042514 7F00FB24 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042518 7F00FB28 0C000F9F */ jal viGetY -/* 04251C 7F00FB2C A7A20044 */ sh $v0, 0x44($sp) -/* 042520 7F00FB30 3C098004 */ lui $t1, %hi(ptrSecondFontTableLarge) # $t1, 0x8004 -/* 042524 7F00FB34 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableLarge) # $t2, 0x8004 -/* 042528 7F00FB38 8D4AAB04 */ lw $t2, %lo(ptrFirstFontTableLarge)($t2) -/* 04252C 7F00FB3C 8D29AB08 */ lw $t1, %lo(ptrSecondFontTableLarge)($t1) -/* 042530 7F00FB40 87AC0044 */ lh $t4, 0x44($sp) -/* 042534 7F00FB44 240B00FF */ li $t3, 255 -/* 042538 7F00FB48 AFAB0018 */ sw $t3, 0x18($sp) -/* 04253C 7F00FB4C 02002025 */ move $a0, $s0 -/* 042540 7F00FB50 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042544 7F00FB54 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042548 7F00FB58 27A70054 */ addiu $a3, $sp, 0x54 -/* 04254C 7F00FB5C AFA20020 */ sw $v0, 0x20($sp) -/* 042550 7F00FB60 AFA00024 */ sw $zero, 0x24($sp) -/* 042554 7F00FB64 AFA00028 */ sw $zero, 0x28($sp) -/* 042558 7F00FB68 AFAA0014 */ sw $t2, 0x14($sp) -/* 04255C 7F00FB6C AFA90010 */ sw $t1, 0x10($sp) -/* 042560 7F00FB70 0FC02598 */ jal write_text_at_abs_coord -/* 042564 7F00FB74 AFAC001C */ sw $t4, 0x1c($sp) -/* 042568 7F00FB78 00408025 */ move $s0, $v0 -/* 04256C 7F00FB7C 0FC304AE */ jal langGet -/* 042570 7F00FB80 34049C2C */ li $a0, 39980 -/* 042574 7F00FB84 240D0039 */ li $t5, 57 -/* 042578 7F00FB88 240300E6 */ li $v1, 230 -/* 04257C 7F00FB8C 240F0102 */ li $t7, 258 -/* 042580 7F00FB90 240E0032 */ li $t6, 50 -/* 042584 7F00FB94 AFA20C14 */ sw $v0, 0xc14($sp) -/* 042588 7F00FB98 AFAD0C10 */ sw $t5, 0xc10($sp) -/* 04258C 7F00FB9C AFAE0014 */ sw $t6, 0x14($sp) -/* 042590 7F00FBA0 AFAF0010 */ sw $t7, 0x10($sp) -/* 042594 7F00FBA4 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042598 7F00FBA8 02002025 */ move $a0, $s0 -/* 04259C 7F00FBAC 24050037 */ li $a1, 55 -/* 0425A0 7F00FBB0 240600F7 */ li $a2, 247 -/* 0425A4 7F00FBB4 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0425A8 7F00FBB8 24070163 */ li $a3, 355 -/* 0425AC 7F00FBBC 3C018002 */ lui $at, %hi(slider_007_mode_damage) # $at, 0x8002 -/* 0425B0 7F00FBC0 C4245EFC */ lwc1 $f4, %lo(slider_007_mode_damage)($at) -/* 0425B4 7F00FBC4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0425B8 7F00FBC8 44813000 */ mtc1 $at, $f6 -/* 0425BC 7F00FBCC 00408025 */ move $s0, $v0 -/* 0425C0 7F00FBD0 0C007614 */ jal sqrtf -/* 0425C4 7F00FBD4 46062303 */ div.s $f12, $f4, $f6 -/* 0425C8 7F00FBD8 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0425CC 7F00FBDC 44814000 */ mtc1 $at, $f8 -/* 0425D0 7F00FBE0 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 0425D4 7F00FBE4 24080064 */ li $t0, 100 -/* 0425D8 7F00FBE8 46080282 */ mul.s $f10, $f0, $f8 -/* 0425DC 7F00FBEC 2478001C */ addiu $t8, $v1, 0x1c -/* 0425E0 7F00FBF0 AFB80010 */ sw $t8, 0x10($sp) -/* 0425E4 7F00FBF4 AFA80014 */ sw $t0, 0x14($sp) -/* 0425E8 7F00FBF8 02002025 */ move $a0, $s0 -/* 0425EC 7F00FBFC 24050037 */ li $a1, 55 -/* 0425F0 7F00FC00 24660011 */ addiu $a2, $v1, 0x11 -/* 0425F4 7F00FC04 4600540D */ trunc.w.s $f16, $f10 -/* 0425F8 7F00FC08 44078000 */ mfc1 $a3, $f16 -/* 0425FC 7F00FC0C 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 042600 7F00FC10 24E70037 */ addiu $a3, $a3, 0x37 -/* 042604 7F00FC14 3C098006 */ lui $t1, %hi(highlight_enemy_damage) # $t1, 0x8006 -/* 042608 7F00FC18 8D2986E0 */ lw $t1, %lo(highlight_enemy_damage)($t1) -/* 04260C 7F00FC1C 00408025 */ move $s0, $v0 -/* 042610 7F00FC20 1120000C */ beqz $t1, .L7F00FC54 -/* 042614 7F00FC24 00000000 */ nop -/* 042618 7F00FC28 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 04261C 7F00FC2C 240B0032 */ li $t3, 50 -/* 042620 7F00FC30 AFAB0014 */ sw $t3, 0x14($sp) -/* 042624 7F00FC34 246A000E */ addiu $t2, $v1, 0xe -/* 042628 7F00FC38 AFAA0010 */ sw $t2, 0x10($sp) -/* 04262C 7F00FC3C 00402025 */ move $a0, $v0 -/* 042630 7F00FC40 24050037 */ li $a1, 55 -/* 042634 7F00FC44 240700C7 */ li $a3, 199 -/* 042638 7F00FC48 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 04263C 7F00FC4C 2466FFFF */ addiu $a2, $v1, -1 -/* 042640 7F00FC50 00408025 */ move $s0, $v0 -.L7F00FC54: -/* 042644 7F00FC54 0C000F9B */ jal viGetX -/* 042648 7F00FC58 00000000 */ nop -/* 04264C 7F00FC5C 0C000F9F */ jal viGetY -/* 042650 7F00FC60 A7A20044 */ sh $v0, 0x44($sp) -/* 042654 7F00FC64 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableLarge) # $t4, 0x8004 -/* 042658 7F00FC68 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) # $t5, 0x8004 -/* 04265C 7F00FC6C 8DADAB04 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 042660 7F00FC70 8D8CAB08 */ lw $t4, %lo(ptrSecondFontTableLarge)($t4) -/* 042664 7F00FC74 87AE0044 */ lh $t6, 0x44($sp) -/* 042668 7F00FC78 240F00FF */ li $t7, 255 -/* 04266C 7F00FC7C AFAF0018 */ sw $t7, 0x18($sp) -/* 042670 7F00FC80 02002025 */ move $a0, $s0 -/* 042674 7F00FC84 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042678 7F00FC88 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 04267C 7F00FC8C 8FA70C14 */ lw $a3, 0xc14($sp) -/* 042680 7F00FC90 AFA20020 */ sw $v0, 0x20($sp) -/* 042684 7F00FC94 AFA00024 */ sw $zero, 0x24($sp) -/* 042688 7F00FC98 AFA00028 */ sw $zero, 0x28($sp) -/* 04268C 7F00FC9C AFAD0014 */ sw $t5, 0x14($sp) -/* 042690 7F00FCA0 AFAC0010 */ sw $t4, 0x10($sp) -/* 042694 7F00FCA4 0FC02598 */ jal write_text_at_abs_coord -/* 042698 7F00FCA8 AFAE001C */ sw $t6, 0x1c($sp) -/* 04269C 7F00FCAC 3C018002 */ lui $at, %hi(slider_007_mode_damage) # $at, 0x8002 -/* 0426A0 7F00FCB0 C4325EFC */ lwc1 $f18, %lo(slider_007_mode_damage)($at) -/* 0426A4 7F00FCB4 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 0426A8 7F00FCB8 44812000 */ mtc1 $at, $f4 -/* 0426AC 7F00FCBC 3C058004 */ lui $a1, %hi(aD_1) # $a1, 0x8004 -/* 0426B0 7F00FCC0 00408025 */ move $s0, $v0 -/* 0426B4 7F00FCC4 46049182 */ mul.s $f6, $f18, $f4 -/* 0426B8 7F00FCC8 24A5791C */ addiu $a1, %lo(aD_1) # addiu $a1, $a1, 0x791c -/* 0426BC 7F00FCCC 27A40054 */ addiu $a0, $sp, 0x54 -/* 0426C0 7F00FCD0 4600320D */ trunc.w.s $f8, $f6 -/* 0426C4 7F00FCD4 44064000 */ mfc1 $a2, $f8 -/* 0426C8 7F00FCD8 0C00283D */ jal sprintf -/* 0426CC 7F00FCDC 00000000 */ nop -/* 0426D0 7F00FCE0 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) # $t8, 0x8004 -/* 0426D4 7F00FCE4 8F18AB04 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) -/* 0426D8 7F00FCE8 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 -/* 0426DC 7F00FCEC AFA0004C */ sw $zero, 0x4c($sp) -/* 0426E0 7F00FCF0 AFA00050 */ sw $zero, 0x50($sp) -/* 0426E4 7F00FCF4 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 0426E8 7F00FCF8 27A40050 */ addiu $a0, $sp, 0x50 -/* 0426EC 7F00FCFC 27A5004C */ addiu $a1, $sp, 0x4c -/* 0426F0 7F00FD00 27A60054 */ addiu $a2, $sp, 0x54 -/* 0426F4 7F00FD04 AFA00014 */ sw $zero, 0x14($sp) -/* 0426F8 7F00FD08 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 0426FC 7F00FD0C AFB80010 */ sw $t8, 0x10($sp) -/* 042700 7F00FD10 8FA8004C */ lw $t0, 0x4c($sp) -/* 042704 7F00FD14 2409011D */ li $t1, 285 -/* 042708 7F00FD18 240300E6 */ li $v1, 230 -/* 04270C 7F00FD1C 01285023 */ subu $t2, $t1, $t0 -/* 042710 7F00FD20 AFAA0C10 */ sw $t2, 0xc10($sp) -/* 042714 7F00FD24 0C000F9B */ jal viGetX -/* 042718 7F00FD28 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 04271C 7F00FD2C 0C000F9F */ jal viGetY -/* 042720 7F00FD30 A7A20044 */ sh $v0, 0x44($sp) -/* 042724 7F00FD34 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableLarge) # $t3, 0x8004 -/* 042728 7F00FD38 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableLarge) # $t4, 0x8004 -/* 04272C 7F00FD3C 8D8CAB04 */ lw $t4, %lo(ptrFirstFontTableLarge)($t4) -/* 042730 7F00FD40 8D6BAB08 */ lw $t3, %lo(ptrSecondFontTableLarge)($t3) -/* 042734 7F00FD44 87AF0044 */ lh $t7, 0x44($sp) -/* 042738 7F00FD48 240D00FF */ li $t5, 255 -/* 04273C 7F00FD4C AFAD0018 */ sw $t5, 0x18($sp) -/* 042740 7F00FD50 02002025 */ move $a0, $s0 -/* 042744 7F00FD54 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042748 7F00FD58 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 04274C 7F00FD5C 27A70054 */ addiu $a3, $sp, 0x54 -/* 042750 7F00FD60 AFA20020 */ sw $v0, 0x20($sp) -/* 042754 7F00FD64 AFA00024 */ sw $zero, 0x24($sp) -/* 042758 7F00FD68 AFA00028 */ sw $zero, 0x28($sp) -/* 04275C 7F00FD6C AFAC0014 */ sw $t4, 0x14($sp) -/* 042760 7F00FD70 AFAB0010 */ sw $t3, 0x10($sp) -/* 042764 7F00FD74 0FC02598 */ jal write_text_at_abs_coord -/* 042768 7F00FD78 AFAF001C */ sw $t7, 0x1c($sp) -/* 04276C 7F00FD7C 00408025 */ move $s0, $v0 -/* 042770 7F00FD80 0FC304AE */ jal langGet -/* 042774 7F00FD84 34049C29 */ li $a0, 39977 -/* 042778 7F00FD88 240E0039 */ li $t6, 57 -/* 04277C 7F00FD8C 24030107 */ li $v1, 263 -/* 042780 7F00FD90 24190123 */ li $t9, 291 -/* 042784 7F00FD94 24180032 */ li $t8, 50 -/* 042788 7F00FD98 AFA20C14 */ sw $v0, 0xc14($sp) -/* 04278C 7F00FD9C AFAE0C10 */ sw $t6, 0xc10($sp) -/* 042790 7F00FDA0 AFB80014 */ sw $t8, 0x14($sp) -/* 042794 7F00FDA4 AFB90010 */ sw $t9, 0x10($sp) -/* 042798 7F00FDA8 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 04279C 7F00FDAC 02002025 */ move $a0, $s0 -/* 0427A0 7F00FDB0 24050037 */ li $a1, 55 -/* 0427A4 7F00FDB4 24060118 */ li $a2, 280 -/* 0427A8 7F00FDB8 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0427AC 7F00FDBC 24070163 */ li $a3, 355 -/* 0427B0 7F00FDC0 3C018002 */ lui $at, %hi(slider_007_mode_reaction) # $at, 0x8002 -/* 0427B4 7F00FDC4 C42A5EF0 */ lwc1 $f10, %lo(slider_007_mode_reaction)($at) -/* 0427B8 7F00FDC8 3C014396 */ li $at, 0x43960000 # 300.000000 -/* 0427BC 7F00FDCC 44818000 */ mtc1 $at, $f16 -/* 0427C0 7F00FDD0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0427C4 7F00FDD4 44812000 */ mtc1 $at, $f4 -/* 0427C8 7F00FDD8 46105482 */ mul.s $f18, $f10, $f16 -/* 0427CC 7F00FDDC 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 0427D0 7F00FDE0 240A0064 */ li $t2, 100 -/* 0427D4 7F00FDE4 AFAA0014 */ sw $t2, 0x14($sp) -/* 0427D8 7F00FDE8 2468001C */ addiu $t0, $v1, 0x1c -/* 0427DC 7F00FDEC AFA80010 */ sw $t0, 0x10($sp) -/* 0427E0 7F00FDF0 00402025 */ move $a0, $v0 -/* 0427E4 7F00FDF4 46049182 */ mul.s $f6, $f18, $f4 -/* 0427E8 7F00FDF8 24050037 */ li $a1, 55 -/* 0427EC 7F00FDFC 24660011 */ addiu $a2, $v1, 0x11 -/* 0427F0 7F00FE00 4600320D */ trunc.w.s $f8, $f6 -/* 0427F4 7F00FE04 44074000 */ mfc1 $a3, $f8 -/* 0427F8 7F00FE08 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 0427FC 7F00FE0C 24E70037 */ addiu $a3, $a3, 0x37 -/* 042800 7F00FE10 3C0B8006 */ lui $t3, %hi(highlight_enemy_reaction) # $t3, 0x8006 -/* 042804 7F00FE14 8D6B86D4 */ lw $t3, %lo(highlight_enemy_reaction)($t3) -/* 042808 7F00FE18 00408025 */ move $s0, $v0 -/* 04280C 7F00FE1C 1160000C */ beqz $t3, .L7F00FE50 -/* 042810 7F00FE20 00000000 */ nop -/* 042814 7F00FE24 8FA30C0C */ lw $v1, 0xc0c($sp) -/* 042818 7F00FE28 240D0032 */ li $t5, 50 -/* 04281C 7F00FE2C AFAD0014 */ sw $t5, 0x14($sp) -/* 042820 7F00FE30 246C000E */ addiu $t4, $v1, 0xe -/* 042824 7F00FE34 AFAC0010 */ sw $t4, 0x10($sp) -/* 042828 7F00FE38 00402025 */ move $a0, $v0 -/* 04282C 7F00FE3C 24050037 */ li $a1, 55 -/* 042830 7F00FE40 240700C7 */ li $a3, 199 -/* 042834 7F00FE44 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 042838 7F00FE48 2466FFFF */ addiu $a2, $v1, -1 -/* 04283C 7F00FE4C 00408025 */ move $s0, $v0 -.L7F00FE50: -/* 042840 7F00FE50 0C000F9B */ jal viGetX -/* 042844 7F00FE54 00000000 */ nop -/* 042848 7F00FE58 0C000F9F */ jal viGetY -/* 04284C 7F00FE5C A7A20044 */ sh $v0, 0x44($sp) -/* 042850 7F00FE60 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableLarge) # $t7, 0x8004 -/* 042854 7F00FE64 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) # $t6, 0x8004 -/* 042858 7F00FE68 8DCEAB04 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 04285C 7F00FE6C 8DEFAB08 */ lw $t7, %lo(ptrSecondFontTableLarge)($t7) -/* 042860 7F00FE70 87B80044 */ lh $t8, 0x44($sp) -/* 042864 7F00FE74 241900FF */ li $t9, 255 -/* 042868 7F00FE78 AFB90018 */ sw $t9, 0x18($sp) -/* 04286C 7F00FE7C 02002025 */ move $a0, $s0 -/* 042870 7F00FE80 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042874 7F00FE84 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042878 7F00FE88 8FA70C14 */ lw $a3, 0xc14($sp) -/* 04287C 7F00FE8C AFA20020 */ sw $v0, 0x20($sp) -/* 042880 7F00FE90 AFA00024 */ sw $zero, 0x24($sp) -/* 042884 7F00FE94 AFA00028 */ sw $zero, 0x28($sp) -/* 042888 7F00FE98 AFAE0014 */ sw $t6, 0x14($sp) -/* 04288C 7F00FE9C AFAF0010 */ sw $t7, 0x10($sp) -/* 042890 7F00FEA0 0FC02598 */ jal write_text_at_abs_coord -/* 042894 7F00FEA4 AFB8001C */ sw $t8, 0x1c($sp) -/* 042898 7F00FEA8 3C018002 */ lui $at, %hi(slider_007_mode_reaction) # $at, 0x8002 -/* 04289C 7F00FEAC C42A5EF0 */ lwc1 $f10, %lo(slider_007_mode_reaction)($at) -/* 0428A0 7F00FEB0 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0428A4 7F00FEB4 44818000 */ mtc1 $at, $f16 -/* 0428A8 7F00FEB8 3C058004 */ lui $a1, %hi(aD_2) # $a1, 0x8004 -/* 0428AC 7F00FEBC 00408025 */ move $s0, $v0 -/* 0428B0 7F00FEC0 46105482 */ mul.s $f18, $f10, $f16 -/* 0428B4 7F00FEC4 24A57924 */ addiu $a1, %lo(aD_2) # addiu $a1, $a1, 0x7924 -/* 0428B8 7F00FEC8 27A40054 */ addiu $a0, $sp, 0x54 -/* 0428BC 7F00FECC 4600910D */ trunc.w.s $f4, $f18 -/* 0428C0 7F00FED0 44062000 */ mfc1 $a2, $f4 -/* 0428C4 7F00FED4 0C00283D */ jal sprintf -/* 0428C8 7F00FED8 00000000 */ nop -/* 0428CC 7F00FEDC 3C088004 */ lui $t0, %hi(ptrFirstFontTableLarge) # $t0, 0x8004 -/* 0428D0 7F00FEE0 8D08AB04 */ lw $t0, %lo(ptrFirstFontTableLarge)($t0) -/* 0428D4 7F00FEE4 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 -/* 0428D8 7F00FEE8 AFA0004C */ sw $zero, 0x4c($sp) -/* 0428DC 7F00FEEC AFA00050 */ sw $zero, 0x50($sp) -/* 0428E0 7F00FEF0 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 0428E4 7F00FEF4 27A40050 */ addiu $a0, $sp, 0x50 -/* 0428E8 7F00FEF8 27A5004C */ addiu $a1, $sp, 0x4c -/* 0428EC 7F00FEFC 27A60054 */ addiu $a2, $sp, 0x54 -/* 0428F0 7F00FF00 AFA00014 */ sw $zero, 0x14($sp) -/* 0428F4 7F00FF04 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 0428F8 7F00FF08 AFA80010 */ sw $t0, 0x10($sp) -/* 0428FC 7F00FF0C 8FAA004C */ lw $t2, 0x4c($sp) -/* 042900 7F00FF10 240B011D */ li $t3, 285 -/* 042904 7F00FF14 24030107 */ li $v1, 263 -/* 042908 7F00FF18 016A6023 */ subu $t4, $t3, $t2 -/* 04290C 7F00FF1C AFAC0C10 */ sw $t4, 0xc10($sp) -/* 042910 7F00FF20 0C000F9B */ jal viGetX -/* 042914 7F00FF24 AFA30C0C */ sw $v1, 0xc0c($sp) -/* 042918 7F00FF28 0C000F9F */ jal viGetY -/* 04291C 7F00FF2C A7A20044 */ sh $v0, 0x44($sp) -/* 042920 7F00FF30 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableLarge) # $t5, 0x8004 -/* 042924 7F00FF34 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) # $t7, 0x8004 -/* 042928 7F00FF38 8DEFAB04 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) -/* 04292C 7F00FF3C 8DADAB08 */ lw $t5, %lo(ptrSecondFontTableLarge)($t5) -/* 042930 7F00FF40 87B90044 */ lh $t9, 0x44($sp) -/* 042934 7F00FF44 240E00FF */ li $t6, 255 -/* 042938 7F00FF48 AFAE0018 */ sw $t6, 0x18($sp) -/* 04293C 7F00FF4C 02002025 */ move $a0, $s0 -/* 042940 7F00FF50 27A50C10 */ addiu $a1, $sp, 0xc10 -/* 042944 7F00FF54 27A60C0C */ addiu $a2, $sp, 0xc0c -/* 042948 7F00FF58 27A70054 */ addiu $a3, $sp, 0x54 -/* 04294C 7F00FF5C AFA20020 */ sw $v0, 0x20($sp) -/* 042950 7F00FF60 AFA00024 */ sw $zero, 0x24($sp) -/* 042954 7F00FF64 AFA00028 */ sw $zero, 0x28($sp) -/* 042958 7F00FF68 AFAF0014 */ sw $t7, 0x14($sp) -/* 04295C 7F00FF6C AFAD0010 */ sw $t5, 0x10($sp) -/* 042960 7F00FF70 0FC02598 */ jal write_text_at_abs_coord -/* 042964 7F00FF74 AFB9001C */ sw $t9, 0x1c($sp) -/* 042968 7F00FF78 0FC027E0 */ jal add_tab1_start -/* 04296C 7F00FF7C 00402025 */ move $a0, $v0 -/* 042970 7F00FF80 0FC0284E */ jal add_tab3_previous -/* 042974 7F00FF84 00402025 */ move $a0, $v0 -/* 042978 7F00FF88 0FC028C5 */ jal add_tab2_next -/* 04297C 7F00FF8C 00402025 */ move $a0, $v0 -/* 042980 7F00FF90 0FC02782 */ jal load_draw_selected_icon_folder_select -/* 042984 7F00FF94 00402025 */ move $a0, $v0 -/* 042988 7F00FF98 8FBF003C */ lw $ra, 0x3c($sp) -/* 04298C 7F00FF9C 8FB00038 */ lw $s0, 0x38($sp) -/* 042990 7F00FFA0 27BD0C18 */ addiu $sp, $sp, 0xc18 -/* 042994 7F00FFA4 03E00008 */ jr $ra -/* 042998 7F00FFA8 00000000 */ nop -) -#endif -#endif + DL = write_text_at_abs_coord(DL, &spC10, &spC0C, (s8*)&sp54, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + DL = add_tab1_start(DL); + DL = add_tab3_previous(DL); + DL = add_tab2_next(DL); + DL = load_draw_selected_icon_folder_select(DL); + + return DL; +} @@ -9965,11 +4177,8 @@ void reset_mp_options_for_scenario(MPSCENARIOS scenarioid) - - -#ifdef NONMATCHING -//come back once i fix player_#_char to be array -void init_mp_options_for_scenario(u32 numplayers) +// Address 0x7F010608 NTSC +void init_mp_options_for_scenario(s32 numplayers) { s32 i; @@ -9977,122 +4186,34 @@ void init_mp_options_for_scenario(u32 numplayers) { numplayers = 2; } + selected_num_players = numplayers; - for (i=0; i < numplayers; i++) + for (i=0; i < selected_num_players; i++) { if (player_char[i] == -1) { player_char[i] = i; player_handicap[i] = 5; } - if ((numplayers >= 3) && (&controlstyle_player[i] >= CONTROLLER_CONFIG_PLENTY)) + + if ((numplayers >= 3) && (controlstyle_player[i] >= CONTROLLER_CONFIG_PLENTY)) { - &controlstyle_player[i] = CONTROLLER_CONFIG_HONEY; + controlstyle_player[i] = CONTROLLER_CONFIG_HONEY; } } - if ((mp_player_counts[scenario].max < numplayers) || (numplayers < mp_player_counts[scenario].min)) + + if ((mp_player_counts[scenario].max < selected_num_players) || (selected_num_players < mp_player_counts[scenario].min)) { reset_mp_options_for_scenario(SCENARIO_NORMAL); - numplayers = selected_num_players; + } - if (multi_stage_setups[MP_stage_selected].max_player < numplayers) + + if (multi_stage_setups[MP_stage_selected].max_player < selected_num_players) { MP_stage_selected = MP_STAGE_TEMPLE; } } -#else -GLOBAL_ASM( -.text -glabel init_mp_options_for_scenario -/* 045138 7F010608 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 04513C 7F01060C AFB00018 */ sw $s0, 0x18($sp) -/* 045140 7F010610 28810002 */ slti $at, $a0, 2 -/* 045144 7F010614 00808025 */ move $s0, $a0 -/* 045148 7F010618 10200002 */ beqz $at, .L7F010624 -/* 04514C 7F01061C AFBF001C */ sw $ra, 0x1c($sp) -/* 045150 7F010620 24100002 */ li $s0, 2 -.L7F010624: -/* 045154 7F010624 3C028003 */ lui $v0, %hi(selected_num_players) -/* 045158 7F010628 2442B520 */ addiu $v0, %lo(selected_num_players) # addiu $v0, $v0, -0x4ae0 -/* 04515C 7F01062C AC500000 */ sw $s0, ($v0) -/* 045160 7F010630 00001825 */ move $v1, $zero -/* 045164 7F010634 1A00001C */ blez $s0, .L7F0106A8 -/* 045168 7F010638 02003025 */ move $a2, $s0 -/* 04516C 7F01063C 3C058003 */ lui $a1, %hi(player_char) -/* 045170 7F010640 3C0A8007 */ lui $t2, %hi(controlstyle_player) -/* 045174 7F010644 3C088007 */ lui $t0, %hi(player_handicap) -/* 045178 7F010648 250897A8 */ addiu $t0, %lo(player_handicap) # addiu $t0, $t0, -0x6858 -/* 04517C 7F01064C 254A97B8 */ addiu $t2, %lo(controlstyle_player) # addiu $t2, $t2, -0x6848 -/* 045180 7F010650 24A5B524 */ addiu $a1, %lo(player_char) # addiu $a1, $a1, -0x4adc -/* 045184 7F010654 00002025 */ move $a0, $zero -/* 045188 7F010658 24090005 */ li $t1, 5 -/* 04518C 7F01065C 2407FFFF */ li $a3, -1 -.L7F010660: -/* 045190 7F010660 8CAE0000 */ lw $t6, ($a1) -/* 045194 7F010664 01047821 */ addu $t7, $t0, $a0 -/* 045198 7F010668 2A010003 */ slti $at, $s0, 3 -/* 04519C 7F01066C 14EE0003 */ bne $a3, $t6, .L7F01067C -/* 0451A0 7F010670 01441021 */ addu $v0, $t2, $a0 -/* 0451A4 7F010674 ACA30000 */ sw $v1, ($a1) -/* 0451A8 7F010678 ADE90000 */ sw $t1, ($t7) -.L7F01067C: -/* 0451AC 7F01067C 14200006 */ bnez $at, .L7F010698 -/* 0451B0 7F010680 24630001 */ addiu $v1, $v1, 1 -/* 0451B4 7F010684 8C580000 */ lw $t8, ($v0) -/* 0451B8 7F010688 2B010004 */ slti $at, $t8, 4 -/* 0451BC 7F01068C 54200003 */ bnezl $at, .L7F01069C -/* 0451C0 7F010690 0066082A */ slt $at, $v1, $a2 -/* 0451C4 7F010694 AC400000 */ sw $zero, ($v0) -.L7F010698: -/* 0451C8 7F010698 0066082A */ slt $at, $v1, $a2 -.L7F01069C: -/* 0451CC 7F01069C 24840004 */ addiu $a0, $a0, 4 -/* 0451D0 7F0106A0 1420FFEF */ bnez $at, .L7F010660 -/* 0451D4 7F0106A4 24A50004 */ addiu $a1, $a1, 4 -.L7F0106A8: -/* 0451D8 7F0106A8 3C198003 */ lui $t9, %hi(scenario) -/* 0451DC 7F0106AC 8F39B540 */ lw $t9, %lo(scenario)($t9) -/* 0451E0 7F0106B0 3C0C8003 */ lui $t4, %hi(mp_player_counts) -/* 0451E4 7F0106B4 258CB054 */ addiu $t4, %lo(mp_player_counts) # addiu $t4, $t4, -0x4fac -/* 0451E8 7F0106B8 00195880 */ sll $t3, $t9, 2 -/* 0451EC 7F0106BC 016C1021 */ addu $v0, $t3, $t4 -/* 0451F0 7F0106C0 904D0003 */ lbu $t5, 3($v0) -/* 0451F4 7F0106C4 01A6082A */ slt $at, $t5, $a2 -/* 0451F8 7F0106C8 14200005 */ bnez $at, .L7F0106E0 -/* 0451FC 7F0106CC 00000000 */ nop -/* 045200 7F0106D0 904E0002 */ lbu $t6, 2($v0) -/* 045204 7F0106D4 00CE082A */ slt $at, $a2, $t6 -/* 045208 7F0106D8 10200005 */ beqz $at, .L7F0106F0 -/* 04520C 7F0106DC 00000000 */ nop -.L7F0106E0: -/* 045210 7F0106E0 0FC0411A */ jal reset_mp_options_for_scenario -/* 045214 7F0106E4 00002025 */ move $a0, $zero -/* 045218 7F0106E8 3C068003 */ lui $a2, %hi(selected_num_players) -/* 04521C 7F0106EC 8CC6B520 */ lw $a2, %lo(selected_num_players)($a2) -.L7F0106F0: -/* 045220 7F0106F0 3C028003 */ lui $v0, %hi(MP_stage_selected) -/* 045224 7F0106F4 2442B534 */ addiu $v0, %lo(MP_stage_selected) # addiu $v0, $v0, -0x4acc -/* 045228 7F0106F8 8C4F0000 */ lw $t7, ($v0) -/* 04522C 7F0106FC 3C198003 */ lui $t9, %hi(multi_stage_setups+20) -/* 045230 7F010700 240B0001 */ li $t3, 1 -/* 045234 7F010704 000FC080 */ sll $t8, $t7, 2 -/* 045238 7F010708 030FC023 */ subu $t8, $t8, $t7 -/* 04523C 7F01070C 0018C0C0 */ sll $t8, $t8, 3 -/* 045240 7F010710 0338C821 */ addu $t9, $t9, $t8 -/* 045244 7F010714 8F39B088 */ lw $t9, %lo(multi_stage_setups+20)($t9) -/* 045248 7F010718 0326082A */ slt $at, $t9, $a2 -/* 04524C 7F01071C 50200003 */ beql $at, $zero, .L7F01072C -/* 045250 7F010720 8FBF001C */ lw $ra, 0x1c($sp) -/* 045254 7F010724 AC4B0000 */ sw $t3, ($v0) -/* 045258 7F010728 8FBF001C */ lw $ra, 0x1c($sp) -.L7F01072C: -/* 04525C 7F01072C 8FB00018 */ lw $s0, 0x18($sp) -/* 045260 7F010730 27BD0020 */ addiu $sp, $sp, 0x20 -/* 045264 7F010734 03E00008 */ jr $ra -/* 045268 7F010738 00000000 */ nop -) -#endif //******************************************************************************************************** @@ -10150,773 +4271,255 @@ void update_menu0E_mpoptions(void) - - - -#ifdef NONMATCHING -//getting there, needs some love still +// Address 0x7F010848 NTSC void interface_menu0E_mpoptions(void) { - s32 temp_y; - s32 numplayers; - - s32 players_selected; - s32 scenario_selected; - s32 stageselect_selected; - s32 gamelength_selected; - s32 character_selected; - s32 weaponselect_selected; - s32 handicap_selected; - s32 controlstyle_selected; - s32 aimadjustment_selected; - //s32 temp_a0; - s32 curstageid; - s32 randID;; - //s32 temp_v1; - //u32 temp_hi; - - - players_selected = 0; - scenario_selected = 0; - stageselect_selected = 0; - gamelength_selected = 0; - character_selected = 0; - weaponselect_selected = 0; - handicap_selected = 0; - controlstyle_selected = 0; - aimadjustment_selected = 0; - viSetFovY(60.0f); - viSetAspect(1.3333334f); + s32 sp3C = 0; + s32 sp38 = 0; + s32 sp34 = 0; + s32 sp30 = 0; + s32 sp2C = 0; + s32 sp28 = 0; + s32 sp24 = 0; + s32 sp20 = 0; + s32 sp1C = 0; + + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); - viSetUseZBuf(FALSE); + viSetUseZBuf(0); + if (joyGetControllerCount() < 2) { - set_menu_to_mode(MENU_MODE_SELECT, 0); + frontChangeMenu(MENU_MODE_SELECT, 0); setCursorPOSforMode(gamemode); } + if (joyGetControllerCount() < selected_num_players) { init_mp_options_for_scenario(joyGetControllerCount()); } + if (joyGetButtons(PLAYER_1, Z_TRIG|A_BUTTON) == 0) { - tab_prev_highlight = FALSE; - tab_next_highlight = FALSE; - tab_start_highlight = FALSE; - highlight_players = FALSE; - highlight_scenario = FALSE; - highlight_gameselect = FALSE; - highlight_gamelength = FALSE; - highlight_character = FALSE; - highlight_weaponselect = FALSE; - highlight_health = FALSE; - highlight_controlstyle = FALSE; - highlight_aimadjustment = FALSE; + tab_prev_highlight = 0; + tab_next_highlight = 0; + tab_start_highlight = 0; + highlight_players = 0; + highlight_scenario = 0; + highlight_gameselect = 0; + highlight_gamelength = 0; + highlight_character = 0; + highlight_weaponselect = 0; + highlight_health = 0; + highlight_controlstyle = 0; + highlight_aimadjustment = 0; + if (isontab3()) { - tab_prev_highlight = TRUE; + tab_prev_highlight = 1; } else if (isontab1()) { - tab_start_highlight = TRUE; + tab_start_highlight = 1; } else { - temp_y = (s32) cursor_v_pos; - if ((temp_y >= 0x119) && (unlock_aim_sight)) + s32 temp_f6 = cursor_v_pos; + if ((temp_f6 >= 0x119) && (unlock_aim_sight)) { - highlight_aimadjustment = TRUE; + highlight_aimadjustment = 1; } - else if ((temp_y >= 0x105) && (unlock_control_style)) + else if ((temp_f6 >= 0x105) && (unlock_control_style)) { - highlight_controlstyle = TRUE; + highlight_controlstyle = 1; } - else if ((temp_y >= 0xF1) && (unlock_handicap)) + else if ((temp_f6 >= 0xF1) && (unlock_handicap)) { - highlight_health = TRUE; + highlight_health = 1; } - else if ((temp_y >= 0xDD) && (unlock_chars)) + else if ((temp_f6 >= 0xDD) && (unlock_chars)) { - highlight_character = TRUE; + highlight_character = 1; } - else if ((temp_y >= 0xC9) && (unlock_weapon_select)) + else if ((temp_f6 >= 0xC9) && (unlock_weapon_select)) { - highlight_weaponselect = TRUE; + highlight_weaponselect = 1; } - else if ((temp_y >= 0xB5) && (unlock_game_length)) + else if ((temp_f6 >= 0xB5) && (unlock_game_length)) { - highlight_gamelength = TRUE; + highlight_gamelength = 1; } - else if ((temp_y >= 0xA1) && (unlock_stage_select)) + else if ((temp_f6 >= 0xA1) && (unlock_stage_select)) { - highlight_gameselect = TRUE; + highlight_gameselect = 1; } - else if (temp_y >= 0x8D) + else if (temp_f6 >= 0x8D) { - highlight_scenario = TRUE; + highlight_scenario = 1; } else { - highlight_players = TRUE; + highlight_players = 1; } } } + if (joyGetButtonsPressedThisFrame(PLAYER_1, START_BUTTON)) { - tab_start_selected = TRUE; - sndPlaySfx(g_musicSfxBufferPtr, 0xC7, 0); + tab_start_selected = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } else if (joyGetButtonsPressedThisFrame(PLAYER_1, Z_TRIG|A_BUTTON)) { if (tab_prev_highlight) { - tab_prev_selected = TRUE; + tab_prev_selected = 1; } + if (tab_start_highlight) { - tab_start_selected = TRUE; + tab_start_selected = 1; } else if (highlight_players) { - players_selected = TRUE; + sp3C = 1; } else if (highlight_scenario) { - scenario_selected = TRUE; + sp38 = 1; } else if (highlight_gameselect) { - stageselect_selected = TRUE; + sp34 = 1; } else if (highlight_gamelength) { - gamelength_selected = TRUE; + sp30 = 1; } else if (highlight_character) { - character_selected = TRUE; + sp2C = 1; } else if (highlight_weaponselect) { - weaponselect_selected = TRUE; + sp28 = 1; } else if (highlight_health) { - handicap_selected = TRUE; + sp24 = 1; } else if (highlight_controlstyle) { - controlstyle_selected = TRUE; + sp20 = 1; } else if (highlight_aimadjustment) { - aimadjustment_selected = TRUE; + sp1C = 1; } - sndPlaySfx(g_musicSfxBufferPtr, 0xC7, 0); + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - else if (joyGetButtonsPressedThisFrame(PLAYER_1, B_BUTTON) != 0) + else if (joyGetButtonsPressedThisFrame(PLAYER_1, B_BUTTON)) { - tab_prev_selected = TRUE; - sndPlaySfx(g_musicSfxBufferPtr, 0xC7, 0); + tab_prev_selected = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } + disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 5, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CONFIDENTIAL2, 1); menu_control_stick_tracking(); + if (tab_prev_selected) { - set_menu_to_mode(MENU_MODE_SELECT, 0); + frontChangeMenu(MENU_MODE_SELECT, 0); setCursorPOSforMode(gamemode); return; } + if (tab_start_selected) { - -/* - curstageid = *(&multi_stage_setups + 8 + (MP_stage_selected * 0x18)); - if (curstageid < 0) + if (multi_stage_setups[MP_stage_selected].stage_id < 0) { -loop_65: - temp_hi = randomGetNext() % 0xBU; - temp_a0 = temp_hi + 1; - selected_stage = (s32) *(&multi_stage_setups + 0x20 + (temp_hi * 0x18)); - if (check_if_mp_stage_unlocked(temp_a0) == 0) + s32 temp_hi; + do { - goto loop_65; - } + temp_hi = randomGetNext() % (u32)(MP_STAGE_SELECTED_MAX - 1); + selected_stage = multi_stage_setups[1 + temp_hi].stage_id; + } while (check_if_mp_stage_unlocked(temp_hi + 1) == 0); } else { - selected_stage = curstageid; - } -//*/ - - curstageid = multi_stage_setups[MP_stage_selected].stage_id; - if (curstageid < 0) { - do { - randID = randomGetNext() % 0xb; - selected_stage = multi_stage_setups[randID].stage_id; - //BVar3 = ; - curstageid = selected_stage; - } while (check_if_mp_stage_unlocked(randID+1) == FALSE); + selected_stage = multi_stage_setups[MP_stage_selected].stage_id; } - selected_stage = curstageid; -/////////////////////////// - + briefingpage = -1; - set_menu_to_mode(MENU_RUN_STAGE, 1); + frontChangeMenu(MENU_RUN_STAGE, 1); + return; } - if (players_selected) + + if (sp3C) { - //temp_v1 = selected_num_players + 1; - numplayers = selected_num_players + 1; - if (joyGetControllerCount() < numplayers) + s32 temp_v1; + + if (joyGetControllerCount() < selected_num_players + 1) { - numplayers = 2U; + temp_v1 = 2; } - init_mp_options_for_scenario(numplayers); + else + { + temp_v1 = selected_num_players + 1; + } + + init_mp_options_for_scenario(temp_v1); + return; } - if (scenario_selected) + if (sp38) { - set_menu_to_mode(MENU_MP_SCENARIO_SELECT, 0); + frontChangeMenu(MENU_MP_SCENARIO_SELECT, 0); return; } - if (stageselect_selected) + if (sp34) { - set_menu_to_mode(MENU_MP_STAGE_SELECT, 0); + frontChangeMenu(MENU_MP_STAGE_SELECT, 0); return; } - if (gamelength_selected) + if (sp30) { select_game_length(); return; } - if (character_selected) + if (sp2C) { - set_menu_to_mode(MENU_MP_CHAR_SELECT, 0); + frontChangeMenu(MENU_MP_CHAR_SELECT, 0); return; } - if (weaponselect_selected) + if (sp28) { incrementMPWeaponSet(); return; } - if (handicap_selected) + if (sp24) { - set_menu_to_mode(MENU_MP_HANDICAP, 0); + frontChangeMenu(MENU_MP_HANDICAP, 0); return; } - if (controlstyle_selected) + if (sp20) { - set_menu_to_mode(MENU_MP_CONTROL_STYLE, 0); + frontChangeMenu(MENU_MP_CONTROL_STYLE, 0); return; } - if (aimadjustment_selected) + if (sp1C) { advance_aim_settings_selection(); } } -#else -GLOBAL_ASM( -.late_rodata -glabel menu0E_aspect -.word 0x3FAAAAAB /*1.3333334;*/ -glabel menu0E_pageheight -.word 0x461C4000 /*10000.0;*/ - -.text -glabel interface_menu0E_mpoptions -/* 045378 7F010848 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 04537C 7F01084C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 045380 7F010850 AFBF0014 */ sw $ra, 0x14($sp) -/* 045384 7F010854 44816000 */ mtc1 $at, $f12 -/* 045388 7F010858 AFA0003C */ sw $zero, 0x3c($sp) -/* 04538C 7F01085C AFA00038 */ sw $zero, 0x38($sp) -/* 045390 7F010860 AFA00034 */ sw $zero, 0x34($sp) -/* 045394 7F010864 AFA00030 */ sw $zero, 0x30($sp) -/* 045398 7F010868 AFA0002C */ sw $zero, 0x2c($sp) -/* 04539C 7F01086C AFA00028 */ sw $zero, 0x28($sp) -/* 0453A0 7F010870 AFA00024 */ sw $zero, 0x24($sp) -/* 0453A4 7F010874 AFA00020 */ sw $zero, 0x20($sp) -/* 0453A8 7F010878 0C001151 */ jal viSetFovY -/* 0453AC 7F01087C AFA0001C */ sw $zero, 0x1c($sp) -/* 0453B0 7F010880 3C018005 */ lui $at, %hi(menu0E_aspect) -/* 0453B4 7F010884 0C001164 */ jal viSetAspect -/* 0453B8 7F010888 C42C1A80 */ lwc1 $f12, %lo(menu0E_aspect)($at) -/* 0453BC 7F01088C 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0453C0 7F010890 44816000 */ mtc1 $at, $f12 -/* 0453C4 7F010894 3C018005 */ lui $at, %hi(menu0E_pageheight) -/* 0453C8 7F010898 0C001194 */ jal viSetZRange -/* 0453CC 7F01089C C42E1A84 */ lwc1 $f14, %lo(menu0E_pageheight)($at) -/* 0453D0 7F0108A0 0C00114D */ jal viSetUseZBuf -/* 0453D4 7F0108A4 00002025 */ move $a0, $zero -/* 0453D8 7F0108A8 0C002E7E */ jal joyGetControllerCount -/* 0453DC 7F0108AC 00000000 */ nop -/* 0453E0 7F0108B0 28410002 */ slti $at, $v0, 2 -/* 0453E4 7F0108B4 10200006 */ beqz $at, .L7F0108D0 -/* 0453E8 7F0108B8 24040006 */ li $a0, 6 -/* 0453EC 7F0108BC 0FC06975 */ jal set_menu_to_mode -/* 0453F0 7F0108C0 00002825 */ move $a1, $zero -/* 0453F4 7F0108C4 3C048003 */ lui $a0, %hi(gamemode) -/* 0453F8 7F0108C8 0FC035FF */ jal setCursorPOSforMode -/* 0453FC 7F0108CC 8C84A8F0 */ lw $a0, %lo(gamemode)($a0) -.L7F0108D0: -/* 045400 7F0108D0 0C002E7E */ jal joyGetControllerCount -/* 045404 7F0108D4 00000000 */ nop -/* 045408 7F0108D8 3C0E8003 */ lui $t6, %hi(selected_num_players) -/* 04540C 7F0108DC 8DCEB520 */ lw $t6, %lo(selected_num_players)($t6) -/* 045410 7F0108E0 004E082A */ slt $at, $v0, $t6 -/* 045414 7F0108E4 50200006 */ beql $at, $zero, .L7F010900 -/* 045418 7F0108E8 00002025 */ move $a0, $zero -/* 04541C 7F0108EC 0C002E7E */ jal joyGetControllerCount -/* 045420 7F0108F0 00000000 */ nop -/* 045424 7F0108F4 0FC04182 */ jal init_mp_options_for_scenario -/* 045428 7F0108F8 00402025 */ move $a0, $v0 -/* 04542C 7F0108FC 00002025 */ move $a0, $zero -.L7F010900: -/* 045430 7F010900 0C0030C3 */ jal joyGetButtons -/* 045434 7F010904 3405A000 */ li $a1, 40960 -/* 045438 7F010908 1440007A */ bnez $v0, .L7F010AF4 -/* 04543C 7F01090C 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 045440 7F010910 AC20A8E4 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 045444 7F010914 3C018003 */ lui $at, %hi(tab_next_highlight) -/* 045448 7F010918 AC20A8E0 */ sw $zero, %lo(tab_next_highlight)($at) -/* 04544C 7F01091C 3C018003 */ lui $at, %hi(tab_start_highlight) -/* 045450 7F010920 AC20A8DC */ sw $zero, %lo(tab_start_highlight)($at) -/* 045454 7F010924 3C018007 */ lui $at, %hi(highlight_players) -/* 045458 7F010928 AC2097C8 */ sw $zero, %lo(highlight_players)($at) -/* 04545C 7F01092C 3C018007 */ lui $at, %hi(highlight_scenario) -/* 045460 7F010930 AC2097CC */ sw $zero, %lo(highlight_scenario)($at) -/* 045464 7F010934 3C018007 */ lui $at, %hi(highlight_gameselect) -/* 045468 7F010938 AC2097D0 */ sw $zero, %lo(highlight_gameselect)($at) -/* 04546C 7F01093C 3C018007 */ lui $at, %hi(highlight_gamelength) -/* 045470 7F010940 AC2097D4 */ sw $zero, %lo(highlight_gamelength)($at) -/* 045474 7F010944 3C018007 */ lui $at, %hi(highlight_character) -/* 045478 7F010948 AC2097D8 */ sw $zero, %lo(highlight_character)($at) -/* 04547C 7F01094C 3C018007 */ lui $at, %hi(highlight_weaponselect) -/* 045480 7F010950 AC2097DC */ sw $zero, %lo(highlight_weaponselect)($at) -/* 045484 7F010954 3C018007 */ lui $at, %hi(highlight_health) -/* 045488 7F010958 AC2097E0 */ sw $zero, %lo(highlight_health)($at) -/* 04548C 7F01095C 3C018007 */ lui $at, %hi(highlight_controlstyle) -/* 045490 7F010960 AC2097E4 */ sw $zero, %lo(highlight_controlstyle)($at) -/* 045494 7F010964 3C018007 */ lui $at, %hi(highlight_aimadjustment) -/* 045498 7F010968 0FC028E7 */ jal isontab3 -/* 04549C 7F01096C AC2097E8 */ sw $zero, %lo(highlight_aimadjustment)($at) -/* 0454A0 7F010970 10400004 */ beqz $v0, .L7F010984 -/* 0454A4 7F010974 240F0001 */ li $t7, 1 -/* 0454A8 7F010978 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 0454AC 7F01097C 1000005D */ b .L7F010AF4 -/* 0454B0 7F010980 AC2FA8E4 */ sw $t7, %lo(tab_prev_highlight)($at) -.L7F010984: -/* 0454B4 7F010984 0FC02879 */ jal isontab1 -/* 0454B8 7F010988 00000000 */ nop -/* 0454BC 7F01098C 10400005 */ beqz $v0, .L7F0109A4 -/* 0454C0 7F010990 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 0454C4 7F010994 24030001 */ li $v1, 1 -/* 0454C8 7F010998 3C018003 */ lui $at, %hi(tab_start_highlight) -/* 0454CC 7F01099C 10000055 */ b .L7F010AF4 -/* 0454D0 7F0109A0 AC23A8DC */ sw $v1, %lo(tab_start_highlight)($at) -.L7F0109A4: -/* 0454D4 7F0109A4 C424A90C */ lwc1 $f4, %lo(cursor_v_pos)($at) -/* 0454D8 7F0109A8 3C198003 */ lui $t9, %hi(unlock_aim_sight) -/* 0454DC 7F0109AC 4600218D */ trunc.w.s $f6, $f4 -/* 0454E0 7F0109B0 44023000 */ mfc1 $v0, $f6 -/* 0454E4 7F0109B4 00000000 */ nop -/* 0454E8 7F0109B8 28410119 */ slti $at, $v0, 0x119 -/* 0454EC 7F0109BC 54200009 */ bnezl $at, .L7F0109E4 -/* 0454F0 7F0109C0 28410105 */ slti $at, $v0, 0x105 -/* 0454F4 7F0109C4 8F39B55C */ lw $t9, %lo(unlock_aim_sight)($t9) -/* 0454F8 7F0109C8 24030001 */ li $v1, 1 -/* 0454FC 7F0109CC 3C018007 */ lui $at, %hi(highlight_aimadjustment) -/* 045500 7F0109D0 53200004 */ beql $t9, $zero, .L7F0109E4 -/* 045504 7F0109D4 28410105 */ slti $at, $v0, 0x105 -/* 045508 7F0109D8 10000046 */ b .L7F010AF4 -/* 04550C 7F0109DC AC2397E8 */ sw $v1, %lo(highlight_aimadjustment)($at) -/* 045510 7F0109E0 28410105 */ slti $at, $v0, 0x105 -.L7F0109E4: -/* 045514 7F0109E4 14200008 */ bnez $at, .L7F010A08 -/* 045518 7F0109E8 3C088003 */ lui $t0, %hi(unlock_control_style) -/* 04551C 7F0109EC 8D08B558 */ lw $t0, %lo(unlock_control_style)($t0) -/* 045520 7F0109F0 24030001 */ li $v1, 1 -/* 045524 7F0109F4 3C018007 */ lui $at, %hi(highlight_controlstyle) -/* 045528 7F0109F8 51000004 */ beql $t0, $zero, .L7F010A0C -/* 04552C 7F0109FC 284100F1 */ slti $at, $v0, 0xf1 -/* 045530 7F010A00 1000003C */ b .L7F010AF4 -/* 045534 7F010A04 AC2397E4 */ sw $v1, %lo(highlight_controlstyle)($at) -.L7F010A08: -/* 045538 7F010A08 284100F1 */ slti $at, $v0, 0xf1 -.L7F010A0C: -/* 04553C 7F010A0C 14200008 */ bnez $at, .L7F010A30 -/* 045540 7F010A10 3C098003 */ lui $t1, %hi(unlock_handicap) -/* 045544 7F010A14 8D29B554 */ lw $t1, %lo(unlock_handicap)($t1) -/* 045548 7F010A18 24030001 */ li $v1, 1 -/* 04554C 7F010A1C 3C018007 */ lui $at, %hi(highlight_health) -/* 045550 7F010A20 51200004 */ beql $t1, $zero, .L7F010A34 -/* 045554 7F010A24 284100DD */ slti $at, $v0, 0xdd -/* 045558 7F010A28 10000032 */ b .L7F010AF4 -/* 04555C 7F010A2C AC2397E0 */ sw $v1, %lo(highlight_health)($at) -.L7F010A30: -/* 045560 7F010A30 284100DD */ slti $at, $v0, 0xdd -.L7F010A34: -/* 045564 7F010A34 14200008 */ bnez $at, .L7F010A58 -/* 045568 7F010A38 3C0A8003 */ lui $t2, %hi(unlock_chars) -/* 04556C 7F010A3C 8D4AB54C */ lw $t2, %lo(unlock_chars)($t2) -/* 045570 7F010A40 24030001 */ li $v1, 1 -/* 045574 7F010A44 3C018007 */ lui $at, %hi(highlight_character) -/* 045578 7F010A48 51400004 */ beql $t2, $zero, .L7F010A5C -/* 04557C 7F010A4C 284100C9 */ slti $at, $v0, 0xc9 -/* 045580 7F010A50 10000028 */ b .L7F010AF4 -/* 045584 7F010A54 AC2397D8 */ sw $v1, %lo(highlight_character)($at) -.L7F010A58: -/* 045588 7F010A58 284100C9 */ slti $at, $v0, 0xc9 -.L7F010A5C: -/* 04558C 7F010A5C 14200008 */ bnez $at, .L7F010A80 -/* 045590 7F010A60 3C0B8003 */ lui $t3, %hi(unlock_weapon_select) -/* 045594 7F010A64 8D6BB550 */ lw $t3, %lo(unlock_weapon_select)($t3) -/* 045598 7F010A68 24030001 */ li $v1, 1 -/* 04559C 7F010A6C 3C018007 */ lui $at, %hi(highlight_weaponselect) -/* 0455A0 7F010A70 51600004 */ beql $t3, $zero, .L7F010A84 -/* 0455A4 7F010A74 284100B5 */ slti $at, $v0, 0xb5 -/* 0455A8 7F010A78 1000001E */ b .L7F010AF4 -/* 0455AC 7F010A7C AC2397DC */ sw $v1, %lo(highlight_weaponselect)($at) -.L7F010A80: -/* 0455B0 7F010A80 284100B5 */ slti $at, $v0, 0xb5 -.L7F010A84: -/* 0455B4 7F010A84 14200008 */ bnez $at, .L7F010AA8 -/* 0455B8 7F010A88 3C0C8003 */ lui $t4, %hi(unlock_game_length) -/* 0455BC 7F010A8C 8D8CB548 */ lw $t4, %lo(unlock_game_length)($t4) -/* 0455C0 7F010A90 24030001 */ li $v1, 1 -/* 0455C4 7F010A94 3C018007 */ lui $at, %hi(highlight_gamelength) -/* 0455C8 7F010A98 51800004 */ beql $t4, $zero, .L7F010AAC -/* 0455CC 7F010A9C 284100A1 */ slti $at, $v0, 0xa1 -/* 0455D0 7F010AA0 10000014 */ b .L7F010AF4 -/* 0455D4 7F010AA4 AC2397D4 */ sw $v1, %lo(highlight_gamelength)($at) -.L7F010AA8: -/* 0455D8 7F010AA8 284100A1 */ slti $at, $v0, 0xa1 -.L7F010AAC: -/* 0455DC 7F010AAC 14200008 */ bnez $at, .L7F010AD0 -/* 0455E0 7F010AB0 3C0D8003 */ lui $t5, %hi(unlock_stage_select) -/* 0455E4 7F010AB4 8DADB544 */ lw $t5, %lo(unlock_stage_select)($t5) -/* 0455E8 7F010AB8 24030001 */ li $v1, 1 -/* 0455EC 7F010ABC 3C018007 */ lui $at, %hi(highlight_gameselect) -/* 0455F0 7F010AC0 51A00004 */ beql $t5, $zero, .L7F010AD4 -/* 0455F4 7F010AC4 2841008D */ slti $at, $v0, 0x8d -/* 0455F8 7F010AC8 1000000A */ b .L7F010AF4 -/* 0455FC 7F010ACC AC2397D0 */ sw $v1, %lo(highlight_gameselect)($at) -.L7F010AD0: -/* 045600 7F010AD0 2841008D */ slti $at, $v0, 0x8d -.L7F010AD4: -/* 045604 7F010AD4 14200005 */ bnez $at, .L7F010AEC -/* 045608 7F010AD8 24030001 */ li $v1, 1 -/* 04560C 7F010ADC 24030001 */ li $v1, 1 -/* 045610 7F010AE0 3C018007 */ lui $at, %hi(highlight_scenario) -/* 045614 7F010AE4 10000003 */ b .L7F010AF4 -/* 045618 7F010AE8 AC2397CC */ sw $v1, %lo(highlight_scenario)($at) -.L7F010AEC: -/* 04561C 7F010AEC 3C018007 */ lui $at, %hi(highlight_players) -/* 045620 7F010AF0 AC2397C8 */ sw $v1, %lo(highlight_players)($at) -.L7F010AF4: -/* 045624 7F010AF4 00002025 */ move $a0, $zero -/* 045628 7F010AF8 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04562C 7F010AFC 24051000 */ li $a1, 4096 -/* 045630 7F010B00 1040000A */ beqz $v0, .L7F010B2C -/* 045634 7F010B04 24030001 */ li $v1, 1 -/* 045638 7F010B08 3C018003 */ lui $at, %hi(tab_start_selected) -/* 04563C 7F010B0C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 045640 7F010B10 AC23A8D0 */ sw $v1, %lo(tab_start_selected)($at) -/* 045644 7F010B14 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 045648 7F010B18 240500C7 */ li $a1, 199 -/* 04564C 7F010B1C 0C002382 */ jal sndPlaySfx -/* 045650 7F010B20 00003025 */ move $a2, $zero -/* 045654 7F010B24 10000062 */ b .L7F010CB0 -/* 045658 7F010B28 00000000 */ nop -.L7F010B2C: -/* 04565C 7F010B2C 00002025 */ move $a0, $zero -/* 045660 7F010B30 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 045664 7F010B34 3405A000 */ li $a1, 40960 -/* 045668 7F010B38 10400051 */ beqz $v0, .L7F010C80 -/* 04566C 7F010B3C 24030001 */ li $v1, 1 -/* 045670 7F010B40 3C0E8003 */ lui $t6, %hi(tab_prev_highlight) -/* 045674 7F010B44 8DCEA8E4 */ lw $t6, %lo(tab_prev_highlight)($t6) -/* 045678 7F010B48 3C0F8003 */ lui $t7, %hi(tab_start_highlight) -/* 04567C 7F010B4C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 045680 7F010B50 11C00003 */ beqz $t6, .L7F010B60 -/* 045684 7F010B54 240500C7 */ li $a1, 199 -/* 045688 7F010B58 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 04568C 7F010B5C AC23A8D8 */ sw $v1, %lo(tab_prev_selected)($at) -.L7F010B60: -/* 045690 7F010B60 8DEFA8DC */ lw $t7, %lo(tab_start_highlight)($t7) -/* 045694 7F010B64 3C018003 */ lui $at, %hi(tab_start_selected) -/* 045698 7F010B68 3C188007 */ lui $t8, %hi(highlight_players) -/* 04569C 7F010B6C 11E00003 */ beqz $t7, .L7F010B7C -/* 0456A0 7F010B70 00003025 */ move $a2, $zero -/* 0456A4 7F010B74 1000003E */ b .L7F010C70 -/* 0456A8 7F010B78 AC23A8D0 */ sw $v1, %lo(tab_start_selected)($at) -.L7F010B7C: -/* 0456AC 7F010B7C 8F1897C8 */ lw $t8, %lo(highlight_players)($t8) -/* 0456B0 7F010B80 24190001 */ li $t9, 1 -/* 0456B4 7F010B84 3C088007 */ lui $t0, %hi(highlight_scenario) -/* 0456B8 7F010B88 13000003 */ beqz $t8, .L7F010B98 -/* 0456BC 7F010B8C 00000000 */ nop -/* 0456C0 7F010B90 10000037 */ b .L7F010C70 -/* 0456C4 7F010B94 AFB9003C */ sw $t9, 0x3c($sp) -.L7F010B98: -/* 0456C8 7F010B98 8D0897CC */ lw $t0, %lo(highlight_scenario)($t0) -/* 0456CC 7F010B9C 24090001 */ li $t1, 1 -/* 0456D0 7F010BA0 3C0A8007 */ lui $t2, %hi(highlight_gameselect) -/* 0456D4 7F010BA4 11000003 */ beqz $t0, .L7F010BB4 -/* 0456D8 7F010BA8 00000000 */ nop -/* 0456DC 7F010BAC 10000030 */ b .L7F010C70 -/* 0456E0 7F010BB0 AFA90038 */ sw $t1, 0x38($sp) -.L7F010BB4: -/* 0456E4 7F010BB4 8D4A97D0 */ lw $t2, %lo(highlight_gameselect)($t2) -/* 0456E8 7F010BB8 240B0001 */ li $t3, 1 -/* 0456EC 7F010BBC 3C0C8007 */ lui $t4, %hi(highlight_gamelength) -/* 0456F0 7F010BC0 11400003 */ beqz $t2, .L7F010BD0 -/* 0456F4 7F010BC4 00000000 */ nop -/* 0456F8 7F010BC8 10000029 */ b .L7F010C70 -/* 0456FC 7F010BCC AFAB0034 */ sw $t3, 0x34($sp) -.L7F010BD0: -/* 045700 7F010BD0 8D8C97D4 */ lw $t4, %lo(highlight_gamelength)($t4) -/* 045704 7F010BD4 240D0001 */ li $t5, 1 -/* 045708 7F010BD8 3C0E8007 */ lui $t6, %hi(highlight_character) -/* 04570C 7F010BDC 11800003 */ beqz $t4, .L7F010BEC -/* 045710 7F010BE0 00000000 */ nop -/* 045714 7F010BE4 10000022 */ b .L7F010C70 -/* 045718 7F010BE8 AFAD0030 */ sw $t5, 0x30($sp) -.L7F010BEC: -/* 04571C 7F010BEC 8DCE97D8 */ lw $t6, %lo(highlight_character)($t6) -/* 045720 7F010BF0 240F0001 */ li $t7, 1 -/* 045724 7F010BF4 3C188007 */ lui $t8, %hi(highlight_weaponselect) -/* 045728 7F010BF8 11C00003 */ beqz $t6, .L7F010C08 -/* 04572C 7F010BFC 00000000 */ nop -/* 045730 7F010C00 1000001B */ b .L7F010C70 -/* 045734 7F010C04 AFAF002C */ sw $t7, 0x2c($sp) -.L7F010C08: -/* 045738 7F010C08 8F1897DC */ lw $t8, %lo(highlight_weaponselect)($t8) -/* 04573C 7F010C0C 24190001 */ li $t9, 1 -/* 045740 7F010C10 3C088007 */ lui $t0, %hi(highlight_health) -/* 045744 7F010C14 13000003 */ beqz $t8, .L7F010C24 -/* 045748 7F010C18 00000000 */ nop -/* 04574C 7F010C1C 10000014 */ b .L7F010C70 -/* 045750 7F010C20 AFB90028 */ sw $t9, 0x28($sp) -.L7F010C24: -/* 045754 7F010C24 8D0897E0 */ lw $t0, %lo(highlight_health)($t0) -/* 045758 7F010C28 24090001 */ li $t1, 1 -/* 04575C 7F010C2C 3C0A8007 */ lui $t2, %hi(highlight_controlstyle) -/* 045760 7F010C30 11000003 */ beqz $t0, .L7F010C40 -/* 045764 7F010C34 00000000 */ nop -/* 045768 7F010C38 1000000D */ b .L7F010C70 -/* 04576C 7F010C3C AFA90024 */ sw $t1, 0x24($sp) -.L7F010C40: -/* 045770 7F010C40 8D4A97E4 */ lw $t2, %lo(highlight_controlstyle)($t2) -/* 045774 7F010C44 240B0001 */ li $t3, 1 -/* 045778 7F010C48 3C0C8007 */ lui $t4, %hi(highlight_aimadjustment) -/* 04577C 7F010C4C 11400003 */ beqz $t2, .L7F010C5C -/* 045780 7F010C50 00000000 */ nop -/* 045784 7F010C54 10000006 */ b .L7F010C70 -/* 045788 7F010C58 AFAB0020 */ sw $t3, 0x20($sp) -.L7F010C5C: -/* 04578C 7F010C5C 8D8C97E8 */ lw $t4, %lo(highlight_aimadjustment)($t4) -/* 045790 7F010C60 240D0001 */ li $t5, 1 -/* 045794 7F010C64 11800002 */ beqz $t4, .L7F010C70 -/* 045798 7F010C68 00000000 */ nop -/* 04579C 7F010C6C AFAD001C */ sw $t5, 0x1c($sp) -.L7F010C70: -/* 0457A0 7F010C70 0C002382 */ jal sndPlaySfx -/* 0457A4 7F010C74 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0457A8 7F010C78 1000000D */ b .L7F010CB0 -/* 0457AC 7F010C7C 00000000 */ nop -.L7F010C80: -/* 0457B0 7F010C80 00002025 */ move $a0, $zero -/* 0457B4 7F010C84 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0457B8 7F010C88 24054000 */ li $a1, 16384 -/* 0457BC 7F010C8C 10400008 */ beqz $v0, .L7F010CB0 -/* 0457C0 7F010C90 24030001 */ li $v1, 1 -/* 0457C4 7F010C94 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 0457C8 7F010C98 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0457CC 7F010C9C AC23A8D8 */ sw $v1, %lo(tab_prev_selected)($at) -/* 0457D0 7F010CA0 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0457D4 7F010CA4 240500C7 */ li $a1, 199 -/* 0457D8 7F010CA8 0C002382 */ jal sndPlaySfx -/* 0457DC 7F010CAC 00003025 */ move $a2, $zero -.L7F010CB0: -/* 0457E0 7F010CB0 3C048003 */ lui $a0, %hi(walletinst) -/* 0457E4 7F010CB4 0FC02DC9 */ jal disable_all_switches -/* 0457E8 7F010CB8 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 0457EC 7F010CBC 3C048003 */ lui $a0, %hi(walletinst) -/* 0457F0 7F010CC0 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 0457F4 7F010CC4 00002825 */ move $a1, $zero -/* 0457F8 7F010CC8 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0457FC 7F010CCC 24060001 */ li $a2, 1 -/* 045800 7F010CD0 3C048003 */ lui $a0, %hi(walletinst) -/* 045804 7F010CD4 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 045808 7F010CD8 24050001 */ li $a1, 1 -/* 04580C 7F010CDC 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 045810 7F010CE0 24060001 */ li $a2, 1 -/* 045814 7F010CE4 3C048003 */ lui $a0, %hi(walletinst) -/* 045818 7F010CE8 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 04581C 7F010CEC 24050003 */ li $a1, 3 -/* 045820 7F010CF0 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 045824 7F010CF4 24060001 */ li $a2, 1 -/* 045828 7F010CF8 3C048003 */ lui $a0, %hi(walletinst) -/* 04582C 7F010CFC 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 045830 7F010D00 24050005 */ li $a1, 5 -/* 045834 7F010D04 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 045838 7F010D08 24060001 */ li $a2, 1 -/* 04583C 7F010D0C 0FC026E1 */ jal menu_control_stick_tracking -/* 045840 7F010D10 00000000 */ nop -/* 045844 7F010D14 3C0E8003 */ lui $t6, %hi(tab_prev_selected) -/* 045848 7F010D18 8DCEA8D8 */ lw $t6, %lo(tab_prev_selected)($t6) -/* 04584C 7F010D1C 24040006 */ li $a0, 6 -/* 045850 7F010D20 3C0F8003 */ lui $t7, %hi(tab_start_selected) -/* 045854 7F010D24 11C00008 */ beqz $t6, .L7F010D48 -/* 045858 7F010D28 00000000 */ nop -/* 04585C 7F010D2C 0FC06975 */ jal set_menu_to_mode -/* 045860 7F010D30 00002825 */ move $a1, $zero -/* 045864 7F010D34 3C048003 */ lui $a0, %hi(gamemode) -/* 045868 7F010D38 0FC035FF */ jal setCursorPOSforMode -/* 04586C 7F010D3C 8C84A8F0 */ lw $a0, %lo(gamemode)($a0) -/* 045870 7F010D40 10000070 */ b .L7F010F04 -/* 045874 7F010D44 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010D48: -/* 045878 7F010D48 8DEFA8D0 */ lw $t7, %lo(tab_start_selected)($t7) -/* 04587C 7F010D4C 3C188003 */ lui $t8, %hi(MP_stage_selected) -/* 045880 7F010D50 8FAB003C */ lw $t3, 0x3c($sp) -/* 045884 7F010D54 11E00027 */ beqz $t7, .L7F010DF4 -/* 045888 7F010D58 00000000 */ nop -/* 04588C 7F010D5C 8F18B534 */ lw $t8, %lo(MP_stage_selected)($t8) -/* 045890 7F010D60 3C028003 */ lui $v0, %hi(multi_stage_setups+8) -/* 045894 7F010D64 3C018003 */ lui $at, %hi(selected_stage) -/* 045898 7F010D68 0018C880 */ sll $t9, $t8, 2 -/* 04589C 7F010D6C 0338C823 */ subu $t9, $t9, $t8 -/* 0458A0 7F010D70 0019C8C0 */ sll $t9, $t9, 3 -/* 0458A4 7F010D74 00591021 */ addu $v0, $v0, $t9 -/* 0458A8 7F010D78 8C42B07C */ lw $v0, %lo(multi_stage_setups+8)($v0) -/* 0458AC 7F010D7C 04410014 */ bgez $v0, .L7F010DD0 -/* 0458B0 7F010D80 00000000 */ nop -.L7F010D84: -/* 0458B4 7F010D84 0C002914 */ jal randomGetNext -/* 0458B8 7F010D88 00000000 */ nop -/* 0458BC 7F010D8C 2401000B */ li $at, 11 -/* 0458C0 7F010D90 0041001B */ divu $zero, $v0, $at -/* 0458C4 7F010D94 00001810 */ mfhi $v1 -/* 0458C8 7F010D98 00034080 */ sll $t0, $v1, 2 -/* 0458CC 7F010D9C 01034023 */ subu $t0, $t0, $v1 -/* 0458D0 7F010DA0 000840C0 */ sll $t0, $t0, 3 -/* 0458D4 7F010DA4 3C098003 */ lui $t1, %hi(multi_stage_setups+32) -/* 0458D8 7F010DA8 01284821 */ addu $t1, $t1, $t0 -/* 0458DC 7F010DAC 8D29B094 */ lw $t1, %lo(multi_stage_setups+32)($t1) -/* 0458E0 7F010DB0 3C018003 */ lui $at, %hi(selected_stage) -/* 0458E4 7F010DB4 24640001 */ addiu $a0, $v1, 1 -/* 0458E8 7F010DB8 0FC04034 */ jal check_if_mp_stage_unlocked -/* 0458EC 7F010DBC AC29A8F4 */ sw $t1, %lo(selected_stage)($at) -/* 0458F0 7F010DC0 1040FFF0 */ beqz $v0, .L7F010D84 -/* 0458F4 7F010DC4 00000000 */ nop -/* 0458F8 7F010DC8 10000003 */ b .L7F010DD8 -/* 0458FC 7F010DCC 240AFFFF */ li $t2, -1 -.L7F010DD0: -/* 045900 7F010DD0 AC22A8F4 */ sw $v0, %lo(selected_stage)($at) -/* 045904 7F010DD4 240AFFFF */ li $t2, -1 -.L7F010DD8: -/* 045908 7F010DD8 3C018003 */ lui $at, %hi(briefingpage) -/* 04590C 7F010DDC AC2AA8F8 */ sw $t2, %lo(briefingpage)($at) -/* 045910 7F010DE0 2404000B */ li $a0, 11 -/* 045914 7F010DE4 0FC06975 */ jal set_menu_to_mode -/* 045918 7F010DE8 24050001 */ li $a1, 1 -/* 04591C 7F010DEC 10000045 */ b .L7F010F04 -/* 045920 7F010DF0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010DF4: -/* 045924 7F010DF4 1160000F */ beqz $t3, .L7F010E34 -/* 045928 7F010DF8 8FAC0038 */ lw $t4, 0x38($sp) -/* 04592C 7F010DFC 0C002E7E */ jal joyGetControllerCount -/* 045930 7F010E00 00000000 */ nop -/* 045934 7F010E04 3C038003 */ lui $v1, %hi(selected_num_players) -/* 045938 7F010E08 8C63B520 */ lw $v1, %lo(selected_num_players)($v1) -/* 04593C 7F010E0C 24630001 */ addiu $v1, $v1, 1 -/* 045940 7F010E10 0043082A */ slt $at, $v0, $v1 -/* 045944 7F010E14 10200003 */ beqz $at, .L7F010E24 -/* 045948 7F010E18 00602025 */ move $a0, $v1 -/* 04594C 7F010E1C 10000001 */ b .L7F010E24 -/* 045950 7F010E20 24040002 */ li $a0, 2 -.L7F010E24: -/* 045954 7F010E24 0FC04182 */ jal init_mp_options_for_scenario -/* 045958 7F010E28 00000000 */ nop -/* 04595C 7F010E2C 10000035 */ b .L7F010F04 -/* 045960 7F010E30 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010E34: -/* 045964 7F010E34 11800006 */ beqz $t4, .L7F010E50 -/* 045968 7F010E38 8FAD0034 */ lw $t5, 0x34($sp) -/* 04596C 7F010E3C 24040013 */ li $a0, 19 -/* 045970 7F010E40 0FC06975 */ jal set_menu_to_mode -/* 045974 7F010E44 00002825 */ move $a1, $zero -/* 045978 7F010E48 1000002E */ b .L7F010F04 -/* 04597C 7F010E4C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010E50: -/* 045980 7F010E50 11A00006 */ beqz $t5, .L7F010E6C -/* 045984 7F010E54 8FAE0030 */ lw $t6, 0x30($sp) -/* 045988 7F010E58 24040012 */ li $a0, 18 -/* 04598C 7F010E5C 0FC06975 */ jal set_menu_to_mode -/* 045990 7F010E60 00002825 */ move $a1, $zero -/* 045994 7F010E64 10000027 */ b .L7F010F04 -/* 045998 7F010E68 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010E6C: -/* 04599C 7F010E6C 11C00005 */ beqz $t6, .L7F010E84 -/* 0459A0 7F010E70 8FAF002C */ lw $t7, 0x2c($sp) -/* 0459A4 7F010E74 0FC0405C */ jal select_game_length -/* 0459A8 7F010E78 00000000 */ nop -/* 0459AC 7F010E7C 10000021 */ b .L7F010F04 -/* 0459B0 7F010E80 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010E84: -/* 0459B4 7F010E84 11E00006 */ beqz $t7, .L7F010EA0 -/* 0459B8 7F010E88 8FB80028 */ lw $t8, 0x28($sp) -/* 0459BC 7F010E8C 2404000F */ li $a0, 15 -/* 0459C0 7F010E90 0FC06975 */ jal set_menu_to_mode -/* 0459C4 7F010E94 00002825 */ move $a1, $zero -/* 0459C8 7F010E98 1000001A */ b .L7F010F04 -/* 0459CC 7F010E9C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010EA0: -/* 0459D0 7F010EA0 13000005 */ beqz $t8, .L7F010EB8 -/* 0459D4 7F010EA4 8FB90024 */ lw $t9, 0x24($sp) -/* 0459D8 7F010EA8 0FC31974 */ jal incrementMPWeaponSet -/* 0459DC 7F010EAC 00000000 */ nop -/* 0459E0 7F010EB0 10000014 */ b .L7F010F04 -/* 0459E4 7F010EB4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010EB8: -/* 0459E8 7F010EB8 13200006 */ beqz $t9, .L7F010ED4 -/* 0459EC 7F010EBC 8FA80020 */ lw $t0, 0x20($sp) -/* 0459F0 7F010EC0 24040010 */ li $a0, 16 -/* 0459F4 7F010EC4 0FC06975 */ jal set_menu_to_mode -/* 0459F8 7F010EC8 00002825 */ move $a1, $zero -/* 0459FC 7F010ECC 1000000D */ b .L7F010F04 -/* 045A00 7F010ED0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010ED4: -/* 045A04 7F010ED4 11000006 */ beqz $t0, .L7F010EF0 -/* 045A08 7F010ED8 8FA9001C */ lw $t1, 0x1c($sp) -/* 045A0C 7F010EDC 24040011 */ li $a0, 17 -/* 045A10 7F010EE0 0FC06975 */ jal set_menu_to_mode -/* 045A14 7F010EE4 00002825 */ move $a1, $zero -/* 045A18 7F010EE8 10000006 */ b .L7F010F04 -/* 045A1C 7F010EEC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010EF0: -/* 045A20 7F010EF0 51200004 */ beql $t1, $zero, .L7F010F04 -/* 045A24 7F010EF4 8FBF0014 */ lw $ra, 0x14($sp) -/* 045A28 7F010EF8 0FC0408F */ jal advance_aim_settings_selection -/* 045A2C 7F010EFC 00000000 */ nop -/* 045A30 7F010F00 8FBF0014 */ lw $ra, 0x14($sp) -.L7F010F04: -/* 045A34 7F010F04 27BD0040 */ addiu $sp, $sp, 0x40 -/* 045A38 7F010F08 03E00008 */ jr $ra -/* 045A3C 7F010F0C 00000000 */ nop -) -#endif - - Gfx * constructor_menu0E_mpoptions(Gfx *DL) { @@ -10940,31 +4543,31 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) #endif DL = sub_GAME_7F00D5E8(DL); DL = microcode_constructor(DL); - text = langGet(TEXT(LTITLE, 0x4c)); + text = langGet(TEXT(LTITLE, TITLE_STR_76)); x = 0x37; y = 0x5f; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xff, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xff, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x4d)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_77)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0x79; if (highlight_players) { DL = microcode_constructor_related_to_menus(DL,0x37,0x78,iStack28 + 0x3c,0x87,0x32); } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0xff,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,0xff,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x4e)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_78)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0x8d; if (highlight_scenario) { DL = microcode_constructor_related_to_menus(DL,0x37,0x8c,iStack28 + 0x3c,0x9b,0x32); } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0xff,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,0xff,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x4f)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_79)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0xa1; if (highlight_gameselect) { @@ -10976,10 +4579,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x50)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_80)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0xb5; if (highlight_gamelength) { @@ -10991,10 +4594,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x51)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_81)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0xc9; if (highlight_weaponselect) { @@ -11006,10 +4609,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x52)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_82)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0xdd; if (highlight_character) { @@ -11021,10 +4624,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x53)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_83)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0xf1; if (highlight_health) { @@ -11036,10 +4639,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); text = langGet(0x9d1e); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0x105; if (highlight_controlstyle) { @@ -11051,10 +4654,10 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); - text = langGet(TEXT(LTITLE, 0x54)); - sub_GAME_7F0AE98C(&iStack24,&iStack28,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0); + text = langGet(TEXT(LTITLE, TITLE_STR_84)); + textMeasure(&iStack24,&iStack28,text,ptrFontZurichBoldChars,ptrFontZurichBold,0); x = 0x39; y = 0x119; if (highlight_aimadjustment) { @@ -11066,17 +4669,17 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); sprintf(acStack12,"%d",selected_num_players); x = 0xa0; y = 0x79; - DL = write_text_at_abs_coord(DL, &x, &y, acStack12, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xff, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, acStack12, ptrFontZurichBoldChars, ptrFontZurichBold, 0xff, viGetX(), viGetY(), 0, 0); text = langGet(mp_player_counts[scenario].stage); x = 0xa0; y = 0x8d; - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,0xff,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,0xff,viGetX(),viGetY(),0,0); text = langGet(multi_stage_setups[MP_stage_selected].folder_text_preset); x = 0xa0; @@ -11087,7 +4690,7 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); text = langGet(multi_game_lengths[game_length].text_preset); x = 0xa0; @@ -11098,7 +4701,7 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); text = langGet(*(getPtrMPWeaponSetTextID())); @@ -11110,7 +4713,7 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); text = langGet(mp_sight_adjust_table[aim_sight_adjustment].anonymous_0); x = 0xa0; @@ -11121,7 +4724,7 @@ Gfx * constructor_menu0E_mpoptions(Gfx *DL) else { entry = 0x70; } - DL = write_text_at_abs_coord(DL,&x,&y,text,ptrSecondFontTableLarge,ptrFirstFontTableLarge,entry,viGetX(),viGetY(),0,0); + DL = write_text_at_abs_coord(DL,&x,&y,text,ptrFontZurichBoldChars,ptrFontZurichBold,entry,viGetX(),viGetY(),0,0); DL = add_tab3_previous(DL); DL = add_tab1_start(DL); DL = load_draw_selected_icon_folder_select(DL); @@ -11147,311 +4750,94 @@ bool get_players_who_have_selected_mp_char(s32 character) return char_is_selected; } - -#ifdef NONMATCHING +// Address 0x7F011C3C NTSC void init_menu0f_mpcharsel(void) { - s32 temp_lo; - s32 temp_s0; - u32 temp_s1; - u32 temp_v1; - u32 temp_v1_2; - u32 temp_v1_3; - void *temp_s2; - void *temp_v0; - void *phi_s1; - void *phi_v0; - void *phi_v0_2; - void *phi_v0_3; - void *phi_s2; - s32 phi_s0; - s32 phi_s0_2; - + s32 i; + tab_start_selected = 0; tab_next_selected = 0; tab_prev_selected = 0; tab_prev_highlight = 0; tab_next_highlight = 0; tab_start_highlight = 0; - phi_s1 = &mp_chr_setup; -loop_1: - temp_lo = (phi_s1->unk3 * 4) * 0xc; - temp_v0 = mpcharselimages + temp_lo; - phi_v0 = temp_v0; - if ((u32) *temp_v0 < 0xbb8U) - { - texLoadFromTextureNum(*temp_v0, 0, *temp_v0); - phi_v0 = mpcharselimages + temp_lo; - } - temp_v1 = phi_v0->unkC; - phi_v0_2 = phi_v0; - if (temp_v1 < 0xbb8U) - { - texLoadFromTextureNum(temp_v1, 0); - phi_v0_2 = mpcharselimages + temp_lo; - } - temp_v1_2 = phi_v0_2->unk18; - phi_v0_3 = phi_v0_2; - if (temp_v1_2 < 0xbb8U) - { - texLoadFromTextureNum(temp_v1_2, 0); - phi_v0_3 = mpcharselimages + temp_lo; - } - temp_v1_3 = phi_v0_3->unk24; - if (temp_v1_3 < 0xbb8U) - { - texLoadFromTextureNum(temp_v1_3, 0); - } - temp_s1 = phi_s1 + 0xc; - phi_s1 = temp_s1; - if (temp_s1 < &MP_handicap_table) + + for ( i = 0; i < 64; i += 1) { - goto loop_1; + s32 selected_photo = mp_chr_setup[i].select_photo; + + // Multiplayer character images are composed of 4 textures. + + // upper left + if (mpcharselimages[selected_photo * 4 + 0].index < (u32)(MAX_TEXTURES - 1)) + { + texLoadFromTextureNum(mpcharselimages[selected_photo * 4 + 0].index, 0); + } + + // upper right + if (mpcharselimages[selected_photo * 4 + 1].index < (u32)(MAX_TEXTURES - 1)) + { + texLoadFromTextureNum(mpcharselimages[selected_photo * 4 + 1].index, 0); + } + + // lower left + if (mpcharselimages[selected_photo * 4 + 2].index < (u32)(MAX_TEXTURES - 1)) + { + texLoadFromTextureNum(mpcharselimages[selected_photo * 4 + 2].index, 0); + } + + // lower right + if (mpcharselimages[selected_photo * 4 + 3].index < (u32)(MAX_TEXTURES - 1)) + { + texLoadFromTextureNum(mpcharselimages[selected_photo * 4 + 3].index, 0); + } } + if (num_chars_selectable_mp != 0x40) { - if ( fileIsStageUnlockedAtDifficulty(selected_folder_num, 0x11, 0) == 3) + if (fileIsStageUnlockedAtDifficulty(selected_folder_num, SP_LEVEL_CRADLE, DIFFICULTY_AGENT) == STAGESTATUS_COMPLETED) { num_chars_selectable_mp = 0x21; } else { num_chars_selectable_mp = 8; - phi_s2 = &player_1_char; -loop_14: - if (*phi_s2 >= num_chars_selectable_mp) + + for ( i = 0; i < MAX_PLAYER_COUNT; i++) { - phi_s0 = 0; - phi_s0_2 = 0; - if (num_chars_selectable_mp > 0) + if (player_char[i] >= num_chars_selectable_mp) { -loop_16: - phi_s0_2 = phi_s0; - if (get_players_who_have_selected_mp_char(phi_s0) != 0) + s32 count = 0; + + while (count < num_chars_selectable_mp) { - temp_s0 = phi_s0 + 1; - phi_s0 = temp_s0; - phi_s0_2 = temp_s0; - if (temp_s0 < num_chars_selectable_mp) + if (get_players_who_have_selected_mp_char(count) != 0) { - goto loop_16; + count++; + continue; } + + break; } + + player_char[i] = count; } - *phi_s2 = (s32) phi_s0_2; - } - temp_s2 = phi_s2 + 4; - phi_s2 = temp_s2; - if (temp_s2 != &MP_stage_selected) - { - goto loop_14; } } } - mp_char_cur_select_player = (s32) player_1_char; - mp_char_prev_select_player = (s32) player_1_char; - dword_CODE_bss_80069730 = 0; - has_selected_char_player1 = 0; - size_mp_select_image_player1 = 0; - mp_char_cur_select_player+0x4 = (s32) player_2_char; - mp_char_prev_select_player+0x4 = (s32) player_2_char; - dword_CODE_bss_80069730+0x4 = 0; - has_selected_char_player2 = 0; - size_mp_select_image_player2 = 0; - mp_char_cur_select_player+0x8 = (s32) player_3_char; - mp_char_prev_select_player+0x8 = (s32) player_3_char; - dword_CODE_bss_80069730+0x8 = 0; - has_selected_char_player3 = 0; - size_mp_select_image_player3 = 0; - mp_char_cur_select_player+0xc = (s32) player_4_char; - mp_char_prev_select_player+0xC = (s32) player_4_char; - dword_CODE_bss_80069730+0xC = 0; - has_selected_char_player4 = 0; - size_mp_select_image_player4 = 0; - load_walletbond(player_3_char, player_4_char); -} -#else -GLOBAL_ASM( -.text -glabel init_menu0f_mpcharsel -/* 04676C 7F011C3C 3C018003 */ lui $at, %hi(tab_start_selected) -/* 046770 7F011C40 AC20A8D0 */ sw $zero, %lo(tab_start_selected)($at) -/* 046774 7F011C44 3C018003 */ lui $at, %hi(tab_next_selected) -/* 046778 7F011C48 AC20A8D4 */ sw $zero, %lo(tab_next_selected)($at) -/* 04677C 7F011C4C 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 046780 7F011C50 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 046784 7F011C54 AC20A8D8 */ sw $zero, %lo(tab_prev_selected)($at) -/* 046788 7F011C58 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 04678C 7F011C5C AC20A8E4 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 046790 7F011C60 3C018003 */ lui $at, %hi(tab_next_highlight) -/* 046794 7F011C64 AFB40028 */ sw $s4, 0x28($sp) -/* 046798 7F011C68 AFB20020 */ sw $s2, 0x20($sp) -/* 04679C 7F011C6C AFB1001C */ sw $s1, 0x1c($sp) -/* 0467A0 7F011C70 AC20A8E0 */ sw $zero, %lo(tab_next_highlight)($at) -/* 0467A4 7F011C74 AFB30024 */ sw $s3, 0x24($sp) -/* 0467A8 7F011C78 3C018003 */ lui $at, %hi(tab_start_highlight) -/* 0467AC 7F011C7C 3C118003 */ lui $s1, %hi(mp_chr_setup) -/* 0467B0 7F011C80 3C128009 */ lui $s2, %hi(mpcharselimages) -/* 0467B4 7F011C84 3C148003 */ lui $s4, %hi(MP_handicap_table) -/* 0467B8 7F011C88 AFBF002C */ sw $ra, 0x2c($sp) -/* 0467BC 7F011C8C AFB00018 */ sw $s0, 0x18($sp) -/* 0467C0 7F011C90 AC20A8DC */ sw $zero, %lo(tab_start_highlight)($at) -/* 0467C4 7F011C94 2694B498 */ addiu $s4, %lo(MP_handicap_table) # addiu $s4, $s4, -0x4b68 -/* 0467C8 7F011C98 2652D130 */ addiu $s2, %lo(mpcharselimages) # addiu $s2, $s2, -0x2ed0 -/* 0467CC 7F011C9C 2631B198 */ addiu $s1, %lo(mp_chr_setup) # addiu $s1, $s1, -0x4e68 -/* 0467D0 7F011CA0 2413000C */ li $s3, 12 -/* 0467D4 7F011CA4 92230003 */ lbu $v1, 3($s1) -.L7F011CA8: -/* 0467D8 7F011CA8 8E4F0000 */ lw $t7, ($s2) -/* 0467DC 7F011CAC 00037080 */ sll $t6, $v1, 2 -/* 0467E0 7F011CB0 01D30019 */ multu $t6, $s3 -/* 0467E4 7F011CB4 00008012 */ mflo $s0 -/* 0467E8 7F011CB8 01F01021 */ addu $v0, $t7, $s0 -/* 0467EC 7F011CBC 8C460000 */ lw $a2, ($v0) -/* 0467F0 7F011CC0 2CC10BB8 */ sltiu $at, $a2, 0xbb8 -/* 0467F4 7F011CC4 10200005 */ beqz $at, .L7F011CDC -/* 0467F8 7F011CC8 00C02025 */ move $a0, $a2 -/* 0467FC 7F011CCC 0FC32FBA */ jal texLoadFromTextureNum -/* 046800 7F011CD0 00002825 */ move $a1, $zero -/* 046804 7F011CD4 8E580000 */ lw $t8, ($s2) -/* 046808 7F011CD8 03101021 */ addu $v0, $t8, $s0 -.L7F011CDC: -/* 04680C 7F011CDC 8C43000C */ lw $v1, 0xc($v0) -/* 046810 7F011CE0 2C610BB8 */ sltiu $at, $v1, 0xbb8 -/* 046814 7F011CE4 10200005 */ beqz $at, .L7F011CFC -/* 046818 7F011CE8 00602025 */ move $a0, $v1 -/* 04681C 7F011CEC 0FC32FBA */ jal texLoadFromTextureNum -/* 046820 7F011CF0 00002825 */ move $a1, $zero -/* 046824 7F011CF4 8E590000 */ lw $t9, ($s2) -/* 046828 7F011CF8 03301021 */ addu $v0, $t9, $s0 -.L7F011CFC: -/* 04682C 7F011CFC 8C430018 */ lw $v1, 0x18($v0) -/* 046830 7F011D00 2C610BB8 */ sltiu $at, $v1, 0xbb8 -/* 046834 7F011D04 10200005 */ beqz $at, .L7F011D1C -/* 046838 7F011D08 00602025 */ move $a0, $v1 -/* 04683C 7F011D0C 0FC32FBA */ jal texLoadFromTextureNum -/* 046840 7F011D10 00002825 */ move $a1, $zero -/* 046844 7F011D14 8E480000 */ lw $t0, ($s2) -/* 046848 7F011D18 01101021 */ addu $v0, $t0, $s0 -.L7F011D1C: -/* 04684C 7F011D1C 8C430024 */ lw $v1, 0x24($v0) -/* 046850 7F011D20 2C610BB8 */ sltiu $at, $v1, 0xbb8 -/* 046854 7F011D24 10200003 */ beqz $at, .L7F011D34 -/* 046858 7F011D28 00602025 */ move $a0, $v1 -/* 04685C 7F011D2C 0FC32FBA */ jal texLoadFromTextureNum -/* 046860 7F011D30 00002825 */ move $a1, $zero -.L7F011D34: -/* 046864 7F011D34 2631000C */ addiu $s1, $s1, 0xc -/* 046868 7F011D38 0234082B */ sltu $at, $s1, $s4 -/* 04686C 7F011D3C 5420FFDA */ bnezl $at, .L7F011CA8 -/* 046870 7F011D40 92230003 */ lbu $v1, 3($s1) -/* 046874 7F011D44 3C118003 */ lui $s1, %hi(num_chars_selectable_mp) -/* 046878 7F011D48 2631B194 */ addiu $s1, %lo(num_chars_selectable_mp) # addiu $s1, $s1, -0x4e6c -/* 04687C 7F011D4C 8E290000 */ lw $t1, ($s1) -/* 046880 7F011D50 24010040 */ li $at, 64 -/* 046884 7F011D54 3C048003 */ lui $a0, %hi(selected_folder_num) -/* 046888 7F011D58 11210023 */ beq $t1, $at, .L7F011DE8 -/* 04688C 7F011D5C 24050011 */ li $a1, 17 -/* 046890 7F011D60 8C84A8E8 */ lw $a0, %lo(selected_folder_num)($a0) -/* 046894 7F011D64 0FC078B0 */ jal fileIsStageUnlockedAtDifficulty -/* 046898 7F011D68 00003025 */ move $a2, $zero -/* 04689C 7F011D6C 24010003 */ li $at, 3 -/* 0468A0 7F011D70 14410004 */ bne $v0, $at, .L7F011D84 -/* 0468A4 7F011D74 240B0008 */ li $t3, 8 -/* 0468A8 7F011D78 240A0021 */ li $t2, 33 -/* 0468AC 7F011D7C 1000001A */ b .L7F011DE8 -/* 0468B0 7F011D80 AE2A0000 */ sw $t2, ($s1) -.L7F011D84: -/* 0468B4 7F011D84 3C128003 */ lui $s2, %hi(player_char) -/* 0468B8 7F011D88 3C138003 */ lui $s3, %hi(MP_stage_selected) -/* 0468BC 7F011D8C AE2B0000 */ sw $t3, ($s1) -/* 0468C0 7F011D90 2673B534 */ addiu $s3, %lo(MP_stage_selected) # addiu $s3, $s3, -0x4acc -/* 0468C4 7F011D94 2652B524 */ addiu $s2, %lo(player_char) # addiu $s2, $s2, -0x4adc -/* 0468C8 7F011D98 8E220000 */ lw $v0, ($s1) -.L7F011D9C: -/* 0468CC 7F011D9C 8E4C0000 */ lw $t4, ($s2) -/* 0468D0 7F011DA0 0182082A */ slt $at, $t4, $v0 -/* 0468D4 7F011DA4 5420000E */ bnezl $at, .L7F011DE0 -/* 0468D8 7F011DA8 26520004 */ addiu $s2, $s2, 4 -/* 0468DC 7F011DAC 1840000A */ blez $v0, .L7F011DD8 -/* 0468E0 7F011DB0 00008025 */ move $s0, $zero -.L7F011DB4: -/* 0468E4 7F011DB4 0FC046F6 */ jal get_players_who_have_selected_mp_char -/* 0468E8 7F011DB8 02002025 */ move $a0, $s0 -/* 0468EC 7F011DBC 50400007 */ beql $v0, $zero, .L7F011DDC -/* 0468F0 7F011DC0 AE500000 */ sw $s0, ($s2) -/* 0468F4 7F011DC4 8E2D0000 */ lw $t5, ($s1) -/* 0468F8 7F011DC8 26100001 */ addiu $s0, $s0, 1 -/* 0468FC 7F011DCC 020D082A */ slt $at, $s0, $t5 -/* 046900 7F011DD0 1420FFF8 */ bnez $at, .L7F011DB4 -/* 046904 7F011DD4 00000000 */ nop -.L7F011DD8: -/* 046908 7F011DD8 AE500000 */ sw $s0, ($s2) -.L7F011DDC: -/* 04690C 7F011DDC 26520004 */ addiu $s2, $s2, 4 -.L7F011DE0: -/* 046910 7F011DE0 5653FFEE */ bnel $s2, $s3, .L7F011D9C -/* 046914 7F011DE4 8E220000 */ lw $v0, ($s1) -.L7F011DE8: -/* 046918 7F011DE8 3C028003 */ lui $v0, %hi(player_char) -/* 04691C 7F011DEC 8C42B524 */ lw $v0, %lo(player_char)($v0) -/* 046920 7F011DF0 3C018007 */ lui $at, %hi(mp_char_cur_select_player) -/* 046924 7F011DF4 3C038003 */ lui $v1, %hi(player_char+0x04) -/* 046928 7F011DF8 AC229710 */ sw $v0, %lo(mp_char_cur_select_player)($at) -/* 04692C 7F011DFC 3C018007 */ lui $at, %hi(mp_char_prev_select_player) -/* 046930 7F011E00 AC229720 */ sw $v0, %lo(mp_char_prev_select_player)($at) -/* 046934 7F011E04 3C018007 */ lui $at, %hi(dword_CODE_bss_80069730) -/* 046938 7F011E08 AC209730 */ sw $zero, %lo(dword_CODE_bss_80069730)($at) -/* 04693C 7F011E0C 3C018007 */ lui $at, %hi(player_has_selected_char) -/* 046940 7F011E10 AC209740 */ sw $zero, %lo(player_has_selected_char)($at) -/* 046944 7F011E14 8C63B528 */ lw $v1, %lo(player_char+0x04)($v1) -/* 046948 7F011E18 3C018007 */ lui $at, %hi(size_mp_select_image_player1) -/* 04694C 7F011E1C AC209750 */ sw $zero, %lo(size_mp_select_image_player1)($at) -/* 046950 7F011E20 3C018007 */ lui $at, %hi(mp_char_cur_select_player+0x4) -/* 046954 7F011E24 AC239714 */ sw $v1, %lo(mp_char_cur_select_player+0x4)($at) -/* 046958 7F011E28 3C018007 */ lui $at, %hi(mp_char_prev_select_player+0x4) -/* 04695C 7F011E2C AC239724 */ sw $v1, %lo(mp_char_prev_select_player+0x4)($at) -/* 046960 7F011E30 3C018007 */ lui $at, %hi(dword_CODE_bss_80069730+0x4) -/* 046964 7F011E34 AC209734 */ sw $zero, %lo(dword_CODE_bss_80069730+0x4)($at) -/* 046968 7F011E38 3C018007 */ lui $at, %hi(player_has_selected_char+0x4) -/* 04696C 7F011E3C AC209744 */ sw $zero, %lo(player_has_selected_char+0x4)($at) -/* 046970 7F011E40 3C048003 */ lui $a0, %hi(player_char+0x08) -/* 046974 7F011E44 8C84B52C */ lw $a0, %lo(player_char+0x08)($a0) -/* 046978 7F011E48 3C018007 */ lui $at, %hi(size_mp_select_image_player2) -/* 04697C 7F011E4C AC209754 */ sw $zero, %lo(size_mp_select_image_player2)($at) -/* 046980 7F011E50 3C018007 */ lui $at, %hi(mp_char_cur_select_player+0x8) -/* 046984 7F011E54 AC249718 */ sw $a0, %lo(mp_char_cur_select_player+0x8)($at) -/* 046988 7F011E58 3C018007 */ lui $at, %hi(mp_char_prev_select_player+0x8) -/* 04698C 7F011E5C AC249728 */ sw $a0, %lo(mp_char_prev_select_player+0x8)($at) -/* 046990 7F011E60 3C018007 */ lui $at, %hi(dword_CODE_bss_80069730+0x8) -/* 046994 7F011E64 AC209738 */ sw $zero, %lo(dword_CODE_bss_80069730+0x8)($at) -/* 046998 7F011E68 3C018007 */ lui $at, %hi(player_has_selected_char+0x8) -/* 04699C 7F011E6C AC209748 */ sw $zero, %lo(player_has_selected_char+0x8)($at) -/* 0469A0 7F011E70 3C058003 */ lui $a1, %hi(player_char+0x0C) -/* 0469A4 7F011E74 8CA5B530 */ lw $a1, %lo(player_char+0x0C)($a1) -/* 0469A8 7F011E78 3C018007 */ lui $at, %hi(size_mp_select_image_player3) -/* 0469AC 7F011E7C AC209758 */ sw $zero, %lo(size_mp_select_image_player3)($at) -/* 0469B0 7F011E80 3C018007 */ lui $at, %hi(mp_char_cur_select_player+0xc) -/* 0469B4 7F011E84 AC25971C */ sw $a1, %lo(mp_char_cur_select_player+0xc)($at) -/* 0469B8 7F011E88 3C018007 */ lui $at, %hi(mp_char_prev_select_player+0xC) -/* 0469BC 7F011E8C AC25972C */ sw $a1, %lo(mp_char_prev_select_player+0xC)($at) -/* 0469C0 7F011E90 3C018007 */ lui $at, %hi(dword_CODE_bss_80069730+0xC) -/* 0469C4 7F011E94 AC20973C */ sw $zero, %lo(dword_CODE_bss_80069730+0xC)($at) -/* 0469C8 7F011E98 3C018007 */ lui $at, %hi(player_has_selected_char+0xC) -/* 0469CC 7F011E9C AC20974C */ sw $zero, %lo(player_has_selected_char+0xC)($at) -/* 0469D0 7F011EA0 3C018007 */ lui $at, %hi(size_mp_select_image_player4) -/* 0469D4 7F011EA4 0FC02E2B */ jal load_walletbond -/* 0469D8 7F011EA8 AC20975C */ sw $zero, %lo(size_mp_select_image_player4)($at) -/* 0469DC 7F011EAC 8FBF002C */ lw $ra, 0x2c($sp) -/* 0469E0 7F011EB0 8FB00018 */ lw $s0, 0x18($sp) -/* 0469E4 7F011EB4 8FB1001C */ lw $s1, 0x1c($sp) -/* 0469E8 7F011EB8 8FB20020 */ lw $s2, 0x20($sp) -/* 0469EC 7F011EBC 8FB30024 */ lw $s3, 0x24($sp) -/* 0469F0 7F011EC0 8FB40028 */ lw $s4, 0x28($sp) -/* 0469F4 7F011EC4 03E00008 */ jr $ra -/* 0469F8 7F011EC8 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif + + for (i = 0; i < MAX_PLAYER_COUNT; i++) + { + mp_char_cur_select_player[i] = player_char[i]; + mp_char_prev_select_player[i] = player_char[i]; + dword_CODE_bss_80069730[i] = 0; + player_has_selected_char[i] = 0; + size_mp_select_image_player[i] = 0; + } + + load_walletbond(); +} + //******************************************************************************************************** @@ -11463,423 +4849,127 @@ void update_menu0F_mpcharsel(void) { - -#ifdef NONMATCHING +// Address 0x7F011ED4 NTSC void interface_menu0F_mpcharsel(void) - { - int iVar1; - int iVar2; - int iVar4; - s32 uVar3; - u32 BVar5; - int iVar6; - int iVar7; - char controller; - int *piVar8; - int *piVar9; - int iVar10; - u32 *pBVar11; - int *piVar12; - int iVar13; - int iStack12; - - iVar4 = get_selected_num_players(); - iStack12 = 0; - viSetFovY(60.00000000); - viSetAspect((f32)flt_80051A88); - viSetZRange(100.00000000,(f32)flt_80051A8C); - viSetUseZBuf(0); - iVar13 = 0; - iVar10 = 0; - if (0 < iVar4) { - piVar9 = &mp_unknown1_player1; - piVar8 = &mp_char_cur_select_player; - piVar12 = &mp_char_prev_select_player; - pBVar11 = &has_selected_char_player1; - do { - controller = (char)iVar13; - if (*pBVar11 != FALSE) { - iVar6 = *(int *)((int)&size_mp_select_image_player1 + iVar10); - if ((iVar6 < 0xb) && (*piVar12 == *piVar8)) { - *(int *)((int)&size_mp_select_image_player1 + iVar10) = iVar6 + 1; - } - uVar3 = joyGetButtonsPressedThisFrame(controller,B_BUTTON); - if (uVar3 != 0) { - *pBVar11 = FALSE; - sndPlaySfx((s32)(int)g_musicSfxBufferPtr,DOOR_METAL_CLOSE2_SFX,NULL); - } - } - if ((*pBVar11 == FALSE) && - (iVar6 = *(int *)((int)&size_mp_select_image_player1 + iVar10), 0 < iVar6)) { - *(int *)((int)&size_mp_select_image_player1 + iVar10) = iVar6 + -1; -LAB_7f012164: - iVar6 = *piVar12; - } - else { - if (*pBVar11 != FALSE) goto LAB_7f012164; - uVar3 = joyGetButtonsPressedThisFrame(controller,L_CBUTTONS|L_JPAD); - if (uVar3 != 0) { - if (0 < *piVar8) { - *piVar8 = *piVar8 + -1; - } - goto LAB_7f012164; + s32 numplayers; + s32 padding; + s32 ready_players; + s32 padding2; + s32 i; + s32 temp_v1_3; + + numplayers = get_selected_num_players(); + ready_players = 0; + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); + viSetUseZBuf(0); + + for (i = 0; i < numplayers; i++) + { + if (player_has_selected_char[i]) + { + if ((size_mp_select_image_player[i] < 0xb) && (mp_char_prev_select_player[i] == mp_char_cur_select_player[i])) + { + size_mp_select_image_player[i] = size_mp_select_image_player[i] + 1; + } + + if (joyGetButtonsPressedThisFrame(i, B_BUTTON)) + { + player_has_selected_char[i] = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } } - uVar3 = joyGetButtonsPressedThisFrame(controller,R_CBUTTONS|R_JPAD); - if (uVar3 != 0) { - if (*piVar8 < (int)(num_chars_selectable_mp - 1)) { - *piVar8 = *piVar8 + 1; - } - goto LAB_7f012164; + + if (player_has_selected_char[i] == 0 && size_mp_select_image_player[i] > 0) + { + size_mp_select_image_player[i] = size_mp_select_image_player[i] - 1; } - uVar3 = joyGetButtonsPressedThisFrame(controller,START_BUTTON|Z_TRIG|A_BUTTON); - if (uVar3 == 0) { - iVar6 = joyGetStickXInRange(controller,-2,1); - if (iVar6 < 1) { - iVar6 = joyGetStickXInRange(controller,-2,1); - if (iVar6 < -1) { - if (*piVar9 == 0) { - if (0 < *piVar8) { - *piVar8 = *piVar8 + -1; + else if (player_has_selected_char[i] == 0) + { + if (joyGetButtonsPressedThisFrame(i, L_JPAD|L_CBUTTONS)) // 0x202 + { + if (mp_char_cur_select_player[i] > 0) + { + mp_char_cur_select_player[i]--; } - goto LAB_7f012164; - } - iVar6 = *piVar12; } - else { - iVar6 = *piVar12; + else if (joyGetButtonsPressedThisFrame(i, R_JPAD|R_CBUTTONS)) // 0x101 + { + if (mp_char_cur_select_player[i] < (num_chars_selectable_mp - 1)) + { + mp_char_cur_select_player[i]++; + } + } + else if (joyGetButtonsPressedThisFrame(i, A_BUTTON|Z_TRIG|START_BUTTON)) // 0xb000 + { + if (get_players_who_have_selected_mp_char(mp_char_cur_select_player[i]) == 0) + { + player_char[i] = mp_char_cur_select_player[i]; + size_mp_select_image_player[i] = 1; + player_has_selected_char[i] = 1; + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + } + else if (joyGetStickXInRange(i, -2, 1) > 0) + { + if (dword_CODE_bss_80069730[i] == 0) + { + if (mp_char_cur_select_player[i] < (num_chars_selectable_mp - 1)) + { + mp_char_cur_select_player[i]++; + } + } } - } - else { - if (*piVar9 == 0) { - if (*piVar8 < (int)(num_chars_selectable_mp - 1)) { - *piVar8 = *piVar8 + 1; - } - goto LAB_7f012164; + else if ((joyGetStickXInRange(i, -2, 1) < -1) && (dword_CODE_bss_80069730[i] == 0)) + { + if (mp_char_cur_select_player[i] > 0) + { + mp_char_cur_select_player[i]--; + } } - iVar6 = *piVar12; - } } - else { - BVar5 = hasPlayerSelectedMPChar(*piVar8); - if (BVar5 != FALSE) goto LAB_7f012164; - *(int *)((int)&player_1_char + iVar10) = *piVar8; - *(s32 *)((int)&size_mp_select_image_player1 + iVar10) = 1; - *pBVar11 = TRUE; - sndPlaySfx((s32)(int)g_musicSfxBufferPtr,DOOR_METAL_CLOSE2_SFX,NULL); - iVar6 = *piVar12; + + temp_v1_3 = (mp_char_prev_select_player[i] * 0x54) + dword_CODE_bss_80069730[i]; + + if (mp_char_cur_select_player[i] * 0x54 < temp_v1_3) + { + dword_CODE_bss_80069730[i] -= 0xc; + if (dword_CODE_bss_80069730[i] < 0) + { + dword_CODE_bss_80069730[i] += 0x54; + mp_char_prev_select_player[i]--; + } } - } - iVar1 = *piVar8; - iVar2 = *piVar9; - iVar13 += 1; - piVar8 = piVar8 + 1; - BVar5 = *pBVar11; - iVar7 = iVar2 + iVar6 * 0x54; - if (iVar1 * 0x54 < iVar7) { - *piVar9 = iVar2 + -0xc; - if (iVar2 + -0xc < 0) { - *piVar9 = iVar2 + 0x48; - *piVar12 = iVar6 + -1; + else if (temp_v1_3 < mp_char_cur_select_player[i] * 0x54) + { + dword_CODE_bss_80069730[i] += 0xC; + if (dword_CODE_bss_80069730[i] >= 0x54) + { + dword_CODE_bss_80069730[i] -= 0x54; + mp_char_prev_select_player[i]++; + } } - } - else { - if ((iVar7 < iVar1 * 0x54) && (*piVar9 = iVar2 + 0xc, 0x53 < iVar2 + 0xc)) { - *piVar9 = iVar2 + -0x48; - *piVar12 = iVar6 + 1; + + if (player_has_selected_char[i] != 0 && size_mp_select_image_player[i] == 0xb) + { + ready_players++; } - } - if ((BVar5 != FALSE) && (*(int *)((int)&size_mp_select_image_player1 + iVar10) == 0xb)) { - iStack12 = iStack12 + 1; - } - iVar10 += 4; - piVar12 = piVar12 + 1; - piVar9 = piVar9 + 1; - pBVar11 = pBVar11 + 1; - } while (iVar13 != iVar4); - } - disable_all_switches((int)walletinst[0]); - set_item_visibility_in_objinstance((int)walletinst[0],0,1); - set_item_visibility_in_objinstance((int)walletinst[0],0x2a,1); - menu_control_stick_tracking(); - if (iStack12 == iVar4) { - set_menu_to_mode(MENU_MP_OPTIONS,0); - } - return; + } + + disable_all_switches(walletinst[0]); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); + menu_control_stick_tracking(); + + if (ready_players == numplayers) + { + frontChangeMenu(MENU_MP_OPTIONS, 0); + } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80051A88 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051A8C -.word 0x461C4000 /*10000.0;*/ -.text -glabel interface_menu0F_mpcharsel -/* 046A04 7F011ED4 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 046A08 7F011ED8 AFBF003C */ sw $ra, 0x3c($sp) -/* 046A0C 7F011EDC AFBE0038 */ sw $fp, 0x38($sp) -/* 046A10 7F011EE0 AFB70034 */ sw $s7, 0x34($sp) -/* 046A14 7F011EE4 AFB60030 */ sw $s6, 0x30($sp) -/* 046A18 7F011EE8 AFB5002C */ sw $s5, 0x2c($sp) -/* 046A1C 7F011EEC AFB40028 */ sw $s4, 0x28($sp) -/* 046A20 7F011EF0 AFB30024 */ sw $s3, 0x24($sp) -/* 046A24 7F011EF4 AFB20020 */ sw $s2, 0x20($sp) -/* 046A28 7F011EF8 AFB1001C */ sw $s1, 0x1c($sp) -/* 046A2C 7F011EFC 0FC040A4 */ jal get_selected_num_players -/* 046A30 7F011F00 AFB00018 */ sw $s0, 0x18($sp) -/* 046A34 7F011F04 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 046A38 7F011F08 44816000 */ mtc1 $at, $f12 -/* 046A3C 7F011F0C AFA2004C */ sw $v0, 0x4c($sp) -/* 046A40 7F011F10 0C001151 */ jal viSetFovY -/* 046A44 7F011F14 AFA00044 */ sw $zero, 0x44($sp) -/* 046A48 7F011F18 3C018005 */ lui $at, %hi(D_80051A88) -/* 046A4C 7F011F1C 0C001164 */ jal viSetAspect -/* 046A50 7F011F20 C42C1A88 */ lwc1 $f12, %lo(D_80051A88)($at) -/* 046A54 7F011F24 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 046A58 7F011F28 44816000 */ mtc1 $at, $f12 -/* 046A5C 7F011F2C 3C018005 */ lui $at, %hi(D_80051A8C) -/* 046A60 7F011F30 0C001194 */ jal viSetZRange -/* 046A64 7F011F34 C42E1A8C */ lwc1 $f14, %lo(D_80051A8C)($at) -/* 046A68 7F011F38 0C00114D */ jal viSetUseZBuf -/* 046A6C 7F011F3C 00002025 */ move $a0, $zero -/* 046A70 7F011F40 8FAE004C */ lw $t6, 0x4c($sp) -/* 046A74 7F011F44 0000B025 */ move $s6, $zero -/* 046A78 7F011F48 00009825 */ move $s3, $zero -/* 046A7C 7F011F4C 19C000B6 */ blez $t6, .L7F012228 -/* 046A80 7F011F50 3C148007 */ lui $s4, %hi(player_has_selected_char) -/* 046A84 7F011F54 3C158007 */ lui $s5, %hi(mp_char_prev_select_player) -/* 046A88 7F011F58 3C118007 */ lui $s1, %hi(mp_char_cur_select_player) -/* 046A8C 7F011F5C 3C128007 */ lui $s2, %hi(dword_CODE_bss_80069730) -/* 046A90 7F011F60 3C1E8006 */ lui $fp, %hi(g_musicSfxBufferPtr) -/* 046A94 7F011F64 3C178007 */ lui $s7, %hi(size_mp_select_image_player1) -/* 046A98 7F011F68 26F79750 */ addiu $s7, %lo(size_mp_select_image_player1) # addiu $s7, $s7, -0x68b0 -/* 046A9C 7F011F6C 27DE3720 */ addiu $fp, %lo(g_musicSfxBufferPtr) # addiu $fp, $fp, 0x3720 -/* 046AA0 7F011F70 26529730 */ addiu $s2, %lo(dword_CODE_bss_80069730) # addiu $s2, $s2, -0x68d0 -/* 046AA4 7F011F74 26319710 */ addiu $s1, %lo(mp_char_cur_select_player) # addiu $s1, $s1, -0x68f0 -/* 046AA8 7F011F78 26B59720 */ addiu $s5, %lo(mp_char_prev_select_player) # addiu $s5, $s5, -0x68e0 -/* 046AAC 7F011F7C 26949740 */ addiu $s4, %lo(player_has_selected_char) # addiu $s4, $s4, -0x68c0 -.L7F011F80: -/* 046AB0 7F011F80 8E8F0000 */ lw $t7, ($s4) -/* 046AB4 7F011F84 00162600 */ sll $a0, $s6, 0x18 -/* 046AB8 7F011F88 02F31021 */ addu $v0, $s7, $s3 -/* 046ABC 7F011F8C 11E00014 */ beqz $t7, .L7F011FE0 -/* 046AC0 7F011F90 00044E03 */ sra $t1, $a0, 0x18 -/* 046AC4 7F011F94 8C430000 */ lw $v1, ($v0) -/* 046AC8 7F011F98 01202025 */ move $a0, $t1 -/* 046ACC 7F011F9C 2861000B */ slti $at, $v1, 0xb -/* 046AD0 7F011FA0 10200007 */ beqz $at, .L7F011FC0 -/* 046AD4 7F011FA4 00000000 */ nop -/* 046AD8 7F011FA8 8EB80000 */ lw $t8, ($s5) -/* 046ADC 7F011FAC 8E390000 */ lw $t9, ($s1) -/* 046AE0 7F011FB0 24680001 */ addiu $t0, $v1, 1 -/* 046AE4 7F011FB4 17190002 */ bne $t8, $t9, .L7F011FC0 -/* 046AE8 7F011FB8 00000000 */ nop -/* 046AEC 7F011FBC AC480000 */ sw $t0, ($v0) -.L7F011FC0: -/* 046AF0 7F011FC0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 046AF4 7F011FC4 24054000 */ li $a1, 16384 -/* 046AF8 7F011FC8 10400005 */ beqz $v0, .L7F011FE0 -/* 046AFC 7F011FCC 240500C7 */ li $a1, 199 -/* 046B00 7F011FD0 AE800000 */ sw $zero, ($s4) -/* 046B04 7F011FD4 8FC40000 */ lw $a0, ($fp) -/* 046B08 7F011FD8 0C002382 */ jal sndPlaySfx -/* 046B0C 7F011FDC 00003025 */ move $a2, $zero -.L7F011FE0: -/* 046B10 7F011FE0 8E860000 */ lw $a2, ($s4) -/* 046B14 7F011FE4 02F31021 */ addu $v0, $s7, $s3 -/* 046B18 7F011FE8 14C00006 */ bnez $a2, .L7F012004 -/* 046B1C 7F011FEC 00000000 */ nop -/* 046B20 7F011FF0 8C430000 */ lw $v1, ($v0) -/* 046B24 7F011FF4 18600003 */ blez $v1, .L7F012004 -/* 046B28 7F011FF8 246AFFFF */ addiu $t2, $v1, -1 -/* 046B2C 7F011FFC 10000059 */ b .L7F012164 -/* 046B30 7F012000 AC4A0000 */ sw $t2, ($v0) -.L7F012004: -/* 046B34 7F012004 14C00057 */ bnez $a2, .L7F012164 -/* 046B38 7F012008 00168600 */ sll $s0, $s6, 0x18 -/* 046B3C 7F01200C 00105E03 */ sra $t3, $s0, 0x18 -/* 046B40 7F012010 000B2600 */ sll $a0, $t3, 0x18 -/* 046B44 7F012014 00046603 */ sra $t4, $a0, 0x18 -/* 046B48 7F012018 01802025 */ move $a0, $t4 -/* 046B4C 7F01201C 01608025 */ move $s0, $t3 -/* 046B50 7F012020 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 046B54 7F012024 24050202 */ li $a1, 514 -/* 046B58 7F012028 10400006 */ beqz $v0, .L7F012044 -/* 046B5C 7F01202C 00102600 */ sll $a0, $s0, 0x18 -/* 046B60 7F012030 8E220000 */ lw $v0, ($s1) -/* 046B64 7F012034 1840004B */ blez $v0, .L7F012164 -/* 046B68 7F012038 244DFFFF */ addiu $t5, $v0, -1 -/* 046B6C 7F01203C 10000049 */ b .L7F012164 -/* 046B70 7F012040 AE2D0000 */ sw $t5, ($s1) -.L7F012044: -/* 046B74 7F012044 00047603 */ sra $t6, $a0, 0x18 -/* 046B78 7F012048 01C02025 */ move $a0, $t6 -/* 046B7C 7F01204C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 046B80 7F012050 24050101 */ li $a1, 257 -/* 046B84 7F012054 1040000A */ beqz $v0, .L7F012080 -/* 046B88 7F012058 00102600 */ sll $a0, $s0, 0x18 -/* 046B8C 7F01205C 3C0F8003 */ lui $t7, %hi(num_chars_selectable_mp) -/* 046B90 7F012060 8DEFB194 */ lw $t7, %lo(num_chars_selectable_mp)($t7) -/* 046B94 7F012064 8E220000 */ lw $v0, ($s1) -/* 046B98 7F012068 25F8FFFF */ addiu $t8, $t7, -1 -/* 046B9C 7F01206C 0058082A */ slt $at, $v0, $t8 -/* 046BA0 7F012070 1020003C */ beqz $at, .L7F012164 -/* 046BA4 7F012074 24590001 */ addiu $t9, $v0, 1 -/* 046BA8 7F012078 1000003A */ b .L7F012164 -/* 046BAC 7F01207C AE390000 */ sw $t9, ($s1) -.L7F012080: -/* 046BB0 7F012080 00044603 */ sra $t0, $a0, 0x18 -/* 046BB4 7F012084 01002025 */ move $a0, $t0 -/* 046BB8 7F012088 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 046BBC 7F01208C 3405B000 */ li $a1, 45056 -/* 046BC0 7F012090 10400012 */ beqz $v0, .L7F0120DC -/* 046BC4 7F012094 00102600 */ sll $a0, $s0, 0x18 -/* 046BC8 7F012098 0FC046F6 */ jal get_players_who_have_selected_mp_char -/* 046BCC 7F01209C 8E240000 */ lw $a0, ($s1) -/* 046BD0 7F0120A0 14400030 */ bnez $v0, .L7F012164 -/* 046BD4 7F0120A4 3C018003 */ lui $at, %hi(player_char) -/* 046BD8 7F0120A8 8E290000 */ lw $t1, ($s1) -/* 046BDC 7F0120AC 00330821 */ addu $at, $at, $s3 -/* 046BE0 7F0120B0 24020001 */ li $v0, 1 -/* 046BE4 7F0120B4 02F35021 */ addu $t2, $s7, $s3 -/* 046BE8 7F0120B8 AC29B524 */ sw $t1, %lo(player_char)($at) -/* 046BEC 7F0120BC AD420000 */ sw $v0, ($t2) -/* 046BF0 7F0120C0 AE820000 */ sw $v0, ($s4) -/* 046BF4 7F0120C4 8FC40000 */ lw $a0, ($fp) -/* 046BF8 7F0120C8 240500C7 */ li $a1, 199 -/* 046BFC 7F0120CC 0C002382 */ jal sndPlaySfx -/* 046C00 7F0120D0 00003025 */ move $a2, $zero -/* 046C04 7F0120D4 10000024 */ b .L7F012168 -/* 046C08 7F0120D8 8EA50000 */ lw $a1, ($s5) -.L7F0120DC: -/* 046C0C 7F0120DC 00045E03 */ sra $t3, $a0, 0x18 -/* 046C10 7F0120E0 01602025 */ move $a0, $t3 -/* 046C14 7F0120E4 2405FFFE */ li $a1, -2 -/* 046C18 7F0120E8 0C00312D */ jal joyGetStickXInRange -/* 046C1C 7F0120EC 24060001 */ li $a2, 1 -/* 046C20 7F0120F0 1840000D */ blez $v0, .L7F012128 -/* 046C24 7F0120F4 00102600 */ sll $a0, $s0, 0x18 -/* 046C28 7F0120F8 8E4C0000 */ lw $t4, ($s2) -/* 046C2C 7F0120FC 3C0D8003 */ lui $t5, %hi(num_chars_selectable_mp) -/* 046C30 7F012100 55800019 */ bnezl $t4, .L7F012168 -/* 046C34 7F012104 8EA50000 */ lw $a1, ($s5) -/* 046C38 7F012108 8DADB194 */ lw $t5, %lo(num_chars_selectable_mp)($t5) -/* 046C3C 7F01210C 8E220000 */ lw $v0, ($s1) -/* 046C40 7F012110 25AEFFFF */ addiu $t6, $t5, -1 -/* 046C44 7F012114 004E082A */ slt $at, $v0, $t6 -/* 046C48 7F012118 10200012 */ beqz $at, .L7F012164 -/* 046C4C 7F01211C 244F0001 */ addiu $t7, $v0, 1 -/* 046C50 7F012120 10000010 */ b .L7F012164 -/* 046C54 7F012124 AE2F0000 */ sw $t7, ($s1) -.L7F012128: -/* 046C58 7F012128 0004C603 */ sra $t8, $a0, 0x18 -/* 046C5C 7F01212C 03002025 */ move $a0, $t8 -/* 046C60 7F012130 2405FFFE */ li $a1, -2 -/* 046C64 7F012134 0C00312D */ jal joyGetStickXInRange -/* 046C68 7F012138 24060001 */ li $a2, 1 -/* 046C6C 7F01213C 2841FFFF */ slti $at, $v0, -1 -/* 046C70 7F012140 50200009 */ beql $at, $zero, .L7F012168 -/* 046C74 7F012144 8EA50000 */ lw $a1, ($s5) -/* 046C78 7F012148 8E590000 */ lw $t9, ($s2) -/* 046C7C 7F01214C 57200006 */ bnezl $t9, .L7F012168 -/* 046C80 7F012150 8EA50000 */ lw $a1, ($s5) -/* 046C84 7F012154 8E220000 */ lw $v0, ($s1) -/* 046C88 7F012158 18400002 */ blez $v0, .L7F012164 -/* 046C8C 7F01215C 2448FFFF */ addiu $t0, $v0, -1 -/* 046C90 7F012160 AE280000 */ sw $t0, ($s1) -.L7F012164: -/* 046C94 7F012164 8EA50000 */ lw $a1, ($s5) -.L7F012168: -/* 046C98 7F012168 24070054 */ li $a3, 84 -/* 046C9C 7F01216C 8E2A0000 */ lw $t2, ($s1) -/* 046CA0 7F012170 00A70019 */ multu $a1, $a3 -/* 046CA4 7F012174 8E420000 */ lw $v0, ($s2) -/* 046CA8 7F012178 26D60001 */ addiu $s6, $s6, 1 -/* 046CAC 7F01217C 26940004 */ addiu $s4, $s4, 4 -/* 046CB0 7F012180 26310004 */ addiu $s1, $s1, 4 -/* 046CB4 7F012184 8E86FFFC */ lw $a2, -4($s4) -/* 046CB8 7F012188 02F3C821 */ addu $t9, $s7, $s3 -/* 046CBC 7F01218C 244BFFF4 */ addiu $t3, $v0, -0xc -/* 046CC0 7F012190 00004812 */ mflo $t1 -/* 046CC4 7F012194 00491821 */ addu $v1, $v0, $t1 -/* 046CC8 7F012198 00000000 */ nop -/* 046CCC 7F01219C 01470019 */ multu $t2, $a3 -/* 046CD0 7F0121A0 00002012 */ mflo $a0 -/* 046CD4 7F0121A4 0083082A */ slt $at, $a0, $v1 -/* 046CD8 7F0121A8 50200009 */ beql $at, $zero, .L7F0121D0 -/* 046CDC 7F0121AC 0064082A */ slt $at, $v1, $a0 -/* 046CE0 7F0121B0 05610010 */ bgez $t3, .L7F0121F4 -/* 046CE4 7F0121B4 AE4B0000 */ sw $t3, ($s2) -/* 046CE8 7F0121B8 256C0054 */ addiu $t4, $t3, 0x54 -/* 046CEC 7F0121BC 24ADFFFF */ addiu $t5, $a1, -1 -/* 046CF0 7F0121C0 AE4C0000 */ sw $t4, ($s2) -/* 046CF4 7F0121C4 1000000B */ b .L7F0121F4 -/* 046CF8 7F0121C8 AEAD0000 */ sw $t5, ($s5) -/* 046CFC 7F0121CC 0064082A */ slt $at, $v1, $a0 -.L7F0121D0: -/* 046D00 7F0121D0 10200008 */ beqz $at, .L7F0121F4 -/* 046D04 7F0121D4 244E000C */ addiu $t6, $v0, 0xc -/* 046D08 7F0121D8 29C10054 */ slti $at, $t6, 0x54 -/* 046D0C 7F0121DC 14200005 */ bnez $at, .L7F0121F4 -/* 046D10 7F0121E0 AE4E0000 */ sw $t6, ($s2) -/* 046D14 7F0121E4 25CFFFAC */ addiu $t7, $t6, -0x54 -/* 046D18 7F0121E8 24B80001 */ addiu $t8, $a1, 1 -/* 046D1C 7F0121EC AE4F0000 */ sw $t7, ($s2) -/* 046D20 7F0121F0 AEB80000 */ sw $t8, ($s5) -.L7F0121F4: -/* 046D24 7F0121F4 50C00008 */ beql $a2, $zero, .L7F012218 -/* 046D28 7F0121F8 8FAB004C */ lw $t3, 0x4c($sp) -/* 046D2C 7F0121FC 8F280000 */ lw $t0, ($t9) -/* 046D30 7F012200 8FA90044 */ lw $t1, 0x44($sp) -/* 046D34 7F012204 2401000B */ li $at, 11 -/* 046D38 7F012208 15010002 */ bne $t0, $at, .L7F012214 -/* 046D3C 7F01220C 252A0001 */ addiu $t2, $t1, 1 -/* 046D40 7F012210 AFAA0044 */ sw $t2, 0x44($sp) -.L7F012214: -/* 046D44 7F012214 8FAB004C */ lw $t3, 0x4c($sp) -.L7F012218: -/* 046D48 7F012218 26730004 */ addiu $s3, $s3, 4 -/* 046D4C 7F01221C 26B50004 */ addiu $s5, $s5, 4 -/* 046D50 7F012220 16CBFF57 */ bne $s6, $t3, .L7F011F80 -/* 046D54 7F012224 26520004 */ addiu $s2, $s2, 4 -.L7F012228: -/* 046D58 7F012228 3C108003 */ lui $s0, %hi(walletinst) -/* 046D5C 7F01222C 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 046D60 7F012230 0FC02DC9 */ jal disable_all_switches -/* 046D64 7F012234 8E040000 */ lw $a0, ($s0) -/* 046D68 7F012238 8E040000 */ lw $a0, ($s0) -/* 046D6C 7F01223C 00002825 */ move $a1, $zero -/* 046D70 7F012240 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 046D74 7F012244 24060001 */ li $a2, 1 -/* 046D78 7F012248 8E040000 */ lw $a0, ($s0) -/* 046D7C 7F01224C 2405002A */ li $a1, 42 -/* 046D80 7F012250 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 046D84 7F012254 24060001 */ li $a2, 1 -/* 046D88 7F012258 0FC026E1 */ jal menu_control_stick_tracking -/* 046D8C 7F01225C 00000000 */ nop -/* 046D90 7F012260 8FAC0044 */ lw $t4, 0x44($sp) -/* 046D94 7F012264 8FAD004C */ lw $t5, 0x4c($sp) -/* 046D98 7F012268 158D0003 */ bne $t4, $t5, .L7F012278 -/* 046D9C 7F01226C 2404000E */ li $a0, 14 -/* 046DA0 7F012270 0FC06975 */ jal set_menu_to_mode -/* 046DA4 7F012274 00002825 */ move $a1, $zero -.L7F012278: -/* 046DA8 7F012278 8FBF003C */ lw $ra, 0x3c($sp) -/* 046DAC 7F01227C 8FB00018 */ lw $s0, 0x18($sp) -/* 046DB0 7F012280 8FB1001C */ lw $s1, 0x1c($sp) -/* 046DB4 7F012284 8FB20020 */ lw $s2, 0x20($sp) -/* 046DB8 7F012288 8FB30024 */ lw $s3, 0x24($sp) -/* 046DBC 7F01228C 8FB40028 */ lw $s4, 0x28($sp) -/* 046DC0 7F012290 8FB5002C */ lw $s5, 0x2c($sp) -/* 046DC4 7F012294 8FB60030 */ lw $s6, 0x30($sp) -/* 046DC8 7F012298 8FB70034 */ lw $s7, 0x34($sp) -/* 046DCC 7F01229C 8FBE0038 */ lw $fp, 0x38($sp) -/* 046DD0 7F0122A0 03E00008 */ jr $ra -/* 046DD4 7F0122A4 27BD0050 */ addiu $sp, $sp, 0x50 -) -#endif s32 sub_GAME_7F0122A8(s32 arg0, s32 arg1, s32 arg2) @@ -11903,698 +4993,273 @@ s32 sub_GAME_7F0122A8(s32 arg0, s32 arg1, s32 arg2) } -#ifdef NONMATCHING -s32 sub_GAME_7F01231C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) +// Address 0x7F01231C NTSC +Gfx *sub_GAME_7F01231C(Gfx *DL, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { - s32 spD4; - s32 spD0; - s32 spCC; + Mtx* spD4; + Mtx* spD0; + Vertex* spCC; + s32 padding[26]; + u32 var_s2; + u32 var_s3; s32 sp58; s32 sp54; s32 sp50; - s32 temp_s1; - s32 temp_s4; - s32 temp_t2; - s32 temp_t2_2; - s32 temp_t3; - s32 temp_t3_2; - s32 temp_t5; - s32 temp_t5_2; - s32 temp_t6; - s32 temp_t7; - s32 temp_t7_2; - s32 temp_t8; - s32 temp_t9; - void *temp_s0; - void *temp_s2; - void *temp_s5; - s32 phi_s1; - s32 phi_s4; - s32 phi_s3; - void *phi_s0; - s32 phi_s2; - s8 phi_v0; - + s32 var_v0; + s32 selected_photo; + s32 vtx_index; + struct MP_selectable_chars *mpc; + struct sImageTableEntry *simage; + s32 j; + s32 i; + spD4 = dynAllocateMatrix(); spD0 = dynAllocateMatrix(); - spCC = dynAllocate7F0BD6C4(0x10); - arg0 = microcode_constructor(arg0); - guOrtho(spD4, 0, 0x43dc0000, 0, 330.0f, 1.0f, 10.0f, 1.0f); - guRotate(spD0, 0x40490fdb, 0x3f800000, 0.0f, 0.0f); - sp54 = (s32) (0x14a - arg4); - sp50 = (s32) (arg6 + 0x2a); - sp58 = (s32) (arg6 + 0x23); - phi_s4 = 0; - phi_s0 = spCC; -loop_1: - phi_s1 = 0; -loop_2: - phi_s3 = phi_s1; - if (phi_s1 >= 2) - { - phi_s3 = phi_s1 + -1; - } - phi_s2 = phi_s4; - if (phi_s4 >= 2) - { - phi_s2 = phi_s4 + -1; - } - if ((get_players_who_have_selected_mp_char(arg5) != 0) && (arg6 == 0)) - { - phi_v0 = (u8)0x6e; - } - else - { - phi_v0 = (u8)0xff; - } - phi_s0->unk0 = (s16) (((phi_s3 + -1) * sp58) + arg3); - phi_s0->unk4 = (u16)-5; - phi_s0->unk6 = (u16)0; - phi_s0->unk2 = (s16) ((sp54 + ((phi_s2 + -1) * sp50)) + arg6); - if ((phi_s1 & 1) != 0) - { - phi_s0->unk8 = (u16)0x1000; - } - else - { - phi_s0->unk8 = (u16)0; - } - if ((phi_s4 & 1) != 0) - { - phi_s0->unkA = (u16)0x1000; - } - else - { - phi_s0->unkA = (u16)0; - } - phi_s0->unkC = (s8) phi_v0; - phi_s0->unkD = (s8) phi_v0; - phi_s0->unkE = (s8) phi_v0; - if (arg6 == 0) - { - phi_s0->unkF = sub_GAME_7F0122A8(phi_s0->unk0, arg1, arg2); - } - else - { - phi_s0->unkF = (u8)0xff; - } - temp_s1 = phi_s1 + 1; - temp_s0 = phi_s0 + 0x10; - phi_s1 = temp_s1; - phi_s0 = temp_s0; - if (temp_s1 != 4) + spCC = dynAllocate7F0BD6C4(16); + DL = microcode_constructor(DL); + + guOrtho(spD4, 0.0f, 440.0f, 0.0f, 330.0f, 1.0f, 10.0f, 1.0f); + guRotate(spD0, 3.1415927f, 1.0f, 0.0f, 0.0f); + + vtx_index = 0; + + for (i = 0; i < 4; i++) { - goto loop_2; + sp58 = arg6 + 0x23; + sp54 = 0x14A - arg4; + sp50 = arg6 + 0x2a; + + for (j = 0; j < 4; j++) + { + var_s3 = (j >= 2) ? j - 1 : j; + var_s2 = (i >= 2) ? i - 1 : i; + + if ((get_players_who_have_selected_mp_char(arg5)) && (arg6 == 0)) + { + var_v0 = 0x6E; + } + else + { + var_v0 = 0xFF; + } + + spCC[vtx_index].coord.AsArray[0] = ((var_s3 - 1) * sp58) + arg3; + spCC[vtx_index].coord.AsArray[1] = sp54 + ((var_s2 - 1) * sp50) + arg6; + spCC[vtx_index].coord.AsArray[2] = -5; + spCC[vtx_index].index = 0; + + if (j & 1) + { + spCC[vtx_index].s = 0x1000; + } + else + { + spCC[vtx_index].s = 0; + } + + if (i & 1) + { + spCC[vtx_index].t = 0x1000; + } + else + { + spCC[vtx_index].t = 0; + } + + spCC[vtx_index].r = var_v0; + spCC[vtx_index].g = var_v0; + spCC[vtx_index].b = var_v0; + + if (arg6 == 0) + { + spCC[vtx_index].a = sub_GAME_7F0122A8(spCC[vtx_index].coord.AsArray[0], arg1, arg2); + } + else + { + spCC[vtx_index].a = 0xFF; + } + + vtx_index++; + } } - temp_s4 = phi_s4 + 1; - phi_s4 = temp_s4; - phi_s0 = temp_s0; - if (temp_s4 != 4) - { - goto loop_1; - } - temp_t9 = arg0; - arg0 = (s32) (temp_t9 + 8); - temp_t9->unk0 = 0x1030040; - temp_t9->unk4 = (s32) (spD4 + 0x80000000); - temp_t6 = arg0; - arg0 = (s32) (temp_t6 + 8); - temp_t6->unk0 = 0x1020040; - temp_t6->unk4 = (s32) (spD0 + 0x80000000); - temp_t2 = arg0; - arg0 = (s32) (temp_t2 + 8); - temp_t2->unk0 = 0x4f00100; - temp_t2->unk4 = spCC; - temp_s5 = &arg0; - temp_s2 = (arg5 * 0xc) + &mp_chr_setup; - likely_generate_DL_for_image_declaration(temp_s5, (((temp_s2->unk3 * 4) * 0xc) + mpcharselimages) + 0x18, 2, 0, 2); - temp_t8 = arg0; - arg0 = (s32) (temp_t8 + 8); - temp_t8->unk4 = 0xa28; - temp_t8->unk0 = 0xbf000000; - temp_t3 = arg0; - arg0 = (s32) (temp_t3 + 8); - temp_t3->unk4 = 0x280a32; - temp_t3->unk0 = 0xbf000000; - likely_generate_DL_for_image_declaration(temp_s5, (((temp_s2->unk3 * 4) * 0xc) + mpcharselimages) + 0x24, 2, 0, 2); - temp_t3_2 = arg0; - arg0 = (s32) (temp_t3_2 + 8); - temp_t3_2->unk4 = 0x141e3c; - temp_t3_2->unk0 = 0xbf000000; - temp_t5 = arg0; - arg0 = (s32) (temp_t5 + 8); - temp_t5->unk4 = 0x3c1e46; - temp_t5->unk0 = 0xbf000000; - likely_generate_DL_for_image_declaration(temp_s5, ((temp_s2->unk3 * 4) * 0xc) + mpcharselimages, 2, 0, 2); - temp_t5_2 = arg0; - arg0 = (s32) (temp_t5_2 + 8); - temp_t5_2->unk4 = 0x505a78; - temp_t5_2->unk0 = 0xbf000000; - temp_t7 = arg0; - arg0 = (s32) (temp_t7 + 8); - temp_t7->unk4 = 0x785a82; - temp_t7->unk0 = 0xbf000000; - likely_generate_DL_for_image_declaration(temp_s5, (((temp_s2->unk3 * 4) * 0xc) + mpcharselimages) + 0xc, 2, 0, 2); - temp_t7_2 = arg0; - arg0 = (s32) (temp_t7_2 + 8); - temp_t7_2->unk4 = 0x646e8c; - temp_t7_2->unk0 = 0xbf000000; - temp_t2_2 = arg0; - arg0 = (s32) (temp_t2_2 + 8); - temp_t2_2->unk4 = 0x8c6e96; - temp_t2_2->unk0 = 0xbf000000; - return arg0; + + gSPMatrix(DL++, OS_PHYSICAL_TO_K0(spD4), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(DL++, OS_PHYSICAL_TO_K0(spD0), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPVertex(DL++, spCC, 16, 0); + + selected_photo = mp_chr_setup[arg5].select_photo * 4; + simage = &mpcharselimages[mp_chr_setup[arg5].select_photo * 4]; + likely_generate_DL_for_image_declaration(&DL, simage + 2, 2, 0, 2); + gSP1Triangle(DL++, 0, 1, 4, 0); + gSP1Triangle(DL++, 4, 1, 5, 0); + + selected_photo = mp_chr_setup[arg5].select_photo * 4; + simage = &mpcharselimages[mp_chr_setup[arg5].select_photo * 4]; + likely_generate_DL_for_image_declaration(&DL, simage + 3, 2, 0, 2); + gSP1Triangle(DL++, 2, 3, 6, 0); + gSP1Triangle(DL++, 6, 3, 7, 0); + + selected_photo = mp_chr_setup[arg5].select_photo * 4; + simage = &mpcharselimages[mp_chr_setup[arg5].select_photo * 4]; + likely_generate_DL_for_image_declaration(&DL, simage + 0, 2, 0, 2); + gSP1Triangle(DL++, 8, 9, 12, 0); + gSP1Triangle(DL++, 12, 9, 13, 0); + + selected_photo = mp_chr_setup[arg5].select_photo * 4; + simage = &mpcharselimages[mp_chr_setup[arg5].select_photo * 4]; + likely_generate_DL_for_image_declaration(&DL, simage + 1, 2, 0, 2); + gSP1Triangle(DL++, 10, 11, 14, 0); + gSP1Triangle(DL++, 14, 11, 15, 0); + + return DL; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F01231C -/* 046E4C 7F01231C 27BDFF28 */ addiu $sp, $sp, -0xd8 -/* 046E50 7F012320 AFBF004C */ sw $ra, 0x4c($sp) -/* 046E54 7F012324 AFBE0048 */ sw $fp, 0x48($sp) -/* 046E58 7F012328 AFB70044 */ sw $s7, 0x44($sp) -/* 046E5C 7F01232C AFB60040 */ sw $s6, 0x40($sp) -/* 046E60 7F012330 AFB5003C */ sw $s5, 0x3c($sp) -/* 046E64 7F012334 AFB40038 */ sw $s4, 0x38($sp) -/* 046E68 7F012338 AFB30034 */ sw $s3, 0x34($sp) -/* 046E6C 7F01233C AFB20030 */ sw $s2, 0x30($sp) -/* 046E70 7F012340 AFB1002C */ sw $s1, 0x2c($sp) -/* 046E74 7F012344 AFB00028 */ sw $s0, 0x28($sp) -/* 046E78 7F012348 AFA400D8 */ sw $a0, 0xd8($sp) -/* 046E7C 7F01234C AFA500DC */ sw $a1, 0xdc($sp) -/* 046E80 7F012350 AFA600E0 */ sw $a2, 0xe0($sp) -/* 046E84 7F012354 0FC2F5B8 */ jal dynAllocateMatrix -/* 046E88 7F012358 AFA700E4 */ sw $a3, 0xe4($sp) -/* 046E8C 7F01235C 0FC2F5B8 */ jal dynAllocateMatrix -/* 046E90 7F012360 AFA200D4 */ sw $v0, 0xd4($sp) -/* 046E94 7F012364 AFA200D0 */ sw $v0, 0xd0($sp) -/* 046E98 7F012368 0FC2F5B1 */ jal dynAllocate7F0BD6C4 -/* 046E9C 7F01236C 24040010 */ li $a0, 16 -/* 046EA0 7F012370 AFA200CC */ sw $v0, 0xcc($sp) -/* 046EA4 7F012374 0FC2B366 */ jal microcode_constructor -/* 046EA8 7F012378 8FA400D8 */ lw $a0, 0xd8($sp) -/* 046EAC 7F01237C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 046EB0 7F012380 44811000 */ mtc1 $at, $f2 -/* 046EB4 7F012384 44800000 */ mtc1 $zero, $f0 -/* 046EB8 7F012388 3C0143A5 */ li $at, 0x43A50000 # 330.000000 -/* 046EBC 7F01238C 44812000 */ mtc1 $at, $f4 -/* 046EC0 7F012390 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 046EC4 7F012394 44813000 */ mtc1 $at, $f6 -/* 046EC8 7F012398 44050000 */ mfc1 $a1, $f0 -/* 046ECC 7F01239C 44070000 */ mfc1 $a3, $f0 -/* 046ED0 7F0123A0 AFA200D8 */ sw $v0, 0xd8($sp) -/* 046ED4 7F0123A4 8FA400D4 */ lw $a0, 0xd4($sp) -/* 046ED8 7F0123A8 3C0643DC */ lui $a2, 0x43dc -/* 046EDC 7F0123AC E7A20014 */ swc1 $f2, 0x14($sp) -/* 046EE0 7F0123B0 E7A2001C */ swc1 $f2, 0x1c($sp) -/* 046EE4 7F0123B4 E7A40010 */ swc1 $f4, 0x10($sp) -/* 046EE8 7F0123B8 0C005AF1 */ jal guOrtho -/* 046EEC 7F0123BC E7A60018 */ swc1 $f6, 0x18($sp) -/* 046EF0 7F0123C0 44800000 */ mtc1 $zero, $f0 -/* 046EF4 7F0123C4 3C054049 */ lui $a1, (0x40490FDB >> 16) # lui $a1, 0x4049 -/* 046EF8 7F0123C8 34A50FDB */ ori $a1, (0x40490FDB & 0xFFFF) # ori $a1, $a1, 0xfdb -/* 046EFC 7F0123CC 44070000 */ mfc1 $a3, $f0 -/* 046F00 7F0123D0 8FA400D0 */ lw $a0, 0xd0($sp) -/* 046F04 7F0123D4 3C063F80 */ lui $a2, 0x3f80 -/* 046F08 7F0123D8 0C005E2D */ jal guRotate -/* 046F0C 7F0123DC E7A00010 */ swc1 $f0, 0x10($sp) -/* 046F10 7F0123E0 8FB500F0 */ lw $s5, 0xf0($sp) -/* 046F14 7F0123E4 8FAF00E8 */ lw $t7, 0xe8($sp) -/* 046F18 7F0123E8 2418014A */ li $t8, 330 -/* 046F1C 7F0123EC 26AE0023 */ addiu $t6, $s5, 0x23 -/* 046F20 7F0123F0 26AA002A */ addiu $t2, $s5, 0x2a -/* 046F24 7F0123F4 030FC823 */ subu $t9, $t8, $t7 -/* 046F28 7F0123F8 AFB90054 */ sw $t9, 0x54($sp) -/* 046F2C 7F0123FC AFAA0050 */ sw $t2, 0x50($sp) -/* 046F30 7F012400 AFAE0058 */ sw $t6, 0x58($sp) -/* 046F34 7F012404 0000A025 */ move $s4, $zero -/* 046F38 7F012408 8FB000CC */ lw $s0, 0xcc($sp) -/* 046F3C 7F01240C 241E0004 */ li $fp, 4 -/* 046F40 7F012410 24161000 */ li $s6, 4096 -/* 046F44 7F012414 00008825 */ move $s1, $zero -.L7F012418: -/* 046F48 7F012418 32970001 */ andi $s7, $s4, 1 -.L7F01241C: -/* 046F4C 7F01241C 2A210002 */ slti $at, $s1, 2 -/* 046F50 7F012420 14200003 */ bnez $at, .L7F012430 -/* 046F54 7F012424 02209825 */ move $s3, $s1 -/* 046F58 7F012428 10000001 */ b .L7F012430 -/* 046F5C 7F01242C 2633FFFF */ addiu $s3, $s1, -1 -.L7F012430: -/* 046F60 7F012430 2A810002 */ slti $at, $s4, 2 -/* 046F64 7F012434 14200003 */ bnez $at, .L7F012444 -/* 046F68 7F012438 02809025 */ move $s2, $s4 -/* 046F6C 7F01243C 10000001 */ b .L7F012444 -/* 046F70 7F012440 2692FFFF */ addiu $s2, $s4, -1 -.L7F012444: -/* 046F74 7F012444 0FC046F6 */ jal get_players_who_have_selected_mp_char -/* 046F78 7F012448 8FA400EC */ lw $a0, 0xec($sp) -/* 046F7C 7F01244C 10400005 */ beqz $v0, .L7F012464 -/* 046F80 7F012450 8FAC0058 */ lw $t4, 0x58($sp) -/* 046F84 7F012454 56A00004 */ bnezl $s5, .L7F012468 -/* 046F88 7F012458 240200FF */ li $v0, 255 -/* 046F8C 7F01245C 10000002 */ b .L7F012468 -/* 046F90 7F012460 2402006E */ li $v0, 110 -.L7F012464: -/* 046F94 7F012464 240200FF */ li $v0, 255 -.L7F012468: -/* 046F98 7F012468 266BFFFF */ addiu $t3, $s3, -1 -/* 046F9C 7F01246C 016C0019 */ multu $t3, $t4 -/* 046FA0 7F012470 8FAE00E4 */ lw $t6, 0xe4($sp) -/* 046FA4 7F012474 264FFFFF */ addiu $t7, $s2, -1 -/* 046FA8 7F012478 00006812 */ mflo $t5 -/* 046FAC 7F01247C 01AEC021 */ addu $t8, $t5, $t6 -/* 046FB0 7F012480 A6180000 */ sh $t8, ($s0) -/* 046FB4 7F012484 8FB90050 */ lw $t9, 0x50($sp) -/* 046FB8 7F012488 8FAB0054 */ lw $t3, 0x54($sp) -/* 046FBC 7F01248C 240EFFFB */ li $t6, -5 -/* 046FC0 7F012490 01F90019 */ multu $t7, $t9 -/* 046FC4 7F012494 32380001 */ andi $t8, $s1, 1 -/* 046FC8 7F012498 A60E0004 */ sh $t6, 4($s0) -/* 046FCC 7F01249C A6000006 */ sh $zero, 6($s0) -/* 046FD0 7F0124A0 240F00FF */ li $t7, 255 -/* 046FD4 7F0124A4 00005012 */ mflo $t2 -/* 046FD8 7F0124A8 016A6021 */ addu $t4, $t3, $t2 -/* 046FDC 7F0124AC 01956821 */ addu $t5, $t4, $s5 -/* 046FE0 7F0124B0 13000003 */ beqz $t8, .L7F0124C0 -/* 046FE4 7F0124B4 A60D0002 */ sh $t5, 2($s0) -/* 046FE8 7F0124B8 10000002 */ b .L7F0124C4 -/* 046FEC 7F0124BC A6160008 */ sh $s6, 8($s0) -.L7F0124C0: -/* 046FF0 7F0124C0 A6000008 */ sh $zero, 8($s0) -.L7F0124C4: -/* 046FF4 7F0124C4 52E00004 */ beql $s7, $zero, .L7F0124D8 -/* 046FF8 7F0124C8 A600000A */ sh $zero, 0xa($s0) -/* 046FFC 7F0124CC 10000002 */ b .L7F0124D8 -/* 047000 7F0124D0 A616000A */ sh $s6, 0xa($s0) -/* 047004 7F0124D4 A600000A */ sh $zero, 0xa($s0) -.L7F0124D8: -/* 047008 7F0124D8 A202000C */ sb $v0, 0xc($s0) -/* 04700C 7F0124DC A202000D */ sb $v0, 0xd($s0) -/* 047010 7F0124E0 16A00007 */ bnez $s5, .L7F012500 -/* 047014 7F0124E4 A202000E */ sb $v0, 0xe($s0) -/* 047018 7F0124E8 86040000 */ lh $a0, ($s0) -/* 04701C 7F0124EC 8FA500DC */ lw $a1, 0xdc($sp) -/* 047020 7F0124F0 0FC048AA */ jal sub_GAME_7F0122A8 -/* 047024 7F0124F4 8FA600E0 */ lw $a2, 0xe0($sp) -/* 047028 7F0124F8 10000002 */ b .L7F012504 -/* 04702C 7F0124FC A202000F */ sb $v0, 0xf($s0) -.L7F012500: -/* 047030 7F012500 A20F000F */ sb $t7, 0xf($s0) -.L7F012504: -/* 047034 7F012504 26310001 */ addiu $s1, $s1, 1 -/* 047038 7F012508 163EFFC4 */ bne $s1, $fp, .L7F01241C -/* 04703C 7F01250C 26100010 */ addiu $s0, $s0, 0x10 -/* 047040 7F012510 26940001 */ addiu $s4, $s4, 1 -/* 047044 7F012514 569EFFC0 */ bnel $s4, $fp, .L7F012418 -/* 047048 7F012518 00008825 */ move $s1, $zero -/* 04704C 7F01251C 8FB900D8 */ lw $t9, 0xd8($sp) -/* 047050 7F012520 3C0A0103 */ lui $t2, (0x01030040 >> 16) # lui $t2, 0x103 -/* 047054 7F012524 354A0040 */ ori $t2, (0x01030040 & 0xFFFF) # ori $t2, $t2, 0x40 -/* 047058 7F012528 272B0008 */ addiu $t3, $t9, 8 -/* 04705C 7F01252C AFAB00D8 */ sw $t3, 0xd8($sp) -/* 047060 7F012530 AF2A0000 */ sw $t2, ($t9) -/* 047064 7F012534 8FAC00D4 */ lw $t4, 0xd4($sp) -/* 047068 7F012538 3C098000 */ lui $t1, 0x8000 -/* 04706C 7F01253C 3C0F0102 */ lui $t7, (0x01020040 >> 16) # lui $t7, 0x102 -/* 047070 7F012540 01896821 */ addu $t5, $t4, $t1 -/* 047074 7F012544 AF2D0004 */ sw $t5, 4($t9) -/* 047078 7F012548 8FAE00D8 */ lw $t6, 0xd8($sp) -/* 04707C 7F01254C 35EF0040 */ ori $t7, (0x01020040 & 0xFFFF) # ori $t7, $t7, 0x40 -/* 047080 7F012550 3C0D04F0 */ lui $t5, (0x04F00100 >> 16) # lui $t5, 0x4f0 -/* 047084 7F012554 25D80008 */ addiu $t8, $t6, 8 -/* 047088 7F012558 AFB800D8 */ sw $t8, 0xd8($sp) -/* 04708C 7F01255C ADCF0000 */ sw $t7, ($t6) -/* 047090 7F012560 8FB900D0 */ lw $t9, 0xd0($sp) -/* 047094 7F012564 35AD0100 */ ori $t5, (0x04F00100 & 0xFFFF) # ori $t5, $t5, 0x100 -/* 047098 7F012568 2413000C */ li $s3, 12 -/* 04709C 7F01256C 03295821 */ addu $t3, $t9, $t1 -/* 0470A0 7F012570 ADCB0004 */ sw $t3, 4($t6) -/* 0470A4 7F012574 8FAA00D8 */ lw $t2, 0xd8($sp) -/* 0470A8 7F012578 3C198003 */ lui $t9, %hi(mp_chr_setup) -/* 0470AC 7F01257C 2739B198 */ addiu $t9, %lo(mp_chr_setup) # addiu $t9, $t9, -0x4e68 -/* 0470B0 7F012580 254C0008 */ addiu $t4, $t2, 8 -/* 0470B4 7F012584 AFAC00D8 */ sw $t4, 0xd8($sp) -/* 0470B8 7F012588 AD4D0000 */ sw $t5, ($t2) -/* 0470BC 7F01258C 8FAE00CC */ lw $t6, 0xcc($sp) -/* 0470C0 7F012590 3C148009 */ lui $s4, %hi(mpcharselimages) -/* 0470C4 7F012594 2694D130 */ addiu $s4, %lo(mpcharselimages) # addiu $s4, $s4, -0x2ed0 -/* 0470C8 7F012598 AD4E0004 */ sw $t6, 4($t2) -/* 0470CC 7F01259C 8FB800EC */ lw $t8, 0xec($sp) -/* 0470D0 7F0125A0 8E8D0000 */ lw $t5, ($s4) -/* 0470D4 7F0125A4 27B500D8 */ addiu $s5, $sp, 0xd8 -/* 0470D8 7F0125A8 03130019 */ multu $t8, $s3 -/* 0470DC 7F0125AC 240E0002 */ li $t6, 2 -/* 0470E0 7F0125B0 AFAE0010 */ sw $t6, 0x10($sp) -/* 0470E4 7F0125B4 02A02025 */ move $a0, $s5 -/* 0470E8 7F0125B8 24060002 */ li $a2, 2 -/* 0470EC 7F0125BC 00003825 */ move $a3, $zero -/* 0470F0 7F0125C0 00007812 */ mflo $t7 -/* 0470F4 7F0125C4 01F99021 */ addu $s2, $t7, $t9 -/* 0470F8 7F0125C8 924B0003 */ lbu $t3, 3($s2) -/* 0470FC 7F0125CC 000B5080 */ sll $t2, $t3, 2 -/* 047100 7F0125D0 01530019 */ multu $t2, $s3 -/* 047104 7F0125D4 00006012 */ mflo $t4 -/* 047108 7F0125D8 018D8021 */ addu $s0, $t4, $t5 -/* 04710C 7F0125DC 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 047110 7F0125E0 26050018 */ addiu $a1, $s0, 0x18 -/* 047114 7F0125E4 8FB800D8 */ lw $t8, 0xd8($sp) -/* 047118 7F0125E8 3C11BF00 */ lui $s1, 0xbf00 -/* 04711C 7F0125EC 24190A28 */ li $t9, 2600 -/* 047120 7F0125F0 270F0008 */ addiu $t7, $t8, 8 -/* 047124 7F0125F4 AFAF00D8 */ sw $t7, 0xd8($sp) -/* 047128 7F0125F8 AF190004 */ sw $t9, 4($t8) -/* 04712C 7F0125FC AF110000 */ sw $s1, ($t8) -/* 047130 7F012600 8FAB00D8 */ lw $t3, 0xd8($sp) -/* 047134 7F012604 3C0C0028 */ lui $t4, (0x00280A32 >> 16) # lui $t4, 0x28 -/* 047138 7F012608 358C0A32 */ ori $t4, (0x00280A32 & 0xFFFF) # ori $t4, $t4, 0xa32 -/* 04713C 7F01260C 256A0008 */ addiu $t2, $t3, 8 -/* 047140 7F012610 AFAA00D8 */ sw $t2, 0xd8($sp) -/* 047144 7F012614 AD6C0004 */ sw $t4, 4($t3) -/* 047148 7F012618 AD710000 */ sw $s1, ($t3) -/* 04714C 7F01261C 924D0003 */ lbu $t5, 3($s2) -/* 047150 7F012620 8E8F0000 */ lw $t7, ($s4) -/* 047154 7F012624 24190002 */ li $t9, 2 -/* 047158 7F012628 000D7080 */ sll $t6, $t5, 2 -/* 04715C 7F01262C 01D30019 */ multu $t6, $s3 -/* 047160 7F012630 AFB90010 */ sw $t9, 0x10($sp) -/* 047164 7F012634 02A02025 */ move $a0, $s5 -/* 047168 7F012638 24060002 */ li $a2, 2 -/* 04716C 7F01263C 00003825 */ move $a3, $zero -/* 047170 7F012640 0000C012 */ mflo $t8 -/* 047174 7F012644 030F8021 */ addu $s0, $t8, $t7 -/* 047178 7F012648 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 04717C 7F01264C 26050024 */ addiu $a1, $s0, 0x24 -/* 047180 7F012650 8FAB00D8 */ lw $t3, 0xd8($sp) -/* 047184 7F012654 3C0C0014 */ lui $t4, (0x00141E3C >> 16) # lui $t4, 0x14 -/* 047188 7F012658 358C1E3C */ ori $t4, (0x00141E3C & 0xFFFF) # ori $t4, $t4, 0x1e3c -/* 04718C 7F01265C 256A0008 */ addiu $t2, $t3, 8 -/* 047190 7F012660 AFAA00D8 */ sw $t2, 0xd8($sp) -/* 047194 7F012664 AD6C0004 */ sw $t4, 4($t3) -/* 047198 7F012668 AD710000 */ sw $s1, ($t3) -/* 04719C 7F01266C 8FAD00D8 */ lw $t5, 0xd8($sp) -/* 0471A0 7F012670 3C18003C */ lui $t8, (0x003C1E46 >> 16) # lui $t8, 0x3c -/* 0471A4 7F012674 37181E46 */ ori $t8, (0x003C1E46 & 0xFFFF) # ori $t8, $t8, 0x1e46 -/* 0471A8 7F012678 25AE0008 */ addiu $t6, $t5, 8 -/* 0471AC 7F01267C AFAE00D8 */ sw $t6, 0xd8($sp) -/* 0471B0 7F012680 ADB80004 */ sw $t8, 4($t5) -/* 0471B4 7F012684 ADB10000 */ sw $s1, ($t5) -/* 0471B8 7F012688 924F0003 */ lbu $t7, 3($s2) -/* 0471BC 7F01268C 8E8A0000 */ lw $t2, ($s4) -/* 0471C0 7F012690 240C0002 */ li $t4, 2 -/* 0471C4 7F012694 000FC880 */ sll $t9, $t7, 2 -/* 0471C8 7F012698 03330019 */ multu $t9, $s3 -/* 0471CC 7F01269C AFAC0010 */ sw $t4, 0x10($sp) -/* 0471D0 7F0126A0 02A02025 */ move $a0, $s5 -/* 0471D4 7F0126A4 24060002 */ li $a2, 2 -/* 0471D8 7F0126A8 00003825 */ move $a3, $zero -/* 0471DC 7F0126AC 00005812 */ mflo $t3 -/* 0471E0 7F0126B0 016A2821 */ addu $a1, $t3, $t2 -/* 0471E4 7F0126B4 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 0471E8 7F0126B8 00000000 */ nop -/* 0471EC 7F0126BC 8FAD00D8 */ lw $t5, 0xd8($sp) -/* 0471F0 7F0126C0 3C180050 */ lui $t8, (0x00505A78 >> 16) # lui $t8, 0x50 -/* 0471F4 7F0126C4 37185A78 */ ori $t8, (0x00505A78 & 0xFFFF) # ori $t8, $t8, 0x5a78 -/* 0471F8 7F0126C8 25AE0008 */ addiu $t6, $t5, 8 -/* 0471FC 7F0126CC AFAE00D8 */ sw $t6, 0xd8($sp) -/* 047200 7F0126D0 ADB80004 */ sw $t8, 4($t5) -/* 047204 7F0126D4 ADB10000 */ sw $s1, ($t5) -/* 047208 7F0126D8 8FAF00D8 */ lw $t7, 0xd8($sp) -/* 04720C 7F0126DC 3C0B0078 */ lui $t3, (0x00785A82 >> 16) # lui $t3, 0x78 -/* 047210 7F0126E0 356B5A82 */ ori $t3, (0x00785A82 & 0xFFFF) # ori $t3, $t3, 0x5a82 -/* 047214 7F0126E4 25F90008 */ addiu $t9, $t7, 8 -/* 047218 7F0126E8 AFB900D8 */ sw $t9, 0xd8($sp) -/* 04721C 7F0126EC ADEB0004 */ sw $t3, 4($t7) -/* 047220 7F0126F0 ADF10000 */ sw $s1, ($t7) -/* 047224 7F0126F4 924A0003 */ lbu $t2, 3($s2) -/* 047228 7F0126F8 8E8E0000 */ lw $t6, ($s4) -/* 04722C 7F0126FC 24180002 */ li $t8, 2 -/* 047230 7F012700 000A6080 */ sll $t4, $t2, 2 -/* 047234 7F012704 01930019 */ multu $t4, $s3 -/* 047238 7F012708 AFB80010 */ sw $t8, 0x10($sp) -/* 04723C 7F01270C 02A02025 */ move $a0, $s5 -/* 047240 7F012710 24060002 */ li $a2, 2 -/* 047244 7F012714 00003825 */ move $a3, $zero -/* 047248 7F012718 00006812 */ mflo $t5 -/* 04724C 7F01271C 01AE8021 */ addu $s0, $t5, $t6 -/* 047250 7F012720 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 047254 7F012724 2605000C */ addiu $a1, $s0, 0xc -/* 047258 7F012728 8FAF00D8 */ lw $t7, 0xd8($sp) -/* 04725C 7F01272C 3C0B0064 */ lui $t3, (0x00646E8C >> 16) # lui $t3, 0x64 -/* 047260 7F012730 356B6E8C */ ori $t3, (0x00646E8C & 0xFFFF) # ori $t3, $t3, 0x6e8c -/* 047264 7F012734 25F90008 */ addiu $t9, $t7, 8 -/* 047268 7F012738 AFB900D8 */ sw $t9, 0xd8($sp) -/* 04726C 7F01273C ADEB0004 */ sw $t3, 4($t7) -/* 047270 7F012740 ADF10000 */ sw $s1, ($t7) -/* 047274 7F012744 8FAA00D8 */ lw $t2, 0xd8($sp) -/* 047278 7F012748 3C0D008C */ lui $t5, (0x008C6E96 >> 16) # lui $t5, 0x8c -/* 04727C 7F01274C 35AD6E96 */ ori $t5, (0x008C6E96 & 0xFFFF) # ori $t5, $t5, 0x6e96 -/* 047280 7F012750 254C0008 */ addiu $t4, $t2, 8 -/* 047284 7F012754 AFAC00D8 */ sw $t4, 0xd8($sp) -/* 047288 7F012758 AD4D0004 */ sw $t5, 4($t2) -/* 04728C 7F01275C AD510000 */ sw $s1, ($t2) -/* 047290 7F012760 8FBF004C */ lw $ra, 0x4c($sp) -/* 047294 7F012764 8FBE0048 */ lw $fp, 0x48($sp) -/* 047298 7F012768 8FB70044 */ lw $s7, 0x44($sp) -/* 04729C 7F01276C 8FB60040 */ lw $s6, 0x40($sp) -/* 0472A0 7F012770 8FB5003C */ lw $s5, 0x3c($sp) -/* 0472A4 7F012774 8FB40038 */ lw $s4, 0x38($sp) -/* 0472A8 7F012778 8FB30034 */ lw $s3, 0x34($sp) -/* 0472AC 7F01277C 8FB20030 */ lw $s2, 0x30($sp) -/* 0472B0 7F012780 8FB1002C */ lw $s1, 0x2c($sp) -/* 0472B4 7F012784 8FB00028 */ lw $s0, 0x28($sp) -/* 0472B8 7F012788 8FA200D8 */ lw $v0, 0xd8($sp) -/* 0472BC 7F01278C 03E00008 */ jr $ra -/* 0472C0 7F012790 27BD00D8 */ addiu $sp, $sp, 0xd8 -) -#endif #ifdef NONMATCHING -void constructor_menu0F_mpcharsel(s32 arg0) +// https://decomp.me/scratch/VJHe2 99.89% (0x6c(sp) -> 0x70(sp) + +// Address 0x7F012794 NTSC +Gfx * constructor_menu0F_mpcharsel(Gfx *DL) { s32 spE4; - s32 spE0; + s32 i; // spE0 + u8 *text; + s32 var_s2; + s32 var_s7; + s32 var_s4; + s32 var_v1; + s32 padding3; + s32 padding4; + s32 padding1; s32 spBC; s32 spB8; s32 spB4; s32 spB0; + s32 padding2; s32 spA8; s32 spA4; s32 spA0; s32 sp9C; - s32 sp8C; - void *sp88; - void *sp80; - void *sp74; - void *sp70; - s32 temp_ret; - s32 temp_ret_10; - s32 temp_ret_11; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_ret_5; - s32 temp_ret_6; - s32 temp_ret_7; - s32 temp_ret_8; - s32 temp_ret_9; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s1_3; - s32 temp_s3; - s32 temp_s4; - s32 temp_s6; - s32 temp_t7; - s32 temp_t9; - s32 phi_s2; - s32 phi_s7; - void *phi_v0; - s32 phi_s4; - s32 phi_s1; - s32 phi_s0; - s32 phi_s1_2; - s32 phi_s0_2; - s32 phi_s1_3; - s32 phi_s0_3; - s32 phi_s1_4; - s32 phi_s0_4; - s32 phi_v1; - s32 phi_s1_5; - s32 phi_s0_5; - s32 phi_v1_2; - s32 phi_s1_6; - s32 phi_s1_7; - s32 phi_v1_3; - s32 phi_v1_4; spE4 = get_selected_num_players(); - temp_ret = microcode_constructor_related_to_menus(microcode_constructor(sub_GAME_7F00D5E8(viFillScreen(viSetFillColor(arg0, 0, 0, 0)))), 0x26, 0xa9, 0x184, 0xab, 0x90); - temp_s1 = temp_ret; - phi_v0 = temp_ret; - phi_s1_7 = temp_s1; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + DL = microcode_constructor_related_to_menus(DL, 0x26, 0xA9, 0x184, 0xAB, 0x90); + if (spE4 >= 3) { - temp_ret_2 = microcode_constructor_related_to_menus(temp_s1, 0xd4, 0x1e, 0xd6, 0x136, 0x80); - phi_v0 = temp_ret_2; - phi_s1_7 = temp_ret_2; + DL = microcode_constructor_related_to_menus(DL, 0xD4, 0x1E, 0xD6, 0x136, 0x80); } - if (spE4 > 0) + + for (i = 0; i < spE4; i++) { - sp88 = &has_selected_char_player1; - sp80 = &mp_char_cur_select_player; - sp74 = &dword_CODE_bss_80069730; - sp70 = &mp_char_prev_select_player; - spE0 = 0; -loop_4: if (spE4 == 2) { - if (spE0 > 0) + var_s2 = 0x26; + var_s4 = 0x15E; + + if (i > 0) { - phi_s2 = 0x26; - phi_s7 = 0xaa; - phi_s4 = 0x15e; + var_v1 = 0x8c; } else { - phi_s2 = 0x26; - phi_s7 = 0 + 0x1e; - phi_s4 = 0x15e; + var_v1 = 0; } + var_s7 = var_v1 + 0x1E; } else { - if (spE0 >= 2) + var_s4 = 0xAF; + + if (i >= 2) { - phi_v1_4 = 0x8c; + var_v1 = 0x8C; } else { - phi_v1_4 = 0; + var_v1 = 0; } - if ((spE0 & 1) != 0) + var_s7 = var_v1 + 0x1E; + + if (i & 1) { - phi_v1_3 = 0xaf; + var_v1 = 0xAF; } else { - phi_v1_3 = 0; + var_v1 = 0; } - phi_s2 = phi_v1_3 + 0x26; - phi_s7 = phi_v1_4 + 0x1e; - phi_s4 = 0xaf; + var_s2 = var_v1 + 0x26; } - temp_t7 = phi_s2 + phi_s4; - temp_s1_2 = phi_v0 + 8; - phi_v0->unk0 = (s32) (((((s32) ((f32) (phi_s2 + 6) * 4.0f) & 0xfff) << 0xc) | 0xed000000) | ((s32) ((f32) (phi_s7 + 5) * 4.0f) & 0xfff)); - sp8C = temp_t7; - phi_v0->unk4 = (s32) ((((s32) ((f32) (temp_t7 + -6) * 4.0f) & 0xfff) << 0xc) | ((s32) ((f32) (phi_s7 + 0x87) * 4.0f) & 0xfff)); - phi_s1 = temp_s1_2; - if (*sp88 == 0) + + gDPSetScissor(DL++, G_SC_NON_INTERLACE, (var_s2 + 6), var_s7 + 5, (var_s2 + var_s4 - 6), (var_s7 + 0x87)); + + if ((player_has_selected_char[i] == 0) && (size_mp_select_image_player[i] == 0)) { - phi_s1 = temp_s1_2; - if (subroutine_arg0 == 0) - { - temp_ret_3 = langGet(TEXT(LTITLE, 0x55)); - sub_GAME_7F0AE98C(&spBC, &spB8, temp_ret_3, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - spB4 = (s32) ((((s32) phi_s4 >> 1) + phi_s2) - (spB8 >> 1)); - viGetX(); - phi_s1 = write_text_at_abs_coord(microcode_constructor(temp_s1_2), &spB4, &spB0, temp_ret_3, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, viGetY(), 0, 0); - } + + text = langGet(0x9C55U); + textMeasure(&spBC, &spB8, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spB4 = ((var_s4 >> 1) + var_s2) - (spB8 >> 1); + spB0 = var_s7 + 5; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &spB4, &spB0, (s8*)text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } - temp_s6 = ((s32) phi_s4 >> 1) + phi_s2; - temp_ret_4 = langGet((0x80030000 + (*sp80 * 0xc))->unk-4E68); - sub_GAME_7F0AE98C(&spA8, &spA4, temp_ret_4, ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0); - sp9C = (s32) (phi_s7 + 0x78); - spA0 = (s32) (temp_s6 - (spA4 >> 1)); - viGetX(); - temp_s3 = phi_s2 + 0xd; - temp_s4 = sp8C + -0xe; - temp_ret_5 = sub_GAME_7F01231C(write_text_at_abs_coord(microcode_constructor(phi_s1), &spA0, &sp9C, temp_ret_4, (s32) ptrSecondFontTableLarge, (s32) ptrFirstFontTableLarge, 0xff, viGetY(), 0, 0), temp_s3, temp_s4, temp_s6 - *sp74, (s32) *sp70, (s32) subroutine_arg0); - temp_s1_3 = temp_ret_5; - if ((*sp88 != 0) || (subroutine_arg0 != 0)) + + text = langGet(mp_chr_setup[mp_char_cur_select_player[i]].text_preset); + textMeasure(&spA8, &spA4, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + spA0 = (var_s4 >> 1) + var_s2 - (spA4 >> 1); + sp9C = var_s7 + 0x78; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &spA0, &sp9C, (s8*)text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, (var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i], var_s7 + 0x46, mp_char_prev_select_player[i], size_mp_select_image_player[i]); + + if ((player_has_selected_char[i] == 0 && size_mp_select_image_player[i] == 0) || (mp_char_prev_select_player[i] != mp_char_cur_select_player[i])) { - phi_v0 = temp_ret_5; - phi_s1_7 = temp_s1_3; - if (*sp70 != *sp80) + if (mp_char_prev_select_player[i] >= 3) { -block_21: - phi_s0 = *sp70; - phi_s1_2 = temp_s1_3; - phi_v0 = temp_ret_5; - if (*sp70 >= 3) - { - temp_ret_6 = sub_GAME_7F01231C(temp_s1_3, temp_s3, temp_s4, (temp_s6 - *sp74) + -0xfc, (s32) (*sp70 + -3), (s32) subroutine_arg0); - phi_s0 = *sp70; - phi_s1_2 = temp_ret_6; - phi_v0 = temp_ret_6; - } - phi_s0_2 = phi_s0; - phi_s1_3 = phi_s1_2; - if (phi_s0 >= 2) - { - temp_ret_7 = sub_GAME_7F01231C(phi_s1_2, temp_s3, temp_s4, (temp_s6 - *sp74) + -0xa8, (s32) (phi_s0 + -2), (s32) subroutine_arg0); - phi_s0_2 = *sp70; - phi_s1_3 = temp_ret_7; - phi_v0 = temp_ret_7; - } - phi_s0_3 = phi_s0_2; - phi_s1_4 = phi_s1_3; - if (phi_s0_2 > 0) - { - temp_ret_8 = sub_GAME_7F01231C(phi_s1_3, temp_s3, temp_s4, (temp_s6 - *sp74) + -0x54, (s32) (phi_s0_2 + -1), (s32) subroutine_arg0); - phi_s0_3 = *sp70; - phi_s1_4 = temp_ret_8; - phi_v0 = temp_ret_8; - } - phi_s0_4 = phi_s0_3; - phi_v1 = num_chars_selectable_mp; - phi_s1_5 = phi_s1_4; - if (phi_s0_3 < (num_chars_selectable_mp + -1)) - { - temp_ret_9 = sub_GAME_7F01231C(phi_s1_4, temp_s3, temp_s4, (temp_s6 - *sp74) + 0x54, (s32) (phi_s0_3 + 1), (s32) subroutine_arg0); - phi_s0_4 = *sp70; - phi_v1 = num_chars_selectable_mp; - phi_s1_5 = temp_ret_9; - phi_v0 = temp_ret_9; - } - phi_s0_5 = phi_s0_4; - phi_v1_2 = phi_v1; - phi_s1_6 = phi_s1_5; - if (phi_s0_4 < (phi_v1 + -2)) - { - temp_ret_10 = sub_GAME_7F01231C(phi_s1_5, temp_s3, temp_s4, (temp_s6 - *sp74) + 0xa8, (s32) (phi_s0_4 + 2), (s32) subroutine_arg0); - phi_s0_5 = *sp70; - phi_v1_2 = num_chars_selectable_mp; - phi_s1_6 = temp_ret_10; - phi_v0 = temp_ret_10; - } - phi_s1_7 = phi_s1_6; - if (phi_s0_5 < (phi_v1_2 + -3)) - { - temp_ret_11 = sub_GAME_7F01231C(phi_s1_6, temp_s3, temp_s4, (temp_s6 - *sp74) + 0xfc, (s32) (phi_s0_5 + 3), (s32) subroutine_arg0); - phi_v0 = temp_ret_11; - phi_s1_7 = temp_ret_11; - } + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) - 0xFC, var_s7 + 0x46, mp_char_prev_select_player[i] - 3, size_mp_select_image_player[i]); + } + + if (mp_char_prev_select_player[i] >= 2) + { + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) - 0xA8, var_s7 + 0x46, mp_char_prev_select_player[i] - 2, size_mp_select_image_player[i]); + } + + if (mp_char_prev_select_player[i] >= 1) + { + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) - 0x54, var_s7 + 0x46, mp_char_prev_select_player[i] - 1, size_mp_select_image_player[i]); + } + + if (mp_char_prev_select_player[i] < num_chars_selectable_mp - 1) + { + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) + 0x54, var_s7 + 0x46, mp_char_prev_select_player[i] + 1, size_mp_select_image_player[i]); + } + + if (mp_char_prev_select_player[i] < num_chars_selectable_mp - 2) + { + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) + 0xA8, var_s7 + 0x46, mp_char_prev_select_player[i] + 2, size_mp_select_image_player[i]); + } + + if (mp_char_prev_select_player[i] < num_chars_selectable_mp - 3) + { + DL = sub_GAME_7F01231C(DL, var_s2 + 0xD, var_s2 + var_s4 - 0xE, ((var_s4 >> 1) + var_s2 - dword_CODE_bss_80069730[i]) + 0xFC, var_s7 + 0x46, mp_char_prev_select_player[i] + 3, size_mp_select_image_player[i]); } - } - else - { - goto block_21; - } - temp_t9 = spE0 + 1; - sp70 = (void *) (sp70 + 4); - sp74 = (void *) (sp74 + 4); - sp80 = (void *) (sp80 + 4); - spE0 = temp_t9; - sp88 = (void *) (sp88 + 4); - if (temp_t9 != spE4) - { - goto loop_4; } } - combiner_bayer_lod_perspective(phi_s1_7); + + DL = combiner_bayer_lod_perspective(DL); + + return DL; } #else GLOBAL_ASM( @@ -12661,9 +5326,9 @@ glabel constructor_menu0F_mpcharsel /* 0473A8 7F012878 256B9730 */ addiu $t3, %lo(dword_CODE_bss_80069730) # addiu $t3, $t3, -0x68d0 /* 0473AC 7F01287C 254A9710 */ addiu $t2, %lo(mp_char_cur_select_player) # addiu $t2, $t2, -0x68f0 /* 0473B0 7F012880 25299740 */ addiu $t1, %lo(player_has_selected_char) # addiu $t1, $t1, -0x68c0 -/* 0473B4 7F012884 3C1E8007 */ lui $fp, %hi(size_mp_select_image_player1) +/* 0473B4 7F012884 3C1E8007 */ lui $fp, %hi(size_mp_select_image_player) /* 0473B8 7F012888 4481A000 */ mtc1 $at, $f20 -/* 0473BC 7F01288C 27DE9750 */ addiu $fp, %lo(size_mp_select_image_player1) # addiu $fp, $fp, -0x68b0 +/* 0473BC 7F01288C 27DE9750 */ addiu $fp, %lo(size_mp_select_image_player) # addiu $fp, $fp, -0x68b0 /* 0473C0 7F012890 AFA90088 */ sw $t1, 0x88($sp) /* 0473C4 7F012894 AFAA0080 */ sw $t2, 0x80($sp) /* 0473C8 7F012898 AFAB0074 */ sw $t3, 0x74($sp) @@ -12755,16 +5420,16 @@ glabel constructor_menu0F_mpcharsel /* 047500 7F0129D0 8FAE0080 */ lw $t6, 0x80($sp) /* 047504 7F0129D4 0FC30776 */ jal langGet /* 047508 7F0129D8 34049C55 */ li $a0, 40021 -/* 04750C 7F0129DC 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 047510 7F0129E0 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 047514 7F0129E4 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) +/* 04750C 7F0129DC 3C0D8004 */ lui $t5, %hi(ptrFontZurichBold) +/* 047510 7F0129E0 8DAD0EB4 */ lw $t5, %lo(ptrFontZurichBold)($t5) +/* 047514 7F0129E4 3C078004 */ lui $a3, %hi(ptrFontZurichBoldChars) /* 047518 7F0129E8 00409825 */ move $s3, $v0 -/* 04751C 7F0129EC 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) +/* 04751C 7F0129EC 8CE70EB8 */ lw $a3, %lo(ptrFontZurichBoldChars)($a3) /* 047520 7F0129F0 27A400BC */ addiu $a0, $sp, 0xbc /* 047524 7F0129F4 27A500B8 */ addiu $a1, $sp, 0xb8 /* 047528 7F0129F8 00403025 */ move $a2, $v0 /* 04752C 7F0129FC AFA00014 */ sw $zero, 0x14($sp) -/* 047530 7F012A00 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 047530 7F012A00 0FC2BA63 */ jal textMeasure /* 047534 7F012A04 AFAD0010 */ sw $t5, 0x10($sp) /* 047538 7F012A08 8FAA00B8 */ lw $t2, 0xb8($sp) /* 04753C 7F012A0C 00147043 */ sra $t6, $s4, 1 @@ -12781,10 +5446,10 @@ glabel constructor_menu0F_mpcharsel /* 047568 7F012A38 00104C03 */ sra $t1, $s0, 0x10 /* 04756C 7F012A3C 0C00110B */ jal viGetY /* 047570 7F012A40 01208025 */ move $s0, $t1 -/* 047574 7F012A44 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableLarge) -/* 047578 7F012A48 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableLarge) -/* 04757C 7F012A4C 8D8C0EB4 */ lw $t4, %lo(ptrFirstFontTableLarge)($t4) -/* 047580 7F012A50 8D6B0EB8 */ lw $t3, %lo(ptrSecondFontTableLarge)($t3) +/* 047574 7F012A44 3C0B8004 */ lui $t3, %hi(ptrFontZurichBoldChars) +/* 047578 7F012A48 3C0C8004 */ lui $t4, %hi(ptrFontZurichBold) +/* 04757C 7F012A4C 8D8C0EB4 */ lw $t4, %lo(ptrFontZurichBold)($t4) +/* 047580 7F012A50 8D6B0EB8 */ lw $t3, %lo(ptrFontZurichBoldChars)($t3) /* 047584 7F012A54 240D00FF */ li $t5, 255 /* 047588 7F012A58 AFAD0018 */ sw $t5, 0x18($sp) /* 04758C 7F012A5C 02202025 */ move $a0, $s1 @@ -12811,16 +5476,16 @@ glabel constructor_menu0F_mpcharsel /* 0475DC 7F012AAC 008F2021 */ addu $a0, $a0, $t7 /* 0475E0 7F012AB0 0FC30776 */ jal langGet /* 0475E4 7F012AB4 9484B198 */ lhu $a0, %lo(mp_chr_setup)($a0) -/* 0475E8 7F012AB8 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 0475EC 7F012ABC 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 0475F0 7F012AC0 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) +/* 0475E8 7F012AB8 3C198004 */ lui $t9, %hi(ptrFontZurichBold) +/* 0475EC 7F012ABC 8F390EB4 */ lw $t9, %lo(ptrFontZurichBold)($t9) +/* 0475F0 7F012AC0 3C078004 */ lui $a3, %hi(ptrFontZurichBoldChars) /* 0475F4 7F012AC4 00409825 */ move $s3, $v0 -/* 0475F8 7F012AC8 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) +/* 0475F8 7F012AC8 8CE70EB8 */ lw $a3, %lo(ptrFontZurichBoldChars)($a3) /* 0475FC 7F012ACC 27A400A8 */ addiu $a0, $sp, 0xa8 /* 047600 7F012AD0 27A500A4 */ addiu $a1, $sp, 0xa4 /* 047604 7F012AD4 00403025 */ move $a2, $v0 /* 047608 7F012AD8 AFA00014 */ sw $zero, 0x14($sp) -/* 04760C 7F012ADC 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 04760C 7F012ADC 0FC2BA63 */ jal textMeasure /* 047610 7F012AE0 AFB90010 */ sw $t9, 0x10($sp) /* 047614 7F012AE4 8FA900A4 */ lw $t1, 0xa4($sp) /* 047618 7F012AE8 26ED0078 */ addiu $t5, $s7, 0x78 @@ -12836,10 +5501,10 @@ glabel constructor_menu0F_mpcharsel /* 047640 7F012B10 00107403 */ sra $t6, $s0, 0x10 /* 047644 7F012B14 0C00110B */ jal viGetY /* 047648 7F012B18 01C08025 */ move $s0, $t6 -/* 04764C 7F012B1C 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableLarge) -/* 047650 7F012B20 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) -/* 047654 7F012B24 8DEF0EB4 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) -/* 047658 7F012B28 8D4A0EB8 */ lw $t2, %lo(ptrSecondFontTableLarge)($t2) +/* 04764C 7F012B1C 3C0A8004 */ lui $t2, %hi(ptrFontZurichBoldChars) +/* 047650 7F012B20 3C0F8004 */ lui $t7, %hi(ptrFontZurichBold) +/* 047654 7F012B24 8DEF0EB4 */ lw $t7, %lo(ptrFontZurichBold)($t7) +/* 047658 7F012B28 8D4A0EB8 */ lw $t2, %lo(ptrFontZurichBoldChars)($t2) /* 04765C 7F012B2C 241800FF */ li $t8, 255 /* 047660 7F012B30 AFB80018 */ sw $t8, 0x18($sp) /* 047664 7F012B34 02202025 */ move $a0, $s1 @@ -13074,715 +5739,174 @@ void update_menu10_mphandicap(void) { - - -#ifdef NONMATCHING +// Address 0x7F012EC4 NTSC void interface_menu10_mphandicap(void) { s32 sp44; - s32 temp_s3; - s32 temp_t9; - void *temp_s2; - void *temp_v0; - void *temp_v0_2; - void *phi_s1; - s32 phi_s3; - s32 phi_s4; - s32 phi_fp; - s32 phi_fp_2; + s32 i; + s32 var_fp; sp44 = get_selected_num_players(); - viSetFovY(0x42700000); - viSetAspect(D_80051A90); - viSetZRange(0x42c80000, D_80051A94); + var_fp = 0; + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); - phi_fp = 0; - if (sp44 > 0) + + for (i = 0; i < sp44; i++) { - phi_s1 = &has_selected_char_player1; - phi_s3 = 0; - phi_s4 = 0; - phi_fp_2 = 0; -loop_2: - if (*phi_s1 != 0) + if (player_has_selected_char[i] && joyGetButtonsPressedThisFrame(i, B_BUTTON)) { - if (joyGetButtonsPressedThisFrame((s32) (phi_s3 << 0x18) >> 0x18, 0x4000) != 0) - { - *phi_s1 = 0; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + player_has_selected_char[i] = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - temp_t9 = (s32) (phi_s3 << 0x18) >> 0x18; - if (*phi_s1 == 0) + + if (player_has_selected_char[i] == 0) { - temp_s2 = phi_s4 + &player_handicap; - if ((joyGetButtonsPressedThisFrame((s32) (temp_t9 << 0x18) >> 0x18, 0x202) == 0) && (joyGetStickXInRange((s32) (temp_t9 << 0x18) >> 0x18, -2, 1) < -1)) + // 0x202 + if (joyGetButtonsPressedThisFrame(i, L_JPAD|L_CBUTTONS) || ((joyGetStickXInRange(i, -2, 1) < -1) && dword_CODE_bss_80069760[i] != 0)) { - if ((*temp_s2 != 0) && (*temp_v0 > 0)) - { -block_10: - *temp_v0 = (s32) (*temp_v0 + -1); - } - else + if (player_handicap[i] > 0) { - if ((joyGetButtonsPressedThisFrame((s32) (temp_t9 << 0x18) >> 0x18, 0x101) == 0) && (joyGetStickXInRange((s32) (temp_t9 << 0x18) >> 0x18, -2, 1) > 0)) - { - if ((*temp_s2 != 0) && (*temp_v0_2 < 0xa)) - { -block_15: - *temp_v0_2 = (s32) (*temp_v0_2 + 1); - } - else - { - if (joyGetButtonsPressedThisFrame((s32) (temp_t9 << 0x18) >> 0x18, 0xb000) != 0) - { - *phi_s1 = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } - } - } - else - { - temp_v0_2 = &player_handicap + phi_s4; - if (*temp_v0_2 < 0xa) - { - goto block_15; - } - } + player_handicap[i]--; } } - else + // 0x101 + else if (joyGetButtonsPressedThisFrame(i, R_JPAD|R_CBUTTONS) || ((joyGetStickXInRange(i, -2, 1) > 0) && dword_CODE_bss_80069760[i] != 0)) { - temp_v0 = &player_handicap + phi_s4; - if (*temp_v0 > 0) + if (player_handicap[i] < 0xA) { - goto block_10; + player_handicap[i]++; } } - if ((joyGetStickXInRange((s32) (temp_t9 << 0x18) >> 0x18, -2, 1) == -1) || (joyGetStickXInRange((s32) (temp_t9 << 0x18) >> 0x18, -2, 1) == 0)) + else if (joyGetButtonsPressedThisFrame(i, A_BUTTON|Z_TRIG|START_BUTTON)) // 0xb000 + { + player_has_selected_char[i] = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + + if ((joyGetStickXInRange(i, -2, 1) == -1) || (joyGetStickXInRange(i, -2, 1) == 0)) { - *temp_s2 = 1; + dword_CODE_bss_80069760[i] = 1; } else { - *temp_s2 = 0; + dword_CODE_bss_80069760[i] = 0; } } - if (*phi_s1 != 0) - { - } - temp_s3 = phi_s3 + 1; - phi_s1 = phi_s1 + 4; - phi_s3 = temp_s3; - phi_s4 = phi_s4 + 4; - phi_fp = phi_fp_2; - phi_fp_2 = phi_fp_2; - if (temp_s3 != sp44) + if (player_has_selected_char[i] != 0) { - goto loop_2; + var_fp++; } } + disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, 1); - set_item_visibility_in_objinstance(walletinst[0], 0x2a, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); menu_control_stick_tracking(); - if (phi_fp == sp44) + + if (var_fp == sp44) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); + frontChangeMenu(MENU_MP_OPTIONS, 0); } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80051A90 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051A94 -.word 0x461C4000 /*10000.0;*/ - -.text -glabel interface_menu10_mphandicap -/* 0479F4 7F012EC4 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0479F8 7F012EC8 AFBF003C */ sw $ra, 0x3c($sp) -/* 0479FC 7F012ECC AFBE0038 */ sw $fp, 0x38($sp) -/* 047A00 7F012ED0 AFB70034 */ sw $s7, 0x34($sp) -/* 047A04 7F012ED4 AFB60030 */ sw $s6, 0x30($sp) -/* 047A08 7F012ED8 AFB5002C */ sw $s5, 0x2c($sp) -/* 047A0C 7F012EDC AFB40028 */ sw $s4, 0x28($sp) -/* 047A10 7F012EE0 AFB30024 */ sw $s3, 0x24($sp) -/* 047A14 7F012EE4 AFB20020 */ sw $s2, 0x20($sp) -/* 047A18 7F012EE8 AFB1001C */ sw $s1, 0x1c($sp) -/* 047A1C 7F012EEC 0FC040A4 */ jal get_selected_num_players -/* 047A20 7F012EF0 AFB00018 */ sw $s0, 0x18($sp) -/* 047A24 7F012EF4 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 047A28 7F012EF8 44816000 */ mtc1 $at, $f12 -/* 047A2C 7F012EFC AFA20044 */ sw $v0, 0x44($sp) -/* 047A30 7F012F00 0C001151 */ jal viSetFovY -/* 047A34 7F012F04 0000F025 */ move $fp, $zero -/* 047A38 7F012F08 3C018005 */ lui $at, %hi(D_80051A90) -/* 047A3C 7F012F0C 0C001164 */ jal viSetAspect -/* 047A40 7F012F10 C42C1A90 */ lwc1 $f12, %lo(D_80051A90)($at) -/* 047A44 7F012F14 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 047A48 7F012F18 44816000 */ mtc1 $at, $f12 -/* 047A4C 7F012F1C 3C018005 */ lui $at, %hi(D_80051A94) -/* 047A50 7F012F20 0C001194 */ jal viSetZRange -/* 047A54 7F012F24 C42E1A94 */ lwc1 $f14, %lo(D_80051A94)($at) -/* 047A58 7F012F28 0C00114D */ jal viSetUseZBuf -/* 047A5C 7F012F2C 00002025 */ move $a0, $zero -/* 047A60 7F012F30 8FAE0044 */ lw $t6, 0x44($sp) -/* 047A64 7F012F34 00009825 */ move $s3, $zero -/* 047A68 7F012F38 0000A025 */ move $s4, $zero -/* 047A6C 7F012F3C 19C0006F */ blez $t6, .L7F0130FC -/* 047A70 7F012F40 3C118007 */ lui $s1, %hi(player_has_selected_char) -/* 047A74 7F012F44 3C168007 */ lui $s6, %hi(player_handicap) -/* 047A78 7F012F48 3C158006 */ lui $s5, %hi(g_musicSfxBufferPtr) -/* 047A7C 7F012F4C 26B53720 */ addiu $s5, %lo(g_musicSfxBufferPtr) # addiu $s5, $s5, 0x3720 -/* 047A80 7F012F50 26D697A8 */ addiu $s6, %lo(player_handicap) # addiu $s6, $s6, -0x6858 -/* 047A84 7F012F54 26319740 */ addiu $s1, %lo(player_has_selected_char) # addiu $s1, $s1, -0x68c0 -/* 047A88 7F012F58 24170001 */ li $s7, 1 -.L7F012F5C: -/* 047A8C 7F012F5C 8E2F0000 */ lw $t7, ($s1) -/* 047A90 7F012F60 00132600 */ sll $a0, $s3, 0x18 -/* 047A94 7F012F64 0004C603 */ sra $t8, $a0, 0x18 -/* 047A98 7F012F68 11E00009 */ beqz $t7, .L7F012F90 -/* 047A9C 7F012F6C 03002025 */ move $a0, $t8 -/* 047AA0 7F012F70 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 047AA4 7F012F74 24054000 */ li $a1, 16384 -/* 047AA8 7F012F78 10400005 */ beqz $v0, .L7F012F90 -/* 047AAC 7F012F7C 240500C7 */ li $a1, 199 -/* 047AB0 7F012F80 AE200000 */ sw $zero, ($s1) -/* 047AB4 7F012F84 8EA40000 */ lw $a0, ($s5) -/* 047AB8 7F012F88 0C002382 */ jal sndPlaySfx -/* 047ABC 7F012F8C 00003025 */ move $a2, $zero -.L7F012F90: -/* 047AC0 7F012F90 8E220000 */ lw $v0, ($s1) -/* 047AC4 7F012F94 00138600 */ sll $s0, $s3, 0x18 -/* 047AC8 7F012F98 0010CE03 */ sra $t9, $s0, 0x18 -/* 047ACC 7F012F9C 14400050 */ bnez $v0, .L7F0130E0 -/* 047AD0 7F012FA0 03208025 */ move $s0, $t9 -/* 047AD4 7F012FA4 00192600 */ sll $a0, $t9, 0x18 -/* 047AD8 7F012FA8 3C098007 */ lui $t1, %hi(dword_CODE_bss_80069760) -/* 047ADC 7F012FAC 25299760 */ addiu $t1, $t1, %lo(dword_CODE_bss_80069760) -/* 047AE0 7F012FB0 00044603 */ sra $t0, $a0, 0x18 -/* 047AE4 7F012FB4 01002025 */ move $a0, $t0 -/* 047AE8 7F012FB8 02899021 */ addu $s2, $s4, $t1 -/* 047AEC 7F012FBC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 047AF0 7F012FC0 24050202 */ li $a1, 514 -/* 047AF4 7F012FC4 1440000B */ bnez $v0, .L7F012FF4 -/* 047AF8 7F012FC8 00102600 */ sll $a0, $s0, 0x18 -/* 047AFC 7F012FCC 00045603 */ sra $t2, $a0, 0x18 -/* 047B00 7F012FD0 01402025 */ move $a0, $t2 -/* 047B04 7F012FD4 2405FFFE */ li $a1, -2 -/* 047B08 7F012FD8 0C00312D */ jal joyGetStickXInRange -/* 047B0C 7F012FDC 02E03025 */ move $a2, $s7 -/* 047B10 7F012FE0 2841FFFF */ slti $at, $v0, -1 -/* 047B14 7F012FE4 10200009 */ beqz $at, .L7F01300C -/* 047B18 7F012FE8 00102600 */ sll $a0, $s0, 0x18 -/* 047B1C 7F012FEC 8E4B0000 */ lw $t3, ($s2) -/* 047B20 7F012FF0 11600006 */ beqz $t3, .L7F01300C -.L7F012FF4: -/* 047B24 7F012FF4 02D41021 */ addu $v0, $s6, $s4 -/* 047B28 7F012FF8 8C430000 */ lw $v1, ($v0) -/* 047B2C 7F012FFC 18600023 */ blez $v1, .L7F01308C -/* 047B30 7F013000 246CFFFF */ addiu $t4, $v1, -1 -/* 047B34 7F013004 10000021 */ b .L7F01308C -/* 047B38 7F013008 AC4C0000 */ sw $t4, ($v0) -.L7F01300C: -/* 047B3C 7F01300C 00046E03 */ sra $t5, $a0, 0x18 -/* 047B40 7F013010 01A02025 */ move $a0, $t5 -/* 047B44 7F013014 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 047B48 7F013018 24050101 */ li $a1, 257 -/* 047B4C 7F01301C 1440000A */ bnez $v0, .L7F013048 -/* 047B50 7F013020 00102600 */ sll $a0, $s0, 0x18 -/* 047B54 7F013024 00047603 */ sra $t6, $a0, 0x18 -/* 047B58 7F013028 01C02025 */ move $a0, $t6 -/* 047B5C 7F01302C 2405FFFE */ li $a1, -2 -/* 047B60 7F013030 0C00312D */ jal joyGetStickXInRange -/* 047B64 7F013034 02E03025 */ move $a2, $s7 -/* 047B68 7F013038 1840000A */ blez $v0, .L7F013064 -/* 047B6C 7F01303C 00102600 */ sll $a0, $s0, 0x18 -/* 047B70 7F013040 8E4F0000 */ lw $t7, ($s2) -/* 047B74 7F013044 11E00007 */ beqz $t7, .L7F013064 -.L7F013048: -/* 047B78 7F013048 02D41021 */ addu $v0, $s6, $s4 -/* 047B7C 7F01304C 8C430000 */ lw $v1, ($v0) -/* 047B80 7F013050 2861000A */ slti $at, $v1, 0xa -/* 047B84 7F013054 1020000D */ beqz $at, .L7F01308C -/* 047B88 7F013058 24780001 */ addiu $t8, $v1, 1 -/* 047B8C 7F01305C 1000000B */ b .L7F01308C -/* 047B90 7F013060 AC580000 */ sw $t8, ($v0) -.L7F013064: -/* 047B94 7F013064 0004CE03 */ sra $t9, $a0, 0x18 -/* 047B98 7F013068 03202025 */ move $a0, $t9 -/* 047B9C 7F01306C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 047BA0 7F013070 3405B000 */ li $a1, 45056 -/* 047BA4 7F013074 10400005 */ beqz $v0, .L7F01308C -/* 047BA8 7F013078 240500C7 */ li $a1, 199 -/* 047BAC 7F01307C AE370000 */ sw $s7, ($s1) -/* 047BB0 7F013080 8EA40000 */ lw $a0, ($s5) -/* 047BB4 7F013084 0C002382 */ jal sndPlaySfx -/* 047BB8 7F013088 00003025 */ move $a2, $zero -.L7F01308C: -/* 047BBC 7F01308C 00102600 */ sll $a0, $s0, 0x18 -/* 047BC0 7F013090 00044603 */ sra $t0, $a0, 0x18 -/* 047BC4 7F013094 01002025 */ move $a0, $t0 -/* 047BC8 7F013098 2405FFFE */ li $a1, -2 -/* 047BCC 7F01309C 0C00312D */ jal joyGetStickXInRange -/* 047BD0 7F0130A0 02E03025 */ move $a2, $s7 -/* 047BD4 7F0130A4 2401FFFF */ li $at, -1 -/* 047BD8 7F0130A8 10410008 */ beq $v0, $at, .L7F0130CC -/* 047BDC 7F0130AC 00102600 */ sll $a0, $s0, 0x18 -/* 047BE0 7F0130B0 00044E03 */ sra $t1, $a0, 0x18 -/* 047BE4 7F0130B4 01202025 */ move $a0, $t1 -/* 047BE8 7F0130B8 2405FFFE */ li $a1, -2 -/* 047BEC 7F0130BC 0C00312D */ jal joyGetStickXInRange -/* 047BF0 7F0130C0 02E03025 */ move $a2, $s7 -/* 047BF4 7F0130C4 54400005 */ bnezl $v0, .L7F0130DC -/* 047BF8 7F0130C8 AE400000 */ sw $zero, ($s2) -.L7F0130CC: -/* 047BFC 7F0130CC AE570000 */ sw $s7, ($s2) -/* 047C00 7F0130D0 10000003 */ b .L7F0130E0 -/* 047C04 7F0130D4 8E220000 */ lw $v0, ($s1) -/* 047C08 7F0130D8 AE400000 */ sw $zero, ($s2) -.L7F0130DC: -/* 047C0C 7F0130DC 8E220000 */ lw $v0, ($s1) -.L7F0130E0: -/* 047C10 7F0130E0 10400002 */ beqz $v0, .L7F0130EC -/* 047C14 7F0130E4 8FAA0044 */ lw $t2, 0x44($sp) -/* 047C18 7F0130E8 27DE0001 */ addiu $fp, $fp, 1 -.L7F0130EC: -/* 047C1C 7F0130EC 26730001 */ addiu $s3, $s3, 1 -/* 047C20 7F0130F0 26940004 */ addiu $s4, $s4, 4 -/* 047C24 7F0130F4 166AFF99 */ bne $s3, $t2, .L7F012F5C -/* 047C28 7F0130F8 26310004 */ addiu $s1, $s1, 4 -.L7F0130FC: -/* 047C2C 7F0130FC 3C108003 */ lui $s0, %hi(walletinst) -/* 047C30 7F013100 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 047C34 7F013104 0FC02DC9 */ jal disable_all_switches -/* 047C38 7F013108 8E040000 */ lw $a0, ($s0) -/* 047C3C 7F01310C 8E040000 */ lw $a0, ($s0) -/* 047C40 7F013110 00002825 */ move $a1, $zero -/* 047C44 7F013114 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 047C48 7F013118 24060001 */ li $a2, 1 -/* 047C4C 7F01311C 8E040000 */ lw $a0, ($s0) -/* 047C50 7F013120 2405002A */ li $a1, 42 -/* 047C54 7F013124 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 047C58 7F013128 24060001 */ li $a2, 1 -/* 047C5C 7F01312C 0FC026E1 */ jal menu_control_stick_tracking -/* 047C60 7F013130 00000000 */ nop -/* 047C64 7F013134 8FAB0044 */ lw $t3, 0x44($sp) -/* 047C68 7F013138 2404000E */ li $a0, 14 -/* 047C6C 7F01313C 57CB0004 */ bnel $fp, $t3, .L7F013150 -/* 047C70 7F013140 8FBF003C */ lw $ra, 0x3c($sp) -/* 047C74 7F013144 0FC06975 */ jal set_menu_to_mode -/* 047C78 7F013148 00002825 */ move $a1, $zero -/* 047C7C 7F01314C 8FBF003C */ lw $ra, 0x3c($sp) -.L7F013150: -/* 047C80 7F013150 8FB00018 */ lw $s0, 0x18($sp) -/* 047C84 7F013154 8FB1001C */ lw $s1, 0x1c($sp) -/* 047C88 7F013158 8FB20020 */ lw $s2, 0x20($sp) -/* 047C8C 7F01315C 8FB30024 */ lw $s3, 0x24($sp) -/* 047C90 7F013160 8FB40028 */ lw $s4, 0x28($sp) -/* 047C94 7F013164 8FB5002C */ lw $s5, 0x2c($sp) -/* 047C98 7F013168 8FB60030 */ lw $s6, 0x30($sp) -/* 047C9C 7F01316C 8FB70034 */ lw $s7, 0x34($sp) -/* 047CA0 7F013170 8FBE0038 */ lw $fp, 0x38($sp) -/* 047CA4 7F013174 03E00008 */ jr $ra -/* 047CA8 7F013178 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif -#ifdef NONMATCHING -void constructor_menu10_mphandicap(s32 arg0) +// Address 0x7F01317C NTSC +Gfx * constructor_menu10_mphandicap(Gfx *DL) { s32 spCC; + s32 i; // spE0 + u8 *text; + s32 var_s3; + s32 var_s5; + s32 var_v1; + u8 *text2; + s32 padding4; + s32 padding1; + s32 var_s2; s32 spA4; s32 spA0; s32 sp9C; s32 sp98; + s32 padding2; s32 sp90; s32 sp8C; s32 sp88; s32 sp84; - void *sp74; - void *sp70; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s6; - s32 temp_v0; - s32 phi_s6; - s32 phi_s3; - s32 phi_s2; - void *phi_v0; - s32 phi_s5; - s32 phi_s1; - s32 phi_s1_2; - s32 phi_v1; - s32 phi_v1_2; + s32 padding5; spCC = get_selected_num_players(); - temp_ret = microcode_constructor_related_to_menus(microcode_constructor(sub_GAME_7F00D5E8(viFillScreen(viSetFillColor(arg0, 0, 0, 0)))), 0x26, 0xa9, 0x184, 0xab, 0x90); - temp_s1 = temp_ret; - phi_v0 = temp_ret; - phi_s1_2 = temp_s1; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + DL = microcode_constructor_related_to_menus(DL, 0x26, 0xA9, 0x184, 0xAB, 0x90); + if (spCC >= 3) { - temp_ret_2 = microcode_constructor_related_to_menus(temp_s1, 0xd4, 0x1e, 0xd6, 0x136, 0x80); - phi_v0 = temp_ret_2; - phi_s1_2 = temp_ret_2; + DL = microcode_constructor_related_to_menus(DL, 0xD4, 0x1E, 0xD6, 0x136, 0x80); } - if (spCC > 0) + + for (i = 0; i < spCC; i++) { - sp74 = &has_selected_char_player1; - sp70 = &player_handicap; - phi_s6 = 0; -loop_4: + padding4 = player_has_selected_char[i]; + padding1 = player_handicap[i]; + + var_s2 = 0; + if (spCC == 2) { - if (phi_s6 > 0) - { - phi_s3 = 0x26; - phi_s2 = 0xaa; - phi_s5 = 0x15e; - } - else - { - phi_s3 = 0x26; - phi_s2 = 0 + 0x1e; - phi_s5 = 0x15e; - } + var_s3 = 0x26; + var_s5 = 0x15E; + var_v1 = (i > 0) ? 0x8C : 0; + var_s2 = (var_v1) + 0x1E; } else { - if (phi_s6 >= 2) - { - phi_v1_2 = 0x8c; - } - else - { - phi_v1_2 = 0; - } - if ((phi_s6 & 1) != 0) - { - phi_v1 = 0xaf; - } - else - { - phi_v1 = 0; - } - phi_s3 = phi_v1 + 0x26; - phi_s2 = phi_v1_2 + 0x1e; - phi_s5 = 0xaf; + var_s5 = 0xAF; + var_v1 = (i >= 2) ? 0x8C : 0; + var_s2 = (var_v1) + 0x1E; + var_v1 = (i & 1) ? 0xAF : 0; + var_s3 = (var_v1) + 0x26; } - temp_s1_2 = phi_v0 + 8; - phi_v0->unk0 = (s32) (((((s32) ((f32) (phi_s3 + 6) * 4.0f) & 0xfff) << 0xc) | 0xed000000) | ((s32) ((f32) (phi_s2 + 5) * 4.0f) & 0xfff)); - phi_v0->unk4 = (s32) ((((s32) ((f32) ((phi_s3 + phi_s5) + -6) * 4.0f) & 0xfff) << 0xc) | ((s32) ((f32) (phi_s2 + 0x87) * 4.0f) & 0xfff)); - phi_s1 = temp_s1_2; - if (*sp74 == 0) + + gDPSetScissor(DL++, G_SC_NON_INTERLACE, (var_s3 + 6), var_s2 + 5, (var_s3 + var_s5 - 6), (var_s2 + 0x8C - 5)); + + padding2 = ((var_s5 >> 1) + var_s3); + padding5 = var_s2 + 0x46; + + if (player_has_selected_char[i] == 0) { - temp_ret_3 = langGet(TEXT(LTITLE, 0x56)); - sub_GAME_7F0AE98C(&spA4, &spA0, temp_ret_3, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp9C = (s32) ((((s32) phi_s5 >> 1) + phi_s3) - (spA0 >> 1)); - sp98 = (s32) ((phi_s2 - (spA4 >> 1)) + 0x37); - viGetX(); - phi_s1 = write_text_at_abs_coord(microcode_constructor(temp_s1_2), &sp9C, &sp98, temp_ret_3, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, 0xff, viGetY(), 0, 0); + text = langGet(0x9C56U); + textMeasure(&spA4, &spA0, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp9C = padding2 - (spA0 >> 1); + sp98 = padding5 - (spA4 >> 1) - 0xf; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &sp9C, &sp98, (s8*)text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } - temp_ret_4 = langGet((0x80030000 + (*sp70 * 8))->unk-4B68); - sub_GAME_7F0AE98C(&sp90, &sp8C, temp_ret_4, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp88 = (s32) ((((s32) phi_s5 >> 1) + phi_s3) - (sp8C >> 1)); - sp84 = (s32) (((phi_s2 + 0x46) - (sp90 >> 1)) + 0xf); - viGetX(); - temp_s6 = phi_s6 + 1; - sp70 = (void *) (sp70 + 4); - temp_v0 = write_text_at_abs_coord(microcode_constructor(phi_s1), &sp88, &sp84, temp_ret_4, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, 0xff, viGetY(), 0, 0); - sp74 = (void *) (sp74 + 4); - phi_s6 = temp_s6; - phi_v0 = temp_v0; - phi_s1_2 = temp_v0; - if (temp_s6 != spCC) + { - goto loop_4; + text2 = langGet(MP_handicap_table[player_handicap[i]].text_preset); + textMeasure(&sp90, &sp8C, text2, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + sp88 = padding2 - (sp8C >> 1); + sp84 = padding5 - (sp90 >> 1) + 0xf; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &sp88, &sp84, (s8*)text2, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } } - combiner_bayer_lod_perspective(phi_s1_2); + + DL = combiner_bayer_lod_perspective(DL); + + return DL; } -#else -GLOBAL_ASM( -.text -glabel constructor_menu10_mphandicap -/* 047CAC 7F01317C 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* 047CB0 7F013180 AFBF0064 */ sw $ra, 0x64($sp) -/* 047CB4 7F013184 AFB10044 */ sw $s1, 0x44($sp) -/* 047CB8 7F013188 00808825 */ move $s1, $a0 -/* 047CBC 7F01318C AFBE0060 */ sw $fp, 0x60($sp) -/* 047CC0 7F013190 AFB7005C */ sw $s7, 0x5c($sp) -/* 047CC4 7F013194 AFB60058 */ sw $s6, 0x58($sp) -/* 047CC8 7F013198 AFB50054 */ sw $s5, 0x54($sp) -/* 047CCC 7F01319C AFB40050 */ sw $s4, 0x50($sp) -/* 047CD0 7F0131A0 AFB3004C */ sw $s3, 0x4c($sp) -/* 047CD4 7F0131A4 AFB20048 */ sw $s2, 0x48($sp) -/* 047CD8 7F0131A8 AFB00040 */ sw $s0, 0x40($sp) -/* 047CDC 7F0131AC 0FC040A4 */ jal get_selected_num_players -/* 047CE0 7F0131B0 F7B40038 */ sdc1 $f20, 0x38($sp) -/* 047CE4 7F0131B4 AFA200CC */ sw $v0, 0xcc($sp) -/* 047CE8 7F0131B8 02202025 */ move $a0, $s1 -/* 047CEC 7F0131BC 00002825 */ move $a1, $zero -/* 047CF0 7F0131C0 00003025 */ move $a2, $zero -/* 047CF4 7F0131C4 0C0011B4 */ jal viSetFillColor -/* 047CF8 7F0131C8 00003825 */ move $a3, $zero -/* 047CFC 7F0131CC 0C000FBE */ jal viFillScreen -/* 047D00 7F0131D0 00402025 */ move $a0, $v0 -/* 047D04 7F0131D4 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 047D08 7F0131D8 00402025 */ move $a0, $v0 -/* 047D0C 7F0131DC 0FC2B366 */ jal microcode_constructor -/* 047D10 7F0131E0 00402025 */ move $a0, $v0 -/* 047D14 7F0131E4 240E00AB */ li $t6, 171 -/* 047D18 7F0131E8 240F0090 */ li $t7, 144 -/* 047D1C 7F0131EC AFAF0014 */ sw $t7, 0x14($sp) -/* 047D20 7F0131F0 AFAE0010 */ sw $t6, 0x10($sp) -/* 047D24 7F0131F4 00402025 */ move $a0, $v0 -/* 047D28 7F0131F8 24050026 */ li $a1, 38 -/* 047D2C 7F0131FC 240600A9 */ li $a2, 169 -/* 047D30 7F013200 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 047D34 7F013204 24070184 */ li $a3, 388 -/* 047D38 7F013208 8FA800CC */ lw $t0, 0xcc($sp) -/* 047D3C 7F01320C 00408825 */ move $s1, $v0 -/* 047D40 7F013210 02202025 */ move $a0, $s1 -/* 047D44 7F013214 29010003 */ slti $at, $t0, 3 -/* 047D48 7F013218 1420000A */ bnez $at, .L7F013244 -/* 047D4C 7F01321C 240500D4 */ li $a1, 212 -/* 047D50 7F013220 24180136 */ li $t8, 310 -/* 047D54 7F013224 24190080 */ li $t9, 128 -/* 047D58 7F013228 AFB90014 */ sw $t9, 0x14($sp) -/* 047D5C 7F01322C AFB80010 */ sw $t8, 0x10($sp) -/* 047D60 7F013230 2406001E */ li $a2, 30 -/* 047D64 7F013234 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 047D68 7F013238 240700D6 */ li $a3, 214 -/* 047D6C 7F01323C 00408825 */ move $s1, $v0 -/* 047D70 7F013240 8FA800CC */ lw $t0, 0xcc($sp) -.L7F013244: -/* 047D74 7F013244 190000BC */ blez $t0, .L7F013538 -/* 047D78 7F013248 0000B025 */ move $s6, $zero -/* 047D7C 7F01324C 3C098007 */ lui $t1, %hi(player_has_selected_char) -/* 047D80 7F013250 3C0A8007 */ lui $t2, %hi(player_handicap) -/* 047D84 7F013254 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 047D88 7F013258 254A97A8 */ addiu $t2, %lo(player_handicap) # addiu $t2, $t2, -0x6858 -/* 047D8C 7F01325C 25299740 */ addiu $t1, %lo(player_has_selected_char) # addiu $t1, $t1, -0x68c0 -/* 047D90 7F013260 3C1E8004 */ lui $fp, %hi(ptrFirstFontTableLarge) -/* 047D94 7F013264 3C178004 */ lui $s7, %hi(ptrSecondFontTableLarge) -/* 047D98 7F013268 4481A000 */ mtc1 $at, $f20 -/* 047D9C 7F01326C 26F70EB8 */ addiu $s7, %lo(ptrSecondFontTableLarge) # addiu $s7, $s7, 0xeb8 -/* 047DA0 7F013270 27DE0EB4 */ addiu $fp, %lo(ptrFirstFontTableLarge) # addiu $fp, $fp, 0xeb4 -/* 047DA4 7F013274 AFA90074 */ sw $t1, 0x74($sp) -/* 047DA8 7F013278 AFAA0070 */ sw $t2, 0x70($sp) -.L7F01327C: -/* 047DAC 7F01327C 8FA800CC */ lw $t0, 0xcc($sp) -/* 047DB0 7F013280 24010002 */ li $at, 2 -/* 047DB4 7F013284 24130026 */ li $s3, 38 -/* 047DB8 7F013288 15010008 */ bne $t0, $at, .L7F0132AC -/* 047DBC 7F01328C 32CB0001 */ andi $t3, $s6, 1 -/* 047DC0 7F013290 1AC00003 */ blez $s6, .L7F0132A0 -/* 047DC4 7F013294 2415015E */ li $s5, 350 -/* 047DC8 7F013298 10000010 */ b .L7F0132DC -/* 047DCC 7F01329C 241200AA */ li $s2, 170 -.L7F0132A0: -/* 047DD0 7F0132A0 00001825 */ move $v1, $zero -/* 047DD4 7F0132A4 1000000D */ b .L7F0132DC -/* 047DD8 7F0132A8 2472001E */ addiu $s2, $v1, 0x1e -.L7F0132AC: -/* 047DDC 7F0132AC 2AC10002 */ slti $at, $s6, 2 -/* 047DE0 7F0132B0 14200003 */ bnez $at, .L7F0132C0 -/* 047DE4 7F0132B4 241500AF */ li $s5, 175 -/* 047DE8 7F0132B8 10000002 */ b .L7F0132C4 -/* 047DEC 7F0132BC 2403008C */ li $v1, 140 -.L7F0132C0: -/* 047DF0 7F0132C0 00001825 */ move $v1, $zero -.L7F0132C4: -/* 047DF4 7F0132C4 11600003 */ beqz $t3, .L7F0132D4 -/* 047DF8 7F0132C8 2472001E */ addiu $s2, $v1, 0x1e -/* 047DFC 7F0132CC 10000002 */ b .L7F0132D8 -/* 047E00 7F0132D0 240300AF */ li $v1, 175 -.L7F0132D4: -/* 047E04 7F0132D4 00001825 */ move $v1, $zero -.L7F0132D8: -/* 047E08 7F0132D8 24730026 */ addiu $s3, $v1, 0x26 -.L7F0132DC: -/* 047E0C 7F0132DC 266C0006 */ addiu $t4, $s3, 6 -/* 047E10 7F0132E0 448C2000 */ mtc1 $t4, $f4 -/* 047E14 7F0132E4 26490005 */ addiu $t1, $s2, 5 -/* 047E18 7F0132E8 44898000 */ mtc1 $t1, $f16 -/* 047E1C 7F0132EC 468021A0 */ cvt.s.w $f6, $f4 -/* 047E20 7F0132F0 3C01ED00 */ lui $at, 0xed00 -/* 047E24 7F0132F4 24510008 */ addiu $s1, $v0, 8 -/* 047E28 7F0132F8 468084A0 */ cvt.s.w $f18, $f16 -/* 047E2C 7F0132FC 46143202 */ mul.s $f8, $f6, $f20 -/* 047E30 7F013300 4600428D */ trunc.w.s $f10, $f8 -/* 047E34 7F013304 46149102 */ mul.s $f4, $f18, $f20 -/* 047E38 7F013308 440E5000 */ mfc1 $t6, $f10 -/* 047E3C 7F01330C 00000000 */ nop -/* 047E40 7F013310 31CF0FFF */ andi $t7, $t6, 0xfff -/* 047E44 7F013314 4600218D */ trunc.w.s $f6, $f4 -/* 047E48 7F013318 000FC300 */ sll $t8, $t7, 0xc -/* 047E4C 7F01331C 02757021 */ addu $t6, $s3, $s5 -/* 047E50 7F013320 25CFFFFA */ addiu $t7, $t6, -6 -/* 047E54 7F013324 440B3000 */ mfc1 $t3, $f6 -/* 047E58 7F013328 448F4000 */ mtc1 $t7, $f8 -/* 047E5C 7F01332C 0301C825 */ or $t9, $t8, $at -/* 047E60 7F013330 316C0FFF */ andi $t4, $t3, 0xfff -/* 047E64 7F013334 032C6825 */ or $t5, $t9, $t4 -/* 047E68 7F013338 26590087 */ addiu $t9, $s2, 0x87 -/* 047E6C 7F01333C 468042A0 */ cvt.s.w $f10, $f8 -/* 047E70 7F013340 44992000 */ mtc1 $t9, $f4 -/* 047E74 7F013344 AC4D0000 */ sw $t5, ($v0) -/* 047E78 7F013348 468021A0 */ cvt.s.w $f6, $f4 -/* 047E7C 7F01334C 46145402 */ mul.s $f16, $f10, $f20 -/* 047E80 7F013350 00000000 */ nop -/* 047E84 7F013354 46143202 */ mul.s $f8, $f6, $f20 -/* 047E88 7F013358 4600848D */ trunc.w.s $f18, $f16 -/* 047E8C 7F01335C 4600428D */ trunc.w.s $f10, $f8 -/* 047E90 7F013360 44099000 */ mfc1 $t1, $f18 -/* 047E94 7F013364 440D5000 */ mfc1 $t5, $f10 -/* 047E98 7F013368 312A0FFF */ andi $t2, $t1, 0xfff -/* 047E9C 7F01336C 000A5B00 */ sll $t3, $t2, 0xc -/* 047EA0 7F013370 31AE0FFF */ andi $t6, $t5, 0xfff -/* 047EA4 7F013374 016E7825 */ or $t7, $t3, $t6 -/* 047EA8 7F013378 AC4F0004 */ sw $t7, 4($v0) -/* 047EAC 7F01337C 8FB80074 */ lw $t8, 0x74($sp) -/* 047EB0 7F013380 8F090000 */ lw $t1, ($t8) -/* 047EB4 7F013384 1520002F */ bnez $t1, .L7F013444 -/* 047EB8 7F013388 00000000 */ nop -/* 047EBC 7F01338C 0FC30776 */ jal langGet -/* 047EC0 7F013390 34049C56 */ li $a0, 40022 -/* 047EC4 7F013394 8FCA0000 */ lw $t2, ($fp) -/* 047EC8 7F013398 0040A025 */ move $s4, $v0 -/* 047ECC 7F01339C 27A400A4 */ addiu $a0, $sp, 0xa4 -/* 047ED0 7F0133A0 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 047ED4 7F0133A4 00403025 */ move $a2, $v0 -/* 047ED8 7F0133A8 8EE70000 */ lw $a3, ($s7) -/* 047EDC 7F0133AC AFA00014 */ sw $zero, 0x14($sp) -/* 047EE0 7F0133B0 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 047EE4 7F0133B4 AFAA0010 */ sw $t2, 0x10($sp) -/* 047EE8 7F0133B8 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 047EEC 7F0133BC 8FAD00A0 */ lw $t5, 0xa0($sp) -/* 047EF0 7F0133C0 0015C843 */ sra $t9, $s5, 1 -/* 047EF4 7F0133C4 000FC043 */ sra $t8, $t7, 1 -/* 047EF8 7F0133C8 03336021 */ addu $t4, $t9, $s3 -/* 047EFC 7F0133CC 02584823 */ subu $t1, $s2, $t8 -/* 047F00 7F0133D0 000D5843 */ sra $t3, $t5, 1 -/* 047F04 7F0133D4 018B7023 */ subu $t6, $t4, $t3 -/* 047F08 7F0133D8 252A0037 */ addiu $t2, $t1, 0x37 -/* 047F0C 7F0133DC AFAE009C */ sw $t6, 0x9c($sp) -/* 047F10 7F0133E0 AFAA0098 */ sw $t2, 0x98($sp) -/* 047F14 7F0133E4 0FC2B366 */ jal microcode_constructor -/* 047F18 7F0133E8 02202025 */ move $a0, $s1 -/* 047F1C 7F0133EC 0C001107 */ jal viGetX -/* 047F20 7F0133F0 00408825 */ move $s1, $v0 -/* 047F24 7F0133F4 00028400 */ sll $s0, $v0, 0x10 -/* 047F28 7F0133F8 0010CC03 */ sra $t9, $s0, 0x10 -/* 047F2C 7F0133FC 0C00110B */ jal viGetY -/* 047F30 7F013400 03208025 */ move $s0, $t9 -/* 047F34 7F013404 8EED0000 */ lw $t5, ($s7) -/* 047F38 7F013408 8FCC0000 */ lw $t4, ($fp) -/* 047F3C 7F01340C 240B00FF */ li $t3, 255 -/* 047F40 7F013410 AFAB0018 */ sw $t3, 0x18($sp) -/* 047F44 7F013414 02202025 */ move $a0, $s1 -/* 047F48 7F013418 27A5009C */ addiu $a1, $sp, 0x9c -/* 047F4C 7F01341C 27A60098 */ addiu $a2, $sp, 0x98 -/* 047F50 7F013420 02803825 */ move $a3, $s4 -/* 047F54 7F013424 AFB0001C */ sw $s0, 0x1c($sp) -/* 047F58 7F013428 AFA20020 */ sw $v0, 0x20($sp) -/* 047F5C 7F01342C AFA00024 */ sw $zero, 0x24($sp) -/* 047F60 7F013430 AFA00028 */ sw $zero, 0x28($sp) -/* 047F64 7F013434 AFAD0010 */ sw $t5, 0x10($sp) -/* 047F68 7F013438 0FC025D8 */ jal write_text_at_abs_coord -/* 047F6C 7F01343C AFAC0014 */ sw $t4, 0x14($sp) -/* 047F70 7F013440 00408825 */ move $s1, $v0 -.L7F013444: -/* 047F74 7F013444 8FAE0070 */ lw $t6, 0x70($sp) -/* 047F78 7F013448 3C048003 */ lui $a0, %hi(MP_handicap_table) -/* 047F7C 7F01344C 00154843 */ sra $t1, $s5, 1 -/* 047F80 7F013450 8DCF0000 */ lw $t7, ($t6) -/* 047F84 7F013454 01338021 */ addu $s0, $t1, $s3 -/* 047F88 7F013458 26540046 */ addiu $s4, $s2, 0x46 -/* 047F8C 7F01345C 000FC0C0 */ sll $t8, $t7, 3 -/* 047F90 7F013460 00982021 */ addu $a0, $a0, $t8 -/* 047F94 7F013464 0FC30776 */ jal langGet -/* 047F98 7F013468 9484B498 */ lhu $a0, %lo(MP_handicap_table)($a0) -/* 047F9C 7F01346C 8FCA0000 */ lw $t2, ($fp) -/* 047FA0 7F013470 00409025 */ move $s2, $v0 -/* 047FA4 7F013474 27A40090 */ addiu $a0, $sp, 0x90 -/* 047FA8 7F013478 27A5008C */ addiu $a1, $sp, 0x8c -/* 047FAC 7F01347C 00403025 */ move $a2, $v0 -/* 047FB0 7F013480 8EE70000 */ lw $a3, ($s7) -/* 047FB4 7F013484 AFA00014 */ sw $zero, 0x14($sp) -/* 047FB8 7F013488 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 047FBC 7F01348C AFAA0010 */ sw $t2, 0x10($sp) -/* 047FC0 7F013490 8FAB0090 */ lw $t3, 0x90($sp) -/* 047FC4 7F013494 8FB9008C */ lw $t9, 0x8c($sp) -/* 047FC8 7F013498 02202025 */ move $a0, $s1 -/* 047FCC 7F01349C 000B7043 */ sra $t6, $t3, 1 -/* 047FD0 7F0134A0 028E7823 */ subu $t7, $s4, $t6 -/* 047FD4 7F0134A4 00196843 */ sra $t5, $t9, 1 -/* 047FD8 7F0134A8 020D6023 */ subu $t4, $s0, $t5 -/* 047FDC 7F0134AC 25F8000F */ addiu $t8, $t7, 0xf -/* 047FE0 7F0134B0 AFAC0088 */ sw $t4, 0x88($sp) -/* 047FE4 7F0134B4 0FC2B366 */ jal microcode_constructor -/* 047FE8 7F0134B8 AFB80084 */ sw $t8, 0x84($sp) -/* 047FEC 7F0134BC 0C001107 */ jal viGetX -/* 047FF0 7F0134C0 00408825 */ move $s1, $v0 -/* 047FF4 7F0134C4 00028400 */ sll $s0, $v0, 0x10 -/* 047FF8 7F0134C8 00104C03 */ sra $t1, $s0, 0x10 -/* 047FFC 7F0134CC 0C00110B */ jal viGetY -/* 048000 7F0134D0 01208025 */ move $s0, $t1 -/* 048004 7F0134D4 8EEA0000 */ lw $t2, ($s7) -/* 048008 7F0134D8 8FD90000 */ lw $t9, ($fp) -/* 04800C 7F0134DC 240D00FF */ li $t5, 255 -/* 048010 7F0134E0 AFAD0018 */ sw $t5, 0x18($sp) -/* 048014 7F0134E4 02202025 */ move $a0, $s1 -/* 048018 7F0134E8 27A50088 */ addiu $a1, $sp, 0x88 -/* 04801C 7F0134EC 27A60084 */ addiu $a2, $sp, 0x84 -/* 048020 7F0134F0 02403825 */ move $a3, $s2 -/* 048024 7F0134F4 AFB0001C */ sw $s0, 0x1c($sp) -/* 048028 7F0134F8 AFA20020 */ sw $v0, 0x20($sp) -/* 04802C 7F0134FC AFA00024 */ sw $zero, 0x24($sp) -/* 048030 7F013500 AFA00028 */ sw $zero, 0x28($sp) -/* 048034 7F013504 AFAA0010 */ sw $t2, 0x10($sp) -/* 048038 7F013508 0FC025D8 */ jal write_text_at_abs_coord -/* 04803C 7F01350C AFB90014 */ sw $t9, 0x14($sp) -/* 048040 7F013510 8FAC0074 */ lw $t4, 0x74($sp) -/* 048044 7F013514 8FAE0070 */ lw $t6, 0x70($sp) -/* 048048 7F013518 8FB800CC */ lw $t8, 0xcc($sp) -/* 04804C 7F01351C 26D60001 */ addiu $s6, $s6, 1 -/* 048050 7F013520 258B0004 */ addiu $t3, $t4, 4 -/* 048054 7F013524 25CF0004 */ addiu $t7, $t6, 4 -/* 048058 7F013528 AFAF0070 */ sw $t7, 0x70($sp) -/* 04805C 7F01352C AFAB0074 */ sw $t3, 0x74($sp) -/* 048060 7F013530 16D8FF52 */ bne $s6, $t8, .L7F01327C -/* 048064 7F013534 00408825 */ move $s1, $v0 -.L7F013538: -/* 048068 7F013538 0FC2B3BC */ jal combiner_bayer_lod_perspective -/* 04806C 7F01353C 02202025 */ move $a0, $s1 -/* 048070 7F013540 8FBF0064 */ lw $ra, 0x64($sp) -/* 048074 7F013544 D7B40038 */ ldc1 $f20, 0x38($sp) -/* 048078 7F013548 8FB00040 */ lw $s0, 0x40($sp) -/* 04807C 7F01354C 8FB10044 */ lw $s1, 0x44($sp) -/* 048080 7F013550 8FB20048 */ lw $s2, 0x48($sp) -/* 048084 7F013554 8FB3004C */ lw $s3, 0x4c($sp) -/* 048088 7F013558 8FB40050 */ lw $s4, 0x50($sp) -/* 04808C 7F01355C 8FB50054 */ lw $s5, 0x54($sp) -/* 048090 7F013560 8FB60058 */ lw $s6, 0x58($sp) -/* 048094 7F013564 8FB7005C */ lw $s7, 0x5c($sp) -/* 048098 7F013568 8FBE0060 */ lw $fp, 0x60($sp) -/* 04809C 7F01356C 03E00008 */ jr $ra -/* 0480A0 7F013570 27BD00D0 */ addiu $sp, $sp, 0xd0 -) -#endif + //******************************************************************************************************** @@ -13815,1396 +5939,234 @@ void update_menu11_mpcontrols(void) { - -#ifdef NONMATCHING +// Address 0x7F013608 NTSC +// Address 0x7F013648 NTSC-J void interface_menu11_mpcontrols(void) { s32 sp44; - s32 temp_s1; - s32 temp_s6; - s32 temp_t8; - void *temp_s4; - void *temp_v1; - void *temp_v1_2; - void *phi_s2; - s32 phi_s1; - s32 phi_s5; - - temp_s6 = get_selected_num_players(); - sp44 = 0; - viSetFovY(0x42700000); - viSetAspect(D_80051A98); - viSetZRange(0x42c80000, D_80051A9C); + s32 i; + s32 var_fp; + + sp44 = get_selected_num_players(); + var_fp = 0; + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); - if (temp_s6 > 0) + +#if defined(VERSION_JP) || defined(VERSION_EU) + #define MAYBE_OR_JOYCOUNT_NOT_4 || joyGetControllerCount() != 4 + #define MAYBE_AND_JOYCOUNT_4 && joyGetControllerCount() == 4 +#endif + +#if defined(VERSION_US) + #define MAYBE_OR_JOYCOUNT_NOT_4 + #define MAYBE_AND_JOYCOUNT_4 +#endif + + + for (i = 0; i < sp44; i++) { - phi_s2 = &has_selected_char_player1; - phi_s1 = 0; - phi_s5 = 0; -loop_2: - if (*phi_s2 != 0) + if (player_has_selected_char[i] && joyGetButtonsPressedThisFrame(i, B_BUTTON)) { - if (joyGetButtonsPressedThisFrame((s32) (phi_s1 << 0x18) >> 0x18, 0x4000) != 0) - { - *phi_s2 = 0; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + player_has_selected_char[i] = 0; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - temp_t8 = (s32) (phi_s1 << 0x18) >> 0x18; - if (*phi_s2 == 0) + + if (player_has_selected_char[i] == 0) { - temp_s4 = phi_s5 + &player_handicap; - if ((joyGetButtonsPressedThisFrame((s32) (temp_t8 << 0x18) >> 0x18, 0x202) == 0) && (joyGetStickXInRange((s32) (temp_t8 << 0x18) >> 0x18, -2, 1) < -1)) + // 0x202 + if (joyGetButtonsPressedThisFrame(i, L_JPAD|L_CBUTTONS) || ((joyGetStickXInRange(i, -2, 1) < -1) && dword_CODE_bss_80069760[i] != 0)) { - if ((*temp_s4 != 0) && (*temp_v1 > 0)) + // if greater than 0 + if (controlstyle_player[i] > CONTROLLER_CONFIG_HONEY) { -block_10: - if ((((temp_s6 != 2) || (phi_s1 != 1)) || (controlstyle_player.unk0 < 4)) || (*temp_v1 >= 5)) + // ... OR PLAYER_1 is 1.x OR controlstyle_player[i] is 1 + 2.x + if ((sp44 != 2) || (i != PLAYER_2) MAYBE_OR_JOYCOUNT_NOT_4 || (controlstyle_player[PLAYER_1] < CONTROLLER_CONFIG_PLENTY) || (controlstyle_player[i] >= CONTROLLER_CONFIG_GALORE)) { - *temp_v1 = (s32) (*temp_v1 + -1); + controlstyle_player[i]--; } - else - { - } - if (temp_s6 == 2) + // ... AND PLAYER_1 is 1.x AND PLAYER_2 is 2.x + if ((sp44 == 2) && (i == PLAYER_1) MAYBE_AND_JOYCOUNT_4 && (controlstyle_player[PLAYER_1] < CONTROLLER_CONFIG_PLENTY) && (controlstyle_player[PLAYER_2] >= CONTROLLER_CONFIG_PLENTY)) { - if (phi_s1 == 0) - { - if (controlstyle_player.unk0 < 4) - { - if (controlstyle_player.unk4 >= 4) - { - controlstyle_player.unk4 = 0; - } - } - } + // PLAYER_2 is 1.1 + controlstyle_player[PLAYER_2] = CONTROLLER_CONFIG_HONEY; } } - else + } + // 0x101 + else if (joyGetButtonsPressedThisFrame(i, R_JPAD|R_CBUTTONS) || ((joyGetStickXInRange(i, -2, 1) > 0) && dword_CODE_bss_80069760[i] != 0)) + { + // ... controlstyle_player[i] is 2.x + if (((sp44 == 2) && (i == PLAYER_1) MAYBE_AND_JOYCOUNT_4) || controlstyle_player[i] >= CONTROLLER_CONFIG_PLENTY) { - if ((joyGetButtonsPressedThisFrame((s32) (temp_t8 << 0x18) >> 0x18, 0x101) == 0) && (joyGetStickXInRange((s32) (temp_t8 << 0x18) >> 0x18, -2, 1) > 0)) - { - if ((*temp_s4 != 0) && (temp_s6 == 2)) - { - if ((phi_s1 == 0) || (*temp_v1_2 >= 4)) - { -block_26: - if (*temp_v1_2 < 7) - { - *temp_v1_2 = (s32) (*temp_v1_2 + 1); - if (phi_s1 == 0) - { - if (controlstyle_player.unk0 == 4) - { - if (controlstyle_player.unk4 < 4) - { - controlstyle_player.unk4 = 4; - } - } - } - } - } - else - { -block_31: - if (*temp_v1_2 < 3) - { - *temp_v1_2 = (s32) (*temp_v1_2 + 1); - } - } - } - else - { - if (joyGetButtonsPressedThisFrame((s32) (temp_t8 << 0x18) >> 0x18, 0xb000) != 0) - { - *phi_s2 = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } - } - } - else + // if controlstyle_player[i] < 2.4 + if (controlstyle_player[i] < CONTROLLER_CONFIG_GOODHEAD) { - temp_v1_2 = &controlstyle_player + phi_s5; - if ((temp_s6 != 2) || (phi_s1 != 0)) - { - if (*temp_v1_2 >= 4) - { - goto block_26; - } - else - { - goto block_31; - } - } - else + controlstyle_player[i]++; + + // ... AND PLAYER_1 is 2.1 AND PLAYER_2 is 1.x + if ((i == PLAYER_1) && (controlstyle_player[PLAYER_1] == CONTROLLER_CONFIG_PLENTY) && (controlstyle_player[PLAYER_2] < CONTROLLER_CONFIG_PLENTY)) { - goto block_26; + // PLAYER_2 is 2.1 + controlstyle_player[PLAYER_2] = CONTROLLER_CONFIG_PLENTY; } } } + // else if controlstyle_player[i] < 1.45 + else if (controlstyle_player[i] < CONTROLLER_CONFIG_GOODNIGHT) + { + controlstyle_player[i]++; + } + } - else + else if (joyGetButtonsPressedThisFrame(i, A_BUTTON|Z_TRIG|START_BUTTON)) // 0xb000 + { + player_has_selected_char[i] = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + +#if defined(VERSION_JP) || defined(VERSION_EU) + if (joyGetControllerCount() != 4) { - temp_v1 = &controlstyle_player + phi_s5; - if (*temp_v1 > 0) + if (controlstyle_player[PLAYER_1] >= CONTROLLER_CONFIG_PLENTY) + { + controlstyle_player[PLAYER_1] = CONTROLLER_CONFIG_HONEY; + } + + if (controlstyle_player[PLAYER_2] >= CONTROLLER_CONFIG_PLENTY) { - goto block_10; + controlstyle_player[PLAYER_2] = CONTROLLER_CONFIG_HONEY; } } - if ((joyGetStickXInRange((s32) (temp_t8 << 0x18) >> 0x18, -2, 1) == -1) || (joyGetStickXInRange((s32) (temp_t8 << 0x18) >> 0x18, -2, 1) == 0)) +#endif + + if ((joyGetStickXInRange(i, -2, 1) == -1) || (joyGetStickXInRange(i, -2, 1) == 0)) { - *temp_s4 = 1; + dword_CODE_bss_80069760[i] = 1; } else { - *temp_s4 = 0; + dword_CODE_bss_80069760[i] = 0; } } - temp_s1 = phi_s1 + 1; - if (*phi_s2 != 0) - { - sp44 = (s32) (sp44 + 1); - } - phi_s2 = phi_s2 + 4; - phi_s1 = temp_s1; - phi_s5 = phi_s5 + 4; - if (temp_s1 != temp_s6) + + if (player_has_selected_char[i] != 0) { - goto loop_2; + var_fp++; } } + disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, 1); - set_item_visibility_in_objinstance(walletinst[0], 0x2a, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); menu_control_stick_tracking(); - if (sp44 == temp_s6) + + if (var_fp == sp44) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); + frontChangeMenu(MENU_MP_OPTIONS, 0); } -} -#else - -#ifdef VERSION_US -GLOBAL_ASM( -.late_rodata -glabel D_80051A98 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051A9C -.word 0x461C4000 /*10000.0;*/ - -.text -glabel interface_menu11_mpcontrols -/* 048138 7F013608 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 04813C 7F01360C AFBF003C */ sw $ra, 0x3c($sp) -/* 048140 7F013610 AFBE0038 */ sw $fp, 0x38($sp) -/* 048144 7F013614 AFB70034 */ sw $s7, 0x34($sp) -/* 048148 7F013618 AFB60030 */ sw $s6, 0x30($sp) -/* 04814C 7F01361C AFB5002C */ sw $s5, 0x2c($sp) -/* 048150 7F013620 AFB40028 */ sw $s4, 0x28($sp) -/* 048154 7F013624 AFB30024 */ sw $s3, 0x24($sp) -/* 048158 7F013628 AFB20020 */ sw $s2, 0x20($sp) -/* 04815C 7F01362C AFB1001C */ sw $s1, 0x1c($sp) -/* 048160 7F013630 0FC040A4 */ jal get_selected_num_players -/* 048164 7F013634 AFB00018 */ sw $s0, 0x18($sp) -/* 048168 7F013638 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 04816C 7F01363C 44816000 */ mtc1 $at, $f12 -/* 048170 7F013640 0040B025 */ move $s6, $v0 -/* 048174 7F013644 0C001151 */ jal viSetFovY -/* 048178 7F013648 AFA00044 */ sw $zero, 0x44($sp) -/* 04817C 7F01364C 3C018005 */ lui $at, %hi(D_80051A98) -/* 048180 7F013650 0C001164 */ jal viSetAspect -/* 048184 7F013654 C42C1A98 */ lwc1 $f12, %lo(D_80051A98)($at) -/* 048188 7F013658 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 04818C 7F01365C 44816000 */ mtc1 $at, $f12 -/* 048190 7F013660 3C018005 */ lui $at, %hi(D_80051A9C) -/* 048194 7F013664 0C001194 */ jal viSetZRange -/* 048198 7F013668 C42E1A9C */ lwc1 $f14, %lo(D_80051A9C)($at) -/* 04819C 7F01366C 0C00114D */ jal viSetUseZBuf -/* 0481A0 7F013670 00002025 */ move $a0, $zero -/* 0481A4 7F013674 1AC000A2 */ blez $s6, .L7F013900 -/* 0481A8 7F013678 00008825 */ move $s1, $zero -/* 0481AC 7F01367C 3C128007 */ lui $s2, %hi(player_has_selected_char) -/* 0481B0 7F013680 3C138007 */ lui $s3, %hi(controlstyle_player) -/* 0481B4 7F013684 267397B8 */ addiu $s3, %lo(controlstyle_player) # addiu $s3, $s3, -0x6848 -/* 0481B8 7F013688 26529740 */ addiu $s2, %lo(player_has_selected_char) # addiu $s2, $s2, -0x68c0 -/* 0481BC 7F01368C 0000A825 */ move $s5, $zero -/* 0481C0 7F013690 241E0001 */ li $fp, 1 -/* 0481C4 7F013694 24170002 */ li $s7, 2 -.L7F013698: -/* 0481C8 7F013698 8E4E0000 */ lw $t6, ($s2) -/* 0481CC 7F01369C 00112600 */ sll $a0, $s1, 0x18 -/* 0481D0 7F0136A0 00047E03 */ sra $t7, $a0, 0x18 -/* 0481D4 7F0136A4 11C0000A */ beqz $t6, .L7F0136D0 -/* 0481D8 7F0136A8 01E02025 */ move $a0, $t7 -/* 0481DC 7F0136AC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0481E0 7F0136B0 24054000 */ li $a1, 16384 -/* 0481E4 7F0136B4 10400006 */ beqz $v0, .L7F0136D0 -/* 0481E8 7F0136B8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0481EC 7F0136BC AE400000 */ sw $zero, ($s2) -/* 0481F0 7F0136C0 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0481F4 7F0136C4 240500C7 */ li $a1, 199 -/* 0481F8 7F0136C8 0C002382 */ jal sndPlaySfx -/* 0481FC 7F0136CC 00003025 */ move $a2, $zero -.L7F0136D0: -/* 048200 7F0136D0 8E420000 */ lw $v0, ($s2) -/* 048204 7F0136D4 00118600 */ sll $s0, $s1, 0x18 -/* 048208 7F0136D8 0010C603 */ sra $t8, $s0, 0x18 -/* 04820C 7F0136DC 14400080 */ bnez $v0, .L7F0138E0 -/* 048210 7F0136E0 03008025 */ move $s0, $t8 -/* 048214 7F0136E4 00182600 */ sll $a0, $t8, 0x18 -/* 048218 7F0136E8 3C088007 */ lui $t0, %hi(dword_CODE_bss_80069760) -/* 04821C 7F0136EC 25089760 */ addiu $t0, $t0, %lo(dword_CODE_bss_80069760) -/* 048220 7F0136F0 0004CE03 */ sra $t9, $a0, 0x18 -/* 048224 7F0136F4 03202025 */ move $a0, $t9 -/* 048228 7F0136F8 02A8A021 */ addu $s4, $s5, $t0 -/* 04822C 7F0136FC 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 048230 7F013700 24050202 */ li $a1, 514 -/* 048234 7F013704 1440000B */ bnez $v0, .L7F013734 -/* 048238 7F013708 00102600 */ sll $a0, $s0, 0x18 -/* 04823C 7F01370C 00044E03 */ sra $t1, $a0, 0x18 -/* 048240 7F013710 01202025 */ move $a0, $t1 -/* 048244 7F013714 2405FFFE */ li $a1, -2 -/* 048248 7F013718 0C00312D */ jal joyGetStickXInRange -/* 04824C 7F01371C 03C03025 */ move $a2, $fp -/* 048250 7F013720 2841FFFF */ slti $at, $v0, -1 -/* 048254 7F013724 10200020 */ beqz $at, .L7F0137A8 -/* 048258 7F013728 00102600 */ sll $a0, $s0, 0x18 -/* 04825C 7F01372C 8E8A0000 */ lw $t2, ($s4) -/* 048260 7F013730 1140001D */ beqz $t2, .L7F0137A8 -.L7F013734: -/* 048264 7F013734 02751821 */ addu $v1, $s3, $s5 -/* 048268 7F013738 8C620000 */ lw $v0, ($v1) -/* 04826C 7F01373C 58400054 */ blezl $v0, .L7F013890 -/* 048270 7F013740 00102600 */ sll $a0, $s0, 0x18 -/* 048274 7F013744 16D70009 */ bne $s6, $s7, .L7F01376C -/* 048278 7F013748 244CFFFF */ addiu $t4, $v0, -1 -/* 04827C 7F01374C 563E0008 */ bnel $s1, $fp, .L7F013770 -/* 048280 7F013750 AC6C0000 */ sw $t4, ($v1) -/* 048284 7F013754 8E6B0000 */ lw $t3, ($s3) -/* 048288 7F013758 29610004 */ slti $at, $t3, 4 -/* 04828C 7F01375C 14200003 */ bnez $at, .L7F01376C -/* 048290 7F013760 28410005 */ slti $at, $v0, 5 -/* 048294 7F013764 14200002 */ bnez $at, .L7F013770 -/* 048298 7F013768 00000000 */ nop -.L7F01376C: -/* 04829C 7F01376C AC6C0000 */ sw $t4, ($v1) -.L7F013770: -/* 0482A0 7F013770 56D70047 */ bnel $s6, $s7, .L7F013890 -/* 0482A4 7F013774 00102600 */ sll $a0, $s0, 0x18 -/* 0482A8 7F013778 56200045 */ bnezl $s1, .L7F013890 -/* 0482AC 7F01377C 00102600 */ sll $a0, $s0, 0x18 -/* 0482B0 7F013780 8E6D0000 */ lw $t5, ($s3) -/* 0482B4 7F013784 29A10004 */ slti $at, $t5, 4 -/* 0482B8 7F013788 50200041 */ beql $at, $zero, .L7F013890 -/* 0482BC 7F01378C 00102600 */ sll $a0, $s0, 0x18 -/* 0482C0 7F013790 8E6E0004 */ lw $t6, 4($s3) -/* 0482C4 7F013794 29C10004 */ slti $at, $t6, 4 -/* 0482C8 7F013798 5420003D */ bnezl $at, .L7F013890 -/* 0482CC 7F01379C 00102600 */ sll $a0, $s0, 0x18 -/* 0482D0 7F0137A0 1000003A */ b .L7F01388C -/* 0482D4 7F0137A4 AE600004 */ sw $zero, 4($s3) -.L7F0137A8: -/* 0482D8 7F0137A8 00047E03 */ sra $t7, $a0, 0x18 -/* 0482DC 7F0137AC 01E02025 */ move $a0, $t7 -/* 0482E0 7F0137B0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0482E4 7F0137B4 24050101 */ li $a1, 257 -/* 0482E8 7F0137B8 1440000B */ bnez $v0, .L7F0137E8 -/* 0482EC 7F0137BC 00102600 */ sll $a0, $s0, 0x18 -/* 0482F0 7F0137C0 0004C603 */ sra $t8, $a0, 0x18 -/* 0482F4 7F0137C4 03002025 */ move $a0, $t8 -/* 0482F8 7F0137C8 2405FFFE */ li $a1, -2 -/* 0482FC 7F0137CC 0C00312D */ jal joyGetStickXInRange -/* 048300 7F0137D0 03C03025 */ move $a2, $fp -/* 048304 7F0137D4 18400022 */ blez $v0, .L7F013860 -/* 048308 7F0137D8 00102600 */ sll $a0, $s0, 0x18 -/* 04830C 7F0137DC 8E990000 */ lw $t9, ($s4) -/* 048310 7F0137E0 53200020 */ beql $t9, $zero, .L7F013864 -/* 048314 7F0137E4 00046E03 */ sra $t5, $a0, 0x18 -.L7F0137E8: -/* 048318 7F0137E8 16D70003 */ bne $s6, $s7, .L7F0137F8 -/* 04831C 7F0137EC 02751821 */ addu $v1, $s3, $s5 -/* 048320 7F0137F0 52200006 */ beql $s1, $zero, .L7F01380C -/* 048324 7F0137F4 8C620000 */ lw $v0, ($v1) -.L7F0137F8: -/* 048328 7F0137F8 8C620000 */ lw $v0, ($v1) -/* 04832C 7F0137FC 28410004 */ slti $at, $v0, 4 -/* 048330 7F013800 54200013 */ bnezl $at, .L7F013850 -/* 048334 7F013804 28410003 */ slti $at, $v0, 3 -/* 048338 7F013808 8C620000 */ lw $v0, ($v1) -.L7F01380C: -/* 04833C 7F01380C 28410007 */ slti $at, $v0, 7 -/* 048340 7F013810 1020001E */ beqz $at, .L7F01388C -/* 048344 7F013814 24480001 */ addiu $t0, $v0, 1 -/* 048348 7F013818 1620001C */ bnez $s1, .L7F01388C -/* 04834C 7F01381C AC680000 */ sw $t0, ($v1) -/* 048350 7F013820 8E690000 */ lw $t1, ($s3) -/* 048354 7F013824 24010004 */ li $at, 4 -/* 048358 7F013828 55210019 */ bnel $t1, $at, .L7F013890 -/* 04835C 7F01382C 00102600 */ sll $a0, $s0, 0x18 -/* 048360 7F013830 8E6A0004 */ lw $t2, 4($s3) -/* 048364 7F013834 240B0004 */ li $t3, 4 -/* 048368 7F013838 29410004 */ slti $at, $t2, 4 -/* 04836C 7F01383C 50200014 */ beql $at, $zero, .L7F013890 -/* 048370 7F013840 00102600 */ sll $a0, $s0, 0x18 -/* 048374 7F013844 10000011 */ b .L7F01388C -/* 048378 7F013848 AE6B0004 */ sw $t3, 4($s3) -/* 04837C 7F01384C 28410003 */ slti $at, $v0, 3 -.L7F013850: -/* 048380 7F013850 1020000E */ beqz $at, .L7F01388C -/* 048384 7F013854 244C0001 */ addiu $t4, $v0, 1 -/* 048388 7F013858 1000000C */ b .L7F01388C -/* 04838C 7F01385C AC6C0000 */ sw $t4, ($v1) -.L7F013860: -/* 048390 7F013860 00046E03 */ sra $t5, $a0, 0x18 -.L7F013864: -/* 048394 7F013864 01A02025 */ move $a0, $t5 -/* 048398 7F013868 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04839C 7F01386C 3405B000 */ li $a1, 45056 -/* 0483A0 7F013870 10400006 */ beqz $v0, .L7F01388C -/* 0483A4 7F013874 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0483A8 7F013878 AE5E0000 */ sw $fp, ($s2) -/* 0483AC 7F01387C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0483B0 7F013880 240500C7 */ li $a1, 199 -/* 0483B4 7F013884 0C002382 */ jal sndPlaySfx -/* 0483B8 7F013888 00003025 */ move $a2, $zero -.L7F01388C: -/* 0483BC 7F01388C 00102600 */ sll $a0, $s0, 0x18 -.L7F013890: -/* 0483C0 7F013890 00047603 */ sra $t6, $a0, 0x18 -/* 0483C4 7F013894 01C02025 */ move $a0, $t6 -/* 0483C8 7F013898 2405FFFE */ li $a1, -2 -/* 0483CC 7F01389C 0C00312D */ jal joyGetStickXInRange -/* 0483D0 7F0138A0 03C03025 */ move $a2, $fp -/* 0483D4 7F0138A4 2401FFFF */ li $at, -1 -/* 0483D8 7F0138A8 10410008 */ beq $v0, $at, .L7F0138CC -/* 0483DC 7F0138AC 00102600 */ sll $a0, $s0, 0x18 -/* 0483E0 7F0138B0 00047E03 */ sra $t7, $a0, 0x18 -/* 0483E4 7F0138B4 01E02025 */ move $a0, $t7 -/* 0483E8 7F0138B8 2405FFFE */ li $a1, -2 -/* 0483EC 7F0138BC 0C00312D */ jal joyGetStickXInRange -/* 0483F0 7F0138C0 03C03025 */ move $a2, $fp -/* 0483F4 7F0138C4 54400005 */ bnezl $v0, .L7F0138DC -/* 0483F8 7F0138C8 AE800000 */ sw $zero, ($s4) -.L7F0138CC: -/* 0483FC 7F0138CC AE9E0000 */ sw $fp, ($s4) -/* 048400 7F0138D0 10000003 */ b .L7F0138E0 -/* 048404 7F0138D4 8E420000 */ lw $v0, ($s2) -/* 048408 7F0138D8 AE800000 */ sw $zero, ($s4) -.L7F0138DC: -/* 04840C 7F0138DC 8E420000 */ lw $v0, ($s2) -.L7F0138E0: -/* 048410 7F0138E0 10400004 */ beqz $v0, .L7F0138F4 -/* 048414 7F0138E4 26310001 */ addiu $s1, $s1, 1 -/* 048418 7F0138E8 8FB80044 */ lw $t8, 0x44($sp) -/* 04841C 7F0138EC 27190001 */ addiu $t9, $t8, 1 -/* 048420 7F0138F0 AFB90044 */ sw $t9, 0x44($sp) -.L7F0138F4: -/* 048424 7F0138F4 26B50004 */ addiu $s5, $s5, 4 -/* 048428 7F0138F8 1636FF67 */ bne $s1, $s6, .L7F013698 -/* 04842C 7F0138FC 26520004 */ addiu $s2, $s2, 4 -.L7F013900: -/* 048430 7F013900 3C108003 */ lui $s0, %hi(walletinst) -/* 048434 7F013904 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 048438 7F013908 0FC02DC9 */ jal disable_all_switches -/* 04843C 7F01390C 8E040000 */ lw $a0, ($s0) -/* 048440 7F013910 8E040000 */ lw $a0, ($s0) -/* 048444 7F013914 00002825 */ move $a1, $zero -/* 048448 7F013918 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 04844C 7F01391C 24060001 */ li $a2, 1 -/* 048450 7F013920 8E040000 */ lw $a0, ($s0) -/* 048454 7F013924 2405002A */ li $a1, 42 -/* 048458 7F013928 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 04845C 7F01392C 24060001 */ li $a2, 1 -/* 048460 7F013930 0FC026E1 */ jal menu_control_stick_tracking -/* 048464 7F013934 00000000 */ nop -/* 048468 7F013938 8FA80044 */ lw $t0, 0x44($sp) -/* 04846C 7F01393C 2404000E */ li $a0, 14 -/* 048470 7F013940 55160004 */ bnel $t0, $s6, .L7F013954 -/* 048474 7F013944 8FBF003C */ lw $ra, 0x3c($sp) -/* 048478 7F013948 0FC06975 */ jal set_menu_to_mode -/* 04847C 7F01394C 00002825 */ move $a1, $zero -/* 048480 7F013950 8FBF003C */ lw $ra, 0x3c($sp) -.L7F013954: -/* 048484 7F013954 8FB00018 */ lw $s0, 0x18($sp) -/* 048488 7F013958 8FB1001C */ lw $s1, 0x1c($sp) -/* 04848C 7F01395C 8FB20020 */ lw $s2, 0x20($sp) -/* 048490 7F013960 8FB30024 */ lw $s3, 0x24($sp) -/* 048494 7F013964 8FB40028 */ lw $s4, 0x28($sp) -/* 048498 7F013968 8FB5002C */ lw $s5, 0x2c($sp) -/* 04849C 7F01396C 8FB60030 */ lw $s6, 0x30($sp) -/* 0484A0 7F013970 8FB70034 */ lw $s7, 0x34($sp) -/* 0484A4 7F013974 8FBE0038 */ lw $fp, 0x38($sp) -/* 0484A8 7F013978 03E00008 */ jr $ra -/* 0484AC 7F01397C 27BD0050 */ addiu $sp, $sp, 0x50 -) -#endif -#ifdef VERSION_JP -GLOBAL_ASM( -.late_rodata -glabel D_80051A98 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051A9C -.word 0x461C4000 /*10000.0;*/ -.text -glabel interface_menu11_mpcontrols -/* 0481B8 7F013648 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0481BC 7F01364C AFBF003C */ sw $ra, 0x3c($sp) -/* 0481C0 7F013650 AFBE0038 */ sw $fp, 0x38($sp) -/* 0481C4 7F013654 AFB70034 */ sw $s7, 0x34($sp) -/* 0481C8 7F013658 AFB60030 */ sw $s6, 0x30($sp) -/* 0481CC 7F01365C AFB5002C */ sw $s5, 0x2c($sp) -/* 0481D0 7F013660 AFB40028 */ sw $s4, 0x28($sp) -/* 0481D4 7F013664 AFB30024 */ sw $s3, 0x24($sp) -/* 0481D8 7F013668 AFB20020 */ sw $s2, 0x20($sp) -/* 0481DC 7F01366C AFB1001C */ sw $s1, 0x1c($sp) -/* 0481E0 7F013670 0FC040B4 */ jal get_selected_num_players -/* 0481E4 7F013674 AFB00018 */ sw $s0, 0x18($sp) -/* 0481E8 7F013678 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0481EC 7F01367C 44816000 */ mtc1 $at, $f12 -/* 0481F0 7F013680 0040B825 */ move $s7, $v0 -/* 0481F4 7F013684 0C001151 */ jal viSetFovY -/* 0481F8 7F013688 AFA00054 */ sw $zero, 0x54($sp) -/* 0481FC 7F01368C 3C018005 */ lui $at, %hi(D_80051A98) # $at, 0x8005 -/* 048200 7F013690 0C001164 */ jal viSetAspect -/* 048204 7F013694 C42C1AC8 */ lwc1 $f12, %lo(D_80051A98)($at) -/* 048208 7F013698 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 04820C 7F01369C 44816000 */ mtc1 $at, $f12 -/* 048210 7F0136A0 3C018005 */ lui $at, %hi(D_80051A9C) # $at, 0x8005 -/* 048214 7F0136A4 0C001194 */ jal viSetZRange -/* 048218 7F0136A8 C42E1ACC */ lwc1 $f14, %lo(D_80051A9C)($at) -/* 04821C 7F0136AC 0C00114D */ jal viSetUseZBuf -/* 048220 7F0136B0 00002025 */ move $a0, $zero -/* 048224 7F0136B4 1AE000BE */ blez $s7, .L7F0139B0 -/* 048228 7F0136B8 00009025 */ move $s2, $zero -/* 04822C 7F0136BC 3C138007 */ lui $s3, %hi(player_has_selected_char) # $s3, 0x8007 -/* 048230 7F0136C0 3C108007 */ lui $s0, %hi(controlstyle_player) # $s0, 0x8007 -/* 048234 7F0136C4 261097F8 */ addiu $s0, %lo(controlstyle_player) # addiu $s0, $s0, -0x6808 -/* 048238 7F0136C8 26739780 */ addiu $s3, %lo(player_has_selected_char) # addiu $s3, $s3, -0x6880 -/* 04823C 7F0136CC 0000B025 */ move $s6, $zero -/* 048240 7F0136D0 241E0002 */ li $fp, 2 -/* 048244 7F0136D4 24140004 */ li $s4, 4 -.L7F0136D8: -/* 048248 7F0136D8 8E6E0000 */ lw $t6, ($s3) -/* 04824C 7F0136DC 00122600 */ sll $a0, $s2, 0x18 -/* 048250 7F0136E0 00047E03 */ sra $t7, $a0, 0x18 -/* 048254 7F0136E4 11C0000A */ beqz $t6, .L7F013710 -/* 048258 7F0136E8 01E02025 */ move $a0, $t7 -/* 04825C 7F0136EC 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048260 7F0136F0 24054000 */ li $a1, 16384 -/* 048264 7F0136F4 10400006 */ beqz $v0, .L7F013710 -/* 048268 7F0136F8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 04826C 7F0136FC AE600000 */ sw $zero, ($s3) -/* 048270 7F013700 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 048274 7F013704 240500C7 */ li $a1, 199 -/* 048278 7F013708 0C002386 */ jal sndPlaySfx -/* 04827C 7F01370C 00003025 */ move $a2, $zero -.L7F013710: -/* 048280 7F013710 8E620000 */ lw $v0, ($s3) -/* 048284 7F013714 00128E00 */ sll $s1, $s2, 0x18 -/* 048288 7F013718 0011C603 */ sra $t8, $s1, 0x18 -/* 04828C 7F01371C 1440009C */ bnez $v0, .L7F013990 -/* 048290 7F013720 03008825 */ move $s1, $t8 -/* 048294 7F013724 00182600 */ sll $a0, $t8, 0x18 -/* 048298 7F013728 3C088007 */ lui $t0, %hi(dword_CODE_bss_80069760) # $t0, 0x8007 -/* 04829C 7F01372C 250897A0 */ addiu $t0, %lo(dword_CODE_bss_80069760) # addiu $t0, $t0, -0x6860 -/* 0482A0 7F013730 0004CE03 */ sra $t9, $a0, 0x18 -/* 0482A4 7F013734 03202025 */ move $a0, $t9 -/* 0482A8 7F013738 02C8A821 */ addu $s5, $s6, $t0 -/* 0482AC 7F01373C 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 0482B0 7F013740 24050202 */ li $a1, 514 -/* 0482B4 7F013744 1440000B */ bnez $v0, .L7F013774 -/* 0482B8 7F013748 00112600 */ sll $a0, $s1, 0x18 -/* 0482BC 7F01374C 00044E03 */ sra $t1, $a0, 0x18 -/* 0482C0 7F013750 01202025 */ move $a0, $t1 -/* 0482C4 7F013754 2405FFFE */ li $a1, -2 -/* 0482C8 7F013758 0C003146 */ jal joyGetStickXInRange -/* 0482CC 7F01375C 24060001 */ li $a2, 1 -/* 0482D0 7F013760 2841FFFF */ slti $at, $v0, -1 -/* 0482D4 7F013764 1020002C */ beqz $at, .L7F013818 -/* 0482D8 7F013768 00112600 */ sll $a0, $s1, 0x18 -/* 0482DC 7F01376C 8EAA0000 */ lw $t2, ($s5) -/* 0482E0 7F013770 11400029 */ beqz $t2, .L7F013818 -.L7F013774: -/* 0482E4 7F013774 02161821 */ addu $v1, $s0, $s6 -/* 0482E8 7F013778 8C6B0000 */ lw $t3, ($v1) -/* 0482EC 7F01377C 19600062 */ blez $t3, .L7F013908 -/* 0482F0 7F013780 00000000 */ nop -/* 0482F4 7F013784 16FE000F */ bne $s7, $fp, .L7F0137C4 -/* 0482F8 7F013788 24010001 */ li $at, 1 -/* 0482FC 7F01378C 5641000E */ bnel $s2, $at, .L7F0137C8 -/* 048300 7F013790 8C6E0000 */ lw $t6, ($v1) -/* 048304 7F013794 0C002E82 */ jal joyGetControllerCount -/* 048308 7F013798 AFA30040 */ sw $v1, 0x40($sp) -/* 04830C 7F01379C 14540009 */ bne $v0, $s4, .L7F0137C4 -/* 048310 7F0137A0 8FA30040 */ lw $v1, 0x40($sp) -/* 048314 7F0137A4 8E0C0000 */ lw $t4, ($s0) -/* 048318 7F0137A8 29810004 */ slti $at, $t4, 4 -/* 04831C 7F0137AC 54200006 */ bnezl $at, .L7F0137C8 -/* 048320 7F0137B0 8C6E0000 */ lw $t6, ($v1) -/* 048324 7F0137B4 8C6D0000 */ lw $t5, ($v1) -/* 048328 7F0137B8 29A10005 */ slti $at, $t5, 5 -/* 04832C 7F0137BC 14200004 */ bnez $at, .L7F0137D0 -/* 048330 7F0137C0 00000000 */ nop -.L7F0137C4: -/* 048334 7F0137C4 8C6E0000 */ lw $t6, ($v1) -.L7F0137C8: -/* 048338 7F0137C8 25CFFFFF */ addiu $t7, $t6, -1 -/* 04833C 7F0137CC AC6F0000 */ sw $t7, ($v1) -.L7F0137D0: -/* 048340 7F0137D0 16FE004D */ bne $s7, $fp, .L7F013908 -/* 048344 7F0137D4 00000000 */ nop -/* 048348 7F0137D8 1640004B */ bnez $s2, .L7F013908 -/* 04834C 7F0137DC 00000000 */ nop -/* 048350 7F0137E0 0C002E82 */ jal joyGetControllerCount -/* 048354 7F0137E4 00000000 */ nop -/* 048358 7F0137E8 14540047 */ bne $v0, $s4, .L7F013908 -/* 04835C 7F0137EC 00000000 */ nop -/* 048360 7F0137F0 8E180000 */ lw $t8, ($s0) -/* 048364 7F0137F4 2B010004 */ slti $at, $t8, 4 -/* 048368 7F0137F8 10200043 */ beqz $at, .L7F013908 -/* 04836C 7F0137FC 00000000 */ nop -/* 048370 7F013800 8E190004 */ lw $t9, 4($s0) -/* 048374 7F013804 2B210004 */ slti $at, $t9, 4 -/* 048378 7F013808 1420003F */ bnez $at, .L7F013908 -/* 04837C 7F01380C 00000000 */ nop -/* 048380 7F013810 1000003D */ b .L7F013908 -/* 048384 7F013814 AE000004 */ sw $zero, 4($s0) -.L7F013818: -/* 048388 7F013818 00044603 */ sra $t0, $a0, 0x18 -/* 04838C 7F01381C 01002025 */ move $a0, $t0 -/* 048390 7F013820 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048394 7F013824 24050101 */ li $a1, 257 -/* 048398 7F013828 1440000B */ bnez $v0, .L7F013858 -/* 04839C 7F01382C 00112600 */ sll $a0, $s1, 0x18 -/* 0483A0 7F013830 00044E03 */ sra $t1, $a0, 0x18 -/* 0483A4 7F013834 01202025 */ move $a0, $t1 -/* 0483A8 7F013838 2405FFFE */ li $a1, -2 -/* 0483AC 7F01383C 0C003146 */ jal joyGetStickXInRange -/* 0483B0 7F013840 24060001 */ li $a2, 1 -/* 0483B4 7F013844 18400024 */ blez $v0, .L7F0138D8 -/* 0483B8 7F013848 00112600 */ sll $a0, $s1, 0x18 -/* 0483BC 7F01384C 8EAA0000 */ lw $t2, ($s5) -/* 0483C0 7F013850 51400022 */ beql $t2, $zero, .L7F0138DC -/* 0483C4 7F013854 00047E03 */ sra $t7, $a0, 0x18 -.L7F013858: -/* 0483C8 7F013858 16FE0007 */ bne $s7, $fp, .L7F013878 -/* 0483CC 7F01385C 02161821 */ addu $v1, $s0, $s6 -/* 0483D0 7F013860 56400006 */ bnezl $s2, .L7F01387C -/* 0483D4 7F013864 8C620000 */ lw $v0, ($v1) -/* 0483D8 7F013868 0C002E82 */ jal joyGetControllerCount -/* 0483DC 7F01386C AFA30040 */ sw $v1, 0x40($sp) -/* 0483E0 7F013870 10540005 */ beq $v0, $s4, .L7F013888 -/* 0483E4 7F013874 8FA30040 */ lw $v1, 0x40($sp) -.L7F013878: -/* 0483E8 7F013878 8C620000 */ lw $v0, ($v1) -.L7F01387C: -/* 0483EC 7F01387C 28410004 */ slti $at, $v0, 4 -/* 0483F0 7F013880 54200011 */ bnezl $at, .L7F0138C8 -/* 0483F4 7F013884 28410003 */ slti $at, $v0, 3 -.L7F013888: -/* 0483F8 7F013888 8C620000 */ lw $v0, ($v1) -/* 0483FC 7F01388C 28410007 */ slti $at, $v0, 7 -/* 048400 7F013890 1020001D */ beqz $at, .L7F013908 -/* 048404 7F013894 244B0001 */ addiu $t3, $v0, 1 -/* 048408 7F013898 1640001B */ bnez $s2, .L7F013908 -/* 04840C 7F01389C AC6B0000 */ sw $t3, ($v1) -/* 048410 7F0138A0 8E0C0000 */ lw $t4, ($s0) -/* 048414 7F0138A4 168C0018 */ bne $s4, $t4, .L7F013908 -/* 048418 7F0138A8 00000000 */ nop -/* 04841C 7F0138AC 8E0D0004 */ lw $t5, 4($s0) -/* 048420 7F0138B0 29A10004 */ slti $at, $t5, 4 -/* 048424 7F0138B4 10200014 */ beqz $at, .L7F013908 -/* 048428 7F0138B8 00000000 */ nop -/* 04842C 7F0138BC 10000012 */ b .L7F013908 -/* 048430 7F0138C0 AE140004 */ sw $s4, 4($s0) -/* 048434 7F0138C4 28410003 */ slti $at, $v0, 3 -.L7F0138C8: -/* 048438 7F0138C8 1020000F */ beqz $at, .L7F013908 -/* 04843C 7F0138CC 244E0001 */ addiu $t6, $v0, 1 -/* 048440 7F0138D0 1000000D */ b .L7F013908 -/* 048444 7F0138D4 AC6E0000 */ sw $t6, ($v1) -.L7F0138D8: -/* 048448 7F0138D8 00047E03 */ sra $t7, $a0, 0x18 -.L7F0138DC: -/* 04844C 7F0138DC 01E02025 */ move $a0, $t7 -/* 048450 7F0138E0 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048454 7F0138E4 3405B000 */ li $a1, 45056 -/* 048458 7F0138E8 10400007 */ beqz $v0, .L7F013908 -/* 04845C 7F0138EC 24180001 */ li $t8, 1 -/* 048460 7F0138F0 AE780000 */ sw $t8, ($s3) -/* 048464 7F0138F4 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 048468 7F0138F8 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 04846C 7F0138FC 240500C7 */ li $a1, 199 -/* 048470 7F013900 0C002386 */ jal sndPlaySfx -/* 048474 7F013904 00003025 */ move $a2, $zero -.L7F013908: -/* 048478 7F013908 0C002E82 */ jal joyGetControllerCount -/* 04847C 7F01390C 00000000 */ nop -/* 048480 7F013910 1054000B */ beq $v0, $s4, .L7F013940 -/* 048484 7F013914 00112600 */ sll $a0, $s1, 0x18 -/* 048488 7F013918 8E190000 */ lw $t9, ($s0) -/* 04848C 7F01391C 2B210004 */ slti $at, $t9, 4 -/* 048490 7F013920 54200003 */ bnezl $at, .L7F013930 -/* 048494 7F013924 8E080004 */ lw $t0, 4($s0) -/* 048498 7F013928 AE000000 */ sw $zero, ($s0) -/* 04849C 7F01392C 8E080004 */ lw $t0, 4($s0) -.L7F013930: -/* 0484A0 7F013930 29010004 */ slti $at, $t0, 4 -/* 0484A4 7F013934 54200003 */ bnezl $at, .L7F013944 -/* 0484A8 7F013938 00044E03 */ sra $t1, $a0, 0x18 -/* 0484AC 7F01393C AE000004 */ sw $zero, 4($s0) -.L7F013940: -/* 0484B0 7F013940 00044E03 */ sra $t1, $a0, 0x18 -.L7F013944: -/* 0484B4 7F013944 01202025 */ move $a0, $t1 -/* 0484B8 7F013948 2405FFFE */ li $a1, -2 -/* 0484BC 7F01394C 0C003146 */ jal joyGetStickXInRange -/* 0484C0 7F013950 24060001 */ li $a2, 1 -/* 0484C4 7F013954 2401FFFF */ li $at, -1 -/* 0484C8 7F013958 10410007 */ beq $v0, $at, .L7F013978 -/* 0484CC 7F01395C 00112600 */ sll $a0, $s1, 0x18 -/* 0484D0 7F013960 00045603 */ sra $t2, $a0, 0x18 -/* 0484D4 7F013964 01402025 */ move $a0, $t2 -/* 0484D8 7F013968 2405FFFE */ li $a1, -2 -/* 0484DC 7F01396C 0C003146 */ jal joyGetStickXInRange -/* 0484E0 7F013970 24060001 */ li $a2, 1 -/* 0484E4 7F013974 14400004 */ bnez $v0, .L7F013988 -.L7F013978: -/* 0484E8 7F013978 240B0001 */ li $t3, 1 -/* 0484EC 7F01397C AEAB0000 */ sw $t3, ($s5) -/* 0484F0 7F013980 10000003 */ b .L7F013990 -/* 0484F4 7F013984 8E620000 */ lw $v0, ($s3) -.L7F013988: -/* 0484F8 7F013988 AEA00000 */ sw $zero, ($s5) -/* 0484FC 7F01398C 8E620000 */ lw $v0, ($s3) -.L7F013990: -/* 048500 7F013990 10400004 */ beqz $v0, .L7F0139A4 -/* 048504 7F013994 26520001 */ addiu $s2, $s2, 1 -/* 048508 7F013998 8FAC0054 */ lw $t4, 0x54($sp) -/* 04850C 7F01399C 258D0001 */ addiu $t5, $t4, 1 -/* 048510 7F0139A0 AFAD0054 */ sw $t5, 0x54($sp) -.L7F0139A4: -/* 048514 7F0139A4 26D60004 */ addiu $s6, $s6, 4 -/* 048518 7F0139A8 1657FF4B */ bne $s2, $s7, .L7F0136D8 -/* 04851C 7F0139AC 26730004 */ addiu $s3, $s3, 4 -.L7F0139B0: -/* 048520 7F0139B0 3C108003 */ lui $s0, %hi(walletinst) # $s0, 0x8003 -/* 048524 7F0139B4 2610A99C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x5664 -/* 048528 7F0139B8 0FC02DD1 */ jal disable_all_switches -/* 04852C 7F0139BC 8E040000 */ lw $a0, ($s0) -/* 048530 7F0139C0 8E040000 */ lw $a0, ($s0) -/* 048534 7F0139C4 00002825 */ move $a1, $zero -/* 048538 7F0139C8 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 04853C 7F0139CC 24060001 */ li $a2, 1 -/* 048540 7F0139D0 8E040000 */ lw $a0, ($s0) -/* 048544 7F0139D4 2405002A */ li $a1, 42 -/* 048548 7F0139D8 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 04854C 7F0139DC 24060001 */ li $a2, 1 -/* 048550 7F0139E0 0FC026E9 */ jal menu_control_stick_tracking -/* 048554 7F0139E4 00000000 */ nop -/* 048558 7F0139E8 8FAE0054 */ lw $t6, 0x54($sp) -/* 04855C 7F0139EC 2404000E */ li $a0, 14 -/* 048560 7F0139F0 55D70004 */ bnel $t6, $s7, .L7F013A04 -/* 048564 7F0139F4 8FBF003C */ lw $ra, 0x3c($sp) -/* 048568 7F0139F8 0FC069E2 */ jal set_menu_to_mode -/* 04856C 7F0139FC 00002825 */ move $a1, $zero -/* 048570 7F013A00 8FBF003C */ lw $ra, 0x3c($sp) -.L7F013A04: -/* 048574 7F013A04 8FB00018 */ lw $s0, 0x18($sp) -/* 048578 7F013A08 8FB1001C */ lw $s1, 0x1c($sp) -/* 04857C 7F013A0C 8FB20020 */ lw $s2, 0x20($sp) -/* 048580 7F013A10 8FB30024 */ lw $s3, 0x24($sp) -/* 048584 7F013A14 8FB40028 */ lw $s4, 0x28($sp) -/* 048588 7F013A18 8FB5002C */ lw $s5, 0x2c($sp) -/* 04858C 7F013A1C 8FB60030 */ lw $s6, 0x30($sp) -/* 048590 7F013A20 8FB70034 */ lw $s7, 0x34($sp) -/* 048594 7F013A24 8FBE0038 */ lw $fp, 0x38($sp) -/* 048598 7F013A28 03E00008 */ jr $ra -/* 04859C 7F013A2C 27BD0060 */ addiu $sp, $sp, 0x60 - -) -#endif -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_80051A98 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051A9C -.word 0x461C4000 /*10000.0;*/ -.text -glabel interface_menu11_mpcontrols -/* 0481B8 7F013648 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 0481BC 7F01364C AFBF003C */ sw $ra, 0x3c($sp) -/* 0481C0 7F013650 AFBE0038 */ sw $fp, 0x38($sp) -/* 0481C4 7F013654 AFB70034 */ sw $s7, 0x34($sp) -/* 0481C8 7F013658 AFB60030 */ sw $s6, 0x30($sp) -/* 0481CC 7F01365C AFB5002C */ sw $s5, 0x2c($sp) -/* 0481D0 7F013660 AFB40028 */ sw $s4, 0x28($sp) -/* 0481D4 7F013664 AFB30024 */ sw $s3, 0x24($sp) -/* 0481D8 7F013668 AFB20020 */ sw $s2, 0x20($sp) -/* 0481DC 7F01366C AFB1001C */ sw $s1, 0x1c($sp) -/* 0481E0 7F013670 0FC040B4 */ jal get_selected_num_players -/* 0481E4 7F013674 AFB00018 */ sw $s0, 0x18($sp) -/* 0481E8 7F013678 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0481EC 7F01367C 44816000 */ mtc1 $at, $f12 -/* 0481F0 7F013680 0040B825 */ move $s7, $v0 -/* 0481F4 7F013684 0C001151 */ jal viSetFovY -/* 0481F8 7F013688 AFA00054 */ sw $zero, 0x54($sp) -/* 0481FC 7F01368C 3C018005 */ lui $at, %hi(D_80051A98) # $at, 0x8005 -/* 048200 7F013690 0C001164 */ jal viSetAspect -/* 048204 7F013694 C42C1AC8 */ lwc1 $f12, %lo(D_80051A98)($at) -/* 048208 7F013698 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 04820C 7F01369C 44816000 */ mtc1 $at, $f12 -/* 048210 7F0136A0 3C018005 */ lui $at, %hi(D_80051A9C) # $at, 0x8005 -/* 048214 7F0136A4 0C001194 */ jal viSetZRange -/* 048218 7F0136A8 C42E1ACC */ lwc1 $f14, %lo(D_80051A9C)($at) -/* 04821C 7F0136AC 0C00114D */ jal viSetUseZBuf -/* 048220 7F0136B0 00002025 */ move $a0, $zero -/* 048224 7F0136B4 1AE000BE */ blez $s7, .L7F0139B0 -/* 048228 7F0136B8 00009025 */ move $s2, $zero -/* 04822C 7F0136BC 3C138007 */ lui $s3, %hi(player_has_selected_char) # $s3, 0x8007 -/* 048230 7F0136C0 3C108007 */ lui $s0, %hi(controlstyle_player) # $s0, 0x8007 -/* 048234 7F0136C4 261097F8 */ addiu $s0, %lo(controlstyle_player) # addiu $s0, $s0, -0x6808 -/* 048238 7F0136C8 26739780 */ addiu $s3, %lo(player_has_selected_char) # addiu $s3, $s3, -0x6880 -/* 04823C 7F0136CC 0000B025 */ move $s6, $zero -/* 048240 7F0136D0 241E0002 */ li $fp, 2 -/* 048244 7F0136D4 24140004 */ li $s4, 4 -.L7F0136D8: -/* 048248 7F0136D8 8E6E0000 */ lw $t6, ($s3) -/* 04824C 7F0136DC 00122600 */ sll $a0, $s2, 0x18 -/* 048250 7F0136E0 00047E03 */ sra $t7, $a0, 0x18 -/* 048254 7F0136E4 11C0000A */ beqz $t6, .L7F013710 -/* 048258 7F0136E8 01E02025 */ move $a0, $t7 -/* 04825C 7F0136EC 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048260 7F0136F0 24054000 */ li $a1, 16384 -/* 048264 7F0136F4 10400006 */ beqz $v0, .L7F013710 -/* 048268 7F0136F8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 04826C 7F0136FC AE600000 */ sw $zero, ($s3) -/* 048270 7F013700 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 048274 7F013704 240500C7 */ li $a1, 199 -/* 048278 7F013708 0C002386 */ jal sndPlaySfx -/* 04827C 7F01370C 00003025 */ move $a2, $zero -.L7F013710: -/* 048280 7F013710 8E620000 */ lw $v0, ($s3) -/* 048284 7F013714 00128E00 */ sll $s1, $s2, 0x18 -/* 048288 7F013718 0011C603 */ sra $t8, $s1, 0x18 -/* 04828C 7F01371C 1440009C */ bnez $v0, .L7F013990 -/* 048290 7F013720 03008825 */ move $s1, $t8 -/* 048294 7F013724 00182600 */ sll $a0, $t8, 0x18 -/* 048298 7F013728 3C088007 */ lui $t0, %hi(dword_CODE_bss_80069760) # $t0, 0x8007 -/* 04829C 7F01372C 250897A0 */ addiu $t0, %lo(dword_CODE_bss_80069760) # addiu $t0, $t0, -0x6860 -/* 0482A0 7F013730 0004CE03 */ sra $t9, $a0, 0x18 -/* 0482A4 7F013734 03202025 */ move $a0, $t9 -/* 0482A8 7F013738 02C8A821 */ addu $s5, $s6, $t0 -/* 0482AC 7F01373C 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 0482B0 7F013740 24050202 */ li $a1, 514 -/* 0482B4 7F013744 1440000B */ bnez $v0, .L7F013774 -/* 0482B8 7F013748 00112600 */ sll $a0, $s1, 0x18 -/* 0482BC 7F01374C 00044E03 */ sra $t1, $a0, 0x18 -/* 0482C0 7F013750 01202025 */ move $a0, $t1 -/* 0482C4 7F013754 2405FFFE */ li $a1, -2 -/* 0482C8 7F013758 0C003146 */ jal joyGetStickXInRange -/* 0482CC 7F01375C 24060001 */ li $a2, 1 -/* 0482D0 7F013760 2841FFFF */ slti $at, $v0, -1 -/* 0482D4 7F013764 1020002C */ beqz $at, .L7F013818 -/* 0482D8 7F013768 00112600 */ sll $a0, $s1, 0x18 -/* 0482DC 7F01376C 8EAA0000 */ lw $t2, ($s5) -/* 0482E0 7F013770 11400029 */ beqz $t2, .L7F013818 -.L7F013774: -/* 0482E4 7F013774 02161821 */ addu $v1, $s0, $s6 -/* 0482E8 7F013778 8C6B0000 */ lw $t3, ($v1) -/* 0482EC 7F01377C 19600062 */ blez $t3, .L7F013908 -/* 0482F0 7F013780 00000000 */ nop -/* 0482F4 7F013784 16FE000F */ bne $s7, $fp, .L7F0137C4 -/* 0482F8 7F013788 24010001 */ li $at, 1 -/* 0482FC 7F01378C 5641000E */ bnel $s2, $at, .L7F0137C8 -/* 048300 7F013790 8C6E0000 */ lw $t6, ($v1) -/* 048304 7F013794 0C002E82 */ jal joyGetControllerCount -/* 048308 7F013798 AFA30040 */ sw $v1, 0x40($sp) -/* 04830C 7F01379C 14540009 */ bne $v0, $s4, .L7F0137C4 -/* 048310 7F0137A0 8FA30040 */ lw $v1, 0x40($sp) -/* 048314 7F0137A4 8E0C0000 */ lw $t4, ($s0) -/* 048318 7F0137A8 29810004 */ slti $at, $t4, 4 -/* 04831C 7F0137AC 54200006 */ bnezl $at, .L7F0137C8 -/* 048320 7F0137B0 8C6E0000 */ lw $t6, ($v1) -/* 048324 7F0137B4 8C6D0000 */ lw $t5, ($v1) -/* 048328 7F0137B8 29A10005 */ slti $at, $t5, 5 -/* 04832C 7F0137BC 14200004 */ bnez $at, .L7F0137D0 -/* 048330 7F0137C0 00000000 */ nop -.L7F0137C4: -/* 048334 7F0137C4 8C6E0000 */ lw $t6, ($v1) -.L7F0137C8: -/* 048338 7F0137C8 25CFFFFF */ addiu $t7, $t6, -1 -/* 04833C 7F0137CC AC6F0000 */ sw $t7, ($v1) -.L7F0137D0: -/* 048340 7F0137D0 16FE004D */ bne $s7, $fp, .L7F013908 -/* 048344 7F0137D4 00000000 */ nop -/* 048348 7F0137D8 1640004B */ bnez $s2, .L7F013908 -/* 04834C 7F0137DC 00000000 */ nop -/* 048350 7F0137E0 0C002E82 */ jal joyGetControllerCount -/* 048354 7F0137E4 00000000 */ nop -/* 048358 7F0137E8 14540047 */ bne $v0, $s4, .L7F013908 -/* 04835C 7F0137EC 00000000 */ nop -/* 048360 7F0137F0 8E180000 */ lw $t8, ($s0) -/* 048364 7F0137F4 2B010004 */ slti $at, $t8, 4 -/* 048368 7F0137F8 10200043 */ beqz $at, .L7F013908 -/* 04836C 7F0137FC 00000000 */ nop -/* 048370 7F013800 8E190004 */ lw $t9, 4($s0) -/* 048374 7F013804 2B210004 */ slti $at, $t9, 4 -/* 048378 7F013808 1420003F */ bnez $at, .L7F013908 -/* 04837C 7F01380C 00000000 */ nop -/* 048380 7F013810 1000003D */ b .L7F013908 -/* 048384 7F013814 AE000004 */ sw $zero, 4($s0) -.L7F013818: -/* 048388 7F013818 00044603 */ sra $t0, $a0, 0x18 -/* 04838C 7F01381C 01002025 */ move $a0, $t0 -/* 048390 7F013820 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048394 7F013824 24050101 */ li $a1, 257 -/* 048398 7F013828 1440000B */ bnez $v0, .L7F013858 -/* 04839C 7F01382C 00112600 */ sll $a0, $s1, 0x18 -/* 0483A0 7F013830 00044E03 */ sra $t1, $a0, 0x18 -/* 0483A4 7F013834 01202025 */ move $a0, $t1 -/* 0483A8 7F013838 2405FFFE */ li $a1, -2 -/* 0483AC 7F01383C 0C003146 */ jal joyGetStickXInRange -/* 0483B0 7F013840 24060001 */ li $a2, 1 -/* 0483B4 7F013844 18400024 */ blez $v0, .L7F0138D8 -/* 0483B8 7F013848 00112600 */ sll $a0, $s1, 0x18 -/* 0483BC 7F01384C 8EAA0000 */ lw $t2, ($s5) -/* 0483C0 7F013850 51400022 */ beql $t2, $zero, .L7F0138DC -/* 0483C4 7F013854 00047E03 */ sra $t7, $a0, 0x18 -.L7F013858: -/* 0483C8 7F013858 16FE0007 */ bne $s7, $fp, .L7F013878 -/* 0483CC 7F01385C 02161821 */ addu $v1, $s0, $s6 -/* 0483D0 7F013860 56400006 */ bnezl $s2, .L7F01387C -/* 0483D4 7F013864 8C620000 */ lw $v0, ($v1) -/* 0483D8 7F013868 0C002E82 */ jal joyGetControllerCount -/* 0483DC 7F01386C AFA30040 */ sw $v1, 0x40($sp) -/* 0483E0 7F013870 10540005 */ beq $v0, $s4, .L7F013888 -/* 0483E4 7F013874 8FA30040 */ lw $v1, 0x40($sp) -.L7F013878: -/* 0483E8 7F013878 8C620000 */ lw $v0, ($v1) -.L7F01387C: -/* 0483EC 7F01387C 28410004 */ slti $at, $v0, 4 -/* 0483F0 7F013880 54200011 */ bnezl $at, .L7F0138C8 -/* 0483F4 7F013884 28410003 */ slti $at, $v0, 3 -.L7F013888: -/* 0483F8 7F013888 8C620000 */ lw $v0, ($v1) -/* 0483FC 7F01388C 28410007 */ slti $at, $v0, 7 -/* 048400 7F013890 1020001D */ beqz $at, .L7F013908 -/* 048404 7F013894 244B0001 */ addiu $t3, $v0, 1 -/* 048408 7F013898 1640001B */ bnez $s2, .L7F013908 -/* 04840C 7F01389C AC6B0000 */ sw $t3, ($v1) -/* 048410 7F0138A0 8E0C0000 */ lw $t4, ($s0) -/* 048414 7F0138A4 168C0018 */ bne $s4, $t4, .L7F013908 -/* 048418 7F0138A8 00000000 */ nop -/* 04841C 7F0138AC 8E0D0004 */ lw $t5, 4($s0) -/* 048420 7F0138B0 29A10004 */ slti $at, $t5, 4 -/* 048424 7F0138B4 10200014 */ beqz $at, .L7F013908 -/* 048428 7F0138B8 00000000 */ nop -/* 04842C 7F0138BC 10000012 */ b .L7F013908 -/* 048430 7F0138C0 AE140004 */ sw $s4, 4($s0) -/* 048434 7F0138C4 28410003 */ slti $at, $v0, 3 -.L7F0138C8: -/* 048438 7F0138C8 1020000F */ beqz $at, .L7F013908 -/* 04843C 7F0138CC 244E0001 */ addiu $t6, $v0, 1 -/* 048440 7F0138D0 1000000D */ b .L7F013908 -/* 048444 7F0138D4 AC6E0000 */ sw $t6, ($v1) -.L7F0138D8: -/* 048448 7F0138D8 00047E03 */ sra $t7, $a0, 0x18 -.L7F0138DC: -/* 04844C 7F0138DC 01E02025 */ move $a0, $t7 -/* 048450 7F0138E0 0C003104 */ jal joyGetButtonsPressedThisFrame -/* 048454 7F0138E4 3405B000 */ li $a1, 45056 -/* 048458 7F0138E8 10400007 */ beqz $v0, .L7F013908 -/* 04845C 7F0138EC 24180001 */ li $t8, 1 -/* 048460 7F0138F0 AE780000 */ sw $t8, ($s3) -/* 048464 7F0138F4 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8006 -/* 048468 7F0138F8 8C843760 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 04846C 7F0138FC 240500C7 */ li $a1, 199 -/* 048470 7F013900 0C002386 */ jal sndPlaySfx -/* 048474 7F013904 00003025 */ move $a2, $zero -.L7F013908: -/* 048478 7F013908 0C002E82 */ jal joyGetControllerCount -/* 04847C 7F01390C 00000000 */ nop -/* 048480 7F013910 1054000B */ beq $v0, $s4, .L7F013940 -/* 048484 7F013914 00112600 */ sll $a0, $s1, 0x18 -/* 048488 7F013918 8E190000 */ lw $t9, ($s0) -/* 04848C 7F01391C 2B210004 */ slti $at, $t9, 4 -/* 048490 7F013920 54200003 */ bnezl $at, .L7F013930 -/* 048494 7F013924 8E080004 */ lw $t0, 4($s0) -/* 048498 7F013928 AE000000 */ sw $zero, ($s0) -/* 04849C 7F01392C 8E080004 */ lw $t0, 4($s0) -.L7F013930: -/* 0484A0 7F013930 29010004 */ slti $at, $t0, 4 -/* 0484A4 7F013934 54200003 */ bnezl $at, .L7F013944 -/* 0484A8 7F013938 00044E03 */ sra $t1, $a0, 0x18 -/* 0484AC 7F01393C AE000004 */ sw $zero, 4($s0) -.L7F013940: -/* 0484B0 7F013940 00044E03 */ sra $t1, $a0, 0x18 -.L7F013944: -/* 0484B4 7F013944 01202025 */ move $a0, $t1 -/* 0484B8 7F013948 2405FFFE */ li $a1, -2 -/* 0484BC 7F01394C 0C003146 */ jal joyGetStickXInRange -/* 0484C0 7F013950 24060001 */ li $a2, 1 -/* 0484C4 7F013954 2401FFFF */ li $at, -1 -/* 0484C8 7F013958 10410007 */ beq $v0, $at, .L7F013978 -/* 0484CC 7F01395C 00112600 */ sll $a0, $s1, 0x18 -/* 0484D0 7F013960 00045603 */ sra $t2, $a0, 0x18 -/* 0484D4 7F013964 01402025 */ move $a0, $t2 -/* 0484D8 7F013968 2405FFFE */ li $a1, -2 -/* 0484DC 7F01396C 0C003146 */ jal joyGetStickXInRange -/* 0484E0 7F013970 24060001 */ li $a2, 1 -/* 0484E4 7F013974 14400004 */ bnez $v0, .L7F013988 -.L7F013978: -/* 0484E8 7F013978 240B0001 */ li $t3, 1 -/* 0484EC 7F01397C AEAB0000 */ sw $t3, ($s5) -/* 0484F0 7F013980 10000003 */ b .L7F013990 -/* 0484F4 7F013984 8E620000 */ lw $v0, ($s3) -.L7F013988: -/* 0484F8 7F013988 AEA00000 */ sw $zero, ($s5) -/* 0484FC 7F01398C 8E620000 */ lw $v0, ($s3) -.L7F013990: -/* 048500 7F013990 10400004 */ beqz $v0, .L7F0139A4 -/* 048504 7F013994 26520001 */ addiu $s2, $s2, 1 -/* 048508 7F013998 8FAC0054 */ lw $t4, 0x54($sp) -/* 04850C 7F01399C 258D0001 */ addiu $t5, $t4, 1 -/* 048510 7F0139A0 AFAD0054 */ sw $t5, 0x54($sp) -.L7F0139A4: -/* 048514 7F0139A4 26D60004 */ addiu $s6, $s6, 4 -/* 048518 7F0139A8 1657FF4B */ bne $s2, $s7, .L7F0136D8 -/* 04851C 7F0139AC 26730004 */ addiu $s3, $s3, 4 -.L7F0139B0: -/* 048520 7F0139B0 3C108003 */ lui $s0, %hi(walletinst) # $s0, 0x8003 -/* 048524 7F0139B4 2610A99C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x5664 -/* 048528 7F0139B8 0FC02DD1 */ jal disable_all_switches -/* 04852C 7F0139BC 8E040000 */ lw $a0, ($s0) -/* 048530 7F0139C0 8E040000 */ lw $a0, ($s0) -/* 048534 7F0139C4 00002825 */ move $a1, $zero -/* 048538 7F0139C8 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 04853C 7F0139CC 24060001 */ li $a2, 1 -/* 048540 7F0139D0 8E040000 */ lw $a0, ($s0) -/* 048544 7F0139D4 2405002A */ li $a1, 42 -/* 048548 7F0139D8 0FC02DF8 */ jal set_item_visibility_in_objinstance -/* 04854C 7F0139DC 24060001 */ li $a2, 1 -/* 048550 7F0139E0 0FC026E9 */ jal menu_control_stick_tracking -/* 048554 7F0139E4 00000000 */ nop -/* 048558 7F0139E8 8FAE0054 */ lw $t6, 0x54($sp) -/* 04855C 7F0139EC 2404000E */ li $a0, 14 -/* 048560 7F0139F0 55D70004 */ bnel $t6, $s7, .L7F013A04 -/* 048564 7F0139F4 8FBF003C */ lw $ra, 0x3c($sp) -/* 048568 7F0139F8 0FC069E2 */ jal set_menu_to_mode -/* 04856C 7F0139FC 00002825 */ move $a1, $zero -/* 048570 7F013A00 8FBF003C */ lw $ra, 0x3c($sp) -.L7F013A04: -/* 048574 7F013A04 8FB00018 */ lw $s0, 0x18($sp) -/* 048578 7F013A08 8FB1001C */ lw $s1, 0x1c($sp) -/* 04857C 7F013A0C 8FB20020 */ lw $s2, 0x20($sp) -/* 048580 7F013A10 8FB30024 */ lw $s3, 0x24($sp) -/* 048584 7F013A14 8FB40028 */ lw $s4, 0x28($sp) -/* 048588 7F013A18 8FB5002C */ lw $s5, 0x2c($sp) -/* 04858C 7F013A1C 8FB60030 */ lw $s6, 0x30($sp) -/* 048590 7F013A20 8FB70034 */ lw $s7, 0x34($sp) -/* 048594 7F013A24 8FBE0038 */ lw $fp, 0x38($sp) -/* 048598 7F013A28 03E00008 */ jr $ra -/* 04859C 7F013A2C 27BD0060 */ addiu $sp, $sp, 0x60 - -) -#endif +#undef MAYBE_OR_JOYCOUNT_NOT_4 +#undef MAYBE_AND_JOYCOUNT_4 +} -#endif -#ifdef NONMATCHING -void constructor_menu11_mpcontrol(s32 arg0) +// Address 0x7F013980 NTSC +Gfx * constructor_menu11_mpcontrol(Gfx *DL) { s32 spCC; + s32 i; // spE0 + u8 *text; + s32 var_s3; + s32 var_s5; + s32 var_v1; + u8 *text2; + s32 padding4; + s32 padding1; + s32 var_s2; s32 spA4; s32 spA0; s32 sp9C; s32 sp98; + s32 padding2; s32 sp90; s32 sp8C; s32 sp88; s32 sp84; - void *sp74; - void *sp70; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s6; - s32 temp_v0; - s32 phi_s6; - s32 phi_s3; - s32 phi_s2; - void *phi_v0; - s32 phi_s5; - s32 phi_s1; - s32 phi_s1_2; - s32 phi_v1; - s32 phi_v1_2; + s32 padding5; spCC = get_selected_num_players(); - temp_ret = microcode_constructor_related_to_menus(microcode_constructor(sub_GAME_7F00D5E8(viFillScreen(viSetFillColor(arg0, 0, 0, 0)))), 0x26, 0xa9, 0x184, 0xab, 0x90); - temp_s1 = temp_ret; - phi_v0 = temp_ret; - phi_s1_2 = temp_s1; + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + DL = microcode_constructor_related_to_menus(DL, 0x26, 0xA9, 0x184, 0xAB, 0x90); + if (spCC >= 3) { - temp_ret_2 = microcode_constructor_related_to_menus(temp_s1, 0xd4, 0x1e, 0xd6, 0x136, 0x80); - phi_v0 = temp_ret_2; - phi_s1_2 = temp_ret_2; + DL = microcode_constructor_related_to_menus(DL, 0xD4, 0x1E, 0xD6, 0x136, 0x80); } - if (spCC > 0) + + for (i = 0; i < spCC; i++) { - sp74 = &has_selected_char_player1; - sp70 = &controlstyle_player; - phi_s6 = 0; -loop_4: + padding4 = player_has_selected_char[i]; + padding1 = controlstyle_player[i]; + + var_s2 = 0; + if (spCC == 2) { - if (phi_s6 > 0) - { - phi_s3 = 0x26; - phi_s2 = 0xaa; - phi_s5 = 0x15e; - } - else - { - phi_s3 = 0x26; - phi_s2 = 0 + 0x1e; - phi_s5 = 0x15e; - } + var_s3 = 0x26; + var_s5 = 0x15E; + var_v1 = (i > 0) ? 0x8C : 0; + var_s2 = (var_v1) + 0x1E; } else { - if (phi_s6 >= 2) - { - phi_v1_2 = 0x8c; - } - else - { - phi_v1_2 = 0; - } - if ((phi_s6 & 1) != 0) - { - phi_v1 = 0xaf; - } - else - { - phi_v1 = 0; - } - phi_s3 = phi_v1 + 0x26; - phi_s2 = phi_v1_2 + 0x1e; - phi_s5 = 0xaf; + var_s5 = 0xAF; + var_v1 = (i >= 2) ? 0x8C : 0; + var_s2 = (var_v1) + 0x1E; + var_v1 = (i & 1) ? 0xAF : 0; + var_s3 = (var_v1) + 0x26; } - temp_s1_2 = phi_v0 + 8; - phi_v0->unk0 = (s32) (((((s32) ((f32) (phi_s3 + 6) * 4.0f) & 0xfff) << 0xc) | 0xed000000) | ((s32) ((f32) (phi_s2 + 5) * 4.0f) & 0xfff)); - phi_v0->unk4 = (s32) ((((s32) ((f32) ((phi_s3 + phi_s5) + -6) * 4.0f) & 0xfff) << 0xc) | ((s32) ((f32) (phi_s2 + 0x87) * 4.0f) & 0xfff)); - phi_s1 = temp_s1_2; - if (*sp74 == 0) + + gDPSetScissor(DL++, G_SC_NON_INTERLACE, (var_s3 + 6), var_s2 + 5, (var_s3 + var_s5 - 6), (var_s2 + 0x8C - 5)); + + padding2 = ((var_s5 >> 1) + var_s3); + padding5 = var_s2 + 0x46; + + if (player_has_selected_char[i] == 0) { - temp_ret_3 = langGet(TEXT(LTITLE, 0x11d)); - sub_GAME_7F0AE98C(&spA4, &spA0, temp_ret_3, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp9C = (s32) ((((s32) phi_s5 >> 1) + phi_s3) - (spA0 >> 1)); - sp98 = (s32) ((phi_s2 - (spA4 >> 1)) + 0x37); - viGetX(); - phi_s1 = write_text_at_abs_coord(microcode_constructor(temp_s1_2), &sp9C, &sp98, temp_ret_3, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, 0xff, viGetY(), 0, 0); + text = langGet(0x9D1DU); + textMeasure(&spA4, &spA0, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp9C = padding2 - (spA0 >> 1); + sp98 = padding5 - (spA4 >> 1) - 0xf; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &sp9C, &sp98, (s8*)text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } - temp_ret_4 = langGet((0x80030000 + (*sp70 * 4))->unk-4B10); - sub_GAME_7F0AE98C(&sp90, &sp8C, temp_ret_4, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp88 = (s32) ((((s32) phi_s5 >> 1) + phi_s3) - (sp8C >> 1)); - sp84 = (s32) (((phi_s2 + 0x46) - (sp90 >> 1)) + 0xf); - viGetX(); - temp_s6 = phi_s6 + 1; - sp70 = (void *) (sp70 + 4); - temp_v0 = write_text_at_abs_coord(microcode_constructor(phi_s1), &sp88, &sp84, temp_ret_4, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, 0xff, viGetY(), 0, 0); - sp74 = (void *) (sp74 + 4); - phi_s6 = temp_s6; - phi_v0 = temp_v0; - phi_s1_2 = temp_v0; - if (temp_s6 != spCC) + { - goto loop_4; + text2 = langGet(MP_controller_configuration_table[controlstyle_player[i]].text_preset); + textMeasure(&sp90, &sp8C, text2, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + sp88 = padding2 - (sp8C >> 1); + sp84 = padding5 - (sp90 >> 1) + 0xf; + + DL = microcode_constructor(DL); + DL = write_text_at_abs_coord(DL, &sp88, &sp84, (s8*)text2, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } } - combiner_bayer_lod_perspective(phi_s1_2); + + DL = combiner_bayer_lod_perspective(DL); + + return DL; } -#else -GLOBAL_ASM( -.text -glabel constructor_menu11_mpcontrol -/* 0484B0 7F013980 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* 0484B4 7F013984 AFBF0064 */ sw $ra, 0x64($sp) -/* 0484B8 7F013988 AFB10044 */ sw $s1, 0x44($sp) -/* 0484BC 7F01398C 00808825 */ move $s1, $a0 -/* 0484C0 7F013990 AFBE0060 */ sw $fp, 0x60($sp) -/* 0484C4 7F013994 AFB7005C */ sw $s7, 0x5c($sp) -/* 0484C8 7F013998 AFB60058 */ sw $s6, 0x58($sp) -/* 0484CC 7F01399C AFB50054 */ sw $s5, 0x54($sp) -/* 0484D0 7F0139A0 AFB40050 */ sw $s4, 0x50($sp) -/* 0484D4 7F0139A4 AFB3004C */ sw $s3, 0x4c($sp) -/* 0484D8 7F0139A8 AFB20048 */ sw $s2, 0x48($sp) -/* 0484DC 7F0139AC AFB00040 */ sw $s0, 0x40($sp) -/* 0484E0 7F0139B0 0FC040A4 */ jal get_selected_num_players -/* 0484E4 7F0139B4 F7B40038 */ sdc1 $f20, 0x38($sp) -/* 0484E8 7F0139B8 AFA200CC */ sw $v0, 0xcc($sp) -/* 0484EC 7F0139BC 02202025 */ move $a0, $s1 -/* 0484F0 7F0139C0 00002825 */ move $a1, $zero -/* 0484F4 7F0139C4 00003025 */ move $a2, $zero -/* 0484F8 7F0139C8 0C0011B4 */ jal viSetFillColor -/* 0484FC 7F0139CC 00003825 */ move $a3, $zero -/* 048500 7F0139D0 0C000FBE */ jal viFillScreen -/* 048504 7F0139D4 00402025 */ move $a0, $v0 -/* 048508 7F0139D8 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 04850C 7F0139DC 00402025 */ move $a0, $v0 -/* 048510 7F0139E0 0FC2B366 */ jal microcode_constructor -/* 048514 7F0139E4 00402025 */ move $a0, $v0 -/* 048518 7F0139E8 240E00AB */ li $t6, 171 -/* 04851C 7F0139EC 240F0090 */ li $t7, 144 -/* 048520 7F0139F0 AFAF0014 */ sw $t7, 0x14($sp) -/* 048524 7F0139F4 AFAE0010 */ sw $t6, 0x10($sp) -/* 048528 7F0139F8 00402025 */ move $a0, $v0 -/* 04852C 7F0139FC 24050026 */ li $a1, 38 -/* 048530 7F013A00 240600A9 */ li $a2, 169 -/* 048534 7F013A04 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 048538 7F013A08 24070184 */ li $a3, 388 -/* 04853C 7F013A0C 8FA800CC */ lw $t0, 0xcc($sp) -/* 048540 7F013A10 00408825 */ move $s1, $v0 -/* 048544 7F013A14 02202025 */ move $a0, $s1 -/* 048548 7F013A18 29010003 */ slti $at, $t0, 3 -/* 04854C 7F013A1C 1420000A */ bnez $at, .L7F013A48 -/* 048550 7F013A20 240500D4 */ li $a1, 212 -/* 048554 7F013A24 24180136 */ li $t8, 310 -/* 048558 7F013A28 24190080 */ li $t9, 128 -/* 04855C 7F013A2C AFB90014 */ sw $t9, 0x14($sp) -/* 048560 7F013A30 AFB80010 */ sw $t8, 0x10($sp) -/* 048564 7F013A34 2406001E */ li $a2, 30 -/* 048568 7F013A38 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04856C 7F013A3C 240700D6 */ li $a3, 214 -/* 048570 7F013A40 00408825 */ move $s1, $v0 -/* 048574 7F013A44 8FA800CC */ lw $t0, 0xcc($sp) -.L7F013A48: -/* 048578 7F013A48 190000BC */ blez $t0, .L7F013D3C -/* 04857C 7F013A4C 0000B025 */ move $s6, $zero -/* 048580 7F013A50 3C098007 */ lui $t1, %hi(player_has_selected_char) -/* 048584 7F013A54 3C0A8007 */ lui $t2, %hi(controlstyle_player) -/* 048588 7F013A58 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 04858C 7F013A5C 254A97B8 */ addiu $t2, %lo(controlstyle_player) # addiu $t2, $t2, -0x6848 -/* 048590 7F013A60 25299740 */ addiu $t1, %lo(player_has_selected_char) # addiu $t1, $t1, -0x68c0 -/* 048594 7F013A64 3C1E8004 */ lui $fp, %hi(ptrFirstFontTableLarge) -/* 048598 7F013A68 3C178004 */ lui $s7, %hi(ptrSecondFontTableLarge) -/* 04859C 7F013A6C 4481A000 */ mtc1 $at, $f20 -/* 0485A0 7F013A70 26F70EB8 */ addiu $s7, %lo(ptrSecondFontTableLarge) # addiu $s7, $s7, 0xeb8 -/* 0485A4 7F013A74 27DE0EB4 */ addiu $fp, %lo(ptrFirstFontTableLarge) # addiu $fp, $fp, 0xeb4 -/* 0485A8 7F013A78 AFA90074 */ sw $t1, 0x74($sp) -/* 0485AC 7F013A7C AFAA0070 */ sw $t2, 0x70($sp) -.L7F013A80: -/* 0485B0 7F013A80 8FA800CC */ lw $t0, 0xcc($sp) -/* 0485B4 7F013A84 24010002 */ li $at, 2 -/* 0485B8 7F013A88 24130026 */ li $s3, 38 -/* 0485BC 7F013A8C 15010008 */ bne $t0, $at, .L7F013AB0 -/* 0485C0 7F013A90 32CB0001 */ andi $t3, $s6, 1 -/* 0485C4 7F013A94 1AC00003 */ blez $s6, .L7F013AA4 -/* 0485C8 7F013A98 2415015E */ li $s5, 350 -/* 0485CC 7F013A9C 10000010 */ b .L7F013AE0 -/* 0485D0 7F013AA0 241200AA */ li $s2, 170 -.L7F013AA4: -/* 0485D4 7F013AA4 00001825 */ move $v1, $zero -/* 0485D8 7F013AA8 1000000D */ b .L7F013AE0 -/* 0485DC 7F013AAC 2472001E */ addiu $s2, $v1, 0x1e -.L7F013AB0: -/* 0485E0 7F013AB0 2AC10002 */ slti $at, $s6, 2 -/* 0485E4 7F013AB4 14200003 */ bnez $at, .L7F013AC4 -/* 0485E8 7F013AB8 241500AF */ li $s5, 175 -/* 0485EC 7F013ABC 10000002 */ b .L7F013AC8 -/* 0485F0 7F013AC0 2403008C */ li $v1, 140 -.L7F013AC4: -/* 0485F4 7F013AC4 00001825 */ move $v1, $zero -.L7F013AC8: -/* 0485F8 7F013AC8 11600003 */ beqz $t3, .L7F013AD8 -/* 0485FC 7F013ACC 2472001E */ addiu $s2, $v1, 0x1e -/* 048600 7F013AD0 10000002 */ b .L7F013ADC -/* 048604 7F013AD4 240300AF */ li $v1, 175 -.L7F013AD8: -/* 048608 7F013AD8 00001825 */ move $v1, $zero -.L7F013ADC: -/* 04860C 7F013ADC 24730026 */ addiu $s3, $v1, 0x26 -.L7F013AE0: -/* 048610 7F013AE0 266C0006 */ addiu $t4, $s3, 6 -/* 048614 7F013AE4 448C2000 */ mtc1 $t4, $f4 -/* 048618 7F013AE8 26490005 */ addiu $t1, $s2, 5 -/* 04861C 7F013AEC 44898000 */ mtc1 $t1, $f16 -/* 048620 7F013AF0 468021A0 */ cvt.s.w $f6, $f4 -/* 048624 7F013AF4 3C01ED00 */ lui $at, 0xed00 -/* 048628 7F013AF8 24510008 */ addiu $s1, $v0, 8 -/* 04862C 7F013AFC 468084A0 */ cvt.s.w $f18, $f16 -/* 048630 7F013B00 46143202 */ mul.s $f8, $f6, $f20 -/* 048634 7F013B04 4600428D */ trunc.w.s $f10, $f8 -/* 048638 7F013B08 46149102 */ mul.s $f4, $f18, $f20 -/* 04863C 7F013B0C 440E5000 */ mfc1 $t6, $f10 -/* 048640 7F013B10 00000000 */ nop -/* 048644 7F013B14 31CF0FFF */ andi $t7, $t6, 0xfff -/* 048648 7F013B18 4600218D */ trunc.w.s $f6, $f4 -/* 04864C 7F013B1C 000FC300 */ sll $t8, $t7, 0xc -/* 048650 7F013B20 02757021 */ addu $t6, $s3, $s5 -/* 048654 7F013B24 25CFFFFA */ addiu $t7, $t6, -6 -/* 048658 7F013B28 440B3000 */ mfc1 $t3, $f6 -/* 04865C 7F013B2C 448F4000 */ mtc1 $t7, $f8 -/* 048660 7F013B30 0301C825 */ or $t9, $t8, $at -/* 048664 7F013B34 316C0FFF */ andi $t4, $t3, 0xfff -/* 048668 7F013B38 032C6825 */ or $t5, $t9, $t4 -/* 04866C 7F013B3C 26590087 */ addiu $t9, $s2, 0x87 -/* 048670 7F013B40 468042A0 */ cvt.s.w $f10, $f8 -/* 048674 7F013B44 44992000 */ mtc1 $t9, $f4 -/* 048678 7F013B48 AC4D0000 */ sw $t5, ($v0) -/* 04867C 7F013B4C 468021A0 */ cvt.s.w $f6, $f4 -/* 048680 7F013B50 46145402 */ mul.s $f16, $f10, $f20 -/* 048684 7F013B54 00000000 */ nop -/* 048688 7F013B58 46143202 */ mul.s $f8, $f6, $f20 -/* 04868C 7F013B5C 4600848D */ trunc.w.s $f18, $f16 -/* 048690 7F013B60 4600428D */ trunc.w.s $f10, $f8 -/* 048694 7F013B64 44099000 */ mfc1 $t1, $f18 -/* 048698 7F013B68 440D5000 */ mfc1 $t5, $f10 -/* 04869C 7F013B6C 312A0FFF */ andi $t2, $t1, 0xfff -/* 0486A0 7F013B70 000A5B00 */ sll $t3, $t2, 0xc -/* 0486A4 7F013B74 31AE0FFF */ andi $t6, $t5, 0xfff -/* 0486A8 7F013B78 016E7825 */ or $t7, $t3, $t6 -/* 0486AC 7F013B7C AC4F0004 */ sw $t7, 4($v0) -/* 0486B0 7F013B80 8FB80074 */ lw $t8, 0x74($sp) -/* 0486B4 7F013B84 8F090000 */ lw $t1, ($t8) -/* 0486B8 7F013B88 1520002F */ bnez $t1, .L7F013C48 -/* 0486BC 7F013B8C 00000000 */ nop -/* 0486C0 7F013B90 0FC30776 */ jal langGet -/* 0486C4 7F013B94 34049D1D */ li $a0, 40221 -/* 0486C8 7F013B98 8FCA0000 */ lw $t2, ($fp) -/* 0486CC 7F013B9C 0040A025 */ move $s4, $v0 -/* 0486D0 7F013BA0 27A400A4 */ addiu $a0, $sp, 0xa4 -/* 0486D4 7F013BA4 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 0486D8 7F013BA8 00403025 */ move $a2, $v0 -/* 0486DC 7F013BAC 8EE70000 */ lw $a3, ($s7) -/* 0486E0 7F013BB0 AFA00014 */ sw $zero, 0x14($sp) -/* 0486E4 7F013BB4 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0486E8 7F013BB8 AFAA0010 */ sw $t2, 0x10($sp) -/* 0486EC 7F013BBC 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 0486F0 7F013BC0 8FAD00A0 */ lw $t5, 0xa0($sp) -/* 0486F4 7F013BC4 0015C843 */ sra $t9, $s5, 1 -/* 0486F8 7F013BC8 000FC043 */ sra $t8, $t7, 1 -/* 0486FC 7F013BCC 03336021 */ addu $t4, $t9, $s3 -/* 048700 7F013BD0 02584823 */ subu $t1, $s2, $t8 -/* 048704 7F013BD4 000D5843 */ sra $t3, $t5, 1 -/* 048708 7F013BD8 018B7023 */ subu $t6, $t4, $t3 -/* 04870C 7F013BDC 252A0037 */ addiu $t2, $t1, 0x37 -/* 048710 7F013BE0 AFAE009C */ sw $t6, 0x9c($sp) -/* 048714 7F013BE4 AFAA0098 */ sw $t2, 0x98($sp) -/* 048718 7F013BE8 0FC2B366 */ jal microcode_constructor -/* 04871C 7F013BEC 02202025 */ move $a0, $s1 -/* 048720 7F013BF0 0C001107 */ jal viGetX -/* 048724 7F013BF4 00408825 */ move $s1, $v0 -/* 048728 7F013BF8 00028400 */ sll $s0, $v0, 0x10 -/* 04872C 7F013BFC 0010CC03 */ sra $t9, $s0, 0x10 -/* 048730 7F013C00 0C00110B */ jal viGetY -/* 048734 7F013C04 03208025 */ move $s0, $t9 -/* 048738 7F013C08 8EED0000 */ lw $t5, ($s7) -/* 04873C 7F013C0C 8FCC0000 */ lw $t4, ($fp) -/* 048740 7F013C10 240B00FF */ li $t3, 255 -/* 048744 7F013C14 AFAB0018 */ sw $t3, 0x18($sp) -/* 048748 7F013C18 02202025 */ move $a0, $s1 -/* 04874C 7F013C1C 27A5009C */ addiu $a1, $sp, 0x9c -/* 048750 7F013C20 27A60098 */ addiu $a2, $sp, 0x98 -/* 048754 7F013C24 02803825 */ move $a3, $s4 -/* 048758 7F013C28 AFB0001C */ sw $s0, 0x1c($sp) -/* 04875C 7F013C2C AFA20020 */ sw $v0, 0x20($sp) -/* 048760 7F013C30 AFA00024 */ sw $zero, 0x24($sp) -/* 048764 7F013C34 AFA00028 */ sw $zero, 0x28($sp) -/* 048768 7F013C38 AFAD0010 */ sw $t5, 0x10($sp) -/* 04876C 7F013C3C 0FC025D8 */ jal write_text_at_abs_coord -/* 048770 7F013C40 AFAC0014 */ sw $t4, 0x14($sp) -/* 048774 7F013C44 00408825 */ move $s1, $v0 -.L7F013C48: -/* 048778 7F013C48 8FAE0070 */ lw $t6, 0x70($sp) -/* 04877C 7F013C4C 3C048003 */ lui $a0, %hi(MP_controller_configuration_table) -/* 048780 7F013C50 00154843 */ sra $t1, $s5, 1 -/* 048784 7F013C54 8DCF0000 */ lw $t7, ($t6) -/* 048788 7F013C58 01338021 */ addu $s0, $t1, $s3 -/* 04878C 7F013C5C 26540046 */ addiu $s4, $s2, 0x46 -/* 048790 7F013C60 000FC080 */ sll $t8, $t7, 2 -/* 048794 7F013C64 00982021 */ addu $a0, $a0, $t8 -/* 048798 7F013C68 0FC30776 */ jal langGet -/* 04879C 7F013C6C 9484B4F0 */ lhu $a0, %lo(MP_controller_configuration_table)($a0) -/* 0487A0 7F013C70 8FCA0000 */ lw $t2, ($fp) -/* 0487A4 7F013C74 00409025 */ move $s2, $v0 -/* 0487A8 7F013C78 27A40090 */ addiu $a0, $sp, 0x90 -/* 0487AC 7F013C7C 27A5008C */ addiu $a1, $sp, 0x8c -/* 0487B0 7F013C80 00403025 */ move $a2, $v0 -/* 0487B4 7F013C84 8EE70000 */ lw $a3, ($s7) -/* 0487B8 7F013C88 AFA00014 */ sw $zero, 0x14($sp) -/* 0487BC 7F013C8C 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0487C0 7F013C90 AFAA0010 */ sw $t2, 0x10($sp) -/* 0487C4 7F013C94 8FAB0090 */ lw $t3, 0x90($sp) -/* 0487C8 7F013C98 8FB9008C */ lw $t9, 0x8c($sp) -/* 0487CC 7F013C9C 02202025 */ move $a0, $s1 -/* 0487D0 7F013CA0 000B7043 */ sra $t6, $t3, 1 -/* 0487D4 7F013CA4 028E7823 */ subu $t7, $s4, $t6 -/* 0487D8 7F013CA8 00196843 */ sra $t5, $t9, 1 -/* 0487DC 7F013CAC 020D6023 */ subu $t4, $s0, $t5 -/* 0487E0 7F013CB0 25F8000F */ addiu $t8, $t7, 0xf -/* 0487E4 7F013CB4 AFAC0088 */ sw $t4, 0x88($sp) -/* 0487E8 7F013CB8 0FC2B366 */ jal microcode_constructor -/* 0487EC 7F013CBC AFB80084 */ sw $t8, 0x84($sp) -/* 0487F0 7F013CC0 0C001107 */ jal viGetX -/* 0487F4 7F013CC4 00408825 */ move $s1, $v0 -/* 0487F8 7F013CC8 00028400 */ sll $s0, $v0, 0x10 -/* 0487FC 7F013CCC 00104C03 */ sra $t1, $s0, 0x10 -/* 048800 7F013CD0 0C00110B */ jal viGetY -/* 048804 7F013CD4 01208025 */ move $s0, $t1 -/* 048808 7F013CD8 8EEA0000 */ lw $t2, ($s7) -/* 04880C 7F013CDC 8FD90000 */ lw $t9, ($fp) -/* 048810 7F013CE0 240D00FF */ li $t5, 255 -/* 048814 7F013CE4 AFAD0018 */ sw $t5, 0x18($sp) -/* 048818 7F013CE8 02202025 */ move $a0, $s1 -/* 04881C 7F013CEC 27A50088 */ addiu $a1, $sp, 0x88 -/* 048820 7F013CF0 27A60084 */ addiu $a2, $sp, 0x84 -/* 048824 7F013CF4 02403825 */ move $a3, $s2 -/* 048828 7F013CF8 AFB0001C */ sw $s0, 0x1c($sp) -/* 04882C 7F013CFC AFA20020 */ sw $v0, 0x20($sp) -/* 048830 7F013D00 AFA00024 */ sw $zero, 0x24($sp) -/* 048834 7F013D04 AFA00028 */ sw $zero, 0x28($sp) -/* 048838 7F013D08 AFAA0010 */ sw $t2, 0x10($sp) -/* 04883C 7F013D0C 0FC025D8 */ jal write_text_at_abs_coord -/* 048840 7F013D10 AFB90014 */ sw $t9, 0x14($sp) -/* 048844 7F013D14 8FAC0074 */ lw $t4, 0x74($sp) -/* 048848 7F013D18 8FAE0070 */ lw $t6, 0x70($sp) -/* 04884C 7F013D1C 8FB800CC */ lw $t8, 0xcc($sp) -/* 048850 7F013D20 26D60001 */ addiu $s6, $s6, 1 -/* 048854 7F013D24 258B0004 */ addiu $t3, $t4, 4 -/* 048858 7F013D28 25CF0004 */ addiu $t7, $t6, 4 -/* 04885C 7F013D2C AFAF0070 */ sw $t7, 0x70($sp) -/* 048860 7F013D30 AFAB0074 */ sw $t3, 0x74($sp) -/* 048864 7F013D34 16D8FF52 */ bne $s6, $t8, .L7F013A80 -/* 048868 7F013D38 00408825 */ move $s1, $v0 -.L7F013D3C: -/* 04886C 7F013D3C 0FC2B3BC */ jal combiner_bayer_lod_perspective -/* 048870 7F013D40 02202025 */ move $a0, $s1 -/* 048874 7F013D44 8FBF0064 */ lw $ra, 0x64($sp) -/* 048878 7F013D48 D7B40038 */ ldc1 $f20, 0x38($sp) -/* 04887C 7F013D4C 8FB00040 */ lw $s0, 0x40($sp) -/* 048880 7F013D50 8FB10044 */ lw $s1, 0x44($sp) -/* 048884 7F013D54 8FB20048 */ lw $s2, 0x48($sp) -/* 048888 7F013D58 8FB3004C */ lw $s3, 0x4c($sp) -/* 04888C 7F013D5C 8FB40050 */ lw $s4, 0x50($sp) -/* 048890 7F013D60 8FB50054 */ lw $s5, 0x54($sp) -/* 048894 7F013D64 8FB60058 */ lw $s6, 0x58($sp) -/* 048898 7F013D68 8FB7005C */ lw $s7, 0x5c($sp) -/* 04889C 7F013D6C 8FBE0060 */ lw $fp, 0x60($sp) -/* 0488A0 7F013D70 03E00008 */ jr $ra -/* 0488A4 7F013D74 27BD00D0 */ addiu $sp, $sp, 0xd0 -) -#endif + //******************************************************************************************************** @@ -15233,8 +6195,8 @@ void interface_menu12_mpstage(void) s32 row; s32 column; - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); if (joyGetButtons(PLAYER_1, START_BUTTON|Z_TRIG|A_BUTTON) == 0) @@ -15306,711 +6268,183 @@ void interface_menu12_mpstage(void) sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0x0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 0x2A, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 0x3, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); menu_control_stick_tracking(); if (tab_next_selected) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); + frontChangeMenu(MENU_MP_OPTIONS, FALSE); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_MP_OPTIONS, 0); + frontChangeMenu(MENU_MP_OPTIONS, FALSE); } } - -#ifdef NONMATCHING -void constructor_menu12_mpstage(s32 arg0) +// Address 0x7F014050 NTSC +Gfx * constructor_menu12_mpstage(Gfx *DL) { + s32 padding5; s32 sp130; s32 sp12C; s32 sp128; s32 sp124; - f32 sp104; - f32 sp100; - f32 spF8; - f32 spDC; - f32 spD8; - f32 spD4; - f32 spD0; + s32 padding2[7]; + struct coord2d sp100; + struct coord2d spF8; + s32 padding4[3]; + s32 i_3; + s32 i_2; + s32 i_1; + struct coord2d spD8; + struct coord2d spD0; + s32 var_s6; + s32 var_s2_2; + struct sImageTableEntry *simage; + s32 count; + s32 count_2; + s32 padding; s32 spB4; - s32 sp9C; - s32 sp90; - s32 temp_a2; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_ret_3; - s32 temp_ret_4; - s32 temp_ret_5; - s32 temp_ret_6; - s32 temp_ret_7; - s32 temp_s0; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s2; - s32 temp_s4_3; - s32 temp_s5_2; - s32 temp_s7; - s32 temp_t1; - s32 temp_t4; - s32 temp_t5; - s32 temp_t7; - s32 temp_t9; - s32 temp_v0; - s32 temp_v0_2; - s32 temp_v0_3; - s32 temp_v0_4; - void *temp_s0_2; - void *temp_s0_3; - void *temp_s3; - void *temp_s3_2; - void *temp_s4; - void *temp_s4_2; - void *temp_s5; - s32 phi_s1; - s32 phi_s0; - s32 phi_s1_2; - s32 phi_s1_3; - s32 phi_s2; - s32 phi_s5; - s32 phi_s6; - s32 phi_s2_2; - s32 phi_s7; - - temp_ret = viSetFillColor(0, 0, 0); - arg0 = temp_ret; - temp_ret_2 = viFillScreen(temp_ret); - arg0 = temp_ret_2; - temp_ret_3 = sub_GAME_7F00D5E8(temp_ret_2); - arg0 = temp_ret_3; - arg0 = microcode_constructor(temp_ret_3); - phi_s1 = 0x6c; - phi_s0 = 0xa0; -loop_1: - temp_ret_4 = microcode_constructor_related_to_menus(arg0, 0x25, phi_s1, 0x185); - temp_s0 = phi_s0 + 0x46; - arg0 = temp_ret_4; - temp_v0 = temp_ret_4; - phi_s1 = phi_s1 + 0x46; - phi_s0 = temp_s0; - if (temp_s0 != 0x172) - { - goto loop_1; - } - temp_ret_5 = combiner_bayer_lod_perspective(temp_v0); - arg0 = (s32) (temp_ret_5 + 8); - temp_v0_2 = temp_ret_5; - temp_v0_2->unk0 = 0xba000c02; //gDPSet... - temp_v0_2->unk4 = 0; - temp_s3 = &arg0; - temp_s0_2 = mainfolderimages + 0x3c; - likely_generate_DL_for_image_declaration(temp_s3, temp_s0_2, 1, 0, 2); - sp100 = (f32) (176.0f + 37.0f); - sp104 = (f32) (4.0f + 100.0f); - temp_s4 = &spF8; - spF8 = 176.0f; - phi_s1_2 = 0; -loop_3: - display_image_at_on_screen_coord(temp_s3, &sp100, temp_s4, 0x2f0, 0x12, 0, 0, 1, 0x6b, 0x67, 0x53, 0xff, (s32) (0 < temp_s0_2->unk6), 0); - sp104 = (f32) (sp104 + 60.0f); - display_image_at_on_screen_coord(temp_s3, &sp100, temp_s4, 0x2f0, 0x12, 0, 0, 1, 0x6b, 0x67, 0x53, 0xff, (s32) (0 < temp_s0_2->unk6), 0); - temp_s1 = phi_s1_2 + 1; - sp104 = (f32) ((sp104 - 60.0f) + 70.0f); - phi_s1_2 = temp_s1; - if (temp_s1 != 3) - { - goto loop_3; - } - spB4 = 0; - spDC = (f32) ((22.0f + 108.0f) + 4.0f); - temp_s5 = &spD0; - temp_s4_2 = &spD8; - spD0 = 34.0f; - spD4 = 22.0f; - phi_s1_3 = 0; -loop_5: - spD8 = 86.0f; - phi_s2 = 0; -loop_6: - if (phi_s1_3 < 0xc) + + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + + for (i_1 = 0; i_1 != 3; i_1++) + { + DL = microcode_constructor_related_to_menus(DL, 0x25, 0x6c + (i_1 * 0x46), 0x185, 0xa0 + (i_1 * 0x46), 0x101010FF); + } + + DL = combiner_bayer_lod_perspective(DL); + + gDPSetTextureFilter(DL++, G_TF_POINT); + + simage = mainfolderimages + 5; + likely_generate_DL_for_image_declaration(&DL, simage, 1, 0, 2); // IMAGE_DOT + + spF8.f[0] = 176.0f; + spF8.f[1] = 4.0f; + sp100.f[0] = spF8.f[0] + 37.0f; + sp100.f[1] = spF8.f[1] + 100.0f; + + for (i_2 = 0; i_2 < 3; i_2++) { - temp_s0_3 = ((&multi_stage_setups + (phi_s1_3 * 0x18))->unk4 * 0xc) + mpstageselimages; - likely_generate_DL_for_image_declaration(temp_s3, temp_s0_3, 1, 0, 2); - temp_t5 = arg0; - if (phi_s1_3 == current_mp_stage_highlighted) - { - arg0 = (s32) (temp_t5 + 8); - temp_t5->unk4 = 0x100000; - temp_t5->unk0 = 0xba001402; //gDPSetCyceType(glistp++, G_CYC_2CYCLE); - temp_t9 = arg0; - arg0 = (s32) (temp_t9 + 8); - temp_t9->unk4 = -0xf6; - temp_t9->unk0 = 0xf8000000; //gDPSetFogColor(glistp++, 0, 0, 0, 246); - temp_t4 = arg0; - arg0 = (s32) (temp_t4 + 8); - temp_t4->unk4 = 0xc4112048; - temp_t4->unk0 = 0xb900031d; //gDPSetRenderMode(glistp++, G_RM_FOG_PRIM_A, G_RM_AA_OPA_SURF2); - display_image_at_on_screen_coord(temp_s3, temp_s4_2, temp_s5, 0x44, 0x2c, 0, 0, 1, 0xff, 0xff, 0xff, 0xff, (s32) (0 < temp_s0_3->unk6), 1); - } - else - { - if (check_if_mp_stage_unlocked(phi_s1_3) != 0) - { - display_image_at_on_screen_coord(temp_s3, temp_s4_2, temp_s5, 0x44, 0x2c, 0, 0, 1, 0x6e, 0x6e, 0x6e, 0xff, (s32) (0 < temp_s0_3->unk6), 0); - } - else + display_image_at_on_screen_coord(&DL, &sp100.f[0], &spF8.f[0], 0x2F0, 0x12, 0, 0, 1, 0x6B, 0x67, 0x53, 0xFF, simage->level > 0, 0); + sp100.f[1] += 60.0f; + display_image_at_on_screen_coord(&DL, &sp100.f[0], &spF8.f[0], 0x2F0, 0x12, 0, 0, 1, 0x6B, 0x67, 0x53, 0xFF, simage->level > 0, 0); + sp100.f[1] -= 60.0f; + sp100.f[1] += 70.0f; + } + + spD0.f[0] = 34.0f; + spD0.f[1] = 22.0f; + spD8.f[1] = spD0.f[1] + 108.0f + 4.0f; + + count = 0; + + for (spB4 = 0; spB4 != 3; spB4++) + { + spD8.f[0] = 86.0f; + + for (i_3 = 0; i_3 < 4; i_3++) + { + if (count < 12) { - display_image_at_on_screen_coord(temp_s3, temp_s4_2, temp_s5, 0x44, 0x2c, 0, 0, 1, 0xf, 0xf, 0xf, 0xff, (s32) (0 < temp_s0_3->unk6), 0); -block_12: + simage = &mpstageselimages[multi_stage_setups[count].photo]; + + likely_generate_DL_for_image_declaration(&DL, simage, 1, 0, 2); + + if (count == current_mp_stage_highlighted) + { + gDPSetCycleType(DL++, G_CYC_2CYCLE); + gDPSetFogColor(DL++, 0xff, 0xff, 0xff, 0x0a); + gDPSetRenderMode(DL++, G_RM_FOG_PRIM_A, G_RM_AA_OPA_SURF2); + + display_image_at_on_screen_coord(&DL, &spD8.f[0], &spD0.f[0], 0x44, 0x2C, 0, 0, 1, 0xFF, 0xFF, 0xFF, 0xFF, simage->level > 0, 1); + } + else if (check_if_mp_stage_unlocked(count) != 0) + { + display_image_at_on_screen_coord(&DL, &spD8.f[0], &spD0.f[0], 0x44, 0x2C, 0, 0, 1, 0x6E, 0x6E, 0x6E, 0xFF, simage->level > 0, 0); + } + else + { + display_image_at_on_screen_coord(&DL, &spD8.f[0], &spD0.f[0], 0x44, 0x2C, 0, 0, 1, 0xF, 0xF, 0xF, 0xFF, simage->level > 0, 0); + } } + + spD8.f[0] += 85.0f; + count++; } + + spD8.f[1] += 70.0f; } - else - { - goto block_12; - } - temp_s2 = phi_s2 + 1; - temp_s1_2 = phi_s1_3 + 1; - spD8 = (f32) (spD8 + 85.0f); - phi_s1_3 = temp_s1_2; - phi_s2 = temp_s2; - if (temp_s2 != 4) - { - goto loop_6; - } - temp_t7 = spB4 + 1; - spB4 = temp_t7; - spDC = (f32) (spDC + 70.0f); - phi_s1_3 = temp_s1_2; - if (temp_t7 != 3) - { - goto loop_5; - } - arg0 = microcode_constructor(arg0); - sp90 = 0x97; - sp9C = 0; - phi_s5 = 0; -loop_16: - phi_s6 = 0x56; - phi_s7 = 0; -loop_17: - if (phi_s5 < 0xc) + + DL = microcode_constructor(DL); + + count_2 = 0; + + // not sure what's going on here, but this is required to get the stack to match. + if(1) { - if (check_if_mp_stage_unlocked(phi_s5) != 0) + s32 i_4; + s32 sp9C; + s32 padding6; + s32 padding7; + s32 sp90; + s32 padding8; + + sp90 = 0x97; + + for (sp9C = 0; sp9C != 3; sp9C++) { - temp_s3_2 = (((phi_s5 * 4) - phi_s5) * 8) + &multi_stage_setups; - phi_s2_2 = 0x96969600; - if (phi_s5 == current_mp_stage_highlighted) + var_s6 = 0x56; + + for (i_4 = 0; i_4 < 4; i_4++) { - phi_s2_2 = -0x100; + if (count_2 < 12 && check_if_mp_stage_unlocked(count_2)) + { + var_s2_2 = 0x96969600; + + if (count_2 == current_mp_stage_highlighted) + { + var_s2_2 = -0x100; + } + + textMeasure(&sp128, &sp124, langGet(multi_stage_setups[count_2].select_screen_text_preset), ptrFontBankGothicChars, ptrFontBankGothic, 0); + + sp130 = var_s6 - 0x1F; + sp12C = sp90 - sp128; + + DL = microcode_constructor_related_to_menus(DL, sp130, sp12C, sp130 + sp124, sp12C + sp128, 0); + + DL = textRender(DL, &sp130, &sp12C, langGet(multi_stage_setups[count_2].select_screen_text_preset), ptrFontBankGothicChars, ptrFontBankGothic, var_s2_2 | 0xFF, viGetX(), viGetY(), 0, 0); + + sp130 = var_s6 - 0x1F; + sp12C = sp90 - sp128; + + DL = textRender(DL, &sp130, &sp12C, langGet(multi_stage_setups[count_2].select_screen_text_preset), ptrFontBankGothicChars, ptrFontBankGothic, var_s2_2 | 0x64, viGetX(), viGetY(), 0, 0); + } + + var_s6 += 0x55; + count_2++; } - sub_GAME_7F0AE98C(&sp128, &sp124, langGet(temp_s3_2->unk2), subroutine_arg0, (s32) ptrFirstFontTableSmall, 0); - temp_s4_3 = phi_s6 + -0x1f; - temp_a2 = sp90 - sp128; - arg0 = microcode_constructor_related_to_menus(arg0, temp_s4_3, temp_a2, temp_s4_3 + sp124, (s32) (temp_a2 + sp128), 0); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp130, &sp12C, langGet(temp_s3_2->unk2), (s32) subroutine_arg0, (s32) ptrFirstFontTableSmall, (s32) (phi_s2_2 | 0xff), viGetY(), 0, 0); - viGetX(); - arg0 = en_text_write_stuff(arg0, &sp130, &sp12C, langGet(temp_s3_2->unk2, sp90 - sp128), (s32) subroutine_arg0, (s32) ptrFirstFontTableSmall, (s32) (phi_s2_2 | 0x64), viGetY(), 0, 0); + + sp90 += 0x46; } } - temp_s7 = phi_s7 + 1; - temp_s5_2 = phi_s5 + 1; - phi_s5 = temp_s5_2; - phi_s6 = phi_s6 + 0x55; - phi_s7 = temp_s7; - if (temp_s7 != 4) - { - goto loop_17; - } - temp_t1 = sp9C + 1; - sp9C = temp_t1; - sp90 = (s32) (sp90 + 0x46); - phi_s5 = temp_s5_2; - if (temp_t1 != 3) - { - goto loop_16; - } - temp_ret_6 = microcode_constructor(arg0); - arg0 = temp_ret_6; - temp_v0_3 = temp_ret_6; - temp_ret_7 = add_tab3_previous(temp_v0_3); - arg0 = temp_ret_7; - temp_v0_4 = temp_ret_7; - load_draw_selected_icon_folder_select(temp_v0_4); + + DL = microcode_constructor(DL); + DL = add_tab3_previous(DL); + DL = load_draw_selected_icon_folder_select(DL); + + return DL; } -#else -GLOBAL_ASM( -.text -glabel constructor_menu12_mpstage -/* 048B80 7F014050 27BDFEC8 */ addiu $sp, $sp, -0x138 -/* 048B84 7F014054 AFBF0074 */ sw $ra, 0x74($sp) -/* 048B88 7F014058 AFBE0070 */ sw $fp, 0x70($sp) -/* 048B8C 7F01405C AFB7006C */ sw $s7, 0x6c($sp) -/* 048B90 7F014060 AFB60068 */ sw $s6, 0x68($sp) -/* 048B94 7F014064 AFB50064 */ sw $s5, 0x64($sp) -/* 048B98 7F014068 AFB40060 */ sw $s4, 0x60($sp) -/* 048B9C 7F01406C AFB3005C */ sw $s3, 0x5c($sp) -/* 048BA0 7F014070 AFB20058 */ sw $s2, 0x58($sp) -/* 048BA4 7F014074 AFB10054 */ sw $s1, 0x54($sp) -/* 048BA8 7F014078 AFB00050 */ sw $s0, 0x50($sp) -/* 048BAC 7F01407C F7B60048 */ sdc1 $f22, 0x48($sp) -/* 048BB0 7F014080 F7B40040 */ sdc1 $f20, 0x40($sp) -/* 048BB4 7F014084 AFA40138 */ sw $a0, 0x138($sp) -/* 048BB8 7F014088 00002825 */ move $a1, $zero -/* 048BBC 7F01408C 00003025 */ move $a2, $zero -/* 048BC0 7F014090 0C0011B4 */ jal viSetFillColor -/* 048BC4 7F014094 00003825 */ move $a3, $zero -/* 048BC8 7F014098 AFA20138 */ sw $v0, 0x138($sp) -/* 048BCC 7F01409C 0C000FBE */ jal viFillScreen -/* 048BD0 7F0140A0 00402025 */ move $a0, $v0 -/* 048BD4 7F0140A4 AFA20138 */ sw $v0, 0x138($sp) -/* 048BD8 7F0140A8 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 048BDC 7F0140AC 00402025 */ move $a0, $v0 -/* 048BE0 7F0140B0 AFA20138 */ sw $v0, 0x138($sp) -/* 048BE4 7F0140B4 0FC2B366 */ jal microcode_constructor -/* 048BE8 7F0140B8 00402025 */ move $a0, $v0 -/* 048BEC 7F0140BC 3C121010 */ lui $s2, (0x101010FF >> 16) # lui $s2, 0x1010 -/* 048BF0 7F0140C0 AFA20138 */ sw $v0, 0x138($sp) -/* 048BF4 7F0140C4 365210FF */ ori $s2, (0x101010FF & 0xFFFF) # ori $s2, $s2, 0x10ff -/* 048BF8 7F0140C8 2411006C */ li $s1, 108 -/* 048BFC 7F0140CC 241000A0 */ li $s0, 160 -/* 048C00 7F0140D0 24130172 */ li $s3, 370 -.L7F0140D4: -/* 048C04 7F0140D4 8FA40138 */ lw $a0, 0x138($sp) -/* 048C08 7F0140D8 24050025 */ li $a1, 37 -/* 048C0C 7F0140DC 02203025 */ move $a2, $s1 -/* 048C10 7F0140E0 24070185 */ li $a3, 389 -/* 048C14 7F0140E4 AFB00010 */ sw $s0, 0x10($sp) -/* 048C18 7F0140E8 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 048C1C 7F0140EC AFB20014 */ sw $s2, 0x14($sp) -/* 048C20 7F0140F0 26100046 */ addiu $s0, $s0, 0x46 -/* 048C24 7F0140F4 26310046 */ addiu $s1, $s1, 0x46 -/* 048C28 7F0140F8 1613FFF6 */ bne $s0, $s3, .L7F0140D4 -/* 048C2C 7F0140FC AFA20138 */ sw $v0, 0x138($sp) -/* 048C30 7F014100 0FC2B3BC */ jal combiner_bayer_lod_perspective -/* 048C34 7F014104 00402025 */ move $a0, $v0 -/* 048C38 7F014108 244E0008 */ addiu $t6, $v0, 8 -/* 048C3C 7F01410C AFAE0138 */ sw $t6, 0x138($sp) -/* 048C40 7F014110 3C0FBA00 */ lui $t7, (0xBA000C02 >> 16) # lui $t7, 0xba00 -/* 048C44 7F014114 35EF0C02 */ ori $t7, (0xBA000C02 & 0xFFFF) # ori $t7, $t7, 0xc02 -/* 048C48 7F014118 AC4F0000 */ sw $t7, ($v0) -/* 048C4C 7F01411C AC400004 */ sw $zero, 4($v0) -/* 048C50 7F014120 3C108009 */ lui $s0, %hi(mainfolderimages) -/* 048C54 7F014124 8E10D128 */ lw $s0, %lo(mainfolderimages)($s0) -/* 048C58 7F014128 27B30138 */ addiu $s3, $sp, 0x138 -/* 048C5C 7F01412C 24180002 */ li $t8, 2 -/* 048C60 7F014130 2610003C */ addiu $s0, $s0, 0x3c -/* 048C64 7F014134 02002825 */ move $a1, $s0 -/* 048C68 7F014138 AFB80010 */ sw $t8, 0x10($sp) -/* 048C6C 7F01413C 02602025 */ move $a0, $s3 -/* 048C70 7F014140 24060001 */ li $a2, 1 -/* 048C74 7F014144 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 048C78 7F014148 00003825 */ move $a3, $zero -/* 048C7C 7F01414C 3C014330 */ li $at, 0x43300000 # 176.000000 -/* 048C80 7F014150 44811000 */ mtc1 $at, $f2 -/* 048C84 7F014154 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 048C88 7F014158 44816000 */ mtc1 $at, $f12 -/* 048C8C 7F01415C 3C014214 */ li $at, 0x42140000 # 37.000000 -/* 048C90 7F014160 44812000 */ mtc1 $at, $f4 -/* 048C94 7F014164 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 048C98 7F014168 44814000 */ mtc1 $at, $f8 -/* 048C9C 7F01416C 46041180 */ add.s $f6, $f2, $f4 -/* 048CA0 7F014170 3C01428C */ li $at, 0x428C0000 # 70.000000 -/* 048CA4 7F014174 4481B000 */ mtc1 $at, $f22 -/* 048CA8 7F014178 46086000 */ add.s $f0, $f12, $f8 -/* 048CAC 7F01417C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 048CB0 7F014180 4481A000 */ mtc1 $at, $f20 -/* 048CB4 7F014184 E7A60100 */ swc1 $f6, 0x100($sp) -/* 048CB8 7F014188 E7A00104 */ swc1 $f0, 0x104($sp) -/* 048CBC 7F01418C 00008825 */ move $s1, $zero -/* 048CC0 7F014190 27B400F8 */ addiu $s4, $sp, 0xf8 -/* 048CC4 7F014194 27B20100 */ addiu $s2, $sp, 0x100 -/* 048CC8 7F014198 E7A200F8 */ swc1 $f2, 0xf8($sp) -/* 048CCC 7F01419C E7AC00FC */ swc1 $f12, 0xfc($sp) -.L7F0141A0: -/* 048CD0 7F0141A0 24190012 */ li $t9, 18 -/* 048CD4 7F0141A4 24090001 */ li $t1, 1 -/* 048CD8 7F0141A8 240A006B */ li $t2, 107 -/* 048CDC 7F0141AC 240B0067 */ li $t3, 103 -/* 048CE0 7F0141B0 240C0053 */ li $t4, 83 -/* 048CE4 7F0141B4 240D00FF */ li $t5, 255 -/* 048CE8 7F0141B8 AFAD002C */ sw $t5, 0x2c($sp) -/* 048CEC 7F0141BC AFAC0028 */ sw $t4, 0x28($sp) -/* 048CF0 7F0141C0 AFAB0024 */ sw $t3, 0x24($sp) -/* 048CF4 7F0141C4 AFAA0020 */ sw $t2, 0x20($sp) -/* 048CF8 7F0141C8 AFA9001C */ sw $t1, 0x1c($sp) -/* 048CFC 7F0141CC AFB90010 */ sw $t9, 0x10($sp) -/* 048D00 7F0141D0 AFA00014 */ sw $zero, 0x14($sp) -/* 048D04 7F0141D4 AFA00018 */ sw $zero, 0x18($sp) -/* 048D08 7F0141D8 920E0006 */ lbu $t6, 6($s0) -/* 048D0C 7F0141DC AFA00034 */ sw $zero, 0x34($sp) -/* 048D10 7F0141E0 02602025 */ move $a0, $s3 -/* 048D14 7F0141E4 000E782A */ slt $t7, $zero, $t6 -/* 048D18 7F0141E8 AFAF0030 */ sw $t7, 0x30($sp) -/* 048D1C 7F0141EC 02402825 */ move $a1, $s2 -/* 048D20 7F0141F0 02803025 */ move $a2, $s4 -/* 048D24 7F0141F4 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 048D28 7F0141F8 240702F0 */ li $a3, 752 -/* 048D2C 7F0141FC C7AA0104 */ lwc1 $f10, 0x104($sp) -/* 048D30 7F014200 24180012 */ li $t8, 18 -/* 048D34 7F014204 24190001 */ li $t9, 1 -/* 048D38 7F014208 46145400 */ add.s $f16, $f10, $f20 -/* 048D3C 7F01420C 2409006B */ li $t1, 107 -/* 048D40 7F014210 240A0067 */ li $t2, 103 -/* 048D44 7F014214 240B0053 */ li $t3, 83 -/* 048D48 7F014218 240C00FF */ li $t4, 255 -/* 048D4C 7F01421C E7B00104 */ swc1 $f16, 0x104($sp) -/* 048D50 7F014220 AFAC002C */ sw $t4, 0x2c($sp) -/* 048D54 7F014224 AFAB0028 */ sw $t3, 0x28($sp) -/* 048D58 7F014228 AFAA0024 */ sw $t2, 0x24($sp) -/* 048D5C 7F01422C AFA90020 */ sw $t1, 0x20($sp) -/* 048D60 7F014230 AFB9001C */ sw $t9, 0x1c($sp) -/* 048D64 7F014234 AFB80010 */ sw $t8, 0x10($sp) -/* 048D68 7F014238 AFA00014 */ sw $zero, 0x14($sp) -/* 048D6C 7F01423C AFA00018 */ sw $zero, 0x18($sp) -/* 048D70 7F014240 920D0006 */ lbu $t5, 6($s0) -/* 048D74 7F014244 AFA00034 */ sw $zero, 0x34($sp) -/* 048D78 7F014248 02602025 */ move $a0, $s3 -/* 048D7C 7F01424C 000D702A */ slt $t6, $zero, $t5 -/* 048D80 7F014250 AFAE0030 */ sw $t6, 0x30($sp) -/* 048D84 7F014254 02402825 */ move $a1, $s2 -/* 048D88 7F014258 02803025 */ move $a2, $s4 -/* 048D8C 7F01425C 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 048D90 7F014260 240702F0 */ li $a3, 752 -/* 048D94 7F014264 C7A00104 */ lwc1 $f0, 0x104($sp) -/* 048D98 7F014268 26310001 */ addiu $s1, $s1, 1 -/* 048D9C 7F01426C 24010003 */ li $at, 3 -/* 048DA0 7F014270 46140001 */ sub.s $f0, $f0, $f20 -/* 048DA4 7F014274 46160000 */ add.s $f0, $f0, $f22 -/* 048DA8 7F014278 1621FFC9 */ bne $s1, $at, .L7F0141A0 -/* 048DAC 7F01427C E7A00104 */ swc1 $f0, 0x104($sp) -/* 048DB0 7F014280 3C014208 */ li $at, 0x42080000 # 34.000000 -/* 048DB4 7F014284 44819000 */ mtc1 $at, $f18 -/* 048DB8 7F014288 3C0141B0 */ li $at, 0x41B00000 # 22.000000 -/* 048DBC 7F01428C 44810000 */ mtc1 $at, $f0 -/* 048DC0 7F014290 3C0142D8 */ li $at, 0x42D80000 # 108.000000 -/* 048DC4 7F014294 44812000 */ mtc1 $at, $f4 -/* 048DC8 7F014298 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 048DCC 7F01429C 44814000 */ mtc1 $at, $f8 -/* 048DD0 7F0142A0 46040180 */ add.s $f6, $f0, $f4 -/* 048DD4 7F0142A4 3C0142AA */ li $at, 0x42AA0000 # 85.000000 -/* 048DD8 7F0142A8 3C168003 */ lui $s6, %hi(multi_stage_setups) -/* 048DDC 7F0142AC 4481A000 */ mtc1 $at, $f20 -/* 048DE0 7F0142B0 46083280 */ add.s $f10, $f6, $f8 -/* 048DE4 7F0142B4 00008825 */ move $s1, $zero -/* 048DE8 7F0142B8 26D6B074 */ addiu $s6, %lo(multi_stage_setups) # addiu $s6, $s6, -0x4f8c -/* 048DEC 7F0142BC AFA000B4 */ sw $zero, 0xb4($sp) -/* 048DF0 7F0142C0 E7AA00DC */ swc1 $f10, 0xdc($sp) -/* 048DF4 7F0142C4 241E000C */ li $fp, 12 -/* 048DF8 7F0142C8 24170018 */ li $s7, 24 -/* 048DFC 7F0142CC 27B500D0 */ addiu $s5, $sp, 0xd0 -/* 048E00 7F0142D0 27B400D8 */ addiu $s4, $sp, 0xd8 -/* 048E04 7F0142D4 E7B200D0 */ swc1 $f18, 0xd0($sp) -/* 048E08 7F0142D8 E7A000D4 */ swc1 $f0, 0xd4($sp) -.L7F0142DC: -/* 048E0C 7F0142DC 3C0142AC */ li $at, 0x42AC0000 # 86.000000 -/* 048E10 7F0142E0 44818000 */ mtc1 $at, $f16 -/* 048E14 7F0142E4 00009025 */ move $s2, $zero -/* 048E18 7F0142E8 E7B000D8 */ swc1 $f16, 0xd8($sp) -.L7F0142EC: -/* 048E1C 7F0142EC 2A21000C */ slti $at, $s1, 0xc -/* 048E20 7F0142F0 5020007A */ beql $at, $zero, .L7F0144DC -/* 048E24 7F0142F4 C7B200D8 */ lwc1 $f18, 0xd8($sp) -/* 048E28 7F0142F8 02370019 */ multu $s1, $s7 -/* 048E2C 7F0142FC 3C0A8009 */ lui $t2, %hi(mpstageselimages) -/* 048E30 7F014300 8D4AD134 */ lw $t2, %lo(mpstageselimages)($t2) -/* 048E34 7F014304 240B0002 */ li $t3, 2 -/* 048E38 7F014308 02602025 */ move $a0, $s3 -/* 048E3C 7F01430C 24060001 */ li $a2, 1 -/* 048E40 7F014310 00003825 */ move $a3, $zero -/* 048E44 7F014314 00007812 */ mflo $t7 -/* 048E48 7F014318 02CFC021 */ addu $t8, $s6, $t7 -/* 048E4C 7F01431C 8F190004 */ lw $t9, 4($t8) -/* 048E50 7F014320 AFAB0010 */ sw $t3, 0x10($sp) -/* 048E54 7F014324 033E0019 */ multu $t9, $fp -/* 048E58 7F014328 00004812 */ mflo $t1 -/* 048E5C 7F01432C 012A8021 */ addu $s0, $t1, $t2 -/* 048E60 7F014330 0FC1DB5A */ jal likely_generate_DL_for_image_declaration -/* 048E64 7F014334 02002825 */ move $a1, $s0 -/* 048E68 7F014338 3C0C8007 */ lui $t4, %hi(current_mp_stage_highlighted) -/* 048E6C 7F01433C 8D8C977C */ lw $t4, %lo(current_mp_stage_highlighted)($t4) -/* 048E70 7F014340 8FAD0138 */ lw $t5, 0x138($sp) -/* 048E74 7F014344 3C0FBA00 */ lui $t7, (0xBA001402 >> 16) # lui $t7, 0xba00 -/* 048E78 7F014348 162C0030 */ bne $s1, $t4, .L7F01440C -/* 048E7C 7F01434C 25AE0008 */ addiu $t6, $t5, 8 -/* 048E80 7F014350 AFAE0138 */ sw $t6, 0x138($sp) -/* 048E84 7F014354 35EF1402 */ ori $t7, (0xBA001402 & 0xFFFF) # ori $t7, $t7, 0x1402 -/* 048E88 7F014358 3C180010 */ lui $t8, 0x10 -/* 048E8C 7F01435C ADB80004 */ sw $t8, 4($t5) -/* 048E90 7F014360 ADAF0000 */ sw $t7, ($t5) -/* 048E94 7F014364 8FB90138 */ lw $t9, 0x138($sp) -/* 048E98 7F014368 3C0AF800 */ lui $t2, 0xf800 -/* 048E9C 7F01436C 240BFF0A */ li $t3, -246 -/* 048EA0 7F014370 27290008 */ addiu $t1, $t9, 8 -/* 048EA4 7F014374 AFA90138 */ sw $t1, 0x138($sp) -/* 048EA8 7F014378 AF2B0004 */ sw $t3, 4($t9) -/* 048EAC 7F01437C AF2A0000 */ sw $t2, ($t9) -/* 048EB0 7F014380 8FAC0138 */ lw $t4, 0x138($sp) -/* 048EB4 7F014384 3C0FC411 */ lui $t7, (0xC4112048 >> 16) # lui $t7, 0xc411 -/* 048EB8 7F014388 3C0EB900 */ lui $t6, (0xB900031D >> 16) # lui $t6, 0xb900 -/* 048EBC 7F01438C 258D0008 */ addiu $t5, $t4, 8 -/* 048EC0 7F014390 AFAD0138 */ sw $t5, 0x138($sp) -/* 048EC4 7F014394 35CE031D */ ori $t6, (0xB900031D & 0xFFFF) # ori $t6, $t6, 0x31d -/* 048EC8 7F014398 35EF2048 */ ori $t7, (0xC4112048 & 0xFFFF) # ori $t7, $t7, 0x2048 -/* 048ECC 7F01439C AD8F0004 */ sw $t7, 4($t4) -/* 048ED0 7F0143A0 AD8E0000 */ sw $t6, ($t4) -/* 048ED4 7F0143A4 240C00FF */ li $t4, 255 -/* 048ED8 7F0143A8 240A00FF */ li $t2, 255 -/* 048EDC 7F0143AC 24190001 */ li $t9, 1 -/* 048EE0 7F0143B0 240B00FF */ li $t3, 255 -/* 048EE4 7F0143B4 240900FF */ li $t1, 255 -/* 048EE8 7F0143B8 2418002C */ li $t8, 44 -/* 048EEC 7F0143BC AFB80010 */ sw $t8, 0x10($sp) -/* 048EF0 7F0143C0 AFA90020 */ sw $t1, 0x20($sp) -/* 048EF4 7F0143C4 AFAB0028 */ sw $t3, 0x28($sp) -/* 048EF8 7F0143C8 AFB9001C */ sw $t9, 0x1c($sp) -/* 048EFC 7F0143CC AFAA0024 */ sw $t2, 0x24($sp) -/* 048F00 7F0143D0 AFAC002C */ sw $t4, 0x2c($sp) -/* 048F04 7F0143D4 AFA00018 */ sw $zero, 0x18($sp) -/* 048F08 7F0143D8 AFA00014 */ sw $zero, 0x14($sp) -/* 048F0C 7F0143DC 920D0006 */ lbu $t5, 6($s0) -/* 048F10 7F0143E0 240F0001 */ li $t7, 1 -/* 048F14 7F0143E4 AFAF0034 */ sw $t7, 0x34($sp) -/* 048F18 7F0143E8 000D702A */ slt $t6, $zero, $t5 -/* 048F1C 7F0143EC AFAE0030 */ sw $t6, 0x30($sp) -/* 048F20 7F0143F0 02602025 */ move $a0, $s3 -/* 048F24 7F0143F4 02802825 */ move $a1, $s4 -/* 048F28 7F0143F8 02A03025 */ move $a2, $s5 -/* 048F2C 7F0143FC 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 048F30 7F014400 24070044 */ li $a3, 68 -/* 048F34 7F014404 10000035 */ b .L7F0144DC -/* 048F38 7F014408 C7B200D8 */ lwc1 $f18, 0xd8($sp) -.L7F01440C: -/* 048F3C 7F01440C 0FC04034 */ jal check_if_mp_stage_unlocked -/* 048F40 7F014410 02202025 */ move $a0, $s1 -/* 048F44 7F014414 1040001A */ beqz $v0, .L7F014480 -/* 048F48 7F014418 02602025 */ move $a0, $s3 -/* 048F4C 7F01441C 2418002C */ li $t8, 44 -/* 048F50 7F014420 24190001 */ li $t9, 1 -/* 048F54 7F014424 2409006E */ li $t1, 110 -/* 048F58 7F014428 240A006E */ li $t2, 110 -/* 048F5C 7F01442C 240B006E */ li $t3, 110 -/* 048F60 7F014430 240C00FF */ li $t4, 255 -/* 048F64 7F014434 AFAC002C */ sw $t4, 0x2c($sp) -/* 048F68 7F014438 AFAB0028 */ sw $t3, 0x28($sp) -/* 048F6C 7F01443C AFAA0024 */ sw $t2, 0x24($sp) -/* 048F70 7F014440 AFA90020 */ sw $t1, 0x20($sp) -/* 048F74 7F014444 AFB9001C */ sw $t9, 0x1c($sp) -/* 048F78 7F014448 AFB80010 */ sw $t8, 0x10($sp) -/* 048F7C 7F01444C AFA00014 */ sw $zero, 0x14($sp) -/* 048F80 7F014450 AFA00018 */ sw $zero, 0x18($sp) -/* 048F84 7F014454 920D0006 */ lbu $t5, 6($s0) -/* 048F88 7F014458 AFA00034 */ sw $zero, 0x34($sp) -/* 048F8C 7F01445C 02602025 */ move $a0, $s3 -/* 048F90 7F014460 000D702A */ slt $t6, $zero, $t5 -/* 048F94 7F014464 AFAE0030 */ sw $t6, 0x30($sp) -/* 048F98 7F014468 02802825 */ move $a1, $s4 -/* 048F9C 7F01446C 02A03025 */ move $a2, $s5 -/* 048FA0 7F014470 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 048FA4 7F014474 24070044 */ li $a3, 68 -/* 048FA8 7F014478 10000018 */ b .L7F0144DC -/* 048FAC 7F01447C C7B200D8 */ lwc1 $f18, 0xd8($sp) -.L7F014480: -/* 048FB0 7F014480 240F002C */ li $t7, 44 -/* 048FB4 7F014484 24180001 */ li $t8, 1 -/* 048FB8 7F014488 2419000F */ li $t9, 15 -/* 048FBC 7F01448C 2409000F */ li $t1, 15 -/* 048FC0 7F014490 240A000F */ li $t2, 15 -/* 048FC4 7F014494 240B00FF */ li $t3, 255 -/* 048FC8 7F014498 AFAB002C */ sw $t3, 0x2c($sp) -/* 048FCC 7F01449C AFAA0028 */ sw $t2, 0x28($sp) -/* 048FD0 7F0144A0 AFA90024 */ sw $t1, 0x24($sp) -/* 048FD4 7F0144A4 AFB90020 */ sw $t9, 0x20($sp) -/* 048FD8 7F0144A8 AFB8001C */ sw $t8, 0x1c($sp) -/* 048FDC 7F0144AC AFAF0010 */ sw $t7, 0x10($sp) -/* 048FE0 7F0144B0 AFA00014 */ sw $zero, 0x14($sp) -/* 048FE4 7F0144B4 AFA00018 */ sw $zero, 0x18($sp) -/* 048FE8 7F0144B8 920C0006 */ lbu $t4, 6($s0) -/* 048FEC 7F0144BC AFA00034 */ sw $zero, 0x34($sp) -/* 048FF0 7F0144C0 02802825 */ move $a1, $s4 -/* 048FF4 7F0144C4 000C682A */ slt $t5, $zero, $t4 -/* 048FF8 7F0144C8 AFAD0030 */ sw $t5, 0x30($sp) -/* 048FFC 7F0144CC 02A03025 */ move $a2, $s5 -/* 049000 7F0144D0 0FC1ABFA */ jal display_image_at_on_screen_coord -/* 049004 7F0144D4 24070044 */ li $a3, 68 -/* 049008 7F0144D8 C7B200D8 */ lwc1 $f18, 0xd8($sp) -.L7F0144DC: -/* 04900C 7F0144DC 26520001 */ addiu $s2, $s2, 1 -/* 049010 7F0144E0 24010004 */ li $at, 4 -/* 049014 7F0144E4 46149100 */ add.s $f4, $f18, $f20 -/* 049018 7F0144E8 26310001 */ addiu $s1, $s1, 1 -/* 04901C 7F0144EC 1641FF7F */ bne $s2, $at, .L7F0142EC -/* 049020 7F0144F0 E7A400D8 */ swc1 $f4, 0xd8($sp) -/* 049024 7F0144F4 C7A600DC */ lwc1 $f6, 0xdc($sp) -/* 049028 7F0144F8 8FAE00B4 */ lw $t6, 0xb4($sp) -/* 04902C 7F0144FC 24010003 */ li $at, 3 -/* 049030 7F014500 46163200 */ add.s $f8, $f6, $f22 -/* 049034 7F014504 25CF0001 */ addiu $t7, $t6, 1 -/* 049038 7F014508 AFAF00B4 */ sw $t7, 0xb4($sp) -/* 04903C 7F01450C 15E1FF73 */ bne $t7, $at, .L7F0142DC -/* 049040 7F014510 E7A800DC */ swc1 $f8, 0xdc($sp) -/* 049044 7F014514 0FC2B366 */ jal microcode_constructor -/* 049048 7F014518 8FA40138 */ lw $a0, 0x138($sp) -/* 04904C 7F01451C 24180097 */ li $t8, 151 -/* 049050 7F014520 3C1E8004 */ lui $fp, %hi(ptrSecondFontTableSmall) -/* 049054 7F014524 AFA20138 */ sw $v0, 0x138($sp) -/* 049058 7F014528 0000A825 */ move $s5, $zero -/* 04905C 7F01452C AFB80090 */ sw $t8, 0x90($sp) -/* 049060 7F014530 27DE0EB0 */ addiu $fp, %lo(ptrSecondFontTableSmall) # addiu $fp, $fp, 0xeb0 -/* 049064 7F014534 AFA0009C */ sw $zero, 0x9c($sp) -.L7F014538: -/* 049068 7F014538 24160056 */ li $s6, 86 -/* 04906C 7F01453C 0000B825 */ move $s7, $zero -.L7F014540: -/* 049070 7F014540 2AA1000C */ slti $at, $s5, 0xc -/* 049074 7F014544 50200062 */ beql $at, $zero, .L7F0146D0 -/* 049078 7F014548 26F70001 */ addiu $s7, $s7, 1 -/* 04907C 7F01454C 0FC04034 */ jal check_if_mp_stage_unlocked -/* 049080 7F014550 02A02025 */ move $a0, $s5 -/* 049084 7F014554 1040005D */ beqz $v0, .L7F0146CC -/* 049088 7F014558 3C129696 */ lui $s2, (0x96969600 >> 16) # lui $s2, 0x9696 -/* 04908C 7F01455C 3C0A8007 */ lui $t2, %hi(current_mp_stage_highlighted) -/* 049090 7F014560 8D4A977C */ lw $t2, %lo(current_mp_stage_highlighted)($t2) -/* 049094 7F014564 0015C880 */ sll $t9, $s5, 2 -/* 049098 7F014568 0335C823 */ subu $t9, $t9, $s5 -/* 04909C 7F01456C 3C098003 */ lui $t1, %hi(multi_stage_setups) -/* 0490A0 7F014570 2529B074 */ addiu $t1, %lo(multi_stage_setups) # addiu $t1, $t1, -0x4f8c -/* 0490A4 7F014574 0019C8C0 */ sll $t9, $t9, 3 -/* 0490A8 7F014578 36529600 */ ori $s2, (0x96969600 & 0xFFFF) # ori $s2, $s2, 0x9600 -/* 0490AC 7F01457C 16AA0002 */ bne $s5, $t2, .L7F014588 -/* 0490B0 7F014580 03299821 */ addu $s3, $t9, $t1 -/* 0490B4 7F014584 2412FF00 */ li $s2, -256 -.L7F014588: -/* 0490B8 7F014588 0FC30776 */ jal langGet -/* 0490BC 7F01458C 96640002 */ lhu $a0, 2($s3) -/* 0490C0 7F014590 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) -/* 0490C4 7F014594 8D6B0EAC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0490C8 7F014598 27A40128 */ addiu $a0, $sp, 0x128 -/* 0490CC 7F01459C 27A50124 */ addiu $a1, $sp, 0x124 -/* 0490D0 7F0145A0 00403025 */ move $a2, $v0 -/* 0490D4 7F0145A4 8FC70000 */ lw $a3, ($fp) -/* 0490D8 7F0145A8 AFA00014 */ sw $zero, 0x14($sp) -/* 0490DC 7F0145AC 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0490E0 7F0145B0 AFAB0010 */ sw $t3, 0x10($sp) -/* 0490E4 7F0145B4 8FA30128 */ lw $v1, 0x128($sp) -/* 0490E8 7F0145B8 8FAC0090 */ lw $t4, 0x90($sp) -/* 0490EC 7F0145BC 8FAD0124 */ lw $t5, 0x124($sp) -/* 0490F0 7F0145C0 26D4FFE1 */ addiu $s4, $s6, -0x1f -/* 0490F4 7F0145C4 01833023 */ subu $a2, $t4, $v1 -/* 0490F8 7F0145C8 00C37021 */ addu $t6, $a2, $v1 -/* 0490FC 7F0145CC 02802825 */ move $a1, $s4 -/* 049100 7F0145D0 AFAE0010 */ sw $t6, 0x10($sp) -/* 049104 7F0145D4 AFA6012C */ sw $a2, 0x12c($sp) -/* 049108 7F0145D8 AFB40130 */ sw $s4, 0x130($sp) -/* 04910C 7F0145DC 8FA40138 */ lw $a0, 0x138($sp) -/* 049110 7F0145E0 AFA00014 */ sw $zero, 0x14($sp) -/* 049114 7F0145E4 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 049118 7F0145E8 028D3821 */ addu $a3, $s4, $t5 -/* 04911C 7F0145EC AFA20138 */ sw $v0, 0x138($sp) -/* 049120 7F0145F0 0FC30776 */ jal langGet -/* 049124 7F0145F4 96640002 */ lhu $a0, 2($s3) -/* 049128 7F0145F8 0C001107 */ jal viGetX -/* 04912C 7F0145FC 00408825 */ move $s1, $v0 -/* 049130 7F014600 00028400 */ sll $s0, $v0, 0x10 -/* 049134 7F014604 00107C03 */ sra $t7, $s0, 0x10 -/* 049138 7F014608 0C00110B */ jal viGetY -/* 04913C 7F01460C 01E08025 */ move $s0, $t7 -/* 049140 7F014610 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 049144 7F014614 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 049148 7F014618 8FD80000 */ lw $t8, ($fp) -/* 04914C 7F01461C 364900FF */ ori $t1, $s2, 0xff -/* 049150 7F014620 AFA90018 */ sw $t1, 0x18($sp) -/* 049154 7F014624 8FA40138 */ lw $a0, 0x138($sp) -/* 049158 7F014628 27A50130 */ addiu $a1, $sp, 0x130 -/* 04915C 7F01462C 27A6012C */ addiu $a2, $sp, 0x12c -/* 049160 7F014630 02203825 */ move $a3, $s1 -/* 049164 7F014634 AFB0001C */ sw $s0, 0x1c($sp) -/* 049168 7F014638 AFA20020 */ sw $v0, 0x20($sp) -/* 04916C 7F01463C AFA00024 */ sw $zero, 0x24($sp) -/* 049170 7F014640 AFA00028 */ sw $zero, 0x28($sp) -/* 049174 7F014644 AFB90014 */ sw $t9, 0x14($sp) -/* 049178 7F014648 0FC2B6AF */ jal en_text_write_stuff -/* 04917C 7F01464C AFB80010 */ sw $t8, 0x10($sp) -/* 049180 7F014650 8FA30128 */ lw $v1, 0x128($sp) -/* 049184 7F014654 8FAA0090 */ lw $t2, 0x90($sp) -/* 049188 7F014658 AFA20138 */ sw $v0, 0x138($sp) -/* 04918C 7F01465C 96640002 */ lhu $a0, 2($s3) -/* 049190 7F014660 01433023 */ subu $a2, $t2, $v1 -/* 049194 7F014664 AFA6012C */ sw $a2, 0x12c($sp) -/* 049198 7F014668 0FC30776 */ jal langGet -/* 04919C 7F01466C AFB40130 */ sw $s4, 0x130($sp) -/* 0491A0 7F014670 0C001107 */ jal viGetX -/* 0491A4 7F014674 00408825 */ move $s1, $v0 -/* 0491A8 7F014678 00028400 */ sll $s0, $v0, 0x10 -/* 0491AC 7F01467C 00105C03 */ sra $t3, $s0, 0x10 -/* 0491B0 7F014680 0C00110B */ jal viGetY -/* 0491B4 7F014684 01608025 */ move $s0, $t3 -/* 0491B8 7F014688 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0491BC 7F01468C 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0491C0 7F014690 8FCC0000 */ lw $t4, ($fp) -/* 0491C4 7F014694 364E0064 */ ori $t6, $s2, 0x64 -/* 0491C8 7F014698 AFAE0018 */ sw $t6, 0x18($sp) -/* 0491CC 7F01469C 8FA40138 */ lw $a0, 0x138($sp) -/* 0491D0 7F0146A0 27A50130 */ addiu $a1, $sp, 0x130 -/* 0491D4 7F0146A4 27A6012C */ addiu $a2, $sp, 0x12c -/* 0491D8 7F0146A8 02203825 */ move $a3, $s1 -/* 0491DC 7F0146AC AFB0001C */ sw $s0, 0x1c($sp) -/* 0491E0 7F0146B0 AFA20020 */ sw $v0, 0x20($sp) -/* 0491E4 7F0146B4 AFA00024 */ sw $zero, 0x24($sp) -/* 0491E8 7F0146B8 AFA00028 */ sw $zero, 0x28($sp) -/* 0491EC 7F0146BC AFAD0014 */ sw $t5, 0x14($sp) -/* 0491F0 7F0146C0 0FC2B6AF */ jal en_text_write_stuff -/* 0491F4 7F0146C4 AFAC0010 */ sw $t4, 0x10($sp) -/* 0491F8 7F0146C8 AFA20138 */ sw $v0, 0x138($sp) -.L7F0146CC: -/* 0491FC 7F0146CC 26F70001 */ addiu $s7, $s7, 1 -.L7F0146D0: -/* 049200 7F0146D0 24010004 */ li $at, 4 -/* 049204 7F0146D4 26D60055 */ addiu $s6, $s6, 0x55 -/* 049208 7F0146D8 16E1FF99 */ bne $s7, $at, .L7F014540 -/* 04920C 7F0146DC 26B50001 */ addiu $s5, $s5, 1 -/* 049210 7F0146E0 8FB9009C */ lw $t9, 0x9c($sp) -/* 049214 7F0146E4 8FAF0090 */ lw $t7, 0x90($sp) -/* 049218 7F0146E8 24010003 */ li $at, 3 -/* 04921C 7F0146EC 27290001 */ addiu $t1, $t9, 1 -/* 049220 7F0146F0 25F80046 */ addiu $t8, $t7, 0x46 -/* 049224 7F0146F4 AFA9009C */ sw $t1, 0x9c($sp) -/* 049228 7F0146F8 1521FF8F */ bne $t1, $at, .L7F014538 -/* 04922C 7F0146FC AFB80090 */ sw $t8, 0x90($sp) -/* 049230 7F014700 0FC2B366 */ jal microcode_constructor -/* 049234 7F014704 8FA40138 */ lw $a0, 0x138($sp) -/* 049238 7F014708 AFA20138 */ sw $v0, 0x138($sp) -/* 04923C 7F01470C 0FC0288E */ jal add_tab3_previous -/* 049240 7F014710 00402025 */ move $a0, $v0 -/* 049244 7F014714 AFA20138 */ sw $v0, 0x138($sp) -/* 049248 7F014718 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 04924C 7F01471C 00402025 */ move $a0, $v0 -/* 049250 7F014720 8FBF0074 */ lw $ra, 0x74($sp) -/* 049254 7F014724 D7B40040 */ ldc1 $f20, 0x40($sp) -/* 049258 7F014728 D7B60048 */ ldc1 $f22, 0x48($sp) -/* 04925C 7F01472C 8FB00050 */ lw $s0, 0x50($sp) -/* 049260 7F014730 8FB10054 */ lw $s1, 0x54($sp) -/* 049264 7F014734 8FB20058 */ lw $s2, 0x58($sp) -/* 049268 7F014738 8FB3005C */ lw $s3, 0x5c($sp) -/* 04926C 7F01473C 8FB40060 */ lw $s4, 0x60($sp) -/* 049270 7F014740 8FB50064 */ lw $s5, 0x64($sp) -/* 049274 7F014744 8FB60068 */ lw $s6, 0x68($sp) -/* 049278 7F014748 8FB7006C */ lw $s7, 0x6c($sp) -/* 04927C 7F01474C 8FBE0070 */ lw $fp, 0x70($sp) -/* 049280 7F014750 03E00008 */ jr $ra -/* 049284 7F014754 27BD0138 */ addiu $sp, $sp, 0x138 -) -#endif + @@ -16042,24 +6476,19 @@ void update_menu13_mpscenario(void) { - -#ifdef NONMATCHING -//for loop needs tweaking +// Address 0x7F0147B8 NTSC void interface_menu13_mpscenario(void) { + s32 isTeam; s32 scenarioid; s32 i; - s32 isTeam; - s32 vpos; - isTeam = FALSE; - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); - if (joyGetButtons(PLAYER_1, Z_TRIG|A_BUTTON) == 0) { tab_prev_highlight = FALSE; tab_next_highlight = FALSE; @@ -16074,18 +6503,20 @@ void interface_menu13_mpscenario(void) { dword_CODE_bss_80069780 = SCENARIO_YOLT; - - for (i = 7, vpos = 0x11d; i != 0; i--, vpos -= 0x16) + for (i = 7; i != 0; i--) { - if ((vpos <= (s32)cursor_v_pos) && (mp_player_counts[i].min <= get_selected_num_players()) && (get_selected_num_players() <= mp_player_counts[i].max)) + if ( + (s32)cursor_v_pos >= (0x83 + (-i * -0x16)) + && (mp_player_counts[i].min <= get_selected_num_players()) + && (get_selected_num_players() <= mp_player_counts[i].max)) { dword_CODE_bss_80069780 = i + 1; + break; } } } } - if (joyGetButtonsPressedThisFrame(PLAYER_1, START_BUTTON|Z_TRIG|A_BUTTON)) { if (tab_prev_highlight) @@ -16095,6 +6526,7 @@ void interface_menu13_mpscenario(void) else { scenarioid = dword_CODE_bss_80069780 - 1; + if ((scenarioid == SCENARIO_2v2) || (scenarioid == SCENARIO_3v1) || (scenarioid == SCENARIO_2v1)) { reset_mp_options_for_scenario(scenarioid); @@ -16106,6 +6538,7 @@ void interface_menu13_mpscenario(void) tab_prev_selected = TRUE; } } + sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } else if (joyGetButtonsPressedThisFrame(PLAYER_1, B_BUTTON)) @@ -16113,574 +6546,86 @@ void interface_menu13_mpscenario(void) tab_prev_selected = TRUE; sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } + disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 6, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); menu_control_stick_tracking(); + if (isTeam) { - set_menu_to_mode(MENU_MP_TEAMS, 0); + frontChangeMenu(MENU_MP_TEAMS, FALSE); return; - } - if (tab_prev_selected) - { - set_menu_to_mode(MENU_MP_OPTIONS, 0); - } -} -#else -GLOBAL_ASM( -.late_rodata -glabel D_80051AA8 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051AAC -.word 0x461C4000 /*10000.0;*/ - -.text -glabel interface_menu13_mpscenario -/* 0492E8 7F0147B8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0492EC 7F0147BC 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 0492F0 7F0147C0 AFBF0024 */ sw $ra, 0x24($sp) -/* 0492F4 7F0147C4 44816000 */ mtc1 $at, $f12 -/* 0492F8 7F0147C8 AFB20020 */ sw $s2, 0x20($sp) -/* 0492FC 7F0147CC AFB1001C */ sw $s1, 0x1c($sp) -/* 049300 7F0147D0 AFB00018 */ sw $s0, 0x18($sp) -/* 049304 7F0147D4 0C001151 */ jal viSetFovY -/* 049308 7F0147D8 AFA0002C */ sw $zero, 0x2c($sp) -/* 04930C 7F0147DC 3C018005 */ lui $at, %hi(D_80051AA8) -/* 049310 7F0147E0 0C001164 */ jal viSetAspect -/* 049314 7F0147E4 C42C1AA8 */ lwc1 $f12, %lo(D_80051AA8)($at) -/* 049318 7F0147E8 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 04931C 7F0147EC 44816000 */ mtc1 $at, $f12 -/* 049320 7F0147F0 3C018005 */ lui $at, %hi(D_80051AAC) -/* 049324 7F0147F4 0C001194 */ jal viSetZRange -/* 049328 7F0147F8 C42E1AAC */ lwc1 $f14, %lo(D_80051AAC)($at) -/* 04932C 7F0147FC 0C00114D */ jal viSetUseZBuf -/* 049330 7F014800 00002025 */ move $a0, $zero -/* 049334 7F014804 00002025 */ move $a0, $zero -/* 049338 7F014808 0C0030C3 */ jal joyGetButtons -/* 04933C 7F01480C 3405A000 */ li $a1, 40960 -/* 049340 7F014810 14400030 */ bnez $v0, .L7F0148D4 -/* 049344 7F014814 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 049348 7F014818 AC20A8E4 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 04934C 7F01481C 3C018003 */ lui $at, %hi(tab_next_highlight) -/* 049350 7F014820 AC20A8E0 */ sw $zero, %lo(tab_next_highlight)($at) -/* 049354 7F014824 3C018003 */ lui $at, %hi(tab_start_highlight) -/* 049358 7F014828 0FC028E7 */ jal isontab3 -/* 04935C 7F01482C AC20A8DC */ sw $zero, %lo(tab_start_highlight)($at) -/* 049360 7F014830 10400007 */ beqz $v0, .L7F014850 -/* 049364 7F014834 240F0001 */ li $t7, 1 -/* 049368 7F014838 240E0001 */ li $t6, 1 -/* 04936C 7F01483C 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 049370 7F014840 AC2EA8E4 */ sw $t6, %lo(tab_prev_highlight)($at) -/* 049374 7F014844 3C018007 */ lui $at, %hi(dword_CODE_bss_80069780) -/* 049378 7F014848 10000022 */ b .L7F0148D4 -/* 04937C 7F01484C AC209780 */ sw $zero, %lo(dword_CODE_bss_80069780)($at) -.L7F014850: -/* 049380 7F014850 3C018007 */ lui $at, %hi(dword_CODE_bss_80069780) -/* 049384 7F014854 AC2F9780 */ sw $t7, %lo(dword_CODE_bss_80069780)($at) -/* 049388 7F014858 24110007 */ li $s1, 7 -/* 04938C 7F01485C 2412011D */ li $s2, 285 -.L7F014860: -/* 049390 7F014860 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 049394 7F014864 C424A90C */ lwc1 $f4, %lo(cursor_v_pos)($at) -/* 049398 7F014868 3C098003 */ lui $t1, %hi(mp_player_counts) -/* 04939C 7F01486C 2529B054 */ addiu $t1, %lo(mp_player_counts) # addiu $t1, $t1, -0x4fac -/* 0493A0 7F014870 4600218D */ trunc.w.s $f6, $f4 -/* 0493A4 7F014874 00114080 */ sll $t0, $s1, 2 -/* 0493A8 7F014878 44193000 */ mfc1 $t9, $f6 -/* 0493AC 7F01487C 00000000 */ nop -/* 0493B0 7F014880 0332082A */ slt $at, $t9, $s2 -/* 0493B4 7F014884 54200011 */ bnezl $at, .L7F0148CC -/* 0493B8 7F014888 2631FFFF */ addiu $s1, $s1, -1 -/* 0493BC 7F01488C 0FC040A4 */ jal get_selected_num_players -/* 0493C0 7F014890 01098021 */ addu $s0, $t0, $t1 -/* 0493C4 7F014894 920A0002 */ lbu $t2, 2($s0) -/* 0493C8 7F014898 004A082A */ slt $at, $v0, $t2 -/* 0493CC 7F01489C 5420000B */ bnezl $at, .L7F0148CC -/* 0493D0 7F0148A0 2631FFFF */ addiu $s1, $s1, -1 -/* 0493D4 7F0148A4 0FC040A4 */ jal get_selected_num_players -/* 0493D8 7F0148A8 00000000 */ nop -/* 0493DC 7F0148AC 920B0003 */ lbu $t3, 3($s0) -/* 0493E0 7F0148B0 0162082A */ slt $at, $t3, $v0 -/* 0493E4 7F0148B4 14200004 */ bnez $at, .L7F0148C8 -/* 0493E8 7F0148B8 262C0001 */ addiu $t4, $s1, 1 -/* 0493EC 7F0148BC 3C018007 */ lui $at, %hi(dword_CODE_bss_80069780) -/* 0493F0 7F0148C0 10000004 */ b .L7F0148D4 -/* 0493F4 7F0148C4 AC2C9780 */ sw $t4, %lo(dword_CODE_bss_80069780)($at) -.L7F0148C8: -/* 0493F8 7F0148C8 2631FFFF */ addiu $s1, $s1, -1 -.L7F0148CC: -/* 0493FC 7F0148CC 1620FFE4 */ bnez $s1, .L7F014860 -/* 049400 7F0148D0 2652FFEA */ addiu $s2, $s2, -0x16 -.L7F0148D4: -/* 049404 7F0148D4 00002025 */ move $a0, $zero -/* 049408 7F0148D8 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04940C 7F0148DC 3405B000 */ li $a1, 45056 -/* 049410 7F0148E0 10400023 */ beqz $v0, .L7F014970 -/* 049414 7F0148E4 00002025 */ move $a0, $zero -/* 049418 7F0148E8 3C0D8003 */ lui $t5, %hi(tab_prev_highlight) -/* 04941C 7F0148EC 8DADA8E4 */ lw $t5, %lo(tab_prev_highlight)($t5) -/* 049420 7F0148F0 240E0001 */ li $t6, 1 -/* 049424 7F0148F4 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 049428 7F0148F8 11A00003 */ beqz $t5, .L7F014908 -/* 04942C 7F0148FC 3C048007 */ lui $a0, %hi(dword_CODE_bss_80069780) -/* 049430 7F014900 10000014 */ b .L7F014954 -/* 049434 7F014904 AC2EA8D8 */ sw $t6, %lo(tab_prev_selected)($at) -.L7F014908: -/* 049438 7F014908 8C849780 */ lw $a0, %lo(dword_CODE_bss_80069780)($a0) -/* 04943C 7F01490C 24010005 */ li $at, 5 -/* 049440 7F014910 2484FFFF */ addiu $a0, $a0, -1 -/* 049444 7F014914 10810005 */ beq $a0, $at, .L7F01492C -/* 049448 7F014918 24010006 */ li $at, 6 -/* 04944C 7F01491C 10810003 */ beq $a0, $at, .L7F01492C -/* 049450 7F014920 24010007 */ li $at, 7 -/* 049454 7F014924 14810006 */ bne $a0, $at, .L7F014940 -/* 049458 7F014928 00000000 */ nop -.L7F01492C: -/* 04945C 7F01492C 0FC0411A */ jal reset_mp_options_for_scenario -/* 049460 7F014930 00000000 */ nop -/* 049464 7F014934 240F0001 */ li $t7, 1 -/* 049468 7F014938 10000006 */ b .L7F014954 -/* 04946C 7F01493C AFAF002C */ sw $t7, 0x2c($sp) -.L7F014940: -/* 049470 7F014940 0FC0411A */ jal reset_mp_options_for_scenario -/* 049474 7F014944 00000000 */ nop -/* 049478 7F014948 24180001 */ li $t8, 1 -/* 04947C 7F01494C 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 049480 7F014950 AC38A8D8 */ sw $t8, %lo(tab_prev_selected)($at) -.L7F014954: -/* 049484 7F014954 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049488 7F014958 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 04948C 7F01495C 240500C7 */ li $a1, 199 -/* 049490 7F014960 0C002382 */ jal sndPlaySfx -/* 049494 7F014964 00003025 */ move $a2, $zero -/* 049498 7F014968 1000000C */ b .L7F01499C -/* 04949C 7F01496C 00000000 */ nop -.L7F014970: -/* 0494A0 7F014970 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0494A4 7F014974 24054000 */ li $a1, 16384 -/* 0494A8 7F014978 10400008 */ beqz $v0, .L7F01499C -/* 0494AC 7F01497C 24190001 */ li $t9, 1 -/* 0494B0 7F014980 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 0494B4 7F014984 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0494B8 7F014988 AC39A8D8 */ sw $t9, %lo(tab_prev_selected)($at) -/* 0494BC 7F01498C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0494C0 7F014990 240500C7 */ li $a1, 199 -/* 0494C4 7F014994 0C002382 */ jal sndPlaySfx -/* 0494C8 7F014998 00003025 */ move $a2, $zero -.L7F01499C: -/* 0494CC 7F01499C 3C108003 */ lui $s0, %hi(walletinst) -/* 0494D0 7F0149A0 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 0494D4 7F0149A4 0FC02DC9 */ jal disable_all_switches -/* 0494D8 7F0149A8 8E040000 */ lw $a0, ($s0) -/* 0494DC 7F0149AC 8E040000 */ lw $a0, ($s0) -/* 0494E0 7F0149B0 00002825 */ move $a1, $zero -/* 0494E4 7F0149B4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0494E8 7F0149B8 24060001 */ li $a2, 1 -/* 0494EC 7F0149BC 8E040000 */ lw $a0, ($s0) -/* 0494F0 7F0149C0 24050001 */ li $a1, 1 -/* 0494F4 7F0149C4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 0494F8 7F0149C8 24060001 */ li $a2, 1 -/* 0494FC 7F0149CC 8E040000 */ lw $a0, ($s0) -/* 049500 7F0149D0 24050003 */ li $a1, 3 -/* 049504 7F0149D4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 049508 7F0149D8 24060001 */ li $a2, 1 -/* 04950C 7F0149DC 8E040000 */ lw $a0, ($s0) -/* 049510 7F0149E0 24050006 */ li $a1, 6 -/* 049514 7F0149E4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 049518 7F0149E8 24060001 */ li $a2, 1 -/* 04951C 7F0149EC 0FC026E1 */ jal menu_control_stick_tracking -/* 049520 7F0149F0 00000000 */ nop -/* 049524 7F0149F4 8FA8002C */ lw $t0, 0x2c($sp) -/* 049528 7F0149F8 24040014 */ li $a0, 20 -/* 04952C 7F0149FC 3C098003 */ lui $t1, %hi(tab_prev_selected) -/* 049530 7F014A00 11000005 */ beqz $t0, .L7F014A18 -/* 049534 7F014A04 00000000 */ nop -/* 049538 7F014A08 0FC06975 */ jal set_menu_to_mode -/* 04953C 7F014A0C 00002825 */ move $a1, $zero -/* 049540 7F014A10 10000008 */ b .L7F014A34 -/* 049544 7F014A14 8FBF0024 */ lw $ra, 0x24($sp) -.L7F014A18: -/* 049548 7F014A18 8D29A8D8 */ lw $t1, %lo(tab_prev_selected)($t1) -/* 04954C 7F014A1C 2404000E */ li $a0, 14 -/* 049550 7F014A20 51200004 */ beql $t1, $zero, .L7F014A34 -/* 049554 7F014A24 8FBF0024 */ lw $ra, 0x24($sp) -/* 049558 7F014A28 0FC06975 */ jal set_menu_to_mode -/* 04955C 7F014A2C 00002825 */ move $a1, $zero -/* 049560 7F014A30 8FBF0024 */ lw $ra, 0x24($sp) -.L7F014A34: -/* 049564 7F014A34 8FB00018 */ lw $s0, 0x18($sp) -/* 049568 7F014A38 8FB1001C */ lw $s1, 0x1c($sp) -/* 04956C 7F014A3C 8FB20020 */ lw $s2, 0x20($sp) -/* 049570 7F014A40 03E00008 */ jr $ra -/* 049574 7F014A44 27BD0030 */ addiu $sp, $sp, 0x30 -) -#endif - + } + + if (tab_prev_selected) + { + frontChangeMenu(MENU_MP_OPTIONS, FALSE); + } +} -#ifdef NONMATCHING -//getting close -void constructor_menu13_mpscenario(Gfx *DL) +// Address 0x7F014A48 NTSC +Gfx * constructor_menu13_mpscenario(Gfx *DL) { - s32 x; - s32 y; + s32 padding1; + s32 padding2; + s32 padding3; + s32 x; // sp88 + s32 y; // sp84 + s32 i; s32 sp7C; s32 sp78; - s32 i; u8 *text; - //s32 newy; + s32 var_s3; - u32 tBL1entry; DL = viSetFillColor(DL,0,0,0); DL = viFillScreen(DL); +#ifdef VERSION_EU + DL = viFillScreen(DL); + DL = viFillScreen(DL); +#endif DL = sub_GAME_7F00D5E8(DL); DL = microcode_constructor(DL); text = langGet(0x9C57); + x = 0x37; y = 0x66; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - - for (i = 0, y = 0x83; i != 8; i++, y+=0x16) + for (i = 0; i < 8; i++) { - if ((mp_player_counts[i].min < get_selected_num_players()) || (tBL1entry = 0xFF, ((get_selected_num_players() < (s32) mp_player_counts[i].max) != 0))) + var_s3 = 0xff; + + if (((s32) mp_player_counts[i].max < get_selected_num_players()) || (get_selected_num_players() < (s32) mp_player_counts[i].min)) { - tBL1entry = 0x70; + var_s3 = 0x70; } + text = langGet(mp_player_counts[i].stage); - sub_GAME_7F0AE98C(&sp7C, &sp78, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&sp7C, &sp78, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0x39; + y = 0x83 + (i * 0x16); if ((i + 1) == dword_CODE_bss_80069780) { DL = microcode_constructor_related_to_menus(DL, 0x37, y - 1, sp78 + 0x3C, y + 0xE, 0x32); } - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, tBL1entry, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, var_s3, viGetX(), viGetY(), 0, 0); } DL = add_tab3_previous(DL); - load_draw_selected_icon_folder_select(DL); + DL = load_draw_selected_icon_folder_select(DL); + + return DL; } -#else -#ifndef VERSION_EU -GLOBAL_ASM( -.text -glabel constructor_menu13_mpscenario -/* 049578 7F014A48 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 04957C 7F014A4C AFBF005C */ sw $ra, 0x5c($sp) -/* 049580 7F014A50 AFBE0058 */ sw $fp, 0x58($sp) -/* 049584 7F014A54 AFB70054 */ sw $s7, 0x54($sp) -/* 049588 7F014A58 AFB60050 */ sw $s6, 0x50($sp) -/* 04958C 7F014A5C AFB5004C */ sw $s5, 0x4c($sp) -/* 049590 7F014A60 AFB40048 */ sw $s4, 0x48($sp) -/* 049594 7F014A64 AFB30044 */ sw $s3, 0x44($sp) -/* 049598 7F014A68 AFB20040 */ sw $s2, 0x40($sp) -/* 04959C 7F014A6C AFB1003C */ sw $s1, 0x3c($sp) -/* 0495A0 7F014A70 AFB00038 */ sw $s0, 0x38($sp) -/* 0495A4 7F014A74 00002825 */ move $a1, $zero -/* 0495A8 7F014A78 00003025 */ move $a2, $zero -/* 0495AC 7F014A7C 0C0011B4 */ jal viSetFillColor -/* 0495B0 7F014A80 00003825 */ move $a3, $zero -/* 0495B4 7F014A84 0C000FBE */ jal viFillScreen -/* 0495B8 7F014A88 00402025 */ move $a0, $v0 -/* 0495BC 7F014A8C 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 0495C0 7F014A90 00402025 */ move $a0, $v0 -/* 0495C4 7F014A94 0FC2B366 */ jal microcode_constructor -/* 0495C8 7F014A98 00402025 */ move $a0, $v0 -/* 0495CC 7F014A9C 0040A025 */ move $s4, $v0 -/* 0495D0 7F014AA0 0FC30776 */ jal langGet -/* 0495D4 7F014AA4 34049C57 */ li $a0, 40023 -/* 0495D8 7F014AA8 240E0037 */ li $t6, 55 -/* 0495DC 7F014AAC 24030066 */ li $v1, 102 -/* 0495E0 7F014AB0 0040B025 */ move $s6, $v0 -/* 0495E4 7F014AB4 AFAE0088 */ sw $t6, 0x88($sp) -/* 0495E8 7F014AB8 0C001107 */ jal viGetX -/* 0495EC 7F014ABC AFA30084 */ sw $v1, 0x84($sp) -/* 0495F0 7F014AC0 00028400 */ sll $s0, $v0, 0x10 -/* 0495F4 7F014AC4 00107C03 */ sra $t7, $s0, 0x10 -/* 0495F8 7F014AC8 0C00110B */ jal viGetY -/* 0495FC 7F014ACC 01E08025 */ move $s0, $t7 -/* 049600 7F014AD0 3C178004 */ lui $s7, %hi(ptrSecondFontTableLarge) -/* 049604 7F014AD4 3C1E8004 */ lui $fp, %hi(ptrFirstFontTableLarge) -/* 049608 7F014AD8 27DE0EB4 */ addiu $fp, %lo(ptrFirstFontTableLarge) # addiu $fp, $fp, 0xeb4 -/* 04960C 7F014ADC 26F70EB8 */ addiu $s7, %lo(ptrSecondFontTableLarge) # addiu $s7, $s7, 0xeb8 -/* 049610 7F014AE0 8EF80000 */ lw $t8, ($s7) -/* 049614 7F014AE4 8FD90000 */ lw $t9, ($fp) -/* 049618 7F014AE8 240800FF */ li $t0, 255 -/* 04961C 7F014AEC AFA80018 */ sw $t0, 0x18($sp) -/* 049620 7F014AF0 02802025 */ move $a0, $s4 -/* 049624 7F014AF4 27A50088 */ addiu $a1, $sp, 0x88 -/* 049628 7F014AF8 27A60084 */ addiu $a2, $sp, 0x84 -/* 04962C 7F014AFC 02C03825 */ move $a3, $s6 -/* 049630 7F014B00 AFB0001C */ sw $s0, 0x1c($sp) -/* 049634 7F014B04 AFA20020 */ sw $v0, 0x20($sp) -/* 049638 7F014B08 AFA00024 */ sw $zero, 0x24($sp) -/* 04963C 7F014B0C AFA00028 */ sw $zero, 0x28($sp) -/* 049640 7F014B10 AFB80010 */ sw $t8, 0x10($sp) -/* 049644 7F014B14 0FC025D8 */ jal write_text_at_abs_coord -/* 049648 7F014B18 AFB90014 */ sw $t9, 0x14($sp) -/* 04964C 7F014B1C 3C118003 */ lui $s1, %hi(mp_player_counts) -/* 049650 7F014B20 0040A025 */ move $s4, $v0 -/* 049654 7F014B24 2631B054 */ addiu $s1, %lo(mp_player_counts) # addiu $s1, $s1, -0x4fac -/* 049658 7F014B28 00009025 */ move $s2, $zero -/* 04965C 7F014B2C 24150083 */ li $s5, 131 -.L7F014B30: -/* 049660 7F014B30 0FC040A4 */ jal get_selected_num_players -/* 049664 7F014B34 241300FF */ li $s3, 255 -/* 049668 7F014B38 92290003 */ lbu $t1, 3($s1) -/* 04966C 7F014B3C 0122082A */ slt $at, $t1, $v0 -/* 049670 7F014B40 54200008 */ bnezl $at, .L7F014B64 -/* 049674 7F014B44 24130070 */ li $s3, 112 -/* 049678 7F014B48 0FC040A4 */ jal get_selected_num_players -/* 04967C 7F014B4C 00000000 */ nop -/* 049680 7F014B50 922A0002 */ lbu $t2, 2($s1) -/* 049684 7F014B54 004A082A */ slt $at, $v0, $t2 -/* 049688 7F014B58 10200002 */ beqz $at, .L7F014B64 -/* 04968C 7F014B5C 00000000 */ nop -/* 049690 7F014B60 24130070 */ li $s3, 112 -.L7F014B64: -/* 049694 7F014B64 0FC30776 */ jal langGet -/* 049698 7F014B68 96240000 */ lhu $a0, ($s1) -/* 04969C 7F014B6C 8FCB0000 */ lw $t3, ($fp) -/* 0496A0 7F014B70 0040B025 */ move $s6, $v0 -/* 0496A4 7F014B74 27A4007C */ addiu $a0, $sp, 0x7c -/* 0496A8 7F014B78 27A50078 */ addiu $a1, $sp, 0x78 -/* 0496AC 7F014B7C 00403025 */ move $a2, $v0 -/* 0496B0 7F014B80 8EE70000 */ lw $a3, ($s7) -/* 0496B4 7F014B84 AFA00014 */ sw $zero, 0x14($sp) -/* 0496B8 7F014B88 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0496BC 7F014B8C AFAB0010 */ sw $t3, 0x10($sp) -/* 0496C0 7F014B90 3C0E8007 */ lui $t6, %hi(dword_CODE_bss_80069780) -/* 0496C4 7F014B94 8DCE9780 */ lw $t6, %lo(dword_CODE_bss_80069780)($t6) -/* 0496C8 7F014B98 240C0039 */ li $t4, 57 -/* 0496CC 7F014B9C 264D0001 */ addiu $t5, $s2, 1 -/* 0496D0 7F014BA0 AFAC0088 */ sw $t4, 0x88($sp) -/* 0496D4 7F014BA4 02A01825 */ move $v1, $s5 -/* 0496D8 7F014BA8 15AE000D */ bne $t5, $t6, .L7F014BE0 -/* 0496DC 7F014BAC AFB50084 */ sw $s5, 0x84($sp) -/* 0496E0 7F014BB0 8FA70078 */ lw $a3, 0x78($sp) -/* 0496E4 7F014BB4 246F000E */ addiu $t7, $v1, 0xe -/* 0496E8 7F014BB8 24180032 */ li $t8, 50 -/* 0496EC 7F014BBC AFB80014 */ sw $t8, 0x14($sp) -/* 0496F0 7F014BC0 AFAF0010 */ sw $t7, 0x10($sp) -/* 0496F4 7F014BC4 02802025 */ move $a0, $s4 -/* 0496F8 7F014BC8 24050037 */ li $a1, 55 -/* 0496FC 7F014BCC 2466FFFF */ addiu $a2, $v1, -1 -/* 049700 7F014BD0 AFA30084 */ sw $v1, 0x84($sp) -/* 049704 7F014BD4 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 049708 7F014BD8 24E7003C */ addiu $a3, $a3, 0x3c -/* 04970C 7F014BDC 0040A025 */ move $s4, $v0 -.L7F014BE0: -/* 049710 7F014BE0 0C001107 */ jal viGetX -/* 049714 7F014BE4 00000000 */ nop -/* 049718 7F014BE8 00028400 */ sll $s0, $v0, 0x10 -/* 04971C 7F014BEC 0010CC03 */ sra $t9, $s0, 0x10 -/* 049720 7F014BF0 0C00110B */ jal viGetY -/* 049724 7F014BF4 03208025 */ move $s0, $t9 -/* 049728 7F014BF8 8EE80000 */ lw $t0, ($s7) -/* 04972C 7F014BFC 8FC90000 */ lw $t1, ($fp) -/* 049730 7F014C00 02802025 */ move $a0, $s4 -/* 049734 7F014C04 27A50088 */ addiu $a1, $sp, 0x88 -/* 049738 7F014C08 27A60084 */ addiu $a2, $sp, 0x84 -/* 04973C 7F014C0C 02C03825 */ move $a3, $s6 -/* 049740 7F014C10 AFB30018 */ sw $s3, 0x18($sp) -/* 049744 7F014C14 AFB0001C */ sw $s0, 0x1c($sp) -/* 049748 7F014C18 AFA20020 */ sw $v0, 0x20($sp) -/* 04974C 7F014C1C AFA00024 */ sw $zero, 0x24($sp) -/* 049750 7F014C20 AFA00028 */ sw $zero, 0x28($sp) -/* 049754 7F014C24 AFA80010 */ sw $t0, 0x10($sp) -/* 049758 7F014C28 0FC025D8 */ jal write_text_at_abs_coord -/* 04975C 7F014C2C AFA90014 */ sw $t1, 0x14($sp) -/* 049760 7F014C30 26520001 */ addiu $s2, $s2, 1 -/* 049764 7F014C34 24010008 */ li $at, 8 -/* 049768 7F014C38 26310004 */ addiu $s1, $s1, 4 -/* 04976C 7F014C3C 26B50016 */ addiu $s5, $s5, 0x16 -/* 049770 7F014C40 1641FFBB */ bne $s2, $at, .L7F014B30 -/* 049774 7F014C44 0040A025 */ move $s4, $v0 -/* 049778 7F014C48 0FC0288E */ jal add_tab3_previous -/* 04977C 7F014C4C 00402025 */ move $a0, $v0 -/* 049780 7F014C50 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 049784 7F014C54 00402025 */ move $a0, $v0 -/* 049788 7F014C58 8FBF005C */ lw $ra, 0x5c($sp) -/* 04978C 7F014C5C 8FB00038 */ lw $s0, 0x38($sp) -/* 049790 7F014C60 8FB1003C */ lw $s1, 0x3c($sp) -/* 049794 7F014C64 8FB20040 */ lw $s2, 0x40($sp) -/* 049798 7F014C68 8FB30044 */ lw $s3, 0x44($sp) -/* 04979C 7F014C6C 8FB40048 */ lw $s4, 0x48($sp) -/* 0497A0 7F014C70 8FB5004C */ lw $s5, 0x4c($sp) -/* 0497A4 7F014C74 8FB60050 */ lw $s6, 0x50($sp) -/* 0497A8 7F014C78 8FB70054 */ lw $s7, 0x54($sp) -/* 0497AC 7F014C7C 8FBE0058 */ lw $fp, 0x58($sp) -/* 0497B0 7F014C80 03E00008 */ jr $ra -/* 0497B4 7F014C84 27BD0098 */ addiu $sp, $sp, 0x98 -) -#endif -#ifdef VERSION_EU -GLOBAL_ASM( -.text -glabel constructor_menu13_mpscenario -/* 0473A8 7F0149B8 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 0473AC 7F0149BC AFBF005C */ sw $ra, 0x5c($sp) -/* 0473B0 7F0149C0 AFBE0058 */ sw $fp, 0x58($sp) -/* 0473B4 7F0149C4 AFB70054 */ sw $s7, 0x54($sp) -/* 0473B8 7F0149C8 AFB60050 */ sw $s6, 0x50($sp) -/* 0473BC 7F0149CC AFB5004C */ sw $s5, 0x4c($sp) -/* 0473C0 7F0149D0 AFB40048 */ sw $s4, 0x48($sp) -/* 0473C4 7F0149D4 AFB30044 */ sw $s3, 0x44($sp) -/* 0473C8 7F0149D8 AFB20040 */ sw $s2, 0x40($sp) -/* 0473CC 7F0149DC AFB1003C */ sw $s1, 0x3c($sp) -/* 0473D0 7F0149E0 AFB00038 */ sw $s0, 0x38($sp) -/* 0473D4 7F0149E4 00002825 */ move $a1, $zero -/* 0473D8 7F0149E8 00003025 */ move $a2, $zero -/* 0473DC 7F0149EC 0C001048 */ jal viSetFillColor -/* 0473E0 7F0149F0 00003825 */ move $a3, $zero -/* 0473E4 7F0149F4 0C000E52 */ jal viFillScreen -/* 0473E8 7F0149F8 00402025 */ move $a0, $v0 -/* 0473EC 7F0149FC 0C000E52 */ jal viFillScreen -/* 0473F0 7F014A00 00402025 */ move $a0, $v0 -/* 0473F4 7F014A04 0C000E52 */ jal viFillScreen -/* 0473F8 7F014A08 00402025 */ move $a0, $v0 -/* 0473FC 7F014A0C 0FC0353A */ jal sub_GAME_7F00D5E8 -/* 047400 7F014A10 00402025 */ move $a0, $v0 -/* 047404 7F014A14 0FC2B016 */ jal microcode_constructor -/* 047408 7F014A18 00402025 */ move $a0, $v0 -/* 04740C 7F014A1C 0040A025 */ move $s4, $v0 -/* 047410 7F014A20 0FC304AE */ jal langGet -/* 047414 7F014A24 34049C57 */ li $a0, 40023 -/* 047418 7F014A28 240E0037 */ li $t6, 55 -/* 04741C 7F014A2C 24030066 */ li $v1, 102 -/* 047420 7F014A30 0040B025 */ move $s6, $v0 -/* 047424 7F014A34 AFAE0088 */ sw $t6, 0x88($sp) -/* 047428 7F014A38 0C000F9B */ jal viGetX -/* 04742C 7F014A3C AFA30084 */ sw $v1, 0x84($sp) -/* 047430 7F014A40 00028400 */ sll $s0, $v0, 0x10 -/* 047434 7F014A44 00107C03 */ sra $t7, $s0, 0x10 -/* 047438 7F014A48 0C000F9F */ jal viGetY -/* 04743C 7F014A4C 01E08025 */ move $s0, $t7 -/* 047440 7F014A50 3C178004 */ lui $s7, %hi(ptrSecondFontTableLarge) # $s7, 0x8004 -/* 047444 7F014A54 3C1E8004 */ lui $fp, %hi(ptrFirstFontTableLarge) # $fp, 0x8004 -/* 047448 7F014A58 27DEAB04 */ addiu $fp, %lo(ptrFirstFontTableLarge) # addiu $fp, $fp, -0x54fc -/* 04744C 7F014A5C 26F7AB08 */ addiu $s7, %lo(ptrSecondFontTableLarge) # addiu $s7, $s7, -0x54f8 -/* 047450 7F014A60 8EF80000 */ lw $t8, ($s7) -/* 047454 7F014A64 8FD90000 */ lw $t9, ($fp) -/* 047458 7F014A68 240800FF */ li $t0, 255 -/* 04745C 7F014A6C AFA80018 */ sw $t0, 0x18($sp) -/* 047460 7F014A70 02802025 */ move $a0, $s4 -/* 047464 7F014A74 27A50088 */ addiu $a1, $sp, 0x88 -/* 047468 7F014A78 27A60084 */ addiu $a2, $sp, 0x84 -/* 04746C 7F014A7C 02C03825 */ move $a3, $s6 -/* 047470 7F014A80 AFB0001C */ sw $s0, 0x1c($sp) -/* 047474 7F014A84 AFA20020 */ sw $v0, 0x20($sp) -/* 047478 7F014A88 AFA00024 */ sw $zero, 0x24($sp) -/* 04747C 7F014A8C AFA00028 */ sw $zero, 0x28($sp) -/* 047480 7F014A90 AFB80010 */ sw $t8, 0x10($sp) -/* 047484 7F014A94 0FC02598 */ jal write_text_at_abs_coord -/* 047488 7F014A98 AFB90014 */ sw $t9, 0x14($sp) -/* 04748C 7F014A9C 3C118002 */ lui $s1, %hi(mp_player_counts) # $s1, 0x8002 -/* 047490 7F014AA0 0040A025 */ move $s4, $v0 -/* 047494 7F014AA4 263165A4 */ addiu $s1, %lo(mp_player_counts) # addiu $s1, $s1, 0x65a4 -/* 047498 7F014AA8 00009025 */ move $s2, $zero -/* 04749C 7F014AAC 24150083 */ li $s5, 131 -.L7F014AB0: -/* 0474A0 7F014AB0 0FC04060 */ jal get_selected_num_players -/* 0474A4 7F014AB4 241300FF */ li $s3, 255 -/* 0474A8 7F014AB8 92290003 */ lbu $t1, 3($s1) -/* 0474AC 7F014ABC 0122082A */ slt $at, $t1, $v0 -/* 0474B0 7F014AC0 54200008 */ bnezl $at, .L7F014AE4 -/* 0474B4 7F014AC4 24130070 */ li $s3, 112 -/* 0474B8 7F014AC8 0FC04060 */ jal get_selected_num_players -/* 0474BC 7F014ACC 00000000 */ nop -/* 0474C0 7F014AD0 922A0002 */ lbu $t2, 2($s1) -/* 0474C4 7F014AD4 004A082A */ slt $at, $v0, $t2 -/* 0474C8 7F014AD8 10200002 */ beqz $at, .L7F014AE4 -/* 0474CC 7F014ADC 00000000 */ nop -/* 0474D0 7F014AE0 24130070 */ li $s3, 112 -.L7F014AE4: -/* 0474D4 7F014AE4 0FC304AE */ jal langGet -/* 0474D8 7F014AE8 96240000 */ lhu $a0, ($s1) -/* 0474DC 7F014AEC 8FCB0000 */ lw $t3, ($fp) -/* 0474E0 7F014AF0 0040B025 */ move $s6, $v0 -/* 0474E4 7F014AF4 27A4007C */ addiu $a0, $sp, 0x7c -/* 0474E8 7F014AF8 27A50078 */ addiu $a1, $sp, 0x78 -/* 0474EC 7F014AFC 00403025 */ move $a2, $v0 -/* 0474F0 7F014B00 8EE70000 */ lw $a3, ($s7) -/* 0474F4 7F014B04 AFA00014 */ sw $zero, 0x14($sp) -/* 0474F8 7F014B08 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 0474FC 7F014B0C AFAB0010 */ sw $t3, 0x10($sp) -/* 047500 7F014B10 3C0E8006 */ lui $t6, %hi(dword_CODE_bss_80069780) # $t6, 0x8006 -/* 047504 7F014B14 8DCE86C0 */ lw $t6, %lo(dword_CODE_bss_80069780)($t6) -/* 047508 7F014B18 240C0039 */ li $t4, 57 -/* 04750C 7F014B1C 264D0001 */ addiu $t5, $s2, 1 -/* 047510 7F014B20 AFAC0088 */ sw $t4, 0x88($sp) -/* 047514 7F014B24 02A01825 */ move $v1, $s5 -/* 047518 7F014B28 15AE000D */ bne $t5, $t6, .L7F014B60 -/* 04751C 7F014B2C AFB50084 */ sw $s5, 0x84($sp) -/* 047520 7F014B30 8FA70078 */ lw $a3, 0x78($sp) -/* 047524 7F014B34 246F000E */ addiu $t7, $v1, 0xe -/* 047528 7F014B38 24180032 */ li $t8, 50 -/* 04752C 7F014B3C AFB80014 */ sw $t8, 0x14($sp) -/* 047530 7F014B40 AFAF0010 */ sw $t7, 0x10($sp) -/* 047534 7F014B44 02802025 */ move $a0, $s4 -/* 047538 7F014B48 24050037 */ li $a1, 55 -/* 04753C 7F014B4C 2466FFFF */ addiu $a2, $v1, -1 -/* 047540 7F014B50 AFA30084 */ sw $v1, 0x84($sp) -/* 047544 7F014B54 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 047548 7F014B58 24E7003C */ addiu $a3, $a3, 0x3c -/* 04754C 7F014B5C 0040A025 */ move $s4, $v0 -.L7F014B60: -/* 047550 7F014B60 0C000F9B */ jal viGetX -/* 047554 7F014B64 00000000 */ nop -/* 047558 7F014B68 00028400 */ sll $s0, $v0, 0x10 -/* 04755C 7F014B6C 0010CC03 */ sra $t9, $s0, 0x10 -/* 047560 7F014B70 0C000F9F */ jal viGetY -/* 047564 7F014B74 03208025 */ move $s0, $t9 -/* 047568 7F014B78 8EE80000 */ lw $t0, ($s7) -/* 04756C 7F014B7C 8FC90000 */ lw $t1, ($fp) -/* 047570 7F014B80 02802025 */ move $a0, $s4 -/* 047574 7F014B84 27A50088 */ addiu $a1, $sp, 0x88 -/* 047578 7F014B88 27A60084 */ addiu $a2, $sp, 0x84 -/* 04757C 7F014B8C 02C03825 */ move $a3, $s6 -/* 047580 7F014B90 AFB30018 */ sw $s3, 0x18($sp) -/* 047584 7F014B94 AFB0001C */ sw $s0, 0x1c($sp) -/* 047588 7F014B98 AFA20020 */ sw $v0, 0x20($sp) -/* 04758C 7F014B9C AFA00024 */ sw $zero, 0x24($sp) -/* 047590 7F014BA0 AFA00028 */ sw $zero, 0x28($sp) -/* 047594 7F014BA4 AFA80010 */ sw $t0, 0x10($sp) -/* 047598 7F014BA8 0FC02598 */ jal write_text_at_abs_coord -/* 04759C 7F014BAC AFA90014 */ sw $t1, 0x14($sp) -/* 0475A0 7F014BB0 26520001 */ addiu $s2, $s2, 1 -/* 0475A4 7F014BB4 24010008 */ li $at, 8 -/* 0475A8 7F014BB8 26310004 */ addiu $s1, $s1, 4 -/* 0475AC 7F014BBC 26B50016 */ addiu $s5, $s5, 0x16 -/* 0475B0 7F014BC0 1641FFBB */ bne $s2, $at, .L7F014AB0 -/* 0475B4 7F014BC4 0040A025 */ move $s4, $v0 -/* 0475B8 7F014BC8 0FC0284E */ jal add_tab3_previous -/* 0475BC 7F014BCC 00402025 */ move $a0, $v0 -/* 0475C0 7F014BD0 0FC02782 */ jal load_draw_selected_icon_folder_select -/* 0475C4 7F014BD4 00402025 */ move $a0, $v0 -/* 0475C8 7F014BD8 8FBF005C */ lw $ra, 0x5c($sp) -/* 0475CC 7F014BDC 8FB00038 */ lw $s0, 0x38($sp) -/* 0475D0 7F014BE0 8FB1003C */ lw $s1, 0x3c($sp) -/* 0475D4 7F014BE4 8FB20040 */ lw $s2, 0x40($sp) -/* 0475D8 7F014BE8 8FB30044 */ lw $s3, 0x44($sp) -/* 0475DC 7F014BEC 8FB40048 */ lw $s4, 0x48($sp) -/* 0475E0 7F014BF0 8FB5004C */ lw $s5, 0x4c($sp) -/* 0475E4 7F014BF4 8FB60050 */ lw $s6, 0x50($sp) -/* 0475E8 7F014BF8 8FB70054 */ lw $s7, 0x54($sp) -/* 0475EC 7F014BFC 8FBE0058 */ lw $fp, 0x58($sp) -/* 0475F0 7F014C00 03E00008 */ jr $ra -/* 0475F4 7F014C04 27BD0098 */ addiu $sp, $sp, 0x98 -) -#endif -#endif @@ -16726,568 +6671,229 @@ return; - - -#ifdef NONMATCHING +// Address 0x7F014D48 NTSC void interface_menu14_mpteams(void) { - s32 phi_s0; - s32 phi_a1; - s32 phi_a1_2; - s32 phi_s0_2; - - viSetFovY(0x42700000); - viSetAspect(D_80051AB0); - viSetZRange(0x42c80000, D_80051AB4); + s32 i; + s32 var_a1; + + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); - D_8002B560 = (s32) ((s32) (D_8002B560 + 1) % 0x14); - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0x101) != 0) || (joyGetStickXInRange(0, -2, 1) > 0)) + + D_8002B560 = (s32) (D_8002B560 + 1) % 20; + + // 0x101 + if ((joyGetButtonsPressedThisFrame(0, R_JPAD|R_CBUTTONS)) || (joyGetStickXInRange(0, -2, 1) > 0)) { - if (scenario == 7) + if (scenario == SCENARIO_2v1) { - if ((teamsize & 1) == 0) + if (!(teamsize & 1)) { teamsize = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } } - else + else if (!(teamsize & 1)) + { + teamsize += 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + } + // 0x808 + else if ((joyGetButtonsPressedThisFrame(0, U_JPAD|U_CBUTTONS)) || (joyGetStickYInRange(0, -2, 1) > 0)) + { + if (scenario == SCENARIO_2v2) { - if ((teamsize & 1) == 0) + if (teamsize & 2) { - teamsize = (s32) (teamsize + 1); - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); + teamsize = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } } + else if (teamsize & 2) + { + teamsize -= 2; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } } - else + // 0x202 + else if ((joyGetButtonsPressedThisFrame(0, L_JPAD|L_CBUTTONS)) || (joyGetStickXInRange(0, -2, 1) < -1)) { - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0x808) != 0) || (joyGetStickYInRange(0, -2, 1) > 0)) + if (scenario == SCENARIO_2v2) { - if (scenario == 5) + if (teamsize & 1) { - if ((teamsize & 2) != 0) - { - teamsize = 1; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + teamsize = 2; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - else + } + else if (teamsize & 1) + { + teamsize -= 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + } + // 0x404 + else if ((joyGetButtonsPressedThisFrame(0, D_JPAD|D_CBUTTONS)) || (joyGetStickYInRange(0, -2, 1) < -1)) + { + if (scenario == SCENARIO_2v1) + { + if (!(teamsize & 2)) { - if ((teamsize & 2) != 0) - { - teamsize = (s32) (teamsize + -2); - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + teamsize = 2; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } } - else + else if (!(teamsize & 2)) + { + teamsize += 2; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); + } + } + + disable_all_switches(walletinst[0]); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); + menu_control_stick_tracking(); + + if (joyGetButtonsPressedThisFrame(0, A_BUTTON|Z_TRIG|START_BUTTON)) // 0xb000 + { + for (i = 0; i < 4; i++) { - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0x202) != 0) || (joyGetStickXInRange(0, -2, 1) < -1)) + if (scenario == SCENARIO_2v2) { - if (scenario == 5) + + if (i == 0 || i == teamsize) { - if ((teamsize & 1) != 0) - { - teamsize = 2; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + var_a1 = 0; } else { - if ((teamsize & 1) != 0) - { - teamsize = (s32) (teamsize + -1); - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } + var_a1 = 1; } + + set_players_team_or_scenario_item_flag(i, var_a1); } else { - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0x404) != 0) || (joyGetStickYInRange(0, -2, 1) < -1)) + if (i != teamsize) { - if (scenario == 7) - { - if ((teamsize & 2) == 0) - { - teamsize = 2; - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } - } - else - { - if ((teamsize & 2) == 0) - { - teamsize = (s32) (teamsize + 2); - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); - } - } + var_a1 = 0; } else { - + var_a1 = 1; } + + set_players_team_or_scenario_item_flag(i, var_a1); } } - } - disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, 1); - set_item_visibility_in_objinstance(walletinst[0], 0x2a, 1); - menu_control_stick_tracking(); - phi_s0 = 0; - if (joyGetButtonsPressedThisFrame(PLAYER_1, 0xb000) != 0) - { -loop_29: - if (scenario == 5) - { - if ((phi_s0 == 0) || (phi_s0 == teamsize)) - { - phi_a1 = 0; - } - else - { - - } - set_players_team_or_scenario_item_flag(phi_s0, phi_a1); - phi_s0_2 = phi_s0 + 1; - } - else - { - phi_a1_2 = 1; - if (phi_s0 != teamsize) - { - phi_a1_2 = 0; - } - set_players_team_or_scenario_item_flag(phi_s0, phi_a1_2); - phi_s0_2 = phi_s0 + 1; - } - phi_s0 = phi_s0_2; - if (phi_s0_2 != 4) - { - goto loop_29; - } - set_menu_to_mode(MENU_MP_OPTIONS, 0); - sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, 0); + + frontChangeMenu(MENU_MP_OPTIONS, 0); + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_80051AB0 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051AB4 -.word 0x461C4000 /*10000.0;*/ - -.text -glabel interface_menu14_mpteams -/* 049878 7F014D48 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 04987C 7F014D4C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 049880 7F014D50 AFBF001C */ sw $ra, 0x1c($sp) -/* 049884 7F014D54 44816000 */ mtc1 $at, $f12 -/* 049888 7F014D58 AFB10018 */ sw $s1, 0x18($sp) -/* 04988C 7F014D5C 0C001151 */ jal viSetFovY -/* 049890 7F014D60 AFB00014 */ sw $s0, 0x14($sp) -/* 049894 7F014D64 3C018005 */ lui $at, %hi(D_80051AB0) -/* 049898 7F014D68 0C001164 */ jal viSetAspect -/* 04989C 7F014D6C C42C1AB0 */ lwc1 $f12, %lo(D_80051AB0)($at) -/* 0498A0 7F014D70 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0498A4 7F014D74 44816000 */ mtc1 $at, $f12 -/* 0498A8 7F014D78 3C018005 */ lui $at, %hi(D_80051AB4) -/* 0498AC 7F014D7C 0C001194 */ jal viSetZRange -/* 0498B0 7F014D80 C42E1AB4 */ lwc1 $f14, %lo(D_80051AB4)($at) -/* 0498B4 7F014D84 0C00114D */ jal viSetUseZBuf -/* 0498B8 7F014D88 00002025 */ move $a0, $zero -/* 0498BC 7F014D8C 3C028003 */ lui $v0, %hi(D_8002B560) -/* 0498C0 7F014D90 2442B560 */ addiu $v0, %lo(D_8002B560) # addiu $v0, $v0, -0x4aa0 -/* 0498C4 7F014D94 8C4E0000 */ lw $t6, ($v0) -/* 0498C8 7F014D98 24010014 */ li $at, 20 -/* 0498CC 7F014D9C 00002025 */ move $a0, $zero -/* 0498D0 7F014DA0 25CF0001 */ addiu $t7, $t6, 1 -/* 0498D4 7F014DA4 01E1001A */ div $zero, $t7, $at -/* 0498D8 7F014DA8 0000C010 */ mfhi $t8 -/* 0498DC 7F014DAC AC580000 */ sw $t8, ($v0) -/* 0498E0 7F014DB0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0498E4 7F014DB4 24050101 */ li $a1, 257 -/* 0498E8 7F014DB8 14400005 */ bnez $v0, .L7F014DD0 -/* 0498EC 7F014DBC 00002025 */ move $a0, $zero -/* 0498F0 7F014DC0 2405FFFE */ li $a1, -2 -/* 0498F4 7F014DC4 0C00312D */ jal joyGetStickXInRange -/* 0498F8 7F014DC8 24060001 */ li $a2, 1 -/* 0498FC 7F014DCC 18400020 */ blez $v0, .L7F014E50 -.L7F014DD0: -/* 049900 7F014DD0 3C198003 */ lui $t9, %hi(scenario) -/* 049904 7F014DD4 8F39B540 */ lw $t9, %lo(scenario)($t9) -/* 049908 7F014DD8 24010007 */ li $at, 7 -/* 04990C 7F014DDC 3C118007 */ lui $s1, %hi(teamsize) -/* 049910 7F014DE0 1721000F */ bne $t9, $at, .L7F014E20 -/* 049914 7F014DE4 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049918 7F014DE8 3C118007 */ lui $s1, %hi(teamsize) -/* 04991C 7F014DEC 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049920 7F014DF0 8E280000 */ lw $t0, ($s1) -/* 049924 7F014DF4 240A0001 */ li $t2, 1 -/* 049928 7F014DF8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 04992C 7F014DFC 31090001 */ andi $t1, $t0, 1 -/* 049930 7F014E00 1520008E */ bnez $t1, .L7F01503C -/* 049934 7F014E04 240500C7 */ li $a1, 199 -/* 049938 7F014E08 AE2A0000 */ sw $t2, ($s1) -/* 04993C 7F014E0C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049940 7F014E10 0C002382 */ jal sndPlaySfx -/* 049944 7F014E14 00003025 */ move $a2, $zero -/* 049948 7F014E18 10000088 */ b .L7F01503C -/* 04994C 7F014E1C 00000000 */ nop -.L7F014E20: -/* 049950 7F014E20 8E220000 */ lw $v0, ($s1) -/* 049954 7F014E24 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049958 7F014E28 240500C7 */ li $a1, 199 -/* 04995C 7F014E2C 304B0001 */ andi $t3, $v0, 1 -/* 049960 7F014E30 15600082 */ bnez $t3, .L7F01503C -/* 049964 7F014E34 244C0001 */ addiu $t4, $v0, 1 -/* 049968 7F014E38 AE2C0000 */ sw $t4, ($s1) -/* 04996C 7F014E3C 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049970 7F014E40 0C002382 */ jal sndPlaySfx -/* 049974 7F014E44 00003025 */ move $a2, $zero -/* 049978 7F014E48 1000007C */ b .L7F01503C -/* 04997C 7F014E4C 00000000 */ nop -.L7F014E50: -/* 049980 7F014E50 00002025 */ move $a0, $zero -/* 049984 7F014E54 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 049988 7F014E58 24050808 */ li $a1, 2056 -/* 04998C 7F014E5C 14400005 */ bnez $v0, .L7F014E74 -/* 049990 7F014E60 00002025 */ move $a0, $zero -/* 049994 7F014E64 2405FFFE */ li $a1, -2 -/* 049998 7F014E68 0C00314A */ jal joyGetStickYInRange -/* 04999C 7F014E6C 24060001 */ li $a2, 1 -/* 0499A0 7F014E70 18400020 */ blez $v0, .L7F014EF4 -.L7F014E74: -/* 0499A4 7F014E74 3C0D8003 */ lui $t5, %hi(scenario) -/* 0499A8 7F014E78 8DADB540 */ lw $t5, %lo(scenario)($t5) -/* 0499AC 7F014E7C 24010005 */ li $at, 5 -/* 0499B0 7F014E80 3C118007 */ lui $s1, %hi(teamsize) -/* 0499B4 7F014E84 15A1000F */ bne $t5, $at, .L7F014EC4 -/* 0499B8 7F014E88 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 0499BC 7F014E8C 3C118007 */ lui $s1, %hi(teamsize) -/* 0499C0 7F014E90 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 0499C4 7F014E94 8E2E0000 */ lw $t6, ($s1) -/* 0499C8 7F014E98 24180001 */ li $t8, 1 -/* 0499CC 7F014E9C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0499D0 7F014EA0 31CF0002 */ andi $t7, $t6, 2 -/* 0499D4 7F014EA4 11E00065 */ beqz $t7, .L7F01503C -/* 0499D8 7F014EA8 240500C7 */ li $a1, 199 -/* 0499DC 7F014EAC AE380000 */ sw $t8, ($s1) -/* 0499E0 7F014EB0 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 0499E4 7F014EB4 0C002382 */ jal sndPlaySfx -/* 0499E8 7F014EB8 00003025 */ move $a2, $zero -/* 0499EC 7F014EBC 1000005F */ b .L7F01503C -/* 0499F0 7F014EC0 00000000 */ nop -.L7F014EC4: -/* 0499F4 7F014EC4 8E220000 */ lw $v0, ($s1) -/* 0499F8 7F014EC8 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 0499FC 7F014ECC 240500C7 */ li $a1, 199 -/* 049A00 7F014ED0 30590002 */ andi $t9, $v0, 2 -/* 049A04 7F014ED4 13200059 */ beqz $t9, .L7F01503C -/* 049A08 7F014ED8 2448FFFE */ addiu $t0, $v0, -2 -/* 049A0C 7F014EDC AE280000 */ sw $t0, ($s1) -/* 049A10 7F014EE0 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049A14 7F014EE4 0C002382 */ jal sndPlaySfx -/* 049A18 7F014EE8 00003025 */ move $a2, $zero -/* 049A1C 7F014EEC 10000053 */ b .L7F01503C -/* 049A20 7F014EF0 00000000 */ nop -.L7F014EF4: -/* 049A24 7F014EF4 00002025 */ move $a0, $zero -/* 049A28 7F014EF8 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 049A2C 7F014EFC 24050202 */ li $a1, 514 -/* 049A30 7F014F00 14400006 */ bnez $v0, .L7F014F1C -/* 049A34 7F014F04 00002025 */ move $a0, $zero -/* 049A38 7F014F08 2405FFFE */ li $a1, -2 -/* 049A3C 7F014F0C 0C00312D */ jal joyGetStickXInRange -/* 049A40 7F014F10 24060001 */ li $a2, 1 -/* 049A44 7F014F14 2841FFFF */ slti $at, $v0, -1 -/* 049A48 7F014F18 10200020 */ beqz $at, .L7F014F9C -.L7F014F1C: -/* 049A4C 7F014F1C 3C098003 */ lui $t1, %hi(scenario) -/* 049A50 7F014F20 8D29B540 */ lw $t1, %lo(scenario)($t1) -/* 049A54 7F014F24 24010005 */ li $at, 5 -/* 049A58 7F014F28 3C118007 */ lui $s1, %hi(teamsize) -/* 049A5C 7F014F2C 1521000F */ bne $t1, $at, .L7F014F6C -/* 049A60 7F014F30 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049A64 7F014F34 3C118007 */ lui $s1, %hi(teamsize) -/* 049A68 7F014F38 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049A6C 7F014F3C 8E2A0000 */ lw $t2, ($s1) -/* 049A70 7F014F40 240C0002 */ li $t4, 2 -/* 049A74 7F014F44 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049A78 7F014F48 314B0001 */ andi $t3, $t2, 1 -/* 049A7C 7F014F4C 1160003B */ beqz $t3, .L7F01503C -/* 049A80 7F014F50 240500C7 */ li $a1, 199 -/* 049A84 7F014F54 AE2C0000 */ sw $t4, ($s1) -/* 049A88 7F014F58 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049A8C 7F014F5C 0C002382 */ jal sndPlaySfx -/* 049A90 7F014F60 00003025 */ move $a2, $zero -/* 049A94 7F014F64 10000035 */ b .L7F01503C -/* 049A98 7F014F68 00000000 */ nop -.L7F014F6C: -/* 049A9C 7F014F6C 8E220000 */ lw $v0, ($s1) -/* 049AA0 7F014F70 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049AA4 7F014F74 240500C7 */ li $a1, 199 -/* 049AA8 7F014F78 304D0001 */ andi $t5, $v0, 1 -/* 049AAC 7F014F7C 11A0002F */ beqz $t5, .L7F01503C -/* 049AB0 7F014F80 244EFFFF */ addiu $t6, $v0, -1 -/* 049AB4 7F014F84 AE2E0000 */ sw $t6, ($s1) -/* 049AB8 7F014F88 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049ABC 7F014F8C 0C002382 */ jal sndPlaySfx -/* 049AC0 7F014F90 00003025 */ move $a2, $zero -/* 049AC4 7F014F94 10000029 */ b .L7F01503C -/* 049AC8 7F014F98 00000000 */ nop -.L7F014F9C: -/* 049ACC 7F014F9C 00002025 */ move $a0, $zero -/* 049AD0 7F014FA0 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 049AD4 7F014FA4 24050404 */ li $a1, 1028 -/* 049AD8 7F014FA8 14400006 */ bnez $v0, .L7F014FC4 -/* 049ADC 7F014FAC 00002025 */ move $a0, $zero -/* 049AE0 7F014FB0 2405FFFE */ li $a1, -2 -/* 049AE4 7F014FB4 0C00314A */ jal joyGetStickYInRange -/* 049AE8 7F014FB8 24060001 */ li $a2, 1 -/* 049AEC 7F014FBC 2841FFFF */ slti $at, $v0, -1 -/* 049AF0 7F014FC0 1020001E */ beqz $at, .L7F01503C -.L7F014FC4: -/* 049AF4 7F014FC4 3C0F8003 */ lui $t7, %hi(scenario) -/* 049AF8 7F014FC8 8DEFB540 */ lw $t7, %lo(scenario)($t7) -/* 049AFC 7F014FCC 24010007 */ li $at, 7 -/* 049B00 7F014FD0 3C118007 */ lui $s1, %hi(teamsize) -/* 049B04 7F014FD4 15E1000F */ bne $t7, $at, .L7F015014 -/* 049B08 7F014FD8 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049B0C 7F014FDC 3C118007 */ lui $s1, %hi(teamsize) -/* 049B10 7F014FE0 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049B14 7F014FE4 8E380000 */ lw $t8, ($s1) -/* 049B18 7F014FE8 24080002 */ li $t0, 2 -/* 049B1C 7F014FEC 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049B20 7F014FF0 33190002 */ andi $t9, $t8, 2 -/* 049B24 7F014FF4 17200011 */ bnez $t9, .L7F01503C -/* 049B28 7F014FF8 240500C7 */ li $a1, 199 -/* 049B2C 7F014FFC AE280000 */ sw $t0, ($s1) -/* 049B30 7F015000 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049B34 7F015004 0C002382 */ jal sndPlaySfx -/* 049B38 7F015008 00003025 */ move $a2, $zero -/* 049B3C 7F01500C 1000000B */ b .L7F01503C -/* 049B40 7F015010 00000000 */ nop -.L7F015014: -/* 049B44 7F015014 8E220000 */ lw $v0, ($s1) -/* 049B48 7F015018 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049B4C 7F01501C 240500C7 */ li $a1, 199 -/* 049B50 7F015020 30490002 */ andi $t1, $v0, 2 -/* 049B54 7F015024 15200005 */ bnez $t1, .L7F01503C -/* 049B58 7F015028 244A0002 */ addiu $t2, $v0, 2 -/* 049B5C 7F01502C AE2A0000 */ sw $t2, ($s1) -/* 049B60 7F015030 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049B64 7F015034 0C002382 */ jal sndPlaySfx -/* 049B68 7F015038 00003025 */ move $a2, $zero -.L7F01503C: -/* 049B6C 7F01503C 3C108003 */ lui $s0, %hi(walletinst) -/* 049B70 7F015040 2610A95C */ addiu $s0, %lo(walletinst) # addiu $s0, $s0, -0x56a4 -/* 049B74 7F015044 3C118007 */ lui $s1, %hi(teamsize) -/* 049B78 7F015048 26319788 */ addiu $s1, %lo(teamsize) # addiu $s1, $s1, -0x6878 -/* 049B7C 7F01504C 0FC02DC9 */ jal disable_all_switches -/* 049B80 7F015050 8E040000 */ lw $a0, ($s0) -/* 049B84 7F015054 8E040000 */ lw $a0, ($s0) -/* 049B88 7F015058 00002825 */ move $a1, $zero -/* 049B8C 7F01505C 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 049B90 7F015060 24060001 */ li $a2, 1 -/* 049B94 7F015064 8E040000 */ lw $a0, ($s0) -/* 049B98 7F015068 2405002A */ li $a1, 42 -/* 049B9C 7F01506C 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 049BA0 7F015070 24060001 */ li $a2, 1 -/* 049BA4 7F015074 0FC026E1 */ jal menu_control_stick_tracking -/* 049BA8 7F015078 00000000 */ nop -/* 049BAC 7F01507C 00002025 */ move $a0, $zero -/* 049BB0 7F015080 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 049BB4 7F015084 3405B000 */ li $a1, 45056 -/* 049BB8 7F015088 10400026 */ beqz $v0, .L7F015124 -/* 049BBC 7F01508C 00008025 */ move $s0, $zero -.L7F015090: -/* 049BC0 7F015090 3C0B8003 */ lui $t3, %hi(scenario) -/* 049BC4 7F015094 8D6BB540 */ lw $t3, %lo(scenario)($t3) -/* 049BC8 7F015098 24010005 */ li $at, 5 -/* 049BCC 7F01509C 5561000E */ bnel $t3, $at, .L7F0150D8 -/* 049BD0 7F0150A0 8E2D0000 */ lw $t5, ($s1) -/* 049BD4 7F0150A4 12000005 */ beqz $s0, .L7F0150BC -/* 049BD8 7F0150A8 00000000 */ nop -/* 049BDC 7F0150AC 8E2C0000 */ lw $t4, ($s1) -/* 049BE0 7F0150B0 24050001 */ li $a1, 1 -/* 049BE4 7F0150B4 160C0003 */ bne $s0, $t4, .L7F0150C4 -/* 049BE8 7F0150B8 00000000 */ nop -.L7F0150BC: -/* 049BEC 7F0150BC 10000001 */ b .L7F0150C4 -/* 049BF0 7F0150C0 00002825 */ move $a1, $zero -.L7F0150C4: -/* 049BF4 7F0150C4 0FC05329 */ jal set_players_team_or_scenario_item_flag -/* 049BF8 7F0150C8 02002025 */ move $a0, $s0 -/* 049BFC 7F0150CC 1000000A */ b .L7F0150F8 -/* 049C00 7F0150D0 26100001 */ addiu $s0, $s0, 1 -/* 049C04 7F0150D4 8E2D0000 */ lw $t5, ($s1) -.L7F0150D8: -/* 049C08 7F0150D8 24050001 */ li $a1, 1 -/* 049C0C 7F0150DC 120D0003 */ beq $s0, $t5, .L7F0150EC -/* 049C10 7F0150E0 00000000 */ nop -/* 049C14 7F0150E4 10000001 */ b .L7F0150EC -/* 049C18 7F0150E8 00002825 */ move $a1, $zero -.L7F0150EC: -/* 049C1C 7F0150EC 0FC05329 */ jal set_players_team_or_scenario_item_flag -/* 049C20 7F0150F0 02002025 */ move $a0, $s0 -/* 049C24 7F0150F4 26100001 */ addiu $s0, $s0, 1 -.L7F0150F8: -/* 049C28 7F0150F8 24010004 */ li $at, 4 -/* 049C2C 7F0150FC 1601FFE4 */ bne $s0, $at, .L7F015090 -/* 049C30 7F015100 00000000 */ nop -/* 049C34 7F015104 2404000E */ li $a0, 14 -/* 049C38 7F015108 0FC06975 */ jal set_menu_to_mode -/* 049C3C 7F01510C 00002825 */ move $a1, $zero -/* 049C40 7F015110 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 049C44 7F015114 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 049C48 7F015118 240500C7 */ li $a1, 199 -/* 049C4C 7F01511C 0C002382 */ jal sndPlaySfx -/* 049C50 7F015120 00003025 */ move $a2, $zero -.L7F015124: -/* 049C54 7F015124 8FBF001C */ lw $ra, 0x1c($sp) -/* 049C58 7F015128 8FB00014 */ lw $s0, 0x14($sp) -/* 049C5C 7F01512C 8FB10018 */ lw $s1, 0x18($sp) -/* 049C60 7F015130 03E00008 */ jr $ra -/* 049C64 7F015134 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif - +// Address 0x7F015138 NTSC #ifdef NONMATCHING -void constructor_menu14_mpteams(s32 arg0) +// https://decomp.me/scratch/N4sd9 99.55% +// Just down to regalloc. Need a break from this one, not sure how much is fake match improvement. +Gfx * constructor_menu14_mpteams(Gfx *DL) { s32 spCC; + s32 i; + s32 var_v0; + s32 temp_s0; + s32 temp_s2; + s32 var_s0; + s32 spB4; + s32 temp_s6; + u8 *text; + s32 var_s2; s32 spA4; s32 spA0; s32 sp9C; s32 sp98; + s32 padding1; s32 sp90; s32 sp8C; s32 sp88; s32 sp84; - s32 temp_ret; - s32 temp_ret_2; - s32 temp_s5; - s32 temp_s6; - u32 temp_s2; - u32 temp_s4; - void *temp_v1; - u32 phi_s4; - s32 phi_v0; - s32 phi_v0_2; - void *phi_s5; - u32 phi_s0; - s32 phi_s1; - s32 phi_s5_2; - void *phi_s5_3; - void *phi_s5_4; - void *phi_s5_5; - u32 phi_v0_3; + s32 padding2; spCC = get_selected_num_players(); - temp_ret = microcode_constructor_related_to_menus(microcode_constructor(sub_GAME_7F00D5E8(viFillScreen(viSetFillColor(arg0, 0, 0, 0)))), 0x26, 0xa9, 0x184, 0xab, 0x90); - phi_s5_5 = temp_ret; + + DL = viSetFillColor(DL,0,0,0); + DL = viFillScreen(DL); + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + + DL = microcode_constructor_related_to_menus(DL, 0x26, 0xA9, 0x184, 0xAB, 0x90); + if (spCC >= 3) { - phi_s5_5 = microcode_constructor_related_to_menus(temp_ret, 0xd4, 0x1e, 0xd6, 0x136, 0x80); + DL = microcode_constructor_related_to_menus(DL, 0xD4, 0x1E, 0xD6, 0x136, 0x80); } - phi_s5_3 = phi_s5_5; - if (spCC > 0) - { - phi_s4 = 0U; - phi_s5 = phi_s5_5; -loop_4: - if (phi_s4 >= 2) - { - phi_v0_2 = 0x8c; - } - else - { - phi_v0_2 = 0; - } - temp_s6 = phi_v0_2 + 0x1e; - if ((phi_s4 & 1) != 0) - { - phi_v0 = 0xaf; - } - else - { - phi_v0 = 0; - } - temp_v1 = phi_s5; - temp_s2 = (u32) phi_s4 < 1U; - temp_s5 = phi_s5 + 8; - temp_v1->unk0 = (s32) (((((s32) ((f32) (phi_v0 + 0x2c) * 4.0f) & 0xfff) << 0xc) | 0xed000000) | ((s32) ((f32) (temp_s6 + 5) * 4.0f) & 0xfff)); - temp_v1->unk4 = (s32) ((((s32) ((f32) (phi_v0 + 0xcf) * 4.0f) & 0xfff) << 0xc) | ((s32) ((f32) (temp_s6 + 0x87) * 4.0f) & 0xfff)); - phi_s5_2 = temp_s5; - if (temp_s2 != 0) - { - temp_ret_2 = langGet(TEXT(LTITLE, 0x58)); - sub_GAME_7F0AE98C(&spA4, &spA0, temp_ret_2, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp9C = (s32) ((phi_v0 + 0x7d) - (spA0 >> 1)); - viGetX(); - phi_s5_2 = write_text_at_abs_coord(temp_s5, &sp9C, &sp98, temp_ret_2, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, 0xff, viGetY(), 0, 0); + + for (i = 0; i < spCC; i++) + { + var_v0 = (i >= 2) ? 0x8C : 0; + temp_s6 = (var_v0) + 0x1E; + + // nonmatching: Problem line. + var_v0 = ((i & 1) ? 0xAF : 0) + 0; + + gDPSetScissor(DL++, G_SC_NON_INTERLACE, (var_v0 + 0x2c), temp_s6 + 5, var_v0 + 0xcf, temp_s6 + 0x87); + + // nonmatching: Problem line ?? + spB4 = var_v0 + 0x7d; + + if (i == 0) + { + text = langGet(0x9C58); + textMeasure(&spA4, &spA0, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp98 = temp_s6 + 5; + sp9C = spB4 - (spA0 >> 1); + + DL = write_text_at_abs_coord(DL, &sp9C, &sp98, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } + if (scenario == 5) { - phi_v0_3 = temp_s2; - if (temp_s2 == 0) - { - phi_v0_3 = (u32) (phi_s4 ^ teamsize) < 1U; - } - phi_s0 = phi_v0_3; - } - else - { - phi_s0 = 0U < (u32) (phi_s4 ^ teamsize); - } - if (phi_s0 != 0) - { - phi_s1 = langGet(TEXT(LTITLE, 0x59)); + var_s0 = i == 0 || i == teamsize; } else { - phi_s1 = langGet(TEXT(LTITLE, 0x5a)); - } - if (phi_s0 != 0) - { - + var_s0 = i != teamsize; } - else - { - } - sub_GAME_7F0AE98C(&sp90, &sp8C, phi_s1, ptrSecondFontTableLarge, (s32) subroutine_arg0, 0); - sp88 = (s32) (spB4 - (sp8C >> 1)); - sp84 = (s32) ((temp_s6 - (sp90 >> 1)) + 0x46); - if ((phi_s4 == teamsize) && (phi_s4 == teamsize)) + text = var_s0 ? langGet(0x9C59) : langGet(0x9C5A); + var_s2 = var_s0 ? -0xFFFF01 : 0xFFFF; + + // nonmatching: Basic block, yes or no ?? + if (1) { - phi_s5_4 = (void *) phi_s5_2; - if (D_8002B560 < 0xa) + textMeasure(&sp90, &sp8C, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp88 = spB4 - (sp8C >> 1); + sp84 = (temp_s6 - (sp90 >> 1)) + 0x46; + + if ((i != teamsize) || ((i == teamsize) && (D_8002B560 < 0xA))) { -block_26: - viGetX(); - phi_s5_4 = write_text_at_abs_coord(phi_s5_2, &sp88, &sp84, phi_s1, (s32) ptrSecondFontTableLarge, (s32) subroutine_arg0, viGetY(), 0, 0); - } - } - else - { - goto block_26; - } - temp_s4 = phi_s4 + 1; - phi_s4 = temp_s4; - phi_s5 = phi_s5_4; - phi_s5_3 = phi_s5_4; - if (temp_s4 != spCC) - { - goto loop_4; + DL = write_text_at_abs_coord(DL, &sp88, &sp84, text, ptrFontZurichBoldChars, ptrFontZurichBold, var_s2, viGetX(), viGetY(), 0, 0); + } } } - combiner_bayer_lod_perspective(phi_s5_3); + + DL = combiner_bayer_lod_perspective(DL); + + return DL; } + #else GLOBAL_ASM( .text @@ -17346,11 +6952,11 @@ glabel constructor_menu14_mpteams /* 049D30 7F015200 0000A025 */ move $s4, $zero /* 049D34 7F015204 3C014080 */ li $at, 0x40800000 # 4.000000 /* 049D38 7F015208 192000B2 */ blez $t1, .L7F0154D4 -/* 049D3C 7F01520C 3C178004 */ lui $s7, %hi(ptrSecondFontTableLarge) -/* 049D40 7F015210 3C1E8004 */ lui $fp, %hi(ptrFirstFontTableLarge) +/* 049D3C 7F01520C 3C178004 */ lui $s7, %hi(ptrFontZurichBoldChars) +/* 049D40 7F015210 3C1E8004 */ lui $fp, %hi(ptrFontZurichBold) /* 049D44 7F015214 4481A000 */ mtc1 $at, $f20 -/* 049D48 7F015218 27DE0EB4 */ addiu $fp, %lo(ptrFirstFontTableLarge) # addiu $fp, $fp, 0xeb4 -/* 049D4C 7F01521C 26F70EB8 */ addiu $s7, %lo(ptrSecondFontTableLarge) # addiu $s7, $s7, 0xeb8 +/* 049D48 7F015218 27DE0EB4 */ addiu $fp, %lo(ptrFontZurichBold) # addiu $fp, $fp, 0xeb4 +/* 049D4C 7F01521C 26F70EB8 */ addiu $s7, %lo(ptrFontZurichBoldChars) # addiu $s7, $s7, 0xeb8 /* 049D50 7F015220 2A810002 */ slti $at, $s4, 2 .L7F015224: /* 049D54 7F015224 14200003 */ bnez $at, .L7F015234 @@ -17418,7 +7024,7 @@ glabel constructor_menu14_mpteams /* 049E3C 7F01530C 00403025 */ move $a2, $v0 /* 049E40 7F015310 8EE70000 */ lw $a3, ($s7) /* 049E44 7F015314 AFA00014 */ sw $zero, 0x14($sp) -/* 049E48 7F015318 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 049E48 7F015318 0FC2BA63 */ jal textMeasure /* 049E4C 7F01531C AFAB0010 */ sw $t3, 0x10($sp) /* 049E50 7F015320 8FAC00A0 */ lw $t4, 0xa0($sp) /* 049E54 7F015324 AFB00098 */ sw $s0, 0x98($sp) @@ -17491,7 +7097,7 @@ glabel constructor_menu14_mpteams /* 049F40 7F015410 02203025 */ move $a2, $s1 /* 049F44 7F015414 8EE70000 */ lw $a3, ($s7) /* 049F48 7F015418 AFA00014 */ sw $zero, 0x14($sp) -/* 049F4C 7F01541C 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 049F4C 7F01541C 0FC2BA63 */ jal textMeasure /* 049F50 7F015420 AFAC0010 */ sw $t4, 0x10($sp) /* 049F54 7F015424 8FB80090 */ lw $t8, 0x90($sp) /* 049F58 7F015428 8FAE008C */ lw $t6, 0x8c($sp) @@ -17573,89 +7179,36 @@ void set_briefing_page(WATCH_BRIEFING_PAGE page) } - -#ifdef NONMATCHING -s32 load_briefing_text_for_stage(void) { - //s32 sp20; +// Address 0x7F015520 NTSC +void load_briefing_text_for_stage(void) +{ Gfx *temp_s0; - s32 i; - struct BriefingData *pbriefdata; - - temp_s0 = ptr_logo_and_walletbond_DL + 0xA000; - ptrbriefingdata = _load_resource_named_to_buffer(mission_folder_setup_entries[briefingpage].briefing_name_ptr, 1, temp_s0, 0x200); - //sp20 = 0x6DE00; - load_briefing_text_bank(get_textbank_number_for_stagenum(mission_folder_setup_entries[briefingpage].stage_id, temp_s0 + 0x200, 0x6DE00)); - pbriefdata = ptrbriefingdata; - for(i = 0; i!= 0x28;i++) + s32 argg; + + // what is this + temp_s0 = (s32)(ptr_logo_and_walletbond_DL) + (s32)(4096*10); + + // alright + argg = 0x200; + ptrbriefingdata = _fileNameLoadToAddr(mission_folder_setup_entries[briefingpage].briefing_name_ptr, FILELOADMETHOD_DEFAULT, (u8 *) temp_s0, argg); + + // what is this + temp_s0 += argg / 8; + + // what is this + argg *= 879; + + langLoadToBank(langGetLangBankIndexFromStagenum(mission_folder_setup_entries[briefingpage].stage_id), (u8 *)temp_s0, argg); + + // what is this + for (argg = 0; argg < OBJECTIVES_MAX; argg++) { - if (pbriefdata[i].datas[0] != 0) { - break; + if (ptrbriefingdata->objective[argg].textid == 0) + { + break; } } - return i; } -#else -GLOBAL_ASM( -.text -glabel load_briefing_text_for_stage -/* 04A050 7F015520 3C0E8003 */ lui $t6, %hi(briefingpage) -/* 04A054 7F015524 8DCEA8F8 */ lw $t6, %lo(briefingpage)($t6) -/* 04A058 7F015528 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 04A05C 7F01552C AFB00018 */ sw $s0, 0x18($sp) -/* 04A060 7F015530 3C108003 */ lui $s0, %hi(ptr_logo_and_walletbond_DL) -/* 04A064 7F015534 8E10A950 */ lw $s0, %lo(ptr_logo_and_walletbond_DL)($s0) -/* 04A068 7F015538 000E78C0 */ sll $t7, $t6, 3 -/* 04A06C 7F01553C 01EE7823 */ subu $t7, $t7, $t6 -/* 04A070 7F015540 3401A000 */ li $at, 40960 -/* 04A074 7F015544 000F7880 */ sll $t7, $t7, 2 -/* 04A078 7F015548 3C048003 */ lui $a0, %hi(mission_folder_setup_entries+24) -/* 04A07C 7F01554C AFBF001C */ sw $ra, 0x1c($sp) -/* 04A080 7F015550 008F2021 */ addu $a0, $a0, $t7 -/* 04A084 7F015554 02018021 */ addu $s0, $s0, $at -/* 04A088 7F015558 02003025 */ move $a2, $s0 -/* 04A08C 7F01555C 8C84ABFC */ lw $a0, %lo(mission_folder_setup_entries+24)($a0) -/* 04A090 7F015560 24050001 */ li $a1, 1 -/* 04A094 7F015564 0FC2F350 */ jal _load_resource_named_to_buffer -/* 04A098 7F015568 24070200 */ li $a3, 512 -/* 04A09C 7F01556C 3C198003 */ lui $t9, %hi(briefingpage) -/* 04A0A0 7F015570 8F39A8F8 */ lw $t9, %lo(briefingpage)($t9) -/* 04A0A4 7F015574 3C180006 */ lui $t8, (0x0006DE00 >> 16) # lui $t8, 6 -/* 04A0A8 7F015578 3C048003 */ lui $a0, %hi(mission_folder_setup_entries+8) -/* 04A0AC 7F01557C 001940C0 */ sll $t0, $t9, 3 -/* 04A0B0 7F015580 01194023 */ subu $t0, $t0, $t9 -/* 04A0B4 7F015584 00084080 */ sll $t0, $t0, 2 -/* 04A0B8 7F015588 3C018007 */ lui $at, %hi(ptrbriefingdata) -/* 04A0BC 7F01558C 3718DE00 */ ori $t8, (0x0006DE00 & 0xFFFF) # ori $t8, $t8, 0xde00 -/* 04A0C0 7F015590 00882021 */ addu $a0, $a0, $t0 -/* 04A0C4 7F015594 AC22978C */ sw $v0, %lo(ptrbriefingdata)($at) -/* 04A0C8 7F015598 26100200 */ addiu $s0, $s0, 0x200 -/* 04A0CC 7F01559C AFB80020 */ sw $t8, 0x20($sp) -/* 04A0D0 7F0155A0 0FC30578 */ jal get_textbank_number_for_stagenum -/* 04A0D4 7F0155A4 8C84ABEC */ lw $a0, %lo(mission_folder_setup_entries+8)($a0) -/* 04A0D8 7F0155A8 00402025 */ move $a0, $v0 -/* 04A0DC 7F0155AC 02002825 */ move $a1, $s0 -/* 04A0E0 7F0155B0 0FC30759 */ jal load_briefing_text_bank -/* 04A0E4 7F0155B4 8FA60020 */ lw $a2, 0x20($sp) -/* 04A0E8 7F0155B8 3C038007 */ lui $v1, %hi(ptrbriefingdata) -/* 04A0EC 7F0155BC 8C63978C */ lw $v1, %lo(ptrbriefingdata)($v1) -/* 04A0F0 7F0155C0 00001025 */ move $v0, $zero -/* 04A0F4 7F0155C4 24040028 */ li $a0, 40 -.L7F0155C8: -/* 04A0F8 7F0155C8 94690008 */ lhu $t1, 8($v1) -/* 04A0FC 7F0155CC 24420004 */ addiu $v0, $v0, 4 -/* 04A100 7F0155D0 51200004 */ beql $t1, $zero, .L7F0155E4 -/* 04A104 7F0155D4 8FBF001C */ lw $ra, 0x1c($sp) -/* 04A108 7F0155D8 1444FFFB */ bne $v0, $a0, .L7F0155C8 -/* 04A10C 7F0155DC 24630004 */ addiu $v1, $v1, 4 -/* 04A110 7F0155E0 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0155E4: -/* 04A114 7F0155E4 8FB00018 */ lw $s0, 0x18($sp) -/* 04A118 7F0155E8 27BD0028 */ addiu $sp, $sp, 0x28 -/* 04A11C 7F0155EC 03E00008 */ jr $ra -/* 04A120 7F0155F0 00000000 */ nop -) -#endif - //******************************************************************************************************** //BRIEFING SCREEN @@ -17673,7 +7226,7 @@ void init_menu0A_briefing(void) void update_menu0A_briefing(void) { - blank_text_bank(get_textbank_number_for_stagenum(mission_folder_setup_entries[briefingpage].stage_id)); + langClearBank(langGetLangBankIndexFromStagenum(mission_folder_setup_entries[briefingpage].stage_id)); if (-1 < menu_update) { sub_GAME_7F00B990(); } @@ -17682,8 +7235,8 @@ void update_menu0A_briefing(void) void interface_menu0A_briefing(void) { - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); tab_prev_highlight = FALSE; @@ -17750,21 +7303,21 @@ void interface_menu0A_briefing(void) sndPlaySfx(g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0xC, current_menu_briefing_page == BRIEFING_TITLE); - set_item_visibility_in_objinstance(walletinst[0], mission_folder_setup_entries[briefingpage].mission_num + 0x16, current_menu_briefing_page == 0); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 6, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_PHOTOBRIEF, current_menu_briefing_page == BRIEFING_TITLE); + set_item_visibility_in_objinstance(walletinst[0], mission_folder_setup_entries[briefingpage].mission_num + 0x16, current_menu_briefing_page == BRIEFING_TITLE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); menu_control_stick_tracking(); if (tab_next_selected) { - set_menu_to_mode(MENU_RUN_STAGE, 1); + frontChangeMenu(MENU_RUN_STAGE, TRUE); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_MISSION_SELECT, 0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo(mission_folder_setup_entries[briefingpage].mission_num); } } @@ -17772,863 +7325,190 @@ void interface_menu0A_briefing(void) - -#ifdef NONMATCHING -u32 * print_objectives_and_status_to_menu(u32 *param_1,int param_2,u8 *param_3,int param_4) +// Address 0x7F015A08 NTSC +Gfx *print_objectives_and_status_to_menu(Gfx *DL, s32 arg1, u8 *arg2, s32 arg3) { - ushort uVar1; - u8 *pbVar2; - short sVar5; - short sVar6; - u32 *puVar3; - int iVar4; - int iVar7; - u32 uVar8; - int iVar9; - u32 uStack24; - u32 uStack20; - int iStack16; - int iStack12; - int iStack8; - int iStack4; - - iStack8 = 0; - iVar9 = 0; - iStack4 = 0; - iVar7 = 0; - do { - uVar1 = *(ushort *)(ptrbriefingdata + iVar7 + 8); - if (uVar1 == 0) { - iStack4 += 1; - } - else { - if ((s32)selected_difficulty < - (s32)(s32)*(ushort *)(ptrbriefingdata + iVar7 + 10)) { - iStack4 += 1; - } - else { - pbVar2 = langGet((u32)uVar1); - strcpy((char *)param_3,aA_); - *param_3 = *param_3 + (char)iStack8; - iStack12 = 0; - iStack16 = 0; - proc_7F0AE98C(&iStack12,&iStack16,param_3,(int)ptrSecondFontTableLarge,(int *)ptrFirstFontTableLarge,0 - ); - uStack20 = 0x37; - uStack24 = iStack12 * iVar9 + param_2; - sVar5 = viGetX(); - sVar6 = viGetY(); - puVar3 = write_text_at_abs_coord - (param_1,&uStack20,&uStack24,param_3,(int)ptrSecondFontTableLarge, - (int)ptrFirstFontTableLarge,0xff,(int)sVar5,(int)sVar6,0,0); - uStack20 = 0x4b; - uStack24 = iStack12 * iVar9 + param_2; - if (param_4 == 0) { - proc_7F0AEB64(0x140,pbVar2,param_3,(int)ptrSecondFontTableLarge,(int *)ptrFirstFontTableLarge); - } - else { - proc_7F0ACB94(2); - proc_7F0AEB64(0xdc,pbVar2,param_3,(int)ptrSecondFontTableLarge,(int *)ptrFirstFontTableLarge); - proc_7F0ACB94(0); - } - sVar5 = viGetX(); - sVar6 = viGetY(); - param_1 = write_text_at_abs_coord - (puVar3,&uStack20,&uStack24,param_3,(int)ptrSecondFontTableLarge, - (int)ptrFirstFontTableLarge,0xff,(int)sVar5,(int)sVar6,0,0); - if (param_4 != 0) { - iVar4 = get_status_of_objective((s32)iStack4); - if ((iVar4 == 0) || (iVar4 != 1)) { - uVar8 = 0x780000ff; - pbVar2 = langGet(TEXT(LTITLE, 0x5c)); - } - else { - uVar8 = 0xff; - pbVar2 = langGet(TEXT(LTITLE, 0x5b)); - } - uStack20 = 0x136; - uStack24 = iStack12 * iVar9 + param_2; - sVar5 = viGetX(); - sVar6 = viGetY(); - param_1 = write_text_at_abs_coord - (param_1,&uStack20,&uStack24,pbVar2,(int)ptrSecondFontTableLarge, - (int)ptrFirstFontTableLarge,uVar8,(int)sVar5,(int)sVar6,0,0); - } - iVar4 = proc_7F0AC0E8((char *)param_3); - iVar9 += iVar4; - iStack8 += 1; - iStack4 += 1; - } - } - iVar7 += 4; - } while (iStack4 != 10); - return param_1; -} -#else -const char aA_[] = "a.\n"; -GLOBAL_ASM( -.text -glabel print_objectives_and_status_to_menu -/* 04A538 7F015A08 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* 04A53C 7F015A0C AFB5004C */ sw $s5, 0x4c($sp) -/* 04A540 7F015A10 AFB40048 */ sw $s4, 0x48($sp) -/* 04A544 7F015A14 AFBE0058 */ sw $fp, 0x58($sp) -/* 04A548 7F015A18 AFB60050 */ sw $s6, 0x50($sp) -/* 04A54C 7F015A1C AFB30044 */ sw $s3, 0x44($sp) -/* 04A550 7F015A20 3C148004 */ lui $s4, %hi(ptrSecondFontTableLarge) -/* 04A554 7F015A24 3C158004 */ lui $s5, %hi(ptrFirstFontTableLarge) -/* 04A558 7F015A28 00C09825 */ move $s3, $a2 -/* 04A55C 7F015A2C 0080B025 */ move $s6, $a0 -/* 04A560 7F015A30 AFBF005C */ sw $ra, 0x5c($sp) -/* 04A564 7F015A34 AFB70054 */ sw $s7, 0x54($sp) -/* 04A568 7F015A38 AFB20040 */ sw $s2, 0x40($sp) -/* 04A56C 7F015A3C AFB1003C */ sw $s1, 0x3c($sp) -/* 04A570 7F015A40 AFB00038 */ sw $s0, 0x38($sp) -/* 04A574 7F015A44 AFA500A4 */ sw $a1, 0xa4($sp) -/* 04A578 7F015A48 AFA700AC */ sw $a3, 0xac($sp) -/* 04A57C 7F015A4C AFA00098 */ sw $zero, 0x98($sp) -/* 04A580 7F015A50 0000F025 */ move $fp, $zero -/* 04A584 7F015A54 26B50EB4 */ addiu $s5, %lo(ptrFirstFontTableLarge) # addiu $s5, $s5, 0xeb4 -/* 04A588 7F015A58 26940EB8 */ addiu $s4, %lo(ptrSecondFontTableLarge) # addiu $s4, $s4, 0xeb8 -/* 04A58C 7F015A5C 00004025 */ move $t0, $zero -/* 04A590 7F015A60 00004825 */ move $t1, $zero -.L7F015A64: -/* 04A594 7F015A64 3C0E8007 */ lui $t6, %hi(ptrbriefingdata) -/* 04A598 7F015A68 8DCE978C */ lw $t6, %lo(ptrbriefingdata)($t6) -/* 04A59C 7F015A6C 3C0F8003 */ lui $t7, %hi(selected_difficulty) -/* 04A5A0 7F015A70 01C91021 */ addu $v0, $t6, $t1 -/* 04A5A4 7F015A74 94430008 */ lhu $v1, 8($v0) -/* 04A5A8 7F015A78 506000AE */ beql $v1, $zero, .L7F015D34 -/* 04A5AC 7F015A7C 25080001 */ addiu $t0, $t0, 1 -/* 04A5B0 7F015A80 8DEFA8FC */ lw $t7, %lo(selected_difficulty)($t7) -/* 04A5B4 7F015A84 9458000A */ lhu $t8, 0xa($v0) -/* 04A5B8 7F015A88 00602025 */ move $a0, $v1 -/* 04A5BC 7F015A8C 0000B825 */ move $s7, $zero -/* 04A5C0 7F015A90 01F8082A */ slt $at, $t7, $t8 -/* 04A5C4 7F015A94 542000A7 */ bnezl $at, .L7F015D34 -/* 04A5C8 7F015A98 25080001 */ addiu $t0, $t0, 1 -/* 04A5CC 7F015A9C AFA9006C */ sw $t1, 0x6c($sp) -/* 04A5D0 7F015AA0 0FC30776 */ jal langGet -/* 04A5D4 7F015AA4 AFA8009C */ sw $t0, 0x9c($sp) -/* 04A5D8 7F015AA8 3C058005 */ lui $a1, %hi(aA_) -/* 04A5DC 7F015AAC 00408825 */ move $s1, $v0 -/* 04A5E0 7F015AB0 24A50C50 */ addiu $a1, %lo(aA_) # addiu $a1, $a1, 0xc50 -/* 04A5E4 7F015AB4 0C0029DC */ jal strcpy -/* 04A5E8 7F015AB8 02602025 */ move $a0, $s3 -/* 04A5EC 7F015ABC 92790000 */ lbu $t9, ($s3) -/* 04A5F0 7F015AC0 8FAA0098 */ lw $t2, 0x98($sp) -/* 04A5F4 7F015AC4 27A40094 */ addiu $a0, $sp, 0x94 -/* 04A5F8 7F015AC8 27A50090 */ addiu $a1, $sp, 0x90 -/* 04A5FC 7F015ACC 032A5821 */ addu $t3, $t9, $t2 -/* 04A600 7F015AD0 A26B0000 */ sb $t3, ($s3) -/* 04A604 7F015AD4 8EAC0000 */ lw $t4, ($s5) -/* 04A608 7F015AD8 AFA00094 */ sw $zero, 0x94($sp) -/* 04A60C 7F015ADC AFA00090 */ sw $zero, 0x90($sp) -/* 04A610 7F015AE0 AFA00014 */ sw $zero, 0x14($sp) -/* 04A614 7F015AE4 8E870000 */ lw $a3, ($s4) -/* 04A618 7F015AE8 02603025 */ move $a2, $s3 -/* 04A61C 7F015AEC 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04A620 7F015AF0 AFAC0010 */ sw $t4, 0x10($sp) -/* 04A624 7F015AF4 8FAE0094 */ lw $t6, 0x94($sp) -/* 04A628 7F015AF8 8FB800A4 */ lw $t8, 0xa4($sp) -/* 04A62C 7F015AFC 240D0037 */ li $t5, 55 -/* 04A630 7F015B00 01DE0019 */ multu $t6, $fp -/* 04A634 7F015B04 AFAD008C */ sw $t5, 0x8c($sp) -/* 04A638 7F015B08 00007812 */ mflo $t7 -/* 04A63C 7F015B0C 01F8C821 */ addu $t9, $t7, $t8 -/* 04A640 7F015B10 03375021 */ addu $t2, $t9, $s7 -/* 04A644 7F015B14 0C001107 */ jal viGetX -/* 04A648 7F015B18 AFAA0088 */ sw $t2, 0x88($sp) -/* 04A64C 7F015B1C 00028400 */ sll $s0, $v0, 0x10 -/* 04A650 7F015B20 00105C03 */ sra $t3, $s0, 0x10 -/* 04A654 7F015B24 0C00110B */ jal viGetY -/* 04A658 7F015B28 01608025 */ move $s0, $t3 -/* 04A65C 7F015B2C 8E8C0000 */ lw $t4, ($s4) -/* 04A660 7F015B30 8EAD0000 */ lw $t5, ($s5) -/* 04A664 7F015B34 240E00FF */ li $t6, 255 -/* 04A668 7F015B38 AFAE0018 */ sw $t6, 0x18($sp) -/* 04A66C 7F015B3C 02C02025 */ move $a0, $s6 -/* 04A670 7F015B40 27A5008C */ addiu $a1, $sp, 0x8c -/* 04A674 7F015B44 27A60088 */ addiu $a2, $sp, 0x88 -/* 04A678 7F015B48 02603825 */ move $a3, $s3 -/* 04A67C 7F015B4C AFB0001C */ sw $s0, 0x1c($sp) -/* 04A680 7F015B50 AFA20020 */ sw $v0, 0x20($sp) -/* 04A684 7F015B54 AFA00024 */ sw $zero, 0x24($sp) -/* 04A688 7F015B58 AFA00028 */ sw $zero, 0x28($sp) -/* 04A68C 7F015B5C AFAC0010 */ sw $t4, 0x10($sp) -/* 04A690 7F015B60 0FC025D8 */ jal write_text_at_abs_coord -/* 04A694 7F015B64 AFAD0014 */ sw $t5, 0x14($sp) -/* 04A698 7F015B68 8FB80094 */ lw $t8, 0x94($sp) -/* 04A69C 7F015B6C 8FAA00A4 */ lw $t2, 0xa4($sp) -/* 04A6A0 7F015B70 8FAD00AC */ lw $t5, 0xac($sp) -/* 04A6A4 7F015B74 031E0019 */ multu $t8, $fp -/* 04A6A8 7F015B78 240F004B */ li $t7, 75 -/* 04A6AC 7F015B7C 0040B025 */ move $s6, $v0 -/* 04A6B0 7F015B80 AFAF008C */ sw $t7, 0x8c($sp) -/* 04A6B4 7F015B84 24040140 */ li $a0, 320 -/* 04A6B8 7F015B88 02202825 */ move $a1, $s1 -/* 04A6BC 7F015B8C 02603025 */ move $a2, $s3 -/* 04A6C0 7F015B90 0000C812 */ mflo $t9 -/* 04A6C4 7F015B94 032A5821 */ addu $t3, $t9, $t2 -/* 04A6C8 7F015B98 01776021 */ addu $t4, $t3, $s7 -/* 04A6CC 7F015B9C 11A0000E */ beqz $t5, .L7F015BD8 -/* 04A6D0 7F015BA0 AFAC0088 */ sw $t4, 0x88($sp) -/* 04A6D4 7F015BA4 0FC2B2E5 */ jal setTextWordWrap -/* 04A6D8 7F015BA8 24040002 */ li $a0, 2 -/* 04A6DC 7F015BAC 8EAE0000 */ lw $t6, ($s5) -/* 04A6E0 7F015BB0 240400DC */ li $a0, 220 -/* 04A6E4 7F015BB4 02202825 */ move $a1, $s1 -/* 04A6E8 7F015BB8 02603025 */ move $a2, $s3 -/* 04A6EC 7F015BBC 8E870000 */ lw $a3, ($s4) -/* 04A6F0 7F015BC0 0FC2BAD9 */ jal sub_GAME_7F0AEB64 -/* 04A6F4 7F015BC4 AFAE0010 */ sw $t6, 0x10($sp) -/* 04A6F8 7F015BC8 0FC2B2E5 */ jal setTextWordWrap -/* 04A6FC 7F015BCC 00002025 */ move $a0, $zero -/* 04A700 7F015BD0 10000005 */ b .L7F015BE8 -/* 04A704 7F015BD4 00000000 */ nop -.L7F015BD8: -/* 04A708 7F015BD8 8EAF0000 */ lw $t7, ($s5) -/* 04A70C 7F015BDC 8E870000 */ lw $a3, ($s4) -/* 04A710 7F015BE0 0FC2BAD9 */ jal sub_GAME_7F0AEB64 -/* 04A714 7F015BE4 AFAF0010 */ sw $t7, 0x10($sp) -.L7F015BE8: -/* 04A718 7F015BE8 0C001107 */ jal viGetX -/* 04A71C 7F015BEC 00000000 */ nop -/* 04A720 7F015BF0 00028400 */ sll $s0, $v0, 0x10 -/* 04A724 7F015BF4 0010C403 */ sra $t8, $s0, 0x10 -/* 04A728 7F015BF8 0C00110B */ jal viGetY -/* 04A72C 7F015BFC 03008025 */ move $s0, $t8 -/* 04A730 7F015C00 8E990000 */ lw $t9, ($s4) -/* 04A734 7F015C04 8EAA0000 */ lw $t2, ($s5) -/* 04A738 7F015C08 240B00FF */ li $t3, 255 -/* 04A73C 7F015C0C AFAB0018 */ sw $t3, 0x18($sp) -/* 04A740 7F015C10 02C02025 */ move $a0, $s6 -/* 04A744 7F015C14 27A5008C */ addiu $a1, $sp, 0x8c -/* 04A748 7F015C18 27A60088 */ addiu $a2, $sp, 0x88 -/* 04A74C 7F015C1C 02603825 */ move $a3, $s3 -/* 04A750 7F015C20 AFB0001C */ sw $s0, 0x1c($sp) -/* 04A754 7F015C24 AFA20020 */ sw $v0, 0x20($sp) -/* 04A758 7F015C28 AFA00024 */ sw $zero, 0x24($sp) -/* 04A75C 7F015C2C AFA00028 */ sw $zero, 0x28($sp) -/* 04A760 7F015C30 AFB90010 */ sw $t9, 0x10($sp) -/* 04A764 7F015C34 0FC025D8 */ jal write_text_at_abs_coord -/* 04A768 7F015C38 AFAA0014 */ sw $t2, 0x14($sp) -/* 04A76C 7F015C3C 8FAC00AC */ lw $t4, 0xac($sp) -/* 04A770 7F015C40 0040B025 */ move $s6, $v0 -/* 04A774 7F015C44 11800032 */ beqz $t4, .L7F015D10 -/* 04A778 7F015C48 00000000 */ nop -/* 04A77C 7F015C4C 0FC15C8E */ jal get_status_of_objective -/* 04A780 7F015C50 8FA4009C */ lw $a0, 0x9c($sp) -/* 04A784 7F015C54 1040000C */ beqz $v0, .L7F015C88 -/* 04A788 7F015C58 24010001 */ li $at, 1 -/* 04A78C 7F015C5C 10410006 */ beq $v0, $at, .L7F015C78 -/* 04A790 7F015C60 34049C5B */ li $a0, 40027 -/* 04A794 7F015C64 24010002 */ li $at, 2 -/* 04A798 7F015C68 50410008 */ beql $v0, $at, .L7F015C8C -/* 04A79C 7F015C6C 3C127800 */ lui $s2, 0x7800 -/* 04A7A0 7F015C70 10000006 */ b .L7F015C8C -/* 04A7A4 7F015C74 3C127800 */ lui $s2, 0x7800 -.L7F015C78: -/* 04A7A8 7F015C78 0FC30776 */ jal langGet -/* 04A7AC 7F015C7C 241200FF */ li $s2, 255 -/* 04A7B0 7F015C80 10000006 */ b .L7F015C9C -/* 04A7B4 7F015C84 00408825 */ move $s1, $v0 -.L7F015C88: -/* 04A7B8 7F015C88 3C127800 */ lui $s2, (0x780000FF >> 16) # lui $s2, 0x7800 -.L7F015C8C: -/* 04A7BC 7F015C8C 365200FF */ ori $s2, (0x780000FF & 0xFFFF) # ori $s2, $s2, 0xff -/* 04A7C0 7F015C90 0FC30776 */ jal langGet -/* 04A7C4 7F015C94 34049C5C */ li $a0, 40028 -/* 04A7C8 7F015C98 00408825 */ move $s1, $v0 -.L7F015C9C: -/* 04A7CC 7F015C9C 8FAE0094 */ lw $t6, 0x94($sp) -/* 04A7D0 7F015CA0 8FB800A4 */ lw $t8, 0xa4($sp) -/* 04A7D4 7F015CA4 240D0136 */ li $t5, 310 -/* 04A7D8 7F015CA8 01DE0019 */ multu $t6, $fp -/* 04A7DC 7F015CAC AFAD008C */ sw $t5, 0x8c($sp) -/* 04A7E0 7F015CB0 00007812 */ mflo $t7 -/* 04A7E4 7F015CB4 01F8C821 */ addu $t9, $t7, $t8 -/* 04A7E8 7F015CB8 03375021 */ addu $t2, $t9, $s7 -/* 04A7EC 7F015CBC 0C001107 */ jal viGetX -/* 04A7F0 7F015CC0 AFAA0088 */ sw $t2, 0x88($sp) -/* 04A7F4 7F015CC4 00028400 */ sll $s0, $v0, 0x10 -/* 04A7F8 7F015CC8 00105C03 */ sra $t3, $s0, 0x10 -/* 04A7FC 7F015CCC 0C00110B */ jal viGetY -/* 04A800 7F015CD0 01608025 */ move $s0, $t3 -/* 04A804 7F015CD4 8E8C0000 */ lw $t4, ($s4) -/* 04A808 7F015CD8 8EAD0000 */ lw $t5, ($s5) -/* 04A80C 7F015CDC 02C02025 */ move $a0, $s6 -/* 04A810 7F015CE0 27A5008C */ addiu $a1, $sp, 0x8c -/* 04A814 7F015CE4 27A60088 */ addiu $a2, $sp, 0x88 -/* 04A818 7F015CE8 02203825 */ move $a3, $s1 -/* 04A81C 7F015CEC AFB20018 */ sw $s2, 0x18($sp) -/* 04A820 7F015CF0 AFB0001C */ sw $s0, 0x1c($sp) -/* 04A824 7F015CF4 AFA20020 */ sw $v0, 0x20($sp) -/* 04A828 7F015CF8 AFA00024 */ sw $zero, 0x24($sp) -/* 04A82C 7F015CFC AFA00028 */ sw $zero, 0x28($sp) -/* 04A830 7F015D00 AFAC0010 */ sw $t4, 0x10($sp) -/* 04A834 7F015D04 0FC025D8 */ jal write_text_at_abs_coord -/* 04A838 7F015D08 AFAD0014 */ sw $t5, 0x14($sp) -/* 04A83C 7F015D0C 0040B025 */ move $s6, $v0 -.L7F015D10: -/* 04A840 7F015D10 0FC2B03A */ jal sub_GAME_7F0AC0E8 -/* 04A844 7F015D14 02602025 */ move $a0, $s3 -/* 04A848 7F015D18 8FAE0098 */ lw $t6, 0x98($sp) -/* 04A84C 7F015D1C 03C2F021 */ addu $fp, $fp, $v0 -/* 04A850 7F015D20 8FA9006C */ lw $t1, 0x6c($sp) -/* 04A854 7F015D24 25CF0001 */ addiu $t7, $t6, 1 -/* 04A858 7F015D28 AFAF0098 */ sw $t7, 0x98($sp) -/* 04A85C 7F015D2C 8FA8009C */ lw $t0, 0x9c($sp) -/* 04A860 7F015D30 25080001 */ addiu $t0, $t0, 1 -.L7F015D34: -/* 04A864 7F015D34 2401000A */ li $at, 10 -/* 04A868 7F015D38 1501FF4A */ bne $t0, $at, .L7F015A64 -/* 04A86C 7F015D3C 25290004 */ addiu $t1, $t1, 4 -/* 04A870 7F015D40 8FBF005C */ lw $ra, 0x5c($sp) -/* 04A874 7F015D44 02C01025 */ move $v0, $s6 -/* 04A878 7F015D48 8FB60050 */ lw $s6, 0x50($sp) -/* 04A87C 7F015D4C 8FB00038 */ lw $s0, 0x38($sp) -/* 04A880 7F015D50 8FB1003C */ lw $s1, 0x3c($sp) -/* 04A884 7F015D54 8FB20040 */ lw $s2, 0x40($sp) -/* 04A888 7F015D58 8FB30044 */ lw $s3, 0x44($sp) -/* 04A88C 7F015D5C 8FB40048 */ lw $s4, 0x48($sp) -/* 04A890 7F015D60 8FB5004C */ lw $s5, 0x4c($sp) -/* 04A894 7F015D64 8FB70054 */ lw $s7, 0x54($sp) -/* 04A898 7F015D68 8FBE0058 */ lw $fp, 0x58($sp) -/* 04A89C 7F015D6C 03E00008 */ jr $ra -/* 04A8A0 7F015D70 27BD00A0 */ addiu $sp, $sp, 0xa0 -) -#endif + s32 i; // sp9C + s32 sp98; + s32 sp94; + s32 sp90; + s32 sp8C; + s32 sp88; + s32 var_s2; + s32 var_fp; + u8* text; + s32 v1; + + sp98 = 0; + var_fp = 0; + i = 0; + v1 = 0; + + for (i = 0; i < OBJECTIVES_MAX; i++) + { + if (ptrbriefingdata->objective[i].textid != 0 && selected_difficulty >= ptrbriefingdata->objective[i].enabled_difficulty) + { + v1 = ptrbriefingdata->objective[i].textid; + text = langGet(v1); + strcpy((u8*)arg2, "a.\n"); + *arg2 = *arg2 + sp98; + sp94 = 0; + sp90 = 0; + textMeasure(&sp94, &sp90, (u8*)arg2, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp8C = 0x37; + sp88 = (sp94 * var_fp) + arg1 + (i*0); + DL = write_text_at_abs_coord(DL, &sp8C, &sp88, (s8*)arg2, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); -#ifdef NONMATCHING -s32 constructor_menu0A_briefing(s32 *param_1) -{ - s32 *puVar1; - s32 *DL; - u32 *puVar2; - short sVar4; - short sVar5; - s32 uVar3; - s32 *puVar6; - s32 *puVar7; - s32 auStack3012 [750]; - u32 uStack12; - u32 uStack8; - u8 *pbStack4; - - puVar1 = viSetFillColor(param_1,0,0,0); - puVar1 = viFillScreen(puVar1); - DL = (s32 *)sub_GAME_7F00D5E8(puVar1); - puVar1 = (s32 *)array_80050C54; - puVar6 = auStack3012; - do { - puVar7 = puVar1 + 3; - *puVar6 = *puVar1; - puVar6[1] = puVar1[1]; - puVar6[2] = puVar1[2]; - puVar1 = puVar7; - puVar6 = puVar6 + 3; - } while (puVar7 != (s32 *)a02d02d); - puVar2 = microcode_constructor(DL); - puVar2 = print_current_solo_briefing_stage_name(puVar2,(u8 *)auStack3012); - switch(current_menu_briefing_page) { - case BRIEFING_TITLE: - pbStack4 = langGet(TEXT(LTITLE, 0x5d)); - break; - case BRIEFING_OVERVIEW: - pbStack4 = langGet(TEXT(LTITLE, 0x5e)); - break; - case BRIEFING_M: - pbStack4 = langGet(TEXT(LTITLE, 0x5f)); - break; - case BRIEFING_Q: - pbStack4 = langGet(TEXT(LTITLE, 0x60)); - break; - case BRIEFING_MONEYPENNY: - pbStack4 = langGet(TEXT(LTITLE, 0x61)); - } - uStack8 = 0x37; - uStack12 = 0x8f; - sVar4 = viGetX(); - sVar5 = viGetY(); - puVar2 = write_text_at_abs_coord - (puVar2,&uStack8,&uStack12,pbStack4,(int)ptrSecondFontTableLarge, - (int)ptrFirstFontTableLarge,0xff,(int)sVar4,(int)sVar5,0,0); - if (current_menu_briefing_page == BRIEFING_TITLE) { - puVar2 = print_objectives_and_status_to_menu(puVar2,0xa7,(u8 *)auStack3012,0); - } - else { - if (current_menu_briefing_page == BRIEFING_OVERVIEW) { - pbStack4 = langGet((u32)*(ushort *)ptrbriefingdata); - } - else { - if (current_menu_briefing_page == BRIEFING_M) { - pbStack4 = langGet((u32)*(ushort *)(ptrbriefingdata + 2)); - } - else { - if (current_menu_briefing_page == BRIEFING_Q) { - pbStack4 = langGet((u32)*(ushort *)(ptrbriefingdata + 4)); - } - else { - if (current_menu_briefing_page == BRIEFING_MONEYPENNY) { - pbStack4 = langGet((u32)*(ushort *)(ptrbriefingdata + 6)); - } + sp8C = 0x4B; + sp88 = (sp94 * var_fp) + arg1 + (i*0); + + if (arg3 != 0) + { + setTextWordWrap(2); + sub_GAME_7F0AEB64(0xDC, (s8*)text, (s8*)arg2, ptrFontZurichBoldChars, ptrFontZurichBold); + setTextWordWrap(0); + } + else + { + sub_GAME_7F0AEB64(0x140, (s8*)text, (s8*)arg2, ptrFontZurichBoldChars, ptrFontZurichBold); + } + + DL = write_text_at_abs_coord(DL, &sp8C, &sp88, (s8*)arg2, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + if (arg3) + { + switch (get_status_of_objective(i)) + { + case 1: + text = langGet(0x9C5BU); + var_s2 = 0xFF; + break; + default: + case 0: + case 2: + text = langGet(0x9C5CU); + var_s2 = 0x780000FF; + break; + } + + sp8C = 0x136; + sp88 = (sp94 * var_fp) + arg1 + (i*0); + + DL = write_text_at_abs_coord(DL, &sp8C, &sp88, (s8*)text, ptrFontZurichBoldChars, ptrFontZurichBold, var_s2, viGetX(), viGetY(), 0, 0); + } + + var_fp += sub_GAME_7F0AC0E8(arg2); + sp98++; } - } - } - uStack8 = 0x37; - uStack12 = 0xa7; - proc_7F0AEB64(0x140,pbStack4,(u8 *)auStack3012,(int)ptrSecondFontTableLarge, - (int *)ptrFirstFontTableLarge); - proc_7F0ACBA0(8); - sVar4 = viGetX(); - sVar5 = viGetY(); - puVar2 = write_text_at_abs_coord - (puVar2,&uStack8,&uStack12,(u8 *)auStack3012,(int)ptrSecondFontTableLarge, - (int)ptrFirstFontTableLarge,0xff,(int)sVar4,(int)sVar5,0,0); - proc_7F0ACBA0(0xffffffff); - } - puVar2 = add_tab1_start(puVar2); - puVar2 = add_tab3_previous(puVar2); - if ((int)current_menu_briefing_page < 4) { - puVar2 = add_tab2_next(puVar2); - } - uVar3 = load_draw_selected_icon_folder_select(puVar2); - return uVar3; + } + + return DL; } -#else +// Address 0x7F015D74 NTSC #ifndef VERSION_EU -const char asc_D_80050C54[3000] = {0xA,0}; -GLOBAL_ASM( -.late_rodata -glabel jpt_briefingpage_name - .word .L7F015E14 - .word .L7F015E24 - .word .L7F015E34 - .word .L7F015E44 - .word .L7F015E54 - -.text -glabel constructor_menu0A_briefing -/* 04A8A4 7F015D74 27BDF3F0 */ addiu $sp, $sp, -0xc10 -/* 04A8A8 7F015D78 AFBF003C */ sw $ra, 0x3c($sp) -/* 04A8AC 7F015D7C AFB00038 */ sw $s0, 0x38($sp) -/* 04A8B0 7F015D80 00002825 */ move $a1, $zero -/* 04A8B4 7F015D84 00003025 */ move $a2, $zero -/* 04A8B8 7F015D88 0C0011B4 */ jal viSetFillColor -/* 04A8BC 7F015D8C 00003825 */ move $a3, $zero -/* 04A8C0 7F015D90 0C000FBE */ jal viFillScreen -/* 04A8C4 7F015D94 00402025 */ move $a0, $v0 -/* 04A8C8 7F015D98 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 04A8CC 7F015D9C 00402025 */ move $a0, $v0 -/* 04A8D0 7F015DA0 3C0F8005 */ lui $t7, %hi(asc_D_80050C54) -/* 04A8D4 7F015DA4 25EF0C54 */ addiu $t7, %lo(asc_D_80050C54) # addiu $t7, $t7, 0xc54 -/* 04A8D8 7F015DA8 25E80BB8 */ addiu $t0, $t7, 0xbb8 -/* 04A8DC 7F015DAC 27AE004C */ addiu $t6, $sp, 0x4c -.L7F015DB0: -/* 04A8E0 7F015DB0 8DE10000 */ lw $at, ($t7) -/* 04A8E4 7F015DB4 25EF000C */ addiu $t7, $t7, 0xc -/* 04A8E8 7F015DB8 25CE000C */ addiu $t6, $t6, 0xc -/* 04A8EC 7F015DBC ADC1FFF4 */ sw $at, -0xc($t6) -/* 04A8F0 7F015DC0 8DE1FFF8 */ lw $at, -8($t7) -/* 04A8F4 7F015DC4 ADC1FFF8 */ sw $at, -8($t6) -/* 04A8F8 7F015DC8 8DE1FFFC */ lw $at, -4($t7) -/* 04A8FC 7F015DCC 15E8FFF8 */ bne $t7, $t0, .L7F015DB0 -/* 04A900 7F015DD0 ADC1FFFC */ sw $at, -4($t6) -/* 04A904 7F015DD4 0FC2B366 */ jal microcode_constructor -/* 04A908 7F015DD8 00402025 */ move $a0, $v0 -/* 04A90C 7F015DDC 00402025 */ move $a0, $v0 -/* 04A910 7F015DE0 0FC03AAF */ jal print_current_solo_briefing_stage_name -/* 04A914 7F015DE4 27A5004C */ addiu $a1, $sp, 0x4c -/* 04A918 7F015DE8 3C098003 */ lui $t1, %hi(current_menu_briefing_page) -/* 04A91C 7F015DEC 8D29A914 */ lw $t1, %lo(current_menu_briefing_page)($t1) -/* 04A920 7F015DF0 00408025 */ move $s0, $v0 -/* 04A924 7F015DF4 2D210005 */ sltiu $at, $t1, 5 -/* 04A928 7F015DF8 10200019 */ beqz $at, .L7F015E60 -/* 04A92C 7F015DFC 00094880 */ sll $t1, $t1, 2 -/* 04A930 7F015E00 3C018005 */ lui $at, %hi(jpt_briefingpage_name) -/* 04A934 7F015E04 00290821 */ addu $at, $at, $t1 -/* 04A938 7F015E08 8C291AC0 */ lw $t1, %lo(jpt_briefingpage_name)($at) -/* 04A93C 7F015E0C 01200008 */ jr $t1 -/* 04A940 7F015E10 00000000 */ nop -.L7F015E14: -/* 04A944 7F015E14 0FC30776 */ jal langGet -/* 04A948 7F015E18 34049C5D */ li $a0, 40029 -/* 04A94C 7F015E1C 10000010 */ b .L7F015E60 -/* 04A950 7F015E20 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015E24: -/* 04A954 7F015E24 0FC30776 */ jal langGet -/* 04A958 7F015E28 34049C5E */ li $a0, 40030 -/* 04A95C 7F015E2C 1000000C */ b .L7F015E60 -/* 04A960 7F015E30 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015E34: -/* 04A964 7F015E34 0FC30776 */ jal langGet -/* 04A968 7F015E38 34049C5F */ li $a0, 40031 -/* 04A96C 7F015E3C 10000008 */ b .L7F015E60 -/* 04A970 7F015E40 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015E44: -/* 04A974 7F015E44 0FC30776 */ jal langGet -/* 04A978 7F015E48 34049C60 */ li $a0, 40032 -/* 04A97C 7F015E4C 10000004 */ b .L7F015E60 -/* 04A980 7F015E50 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015E54: -/* 04A984 7F015E54 0FC30776 */ jal langGet -/* 04A988 7F015E58 34049C61 */ li $a0, 40033 -/* 04A98C 7F015E5C AFA20C0C */ sw $v0, 0xc0c($sp) -def_7F015E0C: -.L7F015E60: -/* 04A990 7F015E60 240A0037 */ li $t2, 55 -/* 04A994 7F015E64 240B008F */ li $t3, 143 -/* 04A998 7F015E68 AFAA0C08 */ sw $t2, 0xc08($sp) -/* 04A99C 7F015E6C 0C001107 */ jal viGetX -/* 04A9A0 7F015E70 AFAB0C04 */ sw $t3, 0xc04($sp) -/* 04A9A4 7F015E74 0C00110B */ jal viGetY -/* 04A9A8 7F015E78 A7A20048 */ sh $v0, 0x48($sp) -/* 04A9AC 7F015E7C 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableLarge) -/* 04A9B0 7F015E80 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 04A9B4 7F015E84 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) -/* 04A9B8 7F015E88 8D8C0EB8 */ lw $t4, %lo(ptrSecondFontTableLarge)($t4) -/* 04A9BC 7F015E8C 87B80048 */ lh $t8, 0x48($sp) -/* 04A9C0 7F015E90 241900FF */ li $t9, 255 -/* 04A9C4 7F015E94 AFB90018 */ sw $t9, 0x18($sp) -/* 04A9C8 7F015E98 02002025 */ move $a0, $s0 -/* 04A9CC 7F015E9C 27A50C08 */ addiu $a1, $sp, 0xc08 -/* 04A9D0 7F015EA0 27A60C04 */ addiu $a2, $sp, 0xc04 -/* 04A9D4 7F015EA4 8FA70C0C */ lw $a3, 0xc0c($sp) -/* 04A9D8 7F015EA8 AFA20020 */ sw $v0, 0x20($sp) -/* 04A9DC 7F015EAC AFA00024 */ sw $zero, 0x24($sp) -/* 04A9E0 7F015EB0 AFA00028 */ sw $zero, 0x28($sp) -/* 04A9E4 7F015EB4 AFAD0014 */ sw $t5, 0x14($sp) -/* 04A9E8 7F015EB8 AFAC0010 */ sw $t4, 0x10($sp) -/* 04A9EC 7F015EBC 0FC025D8 */ jal write_text_at_abs_coord -/* 04A9F0 7F015EC0 AFB8001C */ sw $t8, 0x1c($sp) -/* 04A9F4 7F015EC4 3C038003 */ lui $v1, %hi(current_menu_briefing_page) -/* 04A9F8 7F015EC8 8C63A914 */ lw $v1, %lo(current_menu_briefing_page)($v1) -/* 04A9FC 7F015ECC 00408025 */ move $s0, $v0 -/* 04AA00 7F015ED0 24010001 */ li $at, 1 -/* 04AA04 7F015ED4 14600007 */ bnez $v1, .L7F015EF4 -/* 04AA08 7F015ED8 00402025 */ move $a0, $v0 -/* 04AA0C 7F015EDC 240500A7 */ li $a1, 167 -/* 04AA10 7F015EE0 27A6004C */ addiu $a2, $sp, 0x4c -/* 04AA14 7F015EE4 0FC05682 */ jal print_objectives_and_status_to_menu -/* 04AA18 7F015EE8 00003825 */ move $a3, $zero -/* 04AA1C 7F015EEC 10000049 */ b .L7F016014 -/* 04AA20 7F015EF0 00408025 */ move $s0, $v0 -.L7F015EF4: -/* 04AA24 7F015EF4 1061000C */ beq $v1, $at, .L7F015F28 -/* 04AA28 7F015EF8 3C088007 */ lui $t0, %hi(ptrbriefingdata) -/* 04AA2C 7F015EFC 24010002 */ li $at, 2 -/* 04AA30 7F015F00 1061000E */ beq $v1, $at, .L7F015F3C -/* 04AA34 7F015F04 3C0F8007 */ lui $t7, %hi(ptrbriefingdata) -/* 04AA38 7F015F08 24010003 */ li $at, 3 -/* 04AA3C 7F015F0C 10610010 */ beq $v1, $at, .L7F015F50 -/* 04AA40 7F015F10 3C0E8007 */ lui $t6, %hi(ptrbriefingdata) -/* 04AA44 7F015F14 24010004 */ li $at, 4 -/* 04AA48 7F015F18 10610012 */ beq $v1, $at, .L7F015F64 -/* 04AA4C 7F015F1C 3C098007 */ lui $t1, %hi(ptrbriefingdata) -/* 04AA50 7F015F20 10000014 */ b .L7F015F74 -/* 04AA54 7F015F24 00000000 */ nop -.L7F015F28: -/* 04AA58 7F015F28 8D08978C */ lw $t0, %lo(ptrbriefingdata)($t0) -/* 04AA5C 7F015F2C 0FC30776 */ jal langGet -/* 04AA60 7F015F30 95040000 */ lhu $a0, ($t0) -/* 04AA64 7F015F34 1000000F */ b .L7F015F74 -/* 04AA68 7F015F38 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015F3C: -/* 04AA6C 7F015F3C 8DEF978C */ lw $t7, %lo(ptrbriefingdata)($t7) -/* 04AA70 7F015F40 0FC30776 */ jal langGet -/* 04AA74 7F015F44 95E40002 */ lhu $a0, 2($t7) -/* 04AA78 7F015F48 1000000A */ b .L7F015F74 -/* 04AA7C 7F015F4C AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015F50: -/* 04AA80 7F015F50 8DCE978C */ lw $t6, %lo(ptrbriefingdata)($t6) -/* 04AA84 7F015F54 0FC30776 */ jal langGet -/* 04AA88 7F015F58 95C40004 */ lhu $a0, 4($t6) -/* 04AA8C 7F015F5C 10000005 */ b .L7F015F74 -/* 04AA90 7F015F60 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015F64: -/* 04AA94 7F015F64 8D29978C */ lw $t1, %lo(ptrbriefingdata)($t1) -/* 04AA98 7F015F68 0FC30776 */ jal langGet -/* 04AA9C 7F015F6C 95240006 */ lhu $a0, 6($t1) -/* 04AAA0 7F015F70 AFA20C0C */ sw $v0, 0xc0c($sp) -.L7F015F74: -/* 04AAA4 7F015F74 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableLarge) -/* 04AAA8 7F015F78 8D8C0EB4 */ lw $t4, %lo(ptrFirstFontTableLarge)($t4) -/* 04AAAC 7F015F7C 240A0037 */ li $t2, 55 -/* 04AAB0 7F015F80 240B00A7 */ li $t3, 167 -/* 04AAB4 7F015F84 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) -/* 04AAB8 7F015F88 AFAA0C08 */ sw $t2, 0xc08($sp) -/* 04AABC 7F015F8C AFAB0C04 */ sw $t3, 0xc04($sp) -/* 04AAC0 7F015F90 8CE70EB8 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 04AAC4 7F015F94 24040140 */ li $a0, 320 -/* 04AAC8 7F015F98 8FA50C0C */ lw $a1, 0xc0c($sp) -/* 04AACC 7F015F9C 27A6004C */ addiu $a2, $sp, 0x4c -/* 04AAD0 7F015FA0 0FC2BAD9 */ jal sub_GAME_7F0AEB64 -/* 04AAD4 7F015FA4 AFAC0010 */ sw $t4, 0x10($sp) -/* 04AAD8 7F015FA8 0FC2B2E8 */ jal setTextOverlapCorrection -/* 04AADC 7F015FAC 24040008 */ li $a0, 8 -/* 04AAE0 7F015FB0 0C001107 */ jal viGetX -/* 04AAE4 7F015FB4 00000000 */ nop -/* 04AAE8 7F015FB8 0C00110B */ jal viGetY -/* 04AAEC 7F015FBC A7A20048 */ sh $v0, 0x48($sp) -/* 04AAF0 7F015FC0 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableLarge) -/* 04AAF4 7F015FC4 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) -/* 04AAF8 7F015FC8 8F390EB4 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 04AAFC 7F015FCC 8DAD0EB8 */ lw $t5, %lo(ptrSecondFontTableLarge)($t5) -/* 04AB00 7F015FD0 87A80048 */ lh $t0, 0x48($sp) -/* 04AB04 7F015FD4 241800FF */ li $t8, 255 -/* 04AB08 7F015FD8 AFB80018 */ sw $t8, 0x18($sp) -/* 04AB0C 7F015FDC 02002025 */ move $a0, $s0 -/* 04AB10 7F015FE0 27A50C08 */ addiu $a1, $sp, 0xc08 -/* 04AB14 7F015FE4 27A60C04 */ addiu $a2, $sp, 0xc04 -/* 04AB18 7F015FE8 27A7004C */ addiu $a3, $sp, 0x4c -/* 04AB1C 7F015FEC AFA20020 */ sw $v0, 0x20($sp) -/* 04AB20 7F015FF0 AFA00024 */ sw $zero, 0x24($sp) -/* 04AB24 7F015FF4 AFA00028 */ sw $zero, 0x28($sp) -/* 04AB28 7F015FF8 AFB90014 */ sw $t9, 0x14($sp) -/* 04AB2C 7F015FFC AFAD0010 */ sw $t5, 0x10($sp) -/* 04AB30 7F016000 0FC025D8 */ jal write_text_at_abs_coord -/* 04AB34 7F016004 AFA8001C */ sw $t0, 0x1c($sp) -/* 04AB38 7F016008 00408025 */ move $s0, $v0 -/* 04AB3C 7F01600C 0FC2B2E8 */ jal setTextOverlapCorrection -/* 04AB40 7F016010 2404FFFF */ li $a0, -1 -.L7F016014: -/* 04AB44 7F016014 0FC02820 */ jal add_tab1_start -/* 04AB48 7F016018 02002025 */ move $a0, $s0 -/* 04AB4C 7F01601C 0FC0288E */ jal add_tab3_previous -/* 04AB50 7F016020 00402025 */ move $a0, $v0 -/* 04AB54 7F016024 3C0F8003 */ lui $t7, %hi(current_menu_briefing_page) -/* 04AB58 7F016028 8DEFA914 */ lw $t7, %lo(current_menu_briefing_page)($t7) -/* 04AB5C 7F01602C 00408025 */ move $s0, $v0 -/* 04AB60 7F016030 29E10004 */ slti $at, $t7, 4 -/* 04AB64 7F016034 10200004 */ beqz $at, .L7F016048 -/* 04AB68 7F016038 00000000 */ nop -/* 04AB6C 7F01603C 0FC02905 */ jal add_tab2_next -/* 04AB70 7F016040 00402025 */ move $a0, $v0 -/* 04AB74 7F016044 00408025 */ move $s0, $v0 -.L7F016048: -/* 04AB78 7F016048 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 04AB7C 7F01604C 02002025 */ move $a0, $s0 -/* 04AB80 7F016050 8FBF003C */ lw $ra, 0x3c($sp) -/* 04AB84 7F016054 8FB00038 */ lw $s0, 0x38($sp) -/* 04AB88 7F016058 27BD0C10 */ addiu $sp, $sp, 0xc10 -/* 04AB8C 7F01605C 03E00008 */ jr $ra -/* 04AB90 7F016060 00000000 */ nop -) +const struct MatchHack_front_rodata_3000 asc_D_80050C54 = { "\n" }; #endif -#ifdef VERSION_EU - -GLOBAL_ASM( -.late_rodata -glabel jpt_briefingpage_name - .word .L7F015E14 - .word .L7F015E24 - .word .L7F015E34 - .word .L7F015E44 - .word .L7F015E54 +Gfx *constructor_menu0A_briefing(Gfx *DL) +{ + u8 *spC0C; + s32 spC08; + s32 spC04; + struct MatchHack_front_rodata_3000 sp4C; -.text -glabel constructor_menu0A_briefing -/* 0486E4 7F015CF4 27BDF3F8 */ addiu $sp, $sp, -0xc08 -/* 0486E8 7F015CF8 AFBF0034 */ sw $ra, 0x34($sp) -/* 0486EC 7F015CFC 00002825 */ move $a1, $zero -/* 0486F0 7F015D00 00003025 */ move $a2, $zero -/* 0486F4 7F015D04 0C001048 */ jal viSetFillColor -/* 0486F8 7F015D08 00003825 */ move $a3, $zero -/* 0486FC 7F015D0C 0C000E52 */ jal viFillScreen -/* 048700 7F015D10 00402025 */ move $a0, $v0 -/* 048704 7F015D14 0C000E52 */ jal viFillScreen -/* 048708 7F015D18 00402025 */ move $a0, $v0 -/* 04870C 7F015D1C 0C000E52 */ jal viFillScreen -/* 048710 7F015D20 00402025 */ move $a0, $v0 -/* 048714 7F015D24 0FC0353A */ jal sub_GAME_7F00D5E8 -/* 048718 7F015D28 00402025 */ move $a0, $v0 -/* 04871C 7F015D2C 0FC2B016 */ jal microcode_constructor -/* 048720 7F015D30 00402025 */ move $a0, $v0 -/* 048724 7F015D34 00402025 */ move $a0, $v0 -/* 048728 7F015D38 0FC03A7B */ jal print_current_solo_briefing_stage_name -/* 04872C 7F015D3C 27A50044 */ addiu $a1, $sp, 0x44 -/* 048730 7F015D40 3C0E8002 */ lui $t6, %hi(current_menu_briefing_page) # $t6, 0x8002 -/* 048734 7F015D44 8DCE5E64 */ lw $t6, %lo(current_menu_briefing_page)($t6) -/* 048738 7F015D48 AFA20C08 */ sw $v0, 0xc08($sp) -/* 04873C 7F015D4C 2DC10005 */ sltiu $at, $t6, 5 -/* 048740 7F015D50 10200019 */ beqz $at, .L7F015DB8 -/* 048744 7F015D54 000E7080 */ sll $t6, $t6, 2 -/* 048748 7F015D58 3C018004 */ lui $at, %hi(jpt_briefingpage_name) -/* 04874C 7F015D5C 002E0821 */ addu $at, $at, $t6 -/* 048750 7F015D60 8C2E7BE8 */ lw $t6, %lo(jpt_briefingpage_name)($at) -/* 048754 7F015D64 01C00008 */ jr $t6 -/* 048758 7F015D68 00000000 */ nop -.L7F015E14: -/* 04875C 7F015D6C 0FC304AE */ jal langGet -/* 048760 7F015D70 34049C5D */ li $a0, 40029 -/* 048764 7F015D74 10000010 */ b .L7F015DB8 -/* 048768 7F015D78 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015E24: -/* 04876C 7F015D7C 0FC304AE */ jal langGet -/* 048770 7F015D80 34049C5E */ li $a0, 40030 -/* 048774 7F015D84 1000000C */ b .L7F015DB8 -/* 048778 7F015D88 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015E34: -/* 04877C 7F015D8C 0FC304AE */ jal langGet -/* 048780 7F015D90 34049C5F */ li $a0, 40031 -/* 048784 7F015D94 10000008 */ b .L7F015DB8 -/* 048788 7F015D98 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015E44: -/* 04878C 7F015D9C 0FC304AE */ jal langGet -/* 048790 7F015DA0 34049C60 */ li $a0, 40032 -/* 048794 7F015DA4 10000004 */ b .L7F015DB8 -/* 048798 7F015DA8 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015E54: -/* 04879C 7F015DAC 0FC304AE */ jal langGet -/* 0487A0 7F015DB0 34049C61 */ li $a0, 40033 -/* 0487A4 7F015DB4 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015DB8: -.L7F015E60: -/* 0487A8 7F015DB8 240F0037 */ li $t7, 55 -/* 0487AC 7F015DBC 2418008F */ li $t8, 143 -/* 0487B0 7F015DC0 AFAF0C00 */ sw $t7, 0xc00($sp) -/* 0487B4 7F015DC4 0C000F9B */ jal viGetX -/* 0487B8 7F015DC8 AFB80BFC */ sw $t8, 0xbfc($sp) -/* 0487BC 7F015DCC 0C000F9F */ jal viGetY -/* 0487C0 7F015DD0 A7A20040 */ sh $v0, 0x40($sp) -/* 0487C4 7F015DD4 3C198004 */ lui $t9, %hi(ptrSecondFontTableLarge) # $t9, 0x8004 -/* 0487C8 7F015DD8 3C088004 */ lui $t0, %hi(ptrFirstFontTableLarge) # $t0, 0x8004 -/* 0487CC 7F015DDC 8D08AB04 */ lw $t0, %lo(ptrFirstFontTableLarge)($t0) -/* 0487D0 7F015DE0 8F39AB08 */ lw $t9, %lo(ptrSecondFontTableLarge)($t9) -/* 0487D4 7F015DE4 87AA0040 */ lh $t2, 0x40($sp) -/* 0487D8 7F015DE8 240900FF */ li $t1, 255 -/* 0487DC 7F015DEC AFA90018 */ sw $t1, 0x18($sp) -/* 0487E0 7F015DF0 8FA40C08 */ lw $a0, 0xc08($sp) -/* 0487E4 7F015DF4 27A50C00 */ addiu $a1, $sp, 0xc00 -/* 0487E8 7F015DF8 27A60BFC */ addiu $a2, $sp, 0xbfc -/* 0487EC 7F015DFC 8FA70C04 */ lw $a3, 0xc04($sp) -/* 0487F0 7F015E00 AFA20020 */ sw $v0, 0x20($sp) -/* 0487F4 7F015E04 AFA00024 */ sw $zero, 0x24($sp) -/* 0487F8 7F015E08 AFA00028 */ sw $zero, 0x28($sp) -/* 0487FC 7F015E0C AFA80014 */ sw $t0, 0x14($sp) -/* 048800 7F015E10 AFB90010 */ sw $t9, 0x10($sp) -/* 048804 7F015E14 0FC02598 */ jal write_text_at_abs_coord -/* 048808 7F015E18 AFAA001C */ sw $t2, 0x1c($sp) -/* 04880C 7F015E1C 3C038002 */ lui $v1, %hi(current_menu_briefing_page) # $v1, 0x8002 -/* 048810 7F015E20 8C635E64 */ lw $v1, %lo(current_menu_briefing_page)($v1) -/* 048814 7F015E24 AFA20C08 */ sw $v0, 0xc08($sp) -/* 048818 7F015E28 24010001 */ li $at, 1 -/* 04881C 7F015E2C 14600007 */ bnez $v1, .L7F015E4C -/* 048820 7F015E30 00402025 */ move $a0, $v0 -/* 048824 7F015E34 240500A7 */ li $a1, 167 -/* 048828 7F015E38 27A60044 */ addiu $a2, $sp, 0x44 -/* 04882C 7F015E3C 0FC05662 */ jal print_objectives_and_status_to_menu -/* 048830 7F015E40 00003825 */ move $a3, $zero -/* 048834 7F015E44 10000049 */ b .L7F015F6C -/* 048838 7F015E48 AFA20C08 */ sw $v0, 0xc08($sp) -.L7F015E4C: -/* 04883C 7F015E4C 1061000C */ beq $v1, $at, .L7F015E80 -/* 048840 7F015E50 3C0B8006 */ lui $t3, %hi(ptrbriefingdata) # $t3, 0x8006 -/* 048844 7F015E54 24010002 */ li $at, 2 -/* 048848 7F015E58 1061000E */ beq $v1, $at, .L7F015E94 -/* 04884C 7F015E5C 3C0C8006 */ lui $t4, %hi(ptrbriefingdata) # $t4, 0x8006 -/* 048850 7F015E60 24010003 */ li $at, 3 -/* 048854 7F015E64 10610010 */ beq $v1, $at, .L7F015EA8 -/* 048858 7F015E68 3C0D8006 */ lui $t5, %hi(ptrbriefingdata) # $t5, 0x8006 -/* 04885C 7F015E6C 24010004 */ li $at, 4 -/* 048860 7F015E70 10610012 */ beq $v1, $at, .L7F015EBC -/* 048864 7F015E74 3C0E8006 */ lui $t6, %hi(ptrbriefingdata) # $t6, 0x8006 -/* 048868 7F015E78 10000014 */ b .L7F015ECC -/* 04886C 7F015E7C 00000000 */ nop -.L7F015E80: -/* 048870 7F015E80 8D6B86CC */ lw $t3, %lo(ptrbriefingdata)($t3) -/* 048874 7F015E84 0FC304AE */ jal langGet -/* 048878 7F015E88 95640000 */ lhu $a0, ($t3) -/* 04887C 7F015E8C 1000000F */ b .L7F015ECC -/* 048880 7F015E90 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015E94: -/* 048884 7F015E94 8D8C86CC */ lw $t4, %lo(ptrbriefingdata)($t4) -/* 048888 7F015E98 0FC304AE */ jal langGet -/* 04888C 7F015E9C 95840002 */ lhu $a0, 2($t4) -/* 048890 7F015EA0 1000000A */ b .L7F015ECC -/* 048894 7F015EA4 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015EA8: -/* 048898 7F015EA8 8DAD86CC */ lw $t5, %lo(ptrbriefingdata)($t5) -/* 04889C 7F015EAC 0FC304AE */ jal langGet -/* 0488A0 7F015EB0 95A40004 */ lhu $a0, 4($t5) -/* 0488A4 7F015EB4 10000005 */ b .L7F015ECC -/* 0488A8 7F015EB8 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015EBC: -/* 0488AC 7F015EBC 8DCE86CC */ lw $t6, %lo(ptrbriefingdata)($t6) -/* 0488B0 7F015EC0 0FC304AE */ jal langGet -/* 0488B4 7F015EC4 95C40006 */ lhu $a0, 6($t6) -/* 0488B8 7F015EC8 AFA20C04 */ sw $v0, 0xc04($sp) -.L7F015ECC: -/* 0488BC 7F015ECC 3C198004 */ lui $t9, %hi(ptrFirstFontTableLarge) # $t9, 0x8004 -/* 0488C0 7F015ED0 8F39AB04 */ lw $t9, %lo(ptrFirstFontTableLarge)($t9) -/* 0488C4 7F015ED4 240F0037 */ li $t7, 55 -/* 0488C8 7F015ED8 241800A7 */ li $t8, 167 -/* 0488CC 7F015EDC 3C078004 */ lui $a3, %hi(ptrSecondFontTableLarge) # $a3, 0x8004 -/* 0488D0 7F015EE0 AFAF0C00 */ sw $t7, 0xc00($sp) -/* 0488D4 7F015EE4 AFB80BFC */ sw $t8, 0xbfc($sp) -/* 0488D8 7F015EE8 8CE7AB08 */ lw $a3, %lo(ptrSecondFontTableLarge)($a3) -/* 0488DC 7F015EEC 24040140 */ li $a0, 320 -/* 0488E0 7F015EF0 8FA50C04 */ lw $a1, 0xc04($sp) -/* 0488E4 7F015EF4 27A60044 */ addiu $a2, $sp, 0x44 -/* 0488E8 7F015EF8 0FC2B789 */ jal sub_GAME_7F0AEB64 -/* 0488EC 7F015EFC AFB90010 */ sw $t9, 0x10($sp) -/* 0488F0 7F015F00 0FC2AF98 */ jal setTextOverlapCorrection -/* 0488F4 7F015F04 24040008 */ li $a0, 8 -/* 0488F8 7F015F08 0C000F9B */ jal viGetX -/* 0488FC 7F015F0C 00000000 */ nop -/* 048900 7F015F10 0C000F9F */ jal viGetY -/* 048904 7F015F14 A7A20040 */ sh $v0, 0x40($sp) -/* 048908 7F015F18 3C088004 */ lui $t0, %hi(ptrSecondFontTableLarge) # $t0, 0x8004 -/* 04890C 7F015F1C 3C098004 */ lui $t1, %hi(ptrFirstFontTableLarge) # $t1, 0x8004 -/* 048910 7F015F20 8D29AB04 */ lw $t1, %lo(ptrFirstFontTableLarge)($t1) -/* 048914 7F015F24 8D08AB08 */ lw $t0, %lo(ptrSecondFontTableLarge)($t0) -/* 048918 7F015F28 87AB0040 */ lh $t3, 0x40($sp) -/* 04891C 7F015F2C 240A00FF */ li $t2, 255 -/* 048920 7F015F30 AFAA0018 */ sw $t2, 0x18($sp) -/* 048924 7F015F34 8FA40C08 */ lw $a0, 0xc08($sp) -/* 048928 7F015F38 27A50C00 */ addiu $a1, $sp, 0xc00 -/* 04892C 7F015F3C 27A60BFC */ addiu $a2, $sp, 0xbfc -/* 048930 7F015F40 27A70044 */ addiu $a3, $sp, 0x44 -/* 048934 7F015F44 AFA20020 */ sw $v0, 0x20($sp) -/* 048938 7F015F48 AFA00024 */ sw $zero, 0x24($sp) -/* 04893C 7F015F4C AFA00028 */ sw $zero, 0x28($sp) -/* 048940 7F015F50 AFA90014 */ sw $t1, 0x14($sp) -/* 048944 7F015F54 AFA80010 */ sw $t0, 0x10($sp) -/* 048948 7F015F58 0FC02598 */ jal write_text_at_abs_coord -/* 04894C 7F015F5C AFAB001C */ sw $t3, 0x1c($sp) -/* 048950 7F015F60 AFA20C08 */ sw $v0, 0xc08($sp) -/* 048954 7F015F64 0FC2AF98 */ jal setTextOverlapCorrection -/* 048958 7F015F68 2404FFFF */ li $a0, -1 -.L7F015F6C: -/* 04895C 7F015F6C 0FC027E0 */ jal add_tab1_start -/* 048960 7F015F70 8FA40C08 */ lw $a0, 0xc08($sp) -/* 048964 7F015F74 0FC0284E */ jal add_tab3_previous -/* 048968 7F015F78 00402025 */ move $a0, $v0 -/* 04896C 7F015F7C 3C0C8002 */ lui $t4, %hi(current_menu_briefing_page) # $t4, 0x8002 -/* 048970 7F015F80 8D8C5E64 */ lw $t4, %lo(current_menu_briefing_page)($t4) -/* 048974 7F015F84 AFA20C08 */ sw $v0, 0xc08($sp) -/* 048978 7F015F88 29810004 */ slti $at, $t4, 4 -/* 04897C 7F015F8C 10200004 */ beqz $at, .L7F015FA0 -/* 048980 7F015F90 00000000 */ nop -/* 048984 7F015F94 0FC028C5 */ jal add_tab2_next -/* 048988 7F015F98 00402025 */ move $a0, $v0 -/* 04898C 7F015F9C AFA20C08 */ sw $v0, 0xc08($sp) -.L7F015FA0: -/* 048990 7F015FA0 0FC02782 */ jal load_draw_selected_icon_folder_select -/* 048994 7F015FA4 8FA40C08 */ lw $a0, 0xc08($sp) -/* 048998 7F015FA8 8FBF0034 */ lw $ra, 0x34($sp) -/* 04899C 7F015FAC 27BD0C08 */ addiu $sp, $sp, 0xc08 -/* 0489A0 7F015FB0 03E00008 */ jr $ra -/* 0489A4 7F015FB4 00000000 */ nop -) + DL = viSetFillColor(DL,0,0,0); + DL = viFillScreen(DL); +#ifdef VERSION_EU + DL = viFillScreen(DL); + DL = viFillScreen(DL); #endif + DL = sub_GAME_7F00D5E8(DL); + +#if !defined(VERSION_EU) + sp4C = asc_D_80050C54; #endif + + DL = microcode_constructor(DL); + DL = print_current_solo_briefing_stage_name(DL, (char*)&sp4C); + + switch (current_menu_briefing_page) + { + case BRIEFING_TITLE: + spC0C = langGet(0x9C5DU); + break; + + case BRIEFING_OVERVIEW: + spC0C = langGet(0x9C5EU); + break; + + case BRIEFING_M: + spC0C = langGet(0x9C5FU); + break; + + case BRIEFING_Q: + spC0C = langGet(0x9C60U); + break; + + case BRIEFING_MONEYPENNY: + spC0C = langGet(0x9C61U); + break; + } + + spC08 = 0x37; + spC04 = 0x8F; + DL = write_text_at_abs_coord(DL, &spC08, &spC04, (s8*)spC0C, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + if (current_menu_briefing_page == BRIEFING_TITLE) + { + DL = print_objectives_and_status_to_menu(DL, 0xA7, (char*)&sp4C, 0); + } + else + { + switch (current_menu_briefing_page) + { + case BRIEFING_OVERVIEW: + spC0C = langGet(ptrbriefingdata->brief[0]); + break; + + case BRIEFING_M: + spC0C = langGet(ptrbriefingdata->brief[1]); + break; + + case BRIEFING_Q: + spC0C = langGet(ptrbriefingdata->brief[2]); + break; + + case BRIEFING_MONEYPENNY: + spC0C = langGet(ptrbriefingdata->brief[3]); + break; + } + + spC08 = 0x37; + spC04 = 0xA7; + sub_GAME_7F0AEB64(0x140, (s8*)spC0C, (s8*)&sp4C, ptrFontZurichBoldChars, ptrFontZurichBold); + setTextOverlapCorrection(8); + DL = write_text_at_abs_coord(DL, &spC08, &spC04, (s8*)&sp4C, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + setTextOverlapCorrection(-1); + } + + DL = add_tab1_start(DL); + DL = add_tab3_previous(DL); + + if (current_menu_briefing_page < BRIEFING_MONEYPENNY) + { + DL = add_tab2_next(DL); + } + + DL = load_draw_selected_icon_folder_select(DL); + + return DL; +} + //******************************************************************************************************** @@ -18667,8 +7547,8 @@ void update_menu0C_missionfailed(void) { void interface_menu0C_missionfailed(void) { - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(FALSE); tab_next_highlight = FALSE; @@ -18713,19 +7593,19 @@ void interface_menu0C_missionfailed(void) } } disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 1, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 3, TRUE); - set_item_visibility_in_objinstance(walletinst[0], 6, TRUE); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); menu_control_stick_tracking(); if (tab_next_selected) { - set_menu_to_mode(MENU_MISSION_COMPLETE, 0); + frontChangeMenu(MENU_MISSION_COMPLETE, FALSE); return; } if (tab_prev_selected) { - set_menu_to_mode(MENU_MISSION_SELECT, 0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo(mission_folder_setup_entries[briefingpage].mission_num); } } @@ -18747,8 +7627,8 @@ s32 frontCompleteAllObjectivesAliveSuccess(void) for (i=0; i<10; i++) { - if (ptrbriefingdata->datas[i].difficulty_related != 0 - && lvlGetSelectedDifficulty() >= ptrbriefingdata->datas[i].selected_difficulty + if (ptrbriefingdata->objective[i].textid != 0 + && lvlGetSelectedDifficulty() >= ptrbriefingdata->objective[i].enabled_difficulty && get_status_of_objective(i) != OBJECTIVESTATUS_COMPLETE) { return 0; @@ -18782,44 +7662,44 @@ Gfx * constructor_menu0C_missionfailed(Gfx *DL) DL = microcode_constructor(DL); DL = print_current_solo_briefing_stage_name(DL, &stagename); - text = langGet(TEXT(LTITLE, 0x62)); //REPORT:* + text = langGet(TEXT(LTITLE, TITLE_STR_98)); //REPORT:* x = 0x37; y = 0x8F; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x63)); //Mission status:* + text = langGet(TEXT(LTITLE, TITLE_STR_99)); //Mission status:* x2 = 0; y2 = 0; - sub_GAME_7F0AE98C(&y2, &x2, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&y2, &x2, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0x37; y = 0xA7; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); if (g_isBondKIA) { - text = langGet(TEXT(LTITLE, 0x64)); // KILLED IN ACTION* + text = langGet(TEXT(LTITLE, TITLE_STR_100)); // KILLED IN ACTION* phi_v1 = 0x78000000 | 0xFF; } else if (mission_failed_or_aborted) { - text = langGet(TEXT(LTITLE, 0x65)); // ABORTED* + text = langGet(TEXT(LTITLE, TITLE_STR_101)); // ABORTED* phi_v1 = 0x78000000 | 0xFF; } else if (frontCompleteAllObjectivesAliveSuccess()) { - text = langGet(TEXT(LTITLE, 0x66)); // Completed* + text = langGet(TEXT(LTITLE, TITLE_STR_102)); // Completed* phi_v1 = 0xFF; } else { - text = langGet(TEXT(LTITLE, 0x67)); // FAILED* + text = langGet(TEXT(LTITLE, TITLE_STR_103)); // FAILED* phi_v1 = 0x78000000 | 0xFF; } x = x2 + 0x37; y = 0xA7; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, phi_v1, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, phi_v1, viGetX(), viGetY(), 0, 0); DL = print_objectives_and_status_to_menu(DL, 0xBF, &stagename, 1); DL = add_tab2_next(DL); @@ -18857,8 +7737,8 @@ void interface_menu0D_missioncomplete() { int entry; - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); tab_prev_highlight = FALSE; @@ -18900,30 +7780,30 @@ void interface_menu0D_missioncomplete() } disable_all_switches(walletinst[0]); - set_item_visibility_in_objinstance(walletinst[0], 0, 1); - set_item_visibility_in_objinstance(walletinst[0], 1, 1); - set_item_visibility_in_objinstance(walletinst[0], 3, 1); - set_item_visibility_in_objinstance(walletinst[0], 6, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_PAPER, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_OHMSS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); menu_control_stick_tracking(); if (tab_next_selected) { - if (frontCompleteAllObjectivesAliveSuccess() && (g_AppendCheatSinglePlayer == 0)) + if (frontCompleteAllObjectivesAliveSuccess() && (!g_AppendCheatSinglePlayer)) { - if (mission_folder_setup_entries[briefingpage].mission_num == 0x11) + if (mission_folder_setup_entries[briefingpage].mission_num == SP_LEVEL_CRADLE) { - set_menu_to_mode(MENU_RUN_STAGE,1); + frontChangeMenu(MENU_RUN_STAGE, TRUE); selected_stage = LEVELID_CUBA; } - else if (mission_folder_setup_entries[briefingpage].mission_num >= 0x12) + else if (mission_folder_setup_entries[briefingpage].mission_num >= SP_LEVEL_AZTEC) { - set_menu_to_mode(MENU_MISSION_SELECT,0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo((s32)mission_folder_setup_entries[briefingpage].mission_num); } else { entry = briefingpage + 1; - while (mission_folder_setup_entries[entry].folder_text_preset != 0) + while (mission_folder_setup_entries[entry].folder_text_preset) { if (mission_folder_setup_entries[entry].stage_id >= 0) { @@ -18939,17 +7819,17 @@ void interface_menu0D_missioncomplete() selected_stage = mission_folder_setup_entries[entry].stage_id; } - set_menu_to_mode(MENU_BRIEFING,0); + frontChangeMenu(MENU_BRIEFING, FALSE); } } else { - set_menu_to_mode(MENU_BRIEFING,0); + frontChangeMenu(MENU_BRIEFING, FALSE); } } - else if (tab_prev_selected != FALSE) + else if (tab_prev_selected) { - set_menu_to_mode(MENU_MISSION_SELECT,0); + frontChangeMenu(MENU_MISSION_SELECT, FALSE); set_cursor_to_stage_solo((s32)mission_folder_setup_entries[briefingpage].mission_num); } @@ -19006,19 +7886,19 @@ Gfx *constructor_menu0D_missioncomplete(Gfx *DL) } DL = print_current_solo_briefing_stage_name(DL, stagename); - text = langGet(TEXT(LTITLE, 0x68)); //STATISTICS:* + text = langGet(TEXT(LTITLE, TITLE_STR_104)); //STATISTICS:* x = 0x37; y = 0x8F; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); x2 = 0; y2 = 0; - sub_GAME_7F0AE98C(&y2, &x2, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&y2, &x2, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); - text = langGet(TEXT(LTITLE, 0x69)); //Time:* + text = langGet(TEXT(LTITLE, TITLE_STR_105)); //Time:* x = 0x37; y = 0xA7; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); besttime = fileGetSaveStageDifficultyTime( fileGetSaveForFoldernum(selected_folder_num), mission_folder_setup_entries[briefingpage].mission_num, selected_difficulty); if ((besttime == 0) || (!(besttime < 0x3FF))) { @@ -19036,59 +7916,59 @@ Gfx *constructor_menu0D_missioncomplete(Gfx *DL) sprintf(stagename, "%02d:%02d", missiontime / 60, missiontime % 60); x = 0x82; y = 0xA7; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); if (g_NewCheatUnlocked) { stagename[0] = '\0'; - sprintf(stagename, " [%s]", langGet(TEXT(LTITLE, 0x113))); //New Cheat Available - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xA00000FF, viGetX(), viGetY(), 0, 0); + sprintf(stagename, " [%s]", langGet(TEXT(LTITLE, TITLE_STR_275))); //New Cheat Available + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xA00000FF, viGetX(), viGetY(), 0, 0); } if ((targettime > 0) && (selected_difficulty != DIFFICULTY_007)) { - text = langGet(TEXT(LTITLE, 0x112)); //Target: + text = langGet(TEXT(LTITLE, TITLE_STR_274)); //Target: x = 0x37; y = y2 + 0xA9; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); stagename[0] = '\0'; sprintf(stagename, "%02d:%02d", targettime / 60, targettime % 60); x = 0x82; y = y2 + 0xA9; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); if (besttime >= 0) { if (besttime < 0x3FF) { stagename[0] = '\0'; if (besttime >= 0) { - sprintf(stagename, " (%s %02d:%02d)", langGet(TEXT(LTITLE, 0x111)), besttime / 60, besttime % 60); //Best Time: + sprintf(stagename, " (%s %02d:%02d)", langGet(TEXT(LTITLE, TITLE_STR_273)), besttime / 60, besttime % 60); //Best Time: } else { sprintf(stagename, ""); } - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } } } else { if (besttime >= 0) { if (besttime < 0x3FF) { - text = langGet(TEXT(LTITLE, 0x111)); //Best Time: + text = langGet(TEXT(LTITLE, TITLE_STR_273)); //Best Time: x = 0x37; y = y2 + 0xA9; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); stagename[0] = '\0'; sprintf(stagename, "%02d:%02d", besttime / 60, besttime % 60); x = 0x82; y = y2 + 0xA9; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); } } } - text = langGet(TEXT(LTITLE, 0x6A)); //Accuracy:* + text = langGet(TEXT(LTITLE, TITLE_STR_106)); //Accuracy:* x = 0x37; y = 0xCC; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); if (shotsfired > 0) { hitPct = (hitshots * 100.0f) / shotsfired; } @@ -19098,13 +7978,13 @@ Gfx *constructor_menu0D_missioncomplete(Gfx *DL) sprintf(stagename, "%.1f%%", hitPct); x = 0x82; y = 0xCC; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x6B)); //Weapon of choice:* + text = langGet(TEXT(LTITLE, TITLE_STR_107)); //Weapon of choice:* x = 0x37; y = 0xDC; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); strcpy(stagename, getplayerfavoredweapon(0, 0)); if ((array_favweapon[0][0] > 0) && (array_favweapon[0][1] == array_favweapon[0][0])) { @@ -19113,68 +7993,68 @@ Gfx *constructor_menu0D_missioncomplete(Gfx *DL) } x = 0xBE; y = 0xDC; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x6C)); //Shot total:* + text = langGet(TEXT(LTITLE, TITLE_STR_108)); //Shot total:* x = 0x37; y = 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d", shotsfired); x = 0x82; y = 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x6D)); //Head hits:* + text = langGet(TEXT(LTITLE, TITLE_STR_109)); //Head hits:* x = 0xB4; y = 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d (%d%%)", headshots, (s32)(floorFloat(((headshots * 100.0f) / allhits) + 0.5f))); x = 0x12C; y = 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x6E)); //Body hits:* + text = langGet(TEXT(LTITLE, TITLE_STR_110)); //Body hits:* x = 0xB4; y = y2 + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d (%d%%)", bodyshots, (s32)floorFloat(((bodyshots * 100.0f) / allhits) + 0.5f)); x = 0x12C; y = y2 + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x6F)); //Limb hits:* + text = langGet(TEXT(LTITLE, TITLE_STR_111)); //Limb hits:* x = 0xB4; y = (y2 * 2) + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d (%d%%)", limbshots, (s32)floorFloat(((limbshots * 100.0f) / allhits) + 0.5f)); x = 0x12C; y = (y2 * 2) + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x70)); //Others:* + text = langGet(TEXT(LTITLE, TITLE_STR_112)); //Others:* x = 0xB4; y = (y2 * 3) + 0xF4; temp = reg5 + reg4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d (%d%%)", temp, (s32)floorFloat(((temp * 100.0f) / allhits) + 0.5f)); x = 0x12C; y = (y2 * 3) + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); - text = langGet(TEXT(LTITLE, 0x71)); //Kill total:* + text = langGet(TEXT(LTITLE, TITLE_STR_113)); //Kill total:* x = 0x37; y = y2 + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); sprintf(stagename, "%d", killcount); x = 0x82; y = y2 + 0xF4; - DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0xFF, viGetX(), viGetY(), 0, 0); + DL = write_text_at_abs_coord(DL, &x, &y, stagename, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); DL = add_tab2_next(DL); @@ -19239,982 +8119,189 @@ void update_menu15_cheat(void) } - -#ifdef NONMATCHING -void interface_menu15_cheat(u32 param_1,u32 param_2) +// Address 0x7F017C88 NTSC +void interface_menu15_cheat(void) { - int iVar1; - u32 BVar3; - int iVar4; - int iVar5; - - viSetFovY(60.00000000); - viSetAspect(menu15_aspect); - viSetZRange(100.00000000, menu15_pageheight); - viSetUseZBuf(0); - MP_menu_selected_option = 0; - iVar1 = dword_8002B5E0; - if (joyGetButtons(0,Z_TRIG|A_BUTTON) == 0) { - tab_prev_highlight = FALSE; - tab_next_highlight = FALSE; - tab_start_highlight = FALSE; - dword_8002B5E0 = 0; - BVar3 = isontab3(); - if (BVar3 == FALSE) { - iVar1 = dword_8002B5E0; - if (((0xc < totalunlockedcheats) && - (iVar5 = totalunlockedcheats + -0xd, iVar1 = dword_8002B5E0, 0xdb < (int)(float)cursor_h_pos)) - && (iVar1 = dword_8002B5E0, -1 < iVar5)) { - iVar4 = iVar5 * 0x14 + 0x35; - do { - iVar1 = iVar5 + 0xc; - if (iVar4 <= (int)(float)cursor_v_pos) break; - iVar5 += -1; - iVar4 += -0x14; - iVar1 = dword_8002B5E0; - } while (-1 < iVar5); - } - dword_8002B5E0 = iVar1; - iVar1 = dword_8002B5E0; - if (dword_8002B5E0 == 0) { - iVar5 = totalunlockedcheats + -1; - if (0xc < totalunlockedcheats) { - iVar5 = 0xb; + s32 i; + + viSetFovY(60.0f); + viSetAspect(1.3333334f); + viSetZRange(100.0f, 10000.0f); + viSetUseZBuf(0); + + MP_menu_selected_option = 0; + + if (joyGetButtons(PLAYER_1, A_BUTTON|Z_TRIG) == 0) + { + tab_prev_highlight = 0; + tab_next_highlight = 0; + tab_start_highlight = 0; + D_8002B5E0 = 0; + + if (isontab3()) + { + tab_prev_highlight = 1; } - iVar1 = dword_8002B5E0; - if (-1 < iVar5) { - iVar4 = iVar5 * 0x14 + 0x35; - do { - iVar1 = iVar5; - if (iVar4 <= (int)(float)cursor_v_pos) break; - iVar5 += -1; - iVar4 += -0x14; - iVar1 = dword_8002B5E0; - } while (-1 < iVar5); + else + { + if (totalunlockedcheats >= 0xD) + { + i = totalunlockedcheats - 0xD; + if ((s32) cursor_h_pos >= 0xDC) + { + for (; i >= 0; i--) + { + if ((s32) cursor_v_pos >= (i * 0x14) + 0x35) + { + D_8002B5E0 = i + 0xC; + break; + } + } + } + } + + if (D_8002B5E0 == 0) + { + i = (totalunlockedcheats >= 0xD) + ? 0xB + : totalunlockedcheats - 1; + + for (; i >= 0; i--) + { + if ((s32) cursor_v_pos >= (i * 0x14) + 0x35) + { + D_8002B5E0 = i; + break; + } + } + } } - } - } - else { - tab_prev_highlight = TRUE; - iVar1 = dword_8002B5E0; } - } - dword_8002B5E0 = iVar1; - uVar2 = joyGetButtonsPressedThisFrame(PLAYER_1,Z_TRIG|A_BUTTON); - if (uVar2 == 0) { - uVar2 = joyGetButtonsPressedThisFrame(PLAYER_1,B_BUTTON); - if (uVar2 != 0) { - tab_prev_selected = TRUE; - sndPlaySfx((s32)(int)g_musicSfxBufferPtr,DOOR_METAL_CLOSE2_SFX,NULL); + + if (joyGetButtonsPressedThisFrame(PLAYER_1, A_BUTTON|Z_TRIG)) + { + if (tab_prev_highlight != 0) + { + tab_prev_selected = 1; + } + else + { + MP_menu_selected_option = 1; + } + + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - } - else { - if (tab_prev_highlight == FALSE) { - MP_menu_selected_option = 1; + else if (joyGetButtonsPressedThisFrame(0, 0x4000U) != 0) + { + tab_prev_selected = 1; + sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, DOOR_METAL_CLOSE2_SFX, NULL); } - else { - tab_prev_selected = TRUE; + + disable_all_switches(walletinst[0]); + set_item_visibility_in_objinstance(walletinst[0], SW_TABS, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_BLANK, 1); + set_item_visibility_in_objinstance(walletinst[0], SW_CLASSIFIED, 1); + menu_control_stick_tracking(); + + if (tab_prev_selected) + { + frontChangeMenu(MENU_MODE_SELECT, 0); + setCursorPOSforMode(gamemode); + return; } - sndPlaySfx((s32)(int)g_musicSfxBufferPtr,DOOR_METAL_CLOSE2_SFX,NULL); - } - disable_all_switches((int)walletinst[0]); - set_item_visibility_in_objinstance((int)walletinst[0],0,1); - set_item_visibility_in_objinstance((int)walletinst[0],0x2a,1); - set_item_visibility_in_objinstance((int)walletinst[0],6,1); - menu_control_stick_tracking(); - if (tab_prev_selected == FALSE) { - if (MP_menu_selected_option != 0) { - *(char *)((&DAT_800697f0)[dword_8002B5E0] + -0x7ff96960) = - 1 - *(char *)((&DAT_800697f0)[dword_8002B5E0] + -0x7ff96960); + + if (MP_menu_selected_option) + { + i = arrayUnlockedCheats[D_8002B5E0]; + g_CheatActivated[i] = 1 - g_CheatActivated[i]; } - } - else { - set_menu_to_mode(MENU_MODE_SELECT,0); - setCursorPOSforMode(gamemode); - } } -#else -GLOBAL_ASM( -.late_rodata -glabel menu15_aspect -.word 0x3FAAAAAB /*1.3333334;*/ -glabel menu15_pageheight -.word 0x461C4000 /*10000.0;*/ -.text -glabel interface_menu15_cheat -/* 04C7B8 7F017C88 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 04C7BC 7F017C8C 3C014270 */ li $at, 0x42700000 # 60.000000 -/* 04C7C0 7F017C90 AFBF0014 */ sw $ra, 0x14($sp) -/* 04C7C4 7F017C94 44816000 */ mtc1 $at, $f12 -/* 04C7C8 7F017C98 0C001151 */ jal viSetFovY -/* 04C7CC 7F017C9C 00000000 */ nop -/* 04C7D0 7F017CA0 3C018005 */ lui $at, %hi(menu15_aspect) -/* 04C7D4 7F017CA4 0C001164 */ jal viSetAspect -/* 04C7D8 7F017CA8 C42C1AE4 */ lwc1 $f12, %lo(menu15_aspect)($at) -/* 04C7DC 7F017CAC 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 04C7E0 7F017CB0 44816000 */ mtc1 $at, $f12 -/* 04C7E4 7F017CB4 3C018005 */ lui $at, %hi(menu15_pageheight) -/* 04C7E8 7F017CB8 0C001194 */ jal viSetZRange -/* 04C7EC 7F017CBC C42E1AE8 */ lwc1 $f14, %lo(menu15_pageheight)($at) -/* 04C7F0 7F017CC0 0C00114D */ jal viSetUseZBuf -/* 04C7F4 7F017CC4 00002025 */ move $a0, $zero -/* 04C7F8 7F017CC8 3C018003 */ lui $at, %hi(MP_menu_selected_option) -/* 04C7FC 7F017CCC AC20B5E4 */ sw $zero, %lo(MP_menu_selected_option)($at) -/* 04C800 7F017CD0 00002025 */ move $a0, $zero -/* 04C804 7F017CD4 0C0030C3 */ jal joyGetButtons -/* 04C808 7F017CD8 3405A000 */ li $a1, 40960 -/* 04C80C 7F017CDC 14400049 */ bnez $v0, .L7F017E04 -/* 04C810 7F017CE0 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 04C814 7F017CE4 AC20A8E4 */ sw $zero, %lo(tab_prev_highlight)($at) -/* 04C818 7F017CE8 3C018003 */ lui $at, %hi(tab_next_highlight) -/* 04C81C 7F017CEC AC20A8E0 */ sw $zero, %lo(tab_next_highlight)($at) -/* 04C820 7F017CF0 3C018003 */ lui $at, %hi(tab_start_highlight) -/* 04C824 7F017CF4 AC20A8DC */ sw $zero, %lo(tab_start_highlight)($at) -/* 04C828 7F017CF8 3C018003 */ lui $at, %hi(D_8002B5E0) -/* 04C82C 7F017CFC 0FC028E7 */ jal isontab3 -/* 04C830 7F017D00 AC20B5E0 */ sw $zero, %lo(D_8002B5E0)($at) -/* 04C834 7F017D04 10400005 */ beqz $v0, .L7F017D1C -/* 04C838 7F017D08 3C058003 */ lui $a1, %hi(totalunlockedcheats) -/* 04C83C 7F017D0C 240E0001 */ li $t6, 1 -/* 04C840 7F017D10 3C018003 */ lui $at, %hi(tab_prev_highlight) -/* 04C844 7F017D14 1000003B */ b .L7F017E04 -/* 04C848 7F017D18 AC2EA8E4 */ sw $t6, %lo(tab_prev_highlight)($at) -.L7F017D1C: -/* 04C84C 7F017D1C 8CA5B5DC */ lw $a1, %lo(totalunlockedcheats)($a1) -/* 04C850 7F017D20 3C098003 */ lui $t1, %hi(D_8002B5E0) -/* 04C854 7F017D24 28A1000D */ slti $at, $a1, 0xd -/* 04C858 7F017D28 1420001C */ bnez $at, .L7F017D9C -/* 04C85C 7F017D2C 3C018003 */ lui $at, %hi(cursor_h_pos) -/* 04C860 7F017D30 C424A908 */ lwc1 $f4, %lo(cursor_h_pos)($at) -/* 04C864 7F017D34 24A3FFF3 */ addiu $v1, $a1, -0xd -/* 04C868 7F017D38 4600218D */ trunc.w.s $f6, $f4 -/* 04C86C 7F017D3C 44183000 */ mfc1 $t8, $f6 -/* 04C870 7F017D40 00000000 */ nop -/* 04C874 7F017D44 2B0100DC */ slti $at, $t8, 0xdc -/* 04C878 7F017D48 14200014 */ bnez $at, .L7F017D9C -/* 04C87C 7F017D4C 00000000 */ nop -/* 04C880 7F017D50 04600012 */ bltz $v1, .L7F017D9C -/* 04C884 7F017D54 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 04C888 7F017D58 C428A90C */ lwc1 $f8, %lo(cursor_v_pos)($at) -/* 04C88C 7F017D5C 00031080 */ sll $v0, $v1, 2 -/* 04C890 7F017D60 00431021 */ addu $v0, $v0, $v1 -/* 04C894 7F017D64 4600428D */ trunc.w.s $f10, $f8 -/* 04C898 7F017D68 00021080 */ sll $v0, $v0, 2 -/* 04C89C 7F017D6C 24420035 */ addiu $v0, $v0, 0x35 -/* 04C8A0 7F017D70 44045000 */ mfc1 $a0, $f10 -/* 04C8A4 7F017D74 00000000 */ nop -.L7F017D78: -/* 04C8A8 7F017D78 0082082A */ slt $at, $a0, $v0 -/* 04C8AC 7F017D7C 14200004 */ bnez $at, .L7F017D90 -/* 04C8B0 7F017D80 2468000C */ addiu $t0, $v1, 0xc -/* 04C8B4 7F017D84 3C018003 */ lui $at, %hi(D_8002B5E0) -/* 04C8B8 7F017D88 10000004 */ b .L7F017D9C -/* 04C8BC 7F017D8C AC28B5E0 */ sw $t0, %lo(D_8002B5E0)($at) -.L7F017D90: -/* 04C8C0 7F017D90 2463FFFF */ addiu $v1, $v1, -1 -/* 04C8C4 7F017D94 0461FFF8 */ bgez $v1, .L7F017D78 -/* 04C8C8 7F017D98 2442FFEC */ addiu $v0, $v0, -0x14 -.L7F017D9C: -/* 04C8CC 7F017D9C 8D29B5E0 */ lw $t1, %lo(D_8002B5E0)($t1) -/* 04C8D0 7F017DA0 28A1000D */ slti $at, $a1, 0xd -/* 04C8D4 7F017DA4 55200018 */ bnezl $t1, .L7F017E08 -/* 04C8D8 7F017DA8 00002025 */ move $a0, $zero -/* 04C8DC 7F017DAC 14200003 */ bnez $at, .L7F017DBC -/* 04C8E0 7F017DB0 24A3FFFF */ addiu $v1, $a1, -1 -/* 04C8E4 7F017DB4 10000001 */ b .L7F017DBC -/* 04C8E8 7F017DB8 2403000B */ li $v1, 11 -.L7F017DBC: -/* 04C8EC 7F017DBC 04600011 */ bltz $v1, .L7F017E04 -/* 04C8F0 7F017DC0 3C018003 */ lui $at, %hi(cursor_v_pos) -/* 04C8F4 7F017DC4 C430A90C */ lwc1 $f16, %lo(cursor_v_pos)($at) -/* 04C8F8 7F017DC8 00031080 */ sll $v0, $v1, 2 -/* 04C8FC 7F017DCC 00431021 */ addu $v0, $v0, $v1 -/* 04C900 7F017DD0 4600848D */ trunc.w.s $f18, $f16 -/* 04C904 7F017DD4 00021080 */ sll $v0, $v0, 2 -/* 04C908 7F017DD8 24420035 */ addiu $v0, $v0, 0x35 -/* 04C90C 7F017DDC 44049000 */ mfc1 $a0, $f18 -/* 04C910 7F017DE0 00000000 */ nop -.L7F017DE4: -/* 04C914 7F017DE4 0082082A */ slt $at, $a0, $v0 -/* 04C918 7F017DE8 14200003 */ bnez $at, .L7F017DF8 -/* 04C91C 7F017DEC 3C018003 */ lui $at, %hi(D_8002B5E0) -/* 04C920 7F017DF0 10000004 */ b .L7F017E04 -/* 04C924 7F017DF4 AC23B5E0 */ sw $v1, %lo(D_8002B5E0)($at) -.L7F017DF8: -/* 04C928 7F017DF8 2463FFFF */ addiu $v1, $v1, -1 -/* 04C92C 7F017DFC 0461FFF9 */ bgez $v1, .L7F017DE4 -/* 04C930 7F017E00 2442FFEC */ addiu $v0, $v0, -0x14 -.L7F017E04: -/* 04C934 7F017E04 00002025 */ move $a0, $zero -.L7F017E08: -/* 04C938 7F017E08 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04C93C 7F017E0C 3405A000 */ li $a1, 40960 -/* 04C940 7F017E10 10400012 */ beqz $v0, .L7F017E5C -/* 04C944 7F017E14 00002025 */ move $a0, $zero -/* 04C948 7F017E18 3C0B8003 */ lui $t3, %hi(tab_prev_highlight) -/* 04C94C 7F017E1C 8D6BA8E4 */ lw $t3, %lo(tab_prev_highlight)($t3) -/* 04C950 7F017E20 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 04C954 7F017E24 240500C7 */ li $a1, 199 -/* 04C958 7F017E28 11600005 */ beqz $t3, .L7F017E40 -/* 04C95C 7F017E2C 00003025 */ move $a2, $zero -/* 04C960 7F017E30 240C0001 */ li $t4, 1 -/* 04C964 7F017E34 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 04C968 7F017E38 10000004 */ b .L7F017E4C -/* 04C96C 7F017E3C AC2CA8D8 */ sw $t4, %lo(tab_prev_selected)($at) -.L7F017E40: -/* 04C970 7F017E40 240D0001 */ li $t5, 1 -/* 04C974 7F017E44 3C018003 */ lui $at, %hi(MP_menu_selected_option) -/* 04C978 7F017E48 AC2DB5E4 */ sw $t5, %lo(MP_menu_selected_option)($at) -.L7F017E4C: -/* 04C97C 7F017E4C 0C002382 */ jal sndPlaySfx -/* 04C980 7F017E50 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 04C984 7F017E54 1000000C */ b .L7F017E88 -/* 04C988 7F017E58 00000000 */ nop -.L7F017E5C: -/* 04C98C 7F017E5C 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04C990 7F017E60 24054000 */ li $a1, 16384 -/* 04C994 7F017E64 10400008 */ beqz $v0, .L7F017E88 -/* 04C998 7F017E68 240E0001 */ li $t6, 1 -/* 04C99C 7F017E6C 3C018003 */ lui $at, %hi(tab_prev_selected) -/* 04C9A0 7F017E70 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 04C9A4 7F017E74 AC2EA8D8 */ sw $t6, %lo(tab_prev_selected)($at) -/* 04C9A8 7F017E78 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 04C9AC 7F017E7C 240500C7 */ li $a1, 199 -/* 04C9B0 7F017E80 0C002382 */ jal sndPlaySfx -/* 04C9B4 7F017E84 00003025 */ move $a2, $zero -.L7F017E88: -/* 04C9B8 7F017E88 3C048003 */ lui $a0, %hi(walletinst) -/* 04C9BC 7F017E8C 0FC02DC9 */ jal disable_all_switches -/* 04C9C0 7F017E90 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 04C9C4 7F017E94 3C048003 */ lui $a0, %hi(walletinst) -/* 04C9C8 7F017E98 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 04C9CC 7F017E9C 00002825 */ move $a1, $zero -/* 04C9D0 7F017EA0 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 04C9D4 7F017EA4 24060001 */ li $a2, 1 -/* 04C9D8 7F017EA8 3C048003 */ lui $a0, %hi(walletinst) -/* 04C9DC 7F017EAC 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 04C9E0 7F017EB0 2405002A */ li $a1, 42 -/* 04C9E4 7F017EB4 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 04C9E8 7F017EB8 24060001 */ li $a2, 1 -/* 04C9EC 7F017EBC 3C048003 */ lui $a0, %hi(walletinst) -/* 04C9F0 7F017EC0 8C84A95C */ lw $a0, %lo(walletinst)($a0) -/* 04C9F4 7F017EC4 24050006 */ li $a1, 6 -/* 04C9F8 7F017EC8 0FC02DF0 */ jal set_item_visibility_in_objinstance -/* 04C9FC 7F017ECC 24060001 */ li $a2, 1 -/* 04CA00 7F017ED0 0FC026E1 */ jal menu_control_stick_tracking -/* 04CA04 7F017ED4 00000000 */ nop -/* 04CA08 7F017ED8 3C0F8003 */ lui $t7, %hi(tab_prev_selected) -/* 04CA0C 7F017EDC 8DEFA8D8 */ lw $t7, %lo(tab_prev_selected)($t7) -/* 04CA10 7F017EE0 24040006 */ li $a0, 6 -/* 04CA14 7F017EE4 3C188003 */ lui $t8, %hi(MP_menu_selected_option) -/* 04CA18 7F017EE8 11E00008 */ beqz $t7, .L7F017F0C -/* 04CA1C 7F017EEC 00000000 */ nop -/* 04CA20 7F017EF0 0FC06975 */ jal set_menu_to_mode -/* 04CA24 7F017EF4 00002825 */ move $a1, $zero -/* 04CA28 7F017EF8 3C048003 */ lui $a0, %hi(gamemode) -/* 04CA2C 7F017EFC 0FC035FF */ jal setCursorPOSforMode -/* 04CA30 7F017F00 8C84A8F0 */ lw $a0, %lo(gamemode)($a0) -/* 04CA34 7F017F04 10000012 */ b .L7F017F50 -/* 04CA38 7F017F08 8FBF0014 */ lw $ra, 0x14($sp) -.L7F017F0C: -/* 04CA3C 7F017F0C 8F18B5E4 */ lw $t8, %lo(MP_menu_selected_option)($t8) -/* 04CA40 7F017F10 3C198003 */ lui $t9, %hi(D_8002B5E0) -/* 04CA44 7F017F14 5300000E */ beql $t8, $zero, .L7F017F50 -/* 04CA48 7F017F18 8FBF0014 */ lw $ra, 0x14($sp) -/* 04CA4C 7F017F1C 8F39B5E0 */ lw $t9, %lo(D_8002B5E0)($t9) -/* 04CA50 7F017F20 3C038007 */ lui $v1, %hi(arrayUnlockedCheats) -/* 04CA54 7F017F24 3C098007 */ lui $t1, %hi(g_CheatActivated) -/* 04CA58 7F017F28 00194080 */ sll $t0, $t9, 2 -/* 04CA5C 7F017F2C 00681821 */ addu $v1, $v1, $t0 -/* 04CA60 7F017F30 8C6397F0 */ lw $v1, %lo(arrayUnlockedCheats)($v1) -/* 04CA64 7F017F34 252996A0 */ addiu $t1, %lo(g_CheatActivated) # addiu $t1, $t1, -0x6960 -/* 04CA68 7F017F38 240B0001 */ li $t3, 1 -/* 04CA6C 7F017F3C 00691021 */ addu $v0, $v1, $t1 -/* 04CA70 7F017F40 904A0000 */ lbu $t2, ($v0) -/* 04CA74 7F017F44 016A6023 */ subu $t4, $t3, $t2 -/* 04CA78 7F017F48 A04C0000 */ sb $t4, ($v0) -/* 04CA7C 7F017F4C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F017F50: -/* 04CA80 7F017F50 27BD0018 */ addiu $sp, $sp, 0x18 -/* 04CA84 7F017F54 03E00008 */ jr $ra -/* 04CA88 7F017F58 00000000 */ nop -) -#endif -#ifdef NONMATCHING -void constructor_menu15_cheat(void) { +// Address 0x7F017F5C NTSC +// Address 0x7F017EB8 PAL +Gfx * constructor_menu15_cheat(Gfx *DL) +{ + s32 padding; + s32 var_s1; + s32 var_fp; + s32 sp88; + s32 sp84; + s32 sp80; + s32 sp7C; + u8 *temp_v0; + s32 var_s5; -} -#else -#ifndef VERSION_EU -GLOBAL_ASM( -.text -glabel constructor_menu15_cheat -/* 04CA8C 7F017F5C 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 04CA90 7F017F60 AFBF005C */ sw $ra, 0x5c($sp) -/* 04CA94 7F017F64 AFBE0058 */ sw $fp, 0x58($sp) -/* 04CA98 7F017F68 AFB70054 */ sw $s7, 0x54($sp) -/* 04CA9C 7F017F6C AFB60050 */ sw $s6, 0x50($sp) -/* 04CAA0 7F017F70 AFB5004C */ sw $s5, 0x4c($sp) -/* 04CAA4 7F017F74 AFB40048 */ sw $s4, 0x48($sp) -/* 04CAA8 7F017F78 AFB30044 */ sw $s3, 0x44($sp) -/* 04CAAC 7F017F7C AFB20040 */ sw $s2, 0x40($sp) -/* 04CAB0 7F017F80 AFB1003C */ sw $s1, 0x3c($sp) -/* 04CAB4 7F017F84 AFB00038 */ sw $s0, 0x38($sp) -/* 04CAB8 7F017F88 00002825 */ move $a1, $zero -/* 04CABC 7F017F8C 00003025 */ move $a2, $zero -/* 04CAC0 7F017F90 0C0011B4 */ jal viSetFillColor -/* 04CAC4 7F017F94 00003825 */ move $a3, $zero -/* 04CAC8 7F017F98 0C000FBE */ jal viFillScreen -/* 04CACC 7F017F9C 00402025 */ move $a0, $v0 -/* 04CAD0 7F017FA0 0FC0357A */ jal sub_GAME_7F00D5E8 -/* 04CAD4 7F017FA4 00402025 */ move $a0, $v0 -/* 04CAD8 7F017FA8 0FC2B366 */ jal microcode_constructor -/* 04CADC 7F017FAC 00402025 */ move $a0, $v0 -/* 04CAE0 7F017FB0 3C038003 */ lui $v1, %hi(totalunlockedcheats) -/* 04CAE4 7F017FB4 8C63B5DC */ lw $v1, %lo(totalunlockedcheats)($v1) -/* 04CAE8 7F017FB8 0040A025 */ move $s4, $v0 -/* 04CAEC 7F017FBC 0000F025 */ move $fp, $zero -/* 04CAF0 7F017FC0 2861000D */ slti $at, $v1, 0xd -/* 04CAF4 7F017FC4 14200003 */ bnez $at, .L7F017FD4 -/* 04CAF8 7F017FC8 00608825 */ move $s1, $v1 -/* 04CAFC 7F017FCC 10000001 */ b .L7F017FD4 -/* 04CB00 7F017FD0 2411000C */ li $s1, 12 -.L7F017FD4: -/* 04CB04 7F017FD4 1A200086 */ blez $s1, .L7F0181F0 -/* 04CB08 7F017FD8 001E7080 */ sll $t6, $fp, 2 -/* 04CB0C 7F017FDC 001EA880 */ sll $s5, $fp, 2 -/* 04CB10 7F017FE0 02BEA821 */ addu $s5, $s5, $fp -/* 04CB14 7F017FE4 3C0F8007 */ lui $t7, %hi(arrayUnlockedCheats) -/* 04CB18 7F017FE8 25EF97F0 */ addiu $t7, %lo(arrayUnlockedCheats) # addiu $t7, $t7, -0x6810 -/* 04CB1C 7F017FEC 0015A880 */ sll $s5, $s5, 2 -/* 04CB20 7F017FF0 3C178004 */ lui $s7, %hi(ptrFirstFontTableLarge) -/* 04CB24 7F017FF4 3C168004 */ lui $s6, %hi(ptrSecondFontTableLarge) -/* 04CB28 7F017FF8 26D60EB8 */ addiu $s6, %lo(ptrSecondFontTableLarge) # addiu $s6, $s6, 0xeb8 -/* 04CB2C 7F017FFC 26F70EB4 */ addiu $s7, %lo(ptrFirstFontTableLarge) # addiu $s7, $s7, 0xeb4 -/* 04CB30 7F018000 26B50035 */ addiu $s5, $s5, 0x35 -/* 04CB34 7F018004 01CF9821 */ addu $s3, $t6, $t7 -.L7F018008: -/* 04CB38 7F018008 0FC249DD */ jal cheatGetMenuTextPointer -/* 04CB3C 7F01800C 8E640000 */ lw $a0, ($s3) -/* 04CB40 7F018010 8EF80000 */ lw $t8, ($s7) -/* 04CB44 7F018014 00409025 */ move $s2, $v0 -/* 04CB48 7F018018 27A40080 */ addiu $a0, $sp, 0x80 -/* 04CB4C 7F01801C 27A5007C */ addiu $a1, $sp, 0x7c -/* 04CB50 7F018020 00403025 */ move $a2, $v0 -/* 04CB54 7F018024 8EC70000 */ lw $a3, ($s6) -/* 04CB58 7F018028 AFA00014 */ sw $zero, 0x14($sp) -/* 04CB5C 7F01802C 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04CB60 7F018030 AFB80010 */ sw $t8, 0x10($sp) -/* 04CB64 7F018034 3C198003 */ lui $t9, %hi(D_8002B5E0) -/* 04CB68 7F018038 8F39B5E0 */ lw $t9, %lo(D_8002B5E0)($t9) -/* 04CB6C 7F01803C 24020037 */ li $v0, 55 -/* 04CB70 7F018040 AFA20088 */ sw $v0, 0x88($sp) -/* 04CB74 7F018044 17D90012 */ bne $fp, $t9, .L7F018090 -/* 04CB78 7F018048 AFB50084 */ sw $s5, 0x84($sp) -/* 04CB7C 7F01804C 0FC028E7 */ jal isontab3 -/* 04CB80 7F018050 00000000 */ nop -/* 04CB84 7F018054 1440000E */ bnez $v0, .L7F018090 -/* 04CB88 7F018058 8FA30084 */ lw $v1, 0x84($sp) -/* 04CB8C 7F01805C 8FA20088 */ lw $v0, 0x88($sp) -/* 04CB90 7F018060 8FA8007C */ lw $t0, 0x7c($sp) -/* 04CB94 7F018064 2469000E */ addiu $t1, $v1, 0xe -/* 04CB98 7F018068 240A0032 */ li $t2, 50 -/* 04CB9C 7F01806C 00483821 */ addu $a3, $v0, $t0 -/* 04CBA0 7F018070 24E70005 */ addiu $a3, $a3, 5 -/* 04CBA4 7F018074 AFAA0014 */ sw $t2, 0x14($sp) -/* 04CBA8 7F018078 AFA90010 */ sw $t1, 0x10($sp) -/* 04CBAC 7F01807C 02802025 */ move $a0, $s4 -/* 04CBB0 7F018080 2466FFFF */ addiu $a2, $v1, -1 -/* 04CBB4 7F018084 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04CBB8 7F018088 2445FFFE */ addiu $a1, $v0, -2 -/* 04CBBC 7F01808C 0040A025 */ move $s4, $v0 -.L7F018090: -/* 04CBC0 7F018090 0C001107 */ jal viGetX -/* 04CBC4 7F018094 00000000 */ nop -/* 04CBC8 7F018098 00028400 */ sll $s0, $v0, 0x10 -/* 04CBCC 7F01809C 00105C03 */ sra $t3, $s0, 0x10 -/* 04CBD0 7F0180A0 0C00110B */ jal viGetY -/* 04CBD4 7F0180A4 01608025 */ move $s0, $t3 -/* 04CBD8 7F0180A8 8ECC0000 */ lw $t4, ($s6) -/* 04CBDC 7F0180AC 8EED0000 */ lw $t5, ($s7) -/* 04CBE0 7F0180B0 240E00FF */ li $t6, 255 -/* 04CBE4 7F0180B4 AFAE0018 */ sw $t6, 0x18($sp) -/* 04CBE8 7F0180B8 02802025 */ move $a0, $s4 -/* 04CBEC 7F0180BC 27A50088 */ addiu $a1, $sp, 0x88 -/* 04CBF0 7F0180C0 27A60084 */ addiu $a2, $sp, 0x84 -/* 04CBF4 7F0180C4 02403825 */ move $a3, $s2 -/* 04CBF8 7F0180C8 AFB0001C */ sw $s0, 0x1c($sp) -/* 04CBFC 7F0180CC AFA20020 */ sw $v0, 0x20($sp) -/* 04CC00 7F0180D0 AFA00024 */ sw $zero, 0x24($sp) -/* 04CC04 7F0180D4 AFA00028 */ sw $zero, 0x28($sp) -/* 04CC08 7F0180D8 AFAC0010 */ sw $t4, 0x10($sp) -/* 04CC0C 7F0180DC 0FC025D8 */ jal write_text_at_abs_coord -/* 04CC10 7F0180E0 AFAD0014 */ sw $t5, 0x14($sp) -/* 04CC14 7F0180E4 8E6F0000 */ lw $t7, ($s3) -/* 04CC18 7F0180E8 3C188007 */ lui $t8, %hi(g_CheatActivated) -/* 04CC1C 7F0180EC 0040A025 */ move $s4, $v0 -/* 04CC20 7F0180F0 030FC021 */ addu $t8, $t8, $t7 -/* 04CC24 7F0180F4 931896A0 */ lbu $t8, %lo(g_CheatActivated)($t8) -/* 04CC28 7F0180F8 34119C74 */ li $s1, 40052 -/* 04CC2C 7F0180FC 13000003 */ beqz $t8, .L7F01810C -/* 04CC30 7F018100 00000000 */ nop -/* 04CC34 7F018104 10000001 */ b .L7F01810C -/* 04CC38 7F018108 34119C73 */ li $s1, 40051 -.L7F01810C: -/* 04CC3C 7F01810C 0FC30776 */ jal langGet -/* 04CC40 7F018110 02202025 */ move $a0, $s1 -/* 04CC44 7F018114 8EF90000 */ lw $t9, ($s7) -/* 04CC48 7F018118 00409025 */ move $s2, $v0 -/* 04CC4C 7F01811C 27A40080 */ addiu $a0, $sp, 0x80 -/* 04CC50 7F018120 27A5007C */ addiu $a1, $sp, 0x7c -/* 04CC54 7F018124 00403025 */ move $a2, $v0 -/* 04CC58 7F018128 8EC70000 */ lw $a3, ($s6) -/* 04CC5C 7F01812C AFA00014 */ sw $zero, 0x14($sp) -/* 04CC60 7F018130 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04CC64 7F018134 AFB90010 */ sw $t9, 0x10($sp) -/* 04CC68 7F018138 8E680000 */ lw $t0, ($s3) -/* 04CC6C 7F01813C 3C098007 */ lui $t1, %hi(g_CheatActivated) -/* 04CC70 7F018140 240200B3 */ li $v0, 179 -/* 04CC74 7F018144 01284821 */ addu $t1, $t1, $t0 -/* 04CC78 7F018148 912996A0 */ lbu $t1, %lo(g_CheatActivated)($t1) -/* 04CC7C 7F01814C AFA20088 */ sw $v0, 0x88($sp) -/* 04CC80 7F018150 AFB50084 */ sw $s5, 0x84($sp) -/* 04CC84 7F018154 11200004 */ beqz $t1, .L7F018168 -/* 04CC88 7F018158 241100FF */ li $s1, 255 -/* 04CC8C 7F01815C 3C11A000 */ lui $s1, (0xA00000FF >> 16) # lui $s1, 0xa000 -/* 04CC90 7F018160 10000001 */ b .L7F018168 -/* 04CC94 7F018164 363100FF */ ori $s1, (0xA00000FF & 0xFFFF) # ori $s1, $s1, 0xff -.L7F018168: -/* 04CC98 7F018168 0C001107 */ jal viGetX -/* 04CC9C 7F01816C 00000000 */ nop -/* 04CCA0 7F018170 00028400 */ sll $s0, $v0, 0x10 -/* 04CCA4 7F018174 00105403 */ sra $t2, $s0, 0x10 -/* 04CCA8 7F018178 0C00110B */ jal viGetY -/* 04CCAC 7F01817C 01408025 */ move $s0, $t2 -/* 04CCB0 7F018180 8ECB0000 */ lw $t3, ($s6) -/* 04CCB4 7F018184 8EEC0000 */ lw $t4, ($s7) -/* 04CCB8 7F018188 02802025 */ move $a0, $s4 -/* 04CCBC 7F01818C 27A50088 */ addiu $a1, $sp, 0x88 -/* 04CCC0 7F018190 27A60084 */ addiu $a2, $sp, 0x84 -/* 04CCC4 7F018194 02403825 */ move $a3, $s2 -/* 04CCC8 7F018198 AFB10018 */ sw $s1, 0x18($sp) -/* 04CCCC 7F01819C AFB0001C */ sw $s0, 0x1c($sp) -/* 04CCD0 7F0181A0 AFA20020 */ sw $v0, 0x20($sp) -/* 04CCD4 7F0181A4 AFA00024 */ sw $zero, 0x24($sp) -/* 04CCD8 7F0181A8 AFA00028 */ sw $zero, 0x28($sp) -/* 04CCDC 7F0181AC AFAB0010 */ sw $t3, 0x10($sp) -/* 04CCE0 7F0181B0 0FC025D8 */ jal write_text_at_abs_coord -/* 04CCE4 7F0181B4 AFAC0014 */ sw $t4, 0x14($sp) -/* 04CCE8 7F0181B8 3C038003 */ lui $v1, %hi(totalunlockedcheats) -/* 04CCEC 7F0181BC 8C63B5DC */ lw $v1, %lo(totalunlockedcheats)($v1) -/* 04CCF0 7F0181C0 27DE0001 */ addiu $fp, $fp, 1 -/* 04CCF4 7F0181C4 26730004 */ addiu $s3, $s3, 4 -/* 04CCF8 7F0181C8 2861000D */ slti $at, $v1, 0xd -/* 04CCFC 7F0181CC 26B50014 */ addiu $s5, $s5, 0x14 -/* 04CD00 7F0181D0 14200003 */ bnez $at, .L7F0181E0 -/* 04CD04 7F0181D4 0040A025 */ move $s4, $v0 -/* 04CD08 7F0181D8 10000002 */ b .L7F0181E4 -/* 04CD0C 7F0181DC 2411000C */ li $s1, 12 -.L7F0181E0: -/* 04CD10 7F0181E0 00608825 */ move $s1, $v1 -.L7F0181E4: -/* 04CD14 7F0181E4 03D1082A */ slt $at, $fp, $s1 -/* 04CD18 7F0181E8 1420FF87 */ bnez $at, .L7F018008 -/* 04CD1C 7F0181EC 00000000 */ nop -.L7F0181F0: -/* 04CD20 7F0181F0 3C168004 */ lui $s6, %hi(ptrSecondFontTableLarge) -/* 04CD24 7F0181F4 3C178004 */ lui $s7, %hi(ptrFirstFontTableLarge) -/* 04CD28 7F0181F8 2861000D */ slti $at, $v1, 0xd -/* 04CD2C 7F0181FC 26F70EB4 */ addiu $s7, %lo(ptrFirstFontTableLarge) # addiu $s7, $s7, 0xeb4 -/* 04CD30 7F018200 1420007D */ bnez $at, .L7F0183F8 -/* 04CD34 7F018204 26D60EB8 */ addiu $s6, %lo(ptrSecondFontTableLarge) # addiu $s6, $s6, 0xeb8 -/* 04CD38 7F018208 246DFFF4 */ addiu $t5, $v1, -0xc -/* 04CD3C 7F01820C 19A0007A */ blez $t5, .L7F0183F8 -/* 04CD40 7F018210 0000F025 */ move $fp, $zero -/* 04CD44 7F018214 3C138007 */ lui $s3, %hi(arrayUnlockedCheats) -/* 04CD48 7F018218 267397F0 */ addiu $s3, %lo(arrayUnlockedCheats) # addiu $s3, $s3, -0x6810 -/* 04CD4C 7F01821C 24150035 */ li $s5, 53 -.L7F018220: -/* 04CD50 7F018220 0FC249DD */ jal cheatGetMenuTextPointer -/* 04CD54 7F018224 8E640030 */ lw $a0, 0x30($s3) -/* 04CD58 7F018228 8EEE0000 */ lw $t6, ($s7) -/* 04CD5C 7F01822C 00409025 */ move $s2, $v0 -/* 04CD60 7F018230 27A40080 */ addiu $a0, $sp, 0x80 -/* 04CD64 7F018234 27A5007C */ addiu $a1, $sp, 0x7c -/* 04CD68 7F018238 00403025 */ move $a2, $v0 -/* 04CD6C 7F01823C 8EC70000 */ lw $a3, ($s6) -/* 04CD70 7F018240 AFA00014 */ sw $zero, 0x14($sp) -/* 04CD74 7F018244 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04CD78 7F018248 AFAE0010 */ sw $t6, 0x10($sp) -/* 04CD7C 7F01824C 3C188003 */ lui $t8, %hi(D_8002B5E0) -/* 04CD80 7F018250 8F18B5E0 */ lw $t8, %lo(D_8002B5E0)($t8) -/* 04CD84 7F018254 240200DC */ li $v0, 220 -/* 04CD88 7F018258 27CF000C */ addiu $t7, $fp, 0xc -/* 04CD8C 7F01825C AFA20088 */ sw $v0, 0x88($sp) -/* 04CD90 7F018260 15F80012 */ bne $t7, $t8, .L7F0182AC -/* 04CD94 7F018264 AFB50084 */ sw $s5, 0x84($sp) -/* 04CD98 7F018268 0FC028E7 */ jal isontab3 -/* 04CD9C 7F01826C 00000000 */ nop -/* 04CDA0 7F018270 1440000E */ bnez $v0, .L7F0182AC -/* 04CDA4 7F018274 8FA30084 */ lw $v1, 0x84($sp) -/* 04CDA8 7F018278 8FA20088 */ lw $v0, 0x88($sp) -/* 04CDAC 7F01827C 8FB9007C */ lw $t9, 0x7c($sp) -/* 04CDB0 7F018280 2468000E */ addiu $t0, $v1, 0xe -/* 04CDB4 7F018284 24090032 */ li $t1, 50 -/* 04CDB8 7F018288 00593821 */ addu $a3, $v0, $t9 -/* 04CDBC 7F01828C 24E70005 */ addiu $a3, $a3, 5 -/* 04CDC0 7F018290 AFA90014 */ sw $t1, 0x14($sp) -/* 04CDC4 7F018294 AFA80010 */ sw $t0, 0x10($sp) -/* 04CDC8 7F018298 02802025 */ move $a0, $s4 -/* 04CDCC 7F01829C 2466FFFF */ addiu $a2, $v1, -1 -/* 04CDD0 7F0182A0 0FC2B405 */ jal microcode_constructor_related_to_menus -/* 04CDD4 7F0182A4 2445FFFE */ addiu $a1, $v0, -2 -/* 04CDD8 7F0182A8 0040A025 */ move $s4, $v0 -.L7F0182AC: -/* 04CDDC 7F0182AC 0C001107 */ jal viGetX -/* 04CDE0 7F0182B0 00000000 */ nop -/* 04CDE4 7F0182B4 00028400 */ sll $s0, $v0, 0x10 -/* 04CDE8 7F0182B8 00105403 */ sra $t2, $s0, 0x10 -/* 04CDEC 7F0182BC 0C00110B */ jal viGetY -/* 04CDF0 7F0182C0 01408025 */ move $s0, $t2 -/* 04CDF4 7F0182C4 8ECB0000 */ lw $t3, ($s6) -/* 04CDF8 7F0182C8 8EEC0000 */ lw $t4, ($s7) -/* 04CDFC 7F0182CC 240D00FF */ li $t5, 255 -/* 04CE00 7F0182D0 AFAD0018 */ sw $t5, 0x18($sp) -/* 04CE04 7F0182D4 02802025 */ move $a0, $s4 -/* 04CE08 7F0182D8 27A50088 */ addiu $a1, $sp, 0x88 -/* 04CE0C 7F0182DC 27A60084 */ addiu $a2, $sp, 0x84 -/* 04CE10 7F0182E0 02403825 */ move $a3, $s2 -/* 04CE14 7F0182E4 AFB0001C */ sw $s0, 0x1c($sp) -/* 04CE18 7F0182E8 AFA20020 */ sw $v0, 0x20($sp) -/* 04CE1C 7F0182EC AFA00024 */ sw $zero, 0x24($sp) -/* 04CE20 7F0182F0 AFA00028 */ sw $zero, 0x28($sp) -/* 04CE24 7F0182F4 AFAB0010 */ sw $t3, 0x10($sp) -/* 04CE28 7F0182F8 0FC025D8 */ jal write_text_at_abs_coord -/* 04CE2C 7F0182FC AFAC0014 */ sw $t4, 0x14($sp) -/* 04CE30 7F018300 8E6E0030 */ lw $t6, 0x30($s3) -/* 04CE34 7F018304 3C0F8007 */ lui $t7, %hi(g_CheatActivated) -/* 04CE38 7F018308 0040A025 */ move $s4, $v0 -/* 04CE3C 7F01830C 01EE7821 */ addu $t7, $t7, $t6 -/* 04CE40 7F018310 91EF96A0 */ lbu $t7, %lo(g_CheatActivated)($t7) -/* 04CE44 7F018314 34119C74 */ li $s1, 40052 -/* 04CE48 7F018318 11E00003 */ beqz $t7, .L7F018328 -/* 04CE4C 7F01831C 00000000 */ nop -/* 04CE50 7F018320 10000001 */ b .L7F018328 -/* 04CE54 7F018324 34119C73 */ li $s1, 40051 -.L7F018328: -/* 04CE58 7F018328 0FC30776 */ jal langGet -/* 04CE5C 7F01832C 02202025 */ move $a0, $s1 -/* 04CE60 7F018330 8EF80000 */ lw $t8, ($s7) -/* 04CE64 7F018334 00409025 */ move $s2, $v0 -/* 04CE68 7F018338 27A40080 */ addiu $a0, $sp, 0x80 -/* 04CE6C 7F01833C 27A5007C */ addiu $a1, $sp, 0x7c -/* 04CE70 7F018340 00403025 */ move $a2, $v0 -/* 04CE74 7F018344 8EC70000 */ lw $a3, ($s6) -/* 04CE78 7F018348 AFA00014 */ sw $zero, 0x14($sp) -/* 04CE7C 7F01834C 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 04CE80 7F018350 AFB80010 */ sw $t8, 0x10($sp) -/* 04CE84 7F018354 8E790030 */ lw $t9, 0x30($s3) -/* 04CE88 7F018358 3C088007 */ lui $t0, %hi(g_CheatActivated) -/* 04CE8C 7F01835C 24020158 */ li $v0, 344 -/* 04CE90 7F018360 01194021 */ addu $t0, $t0, $t9 -/* 04CE94 7F018364 910896A0 */ lbu $t0, %lo(g_CheatActivated)($t0) -/* 04CE98 7F018368 AFA20088 */ sw $v0, 0x88($sp) -/* 04CE9C 7F01836C AFB50084 */ sw $s5, 0x84($sp) -/* 04CEA0 7F018370 11000004 */ beqz $t0, .L7F018384 -/* 04CEA4 7F018374 241100FF */ li $s1, 255 -/* 04CEA8 7F018378 3C11A000 */ lui $s1, (0xA00000FF >> 16) # lui $s1, 0xa000 -/* 04CEAC 7F01837C 10000001 */ b .L7F018384 -/* 04CEB0 7F018380 363100FF */ ori $s1, (0xA00000FF & 0xFFFF) # ori $s1, $s1, 0xff -.L7F018384: -/* 04CEB4 7F018384 0C001107 */ jal viGetX -/* 04CEB8 7F018388 00000000 */ nop -/* 04CEBC 7F01838C 00028400 */ sll $s0, $v0, 0x10 -/* 04CEC0 7F018390 00104C03 */ sra $t1, $s0, 0x10 -/* 04CEC4 7F018394 0C00110B */ jal viGetY -/* 04CEC8 7F018398 01208025 */ move $s0, $t1 -/* 04CECC 7F01839C 8ECA0000 */ lw $t2, ($s6) -/* 04CED0 7F0183A0 8EEB0000 */ lw $t3, ($s7) -/* 04CED4 7F0183A4 02802025 */ move $a0, $s4 -/* 04CED8 7F0183A8 27A50088 */ addiu $a1, $sp, 0x88 -/* 04CEDC 7F0183AC 27A60084 */ addiu $a2, $sp, 0x84 -/* 04CEE0 7F0183B0 02403825 */ move $a3, $s2 -/* 04CEE4 7F0183B4 AFB10018 */ sw $s1, 0x18($sp) -/* 04CEE8 7F0183B8 AFB0001C */ sw $s0, 0x1c($sp) -/* 04CEEC 7F0183BC AFA20020 */ sw $v0, 0x20($sp) -/* 04CEF0 7F0183C0 AFA00024 */ sw $zero, 0x24($sp) -/* 04CEF4 7F0183C4 AFA00028 */ sw $zero, 0x28($sp) -/* 04CEF8 7F0183C8 AFAA0010 */ sw $t2, 0x10($sp) -/* 04CEFC 7F0183CC 0FC025D8 */ jal write_text_at_abs_coord -/* 04CF00 7F0183D0 AFAB0014 */ sw $t3, 0x14($sp) -/* 04CF04 7F0183D4 3C0C8003 */ lui $t4, %hi(totalunlockedcheats) -/* 04CF08 7F0183D8 8D8CB5DC */ lw $t4, %lo(totalunlockedcheats)($t4) -/* 04CF0C 7F0183DC 27DE0001 */ addiu $fp, $fp, 1 -/* 04CF10 7F0183E0 26730004 */ addiu $s3, $s3, 4 -/* 04CF14 7F0183E4 258DFFF4 */ addiu $t5, $t4, -0xc -/* 04CF18 7F0183E8 03CD082A */ slt $at, $fp, $t5 -/* 04CF1C 7F0183EC 26B50014 */ addiu $s5, $s5, 0x14 -/* 04CF20 7F0183F0 1420FF8B */ bnez $at, .L7F018220 -/* 04CF24 7F0183F4 0040A025 */ move $s4, $v0 -.L7F0183F8: -/* 04CF28 7F0183F8 0FC0288E */ jal add_tab3_previous -/* 04CF2C 7F0183FC 02802025 */ move $a0, $s4 -/* 04CF30 7F018400 0FC027C2 */ jal load_draw_selected_icon_folder_select -/* 04CF34 7F018404 00402025 */ move $a0, $v0 -/* 04CF38 7F018408 8FBF005C */ lw $ra, 0x5c($sp) -/* 04CF3C 7F01840C 8FB00038 */ lw $s0, 0x38($sp) -/* 04CF40 7F018410 8FB1003C */ lw $s1, 0x3c($sp) -/* 04CF44 7F018414 8FB20040 */ lw $s2, 0x40($sp) -/* 04CF48 7F018418 8FB30044 */ lw $s3, 0x44($sp) -/* 04CF4C 7F01841C 8FB40048 */ lw $s4, 0x48($sp) -/* 04CF50 7F018420 8FB5004C */ lw $s5, 0x4c($sp) -/* 04CF54 7F018424 8FB60050 */ lw $s6, 0x50($sp) -/* 04CF58 7F018428 8FB70054 */ lw $s7, 0x54($sp) -/* 04CF5C 7F01842C 8FBE0058 */ lw $fp, 0x58($sp) -/* 04CF60 7F018430 03E00008 */ jr $ra -/* 04CF64 7F018434 27BD0098 */ addiu $sp, $sp, 0x98 -) -#endif + DL = viSetFillColor(DL,0,0,0); + DL = viFillScreen(DL); #ifdef VERSION_EU -GLOBAL_ASM( -.text -glabel constructor_menu15_cheat -/* 04A8A8 7F017EB8 27BDFF68 */ addiu $sp, $sp, -0x98 -/* 04A8AC 7F017EBC AFBF005C */ sw $ra, 0x5c($sp) -/* 04A8B0 7F017EC0 AFBE0058 */ sw $fp, 0x58($sp) -/* 04A8B4 7F017EC4 AFB70054 */ sw $s7, 0x54($sp) -/* 04A8B8 7F017EC8 AFB60050 */ sw $s6, 0x50($sp) -/* 04A8BC 7F017ECC AFB5004C */ sw $s5, 0x4c($sp) -/* 04A8C0 7F017ED0 AFB40048 */ sw $s4, 0x48($sp) -/* 04A8C4 7F017ED4 AFB30044 */ sw $s3, 0x44($sp) -/* 04A8C8 7F017ED8 AFB20040 */ sw $s2, 0x40($sp) -/* 04A8CC 7F017EDC AFB1003C */ sw $s1, 0x3c($sp) -/* 04A8D0 7F017EE0 AFB00038 */ sw $s0, 0x38($sp) -/* 04A8D4 7F017EE4 00002825 */ move $a1, $zero -/* 04A8D8 7F017EE8 00003025 */ move $a2, $zero -/* 04A8DC 7F017EEC 0C001048 */ jal viSetFillColor -/* 04A8E0 7F017EF0 00003825 */ move $a3, $zero -/* 04A8E4 7F017EF4 0C000E52 */ jal viFillScreen -/* 04A8E8 7F017EF8 00402025 */ move $a0, $v0 -/* 04A8EC 7F017EFC 0C000E52 */ jal viFillScreen -/* 04A8F0 7F017F00 00402025 */ move $a0, $v0 -/* 04A8F4 7F017F04 0C000E52 */ jal viFillScreen -/* 04A8F8 7F017F08 00402025 */ move $a0, $v0 -/* 04A8FC 7F017F0C 0C000E52 */ jal viFillScreen -/* 04A900 7F017F10 00402025 */ move $a0, $v0 -/* 04A904 7F017F14 0FC0353A */ jal sub_GAME_7F00D5E8 -/* 04A908 7F017F18 00402025 */ move $a0, $v0 -/* 04A90C 7F017F1C 0FC2B016 */ jal microcode_constructor -/* 04A910 7F017F20 00402025 */ move $a0, $v0 -/* 04A914 7F017F24 3C038002 */ lui $v1, %hi(totalunlockedcheats) # $v1, 0x8002 -/* 04A918 7F017F28 8C636B2C */ lw $v1, %lo(totalunlockedcheats)($v1) -/* 04A91C 7F017F2C 0040A025 */ move $s4, $v0 -/* 04A920 7F017F30 0000F025 */ move $fp, $zero -/* 04A924 7F017F34 2861000D */ slti $at, $v1, 0xd -/* 04A928 7F017F38 14200003 */ bnez $at, .L7F017F48 -/* 04A92C 7F017F3C 00608825 */ move $s1, $v1 -/* 04A930 7F017F40 10000001 */ b .L7F017F48 -/* 04A934 7F017F44 2411000C */ li $s1, 12 -.L7F017F48: -/* 04A938 7F017F48 1A200086 */ blez $s1, .L7F018164 -/* 04A93C 7F017F4C 001E7080 */ sll $t6, $fp, 2 -/* 04A940 7F017F50 001EA880 */ sll $s5, $fp, 2 -/* 04A944 7F017F54 02BEA821 */ addu $s5, $s5, $fp -/* 04A948 7F017F58 3C0F8006 */ lui $t7, %hi(arrayUnlockedCheats) # $t7, 0x8006 -/* 04A94C 7F017F5C 25EF8730 */ addiu $t7, %lo(arrayUnlockedCheats) # addiu $t7, $t7, -0x78d0 -/* 04A950 7F017F60 0015A880 */ sll $s5, $s5, 2 -/* 04A954 7F017F64 3C178004 */ lui $s7, %hi(ptrFirstFontTableLarge) # $s7, 0x8004 -/* 04A958 7F017F68 3C168004 */ lui $s6, %hi(ptrSecondFontTableLarge) # $s6, 0x8004 -/* 04A95C 7F017F6C 26D6AB08 */ addiu $s6, %lo(ptrSecondFontTableLarge) # addiu $s6, $s6, -0x54f8 -/* 04A960 7F017F70 26F7AB04 */ addiu $s7, %lo(ptrFirstFontTableLarge) # addiu $s7, $s7, -0x54fc -/* 04A964 7F017F74 26B50035 */ addiu $s5, $s5, 0x35 -/* 04A968 7F017F78 01CF9821 */ addu $s3, $t6, $t7 -.L7F017F7C: -/* 04A96C 7F017F7C 0FC24725 */ jal cheatGetMenuTextPointer -/* 04A970 7F017F80 8E640000 */ lw $a0, ($s3) -/* 04A974 7F017F84 8EF80000 */ lw $t8, ($s7) -/* 04A978 7F017F88 00409025 */ move $s2, $v0 -/* 04A97C 7F017F8C 27A40080 */ addiu $a0, $sp, 0x80 -/* 04A980 7F017F90 27A5007C */ addiu $a1, $sp, 0x7c -/* 04A984 7F017F94 00403025 */ move $a2, $v0 -/* 04A988 7F017F98 8EC70000 */ lw $a3, ($s6) -/* 04A98C 7F017F9C AFA00014 */ sw $zero, 0x14($sp) -/* 04A990 7F017FA0 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 04A994 7F017FA4 AFB80010 */ sw $t8, 0x10($sp) -/* 04A998 7F017FA8 3C198002 */ lui $t9, %hi(D_8002B5E0) # $t9, 0x8002 -/* 04A99C 7F017FAC 8F396B30 */ lw $t9, %lo(D_8002B5E0)($t9) -/* 04A9A0 7F017FB0 24020037 */ li $v0, 55 -/* 04A9A4 7F017FB4 AFA20088 */ sw $v0, 0x88($sp) -/* 04A9A8 7F017FB8 17D90012 */ bne $fp, $t9, .L7F018004 -/* 04A9AC 7F017FBC AFB50084 */ sw $s5, 0x84($sp) -/* 04A9B0 7F017FC0 0FC028A7 */ jal isontab3 -/* 04A9B4 7F017FC4 00000000 */ nop -/* 04A9B8 7F017FC8 1440000E */ bnez $v0, .L7F018004 -/* 04A9BC 7F017FCC 8FA30084 */ lw $v1, 0x84($sp) -/* 04A9C0 7F017FD0 8FA20088 */ lw $v0, 0x88($sp) -/* 04A9C4 7F017FD4 8FA8007C */ lw $t0, 0x7c($sp) -/* 04A9C8 7F017FD8 2469000E */ addiu $t1, $v1, 0xe -/* 04A9CC 7F017FDC 240A0032 */ li $t2, 50 -/* 04A9D0 7F017FE0 00483821 */ addu $a3, $v0, $t0 -/* 04A9D4 7F017FE4 24E70005 */ addiu $a3, $a3, 5 -/* 04A9D8 7F017FE8 AFAA0014 */ sw $t2, 0x14($sp) -/* 04A9DC 7F017FEC AFA90010 */ sw $t1, 0x10($sp) -/* 04A9E0 7F017FF0 02802025 */ move $a0, $s4 -/* 04A9E4 7F017FF4 2466FFFF */ addiu $a2, $v1, -1 -/* 04A9E8 7F017FF8 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 04A9EC 7F017FFC 2445FFFE */ addiu $a1, $v0, -2 -/* 04A9F0 7F018000 0040A025 */ move $s4, $v0 -.L7F018004: -/* 04A9F4 7F018004 0C000F9B */ jal viGetX -/* 04A9F8 7F018008 00000000 */ nop -/* 04A9FC 7F01800C 00028400 */ sll $s0, $v0, 0x10 -/* 04AA00 7F018010 00105C03 */ sra $t3, $s0, 0x10 -/* 04AA04 7F018014 0C000F9F */ jal viGetY -/* 04AA08 7F018018 01608025 */ move $s0, $t3 -/* 04AA0C 7F01801C 8ECC0000 */ lw $t4, ($s6) -/* 04AA10 7F018020 8EED0000 */ lw $t5, ($s7) -/* 04AA14 7F018024 240E00FF */ li $t6, 255 -/* 04AA18 7F018028 AFAE0018 */ sw $t6, 0x18($sp) -/* 04AA1C 7F01802C 02802025 */ move $a0, $s4 -/* 04AA20 7F018030 27A50088 */ addiu $a1, $sp, 0x88 -/* 04AA24 7F018034 27A60084 */ addiu $a2, $sp, 0x84 -/* 04AA28 7F018038 02403825 */ move $a3, $s2 -/* 04AA2C 7F01803C AFB0001C */ sw $s0, 0x1c($sp) -/* 04AA30 7F018040 AFA20020 */ sw $v0, 0x20($sp) -/* 04AA34 7F018044 AFA00024 */ sw $zero, 0x24($sp) -/* 04AA38 7F018048 AFA00028 */ sw $zero, 0x28($sp) -/* 04AA3C 7F01804C AFAC0010 */ sw $t4, 0x10($sp) -/* 04AA40 7F018050 0FC02598 */ jal write_text_at_abs_coord -/* 04AA44 7F018054 AFAD0014 */ sw $t5, 0x14($sp) -/* 04AA48 7F018058 8E6F0000 */ lw $t7, ($s3) -/* 04AA4C 7F01805C 3C188006 */ lui $t8, 0x8006 -/* 04AA50 7F018060 0040A025 */ move $s4, $v0 -/* 04AA54 7F018064 030FC021 */ addu $t8, $t8, $t7 -/* 04AA58 7F018068 931885E0 */ lbu $t8, -0x7a20($t8) -/* 04AA5C 7F01806C 34119C74 */ li $s1, 40052 -/* 04AA60 7F018070 13000003 */ beqz $t8, .L7F018080 -/* 04AA64 7F018074 00000000 */ nop -/* 04AA68 7F018078 10000001 */ b .L7F018080 -/* 04AA6C 7F01807C 34119C73 */ li $s1, 40051 -.L7F018080: -/* 04AA70 7F018080 0FC304AE */ jal langGet -/* 04AA74 7F018084 02202025 */ move $a0, $s1 -/* 04AA78 7F018088 8EF90000 */ lw $t9, ($s7) -/* 04AA7C 7F01808C 00409025 */ move $s2, $v0 -/* 04AA80 7F018090 27A40080 */ addiu $a0, $sp, 0x80 -/* 04AA84 7F018094 27A5007C */ addiu $a1, $sp, 0x7c -/* 04AA88 7F018098 00403025 */ move $a2, $v0 -/* 04AA8C 7F01809C 8EC70000 */ lw $a3, ($s6) -/* 04AA90 7F0180A0 AFA00014 */ sw $zero, 0x14($sp) -/* 04AA94 7F0180A4 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 04AA98 7F0180A8 AFB90010 */ sw $t9, 0x10($sp) -/* 04AA9C 7F0180AC 8E680000 */ lw $t0, ($s3) -/* 04AAA0 7F0180B0 3C098006 */ lui $t1, 0x8006 -/* 04AAA4 7F0180B4 240200B3 */ li $v0, 179 -/* 04AAA8 7F0180B8 01284821 */ addu $t1, $t1, $t0 -/* 04AAAC 7F0180BC 912985E0 */ lbu $t1, -0x7a20($t1) -/* 04AAB0 7F0180C0 AFA20088 */ sw $v0, 0x88($sp) -/* 04AAB4 7F0180C4 AFB50084 */ sw $s5, 0x84($sp) -/* 04AAB8 7F0180C8 11200004 */ beqz $t1, .L7F0180DC -/* 04AABC 7F0180CC 241100FF */ li $s1, 255 -/* 04AAC0 7F0180D0 3C11A000 */ lui $s1, (0xA00000FF >> 16) # lui $s1, 0xa000 -/* 04AAC4 7F0180D4 10000001 */ b .L7F0180DC -/* 04AAC8 7F0180D8 363100FF */ ori $s1, (0xA00000FF & 0xFFFF) # ori $s1, $s1, 0xff -.L7F0180DC: -/* 04AACC 7F0180DC 0C000F9B */ jal viGetX -/* 04AAD0 7F0180E0 00000000 */ nop -/* 04AAD4 7F0180E4 00028400 */ sll $s0, $v0, 0x10 -/* 04AAD8 7F0180E8 00105403 */ sra $t2, $s0, 0x10 -/* 04AADC 7F0180EC 0C000F9F */ jal viGetY -/* 04AAE0 7F0180F0 01408025 */ move $s0, $t2 -/* 04AAE4 7F0180F4 8ECB0000 */ lw $t3, ($s6) -/* 04AAE8 7F0180F8 8EEC0000 */ lw $t4, ($s7) -/* 04AAEC 7F0180FC 02802025 */ move $a0, $s4 -/* 04AAF0 7F018100 27A50088 */ addiu $a1, $sp, 0x88 -/* 04AAF4 7F018104 27A60084 */ addiu $a2, $sp, 0x84 -/* 04AAF8 7F018108 02403825 */ move $a3, $s2 -/* 04AAFC 7F01810C AFB10018 */ sw $s1, 0x18($sp) -/* 04AB00 7F018110 AFB0001C */ sw $s0, 0x1c($sp) -/* 04AB04 7F018114 AFA20020 */ sw $v0, 0x20($sp) -/* 04AB08 7F018118 AFA00024 */ sw $zero, 0x24($sp) -/* 04AB0C 7F01811C AFA00028 */ sw $zero, 0x28($sp) -/* 04AB10 7F018120 AFAB0010 */ sw $t3, 0x10($sp) -/* 04AB14 7F018124 0FC02598 */ jal write_text_at_abs_coord -/* 04AB18 7F018128 AFAC0014 */ sw $t4, 0x14($sp) -/* 04AB1C 7F01812C 3C038002 */ lui $v1, %hi(totalunlockedcheats) # $v1, 0x8002 -/* 04AB20 7F018130 8C636B2C */ lw $v1, %lo(totalunlockedcheats)($v1) -/* 04AB24 7F018134 27DE0001 */ addiu $fp, $fp, 1 -/* 04AB28 7F018138 26730004 */ addiu $s3, $s3, 4 -/* 04AB2C 7F01813C 2861000D */ slti $at, $v1, 0xd -/* 04AB30 7F018140 26B50014 */ addiu $s5, $s5, 0x14 -/* 04AB34 7F018144 14200003 */ bnez $at, .L7F018154 -/* 04AB38 7F018148 0040A025 */ move $s4, $v0 -/* 04AB3C 7F01814C 10000002 */ b .L7F018158 -/* 04AB40 7F018150 2411000C */ li $s1, 12 -.L7F018154: -/* 04AB44 7F018154 00608825 */ move $s1, $v1 -.L7F018158: -/* 04AB48 7F018158 03D1082A */ slt $at, $fp, $s1 -/* 04AB4C 7F01815C 1420FF87 */ bnez $at, .L7F017F7C -/* 04AB50 7F018160 00000000 */ nop -.L7F018164: -/* 04AB54 7F018164 3C168004 */ lui $s6, %hi(ptrSecondFontTableLarge) # $s6, 0x8004 -/* 04AB58 7F018168 3C178004 */ lui $s7, %hi(ptrFirstFontTableLarge) # $s7, 0x8004 -/* 04AB5C 7F01816C 2861000D */ slti $at, $v1, 0xd -/* 04AB60 7F018170 26F7AB04 */ addiu $s7, %lo(ptrFirstFontTableLarge) # addiu $s7, $s7, -0x54fc -/* 04AB64 7F018174 1420007D */ bnez $at, .L7F01836C -/* 04AB68 7F018178 26D6AB08 */ addiu $s6, %lo(ptrSecondFontTableLarge) # addiu $s6, $s6, -0x54f8 -/* 04AB6C 7F01817C 246DFFF4 */ addiu $t5, $v1, -0xc -/* 04AB70 7F018180 19A0007A */ blez $t5, .L7F01836C -/* 04AB74 7F018184 0000F025 */ move $fp, $zero -/* 04AB78 7F018188 3C138006 */ lui $s3, %hi(arrayUnlockedCheats) # $s3, 0x8006 -/* 04AB7C 7F01818C 26738730 */ addiu $s3, %lo(arrayUnlockedCheats) # addiu $s3, $s3, -0x78d0 -/* 04AB80 7F018190 24150035 */ li $s5, 53 -.L7F018194: -/* 04AB84 7F018194 0FC24725 */ jal cheatGetMenuTextPointer -/* 04AB88 7F018198 8E640030 */ lw $a0, 0x30($s3) -/* 04AB8C 7F01819C 8EEE0000 */ lw $t6, ($s7) -/* 04AB90 7F0181A0 00409025 */ move $s2, $v0 -/* 04AB94 7F0181A4 27A40080 */ addiu $a0, $sp, 0x80 -/* 04AB98 7F0181A8 27A5007C */ addiu $a1, $sp, 0x7c -/* 04AB9C 7F0181AC 00403025 */ move $a2, $v0 -/* 04ABA0 7F0181B0 8EC70000 */ lw $a3, ($s6) -/* 04ABA4 7F0181B4 AFA00014 */ sw $zero, 0x14($sp) -/* 04ABA8 7F0181B8 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 04ABAC 7F0181BC AFAE0010 */ sw $t6, 0x10($sp) -/* 04ABB0 7F0181C0 3C188002 */ lui $t8, %hi(D_8002B5E0) # $t8, 0x8002 -/* 04ABB4 7F0181C4 8F186B30 */ lw $t8, %lo(D_8002B5E0)($t8) -/* 04ABB8 7F0181C8 240200DC */ li $v0, 220 -/* 04ABBC 7F0181CC 27CF000C */ addiu $t7, $fp, 0xc -/* 04ABC0 7F0181D0 AFA20088 */ sw $v0, 0x88($sp) -/* 04ABC4 7F0181D4 15F80012 */ bne $t7, $t8, .L7F018220 -/* 04ABC8 7F0181D8 AFB50084 */ sw $s5, 0x84($sp) -/* 04ABCC 7F0181DC 0FC028A7 */ jal isontab3 -/* 04ABD0 7F0181E0 00000000 */ nop -/* 04ABD4 7F0181E4 1440000E */ bnez $v0, .L7F018220 -/* 04ABD8 7F0181E8 8FA30084 */ lw $v1, 0x84($sp) -/* 04ABDC 7F0181EC 8FA20088 */ lw $v0, 0x88($sp) -/* 04ABE0 7F0181F0 8FB9007C */ lw $t9, 0x7c($sp) -/* 04ABE4 7F0181F4 2468000E */ addiu $t0, $v1, 0xe -/* 04ABE8 7F0181F8 24090032 */ li $t1, 50 -/* 04ABEC 7F0181FC 00593821 */ addu $a3, $v0, $t9 -/* 04ABF0 7F018200 24E70005 */ addiu $a3, $a3, 5 -/* 04ABF4 7F018204 AFA90014 */ sw $t1, 0x14($sp) -/* 04ABF8 7F018208 AFA80010 */ sw $t0, 0x10($sp) -/* 04ABFC 7F01820C 02802025 */ move $a0, $s4 -/* 04AC00 7F018210 2466FFFF */ addiu $a2, $v1, -1 -/* 04AC04 7F018214 0FC2B0B5 */ jal microcode_constructor_related_to_menus -/* 04AC08 7F018218 2445FFFE */ addiu $a1, $v0, -2 -/* 04AC0C 7F01821C 0040A025 */ move $s4, $v0 -.L7F018220: -/* 04AC10 7F018220 0C000F9B */ jal viGetX -/* 04AC14 7F018224 00000000 */ nop -/* 04AC18 7F018228 00028400 */ sll $s0, $v0, 0x10 -/* 04AC1C 7F01822C 00105403 */ sra $t2, $s0, 0x10 -/* 04AC20 7F018230 0C000F9F */ jal viGetY -/* 04AC24 7F018234 01408025 */ move $s0, $t2 -/* 04AC28 7F018238 8ECB0000 */ lw $t3, ($s6) -/* 04AC2C 7F01823C 8EEC0000 */ lw $t4, ($s7) -/* 04AC30 7F018240 240D00FF */ li $t5, 255 -/* 04AC34 7F018244 AFAD0018 */ sw $t5, 0x18($sp) -/* 04AC38 7F018248 02802025 */ move $a0, $s4 -/* 04AC3C 7F01824C 27A50088 */ addiu $a1, $sp, 0x88 -/* 04AC40 7F018250 27A60084 */ addiu $a2, $sp, 0x84 -/* 04AC44 7F018254 02403825 */ move $a3, $s2 -/* 04AC48 7F018258 AFB0001C */ sw $s0, 0x1c($sp) -/* 04AC4C 7F01825C AFA20020 */ sw $v0, 0x20($sp) -/* 04AC50 7F018260 AFA00024 */ sw $zero, 0x24($sp) -/* 04AC54 7F018264 AFA00028 */ sw $zero, 0x28($sp) -/* 04AC58 7F018268 AFAB0010 */ sw $t3, 0x10($sp) -/* 04AC5C 7F01826C 0FC02598 */ jal write_text_at_abs_coord -/* 04AC60 7F018270 AFAC0014 */ sw $t4, 0x14($sp) -/* 04AC64 7F018274 8E6E0030 */ lw $t6, 0x30($s3) -/* 04AC68 7F018278 3C0F8006 */ lui $t7, 0x8006 -/* 04AC6C 7F01827C 0040A025 */ move $s4, $v0 -/* 04AC70 7F018280 01EE7821 */ addu $t7, $t7, $t6 -/* 04AC74 7F018284 91EF85E0 */ lbu $t7, -0x7a20($t7) -/* 04AC78 7F018288 34119C74 */ li $s1, 40052 -/* 04AC7C 7F01828C 11E00003 */ beqz $t7, .L7F01829C -/* 04AC80 7F018290 00000000 */ nop -/* 04AC84 7F018294 10000001 */ b .L7F01829C -/* 04AC88 7F018298 34119C73 */ li $s1, 40051 -.L7F01829C: -/* 04AC8C 7F01829C 0FC304AE */ jal langGet -/* 04AC90 7F0182A0 02202025 */ move $a0, $s1 -/* 04AC94 7F0182A4 8EF80000 */ lw $t8, ($s7) -/* 04AC98 7F0182A8 00409025 */ move $s2, $v0 -/* 04AC9C 7F0182AC 27A40080 */ addiu $a0, $sp, 0x80 -/* 04ACA0 7F0182B0 27A5007C */ addiu $a1, $sp, 0x7c -/* 04ACA4 7F0182B4 00403025 */ move $a2, $v0 -/* 04ACA8 7F0182B8 8EC70000 */ lw $a3, ($s6) -/* 04ACAC 7F0182BC AFA00014 */ sw $zero, 0x14($sp) -/* 04ACB0 7F0182C0 0FC2B713 */ jal sub_GAME_7F0AE98C -/* 04ACB4 7F0182C4 AFB80010 */ sw $t8, 0x10($sp) -/* 04ACB8 7F0182C8 8E790030 */ lw $t9, 0x30($s3) -/* 04ACBC 7F0182CC 3C088006 */ lui $t0, 0x8006 -/* 04ACC0 7F0182D0 24020158 */ li $v0, 344 -/* 04ACC4 7F0182D4 01194021 */ addu $t0, $t0, $t9 -/* 04ACC8 7F0182D8 910885E0 */ lbu $t0, -0x7a20($t0) -/* 04ACCC 7F0182DC AFA20088 */ sw $v0, 0x88($sp) -/* 04ACD0 7F0182E0 AFB50084 */ sw $s5, 0x84($sp) -/* 04ACD4 7F0182E4 11000004 */ beqz $t0, .L7F0182F8 -/* 04ACD8 7F0182E8 241100FF */ li $s1, 255 -/* 04ACDC 7F0182EC 3C11A000 */ lui $s1, (0xA00000FF >> 16) # lui $s1, 0xa000 -/* 04ACE0 7F0182F0 10000001 */ b .L7F0182F8 -/* 04ACE4 7F0182F4 363100FF */ ori $s1, (0xA00000FF & 0xFFFF) # ori $s1, $s1, 0xff -.L7F0182F8: -/* 04ACE8 7F0182F8 0C000F9B */ jal viGetX -/* 04ACEC 7F0182FC 00000000 */ nop -/* 04ACF0 7F018300 00028400 */ sll $s0, $v0, 0x10 -/* 04ACF4 7F018304 00104C03 */ sra $t1, $s0, 0x10 -/* 04ACF8 7F018308 0C000F9F */ jal viGetY -/* 04ACFC 7F01830C 01208025 */ move $s0, $t1 -/* 04AD00 7F018310 8ECA0000 */ lw $t2, ($s6) -/* 04AD04 7F018314 8EEB0000 */ lw $t3, ($s7) -/* 04AD08 7F018318 02802025 */ move $a0, $s4 -/* 04AD0C 7F01831C 27A50088 */ addiu $a1, $sp, 0x88 -/* 04AD10 7F018320 27A60084 */ addiu $a2, $sp, 0x84 -/* 04AD14 7F018324 02403825 */ move $a3, $s2 -/* 04AD18 7F018328 AFB10018 */ sw $s1, 0x18($sp) -/* 04AD1C 7F01832C AFB0001C */ sw $s0, 0x1c($sp) -/* 04AD20 7F018330 AFA20020 */ sw $v0, 0x20($sp) -/* 04AD24 7F018334 AFA00024 */ sw $zero, 0x24($sp) -/* 04AD28 7F018338 AFA00028 */ sw $zero, 0x28($sp) -/* 04AD2C 7F01833C AFAA0010 */ sw $t2, 0x10($sp) -/* 04AD30 7F018340 0FC02598 */ jal write_text_at_abs_coord -/* 04AD34 7F018344 AFAB0014 */ sw $t3, 0x14($sp) -/* 04AD38 7F018348 3C0C8002 */ lui $t4, %hi(totalunlockedcheats) # $t4, 0x8002 -/* 04AD3C 7F01834C 8D8C6B2C */ lw $t4, %lo(totalunlockedcheats)($t4) -/* 04AD40 7F018350 27DE0001 */ addiu $fp, $fp, 1 -/* 04AD44 7F018354 26730004 */ addiu $s3, $s3, 4 -/* 04AD48 7F018358 258DFFF4 */ addiu $t5, $t4, -0xc -/* 04AD4C 7F01835C 03CD082A */ slt $at, $fp, $t5 -/* 04AD50 7F018360 26B50014 */ addiu $s5, $s5, 0x14 -/* 04AD54 7F018364 1420FF8B */ bnez $at, .L7F018194 -/* 04AD58 7F018368 0040A025 */ move $s4, $v0 -.L7F01836C: -/* 04AD5C 7F01836C 0FC0284E */ jal add_tab3_previous -/* 04AD60 7F018370 02802025 */ move $a0, $s4 -/* 04AD64 7F018374 0FC02782 */ jal load_draw_selected_icon_folder_select -/* 04AD68 7F018378 00402025 */ move $a0, $v0 -/* 04AD6C 7F01837C 8FBF005C */ lw $ra, 0x5c($sp) -/* 04AD70 7F018380 8FB00038 */ lw $s0, 0x38($sp) -/* 04AD74 7F018384 8FB1003C */ lw $s1, 0x3c($sp) -/* 04AD78 7F018388 8FB20040 */ lw $s2, 0x40($sp) -/* 04AD7C 7F01838C 8FB30044 */ lw $s3, 0x44($sp) -/* 04AD80 7F018390 8FB40048 */ lw $s4, 0x48($sp) -/* 04AD84 7F018394 8FB5004C */ lw $s5, 0x4c($sp) -/* 04AD88 7F018398 8FB60050 */ lw $s6, 0x50($sp) -/* 04AD8C 7F01839C 8FB70054 */ lw $s7, 0x54($sp) -/* 04AD90 7F0183A0 8FBE0058 */ lw $fp, 0x58($sp) -/* 04AD94 7F0183A4 03E00008 */ jr $ra -/* 04AD98 7F0183A8 27BD0098 */ addiu $sp, $sp, 0x98 -) -#endif + DL = viFillScreen(DL); + DL = viFillScreen(DL); + DL = viFillScreen(DL); #endif + DL = sub_GAME_7F00D5E8(DL); + DL = microcode_constructor(DL); + + for (var_fp = 0; var_fp < ((totalunlockedcheats >= 0xD) ? 0xC : totalunlockedcheats); var_fp++) + { + temp_v0 = cheatGetMenuTextPointer(arrayUnlockedCheats[var_fp]); + textMeasure(&sp80, &sp7C, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp88 = 0x37; + sp84 = (var_fp * 0x14) + 0x35; + if ((var_fp == D_8002B5E0) && (isontab3() == 0)) + { + DL = microcode_constructor_related_to_menus(DL, sp88 - 2, sp84 - 1, sp88 + sp7C + 5, sp84 + 0xE, 0x32); + } + + DL = write_text_at_abs_coord(DL, &sp88, &sp84, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + var_s1 = (g_CheatActivated[arrayUnlockedCheats[var_fp]]) ? 0x9C73 : 0x9C74; + temp_v0 = langGet(var_s1); + textMeasure(&sp80, &sp7C, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp88 = 0xB3; + sp84 = (var_fp * 0x14) + 0x35; + + DL = write_text_at_abs_coord(DL, &sp88, &sp84, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, (g_CheatActivated[arrayUnlockedCheats[var_fp]]) ? 0xA00000FF : 0xFF, viGetX(), viGetY(), 0, 0); + } + + if (totalunlockedcheats >= 0xd) + { + for (var_fp = 0; var_fp < (totalunlockedcheats - 0xC); var_fp++) + { + temp_v0 = cheatGetMenuTextPointer(arrayUnlockedCheats[var_fp + 12]); + textMeasure(&sp80, &sp7C, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp88 = 0xDC; + sp84 = (var_fp * 0x14) + 0x35; + if ((var_fp + 0xc == D_8002B5E0) && (isontab3() == 0)) + { + DL = microcode_constructor_related_to_menus(DL, sp88 - 2, sp84 - 1, sp88 + sp7C + 5, sp84 + 0xE, 0x32); + } + + DL = write_text_at_abs_coord(DL, &sp88, &sp84, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0xFF, viGetX(), viGetY(), 0, 0); + + var_s1 = (g_CheatActivated[arrayUnlockedCheats[var_fp + 12]]) ? 0x9C73 : 0x9C74; + temp_v0 = langGet(var_s1); + textMeasure(&sp80, &sp7C, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp88 = 0x158; + sp84 = (var_fp * 0x14) + 0x35; + var_s1 = (g_CheatActivated[arrayUnlockedCheats[var_fp + 12]]) ? 0xA00000FF : 0xFF; + + DL = write_text_at_abs_coord(DL, &sp88, &sp84, temp_v0, ptrFontZurichBoldChars, ptrFontZurichBold, var_s1, viGetX(), viGetY(), 0, 0); + } + } + + DL = add_tab3_previous(DL); + + DL = load_draw_selected_icon_folder_select(DL); + + return DL; +} + @@ -20261,302 +8348,295 @@ Gfx *constructor_menu16_nocontrollers(Gfx *DL) if ((numContCon == 0) || (numContCon == 1) || (numContCon == 2) || (numContCon == 3)) { - text = langGet(TEXT(LTITLE, 0x76)); //NO CONTROLLER IN CONTROLLER SOCKET 1 + text = langGet(TEXT(LTITLE, TITLE_STR_118)); //NO CONTROLLER IN CONTROLLER SOCKET 1 } - sub_GAME_7F0AE98C(&y2, &x2, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); + textMeasure(&y2, &x2, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); x = 0xDC - (x2 >> 1); y = 0x99 - (y2 >> 1); #ifdef BUGFIX_R1 if (j_text_trigger) { - DL = jp_text_write_stuff(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, -1, 0x8000FF, viGetX(), viGetY(), 0, 0); + DL = textRenderGlow(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, -1, 0x8000FF, viGetX(), viGetY(), 0, 0); + } + else { +#endif + DL = textRender(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); +#ifdef BUGFIX_R1 + } +#endif + + + if ((numContCon == 0) || (numContCon == 1) || (numContCon == 2) || (numContCon == 3)) { + text = langGet(TEXT(LTITLE, TITLE_STR_119)); //PLEASE POWER OFF AND ATTACH A CONTROLLER + } + textMeasure(&y2, &x2, text, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + x = 0xDC - (x2 >> 1); + y = 0xB1 - (y2 >> 1); +#ifdef BUGFIX_R1 + if (j_text_trigger) { + DL = textRenderGlow(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, -1, 0x8000FF, viGetX(), viGetY(), 0, 0); } else { #endif - DL = en_text_write_stuff(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, -1, viGetX(), viGetY(), 0, 0); + DL = textRender(DL, &x, &y, text, ptrFontZurichBoldChars, ptrFontZurichBold, -1, viGetX(), viGetY(), 0, 0); #ifdef BUGFIX_R1 } #endif + return DL; +} + + + + + + + + + +void do_extended_cast_display(s32 flag) +{ + full_actor_intro = flag; + if (flag) + { + intro_character_index = 0; + return; + } + intro_character_index = 1; +} + +//******************************************************************************************************** +//CAST SCREEN +//******************************************************************************************************** +#ifdef NONMATCHING + +// Address 0x7F01869C NTSC +// Address 0x7F018714 PAL + +// https://decomp.me/scratch/MAkgo (PAL) 97.69% +void init_menu18_displaycast(void) +{ + u8 *spB4; + s32 spB0; + s32 temp_t0; + struct coord3d spA0; + struct texpool sp90; + enum BODIES sp8C; + enum HEADS sp88; + s32 sp84; + ModelFileHeader *sp80; + ModelFileHeader *sp7C; + ModelFileHeader *sp78; + s32 padding; + s32 sp70; + s32 sp6C; + struct intro_random_rifles sp54; + struct intro_random_pistols sp2C; + + spB4 = ptr_logo_and_walletbond_DL; + + // struct copy + spA0 = D_8002BA2C; + + sp7C = NULL; + sp70 = randomGetNext() & 1; + + if ((full_actor_intro != 0) && (intro_character_index == 0)) + { + musicTrack1ApplySeqpVol(0x7FFF); + g_musicXTrack1Fade = 0; + musicTrack1Play(2); + } + + for (intro_animation_count = 0; intro_animation_table[intro_animation_count].animID >= 0; intro_animation_count++) + { + // this `for` loop just sets intro_animation_count + } + + randomly_selected_intro_animation = randomGetNext() % (u32) intro_animation_count; + + sp8C = intro_char_table[intro_character_index].body; + sp88 = intro_char_table[intro_character_index].head; + + sp6C = intro_animation_table[randomly_selected_intro_animation].camera_preset; + + if (sp8C == BODY_Special_Operations_Uniform) + { + switch (randomGetNext() % 5U) + { + case 0: + break; + + case 1: + sp8C = BODY_Formal_Wear;\ + sp88 = HEAD_Male_Brosnan_Default; + break; + + case 2: + sp8C = BODY_Jungle_Fatigues;\ + sp88 = HEAD_Male_Brosnan_Default; + break; - if ((numContCon == 0) || (numContCon == 1) || (numContCon == 2) || (numContCon == 3)) { - text = langGet(TEXT(LTITLE, 0x77)); //PLEASE POWER OFF AND ATTACH A CONTROLLER + case 3: + sp8C = BODY_Parka;\ + sp88 = HEAD_Male_Brosnan_Default; + break; + + case 4: + sp8C = BODY_Brosnan_Tuxedo;\ + sp88 = HEAD_Male_Brosnan_Tuxedo; + break; + } } - sub_GAME_7F0AE98C(&y2, &x2, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, 0); - x = 0xDC - (x2 >> 1); - y = 0xB1 - (y2 >> 1); -#ifdef BUGFIX_R1 - if (j_text_trigger) { - DL = jp_text_write_stuff(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, -1, 0x8000FF, viGetX(), viGetY(), 0, 0); + else if (sp8C == BODY_Natalya_Skirt) + { + if (randomGetNext() & 1) + { + sp8C = BODY_Natalya_Jungle_Fatigues; + } } - else { -#endif - DL = en_text_write_stuff(DL, &x, &y, text, ptrSecondFontTableLarge, ptrFirstFontTableLarge, -1, viGetX(), viGetY(), 0, 0); -#ifdef BUGFIX_R1 + else if (sp8C == BODY_Trevelyan_006 && randomGetNext() & 1) + { + sp8C = BODY_Trevelyan_Janus; } -#endif - - return DL; -} + if (sp88 == -0x61) + { + sp88 = get_random_head(sp8C); + } + // begin problem area + + temp_t0 = 0x19000; + spB0 = 0x18160 + temp_t0; + if(0); + + zbufSetBuffer(ALIGN64_V2(spB4 + spB0), 440, 330); + texInitPool(&sp90, spB4, temp_t0); + spB0 -= temp_t0; + spB4 += temp_t0; + sp80 = c_item_entries[sp8C].header; + // can't get subu a3,a3,v1 + + load_object_fill_header(c_item_entries[sp8C].header, c_item_entries[sp8C].filename, spB4, spB0, &sp90); + temp_t0 = ALIGN64_V2(get_pc_buffer_remaining_value(c_item_entries[sp8C].filename)); + // end problem area + spB0 -= temp_t0; + spB4 += temp_t0; -void do_extended_cast_display(s32 flag) -{ - full_actor_intro = flag; - if (flag) + if (sp88 >= 0) { - intro_character_index = 0; - return; + sp7C = c_item_entries[sp88].header; + + load_object_fill_header(c_item_entries[sp88].header, c_item_entries[sp88].filename, spB4, spB0, &sp90); + temp_t0 = ALIGN64_V2(get_pc_buffer_remaining_value(c_item_entries[sp88].filename)); + + spB0 -= temp_t0; + spB4 += temp_t0; } - intro_character_index = 1; -} -//******************************************************************************************************** -//CAST SCREEN -//******************************************************************************************************** -#ifdef NONMATCHING -void init_menu18_displaycast(void) -{ - ModelFileHeader *objheader; - u32 uVar2; - u32 uVar3; - int iVar4; - s32 lVar1; - u32 BVar5; - int iVar6; - s32 extraout_a2_lo; - s32 extraout_a2_lo_00; - s32 extraout_a3_lo; - int *piVar7; - int *piVar8; - int *piVar9; - int *piVar10; - float fVar11; - f32 scale; - f32 scale_00; - float extraout_f12; - f32 extraout_f12_00; - float extraout_f12_01; - f32 extraout_f14; - float extraout_f14_00; - int local_8c [10]; - int rifles [6]; - ModelFileHeader *headHeader; - HEADS headID; - BODIES bodyID; - int aiStack40 [4]; - float local_18; - s32 local_14; - s32 local_10; - undefined *local_8; - undefined *local_4; - - local_4 = ptr_logo_and_walletbond_DL; - local_18 = dword_8002BA2C; - local_14 = DAT_8002ba30; - local_10 = DAT_8002ba34; - headHeader = NULL; - uVar2 = randomGetNext(); - if ((full_actor_intro != FALSE) && (intro_character_index == 0)) { - musicTrack1ApplySeqpVol(0x7fff); - g_musicXTrack1Fade = MUSIC_FADESTATE_UNSET; - musicTrack1Play(M_INTRO); - } - intro_animation_count = 0; - if (-1 < intro_animation_table[0].animID) { - intro_animation_count = 1; - while (-1 < intro_animation_table[intro_animation_count].animID) { - intro_animation_count += 1; - } - } - randomly_selected_intro_animation = randomGetNext(); - randomly_selected_intro_animation %= intro_animation_count; - bodyID = intro_char_table[intro_character_index].body; - headID = intro_char_table[intro_character_index].head; - iVar6 = intro_animation_table[randomly_selected_intro_animation].camera_preset; - if (intro_animation_count == 0) { - trap(0x1c00); - } - if (bodyID == BODY_Special_Operations_Uniform) { - uVar3 = randomGetNext(); - if (true) { - switch(uVar3 % 5) { - case 1: - headID = HEAD_Male_Pierce_Bond_2; - bodyID = BODY_Formal_Wear; - break; - case 2: - headID = HEAD_Male_Pierce_Bond_2; - bodyID = BODY_Jungle_Fatigues; - break; - case 3: - headID = HEAD_Male_Pierce_Bond_2; - bodyID = BODY_Parka; - break; - case 4: - headID = HEAD_Male_Pierce_Bond_Tuxedo_DEFAULT; - bodyID = BODY_Tuxedo; - } - } - } - else { - if (bodyID == BODY_Natalya_Skirt) { - uVar3 = randomGetNext(); - if ((uVar3 & 1) != 0) { - bodyID = BODY_Natalya_Jungle_Fatigues; - } - } - else { - if ((bodyID == BODY_Trevelyan_006) && (uVar3 = randomGetNext(), (uVar3 & 1) != 0)) { - bodyID = BODY_Trevelyan_Janus; - } + cast_model = setup_chr_instance(sp8C, sp88, sp80, sp7C, 0); + modelSetScale((Model *) cast_model, 0.1f); + + if (sp6C != 0) + { + if (sp6C == 2) + { + // struct copy + sp54 = random_rifles_in_intro; + + sp84 = sp54.props[randomGetNext() % INTRO_RANDOM_RIFLE_LEN]; + } + else + { + // struct copy + sp2C = random_pistols_in_intro; + + sp84 = sp2C.props[randomGetNext() % INTRO_RANDOM_PISTO_LEN]; + } + + if (sp84 == PROP_CHRRUGER) // Cougar Magnum + { + if (fileIsCradleCompletedAnyFolder() == 0) + { + sp84 = PROP_CHRWPPK; + } + } + + if (sp84 == PROP_CHRLASER) + { + if (check_aztec_completed_any_folder_secret_00() == 0) + { + sp84 = PROP_CHRWPPK; + } + } + + if (sp84 == PROP_CHRGOLDEN) + { + if (fileIsEgyptCompletedOn00AnyFolder() == 0) + { + sp84 = PROP_CHRWPPK; + } + } + + //temp_v0_4 = &PitemZ_entries[sp84]; + sp78 = PitemZ_entries[sp84].header; + + load_object_fill_header(sp78, PitemZ_entries[sp84].filename, spB4, spB0, &sp90); + temp_t0 = ALIGN64_V2(get_pc_buffer_remaining_value(PitemZ_entries[sp84].filename)); + spB0 -= temp_t0; + spB4 += temp_t0; + + modelCalculateRwDataLen(sp78); + cast_model_weapon = get_obj_instance_controller_for_header(sp78); + modelSetScale((Model *) cast_model_weapon, 0.1f); + + cast_model_weapon->attachedto = cast_model; + //var_v0_2 = (sp70 != 0) ? 5 : 3; + cast_model_weapon->attachedto_objinst = cast_model->obj->Switches[(sp70 != 0) ? 5 : 3]; } - } - if (headID == 0xffffff9f) { - headID = get_random_head(bodyID); - } - local_8 = &DAT_00031160; - proc_7F0D2448(((u32)(local_4 + 0x3119f) | 0x3f) ^ 0x3f,0x1b8,0x14a); - proc_7F0CBAF4(aiStack40,(int)local_4,0x19000); - objheader = c_item_entries[bodyID].header; - local_4 = local_4 + 0x19000; - local_8 = local_8 + -0x19000; - load_object_fill_header - (objheader,(int *)c_item_entries[bodyID].filename,(int)local_4,(int)local_8, - (int)aiStack40); - iVar4 = proc_7F0BD188((u8 *)c_item_entries[bodyID].filename); - uVar3 = (iVar4 + 0x3fU | 0x3f) ^ 0x3f; - local_8 = local_8 + -uVar3; - local_4 = local_4 + uVar3; - if (-1 < (int)headID) { - headHeader = c_item_entries[headID].header; - load_object_fill_header - (headHeader,(int *)c_item_entries[headID].filename,(int)local_4,(int)local_8, - (int)aiStack40); - iVar4 = proc_7F0BD188((u8 *)c_item_entries[headID].filename); - uVar3 = (iVar4 + 0x3fU | 0x3f) ^ 0x3f; - local_8 = local_8 + -uVar3; - local_4 = local_4 + uVar3; - } - objinstance = (undefined *)setup_chr_instance(bodyID,headID,objheader,headHeader,0); - modelSetScale((int)objinstance,scale); - if (iVar6 == 0) { - ptrobjinstance = NULL; - } - else { - if (iVar6 == 2) { - rifles[0] = random_rifles_in_intro[0]; - rifles[1] = random_rifles_in_intro[1]; - rifles[3] = random_rifles_in_intro[3]; - rifles[2] = random_rifles_in_intro[2]; - rifles[4] = random_rifles_in_intro[4]; - rifles[5] = random_rifles_in_intro[5]; - uVar3 = randomGetNext(); - iVar6 = rifles[uVar3 % 6]; + else + { + cast_model_weapon = NULL; } - else { - piVar7 = random_pistols_in_intro; - piVar9 = local_8c; - do { - piVar8 = piVar7 + 3; - piVar10 = piVar9 + 3; - *piVar9 = *piVar7; - piVar9[1] = piVar7[1]; - piVar9[2] = piVar7[2]; - piVar7 = piVar8; - piVar9 = piVar10; - } while (piVar8 != random_pistols_in_intro + 9); - *piVar10 = random_pistols_in_intro[9]; - uVar3 = randomGetNext(); - iVar6 = local_8c[uVar3 % 10]; - } - if ((iVar6 == 0xbe) && (lVar1 = fileIsCradleCompletedAnyFolder(), lVar1 == 0)) { - iVar6 = 0xbf; - } - if ((iVar6 == 0xbb) && (BVar5 = check_aztec_completed_any_folder_secret_00(), BVar5 == FALSE)) { - iVar6 = 0xbf; - } - if ((iVar6 == 0xd0) && (BVar5 = fileIsEgyptCompletedOn00AnyFolder(), BVar5 == FALSE)) { - iVar6 = 0xbf; - } - objheader = (ModelFileHeader *)PitemZ_entries[iVar6].header; - load_object_fill_header - (objheader,(int *)PitemZ_entries[iVar6].filename,(int)local_4,(int)local_8, - (int)aiStack40); - proc_7F0BD188((u8 *)PitemZ_entries[iVar6].filename); - modelCalculateRwDataLen(objheader); - ptrobjinstance = (undefined *)get_obj_instance_controller_for_header((ModelFileHeader *)objheader) - ; - modelSetScale((int)ptrobjinstance,scale_00); - iVar6 = 3; - *(undefined **)(ptrobjinstance + 0x18) = objinstance; - if ((uVar2 & 1) != 0) { - iVar6 = 5; - } - *(s32 *)(ptrobjinstance + 0x1c) = - *(s32 *)(*(int *)(*(int *)(objinstance + 8) + 8) + iVar6 * 4); - } - proc_7F06CE84((int)objinstance,0x3dcccccd); - setsuboffset((int)objinstance,&local_18,extraout_a2_lo,extraout_a3_lo); - setsubroty((int)objinstance,extraout_f12,0.00000000,extraout_a2_lo_00); - proc_7F06FF18((int)objinstance,extraout_f12_00,extraout_f14); - proc_7F06FCA8((int)objinstance, - *(s32 *) - (animation_table_ptrs1 + - intro_animation_table[randomly_selected_intro_animation].animID * 4), - (char)(uVar2 & 1),extraout_f12_01, - intro_animation_table[randomly_selected_intro_animation].startframeoffset, - extraout_f14_00); - g_MenuTimer = 0; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695a4 = fVar11 * 0.00000000 * 80.00000000 + 70.00000000; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695a8 = fVar11 * 0.00000000 * 80.00000000 + 70.00000000; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695b0 = (fVar11 * 0.00000000 - 0.50000000) * flt_80051B00; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695b4 = (fVar11 * 0.00000000 - 0.50000000) * flt_80051B04; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695bc = fVar11 * 0.00000000 * 200.00000000 + -100.00000000; - iVar6 = randomGetNext(); - fVar11 = (float)iVar6; - if (iVar6 < 0) { - fVar11 = fVar11 + 4294967296.00000000; - } - DAT_800695a0 = DAT_800695a4; - dword_80069C6C = DAT_800695b0; - DAT_800695b8 = DAT_800695bc; - DAT_800695c0 = fVar11 * 0.00000000 * 200.00000000 + -100.00000000; - DAT_800695e4 = 1; - DAT_800695e8 = 0; - DAT_800695ec = 0; - DAT_800695f0 = 0; + + sub_GAME_7F06CE84(cast_model, 0.1f); + setsuboffset(cast_model, &spA0); + setsubroty(cast_model, 0.0f); +#if defined(VERSION_EU) + modelSetAnimPlaySpeed(cast_model, 0.600000023842f, 0); +#else + modelSetAnimPlaySpeed(cast_model, 0.5f, 0); +#endif + + modelSetAnimation( + cast_model, + animation_table_ptrs1[intro_animation_table[randomly_selected_intro_animation].animID], + sp70, + intro_animation_table[randomly_selected_intro_animation].startframeoffset, + intro_animation_table[randomly_selected_intro_animation].playback_speed, + 0.0f); + + g_MenuTimer = 0; + + flt_CODE_bss_800695A4 = (RANDOMGETNEXT_F32() * 80.0f) + 70.0f; + flt_CODE_bss_800695A8 = (RANDOMGETNEXT_F32() * 80.0f) + 70.0f; + flt_CODE_bss_800695B0 = (RANDOMGETNEXT_F32() - 0.5f) * 6.2831855f; + flt_CODE_bss_800695B4 = (RANDOMGETNEXT_F32() - 0.5f) * 2.5132742f; + flt_CODE_bss_800695BC = (RANDOMGETNEXT_F32() * 200.0f) + (-100.0f); + flt_CODE_bss_800695C0 = (RANDOMGETNEXT_F32() * 200.0f) + (-100.0f); + flt_CODE_bss_800695A0 = flt_CODE_bss_800695A4; + flt_CODE_bss_800695AC = flt_CODE_bss_800695B0; + flt_CODE_bss_800695B8 = flt_CODE_bss_800695BC; + bss_800695E4 = 1; + flt_CODE_bss_800695E8.f[0] = 0.0f; + flt_CODE_bss_800695E8.f[1] = 0.0f; + flt_CODE_bss_800695E8.f[2] = 0.0f; } #else #ifndef VERSION_EU @@ -20819,8 +8899,8 @@ glabel init_menu18_displaycast /* 04D554 7F018A24 8FA7007C */ lw $a3, 0x7c($sp) /* 04D558 7F018A28 0FC08D2A */ jal setup_chr_instance /* 04D55C 7F018A2C AFA00010 */ sw $zero, 0x10($sp) -/* 04D560 7F018A30 3C038003 */ lui $v1, %hi(objinstance) -/* 04D564 7F018A34 2463B5F4 */ addiu $v1, %lo(objinstance) # addiu $v1, $v1, -0x4a0c +/* 04D560 7F018A30 3C038003 */ lui $v1, %hi(cast_model) +/* 04D564 7F018A34 2463B5F4 */ addiu $v1, %lo(cast_model) # addiu $v1, $v1, -0x4a0c /* 04D568 7F018A38 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04D56C 7F018A3C AC620000 */ sw $v0, ($v1) /* 04D570 7F018A40 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd @@ -20931,17 +9011,17 @@ glabel init_menu18_displaycast /* 04D6F0 7F018BC0 8FA40078 */ lw $a0, 0x78($sp) /* 04D6F4 7F018BC4 0FC1B025 */ jal get_obj_instance_controller_for_header /* 04D6F8 7F018BC8 8FA40078 */ lw $a0, 0x78($sp) -/* 04D6FC 7F018BCC 3C038003 */ lui $v1, %hi(ptrobjinstance) -/* 04D700 7F018BD0 2463B5F8 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, -0x4a08 +/* 04D6FC 7F018BCC 3C038003 */ lui $v1, %hi(cast_model_weapon) +/* 04D700 7F018BD0 2463B5F8 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, -0x4a08 /* 04D704 7F018BD4 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04D708 7F018BD8 AC620000 */ sw $v0, ($v1) /* 04D70C 7F018BDC 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd /* 04D710 7F018BE0 0FC1B39E */ jal modelSetScale /* 04D714 7F018BE4 00402025 */ move $a0, $v0 -/* 04D718 7F018BE8 3C038003 */ lui $v1, %hi(ptrobjinstance) -/* 04D71C 7F018BEC 3C068003 */ lui $a2, %hi(objinstance) -/* 04D720 7F018BF0 24C6B5F4 */ addiu $a2, %lo(objinstance) # addiu $a2, $a2, -0x4a0c -/* 04D724 7F018BF4 2463B5F8 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, -0x4a08 +/* 04D718 7F018BE8 3C038003 */ lui $v1, %hi(cast_model_weapon) +/* 04D71C 7F018BEC 3C068003 */ lui $a2, %hi(cast_model) +/* 04D720 7F018BF0 24C6B5F4 */ addiu $a2, %lo(cast_model) # addiu $a2, $a2, -0x4a0c +/* 04D724 7F018BF4 2463B5F8 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, -0x4a08 /* 04D728 7F018BF8 8C6B0000 */ lw $t3, ($v1) /* 04D72C 7F018BFC 8CD90000 */ lw $t9, ($a2) /* 04D730 7F018C00 24020003 */ li $v0, 3 @@ -20962,28 +9042,28 @@ glabel init_menu18_displaycast /* 04D768 7F018C38 10000006 */ b .L7F018C54 /* 04D76C 7F018C3C AD0E001C */ sw $t6, 0x1c($t0) .L7F018C40: -/* 04D770 7F018C40 3C038003 */ lui $v1, %hi(ptrobjinstance) -/* 04D774 7F018C44 2463B5F8 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, -0x4a08 -/* 04D778 7F018C48 3C068003 */ lui $a2, %hi(objinstance) -/* 04D77C 7F018C4C 24C6B5F4 */ addiu $a2, %lo(objinstance) # addiu $a2, $a2, -0x4a0c +/* 04D770 7F018C40 3C038003 */ lui $v1, %hi(cast_model_weapon) +/* 04D774 7F018C44 2463B5F8 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, -0x4a08 +/* 04D778 7F018C48 3C068003 */ lui $a2, %hi(cast_model) +/* 04D77C 7F018C4C 24C6B5F4 */ addiu $a2, %lo(cast_model) # addiu $a2, $a2, -0x4a0c /* 04D780 7F018C50 AC600000 */ sw $zero, ($v1) .L7F018C54: /* 04D784 7F018C54 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04D788 7F018C58 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd /* 04D78C 7F018C5C 0FC1B3A1 */ jal sub_GAME_7F06CE84 /* 04D790 7F018C60 8CC40000 */ lw $a0, ($a2) -/* 04D794 7F018C64 3C048003 */ lui $a0, %hi(objinstance) -/* 04D798 7F018C68 8C84B5F4 */ lw $a0, %lo(objinstance)($a0) +/* 04D794 7F018C64 3C048003 */ lui $a0, %hi(cast_model) +/* 04D798 7F018C68 8C84B5F4 */ lw $a0, %lo(cast_model)($a0) /* 04D79C 7F018C6C 0FC1B303 */ jal setsuboffset /* 04D7A0 7F018C70 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 04D7A4 7F018C74 3C048003 */ lui $a0, %hi(objinstance) -/* 04D7A8 7F018C78 8C84B5F4 */ lw $a0, %lo(objinstance)($a0) +/* 04D7A4 7F018C74 3C048003 */ lui $a0, %hi(cast_model) +/* 04D7A8 7F018C78 8C84B5F4 */ lw $a0, %lo(cast_model)($a0) /* 04D7AC 7F018C7C 0FC1B34F */ jal setsubroty /* 04D7B0 7F018C80 24050000 */ li $a1, 0 -/* 04D7B4 7F018C84 3C048003 */ lui $a0, %hi(objinstance) -/* 04D7B8 7F018C88 8C84B5F4 */ lw $a0, %lo(objinstance)($a0) +/* 04D7B4 7F018C84 3C048003 */ lui $a0, %hi(cast_model) +/* 04D7B8 7F018C88 8C84B5F4 */ lw $a0, %lo(cast_model)($a0) /* 04D7BC 7F018C8C 3C053F00 */ lui $a1, 0x3f00 -/* 04D7C0 7F018C90 0FC1BFC6 */ jal modelSetAnimRateForDuration +/* 04D7C0 7F018C90 0FC1BFC6 */ jal modelSetAnimPlaySpeed /* 04D7C4 7F018C94 24060000 */ li $a2, 0 /* 04D7C8 7F018C98 3C198003 */ lui $t9, %hi(randomly_selected_intro_animation) /* 04D7CC 7F018C9C 8F39B5EC */ lw $t9, %lo(randomly_selected_intro_animation)($t9) @@ -20997,8 +9077,8 @@ glabel init_menu18_displaycast /* 04D7EC 7F018CBC 3C058003 */ lui $a1, %hi(animation_table_ptrs1) /* 04D7F0 7F018CC0 000AC080 */ sll $t8, $t2, 2 /* 04D7F4 7F018CC4 00B82821 */ addu $a1, $a1, $t8 -/* 04D7F8 7F018CC8 3C048003 */ lui $a0, %hi(objinstance) -/* 04D7FC 7F018CCC 8C84B5F4 */ lw $a0, %lo(objinstance)($a0) +/* 04D7F8 7F018CC8 3C048003 */ lui $a0, %hi(cast_model) +/* 04D7FC 7F018CCC 8C84B5F4 */ lw $a0, %lo(cast_model)($a0) /* 04D800 7F018CD0 8CA59D6C */ lw $a1, %lo(animation_table_ptrs1)($a1) /* 04D804 7F018CD4 8C470004 */ lw $a3, 4($v0) /* 04D808 7F018CD8 8FA60070 */ lw $a2, 0x70($sp) @@ -21145,8 +9225,8 @@ glabel init_menu18_displaycast /* 04DA24 7F018EF4 3C018007 */ lui $at, %hi(flt_CODE_bss_800695B8) /* 04DA28 7F018EF8 27BD00B8 */ addiu $sp, $sp, 0xb8 /* 04DA2C 7F018EFC E42A95B8 */ swc1 $f10, %lo(flt_CODE_bss_800695B8)($at) -/* 04DA30 7F018F00 3C018007 */ lui $at, %hi(flt_CODE_bss_800695E4) -/* 04DA34 7F018F04 AC2D95E4 */ sw $t5, %lo(flt_CODE_bss_800695E4)($at) +/* 04DA30 7F018F00 3C018007 */ lui $at, %hi(bss_800695E4) +/* 04DA34 7F018F04 AC2D95E4 */ sw $t5, %lo(bss_800695E4)($at) /* 04DA38 7F018F08 E4600000 */ swc1 $f0, ($v1) /* 04DA3C 7F018F0C E4600004 */ swc1 $f0, 4($v1) /* 04DA40 7F018F10 03E00008 */ jr $ra @@ -21415,8 +9495,8 @@ glabel init_menu18_displaycast /* 04B48C 7F018A9C 8FA7007C */ lw $a3, 0x7c($sp) /* 04B490 7F018AA0 0FC08D22 */ jal setup_chr_instance /* 04B494 7F018AA4 AFA00010 */ sw $zero, 0x10($sp) -/* 04B498 7F018AA8 3C038002 */ lui $v1, %hi(objinstance) # $v1, 0x8002 -/* 04B49C 7F018AAC 24636B44 */ addiu $v1, %lo(objinstance) # addiu $v1, $v1, 0x6b44 +/* 04B498 7F018AA8 3C038002 */ lui $v1, %hi(cast_model) # $v1, 0x8002 +/* 04B49C 7F018AAC 24636B44 */ addiu $v1, %lo(cast_model) # addiu $v1, $v1, 0x6b44 /* 04B4A0 7F018AB0 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04B4A4 7F018AB4 AC620000 */ sw $v0, ($v1) /* 04B4A8 7F018AB8 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd @@ -21527,17 +9607,17 @@ glabel init_menu18_displaycast /* 04B628 7F018C38 8FA40078 */ lw $a0, 0x78($sp) /* 04B62C 7F018C3C 0FC1B1F5 */ jal get_obj_instance_controller_for_header /* 04B630 7F018C40 8FA40078 */ lw $a0, 0x78($sp) -/* 04B634 7F018C44 3C038002 */ lui $v1, %hi(ptrobjinstance) # $v1, 0x8002 -/* 04B638 7F018C48 24636B48 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, 0x6b48 +/* 04B634 7F018C44 3C038002 */ lui $v1, %hi(cast_model_weapon) # $v1, 0x8002 +/* 04B638 7F018C48 24636B48 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, 0x6b48 /* 04B63C 7F018C4C 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04B640 7F018C50 AC620000 */ sw $v0, ($v1) /* 04B644 7F018C54 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd /* 04B648 7F018C58 0FC1B4CF */ jal modelSetScale /* 04B64C 7F018C5C 00402025 */ move $a0, $v0 -/* 04B650 7F018C60 3C038002 */ lui $v1, %hi(ptrobjinstance) # $v1, 0x8002 -/* 04B654 7F018C64 3C068002 */ lui $a2, %hi(objinstance) # $a2, 0x8002 -/* 04B658 7F018C68 24C66B44 */ addiu $a2, %lo(objinstance) # addiu $a2, $a2, 0x6b44 -/* 04B65C 7F018C6C 24636B48 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, 0x6b48 +/* 04B650 7F018C60 3C038002 */ lui $v1, %hi(cast_model_weapon) # $v1, 0x8002 +/* 04B654 7F018C64 3C068002 */ lui $a2, %hi(cast_model) # $a2, 0x8002 +/* 04B658 7F018C68 24C66B44 */ addiu $a2, %lo(cast_model) # addiu $a2, $a2, 0x6b44 +/* 04B65C 7F018C6C 24636B48 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, 0x6b48 /* 04B660 7F018C70 8C6B0000 */ lw $t3, ($v1) /* 04B664 7F018C74 8CD90000 */ lw $t9, ($a2) /* 04B668 7F018C78 24020003 */ li $v0, 3 @@ -21558,29 +9638,29 @@ glabel init_menu18_displaycast /* 04B6A0 7F018CB0 10000006 */ b .L7F018CCC /* 04B6A4 7F018CB4 AD0E001C */ sw $t6, 0x1c($t0) .L7F018CB8: -/* 04B6A8 7F018CB8 3C038002 */ lui $v1, %hi(ptrobjinstance) # $v1, 0x8002 -/* 04B6AC 7F018CBC 24636B48 */ addiu $v1, %lo(ptrobjinstance) # addiu $v1, $v1, 0x6b48 -/* 04B6B0 7F018CC0 3C068002 */ lui $a2, %hi(objinstance) # $a2, 0x8002 -/* 04B6B4 7F018CC4 24C66B44 */ addiu $a2, %lo(objinstance) # addiu $a2, $a2, 0x6b44 +/* 04B6A8 7F018CB8 3C038002 */ lui $v1, %hi(cast_model_weapon) # $v1, 0x8002 +/* 04B6AC 7F018CBC 24636B48 */ addiu $v1, %lo(cast_model_weapon) # addiu $v1, $v1, 0x6b48 +/* 04B6B0 7F018CC0 3C068002 */ lui $a2, %hi(cast_model) # $a2, 0x8002 +/* 04B6B4 7F018CC4 24C66B44 */ addiu $a2, %lo(cast_model) # addiu $a2, $a2, 0x6b44 /* 04B6B8 7F018CC8 AC600000 */ sw $zero, ($v1) .L7F018CCC: /* 04B6BC 7F018CCC 3C053DCC */ lui $a1, (0x3DCCCCCD >> 16) # lui $a1, 0x3dcc /* 04B6C0 7F018CD0 34A5CCCD */ ori $a1, (0x3DCCCCCD & 0xFFFF) # ori $a1, $a1, 0xcccd /* 04B6C4 7F018CD4 0FC1B4D2 */ jal sub_GAME_7F06CE84 /* 04B6C8 7F018CD8 8CC40000 */ lw $a0, ($a2) -/* 04B6CC 7F018CDC 3C048002 */ lui $a0, %hi(objinstance) # $a0, 0x8002 -/* 04B6D0 7F018CE0 8C846B44 */ lw $a0, %lo(objinstance)($a0) +/* 04B6CC 7F018CDC 3C048002 */ lui $a0, %hi(cast_model) # $a0, 0x8002 +/* 04B6D0 7F018CE0 8C846B44 */ lw $a0, %lo(cast_model)($a0) /* 04B6D4 7F018CE4 0FC1B480 */ jal setsuboffset /* 04B6D8 7F018CE8 27A500A0 */ addiu $a1, $sp, 0xa0 -/* 04B6DC 7F018CEC 3C048002 */ lui $a0, %hi(objinstance) # $a0, 0x8002 -/* 04B6E0 7F018CF0 8C846B44 */ lw $a0, %lo(objinstance)($a0) +/* 04B6DC 7F018CEC 3C048002 */ lui $a0, %hi(cast_model) # $a0, 0x8002 +/* 04B6E0 7F018CF0 8C846B44 */ lw $a0, %lo(cast_model)($a0) /* 04B6E4 7F018CF4 0FC1B49D */ jal setsubroty /* 04B6E8 7F018CF8 24050000 */ li $a1, 0 -/* 04B6EC 7F018CFC 3C048002 */ lui $a0, %hi(objinstance) # $a0, 0x8002 +/* 04B6EC 7F018CFC 3C048002 */ lui $a0, %hi(cast_model) # $a0, 0x8002 /* 04B6F0 7F018D00 3C053F19 */ lui $a1, (0x3F19999A >> 16) # lui $a1, 0x3f19 /* 04B6F4 7F018D04 34A5999A */ ori $a1, (0x3F19999A & 0xFFFF) # ori $a1, $a1, 0x999a -/* 04B6F8 7F018D08 8C846B44 */ lw $a0, %lo(objinstance)($a0) -/* 04B6FC 7F018D0C 0FC1C02E */ jal modelSetAnimRateForDuration +/* 04B6F8 7F018D08 8C846B44 */ lw $a0, %lo(cast_model)($a0) +/* 04B6FC 7F018D0C 0FC1C02E */ jal modelSetAnimPlaySpeed /* 04B700 7F018D10 24060000 */ li $a2, 0 /* 04B704 7F018D14 3C198002 */ lui $t9, %hi(randomly_selected_intro_animation) # $t9, 0x8002 /* 04B708 7F018D18 8F396B3C */ lw $t9, %lo(randomly_selected_intro_animation)($t9) @@ -21594,8 +9674,8 @@ glabel init_menu18_displaycast /* 04B728 7F018D38 3C058002 */ lui $a1, %hi(animation_table_ptrs1) /* 04B72C 7F018D3C 000AC080 */ sll $t8, $t2, 2 /* 04B730 7F018D40 00B82821 */ addu $a1, $a1, $t8 -/* 04B734 7F018D44 3C048002 */ lui $a0, %hi(objinstance) # $a0, 0x8002 -/* 04B738 7F018D48 8C846B44 */ lw $a0, %lo(objinstance)($a0) +/* 04B734 7F018D44 3C048002 */ lui $a0, %hi(cast_model) # $a0, 0x8002 +/* 04B738 7F018D48 8C846B44 */ lw $a0, %lo(cast_model)($a0) /* 04B73C 7F018D4C 8CA552BC */ lw $a1, %lo(animation_table_ptrs1)($a1) /* 04B740 7F018D50 8C470004 */ lw $a3, 4($v0) /* 04B744 7F018D54 8FA60070 */ lw $a2, 0x70($sp) @@ -21742,8 +9822,8 @@ glabel init_menu18_displaycast /* 04B960 7F018F70 3C018006 */ lui $at, %hi(flt_CODE_bss_800695B8) # $at, 0x8006 /* 04B964 7F018F74 27BD00B8 */ addiu $sp, $sp, 0xb8 /* 04B968 7F018F78 E42A84F8 */ swc1 $f10, %lo(flt_CODE_bss_800695B8)($at) -/* 04B96C 7F018F7C 3C018006 */ lui $at, %hi(flt_CODE_bss_800695E4) # $at, 0x8006 -/* 04B970 7F018F80 AC2D8524 */ sw $t5, %lo(flt_CODE_bss_800695E4)($at) +/* 04B96C 7F018F7C 3C018006 */ lui $at, %hi(bss_800695E4) # $at, 0x8006 +/* 04B970 7F018F80 AC2D8524 */ sw $t5, %lo(bss_800695E4)($at) /* 04B974 7F018F84 E4600000 */ swc1 $f0, ($v1) /* 04B978 7F018F88 E4600004 */ swc1 $f0, 4($v1) /* 04B97C 7F018F8C 03E00008 */ jr $ra @@ -21754,628 +9834,496 @@ glabel init_menu18_displaycast -void update_menu18_displaycast(void) { - if (objinstance != 0) { - set_aircraft_obj_inst_scale_to_zero(objinstance); - } - if (ptrobjinstance != 0) { - clear_model_obj(ptrobjinstance); - return; +void update_menu18_displaycast(void) { + if (cast_model != 0) { + clear_aircraft_model_obj(cast_model); + } + if (cast_model_weapon != 0) { + clear_model_obj(cast_model_weapon); + return; + } +} + + + + +// Address 0x7F018F60 NTSC + +void interface_menu18_displaycast(void) +{ + s32 f; + + viSetFovY(46.0f); + viSetZRange(10.0f, 2000.0f); + viSetUseZBuf(TRUE); + viSetAspect(ASPECT_RATIO_SD); + set_cur_player_screen_size(440, 330); + viSetViewSize(440, 330); + set_cur_player_viewport_size(0, 0); + viSetViewPosition(0, 0); + + g_MenuTimer += g_ClockTimer; + +#if defined(VERSION_US) || defined(VERSION_JP) +#define INTERFACE_MENU18_TIMER 181 +#endif +#if defined(VERSION_EU) +#define INTERFACE_MENU18_TIMER 151 +#endif + + if (g_MenuTimer >= INTERFACE_MENU18_TIMER) + { +#undef INTERFACE_MENU18_TIMER + intro_character_index++; + + while (1) + { + if (intro_char_table[intro_character_index].flag && full_actor_intro == 0 && 1) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Moonraker_Elite_1_Male) && (check_aztec_completed_any_folder_secret_00()) == 0) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Moonraker_Elite_2_Female) && (check_aztec_completed_any_folder_secret_00() == 0)) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Mayday) && (check_aztec_completed_any_folder_secret_00() == 0 && (randomGetNext() % 0x2710U))) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Jaws) && (check_aztec_completed_any_folder_secret_00() == 0 && (randomGetNext() % 0x2710U))) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Oddjob) && (fileIsEgyptCompletedOn00AnyFolder() == 0 && (randomGetNext() % 0x2710U))) + { + intro_character_index++; + continue; + } + + if ((intro_char_table[intro_character_index].body == BODY_Baron_Samedi) && (fileIsEgyptCompletedOn00AnyFolder() == 0 && (randomGetNext() % 0x2710U) )) + { + intro_character_index++; + continue; + } + + break; + } + + f = intro_character_index; + + if (intro_char_table[f].body < 0) + { + intro_character_index = 0; + f = 0; + } + + if (intro_character_index > 0) + { + frontChangeMenu(MENU_DISPLAY_CAST, 1); + } + else if (full_actor_intro != 0) + { + frontChangeMenu(MENU_MISSION_SELECT, 1); + set_cursor_to_stage_solo(SP_LEVEL_CRADLE); + full_actor_intro = 0; + } + else + { + select_ramrom_to_play(); + } + } + + else if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0xFFFF) != 0) && (!full_actor_intro)) + { + frontChangeMenu(MENU_FILE_SELECT, TRUE); + } +} + + + + +#ifdef NONMATCHING + +// https://decomp.me/scratch/8VrOg 71.40% + +typedef struct some_model_struct +{ + s16 val; +}; + +Gfx * constructor_menu18_displaycast(Gfx *DL) +{ + struct coord3d sp244; + struct coord3d sp238; + struct coord3d sp22C; + s32 padding; + Mtxf sp1E8; + struct unk_joint_list sp1A8; + s32 padding3; + Mtxf sp160; + s32 sp15C; + s32 sp158; + s32 sp154; + s32 sp150; + LookAt * temp_v0; + s32 padding2; + f32 sp148; + f32 sp144; + union ModelRwData *unmrd; + struct coord3d sp134; + struct coord3d sp128; + struct some_model_struct *srecord; + ModelNode *mnode; + Mtx spE0; + + s32 var_s1; + s32 i; + struct coord3d temp_f2; + u8 *temp_v0_6; + s32 var_t4; + + // struct copies. + sp244 = D_8002BA78; + sp238 = D_8002BA84; + sp22C = D_8002BA90; + sp1A8 = D_8002BA9C; + sp148 = g_MenuTimer / 180.0f; + sp134 = D_8002BADC; + // end struct copies. + + if ((g_MenuTimer < 0) || (g_MenuTimer >= 0xB4)) + { + sp144 = 0.0f; + } + else if (g_MenuTimer < 0x1E) + { + sp144 = g_MenuTimer / 30.0f; + } + else if (g_MenuTimer >= 0x97) + { + sp144 = (f32) (0xB4 - g_MenuTimer) / 30.0f; + } + else + { + sp144 = 1.0f; + } + + DL = viSetFillColor(DL, 0, 0, 0); + DL = viFillScreen(DL); + + flt_CODE_bss_800695A0 = ((flt_CODE_bss_800695A8 - flt_CODE_bss_800695A4) * sp148) + flt_CODE_bss_800695A4; + flt_CODE_bss_800695AC = ((flt_CODE_bss_800695B4 - flt_CODE_bss_800695B0) * sp148) + flt_CODE_bss_800695B0; + flt_CODE_bss_800695B8 = ((flt_CODE_bss_800695C0 - flt_CODE_bss_800695BC) * sp148) + flt_CODE_bss_800695BC; + + if (flt_CODE_bss_800695AC < 0.0f) + { + flt_CODE_bss_800695AC += 6.2831855f; + } + + sp244.f[0] = (flt_CODE_bss_800695A0 * sinf(flt_CODE_bss_800695AC)) + (0.2f * flt_CODE_bss_800695A0 * cosf(flt_CODE_bss_800695AC)); + sp244.f[1] = flt_CODE_bss_800695B8; + sp244.f[2] = (flt_CODE_bss_800695A0 * cosf(flt_CODE_bss_800695AC)) - (0.2f * flt_CODE_bss_800695A0 * sinf(flt_CODE_bss_800695AC)); + sp238.f[0] += cosf(flt_CODE_bss_800695AC) * 0.2f * flt_CODE_bss_800695A0; + sp238.f[2] += -sinf(flt_CODE_bss_800695AC) * 0.2f * flt_CODE_bss_800695A0; + + temp_v0 = (LookAt *)dynAllocate7F0BD6F8(2); + guLookAtReflect(&spE0, temp_v0, 0.0f, 0.0f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + + gSPNumLights(DL++, 1); + gSPLight(DL++, &gelogolight.l[0], 1); + gSPLight(DL++, &gelogolight.a, 2); + gSPLookAtX(DL++, &temp_v0->l[0]); + gSPLookAtY(DL++, &temp_v0->l[1]); + + modelTickAnimQuarterSpeed(cast_model, g_ClockTimer, 1); + modelSetDistanceDisabled(1); + sub_GAME_7F073FC8(0); + subcalcpos(cast_model); + + if (cast_model_weapon != NULL) + { + mnode = cast_model_weapon->obj->Switches[0]; + + if (mnode != NULL) + { + unmrd = modelGetNodeRwData(cast_model_weapon, mnode); + srecord = (struct some_model_struct *)unmrd; + srecord->val = 0; + } + } + + if (cast_model_weapon != NULL) + { + mnode = cast_model_weapon->obj->Switches[2]; + + if (mnode != NULL) + { + unmrd = modelGetNodeRwData(cast_model_weapon, mnode); + ((struct ModelRwData_SwitchRecord *)unmrd)->visible = 0; + } + } + + sp1A8.mtxlist = dynAllocate(cast_model->obj->numMatrices << 6); + sp1A8.unk_matrix = &sp1E8; + matrix_4x4_set_identity(&sp1E8); + subcalcmatrices(&sp1A8, cast_model); + getsuboffset(cast_model, &sp128); + + var_s1 = 0; + if (bss_800695E4 != 0) + { + flt_CODE_bss_800695E8.f[1] = sp128.f[1]; + } + + sp134.f[0] = (sp128.f[0] - flt_CODE_bss_800695E8.f[0]) / g_GlobalTimerDelta; + sp134.f[1] = (sp128.f[1] - flt_CODE_bss_800695E8.f[1]) / g_GlobalTimerDelta; + sp134.f[2] = (sp128.f[2] - flt_CODE_bss_800695E8.f[2]) / g_GlobalTimerDelta; + + if (bss_800695E4 != 0) + { + flt_CODE_bss_80069608.f[0] = sp134.f[0] / 0.050000012f; + flt_CODE_bss_80069608.f[1] = sp134.f[1] / 0.050000012f; + flt_CODE_bss_80069608.f[2] = sp134.f[2] / 0.050000012f; + } + + if (g_ClockTimer > 0) + { + var_s1 = 0; + do + { + flt_CODE_bss_80069608.f[0] = (0.95f * flt_CODE_bss_80069608.f[0]) + sp134.f[0]; + flt_CODE_bss_80069608.f[1] = (0.95f * flt_CODE_bss_80069608.f[1]) + sp134.f[1]; + flt_CODE_bss_80069608.f[2] = (0.95f * flt_CODE_bss_80069608.f[2]) + sp134.f[2]; + } + while (++var_s1 < g_ClockTimer); + + if (sp134.f[0]); + if (sp134.f[1]); + if (sp134.f[2]); + + var_s1 = 0; + } + + flt_CODE_bss_800695F8.f[0] = flt_CODE_bss_80069608.f[0] * 0.050000012f; + flt_CODE_bss_800695F8.f[1] = flt_CODE_bss_80069608.f[1] * 0.050000012f; + flt_CODE_bss_800695F8.f[2] = flt_CODE_bss_80069608.f[2] * 0.050000012f; + + flt_CODE_bss_800695E8.f[0] += flt_CODE_bss_800695F8.f[0] * g_GlobalTimerDelta; + flt_CODE_bss_800695E8.f[1] += flt_CODE_bss_800695F8.f[1] * g_GlobalTimerDelta; + flt_CODE_bss_800695E8.f[2] += flt_CODE_bss_800695F8.f[2] * g_GlobalTimerDelta; + + mtx4TransformVecInPlace(&cast_model->render_pos->pos, (struct coord3d *) &sp134); + + sp134.f[0] -= flt_CODE_bss_800695E8.f[0]; + sp134.f[1] -= flt_CODE_bss_800695E8.f[1]; + sp134.f[2] -= flt_CODE_bss_800695E8.f[2]; + + if (bss_800695E4 != 0) + { + bss_800695E4 = 0; + flt_CODE_bss_800695D8.f[0] = (f32) (sp134.f[0] / 0.050000012f); + flt_CODE_bss_800695D8.f[1] = (f32) (sp134.f[1] / 0.050000012f); + flt_CODE_bss_800695D8.f[2] = (f32) (sp134.f[2] / 0.050000012f); + } + + if (g_ClockTimer > 0) + { + var_s1 = 0; + do + { + flt_CODE_bss_800695D8.f[0] = (0.95f * flt_CODE_bss_800695D8.f[0]) + sp134.f[0]; + flt_CODE_bss_800695D8.f[1] = (0.95f * flt_CODE_bss_800695D8.f[1]) + sp134.f[1]; + flt_CODE_bss_800695D8.f[2] = (0.95f * flt_CODE_bss_800695D8.f[2]) + sp134.f[2]; + } + while (++var_s1 < g_ClockTimer); + + flt_CODE_bss_800695D8.f[0] = (0.95f * flt_CODE_bss_800695D8.f[0]) + sp134.f[0]; + flt_CODE_bss_800695D8.f[1] = (0.95f * flt_CODE_bss_800695D8.f[1]) + sp134.f[1]; + flt_CODE_bss_800695D8.f[2] = (0.95f * flt_CODE_bss_800695D8.f[2]) + sp134.f[2]; + + var_s1 = 0; } -} + flt_CODE_bss_800695C8.f[0] = flt_CODE_bss_800695D8.f[0] * 0.050000012f; + flt_CODE_bss_800695C8.f[1] = flt_CODE_bss_800695D8.f[1] * 0.050000012f; + flt_CODE_bss_800695C8.f[2] = flt_CODE_bss_800695D8.f[2] * 0.050000012f; + sp134.f[2] = flt_CODE_bss_800695E8.f[2] + flt_CODE_bss_800695C8.f[2]; + sp238.f[0] += flt_CODE_bss_800695E8.f[0] + flt_CODE_bss_800695C8.f[0]; + sp244.f[0] += flt_CODE_bss_800695E8.f[0]; + sp238.f[2] += flt_CODE_bss_800695E8.f[2] + flt_CODE_bss_800695C8.f[2]; + sp244.f[2] += flt_CODE_bss_800695E8.f[1] + 52.5f; + sp244.f[2] += flt_CODE_bss_800695E8.f[2]; + sp238.f[2] += (flt_CODE_bss_800695E8.f[1] + flt_CODE_bss_800695C8.f[1]) - 10.0f; + sp134.f[0] = flt_CODE_bss_800695E8.f[0] + flt_CODE_bss_800695C8.f[0]; + sp134.f[2] = (flt_CODE_bss_800695E8.f[1] + flt_CODE_bss_800695C8.f[1]) - 10.0f; + matrix_4x4_7F059694(&sp1E8, sp244.f[0], sp244.f[1], sp244.f[2], flt_CODE_bss_800695E8.f[1], sp238.f[2], sp238.f[2], sp22C.f[0], sp22C.f[1], sp22C.f[2]); + sp1A8.unk_matrix = &sp1E8; + sp1A8.mtxlist = dynAllocate(cast_model->obj->numMatrices << 6); + subcalcmatrices((struct unk_joint_list *) &sp1A8, cast_model); + if (cast_model_weapon != NULL) + { + sp1A8.unk_matrix = modelFindNodeMtx(cast_model, cast_model_weapon->attachedto_objinst, 0); -#ifdef NONMATCHING -//better than what was here -void interface_menu18_displaycast(void) -{ - s32 body; - viSetFovY(46.0f); - viSetZRange(10.0f, 2000.0f); - viSetUseZBuf(TRUE); - viSetAspect(1.3333334f); - set_cur_player_screen_size(440, 330); - viSetViewSize(440, 330); - set_cur_player_viewport_size(0, 0); - viSetViewPosition(0, 0); - g_MenuTimer += g_ClockTimer; - if (g_MenuTimer >= 181) // the equivalent would be 151 in the EU rom + if (cast_model_weapon->attachedto_objinst == cast_model->obj->Switches[5]) + { + matrix_4x4_set_rotation_around_z(3.1415927f, &sp160); + matrix_4x4_multiply_in_place(sp1A8.unk_matrix, &sp160); + sp1A8.unk_matrix = &sp160; + } + + sp1A8.mtxlist = dynAllocate(cast_model_weapon->obj->numMatrices << 6); + instcalcmatrices((struct unk_joint_list *) &sp1A8, cast_model_weapon); + } + + sp1A8.unk20 = 7; + sp1A8.unk04 = 1; + sp1A8.gdl = DL++; + sp1A8.unk08 = 3; + subdraw((struct unk_joint_list *) &sp1A8, cast_model); + + if (cast_model_weapon != NULL) { - intro_character_index++; -loop_2: - body =intro_char_table[intro_character_index].body; - if (((intro_char_table[intro_character_index].flag ) && ( !full_actor_intro)) || - ((body == BODY_Moonraker_Elite_1_Male) && (!check_aztec_completed_any_folder_secret_00())) || - ((body == BODY_Moonraker_Elite_2_Female) && (!check_aztec_completed_any_folder_secret_00())) || - ((body == BODY_Mayday) && (!check_aztec_completed_any_folder_secret_00()) && (randomGetNext() % 0x2710U)) || - ((body == BODY_Jaws) && (!check_aztec_completed_any_folder_secret_00()) && (randomGetNext() % 0x2710U)) || - ((body == BODY_Oddjob) && (! fileIsEgyptCompletedOn00AnyFolder()) && (randomGetNext() % 0x2710U)) || - ((body == BODY_Baron_Samedi) && (! fileIsEgyptCompletedOn00AnyFolder()) && (randomGetNext() % 0x2710U))) + subdraw((struct unk_joint_list *) &sp1A8, cast_model_weapon); + } + + modelSetDistanceDisabled(0); + + for (; var_s1obj->numMatrices; var_s1++) + { + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy(&((s8*)cast_model->render_pos)[var_s1*0x40], &sp160); + matrix_4x4_f32_to_s32(&sp160, &((Mtxf*)cast_model->render_pos)[var_s1]); + } + + if (cast_model_weapon != NULL) + { + for (i=0; iobj->numMatrices; i++) { - // Skip characters that we don't want to show - intro_character_index++; - goto loop_2; + // hack: source address steps by sizeof(Mtxf), but can't get that to match + matrix_4x4_copy(&((s8*)cast_model_weapon->render_pos)[i*0x40], &sp160); + matrix_4x4_f32_to_s32(&sp160, &((Mtxf*)cast_model_weapon->render_pos)[i]); } + } + + gDPSetScissor(DL++, G_SC_NON_INTERLACE, 0, 0, 440, 330); + gDPPipeSync(DL++); + gDPSetCycleType(DL++, G_CYC_1CYCLE); + gDPSetColorDither(DL++, G_CD_DISABLE); + gDPSetTexturePersp(DL++, G_TP_NONE); + gDPSetAlphaCompare(DL++, G_AC_NONE); + gDPSetTextureLOD(DL++, G_TL_TILE); + gDPSetTextureFilter(DL++, G_TF_BILERP); + gDPSetTextureConvert(DL++, G_TC_FILT); + gDPSetTextureLUT(DL++, G_TT_NONE); + gDPSetRenderMode(DL++, G_RM_CLD_SURF, G_RM_CLD_SURF2); + gDPSetCombineMode(DL++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPSetPrimColor(DL++, 0, 0, 0x00, 0x00, 0x00, (0xFF - (s32) (255.0f * sp144)) & 0xFF); + gDPFillRectangle(DL++, 0, 0, 440, 330); + gDPPipeSync(DL++); + gDPSetColorDither(DL++, G_CD_BAYER); + gDPSetTexturePersp(DL++, G_TP_PERSP); + gDPSetTextureLOD(DL++, G_TL_LOD); + + DL = microcode_constructor(DL); + + if (full_actor_intro == 0) + { + temp_v0_6 = langGet(intro_char_table[intro_character_index].text1); + textMeasure(&sp150, &sp154, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + + sp158 = 0x6C; + sp15C = 0x13B - (sp154 / 2); - if (body < 0) + DL = microcode_constructor_related_to_menus(DL, sp15C, 0x6C, sp15C + sp154 + 1, sp150 + 0x6D, 0); +/* + if (sp158 & 0x78) { - intro_character_index = 0; + if (!(sp158 & 0x78)) + { + var_t4 = (255.0f * sp144) / 2147483647; + } + else + { + var_t4 = -1; + } } - if (intro_character_index <= 0) + else { - if (!full_actor_intro) + var_t4 = 255.0f * sp144; + if (var_t4 < 0) { - select_ramrom_to_play(); - return; + var_t4 = -1; } - set_menu_to_mode(MENU_MISSION_SELECT, 1); - set_cursor_to_stage_solo(SP_LEVEL_CRADLE); - full_actor_intro = FALSE; - return; } - set_menu_to_mode(MENU_DISPLAY_CAST, 1); - return; +*/ + if ((s32)sp144 & 0x78) + { + var_t4 = (255.0f * sp144) / 2147483647; + } + else + { + var_t4 = -1; + } + + DL = textRender(DL, &sp15C, &sp158, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, var_t4 | ~0xFF, viGetX(), viGetY(), 0, 0); + } +/* + if (sp158 & 0x78) + { + if (!(sp158 & 0x78)) + { + var_t4 = (255.0f * sp144) / 2147483647; + } + else + { + var_t4 = -1; + } } - if ((joyGetButtonsPressedThisFrame(PLAYER_1, 0xFFFF) != 0) && (!full_actor_intro)) + else { - set_menu_to_mode(MENU_FILE_SELECT, 1); + var_t4 = 255.0f * sp144; + if (var_t4 < 0) + { + var_t4 = -1; + } } +*/ + + temp_v0_6 = langGet(intro_char_table[intro_character_index].text2); + textMeasure(&sp150, &sp154, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + sp158 = 0x98; + sp15C = 0x13B - (sp154 / 2); + DL = microcode_constructor_related_to_menus(DL, sp15C, 0x98, sp15C + sp154 + 1, sp150 + 0x99, 0); + DL = textRender(DL, &sp15C, &sp158, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, var_t4 | ~0xFF, viGetX(), viGetY(), 0, 0); + + temp_v0_6 = langGet(intro_char_table[intro_character_index].text3); + textMeasure(&sp150, &sp154, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, 0); + sp158 = 0xAE; + sp15C = 0x13B - (sp154 / 2); + DL = microcode_constructor_related_to_menus(DL, sp15C, 0xAE, sp15C + sp154 + 1, sp150 + 0xAF, 0); + DL = textRender(DL, &sp15C, &sp158, temp_v0_6, ptrFontZurichBoldChars, ptrFontZurichBold, var_t4 | ~0xFF, viGetX(), viGetY(), 0, 0); + + return DL; } -#else - -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.late_rodata -glabel D_80051B08 -.word 0x3FAAAAAB /*1.3333334;*/ - -.text -glabel interface_menu18_displaycast -/* 04DA90 7F018F60 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 04DA94 7F018F64 3C014238 */ li $at, 0x42380000 # 46.000000 -/* 04DA98 7F018F68 AFBF0024 */ sw $ra, 0x24($sp) -/* 04DA9C 7F018F6C 44816000 */ mtc1 $at, $f12 -/* 04DAA0 7F018F70 AFB30020 */ sw $s3, 0x20($sp) -/* 04DAA4 7F018F74 AFB2001C */ sw $s2, 0x1c($sp) -/* 04DAA8 7F018F78 AFB10018 */ sw $s1, 0x18($sp) -/* 04DAAC 7F018F7C 0C001151 */ jal viSetFovY -/* 04DAB0 7F018F80 AFB00014 */ sw $s0, 0x14($sp) -/* 04DAB4 7F018F84 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 04DAB8 7F018F88 44816000 */ mtc1 $at, $f12 -/* 04DABC 7F018F8C 3C0144FA */ li $at, 0x44FA0000 # 2000.000000 -/* 04DAC0 7F018F90 44817000 */ mtc1 $at, $f14 -/* 04DAC4 7F018F94 0C001194 */ jal viSetZRange -/* 04DAC8 7F018F98 00000000 */ nop -/* 04DACC 7F018F9C 0C00114D */ jal viSetUseZBuf -/* 04DAD0 7F018FA0 24040001 */ li $a0, 1 -/* 04DAD4 7F018FA4 3C018005 */ lui $at, %hi(D_80051B08) -/* 04DAD8 7F018FA8 0C001164 */ jal viSetAspect -/* 04DADC 7F018FAC C42C1B08 */ lwc1 $f12, %lo(D_80051B08)($at) -/* 04DAE0 7F018FB0 240401B8 */ li $a0, 440 -/* 04DAE4 7F018FB4 0FC26C77 */ jal set_cur_player_screen_size -/* 04DAE8 7F018FB8 2405014A */ li $a1, 330 -/* 04DAEC 7F018FBC 240401B8 */ li $a0, 440 -/* 04DAF0 7F018FC0 0C00110F */ jal viSetViewSize -/* 04DAF4 7F018FC4 2405014A */ li $a1, 330 -/* 04DAF8 7F018FC8 00002025 */ move $a0, $zero -/* 04DAFC 7F018FCC 0FC26C7E */ jal set_cur_player_viewport_size -/* 04DB00 7F018FD0 00002825 */ move $a1, $zero -/* 04DB04 7F018FD4 00002025 */ move $a0, $zero -/* 04DB08 7F018FD8 0C00112F */ jal viSetViewPosition -/* 04DB0C 7F018FDC 00002825 */ move $a1, $zero -/* 04DB10 7F018FE0 3C028003 */ lui $v0, %hi(g_MenuTimer) -/* 04DB14 7F018FE4 2442A8CC */ addiu $v0, %lo(g_MenuTimer) # addiu $v0, $v0, -0x5734 -/* 04DB18 7F018FE8 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 04DB1C 7F018FEC 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 04DB20 7F018FF0 8C4E0000 */ lw $t6, ($v0) -/* 04DB24 7F018FF4 3C108003 */ lui $s0, %hi(intro_character_index) -/* 04DB28 7F018FF8 00002025 */ move $a0, $zero -/* 04DB2C 7F018FFC 01CFC021 */ addu $t8, $t6, $t7 -/* 04DB30 7F019000 2B0100B5 */ slti $at, $t8, 0xb5 -/* 04DB34 7F019004 142000B7 */ bnez $at, .L7F0192E4 -/* 04DB38 7F019008 AC580000 */ sw $t8, ($v0) -/* 04DB3C 7F01900C 2610B5E8 */ addiu $s0, %lo(intro_character_index) # addiu $s0, $s0, -0x4a18 -/* 04DB40 7F019010 8E080000 */ lw $t0, ($s0) -/* 04DB44 7F019014 3C118003 */ lui $s1, %hi(intro_char_table) -/* 04DB48 7F019018 2631B600 */ addiu $s1, %lo(intro_char_table) # addiu $s1, $s1, -0x4a00 -/* 04DB4C 7F01901C 25090001 */ addiu $t1, $t0, 1 -/* 04DB50 7F019020 AE090000 */ sw $t1, ($s0) -/* 04DB54 7F019024 24132710 */ li $s3, 10000 -/* 04DB58 7F019028 24120014 */ li $s2, 20 -.L7F01902C: -/* 04DB5C 7F01902C 8E030000 */ lw $v1, ($s0) -/* 04DB60 7F019030 3C0C8003 */ lui $t4, %hi(full_actor_intro) -/* 04DB64 7F019034 00720019 */ multu $v1, $s2 -/* 04DB68 7F019038 00005012 */ mflo $t2 -/* 04DB6C 7F01903C 022A1021 */ addu $v0, $s1, $t2 -/* 04DB70 7F019040 8C4B0010 */ lw $t3, 0x10($v0) -/* 04DB74 7F019044 51600008 */ beql $t3, $zero, .L7F019068 -/* 04DB78 7F019048 8C4E0000 */ lw $t6, ($v0) -/* 04DB7C 7F01904C 8D8CB5FC */ lw $t4, %lo(full_actor_intro)($t4) -/* 04DB80 7F019050 246D0001 */ addiu $t5, $v1, 1 -/* 04DB84 7F019054 55800004 */ bnezl $t4, .L7F019068 -/* 04DB88 7F019058 8C4E0000 */ lw $t6, ($v0) -/* 04DB8C 7F01905C 1000FFF3 */ b .L7F01902C -/* 04DB90 7F019060 AE0D0000 */ sw $t5, ($s0) -/* 04DB94 7F019064 8C4E0000 */ lw $t6, ($v0) -.L7F019068: -/* 04DB98 7F019068 24010027 */ li $at, 39 -/* 04DB9C 7F01906C 55C1000A */ bnel $t6, $at, .L7F019098 -/* 04DBA0 7F019070 8E190000 */ lw $t9, ($s0) -/* 04DBA4 7F019074 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DBA8 7F019078 00000000 */ nop -/* 04DBAC 7F01907C 54400006 */ bnezl $v0, .L7F019098 -/* 04DBB0 7F019080 8E190000 */ lw $t9, ($s0) -/* 04DBB4 7F019084 8E0F0000 */ lw $t7, ($s0) -/* 04DBB8 7F019088 25F80001 */ addiu $t8, $t7, 1 -/* 04DBBC 7F01908C 1000FFE7 */ b .L7F01902C -/* 04DBC0 7F019090 AE180000 */ sw $t8, ($s0) -/* 04DBC4 7F019094 8E190000 */ lw $t9, ($s0) -.L7F019098: -/* 04DBC8 7F019098 24010028 */ li $at, 40 -/* 04DBCC 7F01909C 03320019 */ multu $t9, $s2 -/* 04DBD0 7F0190A0 00004012 */ mflo $t0 -/* 04DBD4 7F0190A4 02284821 */ addu $t1, $s1, $t0 -/* 04DBD8 7F0190A8 8D2A0000 */ lw $t2, ($t1) -/* 04DBDC 7F0190AC 5541000A */ bnel $t2, $at, .L7F0190D8 -/* 04DBE0 7F0190B0 8E0D0000 */ lw $t5, ($s0) -/* 04DBE4 7F0190B4 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DBE8 7F0190B8 00000000 */ nop -/* 04DBEC 7F0190BC 54400006 */ bnezl $v0, .L7F0190D8 -/* 04DBF0 7F0190C0 8E0D0000 */ lw $t5, ($s0) -/* 04DBF4 7F0190C4 8E0B0000 */ lw $t3, ($s0) -/* 04DBF8 7F0190C8 256C0001 */ addiu $t4, $t3, 1 -/* 04DBFC 7F0190CC 1000FFD7 */ b .L7F01902C -/* 04DC00 7F0190D0 AE0C0000 */ sw $t4, ($s0) -/* 04DC04 7F0190D4 8E0D0000 */ lw $t5, ($s0) -.L7F0190D8: -/* 04DC08 7F0190D8 2401000E */ li $at, 14 -/* 04DC0C 7F0190DC 01B20019 */ multu $t5, $s2 -/* 04DC10 7F0190E0 00007012 */ mflo $t6 -/* 04DC14 7F0190E4 022E7821 */ addu $t7, $s1, $t6 -/* 04DC18 7F0190E8 8DF80000 */ lw $t8, ($t7) -/* 04DC1C 7F0190EC 57010013 */ bnel $t8, $at, .L7F01913C -/* 04DC20 7F0190F0 8E0A0000 */ lw $t2, ($s0) -/* 04DC24 7F0190F4 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DC28 7F0190F8 00000000 */ nop -/* 04DC2C 7F0190FC 5440000F */ bnezl $v0, .L7F01913C -/* 04DC30 7F019100 8E0A0000 */ lw $t2, ($s0) -/* 04DC34 7F019104 0C002914 */ jal randomGetNext -/* 04DC38 7F019108 00000000 */ nop -/* 04DC3C 7F01910C 0053001B */ divu $zero, $v0, $s3 -/* 04DC40 7F019110 0000C810 */ mfhi $t9 -/* 04DC44 7F019114 16600002 */ bnez $s3, .L7F019120 -/* 04DC48 7F019118 00000000 */ nop -/* 04DC4C 7F01911C 0007000D */ break 7 -.L7F019120: -/* 04DC50 7F019120 53200006 */ beql $t9, $zero, .L7F01913C -/* 04DC54 7F019124 8E0A0000 */ lw $t2, ($s0) -/* 04DC58 7F019128 8E080000 */ lw $t0, ($s0) -/* 04DC5C 7F01912C 25090001 */ addiu $t1, $t0, 1 -/* 04DC60 7F019130 1000FFBE */ b .L7F01902C -/* 04DC64 7F019134 AE090000 */ sw $t1, ($s0) -/* 04DC68 7F019138 8E0A0000 */ lw $t2, ($s0) -.L7F01913C: -/* 04DC6C 7F01913C 2401000D */ li $at, 13 -/* 04DC70 7F019140 01520019 */ multu $t2, $s2 -/* 04DC74 7F019144 00005812 */ mflo $t3 -/* 04DC78 7F019148 022B6021 */ addu $t4, $s1, $t3 -/* 04DC7C 7F01914C 8D8D0000 */ lw $t5, ($t4) -/* 04DC80 7F019150 55A10013 */ bnel $t5, $at, .L7F0191A0 -/* 04DC84 7F019154 8E190000 */ lw $t9, ($s0) -/* 04DC88 7F019158 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DC8C 7F01915C 00000000 */ nop -/* 04DC90 7F019160 5440000F */ bnezl $v0, .L7F0191A0 -/* 04DC94 7F019164 8E190000 */ lw $t9, ($s0) -/* 04DC98 7F019168 0C002914 */ jal randomGetNext -/* 04DC9C 7F01916C 00000000 */ nop -/* 04DCA0 7F019170 0053001B */ divu $zero, $v0, $s3 -/* 04DCA4 7F019174 00007010 */ mfhi $t6 -/* 04DCA8 7F019178 16600002 */ bnez $s3, .L7F019184 -/* 04DCAC 7F01917C 00000000 */ nop -/* 04DCB0 7F019180 0007000D */ break 7 -.L7F019184: -/* 04DCB4 7F019184 51C00006 */ beql $t6, $zero, .L7F0191A0 -/* 04DCB8 7F019188 8E190000 */ lw $t9, ($s0) -/* 04DCBC 7F01918C 8E0F0000 */ lw $t7, ($s0) -/* 04DCC0 7F019190 25F80001 */ addiu $t8, $t7, 1 -/* 04DCC4 7F019194 1000FFA5 */ b .L7F01902C -/* 04DCC8 7F019198 AE180000 */ sw $t8, ($s0) -/* 04DCCC 7F01919C 8E190000 */ lw $t9, ($s0) -.L7F0191A0: -/* 04DCD0 7F0191A0 2401000F */ li $at, 15 -/* 04DCD4 7F0191A4 03320019 */ multu $t9, $s2 -/* 04DCD8 7F0191A8 00004012 */ mflo $t0 -/* 04DCDC 7F0191AC 02284821 */ addu $t1, $s1, $t0 -/* 04DCE0 7F0191B0 8D2A0000 */ lw $t2, ($t1) -/* 04DCE4 7F0191B4 55410013 */ bnel $t2, $at, .L7F019204 -/* 04DCE8 7F0191B8 8E0E0000 */ lw $t6, ($s0) -/* 04DCEC 7F0191BC 0FC07ADC */ jal fileIsEgyptCompletedOn00AnyFolder -/* 04DCF0 7F0191C0 00000000 */ nop -/* 04DCF4 7F0191C4 5440000F */ bnezl $v0, .L7F019204 -/* 04DCF8 7F0191C8 8E0E0000 */ lw $t6, ($s0) -/* 04DCFC 7F0191CC 0C002914 */ jal randomGetNext -/* 04DD00 7F0191D0 00000000 */ nop -/* 04DD04 7F0191D4 0053001B */ divu $zero, $v0, $s3 -/* 04DD08 7F0191D8 00005810 */ mfhi $t3 -/* 04DD0C 7F0191DC 16600002 */ bnez $s3, .L7F0191E8 -/* 04DD10 7F0191E0 00000000 */ nop -/* 04DD14 7F0191E4 0007000D */ break 7 -.L7F0191E8: -/* 04DD18 7F0191E8 51600006 */ beql $t3, $zero, .L7F019204 -/* 04DD1C 7F0191EC 8E0E0000 */ lw $t6, ($s0) -/* 04DD20 7F0191F0 8E0C0000 */ lw $t4, ($s0) -/* 04DD24 7F0191F4 258D0001 */ addiu $t5, $t4, 1 -/* 04DD28 7F0191F8 1000FF8C */ b .L7F01902C -/* 04DD2C 7F0191FC AE0D0000 */ sw $t5, ($s0) -/* 04DD30 7F019200 8E0E0000 */ lw $t6, ($s0) -.L7F019204: -/* 04DD34 7F019204 2401000C */ li $at, 12 -/* 04DD38 7F019208 01D20019 */ multu $t6, $s2 -/* 04DD3C 7F01920C 00007812 */ mflo $t7 -/* 04DD40 7F019210 022FC021 */ addu $t8, $s1, $t7 -/* 04DD44 7F019214 8F190000 */ lw $t9, ($t8) -/* 04DD48 7F019218 57210013 */ bnel $t9, $at, .L7F019268 -/* 04DD4C 7F01921C 8E030000 */ lw $v1, ($s0) -/* 04DD50 7F019220 0FC07ADC */ jal fileIsEgyptCompletedOn00AnyFolder -/* 04DD54 7F019224 00000000 */ nop -/* 04DD58 7F019228 5440000F */ bnezl $v0, .L7F019268 -/* 04DD5C 7F01922C 8E030000 */ lw $v1, ($s0) -/* 04DD60 7F019230 0C002914 */ jal randomGetNext -/* 04DD64 7F019234 00000000 */ nop -/* 04DD68 7F019238 0053001B */ divu $zero, $v0, $s3 -/* 04DD6C 7F01923C 00004010 */ mfhi $t0 -/* 04DD70 7F019240 16600002 */ bnez $s3, .L7F01924C -/* 04DD74 7F019244 00000000 */ nop -/* 04DD78 7F019248 0007000D */ break 7 -.L7F01924C: -/* 04DD7C 7F01924C 51000006 */ beql $t0, $zero, .L7F019268 -/* 04DD80 7F019250 8E030000 */ lw $v1, ($s0) -/* 04DD84 7F019254 8E090000 */ lw $t1, ($s0) -/* 04DD88 7F019258 252A0001 */ addiu $t2, $t1, 1 -/* 04DD8C 7F01925C 1000FF73 */ b .L7F01902C -/* 04DD90 7F019260 AE0A0000 */ sw $t2, ($s0) -/* 04DD94 7F019264 8E030000 */ lw $v1, ($s0) -.L7F019268: -/* 04DD98 7F019268 24040018 */ li $a0, 24 -/* 04DD9C 7F01926C 3C0E8003 */ lui $t6, %hi(full_actor_intro) -/* 04DDA0 7F019270 00720019 */ multu $v1, $s2 -/* 04DDA4 7F019274 00005812 */ mflo $t3 -/* 04DDA8 7F019278 022B6021 */ addu $t4, $s1, $t3 -/* 04DDAC 7F01927C 8D8D0000 */ lw $t5, ($t4) -/* 04DDB0 7F019280 05A10003 */ bgez $t5, .L7F019290 -/* 04DDB4 7F019284 00000000 */ nop -/* 04DDB8 7F019288 AE000000 */ sw $zero, ($s0) -/* 04DDBC 7F01928C 00001825 */ move $v1, $zero -.L7F019290: -/* 04DDC0 7F019290 18600005 */ blez $v1, .L7F0192A8 -/* 04DDC4 7F019294 00000000 */ nop -/* 04DDC8 7F019298 0FC06975 */ jal set_menu_to_mode -/* 04DDCC 7F01929C 24050001 */ li $a1, 1 -/* 04DDD0 7F0192A0 1000001B */ b .L7F019310 -/* 04DDD4 7F0192A4 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0192A8: -/* 04DDD8 7F0192A8 8DCEB5FC */ lw $t6, %lo(full_actor_intro)($t6) -/* 04DDDC 7F0192AC 24040007 */ li $a0, 7 -/* 04DDE0 7F0192B0 11C00008 */ beqz $t6, .L7F0192D4 -/* 04DDE4 7F0192B4 00000000 */ nop -/* 04DDE8 7F0192B8 0FC06975 */ jal set_menu_to_mode -/* 04DDEC 7F0192BC 24050001 */ li $a1, 1 -/* 04DDF0 7F0192C0 0FC038F8 */ jal set_cursor_to_stage_solo -/* 04DDF4 7F0192C4 24040011 */ li $a0, 17 -/* 04DDF8 7F0192C8 3C018003 */ lui $at, %hi(full_actor_intro) -/* 04DDFC 7F0192CC 1000000F */ b .L7F01930C -/* 04DE00 7F0192D0 AC20B5FC */ sw $zero, %lo(full_actor_intro)($at) -.L7F0192D4: -/* 04DE04 7F0192D4 0FC3025C */ jal select_ramrom_to_play -/* 04DE08 7F0192D8 00000000 */ nop -/* 04DE0C 7F0192DC 1000000C */ b .L7F019310 -/* 04DE10 7F0192E0 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0192E4: -/* 04DE14 7F0192E4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04DE18 7F0192E8 3405FFFF */ li $a1, 65535 -/* 04DE1C 7F0192EC 10400007 */ beqz $v0, .L7F01930C -/* 04DE20 7F0192F0 3C0F8003 */ lui $t7, %hi(full_actor_intro) -/* 04DE24 7F0192F4 8DEFB5FC */ lw $t7, %lo(full_actor_intro)($t7) -/* 04DE28 7F0192F8 24040005 */ li $a0, 5 -/* 04DE2C 7F0192FC 55E00004 */ bnezl $t7, .L7F019310 -/* 04DE30 7F019300 8FBF0024 */ lw $ra, 0x24($sp) -/* 04DE34 7F019304 0FC06975 */ jal set_menu_to_mode -/* 04DE38 7F019308 24050001 */ li $a1, 1 -.L7F01930C: -/* 04DE3C 7F01930C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F019310: -/* 04DE40 7F019310 8FB00014 */ lw $s0, 0x14($sp) -/* 04DE44 7F019314 8FB10018 */ lw $s1, 0x18($sp) -/* 04DE48 7F019318 8FB2001C */ lw $s2, 0x1c($sp) -/* 04DE4C 7F01931C 8FB30020 */ lw $s3, 0x20($sp) -/* 04DE50 7F019320 03E00008 */ jr $ra -/* 04DE54 7F019324 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif - -#if defined(VERSION_EU) -GLOBAL_ASM( -.late_rodata -glabel D_80051B08 -.word 0x3FAAAAAB /*1.3333334;*/ - -.text -glabel interface_menu18_displaycast -/* 04DA90 7F018F60 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 04DA94 7F018F64 3C014238 */ li $at, 0x42380000 # 46.000000 -/* 04DA98 7F018F68 AFBF0024 */ sw $ra, 0x24($sp) -/* 04DA9C 7F018F6C 44816000 */ mtc1 $at, $f12 -/* 04DAA0 7F018F70 AFB30020 */ sw $s3, 0x20($sp) -/* 04DAA4 7F018F74 AFB2001C */ sw $s2, 0x1c($sp) -/* 04DAA8 7F018F78 AFB10018 */ sw $s1, 0x18($sp) -/* 04DAAC 7F018F7C 0C001151 */ jal viSetFovY -/* 04DAB0 7F018F80 AFB00014 */ sw $s0, 0x14($sp) -/* 04DAB4 7F018F84 3C014120 */ li $at, 0x41200000 # 10.000000 -/* 04DAB8 7F018F88 44816000 */ mtc1 $at, $f12 -/* 04DABC 7F018F8C 3C0144FA */ li $at, 0x44FA0000 # 2000.000000 -/* 04DAC0 7F018F90 44817000 */ mtc1 $at, $f14 -/* 04DAC4 7F018F94 0C001194 */ jal viSetZRange -/* 04DAC8 7F018F98 00000000 */ nop -/* 04DACC 7F018F9C 0C00114D */ jal viSetUseZBuf -/* 04DAD0 7F018FA0 24040001 */ li $a0, 1 -/* 04DAD4 7F018FA4 3C018005 */ lui $at, %hi(D_80051B08) -/* 04DAD8 7F018FA8 0C001164 */ jal viSetAspect -/* 04DADC 7F018FAC C42C1B08 */ lwc1 $f12, %lo(D_80051B08)($at) -/* 04DAE0 7F018FB0 240401B8 */ li $a0, 440 -/* 04DAE4 7F018FB4 0FC26C77 */ jal set_cur_player_screen_size -/* 04DAE8 7F018FB8 2405014A */ li $a1, 330 -/* 04DAEC 7F018FBC 240401B8 */ li $a0, 440 -/* 04DAF0 7F018FC0 0C00110F */ jal viSetViewSize -/* 04DAF4 7F018FC4 2405014A */ li $a1, 330 -/* 04DAF8 7F018FC8 00002025 */ move $a0, $zero -/* 04DAFC 7F018FCC 0FC26C7E */ jal set_cur_player_viewport_size -/* 04DB00 7F018FD0 00002825 */ move $a1, $zero -/* 04DB04 7F018FD4 00002025 */ move $a0, $zero -/* 04DB08 7F018FD8 0C00112F */ jal viSetViewPosition -/* 04DB0C 7F018FDC 00002825 */ move $a1, $zero -/* 04DB10 7F018FE0 3C028003 */ lui $v0, %hi(g_MenuTimer) -/* 04DB14 7F018FE4 2442A8CC */ addiu $v0, %lo(g_MenuTimer) # addiu $v0, $v0, -0x5734 -/* 04DB18 7F018FE8 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 04DB1C 7F018FEC 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 04DB20 7F018FF0 8C4E0000 */ lw $t6, ($v0) -/* 04DB24 7F018FF4 3C108003 */ lui $s0, %hi(intro_character_index) -/* 04DB28 7F018FF8 00002025 */ move $a0, $zero -/* 04DB2C 7F018FFC 01CFC021 */ addu $t8, $t6, $t7 -/* 04DB30 7F019000 2B0100B5 */ slti $at, $t8, 0x97 -/* 04DB34 7F019004 142000B7 */ bnez $at, .L7F0192E4 -/* 04DB38 7F019008 AC580000 */ sw $t8, ($v0) -/* 04DB3C 7F01900C 2610B5E8 */ addiu $s0, %lo(intro_character_index) # addiu $s0, $s0, -0x4a18 -/* 04DB40 7F019010 8E080000 */ lw $t0, ($s0) -/* 04DB44 7F019014 3C118003 */ lui $s1, %hi(intro_char_table) -/* 04DB48 7F019018 2631B600 */ addiu $s1, %lo(intro_char_table) # addiu $s1, $s1, -0x4a00 -/* 04DB4C 7F01901C 25090001 */ addiu $t1, $t0, 1 -/* 04DB50 7F019020 AE090000 */ sw $t1, ($s0) -/* 04DB54 7F019024 24132710 */ li $s3, 10000 -/* 04DB58 7F019028 24120014 */ li $s2, 20 -.L7F01902C: -/* 04DB5C 7F01902C 8E030000 */ lw $v1, ($s0) -/* 04DB60 7F019030 3C0C8003 */ lui $t4, %hi(full_actor_intro) -/* 04DB64 7F019034 00720019 */ multu $v1, $s2 -/* 04DB68 7F019038 00005012 */ mflo $t2 -/* 04DB6C 7F01903C 022A1021 */ addu $v0, $s1, $t2 -/* 04DB70 7F019040 8C4B0010 */ lw $t3, 0x10($v0) -/* 04DB74 7F019044 51600008 */ beql $t3, $zero, .L7F019068 -/* 04DB78 7F019048 8C4E0000 */ lw $t6, ($v0) -/* 04DB7C 7F01904C 8D8CB5FC */ lw $t4, %lo(full_actor_intro)($t4) -/* 04DB80 7F019050 246D0001 */ addiu $t5, $v1, 1 -/* 04DB84 7F019054 55800004 */ bnezl $t4, .L7F019068 -/* 04DB88 7F019058 8C4E0000 */ lw $t6, ($v0) -/* 04DB8C 7F01905C 1000FFF3 */ b .L7F01902C -/* 04DB90 7F019060 AE0D0000 */ sw $t5, ($s0) -/* 04DB94 7F019064 8C4E0000 */ lw $t6, ($v0) -.L7F019068: -/* 04DB98 7F019068 24010027 */ li $at, 39 -/* 04DB9C 7F01906C 55C1000A */ bnel $t6, $at, .L7F019098 -/* 04DBA0 7F019070 8E190000 */ lw $t9, ($s0) -/* 04DBA4 7F019074 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DBA8 7F019078 00000000 */ nop -/* 04DBAC 7F01907C 54400006 */ bnezl $v0, .L7F019098 -/* 04DBB0 7F019080 8E190000 */ lw $t9, ($s0) -/* 04DBB4 7F019084 8E0F0000 */ lw $t7, ($s0) -/* 04DBB8 7F019088 25F80001 */ addiu $t8, $t7, 1 -/* 04DBBC 7F01908C 1000FFE7 */ b .L7F01902C -/* 04DBC0 7F019090 AE180000 */ sw $t8, ($s0) -/* 04DBC4 7F019094 8E190000 */ lw $t9, ($s0) -.L7F019098: -/* 04DBC8 7F019098 24010028 */ li $at, 40 -/* 04DBCC 7F01909C 03320019 */ multu $t9, $s2 -/* 04DBD0 7F0190A0 00004012 */ mflo $t0 -/* 04DBD4 7F0190A4 02284821 */ addu $t1, $s1, $t0 -/* 04DBD8 7F0190A8 8D2A0000 */ lw $t2, ($t1) -/* 04DBDC 7F0190AC 5541000A */ bnel $t2, $at, .L7F0190D8 -/* 04DBE0 7F0190B0 8E0D0000 */ lw $t5, ($s0) -/* 04DBE4 7F0190B4 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DBE8 7F0190B8 00000000 */ nop -/* 04DBEC 7F0190BC 54400006 */ bnezl $v0, .L7F0190D8 -/* 04DBF0 7F0190C0 8E0D0000 */ lw $t5, ($s0) -/* 04DBF4 7F0190C4 8E0B0000 */ lw $t3, ($s0) -/* 04DBF8 7F0190C8 256C0001 */ addiu $t4, $t3, 1 -/* 04DBFC 7F0190CC 1000FFD7 */ b .L7F01902C -/* 04DC00 7F0190D0 AE0C0000 */ sw $t4, ($s0) -/* 04DC04 7F0190D4 8E0D0000 */ lw $t5, ($s0) -.L7F0190D8: -/* 04DC08 7F0190D8 2401000E */ li $at, 14 -/* 04DC0C 7F0190DC 01B20019 */ multu $t5, $s2 -/* 04DC10 7F0190E0 00007012 */ mflo $t6 -/* 04DC14 7F0190E4 022E7821 */ addu $t7, $s1, $t6 -/* 04DC18 7F0190E8 8DF80000 */ lw $t8, ($t7) -/* 04DC1C 7F0190EC 57010013 */ bnel $t8, $at, .L7F01913C -/* 04DC20 7F0190F0 8E0A0000 */ lw $t2, ($s0) -/* 04DC24 7F0190F4 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DC28 7F0190F8 00000000 */ nop -/* 04DC2C 7F0190FC 5440000F */ bnezl $v0, .L7F01913C -/* 04DC30 7F019100 8E0A0000 */ lw $t2, ($s0) -/* 04DC34 7F019104 0C002914 */ jal randomGetNext -/* 04DC38 7F019108 00000000 */ nop -/* 04DC3C 7F01910C 0053001B */ divu $zero, $v0, $s3 -/* 04DC40 7F019110 0000C810 */ mfhi $t9 -/* 04DC44 7F019114 16600002 */ bnez $s3, .L7F019120 -/* 04DC48 7F019118 00000000 */ nop -/* 04DC4C 7F01911C 0007000D */ break 7 -.L7F019120: -/* 04DC50 7F019120 53200006 */ beql $t9, $zero, .L7F01913C -/* 04DC54 7F019124 8E0A0000 */ lw $t2, ($s0) -/* 04DC58 7F019128 8E080000 */ lw $t0, ($s0) -/* 04DC5C 7F01912C 25090001 */ addiu $t1, $t0, 1 -/* 04DC60 7F019130 1000FFBE */ b .L7F01902C -/* 04DC64 7F019134 AE090000 */ sw $t1, ($s0) -/* 04DC68 7F019138 8E0A0000 */ lw $t2, ($s0) -.L7F01913C: -/* 04DC6C 7F01913C 2401000D */ li $at, 13 -/* 04DC70 7F019140 01520019 */ multu $t2, $s2 -/* 04DC74 7F019144 00005812 */ mflo $t3 -/* 04DC78 7F019148 022B6021 */ addu $t4, $s1, $t3 -/* 04DC7C 7F01914C 8D8D0000 */ lw $t5, ($t4) -/* 04DC80 7F019150 55A10013 */ bnel $t5, $at, .L7F0191A0 -/* 04DC84 7F019154 8E190000 */ lw $t9, ($s0) -/* 04DC88 7F019158 0FC07AC8 */ jal check_aztec_completed_any_folder_secret_00 -/* 04DC8C 7F01915C 00000000 */ nop -/* 04DC90 7F019160 5440000F */ bnezl $v0, .L7F0191A0 -/* 04DC94 7F019164 8E190000 */ lw $t9, ($s0) -/* 04DC98 7F019168 0C002914 */ jal randomGetNext -/* 04DC9C 7F01916C 00000000 */ nop -/* 04DCA0 7F019170 0053001B */ divu $zero, $v0, $s3 -/* 04DCA4 7F019174 00007010 */ mfhi $t6 -/* 04DCA8 7F019178 16600002 */ bnez $s3, .L7F019184 -/* 04DCAC 7F01917C 00000000 */ nop -/* 04DCB0 7F019180 0007000D */ break 7 -.L7F019184: -/* 04DCB4 7F019184 51C00006 */ beql $t6, $zero, .L7F0191A0 -/* 04DCB8 7F019188 8E190000 */ lw $t9, ($s0) -/* 04DCBC 7F01918C 8E0F0000 */ lw $t7, ($s0) -/* 04DCC0 7F019190 25F80001 */ addiu $t8, $t7, 1 -/* 04DCC4 7F019194 1000FFA5 */ b .L7F01902C -/* 04DCC8 7F019198 AE180000 */ sw $t8, ($s0) -/* 04DCCC 7F01919C 8E190000 */ lw $t9, ($s0) -.L7F0191A0: -/* 04DCD0 7F0191A0 2401000F */ li $at, 15 -/* 04DCD4 7F0191A4 03320019 */ multu $t9, $s2 -/* 04DCD8 7F0191A8 00004012 */ mflo $t0 -/* 04DCDC 7F0191AC 02284821 */ addu $t1, $s1, $t0 -/* 04DCE0 7F0191B0 8D2A0000 */ lw $t2, ($t1) -/* 04DCE4 7F0191B4 55410013 */ bnel $t2, $at, .L7F019204 -/* 04DCE8 7F0191B8 8E0E0000 */ lw $t6, ($s0) -/* 04DCEC 7F0191BC 0FC07ADC */ jal fileIsEgyptCompletedOn00AnyFolder -/* 04DCF0 7F0191C0 00000000 */ nop -/* 04DCF4 7F0191C4 5440000F */ bnezl $v0, .L7F019204 -/* 04DCF8 7F0191C8 8E0E0000 */ lw $t6, ($s0) -/* 04DCFC 7F0191CC 0C002914 */ jal randomGetNext -/* 04DD00 7F0191D0 00000000 */ nop -/* 04DD04 7F0191D4 0053001B */ divu $zero, $v0, $s3 -/* 04DD08 7F0191D8 00005810 */ mfhi $t3 -/* 04DD0C 7F0191DC 16600002 */ bnez $s3, .L7F0191E8 -/* 04DD10 7F0191E0 00000000 */ nop -/* 04DD14 7F0191E4 0007000D */ break 7 -.L7F0191E8: -/* 04DD18 7F0191E8 51600006 */ beql $t3, $zero, .L7F019204 -/* 04DD1C 7F0191EC 8E0E0000 */ lw $t6, ($s0) -/* 04DD20 7F0191F0 8E0C0000 */ lw $t4, ($s0) -/* 04DD24 7F0191F4 258D0001 */ addiu $t5, $t4, 1 -/* 04DD28 7F0191F8 1000FF8C */ b .L7F01902C -/* 04DD2C 7F0191FC AE0D0000 */ sw $t5, ($s0) -/* 04DD30 7F019200 8E0E0000 */ lw $t6, ($s0) -.L7F019204: -/* 04DD34 7F019204 2401000C */ li $at, 12 -/* 04DD38 7F019208 01D20019 */ multu $t6, $s2 -/* 04DD3C 7F01920C 00007812 */ mflo $t7 -/* 04DD40 7F019210 022FC021 */ addu $t8, $s1, $t7 -/* 04DD44 7F019214 8F190000 */ lw $t9, ($t8) -/* 04DD48 7F019218 57210013 */ bnel $t9, $at, .L7F019268 -/* 04DD4C 7F01921C 8E030000 */ lw $v1, ($s0) -/* 04DD50 7F019220 0FC07ADC */ jal fileIsEgyptCompletedOn00AnyFolder -/* 04DD54 7F019224 00000000 */ nop -/* 04DD58 7F019228 5440000F */ bnezl $v0, .L7F019268 -/* 04DD5C 7F01922C 8E030000 */ lw $v1, ($s0) -/* 04DD60 7F019230 0C002914 */ jal randomGetNext -/* 04DD64 7F019234 00000000 */ nop -/* 04DD68 7F019238 0053001B */ divu $zero, $v0, $s3 -/* 04DD6C 7F01923C 00004010 */ mfhi $t0 -/* 04DD70 7F019240 16600002 */ bnez $s3, .L7F01924C -/* 04DD74 7F019244 00000000 */ nop -/* 04DD78 7F019248 0007000D */ break 7 -.L7F01924C: -/* 04DD7C 7F01924C 51000006 */ beql $t0, $zero, .L7F019268 -/* 04DD80 7F019250 8E030000 */ lw $v1, ($s0) -/* 04DD84 7F019254 8E090000 */ lw $t1, ($s0) -/* 04DD88 7F019258 252A0001 */ addiu $t2, $t1, 1 -/* 04DD8C 7F01925C 1000FF73 */ b .L7F01902C -/* 04DD90 7F019260 AE0A0000 */ sw $t2, ($s0) -/* 04DD94 7F019264 8E030000 */ lw $v1, ($s0) -.L7F019268: -/* 04DD98 7F019268 24040018 */ li $a0, 24 -/* 04DD9C 7F01926C 3C0E8003 */ lui $t6, %hi(full_actor_intro) -/* 04DDA0 7F019270 00720019 */ multu $v1, $s2 -/* 04DDA4 7F019274 00005812 */ mflo $t3 -/* 04DDA8 7F019278 022B6021 */ addu $t4, $s1, $t3 -/* 04DDAC 7F01927C 8D8D0000 */ lw $t5, ($t4) -/* 04DDB0 7F019280 05A10003 */ bgez $t5, .L7F019290 -/* 04DDB4 7F019284 00000000 */ nop -/* 04DDB8 7F019288 AE000000 */ sw $zero, ($s0) -/* 04DDBC 7F01928C 00001825 */ move $v1, $zero -.L7F019290: -/* 04DDC0 7F019290 18600005 */ blez $v1, .L7F0192A8 -/* 04DDC4 7F019294 00000000 */ nop -/* 04DDC8 7F019298 0FC06975 */ jal set_menu_to_mode -/* 04DDCC 7F01929C 24050001 */ li $a1, 1 -/* 04DDD0 7F0192A0 1000001B */ b .L7F019310 -/* 04DDD4 7F0192A4 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0192A8: -/* 04DDD8 7F0192A8 8DCEB5FC */ lw $t6, %lo(full_actor_intro)($t6) -/* 04DDDC 7F0192AC 24040007 */ li $a0, 7 -/* 04DDE0 7F0192B0 11C00008 */ beqz $t6, .L7F0192D4 -/* 04DDE4 7F0192B4 00000000 */ nop -/* 04DDE8 7F0192B8 0FC06975 */ jal set_menu_to_mode -/* 04DDEC 7F0192BC 24050001 */ li $a1, 1 -/* 04DDF0 7F0192C0 0FC038F8 */ jal set_cursor_to_stage_solo -/* 04DDF4 7F0192C4 24040011 */ li $a0, 17 -/* 04DDF8 7F0192C8 3C018003 */ lui $at, %hi(full_actor_intro) -/* 04DDFC 7F0192CC 1000000F */ b .L7F01930C -/* 04DE00 7F0192D0 AC20B5FC */ sw $zero, %lo(full_actor_intro)($at) -.L7F0192D4: -/* 04DE04 7F0192D4 0FC3025C */ jal select_ramrom_to_play -/* 04DE08 7F0192D8 00000000 */ nop -/* 04DE0C 7F0192DC 1000000C */ b .L7F019310 -/* 04DE10 7F0192E0 8FBF0024 */ lw $ra, 0x24($sp) -.L7F0192E4: -/* 04DE14 7F0192E4 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 04DE18 7F0192E8 3405FFFF */ li $a1, 65535 -/* 04DE1C 7F0192EC 10400007 */ beqz $v0, .L7F01930C -/* 04DE20 7F0192F0 3C0F8003 */ lui $t7, %hi(full_actor_intro) -/* 04DE24 7F0192F4 8DEFB5FC */ lw $t7, %lo(full_actor_intro)($t7) -/* 04DE28 7F0192F8 24040005 */ li $a0, 5 -/* 04DE2C 7F0192FC 55E00004 */ bnezl $t7, .L7F019310 -/* 04DE30 7F019300 8FBF0024 */ lw $ra, 0x24($sp) -/* 04DE34 7F019304 0FC06975 */ jal set_menu_to_mode -/* 04DE38 7F019308 24050001 */ li $a1, 1 -.L7F01930C: -/* 04DE3C 7F01930C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F019310: -/* 04DE40 7F019310 8FB00014 */ lw $s0, 0x14($sp) -/* 04DE44 7F019314 8FB10018 */ lw $s1, 0x18($sp) -/* 04DE48 7F019318 8FB2001C */ lw $s2, 0x1c($sp) -/* 04DE4C 7F01931C 8FB30020 */ lw $s3, 0x20($sp) -/* 04DE50 7F019320 03E00008 */ jr $ra -/* 04DE54 7F019324 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif -#endif - - - -#ifdef NONMATCHING -void constructor_menu18_displaycast(void) { -} #else #ifndef VERSION_EU GLOBAL_ASM( @@ -22643,16 +10591,16 @@ glabel constructor_menu18_displaycast /* 04E1E0 7F0196B0 AC4B0000 */ sw $t3, ($v0) /* 04E1E4 7F0196B4 AC580004 */ sw $t8, 4($v0) /* 04E1E8 7F0196B8 3C0C0386 */ lui $t4, (0x03860010 >> 16) # lui $t4, 0x386 -/* 04E1EC 7F0196BC 3C198003 */ lui $t9, %hi(RGBA_8002A978) -/* 04E1F0 7F0196C0 2739A978 */ addiu $t9, %lo(RGBA_8002A978) # addiu $t9, $t9, -0x5688 +/* 04E1EC 7F0196BC 3C198003 */ lui $t9, %hi(gelogolight + 0x8) +/* 04E1F0 7F0196C0 2739A978 */ addiu $t9, %lo(gelogolight + 0x8) # addiu $t9, $t9, -0x5688 /* 04E1F4 7F0196C4 358C0010 */ ori $t4, (0x03860010 & 0xFFFF) # ori $t4, $t4, 0x10 /* 04E1F8 7F0196C8 02602025 */ move $a0, $s3 /* 04E1FC 7F0196CC 26730008 */ addiu $s3, $s3, 8 /* 04E200 7F0196D0 AC6C0000 */ sw $t4, ($v1) /* 04E204 7F0196D4 AC790004 */ sw $t9, 4($v1) /* 04E208 7F0196D8 3C0E0388 */ lui $t6, (0x03880010 >> 16) # lui $t6, 0x388 -/* 04E20C 7F0196DC 3C0F8003 */ lui $t7, %hi(RGBA_8002A970) -/* 04E210 7F0196E0 25EFA970 */ addiu $t7, %lo(RGBA_8002A970) # addiu $t7, $t7, -0x5690 +/* 04E20C 7F0196DC 3C0F8003 */ lui $t7, %hi(gelogolight) +/* 04E210 7F0196E0 25EFA970 */ addiu $t7, %lo(gelogolight) # addiu $t7, $t7, -0x5690 /* 04E214 7F0196E4 35CE0010 */ ori $t6, (0x03880010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 04E218 7F0196E8 02602825 */ move $a1, $s3 /* 04E21C 7F0196EC AC8E0000 */ sw $t6, ($a0) @@ -22666,24 +10614,24 @@ glabel constructor_menu18_displaycast /* 04E23C 7F01970C 3C0B0382 */ lui $t3, (0x03820010 >> 16) # lui $t3, 0x382 /* 04E240 7F019710 356B0010 */ ori $t3, (0x03820010 & 0xFFFF) # ori $t3, $t3, 0x10 /* 04E244 7F019714 26180010 */ addiu $t8, $s0, 0x10 -/* 04E248 7F019718 3C148003 */ lui $s4, %hi(objinstance) -/* 04E24C 7F01971C 2694B5F4 */ addiu $s4, %lo(objinstance) # addiu $s4, $s4, -0x4a0c +/* 04E248 7F019718 3C148003 */ lui $s4, %hi(cast_model) +/* 04E24C 7F01971C 2694B5F4 */ addiu $s4, %lo(cast_model) # addiu $s4, $s4, -0x4a0c /* 04E250 7F019720 ACF80004 */ sw $t8, 4($a3) /* 04E254 7F019724 ACEB0000 */ sw $t3, ($a3) /* 04E258 7F019728 3C058005 */ lui $a1, %hi(g_ClockTimer) /* 04E25C 7F01972C 26730008 */ addiu $s3, $s3, 8 /* 04E260 7F019730 8CA58374 */ lw $a1, %lo(g_ClockTimer)($a1) /* 04E264 7F019734 8E840000 */ lw $a0, ($s4) -/* 04E268 7F019738 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 04E268 7F019738 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 04E26C 7F01973C 24060001 */ li $a2, 1 -/* 04E270 7F019740 0FC1B100 */ jal set_80036084 +/* 04E270 7F019740 0FC1B100 */ jal modelSetDistanceDisabled /* 04E274 7F019744 24040001 */ li $a0, 1 /* 04E278 7F019748 0FC1CFF2 */ jal sub_GAME_7F073FC8 /* 04E27C 7F01974C 00002025 */ move $a0, $zero /* 04E280 7F019750 0FC1B5AC */ jal subcalcpos /* 04E284 7F019754 8E840000 */ lw $a0, ($s4) -/* 04E288 7F019758 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E28C 7F01975C 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E288 7F019758 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E28C 7F01975C 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E290 7F019760 10E0000B */ beqz $a3, .L7F019790 /* 04E294 7F019764 00000000 */ nop /* 04E298 7F019768 8CEC0008 */ lw $t4, 8($a3) @@ -22694,8 +10642,8 @@ glabel constructor_menu18_displaycast /* 04E2AC 7F01977C 0FC1B1E7 */ jal modelGetNodeRwData /* 04E2B0 7F019780 00E02025 */ move $a0, $a3 /* 04E2B4 7F019784 A4400000 */ sh $zero, ($v0) -/* 04E2B8 7F019788 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E2BC 7F01978C 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E2B8 7F019788 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E2BC 7F01978C 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) .L7F019790: /* 04E2C0 7F019790 50E0000A */ beql $a3, $zero, .L7F0197BC /* 04E2C4 7F019794 8E8D0000 */ lw $t5, ($s4) @@ -22725,8 +10673,8 @@ glabel constructor_menu18_displaycast /* 04E320 7F0197F0 8E840000 */ lw $a0, ($s4) /* 04E324 7F0197F4 0FC1B2E6 */ jal getsuboffset /* 04E328 7F0197F8 27A50128 */ addiu $a1, $sp, 0x128 -/* 04E32C 7F0197FC 3C068007 */ lui $a2, %hi(flt_CODE_bss_800695E4) -/* 04E330 7F019800 24C695E4 */ addiu $a2, %lo(flt_CODE_bss_800695E4) # addiu $a2, $a2, -0x6a1c +/* 04E32C 7F0197FC 3C068007 */ lui $a2, %hi(bss_800695E4) +/* 04E330 7F019800 24C695E4 */ addiu $a2, %lo(bss_800695E4) # addiu $a2, $a2, -0x6a1c /* 04E334 7F019804 8CC20000 */ lw $v0, ($a2) /* 04E338 7F019808 00008825 */ move $s1, $zero /* 04E33C 7F01980C 3C038005 */ lui $v1, %hi(g_ClockTimer) @@ -22847,12 +10795,12 @@ glabel constructor_menu18_displaycast /* 04E4F4 7F0199C4 E6060004 */ swc1 $f6, 4($s0) /* 04E4F8 7F0199C8 46044180 */ add.s $f6, $f8, $f4 /* 04E4FC 7F0199CC E6060008 */ swc1 $f6, 8($s0) -/* 04E500 7F0199D0 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 04E500 7F0199D0 0FC1611D */ jal mtx4TransformVecInPlace /* 04E504 7F0199D4 8D84000C */ lw $a0, 0xc($t4) /* 04E508 7F0199D8 C60A0004 */ lwc1 $f10, 4($s0) /* 04E50C 7F0199DC C6040008 */ lwc1 $f4, 8($s0) -/* 04E510 7F0199E0 3C068007 */ lui $a2, %hi(flt_CODE_bss_800695E4) -/* 04E514 7F0199E4 24C695E4 */ addiu $a2, %lo(flt_CODE_bss_800695E4) # addiu $a2, $a2, -0x6a1c +/* 04E510 7F0199E0 3C068007 */ lui $a2, %hi(bss_800695E4) +/* 04E514 7F0199E4 24C695E4 */ addiu $a2, %lo(bss_800695E4) # addiu $a2, $a2, -0x6a1c /* 04E518 7F0199E8 8CD90000 */ lw $t9, ($a2) /* 04E51C 7F0199EC 3C018005 */ lui $at, %hi(D_80051B30) /* 04E520 7F0199F0 E7AA0064 */ swc1 $f10, 0x64($sp) @@ -22999,19 +10947,19 @@ glabel constructor_menu18_displaycast /* 04E744 7F019C14 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04E748 7F019C18 0FC1BCBE */ jal subcalcmatrices /* 04E74C 7F019C1C 8E850000 */ lw $a1, ($s4) -/* 04E750 7F019C20 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E754 7F019C24 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E750 7F019C20 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E754 7F019C24 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E758 7F019C28 50E00025 */ beql $a3, $zero, .L7F019CC0 /* 04E75C 7F019C2C 24180007 */ li $t8, 7 /* 04E760 7F019C30 8E840000 */ lw $a0, ($s4) /* 04E764 7F019C34 8CE5001C */ lw $a1, 0x1c($a3) -/* 04E768 7F019C38 0FC1B198 */ jal sub_GAME_7F06C660 +/* 04E768 7F019C38 0FC1B198 */ jal modelFindNodeMtx /* 04E76C 7F019C3C 00003025 */ move $a2, $zero /* 04E770 7F019C40 8E980000 */ lw $t8, ($s4) /* 04E774 7F019C44 AFA201A8 */ sw $v0, 0x1a8($sp) -/* 04E778 7F019C48 3C078003 */ lui $a3, %hi(ptrobjinstance) +/* 04E778 7F019C48 3C078003 */ lui $a3, %hi(cast_model_weapon) /* 04E77C 7F019C4C 8F0C0008 */ lw $t4, 8($t8) -/* 04E780 7F019C50 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E780 7F019C50 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E784 7F019C54 27B20160 */ addiu $s2, $sp, 0x160 /* 04E788 7F019C58 8D990008 */ lw $t9, 8($t4) /* 04E78C 7F019C5C 8CEB001C */ lw $t3, 0x1c($a3) @@ -23025,8 +10973,8 @@ glabel constructor_menu18_displaycast /* 04E7AC 7F019C7C 8FA401A8 */ lw $a0, 0x1a8($sp) /* 04E7B0 7F019C80 0FC1601A */ jal matrix_4x4_multiply_in_place /* 04E7B4 7F019C84 02402825 */ move $a1, $s2 -/* 04E7B8 7F019C88 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E7BC 7F019C8C 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E7B8 7F019C88 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E7BC 7F019C8C 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E7C0 7F019C90 AFB201A8 */ sw $s2, 0x1a8($sp) /* 04E7C4 7F019C94 8CEF0008 */ lw $t7, 8($a3) .L7F019C98: @@ -23034,9 +10982,9 @@ glabel constructor_menu18_displaycast /* 04E7CC 7F019C9C 00046980 */ sll $t5, $a0, 6 /* 04E7D0 7F019CA0 0FC2F5C5 */ jal dynAllocate /* 04E7D4 7F019CA4 01A02025 */ move $a0, $t5 -/* 04E7D8 7F019CA8 3C058003 */ lui $a1, %hi(ptrobjinstance) +/* 04E7D8 7F019CA8 3C058003 */ lui $a1, %hi(cast_model_weapon) /* 04E7DC 7F019CAC AFA201B8 */ sw $v0, 0x1b8($sp) -/* 04E7E0 7F019CB0 8CA5B5F8 */ lw $a1, %lo(ptrobjinstance)($a1) +/* 04E7E0 7F019CB0 8CA5B5F8 */ lw $a1, %lo(cast_model_weapon)($a1) /* 04E7E4 7F019CB4 0FC1BC92 */ jal instcalcmatrices /* 04E7E8 7F019CB8 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04E7EC 7F019CBC 24180007 */ li $t8, 7 @@ -23051,15 +10999,15 @@ glabel constructor_menu18_displaycast /* 04E80C 7F019CDC 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04E810 7F019CE0 0FC1D1A1 */ jal subdraw /* 04E814 7F019CE4 8E850000 */ lw $a1, ($s4) -/* 04E818 7F019CE8 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E81C 7F019CEC 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E818 7F019CE8 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E81C 7F019CEC 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E820 7F019CF0 10E00003 */ beqz $a3, .L7F019D00 /* 04E824 7F019CF4 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04E828 7F019CF8 0FC1D1A1 */ jal subdraw /* 04E82C 7F019CFC 00E02825 */ move $a1, $a3 .L7F019D00: /* 04E830 7F019D00 8FB301B4 */ lw $s3, 0x1b4($sp) -/* 04E834 7F019D04 0FC1B100 */ jal set_80036084 +/* 04E834 7F019D04 0FC1B100 */ jal modelSetDistanceDisabled /* 04E838 7F019D08 00002025 */ move $a0, $zero /* 04E83C 7F019D0C 8E820000 */ lw $v0, ($s4) /* 04E840 7F019D10 8C4B0008 */ lw $t3, 8($v0) @@ -23086,8 +11034,8 @@ glabel constructor_menu18_displaycast /* 04E890 7F019D60 5420FFF0 */ bnezl $at, .L7F019D24 /* 04E894 7F019D64 8C4F000C */ lw $t7, 0xc($v0) .L7F019D68: -/* 04E898 7F019D68 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E89C 7F019D6C 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E898 7F019D68 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E89C 7F019D6C 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E8A0 7F019D70 50E0001C */ beql $a3, $zero, .L7F019DE4 /* 04E8A4 7F019D74 02601025 */ move $v0, $s3 /* 04E8A8 7F019D78 8CEE0008 */ lw $t6, 8($a3) @@ -23101,15 +11049,15 @@ glabel constructor_menu18_displaycast /* 04E8C4 7F019D94 02402825 */ move $a1, $s2 /* 04E8C8 7F019D98 0FC16008 */ jal matrix_4x4_copy /* 04E8CC 7F019D9C 01B02021 */ addu $a0, $t5, $s0 -/* 04E8D0 7F019DA0 3C188003 */ lui $t8, %hi(ptrobjinstance) -/* 04E8D4 7F019DA4 8F18B5F8 */ lw $t8, %lo(ptrobjinstance)($t8) +/* 04E8D0 7F019DA0 3C188003 */ lui $t8, %hi(cast_model_weapon) +/* 04E8D4 7F019DA4 8F18B5F8 */ lw $t8, %lo(cast_model_weapon)($t8) /* 04E8D8 7F019DA8 0011C980 */ sll $t9, $s1, 6 /* 04E8DC 7F019DAC 02402025 */ move $a0, $s2 /* 04E8E0 7F019DB0 8F0C000C */ lw $t4, 0xc($t8) /* 04E8E4 7F019DB4 0FC16327 */ jal matrix_4x4_f32_to_s32 /* 04E8E8 7F019DB8 01992821 */ addu $a1, $t4, $t9 -/* 04E8EC 7F019DBC 3C078003 */ lui $a3, %hi(ptrobjinstance) -/* 04E8F0 7F019DC0 8CE7B5F8 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04E8EC 7F019DBC 3C078003 */ lui $a3, %hi(cast_model_weapon) +/* 04E8F0 7F019DC0 8CE7B5F8 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04E8F4 7F019DC4 26310001 */ addiu $s1, $s1, 1 /* 04E8F8 7F019DC8 26100040 */ addiu $s0, $s0, 0x40 /* 04E8FC 7F019DCC 8CEB0008 */ lw $t3, 8($a3) @@ -23236,17 +11184,17 @@ glabel constructor_menu18_displaycast /* 04EADC 7F019FAC 008B2021 */ addu $a0, $a0, $t3 /* 04EAE0 7F019FB0 0FC30776 */ jal langGet /* 04EAE4 7F019FB4 9484B608 */ lhu $a0, %lo(intro_char_table+8)($a0) -/* 04EAE8 7F019FB8 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) -/* 04EAEC 7F019FBC 8DCE0EB4 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 04EAF0 7F019FC0 3C148004 */ lui $s4, %hi(ptrSecondFontTableLarge) -/* 04EAF4 7F019FC4 26940EB8 */ addiu $s4, %lo(ptrSecondFontTableLarge) # addiu $s4, $s4, 0xeb8 +/* 04EAE8 7F019FB8 3C0E8004 */ lui $t6, %hi(ptrFontZurichBold) +/* 04EAEC 7F019FBC 8DCE0EB4 */ lw $t6, %lo(ptrFontZurichBold)($t6) +/* 04EAF0 7F019FC0 3C148004 */ lui $s4, %hi(ptrFontZurichBoldChars) +/* 04EAF4 7F019FC4 26940EB8 */ addiu $s4, %lo(ptrFontZurichBoldChars) # addiu $s4, $s4, 0xeb8 /* 04EAF8 7F019FC8 00408825 */ move $s1, $v0 /* 04EAFC 7F019FCC 8E870000 */ lw $a3, ($s4) /* 04EB00 7F019FD0 27A40150 */ addiu $a0, $sp, 0x150 /* 04EB04 7F019FD4 27A50154 */ addiu $a1, $sp, 0x154 /* 04EB08 7F019FD8 00403025 */ move $a2, $v0 /* 04EB0C 7F019FDC AFA00014 */ sw $zero, 0x14($sp) -/* 04EB10 7F019FE0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 04EB10 7F019FE0 0FC2BA63 */ jal textMeasure /* 04EB14 7F019FE4 AFAE0010 */ sw $t6, 0x10($sp) /* 04EB18 7F019FE8 8FA20154 */ lw $v0, 0x154($sp) /* 04EB1C 7F019FEC 8FB80150 */ lw $t8, 0x150($sp) @@ -23278,8 +11226,8 @@ glabel constructor_menu18_displaycast /* 04EB80 7F01A050 240C0001 */ li $t4, 1 /* 04EB84 7F01A054 44CCF800 */ ctc1 $t4, $31 /* 04EB88 7F01A058 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 04EB8C 7F01A05C 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 04EB90 7F01A060 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) +/* 04EB8C 7F01A05C 3C0D8004 */ lui $t5, %hi(ptrFontZurichBold) +/* 04EB90 7F01A060 8DAD0EB4 */ lw $t5, %lo(ptrFontZurichBold)($t5) /* 04EB94 7F01A064 460021A4 */ cvt.w.s $f6, $f4 /* 04EB98 7F01A068 8E8E0000 */ lw $t6, ($s4) /* 04EB9C 7F01A06C 02602025 */ move $a0, $s3 @@ -23323,7 +11271,7 @@ glabel constructor_menu18_displaycast /* 04EC28 7F01A0F8 AFB0001C */ sw $s0, 0x1c($sp) /* 04EC2C 7F01A0FC AFA20020 */ sw $v0, 0x20($sp) /* 04EC30 7F01A100 AFA00024 */ sw $zero, 0x24($sp) -/* 04EC34 7F01A104 0FC2B6AF */ jal en_text_write_stuff +/* 04EC34 7F01A104 0FC2B6AF */ jal textRender /* 04EC38 7F01A108 AFA00028 */ sw $zero, 0x28($sp) /* 04EC3C 7F01A10C 00409825 */ move $s3, $v0 .L7F01A110: @@ -23339,10 +11287,10 @@ glabel constructor_menu18_displaycast /* 04EC64 7F01A134 01795821 */ addu $t3, $t3, $t9 /* 04EC68 7F01A138 4452F800 */ cfc1 $s2, $31 /* 04EC6C 7F01A13C 000B5880 */ sll $t3, $t3, 2 -/* 04EC70 7F01A140 3C148004 */ lui $s4, %hi(ptrSecondFontTableLarge) +/* 04EC70 7F01A140 3C148004 */ lui $s4, %hi(ptrFontZurichBoldChars) /* 04EC74 7F01A144 008B2021 */ addu $a0, $a0, $t3 /* 04EC78 7F01A148 32520078 */ andi $s2, $s2, 0x78 -/* 04EC7C 7F01A14C 26940EB8 */ addiu $s4, %lo(ptrSecondFontTableLarge) # addiu $s4, $s4, 0xeb8 +/* 04EC7C 7F01A14C 26940EB8 */ addiu $s4, %lo(ptrFontZurichBoldChars) # addiu $s4, $s4, 0xeb8 /* 04EC80 7F01A150 12400013 */ beqz $s2, .L7F01A1A0 /* 04EC84 7F01A154 9484B60A */ lhu $a0, %lo(intro_char_table+10)($a0) /* 04EC88 7F01A158 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 @@ -23375,15 +11323,15 @@ glabel constructor_menu18_displaycast /* 04ECE8 7F01A1B8 44CEF800 */ ctc1 $t6, $31 /* 04ECEC 7F01A1BC 0FC30776 */ jal langGet /* 04ECF0 7F01A1C0 01A09025 */ move $s2, $t5 -/* 04ECF4 7F01A1C4 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) -/* 04ECF8 7F01A1C8 8DEF0EB4 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) +/* 04ECF4 7F01A1C4 3C0F8004 */ lui $t7, %hi(ptrFontZurichBold) +/* 04ECF8 7F01A1C8 8DEF0EB4 */ lw $t7, %lo(ptrFontZurichBold)($t7) /* 04ECFC 7F01A1CC 00408825 */ move $s1, $v0 /* 04ED00 7F01A1D0 27A40150 */ addiu $a0, $sp, 0x150 /* 04ED04 7F01A1D4 27A50154 */ addiu $a1, $sp, 0x154 /* 04ED08 7F01A1D8 00403025 */ move $a2, $v0 /* 04ED0C 7F01A1DC 8E870000 */ lw $a3, ($s4) /* 04ED10 7F01A1E0 AFA00014 */ sw $zero, 0x14($sp) -/* 04ED14 7F01A1E4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 04ED14 7F01A1E4 0FC2BA63 */ jal textMeasure /* 04ED18 7F01A1E8 AFAF0010 */ sw $t7, 0x10($sp) /* 04ED1C 7F01A1EC 8FA20154 */ lw $v0, 0x154($sp) /* 04ED20 7F01A1F0 8FAB0150 */ lw $t3, 0x150($sp) @@ -23411,8 +11359,8 @@ glabel constructor_menu18_displaycast /* 04ED74 7F01A244 00106C03 */ sra $t5, $s0, 0x10 /* 04ED78 7F01A248 0C00110B */ jal viGetY /* 04ED7C 7F01A24C 01A08025 */ move $s0, $t5 -/* 04ED80 7F01A250 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) -/* 04ED84 7F01A254 8F180EB4 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) +/* 04ED80 7F01A250 3C188004 */ lui $t8, %hi(ptrFontZurichBold) +/* 04ED84 7F01A254 8F180EB4 */ lw $t8, %lo(ptrFontZurichBold)($t8) /* 04ED88 7F01A258 8E8F0000 */ lw $t7, ($s4) /* 04ED8C 7F01A25C 02602025 */ move $a0, $s3 /* 04ED90 7F01A260 27A5015C */ addiu $a1, $sp, 0x15c @@ -23424,7 +11372,7 @@ glabel constructor_menu18_displaycast /* 04EDA8 7F01A278 AFA00024 */ sw $zero, 0x24($sp) /* 04EDAC 7F01A27C AFA00028 */ sw $zero, 0x28($sp) /* 04EDB0 7F01A280 AFB80014 */ sw $t8, 0x14($sp) -/* 04EDB4 7F01A284 0FC2B6AF */ jal en_text_write_stuff +/* 04EDB4 7F01A284 0FC2B6AF */ jal textRender /* 04EDB8 7F01A288 AFAF0010 */ sw $t7, 0x10($sp) /* 04EDBC 7F01A28C 3C0C8003 */ lui $t4, %hi(intro_character_index) /* 04EDC0 7F01A290 8D8CB5E8 */ lw $t4, %lo(intro_character_index)($t4) @@ -23436,15 +11384,15 @@ glabel constructor_menu18_displaycast /* 04EDD8 7F01A2A8 00992021 */ addu $a0, $a0, $t9 /* 04EDDC 7F01A2AC 0FC30776 */ jal langGet /* 04EDE0 7F01A2B0 9484B60C */ lhu $a0, %lo(intro_char_table+12)($a0) -/* 04EDE4 7F01A2B4 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableLarge) -/* 04EDE8 7F01A2B8 8D6B0EB4 */ lw $t3, %lo(ptrFirstFontTableLarge)($t3) +/* 04EDE4 7F01A2B4 3C0B8004 */ lui $t3, %hi(ptrFontZurichBold) +/* 04EDE8 7F01A2B8 8D6B0EB4 */ lw $t3, %lo(ptrFontZurichBold)($t3) /* 04EDEC 7F01A2BC 00408825 */ move $s1, $v0 /* 04EDF0 7F01A2C0 27A40150 */ addiu $a0, $sp, 0x150 /* 04EDF4 7F01A2C4 27A50154 */ addiu $a1, $sp, 0x154 /* 04EDF8 7F01A2C8 00403025 */ move $a2, $v0 /* 04EDFC 7F01A2CC 8E870000 */ lw $a3, ($s4) /* 04EE00 7F01A2D0 AFA00014 */ sw $zero, 0x14($sp) -/* 04EE04 7F01A2D4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 04EE04 7F01A2D4 0FC2BA63 */ jal textMeasure /* 04EE08 7F01A2D8 AFAB0010 */ sw $t3, 0x10($sp) /* 04EE0C 7F01A2DC 8FA20154 */ lw $v0, 0x154($sp) /* 04EE10 7F01A2E0 8FB80150 */ lw $t8, 0x150($sp) @@ -23472,8 +11420,8 @@ glabel constructor_menu18_displaycast /* 04EE64 7F01A334 0010CC03 */ sra $t9, $s0, 0x10 /* 04EE68 7F01A338 0C00110B */ jal viGetY /* 04EE6C 7F01A33C 03208025 */ move $s0, $t9 -/* 04EE70 7F01A340 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) -/* 04EE74 7F01A344 8DAD0EB4 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) +/* 04EE70 7F01A340 3C0D8004 */ lui $t5, %hi(ptrFontZurichBold) +/* 04EE74 7F01A344 8DAD0EB4 */ lw $t5, %lo(ptrFontZurichBold)($t5) /* 04EE78 7F01A348 8E8B0000 */ lw $t3, ($s4) /* 04EE7C 7F01A34C 02602025 */ move $a0, $s3 /* 04EE80 7F01A350 27A5015C */ addiu $a1, $sp, 0x15c @@ -23485,7 +11433,7 @@ glabel constructor_menu18_displaycast /* 04EE98 7F01A368 AFA00024 */ sw $zero, 0x24($sp) /* 04EE9C 7F01A36C AFA00028 */ sw $zero, 0x28($sp) /* 04EEA0 7F01A370 AFAD0014 */ sw $t5, 0x14($sp) -/* 04EEA4 7F01A374 0FC2B6AF */ jal en_text_write_stuff +/* 04EEA4 7F01A374 0FC2B6AF */ jal textRender /* 04EEA8 7F01A378 AFAB0010 */ sw $t3, 0x10($sp) /* 04EEAC 7F01A37C 8FBF004C */ lw $ra, 0x4c($sp) /* 04EEB0 7F01A380 8FB00038 */ lw $s0, 0x38($sp) @@ -23767,16 +11715,16 @@ glabel constructor_menu18_displaycast /* 04C11C 7F01972C AC4B0000 */ sw $t3, ($v0) /* 04C120 7F019730 AC580004 */ sw $t8, 4($v0) /* 04C124 7F019734 3C0C0386 */ lui $t4, (0x03860010 >> 16) # lui $t4, 0x386 -/* 04C128 7F019738 3C198002 */ lui $t9, %hi(RGBA_8002A978) # $t9, 0x8002 -/* 04C12C 7F01973C 27395EC8 */ addiu $t9, %lo(RGBA_8002A978) # addiu $t9, $t9, 0x5ec8 +/* 04C128 7F019738 3C198002 */ lui $t9, %hi(gelogolight + 0x8) # $t9, 0x8002 +/* 04C12C 7F01973C 27395EC8 */ addiu $t9, %lo(gelogolight + 0x8) # addiu $t9, $t9, 0x5ec8 /* 04C130 7F019740 358C0010 */ ori $t4, (0x03860010 & 0xFFFF) # ori $t4, $t4, 0x10 /* 04C134 7F019744 02602025 */ move $a0, $s3 /* 04C138 7F019748 26730008 */ addiu $s3, $s3, 8 /* 04C13C 7F01974C AC6C0000 */ sw $t4, ($v1) /* 04C140 7F019750 AC790004 */ sw $t9, 4($v1) /* 04C144 7F019754 3C0E0388 */ lui $t6, (0x03880010 >> 16) # lui $t6, 0x388 -/* 04C148 7F019758 3C0F8002 */ lui $t7, %hi(RGBA_8002A970) # $t7, 0x8002 -/* 04C14C 7F01975C 25EF5EC0 */ addiu $t7, %lo(RGBA_8002A970) # addiu $t7, $t7, 0x5ec0 +/* 04C148 7F019758 3C0F8002 */ lui $t7, %hi(gelogolight) # $t7, 0x8002 +/* 04C14C 7F01975C 25EF5EC0 */ addiu $t7, %lo(gelogolight) # addiu $t7, $t7, 0x5ec0 /* 04C150 7F019760 35CE0010 */ ori $t6, (0x03880010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 04C154 7F019764 02602825 */ move $a1, $s3 /* 04C158 7F019768 AC8E0000 */ sw $t6, ($a0) @@ -23790,24 +11738,24 @@ glabel constructor_menu18_displaycast /* 04C178 7F019788 3C0B0382 */ lui $t3, (0x03820010 >> 16) # lui $t3, 0x382 /* 04C17C 7F01978C 356B0010 */ ori $t3, (0x03820010 & 0xFFFF) # ori $t3, $t3, 0x10 /* 04C180 7F019790 26180010 */ addiu $t8, $s0, 0x10 -/* 04C184 7F019794 3C148002 */ lui $s4, %hi(objinstance) # $s4, 0x8002 -/* 04C188 7F019798 26946B44 */ addiu $s4, %lo(objinstance) # addiu $s4, $s4, 0x6b44 +/* 04C184 7F019794 3C148002 */ lui $s4, %hi(cast_model) # $s4, 0x8002 +/* 04C188 7F019798 26946B44 */ addiu $s4, %lo(cast_model) # addiu $s4, $s4, 0x6b44 /* 04C18C 7F01979C ACF80004 */ sw $t8, 4($a3) /* 04C190 7F0197A0 ACEB0000 */ sw $t3, ($a3) /* 04C194 7F0197A4 3C058004 */ lui $a1, %hi(g_ClockTimer) # $a1, 0x8004 /* 04C198 7F0197A8 26730008 */ addiu $s3, $s3, 8 /* 04C19C 7F0197AC 8CA50FF4 */ lw $a1, %lo(g_ClockTimer)($a1) /* 04C1A0 7F0197B0 8E840000 */ lw $a0, ($s4) -/* 04C1A4 7F0197B4 0FC1C323 */ jal sub_GAME_7F070AEC +/* 04C1A4 7F0197B4 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 04C1A8 7F0197B8 24060001 */ li $a2, 1 -/* 04C1AC 7F0197BC 0FC1B2D0 */ jal set_80036084 +/* 04C1AC 7F0197BC 0FC1B2D0 */ jal modelSetDistanceDisabled /* 04C1B0 7F0197C0 24040001 */ li $a0, 1 /* 04C1B4 7F0197C4 0FC1D037 */ jal sub_GAME_7F073FC8 /* 04C1B8 7F0197C8 00002025 */ move $a0, $zero /* 04C1BC 7F0197CC 0FC1B6B8 */ jal subcalcpos /* 04C1C0 7F0197D0 8E840000 */ lw $a0, ($s4) -/* 04C1C4 7F0197D4 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C1C8 7F0197D8 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C1C4 7F0197D4 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C1C8 7F0197D8 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C1CC 7F0197DC 10E0000B */ beqz $a3, .L7F01980C /* 04C1D0 7F0197E0 00000000 */ nop /* 04C1D4 7F0197E4 8CEC0008 */ lw $t4, 8($a3) @@ -23818,8 +11766,8 @@ glabel constructor_menu18_displaycast /* 04C1E8 7F0197F8 0FC1B3A3 */ jal modelGetNodeRwData /* 04C1EC 7F0197FC 00E02025 */ move $a0, $a3 /* 04C1F0 7F019800 A4400000 */ sh $zero, ($v0) -/* 04C1F4 7F019804 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C1F8 7F019808 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C1F4 7F019804 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C1F8 7F019808 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) .L7F01980C: /* 04C1FC 7F01980C 50E0000A */ beql $a3, $zero, .L7F019838 /* 04C200 7F019810 8E8D0000 */ lw $t5, ($s4) @@ -23849,8 +11797,8 @@ glabel constructor_menu18_displaycast /* 04C25C 7F01986C 8E840000 */ lw $a0, ($s4) /* 04C260 7F019870 0FC1B476 */ jal getsuboffset /* 04C264 7F019874 27A50128 */ addiu $a1, $sp, 0x128 -/* 04C268 7F019878 3C068006 */ lui $a2, %hi(flt_CODE_bss_800695E4) # $a2, 0x8006 -/* 04C26C 7F01987C 24C68524 */ addiu $a2, %lo(flt_CODE_bss_800695E4) # addiu $a2, $a2, -0x7adc +/* 04C268 7F019878 3C068006 */ lui $a2, %hi(bss_800695E4) # $a2, 0x8006 +/* 04C26C 7F01987C 24C68524 */ addiu $a2, %lo(bss_800695E4) # addiu $a2, $a2, -0x7adc /* 04C270 7F019880 8CC20000 */ lw $v0, ($a2) /* 04C274 7F019884 00008825 */ move $s1, $zero /* 04C278 7F019888 3C038004 */ lui $v1, %hi(g_ClockTimer) # $v1, 0x8004 @@ -23971,12 +11919,12 @@ glabel constructor_menu18_displaycast /* 04C430 7F019A40 E6060004 */ swc1 $f6, 4($s0) /* 04C434 7F019A44 46044180 */ add.s $f6, $f8, $f4 /* 04C438 7F019A48 E6060008 */ swc1 $f6, 8($s0) -/* 04C43C 7F019A4C 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 04C43C 7F019A4C 0FC16247 */ jal mtx4TransformVecInPlace /* 04C440 7F019A50 8D84000C */ lw $a0, 0xc($t4) /* 04C444 7F019A54 C60A0004 */ lwc1 $f10, 4($s0) /* 04C448 7F019A58 C6040008 */ lwc1 $f4, 8($s0) -/* 04C44C 7F019A5C 3C068006 */ lui $a2, %hi(flt_CODE_bss_800695E4) # $a2, 0x8006 -/* 04C450 7F019A60 24C68524 */ addiu $a2, %lo(flt_CODE_bss_800695E4) # addiu $a2, $a2, -0x7adc +/* 04C44C 7F019A5C 3C068006 */ lui $a2, %hi(bss_800695E4) # $a2, 0x8006 +/* 04C450 7F019A60 24C68524 */ addiu $a2, %lo(bss_800695E4) # addiu $a2, $a2, -0x7adc /* 04C454 7F019A64 8CD90000 */ lw $t9, ($a2) /* 04C458 7F019A68 3C018004 */ lui $at, %hi(D_80051B30) # $at, 0x8004 /* 04C45C 7F019A6C E7AA0064 */ swc1 $f10, 0x64($sp) @@ -24123,19 +12071,19 @@ glabel constructor_menu18_displaycast /* 04C680 7F019C90 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04C684 7F019C94 0FC1BD9C */ jal subcalcmatrices /* 04C688 7F019C98 8E850000 */ lw $a1, ($s4) -/* 04C68C 7F019C9C 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C690 7F019CA0 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C68C 7F019C9C 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C690 7F019CA0 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C694 7F019CA4 50E00025 */ beql $a3, $zero, .L7F019D3C /* 04C698 7F019CA8 24180007 */ li $t8, 7 /* 04C69C 7F019CAC 8E840000 */ lw $a0, ($s4) /* 04C6A0 7F019CB0 8CE5001C */ lw $a1, 0x1c($a3) -/* 04C6A4 7F019CB4 0FC1B366 */ jal sub_GAME_7F06C660 +/* 04C6A4 7F019CB4 0FC1B366 */ jal modelFindNodeMtx /* 04C6A8 7F019CB8 00003025 */ move $a2, $zero /* 04C6AC 7F019CBC 8E980000 */ lw $t8, ($s4) /* 04C6B0 7F019CC0 AFA201A8 */ sw $v0, 0x1a8($sp) -/* 04C6B4 7F019CC4 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 +/* 04C6B4 7F019CC4 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 /* 04C6B8 7F019CC8 8F0C0008 */ lw $t4, 8($t8) -/* 04C6BC 7F019CCC 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C6BC 7F019CCC 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C6C0 7F019CD0 27B20160 */ addiu $s2, $sp, 0x160 /* 04C6C4 7F019CD4 8D990008 */ lw $t9, 8($t4) /* 04C6C8 7F019CD8 8CEB001C */ lw $t3, 0x1c($a3) @@ -24149,8 +12097,8 @@ glabel constructor_menu18_displaycast /* 04C6E8 7F019CF8 8FA401A8 */ lw $a0, 0x1a8($sp) /* 04C6EC 7F019CFC 0FC16144 */ jal matrix_4x4_multiply_in_place /* 04C6F0 7F019D00 02402825 */ move $a1, $s2 -/* 04C6F4 7F019D04 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C6F8 7F019D08 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C6F4 7F019D04 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C6F8 7F019D08 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C6FC 7F019D0C AFB201A8 */ sw $s2, 0x1a8($sp) /* 04C700 7F019D10 8CEF0008 */ lw $t7, 8($a3) .L7F019D14: @@ -24158,9 +12106,9 @@ glabel constructor_menu18_displaycast /* 04C708 7F019D18 00046980 */ sll $t5, $a0, 6 /* 04C70C 7F019D1C 0FC2F2B1 */ jal dynAllocate /* 04C710 7F019D20 01A02025 */ move $a0, $t5 -/* 04C714 7F019D24 3C058002 */ lui $a1, %hi(ptrobjinstance) # $a1, 0x8002 +/* 04C714 7F019D24 3C058002 */ lui $a1, %hi(cast_model_weapon) # $a1, 0x8002 /* 04C718 7F019D28 AFA201B8 */ sw $v0, 0x1b8($sp) -/* 04C71C 7F019D2C 8CA56B48 */ lw $a1, %lo(ptrobjinstance)($a1) +/* 04C71C 7F019D2C 8CA56B48 */ lw $a1, %lo(cast_model_weapon)($a1) /* 04C720 7F019D30 0FC1BD8D */ jal instcalcmatrices /* 04C724 7F019D34 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04C728 7F019D38 24180007 */ li $t8, 7 @@ -24175,15 +12123,15 @@ glabel constructor_menu18_displaycast /* 04C748 7F019D58 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04C74C 7F019D5C 0FC1D1D6 */ jal subdraw /* 04C750 7F019D60 8E850000 */ lw $a1, ($s4) -/* 04C754 7F019D64 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C758 7F019D68 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C754 7F019D64 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C758 7F019D68 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C75C 7F019D6C 10E00003 */ beqz $a3, .L7F019D7C /* 04C760 7F019D70 27A401A8 */ addiu $a0, $sp, 0x1a8 /* 04C764 7F019D74 0FC1D1D6 */ jal subdraw /* 04C768 7F019D78 00E02825 */ move $a1, $a3 .L7F019D7C: /* 04C76C 7F019D7C 8FB301B4 */ lw $s3, 0x1b4($sp) -/* 04C770 7F019D80 0FC1B2D0 */ jal set_80036084 +/* 04C770 7F019D80 0FC1B2D0 */ jal modelSetDistanceDisabled /* 04C774 7F019D84 00002025 */ move $a0, $zero /* 04C778 7F019D88 8E820000 */ lw $v0, ($s4) /* 04C77C 7F019D8C 8C4B0008 */ lw $t3, 8($v0) @@ -24210,8 +12158,8 @@ glabel constructor_menu18_displaycast /* 04C7CC 7F019DDC 5420FFF0 */ bnezl $at, .L7F019DA0 /* 04C7D0 7F019DE0 8C4F000C */ lw $t7, 0xc($v0) .L7F019DE4: -/* 04C7D4 7F019DE4 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C7D8 7F019DE8 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C7D4 7F019DE4 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C7D8 7F019DE8 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C7DC 7F019DEC 50E0001C */ beql $a3, $zero, .L7F019E60 /* 04C7E0 7F019DF0 02601025 */ move $v0, $s3 /* 04C7E4 7F019DF4 8CEE0008 */ lw $t6, 8($a3) @@ -24225,15 +12173,15 @@ glabel constructor_menu18_displaycast /* 04C800 7F019E10 02402825 */ move $a1, $s2 /* 04C804 7F019E14 0FC16132 */ jal matrix_4x4_copy /* 04C808 7F019E18 01B02021 */ addu $a0, $t5, $s0 -/* 04C80C 7F019E1C 3C188002 */ lui $t8, %hi(ptrobjinstance) # $t8, 0x8002 -/* 04C810 7F019E20 8F186B48 */ lw $t8, %lo(ptrobjinstance)($t8) +/* 04C80C 7F019E1C 3C188002 */ lui $t8, %hi(cast_model_weapon) # $t8, 0x8002 +/* 04C810 7F019E20 8F186B48 */ lw $t8, %lo(cast_model_weapon)($t8) /* 04C814 7F019E24 0011C980 */ sll $t9, $s1, 6 /* 04C818 7F019E28 02402025 */ move $a0, $s2 /* 04C81C 7F019E2C 8F0C000C */ lw $t4, 0xc($t8) /* 04C820 7F019E30 0FC16451 */ jal matrix_4x4_f32_to_s32 /* 04C824 7F019E34 01992821 */ addu $a1, $t4, $t9 -/* 04C828 7F019E38 3C078002 */ lui $a3, %hi(ptrobjinstance) # $a3, 0x8002 -/* 04C82C 7F019E3C 8CE76B48 */ lw $a3, %lo(ptrobjinstance)($a3) +/* 04C828 7F019E38 3C078002 */ lui $a3, %hi(cast_model_weapon) # $a3, 0x8002 +/* 04C82C 7F019E3C 8CE76B48 */ lw $a3, %lo(cast_model_weapon)($a3) /* 04C830 7F019E40 26310001 */ addiu $s1, $s1, 1 /* 04C834 7F019E44 26100040 */ addiu $s0, $s0, 0x40 /* 04C838 7F019E48 8CEB0008 */ lw $t3, 8($a3) @@ -24360,17 +12308,17 @@ glabel constructor_menu18_displaycast /* 04CA18 7F01A028 008B2021 */ addu $a0, $a0, $t3 /* 04CA1C 7F01A02C 0FC304AE */ jal langGet /* 04CA20 7F01A030 94846B58 */ lhu $a0, %lo(intro_char_table+8)($a0) -/* 04CA24 7F01A034 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableLarge) # $t6, 0x8004 -/* 04CA28 7F01A038 8DCEAB04 */ lw $t6, %lo(ptrFirstFontTableLarge)($t6) -/* 04CA2C 7F01A03C 3C148004 */ lui $s4, %hi(ptrSecondFontTableLarge) # $s4, 0x8004 -/* 04CA30 7F01A040 2694AB08 */ addiu $s4, %lo(ptrSecondFontTableLarge) # addiu $s4, $s4, -0x54f8 +/* 04CA24 7F01A034 3C0E8004 */ lui $t6, %hi(ptrFontZurichBold) # $t6, 0x8004 +/* 04CA28 7F01A038 8DCEAB04 */ lw $t6, %lo(ptrFontZurichBold)($t6) +/* 04CA2C 7F01A03C 3C148004 */ lui $s4, %hi(ptrFontZurichBoldChars) # $s4, 0x8004 +/* 04CA30 7F01A040 2694AB08 */ addiu $s4, %lo(ptrFontZurichBoldChars) # addiu $s4, $s4, -0x54f8 /* 04CA34 7F01A044 00408825 */ move $s1, $v0 /* 04CA38 7F01A048 8E870000 */ lw $a3, ($s4) /* 04CA3C 7F01A04C 27A40150 */ addiu $a0, $sp, 0x150 /* 04CA40 7F01A050 27A50154 */ addiu $a1, $sp, 0x154 /* 04CA44 7F01A054 00403025 */ move $a2, $v0 /* 04CA48 7F01A058 AFA00014 */ sw $zero, 0x14($sp) -/* 04CA4C 7F01A05C 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 04CA4C 7F01A05C 0FC2B713 */ jal textMeasure /* 04CA50 7F01A060 AFAE0010 */ sw $t6, 0x10($sp) /* 04CA54 7F01A064 8FA20154 */ lw $v0, 0x154($sp) /* 04CA58 7F01A068 8FB80150 */ lw $t8, 0x150($sp) @@ -24402,8 +12350,8 @@ glabel constructor_menu18_displaycast /* 04CABC 7F01A0CC 240C0001 */ li $t4, 1 /* 04CAC0 7F01A0D0 44CCF800 */ ctc1 $t4, $31 /* 04CAC4 7F01A0D4 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 04CAC8 7F01A0D8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) # $t5, 0x8004 -/* 04CACC 7F01A0DC 8DADAB04 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) +/* 04CAC8 7F01A0D8 3C0D8004 */ lui $t5, %hi(ptrFontZurichBold) # $t5, 0x8004 +/* 04CACC 7F01A0DC 8DADAB04 */ lw $t5, %lo(ptrFontZurichBold)($t5) /* 04CAD0 7F01A0E0 460021A4 */ cvt.w.s $f6, $f4 /* 04CAD4 7F01A0E4 8E8E0000 */ lw $t6, ($s4) /* 04CAD8 7F01A0E8 02602025 */ move $a0, $s3 @@ -24447,7 +12395,7 @@ glabel constructor_menu18_displaycast /* 04CB64 7F01A174 AFB0001C */ sw $s0, 0x1c($sp) /* 04CB68 7F01A178 AFA20020 */ sw $v0, 0x20($sp) /* 04CB6C 7F01A17C AFA00024 */ sw $zero, 0x24($sp) -/* 04CB70 7F01A180 0FC2B35F */ jal en_text_write_stuff +/* 04CB70 7F01A180 0FC2B35F */ jal textRender /* 04CB74 7F01A184 AFA00028 */ sw $zero, 0x28($sp) /* 04CB78 7F01A188 00409825 */ move $s3, $v0 .L7F01A18C: @@ -24463,10 +12411,10 @@ glabel constructor_menu18_displaycast /* 04CBA0 7F01A1B0 01795821 */ addu $t3, $t3, $t9 /* 04CBA4 7F01A1B4 4452F800 */ cfc1 $s2, $31 /* 04CBA8 7F01A1B8 000B5880 */ sll $t3, $t3, 2 -/* 04CBAC 7F01A1BC 3C148004 */ lui $s4, %hi(ptrSecondFontTableLarge) # $s4, 0x8004 +/* 04CBAC 7F01A1BC 3C148004 */ lui $s4, %hi(ptrFontZurichBoldChars) # $s4, 0x8004 /* 04CBB0 7F01A1C0 008B2021 */ addu $a0, $a0, $t3 /* 04CBB4 7F01A1C4 32520078 */ andi $s2, $s2, 0x78 -/* 04CBB8 7F01A1C8 2694AB08 */ addiu $s4, %lo(ptrSecondFontTableLarge) # addiu $s4, $s4, -0x54f8 +/* 04CBB8 7F01A1C8 2694AB08 */ addiu $s4, %lo(ptrFontZurichBoldChars) # addiu $s4, $s4, -0x54f8 /* 04CBBC 7F01A1CC 12400013 */ beqz $s2, .L7F01A21C /* 04CBC0 7F01A1D0 94846B5A */ lhu $a0, %lo(intro_char_table+10)($a0) /* 04CBC4 7F01A1D4 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000 @@ -24499,15 +12447,15 @@ glabel constructor_menu18_displaycast /* 04CC24 7F01A234 44CEF800 */ ctc1 $t6, $31 /* 04CC28 7F01A238 0FC304AE */ jal langGet /* 04CC2C 7F01A23C 01A09025 */ move $s2, $t5 -/* 04CC30 7F01A240 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableLarge) # $t7, 0x8004 -/* 04CC34 7F01A244 8DEFAB04 */ lw $t7, %lo(ptrFirstFontTableLarge)($t7) +/* 04CC30 7F01A240 3C0F8004 */ lui $t7, %hi(ptrFontZurichBold) # $t7, 0x8004 +/* 04CC34 7F01A244 8DEFAB04 */ lw $t7, %lo(ptrFontZurichBold)($t7) /* 04CC38 7F01A248 00408825 */ move $s1, $v0 /* 04CC3C 7F01A24C 27A40150 */ addiu $a0, $sp, 0x150 /* 04CC40 7F01A250 27A50154 */ addiu $a1, $sp, 0x154 /* 04CC44 7F01A254 00403025 */ move $a2, $v0 /* 04CC48 7F01A258 8E870000 */ lw $a3, ($s4) /* 04CC4C 7F01A25C AFA00014 */ sw $zero, 0x14($sp) -/* 04CC50 7F01A260 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 04CC50 7F01A260 0FC2B713 */ jal textMeasure /* 04CC54 7F01A264 AFAF0010 */ sw $t7, 0x10($sp) /* 04CC58 7F01A268 8FA20154 */ lw $v0, 0x154($sp) /* 04CC5C 7F01A26C 8FAB0150 */ lw $t3, 0x150($sp) @@ -24535,8 +12483,8 @@ glabel constructor_menu18_displaycast /* 04CCB0 7F01A2C0 00106C03 */ sra $t5, $s0, 0x10 /* 04CCB4 7F01A2C4 0C000F9F */ jal viGetY /* 04CCB8 7F01A2C8 01A08025 */ move $s0, $t5 -/* 04CCBC 7F01A2CC 3C188004 */ lui $t8, %hi(ptrFirstFontTableLarge) # $t8, 0x8004 -/* 04CCC0 7F01A2D0 8F18AB04 */ lw $t8, %lo(ptrFirstFontTableLarge)($t8) +/* 04CCBC 7F01A2CC 3C188004 */ lui $t8, %hi(ptrFontZurichBold) # $t8, 0x8004 +/* 04CCC0 7F01A2D0 8F18AB04 */ lw $t8, %lo(ptrFontZurichBold)($t8) /* 04CCC4 7F01A2D4 8E8F0000 */ lw $t7, ($s4) /* 04CCC8 7F01A2D8 02602025 */ move $a0, $s3 /* 04CCCC 7F01A2DC 27A5015C */ addiu $a1, $sp, 0x15c @@ -24548,7 +12496,7 @@ glabel constructor_menu18_displaycast /* 04CCE4 7F01A2F4 AFA00024 */ sw $zero, 0x24($sp) /* 04CCE8 7F01A2F8 AFA00028 */ sw $zero, 0x28($sp) /* 04CCEC 7F01A2FC AFB80014 */ sw $t8, 0x14($sp) -/* 04CCF0 7F01A300 0FC2B35F */ jal en_text_write_stuff +/* 04CCF0 7F01A300 0FC2B35F */ jal textRender /* 04CCF4 7F01A304 AFAF0010 */ sw $t7, 0x10($sp) /* 04CCF8 7F01A308 3C0C8002 */ lui $t4, %hi(intro_character_index) # $t4, 0x8002 /* 04CCFC 7F01A30C 8D8C6B38 */ lw $t4, %lo(intro_character_index)($t4) @@ -24560,15 +12508,15 @@ glabel constructor_menu18_displaycast /* 04CD14 7F01A324 00992021 */ addu $a0, $a0, $t9 /* 04CD18 7F01A328 0FC304AE */ jal langGet /* 04CD1C 7F01A32C 94846B5C */ lhu $a0, %lo(intro_char_table+12)($a0) -/* 04CD20 7F01A330 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableLarge) # $t3, 0x8004 -/* 04CD24 7F01A334 8D6BAB04 */ lw $t3, %lo(ptrFirstFontTableLarge)($t3) +/* 04CD20 7F01A330 3C0B8004 */ lui $t3, %hi(ptrFontZurichBold) # $t3, 0x8004 +/* 04CD24 7F01A334 8D6BAB04 */ lw $t3, %lo(ptrFontZurichBold)($t3) /* 04CD28 7F01A338 00408825 */ move $s1, $v0 /* 04CD2C 7F01A33C 27A40150 */ addiu $a0, $sp, 0x150 /* 04CD30 7F01A340 27A50154 */ addiu $a1, $sp, 0x154 /* 04CD34 7F01A344 00403025 */ move $a2, $v0 /* 04CD38 7F01A348 8E870000 */ lw $a3, ($s4) /* 04CD3C 7F01A34C AFA00014 */ sw $zero, 0x14($sp) -/* 04CD40 7F01A350 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 04CD40 7F01A350 0FC2B713 */ jal textMeasure /* 04CD44 7F01A354 AFAB0010 */ sw $t3, 0x10($sp) /* 04CD48 7F01A358 8FA20154 */ lw $v0, 0x154($sp) /* 04CD4C 7F01A35C 8FB80150 */ lw $t8, 0x150($sp) @@ -24596,8 +12544,8 @@ glabel constructor_menu18_displaycast /* 04CDA0 7F01A3B0 0010CC03 */ sra $t9, $s0, 0x10 /* 04CDA4 7F01A3B4 0C000F9F */ jal viGetY /* 04CDA8 7F01A3B8 03208025 */ move $s0, $t9 -/* 04CDAC 7F01A3BC 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableLarge) # $t5, 0x8004 -/* 04CDB0 7F01A3C0 8DADAB04 */ lw $t5, %lo(ptrFirstFontTableLarge)($t5) +/* 04CDAC 7F01A3BC 3C0D8004 */ lui $t5, %hi(ptrFontZurichBold) # $t5, 0x8004 +/* 04CDB0 7F01A3C0 8DADAB04 */ lw $t5, %lo(ptrFontZurichBold)($t5) /* 04CDB4 7F01A3C4 8E8B0000 */ lw $t3, ($s4) /* 04CDB8 7F01A3C8 02602025 */ move $a0, $s3 /* 04CDBC 7F01A3CC 27A5015C */ addiu $a1, $sp, 0x15c @@ -24609,7 +12557,7 @@ glabel constructor_menu18_displaycast /* 04CDD4 7F01A3E4 AFA00024 */ sw $zero, 0x24($sp) /* 04CDD8 7F01A3E8 AFA00028 */ sw $zero, 0x28($sp) /* 04CDDC 7F01A3EC AFAD0014 */ sw $t5, 0x14($sp) -/* 04CDE0 7F01A3F0 0FC2B35F */ jal en_text_write_stuff +/* 04CDE0 7F01A3F0 0FC2B35F */ jal textRender /* 04CDE4 7F01A3F4 AFAB0010 */ sw $t3, 0x10($sp) /* 04CDE8 7F01A3F8 8FBF004C */ lw $ra, 0x4c($sp) /* 04CDEC 7F01A3FC 8FB00038 */ lw $s0, 0x38($sp) @@ -24681,8 +12629,8 @@ void update_menu19_spectrum(void) { void interface_menu19_spectrum(void) { #if defined(LEFTOVERSPECTRUM) - viSetFovY(60.0f); - viSetAspect(1.3333334f); + viSetFovY(FOV_Y_F); + viSetAspect(ASPECT_RATIO_SD); viSetZRange(100.0f, 10000.0f); viSetUseZBuf(0); run_spectrum_game(); @@ -24692,122 +12640,34 @@ void interface_menu19_spectrum(void) +#if !defined(LEFTOVERSPECTRUM) +Gfx* constructor_menu19_spectrum(Gfx* DL) +{ + return DL; +} +#else -#ifdef NONMATCHING -Gfx * constructor_menu19_spectrum(Gfx *DL) +// Address 0x7F01A4E0 NTSC +Gfx * constructor_menu19_spectrum(Gfx * DL) { - #if defined(LEFTOVERSPECTRUM) DL = insert_imageDL(DL); - //DL[0]->w0 = 0xba001402; - //DL[0]->w1 = 0; + gDPSetCycleType(DL++, G_CYC_1CYCLE); - //DL[1].w0 = 0xb900031d; - //DL[1].w1 = &DAT_00552048; gDPSetRenderMode(DL++, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2); - //DL[2].w0 = 0xb6000000; - //DL[2].w1 = 0x204; gSPClearGeometryMode(DL++, G_SHADE | G_SHADING_SMOOTH); - //DL[3].w0 = 0xfcffffff; - //DL[3].w1 = 0xfffcf87c; gDPSetCombineMode(DL++, G_CC_DECALRGB, G_CC_DECALRGB); - //DL[4].w0 = 0xba000c02; - //DL[4].w1 = 0; gDPSetTextureFilter(DL++, G_TF_POINT); - //DL[5].w0 = 0xfd500000; - //DL[5].w1 = color_palette_entries_50_percent; - gDPSetTextureImage(DL++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, &color_palette_entries_50_percent); - //DL[6].w0 = 0xf5000300; - //DL[6].w1 = 0x07000000; - gDPSetTile(DL++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 1, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - //DL[7].w0 = 0xe6000000; - //DL[7].w1 = 0; + gDPSetTextureImage(DL++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, color_palette_entries_50_percent); + gDPSetTile(DL++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 1, 0x100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(DL++); - //DL[8].w0 = 0xf0000ff0; - //DL[8].w1 = 0x0701cff0; - gDPLoadTLUTCmd(DL++, G_TX_LOADTILE, 7); - //DL[9].w0 = 0xe7000000; - //DL[9].w1 = 0; + gDPLoadTLUTCmd2(DL++, G_TX_LOADTILE, 7); gDPPipeSync(DL++); - //DL[10].w0 = 0xba000e02; - //DL[10].w1 = 0x00008000; gDPSetTextureLUT(DL++, G_TT_RGBA16); - DL = spectrum_draw_screen(DL++); - #endif - return DL; -} -#else -#if !defined(LEFTOVERSPECTRUM) -Gfx* constructor_menu19_spectrum(Gfx* DL) -{ + + DL = spectrum_draw_screen(DL); + return DL; } -#else -GLOBAL_ASM( -.text -glabel constructor_menu19_spectrum -/* 04F010 7F01A4E0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 04F014 7F01A4E4 AFBF0014 */ sw $ra, 0x14($sp) -/* 04F018 7F01A4E8 0FC07034 */ jal insert_imageDL -/* 04F01C 7F01A4EC 00000000 */ nop -/* 04F020 7F01A4F0 3C0EBA00 */ lui $t6, (0xBA001402 >> 16) # lui $t6, 0xba00 -/* 04F024 7F01A4F4 3C0AFFFC */ lui $t2, (0xFFFCF87C >> 16) # lui $t2, 0xfffc -/* 04F028 7F01A4F8 35CE1402 */ ori $t6, (0xBA001402 & 0xFFFF) # ori $t6, $t6, 0x1402 -/* 04F02C 7F01A4FC 3C0FB900 */ lui $t7, (0xB900031D >> 16) # lui $t7, 0xb900 -/* 04F030 7F01A500 3C180055 */ lui $t8, (0x00552048 >> 16) # lui $t8, 0x55 -/* 04F034 7F01A504 3C19B600 */ lui $t9, 0xb600 -/* 04F038 7F01A508 24080204 */ li $t0, 516 -/* 04F03C 7F01A50C 354AF87C */ ori $t2, (0xFFFCF87C & 0xFFFF) # ori $t2, $t2, 0xf87c -/* 04F040 7F01A510 3C09FCFF */ lui $t1, (0xFCFFFFFF >> 16) # lui $t1, 0xfcff -/* 04F044 7F01A514 3C0BBA00 */ lui $t3, (0xBA000C02 >> 16) # lui $t3, 0xba00 -/* 04F048 7F01A518 AC4E0000 */ sw $t6, ($v0) -/* 04F04C 7F01A51C 37182048 */ ori $t8, (0x00552048 & 0xFFFF) # ori $t8, $t8, 0x2048 -/* 04F050 7F01A520 35EF031D */ ori $t7, (0xB900031D & 0xFFFF) # ori $t7, $t7, 0x31d -/* 04F054 7F01A524 AC480014 */ sw $t0, 0x14($v0) -/* 04F058 7F01A528 AC590010 */ sw $t9, 0x10($v0) -/* 04F05C 7F01A52C 3529FFFF */ ori $t1, (0xFCFFFFFF & 0xFFFF) # ori $t1, $t1, 0xffff -/* 04F060 7F01A530 AC4A001C */ sw $t2, 0x1c($v0) -/* 04F064 7F01A534 356B0C02 */ ori $t3, (0xBA000C02 & 0xFFFF) # ori $t3, $t3, 0xc02 -/* 04F068 7F01A538 AC4F0008 */ sw $t7, 8($v0) -/* 04F06C 7F01A53C AC58000C */ sw $t8, 0xc($v0) -/* 04F070 7F01A540 AC490018 */ sw $t1, 0x18($v0) -/* 04F074 7F01A544 AC4B0020 */ sw $t3, 0x20($v0) -/* 04F078 7F01A548 3C0D8003 */ lui $t5, %hi(color_palette_entries_50_percent) -/* 04F07C 7F01A54C 3C0EF500 */ lui $t6, (0xF5000300 >> 16) # lui $t6, 0xf500 -/* 04F080 7F01A550 3C19F000 */ lui $t9, (0xF0000FF0 >> 16) # lui $t9, 0xf000 -/* 04F084 7F01A554 3C080701 */ lui $t0, (0x0701CFF0 >> 16) # lui $t0, 0x701 -/* 04F088 7F01A558 3C0ABA00 */ lui $t2, (0xBA000E02 >> 16) # lui $t2, 0xba00 -/* 04F08C 7F01A55C 25ADBAF0 */ addiu $t5, %lo(color_palette_entries_50_percent) # addiu $t5, $t5, -0x4510 -/* 04F090 7F01A560 3C0CFD50 */ lui $t4, 0xfd50 -/* 04F094 7F01A564 35CE0300 */ ori $t6, (0xF5000300 & 0xFFFF) # ori $t6, $t6, 0x300 -/* 04F098 7F01A568 3C0F0700 */ lui $t7, 0x700 -/* 04F09C 7F01A56C 3C18E600 */ lui $t8, 0xe600 -/* 04F0A0 7F01A570 3508CFF0 */ ori $t0, (0x0701CFF0 & 0xFFFF) # ori $t0, $t0, 0xcff0 -/* 04F0A4 7F01A574 37390FF0 */ ori $t9, (0xF0000FF0 & 0xFFFF) # ori $t9, $t9, 0xff0 -/* 04F0A8 7F01A578 3C09E700 */ lui $t1, 0xe700 -/* 04F0AC 7F01A57C 354A0E02 */ ori $t2, (0xBA000E02 & 0xFFFF) # ori $t2, $t2, 0xe02 -/* 04F0B0 7F01A580 340B8000 */ li $t3, 32768 -/* 04F0B4 7F01A584 AC400004 */ sw $zero, 4($v0) -/* 04F0B8 7F01A588 AC400024 */ sw $zero, 0x24($v0) -/* 04F0BC 7F01A58C AC4C0028 */ sw $t4, 0x28($v0) -/* 04F0C0 7F01A590 AC4D002C */ sw $t5, 0x2c($v0) -/* 04F0C4 7F01A594 AC4F0034 */ sw $t7, 0x34($v0) -/* 04F0C8 7F01A598 AC4E0030 */ sw $t6, 0x30($v0) -/* 04F0CC 7F01A59C AC580038 */ sw $t8, 0x38($v0) -/* 04F0D0 7F01A5A0 AC40003C */ sw $zero, 0x3c($v0) -/* 04F0D4 7F01A5A4 AC590040 */ sw $t9, 0x40($v0) -/* 04F0D8 7F01A5A8 AC480044 */ sw $t0, 0x44($v0) -/* 04F0DC 7F01A5AC AC490048 */ sw $t1, 0x48($v0) -/* 04F0E0 7F01A5B0 AC40004C */ sw $zero, 0x4c($v0) -/* 04F0E4 7F01A5B4 AC4B0054 */ sw $t3, 0x54($v0) -/* 04F0E8 7F01A5B8 AC4A0050 */ sw $t2, 0x50($v0) -/* 04F0EC 7F01A5BC 0FC34CED */ jal spectrum_draw_screen -/* 04F0F0 7F01A5C0 24440058 */ addiu $a0, $v0, 0x58 -/* 04F0F4 7F01A5C4 8FBF0014 */ lw $ra, 0x14($sp) -/* 04F0F8 7F01A5C8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 04F0FC 7F01A5CC 03E00008 */ jr $ra -/* 04F100 7F01A5D0 00000000 */ nop -) -#endif #endif @@ -24816,17 +12676,19 @@ glabel constructor_menu19_spectrum -void set_menu_to_mode(MENU menu, s32 mode) +void frontChangeMenu(MENU menu, s32 reload) { if ((menu == MENU_RUN_STAGE) || (menu == MENU_SPECTRUM_EMU)) { - is_emulating_spectrum = 1; + is_emulating_spectrum = TRUE; } - if (mode != 0) + + if (reload) { menu_update = menu; return; } + maybe_prev_menu = menu; } @@ -24839,1837 +12701,185 @@ MENU get_currentmenu(void) - -#ifdef NONMATCHING -void menu_init() +void menu_init(void) { - MENU MVar1; - + s32 var_v0; + if (current_menu == MENU_SWITCH_SCREENS) { - if (spectrum_related_flag == FALSE) + if (spectrum_related_flag != 0) { - if ((is_emulating_spectrum != FALSE) && (viGetFrameBuf2() == cfb_16[0])) - { - screen_size = SCREEN_SIZE_320x240; - is_emulating_spectrum = FALSE; - } - } - else { - if (viGetFrameBuf2() == cfb_16[1]) + if (viGetFrameBuf2() == (cfb_16[1])) { screen_size = SCREEN_SIZE_440x330; - spectrum_related_flag = FALSE; + spectrum_related_flag = 0; } } + else if ((is_emulating_spectrum != 0) && (viGetFrameBuf2() == cfb_16[0])) + { + screen_size = SCREEN_SIZE_320x240; + is_emulating_spectrum = 0; + } } - if (screen_size == SCREEN_SIZE_320x240) - { - viSetAspect((f32)flt_80051B48); - viSetXY(320,240); - viSetBuf(320,240); - set_cur_player_screen_size(320,240); - viSetViewSize(320,240); - set_cur_player_viewport_size(0,0); - viSetViewPosition(0,0); - } - else +#if defined(VERSION_EU) +#define MENU_INIT_ASPECT_440 ASPECT_RATIO_EU_400_330 +#define MENU_INIT_ASPECT_320 ASPECT_RATIO_EU_320_272 +#else +#define MENU_INIT_ASPECT_440 ASPECT_RATIO +#define MENU_INIT_ASPECT_320 ASPECT_RATIO +#endif + + if (screen_size != SCREEN_SIZE_320x240) { - if (viGetFrameBuf2() == cfb_16[1]) + if (viGetFrameBuf2() == (cfb_16[1])) { - set_video_settings2_frameb(ptr_menu_videobuffer); + viSetFrameBuf2(ptr_menu_videobuffer); } - viSetAspect((f32)flt_80051B44); - viSetXY(440,330); - viSetBuf(440,330); - set_cur_player_screen_size(440,330); - viSetViewSize(440,330); - set_cur_player_viewport_size(0,0); - viSetViewPosition(0,0); - } - if (((-1 < menu_update) || (-1 < maybe_prev_menu)) && (current_menu != MENU_SWITCH_SCREENS)) + + viSetAspect(MENU_INIT_ASPECT_440); + viSetXY(440, 330); + viSetBuf(440, 330); + set_cur_player_screen_size(440, 330); + viSetViewSize(440, 330); + set_cur_player_viewport_size(0, 0); + viSetViewPosition(0, 0); + } + else { - if (true) + viSetAspect(MENU_INIT_ASPECT_320); + viSetXY(320, SCREEN_HEIGHT); + viSetBuf(320, SCREEN_HEIGHT); + set_cur_player_screen_size(320, SCREEN_HEIGHT); + viSetViewSize(320, SCREEN_HEIGHT); + set_cur_player_viewport_size(0, 0); + viSetViewPosition(0, 0); + } + +#undef MENU_INIT_ASPECT_440 +#undef MENU_INIT_ASPECT_320 + + if ( + ((menu_update > MENU_INVALID) || (maybe_prev_menu > MENU_INVALID)) + && (current_menu != MENU_SWITCH_SCREENS)) + { + switch(current_menu) { + case MENU_LEGAL_SCREEN: update_menu00_legalscreen(); break; + case MENU_NINTENDO_LOGO: update_menu01_nintendo(); break; + case MENU_RAREWARE_LOGO: update_menu02_rareware(); break; + case MENU_EYE_INTRO: update_menu_03_eye(); break; + case MENU_GOLDENEYE_LOGO: update_menu04_goldeneye(); break; + case MENU_FILE_SELECT: update_menu05_filesel(); break; + case MENU_MODE_SELECT: update_menu06_modesel(); break; + case MENU_MISSION_SELECT: update_menu07_missionsel(); break; + case MENU_DIFFICULTY: update_menu08_difficulty(); break; + case MENU_007_OPTIONS: update_menu09_007options(); break; + case MENU_BRIEFING: update_menu0A_briefing(); break; + case MENU_MISSION_FAILED: update_menu0C_missionfailed(); break; + case MENU_MISSION_COMPLETE: update_menu0D_missioncomplete(); break; + case MENU_MP_OPTIONS: update_menu0E_mpoptions(); break; + case MENU_MP_SCENARIO_SELECT: update_menu13_mpscenario(); break; + case MENU_MP_CHAR_SELECT: update_menu0F_mpcharsel(); break; + case MENU_MP_TEAMS: update_menu14_mpteams(); break; + case MENU_MP_HANDICAP: update_menu10_mphandicap(); break; + case MENU_MP_CONTROL_STYLE: update_menu11_mpcontrols(); break; + case MENU_MP_STAGE_SELECT: update_menu12_mpstage(); break; + case MENU_CHEAT: update_menu15_cheat(); break; + case MENU_NO_CONTROLLERS: update_menu16_nocontrollers(); break; + case MENU_DISPLAY_CAST: update_menu18_displaycast(); break; + case MENU_SPECTRUM_EMU: update_menu19_spectrum(); break; + } + + if (menu_update > MENU_INVALID) { - switch(current_menu) { - case MENU_LEGAL_SCREEN: - update_menu00_legalscreen(); - break; - case MENU_NINTENDO_LOGO: - update_menu01_nintendo(); - break; - case MENU_RAREWARE_LOGO: - update_menu02_rareware(); - break; - case MENU_EYE_INTRO: - update_menu_03_eyeintro(); - break; - case MENU_GOLDENEYE_LOGO: - update_menu04_goldeneyelogo(); - break; - case MENU_FILE_SELECT: - update_menu05_filesel(); - break; - case MENU_MODE_SELECT: - update_menu06_modesel(); - break; - case MENU_MISSION_SELECT: - update_menu07_missionsel(); - break; - case MENU_DIFFICULTY: - update_menu08_difficulty(); - break; - case MENU_007_OPTIONS: - update_menu09_007options(); - break; - case MENU_BRIEFING: - update_menu0A_briefing(); - break; - case MENU_MISSION_FAILED: - update_menu0C_missionfailed(); - break; - case MENU_MISSION_COMPLETE: - update_menu0D_missioncomplete(); - break; - case MENU_MP_OPTIONS: - update_menu0E_mpoptions(); - break; - case MENU_MP_CHAR_SELECT: - update_menu0F_mpcharsel(); - break; - case MENU_MP_HANDICAP: - update_menu10_mphandicap(); - break; - case MENU_MP_CONTROL_STYLE: - update_menu11_mpcontrols(); - break; - case MENU_MP_STAGE_SELECT: - update_menu12_mpstage(); - break; - case MENU_MP_SCENARIO_SELECT: - update_menu13_mpscenario(); - break; - case MENU_MP_TEAMS: - update_menu14_mpteams(); - break; - case MENU_CHEAT: - update_menu15_cheat(); - break; - case MENU_NO_CONTROLLERS: - update_menu16_nocontrollers(); - break; - case MENU_DISPLAY_CAST: - update_menu18_displaycast(); - break; - case MENU_SPECTRUM_EMU: - update_menu19_spectrum(); - } - } - if (-1 < menu_update) { current_menu = MENU_SWITCH_SCREENS; reset_menutimer(); } } - MVar1 = maybe_prev_menu; - if (true) { + + if (maybe_prev_menu > MENU_INVALID) + { current_menu = maybe_prev_menu; - maybe_prev_menu = ~MENU_LEGAL_SCREEN; - if (true) { - switch(MVar1) { - case MENU_LEGAL_SCREEN: - init_menu00_legalscreen(); - break; - case MENU_NINTENDO_LOGO: - init_menu01_nintendo(); - break; - case MENU_RAREWARE_LOGO: - init_menu02_rareware(); - break; - case MENU_EYE_INTRO: - init_menu03_eyeintro(); - break; - case MENU_GOLDENEYE_LOGO: - init_menu04_goldeneyelogo(); - break; - case MENU_FILE_SELECT: - init_menu05_filesel(); - break; - case MENU_MODE_SELECT: - init_menu06_modesel(); - break; - case MENU_MISSION_SELECT: - init_menu07_missionsel(); - break; - case MENU_DIFFICULTY: - init_menu08_difficulty(); - break; - case MENU_007_OPTIONS: - init_menu09_007options(); - break; - case MENU_BRIEFING: - init_menu0A_briefing(); - break; - case MENU_RUN_STAGE: - init_menu0B_runstage(); - break; - case MENU_MISSION_FAILED: - init_menu0C_missionfailed(); - break; - case MENU_MISSION_COMPLETE: - init_menu0D_missioncomplete(); - break; - case MENU_MP_OPTIONS: - init_menu0E_mpoptions(); - break; - case MENU_MP_CHAR_SELECT: - init_menu0f_mpcharsel(); - break; - case MENU_MP_HANDICAP: - init_menu10_mphandicap(); - break; - case MENU_MP_CONTROL_STYLE: - init_menu11_mpcontrol(); - break; - case MENU_MP_STAGE_SELECT: - init_menu12_mpstage(); - break; - case MENU_MP_SCENARIO_SELECT: - init_menu13_mpscenariosel(); - break; - case MENU_MP_TEAMS: - init_menu14_mpteamsel(); - break; - case MENU_CHEAT: - init_menu15_cheat(); - break; - case MENU_NO_CONTROLLERS: - init_menu16_nocontroller(); - break; - case MENU_DISPLAY_CAST: - init_menu18_displaycast(); - break; - case MENU_SPECTRUM_EMU: - init_menu19_spectrum(); - } + maybe_prev_menu = MENU_INVALID; + + switch(current_menu) { + case MENU_LEGAL_SCREEN: init_menu00_legalscreen(); break; + case MENU_NINTENDO_LOGO: init_menu01_nintendo(); break; + case MENU_RAREWARE_LOGO: init_menu02_rarelogo(); break; + case MENU_EYE_INTRO: init_menu03_eyeintro(); break; + case MENU_GOLDENEYE_LOGO: init_menu04_goldeneyelogo(); break; + case MENU_FILE_SELECT: init_menu05_fileselect(); break; + case MENU_MODE_SELECT: init_menu06_modeselect(); break; + case MENU_MISSION_SELECT: init_menu07_missionselect(); break; + case MENU_DIFFICULTY: init_menu08_difficultyselect(); break; + case MENU_007_OPTIONS: init_menu09_007difficultyselect(); break; + case MENU_BRIEFING: init_menu0A_briefing(); break; + case MENU_RUN_STAGE: init_menu0B_runstage(); break; + case MENU_MISSION_FAILED: init_menu0C_missionfailed(); break; + case MENU_MISSION_COMPLETE: init_menu0D_missioncomplete(); break; + case MENU_MP_OPTIONS: init_menu0E_mpoptions(); break; + case MENU_MP_SCENARIO_SELECT: init_menu13_mpscenariosel(); break; + case MENU_MP_CHAR_SELECT: init_menu0f_mpcharsel(); break; + case MENU_MP_TEAMS: init_menu14_mpteamsel(); break; + case MENU_MP_HANDICAP: init_menu10_mphandicap(); break; + case MENU_MP_CONTROL_STYLE: init_menu11_mpcontrol(); break; + case MENU_MP_STAGE_SELECT: init_menu12_mpstage(); break; + case MENU_CHEAT: init_menu15_cheat(); break; + case MENU_NO_CONTROLLERS: init_menu16_nocontroller(); break; + case MENU_DISPLAY_CAST: init_menu18_displaycast(); break; + case MENU_SPECTRUM_EMU: init_menu19_spectrum(); break; } } + switch(current_menu) { - case MENU_LEGAL_SCREEN: - interface_menu00_legalscreen(); - break; - case MENU_NINTENDO_LOGO: - interface_menu01_nintendo(); - break; - case MENU_RAREWARE_LOGO: - interface_menu02_rareware(); - break; - case MENU_EYE_INTRO: - interface_menu03_eyeintro(); - break; - case MENU_GOLDENEYE_LOGO: - interface_menu04_goldeneyelogo(); - break; - case MENU_FILE_SELECT: - interface_menu05_filesel(); - break; - case MENU_MODE_SELECT: - interface_menu06_modesel(); - break; - case MENU_MISSION_SELECT: - interface_menu07_missionsel(); - break; - case MENU_DIFFICULTY: - interface_menu08_difficulty(); - break; - case MENU_007_OPTIONS: - interface_menu09_007options(); - break; - case MENU_BRIEFING: - interface_menu0A_briefing(); - break; - case MENU_RUN_STAGE: - if (interface_menu0B_runstage() == 0) { - if (gamemode == GAMEMODE_MULTI) { - set_menu_to_mode(MENU_MP_OPTIONS,1); + case MENU_LEGAL_SCREEN: interface_menu00_legalscreen(); break; + case MENU_SWITCH_SCREENS: interface_menu17_switchscreens(); break; + case MENU_NINTENDO_LOGO: interface_menu01_nintendo(); break; + case MENU_RAREWARE_LOGO: interface_menu02_rareware(); break; + case MENU_EYE_INTRO: interface_menu03_eye(); break; + case MENU_GOLDENEYE_LOGO: interface_menu04_goldeneyelogo(); break; + case MENU_FILE_SELECT: interface_menu05_fileselect(); break; + case MENU_MODE_SELECT: interface_menu06_modesel(); break; + case MENU_MISSION_SELECT: interface_menu07_missionsel(); break; + case MENU_DIFFICULTY: interface_menu08_difficulty(); break; + case MENU_007_OPTIONS: interface_menu09_007options(); break; + case MENU_BRIEFING: interface_menu0A_briefing(); break; + case MENU_MISSION_FAILED: interface_menu0C_missionfailed(); break; + case MENU_MISSION_COMPLETE: interface_menu0D_missioncomplete(); break; + case MENU_MP_OPTIONS: interface_menu0E_mpoptions(); break; + case MENU_MP_SCENARIO_SELECT: interface_menu13_mpscenario(); break; + case MENU_MP_CHAR_SELECT: interface_menu0F_mpcharsel(); break; + case MENU_MP_TEAMS: interface_menu14_mpteams(); break; + case MENU_MP_HANDICAP: interface_menu10_mphandicap(); break; + case MENU_MP_CONTROL_STYLE: interface_menu11_mpcontrols(); break; + case MENU_MP_STAGE_SELECT: interface_menu12_mpstage(); break; + case MENU_CHEAT: interface_menu15_cheat(); break; + case MENU_NO_CONTROLLERS: interface_menu16_nocontrollers(); break; + case MENU_DISPLAY_CAST: interface_menu18_displaycast(); break; + case MENU_SPECTRUM_EMU: interface_menu19_spectrum(); break; + case MENU_RUN_STAGE: + if (interface_menu0B_runstage()) + { + frontChangeMenu(MENU_LEGAL_SCREEN, 1); } - else { - if (selected_stage == LEVELID_CUBA) { - do_extended_cast_display(1); - set_menu_to_mode(MENU_DISPLAY_CAST,1); - } - else { - set_menu_to_mode(MENU_MISSION_FAILED,1); - } + else if (gamemode == GAMEMODE_MULTI) + { + frontChangeMenu(MENU_MP_OPTIONS, 1); + } + else if (selected_stage == LEVELID_CUBA) + { + do_extended_cast_display(1); + frontChangeMenu(MENU_DISPLAY_CAST, 1); + } + else + { + frontChangeMenu(MENU_MISSION_FAILED, 1); } - } - else { - set_menu_to_mode(MENU_LEGAL_SCREEN,1); - } - break; - case MENU_MISSION_FAILED: - interface_menu0C_missionfailed(); - break; - case MENU_MISSION_COMPLETE: - interface_menu0D_missioncomplete(); - break; - case MENU_MP_OPTIONS: - interface_menu0E_mpoptions(); - break; - case MENU_MP_CHAR_SELECT: - interface_menu0F_mpcharsel(); - break; - case MENU_MP_HANDICAP: - interface_menu10_mphandicap(); - break; - case MENU_MP_CONTROL_STYLE: - interface_menu11_mpcontrols(); - break; - case MENU_MP_STAGE_SELECT: - interface_menu12_mpstage(); - break; - case MENU_MP_SCENARIO_SELECT: - interface_menu13_mpscenario(); - break; - case MENU_MP_TEAMS: - interface_menu14_mpteams(); - break; - case MENU_CHEAT: - interface_menu15_cheat(); - break; - case MENU_NO_CONTROLLERS: - interface_menu16_nocontrollers(); - break; - case MENU_SWITCH_SCREENS: - interface_menu17_switchscreens(); - break; - case MENU_DISPLAY_CAST: - interface_menu18_displaycast(); - break; - case MENU_SPECTRUM_EMU: - interface_menu19_spectrum(); } - return; -} -#else - -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.late_rodata - -glabel D_80051B44 -.word 0x3FAAAAAB /*1.3333334;*/ -glabel D_80051B48 -.word 0x3FAAAAAB /*1.3333334;*/ - - -glabel jpt_menu_update - .word menu_legal_screen_update - .word menu_nintendo_logo_update - .word menu_rareware_logo_update - .word menu_eye_intro_update - .word menu_goldeneye_logo_update - .word menu_file_select_update - .word menu_mode_select_update - .word menu_mission_select_update - .word menu_difficulty_update - .word menu_007_options_update - .word menu_briefing_update - .word menu_switch_screen_update - .word menu_mission_failed_update - .word menu_mission_complete_update - .word menu_mp_options_update - .word menu_mp_char_select_update - .word menu_mp_handicap_update - .word menu_mp_control_style_update - .word menu_mp_stage_select_update - .word menu_mp_scenario_select_update - .word menu_mp_teams_update - .word menu_cheat_update - .word menu_no_controllers_update - .word menu_switch_screen_update - .word menu_display_cast_update - .word menu_spectrum_emu_update - - glabel jpt_menu_init - .word menu_legal_screen_init - .word menu_nintendo_logo_init - .word menu_rareware_logo_init - .word menu_eye_intro_init - .word menu_goldeneye_logo_init - .word menu_file_select_init - .word menu_mode_select_init - .word menu_mission_select_init - .word menu_difficulty_init - .word menu_007_options_init - .word menu_briefing_init - .word menu_runstage_init - .word menu_mission_failed_init - .word menu_mission_complete_init - .word menu_mp_options_init - .word menu_mp_char_select_init - .word menu_mp_handicap_init - .word menu_mp_control_style_init - .word menu_mp_stage_select_init - .word menu_mp_scenario_select_init - .word menu_mp_teams_init - .word menu_cheat_init - .word menu_no_controllers_init - .word menu_switch_screens_init - .word menu_display_cast_init - .word menu_spectrum_emu_init - -glabel jpt_menu_interface - .word menu00_legal_interface - .word menu01_nintendo_interface - .word menu02_rareware_interface - .word menu03_eye_interface - .word menu04_goldeneye_interface - .word menu05_filesel_interface - .word menu06_modesel_interface - .word menu07_missionsel_interface - .word menu08_difficulty_interface - .word menu09_007options_interface - .word menu0A_briefing_interface - .word menu0B_runstage_interface - .word menu0C_missionfailed_interface - .word menu0D_missioncomplete_interface - .word menu0E_mpoptions_interface - .word menu0F_mpcharsel_interface - .word menu10_mphandicap_interface - .word menu11_mpcontrol_interface - .word menu12_mpstage_interface - .word menu13_mpscenario_interface - .word menu14_mpteams_interface - .word menu15_cheat_interface - .word menu16_nocontrollers_interface - .word menu17_switchscreen_interface - .word menu18_displaycast_interface - .word menu19_spectrum_interface -.text -glabel menu_init -/* 04F14C 7F01A61C 3C0E8003 */ lui $t6, %hi(current_menu) -/* 04F150 7F01A620 8DCEA8C0 */ lw $t6, %lo(current_menu)($t6) -/* 04F154 7F01A624 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 04F158 7F01A628 24010017 */ li $at, 23 -/* 04F15C 7F01A62C 15C1001D */ bne $t6, $at, .L7F01A6A4 -/* 04F160 7F01A630 AFBF0014 */ sw $ra, 0x14($sp) -/* 04F164 7F01A634 3C0F8003 */ lui $t7, %hi(spectrum_related_flag) -/* 04F168 7F01A638 8DEFA944 */ lw $t7, %lo(spectrum_related_flag)($t7) -/* 04F16C 7F01A63C 3C088003 */ lui $t0, %hi(is_emulating_spectrum) -/* 04F170 7F01A640 11E0000C */ beqz $t7, .L7F01A674 -/* 04F174 7F01A644 00000000 */ nop -/* 04F178 7F01A648 0C000F07 */ jal viGetFrameBuf2 -/* 04F17C 7F01A64C 00000000 */ nop -/* 04F180 7F01A650 3C18803E */ lui $t8, %hi(cfb_16+0x25800) # $t8, 0x803e -/* 04F184 7F01A654 2718A800 */ addiu $t8, %lo(cfb_16+0x25800) # addiu $t8, $t8, -0x5800 -/* 04F188 7F01A658 14580012 */ bne $v0, $t8, .L7F01A6A4 -/* 04F18C 7F01A65C 24190001 */ li $t9, 1 -/* 04F190 7F01A660 3C018003 */ lui $at, %hi(screen_size) -/* 04F194 7F01A664 AC39A940 */ sw $t9, %lo(screen_size)($at) -/* 04F198 7F01A668 3C018003 */ lui $at, %hi(spectrum_related_flag) -/* 04F19C 7F01A66C 1000000D */ b .L7F01A6A4 -/* 04F1A0 7F01A670 AC20A944 */ sw $zero, %lo(spectrum_related_flag)($at) -.L7F01A674: -/* 04F1A4 7F01A674 8D08A948 */ lw $t0, %lo(is_emulating_spectrum)($t0) -/* 04F1A8 7F01A678 1100000A */ beqz $t0, .L7F01A6A4 -/* 04F1AC 7F01A67C 00000000 */ nop -/* 04F1B0 7F01A680 0C000F07 */ jal viGetFrameBuf2 -/* 04F1B4 7F01A684 00000000 */ nop -/* 04F1B8 7F01A688 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b -/* 04F1BC 7F01A68C 25295000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, 0x5000 -/* 04F1C0 7F01A690 14490004 */ bne $v0, $t1, .L7F01A6A4 -/* 04F1C4 7F01A694 3C018003 */ lui $at, %hi(screen_size) -/* 04F1C8 7F01A698 AC20A940 */ sw $zero, %lo(screen_size)($at) -/* 04F1CC 7F01A69C 3C018003 */ lui $at, %hi(is_emulating_spectrum) -/* 04F1D0 7F01A6A0 AC20A948 */ sw $zero, %lo(is_emulating_spectrum)($at) -.L7F01A6A4: -/* 04F1D4 7F01A6A4 3C0A8003 */ lui $t2, %hi(screen_size) -/* 04F1D8 7F01A6A8 8D4AA940 */ lw $t2, %lo(screen_size)($t2) -/* 04F1DC 7F01A6AC 3C018005 */ lui $at, %hi(D_80051B48) -/* 04F1E0 7F01A6B0 11400020 */ beqz $t2, .L7F01A734 -/* 04F1E4 7F01A6B4 00000000 */ nop -/* 04F1E8 7F01A6B8 0C000F07 */ jal viGetFrameBuf2 -/* 04F1EC 7F01A6BC 00000000 */ nop -/* 04F1F0 7F01A6C0 3C0B803E */ lui $t3, %hi(cfb_16+0x25800) # $t3, 0x803e -/* 04F1F4 7F01A6C4 256BA800 */ addiu $t3, %lo(cfb_16+0x25800) # addiu $t3, $t3, -0x5800 -/* 04F1F8 7F01A6C8 144B0003 */ bne $v0, $t3, .L7F01A6D8 -/* 04F1FC 7F01A6CC 3C048003 */ lui $a0, %hi(ptr_menu_videobuffer) -/* 04F200 7F01A6D0 0C000F0F */ jal viSetFrameBuf2 -/* 04F204 7F01A6D4 8C84A954 */ lw $a0, %lo(ptr_menu_videobuffer)($a0) -.L7F01A6D8: -/* 04F208 7F01A6D8 3C018005 */ lui $at, %hi(D_80051B48) -/* 04F20C 7F01A6DC 0C001164 */ jal viSetAspect -/* 04F210 7F01A6E0 C42C1B44 */ lwc1 $f12, %lo(D_80051B44)($at) -/* 04F214 7F01A6E4 240401B8 */ li $a0, 440 -/* 04F218 7F01A6E8 0C0010FE */ jal viSetXY -/* 04F21C 7F01A6EC 2405014A */ li $a1, 330 -/* 04F220 7F01A6F0 240401B8 */ li $a0, 440 -/* 04F224 7F01A6F4 0C0010ED */ jal viSetBuf -/* 04F228 7F01A6F8 2405014A */ li $a1, 330 -/* 04F22C 7F01A6FC 240401B8 */ li $a0, 440 -/* 04F230 7F01A700 0FC26C77 */ jal set_cur_player_screen_size -/* 04F234 7F01A704 2405014A */ li $a1, 330 -/* 04F238 7F01A708 240401B8 */ li $a0, 440 -/* 04F23C 7F01A70C 0C00110F */ jal viSetViewSize -/* 04F240 7F01A710 2405014A */ li $a1, 330 -/* 04F244 7F01A714 00002025 */ move $a0, $zero -/* 04F248 7F01A718 0FC26C7E */ jal set_cur_player_viewport_size -/* 04F24C 7F01A71C 00002825 */ move $a1, $zero -/* 04F250 7F01A720 00002025 */ move $a0, $zero -/* 04F254 7F01A724 0C00112F */ jal viSetViewPosition -/* 04F258 7F01A728 00002825 */ move $a1, $zero -/* 04F25C 7F01A72C 10000015 */ b .L7F01A784 -/* 04F260 7F01A730 00000000 */ nop -.L7F01A734: -/* 04F264 7F01A734 0C001164 */ jal viSetAspect -/* 04F268 7F01A738 C42C1B48 */ lwc1 $f12, %lo(D_80051B48)($at) -/* 04F26C 7F01A73C 24040140 */ li $a0, 320 -/* 04F270 7F01A740 0C0010FE */ jal viSetXY -/* 04F274 7F01A744 240500F0 */ li $a1, 240 -/* 04F278 7F01A748 24040140 */ li $a0, 320 -/* 04F27C 7F01A74C 0C0010ED */ jal viSetBuf -/* 04F280 7F01A750 240500F0 */ li $a1, 240 -/* 04F284 7F01A754 24040140 */ li $a0, 320 -/* 04F288 7F01A758 0FC26C77 */ jal set_cur_player_screen_size -/* 04F28C 7F01A75C 240500F0 */ li $a1, 240 -/* 04F290 7F01A760 24040140 */ li $a0, 320 -/* 04F294 7F01A764 0C00110F */ jal viSetViewSize -/* 04F298 7F01A768 240500F0 */ li $a1, 240 -/* 04F29C 7F01A76C 00002025 */ move $a0, $zero -/* 04F2A0 7F01A770 0FC26C7E */ jal set_cur_player_viewport_size -/* 04F2A4 7F01A774 00002825 */ move $a1, $zero -/* 04F2A8 7F01A778 00002025 */ move $a0, $zero -/* 04F2AC 7F01A77C 0C00112F */ jal viSetViewPosition -/* 04F2B0 7F01A780 00002825 */ move $a1, $zero -.L7F01A784: -/* 04F2B4 7F01A784 3C028003 */ lui $v0, %hi(menu_update) -/* 04F2B8 7F01A788 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -/* 04F2BC 7F01A78C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F2C0 7F01A790 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F2C4 7F01A794 04410004 */ bgez $v0, .L7F01A7A8 -/* 04F2C8 7F01A798 3C0C8003 */ lui $t4, %hi(maybe_prev_menu) -/* 04F2CC 7F01A79C 8D8CA8C8 */ lw $t4, %lo(maybe_prev_menu)($t4) -/* 04F2D0 7F01A7A0 058000B7 */ bltz $t4, .L7F01AA80 -/* 04F2D4 7F01A7A4 00000000 */ nop -.L7F01A7A8: -/* 04F2D8 7F01A7A8 8C830000 */ lw $v1, ($a0) -/* 04F2DC 7F01A7AC 24010017 */ li $at, 23 -/* 04F2E0 7F01A7B0 106100B3 */ beq $v1, $at, .L7F01AA80 -/* 04F2E4 7F01A7B4 2C61001A */ sltiu $at, $v1, 0x1a -/* 04F2E8 7F01A7B8 102000AD */ beqz $at, .L7F01AA70 -/* 04F2EC 7F01A7BC 00036880 */ sll $t5, $v1, 2 -/* 04F2F0 7F01A7C0 3C018005 */ lui $at, %hi(jpt_menu_update) -/* 04F2F4 7F01A7C4 002D0821 */ addu $at, $at, $t5 -/* 04F2F8 7F01A7C8 8C2D1B4C */ lw $t5, %lo(jpt_menu_update)($at) -/* 04F2FC 7F01A7CC 01A00008 */ jr $t5 -/* 04F300 7F01A7D0 00000000 */ nop -menu_legal_screen_update: -/* 04F304 7F01A7D4 0FC029AC */ jal update_menu00_legalscreen -/* 04F308 7F01A7D8 00000000 */ nop -/* 04F30C 7F01A7DC 3C028003 */ lui $v0, %hi(menu_update) -/* 04F310 7F01A7E0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F314 7F01A7E4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F318 7F01A7E8 100000A1 */ b .L7F01AA70 -/* 04F31C 7F01A7EC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_nintendo_logo_update: -/* 04F320 7F01A7F0 0FC02B29 */ jal update_menu01_nintendo -/* 04F324 7F01A7F4 00000000 */ nop -/* 04F328 7F01A7F8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F32C 7F01A7FC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F330 7F01A800 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F334 7F01A804 1000009A */ b .L7F01AA70 -/* 04F338 7F01A808 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_rareware_logo_update: -/* 04F33C 7F01A80C 0FC02C29 */ jal update_menu02_rareware -/* 04F340 7F01A810 00000000 */ nop -/* 04F344 7F01A814 3C028003 */ lui $v0, %hi(menu_update) -/* 04F348 7F01A818 3C048003 */ lui $a0, %hi(current_menu) -/* 04F34C 7F01A81C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F350 7F01A820 10000093 */ b .L7F01AA70 -/* 04F354 7F01A824 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_eye_intro_update: -/* 04F358 7F01A828 0FC02C64 */ jal update_menu_03_eye -/* 04F35C 7F01A82C 00000000 */ nop -/* 04F360 7F01A830 3C028003 */ lui $v0, %hi(menu_update) -/* 04F364 7F01A834 3C048003 */ lui $a0, %hi(current_menu) -/* 04F368 7F01A838 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F36C 7F01A83C 1000008C */ b .L7F01AA70 -/* 04F370 7F01A840 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_goldeneye_logo_update: -/* 04F374 7F01A844 0FC02CC1 */ jal update_menu04_goldeneye -/* 04F378 7F01A848 00000000 */ nop -/* 04F37C 7F01A84C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F380 7F01A850 3C048003 */ lui $a0, %hi(current_menu) -/* 04F384 7F01A854 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F388 7F01A858 10000085 */ b .L7F01AA70 -/* 04F38C 7F01A85C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_file_select_update: -/* 04F390 7F01A860 0FC02EB8 */ jal update_menu05_filesel -/* 04F394 7F01A864 00000000 */ nop -/* 04F398 7F01A868 3C028003 */ lui $v0, %hi(menu_update) -/* 04F39C 7F01A86C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3A0 7F01A870 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3A4 7F01A874 1000007E */ b .L7F01AA70 -/* 04F3A8 7F01A878 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mode_select_update: -/* 04F3AC 7F01A87C 0FC034A4 */ jal update_menu06_modesel -/* 04F3B0 7F01A880 00000000 */ nop -/* 04F3B4 7F01A884 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3B8 7F01A888 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3BC 7F01A88C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3C0 7F01A890 10000077 */ b .L7F01AA70 -/* 04F3C4 7F01A894 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_select_update: -/* 04F3C8 7F01A898 0FC037AC */ jal update_menu07_missionsel -/* 04F3CC 7F01A89C 00000000 */ nop -/* 04F3D0 7F01A8A0 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3D4 7F01A8A4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3D8 7F01A8A8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3DC 7F01A8AC 10000070 */ b .L7F01AA70 -/* 04F3E0 7F01A8B0 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_difficulty_update: -/* 04F3E4 7F01A8B4 0FC039EE */ jal update_menu08_difficulty -/* 04F3E8 7F01A8B8 00000000 */ nop -/* 04F3EC 7F01A8BC 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3F0 7F01A8C0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3F4 7F01A8C4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3F8 7F01A8C8 10000069 */ b .L7F01AA70 -/* 04F3FC 7F01A8CC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_007_options_update: -/* 04F400 7F01A8D0 0FC03CDB */ jal update_menu09_007options -/* 04F404 7F01A8D4 00000000 */ nop -/* 04F408 7F01A8D8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F40C 7F01A8DC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F410 7F01A8E0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F414 7F01A8E4 10000062 */ b .L7F01AA70 -/* 04F418 7F01A8E8 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_briefing_update: -/* 04F41C 7F01A8EC 0FC05590 */ jal update_menu0A_briefing -/* 04F420 7F01A8F0 00000000 */ nop -/* 04F424 7F01A8F4 3C028003 */ lui $v0, %hi(menu_update) -/* 04F428 7F01A8F8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F42C 7F01A8FC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F430 7F01A900 1000005B */ b .L7F01AA70 -/* 04F434 7F01A904 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_failed_update: -/* 04F438 7F01A908 0FC05842 */ jal update_menu0C_missionfailed -/* 04F43C 7F01A90C 00000000 */ nop -/* 04F440 7F01A910 3C028003 */ lui $v0, %hi(menu_update) -/* 04F444 7F01A914 3C048003 */ lui $a0, %hi(current_menu) -/* 04F448 7F01A918 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F44C 7F01A91C 10000054 */ b .L7F01AA70 -/* 04F450 7F01A920 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_complete_update: -/* 04F454 7F01A924 0FC059B4 */ jal update_menu0D_missioncomplete -/* 04F458 7F01A928 00000000 */ nop -/* 04F45C 7F01A92C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F460 7F01A930 3C048003 */ lui $a0, %hi(current_menu) -/* 04F464 7F01A934 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F468 7F01A938 1000004D */ b .L7F01AA70 -/* 04F46C 7F01A93C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_options_update: -/* 04F470 7F01A940 0FC04210 */ jal update_menu0E_mpoptions -/* 04F474 7F01A944 00000000 */ nop -/* 04F478 7F01A948 3C028003 */ lui $v0, %hi(menu_update) -/* 04F47C 7F01A94C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F480 7F01A950 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F484 7F01A954 10000046 */ b .L7F01AA70 -/* 04F488 7F01A958 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_scenario_select_update: -/* 04F48C 7F01A95C 0FC051EC */ jal update_menu13_mpscenario -/* 04F490 7F01A960 00000000 */ nop -/* 04F494 7F01A964 3C028003 */ lui $v0, %hi(menu_update) -/* 04F498 7F01A968 3C048003 */ lui $a0, %hi(current_menu) -/* 04F49C 7F01A96C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4A0 7F01A970 1000003F */ b .L7F01AA70 -/* 04F4A4 7F01A974 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_char_select_update: -/* 04F4A8 7F01A978 0FC047B3 */ jal update_menu0F_mpcharsel -/* 04F4AC 7F01A97C 00000000 */ nop -/* 04F4B0 7F01A980 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4B4 7F01A984 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4B8 7F01A988 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4BC 7F01A98C 10000038 */ b .L7F01AA70 -/* 04F4C0 7F01A990 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_teams_update: -/* 04F4C4 7F01A994 0FC05350 */ jal update_menu14_mpteams -/* 04F4C8 7F01A998 00000000 */ nop -/* 04F4CC 7F01A99C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4D0 7F01A9A0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4D4 7F01A9A4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4D8 7F01A9A8 10000031 */ b .L7F01AA70 -/* 04F4DC 7F01A9AC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_handicap_update: -/* 04F4E0 7F01A9B0 0FC04BAF */ jal update_menu10_mphandicap -/* 04F4E4 7F01A9B4 00000000 */ nop -/* 04F4E8 7F01A9B8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4EC 7F01A9BC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4F0 7F01A9C0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4F4 7F01A9C4 1000002A */ b .L7F01AA70 -/* 04F4F8 7F01A9C8 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_control_style_update: -/* 04F4FC 7F01A9CC 0FC04D80 */ jal update_menu11_mpcontrols -/* 04F500 7F01A9D0 00000000 */ nop -/* 04F504 7F01A9D4 3C028003 */ lui $v0, %hi(menu_update) -/* 04F508 7F01A9D8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F50C 7F01A9DC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F510 7F01A9E0 10000023 */ b .L7F01AA70 -/* 04F514 7F01A9E4 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_stage_select_update: -/* 04F518 7F01A9E8 0FC04F73 */ jal update_menu12_mpstage -/* 04F51C 7F01A9EC 00000000 */ nop -/* 04F520 7F01A9F0 3C028003 */ lui $v0, %hi(menu_update) -/* 04F524 7F01A9F4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F528 7F01A9F8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F52C 7F01A9FC 1000001C */ b .L7F01AA70 -/* 04F530 7F01AA00 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_cheat_update: -/* 04F534 7F01AA04 0FC05EFD */ jal update_menu15_cheat -/* 04F538 7F01AA08 00000000 */ nop -/* 04F53C 7F01AA0C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F540 7F01AA10 3C048003 */ lui $a0, %hi(current_menu) -/* 04F544 7F01AA14 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F548 7F01AA18 10000015 */ b .L7F01AA70 -/* 04F54C 7F01AA1C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_no_controllers_update: -/* 04F550 7F01AA20 0FC06110 */ jal update_menu16_nocontrollers -/* 04F554 7F01AA24 00000000 */ nop -/* 04F558 7F01AA28 3C028003 */ lui $v0, %hi(menu_update) -/* 04F55C 7F01AA2C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F560 7F01AA30 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F564 7F01AA34 1000000E */ b .L7F01AA70 -/* 04F568 7F01AA38 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_display_cast_update: -/* 04F56C 7F01AA3C 0FC063C6 */ jal update_menu18_displaycast -/* 04F570 7F01AA40 00000000 */ nop -/* 04F574 7F01AA44 3C028003 */ lui $v0, %hi(menu_update) -/* 04F578 7F01AA48 3C048003 */ lui $a0, %hi(current_menu) -/* 04F57C 7F01AA4C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F580 7F01AA50 10000007 */ b .L7F01AA70 -/* 04F584 7F01AA54 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_spectrum_emu_update: -/* 04F588 7F01AA58 0FC06920 */ jal update_menu19_spectrum -/* 04F58C 7F01AA5C 00000000 */ nop -/* 04F590 7F01AA60 3C028003 */ lui $v0, %hi(menu_update) -/* 04F594 7F01AA64 3C048003 */ lui $a0, %hi(current_menu) -/* 04F598 7F01AA68 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F59C 7F01AA6C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_switch_screen_update: -.L7F01AA70: -/* 04F5A0 7F01AA70 04400003 */ bltz $v0, .L7F01AA80 -/* 04F5A4 7F01AA74 240E0017 */ li $t6, 23 -/* 04F5A8 7F01AA78 0FC02ABB */ jal reset_menutimer -/* 04F5AC 7F01AA7C AC8E0000 */ sw $t6, ($a0) -.L7F01AA80: -/* 04F5B0 7F01AA80 3C028003 */ lui $v0, %hi(maybe_prev_menu) -/* 04F5B4 7F01AA84 8C42A8C8 */ lw $v0, %lo(maybe_prev_menu)($v0) -/* 04F5B8 7F01AA88 3C048003 */ lui $a0, %hi(current_menu) -/* 04F5BC 7F01AA8C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F5C0 7F01AA90 04400089 */ bltz $v0, .L7F01ACB8 -/* 04F5C4 7F01AA94 240FFFFF */ li $t7, -1 -/* 04F5C8 7F01AA98 AC820000 */ sw $v0, ($a0) -/* 04F5CC 7F01AA9C 3C018003 */ lui $at, %hi(maybe_prev_menu) -/* 04F5D0 7F01AAA0 AC2FA8C8 */ sw $t7, %lo(maybe_prev_menu)($at) -/* 04F5D4 7F01AAA4 8C980000 */ lw $t8, ($a0) -/* 04F5D8 7F01AAA8 2F01001A */ sltiu $at, $t8, 0x1a -/* 04F5DC 7F01AAAC 10200082 */ beqz $at, .L7F01ACB8 -/* 04F5E0 7F01AAB0 0018C080 */ sll $t8, $t8, 2 -/* 04F5E4 7F01AAB4 3C018005 */ lui $at, %hi(jpt_menu_init) -/* 04F5E8 7F01AAB8 00380821 */ addu $at, $at, $t8 -/* 04F5EC 7F01AABC 8C381BB4 */ lw $t8, %lo(jpt_menu_init)($at) -/* 04F5F0 7F01AAC0 03000008 */ jr $t8 -/* 04F5F4 7F01AAC4 00000000 */ nop -menu_legal_screen_init: -/* 04F5F8 7F01AAC8 0FC0297A */ jal init_menu00_legalscreen -/* 04F5FC 7F01AACC 00000000 */ nop -/* 04F600 7F01AAD0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F604 7F01AAD4 10000078 */ b .L7F01ACB8 -/* 04F608 7F01AAD8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_nintendo_logo_init: -/* 04F60C 7F01AADC 0FC02AF2 */ jal init_menu01_nintendo -/* 04F610 7F01AAE0 00000000 */ nop -/* 04F614 7F01AAE4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F618 7F01AAE8 10000073 */ b .L7F01ACB8 -/* 04F61C 7F01AAEC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_rareware_logo_init: -/* 04F620 7F01AAF0 0FC02C19 */ jal init_menu02_rarelogo -/* 04F624 7F01AAF4 00000000 */ nop -/* 04F628 7F01AAF8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F62C 7F01AAFC 1000006E */ b .L7F01ACB8 -/* 04F630 7F01AB00 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_eye_intro_init: -/* 04F634 7F01AB04 0FC02C55 */ jal init_menu03_eyeintro -/* 04F638 7F01AB08 00000000 */ nop -/* 04F63C 7F01AB0C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F640 7F01AB10 10000069 */ b .L7F01ACB8 -/* 04F644 7F01AB14 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_goldeneye_logo_init: -/* 04F648 7F01AB18 0FC02C96 */ jal init_menu04_goldeneyelogo -/* 04F64C 7F01AB1C 00000000 */ nop -/* 04F650 7F01AB20 3C048003 */ lui $a0, %hi(current_menu) -/* 04F654 7F01AB24 10000064 */ b .L7F01ACB8 -/* 04F658 7F01AB28 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_file_select_init: -/* 04F65C 7F01AB2C 0FC02E7A */ jal init_menu05_fileselect -/* 04F660 7F01AB30 00000000 */ nop -/* 04F664 7F01AB34 3C048003 */ lui $a0, %hi(current_menu) -/* 04F668 7F01AB38 1000005F */ b .L7F01ACB8 -/* 04F66C 7F01AB3C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mode_select_init: -/* 04F670 7F01AB40 0FC03494 */ jal init_menu06_modeselect -/* 04F674 7F01AB44 00000000 */ nop -/* 04F678 7F01AB48 3C048003 */ lui $a0, %hi(current_menu) -/* 04F67C 7F01AB4C 1000005A */ b .L7F01ACB8 -/* 04F680 7F01AB50 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_select_init: -/* 04F684 7F01AB54 0FC03794 */ jal init_menu07_missionselect -/* 04F688 7F01AB58 00000000 */ nop -/* 04F68C 7F01AB5C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F690 7F01AB60 10000055 */ b .L7F01ACB8 -/* 04F694 7F01AB64 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_difficulty_init: -/* 04F698 7F01AB68 0FC039E0 */ jal init_menu08_difficultyselect -/* 04F69C 7F01AB6C 00000000 */ nop -/* 04F6A0 7F01AB70 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6A4 7F01AB74 10000050 */ b .L7F01ACB8 -/* 04F6A8 7F01AB78 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_007_options_init: -/* 04F6AC 7F01AB7C 0FC03CC0 */ jal init_menu09_007difficultyselect -/* 04F6B0 7F01AB80 00000000 */ nop -/* 04F6B4 7F01AB84 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6B8 7F01AB88 1000004B */ b .L7F01ACB8 -/* 04F6BC 7F01AB8C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_briefing_init: -/* 04F6C0 7F01AB90 0FC0557D */ jal init_menu0A_briefing -/* 04F6C4 7F01AB94 00000000 */ nop -/* 04F6C8 7F01AB98 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6CC 7F01AB9C 10000046 */ b .L7F01ACB8 -/* 04F6D0 7F01ABA0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_runstage_init: -/* 04F6D4 7F01ABA4 0FC05819 */ jal init_menu0B_runstage -/* 04F6D8 7F01ABA8 00000000 */ nop -/* 04F6DC 7F01ABAC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6E0 7F01ABB0 10000041 */ b .L7F01ACB8 -/* 04F6E4 7F01ABB4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_failed_init: -/* 04F6E8 7F01ABB8 0FC05825 */ jal init_menu0C_missionfailed -/* 04F6EC 7F01ABBC 00000000 */ nop -/* 04F6F0 7F01ABC0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6F4 7F01ABC4 1000003C */ b .L7F01ACB8 -/* 04F6F8 7F01ABC8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_complete_init: -/* 04F6FC 7F01ABCC 0FC0599F */ jal init_menu0D_missioncomplete -/* 04F700 7F01ABD0 00000000 */ nop -/* 04F704 7F01ABD4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F708 7F01ABD8 10000037 */ b .L7F01ACB8 -/* 04F70C 7F01ABDC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_options_init: -/* 04F710 7F01ABE0 0FC041CF */ jal init_menu0E_mpoptions -/* 04F714 7F01ABE4 00000000 */ nop -/* 04F718 7F01ABE8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F71C 7F01ABEC 10000032 */ b .L7F01ACB8 -/* 04F720 7F01ABF0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_scenario_select_init: -/* 04F724 7F01ABF4 0FC051D9 */ jal init_menu13_mpscenariosel -/* 04F728 7F01ABF8 00000000 */ nop -/* 04F72C 7F01ABFC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F730 7F01AC00 1000002D */ b .L7F01ACB8 -/* 04F734 7F01AC04 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_char_select_init: -/* 04F738 7F01AC08 0FC0470F */ jal init_menu0f_mpcharsel -/* 04F73C 7F01AC0C 00000000 */ nop -/* 04F740 7F01AC10 3C048003 */ lui $a0, %hi(current_menu) -/* 04F744 7F01AC14 10000028 */ b .L7F01ACB8 -/* 04F748 7F01AC18 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_teams_init: -/* 04F74C 7F01AC1C 0FC05330 */ jal init_menu14_mpteamsel -/* 04F750 7F01AC20 00000000 */ nop -/* 04F754 7F01AC24 3C048003 */ lui $a0, %hi(current_menu) -/* 04F758 7F01AC28 10000023 */ b .L7F01ACB8 -/* 04F75C 7F01AC2C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_handicap_init: -/* 04F760 7F01AC30 0FC04B8C */ jal init_menu10_mphandicap -/* 04F764 7F01AC34 00000000 */ nop -/* 04F768 7F01AC38 3C048003 */ lui $a0, %hi(current_menu) -/* 04F76C 7F01AC3C 1000001E */ b .L7F01ACB8 -/* 04F770 7F01AC40 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_control_style_init: -/* 04F774 7F01AC44 0FC04D5D */ jal init_menu11_mpcontrol -/* 04F778 7F01AC48 00000000 */ nop -/* 04F77C 7F01AC4C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F780 7F01AC50 10000019 */ b .L7F01ACB8 -/* 04F784 7F01AC54 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_stage_select_init: -/* 04F788 7F01AC58 0FC04F5E */ jal init_menu12_mpstage -/* 04F78C 7F01AC5C 00000000 */ nop -/* 04F790 7F01AC60 3C048003 */ lui $a0, %hi(current_menu) -/* 04F794 7F01AC64 10000014 */ b .L7F01ACB8 -/* 04F798 7F01AC68 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_cheat_init: -/* 04F79C 7F01AC6C 0FC05ED4 */ jal init_menu15_cheat -/* 04F7A0 7F01AC70 00000000 */ nop -/* 04F7A4 7F01AC74 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7A8 7F01AC78 1000000F */ b .L7F01ACB8 -/* 04F7AC 7F01AC7C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_no_controllers_init: -/* 04F7B0 7F01AC80 0FC0610E */ jal init_menu16_nocontroller -/* 04F7B4 7F01AC84 00000000 */ nop -/* 04F7B8 7F01AC88 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7BC 7F01AC8C 1000000A */ b .L7F01ACB8 -/* 04F7C0 7F01AC90 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_display_cast_init: -/* 04F7C4 7F01AC94 0FC061A7 */ jal init_menu18_displaycast -/* 04F7C8 7F01AC98 00000000 */ nop -/* 04F7CC 7F01AC9C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7D0 7F01ACA0 10000005 */ b .L7F01ACB8 -/* 04F7D4 7F01ACA4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_spectrum_emu_init: -/* 04F7D8 7F01ACA8 0FC068E7 */ jal init_menu19_spectrum -/* 04F7DC 7F01ACAC 00000000 */ nop -/* 04F7E0 7F01ACB0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7E4 7F01ACB4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_switch_screens_init: -.L7F01ACB8: -/* 04F7E8 7F01ACB8 8C990000 */ lw $t9, ($a0) -/* 04F7EC 7F01ACBC 2F21001A */ sltiu $at, $t9, 0x1a -/* 04F7F0 7F01ACC0 1020008A */ beqz $at, .L7F01AEEC -/* 04F7F4 7F01ACC4 0019C880 */ sll $t9, $t9, 2 -/* 04F7F8 7F01ACC8 3C018005 */ lui $at, %hi(jpt_menu_interface) -/* 04F7FC 7F01ACCC 00390821 */ addu $at, $at, $t9 -/* 04F800 7F01ACD0 8C391C1C */ lw $t9, %lo(jpt_menu_interface)($at) -/* 04F804 7F01ACD4 03200008 */ jr $t9 -/* 04F808 7F01ACD8 00000000 */ nop -menu00_legal_interface: -/* 04F80C 7F01ACDC 0FC029B7 */ jal interface_menu00_legalscreen -/* 04F810 7F01ACE0 00000000 */ nop -/* 04F814 7F01ACE4 10000082 */ b .L7F01AEF0 -/* 04F818 7F01ACE8 8FBF0014 */ lw $ra, 0x14($sp) -menu17_switchscreen_interface: -/* 04F81C 7F01ACEC 0FC02AC0 */ jal interface_menu17_switchscreens -/* 04F820 7F01ACF0 00000000 */ nop -/* 04F824 7F01ACF4 1000007E */ b .L7F01AEF0 -/* 04F828 7F01ACF8 8FBF0014 */ lw $ra, 0x14($sp) -menu01_nintendo_interface: -/* 04F82C 7F01ACFC 0FC02B32 */ jal interface_menu01_nintendo -/* 04F830 7F01AD00 00000000 */ nop -/* 04F834 7F01AD04 1000007A */ b .L7F01AEF0 -/* 04F838 7F01AD08 8FBF0014 */ lw $ra, 0x14($sp) -menu02_rareware_interface: -/* 04F83C 7F01AD0C 0FC02C2B */ jal interface_menu02_rareware -/* 04F840 7F01AD10 00000000 */ nop -/* 04F844 7F01AD14 10000076 */ b .L7F01AEF0 -/* 04F848 7F01AD18 8FBF0014 */ lw $ra, 0x14($sp) -menu03_eye_interface: -/* 04F84C 7F01AD1C 0FC02C6C */ jal interface_menu03_eye -/* 04F850 7F01AD20 00000000 */ nop -/* 04F854 7F01AD24 10000072 */ b .L7F01AEF0 -/* 04F858 7F01AD28 8FBF0014 */ lw $ra, 0x14($sp) -menu04_goldeneye_interface: -/* 04F85C 7F01AD2C 0FC02CCC */ jal interface_menu04_goldeneyelogo -/* 04F860 7F01AD30 00000000 */ nop -/* 04F864 7F01AD34 1000006E */ b .L7F01AEF0 -/* 04F868 7F01AD38 8FBF0014 */ lw $ra, 0x14($sp) -menu05_filesel_interface: -/* 04F86C 7F01AD3C 0FC02EF3 */ jal interface_menu05_fileselect -/* 04F870 7F01AD40 00000000 */ nop -/* 04F874 7F01AD44 1000006A */ b .L7F01AEF0 -/* 04F878 7F01AD48 8FBF0014 */ lw $ra, 0x14($sp) -menu06_modesel_interface: -/* 04F87C 7F01AD4C 0FC034A6 */ jal interface_menu06_modesel -/* 04F880 7F01AD50 00000000 */ nop -/* 04F884 7F01AD54 10000066 */ b .L7F01AEF0 -/* 04F888 7F01AD58 8FBF0014 */ lw $ra, 0x14($sp) -menu07_missionsel_interface: -/* 04F88C 7F01AD5C 0FC037AE */ jal interface_menu07_missionsel -/* 04F890 7F01AD60 00000000 */ nop -/* 04F894 7F01AD64 10000062 */ b .L7F01AEF0 -/* 04F898 7F01AD68 8FBF0014 */ lw $ra, 0x14($sp) -menu08_difficulty_interface: -/* 04F89C 7F01AD6C 0FC039F0 */ jal interface_menu08_difficulty -/* 04F8A0 7F01AD70 00000000 */ nop -/* 04F8A4 7F01AD74 1000005E */ b .L7F01AEF0 -/* 04F8A8 7F01AD78 8FBF0014 */ lw $ra, 0x14($sp) -menu09_007options_interface: -/* 04F8AC 7F01AD7C 0FC03CDD */ jal interface_menu09_007options -/* 04F8B0 7F01AD80 00000000 */ nop -/* 04F8B4 7F01AD84 1000005A */ b .L7F01AEF0 -/* 04F8B8 7F01AD88 8FBF0014 */ lw $ra, 0x14($sp) -menu0A_briefing_interface: -/* 04F8BC 7F01AD8C 0FC055A7 */ jal interface_menu0A_briefing -/* 04F8C0 7F01AD90 00000000 */ nop -/* 04F8C4 7F01AD94 10000056 */ b .L7F01AEF0 -/* 04F8C8 7F01AD98 8FBF0014 */ lw $ra, 0x14($sp) -menu0C_missionfailed_interface: -/* 04F8CC 7F01AD9C 0FC05844 */ jal interface_menu0C_missionfailed -/* 04F8D0 7F01ADA0 00000000 */ nop -/* 04F8D4 7F01ADA4 10000052 */ b .L7F01AEF0 -/* 04F8D8 7F01ADA8 8FBF0014 */ lw $ra, 0x14($sp) -menu0D_missioncomplete_interface: -/* 04F8DC 7F01ADAC 0FC059B6 */ jal interface_menu0D_missioncomplete -/* 04F8E0 7F01ADB0 00000000 */ nop -/* 04F8E4 7F01ADB4 1000004E */ b .L7F01AEF0 -/* 04F8E8 7F01ADB8 8FBF0014 */ lw $ra, 0x14($sp) -menu0E_mpoptions_interface: -/* 04F8EC 7F01ADBC 0FC04212 */ jal interface_menu0E_mpoptions -/* 04F8F0 7F01ADC0 00000000 */ nop -/* 04F8F4 7F01ADC4 1000004A */ b .L7F01AEF0 -/* 04F8F8 7F01ADC8 8FBF0014 */ lw $ra, 0x14($sp) -menu13_mpscenario_interface: -/* 04F8FC 7F01ADCC 0FC051EE */ jal interface_menu13_mpscenario -/* 04F900 7F01ADD0 00000000 */ nop -/* 04F904 7F01ADD4 10000046 */ b .L7F01AEF0 -/* 04F908 7F01ADD8 8FBF0014 */ lw $ra, 0x14($sp) -menu0F_mpcharsel_interface: -/* 04F90C 7F01ADDC 0FC047B5 */ jal interface_menu0F_mpcharsel -/* 04F910 7F01ADE0 00000000 */ nop -/* 04F914 7F01ADE4 10000042 */ b .L7F01AEF0 -/* 04F918 7F01ADE8 8FBF0014 */ lw $ra, 0x14($sp) -menu14_mpteams_interface: -/* 04F91C 7F01ADEC 0FC05352 */ jal interface_menu14_mpteams -/* 04F920 7F01ADF0 00000000 */ nop -/* 04F924 7F01ADF4 1000003E */ b .L7F01AEF0 -/* 04F928 7F01ADF8 8FBF0014 */ lw $ra, 0x14($sp) -menu10_mphandicap_interface: -/* 04F92C 7F01ADFC 0FC04BB1 */ jal interface_menu10_mphandicap -/* 04F930 7F01AE00 00000000 */ nop -/* 04F934 7F01AE04 1000003A */ b .L7F01AEF0 -/* 04F938 7F01AE08 8FBF0014 */ lw $ra, 0x14($sp) -menu11_mpcontrol_interface: -/* 04F93C 7F01AE0C 0FC04D82 */ jal interface_menu11_mpcontrols -/* 04F940 7F01AE10 00000000 */ nop -/* 04F944 7F01AE14 10000036 */ b .L7F01AEF0 -/* 04F948 7F01AE18 8FBF0014 */ lw $ra, 0x14($sp) -menu12_mpstage_interface: -/* 04F94C 7F01AE1C 0FC04F75 */ jal interface_menu12_mpstage -/* 04F950 7F01AE20 00000000 */ nop -/* 04F954 7F01AE24 10000032 */ b .L7F01AEF0 -/* 04F958 7F01AE28 8FBF0014 */ lw $ra, 0x14($sp) -menu15_cheat_interface: -/* 04F95C 7F01AE2C 0FC05F22 */ jal interface_menu15_cheat -/* 04F960 7F01AE30 00000000 */ nop -/* 04F964 7F01AE34 1000002E */ b .L7F01AEF0 -/* 04F968 7F01AE38 8FBF0014 */ lw $ra, 0x14($sp) -menu16_nocontrollers_interface: -/* 04F96C 7F01AE3C 0FC06112 */ jal interface_menu16_nocontrollers -/* 04F970 7F01AE40 00000000 */ nop -/* 04F974 7F01AE44 1000002A */ b .L7F01AEF0 -/* 04F978 7F01AE48 8FBF0014 */ lw $ra, 0x14($sp) -menu18_displaycast_interface: -/* 04F97C 7F01AE4C 0FC063D8 */ jal interface_menu18_displaycast -/* 04F980 7F01AE50 00000000 */ nop -/* 04F984 7F01AE54 10000026 */ b .L7F01AEF0 -/* 04F988 7F01AE58 8FBF0014 */ lw $ra, 0x14($sp) -menu19_spectrum_interface: -/* 04F98C 7F01AE5C 0FC06922 */ jal interface_menu19_spectrum -/* 04F990 7F01AE60 00000000 */ nop -/* 04F994 7F01AE64 10000022 */ b .L7F01AEF0 -/* 04F998 7F01AE68 8FBF0014 */ lw $ra, 0x14($sp) -menu0B_runstage_interface: -/* 04F99C 7F01AE6C 0FC2FF29 */ jal interface_menu0B_runstage -/* 04F9A0 7F01AE70 00000000 */ nop -/* 04F9A4 7F01AE74 10400006 */ beqz $v0, .L7F01AE90 -/* 04F9A8 7F01AE78 3C088003 */ lui $t0, %hi(gamemode) -/* 04F9AC 7F01AE7C 00002025 */ move $a0, $zero -/* 04F9B0 7F01AE80 0FC06975 */ jal set_menu_to_mode -/* 04F9B4 7F01AE84 24050001 */ li $a1, 1 -/* 04F9B8 7F01AE88 10000019 */ b .L7F01AEF0 -/* 04F9BC 7F01AE8C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AE90: -/* 04F9C0 7F01AE90 8D08A8F0 */ lw $t0, %lo(gamemode)($t0) -/* 04F9C4 7F01AE94 24010001 */ li $at, 1 -/* 04F9C8 7F01AE98 2404000E */ li $a0, 14 -/* 04F9CC 7F01AE9C 15010005 */ bne $t0, $at, .L7F01AEB4 -/* 04F9D0 7F01AEA0 3C098003 */ lui $t1, %hi(selected_stage) -/* 04F9D4 7F01AEA4 0FC06975 */ jal set_menu_to_mode -/* 04F9D8 7F01AEA8 24050001 */ li $a1, 1 -/* 04F9DC 7F01AEAC 10000010 */ b .L7F01AEF0 -/* 04F9E0 7F01AEB0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEB4: -/* 04F9E4 7F01AEB4 8D29A8F4 */ lw $t1, %lo(selected_stage)($t1) -/* 04F9E8 7F01AEB8 24010036 */ li $at, 54 -/* 04F9EC 7F01AEBC 2404000C */ li $a0, 12 -/* 04F9F0 7F01AEC0 15210008 */ bne $t1, $at, .L7F01AEE4 -/* 04F9F4 7F01AEC4 00000000 */ nop -/* 04F9F8 7F01AEC8 0FC0619C */ jal do_extended_cast_display -/* 04F9FC 7F01AECC 24040001 */ li $a0, 1 -/* 04FA00 7F01AED0 24040018 */ li $a0, 24 -/* 04FA04 7F01AED4 0FC06975 */ jal set_menu_to_mode -/* 04FA08 7F01AED8 24050001 */ li $a1, 1 -/* 04FA0C 7F01AEDC 10000004 */ b .L7F01AEF0 -/* 04FA10 7F01AEE0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEE4: -/* 04FA14 7F01AEE4 0FC06975 */ jal set_menu_to_mode -/* 04FA18 7F01AEE8 24050001 */ li $a1, 1 -.L7F01AEEC: -/* 04FA1C 7F01AEEC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEF0: -/* 04FA20 7F01AEF0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 04FA24 7F01AEF4 03E00008 */ jr $ra -/* 04FA28 7F01AEF8 00000000 */ nop -) -#endif - -#if defined(VERSION_EU) - -GLOBAL_ASM( -.late_rodata +} -glabel D_80051B44 -.word 0x3FCB2CB3 /* 1.58730161190033 */ -glabel D_80051B48 -.word 0x3FB3458F /* 1.40056025981903 */ - - -glabel jpt_menu_update - .word menu_legal_screen_update - .word menu_nintendo_logo_update - .word menu_rareware_logo_update - .word menu_eye_intro_update - .word menu_goldeneye_logo_update - .word menu_file_select_update - .word menu_mode_select_update - .word menu_mission_select_update - .word menu_difficulty_update - .word menu_007_options_update - .word menu_briefing_update - .word menu_switch_screen_update - .word menu_mission_failed_update - .word menu_mission_complete_update - .word menu_mp_options_update - .word menu_mp_char_select_update - .word menu_mp_handicap_update - .word menu_mp_control_style_update - .word menu_mp_stage_select_update - .word menu_mp_scenario_select_update - .word menu_mp_teams_update - .word menu_cheat_update - .word menu_no_controllers_update - .word menu_switch_screen_update - .word menu_display_cast_update - .word menu_spectrum_emu_update - - glabel jpt_menu_init - .word menu_legal_screen_init - .word menu_nintendo_logo_init - .word menu_rareware_logo_init - .word menu_eye_intro_init - .word menu_goldeneye_logo_init - .word menu_file_select_init - .word menu_mode_select_init - .word menu_mission_select_init - .word menu_difficulty_init - .word menu_007_options_init - .word menu_briefing_init - .word menu_runstage_init - .word menu_mission_failed_init - .word menu_mission_complete_init - .word menu_mp_options_init - .word menu_mp_char_select_init - .word menu_mp_handicap_init - .word menu_mp_control_style_init - .word menu_mp_stage_select_init - .word menu_mp_scenario_select_init - .word menu_mp_teams_init - .word menu_cheat_init - .word menu_no_controllers_init - .word menu_switch_screens_init - .word menu_display_cast_init - .word menu_spectrum_emu_init - -glabel jpt_menu_interface - .word menu00_legal_interface - .word menu01_nintendo_interface - .word menu02_rareware_interface - .word menu03_eye_interface - .word menu04_goldeneye_interface - .word menu05_filesel_interface - .word menu06_modesel_interface - .word menu07_missionsel_interface - .word menu08_difficulty_interface - .word menu09_007options_interface - .word menu0A_briefing_interface - .word menu0B_runstage_interface - .word menu0C_missionfailed_interface - .word menu0D_missioncomplete_interface - .word menu0E_mpoptions_interface - .word menu0F_mpcharsel_interface - .word menu10_mphandicap_interface - .word menu11_mpcontrol_interface - .word menu12_mpstage_interface - .word menu13_mpscenario_interface - .word menu14_mpteams_interface - .word menu15_cheat_interface - .word menu16_nocontrollers_interface - .word menu17_switchscreen_interface - .word menu18_displaycast_interface - .word menu19_spectrum_interface -.text -glabel menu_init -/* 04F14C 7F01A61C 3C0E8003 */ lui $t6, %hi(current_menu) -/* 04F150 7F01A620 8DCEA8C0 */ lw $t6, %lo(current_menu)($t6) -/* 04F154 7F01A624 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 04F158 7F01A628 24010017 */ li $at, 23 -/* 04F15C 7F01A62C 15C1001D */ bne $t6, $at, .L7F01A6A4 -/* 04F160 7F01A630 AFBF0014 */ sw $ra, 0x14($sp) -/* 04F164 7F01A634 3C0F8003 */ lui $t7, %hi(spectrum_related_flag) -/* 04F168 7F01A638 8DEFA944 */ lw $t7, %lo(spectrum_related_flag)($t7) -/* 04F16C 7F01A63C 3C088003 */ lui $t0, %hi(is_emulating_spectrum) -/* 04F170 7F01A640 11E0000C */ beqz $t7, .L7F01A674 -/* 04F174 7F01A644 00000000 */ nop -/* 04F178 7F01A648 0C000F07 */ jal viGetFrameBuf2 -/* 04F17C 7F01A64C 00000000 */ nop -/* 04F180 7F01A650 3C18803E */ lui $t8, %hi(cfb_16+0x2a800) # $t8, 0x803e -/* 04F184 7F01A654 2718A800 */ addiu $t8, %lo(cfb_16+0x2a800) # addiu $t8, $t8, -0x5800 -/* 04F188 7F01A658 14580012 */ bne $v0, $t8, .L7F01A6A4 -/* 04F18C 7F01A65C 24190001 */ li $t9, 1 -/* 04F190 7F01A660 3C018003 */ lui $at, %hi(screen_size) -/* 04F194 7F01A664 AC39A940 */ sw $t9, %lo(screen_size)($at) -/* 04F198 7F01A668 3C018003 */ lui $at, %hi(spectrum_related_flag) -/* 04F19C 7F01A66C 1000000D */ b .L7F01A6A4 -/* 04F1A0 7F01A670 AC20A944 */ sw $zero, %lo(spectrum_related_flag)($at) -.L7F01A674: -/* 04F1A4 7F01A674 8D08A948 */ lw $t0, %lo(is_emulating_spectrum)($t0) -/* 04F1A8 7F01A678 1100000A */ beqz $t0, .L7F01A6A4 -/* 04F1AC 7F01A67C 00000000 */ nop -/* 04F1B0 7F01A680 0C000F07 */ jal viGetFrameBuf2 -/* 04F1B4 7F01A684 00000000 */ nop -/* 04F1B8 7F01A688 3C09803B */ lui $t1, %hi(cfb_16) # $t1, 0x803b -/* 04F1BC 7F01A68C 25295000 */ addiu $t1, %lo(cfb_16) # addiu $t1, $t1, 0x5000 -/* 04F1C0 7F01A690 14490004 */ bne $v0, $t1, .L7F01A6A4 -/* 04F1C4 7F01A694 3C018003 */ lui $at, %hi(screen_size) -/* 04F1C8 7F01A698 AC20A940 */ sw $zero, %lo(screen_size)($at) -/* 04F1CC 7F01A69C 3C018003 */ lui $at, %hi(is_emulating_spectrum) -/* 04F1D0 7F01A6A0 AC20A948 */ sw $zero, %lo(is_emulating_spectrum)($at) -.L7F01A6A4: -/* 04F1D4 7F01A6A4 3C0A8003 */ lui $t2, %hi(screen_size) -/* 04F1D8 7F01A6A8 8D4AA940 */ lw $t2, %lo(screen_size)($t2) -/* 04F1DC 7F01A6AC 3C018005 */ lui $at, %hi(D_80051B48) -/* 04F1E0 7F01A6B0 11400020 */ beqz $t2, .L7F01A734 -/* 04F1E4 7F01A6B4 00000000 */ nop -/* 04F1E8 7F01A6B8 0C000F07 */ jal viGetFrameBuf2 -/* 04F1EC 7F01A6BC 00000000 */ nop -/* 04F1F0 7F01A6C0 3C0B803E */ lui $t3, %hi(cfb_16+0x2a800) # $t3, 0x803e -/* 04F1F4 7F01A6C4 256BA800 */ addiu $t3, %lo(cfb_16+0x2a800) # addiu $t3, $t3, -0x5800 -/* 04F1F8 7F01A6C8 144B0003 */ bne $v0, $t3, .L7F01A6D8 -/* 04F1FC 7F01A6CC 3C048003 */ lui $a0, %hi(ptr_menu_videobuffer) -/* 04F200 7F01A6D0 0C000F0F */ jal viSetFrameBuf2 -/* 04F204 7F01A6D4 8C84A954 */ lw $a0, %lo(ptr_menu_videobuffer)($a0) -.L7F01A6D8: -/* 04F208 7F01A6D8 3C018005 */ lui $at, %hi(D_80051B48) -/* 04F20C 7F01A6DC 0C001164 */ jal viSetAspect -/* 04F210 7F01A6E0 C42C1B44 */ lwc1 $f12, %lo(D_80051B44)($at) -/* 04F214 7F01A6E4 240401B8 */ li $a0, 440 -/* 04F218 7F01A6E8 0C0010FE */ jal viSetXY -/* 04F21C 7F01A6EC 2405014A */ li $a1, 330 -/* 04F220 7F01A6F0 240401B8 */ li $a0, 440 -/* 04F224 7F01A6F4 0C0010ED */ jal viSetBuf -/* 04F228 7F01A6F8 2405014A */ li $a1, 330 -/* 04F22C 7F01A6FC 240401B8 */ li $a0, 440 -/* 04F230 7F01A700 0FC26C77 */ jal set_cur_player_screen_size -/* 04F234 7F01A704 2405014A */ li $a1, 330 -/* 04F238 7F01A708 240401B8 */ li $a0, 440 -/* 04F23C 7F01A70C 0C00110F */ jal viSetViewSize -/* 04F240 7F01A710 2405014A */ li $a1, 330 -/* 04F244 7F01A714 00002025 */ move $a0, $zero -/* 04F248 7F01A718 0FC26C7E */ jal set_cur_player_viewport_size -/* 04F24C 7F01A71C 00002825 */ move $a1, $zero -/* 04F250 7F01A720 00002025 */ move $a0, $zero -/* 04F254 7F01A724 0C00112F */ jal viSetViewPosition -/* 04F258 7F01A728 00002825 */ move $a1, $zero -/* 04F25C 7F01A72C 10000015 */ b .L7F01A784 -/* 04F260 7F01A730 00000000 */ nop -.L7F01A734: -/* 04F264 7F01A734 0C001164 */ jal viSetAspect -/* 04F268 7F01A738 C42C1B48 */ lwc1 $f12, %lo(D_80051B48)($at) -/* 04F26C 7F01A73C 24040140 */ li $a0, 320 -/* 04F270 7F01A740 0C0010FE */ jal viSetXY -/* 04F274 7F01A744 240500F0 */ li $a1, 272 -/* 04F278 7F01A748 24040140 */ li $a0, 320 -/* 04F27C 7F01A74C 0C0010ED */ jal viSetBuf -/* 04F280 7F01A750 240500F0 */ li $a1, 272 -/* 04F284 7F01A754 24040140 */ li $a0, 320 -/* 04F288 7F01A758 0FC26C77 */ jal set_cur_player_screen_size -/* 04F28C 7F01A75C 240500F0 */ li $a1, 272 -/* 04F290 7F01A760 24040140 */ li $a0, 320 -/* 04F294 7F01A764 0C00110F */ jal viSetViewSize -/* 04F298 7F01A768 240500F0 */ li $a1, 272 -/* 04F29C 7F01A76C 00002025 */ move $a0, $zero -/* 04F2A0 7F01A770 0FC26C7E */ jal set_cur_player_viewport_size -/* 04F2A4 7F01A774 00002825 */ move $a1, $zero -/* 04F2A8 7F01A778 00002025 */ move $a0, $zero -/* 04F2AC 7F01A77C 0C00112F */ jal viSetViewPosition -/* 04F2B0 7F01A780 00002825 */ move $a1, $zero -.L7F01A784: -/* 04F2B4 7F01A784 3C028003 */ lui $v0, %hi(menu_update) -/* 04F2B8 7F01A788 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -/* 04F2BC 7F01A78C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F2C0 7F01A790 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F2C4 7F01A794 04410004 */ bgez $v0, .L7F01A7A8 -/* 04F2C8 7F01A798 3C0C8003 */ lui $t4, %hi(maybe_prev_menu) -/* 04F2CC 7F01A79C 8D8CA8C8 */ lw $t4, %lo(maybe_prev_menu)($t4) -/* 04F2D0 7F01A7A0 058000B7 */ bltz $t4, .L7F01AA80 -/* 04F2D4 7F01A7A4 00000000 */ nop -.L7F01A7A8: -/* 04F2D8 7F01A7A8 8C830000 */ lw $v1, ($a0) -/* 04F2DC 7F01A7AC 24010017 */ li $at, 23 -/* 04F2E0 7F01A7B0 106100B3 */ beq $v1, $at, .L7F01AA80 -/* 04F2E4 7F01A7B4 2C61001A */ sltiu $at, $v1, 0x1a -/* 04F2E8 7F01A7B8 102000AD */ beqz $at, .L7F01AA70 -/* 04F2EC 7F01A7BC 00036880 */ sll $t5, $v1, 2 -/* 04F2F0 7F01A7C0 3C018005 */ lui $at, %hi(jpt_menu_update) -/* 04F2F4 7F01A7C4 002D0821 */ addu $at, $at, $t5 -/* 04F2F8 7F01A7C8 8C2D1B4C */ lw $t5, %lo(jpt_menu_update)($at) -/* 04F2FC 7F01A7CC 01A00008 */ jr $t5 -/* 04F300 7F01A7D0 00000000 */ nop -menu_legal_screen_update: -/* 04F304 7F01A7D4 0FC029AC */ jal update_menu00_legalscreen -/* 04F308 7F01A7D8 00000000 */ nop -/* 04F30C 7F01A7DC 3C028003 */ lui $v0, %hi(menu_update) -/* 04F310 7F01A7E0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F314 7F01A7E4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F318 7F01A7E8 100000A1 */ b .L7F01AA70 -/* 04F31C 7F01A7EC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_nintendo_logo_update: -/* 04F320 7F01A7F0 0FC02B29 */ jal update_menu01_nintendo -/* 04F324 7F01A7F4 00000000 */ nop -/* 04F328 7F01A7F8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F32C 7F01A7FC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F330 7F01A800 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F334 7F01A804 1000009A */ b .L7F01AA70 -/* 04F338 7F01A808 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_rareware_logo_update: -/* 04F33C 7F01A80C 0FC02C29 */ jal update_menu02_rareware -/* 04F340 7F01A810 00000000 */ nop -/* 04F344 7F01A814 3C028003 */ lui $v0, %hi(menu_update) -/* 04F348 7F01A818 3C048003 */ lui $a0, %hi(current_menu) -/* 04F34C 7F01A81C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F350 7F01A820 10000093 */ b .L7F01AA70 -/* 04F354 7F01A824 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_eye_intro_update: -/* 04F358 7F01A828 0FC02C64 */ jal update_menu_03_eye -/* 04F35C 7F01A82C 00000000 */ nop -/* 04F360 7F01A830 3C028003 */ lui $v0, %hi(menu_update) -/* 04F364 7F01A834 3C048003 */ lui $a0, %hi(current_menu) -/* 04F368 7F01A838 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F36C 7F01A83C 1000008C */ b .L7F01AA70 -/* 04F370 7F01A840 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_goldeneye_logo_update: -/* 04F374 7F01A844 0FC02CC1 */ jal update_menu04_goldeneye -/* 04F378 7F01A848 00000000 */ nop -/* 04F37C 7F01A84C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F380 7F01A850 3C048003 */ lui $a0, %hi(current_menu) -/* 04F384 7F01A854 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F388 7F01A858 10000085 */ b .L7F01AA70 -/* 04F38C 7F01A85C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_file_select_update: -/* 04F390 7F01A860 0FC02EB8 */ jal update_menu05_filesel -/* 04F394 7F01A864 00000000 */ nop -/* 04F398 7F01A868 3C028003 */ lui $v0, %hi(menu_update) -/* 04F39C 7F01A86C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3A0 7F01A870 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3A4 7F01A874 1000007E */ b .L7F01AA70 -/* 04F3A8 7F01A878 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mode_select_update: -/* 04F3AC 7F01A87C 0FC034A4 */ jal update_menu06_modesel -/* 04F3B0 7F01A880 00000000 */ nop -/* 04F3B4 7F01A884 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3B8 7F01A888 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3BC 7F01A88C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3C0 7F01A890 10000077 */ b .L7F01AA70 -/* 04F3C4 7F01A894 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_select_update: -/* 04F3C8 7F01A898 0FC037AC */ jal update_menu07_missionsel -/* 04F3CC 7F01A89C 00000000 */ nop -/* 04F3D0 7F01A8A0 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3D4 7F01A8A4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3D8 7F01A8A8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3DC 7F01A8AC 10000070 */ b .L7F01AA70 -/* 04F3E0 7F01A8B0 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_difficulty_update: -/* 04F3E4 7F01A8B4 0FC039EE */ jal update_menu08_difficulty -/* 04F3E8 7F01A8B8 00000000 */ nop -/* 04F3EC 7F01A8BC 3C028003 */ lui $v0, %hi(menu_update) -/* 04F3F0 7F01A8C0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F3F4 7F01A8C4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F3F8 7F01A8C8 10000069 */ b .L7F01AA70 -/* 04F3FC 7F01A8CC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_007_options_update: -/* 04F400 7F01A8D0 0FC03CDB */ jal update_menu09_007options -/* 04F404 7F01A8D4 00000000 */ nop -/* 04F408 7F01A8D8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F40C 7F01A8DC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F410 7F01A8E0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F414 7F01A8E4 10000062 */ b .L7F01AA70 -/* 04F418 7F01A8E8 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_briefing_update: -/* 04F41C 7F01A8EC 0FC05590 */ jal update_menu0A_briefing -/* 04F420 7F01A8F0 00000000 */ nop -/* 04F424 7F01A8F4 3C028003 */ lui $v0, %hi(menu_update) -/* 04F428 7F01A8F8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F42C 7F01A8FC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F430 7F01A900 1000005B */ b .L7F01AA70 -/* 04F434 7F01A904 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_failed_update: -/* 04F438 7F01A908 0FC05842 */ jal update_menu0C_missionfailed -/* 04F43C 7F01A90C 00000000 */ nop -/* 04F440 7F01A910 3C028003 */ lui $v0, %hi(menu_update) -/* 04F444 7F01A914 3C048003 */ lui $a0, %hi(current_menu) -/* 04F448 7F01A918 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F44C 7F01A91C 10000054 */ b .L7F01AA70 -/* 04F450 7F01A920 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mission_complete_update: -/* 04F454 7F01A924 0FC059B4 */ jal update_menu0D_missioncomplete -/* 04F458 7F01A928 00000000 */ nop -/* 04F45C 7F01A92C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F460 7F01A930 3C048003 */ lui $a0, %hi(current_menu) -/* 04F464 7F01A934 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F468 7F01A938 1000004D */ b .L7F01AA70 -/* 04F46C 7F01A93C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_options_update: -/* 04F470 7F01A940 0FC04210 */ jal update_menu0E_mpoptions -/* 04F474 7F01A944 00000000 */ nop -/* 04F478 7F01A948 3C028003 */ lui $v0, %hi(menu_update) -/* 04F47C 7F01A94C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F480 7F01A950 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F484 7F01A954 10000046 */ b .L7F01AA70 -/* 04F488 7F01A958 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_scenario_select_update: -/* 04F48C 7F01A95C 0FC051EC */ jal update_menu13_mpscenario -/* 04F490 7F01A960 00000000 */ nop -/* 04F494 7F01A964 3C028003 */ lui $v0, %hi(menu_update) -/* 04F498 7F01A968 3C048003 */ lui $a0, %hi(current_menu) -/* 04F49C 7F01A96C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4A0 7F01A970 1000003F */ b .L7F01AA70 -/* 04F4A4 7F01A974 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_char_select_update: -/* 04F4A8 7F01A978 0FC047B3 */ jal update_menu0F_mpcharsel -/* 04F4AC 7F01A97C 00000000 */ nop -/* 04F4B0 7F01A980 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4B4 7F01A984 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4B8 7F01A988 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4BC 7F01A98C 10000038 */ b .L7F01AA70 -/* 04F4C0 7F01A990 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_teams_update: -/* 04F4C4 7F01A994 0FC05350 */ jal update_menu14_mpteams -/* 04F4C8 7F01A998 00000000 */ nop -/* 04F4CC 7F01A99C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4D0 7F01A9A0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4D4 7F01A9A4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4D8 7F01A9A8 10000031 */ b .L7F01AA70 -/* 04F4DC 7F01A9AC 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_handicap_update: -/* 04F4E0 7F01A9B0 0FC04BAF */ jal update_menu10_mphandicap -/* 04F4E4 7F01A9B4 00000000 */ nop -/* 04F4E8 7F01A9B8 3C028003 */ lui $v0, %hi(menu_update) -/* 04F4EC 7F01A9BC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F4F0 7F01A9C0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F4F4 7F01A9C4 1000002A */ b .L7F01AA70 -/* 04F4F8 7F01A9C8 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_control_style_update: -/* 04F4FC 7F01A9CC 0FC04D80 */ jal update_menu11_mpcontrols -/* 04F500 7F01A9D0 00000000 */ nop -/* 04F504 7F01A9D4 3C028003 */ lui $v0, %hi(menu_update) -/* 04F508 7F01A9D8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F50C 7F01A9DC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F510 7F01A9E0 10000023 */ b .L7F01AA70 -/* 04F514 7F01A9E4 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_mp_stage_select_update: -/* 04F518 7F01A9E8 0FC04F73 */ jal update_menu12_mpstage -/* 04F51C 7F01A9EC 00000000 */ nop -/* 04F520 7F01A9F0 3C028003 */ lui $v0, %hi(menu_update) -/* 04F524 7F01A9F4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F528 7F01A9F8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F52C 7F01A9FC 1000001C */ b .L7F01AA70 -/* 04F530 7F01AA00 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_cheat_update: -/* 04F534 7F01AA04 0FC05EFD */ jal update_menu15_cheat -/* 04F538 7F01AA08 00000000 */ nop -/* 04F53C 7F01AA0C 3C028003 */ lui $v0, %hi(menu_update) -/* 04F540 7F01AA10 3C048003 */ lui $a0, %hi(current_menu) -/* 04F544 7F01AA14 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F548 7F01AA18 10000015 */ b .L7F01AA70 -/* 04F54C 7F01AA1C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_no_controllers_update: -/* 04F550 7F01AA20 0FC06110 */ jal update_menu16_nocontrollers -/* 04F554 7F01AA24 00000000 */ nop -/* 04F558 7F01AA28 3C028003 */ lui $v0, %hi(menu_update) -/* 04F55C 7F01AA2C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F560 7F01AA30 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F564 7F01AA34 1000000E */ b .L7F01AA70 -/* 04F568 7F01AA38 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_display_cast_update: -/* 04F56C 7F01AA3C 0FC063C6 */ jal update_menu18_displaycast -/* 04F570 7F01AA40 00000000 */ nop -/* 04F574 7F01AA44 3C028003 */ lui $v0, %hi(menu_update) -/* 04F578 7F01AA48 3C048003 */ lui $a0, %hi(current_menu) -/* 04F57C 7F01AA4C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F580 7F01AA50 10000007 */ b .L7F01AA70 -/* 04F584 7F01AA54 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_spectrum_emu_update: -/* 04F588 7F01AA58 0FC06920 */ jal update_menu19_spectrum -/* 04F58C 7F01AA5C 00000000 */ nop -/* 04F590 7F01AA60 3C028003 */ lui $v0, %hi(menu_update) -/* 04F594 7F01AA64 3C048003 */ lui $a0, %hi(current_menu) -/* 04F598 7F01AA68 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F59C 7F01AA6C 8C42A8C4 */ lw $v0, %lo(menu_update)($v0) -menu_switch_screen_update: -.L7F01AA70: -/* 04F5A0 7F01AA70 04400003 */ bltz $v0, .L7F01AA80 -/* 04F5A4 7F01AA74 240E0017 */ li $t6, 23 -/* 04F5A8 7F01AA78 0FC02ABB */ jal reset_menutimer -/* 04F5AC 7F01AA7C AC8E0000 */ sw $t6, ($a0) -.L7F01AA80: -/* 04F5B0 7F01AA80 3C028003 */ lui $v0, %hi(maybe_prev_menu) -/* 04F5B4 7F01AA84 8C42A8C8 */ lw $v0, %lo(maybe_prev_menu)($v0) -/* 04F5B8 7F01AA88 3C048003 */ lui $a0, %hi(current_menu) -/* 04F5BC 7F01AA8C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -/* 04F5C0 7F01AA90 04400089 */ bltz $v0, .L7F01ACB8 -/* 04F5C4 7F01AA94 240FFFFF */ li $t7, -1 -/* 04F5C8 7F01AA98 AC820000 */ sw $v0, ($a0) -/* 04F5CC 7F01AA9C 3C018003 */ lui $at, %hi(maybe_prev_menu) -/* 04F5D0 7F01AAA0 AC2FA8C8 */ sw $t7, %lo(maybe_prev_menu)($at) -/* 04F5D4 7F01AAA4 8C980000 */ lw $t8, ($a0) -/* 04F5D8 7F01AAA8 2F01001A */ sltiu $at, $t8, 0x1a -/* 04F5DC 7F01AAAC 10200082 */ beqz $at, .L7F01ACB8 -/* 04F5E0 7F01AAB0 0018C080 */ sll $t8, $t8, 2 -/* 04F5E4 7F01AAB4 3C018005 */ lui $at, %hi(jpt_menu_init) -/* 04F5E8 7F01AAB8 00380821 */ addu $at, $at, $t8 -/* 04F5EC 7F01AABC 8C381BB4 */ lw $t8, %lo(jpt_menu_init)($at) -/* 04F5F0 7F01AAC0 03000008 */ jr $t8 -/* 04F5F4 7F01AAC4 00000000 */ nop -menu_legal_screen_init: -/* 04F5F8 7F01AAC8 0FC0297A */ jal init_menu00_legalscreen -/* 04F5FC 7F01AACC 00000000 */ nop -/* 04F600 7F01AAD0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F604 7F01AAD4 10000078 */ b .L7F01ACB8 -/* 04F608 7F01AAD8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_nintendo_logo_init: -/* 04F60C 7F01AADC 0FC02AF2 */ jal init_menu01_nintendo -/* 04F610 7F01AAE0 00000000 */ nop -/* 04F614 7F01AAE4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F618 7F01AAE8 10000073 */ b .L7F01ACB8 -/* 04F61C 7F01AAEC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_rareware_logo_init: -/* 04F620 7F01AAF0 0FC02C19 */ jal init_menu02_rarelogo -/* 04F624 7F01AAF4 00000000 */ nop -/* 04F628 7F01AAF8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F62C 7F01AAFC 1000006E */ b .L7F01ACB8 -/* 04F630 7F01AB00 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_eye_intro_init: -/* 04F634 7F01AB04 0FC02C55 */ jal init_menu03_eyeintro -/* 04F638 7F01AB08 00000000 */ nop -/* 04F63C 7F01AB0C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F640 7F01AB10 10000069 */ b .L7F01ACB8 -/* 04F644 7F01AB14 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_goldeneye_logo_init: -/* 04F648 7F01AB18 0FC02C96 */ jal init_menu04_goldeneyelogo -/* 04F64C 7F01AB1C 00000000 */ nop -/* 04F650 7F01AB20 3C048003 */ lui $a0, %hi(current_menu) -/* 04F654 7F01AB24 10000064 */ b .L7F01ACB8 -/* 04F658 7F01AB28 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_file_select_init: -/* 04F65C 7F01AB2C 0FC02E7A */ jal init_menu05_fileselect -/* 04F660 7F01AB30 00000000 */ nop -/* 04F664 7F01AB34 3C048003 */ lui $a0, %hi(current_menu) -/* 04F668 7F01AB38 1000005F */ b .L7F01ACB8 -/* 04F66C 7F01AB3C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mode_select_init: -/* 04F670 7F01AB40 0FC03494 */ jal init_menu06_modeselect -/* 04F674 7F01AB44 00000000 */ nop -/* 04F678 7F01AB48 3C048003 */ lui $a0, %hi(current_menu) -/* 04F67C 7F01AB4C 1000005A */ b .L7F01ACB8 -/* 04F680 7F01AB50 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_select_init: -/* 04F684 7F01AB54 0FC03794 */ jal init_menu07_missionselect -/* 04F688 7F01AB58 00000000 */ nop -/* 04F68C 7F01AB5C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F690 7F01AB60 10000055 */ b .L7F01ACB8 -/* 04F694 7F01AB64 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_difficulty_init: -/* 04F698 7F01AB68 0FC039E0 */ jal init_menu08_difficultyselect -/* 04F69C 7F01AB6C 00000000 */ nop -/* 04F6A0 7F01AB70 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6A4 7F01AB74 10000050 */ b .L7F01ACB8 -/* 04F6A8 7F01AB78 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_007_options_init: -/* 04F6AC 7F01AB7C 0FC03CC0 */ jal init_menu09_007difficultyselect -/* 04F6B0 7F01AB80 00000000 */ nop -/* 04F6B4 7F01AB84 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6B8 7F01AB88 1000004B */ b .L7F01ACB8 -/* 04F6BC 7F01AB8C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_briefing_init: -/* 04F6C0 7F01AB90 0FC0557D */ jal init_menu0A_briefing -/* 04F6C4 7F01AB94 00000000 */ nop -/* 04F6C8 7F01AB98 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6CC 7F01AB9C 10000046 */ b .L7F01ACB8 -/* 04F6D0 7F01ABA0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_runstage_init: -/* 04F6D4 7F01ABA4 0FC05819 */ jal init_menu0B_runstage -/* 04F6D8 7F01ABA8 00000000 */ nop -/* 04F6DC 7F01ABAC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6E0 7F01ABB0 10000041 */ b .L7F01ACB8 -/* 04F6E4 7F01ABB4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_failed_init: -/* 04F6E8 7F01ABB8 0FC05825 */ jal init_menu0C_missionfailed -/* 04F6EC 7F01ABBC 00000000 */ nop -/* 04F6F0 7F01ABC0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F6F4 7F01ABC4 1000003C */ b .L7F01ACB8 -/* 04F6F8 7F01ABC8 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mission_complete_init: -/* 04F6FC 7F01ABCC 0FC0599F */ jal init_menu0D_missioncomplete -/* 04F700 7F01ABD0 00000000 */ nop -/* 04F704 7F01ABD4 3C048003 */ lui $a0, %hi(current_menu) -/* 04F708 7F01ABD8 10000037 */ b .L7F01ACB8 -/* 04F70C 7F01ABDC 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_options_init: -/* 04F710 7F01ABE0 0FC041CF */ jal init_menu0E_mpoptions -/* 04F714 7F01ABE4 00000000 */ nop -/* 04F718 7F01ABE8 3C048003 */ lui $a0, %hi(current_menu) -/* 04F71C 7F01ABEC 10000032 */ b .L7F01ACB8 -/* 04F720 7F01ABF0 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_scenario_select_init: -/* 04F724 7F01ABF4 0FC051D9 */ jal init_menu13_mpscenariosel -/* 04F728 7F01ABF8 00000000 */ nop -/* 04F72C 7F01ABFC 3C048003 */ lui $a0, %hi(current_menu) -/* 04F730 7F01AC00 1000002D */ b .L7F01ACB8 -/* 04F734 7F01AC04 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_char_select_init: -/* 04F738 7F01AC08 0FC0470F */ jal init_menu0f_mpcharsel -/* 04F73C 7F01AC0C 00000000 */ nop -/* 04F740 7F01AC10 3C048003 */ lui $a0, %hi(current_menu) -/* 04F744 7F01AC14 10000028 */ b .L7F01ACB8 -/* 04F748 7F01AC18 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_teams_init: -/* 04F74C 7F01AC1C 0FC05330 */ jal init_menu14_mpteamsel -/* 04F750 7F01AC20 00000000 */ nop -/* 04F754 7F01AC24 3C048003 */ lui $a0, %hi(current_menu) -/* 04F758 7F01AC28 10000023 */ b .L7F01ACB8 -/* 04F75C 7F01AC2C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_handicap_init: -/* 04F760 7F01AC30 0FC04B8C */ jal init_menu10_mphandicap -/* 04F764 7F01AC34 00000000 */ nop -/* 04F768 7F01AC38 3C048003 */ lui $a0, %hi(current_menu) -/* 04F76C 7F01AC3C 1000001E */ b .L7F01ACB8 -/* 04F770 7F01AC40 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_control_style_init: -/* 04F774 7F01AC44 0FC04D5D */ jal init_menu11_mpcontrol -/* 04F778 7F01AC48 00000000 */ nop -/* 04F77C 7F01AC4C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F780 7F01AC50 10000019 */ b .L7F01ACB8 -/* 04F784 7F01AC54 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_mp_stage_select_init: -/* 04F788 7F01AC58 0FC04F5E */ jal init_menu12_mpstage -/* 04F78C 7F01AC5C 00000000 */ nop -/* 04F790 7F01AC60 3C048003 */ lui $a0, %hi(current_menu) -/* 04F794 7F01AC64 10000014 */ b .L7F01ACB8 -/* 04F798 7F01AC68 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_cheat_init: -/* 04F79C 7F01AC6C 0FC05ED4 */ jal init_menu15_cheat -/* 04F7A0 7F01AC70 00000000 */ nop -/* 04F7A4 7F01AC74 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7A8 7F01AC78 1000000F */ b .L7F01ACB8 -/* 04F7AC 7F01AC7C 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_no_controllers_init: -/* 04F7B0 7F01AC80 0FC0610E */ jal init_menu16_nocontroller -/* 04F7B4 7F01AC84 00000000 */ nop -/* 04F7B8 7F01AC88 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7BC 7F01AC8C 1000000A */ b .L7F01ACB8 -/* 04F7C0 7F01AC90 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_display_cast_init: -/* 04F7C4 7F01AC94 0FC061A7 */ jal init_menu18_displaycast -/* 04F7C8 7F01AC98 00000000 */ nop -/* 04F7CC 7F01AC9C 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7D0 7F01ACA0 10000005 */ b .L7F01ACB8 -/* 04F7D4 7F01ACA4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_spectrum_emu_init: -/* 04F7D8 7F01ACA8 0FC068E7 */ jal init_menu19_spectrum -/* 04F7DC 7F01ACAC 00000000 */ nop -/* 04F7E0 7F01ACB0 3C048003 */ lui $a0, %hi(current_menu) -/* 04F7E4 7F01ACB4 2484A8C0 */ addiu $a0, %lo(current_menu) # addiu $a0, $a0, -0x5740 -menu_switch_screens_init: -.L7F01ACB8: -/* 04F7E8 7F01ACB8 8C990000 */ lw $t9, ($a0) -/* 04F7EC 7F01ACBC 2F21001A */ sltiu $at, $t9, 0x1a -/* 04F7F0 7F01ACC0 1020008A */ beqz $at, .L7F01AEEC -/* 04F7F4 7F01ACC4 0019C880 */ sll $t9, $t9, 2 -/* 04F7F8 7F01ACC8 3C018005 */ lui $at, %hi(jpt_menu_interface) -/* 04F7FC 7F01ACCC 00390821 */ addu $at, $at, $t9 -/* 04F800 7F01ACD0 8C391C1C */ lw $t9, %lo(jpt_menu_interface)($at) -/* 04F804 7F01ACD4 03200008 */ jr $t9 -/* 04F808 7F01ACD8 00000000 */ nop -menu00_legal_interface: -/* 04F80C 7F01ACDC 0FC029B7 */ jal interface_menu00_legalscreen -/* 04F810 7F01ACE0 00000000 */ nop -/* 04F814 7F01ACE4 10000082 */ b .L7F01AEF0 -/* 04F818 7F01ACE8 8FBF0014 */ lw $ra, 0x14($sp) -menu17_switchscreen_interface: -/* 04F81C 7F01ACEC 0FC02AC0 */ jal interface_menu17_switchscreens -/* 04F820 7F01ACF0 00000000 */ nop -/* 04F824 7F01ACF4 1000007E */ b .L7F01AEF0 -/* 04F828 7F01ACF8 8FBF0014 */ lw $ra, 0x14($sp) -menu01_nintendo_interface: -/* 04F82C 7F01ACFC 0FC02B32 */ jal interface_menu01_nintendo -/* 04F830 7F01AD00 00000000 */ nop -/* 04F834 7F01AD04 1000007A */ b .L7F01AEF0 -/* 04F838 7F01AD08 8FBF0014 */ lw $ra, 0x14($sp) -menu02_rareware_interface: -/* 04F83C 7F01AD0C 0FC02C2B */ jal interface_menu02_rareware -/* 04F840 7F01AD10 00000000 */ nop -/* 04F844 7F01AD14 10000076 */ b .L7F01AEF0 -/* 04F848 7F01AD18 8FBF0014 */ lw $ra, 0x14($sp) -menu03_eye_interface: -/* 04F84C 7F01AD1C 0FC02C6C */ jal interface_menu03_eye -/* 04F850 7F01AD20 00000000 */ nop -/* 04F854 7F01AD24 10000072 */ b .L7F01AEF0 -/* 04F858 7F01AD28 8FBF0014 */ lw $ra, 0x14($sp) -menu04_goldeneye_interface: -/* 04F85C 7F01AD2C 0FC02CCC */ jal interface_menu04_goldeneyelogo -/* 04F860 7F01AD30 00000000 */ nop -/* 04F864 7F01AD34 1000006E */ b .L7F01AEF0 -/* 04F868 7F01AD38 8FBF0014 */ lw $ra, 0x14($sp) -menu05_filesel_interface: -/* 04F86C 7F01AD3C 0FC02EF3 */ jal interface_menu05_fileselect -/* 04F870 7F01AD40 00000000 */ nop -/* 04F874 7F01AD44 1000006A */ b .L7F01AEF0 -/* 04F878 7F01AD48 8FBF0014 */ lw $ra, 0x14($sp) -menu06_modesel_interface: -/* 04F87C 7F01AD4C 0FC034A6 */ jal interface_menu06_modesel -/* 04F880 7F01AD50 00000000 */ nop -/* 04F884 7F01AD54 10000066 */ b .L7F01AEF0 -/* 04F888 7F01AD58 8FBF0014 */ lw $ra, 0x14($sp) -menu07_missionsel_interface: -/* 04F88C 7F01AD5C 0FC037AE */ jal interface_menu07_missionsel -/* 04F890 7F01AD60 00000000 */ nop -/* 04F894 7F01AD64 10000062 */ b .L7F01AEF0 -/* 04F898 7F01AD68 8FBF0014 */ lw $ra, 0x14($sp) -menu08_difficulty_interface: -/* 04F89C 7F01AD6C 0FC039F0 */ jal interface_menu08_difficulty -/* 04F8A0 7F01AD70 00000000 */ nop -/* 04F8A4 7F01AD74 1000005E */ b .L7F01AEF0 -/* 04F8A8 7F01AD78 8FBF0014 */ lw $ra, 0x14($sp) -menu09_007options_interface: -/* 04F8AC 7F01AD7C 0FC03CDD */ jal interface_menu09_007options -/* 04F8B0 7F01AD80 00000000 */ nop -/* 04F8B4 7F01AD84 1000005A */ b .L7F01AEF0 -/* 04F8B8 7F01AD88 8FBF0014 */ lw $ra, 0x14($sp) -menu0A_briefing_interface: -/* 04F8BC 7F01AD8C 0FC055A7 */ jal interface_menu0A_briefing -/* 04F8C0 7F01AD90 00000000 */ nop -/* 04F8C4 7F01AD94 10000056 */ b .L7F01AEF0 -/* 04F8C8 7F01AD98 8FBF0014 */ lw $ra, 0x14($sp) -menu0C_missionfailed_interface: -/* 04F8CC 7F01AD9C 0FC05844 */ jal interface_menu0C_missionfailed -/* 04F8D0 7F01ADA0 00000000 */ nop -/* 04F8D4 7F01ADA4 10000052 */ b .L7F01AEF0 -/* 04F8D8 7F01ADA8 8FBF0014 */ lw $ra, 0x14($sp) -menu0D_missioncomplete_interface: -/* 04F8DC 7F01ADAC 0FC059B6 */ jal interface_menu0D_missioncomplete -/* 04F8E0 7F01ADB0 00000000 */ nop -/* 04F8E4 7F01ADB4 1000004E */ b .L7F01AEF0 -/* 04F8E8 7F01ADB8 8FBF0014 */ lw $ra, 0x14($sp) -menu0E_mpoptions_interface: -/* 04F8EC 7F01ADBC 0FC04212 */ jal interface_menu0E_mpoptions -/* 04F8F0 7F01ADC0 00000000 */ nop -/* 04F8F4 7F01ADC4 1000004A */ b .L7F01AEF0 -/* 04F8F8 7F01ADC8 8FBF0014 */ lw $ra, 0x14($sp) -menu13_mpscenario_interface: -/* 04F8FC 7F01ADCC 0FC051EE */ jal interface_menu13_mpscenario -/* 04F900 7F01ADD0 00000000 */ nop -/* 04F904 7F01ADD4 10000046 */ b .L7F01AEF0 -/* 04F908 7F01ADD8 8FBF0014 */ lw $ra, 0x14($sp) -menu0F_mpcharsel_interface: -/* 04F90C 7F01ADDC 0FC047B5 */ jal interface_menu0F_mpcharsel -/* 04F910 7F01ADE0 00000000 */ nop -/* 04F914 7F01ADE4 10000042 */ b .L7F01AEF0 -/* 04F918 7F01ADE8 8FBF0014 */ lw $ra, 0x14($sp) -menu14_mpteams_interface: -/* 04F91C 7F01ADEC 0FC05352 */ jal interface_menu14_mpteams -/* 04F920 7F01ADF0 00000000 */ nop -/* 04F924 7F01ADF4 1000003E */ b .L7F01AEF0 -/* 04F928 7F01ADF8 8FBF0014 */ lw $ra, 0x14($sp) -menu10_mphandicap_interface: -/* 04F92C 7F01ADFC 0FC04BB1 */ jal interface_menu10_mphandicap -/* 04F930 7F01AE00 00000000 */ nop -/* 04F934 7F01AE04 1000003A */ b .L7F01AEF0 -/* 04F938 7F01AE08 8FBF0014 */ lw $ra, 0x14($sp) -menu11_mpcontrol_interface: -/* 04F93C 7F01AE0C 0FC04D82 */ jal interface_menu11_mpcontrols -/* 04F940 7F01AE10 00000000 */ nop -/* 04F944 7F01AE14 10000036 */ b .L7F01AEF0 -/* 04F948 7F01AE18 8FBF0014 */ lw $ra, 0x14($sp) -menu12_mpstage_interface: -/* 04F94C 7F01AE1C 0FC04F75 */ jal interface_menu12_mpstage -/* 04F950 7F01AE20 00000000 */ nop -/* 04F954 7F01AE24 10000032 */ b .L7F01AEF0 -/* 04F958 7F01AE28 8FBF0014 */ lw $ra, 0x14($sp) -menu15_cheat_interface: -/* 04F95C 7F01AE2C 0FC05F22 */ jal interface_menu15_cheat -/* 04F960 7F01AE30 00000000 */ nop -/* 04F964 7F01AE34 1000002E */ b .L7F01AEF0 -/* 04F968 7F01AE38 8FBF0014 */ lw $ra, 0x14($sp) -menu16_nocontrollers_interface: -/* 04F96C 7F01AE3C 0FC06112 */ jal interface_menu16_nocontrollers -/* 04F970 7F01AE40 00000000 */ nop -/* 04F974 7F01AE44 1000002A */ b .L7F01AEF0 -/* 04F978 7F01AE48 8FBF0014 */ lw $ra, 0x14($sp) -menu18_displaycast_interface: -/* 04F97C 7F01AE4C 0FC063D8 */ jal interface_menu18_displaycast -/* 04F980 7F01AE50 00000000 */ nop -/* 04F984 7F01AE54 10000026 */ b .L7F01AEF0 -/* 04F988 7F01AE58 8FBF0014 */ lw $ra, 0x14($sp) -menu19_spectrum_interface: -/* 04F98C 7F01AE5C 0FC06922 */ jal interface_menu19_spectrum -/* 04F990 7F01AE60 00000000 */ nop -/* 04F994 7F01AE64 10000022 */ b .L7F01AEF0 -/* 04F998 7F01AE68 8FBF0014 */ lw $ra, 0x14($sp) -menu0B_runstage_interface: -/* 04F99C 7F01AE6C 0FC2FF29 */ jal interface_menu0B_runstage -/* 04F9A0 7F01AE70 00000000 */ nop -/* 04F9A4 7F01AE74 10400006 */ beqz $v0, .L7F01AE90 -/* 04F9A8 7F01AE78 3C088003 */ lui $t0, %hi(gamemode) -/* 04F9AC 7F01AE7C 00002025 */ move $a0, $zero -/* 04F9B0 7F01AE80 0FC06975 */ jal set_menu_to_mode -/* 04F9B4 7F01AE84 24050001 */ li $a1, 1 -/* 04F9B8 7F01AE88 10000019 */ b .L7F01AEF0 -/* 04F9BC 7F01AE8C 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AE90: -/* 04F9C0 7F01AE90 8D08A8F0 */ lw $t0, %lo(gamemode)($t0) -/* 04F9C4 7F01AE94 24010001 */ li $at, 1 -/* 04F9C8 7F01AE98 2404000E */ li $a0, 14 -/* 04F9CC 7F01AE9C 15010005 */ bne $t0, $at, .L7F01AEB4 -/* 04F9D0 7F01AEA0 3C098003 */ lui $t1, %hi(selected_stage) -/* 04F9D4 7F01AEA4 0FC06975 */ jal set_menu_to_mode -/* 04F9D8 7F01AEA8 24050001 */ li $a1, 1 -/* 04F9DC 7F01AEAC 10000010 */ b .L7F01AEF0 -/* 04F9E0 7F01AEB0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEB4: -/* 04F9E4 7F01AEB4 8D29A8F4 */ lw $t1, %lo(selected_stage)($t1) -/* 04F9E8 7F01AEB8 24010036 */ li $at, 54 -/* 04F9EC 7F01AEBC 2404000C */ li $a0, 12 -/* 04F9F0 7F01AEC0 15210008 */ bne $t1, $at, .L7F01AEE4 -/* 04F9F4 7F01AEC4 00000000 */ nop -/* 04F9F8 7F01AEC8 0FC0619C */ jal do_extended_cast_display -/* 04F9FC 7F01AECC 24040001 */ li $a0, 1 -/* 04FA00 7F01AED0 24040018 */ li $a0, 24 -/* 04FA04 7F01AED4 0FC06975 */ jal set_menu_to_mode -/* 04FA08 7F01AED8 24050001 */ li $a1, 1 -/* 04FA0C 7F01AEDC 10000004 */ b .L7F01AEF0 -/* 04FA10 7F01AEE0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEE4: -/* 04FA14 7F01AEE4 0FC06975 */ jal set_menu_to_mode -/* 04FA18 7F01AEE8 24050001 */ li $a1, 1 -.L7F01AEEC: -/* 04FA1C 7F01AEEC 8FBF0014 */ lw $ra, 0x14($sp) -.L7F01AEF0: -/* 04FA20 7F01AEF0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 04FA24 7F01AEF4 03E00008 */ jr $ra -/* 04FA28 7F01AEF8 00000000 */ nop -) -#endif -#endif diff --git a/src/game/front.h b/src/game/front.h index 1f5effbe..2488fef3 100644 --- a/src/game/front.h +++ b/src/game/front.h @@ -7,8 +7,8 @@ struct legal_screen_text { s32 h_pos; s32 v_pos; - s32 flag; - s32 flag2; + s32 halign; + s32 valign; u16 txtID; u16 anonymous_5; }; @@ -39,7 +39,7 @@ struct mp_stage_playercount { struct mp_stage_setup { u16 folder_text_preset; - s16 select_screen_text_preset; + u16 select_screen_text_preset; s32 photo; s32 stage_id; s32 unlock_after; @@ -48,25 +48,25 @@ struct mp_stage_setup { }; struct MP_selectable_chars { - short text_preset; - char gender; - char select_photo; + u16 text_preset; + u8 gender; + u8 select_photo; short body; short head; float pov; }; struct MP_handicap_menu { - short text_preset; - short padding; + u16 text_preset; + u16 padding; float damage_modifier; }; struct MP_controller_configuration_menu { - u16 anonymous_0; + u16 text_preset; //char field_1; - char field_2; - char field_3; + u8 field_2; + u8 field_3; }; struct MP_sight_aim_settings { @@ -76,8 +76,8 @@ struct MP_sight_aim_settings { }; struct intro_char { - int body; - int head; + enum BODIES body; + enum HEADS head; short text1; short text2; short text3; @@ -119,40 +119,24 @@ extern f32 flt_CODE_bss_800695BC; extern f32 flt_CODE_bss_800695C0; //CODE.bss:800695C4 .align 3 //CODE.bss:800695C8 -extern f32 flt_CODE_bss_800695C8; -//CODE.bss:800695CC -extern f32 flt_CODE_bss_800695CC; -//CODE.bss:800695D0 -extern f32 flt_CODE_bss_800695D0; +extern struct coord3d flt_CODE_bss_800695C8; //CODE.bss:800695D4 .align 3 //CODE.bss:800695D8 -extern f32 flt_CODE_bss_800695D8; -//CODE.bss:800695DC -extern f32 flt_CODE_bss_800695DC; -//CODE.bss:800695E0 -extern f32 flt_CODE_bss_800695E0; +extern struct coord3d flt_CODE_bss_800695D8; + //CODE.bss:800695E4 -extern f32 flt_CODE_bss_800695E4; +extern s32 bss_800695E4; + //CODE.bss:800695E8 -extern f32 flt_CODE_bss_800695E8; -//CODE.bss:800695EC -extern f32 flt_CODE_bss_800695EC; -//CODE.bss:800695F0 -extern f32 flt_CODE_bss_800695F0; +extern struct coord3d flt_CODE_bss_800695E8; + //CODE.bss:800695F4 .align 3 //CODE.bss:800695F8 -extern f32 flt_CODE_bss_800695F8; -//CODE.bss:800695FC -extern f32 flt_CODE_bss_800695FC; -//CODE.bss:80069600 -extern f32 flt_CODE_bss_80069600; +extern struct coord3d flt_CODE_bss_800695F8; //CODE.bss:80069604 .align 3 //CODE.bss:80069608 -extern f32 flt_CODE_bss_80069608; -//CODE.bss:8006960C -extern f32 flt_CODE_bss_8006960C; -//CODE.bss:80069610 -extern f32 flt_CODE_bss_80069610; +extern struct coord3d flt_CODE_bss_80069608; + //CODE.bss:80069614 extern f32 ninLogoRotRate; //CODE.bss:80069618 @@ -181,13 +165,7 @@ extern s32 dword_CODE_bss_80069730[4]; //CODE.bss:80069740 extern s32 player_has_selected_char[]; //CODE.bss:80069750 -extern s32 size_mp_select_image_player1; -//CODE.bss:80069754 -extern s32 size_mp_select_image_player2; -//CODE.bss:80069758 -extern s32 size_mp_select_image_player3; -//CODE.bss:8006975C -extern s32 size_mp_select_image_player4; +extern s32 size_mp_select_image_player[]; //CODE.bss:80069760 extern s32 player_handicap[]; //CODE.bss:80069770 @@ -220,7 +198,7 @@ extern s32 highlight_enemy_damage; //CODE.bss:800697A8 extern s32 player_handicap[]; //CODE.bss:800697B8 -extern u32 controlstyle_player[]; +extern s32 controlstyle_player[]; //CODE.bss:800697C8 @@ -287,21 +265,12 @@ extern s32 screen_size; extern s32 spectrum_related_flag; extern s32 is_emulating_spectrum; extern s32 is_cheat_menu_available; -extern Gfx * ptr_logo_and_walletbond_DL; +extern u8 * ptr_logo_and_walletbond_DL; extern s32 ptr_menu_videobuffer; extern Model * walletinst[]; -extern struct rgba_u8 RGBA_8002A970; -extern struct rgba_u8 RGBA_8002A974; -extern struct rgba_u8 RGBA_8002A978; -extern struct rgba_u8 RGBA_8002A97C; -extern struct rgba_u8 RGBA_8002A980; -extern struct rgba_u8 RGBA_8002A984; -extern struct rgba_u8 RGBA_8002A988; -extern struct rgba_u8 RGBA_8002A98C; -extern u32 dword_D_8002A990; -extern u32 dword_D_8002A994; -extern u32 dword_D_8002A998; -extern u32 dword_D_8002A99C; +extern Lights1 gelogolight; +extern Lights1 ninlogolight; + extern f32 slider_007_mode_reaction; extern f32 slider_007_mode_health; extern f32 slider_007_mode_damage; @@ -325,14 +294,14 @@ extern s32 unlock_control_style; extern s32 unlock_aim_sight; extern s16 solo_target_time_array[20][3]; -extern u32 intro_character_index; +extern s32 intro_character_index; extern u32 randomly_selected_intro_animation; extern u32 intro_animation_count; -extern u32 objinstance; -extern u32 ptrobjinstance; +extern struct Model *cast_model; +extern struct Model *cast_model_weapon; extern u32 full_actor_intro; -void set_menu_to_mode(MENU menu, s32 mode); +void frontChangeMenu(MENU menu, s32 reload); s32 get_selected_num_players(void); void do_extended_cast_display(s32 flag); MPSCENARIOS get_scenario(void); diff --git a/src/game/game_debug.c b/src/game/game_debug.c index b6f72a26..f1ce3658 100644 --- a/src/game/game_debug.c +++ b/src/game/game_debug.c @@ -8,19 +8,19 @@ //D:8004EAE0 s32 D_8004EAE0[] = {0, 0, 0, 0}; -void gameInitDebugNoticeList(void) { +void gameInit(void) { debTryAdd(&D_8004EAE0, "game_c_debug"); } void reset_mem_bank_5(void) { obBlankResourcesInBank5(); - mempResetBank(5); - obBlankResourcesLoadedInBank(5); + mempResetBank(MEMPOOL_ME); + obBlankResourcesLoadedInBank(MEMPOOL_ME); } void sub_GAME_7F0D1A7C(void) { - mempNullNextEntryInBank(5); - obBlankResourcesLoadedInBank(5); + mempNullNextEntryInBank(MEMPOOL_ME); + obBlankResourcesLoadedInBank(MEMPOOL_ME); } diff --git a/src/game/game_debug.h b/src/game/game_debug.h index be83cc7c..1e66614f 100644 --- a/src/game/game_debug.h +++ b/src/game/game_debug.h @@ -2,7 +2,7 @@ #define _GAME_DEBUG_H_ #include -void gameInitDebugNoticeList(void); +void gameInit(void); void reset_mem_bank_5(void); void sub_GAME_7F0D1A7C(void); diff --git a/src/game/gun.c b/src/game/gun.c index ee72cc34..e857c47c 100644 --- a/src/game/gun.c +++ b/src/game/gun.c @@ -25,6 +25,8 @@ #include "unk_0CC4C0.h" #include "debugmenu_handler.h" #include "fr.h" +#include "assets/obseg/text/LgunE.h" +#include "textrelated.h" // bss s32 dword_CODE_bss_80075DB0; @@ -41,30 +43,39 @@ s32 dword_CODE_bss_80076A48; #define THROWN_ITEM_TIMER_SOLO 250 #define THROWN_ITEM_TIMER_MULTI 150 #define THROWN_ITEM_TIMER_DEFAULT 200 + #define DUAL_WIELD_TRIGGER_SWAP_TICKS 24 + #define DUAL_WIELD_SINGLE_TRIGGER_SWAP_TICKS 36 + #define WATCH_SOUND_DURATION_TICKS 250 #else /* NTSC */ #define THROWN_ITEM_REFRESH_RATE 60 #define THROWN_ITEM_TIMER_SOLO 300 #define THROWN_ITEM_TIMER_MULTI 180 #define THROWN_ITEM_TIMER_DEFAULT 240 + #define DUAL_WIELD_TRIGGER_SWAP_TICKS 20 + #define DUAL_WIELD_SINGLE_TRIGGER_SWAP_TICKS 30 + #define WATCH_SOUND_DURATION_TICKS 300 #endif + -// data -//D:80032440 -rgba_u8 D_80032440[] = { - {0x96, 0x96, 0x96, 0}, - {0x96, 0x96, 0x96, 0} -}; -//D:80032448 -rgba_u8 D_80032448[] = { - {0xFF, 0xFF, 0xFF, 0}, - {0xFF, 0xFF, 0xFF, 0}, - {0xB2, 0x4D, 0x2E, 0} -}; +// data +////D:80032440 +//rgba_u8 D_80032440[] = { +// {0x96, 0x96, 0x96, 0}, +// {0x96, 0x96, 0x96, 0} +//}; +// +////D:80032448 +//rgba_u8 D_80032448[] = { +// {0xFF, 0xFF, 0xFF, 0}, +// {0xFF, 0xFF, 0xFF, 0}, +// {0xB2, 0x4D, 0x2E, 0} +//}; +Lights1 D_80032440 = gdSPDefLights1(0x96, 0x96, 0x96, 0xff, 0xff, 0xff, 0xb2, 0x4d, 0x2e); //D:80032454 -u32 D_80032454 = 0; +//u32 D_80032454 = 0; //D:80032458 u32 D_80032458 = 0; @@ -522,9 +533,9 @@ u16 D_80035E90[] = { RICO_LASER2_SFX, RICO_LASER3_SFX }; //D:80035E94 u16 D_80035E94[] = { KNIFE_THROW1_SFX, KNIFE_THROW2_SFX, KNIFE_THROW3_SFX, 0 }; //D:80035E9C -u32 D_80035E9C = 0; +struct unkown_gun_struct D_80035E9C = { 0, 0 }; //D:80035EA0 -u32 D_80035EA0 = 0; +//u32 D_80035EA0 = 0; //D:80035EA4 u32 D_80035EA4 = 0; //D:80035EA8 @@ -585,7 +596,7 @@ u32 D_80036060 = 0; // forward declarations -void sub_GAME_7F0681CC(coord3d* arg0, coord3d* arg1, enum GUNHAND arg2); +void bullet_path_from_screen_center(coord3d* arg0, coord3d* arg1, enum GUNHAND arg2); void sub_GAME_7F05EC1C(struct WeaponObjectRecord *arg0, struct coord3d *arg1, Mtxf *arg2, struct coord3d *arg3, s32 *arg4); // end forward declarations @@ -868,50 +879,11 @@ void bgunCalculateBlend(enum GUNHAND handnum) } -#if defined(VERSION_US) || defined(VERSION_JP) s32 Gun_hand_without_item(enum GUNHAND arg0) { return g_CurrentPlayer->hand_invisible[arg0] > 0 || (g_CurrentPlayer->hand_item[arg0] == 0 && g_CurrentPlayer->field_2A44[arg0] < 0); } -#endif - -#if defined(VERSION_EU) - -#ifdef NONMATCHING -s32 Gun_hand_without_item(enum GUNHAND arg0) -{ - return g_CurrentPlayer->hand_invisible[arg0] > 0 - || (g_CurrentPlayer->hand_item[arg0] == 0 && g_CurrentPlayer->field_2A3C[arg0] < 0); -} -#else -GLOBAL_ASM( -.text -glabel Gun_hand_without_item -/* 08FD5C 7F05D36C 3C0E8007 */ lui $t6, %hi(g_CurrentPlayer) # $t6, 0x8007 -/* 08FD60 7F05D370 8DCE8BC0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 08FD64 7F05D374 00047880 */ sll $t7, $a0, 2 -/* 08FD68 7F05D378 01CF1821 */ addu $v1, $t6, $t7 -/* 08FD6C 7F05D37C 8C6207F8 */ lw $v0, 0x7f8($v1) -/* 08FD70 7F05D380 0002C02A */ slt $t8, $zero, $v0 -/* 08FD74 7F05D384 17000008 */ bnez $t8, .L7F05D3A8 -/* 08FD78 7F05D388 03001025 */ move $v0, $t8 -/* 08FD7C 7F05D38C 8C620800 */ lw $v0, 0x800($v1) -/* 08FD80 7F05D390 2C590001 */ sltiu $t9, $v0, 1 -/* 08FD84 7F05D394 13200004 */ beqz $t9, .L7F05D3A8 -/* 08FD88 7F05D398 03201025 */ move $v0, $t9 -/* 08FD8C 7F05D39C 8C622A3C */ lw $v0, 0x2a3c($v1) -/* 08FD90 7F05D3A0 28480000 */ slti $t0, $v0, 0 -/* 08FD94 7F05D3A4 01001025 */ move $v0, $t0 -.L7F05D3A8: -/* 08FD98 7F05D3A8 03E00008 */ jr $ra -/* 08FD9C 7F05D3AC 00000000 */ nop -) -#endif - -#endif - - s32 get_itemtype_in_hand(GUNHAND hand) { @@ -1050,104 +1022,33 @@ void used_to_load_1st_person_model_on_demand(enum GUNHAND arg0) } -#ifdef NONMATCHING -enum ITEM_IDS sub_GAME_7F05D334(enum ITEM_IDS arg0, s32 arg1) { - s32 i; - for (i = arg1; i > 0; i--) { - do { - arg0 = (arg0 + 1) % 33; - } while (bondinvItemAvailable(arg0) == 0); +ITEM_IDS sub_GAME_7F05D334(ITEM_IDS item, s32 arg1) +{ + while (arg1 > 0) + { + do + { + item = (item + 1) % ITEM_BOMBCASE; + } while (bondinvItemAvailable(item) == 0); + arg1--; } - for (; i < 0; i++) { - do { - arg0--; - if (arg0 < 0) { - arg0 = 0x20 - ((-1 - arg0) % 33); + while (arg1 < 0) + { + do + { + item--; + if (item < 0) + { + item = 0x20 - (-(item + 1) % ITEM_BOMBCASE); } - } while (bondinvItemAvailable(arg0) == 0); + } while (bondinvItemAvailable(item) == 0); + arg1++; } - return arg0; + return item; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05D334 -/* 091E64 7F05D334 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 091E68 7F05D338 AFB30020 */ sw $s3, 0x20($sp) -/* 091E6C 7F05D33C AFB00014 */ sw $s0, 0x14($sp) -/* 091E70 7F05D340 00808025 */ move $s0, $a0 -/* 091E74 7F05D344 00A09825 */ move $s3, $a1 -/* 091E78 7F05D348 AFBF0024 */ sw $ra, 0x24($sp) -/* 091E7C 7F05D34C AFB2001C */ sw $s2, 0x1c($sp) -/* 091E80 7F05D350 18A00016 */ blez $a1, .L7F05D3AC -/* 091E84 7F05D354 AFB10018 */ sw $s1, 0x18($sp) -/* 091E88 7F05D358 24110021 */ li $s1, 33 -/* 091E8C 7F05D35C 260E0001 */ addiu $t6, $s0, 1 -.L7F05D360: -/* 091E90 7F05D360 01D1001A */ div $zero, $t6, $s1 -/* 091E94 7F05D364 00008010 */ mfhi $s0 -/* 091E98 7F05D368 02002025 */ move $a0, $s0 -/* 091E9C 7F05D36C 16200002 */ bnez $s1, .L7F05D378 -/* 091EA0 7F05D370 00000000 */ nop -/* 091EA4 7F05D374 0007000D */ break 7 -.L7F05D378: -/* 091EA8 7F05D378 2401FFFF */ li $at, -1 -/* 091EAC 7F05D37C 16210004 */ bne $s1, $at, .L7F05D390 -/* 091EB0 7F05D380 3C018000 */ lui $at, 0x8000 -/* 091EB4 7F05D384 15C10002 */ bne $t6, $at, .L7F05D390 -/* 091EB8 7F05D388 00000000 */ nop -/* 091EBC 7F05D38C 0006000D */ break 6 -.L7F05D390: -/* 091EC0 7F05D390 0FC230F0 */ jal bondinvItemAvailable -/* 091EC4 7F05D394 00000000 */ nop -/* 091EC8 7F05D398 5040FFF1 */ beql $v0, $zero, .L7F05D360 -/* 091ECC 7F05D39C 260E0001 */ addiu $t6, $s0, 1 -/* 091ED0 7F05D3A0 2673FFFF */ addiu $s3, $s3, -1 -/* 091ED4 7F05D3A4 5E60FFEE */ bgtzl $s3, .L7F05D360 -/* 091ED8 7F05D3A8 260E0001 */ addiu $t6, $s0, 1 -.L7F05D3AC: -/* 091EDC 7F05D3AC 06610019 */ bgez $s3, .L7F05D414 -/* 091EE0 7F05D3B0 24110021 */ li $s1, 33 -/* 091EE4 7F05D3B4 24120020 */ li $s2, 32 -/* 091EE8 7F05D3B8 2610FFFF */ addiu $s0, $s0, -1 -.L7F05D3BC: -/* 091EEC 7F05D3BC 0601000E */ bgez $s0, .L7F05D3F8 -/* 091EF0 7F05D3C0 240FFFFF */ li $t7, -1 -/* 091EF4 7F05D3C4 01F0C023 */ subu $t8, $t7, $s0 -/* 091EF8 7F05D3C8 0311001A */ div $zero, $t8, $s1 -/* 091EFC 7F05D3CC 0000C810 */ mfhi $t9 -/* 091F00 7F05D3D0 02598023 */ subu $s0, $s2, $t9 -/* 091F04 7F05D3D4 16200002 */ bnez $s1, .L7F05D3E0 -/* 091F08 7F05D3D8 00000000 */ nop -/* 091F0C 7F05D3DC 0007000D */ break 7 -.L7F05D3E0: -/* 091F10 7F05D3E0 2401FFFF */ li $at, -1 -/* 091F14 7F05D3E4 16210004 */ bne $s1, $at, .L7F05D3F8 -/* 091F18 7F05D3E8 3C018000 */ lui $at, 0x8000 -/* 091F1C 7F05D3EC 17010002 */ bne $t8, $at, .L7F05D3F8 -/* 091F20 7F05D3F0 00000000 */ nop -/* 091F24 7F05D3F4 0006000D */ break 6 -.L7F05D3F8: -/* 091F28 7F05D3F8 0FC230F0 */ jal bondinvItemAvailable -/* 091F2C 7F05D3FC 02002025 */ move $a0, $s0 -/* 091F30 7F05D400 5040FFEE */ beql $v0, $zero, .L7F05D3BC -/* 091F34 7F05D404 2610FFFF */ addiu $s0, $s0, -1 -/* 091F38 7F05D408 26730001 */ addiu $s3, $s3, 1 -/* 091F3C 7F05D40C 0662FFEB */ bltzl $s3, .L7F05D3BC -/* 091F40 7F05D410 2610FFFF */ addiu $s0, $s0, -1 -.L7F05D414: -/* 091F44 7F05D414 8FBF0024 */ lw $ra, 0x24($sp) -/* 091F48 7F05D418 02001025 */ move $v0, $s0 -/* 091F4C 7F05D41C 8FB00014 */ lw $s0, 0x14($sp) -/* 091F50 7F05D420 8FB10018 */ lw $s1, 0x18($sp) -/* 091F54 7F05D424 8FB2001C */ lw $s2, 0x1c($sp) -/* 091F58 7F05D428 8FB30020 */ lw $s3, 0x20($sp) -/* 091F5C 7F05D42C 03E00008 */ jr $ra -/* 091F60 7F05D430 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif + ITEM_IDS get_next_weapon_in_cycle_for_hand(GUNHAND hand, s32 direction) { @@ -1423,7 +1324,7 @@ f32 get_item_in_hand_zoom(void) { return get_ptr_item_statistics(get_item_in_hand_or_watch_menu(GUNRIGHT))->Zoom; } -void camera_sniper_zoom_in(f32 zoom) +void camera_sniper_zoom_out(f32 zoom) { if (get_item_in_hand_or_watch_menu(GUNRIGHT) == ITEM_SNIPERRIFLE) { g_CurrentPlayer->sniper_zoom *= (1.0f + (zoom * 0.1f)); @@ -1442,7 +1343,7 @@ void camera_sniper_zoom_in(f32 zoom) } } -void camera_sniper_zoom_out(f32 zoom) +void camera_sniper_zoom_in(f32 zoom) { if (get_item_in_hand_or_watch_menu(GUNRIGHT) == ITEM_SNIPERRIFLE) { g_CurrentPlayer->sniper_zoom /= (1.0f + (zoom * 0.1f)); @@ -1472,7 +1373,9 @@ f32 bondwalkItemGetForceOfImpact(ITEM_IDS item) return get_ptr_item_statistics(item)->ForceOfImpact; } - +/** + * Address 0x7F05DFCC + */ s8 bondwalkItemGetAutomaticFiringRate(ITEM_IDS item) { return get_ptr_item_statistics(item)->AutomaticFiringRate; } @@ -1497,7 +1400,7 @@ u8 bondwalkItemGetObjectsShootThrough(ITEM_IDS item) s32 bondwalkItemHasAmmo(ITEM_IDS item) { - if (bondwalkItemCheckBitflags(item, 0x40000) != 0) + if (bondwalkItemCheckBitflags(item, WEAPONSTATBITFLAG_HAS_AMMO) != 0) { if ((get_ammo_type_for_weapon(item) == 0) || (get_ammo_count_for_weapon(item) > 0)) { @@ -1787,38 +1690,38 @@ void sub_GAME_7F05EA94(Model* model, s32 val) /** * Address 0x7F05EB0C. */ -void sub_GAME_7F05EB0C(ObjectRecord *arg0, coord3d *arg1, StandTile *arg2, Mtxf *arg3, coord3d *arg4, Mtxf *arg5, PropRecord *arg6) +void sub_GAME_7F05EB0C(ObjectRecord *obj, coord3d *pos, StandTile *stan, Mtxf *matrix, coord3d *arg4, Mtxf *arg5, PropRecord *arg6) { PropRecord *temp_s1; - struct ObjectRecord_f6c *temp_v0; + Projectile *temp_v0; - temp_s1 = arg0->prop; + temp_s1 = obj->prop; if (temp_s1 != NULL) { chrpropActivate(temp_s1); chrpropEnable(temp_s1); - matrix_scalar_multiply(arg0->model->scale, arg3); - sub_GAME_7F040754(arg0, arg1, arg3, arg2); + matrix_scalar_multiply(obj->model->scale, matrix); + objChangeShading(obj, pos, matrix, stan); // loadobjectmodel.c - setupUpdateObjectRoomPosition(arg0); + setupUpdateObjectRoomPosition(obj); - chrobjCollisionRelated(arg0); + chrobjCollisionRelated(obj); sub_GAME_7F03FDA8(temp_s1); - if (arg0->runtime_bitflags & 0x80) + if (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) { - temp_v0 = arg0->unk6C; + temp_v0 = obj->projectile; temp_v0->flags |= 0x41; - arg0->unk6C->prop = arg6; - sub_GAME_7F03FE14(temp_s1); - matrix_4x4_copy(arg5, &arg0->unk6C->m); - arg0->unk6C->pos.f[0] = arg4->f[0]; - arg0->unk6C->pos.f[1] = arg4->f[1]; - arg0->unk6C->pos.f[2] = arg4->f[2]; - arg0->unk6C->parent = arg0; - arg0->unk6C->unke8 = D_80048380; + obj->projectile->ownerprop = arg6; + projectileSetSticky(temp_s1); + matrix_4x4_copy(arg5, &obj->projectile->mtx); + obj->projectile->speed.f[0] = arg4->f[0]; + obj->projectile->speed.f[1] = arg4->f[1]; + obj->projectile->speed.f[2] = arg4->f[2]; + obj->projectile->obj = obj; + obj->projectile->unkE8 = D_80048380; } } } @@ -1869,7 +1772,7 @@ void sub_GAME_7F05EC1C(void) spC4 = temp_s0->unk14; bondviewUpdateGuardTankFlagsRelated(temp_s0->unkC, phi_f14, temp_s0, 0); temp_f14 = phi_f14; - if (sub_GAME_7F0B0E24(temp_f14, + if (stanTestLineUnobstructed(temp_f14, &spC4, temp_s0->unk8, temp_s0->unk10, @@ -1977,7 +1880,7 @@ glabel sub_GAME_7F05EC1C /* 093814 7F05ECE4 E7AE0018 */ swc1 $f14, 0x18($sp) /* 093818 7F05ECE8 E7B0001C */ swc1 $f16, 0x1c($sp) /* 09381C 7F05ECEC E7A80024 */ swc1 $f8, 0x24($sp) -/* 093820 7F05ECF0 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 093820 7F05ECF0 0FC2C389 */ jal stanTestLineUnobstructed /* 093824 7F05ECF4 E7A60020 */ swc1 $f6, 0x20($sp) /* 093828 7F05ECF8 10400008 */ beqz $v0, .L7F05ED1C /* 09382C 7F05ECFC 02002025 */ move $a0, $s0 @@ -2095,8 +1998,8 @@ void generate_player_thrown_grenade(s32 hand) current_weapon = getCurrentPlayerWeaponId(hand); sub_GAME_7F057C14(&throw_speed_vec, &spFC); - sub_GAME_7F0681CC(&sp94, &base_speed_vec, hand); - matrix_4x4_rotate_vector_in_place(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); + bullet_path_from_screen_center(&sp94, &base_speed_vec, hand); + mtx4RotateVecInPlace(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); throw_speed_vec.f[0] = (base_speed_vec.f[0] * base_velocity); throw_speed_vec.f[1] = (base_speed_vec.f[1] * base_velocity) + 5.0f; @@ -2138,17 +2041,17 @@ void generate_player_thrown_grenade(s32 hand) if ((wor->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) != 0) { - wor->unk6C->flags = (s32) (wor->unk6C->flags | 2); + wor->projectile->flags = (s32) (wor->projectile->flags | 2); - wor->unk6C->unk8c = 0.3f; - wor->unk6C->unk94 = 0.13333333f; - wor->unk6C->refreshrate = THROWN_ITEM_REFRESH_RATE; + wor->projectile->unk8C = 0.3f; + wor->projectile->unk94 = 0.13333333f; + wor->projectile->refreshrate = THROWN_ITEM_REFRESH_RATE; sfx_state = sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, 4, NULL); if (sfx_state != NULL) { - sub_GAME_7F053A10(sfx_state, (struct coord3d *) &wor->runtime_pos); + chrobjSndCreatePostEventDefault(sfx_state, (struct coord3d *) &wor->runtime_pos); } } } @@ -2182,8 +2085,8 @@ void generate_player_thrown_knife(s32 hand) bondprevpos = get_BONDdata_field408(); sub_GAME_7F057C14(&throw_speed_vec, &spFC); - sub_GAME_7F0681CC(&sp94, &base_speed_vec, hand); - matrix_4x4_rotate_vector_in_place(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); + bullet_path_from_screen_center(&sp94, &base_speed_vec, hand); + mtx4RotateVecInPlace(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); throw_speed_vec.f[0] = (base_speed_vec.f[0] * base_velocity); throw_speed_vec.f[1] = (base_speed_vec.f[1] * base_velocity) + 5.0f; @@ -2201,7 +2104,7 @@ void generate_player_thrown_knife(s32 hand) spE0.f[2] = g_CurrentPlayer->hands[hand].throw_item_pos_related.m[3][2]; matrix_4x4_set_rotation_around_z(4.712389f, &spA0_a); - matrix_4x4_set_rotation_around_x(3.1415927f, &sp40_f); + matrix_4x4_set_rotation_around_x(M_PI_F, &sp40_f); matrix_4x4_multiply_in_place(&sp40_f, &spA0_a); matrix_4x4_copy(&g_CurrentPlayer->hands[hand].throw_item_pos_related, &sp40_f); @@ -2223,10 +2126,10 @@ void generate_player_thrown_knife(s32 hand) if ((wor->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) != 0) { - wor->unk6C->flags = (s32) (wor->unk6C->flags | 2); + wor->projectile->flags = (s32) (wor->projectile->flags | 2); - wor->unk6C->unk8c = 0.1f; - wor->unk6C->refreshrate = THROWN_ITEM_REFRESH_RATE; + wor->projectile->unk8C = 0.1f; + wor->projectile->refreshrate = THROWN_ITEM_REFRESH_RATE; wor->runtime_bitflags |= RUNTIMEBITFLAG_THROWING_KNIFE_RELATED; } @@ -2281,8 +2184,8 @@ void generate_player_thrown_object(s32 hand) } sub_GAME_7F057C14(&throw_speed_vec, &unk_mtxf); - sub_GAME_7F0681CC(&sp94, &base_speed_vec, hand); - matrix_4x4_rotate_vector_in_place(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); + bullet_path_from_screen_center(&sp94, &base_speed_vec, hand); + mtx4RotateVecInPlace(currentPlayerGetMatrix10D4(), (f32*)&base_speed_vec); throw_speed_vec.f[0] = (base_speed_vec.f[0] * base_velocity); throw_speed_vec.f[1] = (base_speed_vec.f[1] * base_velocity) + 5.0f; @@ -2313,7 +2216,7 @@ void generate_player_thrown_object(s32 hand) if (wor != NULL) { - sub_GAME_7F04C044(wor->prop); + objDetach(wor->prop); } sub_GAME_7F05D690(); @@ -2418,16 +2321,16 @@ void generate_player_thrown_object(s32 hand) if ((wor->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) != 0) { - wor->unk6C->flags = (s32) (wor->unk6C->flags | 2); + wor->projectile->flags = (s32) (wor->projectile->flags | 2); - wor->unk6C->unk8c = 0.1f; - wor->unk6C->refreshrate = THROWN_ITEM_REFRESH_RATE; + wor->projectile->unk8C = 0.1f; + wor->projectile->refreshrate = THROWN_ITEM_REFRESH_RATE; sfx_state = sndPlaySfx((struct ALBankAlt_s *) g_musicSfxBufferPtr, 4, NULL); if (sfx_state != NULL) { - sub_GAME_7F053A10(sfx_state, (struct coord3d *) &wor->runtime_pos); + chrobjSndCreatePostEventDefault(sfx_state, (struct coord3d *) &wor->runtime_pos); } } } @@ -2477,12 +2380,12 @@ glabel sub_GAME_7F05F73C /* 0942C0 7F05F790 27A400A0 */ addiu $a0, $sp, 0xa0 /* 0942C4 7F05F794 27A40044 */ addiu $a0, $sp, 0x44 /* 0942C8 7F05F798 27A50038 */ addiu $a1, $sp, 0x38 -/* 0942CC 7F05F79C 0FC1A073 */ jal sub_GAME_7F0681CC +/* 0942CC 7F05F79C 0FC1A073 */ jal bullet_path_from_screen_center /* 0942D0 7F05F7A0 8FA600E8 */ lw $a2, 0xe8($sp) /* 0942D4 7F05F7A4 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 0942D8 7F05F7A8 00000000 */ nop /* 0942DC 7F05F7AC 00402025 */ move $a0, $v0 -/* 0942E0 7F05F7B0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 0942E0 7F05F7B0 0FC160F6 */ jal mtx4RotateVecInPlace /* 0942E4 7F05F7B4 27A50038 */ addiu $a1, $sp, 0x38 /* 0942E8 7F05F7B8 3C018005 */ lui $at, %hi(D_80053DCC) /* 0942EC 7F05F7BC C4203DCC */ lwc1 $f0, %lo(D_80053DCC)($at) @@ -2617,12 +2520,12 @@ glabel sub_GAME_7F05F73C /* 092638 7F05FC48 27A400A0 */ addiu $a0, $sp, 0xa0 /* 09263C 7F05FC4C 27A40044 */ addiu $a0, $sp, 0x44 /* 092640 7F05FC50 27A50038 */ addiu $a1, $sp, 0x38 -/* 092644 7F05FC54 0FC1A25D */ jal sub_GAME_7F0681CC +/* 092644 7F05FC54 0FC1A25D */ jal bullet_path_from_screen_center /* 092648 7F05FC58 8FA600E8 */ lw $a2, 0xe8($sp) /* 09264C 7F05FC5C 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 092650 7F05FC60 00000000 */ nop /* 092654 7F05FC64 00402025 */ move $a0, $v0 -/* 092658 7F05FC68 0FC16220 */ jal matrix_4x4_rotate_vector_in_place +/* 092658 7F05FC68 0FC16220 */ jal mtx4RotateVecInPlace /* 09265C 7F05FC6C 27A50038 */ addiu $a1, $sp, 0x38 /* 092660 7F05FC70 3C018005 */ lui $at, %hi(D_80053DCC) # $at, 0x8005 /* 092664 7F05FC74 C4209F0C */ lwc1 $f0, %lo(D_80053DCC)($at) @@ -2782,7 +2685,7 @@ glabel sub_GAME_7F05F928 /* 094500 7F05F9D0 02002025 */ move $a0, $s0 /* 094504 7F05F9D4 02403025 */ move $a2, $s2 /* 094508 7F05F9D8 24A502E8 */ addiu $a1, $a1, 0x2e8 -/* 09450C 7F05F9DC 0FC101D5 */ jal sub_GAME_7F040754 +/* 09450C 7F05F9DC 0FC101D5 */ jal objChangeShading /* 094510 7F05F9E0 8F270014 */ lw $a3, 0x14($t9) /* 094514 7F05F9E4 0FC10121 */ jal chrobjCollisionRelated /* 094518 7F05F9E8 02002025 */ move $a0, $s0 @@ -2798,7 +2701,7 @@ glabel sub_GAME_7F05F928 /* 094540 7F05FA10 26040058 */ addiu $a0, $s0, 0x58 /* 094544 7F05FA14 0FC16266 */ jal matrix_4x4_set_position /* 094548 7F05FA18 02402825 */ move $a1, $s2 -/* 09454C 7F05FA1C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 09454C 7F05FA1C 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 094550 7F05FA20 00000000 */ nop /* 094554 7F05FA24 00402025 */ move $a0, $v0 /* 094558 7F05FA28 02402825 */ move $a1, $s2 @@ -2806,7 +2709,7 @@ glabel sub_GAME_7F05F928 /* 094560 7F05FA30 8E26000C */ lw $a2, 0xc($s1) /* 094564 7F05FA34 8E2A0008 */ lw $t2, 8($s1) /* 094568 7F05FA38 02202025 */ move $a0, $s1 -/* 09456C 7F05FA3C 0FC1BBA9 */ jal sub_GAME_7F06EEA4 +/* 09456C 7F05FA3C 0FC1BBA9 */ jal modelUpdateRelationsQuick /* 094570 7F05FA40 8D450000 */ lw $a1, ($t2) /* 094574 7F05FA44 926B0001 */ lbu $t3, 1($s3) /* 094578 7F05FA48 356C0002 */ ori $t4, $t3, 2 @@ -2875,7 +2778,7 @@ glabel sub_GAME_7F05F928 /* 092878 7F05FE88 02002025 */ move $a0, $s0 /* 09287C 7F05FE8C 02403025 */ move $a2, $s2 /* 092880 7F05FE90 24A502E8 */ addiu $a1, $a1, 0x2e8 -/* 092884 7F05FE94 0FC10205 */ jal sub_GAME_7F040754 +/* 092884 7F05FE94 0FC10205 */ jal objChangeShading /* 092888 7F05FE98 8F270014 */ lw $a3, 0x14($t9) /* 09288C 7F05FE9C 0FC10151 */ jal chrobjCollisionRelated /* 092890 7F05FEA0 02002025 */ move $a0, $s0 @@ -2891,7 +2794,7 @@ glabel sub_GAME_7F05F928 /* 0928B8 7F05FEC8 26040058 */ addiu $a0, $s0, 0x58 /* 0928BC 7F05FECC 0FC16390 */ jal matrix_4x4_set_position /* 0928C0 7F05FED0 02402825 */ move $a1, $s2 -/* 0928C4 7F05FED4 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 0928C4 7F05FED4 0FC1E111 */ jal camGetWorldToScreenMtxf /* 0928C8 7F05FED8 00000000 */ nop /* 0928CC 7F05FEDC 00402025 */ move $a0, $v0 /* 0928D0 7F05FEE0 02402825 */ move $a1, $s2 @@ -2899,7 +2802,7 @@ glabel sub_GAME_7F05F928 /* 0928D8 7F05FEE8 8E26000C */ lw $a2, 0xc($s1) /* 0928DC 7F05FEEC 8E2A0008 */ lw $t2, 8($s1) /* 0928E0 7F05FEF0 02202025 */ move $a0, $s1 -/* 0928E4 7F05FEF4 0FC1BCA4 */ jal sub_GAME_7F06EEA4 +/* 0928E4 7F05FEF4 0FC1BCA4 */ jal modelUpdateRelationsQuick /* 0928E8 7F05FEF8 8D450000 */ lw $a1, ($t2) /* 0928EC 7F05FEFC 926B0001 */ lbu $t3, 1($s3) /* 0928F0 7F05FF00 356C0002 */ ori $t4, $t3, 2 @@ -2929,13 +2832,13 @@ void currentPlayerCreateRocket(GUNHAND hand) hand_ptr = &g_CurrentPlayer->hands[hand]; - if ((hand_ptr->field_A90 == NULL) && (hand_ptr->weapon_ammo_in_magazine > 0)) + if ((hand_ptr->rocket == NULL) && (hand_ptr->weapon_ammo_in_magazine > 0)) { - rocket = (struct WeaponObjRecord *)create_new_item_instance_of_model(PROP_CHRROCKET, 0x56); + rocket = (struct WeaponObjRecord *)create_new_item_instance_of_model(PROP_CHRROCKET, ITEM_NULL86); if (rocket != NULL) { - hand_ptr->field_A90 = (ObjectRecord *)rocket; - hand_ptr->field_A94 = 0; + hand_ptr->rocket = (ObjectRecord *)rocket; + hand_ptr->firedrocket = 0; rocket->timer = 1; } } @@ -2950,12 +2853,12 @@ void sub_GAME_7F05FB00(enum GUNHAND hand) ObjectRecord* hand_obj_record; hand_ptr = &g_CurrentPlayer->hands[hand]; - hand_obj_record = hand_ptr->field_A90; + hand_obj_record = hand_ptr->rocket; if (hand_obj_record != NULL) { objFreePermanently(hand_obj_record, 1); - hand_ptr->field_A90 = NULL; + hand_ptr->rocket = NULL; } } @@ -3026,7 +2929,7 @@ glabel gunFireTankShell /* 094748 7F05FC18 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 09474C 7F05FC1C 00000000 */ nop /* 094750 7F05FC20 00402025 */ move $a0, $v0 -/* 094754 7F05FC24 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 094754 7F05FC24 0FC160F6 */ jal mtx4RotateVecInPlace /* 094758 7F05FC28 27A5004C */ addiu $a1, $sp, 0x4c .L7F05FC2C: /* 09475C 7F05FC2C 3C018005 */ lui $at, %hi(D_80053DD8) @@ -3089,7 +2992,7 @@ glabel gunFireTankShell /* 09483C 7F05FD0C 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 094840 7F05FD10 E7AA003C */ swc1 $f10, 0x3c($sp) /* 094844 7F05FD14 00402025 */ move $a0, $v0 -/* 094848 7F05FD18 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 094848 7F05FD18 0FC1611D */ jal mtx4TransformVecInPlace /* 09484C 7F05FD1C 27A50034 */ addiu $a1, $sp, 0x34 /* 094850 7F05FD20 10000007 */ b .L7F05FD40 /* 094854 7F05FD24 00000000 */ nop @@ -3106,12 +3009,12 @@ glabel gunFireTankShell /* 094878 7F05FD48 1000003A */ b .L7F05FE34 /* 09487C 7F05FD4C 00000000 */ nop .L7F05FD50: -/* 094880 7F05FD50 0FC1A073 */ jal sub_GAME_7F0681CC +/* 094880 7F05FD50 0FC1A073 */ jal bullet_path_from_screen_center /* 094884 7F05FD54 8FA60108 */ lw $a2, 0x108($sp) /* 094888 7F05FD58 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 09488C 7F05FD5C 00000000 */ nop /* 094890 7F05FD60 00402025 */ move $a0, $v0 -/* 094894 7F05FD64 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 094894 7F05FD64 0FC160F6 */ jal mtx4RotateVecInPlace /* 094898 7F05FD68 27A5004C */ addiu $a1, $sp, 0x4c /* 09489C 7F05FD6C 8FA60100 */ lw $a2, 0x100($sp) /* 0948A0 7F05FD70 3C018005 */ lui $at, %hi(D_80053DDC) @@ -3332,7 +3235,7 @@ glabel gunFireTankShell /* 092AC0 7F0600D0 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 092AC4 7F0600D4 00000000 */ nop /* 092AC8 7F0600D8 00402025 */ move $a0, $v0 -/* 092ACC 7F0600DC 0FC16220 */ jal matrix_4x4_rotate_vector_in_place +/* 092ACC 7F0600DC 0FC16220 */ jal mtx4RotateVecInPlace /* 092AD0 7F0600E0 27A5004C */ addiu $a1, $sp, 0x4c .L7F0600E4: /* 092AD4 7F0600E4 3C018005 */ lui $at, %hi(D_80053DD8) # $at, 0x8005 @@ -3395,7 +3298,7 @@ glabel gunFireTankShell /* 092BB4 7F0601C4 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 092BB8 7F0601C8 E7AA003C */ swc1 $f10, 0x3c($sp) /* 092BBC 7F0601CC 00402025 */ move $a0, $v0 -/* 092BC0 7F0601D0 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 092BC0 7F0601D0 0FC16247 */ jal mtx4TransformVecInPlace /* 092BC4 7F0601D4 27A50034 */ addiu $a1, $sp, 0x34 /* 092BC8 7F0601D8 10000007 */ b .L7F0601F8 /* 092BCC 7F0601DC 00000000 */ nop @@ -3412,12 +3315,12 @@ glabel gunFireTankShell /* 092BF0 7F060200 1000003A */ b .L7F0602EC /* 092BF4 7F060204 00000000 */ nop .L7F060208: -/* 092BF8 7F060208 0FC1A25D */ jal sub_GAME_7F0681CC +/* 092BF8 7F060208 0FC1A25D */ jal bullet_path_from_screen_center /* 092BFC 7F06020C 8FA60108 */ lw $a2, 0x108($sp) /* 092C00 7F060210 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 092C04 7F060214 00000000 */ nop /* 092C08 7F060218 00402025 */ move $a0, $v0 -/* 092C0C 7F06021C 0FC16220 */ jal matrix_4x4_rotate_vector_in_place +/* 092C0C 7F06021C 0FC16220 */ jal mtx4RotateVecInPlace /* 092C10 7F060220 27A5004C */ addiu $a1, $sp, 0x4c /* 092C14 7F060224 8FA60100 */ lw $a2, 0x100($sp) /* 092C18 7F060228 3C018005 */ lui $at, %hi(D_80053DDC) # $at, 0x8005 @@ -4558,7 +4461,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095854 7F060D24 260402F8 */ addiu $a0, $s0, 0x2f8 /* 095858 7F060D28 8FA501A0 */ lw $a1, 0x1a0($sp) /* 09585C 7F060D2C AFA40044 */ sw $a0, 0x44($sp) -/* 095860 7F060D30 0FC1D7DA */ jal sub_GAME_7F075F68 +/* 095860 7F060D30 0FC1D7DA */ jal modelInit /* 095864 7F060D34 26060318 */ addiu $a2, $s0, 0x318 /* 095868 7F060D38 8FA40044 */ lw $a0, 0x44($sp) /* 09586C 7F060D3C 0FC17A5E */ jal sub_GAME_7F05E978 @@ -4824,7 +4727,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095C38 7F061108 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 095C3C 7F06110C E60A02F0 */ swc1 $f10, 0x2f0($s0) /* 095C40 7F061110 00402025 */ move $a0, $v0 -/* 095C44 7F061114 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 095C44 7F061114 0FC1611D */ jal mtx4TransformVecInPlace /* 095C48 7F061118 260502E8 */ addiu $a1, $s0, 0x2e8 /* 095C4C 7F06111C C7A4025C */ lwc1 $f4, 0x25c($sp) /* 095C50 7F061120 820E000D */ lb $t6, 0xd($s0) @@ -5095,7 +4998,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 096054 7F061524 8FAD01A0 */ lw $t5, 0x1a0($sp) /* 096058 7F061528 8C990004 */ lw $t9, 4($a0) /* 09605C 7F06152C 00002825 */ move $a1, $zero -/* 096060 7F061530 0FC1B15C */ jal sub_GAME_7F06C570 +/* 096060 7F061530 0FC1B15C */ jal modelFindNodeMtxIndex /* 096064 7F061534 AFB90070 */ sw $t9, 0x70($sp) /* 096068 7F061538 AFA2006C */ sw $v0, 0x6c($sp) /* 09606C 7F06153C 8E050010 */ lw $a1, 0x10($s0) @@ -5178,7 +5081,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 096190 7F061660 8FB901A0 */ lw $t9, 0x1a0($sp) /* 096194 7F061664 8C8E0004 */ lw $t6, 4($a0) /* 096198 7F061668 00002825 */ move $a1, $zero -/* 09619C 7F06166C 0FC1B15C */ jal sub_GAME_7F06C570 +/* 09619C 7F06166C 0FC1B15C */ jal modelFindNodeMtxIndex /* 0961A0 7F061670 AFAE0064 */ sw $t6, 0x64($sp) /* 0961A4 7F061674 AFA20060 */ sw $v0, 0x60($sp) /* 0961A8 7F061678 0FC17A0F */ jal sub_GAME_7F05E83C @@ -6342,7 +6245,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 095DB4 7F061244 260402F8 */ addiu $a0, $s0, 0x2f8 /* 095DB8 7F061248 8FA501A0 */ lw $a1, 0x1a0($sp) /* 095DBC 7F06124C AFA40044 */ sw $a0, 0x44($sp) -/* 095DC0 7F061250 0FC1D956 */ jal sub_GAME_7F075F68 +/* 095DC0 7F061250 0FC1D956 */ jal modelInit /* 095DC4 7F061254 26060318 */ addiu $a2, $s0, 0x318 /* 095DC8 7F061258 8FA40044 */ lw $a0, 0x44($sp) /* 095DCC 7F06125C 0FC17BA6 */ jal sub_GAME_7F05E978 @@ -6608,7 +6511,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 096198 7F061628 0FC1E28D */ jal currentPlayerGetMatrix10D4 /* 09619C 7F06162C E60A02F0 */ swc1 $f10, 0x2f0($s0) /* 0961A0 7F061630 00402025 */ move $a0, $v0 -/* 0961A4 7F061634 0FC16265 */ jal matrix_4x4_transform_vector_in_place +/* 0961A4 7F061634 0FC16265 */ jal mtx4TransformVecInPlace /* 0961A8 7F061638 260502E8 */ addiu $a1, $s0, 0x2e8 /* 0961AC 7F06163C C7A4025C */ lwc1 $f4, 0x25c($sp) /* 0961B0 7F061640 820E000D */ lb $t6, 0xd($s0) @@ -6879,7 +6782,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 0965B4 7F061A44 8FAD01A0 */ lw $t5, 0x1a0($sp) /* 0965B8 7F061A48 8C990004 */ lw $t9, 4($a0) /* 0965BC 7F061A4C 00002825 */ move $a1, $zero -/* 0965C0 7F061A50 0FC1B2D8 */ jal sub_GAME_7F06C570 +/* 0965C0 7F061A50 0FC1B2D8 */ jal modelFindNodeMtxIndex /* 0965C4 7F061A54 AFB90070 */ sw $t9, 0x70($sp) /* 0965C8 7F061A58 AFA2006C */ sw $v0, 0x6c($sp) /* 0965CC 7F061A5C 8E050010 */ lw $a1, 0x10($s0) @@ -6962,7 +6865,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 0966F0 7F061B80 8FB901A0 */ lw $t9, 0x1a0($sp) /* 0966F4 7F061B84 8C8E0004 */ lw $t6, 4($a0) /* 0966F8 7F061B88 00002825 */ move $a1, $zero -/* 0966FC 7F061B8C 0FC1B2D8 */ jal sub_GAME_7F06C570 +/* 0966FC 7F061B8C 0FC1B2D8 */ jal modelFindNodeMtxIndex /* 096700 7F061B90 AFAE0064 */ sw $t6, 0x64($sp) /* 096704 7F061B94 AFA20060 */ sw $v0, 0x60($sp) /* 096708 7F061B98 0FC17B57 */ jal sub_GAME_7F05E83C @@ -8130,7 +8033,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 093BD0 7F0611E0 260402F8 */ addiu $a0, $s0, 0x2f8 /* 093BD4 7F0611E4 8FA501A0 */ lw $a1, 0x1a0($sp) /* 093BD8 7F0611E8 AFA40044 */ sw $a0, 0x44($sp) -/* 093BDC 7F0611EC 0FC1D7F9 */ jal sub_GAME_7F075F68 +/* 093BDC 7F0611EC 0FC1D7F9 */ jal modelInit /* 093BE0 7F0611F0 26060318 */ addiu $a2, $s0, 0x318 /* 093BE4 7F0611F4 8FA40044 */ lw $a0, 0x44($sp) /* 093BE8 7F0611F8 0FC17B8C */ jal sub_GAME_7F05E978 @@ -8395,7 +8298,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 093FB0 7F0615C0 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 093FB4 7F0615C4 E60A02F0 */ swc1 $f10, 0x2f0($s0) /* 093FB8 7F0615C8 00402025 */ move $a0, $v0 -/* 093FBC 7F0615CC 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 093FBC 7F0615CC 0FC16247 */ jal mtx4TransformVecInPlace /* 093FC0 7F0615D0 260502E8 */ addiu $a1, $s0, 0x2e8 /* 093FC4 7F0615D4 C7A4025C */ lwc1 $f4, 0x25c($sp) /* 093FC8 7F0615D8 820E000D */ lb $t6, 0xd($s0) @@ -8666,7 +8569,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 0943CC 7F0619DC 8FAD01A0 */ lw $t5, 0x1a0($sp) /* 0943D0 7F0619E0 8C990004 */ lw $t9, 4($a0) /* 0943D4 7F0619E4 00002825 */ move $a1, $zero -/* 0943D8 7F0619E8 0FC1B32A */ jal sub_GAME_7F06C570 +/* 0943D8 7F0619E8 0FC1B32A */ jal modelFindNodeMtxIndex /* 0943DC 7F0619EC AFB90070 */ sw $t9, 0x70($sp) /* 0943E0 7F0619F0 AFA2006C */ sw $v0, 0x6c($sp) /* 0943E4 7F0619F4 8E050010 */ lw $a1, 0x10($s0) @@ -8749,7 +8652,7 @@ glabel handles_firing_or_throwing_weapon_in_hand /* 094508 7F061B18 8FB901A0 */ lw $t9, 0x1a0($sp) /* 09450C 7F061B1C 8C8E0004 */ lw $t6, 4($a0) /* 094510 7F061B20 00002825 */ move $a1, $zero -/* 094514 7F061B24 0FC1B32A */ jal sub_GAME_7F06C570 +/* 094514 7F061B24 0FC1B32A */ jal modelFindNodeMtxIndex /* 094518 7F061B28 AFAE0064 */ sw $t6, 0x64($sp) /* 09451C 7F061B2C AFA20060 */ sw $v0, 0x60($sp) /* 094520 7F061B30 0FC17B3D */ jal sub_GAME_7F05E83C @@ -8971,8 +8874,17 @@ void bondwalkFireBothHands(void) * @param arg3: * * Address 0x7F061948. + * + * This function adjusts the length of the bullet beam that's rendered on screen. + * This function is used for both player and guard beams. + * + * The watch laser has a very short beam, in accordance with its range. + * The laser also has a shortened one, but it appears this is to avoid graphical glitches. + * Other weapons have their bullet beam capped at 10000 max length, otherwise if the player + * fires into the void, there may be graphical glitches with the beam. + * */ -void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2, coord3d *arg3) +void CapBeamLengthAndDecideIfRendered(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2, coord3d *arg3) { f32 phi_f12_2; @@ -8995,15 +8907,15 @@ void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2 arg0->pos.f[1] = arg2->f[1]; arg0->pos.f[2] = arg2->f[2]; - arg0->delta[0] = arg3->x - arg2->x; - arg0->delta[1] = arg3->f[1] - arg2->f[1]; - arg0->delta[2] = arg3->f[2] - arg2->f[2]; + arg0->delta.f[0] = arg3->x - arg2->x; + arg0->delta.f[1] = arg3->f[1] - arg2->f[1]; + arg0->delta.f[2] = arg3->f[2] - arg2->f[2]; - phi_f12_2 = sqrtf((arg0->delta[0] * arg0->delta[0]) + (arg0->delta[1] * arg0->delta[1]) + (arg0->delta[2] * arg0->delta[2])); + phi_f12_2 = sqrtf((arg0->delta.f[0] * arg0->delta.f[0]) + (arg0->delta.f[1] * arg0->delta.f[1]) + (arg0->delta.f[2] * arg0->delta.f[2])); - arg0->delta[0] *= 1.0f / phi_f12_2; - arg0->delta[1] *= 1.0f / phi_f12_2; - arg0->delta[2] *= 1.0f / phi_f12_2; + arg0->delta.f[0] *= 1.0f / phi_f12_2; + arg0->delta.f[1] *= 1.0f / phi_f12_2; + arg0->delta.f[2] *= 1.0f / phi_f12_2; if (item == ITEM_WATCHLASER) { @@ -9039,6 +8951,7 @@ void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2 arg0->unk24 = 3000.0f; } + // Laser beams are rendered more often than other normal weapons arg0->unk28 = (-0.1f - ((f32) (u32)randomGetNext() * (1.0f / UINT_MAX) * 0.3f)) * phi_f12_2; } else if (item == ITEM_WATCHLASER) @@ -9051,6 +8964,7 @@ void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2 arg0->unk24 = 3000.0f; } + // Always render the beam for the watch laser arg0->unk28 = 0.0f; } else @@ -9063,11 +8977,13 @@ void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2 arg0->unk24 = 3000.0f; } + // Decide if a beam should be rendered for normal weapon bullets arg0->unk28 = ((2.0f * ((f32) (u32)randomGetNext() * (1.0f / UINT_MAX))) - 1.0f) * arg0->unk20; } if (arg0->unk1c <= arg0->unk28) { + // No beam will be rendered arg0->unk00 = -1; } } @@ -9088,13 +9004,13 @@ void sub_GAME_7F061BF4(enum GUNHAND hand) { ChrRecord_f180 *field_A54; hand_ptr = &g_CurrentPlayer->hands[hand]; - player_matrix = currentPlayerGetMatrix10CC(); + player_matrix = camGetWorldToScreenMtxf(); val = -((((hand_ptr->item_related.x * player_matrix->m[0][2]) + (hand_ptr->item_related.y * player_matrix->m[1][2])) + (hand_ptr->item_related.z * player_matrix->m[2][2])) + player_matrix->m[3][2]); if (val < hand_ptr->field_B64) { return; } field_A54 = &hand_ptr->field_A54; - sub_GAME_7F061948( + CapBeamLengthAndDecideIfRendered( field_A54, getCurrentPlayerWeaponId(hand), &hand_ptr->field_B58, @@ -9120,7 +9036,7 @@ void sub_GAME_7F061BF4(enum GUNHAND hand) { + (diff1_y * diff2_y))); if (val > 0.08726647f) { return; } - sub_GAME_7F061948( + CapBeamLengthAndDecideIfRendered( &chr->unk180[hand], getCurrentPlayerWeaponId(hand), &g_CurrentPlayer->field_2A18[hand], @@ -9208,7 +9124,7 @@ glabel sub_GAME_7F061E18 /* 096A00 7F061ED0 8D8CD0D0 */ lw $t4, %lo(flareimage3)($t4) /* 096A04 7F061ED4 E7A000E8 */ swc1 $f0, 0xe8($sp) /* 096A08 7F061ED8 E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 096A0C 7F061EDC 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 096A0C 7F061EDC 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 096A10 7F061EE0 AFAC00B0 */ sw $t4, 0xb0($sp) /* 096A14 7F061EE4 AFA200A8 */ sw $v0, 0xa8($sp) /* 096A18 7F061EE8 82230001 */ lb $v1, 1($s1) @@ -9544,7 +9460,7 @@ glabel sub_GAME_7F061E18 /* 096F08 7F0623D8 C6280018 */ lwc1 $f8, 0x18($s1) /* 096F0C 7F0623DC 46144182 */ mul.s $f6, $f8, $f20 /* 096F10 7F0623E0 46043280 */ add.s $f10, $f6, $f4 -/* 096F14 7F0623E4 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 096F14 7F0623E4 0FC1611D */ jal mtx4TransformVecInPlace /* 096F18 7F0623E8 E7AA00A4 */ swc1 $f10, 0xa4($sp) /* 096F1C 7F0623EC 3C014120 */ li $at, 0x41200000 # 10.000000 /* 096F20 7F0623F0 44813000 */ mtc1 $at, $f6 @@ -9583,7 +9499,7 @@ glabel sub_GAME_7F061E18 /* 096FA0 7F062470 0FC1E111 */ jal currentPlayerGetMatrix10D4 /* 096FA4 7F062474 00000000 */ nop /* 096FA8 7F062478 00402025 */ move $a0, $v0 -/* 096FAC 7F06247C 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 096FAC 7F06247C 0FC1611D */ jal mtx4TransformVecInPlace /* 096FB0 7F062480 27A5009C */ addiu $a1, $sp, 0x9c /* 096FB4 7F062484 C7A2009C */ lwc1 $f2, 0x9c($sp) /* 096FB8 7F062488 C7A800FC */ lwc1 $f8, 0xfc($sp) @@ -10083,7 +9999,7 @@ glabel sub_GAME_7F061E18 /* 094D84 7F062394 8D8C44B0 */ lw $t4, %lo(flareimage3)($t4) /* 094D88 7F062398 E7A000E8 */ swc1 $f0, 0xe8($sp) /* 094D8C 7F06239C E7A400B4 */ swc1 $f4, 0xb4($sp) -/* 094D90 7F0623A0 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 094D90 7F0623A0 0FC1E111 */ jal camGetWorldToScreenMtxf /* 094D94 7F0623A4 AFAC00B0 */ sw $t4, 0xb0($sp) /* 094D98 7F0623A8 AFA200A8 */ sw $v0, 0xa8($sp) /* 094D9C 7F0623AC 82230001 */ lb $v1, 1($s1) @@ -10419,7 +10335,7 @@ glabel sub_GAME_7F061E18 /* 09528C 7F06289C C6280018 */ lwc1 $f8, 0x18($s1) /* 095290 7F0628A0 46144182 */ mul.s $f6, $f8, $f20 /* 095294 7F0628A4 46043280 */ add.s $f10, $f6, $f4 -/* 095298 7F0628A8 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 095298 7F0628A8 0FC16247 */ jal mtx4TransformVecInPlace /* 09529C 7F0628AC E7AA00A4 */ swc1 $f10, 0xa4($sp) /* 0952A0 7F0628B0 3C014120 */ li $at, 0x41200000 # 10.000000 /* 0952A4 7F0628B4 44813000 */ mtc1 $at, $f6 @@ -10458,7 +10374,7 @@ glabel sub_GAME_7F061E18 /* 095324 7F062934 0FC1E131 */ jal currentPlayerGetMatrix10D4 /* 095328 7F062938 00000000 */ nop /* 09532C 7F06293C 00402025 */ move $a0, $v0 -/* 095330 7F062940 0FC16247 */ jal matrix_4x4_transform_vector_in_place +/* 095330 7F062940 0FC16247 */ jal mtx4TransformVecInPlace /* 095334 7F062944 27A5009C */ addiu $a1, $sp, 0x9c /* 095338 7F062948 C7A2009C */ lwc1 $f2, 0x9c($sp) /* 09533C 7F06294C C7A800FC */ lwc1 $f8, 0xfc($sp) @@ -11001,8 +10917,8 @@ glabel sub_GAME_7F062BE4 /* 09782C 7F062CFC AC4C0000 */ sw $t4, ($v0) /* 097830 7F062D00 AC4D0004 */ sw $t5, 4($v0) /* 097834 7F062D04 3C0E0386 */ lui $t6, (0x03860010 >> 16) # lui $t6, 0x386 -/* 097838 7F062D08 3C198003 */ lui $t9, %hi(D_80032448) -/* 09783C 7F062D0C 27392448 */ addiu $t9, %lo(D_80032448) # addiu $t9, $t9, 0x2448 +/* 097838 7F062D08 3C198003 */ lui $t9, %hi(D_80032440 + 0x8) +/* 09783C 7F062D0C 27392448 */ addiu $t9, %lo(D_80032440 + 0x8) # addiu $t9, $t9, 0x2448 /* 097840 7F062D10 35CE0010 */ ori $t6, (0x03860010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 097844 7F062D14 02002025 */ move $a0, $s0 /* 097848 7F062D18 AC6E0000 */ sw $t6, ($v1) @@ -11287,8 +11203,8 @@ glabel sub_GAME_7F062BE4 /* 095BB0 7F0631C0 AC4C0000 */ sw $t4, ($v0) /* 095BB4 7F0631C4 AC4D0004 */ sw $t5, 4($v0) /* 095BB8 7F0631C8 3C0E0386 */ lui $t6, (0x03860010 >> 16) # lui $t6, 0x386 -/* 095BBC 7F0631CC 3C198003 */ lui $t9, %hi(D_80032448) # $t9, 0x8003 -/* 095BC0 7F0631D0 2739D998 */ addiu $t9, %lo(D_80032448) # addiu $t9, $t9, -0x2668 +/* 095BBC 7F0631CC 3C198003 */ lui $t9, %hi(D_80032440 + 0x8) # $t9, 0x8003 +/* 095BC0 7F0631D0 2739D998 */ addiu $t9, %lo(D_80032440 + 0x8) # addiu $t9, $t9, -0x2668 /* 095BC4 7F0631D4 35CE0010 */ ori $t6, (0x03860010 & 0xFFFF) # ori $t6, $t6, 0x10 /* 095BC8 7F0631D8 02002025 */ move $a0, $s0 /* 095BCC 7F0631DC AC6E0000 */ sw $t6, ($v1) @@ -11588,7 +11504,7 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097C58 7F063128 27B30138 */ addiu $s3, $sp, 0x138 /* 097C5C 7F06312C 02602025 */ move $a0, $s3 /* 097C60 7F063130 02402825 */ move $a1, $s2 -/* 097C64 7F063134 0FC1D7DA */ jal sub_GAME_7F075F68 +/* 097C64 7F063134 0FC1D7DA */ jal modelInit /* 097C68 7F063138 27A600B8 */ addiu $a2, $sp, 0xb8 /* 097C6C 7F06313C 02602025 */ move $a0, $s3 /* 097C70 7F063140 0FC17A5E */ jal sub_GAME_7F05E978 @@ -11644,7 +11560,7 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097D2C 7F0631FC 8C44001C */ lw $a0, 0x1c($v0) /* 097D30 7F063200 8C880004 */ lw $t0, 4($a0) /* 097D34 7F063204 00002825 */ move $a1, $zero -/* 097D38 7F063208 0FC1B15C */ jal sub_GAME_7F06C570 +/* 097D38 7F063208 0FC1B15C */ jal modelFindNodeMtxIndex /* 097D3C 7F06320C AFA8005C */ sw $t0, 0x5c($sp) /* 097D40 7F063210 AFA20058 */ sw $v0, 0x58($sp) /* 097D44 7F063214 8FA4005C */ lw $a0, 0x5c($sp) @@ -11663,7 +11579,7 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097D74 7F063244 864C000C */ lh $t4, 0xc($s2) /* 097D78 7F063248 8C890004 */ lw $t1, 4($a0) /* 097D7C 7F06324C 00002825 */ move $a1, $zero -/* 097D80 7F063250 0FC1B15C */ jal sub_GAME_7F06C570 +/* 097D80 7F063250 0FC1B15C */ jal modelFindNodeMtxIndex /* 097D84 7F063254 AFA90054 */ sw $t1, 0x54($sp) /* 097D88 7F063258 AFA20050 */ sw $v0, 0x50($sp) /* 097D8C 7F06325C 8FA40054 */ lw $a0, 0x54($sp) @@ -11735,10 +11651,10 @@ glabel set_enviro_fog_for_items_in_solo_watch_menu /* 097E74 7F063344 354A0040 */ ori $t2, (0x80000040 & 0xFFFF) # ori $t2, $t2, 0x40 /* 097E78 7F063348 24430008 */ addiu $v1, $v0, 8 /* 097E7C 7F06334C 3C0B0386 */ lui $t3, (0x03860010 >> 16) # lui $t3, 0x386 -/* 097E80 7F063350 3C0C8003 */ lui $t4, %hi(D_80032448) +/* 097E80 7F063350 3C0C8003 */ lui $t4, %hi(D_80032440 + 0x8) /* 097E84 7F063354 AC4A0004 */ sw $t2, 4($v0) /* 097E88 7F063358 AC490000 */ sw $t1, ($v0) -/* 097E8C 7F06335C 258C2448 */ addiu $t4, %lo(D_80032448) # addiu $t4, $t4, 0x2448 +/* 097E8C 7F06335C 258C2448 */ addiu $t4, %lo(D_80032440 + 0x8) # addiu $t4, $t4, 0x2448 /* 097E90 7F063360 356B0010 */ ori $t3, (0x03860010 & 0xFFFF) # ori $t3, $t3, 0x10 /* 097E94 7F063364 24640008 */ addiu $a0, $v1, 8 /* 097E98 7F063368 AC6B0000 */ sw $t3, ($v1) @@ -11893,7 +11809,7 @@ glabel sub_GAME_7F0634FC -void sub_GAME_7F06351C(f32* arg0, Mtxf* arg1, Mtxf* arg2, Mtxf* arg3, f32* arg4, Mtxf* arg5, Mtxf* arg6) +void sub_GAME_7F06351C(struct coord3d* arg0, Mtxf* arg1, Mtxf* arg2, Mtxf* arg3, struct coord3d* arg4, Mtxf* arg5, Mtxf* arg6) { Mtxf sp20; @@ -12019,7 +11935,7 @@ glabel sub_GAME_7F06359C /* 0981AC 7F06367C 8FA403D8 */ lw $a0, 0x3d8($sp) /* 0981B0 7F063680 8FA503D8 */ lw $a1, 0x3d8($sp) /* 0981B4 7F063684 27A404D8 */ addiu $a0, $sp, 0x4d8 -/* 0981B8 7F063688 0FC1D7DA */ jal sub_GAME_7F075F68 +/* 0981B8 7F063688 0FC1D7DA */ jal modelInit /* 0981BC 7F06368C 27A60460 */ addiu $a2, $sp, 0x460 /* 0981C0 7F063690 AFB704E4 */ sw $s7, 0x4e4($sp) /* 0981C4 7F063694 8FA4053C */ lw $a0, 0x53c($sp) @@ -13027,7 +12943,7 @@ void recall_joy2_hits_edit_detail_edit_flag(enum ITEM_IDS item, PropRecord* prop if (sound_state->link.next != NULL) { - sub_GAME_7F053A10((ALSoundState* ) sound_state->link.next, &prop->pos); + chrobjSndCreatePostEventDefault((ALSoundState* ) sound_state->link.next, &prop->pos); } } } @@ -13052,7 +12968,7 @@ void sub_GAME_7F064720(coord3d* pos) link = sound->link.next; if (link != NULL) { - sub_GAME_7F053A10((ALSoundState* ) link, pos); + chrobjSndCreatePostEventDefault((ALSoundState* ) link, pos); } } } @@ -13097,7 +13013,7 @@ void recall_joy2_hits_edit_flag(enum ITEM_IDS item, coord3d* arg1, s32 texture_i if (sound_state->link.next != NULL) { - sub_GAME_7F053A10((ALSoundState* ) sound_state->link.next, arg1); + chrobjSndCreatePostEventDefault((ALSoundState* ) sound_state->link.next, arg1); } } @@ -13115,7 +13031,7 @@ void recall_joy2_hits_edit_flag(enum ITEM_IDS item, coord3d* arg1, s32 texture_i if (sound_state->link.next != NULL) { - sub_GAME_7F053A10((ALSoundState* ) sound_state->link.next, arg1); + chrobjSndCreatePostEventDefault((ALSoundState* ) sound_state->link.next, arg1); } } } @@ -13171,7 +13087,7 @@ void sub_GAME_7F0649D8(enum GUNHAND hand) ? item_stats->MagSize : ammo_total; - g_CurrentPlayer->ammoheldarr[item_stats->AmmoType] = (bondwalkItemCheckBitflags(item_id, 0x200000U) != 0) + g_CurrentPlayer->ammoheldarr[item_stats->AmmoType] = (bondwalkItemCheckBitflags(item_id, WEAPONSTATBITFLAG_AMMO_CLIP_LIMIT) != 0) ? 0 : (g_CurrentPlayer->ammoheldarr[item_stats->AmmoType] - hand_ptr->weapon_ammo_in_magazine) + ammo_in_magazine; @@ -15978,7 +15894,7 @@ glabel handle_weapon_id_values_possibly_1st_person_animation /* 09B8C8 7F066D98 8E0E001C */ lw $t6, 0x1c($s0) /* 09B8CC 7F066D9C 15C00009 */ bnez $t6, .L7F066DC4 /* 09B8D0 7F066DA0 00000000 */ nop -/* 09B8D4 7F066DA4 0FC0F0FF */ jal sub_GAME_7F03C3FC +/* 09B8D4 7F066DA4 0FC0F0FF */ jal propFindForInteract /* 09B8D8 7F066DA8 00000000 */ nop /* 09B8DC 7F066DAC 10400005 */ beqz $v0, .L7F066DC4 /* 09B8E0 7F066DB0 00000000 */ nop @@ -18836,7 +18752,7 @@ glabel handle_weapon_id_values_possibly_1st_person_animation /* 09BEE0 7F067370 8E0E001C */ lw $t6, 0x1c($s0) /* 09BEE4 7F067374 15C00009 */ bnez $t6, .Ljp7F06739C /* 09BEE8 7F067378 00000000 */ nop -/* 09BEEC 7F06737C 0FC0F1BF */ jal sub_GAME_7F03C3FC +/* 09BEEC 7F06737C 0FC0F1BF */ jal propFindForInteract /* 09BEF0 7F067380 00000000 */ nop /* 09BEF4 7F067384 10400005 */ beqz $v0, .Ljp7F06739C /* 09BEF8 7F067388 00000000 */ nop @@ -21853,7 +21769,7 @@ glabel handle_weapon_id_values_possibly_1st_person_animation /* 099F30 7F067540 8E0E001C */ lw $t6, 0x1c($s0) /* 099F34 7F067544 15C00009 */ bnez $t6, .L7F06756C /* 099F38 7F067548 00000000 */ nop -/* 099F3C 7F06754C 0FC0F12F */ jal sub_GAME_7F03C3FC +/* 099F3C 7F06754C 0FC0F12F */ jal propFindForInteract /* 099F40 7F067550 00000000 */ nop /* 099F44 7F067554 10400005 */ beqz $v0, .L7F06756C /* 099F48 7F067558 00000000 */ nop @@ -21917,7 +21833,7 @@ void analyzeGEKey(void) { if (bondinvHasGEKey()) { - HUDMESSAGEBOTTOM(langGet(TEXT(LGUN, 0xD8))); //Analyzing the GoldenEye key... + HUDMESSAGEBOTTOM(langGet(TEXT(LGUN, GUN_STR_D8))); //Analyzing the GoldenEye key... g_CurrentPlayer->copiedgoldeneye = 1; sndPlaySfx(g_musicSfxBufferPtr, 0xf5, 0x0); currentPlayerEquipWeaponWrapper(GUNRIGHT, ITEM_GOLDENEYEKEY); @@ -21925,7 +21841,7 @@ void analyzeGEKey(void) } else { - HUDMESSAGEBOTTOM(langGet(TEXT(LGUN, 0xD9))); //You do not have the GoldenEye key. + HUDMESSAGEBOTTOM(langGet(TEXT(LGUN, GUN_STR_D9))); //You do not have the GoldenEye key. sub_GAME_7F05D690(); } return; @@ -22120,933 +22036,198 @@ s32 sub_GAME_7F0673B4(enum GUNHAND hand) -#ifdef NONMATCHING -void sub_GAME_7F067420(void) { +/** + * US address 7F067420. + * Perfect Dark method bgunTickGameplay. +*/ +void gunTickGameplay(s32 triggerOn) +{ + struct unkown_gun_struct sp48z; + enum ITEM_IDS sp44; + enum ITEM_IDS sp40; + enum GUNHAND sp3C = GUNLEFT; + struct rgba_u8 sp38; + -} -#else + sp48z = D_80035E9C; + + g_CurrentPlayer->field_FD0 = g_CurrentPlayer->field_FCC; + g_CurrentPlayer->field_FCC = triggerOn; -#if defined(VERSION_US) || defined(VERSION_JP) -GLOBAL_ASM( -.text -glabel sub_GAME_7F067420 -/* 09BF50 7F067420 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 09BF54 7F067424 3C0F8003 */ lui $t7, %hi(D_80035E9C) -/* 09BF58 7F067428 AFBF001C */ sw $ra, 0x1c($sp) -/* 09BF5C 7F06742C AFB00018 */ sw $s0, 0x18($sp) -/* 09BF60 7F067430 25EF5E9C */ addiu $t7, %lo(D_80035E9C) # addiu $t7, $t7, 0x5e9c -/* 09BF64 7F067434 8DE10000 */ lw $at, ($t7) -/* 09BF68 7F067438 8DE80004 */ lw $t0, 4($t7) -/* 09BF6C 7F06743C 27AE0048 */ addiu $t6, $sp, 0x48 -/* 09BF70 7F067440 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 09BF74 7F067444 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 09BF78 7F067448 ADC10000 */ sw $at, ($t6) -/* 09BF7C 7F06744C ADC80004 */ sw $t0, 4($t6) -/* 09BF80 7F067450 8E030000 */ lw $v1, ($s0) -/* 09BF84 7F067454 8C690FCC */ lw $t1, 0xfcc($v1) -/* 09BF88 7F067458 AC690FD0 */ sw $t1, 0xfd0($v1) -/* 09BF8C 7F06745C 8E0A0000 */ lw $t2, ($s0) -/* 09BF90 7F067460 AD440FCC */ sw $a0, 0xfcc($t2) -/* 09BF94 7F067464 8E030000 */ lw $v1, ($s0) -/* 09BF98 7F067468 8C620FCC */ lw $v0, 0xfcc($v1) -/* 09BF9C 7F06746C 14400008 */ bnez $v0, .L7F067490 -/* 09BFA0 7F067470 00000000 */ nop -/* 09BFA4 7F067474 8C6B0FD0 */ lw $t3, 0xfd0($v1) -/* 09BFA8 7F067478 240C0001 */ li $t4, 1 -/* 09BFAC 7F06747C 11600004 */ beqz $t3, .L7F067490 -/* 09BFB0 7F067480 00000000 */ nop -/* 09BFB4 7F067484 AC6C0FC8 */ sw $t4, 0xfc8($v1) -/* 09BFB8 7F067488 8E030000 */ lw $v1, ($s0) -/* 09BFBC 7F06748C 8C620FCC */ lw $v0, 0xfcc($v1) -.L7F067490: -/* 09BFC0 7F067490 5040012A */ beql $v0, $zero, .L7F06793C -/* 09BFC4 7F067494 AC600FD4 */ sw $zero, 0xfd4($v1) -/* 09BFC8 7F067498 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09BFCC 7F06749C 00002025 */ move $a0, $zero -/* 09BFD0 7F0674A0 AFA20044 */ sw $v0, 0x44($sp) -/* 09BFD4 7F0674A4 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09BFD8 7F0674A8 24040001 */ li $a0, 1 -/* 09BFDC 7F0674AC 8E030000 */ lw $v1, ($s0) -/* 09BFE0 7F0674B0 AFA20040 */ sw $v0, 0x40($sp) -/* 09BFE4 7F0674B4 3C198005 */ lui $t9, %hi(g_ClockTimer) -/* 09BFE8 7F0674B8 8F398374 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 09BFEC 7F0674BC 8C6D0FD4 */ lw $t5, 0xfd4($v1) -/* 09BFF0 7F0674C0 8FA40044 */ lw $a0, 0x44($sp) -/* 09BFF4 7F0674C4 01B9C021 */ addu $t8, $t5, $t9 -/* 09BFF8 7F0674C8 108000FD */ beqz $a0, .L7F0678C0 -/* 09BFFC 7F0674CC AC780FD4 */ sw $t8, 0xfd4($v1) -/* 09C000 7F0674D0 504000FC */ beql $v0, $zero, .L7F0678C4 -/* 09C004 7F0674D4 8E0D0000 */ lw $t5, ($s0) -/* 09C008 7F0674D8 0FC1782D */ jal bondwalkItemCheckBitflags -/* 09C00C 7F0674DC 24050080 */ li $a1, 128 -/* 09C010 7F0674E0 10400049 */ beqz $v0, .L7F067608 -/* 09C014 7F0674E4 8FA40040 */ lw $a0, 0x40($sp) -/* 09C018 7F0674E8 0FC1782D */ jal bondwalkItemCheckBitflags -/* 09C01C 7F0674EC 24050080 */ li $a1, 128 -/* 09C020 7F0674F0 50400046 */ beql $v0, $zero, .L7F06760C -/* 09C024 7F0674F4 8FA40044 */ lw $a0, 0x44($sp) -/* 09C028 7F0674F8 8E030000 */ lw $v1, ($s0) -/* 09C02C 7F0674FC 8C6E0FD4 */ lw $t6, 0xfd4($v1) -/* 09C030 7F067500 29C10015 */ slti $at, $t6, 0x15 -/* 09C034 7F067504 54200022 */ bnezl $at, .L7F067590 -/* 09C038 7F067508 8C6C0FD0 */ lw $t4, 0xfd0($v1) -/* 09C03C 7F06750C 8C6F0FD8 */ lw $t7, 0xfd8($v1) -/* 09C040 7F067510 24020001 */ li $v0, 1 -/* 09C044 7F067514 000F4080 */ sll $t0, $t7, 2 -/* 09C048 7F067518 03A84821 */ addu $t1, $sp, $t0 -/* 09C04C 7F06751C AD220048 */ sw $v0, 0x48($t1) -/* 09C050 7F067520 8C6A0FD8 */ lw $t2, 0xfd8($v1) -/* 09C054 7F067524 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C058 7F067528 004A2023 */ subu $a0, $v0, $t2 -/* 09C05C 7F06752C 54400010 */ bnezl $v0, .L7F067570 -/* 09C060 7F067530 8E0F0000 */ lw $t7, ($s0) -/* 09C064 7F067534 8E030000 */ lw $v1, ($s0) -/* 09C068 7F067538 8C6B0FD8 */ lw $t3, 0xfd8($v1) -/* 09C06C 7F06753C 000B60C0 */ sll $t4, $t3, 3 -/* 09C070 7F067540 018B6023 */ subu $t4, $t4, $t3 -/* 09C074 7F067544 000C6080 */ sll $t4, $t4, 2 -/* 09C078 7F067548 018B6021 */ addu $t4, $t4, $t3 -/* 09C07C 7F06754C 000C6080 */ sll $t4, $t4, 2 -/* 09C080 7F067550 018B6021 */ addu $t4, $t4, $t3 -/* 09C084 7F067554 000C60C0 */ sll $t4, $t4, 3 -/* 09C088 7F067558 000C6823 */ negu $t5, $t4 -/* 09C08C 7F06755C 006DC821 */ addu $t9, $v1, $t5 -/* 09C090 7F067560 8F380C28 */ lw $t8, 0xc28($t9) -/* 09C094 7F067564 530000F6 */ beql $t8, $zero, .L7F067940 -/* 09C098 7F067568 00002025 */ move $a0, $zero -/* 09C09C 7F06756C 8E0F0000 */ lw $t7, ($s0) -.L7F067570: -/* 09C0A0 7F067570 240E0001 */ li $t6, 1 -/* 09C0A4 7F067574 8DE80FD8 */ lw $t0, 0xfd8($t7) -/* 09C0A8 7F067578 00084880 */ sll $t1, $t0, 2 -/* 09C0AC 7F06757C 00095023 */ negu $t2, $t1 -/* 09C0B0 7F067580 03AA5821 */ addu $t3, $sp, $t2 -/* 09C0B4 7F067584 100000ED */ b .L7F06793C -/* 09C0B8 7F067588 AD6E004C */ sw $t6, 0x4c($t3) -/* 09C0BC 7F06758C 8C6C0FD0 */ lw $t4, 0xfd0($v1) -.L7F067590: -/* 09C0C0 7F067590 55800012 */ bnezl $t4, .L7F0675DC -/* 09C0C4 7F067594 8E030000 */ lw $v1, ($s0) -/* 09C0C8 7F067598 8C6D0FD8 */ lw $t5, 0xfd8($v1) -/* 09C0CC 7F06759C 24190001 */ li $t9, 1 -/* 09C0D0 7F0675A0 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C0D4 7F0675A4 032D2023 */ subu $a0, $t9, $t5 -/* 09C0D8 7F0675A8 54400007 */ bnezl $v0, .L7F0675C8 -/* 09C0DC 7F0675AC 8E030000 */ lw $v1, ($s0) -/* 09C0E0 7F0675B0 8E180000 */ lw $t8, ($s0) -/* 09C0E4 7F0675B4 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C0E8 7F0675B8 8F040FD8 */ lw $a0, 0xfd8($t8) -/* 09C0EC 7F0675BC 54400007 */ bnezl $v0, .L7F0675DC -/* 09C0F0 7F0675C0 8E030000 */ lw $v1, ($s0) -/* 09C0F4 7F0675C4 8E030000 */ lw $v1, ($s0) -.L7F0675C8: -/* 09C0F8 7F0675C8 24080001 */ li $t0, 1 -/* 09C0FC 7F0675CC 8C6F0FD8 */ lw $t7, 0xfd8($v1) -/* 09C100 7F0675D0 010F4823 */ subu $t1, $t0, $t7 -/* 09C104 7F0675D4 AC690FD8 */ sw $t1, 0xfd8($v1) -/* 09C108 7F0675D8 8E030000 */ lw $v1, ($s0) -.L7F0675DC: -/* 09C10C 7F0675DC 240E0001 */ li $t6, 1 -/* 09C110 7F0675E0 8C6A0FD8 */ lw $t2, 0xfd8($v1) -/* 09C114 7F0675E4 000A5880 */ sll $t3, $t2, 2 -/* 09C118 7F0675E8 03AB6021 */ addu $t4, $sp, $t3 -/* 09C11C 7F0675EC AD8E0048 */ sw $t6, 0x48($t4) -/* 09C120 7F0675F0 8C790FD8 */ lw $t9, 0xfd8($v1) -/* 09C124 7F0675F4 00196880 */ sll $t5, $t9, 2 -/* 09C128 7F0675F8 000DC023 */ negu $t8, $t5 -/* 09C12C 7F0675FC 03B84021 */ addu $t0, $sp, $t8 -/* 09C130 7F067600 100000CE */ b .L7F06793C -/* 09C134 7F067604 AD00004C */ sw $zero, 0x4c($t0) -.L7F067608: -/* 09C138 7F067608 8FA40044 */ lw $a0, 0x44($sp) -.L7F06760C: -/* 09C13C 7F06760C 0FC1782D */ jal bondwalkItemCheckBitflags -/* 09C140 7F067610 24050080 */ li $a1, 128 -/* 09C144 7F067614 14400005 */ bnez $v0, .L7F06762C -/* 09C148 7F067618 8FA40040 */ lw $a0, 0x40($sp) -/* 09C14C 7F06761C 0FC1782D */ jal bondwalkItemCheckBitflags -/* 09C150 7F067620 24050080 */ li $a1, 128 -/* 09C154 7F067624 50400063 */ beql $v0, $zero, .L7F0677B4 -/* 09C158 7F067628 8E030000 */ lw $v1, ($s0) -.L7F06762C: -/* 09C15C 7F06762C 8E030000 */ lw $v1, ($s0) -/* 09C160 7F067630 8FA40044 */ lw $a0, 0x44($sp) -/* 09C164 7F067634 8C6F0FD4 */ lw $t7, 0xfd4($v1) -/* 09C168 7F067638 29E1001F */ slti $at, $t7, 0x1f -/* 09C16C 7F06763C 14200021 */ bnez $at, .L7F0676C4 -/* 09C170 7F067640 00000000 */ nop -/* 09C174 7F067644 8C690FD8 */ lw $t1, 0xfd8($v1) -/* 09C178 7F067648 24020001 */ li $v0, 1 -/* 09C17C 7F06764C 00095080 */ sll $t2, $t1, 2 -/* 09C180 7F067650 03AA7021 */ addu $t6, $sp, $t2 -/* 09C184 7F067654 ADC20048 */ sw $v0, 0x48($t6) -/* 09C188 7F067658 8C6B0FD8 */ lw $t3, 0xfd8($v1) -/* 09C18C 7F06765C 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C190 7F067660 004B2023 */ subu $a0, $v0, $t3 -/* 09C194 7F067664 54400010 */ bnezl $v0, .L7F0676A8 -/* 09C198 7F067668 8E090000 */ lw $t1, ($s0) -/* 09C19C 7F06766C 8E030000 */ lw $v1, ($s0) -/* 09C1A0 7F067670 8C6C0FD8 */ lw $t4, 0xfd8($v1) -/* 09C1A4 7F067674 000CC8C0 */ sll $t9, $t4, 3 -/* 09C1A8 7F067678 032CC823 */ subu $t9, $t9, $t4 -/* 09C1AC 7F06767C 0019C880 */ sll $t9, $t9, 2 -/* 09C1B0 7F067680 032CC821 */ addu $t9, $t9, $t4 -/* 09C1B4 7F067684 0019C880 */ sll $t9, $t9, 2 -/* 09C1B8 7F067688 032CC821 */ addu $t9, $t9, $t4 -/* 09C1BC 7F06768C 0019C8C0 */ sll $t9, $t9, 3 -/* 09C1C0 7F067690 00196823 */ negu $t5, $t9 -/* 09C1C4 7F067694 006DC021 */ addu $t8, $v1, $t5 -/* 09C1C8 7F067698 8F080C28 */ lw $t0, 0xc28($t8) -/* 09C1CC 7F06769C 510000A8 */ beql $t0, $zero, .L7F067940 -/* 09C1D0 7F0676A0 00002025 */ move $a0, $zero -/* 09C1D4 7F0676A4 8E090000 */ lw $t1, ($s0) -.L7F0676A8: -/* 09C1D8 7F0676A8 240F0001 */ li $t7, 1 -/* 09C1DC 7F0676AC 8D2A0FD8 */ lw $t2, 0xfd8($t1) -/* 09C1E0 7F0676B0 000A7080 */ sll $t6, $t2, 2 -/* 09C1E4 7F0676B4 000E5823 */ negu $t3, $t6 -/* 09C1E8 7F0676B8 03AB6021 */ addu $t4, $sp, $t3 -/* 09C1EC 7F0676BC 1000009F */ b .L7F06793C -/* 09C1F0 7F0676C0 AD8F004C */ sw $t7, 0x4c($t4) -.L7F0676C4: -/* 09C1F4 7F0676C4 0FC1782D */ jal bondwalkItemCheckBitflags -/* 09C1F8 7F0676C8 24050080 */ li $a1, 128 -/* 09C1FC 7F0676CC 10400003 */ beqz $v0, .L7F0676DC -/* 09C200 7F0676D0 24050001 */ li $a1, 1 -/* 09C204 7F0676D4 10000001 */ b .L7F0676DC -/* 09C208 7F0676D8 00002825 */ move $a1, $zero -.L7F0676DC: -/* 09C20C 7F0676DC 00A02025 */ move $a0, $a1 -/* 09C210 7F0676E0 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C214 7F0676E4 AFA5003C */ sw $a1, 0x3c($sp) -/* 09C218 7F0676E8 1440000F */ bnez $v0, .L7F067728 -/* 09C21C 7F0676EC 8FA5003C */ lw $a1, 0x3c($sp) -/* 09C220 7F0676F0 000530C0 */ sll $a2, $a1, 3 -/* 09C224 7F0676F4 00C53023 */ subu $a2, $a2, $a1 -/* 09C228 7F0676F8 00063080 */ sll $a2, $a2, 2 -/* 09C22C 7F0676FC 00C53021 */ addu $a2, $a2, $a1 -/* 09C230 7F067700 8E190000 */ lw $t9, ($s0) -/* 09C234 7F067704 00063080 */ sll $a2, $a2, 2 -/* 09C238 7F067708 00C53021 */ addu $a2, $a2, $a1 -/* 09C23C 7F06770C 000630C0 */ sll $a2, $a2, 3 -/* 09C240 7F067710 03266821 */ addu $t5, $t9, $a2 -/* 09C244 7F067714 8DB80880 */ lw $t8, 0x880($t5) -/* 09C248 7F067718 24090001 */ li $t1, 1 -/* 09C24C 7F06771C 01252023 */ subu $a0, $t1, $a1 -/* 09C250 7F067720 53000005 */ beql $t8, $zero, .L7F067738 -/* 09C254 7F067724 AFA40020 */ sw $a0, 0x20($sp) -.L7F067728: -/* 09C258 7F067728 8E080000 */ lw $t0, ($s0) -/* 09C25C 7F06772C 10000014 */ b .L7F067780 -/* 09C260 7F067730 AD050FD8 */ sw $a1, 0xfd8($t0) -/* 09C264 7F067734 AFA40020 */ sw $a0, 0x20($sp) -.L7F067738: -/* 09C268 7F067738 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C26C 7F06773C AFA60024 */ sw $a2, 0x24($sp) -/* 09C270 7F067740 8FA40020 */ lw $a0, 0x20($sp) -/* 09C274 7F067744 14400007 */ bnez $v0, .L7F067764 -/* 09C278 7F067748 8FA60024 */ lw $a2, 0x24($sp) -/* 09C27C 7F06774C 8E030000 */ lw $v1, ($s0) -/* 09C280 7F067750 00065023 */ negu $t2, $a2 -/* 09C284 7F067754 006A7021 */ addu $t6, $v1, $t2 -/* 09C288 7F067758 8DCF0C28 */ lw $t7, 0xc28($t6) -/* 09C28C 7F06775C 51E00005 */ beql $t7, $zero, .L7F067774 -/* 09C290 7F067760 8C6C0FD8 */ lw $t4, 0xfd8($v1) -.L7F067764: -/* 09C294 7F067764 8E0B0000 */ lw $t3, ($s0) -/* 09C298 7F067768 10000005 */ b .L7F067780 -/* 09C29C 7F06776C AD640FD8 */ sw $a0, 0xfd8($t3) -/* 09C2A0 7F067770 8C6C0FD8 */ lw $t4, 0xfd8($v1) -.L7F067774: -/* 09C2A4 7F067774 24190001 */ li $t9, 1 -/* 09C2A8 7F067778 032C6823 */ subu $t5, $t9, $t4 -/* 09C2AC 7F06777C AC6D0FD8 */ sw $t5, 0xfd8($v1) -.L7F067780: -/* 09C2B0 7F067780 8E030000 */ lw $v1, ($s0) -/* 09C2B4 7F067784 24180001 */ li $t8, 1 -/* 09C2B8 7F067788 8C680FD8 */ lw $t0, 0xfd8($v1) -/* 09C2BC 7F06778C 00084880 */ sll $t1, $t0, 2 -/* 09C2C0 7F067790 03A95021 */ addu $t2, $sp, $t1 -/* 09C2C4 7F067794 AD580048 */ sw $t8, 0x48($t2) -/* 09C2C8 7F067798 8C6E0FD8 */ lw $t6, 0xfd8($v1) -/* 09C2CC 7F06779C 000E7880 */ sll $t7, $t6, 2 -/* 09C2D0 7F0677A0 000F5823 */ negu $t3, $t7 -/* 09C2D4 7F0677A4 03ABC821 */ addu $t9, $sp, $t3 -/* 09C2D8 7F0677A8 10000064 */ b .L7F06793C -/* 09C2DC 7F0677AC AF20004C */ sw $zero, 0x4c($t9) -/* 09C2E0 7F0677B0 8E030000 */ lw $v1, ($s0) -.L7F0677B4: -/* 09C2E4 7F0677B4 8C6C0FD4 */ lw $t4, 0xfd4($v1) -/* 09C2E8 7F0677B8 2981001F */ slti $at, $t4, 0x1f -/* 09C2EC 7F0677BC 54200022 */ bnezl $at, .L7F067848 -/* 09C2F0 7F0677C0 8C6E0FD0 */ lw $t6, 0xfd0($v1) -/* 09C2F4 7F0677C4 8C6D0FD8 */ lw $t5, 0xfd8($v1) -/* 09C2F8 7F0677C8 24020001 */ li $v0, 1 -/* 09C2FC 7F0677CC 000D4080 */ sll $t0, $t5, 2 -/* 09C300 7F0677D0 03A8C021 */ addu $t8, $sp, $t0 -/* 09C304 7F0677D4 AF020048 */ sw $v0, 0x48($t8) -/* 09C308 7F0677D8 8C690FD8 */ lw $t1, 0xfd8($v1) -/* 09C30C 7F0677DC 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C310 7F0677E0 00492023 */ subu $a0, $v0, $t1 -/* 09C314 7F0677E4 54400010 */ bnezl $v0, .L7F067828 -/* 09C318 7F0677E8 8E0D0000 */ lw $t5, ($s0) -/* 09C31C 7F0677EC 8E030000 */ lw $v1, ($s0) -/* 09C320 7F0677F0 8C6A0FD8 */ lw $t2, 0xfd8($v1) -/* 09C324 7F0677F4 000A70C0 */ sll $t6, $t2, 3 -/* 09C328 7F0677F8 01CA7023 */ subu $t6, $t6, $t2 -/* 09C32C 7F0677FC 000E7080 */ sll $t6, $t6, 2 -/* 09C330 7F067800 01CA7021 */ addu $t6, $t6, $t2 -/* 09C334 7F067804 000E7080 */ sll $t6, $t6, 2 -/* 09C338 7F067808 01CA7021 */ addu $t6, $t6, $t2 -/* 09C33C 7F06780C 000E70C0 */ sll $t6, $t6, 3 -/* 09C340 7F067810 000E7823 */ negu $t7, $t6 -/* 09C344 7F067814 006F5821 */ addu $t3, $v1, $t7 -/* 09C348 7F067818 8D790C28 */ lw $t9, 0xc28($t3) -/* 09C34C 7F06781C 53200048 */ beql $t9, $zero, .L7F067940 -/* 09C350 7F067820 00002025 */ move $a0, $zero -/* 09C354 7F067824 8E0D0000 */ lw $t5, ($s0) -.L7F067828: -/* 09C358 7F067828 240C0001 */ li $t4, 1 -/* 09C35C 7F06782C 8DA80FD8 */ lw $t0, 0xfd8($t5) -/* 09C360 7F067830 0008C080 */ sll $t8, $t0, 2 -/* 09C364 7F067834 00184823 */ negu $t1, $t8 -/* 09C368 7F067838 03A95021 */ addu $t2, $sp, $t1 -/* 09C36C 7F06783C 1000003F */ b .L7F06793C -/* 09C370 7F067840 AD4C004C */ sw $t4, 0x4c($t2) -/* 09C374 7F067844 8C6E0FD0 */ lw $t6, 0xfd0($v1) -.L7F067848: -/* 09C378 7F067848 55C00012 */ bnezl $t6, .L7F067894 -/* 09C37C 7F06784C 8E030000 */ lw $v1, ($s0) -/* 09C380 7F067850 8C6F0FD8 */ lw $t7, 0xfd8($v1) -/* 09C384 7F067854 240B0001 */ li $t3, 1 -/* 09C388 7F067858 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C38C 7F06785C 016F2023 */ subu $a0, $t3, $t7 -/* 09C390 7F067860 54400007 */ bnezl $v0, .L7F067880 -/* 09C394 7F067864 8E030000 */ lw $v1, ($s0) -/* 09C398 7F067868 8E190000 */ lw $t9, ($s0) -/* 09C39C 7F06786C 0FC19CED */ jal sub_GAME_7F0673B4 -/* 09C3A0 7F067870 8F240FD8 */ lw $a0, 0xfd8($t9) -/* 09C3A4 7F067874 54400007 */ bnezl $v0, .L7F067894 -/* 09C3A8 7F067878 8E030000 */ lw $v1, ($s0) -/* 09C3AC 7F06787C 8E030000 */ lw $v1, ($s0) -.L7F067880: -/* 09C3B0 7F067880 24080001 */ li $t0, 1 -/* 09C3B4 7F067884 8C6D0FD8 */ lw $t5, 0xfd8($v1) -/* 09C3B8 7F067888 010DC023 */ subu $t8, $t0, $t5 -/* 09C3BC 7F06788C AC780FD8 */ sw $t8, 0xfd8($v1) -/* 09C3C0 7F067890 8E030000 */ lw $v1, ($s0) -.L7F067894: -/* 09C3C4 7F067894 240C0001 */ li $t4, 1 -/* 09C3C8 7F067898 8C690FD8 */ lw $t1, 0xfd8($v1) -/* 09C3CC 7F06789C 00095080 */ sll $t2, $t1, 2 -/* 09C3D0 7F0678A0 03AA7021 */ addu $t6, $sp, $t2 -/* 09C3D4 7F0678A4 ADCC0048 */ sw $t4, 0x48($t6) -/* 09C3D8 7F0678A8 8C6B0FD8 */ lw $t3, 0xfd8($v1) -/* 09C3DC 7F0678AC 000B7880 */ sll $t7, $t3, 2 -/* 09C3E0 7F0678B0 000FC823 */ negu $t9, $t7 -/* 09C3E4 7F0678B4 03B94021 */ addu $t0, $sp, $t9 -/* 09C3E8 7F0678B8 10000020 */ b .L7F06793C -/* 09C3EC 7F0678BC AD00004C */ sw $zero, 0x4c($t0) -.L7F0678C0: -/* 09C3F0 7F0678C0 8E0D0000 */ lw $t5, ($s0) -.L7F0678C4: -/* 09C3F4 7F0678C4 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09C3F8 7F0678C8 8DA40FD8 */ lw $a0, 0xfd8($t5) -/* 09C3FC 7F0678CC 5440000E */ bnezl $v0, .L7F067908 -/* 09C400 7F0678D0 8E030000 */ lw $v1, ($s0) -/* 09C404 7F0678D4 8E180000 */ lw $t8, ($s0) -/* 09C408 7F0678D8 240C0001 */ li $t4, 1 -/* 09C40C 7F0678DC 8F090FD8 */ lw $t1, 0xfd8($t8) -/* 09C410 7F0678E0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09C414 7F0678E4 01892023 */ subu $a0, $t4, $t1 -/* 09C418 7F0678E8 50400007 */ beql $v0, $zero, .L7F067908 -/* 09C41C 7F0678EC 8E030000 */ lw $v1, ($s0) -/* 09C420 7F0678F0 8E030000 */ lw $v1, ($s0) -/* 09C424 7F0678F4 240E0001 */ li $t6, 1 -/* 09C428 7F0678F8 8C6A0FD8 */ lw $t2, 0xfd8($v1) -/* 09C42C 7F0678FC 01CA5823 */ subu $t3, $t6, $t2 -/* 09C430 7F067900 AC6B0FD8 */ sw $t3, 0xfd8($v1) -/* 09C434 7F067904 8E030000 */ lw $v1, ($s0) -.L7F067908: -/* 09C438 7F067908 240F0001 */ li $t7, 1 -/* 09C43C 7F06790C 8C790FD8 */ lw $t9, 0xfd8($v1) -/* 09C440 7F067910 00194080 */ sll $t0, $t9, 2 -/* 09C444 7F067914 03A86821 */ addu $t5, $sp, $t0 -/* 09C448 7F067918 ADAF0048 */ sw $t7, 0x48($t5) -/* 09C44C 7F06791C 8C780FD8 */ lw $t8, 0xfd8($v1) -/* 09C450 7F067920 00186080 */ sll $t4, $t8, 2 -/* 09C454 7F067924 000C4823 */ negu $t1, $t4 -/* 09C458 7F067928 03A97021 */ addu $t6, $sp, $t1 -/* 09C45C 7F06792C ADC0004C */ sw $zero, 0x4c($t6) -/* 09C460 7F067930 10000003 */ b .L7F067940 -/* 09C464 7F067934 00002025 */ move $a0, $zero -/* 09C468 7F067938 AC600FD4 */ sw $zero, 0xfd4($v1) -.L7F06793C: -/* 09C46C 7F06793C 00002025 */ move $a0, $zero -.L7F067940: -/* 09C470 7F067940 0FC192CA */ jal handle_weapon_id_values_possibly_1st_person_animation -/* 09C474 7F067944 8FA50048 */ lw $a1, 0x48($sp) -/* 09C478 7F067948 24040001 */ li $a0, 1 -/* 09C47C 7F06794C 0FC192CA */ jal handle_weapon_id_values_possibly_1st_person_animation -/* 09C480 7F067950 8FA5004C */ lw $a1, 0x4c($sp) -/* 09C484 7F067954 0FC17422 */ jal used_to_load_1st_person_model_on_demand -/* 09C488 7F067958 00002025 */ move $a0, $zero -/* 09C48C 7F06795C 0FC17422 */ jal used_to_load_1st_person_model_on_demand -/* 09C490 7F067960 24040001 */ li $a0, 1 -/* 09C494 7F067964 0FC19C69 */ jal sub_GAME_7F0671A4 -/* 09C498 7F067968 00000000 */ nop -/* 09C49C 7F06796C 8E0A0000 */ lw $t2, ($s0) -/* 09C4A0 7F067970 8D4B0FE0 */ lw $t3, 0xfe0($t2) -/* 09C4A4 7F067974 1160000A */ beqz $t3, .L7F0679A0 -/* 09C4A8 7F067978 00000000 */ nop -/* 09C4AC 7F06797C 0FC225E6 */ jal get_curplayer_positiondata -/* 09C4B0 7F067980 00000000 */ nop -/* 09C4B4 7F067984 8E050000 */ lw $a1, ($s0) -/* 09C4B8 7F067988 00402025 */ move $a0, $v0 -/* 09C4BC 7F06798C 0FC10027 */ jal set_color_shading_from_tile -/* 09C4C0 7F067990 24A50FDC */ addiu $a1, $a1, 0xfdc -/* 09C4C4 7F067994 8E190000 */ lw $t9, ($s0) -/* 09C4C8 7F067998 1000000A */ b .L7F0679C4 -/* 09C4CC 7F06799C AF200FE0 */ sw $zero, 0xfe0($t9) -.L7F0679A0: -/* 09C4D0 7F0679A0 0FC225E6 */ jal get_curplayer_positiondata -/* 09C4D4 7F0679A4 00000000 */ nop -/* 09C4D8 7F0679A8 00402025 */ move $a0, $v0 -/* 09C4DC 7F0679AC 0FC10027 */ jal set_color_shading_from_tile -/* 09C4E0 7F0679B0 27A50038 */ addiu $a1, $sp, 0x38 -/* 09C4E4 7F0679B4 8E040000 */ lw $a0, ($s0) -/* 09C4E8 7F0679B8 27A50038 */ addiu $a1, $sp, 0x38 -/* 09C4EC 7F0679BC 0FC100C4 */ jal update_color_shading -/* 09C4F0 7F0679C0 24840FDC */ addiu $a0, $a0, 0xfdc -.L7F0679C4: -/* 09C4F4 7F0679C4 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09C4F8 7F0679C8 00002025 */ move $a0, $zero -/* 09C4FC 7F0679CC AFA2002C */ sw $v0, 0x2c($sp) -/* 09C500 7F0679D0 0FC17674 */ jal getCurrentPlayerWeaponId -/* 09C504 7F0679D4 24040001 */ li $a0, 1 -/* 09C508 7F0679D8 8FA4002C */ lw $a0, 0x2c($sp) -/* 09C50C 7F0679DC 0FC2367B */ jal bondinvIncrementHeldTime -/* 09C510 7F0679E0 00402825 */ move $a1, $v0 -/* 09C514 7F0679E4 8E030000 */ lw $v1, ($s0) -/* 09C518 7F0679E8 3C0F8005 */ lui $t7, %hi(g_ClockTimer) -/* 09C51C 7F0679EC 8C621270 */ lw $v0, 0x1270($v1) -/* 09C520 7F0679F0 04420028 */ bltzl $v0, .L7F067A94 -/* 09C524 7F0679F4 8FBF001C */ lw $ra, 0x1c($sp) -/* 09C528 7F0679F8 8DEF8374 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 09C52C 7F0679FC 24670870 */ addiu $a3, $v1, 0x870 -/* 09C530 7F067A00 2418FFFF */ li $t8, -1 -/* 09C534 7F067A04 004F4021 */ addu $t0, $v0, $t7 -/* 09C538 7F067A08 AC681270 */ sw $t0, 0x1270($v1) -/* 09C53C 7F067A0C 8E030000 */ lw $v1, ($s0) -/* 09C540 7F067A10 8C6D1270 */ lw $t5, 0x1270($v1) -/* 09C544 7F067A14 29A1012C */ slti $at, $t5, 0x12c -/* 09C548 7F067A18 50200014 */ beql $at, $zero, .L7F067A6C -/* 09C54C 7F067A1C AC781270 */ sw $t8, 0x1270($v1) -/* 09C550 7F067A20 8CE401D4 */ lw $a0, 0x1d4($a3) -/* 09C554 7F067A24 10800005 */ beqz $a0, .L7F067A3C -/* 09C558 7F067A28 00000000 */ nop -/* 09C55C 7F067A2C 0C00237C */ jal sndGetPlayingState -/* 09C560 7F067A30 AFA70034 */ sw $a3, 0x34($sp) -/* 09C564 7F067A34 14400016 */ bnez $v0, .L7F067A90 -/* 09C568 7F067A38 8FA70034 */ lw $a3, 0x34($sp) -.L7F067A3C: -/* 09C56C 7F067A3C 0FC2FF01 */ jal lvlGetControlsLockedFlag -/* 09C570 7F067A40 AFA70034 */ sw $a3, 0x34($sp) -/* 09C574 7F067A44 14400012 */ bnez $v0, .L7F067A90 -/* 09C578 7F067A48 8FA70034 */ lw $a3, 0x34($sp) -/* 09C57C 7F067A4C 3C048006 */ lui $a0, %hi(g_musicSfxBufferPtr) -/* 09C580 7F067A50 8C843720 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 09C584 7F067A54 240500F6 */ li $a1, 246 -/* 09C588 7F067A58 0C002382 */ jal sndPlaySfx -/* 09C58C 7F067A5C 24E601D4 */ addiu $a2, $a3, 0x1d4 -/* 09C590 7F067A60 1000000C */ b .L7F067A94 -/* 09C594 7F067A64 8FBF001C */ lw $ra, 0x1c($sp) -/* 09C598 7F067A68 AC781270 */ sw $t8, 0x1270($v1) -.L7F067A6C: -/* 09C59C 7F067A6C 8CE401D4 */ lw $a0, 0x1d4($a3) -/* 09C5A0 7F067A70 50800008 */ beql $a0, $zero, .L7F067A94 -/* 09C5A4 7F067A74 8FBF001C */ lw $ra, 0x1c($sp) -/* 09C5A8 7F067A78 0C00237C */ jal sndGetPlayingState -/* 09C5AC 7F067A7C AFA70034 */ sw $a3, 0x34($sp) -/* 09C5B0 7F067A80 10400003 */ beqz $v0, .L7F067A90 -/* 09C5B4 7F067A84 8FA70034 */ lw $a3, 0x34($sp) -/* 09C5B8 7F067A88 0C002408 */ jal sndDeactivate -/* 09C5BC 7F067A8C 8CE401D4 */ lw $a0, 0x1d4($a3) -.L7F067A90: -/* 09C5C0 7F067A90 8FBF001C */ lw $ra, 0x1c($sp) -.L7F067A94: -/* 09C5C4 7F067A94 8FB00018 */ lw $s0, 0x18($sp) -/* 09C5C8 7F067A98 27BD0050 */ addiu $sp, $sp, 0x50 -/* 09C5CC 7F067A9C 03E00008 */ jr $ra -/* 09C5D0 7F067AA0 00000000 */ nop -) -#endif + if ((g_CurrentPlayer->field_FCC == 0) && (g_CurrentPlayer->field_FD0 != 0)) + { + g_CurrentPlayer->field_FC8 = 1; + } -#if defined(VERSION_EU) -GLOBAL_ASM( -.text -glabel sub_GAME_7F067420 -/* 09A5B8 7F067BC8 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 09A5BC 7F067BCC 3C0F8003 */ lui $t7, %hi(D_80035E9C) # $t7, 0x8003 -/* 09A5C0 7F067BD0 AFBF001C */ sw $ra, 0x1c($sp) -/* 09A5C4 7F067BD4 AFB00018 */ sw $s0, 0x18($sp) -/* 09A5C8 7F067BD8 25EF13EC */ addiu $t7, %lo(D_80035E9C) # addiu $t7, $t7, 0x13ec -/* 09A5CC 7F067BDC 8DE10000 */ lw $at, ($t7) -/* 09A5D0 7F067BE0 8DE80004 */ lw $t0, 4($t7) -/* 09A5D4 7F067BE4 27AE0048 */ addiu $t6, $sp, 0x48 -/* 09A5D8 7F067BE8 3C108007 */ lui $s0, %hi(g_CurrentPlayer) # $s0, 0x8007 -/* 09A5DC 7F067BEC 26108BC0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x7440 -/* 09A5E0 7F067BF0 ADC10000 */ sw $at, ($t6) -/* 09A5E4 7F067BF4 ADC80004 */ sw $t0, 4($t6) -/* 09A5E8 7F067BF8 8E030000 */ lw $v1, ($s0) -/* 09A5EC 7F067BFC 8C690FC4 */ lw $t1, 0xfc4($v1) -/* 09A5F0 7F067C00 AC690FC8 */ sw $t1, 0xfc8($v1) -/* 09A5F4 7F067C04 8E0A0000 */ lw $t2, ($s0) -/* 09A5F8 7F067C08 AD440FC4 */ sw $a0, 0xfc4($t2) -/* 09A5FC 7F067C0C 8E030000 */ lw $v1, ($s0) -/* 09A600 7F067C10 8C620FC4 */ lw $v0, 0xfc4($v1) -/* 09A604 7F067C14 14400008 */ bnez $v0, .L7F067C38 -/* 09A608 7F067C18 00000000 */ nop -/* 09A60C 7F067C1C 8C6B0FC8 */ lw $t3, 0xfc8($v1) -/* 09A610 7F067C20 240C0001 */ li $t4, 1 -/* 09A614 7F067C24 11600004 */ beqz $t3, .L7F067C38 -/* 09A618 7F067C28 00000000 */ nop -/* 09A61C 7F067C2C AC6C0FC0 */ sw $t4, 0xfc0($v1) -/* 09A620 7F067C30 8E030000 */ lw $v1, ($s0) -/* 09A624 7F067C34 8C620FC4 */ lw $v0, 0xfc4($v1) -.L7F067C38: -/* 09A628 7F067C38 5040012A */ beql $v0, $zero, .L7F0680E4 -/* 09A62C 7F067C3C AC600FCC */ sw $zero, 0xfcc($v1) -/* 09A630 7F067C40 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09A634 7F067C44 00002025 */ move $a0, $zero -/* 09A638 7F067C48 AFA20044 */ sw $v0, 0x44($sp) -/* 09A63C 7F067C4C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09A640 7F067C50 24040001 */ li $a0, 1 -/* 09A644 7F067C54 8E030000 */ lw $v1, ($s0) -/* 09A648 7F067C58 AFA20040 */ sw $v0, 0x40($sp) -/* 09A64C 7F067C5C 3C198004 */ lui $t9, %hi(g_ClockTimer) # $t9, 0x8004 -/* 09A650 7F067C60 8F390FF4 */ lw $t9, %lo(g_ClockTimer)($t9) -/* 09A654 7F067C64 8C6D0FCC */ lw $t5, 0xfcc($v1) -/* 09A658 7F067C68 8FA40044 */ lw $a0, 0x44($sp) -/* 09A65C 7F067C6C 01B9C021 */ addu $t8, $t5, $t9 -/* 09A660 7F067C70 108000FD */ beqz $a0, .L7F068068 -/* 09A664 7F067C74 AC780FCC */ sw $t8, 0xfcc($v1) -/* 09A668 7F067C78 504000FC */ beql $v0, $zero, .L7F06806C -/* 09A66C 7F067C7C 8E0D0000 */ lw $t5, ($s0) -/* 09A670 7F067C80 0FC1795B */ jal bondwalkItemCheckBitflags -/* 09A674 7F067C84 24050080 */ li $a1, 128 -/* 09A678 7F067C88 10400049 */ beqz $v0, .L7F067DB0 -/* 09A67C 7F067C8C 8FA40040 */ lw $a0, 0x40($sp) -/* 09A680 7F067C90 0FC1795B */ jal bondwalkItemCheckBitflags -/* 09A684 7F067C94 24050080 */ li $a1, 128 -/* 09A688 7F067C98 50400046 */ beql $v0, $zero, .Leu7F067DB4 -/* 09A68C 7F067C9C 8FA40044 */ lw $a0, 0x44($sp) -/* 09A690 7F067CA0 8E030000 */ lw $v1, ($s0) -/* 09A694 7F067CA4 8C6E0FCC */ lw $t6, 0xfcc($v1) -/* 09A698 7F067CA8 29C10019 */ slti $at, $t6, 0x19 -/* 09A69C 7F067CAC 54200022 */ bnezl $at, .L7F067D38 -/* 09A6A0 7F067CB0 8C6C0FC8 */ lw $t4, 0xfc8($v1) -/* 09A6A4 7F067CB4 8C6F0FD0 */ lw $t7, 0xfd0($v1) -/* 09A6A8 7F067CB8 24020001 */ li $v0, 1 -/* 09A6AC 7F067CBC 000F4080 */ sll $t0, $t7, 2 -/* 09A6B0 7F067CC0 03A84821 */ addu $t1, $sp, $t0 -/* 09A6B4 7F067CC4 AD220048 */ sw $v0, 0x48($t1) -/* 09A6B8 7F067CC8 8C6A0FD0 */ lw $t2, 0xfd0($v1) -/* 09A6BC 7F067CCC 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A6C0 7F067CD0 004A2023 */ subu $a0, $v0, $t2 -/* 09A6C4 7F067CD4 54400010 */ bnezl $v0, .L7F067D18 -/* 09A6C8 7F067CD8 8E0F0000 */ lw $t7, ($s0) -/* 09A6CC 7F067CDC 8E030000 */ lw $v1, ($s0) -/* 09A6D0 7F067CE0 8C6B0FD0 */ lw $t3, 0xfd0($v1) -/* 09A6D4 7F067CE4 000B60C0 */ sll $t4, $t3, 3 -/* 09A6D8 7F067CE8 018B6023 */ subu $t4, $t4, $t3 -/* 09A6DC 7F067CEC 000C6080 */ sll $t4, $t4, 2 -/* 09A6E0 7F067CF0 018B6021 */ addu $t4, $t4, $t3 -/* 09A6E4 7F067CF4 000C6080 */ sll $t4, $t4, 2 -/* 09A6E8 7F067CF8 018B6021 */ addu $t4, $t4, $t3 -/* 09A6EC 7F067CFC 000C60C0 */ sll $t4, $t4, 3 -/* 09A6F0 7F067D00 000C6823 */ negu $t5, $t4 -/* 09A6F4 7F067D04 006DC821 */ addu $t9, $v1, $t5 -/* 09A6F8 7F067D08 8F380C20 */ lw $t8, 0xc20($t9) -/* 09A6FC 7F067D0C 530000F6 */ beql $t8, $zero, .L7F0680E8 -/* 09A700 7F067D10 00002025 */ move $a0, $zero -/* 09A704 7F067D14 8E0F0000 */ lw $t7, ($s0) -.L7F067D18: -/* 09A708 7F067D18 240E0001 */ li $t6, 1 -/* 09A70C 7F067D1C 8DE80FD0 */ lw $t0, 0xfd0($t7) -/* 09A710 7F067D20 00084880 */ sll $t1, $t0, 2 -/* 09A714 7F067D24 00095023 */ negu $t2, $t1 -/* 09A718 7F067D28 03AA5821 */ addu $t3, $sp, $t2 -/* 09A71C 7F067D2C 100000ED */ b .L7F0680E4 -/* 09A720 7F067D30 AD6E004C */ sw $t6, 0x4c($t3) -/* 09A724 7F067D34 8C6C0FC8 */ lw $t4, 0xfc8($v1) -.L7F067D38: -/* 09A728 7F067D38 55800012 */ bnezl $t4, .L7F067D84 -/* 09A72C 7F067D3C 8E030000 */ lw $v1, ($s0) -/* 09A730 7F067D40 8C6D0FD0 */ lw $t5, 0xfd0($v1) -/* 09A734 7F067D44 24190001 */ li $t9, 1 -/* 09A738 7F067D48 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A73C 7F067D4C 032D2023 */ subu $a0, $t9, $t5 -/* 09A740 7F067D50 54400007 */ bnezl $v0, .L7F067D70 -/* 09A744 7F067D54 8E030000 */ lw $v1, ($s0) -/* 09A748 7F067D58 8E180000 */ lw $t8, ($s0) -/* 09A74C 7F067D5C 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A750 7F067D60 8F040FD0 */ lw $a0, 0xfd0($t8) -/* 09A754 7F067D64 54400007 */ bnezl $v0, .L7F067D84 -/* 09A758 7F067D68 8E030000 */ lw $v1, ($s0) -/* 09A75C 7F067D6C 8E030000 */ lw $v1, ($s0) -.L7F067D70: -/* 09A760 7F067D70 24080001 */ li $t0, 1 -/* 09A764 7F067D74 8C6F0FD0 */ lw $t7, 0xfd0($v1) -/* 09A768 7F067D78 010F4823 */ subu $t1, $t0, $t7 -/* 09A76C 7F067D7C AC690FD0 */ sw $t1, 0xfd0($v1) -/* 09A770 7F067D80 8E030000 */ lw $v1, ($s0) -.L7F067D84: -/* 09A774 7F067D84 240E0001 */ li $t6, 1 -/* 09A778 7F067D88 8C6A0FD0 */ lw $t2, 0xfd0($v1) -/* 09A77C 7F067D8C 000A5880 */ sll $t3, $t2, 2 -/* 09A780 7F067D90 03AB6021 */ addu $t4, $sp, $t3 -/* 09A784 7F067D94 AD8E0048 */ sw $t6, 0x48($t4) -/* 09A788 7F067D98 8C790FD0 */ lw $t9, 0xfd0($v1) -/* 09A78C 7F067D9C 00196880 */ sll $t5, $t9, 2 -/* 09A790 7F067DA0 000DC023 */ negu $t8, $t5 -/* 09A794 7F067DA4 03B84021 */ addu $t0, $sp, $t8 -/* 09A798 7F067DA8 100000CE */ b .L7F0680E4 -/* 09A79C 7F067DAC AD00004C */ sw $zero, 0x4c($t0) -.L7F067DB0: -/* 09A7A0 7F067DB0 8FA40044 */ lw $a0, 0x44($sp) -.Leu7F067DB4: -/* 09A7A4 7F067DB4 0FC1795B */ jal bondwalkItemCheckBitflags -/* 09A7A8 7F067DB8 24050080 */ li $a1, 128 -/* 09A7AC 7F067DBC 14400005 */ bnez $v0, .L7F067DD4 -/* 09A7B0 7F067DC0 8FA40040 */ lw $a0, 0x40($sp) -/* 09A7B4 7F067DC4 0FC1795B */ jal bondwalkItemCheckBitflags -/* 09A7B8 7F067DC8 24050080 */ li $a1, 128 -/* 09A7BC 7F067DCC 50400063 */ beql $v0, $zero, .L7F067F5C -/* 09A7C0 7F067DD0 8E030000 */ lw $v1, ($s0) -.L7F067DD4: -/* 09A7C4 7F067DD4 8E030000 */ lw $v1, ($s0) -/* 09A7C8 7F067DD8 8FA40044 */ lw $a0, 0x44($sp) -/* 09A7CC 7F067DDC 8C6F0FCC */ lw $t7, 0xfcc($v1) -/* 09A7D0 7F067DE0 29E10025 */ slti $at, $t7, 0x25 -/* 09A7D4 7F067DE4 14200021 */ bnez $at, .L7F067E6C -/* 09A7D8 7F067DE8 00000000 */ nop -/* 09A7DC 7F067DEC 8C690FD0 */ lw $t1, 0xfd0($v1) -/* 09A7E0 7F067DF0 24020001 */ li $v0, 1 -/* 09A7E4 7F067DF4 00095080 */ sll $t2, $t1, 2 -/* 09A7E8 7F067DF8 03AA7021 */ addu $t6, $sp, $t2 -/* 09A7EC 7F067DFC ADC20048 */ sw $v0, 0x48($t6) -/* 09A7F0 7F067E00 8C6B0FD0 */ lw $t3, 0xfd0($v1) -/* 09A7F4 7F067E04 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A7F8 7F067E08 004B2023 */ subu $a0, $v0, $t3 -/* 09A7FC 7F067E0C 54400010 */ bnezl $v0, .L7F067E50 -/* 09A800 7F067E10 8E090000 */ lw $t1, ($s0) -/* 09A804 7F067E14 8E030000 */ lw $v1, ($s0) -/* 09A808 7F067E18 8C6C0FD0 */ lw $t4, 0xfd0($v1) -/* 09A80C 7F067E1C 000CC8C0 */ sll $t9, $t4, 3 -/* 09A810 7F067E20 032CC823 */ subu $t9, $t9, $t4 -/* 09A814 7F067E24 0019C880 */ sll $t9, $t9, 2 -/* 09A818 7F067E28 032CC821 */ addu $t9, $t9, $t4 -/* 09A81C 7F067E2C 0019C880 */ sll $t9, $t9, 2 -/* 09A820 7F067E30 032CC821 */ addu $t9, $t9, $t4 -/* 09A824 7F067E34 0019C8C0 */ sll $t9, $t9, 3 -/* 09A828 7F067E38 00196823 */ negu $t5, $t9 -/* 09A82C 7F067E3C 006DC021 */ addu $t8, $v1, $t5 -/* 09A830 7F067E40 8F080C20 */ lw $t0, 0xc20($t8) -/* 09A834 7F067E44 510000A8 */ beql $t0, $zero, .L7F0680E8 -/* 09A838 7F067E48 00002025 */ move $a0, $zero -/* 09A83C 7F067E4C 8E090000 */ lw $t1, ($s0) -.L7F067E50: -/* 09A840 7F067E50 240F0001 */ li $t7, 1 -/* 09A844 7F067E54 8D2A0FD0 */ lw $t2, 0xfd0($t1) -/* 09A848 7F067E58 000A7080 */ sll $t6, $t2, 2 -/* 09A84C 7F067E5C 000E5823 */ negu $t3, $t6 -/* 09A850 7F067E60 03AB6021 */ addu $t4, $sp, $t3 -/* 09A854 7F067E64 1000009F */ b .L7F0680E4 -/* 09A858 7F067E68 AD8F004C */ sw $t7, 0x4c($t4) -.L7F067E6C: -/* 09A85C 7F067E6C 0FC1795B */ jal bondwalkItemCheckBitflags -/* 09A860 7F067E70 24050080 */ li $a1, 128 -/* 09A864 7F067E74 10400003 */ beqz $v0, .L7F067E84 -/* 09A868 7F067E78 24050001 */ li $a1, 1 -/* 09A86C 7F067E7C 10000001 */ b .L7F067E84 -/* 09A870 7F067E80 00002825 */ move $a1, $zero -.L7F067E84: -/* 09A874 7F067E84 00A02025 */ move $a0, $a1 -/* 09A878 7F067E88 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A87C 7F067E8C AFA5003C */ sw $a1, 0x3c($sp) -/* 09A880 7F067E90 1440000F */ bnez $v0, .L7F067ED0 -/* 09A884 7F067E94 8FA5003C */ lw $a1, 0x3c($sp) -/* 09A888 7F067E98 000530C0 */ sll $a2, $a1, 3 -/* 09A88C 7F067E9C 00C53023 */ subu $a2, $a2, $a1 -/* 09A890 7F067EA0 00063080 */ sll $a2, $a2, 2 -/* 09A894 7F067EA4 00C53021 */ addu $a2, $a2, $a1 -/* 09A898 7F067EA8 8E190000 */ lw $t9, ($s0) -/* 09A89C 7F067EAC 00063080 */ sll $a2, $a2, 2 -/* 09A8A0 7F067EB0 00C53021 */ addu $a2, $a2, $a1 -/* 09A8A4 7F067EB4 000630C0 */ sll $a2, $a2, 3 -/* 09A8A8 7F067EB8 03266821 */ addu $t5, $t9, $a2 -/* 09A8AC 7F067EBC 8DB80878 */ lw $t8, 0x878($t5) -/* 09A8B0 7F067EC0 24090001 */ li $t1, 1 -/* 09A8B4 7F067EC4 01252023 */ subu $a0, $t1, $a1 -/* 09A8B8 7F067EC8 53000005 */ beql $t8, $zero, .L7F067EE0 -/* 09A8BC 7F067ECC AFA40020 */ sw $a0, 0x20($sp) -.L7F067ED0: -/* 09A8C0 7F067ED0 8E080000 */ lw $t0, ($s0) -/* 09A8C4 7F067ED4 10000014 */ b .L7F067F28 -/* 09A8C8 7F067ED8 AD050FD0 */ sw $a1, 0xfd0($t0) -/* 09A8CC 7F067EDC AFA40020 */ sw $a0, 0x20($sp) -.L7F067EE0: -/* 09A8D0 7F067EE0 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A8D4 7F067EE4 AFA60024 */ sw $a2, 0x24($sp) -/* 09A8D8 7F067EE8 8FA40020 */ lw $a0, 0x20($sp) -/* 09A8DC 7F067EEC 14400007 */ bnez $v0, .L7F067F0C -/* 09A8E0 7F067EF0 8FA60024 */ lw $a2, 0x24($sp) -/* 09A8E4 7F067EF4 8E030000 */ lw $v1, ($s0) -/* 09A8E8 7F067EF8 00065023 */ negu $t2, $a2 -/* 09A8EC 7F067EFC 006A7021 */ addu $t6, $v1, $t2 -/* 09A8F0 7F067F00 8DCF0C20 */ lw $t7, 0xc20($t6) -/* 09A8F4 7F067F04 51E00005 */ beql $t7, $zero, .L7F067F1C -/* 09A8F8 7F067F08 8C6C0FD0 */ lw $t4, 0xfd0($v1) -.L7F067F0C: -/* 09A8FC 7F067F0C 8E0B0000 */ lw $t3, ($s0) -/* 09A900 7F067F10 10000005 */ b .L7F067F28 -/* 09A904 7F067F14 AD640FD0 */ sw $a0, 0xfd0($t3) -/* 09A908 7F067F18 8C6C0FD0 */ lw $t4, 0xfd0($v1) -.L7F067F1C: -/* 09A90C 7F067F1C 24190001 */ li $t9, 1 -/* 09A910 7F067F20 032C6823 */ subu $t5, $t9, $t4 -/* 09A914 7F067F24 AC6D0FD0 */ sw $t5, 0xfd0($v1) -.L7F067F28: -/* 09A918 7F067F28 8E030000 */ lw $v1, ($s0) -/* 09A91C 7F067F2C 24180001 */ li $t8, 1 -/* 09A920 7F067F30 8C680FD0 */ lw $t0, 0xfd0($v1) -/* 09A924 7F067F34 00084880 */ sll $t1, $t0, 2 -/* 09A928 7F067F38 03A95021 */ addu $t2, $sp, $t1 -/* 09A92C 7F067F3C AD580048 */ sw $t8, 0x48($t2) -/* 09A930 7F067F40 8C6E0FD0 */ lw $t6, 0xfd0($v1) -/* 09A934 7F067F44 000E7880 */ sll $t7, $t6, 2 -/* 09A938 7F067F48 000F5823 */ negu $t3, $t7 -/* 09A93C 7F067F4C 03ABC821 */ addu $t9, $sp, $t3 -/* 09A940 7F067F50 10000064 */ b .L7F0680E4 -/* 09A944 7F067F54 AF20004C */ sw $zero, 0x4c($t9) -/* 09A948 7F067F58 8E030000 */ lw $v1, ($s0) -.L7F067F5C: -/* 09A94C 7F067F5C 8C6C0FCC */ lw $t4, 0xfcc($v1) -/* 09A950 7F067F60 29810025 */ slti $at, $t4, 0x25 -/* 09A954 7F067F64 54200022 */ bnezl $at, .L7F067FF0 -/* 09A958 7F067F68 8C6E0FC8 */ lw $t6, 0xfc8($v1) -/* 09A95C 7F067F6C 8C6D0FD0 */ lw $t5, 0xfd0($v1) -/* 09A960 7F067F70 24020001 */ li $v0, 1 -/* 09A964 7F067F74 000D4080 */ sll $t0, $t5, 2 -/* 09A968 7F067F78 03A8C021 */ addu $t8, $sp, $t0 -/* 09A96C 7F067F7C AF020048 */ sw $v0, 0x48($t8) -/* 09A970 7F067F80 8C690FD0 */ lw $t1, 0xfd0($v1) -/* 09A974 7F067F84 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A978 7F067F88 00492023 */ subu $a0, $v0, $t1 -/* 09A97C 7F067F8C 54400010 */ bnezl $v0, .L7F067FD0 -/* 09A980 7F067F90 8E0D0000 */ lw $t5, ($s0) -/* 09A984 7F067F94 8E030000 */ lw $v1, ($s0) -/* 09A988 7F067F98 8C6A0FD0 */ lw $t2, 0xfd0($v1) -/* 09A98C 7F067F9C 000A70C0 */ sll $t6, $t2, 3 -/* 09A990 7F067FA0 01CA7023 */ subu $t6, $t6, $t2 -/* 09A994 7F067FA4 000E7080 */ sll $t6, $t6, 2 -/* 09A998 7F067FA8 01CA7021 */ addu $t6, $t6, $t2 -/* 09A99C 7F067FAC 000E7080 */ sll $t6, $t6, 2 -/* 09A9A0 7F067FB0 01CA7021 */ addu $t6, $t6, $t2 -/* 09A9A4 7F067FB4 000E70C0 */ sll $t6, $t6, 3 -/* 09A9A8 7F067FB8 000E7823 */ negu $t7, $t6 -/* 09A9AC 7F067FBC 006F5821 */ addu $t3, $v1, $t7 -/* 09A9B0 7F067FC0 8D790C20 */ lw $t9, 0xc20($t3) -/* 09A9B4 7F067FC4 53200048 */ beql $t9, $zero, .L7F0680E8 -/* 09A9B8 7F067FC8 00002025 */ move $a0, $zero -/* 09A9BC 7F067FCC 8E0D0000 */ lw $t5, ($s0) -.L7F067FD0: -/* 09A9C0 7F067FD0 240C0001 */ li $t4, 1 -/* 09A9C4 7F067FD4 8DA80FD0 */ lw $t0, 0xfd0($t5) -/* 09A9C8 7F067FD8 0008C080 */ sll $t8, $t0, 2 -/* 09A9CC 7F067FDC 00184823 */ negu $t1, $t8 -/* 09A9D0 7F067FE0 03A95021 */ addu $t2, $sp, $t1 -/* 09A9D4 7F067FE4 1000003F */ b .L7F0680E4 -/* 09A9D8 7F067FE8 AD4C004C */ sw $t4, 0x4c($t2) -/* 09A9DC 7F067FEC 8C6E0FC8 */ lw $t6, 0xfc8($v1) -.L7F067FF0: -/* 09A9E0 7F067FF0 55C00012 */ bnezl $t6, .L7F06803C -/* 09A9E4 7F067FF4 8E030000 */ lw $v1, ($s0) -/* 09A9E8 7F067FF8 8C6F0FD0 */ lw $t7, 0xfd0($v1) -/* 09A9EC 7F067FFC 240B0001 */ li $t3, 1 -/* 09A9F0 7F068000 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09A9F4 7F068004 016F2023 */ subu $a0, $t3, $t7 -/* 09A9F8 7F068008 54400007 */ bnezl $v0, .L7F068028 -/* 09A9FC 7F06800C 8E030000 */ lw $v1, ($s0) -/* 09AA00 7F068010 8E190000 */ lw $t9, ($s0) -/* 09AA04 7F068014 0FC19ED7 */ jal sub_GAME_7F0673B4 -/* 09AA08 7F068018 8F240FD0 */ lw $a0, 0xfd0($t9) -/* 09AA0C 7F06801C 54400007 */ bnezl $v0, .L7F06803C -/* 09AA10 7F068020 8E030000 */ lw $v1, ($s0) -/* 09AA14 7F068024 8E030000 */ lw $v1, ($s0) -.L7F068028: -/* 09AA18 7F068028 24080001 */ li $t0, 1 -/* 09AA1C 7F06802C 8C6D0FD0 */ lw $t5, 0xfd0($v1) -/* 09AA20 7F068030 010DC023 */ subu $t8, $t0, $t5 -/* 09AA24 7F068034 AC780FD0 */ sw $t8, 0xfd0($v1) -/* 09AA28 7F068038 8E030000 */ lw $v1, ($s0) -.L7F06803C: -/* 09AA2C 7F06803C 240C0001 */ li $t4, 1 -/* 09AA30 7F068040 8C690FD0 */ lw $t1, 0xfd0($v1) -/* 09AA34 7F068044 00095080 */ sll $t2, $t1, 2 -/* 09AA38 7F068048 03AA7021 */ addu $t6, $sp, $t2 -/* 09AA3C 7F06804C ADCC0048 */ sw $t4, 0x48($t6) -/* 09AA40 7F068050 8C6B0FD0 */ lw $t3, 0xfd0($v1) -/* 09AA44 7F068054 000B7880 */ sll $t7, $t3, 2 -/* 09AA48 7F068058 000FC823 */ negu $t9, $t7 -/* 09AA4C 7F06805C 03B94021 */ addu $t0, $sp, $t9 -/* 09AA50 7F068060 10000020 */ b .L7F0680E4 -/* 09AA54 7F068064 AD00004C */ sw $zero, 0x4c($t0) -.L7F068068: -/* 09AA58 7F068068 8E0D0000 */ lw $t5, ($s0) -.L7F06806C: -/* 09AA5C 7F06806C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09AA60 7F068070 8DA40FD0 */ lw $a0, 0xfd0($t5) -/* 09AA64 7F068074 5440000E */ bnezl $v0, .L7F0680B0 -/* 09AA68 7F068078 8E030000 */ lw $v1, ($s0) -/* 09AA6C 7F06807C 8E180000 */ lw $t8, ($s0) -/* 09AA70 7F068080 240C0001 */ li $t4, 1 -/* 09AA74 7F068084 8F090FD0 */ lw $t1, 0xfd0($t8) -/* 09AA78 7F068088 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09AA7C 7F06808C 01892023 */ subu $a0, $t4, $t1 -/* 09AA80 7F068090 50400007 */ beql $v0, $zero, .L7F0680B0 -/* 09AA84 7F068094 8E030000 */ lw $v1, ($s0) -/* 09AA88 7F068098 8E030000 */ lw $v1, ($s0) -/* 09AA8C 7F06809C 240E0001 */ li $t6, 1 -/* 09AA90 7F0680A0 8C6A0FD0 */ lw $t2, 0xfd0($v1) -/* 09AA94 7F0680A4 01CA5823 */ subu $t3, $t6, $t2 -/* 09AA98 7F0680A8 AC6B0FD0 */ sw $t3, 0xfd0($v1) -/* 09AA9C 7F0680AC 8E030000 */ lw $v1, ($s0) -.L7F0680B0: -/* 09AAA0 7F0680B0 240F0001 */ li $t7, 1 -/* 09AAA4 7F0680B4 8C790FD0 */ lw $t9, 0xfd0($v1) -/* 09AAA8 7F0680B8 00194080 */ sll $t0, $t9, 2 -/* 09AAAC 7F0680BC 03A86821 */ addu $t5, $sp, $t0 -/* 09AAB0 7F0680C0 ADAF0048 */ sw $t7, 0x48($t5) -/* 09AAB4 7F0680C4 8C780FD0 */ lw $t8, 0xfd0($v1) -/* 09AAB8 7F0680C8 00186080 */ sll $t4, $t8, 2 -/* 09AABC 7F0680CC 000C4823 */ negu $t1, $t4 -/* 09AAC0 7F0680D0 03A97021 */ addu $t6, $sp, $t1 -/* 09AAC4 7F0680D4 ADC0004C */ sw $zero, 0x4c($t6) -/* 09AAC8 7F0680D8 10000003 */ b .L7F0680E8 -/* 09AACC 7F0680DC 00002025 */ move $a0, $zero -/* 09AAD0 7F0680E0 AC600FCC */ sw $zero, 0xfcc($v1) -.L7F0680E4: -/* 09AAD4 7F0680E4 00002025 */ move $a0, $zero -.L7F0680E8: -/* 09AAD8 7F0680E8 0FC19409 */ jal handle_weapon_id_values_possibly_1st_person_animation -/* 09AADC 7F0680EC 8FA50048 */ lw $a1, 0x48($sp) -/* 09AAE0 7F0680F0 24040001 */ li $a0, 1 -/* 09AAE4 7F0680F4 0FC19409 */ jal handle_weapon_id_values_possibly_1st_person_animation -/* 09AAE8 7F0680F8 8FA5004C */ lw $a1, 0x4c($sp) -/* 09AAEC 7F0680FC 0FC17550 */ jal used_to_load_1st_person_model_on_demand -/* 09AAF0 7F068100 00002025 */ move $a0, $zero -/* 09AAF4 7F068104 0FC17550 */ jal used_to_load_1st_person_model_on_demand -/* 09AAF8 7F068108 24040001 */ li $a0, 1 -/* 09AAFC 7F06810C 0FC19E53 */ jal sub_GAME_7F0671A4 -/* 09AB00 7F068110 00000000 */ nop -/* 09AB04 7F068114 8E0A0000 */ lw $t2, ($s0) -/* 09AB08 7F068118 8D4B0FD8 */ lw $t3, 0xfd8($t2) -/* 09AB0C 7F06811C 1160000A */ beqz $t3, .L7F068148 -/* 09AB10 7F068120 00000000 */ nop -/* 09AB14 7F068124 0FC22640 */ jal get_curplayer_positiondata -/* 09AB18 7F068128 00000000 */ nop -/* 09AB1C 7F06812C 8E050000 */ lw $a1, ($s0) -/* 09AB20 7F068130 00402025 */ move $a0, $v0 -/* 09AB24 7F068134 0FC10057 */ jal set_color_shading_from_tile -/* 09AB28 7F068138 24A50FD4 */ addiu $a1, $a1, 0xfd4 -/* 09AB2C 7F06813C 8E190000 */ lw $t9, ($s0) -/* 09AB30 7F068140 1000000A */ b .L7F06816C -/* 09AB34 7F068144 AF200FD8 */ sw $zero, 0xfd8($t9) -.L7F068148: -/* 09AB38 7F068148 0FC22640 */ jal get_curplayer_positiondata -/* 09AB3C 7F06814C 00000000 */ nop -/* 09AB40 7F068150 00402025 */ move $a0, $v0 -/* 09AB44 7F068154 0FC10057 */ jal set_color_shading_from_tile -/* 09AB48 7F068158 27A50038 */ addiu $a1, $sp, 0x38 -/* 09AB4C 7F06815C 8E040000 */ lw $a0, ($s0) -/* 09AB50 7F068160 27A50038 */ addiu $a1, $sp, 0x38 -/* 09AB54 7F068164 0FC100F4 */ jal update_color_shading -/* 09AB58 7F068168 24840FD4 */ addiu $a0, $a0, 0xfd4 -.L7F06816C: -/* 09AB5C 7F06816C 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09AB60 7F068170 00002025 */ move $a0, $zero -/* 09AB64 7F068174 AFA2002C */ sw $v0, 0x2c($sp) -/* 09AB68 7F068178 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 09AB6C 7F06817C 24040001 */ li $a0, 1 -/* 09AB70 7F068180 8FA4002C */ lw $a0, 0x2c($sp) -/* 09AB74 7F068184 0FC237D5 */ jal bondinvIncrementHeldTime -/* 09AB78 7F068188 00402825 */ move $a1, $v0 -/* 09AB7C 7F06818C 8E030000 */ lw $v1, ($s0) -/* 09AB80 7F068190 3C0F8004 */ lui $t7, %hi(g_ClockTimer) # $t7, 0x8004 -/* 09AB84 7F068194 8C621268 */ lw $v0, 0x1268($v1) -/* 09AB88 7F068198 04420028 */ bltzl $v0, .L7F06823C -/* 09AB8C 7F06819C 8FBF001C */ lw $ra, 0x1c($sp) -/* 09AB90 7F0681A0 8DEF0FF4 */ lw $t7, %lo(g_ClockTimer)($t7) -/* 09AB94 7F0681A4 24670868 */ addiu $a3, $v1, 0x868 -/* 09AB98 7F0681A8 2418FFFF */ li $t8, -1 -/* 09AB9C 7F0681AC 004F4021 */ addu $t0, $v0, $t7 -/* 09ABA0 7F0681B0 AC681268 */ sw $t0, 0x1268($v1) -/* 09ABA4 7F0681B4 8E030000 */ lw $v1, ($s0) -/* 09ABA8 7F0681B8 8C6D1268 */ lw $t5, 0x1268($v1) -/* 09ABAC 7F0681BC 29A100FA */ slti $at, $t5, 0xfa -/* 09ABB0 7F0681C0 50200014 */ beql $at, $zero, .L7F068214 -/* 09ABB4 7F0681C4 AC781268 */ sw $t8, 0x1268($v1) -/* 09ABB8 7F0681C8 8CE401D4 */ lw $a0, 0x1d4($a3) -/* 09ABBC 7F0681CC 10800005 */ beqz $a0, .L7F0681E4 -/* 09ABC0 7F0681D0 00000000 */ nop -/* 09ABC4 7F0681D4 0C002094 */ jal sndGetPlayingState -/* 09ABC8 7F0681D8 AFA70034 */ sw $a3, 0x34($sp) -/* 09ABCC 7F0681DC 14400016 */ bnez $v0, .L7F068238 -/* 09ABD0 7F0681E0 8FA70034 */ lw $a3, 0x34($sp) -.L7F0681E4: -/* 09ABD4 7F0681E4 0FC2FC1E */ jal lvlGetControlsLockedFlag -/* 09ABD8 7F0681E8 AFA70034 */ sw $a3, 0x34($sp) -/* 09ABDC 7F0681EC 14400012 */ bnez $v0, .L7F068238 -/* 09ABE0 7F0681F0 8FA70034 */ lw $a3, 0x34($sp) -/* 09ABE4 7F0681F4 3C048005 */ lui $a0, %hi(g_musicSfxBufferPtr) # $a0, 0x8005 -/* 09ABE8 7F0681F8 8C846900 */ lw $a0, %lo(g_musicSfxBufferPtr)($a0) -/* 09ABEC 7F0681FC 240500F6 */ li $a1, 246 -/* 09ABF0 7F068200 0C00209A */ jal sndPlaySfx -/* 09ABF4 7F068204 24E601D4 */ addiu $a2, $a3, 0x1d4 -/* 09ABF8 7F068208 1000000C */ b .L7F06823C -/* 09ABFC 7F06820C 8FBF001C */ lw $ra, 0x1c($sp) -/* 09AC00 7F068210 AC781268 */ sw $t8, 0x1268($v1) -.L7F068214: -/* 09AC04 7F068214 8CE401D4 */ lw $a0, 0x1d4($a3) -/* 09AC08 7F068218 50800008 */ beql $a0, $zero, .L7F06823C -/* 09AC0C 7F06821C 8FBF001C */ lw $ra, 0x1c($sp) -/* 09AC10 7F068220 0C002094 */ jal sndGetPlayingState -/* 09AC14 7F068224 AFA70034 */ sw $a3, 0x34($sp) -/* 09AC18 7F068228 10400003 */ beqz $v0, .L7F068238 -/* 09AC1C 7F06822C 8FA70034 */ lw $a3, 0x34($sp) -/* 09AC20 7F068230 0C002120 */ jal sndDeactivate -/* 09AC24 7F068234 8CE401D4 */ lw $a0, 0x1d4($a3) -.L7F068238: -/* 09AC28 7F068238 8FBF001C */ lw $ra, 0x1c($sp) -.L7F06823C: -/* 09AC2C 7F06823C 8FB00018 */ lw $s0, 0x18($sp) -/* 09AC30 7F068240 27BD0050 */ addiu $sp, $sp, 0x50 -/* 09AC34 7F068244 03E00008 */ jr $ra -/* 09AC38 7F068248 00000000 */ nop -) -#endif -#endif + if (g_CurrentPlayer->field_FCC != 0) + { + sp44 = getCurrentPlayerWeaponId(GUNRIGHT); + sp40 = getCurrentPlayerWeaponId(GUNLEFT); + + g_CurrentPlayer->z_trigger_timer += g_ClockTimer; + + if ((sp44 != ITEM_UNARMED) && (sp40 != ITEM_UNARMED)) + { + if ((bondwalkItemCheckBitflags(sp44, 0x80U) != 0) && (bondwalkItemCheckBitflags(sp40, 0x80U) != 0)) + { + if (g_CurrentPlayer->z_trigger_timer > DUAL_WIELD_TRIGGER_SWAP_TICKS) + { + sp48z.arr[g_CurrentPlayer->field_FD8] = sp3C; + + if (sub_GAME_7F0673B4(1 - g_CurrentPlayer->field_FD8) || g_CurrentPlayer->hands[1 - g_CurrentPlayer->field_FD8].weapon_hold_time) + { + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 1; + } + } + else + { + if ((g_CurrentPlayer->field_FD0 == 0) && + ((sub_GAME_7F0673B4(1 - g_CurrentPlayer->field_FD8) != 0) || (sub_GAME_7F0673B4(g_CurrentPlayer->field_FD8) == 0))) + { + g_CurrentPlayer->field_FD8 = 1 - g_CurrentPlayer->field_FD8; + } + + sp48z.arr[g_CurrentPlayer->field_FD8] = 1; + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 0; + } + } + else if ((bondwalkItemCheckBitflags(sp44, 0x80U) != 0) || (bondwalkItemCheckBitflags(sp40, 0x80U) != 0)) + { + if (g_CurrentPlayer->z_trigger_timer > DUAL_WIELD_SINGLE_TRIGGER_SWAP_TICKS) + { + sp48z.arr[g_CurrentPlayer->field_FD8] = sp3C; + + if ((sub_GAME_7F0673B4(1 - g_CurrentPlayer->field_FD8) != 0) || g_CurrentPlayer->hands[1 - g_CurrentPlayer->field_FD8].weapon_hold_time != 0) + { + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 1; + } + } + else + { + sp3C = bondwalkItemCheckBitflags(sp44, 0x80U) ? GUNRIGHT : GUNLEFT; + + if (sub_GAME_7F0673B4(sp3C) != 0 || g_CurrentPlayer->hands[sp3C].weapon_hold_time != 0) + { + g_CurrentPlayer->field_FD8 = sp3C; + } + else + { + if ((sub_GAME_7F0673B4(1 - sp3C) != 0) || g_CurrentPlayer->hands[1 - sp3C].weapon_hold_time != 0) + { + g_CurrentPlayer->field_FD8 = 1 - sp3C; + } + else + { + g_CurrentPlayer->field_FD8 = 1 - g_CurrentPlayer->field_FD8; + } + } + + sp48z.arr[g_CurrentPlayer->field_FD8] = 1; + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 0; + } + } + else if (g_CurrentPlayer->z_trigger_timer > DUAL_WIELD_SINGLE_TRIGGER_SWAP_TICKS) + { + sp48z.arr[g_CurrentPlayer->field_FD8] = sp3C; + + if (sub_GAME_7F0673B4(1 - g_CurrentPlayer->field_FD8) || g_CurrentPlayer->hands[1 - g_CurrentPlayer->field_FD8].weapon_hold_time) + { + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 1; + } + } + else + { + if ((g_CurrentPlayer->field_FD0 == 0) && + ((sub_GAME_7F0673B4(1 - g_CurrentPlayer->field_FD8) != 0) || (sub_GAME_7F0673B4(g_CurrentPlayer->field_FD8) == 0))) + { + g_CurrentPlayer->field_FD8 = 1 - g_CurrentPlayer->field_FD8; + } + + sp48z.arr[g_CurrentPlayer->field_FD8] = 1; + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 0; + } + } + else + { + if ((getCurrentPlayerWeaponId(g_CurrentPlayer->field_FD8) == ITEM_UNARMED) && (getCurrentPlayerWeaponId(1 - g_CurrentPlayer->field_FD8) != ITEM_UNARMED)) + { + g_CurrentPlayer->field_FD8 = 1 - g_CurrentPlayer->field_FD8; + } + + sp48z.arr[g_CurrentPlayer->field_FD8] = 1; + sp48z.arr[1 - g_CurrentPlayer->field_FD8] = 0; + } + } + else + { + g_CurrentPlayer->z_trigger_timer = 0; + } + + handle_weapon_id_values_possibly_1st_person_animation(0, sp48z.arr[0]); + handle_weapon_id_values_possibly_1st_person_animation(1, sp48z.arr[1]); + used_to_load_1st_person_model_on_demand(0); + used_to_load_1st_person_model_on_demand(1); + sub_GAME_7F0671A4(); + + if (g_CurrentPlayer->resetshadecol != 0) + { + set_color_shading_from_tile(get_curplayer_positiondata(), (struct rgba_u8 *) &g_CurrentPlayer->tileColor); + g_CurrentPlayer->resetshadecol = 0; + } + else + { + set_color_shading_from_tile(get_curplayer_positiondata(), &sp38); + update_color_shading(&g_CurrentPlayer->tileColor, &sp38); + } + + bondinvIncrementHeldTime(getCurrentPlayerWeaponId(GUNRIGHT), getCurrentPlayerWeaponId(GUNLEFT)); + + if(1); + + if (g_CurrentPlayer->magnetattracttime >= 0) + { + struct hand *sp34 = &g_CurrentPlayer->hands[0]; + + g_CurrentPlayer->magnetattracttime += g_ClockTimer; + + if (g_CurrentPlayer->magnetattracttime < WATCH_SOUND_DURATION_TICKS) + { + if (sp34->audioHandle == NULL + || sndGetPlayingState((struct ALSoundState *) sp34->audioHandle) == 0) + { + if (lvlGetControlsLockedFlag() == 0) + { + sndPlaySfx( + (struct ALBankAlt_s *) g_musicSfxBufferPtr, + MAGNETIC_HUM_SFX, + (struct ALSoundState *) &sp34->audioHandle); + } + } + } + else + { + g_CurrentPlayer->magnetattracttime = -1; + + if (sp34->audioHandle != NULL) + { + if (sndGetPlayingState((struct ALSoundState *) sp34->audioHandle) != 0) + { + sndDeactivate((struct ALSoundState *) sp34->audioHandle); + } + } + } + } +} -void sub_GAME_7F067AA4(s32 param_1) + +void gunSetAimType(s32 param_1) { - g_CurrentPlayer->field_FE4 = param_1; + g_CurrentPlayer->aimtype = param_1; } @@ -23248,7 +22429,7 @@ void sub_GAME_7F068190(coord3d *zeropos, coord3d *vec) } -void sub_GAME_7F0681CC(coord3d* arg0, coord3d* arg1, enum GUNHAND arg2) +void bullet_path_from_screen_center(coord3d* arg0, coord3d* result, enum GUNHAND arg2) { coord2d crosspos; s32 unused; @@ -23257,26 +22438,29 @@ void sub_GAME_7F0681CC(coord3d* arg0, coord3d* arg1, enum GUNHAND arg2) f32 randfactor; inaccuracy = get_ptr_item_statistics(getCurrentPlayerWeaponId(arg2))->Inaccuracy; - if ((bondwalkItemCheckBitflags(get_item_in_hand_or_watch_menu(arg2), 0x1000U) != 0) && (g_CurrentPlayer->hands[arg2].field_C08 == 1)) + if ((bondwalkItemCheckBitflags(get_item_in_hand_or_watch_menu(arg2), WEAPONSTATBITFLAG_FIRST_SHOT_ACCURACY) != 0) && (g_CurrentPlayer->hands[arg2].volley == 1)) { + // Single shots are four times more accurate inaccuracy *= 0.25f; } scaledspread = (120.0f * inaccuracy) / viGetFovY(); randfactor = (RANDOMFRAC() - 0.5f) * RANDOMFRAC(); - crosspos.x = g_CurrentPlayer->crosshair_angle.f[0] + randfactor * scaledspread * getPlayer_c_screenwidth() * (PAL ? 1.1764706f : 1.3333334f) + crosspos.x = g_CurrentPlayer->crosshair_angle.f[0] + randfactor * scaledspread * getPlayer_c_screenwidth() * (PAL ? ASPECT_RATIO_PAL : ASPECT_RATIO_SD) / (getPlayer_c_perspaspect() * 320.0f); randfactor = (RANDOMFRAC() - 0.5f) * RANDOMFRAC(); crosspos.y = g_CurrentPlayer->crosshair_angle.f[1] + randfactor * scaledspread * getPlayer_c_screenheight() - / (PAL ? 272.0f : 240.0f); + / (PAL ? (f32)(SCREEN_HEIGHT_272) : (f32)(SCREEN_HEIGHT_240)); arg0->x = 0.0f; arg0->y = 0.0f; arg0->z = 0.0f; - sub_GAME_7F077EEC(&crosspos, arg1, 1.0f); + // Result is a normalized vector describing the path the bullet will follow + // Can be used to compute x,y,z displacement off the center of the screen if done for a projectile + sub_GAME_7F077EEC(&crosspos, result, 1.0f); } @@ -23524,7 +22708,7 @@ glabel sub_GAME_7F068508 /* 09D264 7F068734 E6040014 */ swc1 $f4, 0x14($s0) /* 09D268 7F068738 8D8CA0B0 */ lw $t4, %lo(g_CurrentPlayer)($t4) /* 09D26C 7F06873C 01912021 */ addu $a0, $t4, $s1 -/* 09D270 7F068740 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 09D270 7F068740 0FC160F6 */ jal mtx4RotateVecInPlace /* 09D274 7F068744 24840AD8 */ addiu $a0, $a0, 0xad8 /* 09D278 7F068748 0C002914 */ jal randomGetNext /* 09D27C 7F06874C 00000000 */ nop @@ -23742,7 +22926,7 @@ glabel sub_GAME_7F068508 /* 09D5AC 7F068A7C E6040014 */ swc1 $f4, 0x14($s0) /* 09D5B0 7F068A80 8DADA0B0 */ lw $t5, %lo(g_CurrentPlayer)($t5) /* 09D5B4 7F068A84 01B12021 */ addu $a0, $t5, $s1 -/* 09D5B8 7F068A88 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 09D5B8 7F068A88 0FC160F6 */ jal mtx4RotateVecInPlace /* 09D5BC 7F068A8C 24840AD8 */ addiu $a0, $a0, 0xad8 /* 09D5C0 7F068A90 0C002914 */ jal randomGetNext /* 09D5C4 7F068A94 00000000 */ nop @@ -24112,7 +23296,7 @@ glabel sub_GAME_7F068508 /* 09B88C 7F068E9C E6040014 */ swc1 $f4, 0x14($s0) /* 09B890 7F068EA0 8D8C8BC0 */ lw $t4, %lo(g_CurrentPlayer)($t4) /* 09B894 7F068EA4 01912021 */ addu $a0, $t4, $s1 -/* 09B898 7F068EA8 0FC16220 */ jal matrix_4x4_rotate_vector_in_place +/* 09B898 7F068EA8 0FC16220 */ jal mtx4RotateVecInPlace /* 09B89C 7F068EAC 24840AD0 */ addiu $a0, $a0, 0xad0 /* 09B8A0 7F068EB0 0C00262C */ jal randomGetNext /* 09B8A4 7F068EB4 00000000 */ nop @@ -24333,7 +23517,7 @@ glabel sub_GAME_7F068508 /* 09BBE0 7F0691F0 E6040014 */ swc1 $f4, 0x14($s0) /* 09BBE4 7F0691F4 8DAD8BC0 */ lw $t5, %lo(g_CurrentPlayer)($t5) /* 09BBE8 7F0691F8 01B12021 */ addu $a0, $t5, $s1 -/* 09BBEC 7F0691FC 0FC16220 */ jal matrix_4x4_rotate_vector_in_place +/* 09BBEC 7F0691FC 0FC16220 */ jal mtx4RotateVecInPlace /* 09BBF0 7F069200 24840AD0 */ addiu $a0, $a0, 0xad0 /* 09BBF4 7F069204 0C00262C */ jal randomGetNext /* 09BBF8 7F069208 00000000 */ nop @@ -24516,7 +23700,7 @@ glabel sub_GAME_7F068508 #endif -void sub_GAME_7F068D20(CasingRecord* casing) +void update_bullet_casing(CasingRecord* casing) { f32 new_val_y; f32 delta; @@ -24528,7 +23712,7 @@ void sub_GAME_7F068D20(CasingRecord* casing) casing->pos.y += delta * 0.5f * (casing->vel.y + new_val_y); - if (casing->pos.y < casing->unk00) + if (casing->pos.y < casing->floor_y_pos) { #if defined(BUGFIX_R1) if (dword_CODE_bss_80075DB0 == 0 && (g_ClockTimer > 0)) @@ -24538,9 +23722,12 @@ void sub_GAME_7F068D20(CasingRecord* casing) { if ((g_CurrentPlayer->hands[0].when_detonating_mines_is_0 != 2) && (g_CurrentPlayer->hands[1].when_detonating_mines_is_0 != 2)) { + // Play bullet casing rolling of floor sound sndPlaySfx((struct ALBankAlt_s* ) g_musicSfxBufferPtr, 0x7A, (ALSoundState* ) &dword_CODE_bss_80075DB0); } } + + // This casing is removed and not updated anymore casing->header = NULL; return; } @@ -24560,7 +23747,7 @@ void sub_GAME_7F068D20(CasingRecord* casing) } -void sub_GAME_7F068E6C(void) +void update_bullet_casings(void) { CasingRecord* end = g_Casings + ARRAYCOUNT(g_Casings); CasingRecord* entry = g_Casings; @@ -24568,7 +23755,7 @@ void sub_GAME_7F068E6C(void) { if (entry->header) { - sub_GAME_7F068D20(entry); + update_bullet_casing(entry); } entry++; } @@ -24627,7 +23814,7 @@ glabel sub_GAME_7F068EC4 /* 09DA70 7F068F40 8FA400E0 */ lw $a0, 0xe0($sp) /* 09DA74 7F068F44 27A400BC */ addiu $a0, $sp, 0xbc /* 09DA78 7F068F48 8FA500E0 */ lw $a1, 0xe0($sp) -/* 09DA7C 7F068F4C 0FC1D7DA */ jal sub_GAME_7F075F68 +/* 09DA7C 7F068F4C 0FC1D7DA */ jal modelInit /* 09DA80 7F068F50 00003025 */ move $a2, $zero /* 09DA84 7F068F54 8FAD00DC */ lw $t5, 0xdc($sp) /* 09DA88 7F068F58 8FA400E8 */ lw $a0, 0xe8($sp) @@ -24643,7 +23830,7 @@ glabel sub_GAME_7F068EC4 /* 09DAB0 7F068F80 27A5003C */ addiu $a1, $sp, 0x3c /* 09DAB4 7F068F84 0FC16266 */ jal matrix_4x4_set_position /* 09DAB8 7F068F88 24840004 */ addiu $a0, $a0, 4 -/* 09DABC 7F068F8C 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 09DABC 7F068F8C 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 09DAC0 7F068F90 00000000 */ nop /* 09DAC4 7F068F94 00402025 */ move $a0, $v0 /* 09DAC8 7F068F98 27A5003C */ addiu $a1, $sp, 0x3c @@ -24760,7 +23947,7 @@ glabel sub_GAME_7F068EC4 /* 09C0C4 7F0696D4 8FA400E0 */ lw $a0, 0xe0($sp) /* 09C0C8 7F0696D8 27A400BC */ addiu $a0, $sp, 0xbc /* 09C0CC 7F0696DC 8FA500E0 */ lw $a1, 0xe0($sp) -/* 09C0D0 7F0696E0 0FC1D7F9 */ jal sub_GAME_7F075F68 +/* 09C0D0 7F0696E0 0FC1D7F9 */ jal modelInit /* 09C0D4 7F0696E4 00003025 */ move $a2, $zero /* 09C0D8 7F0696E8 8FAD00DC */ lw $t5, 0xdc($sp) /* 09C0DC 7F0696EC 8FA400E8 */ lw $a0, 0xe8($sp) @@ -24776,7 +23963,7 @@ glabel sub_GAME_7F068EC4 /* 09C104 7F069714 27A5003C */ addiu $a1, $sp, 0x3c /* 09C108 7F069718 0FC16390 */ jal matrix_4x4_set_position /* 09C10C 7F06971C 24840004 */ addiu $a0, $a0, 4 -/* 09C110 7F069720 0FC1E111 */ jal currentPlayerGetMatrix10CC +/* 09C110 7F069720 0FC1E111 */ jal camGetWorldToScreenMtxf /* 09C114 7F069724 00000000 */ nop /* 09C118 7F069728 00402025 */ move $a0, $v0 /* 09C11C 7F06972C 27A5003C */ addiu $a1, $sp, 0x3c @@ -24864,15 +24051,15 @@ void sub_GAME_7F06908C(Gfx** arg0) } -void set_unset_ammo_on_screen_setting(s32 flags, bool unset) { +void gunSetGunAmmoVisible(s32 reason, bool enable) { - if (unset) + if (enable) { - g_CurrentPlayer->ammodispflags &= ~flags; + g_CurrentPlayer->gunammooff &= ~reason; return; } - g_CurrentPlayer->ammodispflags |= flags; + g_CurrentPlayer->gunammooff |= reason; } @@ -24882,7 +24069,7 @@ void give_cur_player_ammo(s32 ammo_type, s32 ammo_amount) { s32 max_ammo; weapon_id = getCurrentPlayerWeaponId(GUNRIGHT); - if ((get_ammo_type_for_weapon(weapon_id) == ammo_type) && (bondwalkItemCheckBitflags(weapon_id, 0x200000U) != 0)) + if ((get_ammo_type_for_weapon(weapon_id) == ammo_type) && (bondwalkItemCheckBitflags(weapon_id, WEAPONSTATBITFLAG_AMMO_CLIP_LIMIT) != 0)) { g_CurrentPlayer->hands[0].weapon_ammo_in_magazine += ammo_amount; if (get_ptr_item_statistics(weapon_id)->MagSize < g_CurrentPlayer->hands[0].weapon_ammo_in_magazine) @@ -25550,294 +24737,65 @@ glabel set_rgba_redirect_generate_microcode #endif +Gfx *gunDrawHudString(Gfx *gdl, s8 *text, s32 x, s32 halign, s32 y, s32 valign, bool glow) +{ + s32 x1; + s32 y1; + s32 x2; + s32 y2; + s32 textheight; + s32 textwidth; + + x1 = 0; + y1 = 0; + x2 = 0; + y2 = 0; + textwidth = 0; + textheight = 0; + + textMeasure(&textheight, &textwidth, text, ptrFontBankGothicChars, ptrFontBankGothic, 0); + + if (halign == HUDHALIGN_LEFT) { // left + x2 = x + textwidth; + x1 = x; + } else if (halign == HUDHALIGN_RIGHT) { // right + x1 = x - textwidth; + x2 = x; + } else if (halign == HUDHALIGN_MIDDLE) { // middle + x2 = x + textwidth / 2; + x1 = x2 - textwidth; + } + if (valign == HUDVALIGN_TOP) { // top + y2 = y + textheight; + y1 = y; + } else if (valign == HUDVALIGN_BOTTOM) { // bottom + y1 = y - textheight; + y2 = y; + } else if (valign == HUDVALIGN_MIDDLE) { // middle + y2 = y + textheight / 2; + y1 = y2 - textheight; + } + gdl = draw_blackbox_to_screen(gdl, &x1, &y1, &x2, &y2); -#ifdef NONMATCHING -s32 some_kind_of_display_routine(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { - s16 sp44; - s32 sp48; - s32 sp4C; - s32 sp50; - s32 sp54; - s32 sp58; - s32 sp5C; - s32 temp_v1; - s32 temp_t0; - s32 temp_s0; - s32 phi_t8; - s32 phi_t4; - s32 phi_s0; - - // Node 0 - sp5C = 0; - sp58 = 0; - sp54 = 0; - sp50 = 0; - sp48 = 0; - sp4C = 0; - sub_GAME_7F0AE98C(&sp4C, &sp48, arg1, ptrSecondFontTableSmall, (?32) ptrFirstFontTableSmall, 0); - if (arg3 == 1) - { - // Node 1 - sp5C = arg2; - sp54 = (s32) (arg2 + sp48); + if (glow) { + gdl = textRenderGlow(gdl, &x1, &y1, text, ptrFontBankGothicChars, ptrFontBankGothic, -1, 0x646464FF, (s32) viGetX(), viGetY(), 0, 0); + } else { + gdl = textRender(gdl, &x1, &y1, text, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF00B0, (s32) viGetX(), viGetY(), 0, 0); } - else - { - // Node 2 - if (arg3 == 0) - { - // Node 3 - sp54 = arg2; - sp5C = (s32) (arg2 - sp48); - } - else - { - // Node 4 - if (arg3 == 2) - { - // Node 5 - phi_t8 = (sp48 >> 1); - if (sp48 < 0) - { - // Node 6 - phi_t8 = ((s32) (sp48 + 1) >> 1); - } - // Node 7 - temp_v1 = (phi_t8 + arg2); - sp5C = (s32) (temp_v1 - sp48); - sp54 = temp_v1; - } - } - } - // Node 8 - if (arg5 == 1) - { - // Node 9 - sp58 = arg4; - sp50 = (s32) (arg4 + sp4C); - } - else - { - // Node 10 - if (arg5 == 0) - { - // Node 11 - sp50 = arg4; - sp58 = (s32) (arg4 - sp4C); - } - else - { - // Node 12 - if (arg5 == 2) - { - // Node 13 - phi_t4 = (sp4C >> 1); - if (sp4C < 0) - { - // Node 14 - phi_t4 = ((s32) (sp4C + 1) >> 1); - } - // Node 15 - temp_t0 = (phi_t4 + arg4); - sp58 = (s32) (temp_t0 - sp4C); - sp50 = temp_t0; - } - } - } - // Node 16 - temp_s0 = draw_blackbox_to_screen(arg0, &sp5C, &sp58, &sp54, &sp50); - if (arg6 != 0) - { - // Node 17 - sp44 = viGetX(); - phi_s0 = jp_text_write_stuff(temp_s0, &sp5C, &sp58, arg1, (?32) ptrSecondFontTableSmall, (?32) ptrFirstFontTableSmall, -1, 0x646464ff, sp44, viGetY(), 0, 0); - } - else - { - // Node 18 - sp44 = viGetX(); - phi_s0 = en_text_write_stuff(temp_s0, &sp5C, &sp58, arg1, (?32) ptrSecondFontTableSmall, (?32) ptrFirstFontTableSmall, 0xff00b0, sp44, viGetY(), 0, 0); - } - // Node 19 - return phi_s0; -} -#else -GLOBAL_ASM( -.text -glabel some_kind_of_display_routine -/* 09E580 7F069A50 27BDFFA0 */ addiu $sp, $sp, -0x60 -/* 09E584 7F069A54 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 09E588 7F069A58 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 09E58C 7F069A5C AFB00038 */ sw $s0, 0x38($sp) -/* 09E590 7F069A60 AFA7006C */ sw $a3, 0x6c($sp) -/* 09E594 7F069A64 00808025 */ move $s0, $a0 -/* 09E598 7F069A68 AFBF003C */ sw $ra, 0x3c($sp) -/* 09E59C 7F069A6C AFA50064 */ sw $a1, 0x64($sp) -/* 09E5A0 7F069A70 AFA60068 */ sw $a2, 0x68($sp) -/* 09E5A4 7F069A74 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 09E5A8 7F069A78 AFA0005C */ sw $zero, 0x5c($sp) -/* 09E5AC 7F069A7C AFA00058 */ sw $zero, 0x58($sp) -/* 09E5B0 7F069A80 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) -/* 09E5B4 7F069A84 8FA60064 */ lw $a2, 0x64($sp) -/* 09E5B8 7F069A88 27A50048 */ addiu $a1, $sp, 0x48 -/* 09E5BC 7F069A8C 27A4004C */ addiu $a0, $sp, 0x4c -/* 09E5C0 7F069A90 AFA00014 */ sw $zero, 0x14($sp) -/* 09E5C4 7F069A94 AFA00054 */ sw $zero, 0x54($sp) -/* 09E5C8 7F069A98 AFA00050 */ sw $zero, 0x50($sp) -/* 09E5CC 7F069A9C AFA00048 */ sw $zero, 0x48($sp) -/* 09E5D0 7F069AA0 AFA0004C */ sw $zero, 0x4c($sp) -/* 09E5D4 7F069AA4 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 09E5D8 7F069AA8 AFAE0010 */ sw $t6, 0x10($sp) -/* 09E5DC 7F069AAC 8FA3006C */ lw $v1, 0x6c($sp) -/* 09E5E0 7F069AB0 24040001 */ li $a0, 1 -/* 09E5E4 7F069AB4 8FA20068 */ lw $v0, 0x68($sp) -/* 09E5E8 7F069AB8 14640006 */ bne $v1, $a0, .L7F069AD4 -/* 09E5EC 7F069ABC 27A5005C */ addiu $a1, $sp, 0x5c -/* 09E5F0 7F069AC0 8FA90048 */ lw $t1, 0x48($sp) -/* 09E5F4 7F069AC4 AFA2005C */ sw $v0, 0x5c($sp) -/* 09E5F8 7F069AC8 00491821 */ addu $v1, $v0, $t1 -/* 09E5FC 7F069ACC 10000012 */ b .L7F069B18 -/* 09E600 7F069AD0 AFA30054 */ sw $v1, 0x54($sp) -.L7F069AD4: -/* 09E604 7F069AD4 14600006 */ bnez $v1, .L7F069AF0 -/* 09E608 7F069AD8 24010002 */ li $at, 2 -/* 09E60C 7F069ADC 8FA90048 */ lw $t1, 0x48($sp) -/* 09E610 7F069AE0 AFA20054 */ sw $v0, 0x54($sp) -/* 09E614 7F069AE4 00497823 */ subu $t7, $v0, $t1 -/* 09E618 7F069AE8 1000000B */ b .L7F069B18 -/* 09E61C 7F069AEC AFAF005C */ sw $t7, 0x5c($sp) -.L7F069AF0: -/* 09E620 7F069AF0 14610009 */ bne $v1, $at, .L7F069B18 -/* 09E624 7F069AF4 8FA90048 */ lw $t1, 0x48($sp) -/* 09E628 7F069AF8 05210003 */ bgez $t1, .L7F069B08 -/* 09E62C 7F069AFC 0009C043 */ sra $t8, $t1, 1 -/* 09E630 7F069B00 25210001 */ addiu $at, $t1, 1 -/* 09E634 7F069B04 0001C043 */ sra $t8, $at, 1 -.L7F069B08: -/* 09E638 7F069B08 03021821 */ addu $v1, $t8, $v0 -/* 09E63C 7F069B0C 0069C823 */ subu $t9, $v1, $t1 -/* 09E640 7F069B10 AFB9005C */ sw $t9, 0x5c($sp) -/* 09E644 7F069B14 AFA30054 */ sw $v1, 0x54($sp) -.L7F069B18: -/* 09E648 7F069B18 8FA20074 */ lw $v0, 0x74($sp) -/* 09E64C 7F069B1C 27A60058 */ addiu $a2, $sp, 0x58 -/* 09E650 7F069B20 27A70054 */ addiu $a3, $sp, 0x54 -/* 09E654 7F069B24 14440007 */ bne $v0, $a0, .L7F069B44 -/* 09E658 7F069B28 27AE0050 */ addiu $t6, $sp, 0x50 -/* 09E65C 7F069B2C 8FA20070 */ lw $v0, 0x70($sp) -/* 09E660 7F069B30 8FAA004C */ lw $t2, 0x4c($sp) -/* 09E664 7F069B34 AFA20058 */ sw $v0, 0x58($sp) -/* 09E668 7F069B38 004A4021 */ addu $t0, $v0, $t2 -/* 09E66C 7F069B3C 10000014 */ b .L7F069B90 -/* 09E670 7F069B40 AFA80050 */ sw $t0, 0x50($sp) -.L7F069B44: -/* 09E674 7F069B44 14400007 */ bnez $v0, .L7F069B64 -/* 09E678 7F069B48 24010002 */ li $at, 2 -/* 09E67C 7F069B4C 8FA20070 */ lw $v0, 0x70($sp) -/* 09E680 7F069B50 8FAA004C */ lw $t2, 0x4c($sp) -/* 09E684 7F069B54 AFA20050 */ sw $v0, 0x50($sp) -/* 09E688 7F069B58 004A5823 */ subu $t3, $v0, $t2 -/* 09E68C 7F069B5C 1000000C */ b .L7F069B90 -/* 09E690 7F069B60 AFAB0058 */ sw $t3, 0x58($sp) -.L7F069B64: -/* 09E694 7F069B64 1441000A */ bne $v0, $at, .L7F069B90 -/* 09E698 7F069B68 8FAA004C */ lw $t2, 0x4c($sp) -/* 09E69C 7F069B6C 8FA20070 */ lw $v0, 0x70($sp) -/* 09E6A0 7F069B70 05410003 */ bgez $t2, .L7F069B80 -/* 09E6A4 7F069B74 000A6043 */ sra $t4, $t2, 1 -/* 09E6A8 7F069B78 25410001 */ addiu $at, $t2, 1 -/* 09E6AC 7F069B7C 00016043 */ sra $t4, $at, 1 -.L7F069B80: -/* 09E6B0 7F069B80 01824021 */ addu $t0, $t4, $v0 -/* 09E6B4 7F069B84 010A6823 */ subu $t5, $t0, $t2 -/* 09E6B8 7F069B88 AFAD0058 */ sw $t5, 0x58($sp) -/* 09E6BC 7F069B8C AFA80050 */ sw $t0, 0x50($sp) -.L7F069B90: -/* 09E6C0 7F069B90 02002025 */ move $a0, $s0 -/* 09E6C4 7F069B94 0FC2B3D3 */ jal draw_blackbox_to_screen -/* 09E6C8 7F069B98 AFAE0010 */ sw $t6, 0x10($sp) -/* 09E6CC 7F069B9C 8FAF0078 */ lw $t7, 0x78($sp) -/* 09E6D0 7F069BA0 00408025 */ move $s0, $v0 -/* 09E6D4 7F069BA4 11E0001C */ beqz $t7, .L7F069C18 -/* 09E6D8 7F069BA8 00000000 */ nop -/* 09E6DC 7F069BAC 0C001107 */ jal viGetX -/* 09E6E0 7F069BB0 00000000 */ nop -/* 09E6E4 7F069BB4 0C00110B */ jal viGetY -/* 09E6E8 7F069BB8 A7A20044 */ sh $v0, 0x44($sp) -/* 09E6EC 7F069BBC 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) -/* 09E6F0 7F069BC0 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 09E6F4 7F069BC4 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 09E6F8 7F069BC8 8F180EB0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) -/* 09E6FC 7F069BCC 87AD0044 */ lh $t5, 0x44($sp) -/* 09E700 7F069BD0 3C0C6464 */ lui $t4, (0x646464FF >> 16) # lui $t4, 0x6464 -/* 09E704 7F069BD4 358C64FF */ ori $t4, (0x646464FF & 0xFFFF) # ori $t4, $t4, 0x64ff -/* 09E708 7F069BD8 240BFFFF */ li $t3, -1 -/* 09E70C 7F069BDC AFAB0018 */ sw $t3, 0x18($sp) -/* 09E710 7F069BE0 AFAC001C */ sw $t4, 0x1c($sp) -/* 09E714 7F069BE4 02002025 */ move $a0, $s0 -/* 09E718 7F069BE8 27A5005C */ addiu $a1, $sp, 0x5c -/* 09E71C 7F069BEC 27A60058 */ addiu $a2, $sp, 0x58 -/* 09E720 7F069BF0 8FA70064 */ lw $a3, 0x64($sp) -/* 09E724 7F069BF4 AFA20024 */ sw $v0, 0x24($sp) -/* 09E728 7F069BF8 AFA00028 */ sw $zero, 0x28($sp) -/* 09E72C 7F069BFC AFA0002C */ sw $zero, 0x2c($sp) -/* 09E730 7F069C00 AFB90014 */ sw $t9, 0x14($sp) -/* 09E734 7F069C04 AFB80010 */ sw $t8, 0x10($sp) -/* 09E738 7F069C08 0FC2B9BB */ jal jp_text_write_stuff -/* 09E73C 7F069C0C AFAD0020 */ sw $t5, 0x20($sp) -/* 09E740 7F069C10 10000019 */ b .L7F069C78 -/* 09E744 7F069C14 00408025 */ move $s0, $v0 -.L7F069C18: -/* 09E748 7F069C18 0C001107 */ jal viGetX -/* 09E74C 7F069C1C 00000000 */ nop -/* 09E750 7F069C20 0C00110B */ jal viGetY -/* 09E754 7F069C24 A7A20044 */ sh $v0, 0x44($sp) -/* 09E758 7F069C28 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) -/* 09E75C 7F069C2C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) -/* 09E760 7F069C30 8DEF0EAC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 09E764 7F069C34 8DCE0EB0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) -/* 09E768 7F069C38 87B90044 */ lh $t9, 0x44($sp) -/* 09E76C 7F069C3C 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff -/* 09E770 7F069C40 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 -/* 09E774 7F069C44 AFB80018 */ sw $t8, 0x18($sp) -/* 09E778 7F069C48 02002025 */ move $a0, $s0 -/* 09E77C 7F069C4C 27A5005C */ addiu $a1, $sp, 0x5c -/* 09E780 7F069C50 27A60058 */ addiu $a2, $sp, 0x58 -/* 09E784 7F069C54 8FA70064 */ lw $a3, 0x64($sp) -/* 09E788 7F069C58 AFA20020 */ sw $v0, 0x20($sp) -/* 09E78C 7F069C5C AFA00024 */ sw $zero, 0x24($sp) -/* 09E790 7F069C60 AFA00028 */ sw $zero, 0x28($sp) -/* 09E794 7F069C64 AFAF0014 */ sw $t7, 0x14($sp) -/* 09E798 7F069C68 AFAE0010 */ sw $t6, 0x10($sp) -/* 09E79C 7F069C6C 0FC2B6AF */ jal en_text_write_stuff -/* 09E7A0 7F069C70 AFB9001C */ sw $t9, 0x1c($sp) -/* 09E7A4 7F069C74 00408025 */ move $s0, $v0 -.L7F069C78: -/* 09E7A8 7F069C78 8FBF003C */ lw $ra, 0x3c($sp) -/* 09E7AC 7F069C7C 02001025 */ move $v0, $s0 -/* 09E7B0 7F069C80 8FB00038 */ lw $s0, 0x38($sp) -/* 09E7B4 7F069C84 03E00008 */ jr $ra -/* 09E7B8 7F069C88 27BD0060 */ addiu $sp, $sp, 0x60 -) -#endif - + return gdl; +} -Gfx *display_ammo_total_in_a1(Gfx *arg0, s32 amount, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) +Gfx *gunDrawHudInteger(Gfx *gdl, s32 value, s32 x, s32 halign, s32 y, s32 valign, bool glow) { char buffer[12]; - sprintf(buffer, "%d\n", amount); - return some_kind_of_display_routine(arg0, buffer, arg2, arg3, arg4, arg5, arg6); + sprintf(buffer, "%d\n", value); + return gunDrawHudString(gdl, buffer, x, halign, y, valign, glow); } - - - - - #ifdef NONMATCHING s32 generate_ammo_total_microcode(s32 arg0) { void *sp28; @@ -25971,7 +24929,7 @@ s32 generate_ammo_total_microcode(s32 arg0) { phi_t9 = ((s32) (sp44 + 1) >> 1); } // Node 22 - arg0 = display_ammo_total_in_a1(arg0, sp4C, ((((sp2E + sp2C) - sp54) - phi_t9) + -4), 0); + arg0 = gunDrawHudInteger(arg0, sp4C, ((((sp2E + sp2C) - sp54) - phi_t9) + -4), 0); } // Node 23 if ((sp50 > 0) || (bondwalkItemCheckBitflags(sp60, 0x400000) != 0)) @@ -25989,7 +24947,7 @@ s32 generate_ammo_total_microcode(s32 arg0) { phi_t0 = ((s32) (temp_t3 + 1) >> 1); } // Node 27 - arg0 = display_ammo_total_in_a1(arg0, sp50, ((((sp2E + sp2C) - sp54) + phi_t0) + 3), 1); + arg0 = gunDrawHudInteger(arg0, sp50, ((((sp2E + sp2C) - sp54) + phi_t0) + 3), 1); } else { @@ -26069,7 +25027,7 @@ s32 generate_ammo_total_microcode(s32 arg0) { phi_t3 = ((s32) (sp3C + 1) >> 1); } // Node 44 - arg0 = display_ammo_total_in_a1(arg0, sp4C, (((sp2E + sp58) + phi_t3) + 3), 1); + arg0 = gunDrawHudInteger(arg0, sp4C, (((sp2E + sp58) + phi_t3) + 3), 1); } // Node 45 if ((sp50 > 0) || (bondwalkItemCheckBitflags(sp64, 0x400000) != 0)) @@ -26086,7 +25044,7 @@ s32 generate_ammo_total_microcode(s32 arg0) { phi_t0_2 = ((s32) (temp_t1 + 1) >> 1); } // Node 49 - arg0 = display_ammo_total_in_a1(arg0, sp50, (((sp2E + sp58) - phi_t0_2) + -4), 0); + arg0 = gunDrawHudInteger(arg0, sp50, (((sp2E + sp58) - phi_t0_2) + -4), 0); } else { @@ -26292,7 +25250,7 @@ glabel generate_ammo_total_microcode .L7F069FA4: /* 09EAD4 7F069FA4 01F93023 */ subu $a2, $t7, $t9 /* 09EAD8 7F069FA8 24C6FFFC */ addiu $a2, $a2, -4 -/* 09EADC 7F069FAC 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09EADC 7F069FAC 0FC1A723 */ jal gunDrawHudInteger /* 09EAE0 7F069FB0 00003825 */ move $a3, $zero /* 09EAE4 7F069FB4 AFA20068 */ sw $v0, 0x68($sp) /* 09EAE8 7F069FB8 8FAD0050 */ lw $t5, 0x50($sp) @@ -26337,7 +25295,7 @@ glabel generate_ammo_total_microcode .L7F06A04C: /* 09EB7C 7F06A04C 01283021 */ addu $a2, $t1, $t0 /* 09EB80 7F06A050 24C60003 */ addiu $a2, $a2, 3 -/* 09EB84 7F06A054 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09EB84 7F06A054 0FC1A723 */ jal gunDrawHudInteger /* 09EB88 7F06A058 24070001 */ li $a3, 1 /* 09EB8C 7F06A05C AFA20068 */ sw $v0, 0x68($sp) .L7F06A060: @@ -26480,7 +25438,7 @@ glabel generate_ammo_total_microcode .L7F06A268: /* 09ED98 7F06A268 032B3021 */ addu $a2, $t9, $t3 /* 09ED9C 7F06A26C 24C60003 */ addiu $a2, $a2, 3 -/* 09EDA0 7F06A270 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09EDA0 7F06A270 0FC1A723 */ jal gunDrawHudInteger /* 09EDA4 7F06A274 24070001 */ li $a3, 1 /* 09EDA8 7F06A278 AFA20068 */ sw $v0, 0x68($sp) /* 09EDAC 7F06A27C 8FAC0050 */ lw $t4, 0x50($sp) @@ -26521,7 +25479,7 @@ glabel generate_ammo_total_microcode .L7F06A300: /* 09EE30 7F06A300 03283023 */ subu $a2, $t9, $t0 /* 09EE34 7F06A304 24C6FFFC */ addiu $a2, $a2, -4 -/* 09EE38 7F06A308 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09EE38 7F06A308 0FC1A723 */ jal gunDrawHudInteger /* 09EE3C 7F06A30C 00003825 */ move $a3, $zero /* 09EE40 7F06A310 AFA20068 */ sw $v0, 0x68($sp) .L7F06A314: @@ -26724,7 +25682,7 @@ glabel generate_ammo_total_microcode .L7F06A738: /* 09D128 7F06A738 01F93023 */ subu $a2, $t7, $t9 /* 09D12C 7F06A73C 24C6FFFC */ addiu $a2, $a2, -4 -/* 09D130 7F06A740 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D130 7F06A740 0FC1A908 */ jal gunDrawHudInteger /* 09D134 7F06A744 00003825 */ move $a3, $zero /* 09D138 7F06A748 AFA20068 */ sw $v0, 0x68($sp) /* 09D13C 7F06A74C 8FAD0050 */ lw $t5, 0x50($sp) @@ -26769,7 +25727,7 @@ glabel generate_ammo_total_microcode .L7F06A7E0: /* 09D1D0 7F06A7E0 01283021 */ addu $a2, $t1, $t0 /* 09D1D4 7F06A7E4 24C60003 */ addiu $a2, $a2, 3 -/* 09D1D8 7F06A7E8 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D1D8 7F06A7E8 0FC1A908 */ jal gunDrawHudInteger /* 09D1DC 7F06A7EC 24070001 */ li $a3, 1 /* 09D1E0 7F06A7F0 AFA20068 */ sw $v0, 0x68($sp) .L7F06A7F4: @@ -26912,7 +25870,7 @@ glabel generate_ammo_total_microcode .L7F06A9FC: /* 09D3EC 7F06A9FC 032B3021 */ addu $a2, $t9, $t3 /* 09D3F0 7F06AA00 24C60003 */ addiu $a2, $a2, 3 -/* 09D3F4 7F06AA04 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D3F4 7F06AA04 0FC1A908 */ jal gunDrawHudInteger /* 09D3F8 7F06AA08 24070001 */ li $a3, 1 /* 09D3FC 7F06AA0C AFA20068 */ sw $v0, 0x68($sp) /* 09D400 7F06AA10 8FAC0050 */ lw $t4, 0x50($sp) @@ -26953,7 +25911,7 @@ glabel generate_ammo_total_microcode .L7F06AA94: /* 09D484 7F06AA94 03283023 */ subu $a2, $t9, $t0 /* 09D488 7F06AA98 24C6FFFC */ addiu $a2, $a2, -4 -/* 09D48C 7F06AA9C 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D48C 7F06AA9C 0FC1A908 */ jal gunDrawHudInteger /* 09D490 7F06AAA0 00003825 */ move $a3, $zero /* 09D494 7F06AAA4 AFA20068 */ sw $v0, 0x68($sp) .L7F06AAA8: @@ -27074,7 +26032,7 @@ s32 sub_GAME_7F06A334(s32 arg0) { phi_t4 = ((s32) (sp3C + 1) >> 1); } // Node 15 - phi_s0_2 = display_ammo_total_in_a1(temp_s0, sp44, (0xc4 - phi_t4), 0, 0); + phi_s0_2 = gunDrawHudInteger(temp_s0, sp44, (0xc4 - phi_t4), 0, 0); } // Node 16 if ((sp48 > 0) || (bondwalkItemCheckBitflags(sp50, 0x400000) != 0)) @@ -27088,7 +26046,7 @@ s32 sub_GAME_7F06A334(s32 arg0) { phi_t9 = ((s32) (temp_a2 + 1) >> 1); } // Node 20 - phi_s0_3 = display_ammo_total_in_a1(phi_s0_2, sp48, (phi_t9 + 0xcb), 1, 0); + phi_s0_3 = gunDrawHudInteger(phi_s0_2, sp48, (phi_t9 + 0xcb), 1, 0); } else { @@ -27236,7 +26194,7 @@ glabel sub_GAME_7F06A334 .L7F06A510: /* 09F040 7F06A510 01AC3023 */ subu $a2, $t5, $t4 /* 09F044 7F06A514 00003825 */ move $a3, $zero -/* 09F048 7F06A518 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09F048 7F06A518 0FC1A723 */ jal gunDrawHudInteger /* 09F04C 7F06A51C AFA00018 */ sw $zero, 0x18($sp) /* 09F050 7F06A520 00408025 */ move $s0, $v0 .L7F06A524: @@ -27264,7 +26222,7 @@ glabel sub_GAME_7F06A334 .L7F06A574: /* 09F0A4 7F06A574 272600CB */ addiu $a2, $t9, 0xcb /* 09F0A8 7F06A578 24070001 */ li $a3, 1 -/* 09F0AC 7F06A57C 0FC1A723 */ jal display_ammo_total_in_a1 +/* 09F0AC 7F06A57C 0FC1A723 */ jal gunDrawHudInteger /* 09F0B0 7F06A580 AFA00018 */ sw $zero, 0x18($sp) /* 09F0B4 7F06A584 00408025 */ move $s0, $v0 .L7F06A588: @@ -27410,7 +26368,7 @@ glabel sub_GAME_7F06A334 .L7F06ACA4: /* 09D694 7F06ACA4 01AC3023 */ subu $a2, $t5, $t4 /* 09D698 7F06ACA8 00003825 */ move $a3, $zero -/* 09D69C 7F06ACAC 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D69C 7F06ACAC 0FC1A908 */ jal gunDrawHudInteger /* 09D6A0 7F06ACB0 AFA00018 */ sw $zero, 0x18($sp) /* 09D6A4 7F06ACB4 00408025 */ move $s0, $v0 .L7F06ACB8: @@ -27438,7 +26396,7 @@ glabel sub_GAME_7F06A334 .L7F06AD08: /* 09D6F8 7F06AD08 272600CB */ addiu $a2, $t9, 0xcb /* 09D6FC 7F06AD0C 24070001 */ li $a3, 1 -/* 09D700 7F06AD10 0FC1A908 */ jal display_ammo_total_in_a1 +/* 09D700 7F06AD10 0FC1A908 */ jal gunDrawHudInteger /* 09D704 7F06AD14 AFA00018 */ sw $zero, 0x18($sp) /* 09D708 7F06AD18 00408025 */ move $s0, $v0 .L7F06AD1C: @@ -27458,19 +26416,19 @@ glabel sub_GAME_7F06A334 -void set_unset_bitflags(s32 bitflags, bool unset) +void gunSetSightVisible(s32 reason, bool visible) { - if (unset) + if (visible) { - g_CurrentPlayer->gunsightmode &= ~bitflags; + g_CurrentPlayer->gunsightmode &= ~reason; return; } - g_CurrentPlayer->gunsightmode |= bitflags; + g_CurrentPlayer->gunsightmode |= reason; } -void display_in_game_crosshair(s32 *gdl) { +void gunDrawSight(s32 *gdl) { s32 sp54; f32 xypos[2]; @@ -27500,7 +26458,7 @@ void display_in_game_crosshair(s32 *gdl) { void inc_curplayer_hitcount_with_weapon(ITEM_IDS item, SHOT_REGISTER shot_register) { - if (bondwalkItemCheckBitflags(item, 0x10000)) { + if (bondwalkItemCheckBitflags(item, WEAPONSTATBITFLAG_PLAYER_STAT_HIT)) { g_playerPerm->shot_count[shot_register] = g_playerPerm->shot_count[shot_register]+1; } } @@ -27524,11 +26482,9 @@ s32 get_civilian_casualties(void) //D:80053BF8 const char aSD[] = "%s: %d\n"; - - void increment_num_kills_display_text_in_MP(void) { - s8 buffer[0x100]; + s8 buffer[256]; s32 time_since_kill; s32 recent_kill_count; s32 mission_time; @@ -27540,7 +26496,7 @@ void increment_num_kills_display_text_in_MP(void) if (getPlayerCount() < 2) { return; } mission_time = getMissiontimer(); - sprintf(&buffer, aSD, langGet(0x98DA), g_playerPerm->kill_count); + sprintf(&buffer, aSD, langGet(TEXT(LGUN, GUN_STR_DA)), g_playerPerm->kill_count); // "kill count" #if defined(VERSION_US) hudmsgBottomShow(&buffer); @@ -27605,22 +26561,22 @@ s32 get_times_killed_mwtgx(void) { void increment_num_deaths(void) { - char acStack256 [256]; + char buffer[256]; g_CurrentPlayer->deathcount = (s32) (g_CurrentPlayer->deathcount + 1); if (getPlayerCount() >= 2) { if (g_CurrentPlayer->deathcount == 1) { - sprintf(acStack256, langGet(TEXT(LGUN, 0xDB))); //died once + sprintf(buffer, langGet(TEXT(LGUN, GUN_STR_DB))); //died once } else { - sprintf(acStack256, "%s %d %s\n", langGet(TEXT(LGUN, 0xDC)), g_CurrentPlayer->deathcount, langGet(TEXT(LGUN, 0xDD))); //died times + sprintf(buffer, "%s %d %s\n", langGet(TEXT(LGUN, GUN_STR_DC)), g_CurrentPlayer->deathcount, langGet(TEXT(LGUN, GUN_STR_DD))); //died times } #if defined(VERSION_JP) || defined(VERSION_EU) - jp_hudmsgBottomShow(acStack256); + jp_hudmsgBottomShow(buffer); #else - hudmsgBottomShow(acStack256); + hudmsgBottomShow(buffer); #endif } } @@ -27633,427 +26589,63 @@ s32 get_curplayer_numdeaths(void) { //D:80053C0C const char aSD_0[] = "%s: %d\n"; -#ifdef NONMATCHING -void *increment_num_suicides_display_MP(void) { - s32 sp34; - ? sp40; - void *temp_ret; - s32 temp_v1; - s32 temp_v1_2; - s32 phi_v1; - void *phi_return_reg; +void increment_num_suicides_display_MP(void) { + char buffer[256]; + s32 time_diff; + s32 recent_kill_count; + s32 currentTime; - // Node 0 - g_CurrentPlayer->num_suicides = (s32) (g_CurrentPlayer->num_suicides + 1); - temp_ret = getPlayerCount(); - phi_return_reg = temp_ret; - if (temp_ret >= 2) - { - // Node 1 - sp34 = getMissiontimer(); - sprintf(&sp40, &aSD_0, langGet(TEXT(LGUN, 0xDE)), g_CurrentPlayer->num_suicides); //suicide count - hudmsgBottomShow(&sp40); - if (g_playerPerm->killcount >= 2) - { - // Node 2 - temp_v1 = (sp34 - g_CurrentPlayer->last_kill_time[0]); - if (g_playerPerm->slowest2kills < temp_v1) - { - // Node 3 - g_playerPerm->slowest2kills = temp_v1; + g_CurrentPlayer->num_suicides += 1; + if (getPlayerCount() >= 2) { + + currentTime = getMissiontimer(); + + sprintf(&buffer, &aSD_0, langGet(TEXT(LGUN, GUN_STR_DE)), g_CurrentPlayer->num_suicides); // "suicide count" + +#if defined(VERSION_JP) || defined(VERSION_EU) + jp_hudmsgBottomShow(&buffer); +#else + hudmsgBottomShow(&buffer); +#endif + + if (g_playerPerm->kill_count >= 2) { + time_diff = currentTime - g_CurrentPlayer->last_kill_time[0]; + if (g_playerPerm->max_time_between_kills < time_diff) { + g_playerPerm->max_time_between_kills = time_diff; } - // Node 4 - if (temp_v1 < g_playerPerm->fastest2kills) - { - // Node 5 - g_playerPerm->fastest2kills = temp_v1; + if (time_diff < g_playerPerm->min_time_between_kills) { + g_playerPerm->min_time_between_kills = time_diff; } } - // Node 6 - g_CurrentPlayer->unk29F0 = (s32) g_CurrentPlayer->unk29EC; - g_CurrentPlayer->unk29EC = (s32) g_CurrentPlayer->unk29E8; - g_CurrentPlayer->unk29E8 = (s32) g_CurrentPlayer->last_kill_time[0]; - g_CurrentPlayer->last_kill_time[0] = sp34; - phi_v1 = 1; - if (-1 != g_CurrentPlayer->unk29E8) - { - // Node 7 - phi_v1 = 1; - if ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->unk29E8) < 0x78) - { - // Node 8 - phi_v1 = 2; - if (-1 != g_CurrentPlayer->unk29EC) - { - // Node 9 - phi_v1 = 2; - if ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->unk29EC) < 0x78) - { - // Node 10 - temp_v1_2 = (2 + 1); - phi_v1 = temp_v1_2; - if (-1 != g_CurrentPlayer->unk29F0) - { - // Node 11 - phi_v1 = temp_v1_2; - if ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->unk29F0) < 0x78) - { - // Node 12 - phi_v1 = (temp_v1_2 + 1); - } - } + recent_kill_count = 1; + g_CurrentPlayer->last_kill_time[3] = g_CurrentPlayer->last_kill_time[2]; + g_CurrentPlayer->last_kill_time[2] = g_CurrentPlayer->last_kill_time[1]; + g_CurrentPlayer->last_kill_time[1] = g_CurrentPlayer->last_kill_time[0]; + g_CurrentPlayer->last_kill_time[0] = currentTime; + + if ( g_CurrentPlayer->last_kill_time[1] != -1) { + + if ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->last_kill_time[1]) < 0x78) { + + recent_kill_count += 1; + + if ((g_CurrentPlayer->last_kill_time[2] != -1) && ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->last_kill_time[2]) < 0x78)) { + + recent_kill_count += 1; + + if ((g_CurrentPlayer->last_kill_time[3] != -1) && ((g_CurrentPlayer->last_kill_time[0] - g_CurrentPlayer->last_kill_time[3]) < 0x78)) { + recent_kill_count += 1; } } } } - // Node 13 - phi_return_reg = g_playerPerm; - if (g_playerPerm->most_killed_one_time < phi_v1) - { - // Node 14 - g_playerPerm->most_killed_one_time = (s32) phi_v1; - phi_return_reg = g_playerPerm; + + if (g_playerPerm->most_killed_one_time < recent_kill_count) { + g_playerPerm->most_killed_one_time = recent_kill_count; } } - // Node 15 - return phi_return_reg; } -#else -#ifdef VERSION_US -GLOBAL_ASM( -.text -glabel increment_num_suicides_display_MP -/* 09F548 7F06AA18 27BDFEC0 */ addiu $sp, $sp, -0x140 -/* 09F54C 7F06AA1C AFB00018 */ sw $s0, 0x18($sp) -/* 09F550 7F06AA20 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 09F554 7F06AA24 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 09F558 7F06AA28 8E020000 */ lw $v0, ($s0) -/* 09F55C 7F06AA2C AFBF001C */ sw $ra, 0x1c($sp) -/* 09F560 7F06AA30 8C4E29DC */ lw $t6, 0x29dc($v0) -/* 09F564 7F06AA34 25CF0001 */ addiu $t7, $t6, 1 -/* 09F568 7F06AA38 0FC26919 */ jal getPlayerCount -/* 09F56C 7F06AA3C AC4F29DC */ sw $t7, 0x29dc($v0) -/* 09F570 7F06AA40 28410002 */ slti $at, $v0, 2 -/* 09F574 7F06AA44 54200052 */ bnezl $at, .L7F06AB90 -/* 09F578 7F06AA48 8FBF001C */ lw $ra, 0x1c($sp) -/* 09F57C 7F06AA4C 0FC22FEE */ jal getMissiontimer -/* 09F580 7F06AA50 00000000 */ nop -/* 09F584 7F06AA54 AFA20034 */ sw $v0, 0x34($sp) -/* 09F588 7F06AA58 0FC30776 */ jal langGet -/* 09F58C 7F06AA5C 340498DE */ li $a0, 39134 -/* 09F590 7F06AA60 8E180000 */ lw $t8, ($s0) -/* 09F594 7F06AA64 3C058005 */ lui $a1, %hi(aSD_0) -/* 09F598 7F06AA68 24A53C0C */ addiu $a1, %lo(aSD_0) # addiu $a1, $a1, 0x3c0c -/* 09F59C 7F06AA6C 27A40040 */ addiu $a0, $sp, 0x40 -/* 09F5A0 7F06AA70 00403025 */ move $a2, $v0 -/* 09F5A4 7F06AA74 0C002B25 */ jal sprintf -/* 09F5A8 7F06AA78 8F0729DC */ lw $a3, 0x29dc($t8) -/* 09F5AC 7F06AA7C 0FC228F2 */ jal hudmsgBottomShow -/* 09F5B0 7F06AA80 27A40040 */ addiu $a0, $sp, 0x40 -/* 09F5B4 7F06AA84 3C078008 */ lui $a3, %hi(g_playerPerm) -/* 09F5B8 7F06AA88 24E7A0B4 */ addiu $a3, %lo(g_playerPerm) # addiu $a3, $a3, -0x5f4c -/* 09F5BC 7F06AA8C 8CE20000 */ lw $v0, ($a3) -/* 09F5C0 7F06AA90 8C59001C */ lw $t9, 0x1c($v0) -/* 09F5C4 7F06AA94 2B210002 */ slti $at, $t9, 2 -/* 09F5C8 7F06AA98 54200011 */ bnezl $at, .L7F06AAE0 -/* 09F5CC 7F06AA9C 8E020000 */ lw $v0, ($s0) -/* 09F5D0 7F06AAA0 8E090000 */ lw $t1, ($s0) -/* 09F5D4 7F06AAA4 8FA80034 */ lw $t0, 0x34($sp) -/* 09F5D8 7F06AAA8 8C4B0048 */ lw $t3, 0x48($v0) -/* 09F5DC 7F06AAAC 8D2A29E4 */ lw $t2, 0x29e4($t1) -/* 09F5E0 7F06AAB0 010A1823 */ subu $v1, $t0, $t2 -/* 09F5E4 7F06AAB4 0163082A */ slt $at, $t3, $v1 -/* 09F5E8 7F06AAB8 50200004 */ beql $at, $zero, .L7F06AACC -/* 09F5EC 7F06AABC 8C4C0044 */ lw $t4, 0x44($v0) -/* 09F5F0 7F06AAC0 AC430048 */ sw $v1, 0x48($v0) -/* 09F5F4 7F06AAC4 8CE20000 */ lw $v0, ($a3) -/* 09F5F8 7F06AAC8 8C4C0044 */ lw $t4, 0x44($v0) -.L7F06AACC: -/* 09F5FC 7F06AACC 006C082A */ slt $at, $v1, $t4 -/* 09F600 7F06AAD0 50200003 */ beql $at, $zero, .L7F06AAE0 -/* 09F604 7F06AAD4 8E020000 */ lw $v0, ($s0) -/* 09F608 7F06AAD8 AC430044 */ sw $v1, 0x44($v0) -/* 09F60C 7F06AADC 8E020000 */ lw $v0, ($s0) -.L7F06AAE0: -/* 09F610 7F06AAE0 2406FFFF */ li $a2, -1 -/* 09F614 7F06AAE4 24030001 */ li $v1, 1 -/* 09F618 7F06AAE8 8C4D29EC */ lw $t5, 0x29ec($v0) -/* 09F61C 7F06AAEC AC4D29F0 */ sw $t5, 0x29f0($v0) -/* 09F620 7F06AAF0 8E020000 */ lw $v0, ($s0) -/* 09F624 7F06AAF4 8C4E29E8 */ lw $t6, 0x29e8($v0) -/* 09F628 7F06AAF8 AC4E29EC */ sw $t6, 0x29ec($v0) -/* 09F62C 7F06AAFC 8E020000 */ lw $v0, ($s0) -/* 09F630 7F06AB00 8C4F29E4 */ lw $t7, 0x29e4($v0) -/* 09F634 7F06AB04 AC4F29E8 */ sw $t7, 0x29e8($v0) -/* 09F638 7F06AB08 8E190000 */ lw $t9, ($s0) -/* 09F63C 7F06AB0C 8FB80034 */ lw $t8, 0x34($sp) -/* 09F640 7F06AB10 AF3829E4 */ sw $t8, 0x29e4($t9) -/* 09F644 7F06AB14 8E020000 */ lw $v0, ($s0) -/* 09F648 7F06AB18 8C4529E8 */ lw $a1, 0x29e8($v0) -/* 09F64C 7F06AB1C 50C50016 */ beql $a2, $a1, .L7F06AB78 -/* 09F650 7F06AB20 8CE20000 */ lw $v0, ($a3) -/* 09F654 7F06AB24 8C4429E4 */ lw $a0, 0x29e4($v0) -/* 09F658 7F06AB28 00854823 */ subu $t1, $a0, $a1 -/* 09F65C 7F06AB2C 29210078 */ slti $at, $t1, 0x78 -/* 09F660 7F06AB30 50200011 */ beql $at, $zero, .L7F06AB78 -/* 09F664 7F06AB34 8CE20000 */ lw $v0, ($a3) -/* 09F668 7F06AB38 8C4529EC */ lw $a1, 0x29ec($v0) -/* 09F66C 7F06AB3C 24030002 */ li $v1, 2 -/* 09F670 7F06AB40 10C5000C */ beq $a2, $a1, .L7F06AB74 -/* 09F674 7F06AB44 00854023 */ subu $t0, $a0, $a1 -/* 09F678 7F06AB48 29010078 */ slti $at, $t0, 0x78 -/* 09F67C 7F06AB4C 5020000A */ beql $at, $zero, .L7F06AB78 -/* 09F680 7F06AB50 8CE20000 */ lw $v0, ($a3) -/* 09F684 7F06AB54 8C4529F0 */ lw $a1, 0x29f0($v0) -/* 09F688 7F06AB58 24630001 */ addiu $v1, $v1, 1 -/* 09F68C 7F06AB5C 10C50005 */ beq $a2, $a1, .L7F06AB74 -/* 09F690 7F06AB60 00855023 */ subu $t2, $a0, $a1 -/* 09F694 7F06AB64 29410078 */ slti $at, $t2, 0x78 -/* 09F698 7F06AB68 50200003 */ beql $at, $zero, .L7F06AB78 -/* 09F69C 7F06AB6C 8CE20000 */ lw $v0, ($a3) -/* 09F6A0 7F06AB70 24630001 */ addiu $v1, $v1, 1 -.L7F06AB74: -/* 09F6A4 7F06AB74 8CE20000 */ lw $v0, ($a3) -.L7F06AB78: -/* 09F6A8 7F06AB78 8C4B0058 */ lw $t3, 0x58($v0) -/* 09F6AC 7F06AB7C 0163082A */ slt $at, $t3, $v1 -/* 09F6B0 7F06AB80 50200003 */ beql $at, $zero, .L7F06AB90 -/* 09F6B4 7F06AB84 8FBF001C */ lw $ra, 0x1c($sp) -/* 09F6B8 7F06AB88 AC430058 */ sw $v1, 0x58($v0) -/* 09F6BC 7F06AB8C 8FBF001C */ lw $ra, 0x1c($sp) -.L7F06AB90: -/* 09F6C0 7F06AB90 8FB00018 */ lw $s0, 0x18($sp) -/* 09F6C4 7F06AB94 27BD0140 */ addiu $sp, $sp, 0x140 -/* 09F6C8 7F06AB98 03E00008 */ jr $ra -/* 09F6CC 7F06AB9C 00000000 */ nop -) -#endif - -#ifdef VERSION_JP -GLOBAL_ASM( -.text -glabel increment_num_suicides_display_MP -/* 09F548 7F06AA18 27BDFEC0 */ addiu $sp, $sp, -0x140 -/* 09F54C 7F06AA1C AFB00018 */ sw $s0, 0x18($sp) -/* 09F550 7F06AA20 3C108008 */ lui $s0, %hi(g_CurrentPlayer) -/* 09F554 7F06AA24 2610A0B0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x5f50 -/* 09F558 7F06AA28 8E020000 */ lw $v0, ($s0) -/* 09F55C 7F06AA2C AFBF001C */ sw $ra, 0x1c($sp) -/* 09F560 7F06AA30 8C4E29DC */ lw $t6, 0x29dc($v0) -/* 09F564 7F06AA34 25CF0001 */ addiu $t7, $t6, 1 -/* 09F568 7F06AA38 0FC26919 */ jal getPlayerCount -/* 09F56C 7F06AA3C AC4F29DC */ sw $t7, 0x29dc($v0) -/* 09F570 7F06AA40 28410002 */ slti $at, $v0, 2 -/* 09F574 7F06AA44 54200052 */ bnezl $at, .L7F06AB90 -/* 09F578 7F06AA48 8FBF001C */ lw $ra, 0x1c($sp) -/* 09F57C 7F06AA4C 0FC22FEE */ jal getMissiontimer -/* 09F580 7F06AA50 00000000 */ nop -/* 09F584 7F06AA54 AFA20034 */ sw $v0, 0x34($sp) -/* 09F588 7F06AA58 0FC30776 */ jal langGet -/* 09F58C 7F06AA5C 340498DE */ li $a0, 39134 -/* 09F590 7F06AA60 8E180000 */ lw $t8, ($s0) -/* 09F594 7F06AA64 3C058005 */ lui $a1, %hi(aSD_0) -/* 09F598 7F06AA68 24A53C0C */ addiu $a1, %lo(aSD_0) # addiu $a1, $a1, 0x3c0c -/* 09F59C 7F06AA6C 27A40040 */ addiu $a0, $sp, 0x40 -/* 09F5A0 7F06AA70 00403025 */ move $a2, $v0 -/* 09F5A4 7F06AA74 0C002B25 */ jal sprintf -/* 09F5A8 7F06AA78 8F0729DC */ lw $a3, 0x29dc($t8) -/* 09F5AC 7F06AA7C 0FC228F2 */ jal jp_hudmsgBottomShow -/* 09F5B0 7F06AA80 27A40040 */ addiu $a0, $sp, 0x40 -/* 09F5B4 7F06AA84 3C078008 */ lui $a3, %hi(g_playerPerm) -/* 09F5B8 7F06AA88 24E7A0B4 */ addiu $a3, %lo(g_playerPerm) # addiu $a3, $a3, -0x5f4c -/* 09F5BC 7F06AA8C 8CE20000 */ lw $v0, ($a3) -/* 09F5C0 7F06AA90 8C59001C */ lw $t9, 0x1c($v0) -/* 09F5C4 7F06AA94 2B210002 */ slti $at, $t9, 2 -/* 09F5C8 7F06AA98 54200011 */ bnezl $at, .L7F06AAE0 -/* 09F5CC 7F06AA9C 8E020000 */ lw $v0, ($s0) -/* 09F5D0 7F06AAA0 8E090000 */ lw $t1, ($s0) -/* 09F5D4 7F06AAA4 8FA80034 */ lw $t0, 0x34($sp) -/* 09F5D8 7F06AAA8 8C4B0048 */ lw $t3, 0x48($v0) -/* 09F5DC 7F06AAAC 8D2A29E4 */ lw $t2, 0x29e4($t1) -/* 09F5E0 7F06AAB0 010A1823 */ subu $v1, $t0, $t2 -/* 09F5E4 7F06AAB4 0163082A */ slt $at, $t3, $v1 -/* 09F5E8 7F06AAB8 50200004 */ beql $at, $zero, .L7F06AACC -/* 09F5EC 7F06AABC 8C4C0044 */ lw $t4, 0x44($v0) -/* 09F5F0 7F06AAC0 AC430048 */ sw $v1, 0x48($v0) -/* 09F5F4 7F06AAC4 8CE20000 */ lw $v0, ($a3) -/* 09F5F8 7F06AAC8 8C4C0044 */ lw $t4, 0x44($v0) -.L7F06AACC: -/* 09F5FC 7F06AACC 006C082A */ slt $at, $v1, $t4 -/* 09F600 7F06AAD0 50200003 */ beql $at, $zero, .L7F06AAE0 -/* 09F604 7F06AAD4 8E020000 */ lw $v0, ($s0) -/* 09F608 7F06AAD8 AC430044 */ sw $v1, 0x44($v0) -/* 09F60C 7F06AADC 8E020000 */ lw $v0, ($s0) -.L7F06AAE0: -/* 09F610 7F06AAE0 2406FFFF */ li $a2, -1 -/* 09F614 7F06AAE4 24030001 */ li $v1, 1 -/* 09F618 7F06AAE8 8C4D29EC */ lw $t5, 0x29ec($v0) -/* 09F61C 7F06AAEC AC4D29F0 */ sw $t5, 0x29f0($v0) -/* 09F620 7F06AAF0 8E020000 */ lw $v0, ($s0) -/* 09F624 7F06AAF4 8C4E29E8 */ lw $t6, 0x29e8($v0) -/* 09F628 7F06AAF8 AC4E29EC */ sw $t6, 0x29ec($v0) -/* 09F62C 7F06AAFC 8E020000 */ lw $v0, ($s0) -/* 09F630 7F06AB00 8C4F29E4 */ lw $t7, 0x29e4($v0) -/* 09F634 7F06AB04 AC4F29E8 */ sw $t7, 0x29e8($v0) -/* 09F638 7F06AB08 8E190000 */ lw $t9, ($s0) -/* 09F63C 7F06AB0C 8FB80034 */ lw $t8, 0x34($sp) -/* 09F640 7F06AB10 AF3829E4 */ sw $t8, 0x29e4($t9) -/* 09F644 7F06AB14 8E020000 */ lw $v0, ($s0) -/* 09F648 7F06AB18 8C4529E8 */ lw $a1, 0x29e8($v0) -/* 09F64C 7F06AB1C 50C50016 */ beql $a2, $a1, .L7F06AB78 -/* 09F650 7F06AB20 8CE20000 */ lw $v0, ($a3) -/* 09F654 7F06AB24 8C4429E4 */ lw $a0, 0x29e4($v0) -/* 09F658 7F06AB28 00854823 */ subu $t1, $a0, $a1 -/* 09F65C 7F06AB2C 29210078 */ slti $at, $t1, 0x78 -/* 09F660 7F06AB30 50200011 */ beql $at, $zero, .L7F06AB78 -/* 09F664 7F06AB34 8CE20000 */ lw $v0, ($a3) -/* 09F668 7F06AB38 8C4529EC */ lw $a1, 0x29ec($v0) -/* 09F66C 7F06AB3C 24030002 */ li $v1, 2 -/* 09F670 7F06AB40 10C5000C */ beq $a2, $a1, .L7F06AB74 -/* 09F674 7F06AB44 00854023 */ subu $t0, $a0, $a1 -/* 09F678 7F06AB48 29010078 */ slti $at, $t0, 0x78 -/* 09F67C 7F06AB4C 5020000A */ beql $at, $zero, .L7F06AB78 -/* 09F680 7F06AB50 8CE20000 */ lw $v0, ($a3) -/* 09F684 7F06AB54 8C4529F0 */ lw $a1, 0x29f0($v0) -/* 09F688 7F06AB58 24630001 */ addiu $v1, $v1, 1 -/* 09F68C 7F06AB5C 10C50005 */ beq $a2, $a1, .L7F06AB74 -/* 09F690 7F06AB60 00855023 */ subu $t2, $a0, $a1 -/* 09F694 7F06AB64 29410078 */ slti $at, $t2, 0x78 -/* 09F698 7F06AB68 50200003 */ beql $at, $zero, .L7F06AB78 -/* 09F69C 7F06AB6C 8CE20000 */ lw $v0, ($a3) -/* 09F6A0 7F06AB70 24630001 */ addiu $v1, $v1, 1 -.L7F06AB74: -/* 09F6A4 7F06AB74 8CE20000 */ lw $v0, ($a3) -.L7F06AB78: -/* 09F6A8 7F06AB78 8C4B0058 */ lw $t3, 0x58($v0) -/* 09F6AC 7F06AB7C 0163082A */ slt $at, $t3, $v1 -/* 09F6B0 7F06AB80 50200003 */ beql $at, $zero, .L7F06AB90 -/* 09F6B4 7F06AB84 8FBF001C */ lw $ra, 0x1c($sp) -/* 09F6B8 7F06AB88 AC430058 */ sw $v1, 0x58($v0) -/* 09F6BC 7F06AB8C 8FBF001C */ lw $ra, 0x1c($sp) -.L7F06AB90: -/* 09F6C0 7F06AB90 8FB00018 */ lw $s0, 0x18($sp) -/* 09F6C4 7F06AB94 27BD0140 */ addiu $sp, $sp, 0x140 -/* 09F6C8 7F06AB98 03E00008 */ jr $ra -/* 09F6CC 7F06AB9C 00000000 */ nop -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.text -glabel increment_num_suicides_display_MP -/* 09DBB0 7F06B1C0 27BDFEC0 */ addiu $sp, $sp, -0x140 -/* 09DBB4 7F06B1C4 AFB00018 */ sw $s0, 0x18($sp) -/* 09DBB8 7F06B1C8 3C108007 */ lui $s0, %hi(g_CurrentPlayer) # $s0, 0x8007 -/* 09DBBC 7F06B1CC 26108BC0 */ addiu $s0, %lo(g_CurrentPlayer) # addiu $s0, $s0, -0x7440 -/* 09DBC0 7F06B1D0 8E020000 */ lw $v0, ($s0) -/* 09DBC4 7F06B1D4 AFBF001C */ sw $ra, 0x1c($sp) -/* 09DBC8 7F06B1D8 8C4E29D4 */ lw $t6, 0x29d4($v0) -/* 09DBCC 7F06B1DC 25CF0001 */ addiu $t7, $t6, 1 -/* 09DBD0 7F06B1E0 0FC26669 */ jal getPlayerCount -/* 09DBD4 7F06B1E4 AC4F29D4 */ sw $t7, 0x29d4($v0) -/* 09DBD8 7F06B1E8 28410002 */ slti $at, $v0, 2 -/* 09DBDC 7F06B1EC 54200052 */ bnezl $at, .L7F06B338 -/* 09DBE0 7F06B1F0 8FBF001C */ lw $ra, 0x1c($sp) -/* 09DBE4 7F06B1F4 0FC230AB */ jal getMissiontimer -/* 09DBE8 7F06B1F8 00000000 */ nop -/* 09DBEC 7F06B1FC AFA20034 */ sw $v0, 0x34($sp) -/* 09DBF0 7F06B200 0FC304AE */ jal langGet -/* 09DBF4 7F06B204 340498DE */ li $a0, 39134 -/* 09DBF8 7F06B208 8E180000 */ lw $t8, ($s0) -/* 09DBFC 7F06B20C 3C058005 */ lui $a1, %hi(aSD_0) # $a1, 0x8005 -/* 09DC00 7F06B210 24A59D4C */ addiu $a1, %lo(aSD_0) # addiu $a1, $a1, -0x62b4 -/* 09DC04 7F06B214 27A40040 */ addiu $a0, $sp, 0x40 -/* 09DC08 7F06B218 00403025 */ move $a2, $v0 -/* 09DC0C 7F06B21C 0C00283D */ jal sprintf -/* 09DC10 7F06B220 8F0729D4 */ lw $a3, 0x29d4($t8) -/* 09DC14 7F06B224 0FC229B5 */ jal jp_hudmsgBottomShow -/* 09DC18 7F06B228 27A40040 */ addiu $a0, $sp, 0x40 -/* 09DC1C 7F06B22C 3C078007 */ lui $a3, %hi(g_playerPerm) # $a3, 0x8007 -/* 09DC20 7F06B230 24E78BC4 */ addiu $a3, %lo(g_playerPerm) # addiu $a3, $a3, -0x743c -/* 09DC24 7F06B234 8CE20000 */ lw $v0, ($a3) -/* 09DC28 7F06B238 8C59001C */ lw $t9, 0x1c($v0) -/* 09DC2C 7F06B23C 2B210002 */ slti $at, $t9, 2 -/* 09DC30 7F06B240 54200011 */ bnezl $at, .L7F06B288 -/* 09DC34 7F06B244 8E020000 */ lw $v0, ($s0) -/* 09DC38 7F06B248 8E090000 */ lw $t1, ($s0) -/* 09DC3C 7F06B24C 8FA80034 */ lw $t0, 0x34($sp) -/* 09DC40 7F06B250 8C4B0048 */ lw $t3, 0x48($v0) -/* 09DC44 7F06B254 8D2A29DC */ lw $t2, 0x29dc($t1) -/* 09DC48 7F06B258 010A1823 */ subu $v1, $t0, $t2 -/* 09DC4C 7F06B25C 0163082A */ slt $at, $t3, $v1 -/* 09DC50 7F06B260 50200004 */ beql $at, $zero, .L7F06B274 -/* 09DC54 7F06B264 8C4C0044 */ lw $t4, 0x44($v0) -/* 09DC58 7F06B268 AC430048 */ sw $v1, 0x48($v0) -/* 09DC5C 7F06B26C 8CE20000 */ lw $v0, ($a3) -/* 09DC60 7F06B270 8C4C0044 */ lw $t4, 0x44($v0) -.L7F06B274: -/* 09DC64 7F06B274 006C082A */ slt $at, $v1, $t4 -/* 09DC68 7F06B278 50200003 */ beql $at, $zero, .L7F06B288 -/* 09DC6C 7F06B27C 8E020000 */ lw $v0, ($s0) -/* 09DC70 7F06B280 AC430044 */ sw $v1, 0x44($v0) -/* 09DC74 7F06B284 8E020000 */ lw $v0, ($s0) -.L7F06B288: -/* 09DC78 7F06B288 2406FFFF */ li $a2, -1 -/* 09DC7C 7F06B28C 24030001 */ li $v1, 1 -/* 09DC80 7F06B290 8C4D29E4 */ lw $t5, 0x29e4($v0) -/* 09DC84 7F06B294 AC4D29E8 */ sw $t5, 0x29e8($v0) -/* 09DC88 7F06B298 8E020000 */ lw $v0, ($s0) -/* 09DC8C 7F06B29C 8C4E29E0 */ lw $t6, 0x29e0($v0) -/* 09DC90 7F06B2A0 AC4E29E4 */ sw $t6, 0x29e4($v0) -/* 09DC94 7F06B2A4 8E020000 */ lw $v0, ($s0) -/* 09DC98 7F06B2A8 8C4F29DC */ lw $t7, 0x29dc($v0) -/* 09DC9C 7F06B2AC AC4F29E0 */ sw $t7, 0x29e0($v0) -/* 09DCA0 7F06B2B0 8E190000 */ lw $t9, ($s0) -/* 09DCA4 7F06B2B4 8FB80034 */ lw $t8, 0x34($sp) -/* 09DCA8 7F06B2B8 AF3829DC */ sw $t8, 0x29dc($t9) -/* 09DCAC 7F06B2BC 8E020000 */ lw $v0, ($s0) -/* 09DCB0 7F06B2C0 8C4529E0 */ lw $a1, 0x29e0($v0) -/* 09DCB4 7F06B2C4 50C50016 */ beql $a2, $a1, .L7F06B320 -/* 09DCB8 7F06B2C8 8CE20000 */ lw $v0, ($a3) -/* 09DCBC 7F06B2CC 8C4429DC */ lw $a0, 0x29dc($v0) -/* 09DCC0 7F06B2D0 00854823 */ subu $t1, $a0, $a1 -/* 09DCC4 7F06B2D4 29210078 */ slti $at, $t1, 0x78 -/* 09DCC8 7F06B2D8 50200011 */ beql $at, $zero, .L7F06B320 -/* 09DCCC 7F06B2DC 8CE20000 */ lw $v0, ($a3) -/* 09DCD0 7F06B2E0 8C4529E4 */ lw $a1, 0x29e4($v0) -/* 09DCD4 7F06B2E4 24030002 */ li $v1, 2 -/* 09DCD8 7F06B2E8 10C5000C */ beq $a2, $a1, .L7F06B31C -/* 09DCDC 7F06B2EC 00854023 */ subu $t0, $a0, $a1 -/* 09DCE0 7F06B2F0 29010078 */ slti $at, $t0, 0x78 -/* 09DCE4 7F06B2F4 5020000A */ beql $at, $zero, .L7F06B320 -/* 09DCE8 7F06B2F8 8CE20000 */ lw $v0, ($a3) -/* 09DCEC 7F06B2FC 8C4529E8 */ lw $a1, 0x29e8($v0) -/* 09DCF0 7F06B300 24630001 */ addiu $v1, $v1, 1 -/* 09DCF4 7F06B304 10C50005 */ beq $a2, $a1, .L7F06B31C -/* 09DCF8 7F06B308 00855023 */ subu $t2, $a0, $a1 -/* 09DCFC 7F06B30C 29410078 */ slti $at, $t2, 0x78 -/* 09DD00 7F06B310 50200003 */ beql $at, $zero, .L7F06B320 -/* 09DD04 7F06B314 8CE20000 */ lw $v0, ($a3) -/* 09DD08 7F06B318 24630001 */ addiu $v1, $v1, 1 -.L7F06B31C: -/* 09DD0C 7F06B31C 8CE20000 */ lw $v0, ($a3) -.L7F06B320: -/* 09DD10 7F06B320 8C4B0058 */ lw $t3, 0x58($v0) -/* 09DD14 7F06B324 0163082A */ slt $at, $t3, $v1 -/* 09DD18 7F06B328 50200003 */ beql $at, $zero, .L7F06B338 -/* 09DD1C 7F06B32C 8FBF001C */ lw $ra, 0x1c($sp) -/* 09DD20 7F06B330 AC430058 */ sw $v1, 0x58($v0) -/* 09DD24 7F06B334 8FBF001C */ lw $ra, 0x1c($sp) -.L7F06B338: -/* 09DD28 7F06B338 8FB00018 */ lw $s0, 0x18($sp) -/* 09DD2C 7F06B33C 27BD0140 */ addiu $sp, $sp, 0x140 -/* 09DD30 7F06B340 03E00008 */ jr $ra -/* 09DD34 7F06B344 00000000 */ nop -) -#endif - - -#endif - - s32 get_curplayer_numsuicides(void) { return g_CurrentPlayer->num_suicides; -} +} \ No newline at end of file diff --git a/src/game/gun.h b/src/game/gun.h index 5b8615a7..4b41dce9 100644 --- a/src/game/gun.h +++ b/src/game/gun.h @@ -231,7 +231,7 @@ typedef struct GunModelFileRecord } GunModelFileRecord; typedef struct CasingRecord { - f32 unk00; + f32 floor_y_pos; coord3d pos; coord3d vel; #if VERSION_EU @@ -289,17 +289,17 @@ u16 *get_ptr_short_watch_text_for_item(ITEM_IDS item); s32 bondwalkItemHasAmmo(ITEM_IDS item); -void display_in_game_crosshair(s32 *gdl); +void gunDrawSight(s32 *gdl); WeaponStats *get_ptr_item_statistics(ITEM_IDS item); ITEM_IDS getCurrentPlayerWeaponId(GUNHAND hand); s32 currentPlayerEquipWeaponWrapper(GUNHAND hand, s32 next_weapon); -void sub_GAME_7F068E6C(void); +void update_bullet_casings(void); void attempt_reload_item_in_hand(GUNHAND hand); void set_max_ammo_for_cur_player(void); -void set_unset_ammo_on_screen_setting(s32 flags, s32 isset); -void set_unset_bitflags(s32 bitflags, s32 flag); +void gunSetGunAmmoVisible(s32 reason, s32 enable); +void gunSetSightVisible(s32 reason, s32 visible); s32 get_max_ammo_for_type(s32); void give_cur_player_ammo(s32, s32); @@ -313,7 +313,7 @@ u8 bondwalkItemGetSoundTriggerRate(ITEM_IDS item); void recall_joy2_hits_edit_detail_edit_flag(enum ITEM_IDS item, PropRecord* prop, s32 texture_index); void recall_joy2_hits_edit_flag(enum ITEM_IDS item, coord3d* arg1, s32 texture_index); void sub_GAME_7F05EB0C(ObjectRecord *arg0, coord3d *arg1, StandTile *arg2, Mtxf *arg3, coord3d *arg4, Mtxf *arg5, PropRecord *arg6); -void sub_GAME_7F061948(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2, coord3d *arg3); +void CapBeamLengthAndDecideIfRendered(struct ChrRecord_f180 *arg0, ITEM_IDS item, coord3d *arg2, coord3d *arg3); void sub_GAME_7F068190(coord3d *arg0, coord3d *arg1); void inc_curplayer_hitcount_with_weapon(ITEM_IDS item, SHOT_REGISTER shot_register); @@ -333,4 +333,25 @@ void gunSetOffsetRelated(f32 param_1); s32 get_curplayer_shot_register(SHOT_REGISTER shot_register); void get_bullet_angle(f32* horizontal_angle, f32* vertical_angle); +ITEM_IDS get_item_in_hand_or_watch_menu(GUNHAND hand); +void draw_item_in_hand(GUNHAND hand, s32 next_weapon); +void sub_GAME_7F05DAE4(GUNHAND hand); +void sub_GAME_7F067F58(f32 turn_x, f32 turn_y, f32 max_aim_lock_speed); +s32 get_ammo_count_for_weapon(ITEM_IDS weapon); +void add_ammo_to_weapon(ITEM_IDS weapon, s32 ammo); +s32 get_ammo_in_hands_magazine(GUNHAND hand); +void autoadvance_on_deplete_all_ammo(void); +f32 getCurrentPlayerNoise(GUNHAND hand); +void camera_sniper_zoom_in(f32 zoom); +void camera_sniper_zoom_out(f32 zoom); +f32 get_item_in_hand_zoom(void); +void advance_through_inventory(void); +void backstep_through_inventory(void); +void gunSetAimType(s32 param_1); +void sub_GAME_7F067FBC(f32 turn_x, f32 turn_y); +void gunTickGameplay(s32 arg0); + +Gfx *gunDrawHudString(Gfx *gdl, s8 *text, s32 x, s32 halign, s32 y, s32 valign, bool glow); +Gfx *gunDrawHudInteger(Gfx *gdl, s32 value, s32 x, s32 halign, s32 y, s32 valign, bool glow); + #endif diff --git a/src/game/image.c b/src/game/image.c index f820c9fa..9d664212 100644 --- a/src/game/image.c +++ b/src/game/image.c @@ -2765,7 +2765,7 @@ void texLoadFromModelFileHeader(ModelFileHeader* arg0, struct texpool* arg1) } -void texLoadFromTextureNum(u32 texturenum, struct texpool *arg1) +void texLoadFromTextureNum(s32 texturenum, struct texpool *arg1) { u32 texturenumcopy; texturenumcopy = texturenum; diff --git a/src/game/image.h b/src/game/image.h index 49625cd7..cebcaaae 100644 --- a/src/game/image.h +++ b/src/game/image.h @@ -91,5 +91,6 @@ s32 texInflateNonZlib(u8 *src, u8 *dst, s32 arg2, s32 forcenumimages, struct tex s32 texInflateZlib(u8 *src, u8 *dst, s32 arg2, s32 forcenumimages, struct texpool *arg4); void texLoad(s32 *updateword, struct texpool *pool); void texInitPool(struct texpool *arg0, u8 *arg1, s32 arg2); +void texLoadFromTextureNum(s32 texturenum, struct texpool *arg1); #endif diff --git a/src/game/image_bank.h b/src/game/image_bank.h index 0f19f5ce..3ae5c4b1 100644 --- a/src/game/image_bank.h +++ b/src/game/image_bank.h @@ -7,8 +7,11 @@ extern struct sImageTableEntry *crosshairimage; extern struct sImageTableEntry *mainfolderimages; +extern struct sImageTableEntry *mpstageselimages; extern struct sImageTableEntry *genericimage; extern struct sImageTableEntry *skywaterimages; +extern struct sImageTableEntry *monitorimages; +extern struct sImageTableEntry *mpcharselimages; extern u8* img_curpos; extern s32 img_bitcount; diff --git a/src/game/indy_commands.c b/src/game/indy_commands.c index 664ad5f6..3002347c 100644 --- a/src/game/indy_commands.c +++ b/src/game/indy_commands.c @@ -194,55 +194,55 @@ s32 send2indyresourcecommands(indy_resource_entry_header * entry1, u32 size1, in } -void indyrescmdSizeNextCmd(s32 readsize,s32 writesize) +void indyrescmdStartCmdSeq(s32 readsize,s32 writesize) { indy_resource_entry_type1 cmd; - cmd.entry.resourceID = 0x9abf1623; - cmd.entry.type = INDY_SIZE; - cmd.entry.size = 0x14; + cmd.entry.resourceID = INDYMAGIC; + cmd.entry.type = INDY_STARTCMDSEQ; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; - indycmdSendCommand(&cmd,0x14); + indycmdSendCommand(&cmd,sizeof(cmd)); } -void indyrescmdSendCmdEnd(s32 readsize,s32 writesize) +void indyrescmdEndCmdSeq(s32 readsize,s32 writesize) { - indy_resource_entry_type2 cmd; + s_indyResCmd02End cmd; - cmd.entry.resourceID = 0x9abf1623; - cmd.entry.type = INDY_END; - cmd.entry.size = 0x14; + cmd.entry.resourceID = INDYMAGIC; + cmd.entry.type = INDY_ENDCMDSEQ; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; - indycmdSendCommand(&cmd,0x14); + indycmdSendCommand(&cmd,sizeof(cmd)); } void indyrescmdInit(s32 readsize,s32 writesize) { indy_resource_entry_type0 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_INIT; - cmd.entry.size = 0x14; + cmd.entry.size = sizeof(indy_resource_entry_type0); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; - indycmdSendCommand(&cmd,0x14); + indycmdSendCommand(&cmd,sizeof(indy_resource_entry_type0)); } void post_type3_indyrescmd(s32 rsize,s32 wsize,char *strptr) { struct indy_resource_entry_type3 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_RESCMD; - cmd.entry.size = 0x114; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,strptr, 256); + strncpy(cmd.strbuffer,strptr, sizeof(cmd.strbuffer)); cmd.strbuffer[255] = 0; - indycmdSendCommand(&cmd.entry,0x114); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } @@ -250,13 +250,13 @@ void post_type4_indyrescmd_data_recieved(s32 readsize,s32 writesize,s32 data) { indy_resource_entry_type4 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_RESCMDDATARCVD; - cmd.entry.size = 0x18; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data = data; - indycmdSendCommand(&cmd.entry,0x18); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } @@ -264,63 +264,63 @@ void indyrescmdCheckFileExists(s32 rsize,s32 wsize,char *name) { indy_resource_entry_type5 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_SENDCHECKFILEEXISTS; - cmd.entry.size = 0x114; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,name,0x100); + strncpy(cmd.strbuffer,name,sizeof(cmd.strbuffer)); cmd.strbuffer[255] = '\0'; - indycmdSendCommand(&cmd,0x114); + indycmdSendCommand(&cmd,sizeof(cmd)); } void post_type6_indyrescmd_printfrecieved(s32 readsize,s32 writesize,u32 data1,u32 data2) { - struct indy_resource_entry_type6 cmd; + indy_resource_entry_type6 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_RECVCHECKFILEEXISTS; - cmd.entry.size = 0x1c; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data1 = data1; cmd.data2 = data2; - indycmdSendCommand(&cmd.entry,0x1c); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } void indyrescmdSendFileLoad(u32 rsize,u32 wsize,u8 *filename,u32 size) { - struct indy_resource_entry_type7 cmd; + indy_resource_entry_type7 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_SENDFILELOAD; - cmd.entry.size = 0x118; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,filename,0x100); + strncpy(cmd.strbuffer,filename,sizeof(cmd.strbuffer)); cmd.strbuffer[255] = '\0'; cmd.size = size; - indycmdSendCommand(&cmd,0x118); + indycmdSendCommand(&cmd,sizeof(cmd)); } void post_type8_indyrescmd_log_recieved(s32 rsize,s32 wsize,u32 data1,u32 data2,u32 cmd2size,struct indy_resource_entry_type8 *cmd2) { - struct indy_resource_entry_type8 cmd; + indy_resource_entry_type8 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_LOGRECVD; - cmd.entry.size = (cmd2size +3 & ~3)+ 0x20; + cmd.entry.size = (cmd2size +3 & ~3)+ sizeof(indy_resource_entry_type8); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; cmd.data1 = data1; cmd.size = cmd2size; cmd.data2 = data2; - send2indyresourcecommands(&cmd,0x20,cmd2,cmd2size); + send2indyresourcecommands(&cmd,sizeof(indy_resource_entry_type8),cmd2,cmd2size); } @@ -328,16 +328,16 @@ void indyrescmdSendDump(s32 rsize,s32 wsize,char *strptr,u32 size2,struct indy_r { indy_resource_entry_type9 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_SENDDUMP; - cmd.entry.size = (size2 + 3 & 0xfffffffc) + 0x114; + cmd.entry.size = (size2 + 3 & 0xfffffffc) + sizeof(indy_resource_entry_type9); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,strptr,0x100); + strncpy(cmd.strbuffer,strptr,sizeof(cmd.strbuffer)); cmd.strbuffer[255] = '\0'; - send2indyresourcecommands(&cmd,0x114,cmd2,size2); + send2indyresourcecommands(&cmd,sizeof(indy_resource_entry_type9),cmd2,size2); } @@ -346,13 +346,13 @@ void post_typeA_indyrescmd_app_command_recieved(s32 readsize,s32 writesize,u32 d { indy_resource_entry_typeA cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_APPCMDRECVD; - cmd.entry.size = 0x18; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data = data; - indycmdSendCommand(&cmd.entry,0x18); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } @@ -360,34 +360,34 @@ void indyrescmdRamRomLoad(u32 rsize,u32 wsize,char *name,u32 filesize,u32 ptarge { indy_resource_entry_typeF cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_RAMROMLOAD; - cmd.entry.size = 0x11c; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,name,0x100); + strncpy(cmd.strbuffer,name,sizeof(cmd.strbuffer)); cmd.strbuffer[255] = '\0'; cmd.size = filesize; cmd.hwaddress = ptarget; - indycmdSendCommand(&cmd,0x11c); + indycmdSendCommand(&cmd,sizeof(cmd)); } void post_type10_indyrescmd_fault_ack_by_host(s32 rsize,s32 wsize,u32 data1,u32 data2,u32 data3) { - struct indy_resource_entry_type10 cmd; + indy_resource_entry_type10 cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_FAULTACKHOST; - cmd.entry.size = 0x20; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; cmd.data1 = data1; cmd.data2 = data2; cmd.data3 = data3; - indycmdSendCommand(&cmd,0x20); + indycmdSendCommand(&cmd,sizeof(cmd)); } @@ -395,16 +395,16 @@ void indyrescmdSendExportFile(u32 rsize,u32 wsize,u8 *ptrstr,u32 size,u8 *hwaddr { indy_resource_entry_typeD cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_EXPORTFILE; - cmd.entry.size = 0x11c; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = rsize; cmd.entry.writesize = wsize; - strncpy(cmd.strbuffer,ptrstr,0x100); + strncpy(cmd.strbuffer,ptrstr,sizeof(cmd.strbuffer)); cmd.strbuffer[255] = '\0'; cmd.size = size; cmd.hwaddress = hwaddress; - indycmdSendCommand(&cmd,0x11c); + indycmdSendCommand(&cmd,sizeof(cmd)); } @@ -412,28 +412,28 @@ void post_typeE_indyrescmd_prof_recv(s32 readsize,s32 writesize,u32 data) { indy_resource_entry_typeE cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_PROFILE_RECV; - cmd.entry.size = 0x18; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data = data; - indycmdSendCommand(&cmd.entry,0x18); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } void indyrescmdSendHostCmd(s32 rsize,s32 wsize,char *strptr) { - indy_resource_entry_typeB res; + indy_resource_entry_typeB cmd; - res.entry.resourceID = 0x9abf1623; - res.entry.type = INDY_SENDHOSTCMD; - res.entry.size = 0x414; - res.entry.readsize = rsize; - res.entry.writesize = wsize; - strncpy(res.strbuffer,strptr,0x400); - res.strbuffer[1023] = '\0'; - indycmdSendCommand(&res,0x414); + cmd.entry.resourceID = INDYMAGIC; + cmd.entry.type = INDY_SENDHOSTCMD; + cmd.entry.size = sizeof(cmd); + cmd.entry.readsize = rsize; + cmd.entry.writesize = wsize; + strncpy(cmd.strbuffer,strptr,sizeof(cmd.strbuffer)); + cmd.strbuffer[1023] = '\0'; + indycmdSendCommand(&cmd,sizeof(cmd)); } @@ -441,13 +441,13 @@ void post_typeC_indyrescmd_prof_send(s32 readsize,s32 writesize,u32 data) { indy_resource_entry_typeC cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_PROFILE_SEND; - cmd.entry.size = 0x18; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data = data; - indycmdSendCommand(&cmd.entry,0x18); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } @@ -455,156 +455,156 @@ void post_typeA_indyrescmd_app_data_recieved(s32 readsize,s32 writesize,u32 data { indy_resource_entry_typeA cmd; - cmd.entry.resourceID = 0x9abf1623; + cmd.entry.resourceID = INDYMAGIC; cmd.entry.type = INDY_APPCMDRECVD; - cmd.entry.size = 0x18; + cmd.entry.size = sizeof(cmd); cmd.entry.readsize = readsize; cmd.entry.writesize = writesize; cmd.data = data; - indycmdSendCommand(&cmd.entry,0x18); + indycmdSendCommand(&cmd.entry,sizeof(cmd)); } s32 indycmdSendInitPacket(void) { - indyrescmdSizeNextCmd(0x14,0x14); - indyrescmdInit(0x14,0x14); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type0),sizeof(indy_resource_entry_type0)); + indyrescmdInit(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End)); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_game_data_send(char *strptr) { - indyrescmdSizeNextCmd(0x114,0x114); - post_type3_indyrescmd(0x14,0x14,strptr); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type3),sizeof(indy_resource_entry_type3)); + post_type3_indyrescmd(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),strptr); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_debug_data_recv(u32 data) { - indyrescmdSizeNextCmd(0x18,0x18); - post_type4_indyrescmd_data_recieved(0x14,0x14,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type4),sizeof(indy_resource_entry_type4)); + post_type4_indyrescmd_data_recieved(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendHostCheckFileExists(char *strptr) { - indyrescmdSizeNextCmd(0x114,0x114); - indyrescmdCheckFileExists(0x14,0x14,strptr); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type5),sizeof(indy_resource_entry_type5)); + indyrescmdCheckFileExists(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),strptr); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_debug_printf_recv(u32 data1,u32 data2) { - indyrescmdSizeNextCmd(0x1c,0x1c); - post_type6_indyrescmd_printfrecieved(0x14,0x14,data1,data2); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type6),sizeof(indy_resource_entry_type6)); + post_type6_indyrescmd_printfrecieved(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data1,data2); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendLoadFile(u8 *filename,u32 size) { - indyrescmdSizeNextCmd(0x118,0x118); - indyrescmdSendFileLoad(0x14,0x14,filename,size); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type7),sizeof(indy_resource_entry_type7)); + indyrescmdSendFileLoad(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),filename,size); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_1_8_2(u32 data1,u32 data2,u32 size2,struct indy_resource_entry_header *cmd2) { - indyrescmdSizeNextCmd((size2 + 3 & 0xfffffffc) + 0x20,0x20); - post_type8_indyrescmd_log_recieved(0x14,0x14,data1,data2,size2,cmd2); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq((size2 + 3 & 0xfffffffc) + sizeof(indy_resource_entry_type8),sizeof(indy_resource_entry_type8)); + post_type8_indyrescmd_log_recieved(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data1,data2,size2,cmd2); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendDump(char *string, u32 size, struct indy_resource_entry_header *data) { - indyrescmdSizeNextCmd((size + 3 & 0xfffffffc) + 0x114,0x114); - indyrescmdSendDump(0x14,0x14,string,size,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq((size + 3 & 0xfffffffc) + sizeof(indy_resource_entry_type9),sizeof(indy_resource_entry_type9)); + indyrescmdSendDump(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),string,size,data); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_recv_capture_data_success(u32 data) { - indyrescmdSizeNextCmd(0x18,0x18); - post_typeA_indyrescmd_app_command_recieved(0x14,0x14,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeA),sizeof(indy_resource_entry_typeA)); + post_typeA_indyrescmd_app_command_recieved(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendRamRomLoad(char *strptr,u32 ptarget,u32 filesize) { - indyrescmdSizeNextCmd(0x11c,0x11c); - indyrescmdRamRomLoad(0x14,0x14,strptr,filesize,ptarget); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeF),sizeof(indy_resource_entry_typeF)); + indyrescmdRamRomLoad(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),strptr,filesize,ptarget); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_1_10_2(u32 param_1,u32 param_2,u32 param_3) { - indyrescmdSizeNextCmd(0x20,0x20); - post_type10_indyrescmd_fault_ack_by_host(0x14,0x14,param_1,param_2,param_3); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_type10),sizeof(indy_resource_entry_type10)); + post_type10_indyrescmd_fault_ack_by_host(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),param_1,param_2,param_3); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendHostExportFile(char *strptr,u8 *phwaddr,u32 size) { - indyrescmdSizeNextCmd(0x11c,0x11c); - indyrescmdSendExportFile(0x14,0x14,strptr,size,phwaddr); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeD),sizeof(indy_resource_entry_typeD)); + indyrescmdSendExportFile(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),strptr,size,phwaddr); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_host_prof_recv(u32 data) { - indyrescmdSizeNextCmd(0x18,0x18); - post_typeE_indyrescmd_prof_recv(0x14,0x14,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeE),sizeof(indy_resource_entry_typeE)); + post_typeE_indyrescmd_prof_recv(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 indycmdSendHostCmdPacket(char *strptr) { - indyrescmdSizeNextCmd(0x414,0x414); - indyrescmdSendHostCmd(0x14,0x14,strptr); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeB),sizeof(indy_resource_entry_typeB)); + indyrescmdSendHostCmd(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),strptr); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_1_C_2(u32 data) { - indyrescmdSizeNextCmd(0x18,0x18); - post_typeC_indyrescmd_prof_send(0x14,0x14,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeC),sizeof(indy_resource_entry_typeC)); + post_typeC_indyrescmd_prof_send(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data); + indyrescmdEndCmdSeq(0,0); return TRUE; } s32 post_indyrescmd_1_A_2(u32 data) { - indyrescmdSizeNextCmd(0x18,0x18); - post_typeA_indyrescmd_app_data_recieved(0x14,0x14,data); - indyrescmdSendCmdEnd(0,0); + indyrescmdStartCmdSeq(sizeof(indy_resource_entry_typeA),sizeof(indy_resource_entry_typeA)); + post_typeA_indyrescmd_app_data_recieved(sizeof(s_indyResCmd02End),sizeof(s_indyResCmd02End),data); + indyrescmdEndCmdSeq(0,0); return TRUE; } @@ -800,10 +800,9 @@ s32 post_indyrescmd_read_2commands(u8 *buffer1,u32 size1,u8 *buffer2,u32 size2) s32 indyrescmdResponseSize(s32 readsize, s32 writesize) { struct indy_resource_entry_header cmd; - u32 ret; indycmdRecieveCommand(&cmd, 0x14); - if (cmd.resourceID != 0x9ABF1623) + if (cmd.resourceID != INDYMAGIC) { return FALSE; } @@ -832,7 +831,7 @@ s32 indyrescmdResponseEnd(s32 readsize, s32 writesize) struct indy_resource_entry_header cmd; indycmdRecieveCommand(&cmd, 0x14); - if (cmd.resourceID != 0x9ABF1623) + if (cmd.resourceID != INDYMAGIC) { return FALSE; } @@ -862,7 +861,7 @@ s32 post_indyrescmd_istype4_correctvalue(s32 readsize, s32 writesize, u32 *respo struct indy_resource_entry_type4 cmd; indycmdRecieveCommand(&cmd, 0x18); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -892,7 +891,7 @@ s32 indyrescmdResponseFileExists(s32 readsize, s32 writesize, u32 *response1, u3 struct indy_resource_entry_type6 cmd; indycmdRecieveCommand(&cmd, 0x1C); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -923,7 +922,7 @@ s32 indyrescmdResponseRecieveFile(s32 readsize, s32 writesize, u32 *response1, u struct indy_resource_entry_type8 cmd; indycmdRecieveCommand(&cmd, 0x20); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -956,7 +955,7 @@ s32 indyrescmdResponseSendDump(s32 readsize, s32 writesize, u32 *response) struct indy_resource_entry_typeA cmd; indycmdRecieveCommand(&cmd, 0x18); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -986,7 +985,7 @@ s32 indyrescmdResponseRecieveRamRom(s32 readsize, s32 writesize, u32 *data1, u32 struct indy_resource_entry_type10 cmd; indycmdRecieveCommand(&cmd, 0x20); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -1018,7 +1017,7 @@ s32 indyrescmdResponseHostExportFile(s32 readsize, s32 writesize, u32 *response) indy_resource_entry_typeE cmd; indycmdRecieveCommand(&cmd, 0x18); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -1048,7 +1047,7 @@ s32 indyrescmdResponseHostCmdPacket(s32 readsize, s32 writesize, u32 *response) indy_resource_entry_typeC cmd; indycmdRecieveCommand(&cmd, 0x18); - if (cmd.entry.resourceID != 0x9ABF1623) + if (cmd.entry.resourceID != INDYMAGIC) { return FALSE; } @@ -1141,7 +1140,7 @@ s32 response_indyrescmd_curr_matches_expected(s32 readsize, s32 writesize) struct indy_resource_entry_header cmd; indycmdRecieveCommand(&cmd, 0x14); - if (cmd.resourceID != 0x9ABF1623) + if (cmd.resourceID != INDYMAGIC) { return FALSE; } diff --git a/src/game/indy_commands.h b/src/game/indy_commands.h index b16ed38c..32133943 100644 --- a/src/game/indy_commands.h +++ b/src/game/indy_commands.h @@ -2,10 +2,12 @@ #define _INDY_COMMANDS_H_ #include +#define INDYMAGIC 0x9abf1623 + typedef enum INDYCMDTYPE { INDY_INIT=0, - INDY_SIZE=1, - INDY_END=2, + INDY_STARTCMDSEQ=1, + INDY_ENDCMDSEQ=2, INDY_RESCMD=3, INDY_RESCMDDATARCVD=4, INDY_SENDCHECKFILEEXISTS=5, @@ -38,9 +40,9 @@ typedef struct indy_resource_entry_type1 { indy_resource_entry_header entry; } indy_resource_entry_type1; -typedef struct indy_resource_entry_type2 { +typedef struct s_indyResCmd02End { indy_resource_entry_header entry; -} indy_resource_entry_type2; +} s_indyResCmd02End; typedef struct indy_resource_entry_type3 { indy_resource_entry_header entry; @@ -57,24 +59,24 @@ typedef struct indy_resource_entry_type5 { u8 strbuffer[256]; } indy_resource_entry_type5; -struct indy_resource_entry_type6 { +typedef struct indy_resource_entry_type6 { struct indy_resource_entry_header entry; u32 data1; u32 data2; -}; +} indy_resource_entry_type6; -struct indy_resource_entry_type7 { +typedef struct indy_resource_entry_type7 { struct indy_resource_entry_header entry; u8 strbuffer[256]; u32 size; -}; +} indy_resource_entry_type7; -struct indy_resource_entry_type8 { +typedef struct indy_resource_entry_type8 { struct indy_resource_entry_header entry; u32 data1; u32 data2; u32 size; -}; +} indy_resource_entry_type8; typedef struct indy_resource_entry_type9 { indy_resource_entry_header entry; @@ -115,12 +117,12 @@ typedef struct indy_resource_entry_typeF { u8* hwaddress; } indy_resource_entry_typeF; -struct indy_resource_entry_type10 { +typedef struct indy_resource_entry_type10 { struct indy_resource_entry_header entry; u32 data1; u32 data2; u32 data3; -}; +} indy_resource_entry_type10; diff --git a/src/game/initBondDATA.c b/src/game/initBondDATA.c index c1e4ee7d..7465533a 100644 --- a/src/game/initBondDATA.c +++ b/src/game/initBondDATA.c @@ -118,12 +118,12 @@ void init_player_BONDdata_stats(void) { g_CurrentPlayer->field_FD0 = 0; g_CurrentPlayer->z_trigger_timer = 0; g_CurrentPlayer->field_FD8 = 0; - g_CurrentPlayer->field_FDC = 0xFF; - g_CurrentPlayer->field_FDD = 0xFF; - g_CurrentPlayer->field_FDE = 0xFF; - g_CurrentPlayer->field_FDF = 0; + g_CurrentPlayer->tileColor.rgba[0] = 0xFF; + g_CurrentPlayer->tileColor.rgba[1] = 0xFF; + g_CurrentPlayer->tileColor.rgba[2] = 0xFF; + g_CurrentPlayer->tileColor.rgba[3] = 0; g_CurrentPlayer->resetshadecol = 1; - g_CurrentPlayer->field_FE4 = 0; + g_CurrentPlayer->aimtype = 0; g_CurrentPlayer->crosshair_angle[] = 0.0f; g_CurrentPlayer->crosshair_angle[] = 0.0f; g_CurrentPlayer->crosshair_x_pos = 0.0f; @@ -135,7 +135,7 @@ void init_player_BONDdata_stats(void) { g_CurrentPlayer->gun_azimuth_turning = 0.0f; g_CurrentPlayer->gunaimdamp = 0.9f; g_CurrentPlayer->field_1010 = 0.0f; - g_CurrentPlayer->holds_neg_pi = -3.1415927f; + g_CurrentPlayer->holds_neg_pi = -M_PI_F; g_CurrentPlayer->unk1018 = 0.0f; g_CurrentPlayer->copiedgoldeneye = FALSE; g_CurrentPlayer->magnetattracttime = -1; diff --git a/src/game/initBondDATA.h b/src/game/initBondDATA.h index 1426a1ed..da496b96 100644 --- a/src/game/initBondDATA.h +++ b/src/game/initBondDATA.h @@ -55,6 +55,7 @@ struct BONDdata_item_control_blocks { int field_C4; int field_C8; int field_CC; + // "reload flag", set when pressing B int field_D0; float field_D4; int field_D8; diff --git a/src/game/initBondDATAdefaults.c b/src/game/initBondDATAdefaults.c index a716a985..ad4e8450 100644 --- a/src/game/initBondDATAdefaults.c +++ b/src/game/initBondDATAdefaults.c @@ -76,11 +76,11 @@ void sets_a_bunch_of_BONDdata_values_to_default(void) } #endif - sub_GAME_7F075FAC(&g_CurrentPlayer->model, &player_gait_object_header, &g_CurrentPlayer->field_654); + animInit(&g_CurrentPlayer->model, &player_gait_object_header, &g_CurrentPlayer->field_654); modelSetScale(&g_CurrentPlayer->model, IDO_POINT_ONE); #if defined (BUGFIX_R1) - modelSetAnimRateForDuration(&g_CurrentPlayer->model, ANIMRATE, 0.0f); + modelSetAnimPlaySpeed(&g_CurrentPlayer->model, ANIMRATE, 0.0f); #endif g_CurrentPlayer->headanim = 0; @@ -90,55 +90,49 @@ void sets_a_bunch_of_BONDdata_values_to_default(void) g_CurrentPlayer->headwalkingtime60 = 0; g_CurrentPlayer->headamplitude = 1.0f; g_CurrentPlayer->sideamplitude = 1.0f; - g_CurrentPlayer->headpos[0] = 0.0f; - g_CurrentPlayer->headpos[1] = 0.0f; - g_CurrentPlayer->headpos[2] = 0.0f; - g_CurrentPlayer->headlook[0] = 0.0f; - g_CurrentPlayer->headlook[1] = 0.0f; - g_CurrentPlayer->headlook[2] = 0.0f; - g_CurrentPlayer->headup[0] = 0.0f; - g_CurrentPlayer->headup[1] = 0.0f; - g_CurrentPlayer->headup[2] = 0.0f; - g_CurrentPlayer->headpossum[0] = 0.0f; - g_CurrentPlayer->headpossum[1] = 0.0f; - g_CurrentPlayer->headpossum[2] = 0.0f; - g_CurrentPlayer->headlooksum[0] = 0.0f; - g_CurrentPlayer->headlooksum[1] = 0.0f; - - - g_CurrentPlayer->headlooksum[2] = HEADSUM; - - - g_CurrentPlayer->headupsum[0] = 0.0f; - - - g_CurrentPlayer->headupsum[1] = HEADSUM; - - - g_CurrentPlayer->headupsum[2] = 0.0f; + g_CurrentPlayer->headpos.f[0] = 0.0f; + g_CurrentPlayer->headpos.f[1] = 0.0f; + g_CurrentPlayer->headpos.f[2] = 0.0f; + g_CurrentPlayer->headlook.f[0] = 0.0f; + g_CurrentPlayer->headlook.f[1] = 0.0f; + g_CurrentPlayer->headlook.f[2] = 0.0f; + g_CurrentPlayer->headup.f[0] = 0.0f; + g_CurrentPlayer->headup.f[1] = 0.0f; + g_CurrentPlayer->headup.f[2] = 0.0f; + g_CurrentPlayer->headpossum.f[0] = 0.0f; + g_CurrentPlayer->headpossum.f[1] = 0.0f; + g_CurrentPlayer->headpossum.f[2] = 0.0f; + g_CurrentPlayer->headlooksum.f[0] = 0.0f; + g_CurrentPlayer->headlooksum.f[1] = 0.0f; + g_CurrentPlayer->headlooksum.f[2] = HEADSUM; + + + g_CurrentPlayer->headupsum.f[0] = 0.0f; + g_CurrentPlayer->headupsum.f[1] = HEADSUM; + g_CurrentPlayer->headupsum.f[2] = 0.0f; g_CurrentPlayer->resetheadpos = 1; g_CurrentPlayer->resetheadrot = 1; g_CurrentPlayer->resetheadtick = 1; - g_CurrentPlayer->headbodyoffset[0] = 0.0f; - g_CurrentPlayer->headbodyoffset[1] = 0.0f; - g_CurrentPlayer->headbodyoffset[2] = 0.0f; + g_CurrentPlayer->headbodyoffset.f[0] = 0.0f; + g_CurrentPlayer->headbodyoffset.f[1] = 0.0f; + g_CurrentPlayer->headbodyoffset.f[2] = 0.0f; g_CurrentPlayer->standheight = 0.0f; g_CurrentPlayer->standbodyoffset.x = 0.0f; g_CurrentPlayer->standbodyoffset.y = 0.0f; g_CurrentPlayer->standbodyoffset.z = 0.0f; g_CurrentPlayer->standfrac = 0.0f; - g_CurrentPlayer->standlook[0][0] = 0.0f; - g_CurrentPlayer->standlook[0][1] = 0.0f; - g_CurrentPlayer->standlook[0][2] = 1.0f; - g_CurrentPlayer->standlook[1][0] = 0.0f; - g_CurrentPlayer->standlook[1][1] = 0.0f; - g_CurrentPlayer->standlook[1][2] = 1.0f; - g_CurrentPlayer->standup[0][0] = 0.0f; - g_CurrentPlayer->standup[0][1] = 1.0f; - g_CurrentPlayer->standup[0][2] = 0.0f; - g_CurrentPlayer->standup[1][0] = 0.0f; - g_CurrentPlayer->standup[1][1] = 1.0f; - g_CurrentPlayer->standup[1][2] = 0.0f; + g_CurrentPlayer->standlook[0].f[0] = 0.0f; + g_CurrentPlayer->standlook[0].f[1] = 0.0f; + g_CurrentPlayer->standlook[0].f[2] = 1.0f; + g_CurrentPlayer->standlook[1].f[0] = 0.0f; + g_CurrentPlayer->standlook[1].f[1] = 0.0f; + g_CurrentPlayer->standlook[1].f[2] = 1.0f; + g_CurrentPlayer->standup[0].f[0] = 0.0f; + g_CurrentPlayer->standup[0].f[1] = 1.0f; + g_CurrentPlayer->standup[0].f[2] = 0.0f; + g_CurrentPlayer->standup[1].f[0] = 0.0f; + g_CurrentPlayer->standup[1].f[1] = 1.0f; + g_CurrentPlayer->standup[1].f[2] = 0.0f; g_CurrentPlayer->standcnt = 0; for (i=0; i<2; i++) diff --git a/src/game/initactorpropstuff.c b/src/game/initactorpropstuff.c index 96ededeb..2600d1c1 100644 --- a/src/game/initactorpropstuff.c +++ b/src/game/initactorpropstuff.c @@ -32,10 +32,6 @@ void reset_counter_rand_body_head(void) } -#ifdef NONMATCHING -//close, ops swapped -//34d80: addu s1,s1,v0 | 34d80: addiu s0,s0,1 -//34d84: addiu s0,s0,1 | 34d84: addu s1,s1,v0 u32 sub_GAME_7F0001F0(void *ani,int aniid,int param_3) { short asStack8 [4]; @@ -46,59 +42,12 @@ u32 sub_GAME_7F0001F0(void *ani,int aniid,int param_3) i = 0; while (aniid < param_3) { uVar1 = sub_GAME_7F06D2E4(0,0,&skeleton_guard,ani,aniid,asStack8); - aniid=1+aniid; i = i + uVar1 & 0xffff; + aniid=1+aniid; + } return i; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0001F0 -/* 034D20 7F0001F0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 034D24 7F0001F4 AFB30028 */ sw $s3, 0x28($sp) -/* 034D28 7F0001F8 AFB20024 */ sw $s2, 0x24($sp) -/* 034D2C 7F0001FC AFB10020 */ sw $s1, 0x20($sp) -/* 034D30 7F000200 AFB0001C */ sw $s0, 0x1c($sp) -/* 034D34 7F000204 00A6082A */ slt $at, $a1, $a2 -/* 034D38 7F000208 00A08025 */ move $s0, $a1 -/* 034D3C 7F00020C 00C09025 */ move $s2, $a2 -/* 034D40 7F000210 00809825 */ move $s3, $a0 -/* 034D44 7F000214 AFBF0034 */ sw $ra, 0x34($sp) -/* 034D48 7F000218 AFB50030 */ sw $s5, 0x30($sp) -/* 034D4C 7F00021C AFB4002C */ sw $s4, 0x2c($sp) -/* 034D50 7F000220 10200011 */ beqz $at, .L7F000268 -/* 034D54 7F000224 00008825 */ move $s1, $zero -/* 034D58 7F000228 3C148004 */ lui $s4, %hi(skeleton_guard) -/* 034D5C 7F00022C 2694D400 */ addiu $s4, %lo(skeleton_guard) # addiu $s4, $s4, -0x2c00 -/* 034D60 7F000230 27B50040 */ addiu $s5, $sp, 0x40 -.L7F000234: -/* 034D64 7F000234 00002025 */ move $a0, $zero -/* 034D68 7F000238 00002825 */ move $a1, $zero -/* 034D6C 7F00023C 02803025 */ move $a2, $s4 -/* 034D70 7F000240 02603825 */ move $a3, $s3 -/* 034D74 7F000244 AFB00010 */ sw $s0, 0x10($sp) -/* 034D78 7F000248 0FC1B4B9 */ jal sub_GAME_7F06D2E4 -/* 034D7C 7F00024C AFB50014 */ sw $s5, 0x14($sp) -/* 034D80 7F000250 02228821 */ addu $s1, $s1, $v0 -/* 034D84 7F000254 26100001 */ addiu $s0, $s0, 1 -/* 034D88 7F000258 322EFFFF */ andi $t6, $s1, 0xffff -/* 034D8C 7F00025C 0212082A */ slt $at, $s0, $s2 -/* 034D90 7F000260 1420FFF4 */ bnez $at, .L7F000234 -/* 034D94 7F000264 01C08825 */ move $s1, $t6 -.L7F000268: -/* 034D98 7F000268 8FBF0034 */ lw $ra, 0x34($sp) -/* 034D9C 7F00026C 02201025 */ move $v0, $s1 -/* 034DA0 7F000270 8FB10020 */ lw $s1, 0x20($sp) -/* 034DA4 7F000274 8FB0001C */ lw $s0, 0x1c($sp) -/* 034DA8 7F000278 8FB20024 */ lw $s2, 0x24($sp) -/* 034DAC 7F00027C 8FB30028 */ lw $s3, 0x28($sp) -/* 034DB0 7F000280 8FB4002C */ lw $s4, 0x2c($sp) -/* 034DB4 7F000284 8FB50030 */ lw $s5, 0x30($sp) -/* 034DB8 7F000288 03E00008 */ jr $ra -/* 034DBC 7F00028C 27BD0048 */ addiu $sp, $sp, 0x48 -) -#endif diff --git a/src/game/initanitable.c b/src/game/initanitable.c index f41fc750..56fb289f 100644 --- a/src/game/initanitable.c +++ b/src/game/initanitable.c @@ -204,7 +204,7 @@ s32 animation_table_ptrs1[] = { 0 }; -s32 animation_table_ptrs2[] = { +struct ModelAnimation *animation_table_ptrs2[] = { PTR_ANIM_helicopter_cradle, PTR_ANIM_plane_runway, PTR_ANIM_helicopter_takeoff, diff --git a/src/game/initanitable.h b/src/game/initanitable.h index 49b55b00..dd8e2b42 100644 --- a/src/game/initanitable.h +++ b/src/game/initanitable.h @@ -25,16 +25,16 @@ extern struct animation_table_data* ptr_animation_table; /** * Contains offsets into ptr_animation_table for player and guard animations. - * The index of each value corresponds to `enum ANIMATIONS`. + * The index of each value corresponds to `enum ANIMATION`. * The value corresponds to (e.g. index=0) PTR_ANIM_idle (same as ANIM_DATA_idle) */ extern s32 animation_table_ptrs1[]; /** * Contains offsets into ptr_animation_table for object/vehicle animations. - * The index of each value corresponds to `enum AIRCRAFT_ANIMATIONS`. + * The index of each value corresponds to `enum AIRCRAFT_ANIMATION`. * The value corresponds to (e.g. index=0) PTR_ANIM_helicopter_cradle (same as ANIM_DATA_helicopter_cradle) */ -extern s32 animation_table_ptrs2[]; +extern struct ModelAnimation * animation_table_ptrs2[]; #endif diff --git a/src/game/initgamedata.c b/src/game/initgamedata.c index 2e7cfdd0..5c911a2c 100644 --- a/src/game/initgamedata.c +++ b/src/game/initgamedata.c @@ -28,8 +28,8 @@ void initGameData(void) { intro_character_index = 0; randomly_selected_intro_animation = 0; intro_animation_count = 0; - objinstance = 0; - ptrobjinstance = 0; + cast_model = 0; + cast_model_weapon = 0; full_actor_intro = 0; } diff --git a/src/game/initguards.c b/src/game/initguards.c index ff381f76..a32cca53 100644 --- a/src/game/initguards.c +++ b/src/game/initguards.c @@ -15,8 +15,8 @@ void init_guards(void) { D_8002CC58 = 0; show_patrols_flag = 0; player1_guardID = 0x1388; - ptr_guard_data = 0; - num_guards = 0; + g_ChrSlots = 0; + g_NumChrSlots = 0; init_obj_register_difficulty_vals(); } @@ -27,18 +27,18 @@ void alloc_init_GUARDdata_entries(s32 count) { s32 i; - num_guards = count + 0xA; + g_NumChrSlots = count + 0xA; - ptr_guard_data = mempAllocBytesInBank(align_addr_zero(num_guards*sizeof(ChrRecord)), 4); - for(i = 0; num_guards > i; i++) + g_ChrSlots = mempAllocBytesInBank(align_addr_zero(g_NumChrSlots*sizeof(ChrRecord)), 4); + for(i = 0; g_NumChrSlots > i; i++) { - ptr_guard_data[i].model = 0; + g_ChrSlots[i].model = 0; } } -void set_new_rand_head_bodies(u32 stagenum) +void bodiesReset(u32 stagenum) { s32 i; diff --git a/src/game/initguards.h b/src/game/initguards.h index 091110f0..93b22460 100644 --- a/src/game/initguards.h +++ b/src/game/initguards.h @@ -3,6 +3,6 @@ #include void init_guards(void); -void set_new_rand_head_bodies(u32 stagenum); +void bodiesReset(u32 stagenum); #endif diff --git a/src/game/initmenus.c b/src/game/initmenus.c index 3ebcf6fd..16af40ef 100644 --- a/src/game/initmenus.c +++ b/src/game/initmenus.c @@ -31,7 +31,7 @@ void init_menus_or_reset(void) menu_update = MENU_FILE_SELECT; } - ptr_logo_and_walletbond_DL = (Gfx *)mempAllocBytesInBank(0x78000, 4); + ptr_logo_and_walletbond_DL = (u8 *)mempAllocBytesInBank(0x78000, 4); #if defined(VERSION_EU) ptr_menu_videobuffer = mempAllocBytesInBank(0x55040, 4); diff --git a/src/game/initobjects.c b/src/game/initobjects.c index 8326419b..454d5874 100644 --- a/src/game/initobjects.c +++ b/src/game/initobjects.c @@ -6,12 +6,12 @@ #include "chrobjhandler.h" //this file may very well be a few different sub files -struct object_animation_controller g_InitialMonitorAnimController = {&monAnim00Bond, 0, 0xFFFF, 0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 1.0, 0.0}; +MonitorRecord g_InitialMonitorAnimController = {&monAnim00Bond, 0, 0xFFFF, 0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 1.0, 0.0}; struct object_animation_controller g_InitialUnknownAnimController = {&monAnim34, 0, 0xFFFF, 0, 0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1.0}; struct object_animation_controller g_InitialTaserAnimController = {&monAnim35Taser, 0, 0xFFFF, 0, 0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1.0}; f32 unused_8002a3bc = 0.0f; -f32 scale_1_0_item_related = 1.0f; +f32 g_DoorScale = 1.0f; // forward declarations @@ -70,23 +70,23 @@ void alloc_lookup_buffers(void) s32 i; ptr_list_object_lookup_indices = (s16*)mempAllocBytesInBank(PTR_LIST_OBJECT_LOOKUP_INDICES_LEN * sizeof(s16), 4); - ptr_room_lookup_buffer_maybe = (s16*)mempAllocBytesInBank((((MaxNumRooms * 4) + 0xF) | 0xF) ^ 0xF, 4); - dword_CODE_bss_8007161C = (s16*)mempAllocBytesInBank(BSS_8007161C_LEN * sizeof(struct unk_8007161c), 4); + RoomPropListChunkIndexes = (s16*)mempAllocBytesInBank((((MaxNumRooms * 4) + 0xF) | 0xF) ^ 0xF, 4); + RoomPropListChunks = (s16*)mempAllocBytesInBank(BSS_8007161C_LEN * sizeof(struct roomproplistchunk), 4); ptr_list_object_lookup_indices[0] = -1; for (i=0; i 0.0f) && (sub_GAME_7F0B18B8(arg4, arg3->pos.f[0], arg3->pos.f[2], arg2, 0x1F, 0.0f, 1.0f) >= 0)) + if ((arg2 > 0.0f) && (stanTestVolume(arg4, arg3->pos.f[0], arg3->pos.f[2], arg2, 0x1F, 0.0f, 1.0f) >= 0)) { return 0; } @@ -242,7 +242,7 @@ void setupUpdateObjectRoomPosition(ObjectRecord *obj) PropRecord *temp_s1; struct coord3d sp40; struct coord3d sp34; - struct modeldata_unk_pos *sp30; + struct ModelRoData_BoundingBoxRecord *sp30; f32 phi_f20; temp_s1 = obj->prop; @@ -263,7 +263,7 @@ void setupUpdateObjectRoomPosition(ObjectRecord *obj) } else { - sp30 = sub_GAME_7F040078(obj); + sp30 = chrobjGetBboxFromObjectRecord(obj); if (sp30 != NULL) { @@ -386,196 +386,53 @@ struct ObjectRecord *setupCommandGetObject(s32 stageID, s32 index) } +ObjectRecord *setupFindObjForReuse(s32 wanttype, ObjectRecord **offscreenobjptr, ObjectRecord **anyobjptr, bool musthaveprop, bool musthavemodel, ModelFileHeader *modeldef) +{ + ObjectRecord *offscreenobj = NULL; + ObjectRecord *anyobj = NULL; + u32 *cmd = g_CurrentSetup.propDefs; -#ifdef NONMATCHING - -PropRecord *setupFindObjForReuse(s32 stageID, PropRecord **arg1, PropRecord **arg2, s32 arg3, s32 arg4, s32 arg5) -{ - PropRecord *temp_s0; - PropRecord *temp_s0_2; - u8 temp_v1; - u8 temp_v1_2; - void * temp_v0; - u8 phi_v1; - PropRecord *phi_s0; - PropRecord *phi_s2; - PropRecord *phi_s3; - PropRecord *phi_s2_2; - PropRecord *phi_s3_2; - PropRecord *phi_s2_3; - PropRecord *phi_s3_3; - - - temp_s0 = g_CurrentSetup.props; - phi_s0 = temp_s0; - phi_s2 = NULL; - phi_s3 = NULL; - phi_s2_2 = NULL; - phi_s3_2 = NULL; - if (temp_s0 != 0) + if (cmd) { - temp_v1 = temp_s0->unk3; - phi_v1 = temp_v1; - if (temp_v1 != 0x30) + while ((u8)cmd[0] != PROPDEF_END) { -loop_3: - phi_s2_3 = phi_s2; - phi_s3_3 = phi_s3; - phi_s2_3 = phi_s2; - if ((stageID & 0xFF) == phi_v1) + if ((wanttype & 0xff) == (u8)cmd[0]) { - temp_v0 = phi_s0->pos.AsArray[2]; - if (temp_v0 == 0) + ObjectRecord *obj = (ObjectRecord *)cmd; + + if (obj->prop == NULL) { - if ((arg3 == 0) && (arg4 == 0)) + if (!musthaveprop && !musthavemodel) { - return phi_s0; + return obj; } - goto block_19; } - if ((stageID != 8) && ((phi_s0->unk64 & 0x80) == 0) && ((phi_s0->unk2 & 4) == 0) && (temp_v0->unk1C == 0) && ((arg4 == 0) || (modelmgrCanSlotFitRwdata(phi_s0->stan, arg5) != 0))) + else if (wanttype != PROP_TYPE_SMOKE + && (obj->runtime_bitflags & RUNTIMEBITFLAG_DEPOSIT) == 0 + && (obj->state & PROPSTATE_RESPAWN) == 0 + && obj->prop->parent == NULL + && (!musthavemodel || modelmgrCanSlotFitRwdata(obj->model, modeldef))) { - if ((phi_s2 == 0) && ((phi_s0->pos.AsArray[2]->unk1 & 2) == 0)) + if (offscreenobj == NULL && (obj->prop->flags & PROPFLAG_ONSCREEN) == 0) { - phi_s2_3 = phi_s0; + offscreenobj = obj; } - if (phi_s3 == 0) + + if (anyobj == NULL) { - phi_s3_3 = phi_s0; + anyobj = obj; } } - goto block_19; - } -block_19: - temp_s0_2 = (sizepropdef(phi_s0) * 4) + phi_s0; - temp_v1_2 = temp_s0_2->unk3; - phi_v1 = temp_v1_2; - phi_s0 = temp_s0_2; - phi_s2 = phi_s2_3; - phi_s3 = phi_s3_3; - phi_s2_2 = phi_s2_3; - phi_s3_2 = phi_s3_3; - if (temp_v1_2 == 0x30) - { - goto block_20; } - goto loop_3; + + cmd = cmd + sizepropdef(cmd); } } -block_20: - *arg1 = phi_s2_2; - *arg2 = phi_s3_2; - return NULL; -} - - -#else -GLOBAL_ASM( -.text -glabel setupFindObjForReuse -/* 08BA38 7F056F08 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 08BA3C 7F056F0C AFB00018 */ sw $s0, 0x18($sp) -/* 08BA40 7F056F10 3C108007 */ lui $s0, %hi(g_CurrentSetup+0x0c) -/* 08BA44 7F056F14 8E105D0C */ lw $s0, %lo(g_CurrentSetup+0x0c)($s0) -/* 08BA48 7F056F18 AFBE0038 */ sw $fp, 0x38($sp) -/* 08BA4C 7F056F1C AFB70034 */ sw $s7, 0x34($sp) -/* 08BA50 7F056F20 AFB30024 */ sw $s3, 0x24($sp) -/* 08BA54 7F056F24 AFB20020 */ sw $s2, 0x20($sp) -/* 08BA58 7F056F28 0080B825 */ move $s7, $a0 -/* 08BA5C 7F056F2C 00E0F025 */ move $fp, $a3 -/* 08BA60 7F056F30 AFBF003C */ sw $ra, 0x3c($sp) -/* 08BA64 7F056F34 AFB60030 */ sw $s6, 0x30($sp) -/* 08BA68 7F056F38 AFB5002C */ sw $s5, 0x2c($sp) -/* 08BA6C 7F056F3C AFB40028 */ sw $s4, 0x28($sp) -/* 08BA70 7F056F40 AFB1001C */ sw $s1, 0x1c($sp) -/* 08BA74 7F056F44 AFA50044 */ sw $a1, 0x44($sp) -/* 08BA78 7F056F48 AFA60048 */ sw $a2, 0x48($sp) -/* 08BA7C 7F056F4C 00009025 */ move $s2, $zero -/* 08BA80 7F056F50 12000039 */ beqz $s0, .L7F057038 -/* 08BA84 7F056F54 00009825 */ move $s3, $zero -/* 08BA88 7F056F58 92030003 */ lbu $v1, 3($s0) -/* 08BA8C 7F056F5C 24010030 */ li $at, 48 -/* 08BA90 7F056F60 309400FF */ andi $s4, $a0, 0xff -/* 08BA94 7F056F64 10610034 */ beq $v1, $at, .L7F057038 -/* 08BA98 7F056F68 24160008 */ li $s6, 8 -/* 08BA9C 7F056F6C 8FB50054 */ lw $s5, 0x54($sp) -/* 08BAA0 7F056F70 8FB10050 */ lw $s1, 0x50($sp) -.L7F056F74: -/* 08BAA4 7F056F74 16830028 */ bne $s4, $v1, .L7F057018 -/* 08BAA8 7F056F78 00000000 */ nop -/* 08BAAC 7F056F7C 8E020010 */ lw $v0, 0x10($s0) -/* 08BAB0 7F056F80 14400007 */ bnez $v0, .L7F056FA0 -/* 08BAB4 7F056F84 00000000 */ nop -/* 08BAB8 7F056F88 17C00023 */ bnez $fp, .L7F057018 -/* 08BABC 7F056F8C 00000000 */ nop -/* 08BAC0 7F056F90 16200021 */ bnez $s1, .L7F057018 -/* 08BAC4 7F056F94 00000000 */ nop -/* 08BAC8 7F056F98 1000002C */ b .L7F05704C -/* 08BACC 7F056F9C 02001025 */ move $v0, $s0 -.L7F056FA0: -/* 08BAD0 7F056FA0 12F6001D */ beq $s7, $s6, .L7F057018 -/* 08BAD4 7F056FA4 00000000 */ nop -/* 08BAD8 7F056FA8 8E0E0064 */ lw $t6, 0x64($s0) -/* 08BADC 7F056FAC 31CF0080 */ andi $t7, $t6, 0x80 -/* 08BAE0 7F056FB0 15E00019 */ bnez $t7, .L7F057018 -/* 08BAE4 7F056FB4 00000000 */ nop -/* 08BAE8 7F056FB8 92180002 */ lbu $t8, 2($s0) -/* 08BAEC 7F056FBC 33190004 */ andi $t9, $t8, 4 -/* 08BAF0 7F056FC0 17200015 */ bnez $t9, .L7F057018 -/* 08BAF4 7F056FC4 00000000 */ nop -/* 08BAF8 7F056FC8 8C48001C */ lw $t0, 0x1c($v0) -/* 08BAFC 7F056FCC 15000012 */ bnez $t0, .L7F057018 -/* 08BB00 7F056FD0 00000000 */ nop -/* 08BB04 7F056FD4 12200005 */ beqz $s1, .L7F056FEC -/* 08BB08 7F056FD8 02A02825 */ move $a1, $s5 -/* 08BB0C 7F056FDC 0FC1B018 */ jal modelmgrCanSlotFitRwdata -/* 08BB10 7F056FE0 8E040014 */ lw $a0, 0x14($s0) -/* 08BB14 7F056FE4 1040000C */ beqz $v0, .L7F057018 -/* 08BB18 7F056FE8 00000000 */ nop -.L7F056FEC: -/* 08BB1C 7F056FEC 16400007 */ bnez $s2, .L7F05700C -/* 08BB20 7F056FF0 00000000 */ nop -/* 08BB24 7F056FF4 8E090010 */ lw $t1, 0x10($s0) -/* 08BB28 7F056FF8 912A0001 */ lbu $t2, 1($t1) -/* 08BB2C 7F056FFC 314B0002 */ andi $t3, $t2, 2 -/* 08BB30 7F057000 15600002 */ bnez $t3, .L7F05700C -/* 08BB34 7F057004 00000000 */ nop -/* 08BB38 7F057008 02009025 */ move $s2, $s0 -.L7F05700C: -/* 08BB3C 7F05700C 16600002 */ bnez $s3, .L7F057018 -/* 08BB40 7F057010 00000000 */ nop -/* 08BB44 7F057014 02009825 */ move $s3, $s0 -.L7F057018: -/* 08BB48 7F057018 0FC15A3D */ jal sizepropdef -/* 08BB4C 7F05701C 02002025 */ move $a0, $s0 -/* 08BB50 7F057020 00026080 */ sll $t4, $v0, 2 -/* 08BB54 7F057024 01908021 */ addu $s0, $t4, $s0 -/* 08BB58 7F057028 92030003 */ lbu $v1, 3($s0) -/* 08BB5C 7F05702C 24010030 */ li $at, 48 -/* 08BB60 7F057030 1461FFD0 */ bne $v1, $at, .L7F056F74 -/* 08BB64 7F057034 00000000 */ nop -.L7F057038: -/* 08BB68 7F057038 8FAD0044 */ lw $t5, 0x44($sp) -/* 08BB6C 7F05703C 00001025 */ move $v0, $zero -/* 08BB70 7F057040 ADB20000 */ sw $s2, ($t5) -/* 08BB74 7F057044 8FAE0048 */ lw $t6, 0x48($sp) -/* 08BB78 7F057048 ADD30000 */ sw $s3, ($t6) -.L7F05704C: -/* 08BB7C 7F05704C 8FBF003C */ lw $ra, 0x3c($sp) -/* 08BB80 7F057050 8FB00018 */ lw $s0, 0x18($sp) -/* 08BB84 7F057054 8FB1001C */ lw $s1, 0x1c($sp) -/* 08BB88 7F057058 8FB20020 */ lw $s2, 0x20($sp) -/* 08BB8C 7F05705C 8FB30024 */ lw $s3, 0x24($sp) -/* 08BB90 7F057060 8FB40028 */ lw $s4, 0x28($sp) -/* 08BB94 7F057064 8FB5002C */ lw $s5, 0x2c($sp) -/* 08BB98 7F057068 8FB60030 */ lw $s6, 0x30($sp) -/* 08BB9C 7F05706C 8FB70034 */ lw $s7, 0x34($sp) -/* 08BBA0 7F057070 8FBE0038 */ lw $fp, 0x38($sp) -/* 08BBA4 7F057074 03E00008 */ jr $ra -/* 08BBA8 7F057078 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif + *offscreenobjptr = offscreenobj; + *anyobjptr = anyobj; + return NULL; +} diff --git a/src/game/lvl.c b/src/game/lvl.c index ebb0c07e..53c4c48c 100644 --- a/src/game/lvl.c +++ b/src/game/lvl.c @@ -34,7 +34,6 @@ #include "initmenus.h" #include "cheat_buttons.h" #include "bg.h" -#include "watch.h" #include "objective.h" #include "mp_watch.h" #include "unk_09B7A0.h" @@ -75,7 +74,7 @@ char ramrom_data_target[0x380]; //CODE.bss:8008C5F0 s32 record_slot_num; //CODE.bss:8008C5F4 -s32 address_demo_loaded; +u8 * address_demo_loaded; //CODE.bss:8008C5F8 s32 dword_CODE_bss_8008C5F8; @@ -192,37 +191,13 @@ struct LvlMpUnknown *D_800483C8 = NULL; * Debug variable, something to do with portals. * Address 0x800483CC. */ -u32 g_DebugPortalsD_800483CC = 0; +s32 g_DebugPortalsD_800483CC = 0; /** * Input buffer, used in debug portal method. Might be array. * Address 0x800483D0. */ -s32 g_DebugPortalsInputBuffer_0 = 0; - -/** - * Input buffer, used in debug portal method. Might be array. - * Address 0x800483D4. - */ -s32 g_DebugPortalsInputBuffer_1 = 0; - -/** - * Input buffer, used in debug portal method. Might be array. - * Address 0x800483D8. - */ -s32 g_DebugPortalsInputBuffer_2 = 0; - -/** - * Input buffer, used in debug portal method. Might be array. - * Address 0x800483DC. - */ -s32 g_DebugPortalsInputBuffer_3 = 0; - -/** - * Input buffer, used in debug portal method. Might be array. - * Address 0x800483E0. - */ -s32 g_DebugPortalsInputBuffer_4 = 0; +s32 g_DebugPortalsInputBuffer[5] = { 0 }; /** * Something debug related in the MP manage method. @@ -255,7 +230,7 @@ void sub_GAME_7F0BD8FC(s32 arg0) D_800483C0 = arg0; } -void lvInitDebugNoticeList(void) +void lvInit(void) { s32 size; @@ -313,25 +288,16 @@ void lvlMusicPlayStageTrackOrRandom(void) lvlPlayMusicTrack1(getmusictrack_or_randomtrack(g_CurrentStageToLoad)); } - - -#ifdef NONMATCHING /** * Stage load method. * Title screen is handled as a special case. * First half of method resets stage and player values (including mutliplayer values) to defaults. * Second part loads stage data (init guards, init guard heads, etc). * - * Address: 0x7F0BDAB0. - * - * decomp status: - * - compiles: yes - * - stack resize: ok - * - identical instructions: yes - * - identical registers: fail - * - * notes: only regalloc issues. Problem seems to be around the do{}while / for loop on g_playerPlayerData. - */ + * NTSC Address: 0x7F0BDAB0. + * NTSC-J Address: 7F0BE660. + * PAL Address: 7F0BCE60. + **/ void lvlStageLoad(s32 stage) { s32 i; @@ -355,16 +321,19 @@ void lvlStageLoad(s32 stage) #ifdef VERSION_US g_GlobalTimerDelta = 1.0f; #endif -#ifdef VERSION_JP +#if defined(VERSION_JP) || defined(VERSION_EU) g_JP_GlobalTimerDelta = 1.0f; #endif D_80048380 = 0; g_GlobalTimer = 0; -#ifdef VERSION_JP +#if defined(VERSION_JP) g_GlobalTimerDelta = 1.f; #endif +#if defined(VERSION_EU) + g_GlobalTimerDelta = 1.20000004768f; +#endif D_80048388 = 0; D_8004838C = 0; @@ -382,7 +351,11 @@ void lvlStageLoad(s32 stage) sub_GAME_7F0C1364(); set_contents_of_80036078(1); set_mt_tex_alloc(); +#ifdef VERSION_EU + sub_GAME_7F0A45D8(); +#else sub_GAME_7F0A47D4(); +#endif texReset(); load_font_tables(); @@ -419,16 +392,18 @@ void lvlStageLoad(s32 stage) load_bg_file(g_CurrentStageToLoad); skySetStageNum(g_CurrentStageToLoad); + + // HACK: This method call is wrong. The function takes one argument, but the asm calls it without + // any arguments here. init_watch_at_start_of_stage(); - sub_GAME_7F0C11FC(stage); - // why oh why are there two pointers for the same data. - // g_playerPlayerData should be s2 - // then copied into s4 - player_data = (struct player_data *)&g_playerPlayerData; + sub_GAME_7F0C11FC(stage); - for (i=0; i<4; i++, player_data++) + for (i=0; i<4; i++) { + s32 s3; + player_data = (struct player_data *)&g_playerPlayerData[i]; + if (getPlayerCount() == 1) { // s4 variable @@ -439,7 +414,6 @@ void lvlStageLoad(s32 stage) } else { - s32 s3; // why is this looping from g_playerPlayerData again, this inner block // gets executed 16 times in multiplayer. @@ -465,22 +439,22 @@ void lvlStageLoad(s32 stage) // g_playerPlayerData s4 variable player_data->time_other_players_on_screen = 0; player_data->damage_to_backside = 0; - player_data->min_time_between_kills = 0x7FFFFFFF; + player_data->min_time_between_kills = S32_MAX; player_data->max_time_between_kills = 0; player_data->most_killed_one_life = 0; player_data->most_killed_one_time = 0; player_data->longest_inning = 0; - player_data->shortest_inning = 0x7FFFFFFF; + player_data->shortest_inning = S32_MAX; player_data->order_out_in_yolt = 0; player_data->flag_counter = 0; player_data->distance_traveled = 0.0f; // one kind of float zero player_data->body_armor_pickups = 0.f; // a different kind of float zero // g_playerPlayerData s2, different than above - g_playerPlayerData[i].killed_p4 = 0; - g_playerPlayerData[i].killed_p3 = 0; - g_playerPlayerData[i].killed_p2 = 0; - g_playerPlayerData[i].killed_p1 = 0; + for (s3 = 0; s3 < 4; s3++) + { + player_data->kill_counts[s3] = 0; + } } } @@ -493,7 +467,7 @@ void lvlStageLoad(s32 stage) reinit_between_menus(); init_sound_effects_registers(); init_guards(); - set_new_rand_head_bodies(stage); + bodiesReset(stage); proplvreset2(stage); alloc_explosion_smoke_casing_scorch_impact_buffers(); alloc_shattered_window_pieces(); @@ -532,935 +506,6 @@ void lvlStageLoad(s32 stage) D_80048368 = 1.0f; lvlSetControlsLockedFlag(0); } -#endif -#ifdef VERSION_US -GLOBAL_ASM( -.text -glabel lvlStageLoad -/* 0F25E0 7F0BDAB0 3C018005 */ lui $at, %hi(g_CurrentStageToLoad) -/* 0F25E4 7F0BDAB4 AC248364 */ sw $a0, %lo(g_CurrentStageToLoad)($at) -/* 0F25E8 7F0BDAB8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F25EC 7F0BDABC 44816000 */ mtc1 $at, $f12 -/* 0F25F0 7F0BDAC0 24020001 */ li $v0, 1 -/* 0F25F4 7F0BDAC4 3C018005 */ lui $at, %hi(D_800483C0) -/* 0F25F8 7F0BDAC8 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0F25FC 7F0BDACC AC2283C0 */ sw $v0, %lo(D_800483C0)($at) -/* 0F2600 7F0BDAD0 AFB10024 */ sw $s1, 0x24($sp) -/* 0F2604 7F0BDAD4 3C018005 */ lui $at, %hi(g_ControlsLockedFlag) -/* 0F2608 7F0BDAD8 3C118005 */ lui $s1, %hi(g_ClockTimer) -/* 0F260C 7F0BDADC AC208370 */ sw $zero, %lo(g_ControlsLockedFlag)($at) -/* 0F2610 7F0BDAE0 26318374 */ addiu $s1, %lo(g_ClockTimer) # addiu $s1, $s1, -0x7c8c -/* 0F2614 7F0BDAE4 AE220000 */ sw $v0, ($s1) -/* 0F2618 7F0BDAE8 3C018005 */ lui $at, %hi(g_GlobalTimerDelta) -/* 0F261C 7F0BDAEC E42C8378 */ swc1 $f12, %lo(g_GlobalTimerDelta)($at) -/* 0F2620 7F0BDAF0 3C018005 */ lui $at, %hi(D_80048380) -/* 0F2624 7F0BDAF4 AC208380 */ sw $zero, %lo(D_80048380)($at) -/* 0F2628 7F0BDAF8 3C018005 */ lui $at, %hi(g_GlobalTimer) -/* 0F262C 7F0BDAFC AC20837C */ sw $zero, %lo(g_GlobalTimer)($at) - -/* 0F2630 7F0BDB00 3C018005 */ lui $at, %hi(D_80048388) -/* 0F2634 7F0BDB04 AC208388 */ sw $zero, %lo(D_80048388)($at) -/* 0F2638 7F0BDB08 3C018005 */ lui $at, %hi(D_8004838C) -/* 0F263C 7F0BDB0C AC20838C */ sw $zero, %lo(D_8004838C)($at) -/* 0F2640 7F0BDB10 AFB00020 */ sw $s0, 0x20($sp) -/* 0F2644 7F0BDB14 3C018005 */ lui $at, %hi(D_80048390) -/* 0F2648 7F0BDB18 44800000 */ mtc1 $zero, $f0 -/* 0F264C 7F0BDB1C 3C108005 */ lui $s0, %hi(D_80048394) -/* 0F2650 7F0BDB20 AC208390 */ sw $zero, %lo(D_80048390)($at) -/* 0F2654 7F0BDB24 26108394 */ addiu $s0, %lo(D_80048394) # addiu $s0, $s0, -0x7c6c - -/* 0F2658 7F0BDB28 AE000000 */ sw $zero, ($s0) -/* 0F265C 7F0BDB2C 3C018005 */ lui $at, %hi(g_CurrentMultiPlayerSec) -/* 0F2660 7F0BDB30 E42083A4 */ swc1 $f0, %lo(g_CurrentMultiPlayerSec)($at) -/* 0F2664 7F0BDB34 3C018005 */ lui $at, %hi(D_800483B0) -/* 0F2668 7F0BDB38 AC2083B0 */ sw $zero, %lo(D_800483B0)($at) -/* 0F266C 7F0BDB3C 3C018005 */ lui $at, %hi(g_StageTimeSec) -/* 0F2670 7F0BDB40 E42083B4 */ swc1 $f0, %lo(g_StageTimeSec)($at) -/* 0F2674 7F0BDB44 AFBF0034 */ sw $ra, 0x34($sp) -/* 0F2678 7F0BDB48 3C018005 */ lui $at, %hi(g_MpSoundStateRelated) -/* 0F267C 7F0BDB4C AFB40030 */ sw $s4, 0x30($sp) -/* 0F2680 7F0BDB50 AFB3002C */ sw $s3, 0x2c($sp) -/* 0F2684 7F0BDB54 AFB20028 */ sw $s2, 0x28($sp) -/* 0F2688 7F0BDB58 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0F268C 7F0BDB5C AFA40038 */ sw $a0, 0x38($sp) -/* 0F2690 7F0BDB60 0C00248E */ jal sndSetScalerApplyVolumeAllSfxSlot -/* 0F2694 7F0BDB64 AC2083A0 */ sw $zero, %lo(g_MpSoundStateRelated)($at) -/* 0F2698 7F0BDB68 0C001C0F */ jal musicTrack1ApplySeqpVol -/* 0F269C 7F0BDB6C 24047FFF */ li $a0, 32767 -/* 0F26A0 7F0BDB70 0C001CF1 */ jal musicTrack2ApplySeqpVol -/* 0F26A4 7F0BDB74 24047FFF */ li $a0, 32767 -/* 0F26A8 7F0BDB78 0C001DD3 */ jal musicTrack3ApplySeqpVol -/* 0F26AC 7F0BDB7C 24047FFF */ li $a0, 32767 -/* 0F26B0 7F0BDB80 0FC304D9 */ jal sub_GAME_7F0C1364 -/* 0F26B4 7F0BDB84 00000000 */ nop -/* 0F26B8 7F0BDB88 0FC0154D */ jal set_contents_of_80036078 -/* 0F26BC 7F0BDB8C 24040001 */ li $a0, 1 -/* 0F26C0 7F0BDB90 0FC01CC8 */ jal set_mt_tex_alloc -/* 0F26C4 7F0BDB94 00000000 */ nop -/* 0F26C8 7F0BDB98 0FC291F5 */ jal sub_GAME_7F0A47D4 -/* 0F26CC 7F0BDB9C 00000000 */ nop -/* 0F26D0 7F0BDBA0 0FC32FEC */ jal texReset -/* 0F26D4 7F0BDBA4 00000000 */ nop -/* 0F26D8 7F0BDBA8 0FC2B2EB */ jal load_font_tables -/* 0F26DC 7F0BDBAC 00000000 */ nop -/* 0F26E0 7F0BDBB0 8FAF0038 */ lw $t7, 0x38($sp) -/* 0F26E4 7F0BDBB4 2401005A */ li $at, 90 -/* 0F26E8 7F0BDBB8 15E10005 */ bne $t7, $at, .L7F0BDBD0 -/* 0F26EC 7F0BDBBC 00000000 */ nop -/* 0F26F0 7F0BDBC0 0FC00348 */ jal init_menus_or_reset -/* 0F26F4 7F0BDBC4 00000000 */ nop -/* 0F26F8 7F0BDBC8 10000073 */ b .L7F0BDD98 -/* 0F26FC 7F0BDBCC 00000000 */ nop -.L7F0BDBD0: -/* 0F2700 7F0BDBD0 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) -/* 0F2704 7F0BDBD4 8C848364 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0F2708 7F0BDBD8 3C018007 */ lui $at, %hi(g_NewCheatUnlocked) # -0.000000 -/* 0F270C 7F0BDBDC AC209790 */ sw $zero, %lo(g_NewCheatUnlocked)($at) -/* 0F2710 7F0BDBE0 2401005A */ li $at, 90 -/* 0F2714 7F0BDBE4 1081001C */ beq $a0, $at, .L7F0BDC58 -/* 0F2718 7F0BDBE8 00000000 */ nop -/* 0F271C 7F0BDBEC 8E180000 */ lw $t8, ($s0) -/* 0F2720 7F0BDBF0 17000019 */ bnez $t8, .L7F0BDC58 -/* 0F2724 7F0BDBF4 00000000 */ nop -/* 0F2728 7F0BDBF8 8E390000 */ lw $t9, ($s1) -/* 0F272C 7F0BDBFC 3C088003 */ lui $t0, %hi(g_AppendCheatSinglePlayer) -/* 0F2730 7F0BDC00 1B200015 */ blez $t9, .L7F0BDC58 -/* 0F2734 7F0BDC04 00000000 */ nop -/* 0F2738 7F0BDC08 8D08A900 */ lw $t0, %lo(g_AppendCheatSinglePlayer)($t0) -/* 0F273C 7F0BDC0C 3C118007 */ lui $s1, %hi(g_CheatActivated + 1) -/* 0F2740 7F0BDC10 263196A1 */ addiu $s1, %lo(g_CheatActivated + 1) # addiu $s1, $s1, -0x695f -/* 0F2744 7F0BDC14 11000010 */ beqz $t0, .L7F0BDC58 -/* 0F2748 7F0BDC18 24100001 */ li $s0, 1 -/* 0F274C 7F0BDC1C 2412004B */ li $s2, 75 -.L7F0BDC20: -/* 0F2750 7F0BDC20 92290000 */ lbu $t1, ($s1) -/* 0F2754 7F0BDC24 51200008 */ beql $t1, $zero, .L7F0BDC48 -/* 0F2758 7F0BDC28 26100001 */ addiu $s0, $s0, 1 -/* 0F275C 7F0BDC2C 0FC24697 */ jal cheatIsEnemyRockets -/* 0F2760 7F0BDC30 02002025 */ move $a0, $s0 -/* 0F2764 7F0BDC34 50400004 */ beql $v0, $zero, .L7F0BDC48 -/* 0F2768 7F0BDC38 26100001 */ addiu $s0, $s0, 1 -/* 0F276C 7F0BDC3C 0FC246AB */ jal cheatButtonTurnOnCheatForPlayers -/* 0F2770 7F0BDC40 02002025 */ move $a0, $s0 -/* 0F2774 7F0BDC44 26100001 */ addiu $s0, $s0, 1 -.L7F0BDC48: -/* 0F2778 7F0BDC48 1612FFF5 */ bne $s0, $s2, .L7F0BDC20 -/* 0F277C 7F0BDC4C 26310001 */ addiu $s1, $s1, 1 -/* 0F2780 7F0BDC50 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) -/* 0F2784 7F0BDC54 8C848364 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -.L7F0BDC58: -/* 0F2788 7F0BDC58 0FC2D049 */ jal load_bg_file -/* 0F278C 7F0BDC5C 00000000 */ nop -/* 0F2790 7F0BDC60 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) -/* 0F2794 7F0BDC64 0FC2510B */ jal skySetStageNum -/* 0F2798 7F0BDC68 8C848364 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0F279C 7F0BDC6C 0FC2921A */ jal init_watch_at_start_of_stage -/* 0F27A0 7F0BDC70 00000000 */ nop -/* 0F27A4 7F0BDC74 0FC3047F */ jal sub_GAME_7F0C11FC -/* 0F27A8 7F0BDC78 8FA40038 */ lw $a0, 0x38($sp) -/* 0F27AC 7F0BDC7C 3C0A8008 */ lui $t2, %hi(g_playerPlayerData) -/* 0F27B0 7F0BDC80 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0F27B4 7F0BDC84 25529EF0 */ addiu $s2, $t2, %lo(g_playerPlayerData) -/* 0F27B8 7F0BDC88 4481A000 */ mtc1 $at, $f20 -/* 0F27BC 7F0BDC8C 0240A025 */ move $s4, $s2 -/* 0F27C0 7F0BDC90 24130004 */ li $s3, 4 -.L7F0BDC94: -/* 0F27C4 7F0BDC94 0FC26919 */ jal getPlayerCount -/* 0F27C8 7F0BDC98 00000000 */ nop -/* 0F27CC 7F0BDC9C 24010001 */ li $at, 1 -/* 0F27D0 7F0BDCA0 14410009 */ bne $v0, $at, .L7F0BDCC8 -/* 0F27D4 7F0BDCA4 00008025 */ move $s0, $zero -/* 0F27D8 7F0BDCA8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F27DC 7F0BDCAC 44812000 */ mtc1 $at, $f4 -/* 0F27E0 7F0BDCB0 44813000 */ mtc1 $at, $f6 -/* 0F27E4 7F0BDCB4 A280006A */ sb $zero, 0x6a($s4) -/* 0F27E8 7F0BDCB8 A280006B */ sb $zero, 0x6b($s4) -/* 0F27EC 7F0BDCBC E684005C */ swc1 $f4, 0x5c($s4) -/* 0F27F0 7F0BDCC0 1000001C */ b .L7F0BDD34 -/* 0F27F4 7F0BDCC4 E6860064 */ swc1 $f6, 0x64($s4) -.L7F0BDCC8: -/* 0F27F8 7F0BDCC8 3C118008 */ lui $s1, %hi(g_playerPlayerData) -/* 0F27FC 7F0BDCCC 26319EF0 */ addiu $s1, %lo(g_playerPlayerData) # addiu $s1, $s1, -0x6110 -.L7F0BDCD0: -/* 0F2800 7F0BDCD0 0FC051D6 */ jal get_scenario -/* 0F2804 7F0BDCD4 00000000 */ nop -/* 0F2808 7F0BDCD8 14530003 */ bne $v0, $s3, .L7F0BDCE8 -/* 0F280C 7F0BDCDC 00000000 */ nop -/* 0F2810 7F0BDCE0 10000004 */ b .L7F0BDCF4 -/* 0F2814 7F0BDCE4 E634005C */ swc1 $f20, 0x5c($s1) -.L7F0BDCE8: -/* 0F2818 7F0BDCE8 0FC040EB */ jal get_player_mp_handicap -/* 0F281C 7F0BDCEC 02002025 */ move $a0, $s0 -/* 0F2820 7F0BDCF0 E620005C */ swc1 $f0, 0x5c($s1) -.L7F0BDCF4: -/* 0F2824 7F0BDCF4 0FC040F4 */ jal get_player_mp_char_height -/* 0F2828 7F0BDCF8 02002025 */ move $a0, $s0 -/* 0F282C 7F0BDCFC 26100001 */ addiu $s0, $s0, 1 -/* 0F2830 7F0BDD00 26310070 */ addiu $s1, $s1, 0x70 -/* 0F2834 7F0BDD04 1613FFF2 */ bne $s0, $s3, .L7F0BDCD0 -/* 0F2838 7F0BDD08 E620FFF4 */ swc1 $f0, -0xc($s1) -/* 0F283C 7F0BDD0C 0FC04108 */ jal get_mp_timelimit -/* 0F2840 7F0BDD10 00000000 */ nop -/* 0F2844 7F0BDD14 0FC2FF0A */ jal lvlSetMpTime -/* 0F2848 7F0BDD18 00402025 */ move $a0, $v0 -/* 0F284C 7F0BDD1C 0FC04111 */ jal get_mp_pointlimit -/* 0F2850 7F0BDD20 00000000 */ nop -/* 0F2854 7F0BDD24 0FC2FF0D */ jal lvlSetMpPoint -/* 0F2858 7F0BDD28 00402025 */ move $a0, $v0 -/* 0F285C 7F0BDD2C 0FC04076 */ jal copy_aim_settings_to_playerdata -/* 0F2860 7F0BDD30 00000000 */ nop -.L7F0BDD34: -/* 0F2864 7F0BDD34 44804000 */ mtc1 $zero, $f8 -/* 0F2868 7F0BDD38 44805000 */ mtc1 $zero, $f10 -/* 0F286C 7F0BDD3C 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16) # lui $v0, 0x7fff -/* 0F2870 7F0BDD40 3442FFFF */ ori $v0, (0x7FFFFFFF & 0xFFFF) # ori $v0, $v0, 0xffff -/* 0F2874 7F0BDD44 AE800034 */ sw $zero, 0x34($s4) -/* 0F2878 7F0BDD48 AE80003C */ sw $zero, 0x3c($s4) -/* 0F287C 7F0BDD4C AE820044 */ sw $v0, 0x44($s4) -/* 0F2880 7F0BDD50 AE800048 */ sw $zero, 0x48($s4) -/* 0F2884 7F0BDD54 AE800054 */ sw $zero, 0x54($s4) -/* 0F2888 7F0BDD58 AE800058 */ sw $zero, 0x58($s4) -/* 0F288C 7F0BDD5C AE80004C */ sw $zero, 0x4c($s4) -/* 0F2890 7F0BDD60 AE820050 */ sw $v0, 0x50($s4) -/* 0F2894 7F0BDD64 A2800068 */ sb $zero, 0x68($s4) -/* 0F2898 7F0BDD68 AE800060 */ sw $zero, 0x60($s4) -/* 0F289C 7F0BDD6C E6880038 */ swc1 $f8, 0x38($s4) -/* 0F28A0 7F0BDD70 E68A0040 */ swc1 $f10, 0x40($s4) -/* 0F28A4 7F0BDD74 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) -/* 0F28A8 7F0BDD78 256BA0B0 */ addiu $t3, %lo(g_CurrentPlayer) # addiu $t3, $t3, -0x5f50 -/* 0F28AC 7F0BDD7C 26520070 */ addiu $s2, $s2, 0x70 -/* 0F28B0 7F0BDD80 26940070 */ addiu $s4, $s4, 0x70 -/* 0F28B4 7F0BDD84 AE40FFC0 */ sw $zero, -0x40($s2) -/* 0F28B8 7F0BDD88 AE40FFBC */ sw $zero, -0x44($s2) -/* 0F28BC 7F0BDD8C AE40FFB8 */ sw $zero, -0x48($s2) -/* 0F28C0 7F0BDD90 164BFFC0 */ bne $s2, $t3, .L7F0BDC94 -/* 0F28C4 7F0BDD94 AE40FFB4 */ sw $zero, -0x4c($s2) -.L7F0BDD98: -/* 0F28C8 7F0BDD98 0FC013B0 */ jal something_with_stage_objectives -/* 0F28CC 7F0BDD9C 00000000 */ nop -/* 0F28D0 7F0BDDA0 0FC30802 */ jal mpwatchUnpauseGame -/* 0F28D4 7F0BDDA4 00000000 */ nop -/* 0F28D8 7F0BDDA8 0FC26E08 */ jal sub_GAME_7F09B820 -/* 0F28DC 7F0BDDAC 00000000 */ nop -/* 0F28E0 7F0BDDB0 0FC01514 */ jal sub_GAME_7F005450 -/* 0F28E4 7F0BDDB4 00000000 */ nop -/* 0F28E8 7F0BDDB8 0FC01548 */ jal zero_contents_of_80036070_74 -/* 0F28EC 7F0BDDBC 00000000 */ nop -/* 0F28F0 7F0BDDC0 0FC00538 */ jal init_load_objpos_table -/* 0F28F4 7F0BDDC4 00000000 */ nop -/* 0F28F8 7F0BDDC8 0FC005D4 */ jal reinit_between_menus -/* 0F28FC 7F0BDDCC 00000000 */ nop -/* 0F2900 7F0BDDD0 0FC0052C */ jal init_sound_effects_registers -/* 0F2904 7F0BDDD4 00000000 */ nop -/* 0F2908 7F0BDDD8 0FC00390 */ jal init_guards -/* 0F290C 7F0BDDDC 00000000 */ nop -/* 0F2910 7F0BDDE0 0FC003D4 */ jal set_new_rand_head_bodies -/* 0F2914 7F0BDDE4 8FA40038 */ lw $a0, 0x38($sp) -/* 0F2918 7F0BDDE8 0FC00EFC */ jal proplvreset2 -/* 0F291C 7F0BDDEC 8FA40038 */ lw $a0, 0x38($sp) -/* 0F2920 7F0BDDF0 0FC01B64 */ jal alloc_explosion_smoke_casing_scorch_impact_buffers -/* 0F2924 7F0BDDF4 00000000 */ nop -/* 0F2928 7F0BDDF8 0FC01C60 */ jal alloc_shattered_window_pieces -/* 0F292C 7F0BDDFC 00000000 */ nop -/* 0F2930 7F0BDE00 0FC01CA4 */ jal sub_GAME_7F007290 -/* 0F2934 7F0BDE04 00000000 */ nop -/* 0F2938 7F0BDE08 0FC01CAC */ jal initCheatTextBuffer -/* 0F293C 7F0BDE0C 00000000 */ nop -/* 0F2940 7F0BDE10 3C0C8005 */ lui $t4, %hi(g_CurrentStageToLoad) -/* 0F2944 7F0BDE14 8D8C8364 */ lw $t4, %lo(g_CurrentStageToLoad)($t4) -/* 0F2948 7F0BDE18 2401005A */ li $at, 90 -/* 0F294C 7F0BDE1C 15810005 */ bne $t4, $at, .L7F0BDE34 -/* 0F2950 7F0BDE20 00000000 */ nop -/* 0F2954 7F0BDE24 0FC01CBE */ jal disableOnscreenCheatText -/* 0F2958 7F0BDE28 00000000 */ nop -/* 0F295C 7F0BDE2C 10000020 */ b .L7F0BDEB0 -/* 0F2960 7F0BDE30 00000000 */ nop -.L7F0BDE34: -/* 0F2964 7F0BDE34 0FC01A24 */ jal init_path_table_links -/* 0F2968 7F0BDE38 00000000 */ nop -/* 0F296C 7F0BDE3C 0FC01410 */ jal init_ejected_cartridges -/* 0F2970 7F0BDE40 00000000 */ nop -/* 0F2974 7F0BDE44 0FC26919 */ jal getPlayerCount -/* 0F2978 7F0BDE48 00008025 */ move $s0, $zero -/* 0F297C 7F0BDE4C 18400016 */ blez $v0, .L7F0BDEA8 -/* 0F2980 7F0BDE50 00000000 */ nop -.L7F0BDE54: -/* 0F2984 7F0BDE54 0FC26C43 */ jal set_cur_player -/* 0F2988 7F0BDE58 02002025 */ move $a0, $s0 -/* 0F298C 7F0BDE5C 0FC0187C */ jal reinit_gunheld_totaltime -/* 0F2990 7F0BDE60 00000000 */ nop -/* 0F2994 7F0BDE64 0FC01434 */ jal init_player_BONDdata_stats -/* 0F2998 7F0BDE68 00000000 */ nop -/* 0F299C 7F0BDE6C 0FC1E4FB */ jal init_player_BONDdata -/* 0F29A0 7F0BDE70 00000000 */ nop -/* 0F29A4 7F0BDE74 0FC015F1 */ jal bondviewLoadSetupIntroSection -/* 0F29A8 7F0BDE78 00000000 */ nop -/* 0F29AC 7F0BDE7C 0FC1E62E */ jal bondviewPlayerSpawnRelated -/* 0F29B0 7F0BDE80 00000000 */ nop -/* 0F29B4 7F0BDE84 0FC018E3 */ jal sets_a_bunch_of_BONDdata_values_to_default -/* 0F29B8 7F0BDE88 00000000 */ nop -/* 0F29BC 7F0BDE8C 0FC01CBE */ jal disableOnscreenCheatText -/* 0F29C0 7F0BDE90 00000000 */ nop -/* 0F29C4 7F0BDE94 0FC26919 */ jal getPlayerCount -/* 0F29C8 7F0BDE98 26100001 */ addiu $s0, $s0, 1 -/* 0F29CC 7F0BDE9C 0202082A */ slt $at, $s0, $v0 -/* 0F29D0 7F0BDEA0 1420FFEC */ bnez $at, .L7F0BDE54 -/* 0F29D4 7F0BDEA4 00000000 */ nop -.L7F0BDEA8: -/* 0F29D8 7F0BDEA8 0FC26C43 */ jal set_cur_player -/* 0F29DC 7F0BDEAC 00002025 */ move $a0, $zero -.L7F0BDEB0: -/* 0F29E0 7F0BDEB0 0FC0154D */ jal set_contents_of_80036078 -/* 0F29E4 7F0BDEB4 00002025 */ move $a0, $zero -/* 0F29E8 7F0BDEB8 0FC348E0 */ jal zbufDeallocate -/* 0F29EC 7F0BDEBC 00000000 */ nop -/* 0F29F0 7F0BDEC0 0C000EEC */ jal viSetVideoMode -/* 0F29F4 7F0BDEC4 24040001 */ li $a0, 1 -/* 0F29F8 7F0BDEC8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F29FC 7F0BDECC 44818000 */ mtc1 $at, $f16 -/* 0F2A00 7F0BDED0 3C018005 */ lui $at, %hi(D_80048368) -/* 0F2A04 7F0BDED4 00002025 */ move $a0, $zero -/* 0F2A08 7F0BDED8 0FC2FEFE */ jal lvlSetControlsLockedFlag -/* 0F2A0C 7F0BDEDC E4308368 */ swc1 $f16, %lo(D_80048368)($at) -/* 0F2A10 7F0BDEE0 8FBF0034 */ lw $ra, 0x34($sp) -/* 0F2A14 7F0BDEE4 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0F2A18 7F0BDEE8 8FB00020 */ lw $s0, 0x20($sp) -/* 0F2A1C 7F0BDEEC 8FB10024 */ lw $s1, 0x24($sp) -/* 0F2A20 7F0BDEF0 8FB20028 */ lw $s2, 0x28($sp) -/* 0F2A24 7F0BDEF4 8FB3002C */ lw $s3, 0x2c($sp) -/* 0F2A28 7F0BDEF8 8FB40030 */ lw $s4, 0x30($sp) -/* 0F2A2C 7F0BDEFC 03E00008 */ jr $ra -/* 0F2A30 7F0BDF00 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif - -#ifdef VERSION_JP -GLOBAL_ASM( -.text -glabel lvlStageLoad -/* 0F31D0 7F0BE660 3C018005 */ lui $at, %hi(g_CurrentStageToLoad) # $at, 0x8005 -/* 0F31D4 7F0BE664 AC248394 */ sw $a0, %lo(g_CurrentStageToLoad)($at) -/* 0F31D8 7F0BE668 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F31DC 7F0BE66C 44816000 */ mtc1 $at, $f12 -/* 0F31E0 7F0BE670 24020001 */ li $v0, 1 -/* 0F31E4 7F0BE674 3C018005 */ lui $at, %hi(D_800483C0) # $at, 0x8005 -/* 0F31E8 7F0BE678 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0F31EC 7F0BE67C AC2283F4 */ sw $v0, %lo(D_800483C0)($at) -/* 0F31F0 7F0BE680 AFB10024 */ sw $s1, 0x24($sp) -/* 0F31F4 7F0BE684 3C018005 */ lui $at, %hi(g_ControlsLockedFlag) # $at, 0x8005 -/* 0F31F8 7F0BE688 3C118005 */ lui $s1, %hi(g_ClockTimer) # $s1, 0x8005 -/* 0F31FC 7F0BE68C AC2083A0 */ sw $zero, %lo(g_ControlsLockedFlag)($at) -/* 0F3200 7F0BE690 263183A4 */ addiu $s1, %lo(g_ClockTimer) # addiu $s1, $s1, -0x7c5c -/* 0F3204 7F0BE694 AE220000 */ sw $v0, ($s1) -/* 0F3208 7F0BE698 3C018005 */ lui $at, %hi(g_JP_GlobalTimerDelta) # $at, 0x8005 -/* 0F320C 7F0BE69C E42C83A8 */ swc1 $f12, %lo(g_JP_GlobalTimerDelta)($at) -/* 0F3210 7F0BE6A0 3C018005 */ lui $at, %hi(D_80048380) # $at, 0x8005 -/* 0F3214 7F0BE6A4 AC2083B0 */ sw $zero, %lo(D_80048380)($at) -/* 0F3218 7F0BE6A8 3C018005 */ lui $at, %hi(g_GlobalTimer) # $at, 0x8005 -/* 0F321C 7F0BE6AC AC2083AC */ sw $zero, %lo(g_GlobalTimer)($at) -/* 0F3220 7F0BE6B0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F3224 7F0BE6B4 44812000 */ mtc1 $at, $f4 - -/* 0F3228 7F0BE6B8 3C018005 */ lui $at, %hi(0x800483B4) # $at, 0x8005 -/* 0F322C 7F0BE6BC AFB00020 */ sw $s0, 0x20($sp) -/* 0F3230 7F0BE6C0 E42483B4 */ swc1 $f4, %lo(0x800483B4)($at) -/* 0F3234 7F0BE6C4 3C018005 */ lui $at, %hi(D_80048388) # $at, 0x8005 -/* 0F3238 7F0BE6C8 AC2083BC */ sw $zero, %lo(D_80048388)($at) -/* 0F323C 7F0BE6CC 3C018005 */ lui $at, %hi(D_8004838C) # $at, 0x8005 -/* 0F3240 7F0BE6D0 AC2083C0 */ sw $zero, %lo(D_8004838C)($at) -/* 0F3244 7F0BE6D4 3C018005 */ lui $at, %hi(D_80048390) # $at, 0x8005 -/* 0F3248 7F0BE6D8 44800000 */ mtc1 $zero, $f0 -/* 0F324C 7F0BE6DC 3C108005 */ lui $s0, %hi(D_80048394) # $s0, 0x8005 -/* 0F3250 7F0BE6E0 AC2083C4 */ sw $zero, %lo(D_80048390)($at) -/* 0F3254 7F0BE6E4 261083C8 */ addiu $s0, %lo(D_80048394) # addiu $s0, $s0, -0x7c38 - -/* 0F3258 7F0BE6E8 AE000000 */ sw $zero, ($s0) -/* 0F325C 7F0BE6EC 3C018005 */ lui $at, %hi(g_CurrentMultiPlayerSec) # $at, 0x8005 -/* 0F3260 7F0BE6F0 E42083D8 */ swc1 $f0, %lo(g_CurrentMultiPlayerSec)($at) -/* 0F3264 7F0BE6F4 3C018005 */ lui $at, %hi(D_800483B0) # $at, 0x8005 -/* 0F3268 7F0BE6F8 AC2083E4 */ sw $zero, %lo(D_800483B0)($at) -/* 0F326C 7F0BE6FC 3C018005 */ lui $at, %hi(g_StageTimeSec) # $at, 0x8005 -/* 0F3270 7F0BE700 E42083E8 */ swc1 $f0, %lo(g_StageTimeSec)($at) -/* 0F3274 7F0BE704 AFBF0034 */ sw $ra, 0x34($sp) -/* 0F3278 7F0BE708 3C018005 */ lui $at, %hi(g_MpSoundStateRelated) # $at, 0x8005 -/* 0F327C 7F0BE70C AFB40030 */ sw $s4, 0x30($sp) -/* 0F3280 7F0BE710 AFB3002C */ sw $s3, 0x2c($sp) -/* 0F3284 7F0BE714 AFB20028 */ sw $s2, 0x28($sp) -/* 0F3288 7F0BE718 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0F328C 7F0BE71C AFA40038 */ sw $a0, 0x38($sp) -/* 0F3290 7F0BE720 0C002492 */ jal sndSetScalerApplyVolumeAllSfxSlot -/* 0F3294 7F0BE724 AC2083D4 */ sw $zero, %lo(g_MpSoundStateRelated)($at) -/* 0F3298 7F0BE728 0C001C13 */ jal musicTrack1ApplySeqpVol -/* 0F329C 7F0BE72C 24047FFF */ li $a0, 32767 -/* 0F32A0 7F0BE730 0C001CF5 */ jal musicTrack2ApplySeqpVol -/* 0F32A4 7F0BE734 24047FFF */ li $a0, 32767 -/* 0F32A8 7F0BE738 0C001DD7 */ jal musicTrack3ApplySeqpVol -/* 0F32AC 7F0BE73C 24047FFF */ li $a0, 32767 -/* 0F32B0 7F0BE740 0FC30805 */ jal sub_GAME_7F0C1364 -/* 0F32B4 7F0BE744 00000000 */ nop -/* 0F32B8 7F0BE748 0FC01555 */ jal set_contents_of_80036078 -/* 0F32BC 7F0BE74C 24040001 */ li $a0, 1 -/* 0F32C0 7F0BE750 0FC01CD0 */ jal set_mt_tex_alloc -/* 0F32C4 7F0BE754 00000000 */ nop -/* 0F32C8 7F0BE758 0FC294DD */ jal sub_GAME_7F0A47D4 -/* 0F32CC 7F0BE75C 00000000 */ nop -/* 0F32D0 7F0BE760 0FC33324 */ jal texReset -/* 0F32D4 7F0BE764 00000000 */ nop -/* 0F32D8 7F0BE768 0FC2B5D7 */ jal load_font_tables -/* 0F32DC 7F0BE76C 00000000 */ nop -/* 0F32E0 7F0BE770 8FAF0038 */ lw $t7, 0x38($sp) -/* 0F32E4 7F0BE774 2401005A */ li $at, 90 -/* 0F32E8 7F0BE778 15E10005 */ bne $t7, $at, .Ljp7F0BE790 -/* 0F32EC 7F0BE77C 00000000 */ nop -/* 0F32F0 7F0BE780 0FC00348 */ jal init_menus_or_reset -/* 0F32F4 7F0BE784 00000000 */ nop -/* 0F32F8 7F0BE788 10000073 */ b .Ljp7F0BE958 -/* 0F32FC 7F0BE78C 00000000 */ nop -.Ljp7F0BE790: -/* 0F3300 7F0BE790 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8005 -/* 0F3304 7F0BE794 8C848394 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0F3308 7F0BE798 3C018007 */ lui $at, %hi(g_NewCheatUnlocked) -/* 0F330C 7F0BE79C AC2097D0 */ sw $zero, %lo(g_NewCheatUnlocked)($at) -/* 0F3310 7F0BE7A0 2401005A */ li $at, 90 -/* 0F3314 7F0BE7A4 1081001C */ beq $a0, $at, .Ljp7F0BE818 -/* 0F3318 7F0BE7A8 00000000 */ nop -/* 0F331C 7F0BE7AC 8E180000 */ lw $t8, ($s0) -/* 0F3320 7F0BE7B0 17000019 */ bnez $t8, .Ljp7F0BE818 -/* 0F3324 7F0BE7B4 00000000 */ nop -/* 0F3328 7F0BE7B8 8E390000 */ lw $t9, ($s1) -/* 0F332C 7F0BE7BC 3C088003 */ lui $t0, %hi(g_AppendCheatSinglePlayer) # $t0, 0x8003 -/* 0F3330 7F0BE7C0 1B200015 */ blez $t9, .Ljp7F0BE818 -/* 0F3334 7F0BE7C4 00000000 */ nop -/* 0F3338 7F0BE7C8 8D08A940 */ lw $t0, %lo(g_AppendCheatSinglePlayer)($t0) -/* 0F333C 7F0BE7CC 3C118007 */ lui $s1, %hi(g_CheatActivated + 1) # $s1, 0x8007 -/* 0F3340 7F0BE7D0 263196E1 */ addiu $s1, %lo(g_CheatActivated + 1) # addiu $s1, $s1, -0x691f -/* 0F3344 7F0BE7D4 11000010 */ beqz $t0, .Ljp7F0BE818 -/* 0F3348 7F0BE7D8 24100001 */ li $s0, 1 -/* 0F334C 7F0BE7DC 2412004B */ li $s2, 75 -.Ljp7F0BE7E0: -/* 0F3350 7F0BE7E0 92290000 */ lbu $t1, ($s1) -/* 0F3354 7F0BE7E4 51200008 */ beql $t1, $zero, .Ljp7F0BE808 -/* 0F3358 7F0BE7E8 26100001 */ addiu $s0, $s0, 1 -/* 0F335C 7F0BE7EC 0FC2494F */ jal cheatIsEnemyRockets -/* 0F3360 7F0BE7F0 02002025 */ move $a0, $s0 -/* 0F3364 7F0BE7F4 50400004 */ beql $v0, $zero, .Ljp7F0BE808 -/* 0F3368 7F0BE7F8 26100001 */ addiu $s0, $s0, 1 -/* 0F336C 7F0BE7FC 0FC24963 */ jal cheatButtonTurnOnCheatForPlayers -/* 0F3370 7F0BE800 02002025 */ move $a0, $s0 -/* 0F3374 7F0BE804 26100001 */ addiu $s0, $s0, 1 -.Ljp7F0BE808: -/* 0F3378 7F0BE808 1612FFF5 */ bne $s0, $s2, .Ljp7F0BE7E0 -/* 0F337C 7F0BE80C 26310001 */ addiu $s1, $s1, 1 -/* 0F3380 7F0BE810 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8005 -/* 0F3384 7F0BE814 8C848394 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -.Ljp7F0BE818: -/* 0F3388 7F0BE818 0FC2D335 */ jal load_bg_file -/* 0F338C 7F0BE81C 00000000 */ nop -/* 0F3390 7F0BE820 3C048005 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8005 -/* 0F3394 7F0BE824 0FC253F3 */ jal skySetStageNum -/* 0F3398 7F0BE828 8C848394 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0F339C 7F0BE82C 0FC29502 */ jal init_watch_at_start_of_stage -/* 0F33A0 7F0BE830 00000000 */ nop -/* 0F33A4 7F0BE834 0FC307AB */ jal sub_GAME_7F0C11FC -/* 0F33A8 7F0BE838 8FA40038 */ lw $a0, 0x38($sp) -/* 0F33AC 7F0BE83C 3C0A8008 */ lui $t2, %hi(g_playerPlayerData) -/* 0F33B0 7F0BE840 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0F33B4 7F0BE844 25529F60 */ addiu $s2, $t2, %lo(g_playerPlayerData) -/* 0F33B8 7F0BE848 4481A000 */ mtc1 $at, $f20 -/* 0F33BC 7F0BE84C 0240A025 */ move $s4, $s2 -/* 0F33C0 7F0BE850 24130004 */ li $s3, 4 -.Ljp7F0BE854: -/* 0F33C4 7F0BE854 0FC26C01 */ jal getPlayerCount -/* 0F33C8 7F0BE858 00000000 */ nop -/* 0F33CC 7F0BE85C 24010001 */ li $at, 1 -/* 0F33D0 7F0BE860 14410009 */ bne $v0, $at, .Ljp7F0BE888 -/* 0F33D4 7F0BE864 00008025 */ move $s0, $zero -/* 0F33D8 7F0BE868 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F33DC 7F0BE86C 44813000 */ mtc1 $at, $f6 -/* 0F33E0 7F0BE870 44814000 */ mtc1 $at, $f8 -/* 0F33E4 7F0BE874 A280006A */ sb $zero, 0x6a($s4) -/* 0F33E8 7F0BE878 A280006B */ sb $zero, 0x6b($s4) -/* 0F33EC 7F0BE87C E686005C */ swc1 $f6, 0x5c($s4) -/* 0F33F0 7F0BE880 1000001C */ b .Ljp7F0BE8F4 -/* 0F33F4 7F0BE884 E6880064 */ swc1 $f8, 0x64($s4) -.Ljp7F0BE888: -/* 0F33F8 7F0BE888 3C118008 */ lui $s1, %hi(g_playerPlayerData) # $s1, 0x8008 -/* 0F33FC 7F0BE88C 26319F60 */ addiu $s1, %lo(g_playerPlayerData) # addiu $s1, $s1, -0x60a0 -.Ljp7F0BE890: -/* 0F3400 7F0BE890 0FC05202 */ jal get_scenario -/* 0F3404 7F0BE894 00000000 */ nop -/* 0F3408 7F0BE898 14530003 */ bne $v0, $s3, .Ljp7F0BE8A8 -/* 0F340C 7F0BE89C 00000000 */ nop -/* 0F3410 7F0BE8A0 10000004 */ b .Ljp7F0BE8B4 -/* 0F3414 7F0BE8A4 E634005C */ swc1 $f20, 0x5c($s1) -.Ljp7F0BE8A8: -/* 0F3418 7F0BE8A8 0FC040FB */ jal get_player_mp_handicap -/* 0F341C 7F0BE8AC 02002025 */ move $a0, $s0 -/* 0F3420 7F0BE8B0 E620005C */ swc1 $f0, 0x5c($s1) -.Ljp7F0BE8B4: -/* 0F3424 7F0BE8B4 0FC04104 */ jal get_player_mp_char_height -/* 0F3428 7F0BE8B8 02002025 */ move $a0, $s0 -/* 0F342C 7F0BE8BC 26100001 */ addiu $s0, $s0, 1 -/* 0F3430 7F0BE8C0 26310070 */ addiu $s1, $s1, 0x70 -/* 0F3434 7F0BE8C4 1613FFF2 */ bne $s0, $s3, .Ljp7F0BE890 -/* 0F3438 7F0BE8C8 E620FFF4 */ swc1 $f0, -0xc($s1) -/* 0F343C 7F0BE8CC 0FC04118 */ jal get_mp_timelimit -/* 0F3440 7F0BE8D0 00000000 */ nop -/* 0F3444 7F0BE8D4 0FC30224 */ jal lvlSetMpTime -/* 0F3448 7F0BE8D8 00402025 */ move $a0, $v0 -/* 0F344C 7F0BE8DC 0FC04121 */ jal get_mp_pointlimit -/* 0F3450 7F0BE8E0 00000000 */ nop -/* 0F3454 7F0BE8E4 0FC30227 */ jal lvlSetMpPoint -/* 0F3458 7F0BE8E8 00402025 */ move $a0, $v0 -/* 0F345C 7F0BE8EC 0FC04086 */ jal copy_aim_settings_to_playerdata -/* 0F3460 7F0BE8F0 00000000 */ nop -.Ljp7F0BE8F4: -/* 0F3464 7F0BE8F4 44805000 */ mtc1 $zero, $f10 -/* 0F3468 7F0BE8F8 44808000 */ mtc1 $zero, $f16 -/* 0F346C 7F0BE8FC 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16) # lui $v0, 0x7fff -/* 0F3470 7F0BE900 3442FFFF */ ori $v0, (0x7FFFFFFF & 0xFFFF) # ori $v0, $v0, 0xffff -/* 0F3474 7F0BE904 AE800034 */ sw $zero, 0x34($s4) -/* 0F3478 7F0BE908 AE80003C */ sw $zero, 0x3c($s4) -/* 0F347C 7F0BE90C AE820044 */ sw $v0, 0x44($s4) -/* 0F3480 7F0BE910 AE800048 */ sw $zero, 0x48($s4) -/* 0F3484 7F0BE914 AE800054 */ sw $zero, 0x54($s4) -/* 0F3488 7F0BE918 AE800058 */ sw $zero, 0x58($s4) -/* 0F348C 7F0BE91C AE80004C */ sw $zero, 0x4c($s4) -/* 0F3490 7F0BE920 AE820050 */ sw $v0, 0x50($s4) -/* 0F3494 7F0BE924 A2800068 */ sb $zero, 0x68($s4) -/* 0F3498 7F0BE928 AE800060 */ sw $zero, 0x60($s4) -/* 0F349C 7F0BE92C E68A0038 */ swc1 $f10, 0x38($s4) -/* 0F34A0 7F0BE930 E6900040 */ swc1 $f16, 0x40($s4) -/* 0F34A4 7F0BE934 3C0B8008 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8008 -/* 0F34A8 7F0BE938 256BA120 */ addiu $t3, %lo(g_CurrentPlayer) # addiu $t3, $t3, -0x5ee0 -/* 0F34AC 7F0BE93C 26520070 */ addiu $s2, $s2, 0x70 -/* 0F34B0 7F0BE940 26940070 */ addiu $s4, $s4, 0x70 -/* 0F34B4 7F0BE944 AE40FFC0 */ sw $zero, -0x40($s2) -/* 0F34B8 7F0BE948 AE40FFBC */ sw $zero, -0x44($s2) -/* 0F34BC 7F0BE94C AE40FFB8 */ sw $zero, -0x48($s2) -/* 0F34C0 7F0BE950 164BFFC0 */ bne $s2, $t3, .Ljp7F0BE854 -/* 0F34C4 7F0BE954 AE40FFB4 */ sw $zero, -0x4c($s2) -.Ljp7F0BE958: -/* 0F34C8 7F0BE958 0FC013B4 */ jal something_with_stage_objectives -/* 0F34CC 7F0BE95C 00000000 */ nop -/* 0F34D0 7F0BE960 0FC30B2E */ jal mpwatchUnpauseGame -/* 0F34D4 7F0BE964 00000000 */ nop -/* 0F34D8 7F0BE968 0FC270F0 */ jal sub_GAME_7F09B820 -/* 0F34DC 7F0BE96C 00000000 */ nop -/* 0F34E0 7F0BE970 0FC0151C */ jal sub_GAME_7F005450 -/* 0F34E4 7F0BE974 00000000 */ nop -/* 0F34E8 7F0BE978 0FC01550 */ jal zero_contents_of_80036070_74 -/* 0F34EC 7F0BE97C 00000000 */ nop -/* 0F34F0 7F0BE980 0FC00538 */ jal init_load_objpos_table -/* 0F34F4 7F0BE984 00000000 */ nop -/* 0F34F8 7F0BE988 0FC005D4 */ jal reinit_between_menus -/* 0F34FC 7F0BE98C 00000000 */ nop -/* 0F3500 7F0BE990 0FC0052C */ jal init_sound_effects_registers -/* 0F3504 7F0BE994 00000000 */ nop -/* 0F3508 7F0BE998 0FC00390 */ jal init_guards -/* 0F350C 7F0BE99C 00000000 */ nop -/* 0F3510 7F0BE9A0 0FC003D4 */ jal set_new_rand_head_bodies -/* 0F3514 7F0BE9A4 8FA40038 */ lw $a0, 0x38($sp) -/* 0F3518 7F0BE9A8 0FC00EFC */ jal proplvreset2 -/* 0F351C 7F0BE9AC 8FA40038 */ lw $a0, 0x38($sp) -/* 0F3520 7F0BE9B0 0FC01B6C */ jal alloc_explosion_smoke_casing_scorch_impact_buffers -/* 0F3524 7F0BE9B4 00000000 */ nop -/* 0F3528 7F0BE9B8 0FC01C68 */ jal alloc_shattered_window_pieces -/* 0F352C 7F0BE9BC 00000000 */ nop -/* 0F3530 7F0BE9C0 0FC01CAC */ jal sub_GAME_7F007290 -/* 0F3534 7F0BE9C4 00000000 */ nop -/* 0F3538 7F0BE9C8 0FC01CB4 */ jal initCheatTextBuffer -/* 0F353C 7F0BE9CC 00000000 */ nop -/* 0F3540 7F0BE9D0 3C0C8005 */ lui $t4, %hi(g_CurrentStageToLoad) # $t4, 0x8005 -/* 0F3544 7F0BE9D4 8D8C8394 */ lw $t4, %lo(g_CurrentStageToLoad)($t4) -/* 0F3548 7F0BE9D8 2401005A */ li $at, 90 -/* 0F354C 7F0BE9DC 15810005 */ bne $t4, $at, .Ljp7F0BE9F4 -/* 0F3550 7F0BE9E0 00000000 */ nop -/* 0F3554 7F0BE9E4 0FC01CC6 */ jal disableOnscreenCheatText -/* 0F3558 7F0BE9E8 00000000 */ nop -/* 0F355C 7F0BE9EC 10000020 */ b .Ljp7F0BEA70 -/* 0F3560 7F0BE9F0 00000000 */ nop -.Ljp7F0BE9F4: -/* 0F3564 7F0BE9F4 0FC01A2C */ jal init_path_table_links -/* 0F3568 7F0BE9F8 00000000 */ nop -/* 0F356C 7F0BE9FC 0FC01418 */ jal init_ejected_cartridges -/* 0F3570 7F0BEA00 00000000 */ nop -/* 0F3574 7F0BEA04 0FC26C01 */ jal getPlayerCount -/* 0F3578 7F0BEA08 00008025 */ move $s0, $zero -/* 0F357C 7F0BEA0C 18400016 */ blez $v0, .Ljp7F0BEA68 -/* 0F3580 7F0BEA10 00000000 */ nop -.Ljp7F0BEA14: -/* 0F3584 7F0BEA14 0FC26F2B */ jal set_cur_player -/* 0F3588 7F0BEA18 02002025 */ move $a0, $s0 -/* 0F358C 7F0BEA1C 0FC0187C */ jal reinit_gunheld_totaltime -/* 0F3590 7F0BEA20 00000000 */ nop -/* 0F3594 7F0BEA24 0FC0143C */ jal init_player_BONDdata_stats -/* 0F3598 7F0BEA28 00000000 */ nop -/* 0F359C 7F0BEA2C 0FC1E677 */ jal init_player_BONDdata -/* 0F35A0 7F0BEA30 00000000 */ nop -/* 0F35A4 7F0BEA34 0FC015F9 */ jal bondviewLoadSetupIntroSection -/* 0F35A8 7F0BEA38 00000000 */ nop -/* 0F35AC 7F0BEA3C 0FC1E7AA */ jal bondviewPlayerSpawnRelated -/* 0F35B0 7F0BEA40 00000000 */ nop -/* 0F35B4 7F0BEA44 0FC018E3 */ jal sets_a_bunch_of_BONDdata_values_to_default -/* 0F35B8 7F0BEA48 00000000 */ nop -/* 0F35BC 7F0BEA4C 0FC01CC6 */ jal disableOnscreenCheatText -/* 0F35C0 7F0BEA50 00000000 */ nop -/* 0F35C4 7F0BEA54 0FC26C01 */ jal getPlayerCount -/* 0F35C8 7F0BEA58 26100001 */ addiu $s0, $s0, 1 -/* 0F35CC 7F0BEA5C 0202082A */ slt $at, $s0, $v0 -/* 0F35D0 7F0BEA60 1420FFEC */ bnez $at, .Ljp7F0BEA14 -/* 0F35D4 7F0BEA64 00000000 */ nop -.Ljp7F0BEA68: -/* 0F35D8 7F0BEA68 0FC26F2B */ jal set_cur_player -/* 0F35DC 7F0BEA6C 00002025 */ move $a0, $zero -.Ljp7F0BEA70: -/* 0F35E0 7F0BEA70 0FC01555 */ jal set_contents_of_80036078 -/* 0F35E4 7F0BEA74 00002025 */ move $a0, $zero -/* 0F35E8 7F0BEA78 0FC34C18 */ jal zbufDeallocate -/* 0F35EC 7F0BEA7C 00000000 */ nop -/* 0F35F0 7F0BEA80 0C000EEC */ jal viSetVideoMode -/* 0F35F4 7F0BEA84 24040001 */ li $a0, 1 -/* 0F35F8 7F0BEA88 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0F35FC 7F0BEA8C 44819000 */ mtc1 $at, $f18 -/* 0F3600 7F0BEA90 3C018005 */ lui $at, %hi(D_80048368) # $at, 0x8005 -/* 0F3604 7F0BEA94 00002025 */ move $a0, $zero -/* 0F3608 7F0BEA98 0FC3020C */ jal lvlSetControlsLockedFlag -/* 0F360C 7F0BEA9C E4328398 */ swc1 $f18, %lo(D_80048368)($at) -/* 0F3610 7F0BEAA0 8FBF0034 */ lw $ra, 0x34($sp) -/* 0F3614 7F0BEAA4 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0F3618 7F0BEAA8 8FB00020 */ lw $s0, 0x20($sp) -/* 0F361C 7F0BEAAC 8FB10024 */ lw $s1, 0x24($sp) -/* 0F3620 7F0BEAB0 8FB20028 */ lw $s2, 0x28($sp) -/* 0F3624 7F0BEAB4 8FB3002C */ lw $s3, 0x2c($sp) -/* 0F3628 7F0BEAB8 8FB40030 */ lw $s4, 0x30($sp) -/* 0F362C 7F0BEABC 03E00008 */ jr $ra -/* 0F3630 7F0BEAC0 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif - -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata - -/* not sure this is the right location ... */ -#const char aSetdetailDDDDDDDDD[] = "setdetail %d %d %d %d %d %d %d %d %d"; -glabel aSetdetailDDDDDDDDD -.word 0x73657464 -.word 0x65746169 -.word 0x6c202564 -.word 0x20256420 -.word 0x25642025 -.word 0x64202564 -.word 0x20256420 -.word 0x25642025 -.word 0x64202564 -.word 0x00000000 - -glabel D_800502EC -.word 0x3f99999a - -.text -glabel lvlStageLoad -/* 0EF850 7F0BCE60 3C018004 */ lui $at, %hi(g_CurrentStageToLoad) # $at, 0x8004 -/* 0EF854 7F0BCE64 AC240FE4 */ sw $a0, %lo(g_CurrentStageToLoad)($at) -/* 0EF858 7F0BCE68 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0EF85C 7F0BCE6C 44816000 */ mtc1 $at, $f12 -/* 0EF860 7F0BCE70 24020001 */ li $v0, 1 -/* 0EF864 7F0BCE74 3C018004 */ lui $at, %hi(D_800483C0) # $at, 0x8004 -/* 0EF868 7F0BCE78 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0EF86C 7F0BCE7C AC221044 */ sw $v0, %lo(D_800483C0)($at) -/* 0EF870 7F0BCE80 AFB10024 */ sw $s1, 0x24($sp) -/* 0EF874 7F0BCE84 3C018004 */ lui $at, %hi(g_ControlsLockedFlag) # $at, 0x8004 -/* 0EF878 7F0BCE88 3C118004 */ lui $s1, %hi(g_ClockTimer) # $s1, 0x8004 -/* 0EF87C 7F0BCE8C AC200FF0 */ sw $zero, %lo(g_ControlsLockedFlag)($at) -/* 0EF880 7F0BCE90 26310FF4 */ addiu $s1, %lo(g_ClockTimer) # addiu $s1, $s1, 0xff4 -/* 0EF884 7F0BCE94 AE220000 */ sw $v0, ($s1) -/* 0EF888 7F0BCE98 3C018004 */ lui $at, %hi(g_JP_GlobalTimerDelta) # $at, 0x8004 -/* 0EF88C 7F0BCE9C E42C0FF8 */ swc1 $f12, %lo(g_JP_GlobalTimerDelta)($at) -/* 0EF890 7F0BCEA0 3C018004 */ lui $at, %hi(D_80048380) # $at, 0x8004 -/* 0EF894 7F0BCEA4 AC201000 */ sw $zero, %lo(D_80048380)($at) -/* 0EF898 7F0BCEA8 3C018004 */ lui $at, %hi(g_GlobalTimer) # $at, 0x8004 -/* 0EF89C 7F0BCEAC AC200FFC */ sw $zero, %lo(g_GlobalTimer)($at) -/* 0EF8A0 7F0BCEB0 3C018005 */ lui $at, %hi(D_800502EC) # $at, 0x8005 -/* 0EF8A4 7F0BCEB4 C42402EC */ lwc1 $f4, %lo(D_800502EC)($at) -/* 0EF8A8 7F0BCEB8 3C018004 */ lui $at, %hi(D_80048380+4) # $at, 0x8004 -/* 0EF8AC 7F0BCEBC AFB00020 */ sw $s0, 0x20($sp) -/* 0EF8B0 7F0BCEC0 E4241004 */ swc1 $f4, %lo(D_80048380+4)($at) -/* 0EF8B4 7F0BCEC4 3C018004 */ lui $at, %hi(D_80048380+0xc) # $at, 0x8004 -/* 0EF8B8 7F0BCEC8 AC20100C */ sw $zero, %lo(D_80048380+0xc)($at) -/* 0EF8BC 7F0BCECC 3C018004 */ lui $at, %hi(D_80048380+0x10) # $at, 0x8004 -/* 0EF8C0 7F0BCED0 AC201010 */ sw $zero, %lo(D_80048380+0x10)($at) -/* 0EF8C4 7F0BCED4 3C018004 */ lui $at, %hi(D_80048380+0x14) # $at, 0x8004 -/* 0EF8C8 7F0BCED8 44800000 */ mtc1 $zero, $f0 -/* 0EF8CC 7F0BCEDC 3C108004 */ lui $s0, %hi(D_80048380+0x18) # $s0, 0x8004 -/* 0EF8D0 7F0BCEE0 AC201014 */ sw $zero, %lo(D_80048380+0x14)($at) -/* 0EF8D4 7F0BCEE4 26101018 */ addiu $s0, %lo(D_80048380+0x18) # addiu $s0, $s0, 0x1018 -/* 0EF8D8 7F0BCEE8 AE000000 */ sw $zero, ($s0) -/* 0EF8DC 7F0BCEEC 3C018004 */ lui $at, %hi(g_CurrentMultiPlayerSec) # $at, 0x8004 -/* 0EF8E0 7F0BCEF0 E4201028 */ swc1 $f0, %lo(g_CurrentMultiPlayerSec)($at) -/* 0EF8E4 7F0BCEF4 3C018004 */ lui $at, %hi(D_800483B0) # $at, 0x8004 -/* 0EF8E8 7F0BCEF8 AC201034 */ sw $zero, %lo(D_800483B0)($at) -/* 0EF8EC 7F0BCEFC 3C018004 */ lui $at, %hi(g_StageTimeSec) # $at, 0x8004 -/* 0EF8F0 7F0BCF00 E4201038 */ swc1 $f0, %lo(g_StageTimeSec)($at) -/* 0EF8F4 7F0BCF04 AFBF0034 */ sw $ra, 0x34($sp) -/* 0EF8F8 7F0BCF08 3C018004 */ lui $at, %hi(g_MpSoundStateRelated) # $at, 0x8004 -/* 0EF8FC 7F0BCF0C AFB40030 */ sw $s4, 0x30($sp) -/* 0EF900 7F0BCF10 AFB3002C */ sw $s3, 0x2c($sp) -/* 0EF904 7F0BCF14 AFB20028 */ sw $s2, 0x28($sp) -/* 0EF908 7F0BCF18 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 0EF90C 7F0BCF1C AFA40038 */ sw $a0, 0x38($sp) -/* 0EF910 7F0BCF20 0C0021A6 */ jal sndSetScalerApplyVolumeAllSfxSlot -/* 0EF914 7F0BCF24 AC201024 */ sw $zero, %lo(g_MpSoundStateRelated)($at) -/* 0EF918 7F0BCF28 0C001927 */ jal musicTrack1ApplySeqpVol -/* 0EF91C 7F0BCF2C 24047FFF */ li $a0, 32767 -/* 0EF920 7F0BCF30 0C001A09 */ jal musicTrack2ApplySeqpVol -/* 0EF924 7F0BCF34 24047FFF */ li $a0, 32767 -/* 0EF928 7F0BCF38 0C001AEB */ jal musicTrack3ApplySeqpVol -/* 0EF92C 7F0BCF3C 24047FFF */ li $a0, 32767 -/* 0EF930 7F0BCF40 0FC30211 */ jal sub_GAME_7F0C1364 -/* 0EF934 7F0BCF44 00000000 */ nop -/* 0EF938 7F0BCF48 0FC01535 */ jal set_contents_of_80036078 -/* 0EF93C 7F0BCF4C 24040001 */ li $a0, 1 -/* 0EF940 7F0BCF50 0FC01CA8 */ jal set_mt_tex_alloc -/* 0EF944 7F0BCF54 00000000 */ nop -/* 0EF948 7F0BCF58 0FC28EC6 */ jal sub_GAME_7F0A45D8 -/* 0EF94C 7F0BCF5C 00000000 */ nop -/* 0EF950 7F0BCF60 0FC32D34 */ jal texReset -/* 0EF954 7F0BCF64 00000000 */ nop -/* 0EF958 7F0BCF68 0FC2AF9B */ jal load_font_tables -/* 0EF95C 7F0BCF6C 00000000 */ nop -/* 0EF960 7F0BCF70 8FAF0038 */ lw $t7, 0x38($sp) -/* 0EF964 7F0BCF74 2401005A */ li $at, 90 -/* 0EF968 7F0BCF78 15E10005 */ bne $t7, $at, .L7F0BCF90 -/* 0EF96C 7F0BCF7C 00000000 */ nop -/* 0EF970 7F0BCF80 0FC00348 */ jal init_menus_or_reset -/* 0EF974 7F0BCF84 00000000 */ nop -/* 0EF978 7F0BCF88 10000073 */ b .L7F0BD158 -/* 0EF97C 7F0BCF8C 00000000 */ nop -.L7F0BCF90: -/* 0EF980 7F0BCF90 3C048004 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8004 -/* 0EF984 7F0BCF94 8C840FE4 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0EF988 7F0BCF98 3C018006 */ lui $at, %hi(g_NewCheatUnlocked) # -0.000000 -/* 0EF98C 7F0BCF9C AC2086D0 */ sw $zero, %lo(g_NewCheatUnlocked)($at) -/* 0EF990 7F0BCFA0 2401005A */ li $at, 90 -/* 0EF994 7F0BCFA4 1081001C */ beq $a0, $at, .L7F0BD018 -/* 0EF998 7F0BCFA8 00000000 */ nop -/* 0EF99C 7F0BCFAC 8E180000 */ lw $t8, ($s0) -/* 0EF9A0 7F0BCFB0 17000019 */ bnez $t8, .L7F0BD018 -/* 0EF9A4 7F0BCFB4 00000000 */ nop -/* 0EF9A8 7F0BCFB8 8E390000 */ lw $t9, ($s1) -/* 0EF9AC 7F0BCFBC 3C088002 */ lui $t0, %hi(g_AppendCheatSinglePlayer) # $t0, 0x8002 -/* 0EF9B0 7F0BCFC0 1B200015 */ blez $t9, .L7F0BD018 -/* 0EF9B4 7F0BCFC4 00000000 */ nop -/* 0EF9B8 7F0BCFC8 8D085E50 */ lw $t0, %lo(g_AppendCheatSinglePlayer)($t0) -/* 0EF9BC 7F0BCFCC 3C118006 */ lui $s1, %hi(g_CheatActivated + 1) # $s1, 0x8006 -/* 0EF9C0 7F0BCFD0 263185E1 */ addiu $s1, %lo(g_CheatActivated + 1) # addiu $s1, $s1, -0x7a1f -/* 0EF9C4 7F0BCFD4 11000010 */ beqz $t0, .L7F0BD018 -/* 0EF9C8 7F0BCFD8 24100001 */ li $s0, 1 -/* 0EF9CC 7F0BCFDC 2412004B */ li $s2, 75 -.L7F0BCFE0: -/* 0EF9D0 7F0BCFE0 92290000 */ lbu $t1, ($s1) -/* 0EF9D4 7F0BCFE4 51200008 */ beql $t1, $zero, .L7F0BD008 -/* 0EF9D8 7F0BCFE8 26100001 */ addiu $s0, $s0, 1 -/* 0EF9DC 7F0BCFEC 0FC243B7 */ jal cheatIsEnemyRockets -/* 0EF9E0 7F0BCFF0 02002025 */ move $a0, $s0 -/* 0EF9E4 7F0BCFF4 50400004 */ beql $v0, $zero, .L7F0BD008 -/* 0EF9E8 7F0BCFF8 26100001 */ addiu $s0, $s0, 1 -/* 0EF9EC 7F0BCFFC 0FC243CB */ jal cheatButtonTurnOnCheatForPlayers -/* 0EF9F0 7F0BD000 02002025 */ move $a0, $s0 -/* 0EF9F4 7F0BD004 26100001 */ addiu $s0, $s0, 1 -.L7F0BD008: -/* 0EF9F8 7F0BD008 1612FFF5 */ bne $s0, $s2, .L7F0BCFE0 -/* 0EF9FC 7F0BD00C 26310001 */ addiu $s1, $s1, 1 -/* 0EFA00 7F0BD010 3C048004 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8004 -/* 0EFA04 7F0BD014 8C840FE4 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -.L7F0BD018: -/* 0EFA08 7F0BD018 0FC2CD18 */ jal load_bg_file -/* 0EFA0C 7F0BD01C 00000000 */ nop -/* 0EFA10 7F0BD020 3C048004 */ lui $a0, %hi(g_CurrentStageToLoad) # $a0, 0x8004 -/* 0EFA14 7F0BD024 0FC24E5B */ jal skySetStageNum -/* 0EFA18 7F0BD028 8C840FE4 */ lw $a0, %lo(g_CurrentStageToLoad)($a0) -/* 0EFA1C 7F0BD02C 0FC28EE2 */ jal init_watch_at_start_of_stage -/* 0EFA20 7F0BD030 00000000 */ nop -/* 0EFA24 7F0BD034 0FC301B7 */ jal sub_GAME_7F0C11FC -/* 0EFA28 7F0BD038 8FA40038 */ lw $a0, 0x38($sp) -/* 0EFA2C 7F0BD03C 3C0A8007 */ lui $t2, %hi(g_playerPlayerData) -/* 0EFA30 7F0BD040 3C014348 */ li $at, 0x43480000 # 200.000000 -/* 0EFA34 7F0BD044 25528A00 */ addiu $s2, $t2, %lo(g_playerPlayerData) -/* 0EFA38 7F0BD048 4481A000 */ mtc1 $at, $f20 -/* 0EFA3C 7F0BD04C 0240A025 */ move $s4, $s2 -/* 0EFA40 7F0BD050 24130004 */ li $s3, 4 -.L7F0BD054: -/* 0EFA44 7F0BD054 0FC26669 */ jal getPlayerCount -/* 0EFA48 7F0BD058 00000000 */ nop -/* 0EFA4C 7F0BD05C 24010001 */ li $at, 1 -/* 0EFA50 7F0BD060 14410009 */ bne $v0, $at, .L7F0BD088 -/* 0EFA54 7F0BD064 00008025 */ move $s0, $zero -/* 0EFA58 7F0BD068 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0EFA5C 7F0BD06C 44813000 */ mtc1 $at, $f6 -/* 0EFA60 7F0BD070 44814000 */ mtc1 $at, $f8 -/* 0EFA64 7F0BD074 A280006A */ sb $zero, 0x6a($s4) -/* 0EFA68 7F0BD078 A280006B */ sb $zero, 0x6b($s4) -/* 0EFA6C 7F0BD07C E686005C */ swc1 $f6, 0x5c($s4) -/* 0EFA70 7F0BD080 1000001C */ b .L7F0BD0F4 -/* 0EFA74 7F0BD084 E6880064 */ swc1 $f8, 0x64($s4) -.L7F0BD088: -/* 0EFA78 7F0BD088 3C118007 */ lui $s1, %hi(g_playerPlayerData) # $s1, 0x8007 -/* 0EFA7C 7F0BD08C 26318A00 */ addiu $s1, %lo(g_playerPlayerData) # addiu $s1, $s1, -0x7600 -.L7F0BD090: -/* 0EFA80 7F0BD090 0FC051B2 */ jal get_scenario -/* 0EFA84 7F0BD094 00000000 */ nop -/* 0EFA88 7F0BD098 14530003 */ bne $v0, $s3, .L7F0BD0A8 -/* 0EFA8C 7F0BD09C 00000000 */ nop -/* 0EFA90 7F0BD0A0 10000004 */ b .L7F0BD0B4 -/* 0EFA94 7F0BD0A4 E634005C */ swc1 $f20, 0x5c($s1) -.L7F0BD0A8: -/* 0EFA98 7F0BD0A8 0FC040A7 */ jal get_player_mp_handicap -/* 0EFA9C 7F0BD0AC 02002025 */ move $a0, $s0 -/* 0EFAA0 7F0BD0B0 E620005C */ swc1 $f0, 0x5c($s1) -.L7F0BD0B4: -/* 0EFAA4 7F0BD0B4 0FC040B0 */ jal get_player_mp_char_height -/* 0EFAA8 7F0BD0B8 02002025 */ move $a0, $s0 -/* 0EFAAC 7F0BD0BC 26100001 */ addiu $s0, $s0, 1 -/* 0EFAB0 7F0BD0C0 26310070 */ addiu $s1, $s1, 0x70 -/* 0EFAB4 7F0BD0C4 1613FFF2 */ bne $s0, $s3, .L7F0BD090 -/* 0EFAB8 7F0BD0C8 E620FFF4 */ swc1 $f0, -0xc($s1) -/* 0EFABC 7F0BD0CC 0FC040C4 */ jal get_mp_timelimit -/* 0EFAC0 7F0BD0D0 00000000 */ nop -/* 0EFAC4 7F0BD0D4 0FC2FC27 */ jal lvlSetMpTime -/* 0EFAC8 7F0BD0D8 00402025 */ move $a0, $v0 -/* 0EFACC 7F0BD0DC 0FC040CD */ jal get_mp_pointlimit -/* 0EFAD0 7F0BD0E0 00000000 */ nop -/* 0EFAD4 7F0BD0E4 0FC2FC2A */ jal lvlSetMpPoint -/* 0EFAD8 7F0BD0E8 00402025 */ move $a0, $v0 -/* 0EFADC 7F0BD0EC 0FC04032 */ jal copy_aim_settings_to_playerdata -/* 0EFAE0 7F0BD0F0 00000000 */ nop -.L7F0BD0F4: -/* 0EFAE4 7F0BD0F4 44805000 */ mtc1 $zero, $f10 -/* 0EFAE8 7F0BD0F8 44808000 */ mtc1 $zero, $f16 -/* 0EFAEC 7F0BD0FC 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16) # lui $v0, 0x7fff -/* 0EFAF0 7F0BD100 3442FFFF */ ori $v0, (0x7FFFFFFF & 0xFFFF) # ori $v0, $v0, 0xffff -/* 0EFAF4 7F0BD104 AE800034 */ sw $zero, 0x34($s4) -/* 0EFAF8 7F0BD108 AE80003C */ sw $zero, 0x3c($s4) -/* 0EFAFC 7F0BD10C AE820044 */ sw $v0, 0x44($s4) -/* 0EFB00 7F0BD110 AE800048 */ sw $zero, 0x48($s4) -/* 0EFB04 7F0BD114 AE800054 */ sw $zero, 0x54($s4) -/* 0EFB08 7F0BD118 AE800058 */ sw $zero, 0x58($s4) -/* 0EFB0C 7F0BD11C AE80004C */ sw $zero, 0x4c($s4) -/* 0EFB10 7F0BD120 AE820050 */ sw $v0, 0x50($s4) -/* 0EFB14 7F0BD124 A2800068 */ sb $zero, 0x68($s4) -/* 0EFB18 7F0BD128 AE800060 */ sw $zero, 0x60($s4) -/* 0EFB1C 7F0BD12C E68A0038 */ swc1 $f10, 0x38($s4) -/* 0EFB20 7F0BD130 E6900040 */ swc1 $f16, 0x40($s4) -/* 0EFB24 7F0BD134 3C0B8007 */ lui $t3, %hi(g_CurrentPlayer) # $t3, 0x8007 -/* 0EFB28 7F0BD138 256B8BC0 */ addiu $t3, %lo(g_CurrentPlayer) # addiu $t3, $t3, -0x7440 -/* 0EFB2C 7F0BD13C 26520070 */ addiu $s2, $s2, 0x70 -/* 0EFB30 7F0BD140 26940070 */ addiu $s4, $s4, 0x70 -/* 0EFB34 7F0BD144 AE40FFC0 */ sw $zero, -0x40($s2) -/* 0EFB38 7F0BD148 AE40FFBC */ sw $zero, -0x44($s2) -/* 0EFB3C 7F0BD14C AE40FFB8 */ sw $zero, -0x48($s2) -/* 0EFB40 7F0BD150 164BFFC0 */ bne $s2, $t3, .L7F0BD054 -/* 0EFB44 7F0BD154 AE40FFB4 */ sw $zero, -0x4c($s2) -.L7F0BD158: -/* 0EFB48 7F0BD158 0FC01394 */ jal something_with_stage_objectives -/* 0EFB4C 7F0BD15C 00000000 */ nop -/* 0EFB50 7F0BD160 0FC3053A */ jal mpwatchUnpauseGame -/* 0EFB54 7F0BD164 00000000 */ nop -/* 0EFB58 7F0BD168 0FC26B58 */ jal sub_GAME_7F09B820 -/* 0EFB5C 7F0BD16C 00000000 */ nop -/* 0EFB60 7F0BD170 0FC014FC */ jal sub_GAME_7F005450 -/* 0EFB64 7F0BD174 00000000 */ nop -/* 0EFB68 7F0BD178 0FC01530 */ jal zero_contents_of_80036070_74 -/* 0EFB6C 7F0BD17C 00000000 */ nop -/* 0EFB70 7F0BD180 0FC00538 */ jal init_load_objpos_table -/* 0EFB74 7F0BD184 00000000 */ nop -/* 0EFB78 7F0BD188 0FC005D4 */ jal reinit_between_menus -/* 0EFB7C 7F0BD18C 00000000 */ nop -/* 0EFB80 7F0BD190 0FC0052C */ jal init_sound_effects_registers -/* 0EFB84 7F0BD194 00000000 */ nop -/* 0EFB88 7F0BD198 0FC00390 */ jal init_guards -/* 0EFB8C 7F0BD19C 00000000 */ nop -/* 0EFB90 7F0BD1A0 0FC003D4 */ jal set_new_rand_head_bodies -/* 0EFB94 7F0BD1A4 8FA40038 */ lw $a0, 0x38($sp) -/* 0EFB98 7F0BD1A8 0FC00EDF */ jal proplvreset2 -/* 0EFB9C 7F0BD1AC 8FA40038 */ lw $a0, 0x38($sp) -/* 0EFBA0 7F0BD1B0 0FC01B44 */ jal alloc_explosion_smoke_casing_scorch_impact_buffers -/* 0EFBA4 7F0BD1B4 00000000 */ nop -/* 0EFBA8 7F0BD1B8 0FC01C40 */ jal alloc_shattered_window_pieces -/* 0EFBAC 7F0BD1BC 00000000 */ nop -/* 0EFBB0 7F0BD1C0 0FC01C84 */ jal sub_GAME_7F007290 -/* 0EFBB4 7F0BD1C4 00000000 */ nop -/* 0EFBB8 7F0BD1C8 0FC01C8C */ jal initCheatTextBuffer -/* 0EFBBC 7F0BD1CC 00000000 */ nop -/* 0EFBC0 7F0BD1D0 3C0C8004 */ lui $t4, %hi(g_CurrentStageToLoad) # $t4, 0x8004 -/* 0EFBC4 7F0BD1D4 8D8C0FE4 */ lw $t4, %lo(g_CurrentStageToLoad)($t4) -/* 0EFBC8 7F0BD1D8 2401005A */ li $at, 90 -/* 0EFBCC 7F0BD1DC 15810005 */ bne $t4, $at, .L7F0BD1F4 -/* 0EFBD0 7F0BD1E0 00000000 */ nop -/* 0EFBD4 7F0BD1E4 0FC01C9E */ jal disableOnscreenCheatText -/* 0EFBD8 7F0BD1E8 00000000 */ nop -/* 0EFBDC 7F0BD1EC 10000020 */ b .L7F0BD270 -/* 0EFBE0 7F0BD1F0 00000000 */ nop -.L7F0BD1F4: -/* 0EFBE4 7F0BD1F4 0FC01A04 */ jal init_path_table_links -/* 0EFBE8 7F0BD1F8 00000000 */ nop -/* 0EFBEC 7F0BD1FC 0FC013F8 */ jal init_ejected_cartridges -/* 0EFBF0 7F0BD200 00000000 */ nop -/* 0EFBF4 7F0BD204 0FC26669 */ jal getPlayerCount -/* 0EFBF8 7F0BD208 00008025 */ move $s0, $zero -/* 0EFBFC 7F0BD20C 18400016 */ blez $v0, .L7F0BD268 -/* 0EFC00 7F0BD210 00000000 */ nop -.L7F0BD214: -/* 0EFC04 7F0BD214 0FC26993 */ jal set_cur_player -/* 0EFC08 7F0BD218 02002025 */ move $a0, $s0 -/* 0EFC0C 7F0BD21C 0FC0185C */ jal reinit_gunheld_totaltime -/* 0EFC10 7F0BD220 00000000 */ nop -/* 0EFC14 7F0BD224 0FC0141C */ jal init_player_BONDdata_stats -/* 0EFC18 7F0BD228 00000000 */ nop -/* 0EFC1C 7F0BD22C 0FC1E51B */ jal init_player_BONDdata -/* 0EFC20 7F0BD230 00000000 */ nop -/* 0EFC24 7F0BD234 0FC015D9 */ jal bondviewLoadSetupIntroSection -/* 0EFC28 7F0BD238 00000000 */ nop -/* 0EFC2C 7F0BD23C 0FC1E64E */ jal bondviewPlayerSpawnRelated -/* 0EFC30 7F0BD240 00000000 */ nop -/* 0EFC34 7F0BD244 0FC018C3 */ jal sets_a_bunch_of_BONDdata_values_to_default -/* 0EFC38 7F0BD248 00000000 */ nop -/* 0EFC3C 7F0BD24C 0FC01C9E */ jal disableOnscreenCheatText -/* 0EFC40 7F0BD250 00000000 */ nop -/* 0EFC44 7F0BD254 0FC26669 */ jal getPlayerCount -/* 0EFC48 7F0BD258 26100001 */ addiu $s0, $s0, 1 -/* 0EFC4C 7F0BD25C 0202082A */ slt $at, $s0, $v0 -/* 0EFC50 7F0BD260 1420FFEC */ bnez $at, .L7F0BD214 -/* 0EFC54 7F0BD264 00000000 */ nop -.L7F0BD268: -/* 0EFC58 7F0BD268 0FC26993 */ jal set_cur_player -/* 0EFC5C 7F0BD26C 00002025 */ move $a0, $zero -.L7F0BD270: -/* 0EFC60 7F0BD270 0FC01535 */ jal set_contents_of_80036078 -/* 0EFC64 7F0BD274 00002025 */ move $a0, $zero -/* 0EFC68 7F0BD278 0FC34628 */ jal zbufDeallocate -/* 0EFC6C 7F0BD27C 00000000 */ nop -/* 0EFC70 7F0BD280 0C000D80 */ jal viSetVideoMode -/* 0EFC74 7F0BD284 24040001 */ li $a0, 1 -/* 0EFC78 7F0BD288 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0EFC7C 7F0BD28C 44819000 */ mtc1 $at, $f18 -/* 0EFC80 7F0BD290 3C018004 */ lui $at, %hi(D_80048368) # $at, 0x8004 -/* 0EFC84 7F0BD294 00002025 */ move $a0, $zero -/* 0EFC88 7F0BD298 0FC2FC0F */ jal lvlSetControlsLockedFlag -/* 0EFC8C 7F0BD29C E4320FE8 */ swc1 $f18, %lo(D_80048368)($at) -/* 0EFC90 7F0BD2A0 8FBF0034 */ lw $ra, 0x34($sp) -/* 0EFC94 7F0BD2A4 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 0EFC98 7F0BD2A8 8FB00020 */ lw $s0, 0x20($sp) -/* 0EFC9C 7F0BD2AC 8FB10024 */ lw $s1, 0x24($sp) -/* 0EFCA0 7F0BD2B0 8FB20028 */ lw $s2, 0x28($sp) -/* 0EFCA4 7F0BD2B4 8FB3002C */ lw $s3, 0x2c($sp) -/* 0EFCA8 7F0BD2B8 8FB40030 */ lw $s4, 0x30($sp) -/* 0EFCAC 7F0BD2BC 03E00008 */ jr $ra -/* 0EFCB0 7F0BD2C0 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif - @@ -1477,6 +522,8 @@ s32 lvlGetCurrentStageToLoad(void) * * address 0x7F0BDF10. * + * https://decomp.me/scratch/C83v8 90.47% + * * decomp status: * - compiles: yes * - stack resize: wrong @@ -1485,11 +532,9 @@ s32 lvlGetCurrentStageToLoad(void) */ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0) { - s32 sp20; s32 temp_v1; - s32 phi_a0; + s32 sp20; s32 i; - s32 *p; sp20 = 0; @@ -1497,48 +542,34 @@ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0) { arg0 = bgDebugRemoved7F0B9DE4(arg0, g_DebugPortalsD_800483CC, -1); - // decomp issue. Can't get the loads and stores to match. - for (i = 0, p = &g_DebugPortalsInputBuffer_0; i < 4; i++) + for (i = 0; i < 4; i++) { - p[i] = p[i+1]; + g_DebugPortalsInputBuffer[i] = g_DebugPortalsInputBuffer[i+1]; } temp_v1 = joyGetButtons(PLAYER_1, A_BUTTON) | joyGetButtons(PLAYER_2, A_BUTTON); - if (g_DebugPortalsInputBuffer_3 != temp_v1) + if (g_DebugPortalsInputBuffer[3] != temp_v1) { D_800483C0 ^= 1; } - if (g_DebugPortalsInputBuffer_0 != g_DebugPortalsInputBuffer_1) + if (g_DebugPortalsInputBuffer[0] != g_DebugPortalsInputBuffer[1]) { D_800483C0 ^= 1; } - g_DebugPortalsInputBuffer_4 = temp_v1; - - if (temp_v1 != 0) - { - phi_a0 = g_DebugPortalsD_800483CC; - } - else - { - phi_a0 = -1; - } + g_DebugPortalsInputBuffer[4] = temp_v1; - bgRemoved7F0B9DF4(phi_a0); + bgRemoved7F0B9DF4(temp_v1 ? g_DebugPortalsD_800483CC : -1); return arg0; } if (joyGetButtonsPressedThisFrame(PLAYER_1, L_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, L_JPAD)) { + g_DebugPortalsD_800483CC--; sp20 = 1; - - // decomp issue: - // this is incomplete / wrong. - g_DebugPortalsD_800483CC = g_DebugPortalsD_800483CC - 1; - if (g_DebugPortalsD_800483CC < 0) { g_DebugPortalsD_800483CC = 0; @@ -1547,15 +578,15 @@ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0) if (joyGetButtonsPressedThisFrame(PLAYER_1, R_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, R_JPAD)) { + g_DebugPortalsD_800483CC++; sp20 = 1; - g_DebugPortalsD_800483CC = g_DebugPortalsD_800483CC + 1; } if ( (joyGetButtons(PLAYER_1, R_TRIG) | joyGetButtons(PLAYER_2, R_TRIG)) && (joyGetButtons(PLAYER_1, L_TRIG) | joyGetButtons(PLAYER_2, L_TRIG))) { - if (joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) != 0) + if (joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD)) { bgSwapConnectedRooms(g_DebugPortalsD_800483CC); } @@ -1566,16 +597,16 @@ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0) (joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, D_JPAD)) && (bgGetDataPortalsControlBytes1Bit1(g_DebugPortalsD_800483CC) == 0)) { - sp20 = 1; bgToggleDataPortalsContrlBytes1Bit1(g_DebugPortalsD_800483CC, 0); + sp20 = 1; } if ( (joyGetButtonsPressedThisFrame(PLAYER_1, U_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, U_JPAD)) && (bgGetDataPortalsControlBytes1Bit1(g_DebugPortalsD_800483CC) != 0)) { - sp20 = 1; bgToggleDataPortalsContrlBytes1Bit1(g_DebugPortalsD_800483CC, 1); + sp20 = 1; } } else if (joyGetButtons(PLAYER_1, L_TRIG) | joyGetButtons(PLAYER_2, L_TRIG)) @@ -1584,30 +615,30 @@ Gfx * lvlPortalDebug7F0BDF10(Gfx * arg0) (joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, D_JPAD)) && bgGetDataPortalsControlBytes1Bit2(g_DebugPortalsD_800483CC)) { - sp20 = 1; bgClearDataPortalsControlBytes1Low2Bits(g_DebugPortalsD_800483CC); + sp20 = 1; } if ( (joyGetButtonsPressedThisFrame(PLAYER_1, U_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, U_JPAD)) && (bgGetDataPortalsControlBytes1Bit2(g_DebugPortalsD_800483CC) == 0)) { - sp20 = 1; bgSetDataPortalsControlBytes1Bit2(g_DebugPortalsD_800483CC); + sp20 = 1; } } else { if (joyGetButtonsPressedThisFrame(PLAYER_1, D_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, D_JPAD)) { - sp20 = 1; sub_GAME_7F0B9A7C(g_DebugPortalsD_800483CC); + sp20 = 1; } if (joyGetButtonsPressedThisFrame(PLAYER_1, U_JPAD) | joyGetButtonsPressedThisFrame(PLAYER_2, U_JPAD)) { - sp20 = 1; sub_GAME_7F0B9A2C(g_DebugPortalsD_800483CC); + sp20 = 1; } } @@ -1632,54 +663,54 @@ glabel lvlPortalDebug7F0BDF10 /* 0F2A58 7F0BDF28 8CA583CC */ lw $a1, %lo(g_DebugPortalsD_800483CC)($a1) /* 0F2A5C 7F0BDF2C 0FC2E779 */ jal bgDebugRemoved7F0B9DE4 /* 0F2A60 7F0BDF30 2406FFFF */ li $a2, -1 -/* 0F2A64 7F0BDF34 3C0E8005 */ lui $t6, %hi(g_DebugPortalsInputBuffer_1) -/* 0F2A68 7F0BDF38 8DCE83D4 */ lw $t6, %lo(g_DebugPortalsInputBuffer_1)($t6) -/* 0F2A6C 7F0BDF3C 3C0F8005 */ lui $t7, %hi(g_DebugPortalsInputBuffer_2) -/* 0F2A70 7F0BDF40 8DEF83D8 */ lw $t7, %lo(g_DebugPortalsInputBuffer_2)($t7) -/* 0F2A74 7F0BDF44 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer_0) -/* 0F2A78 7F0BDF48 3C188005 */ lui $t8, %hi(g_DebugPortalsInputBuffer_3) -/* 0F2A7C 7F0BDF4C AC2E83D0 */ sw $t6, %lo(g_DebugPortalsInputBuffer_0)($at) -/* 0F2A80 7F0BDF50 8F1883DC */ lw $t8, %lo(g_DebugPortalsInputBuffer_3)($t8) -/* 0F2A84 7F0BDF54 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer_1) -/* 0F2A88 7F0BDF58 AC2F83D4 */ sw $t7, %lo(g_DebugPortalsInputBuffer_1)($at) -/* 0F2A8C 7F0BDF5C 3C038005 */ lui $v1, %hi(g_DebugPortalsInputBuffer_4) -/* 0F2A90 7F0BDF60 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer_2) -/* 0F2A94 7F0BDF64 8C6383E0 */ lw $v1, %lo(g_DebugPortalsInputBuffer_4)($v1) -/* 0F2A98 7F0BDF68 AC3883D8 */ sw $t8, %lo(g_DebugPortalsInputBuffer_2)($at) -/* 0F2A9C 7F0BDF6C 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer_3) +/* 0F2A64 7F0BDF34 3C0E8005 */ lui $t6, %hi(g_DebugPortalsInputBuffer + 0x4) +/* 0F2A68 7F0BDF38 8DCE83D4 */ lw $t6, %lo(g_DebugPortalsInputBuffer + 0x4)($t6) +/* 0F2A6C 7F0BDF3C 3C0F8005 */ lui $t7, %hi(g_DebugPortalsInputBuffer + 0x8) +/* 0F2A70 7F0BDF40 8DEF83D8 */ lw $t7, %lo(g_DebugPortalsInputBuffer + 0x8)($t7) +/* 0F2A74 7F0BDF44 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer + 0x0) +/* 0F2A78 7F0BDF48 3C188005 */ lui $t8, %hi(g_DebugPortalsInputBuffer + 0xc) +/* 0F2A7C 7F0BDF4C AC2E83D0 */ sw $t6, %lo(g_DebugPortalsInputBuffer + 0x0)($at) +/* 0F2A80 7F0BDF50 8F1883DC */ lw $t8, %lo(g_DebugPortalsInputBuffer + 0xc)($t8) +/* 0F2A84 7F0BDF54 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer + 0x4) +/* 0F2A88 7F0BDF58 AC2F83D4 */ sw $t7, %lo(g_DebugPortalsInputBuffer + 0x4)($at) +/* 0F2A8C 7F0BDF5C 3C038005 */ lui $v1, %hi(g_DebugPortalsInputBuffer + 0x10) +/* 0F2A90 7F0BDF60 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer + 0x8) +/* 0F2A94 7F0BDF64 8C6383E0 */ lw $v1, %lo(g_DebugPortalsInputBuffer + 0x10)($v1) +/* 0F2A98 7F0BDF68 AC3883D8 */ sw $t8, %lo(g_DebugPortalsInputBuffer + 0x8)($at) +/* 0F2A9C 7F0BDF6C 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer + 0xc) /* 0F2AA0 7F0BDF70 AFA20028 */ sw $v0, 0x28($sp) /* 0F2AA4 7F0BDF74 00002025 */ move $a0, $zero /* 0F2AA8 7F0BDF78 34058000 */ li $a1, 32768 /* 0F2AAC 7F0BDF7C 0C0030C3 */ jal joyGetButtons -/* 0F2AB0 7F0BDF80 AC2383DC */ sw $v1, %lo(g_DebugPortalsInputBuffer_3)($at) +/* 0F2AB0 7F0BDF80 AC2383DC */ sw $v1, %lo(g_DebugPortalsInputBuffer + 0xc)($at) /* 0F2AB4 7F0BDF84 3050FFFF */ andi $s0, $v0, 0xffff /* 0F2AB8 7F0BDF88 24040001 */ li $a0, 1 /* 0F2ABC 7F0BDF8C 0C0030C3 */ jal joyGetButtons /* 0F2AC0 7F0BDF90 34058000 */ li $a1, 32768 -/* 0F2AC4 7F0BDF94 3C198005 */ lui $t9, %hi(g_DebugPortalsInputBuffer_3) -/* 0F2AC8 7F0BDF98 8F3983DC */ lw $t9, %lo(g_DebugPortalsInputBuffer_3)($t9) +/* 0F2AC4 7F0BDF94 3C198005 */ lui $t9, %hi(g_DebugPortalsInputBuffer + 0xc) +/* 0F2AC8 7F0BDF98 8F3983DC */ lw $t9, %lo(g_DebugPortalsInputBuffer + 0xc)($t9) /* 0F2ACC 7F0BDF9C 00501825 */ or $v1, $v0, $s0 -/* 0F2AD0 7F0BDFA0 3C0B8005 */ lui $t3, %hi(g_DebugPortalsInputBuffer_0) +/* 0F2AD0 7F0BDFA0 3C0B8005 */ lui $t3, %hi(g_DebugPortalsInputBuffer + 0x0) /* 0F2AD4 7F0BDFA4 13230006 */ beq $t9, $v1, .L7F0BDFC0 -/* 0F2AD8 7F0BDFA8 3C0C8005 */ lui $t4, %hi(g_DebugPortalsInputBuffer_1) +/* 0F2AD8 7F0BDFA8 3C0C8005 */ lui $t4, %hi(g_DebugPortalsInputBuffer + 0x4) /* 0F2ADC 7F0BDFAC 3C028005 */ lui $v0, %hi(D_800483C0) /* 0F2AE0 7F0BDFB0 244283C0 */ addiu $v0, %lo(D_800483C0) # addiu $v0, $v0, -0x7c40 /* 0F2AE4 7F0BDFB4 8C490000 */ lw $t1, ($v0) /* 0F2AE8 7F0BDFB8 392A0001 */ xori $t2, $t1, 1 /* 0F2AEC 7F0BDFBC AC4A0000 */ sw $t2, ($v0) .L7F0BDFC0: -/* 0F2AF0 7F0BDFC0 8D6B83D0 */ lw $t3, %lo(g_DebugPortalsInputBuffer_0)($t3) -/* 0F2AF4 7F0BDFC4 8D8C83D4 */ lw $t4, %lo(g_DebugPortalsInputBuffer_1)($t4) +/* 0F2AF0 7F0BDFC0 8D6B83D0 */ lw $t3, %lo(g_DebugPortalsInputBuffer + 0x0)($t3) +/* 0F2AF4 7F0BDFC4 8D8C83D4 */ lw $t4, %lo(g_DebugPortalsInputBuffer + 0x4)($t4) /* 0F2AF8 7F0BDFC8 3C028005 */ lui $v0, %hi(D_800483C0) /* 0F2AFC 7F0BDFCC 244283C0 */ addiu $v0, %lo(D_800483C0) # addiu $v0, $v0, -0x7c40 /* 0F2B00 7F0BDFD0 116C0004 */ beq $t3, $t4, .L7F0BDFE4 -/* 0F2B04 7F0BDFD4 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer_4) +/* 0F2B04 7F0BDFD4 3C018005 */ lui $at, %hi(g_DebugPortalsInputBuffer + 0x10) /* 0F2B08 7F0BDFD8 8C4E0000 */ lw $t6, ($v0) /* 0F2B0C 7F0BDFDC 39CF0001 */ xori $t7, $t6, 1 /* 0F2B10 7F0BDFE0 AC4F0000 */ sw $t7, ($v0) .L7F0BDFE4: /* 0F2B14 7F0BDFE4 10600004 */ beqz $v1, .L7F0BDFF8 -/* 0F2B18 7F0BDFE8 AC2383E0 */ sw $v1, %lo(g_DebugPortalsInputBuffer_4)($at) +/* 0F2B18 7F0BDFE8 AC2383E0 */ sw $v1, %lo(g_DebugPortalsInputBuffer + 0x10)($at) /* 0F2B1C 7F0BDFEC 3C048005 */ lui $a0, %hi(g_DebugPortalsD_800483CC) /* 0F2B20 7F0BDFF0 10000002 */ b .L7F0BDFFC /* 0F2B24 7F0BDFF4 8C8483CC */ lw $a0, %lo(g_DebugPortalsD_800483CC)($a0) @@ -1961,7 +992,7 @@ Gfx* lvlRender(Gfx* DL) sub_GAME_7F0B4884(); determing_type_of_object_and_detection(); chraiUpdateOnscreenPropCount(); - sub_GAME_7F03D78C(); + chrpropUpdateAutoaimTarget(); chraiCheckUseHeldItems(); if (bond_pressed_reload_activate() && bond_interact_object()) @@ -2095,8 +1126,8 @@ void lvlSetMultipliersForDifficulty(void) F_80030B14 = 2.0f; F_80030B18 = 2.0f; - F_80030B1C = (0.5f * damageMultiplier); - F_80030B20 = (0.5f * damageMultiplier); + g_AutogunPendingDamageTick = (0.5f * damageMultiplier); + g_AutogunDamageScalar = (0.5f * damageMultiplier); F_80030B24 = 2.0f; g_AiAccuracyModifier = DEFAULT_AGENT_AI_ACCURACY_MODIFIER; g_AiDamageModifier = (DEFAULT_AGENT_AI_DAMAGE_MODIFIER * damageMultiplier); @@ -2110,8 +1141,8 @@ void lvlSetMultipliersForDifficulty(void) { F_80030B14 = 1.0f; F_80030B18 = 1.0f; - F_80030B1C = 0.75f; - F_80030B20 = 0.75f; + g_AutogunPendingDamageTick = 0.75f; + g_AutogunDamageScalar = 0.75f; F_80030B24 = 1.0f; g_AiAccuracyModifier = DEFAULT_SECRET_AGENT_AI_ACCURACY_MODIFIER; g_AiDamageModifier = DEFAULT_SECRET_AGENT_AI_DAMAGE_MODIFIER; @@ -2139,8 +1170,8 @@ void lvlSetMultipliersForDifficulty(void) { F_80030B14 = 1.0f; F_80030B18 = 1.0f; - F_80030B1C = 1.0f; - F_80030B20 = 1.0f; + g_AutogunPendingDamageTick = 1.0f; + g_AutogunDamageScalar = 1.0f; F_80030B24 = 1.0f; g_AiAccuracyModifier = DEFAULT_00_AGENT_AI_ACCURACY_MODIFIER; g_AiDamageModifier = DEFAULT_00_AGENT_AI_DAMAGE_MODIFIER; @@ -2168,8 +1199,8 @@ void lvlSetMultipliersForDifficulty(void) { F_80030B14 = 1.0f; F_80030B18 = 1.0f; - F_80030B1C = 1.0f; - F_80030B20 = 1.0f; + g_AutogunPendingDamageTick = 1.0f; + g_AutogunDamageScalar = 1.0f; F_80030B24 = 1.0f; g_AiAccuracyModifier = DEFAULT_007_AI_ACCURACY_MODIFIER; g_AiDamageModifier = DEFAULT_007_AI_DAMAGE_MODIFIER; @@ -2502,7 +1533,7 @@ void lvlManageMpGame(void) { cheat_buttons_mp_related(); menu_init(); - something_with_LnameJ(); + langTick(); } else { @@ -2512,12 +1543,12 @@ void lvlManageMpGame(void) sub_GAME_7F092E50(); sub_GAME_7F094438(); update_bullet_sparks_and_dust_clouds(); - sub_GAME_7F068E6C(); + update_bullet_casings(); update_broken_windows(); update_gray_flying_particles(); handle_mp_respawn_and_some_things(); reset_all_music_slots(); - something_with_LnameJ(); + langTick(); if ((get_debug_joy2detailedit_flag() != 0) && (D_800483C8 == 0)) { @@ -3234,7 +2265,7 @@ glabel lvlManageMpGame /* 0F3E70 7F0BF340 00000000 */ nop /* 0F3E74 7F0BF344 0FC06987 */ jal menu_init /* 0F3E78 7F0BF348 00000000 */ nop -/* 0F3E7C 7F0BF34C 0FC30650 */ jal something_with_LnameJ +/* 0F3E7C 7F0BF34C 0FC30650 */ jal langTick /* 0F3E80 7F0BF350 00000000 */ nop /* 0F3E84 7F0BF354 100000A9 */ b .L7F0BF5FC /* 0F3E88 7F0BF358 00000000 */ nop @@ -3251,7 +2282,7 @@ glabel lvlManageMpGame /* 0F3EB0 7F0BF380 00000000 */ nop /* 0F3EB4 7F0BF384 0FC291FF */ jal update_bullet_sparks_and_dust_clouds /* 0F3EB8 7F0BF388 00000000 */ nop -/* 0F3EBC 7F0BF38C 0FC1A39B */ jal sub_GAME_7F068E6C +/* 0F3EBC 7F0BF38C 0FC1A39B */ jal update_bullet_casings /* 0F3EC0 7F0BF390 00000000 */ nop /* 0F3EC4 7F0BF394 0FC28A35 */ jal update_broken_windows /* 0F3EC8 7F0BF398 00000000 */ nop @@ -3261,7 +2292,7 @@ glabel lvlManageMpGame /* 0F3ED8 7F0BF3A8 00000000 */ nop /* 0F3EDC 7F0BF3AC 0FC304F2 */ jal reset_all_music_slots /* 0F3EE0 7F0BF3B0 00000000 */ nop -/* 0F3EE4 7F0BF3B4 0FC30650 */ jal something_with_LnameJ +/* 0F3EE4 7F0BF3B4 0FC30650 */ jal langTick /* 0F3EE8 7F0BF3B8 00000000 */ nop /* 0F3EEC 7F0BF3BC 0FC243EE */ jal get_debug_joy2detailedit_flag /* 0F3EF0 7F0BF3C0 00000000 */ nop @@ -4125,7 +3156,7 @@ glabel lvlManageMpGame /* 0F4AE8 7F0BFF78 00000000 */ nop /* 0F4AEC 7F0BFF7C 0FC069F4 */ jal menu_init /* 0F4AF0 7F0BFF80 00000000 */ nop -/* 0F4AF4 7F0BFF84 0FC3097C */ jal something_with_LnameJ +/* 0F4AF4 7F0BFF84 0FC3097C */ jal langTick /* 0F4AF8 7F0BFF88 00000000 */ nop /* 0F4AFC 7F0BFF8C 100000A9 */ b .Ljp7F0C0234 /* 0F4B00 7F0BFF90 00000000 */ nop @@ -4142,7 +3173,7 @@ glabel lvlManageMpGame /* 0F4B28 7F0BFFB8 00000000 */ nop /* 0F4B2C 7F0BFFBC 0FC294E7 */ jal update_bullet_sparks_and_dust_clouds /* 0F4B30 7F0BFFC0 00000000 */ nop -/* 0F4B34 7F0BFFC4 0FC1A516 */ jal sub_GAME_7F068E6C +/* 0F4B34 7F0BFFC4 0FC1A516 */ jal update_bullet_casings /* 0F4B38 7F0BFFC8 00000000 */ nop /* 0F4B3C 7F0BFFCC 0FC28D1D */ jal update_broken_windows /* 0F4B40 7F0BFFD0 00000000 */ nop @@ -4152,7 +3183,7 @@ glabel lvlManageMpGame /* 0F4B50 7F0BFFE0 00000000 */ nop /* 0F4B54 7F0BFFE4 0FC3081E */ jal reset_all_music_slots /* 0F4B58 7F0BFFE8 00000000 */ nop -/* 0F4B5C 7F0BFFEC 0FC3097C */ jal something_with_LnameJ +/* 0F4B5C 7F0BFFEC 0FC3097C */ jal langTick /* 0F4B60 7F0BFFF0 00000000 */ nop /* 0F4B64 7F0BFFF4 0FC246A6 */ jal get_debug_joy2detailedit_flag /* 0F4B68 7F0BFFF8 00000000 */ nop @@ -4456,6 +3487,19 @@ glabel lvlManageMpGame #ifdef VERSION_EU GLOBAL_ASM( +.rdata +#const char aSetdetailDDDDDDDDD[] = "setdetail %d %d %d %d %d %d %d %d %d"; +glabel aSetdetailDDDDDDDDD +.word 0x73657464 +.word 0x65746169 +.word 0x6c202564 +.word 0x20256420 +.word 0x25642025 +.word 0x64202564 +.word 0x20256420 +.word 0x25642025 +.word 0x64202564 +.word 0x00000000 .late_rodata glabel D_80050308 .word 0x3f99999a @@ -5009,7 +4053,7 @@ glabel lvlManageMpGame /* 0F1174 7F0BE784 00000000 */ nop /* 0F1178 7F0BE788 0FC06920 */ jal menu_init /* 0F117C 7F0BE78C 00000000 */ nop -/* 0F1180 7F0BE790 0FC30388 */ jal something_with_LnameJ +/* 0F1180 7F0BE790 0FC30388 */ jal langTick /* 0F1184 7F0BE794 00000000 */ nop /* 0F1188 7F0BE798 100000A9 */ b .L7F0BEA40 /* 0F118C 7F0BE79C 00000000 */ nop @@ -5026,7 +4070,7 @@ glabel lvlManageMpGame /* 0F11B4 7F0BE7C4 00000000 */ nop /* 0F11B8 7F0BE7C8 0FC28ECE */ jal sub_GAME_7F0A4600 /* 0F11BC 7F0BE7CC 00000000 */ nop -/* 0F11C0 7F0BE7D0 0FC1A580 */ jal sub_GAME_7F068E6C +/* 0F11C0 7F0BE7D0 0FC1A580 */ jal update_bullet_casings /* 0F11C4 7F0BE7D4 00000000 */ nop /* 0F11C8 7F0BE7D8 0FC28785 */ jal update_broken_windows /* 0F11CC 7F0BE7DC 00000000 */ nop @@ -5036,7 +4080,7 @@ glabel lvlManageMpGame /* 0F11DC 7F0BE7EC 00000000 */ nop /* 0F11E0 7F0BE7F0 0FC3022A */ jal reset_all_music_slots /* 0F11E4 7F0BE7F4 00000000 */ nop -/* 0F11E8 7F0BE7F8 0FC30388 */ jal something_with_LnameJ +/* 0F11E8 7F0BE7F8 0FC30388 */ jal langTick /* 0F11EC 7F0BE7FC 00000000 */ nop /* 0F11F0 7F0BE800 0FC24116 */ jal get_debug_joy2detailedit_flag /* 0F11F4 7F0BE804 00000000 */ nop @@ -5341,34 +4385,28 @@ glabel lvlManageMpGame #endif -#ifdef NONMATCHING /** - * Multiplayer related. Has some debug code which passes in controller input. + * Assumes a debug mode is present, and handles debug edit intro, debug stan edit, debug bond "view." + * By default, the DEB_BOND_VIEW path is chosen without debug info. + * This updates the player viewport(s), and handles player movement. * + * Multiplayer: * Updates distance_traveled and possibly (depending on scenario) have_token_or_goldengun. * - * Address 0x7F0BF800. - * - * decomp status: - * - compiles: yes - * - stack resize: ok - * - identical instructions: yes - * - identical registers: fail - * - * notes: only regalloc issues near the sqrtf call. + * US Address 0x7F0BF800. + * EU address 7F0BEC44. */ -void lvlUpdateMpPlayerData(void) +void lvlViewMoveTick(void) { s8 local_player_number; + s32 padding; f32 temp_f0; f32 temp_f2; - s32 temp_v0; local_player_number = get_cur_playernum(); cheat_buttons_mp_related(); - temp_v0 = get_debug_freeze_processing(); - switch (temp_v0) + switch (get_debug_freeze_processing()) { case 0: { @@ -5412,9 +4450,8 @@ void lvlUpdateMpPlayerData(void) break; } - // decomp issue: `g_CurrentPlayer->prop` and `g_CurrentPlayer` registers are swapped. - temp_f0 = g_CurrentPlayer->prop->position.x - g_CurrentPlayer->bondprevpos.x; - temp_f2 = g_CurrentPlayer->prop->position.z - g_CurrentPlayer->bondprevpos.z; + temp_f0 = g_CurrentPlayer->prop->pos.x - g_CurrentPlayer->bondprevpos.x; + temp_f2 = g_CurrentPlayer->prop->pos.z - g_CurrentPlayer->bondprevpos.z; g_playerPerm->distance_traveled += sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2)); @@ -5426,12 +4463,14 @@ void lvlUpdateMpPlayerData(void) { currentPlayerEquipWeaponWrapper(GUNRIGHT, ITEM_TOKEN); + if(1); + if (g_CurrentPlayer->hands[GUNRIGHT].when_detonating_mines_is_0 == 2) { g_CurrentPlayer->hands[GUNRIGHT].when_detonating_mines_is_0 = 5; } } - + g_playerPerm->flag_counter += g_ClockTimer; g_playerPerm->have_token_or_goldengun = 1; } @@ -5457,452 +4496,6 @@ void lvlUpdateMpPlayerData(void) return; } } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel lvlUpdateMpPlayerData -/* 0F4330 7F0BF800 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0F4334 7F0BF804 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F4338 7F0BF808 0FC26C54 */ jal get_cur_playernum -/* 0F433C 7F0BF80C 00000000 */ nop -/* 0F4340 7F0BF810 0FC2464F */ jal cheat_buttons_mp_related -/* 0F4344 7F0BF814 A3A2002F */ sb $v0, 0x2f($sp) -/* 0F4348 7F0BF818 0FC243C2 */ jal get_debug_freeze_processing -/* 0F434C 7F0BF81C 00000000 */ nop -/* 0F4350 7F0BF820 10400007 */ beqz $v0, .L7F0BF840 -/* 0F4354 7F0BF824 24010001 */ li $at, 1 -/* 0F4358 7F0BF828 1041002D */ beq $v0, $at, .L7F0BF8E0 -/* 0F435C 7F0BF82C 24010002 */ li $at, 2 -/* 0F4360 7F0BF830 1041004C */ beq $v0, $at, .L7F0BF964 -/* 0F4364 7F0BF834 00000000 */ nop -/* 0F4368 7F0BF838 1000006B */ b .L7F0BF9E8 -/* 0F436C 7F0BF83C 00000000 */ nop -.L7F0BF840: -/* 0F4370 7F0BF840 0FC243C5 */ jal getDebugMode -/* 0F4374 7F0BF844 00000000 */ nop -/* 0F4378 7F0BF848 10400009 */ beqz $v0, .L7F0BF870 -/* 0F437C 7F0BF84C 00000000 */ nop -/* 0F4380 7F0BF850 0FC243C5 */ jal getDebugMode -/* 0F4384 7F0BF854 00000000 */ nop -/* 0F4388 7F0BF858 2401003B */ li $at, 59 -/* 0F438C 7F0BF85C 14410013 */ bne $v0, $at, .L7F0BF8AC -/* 0F4390 7F0BF860 3C0E8003 */ lui $t6, %hi(D_80036ABC) -/* 0F4394 7F0BF864 8DCE6ABC */ lw $t6, %lo(D_80036ABC)($t6) -/* 0F4398 7F0BF868 05C10010 */ bgez $t6, .L7F0BF8AC -/* 0F439C 7F0BF86C 00000000 */ nop -.L7F0BF870: -/* 0F43A0 7F0BF870 0C00303B */ jal joyGetStickX -/* 0F43A4 7F0BF874 83A4002F */ lb $a0, 0x2f($sp) -/* 0F43A8 7F0BF878 A3A20018 */ sb $v0, 0x18($sp) -/* 0F43AC 7F0BF87C 0C00307F */ jal joyGetStickY -/* 0F43B0 7F0BF880 83A4002F */ lb $a0, 0x2f($sp) -/* 0F43B4 7F0BF884 A3A20019 */ sb $v0, 0x19($sp) -/* 0F43B8 7F0BF888 83A4002F */ lb $a0, 0x2f($sp) -/* 0F43BC 7F0BF88C 0C0030C3 */ jal joyGetButtons -/* 0F43C0 7F0BF890 3405FFFF */ li $a1, 65535 -/* 0F43C4 7F0BF894 83A40018 */ lb $a0, 0x18($sp) -/* 0F43C8 7F0BF898 83A50019 */ lb $a1, 0x19($sp) -/* 0F43CC 7F0BF89C 0FC24420 */ jal sub_GAME_7F091080 -/* 0F43D0 7F0BF8A0 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F43D4 7F0BF8A4 10000050 */ b .L7F0BF9E8 -/* 0F43D8 7F0BF8A8 00000000 */ nop -.L7F0BF8AC: -/* 0F43DC 7F0BF8AC 0C00303B */ jal joyGetStickX -/* 0F43E0 7F0BF8B0 83A4002F */ lb $a0, 0x2f($sp) -/* 0F43E4 7F0BF8B4 A3A20018 */ sb $v0, 0x18($sp) -/* 0F43E8 7F0BF8B8 0C00307F */ jal joyGetStickY -/* 0F43EC 7F0BF8BC 83A4002F */ lb $a0, 0x2f($sp) -/* 0F43F0 7F0BF8C0 00022E00 */ sll $a1, $v0, 0x18 -/* 0F43F4 7F0BF8C4 00057E03 */ sra $t7, $a1, 0x18 -/* 0F43F8 7F0BF8C8 01E02825 */ move $a1, $t7 -/* 0F43FC 7F0BF8CC 83A40018 */ lb $a0, 0x18($sp) -/* 0F4400 7F0BF8D0 0FC24420 */ jal sub_GAME_7F091080 -/* 0F4404 7F0BF8D4 00003025 */ move $a2, $zero -/* 0F4408 7F0BF8D8 10000043 */ b .L7F0BF9E8 -/* 0F440C 7F0BF8DC 00000000 */ nop -.L7F0BF8E0: -/* 0F4410 7F0BF8E0 0FC243C5 */ jal getDebugMode -/* 0F4414 7F0BF8E4 00000000 */ nop -/* 0F4418 7F0BF8E8 24010001 */ li $at, 1 -/* 0F441C 7F0BF8EC 14410010 */ bne $v0, $at, .L7F0BF930 -/* 0F4420 7F0BF8F0 00000000 */ nop -/* 0F4424 7F0BF8F4 0C00303B */ jal joyGetStickX -/* 0F4428 7F0BF8F8 83A4002F */ lb $a0, 0x2f($sp) -/* 0F442C 7F0BF8FC A3A20018 */ sb $v0, 0x18($sp) -/* 0F4430 7F0BF900 0C00307F */ jal joyGetStickY -/* 0F4434 7F0BF904 83A4002F */ lb $a0, 0x2f($sp) -/* 0F4438 7F0BF908 A3A20019 */ sb $v0, 0x19($sp) -/* 0F443C 7F0BF90C 83A4002F */ lb $a0, 0x2f($sp) -/* 0F4440 7F0BF910 0C0030C3 */ jal joyGetButtons -/* 0F4444 7F0BF914 3405FFFF */ li $a1, 65535 -/* 0F4448 7F0BF918 83A40018 */ lb $a0, 0x18($sp) -/* 0F444C 7F0BF91C 83A50019 */ lb $a1, 0x19($sp) -/* 0F4450 7F0BF920 0FC2CB4E */ jal sub_GAME_7F0B2D38 -/* 0F4454 7F0BF924 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F4458 7F0BF928 1000002F */ b .L7F0BF9E8 -/* 0F445C 7F0BF92C 00000000 */ nop -.L7F0BF930: -/* 0F4460 7F0BF930 0C00303B */ jal joyGetStickX -/* 0F4464 7F0BF934 83A4002F */ lb $a0, 0x2f($sp) -/* 0F4468 7F0BF938 A3A20018 */ sb $v0, 0x18($sp) -/* 0F446C 7F0BF93C 0C00307F */ jal joyGetStickY -/* 0F4470 7F0BF940 83A4002F */ lb $a0, 0x2f($sp) -/* 0F4474 7F0BF944 00022E00 */ sll $a1, $v0, 0x18 -/* 0F4478 7F0BF948 0005C603 */ sra $t8, $a1, 0x18 -/* 0F447C 7F0BF94C 03002825 */ move $a1, $t8 -/* 0F4480 7F0BF950 83A40018 */ lb $a0, 0x18($sp) -/* 0F4484 7F0BF954 0FC2CB4E */ jal sub_GAME_7F0B2D38 -/* 0F4488 7F0BF958 00003025 */ move $a2, $zero -/* 0F448C 7F0BF95C 10000022 */ b .L7F0BF9E8 -/* 0F4490 7F0BF960 00000000 */ nop -.L7F0BF964: -/* 0F4494 7F0BF964 0FC243C5 */ jal getDebugMode -/* 0F4498 7F0BF968 00000000 */ nop -/* 0F449C 7F0BF96C 24010002 */ li $at, 2 -/* 0F44A0 7F0BF970 14410010 */ bne $v0, $at, .L7F0BF9B4 -/* 0F44A4 7F0BF974 00000000 */ nop -/* 0F44A8 7F0BF978 0C00303B */ jal joyGetStickX -/* 0F44AC 7F0BF97C 83A4002F */ lb $a0, 0x2f($sp) -/* 0F44B0 7F0BF980 A3A20018 */ sb $v0, 0x18($sp) -/* 0F44B4 7F0BF984 0C00307F */ jal joyGetStickY -/* 0F44B8 7F0BF988 83A4002F */ lb $a0, 0x2f($sp) -/* 0F44BC 7F0BF98C A3A20019 */ sb $v0, 0x19($sp) -/* 0F44C0 7F0BF990 83A4002F */ lb $a0, 0x2f($sp) -/* 0F44C4 7F0BF994 0C0030C3 */ jal joyGetButtons -/* 0F44C8 7F0BF998 3405FFFF */ li $a1, 65535 -/* 0F44CC 7F0BF99C 83A40018 */ lb $a0, 0x18($sp) -/* 0F44D0 7F0BF9A0 83A50019 */ lb $a1, 0x19($sp) -/* 0F44D4 7F0BF9A4 0FC21BE7 */ jal bondviewMovePlayerUpdateViewport -/* 0F44D8 7F0BF9A8 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F44DC 7F0BF9AC 1000000C */ b .L7F0BF9E0 -/* 0F44E0 7F0BF9B0 00000000 */ nop -.L7F0BF9B4: -/* 0F44E4 7F0BF9B4 0C00303B */ jal joyGetStickX -/* 0F44E8 7F0BF9B8 83A4002F */ lb $a0, 0x2f($sp) -/* 0F44EC 7F0BF9BC A3A20018 */ sb $v0, 0x18($sp) -/* 0F44F0 7F0BF9C0 0C00307F */ jal joyGetStickY -/* 0F44F4 7F0BF9C4 83A4002F */ lb $a0, 0x2f($sp) -/* 0F44F8 7F0BF9C8 00022E00 */ sll $a1, $v0, 0x18 -/* 0F44FC 7F0BF9CC 0005CE03 */ sra $t9, $a1, 0x18 -/* 0F4500 7F0BF9D0 03202825 */ move $a1, $t9 -/* 0F4504 7F0BF9D4 83A40018 */ lb $a0, 0x18($sp) -/* 0F4508 7F0BF9D8 0FC21BE7 */ jal bondviewMovePlayerUpdateViewport -/* 0F450C 7F0BF9DC 00003025 */ move $a2, $zero -.L7F0BF9E0: -/* 0F4510 7F0BF9E0 0FC30BA0 */ jal sub_GAME_7F0C2E80 -/* 0F4514 7F0BF9E4 00000000 */ nop -.L7F0BF9E8: -/* 0F4518 7F0BF9E8 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0F451C 7F0BF9EC 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0F4520 7F0BF9F0 8C4300A8 */ lw $v1, 0xa8($v0) -/* 0F4524 7F0BF9F4 C4460408 */ lwc1 $f6, 0x408($v0) -/* 0F4528 7F0BF9F8 C44A0410 */ lwc1 $f10, 0x410($v0) -/* 0F452C 7F0BF9FC C4640008 */ lwc1 $f4, 8($v1) -/* 0F4530 7F0BFA00 C4680010 */ lwc1 $f8, 0x10($v1) -/* 0F4534 7F0BFA04 46062001 */ sub.s $f0, $f4, $f6 -/* 0F4538 7F0BFA08 460A4081 */ sub.s $f2, $f8, $f10 -/* 0F453C 7F0BFA0C 46000402 */ mul.s $f16, $f0, $f0 -/* 0F4540 7F0BFA10 00000000 */ nop -/* 0F4544 7F0BFA14 46021482 */ mul.s $f18, $f2, $f2 -/* 0F4548 7F0BFA18 0C007DF8 */ jal sqrtf -/* 0F454C 7F0BFA1C 46128300 */ add.s $f12, $f16, $f18 -/* 0F4550 7F0BFA20 3C028008 */ lui $v0, %hi(g_playerPerm) -/* 0F4554 7F0BFA24 8C42A0B4 */ lw $v0, %lo(g_playerPerm)($v0) -/* 0F4558 7F0BFA28 C4440038 */ lwc1 $f4, 0x38($v0) -/* 0F455C 7F0BFA2C 46002180 */ add.s $f6, $f4, $f0 -/* 0F4560 7F0BFA30 0FC051D6 */ jal get_scenario -/* 0F4564 7F0BFA34 E4460038 */ swc1 $f6, 0x38($v0) -/* 0F4568 7F0BFA38 24010002 */ li $at, 2 -/* 0F456C 7F0BFA3C 14410024 */ bne $v0, $at, .L7F0BFAD0 -/* 0F4570 7F0BFA40 00000000 */ nop -/* 0F4574 7F0BFA44 0FC233E0 */ jal bondinvIsAliveWithFlag -/* 0F4578 7F0BFA48 00000000 */ nop -/* 0F457C 7F0BFA4C 1040001C */ beqz $v0, .L7F0BFAC0 -/* 0F4580 7F0BFA50 00000000 */ nop -/* 0F4584 7F0BFA54 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0F4588 7F0BFA58 00002025 */ move $a0, $zero -/* 0F458C 7F0BFA5C 24010058 */ li $at, 88 -/* 0F4590 7F0BFA60 1041000B */ beq $v0, $at, .L7F0BFA90 -/* 0F4594 7F0BFA64 00002025 */ move $a0, $zero -/* 0F4598 7F0BFA68 0FC17645 */ jal currentPlayerEquipWeaponWrapper -/* 0F459C 7F0BFA6C 24050058 */ li $a1, 88 -/* 0F45A0 7F0BFA70 3C028008 */ lui $v0, %hi(g_CurrentPlayer) -/* 0F45A4 7F0BFA74 8C42A0B0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0F45A8 7F0BFA78 24010002 */ li $at, 2 -/* 0F45AC 7F0BFA7C 24090005 */ li $t1, 5 -/* 0F45B0 7F0BFA80 8C480894 */ lw $t0, 0x894($v0) -/* 0F45B4 7F0BFA84 15010002 */ bne $t0, $at, .L7F0BFA90 -/* 0F45B8 7F0BFA88 00000000 */ nop -/* 0F45BC 7F0BFA8C AC490894 */ sw $t1, 0x894($v0) -.L7F0BFA90: -/* 0F45C0 7F0BFA90 3C038008 */ lui $v1, %hi(g_playerPerm) -/* 0F45C4 7F0BFA94 2463A0B4 */ addiu $v1, %lo(g_playerPerm) # addiu $v1, $v1, -0x5f4c -/* 0F45C8 7F0BFA98 8C620000 */ lw $v0, ($v1) -/* 0F45CC 7F0BFA9C 3C0B8005 */ lui $t3, %hi(g_ClockTimer) -/* 0F45D0 7F0BFAA0 8D6B8374 */ lw $t3, %lo(g_ClockTimer)($t3) -/* 0F45D4 7F0BFAA4 8C4A0060 */ lw $t2, 0x60($v0) -/* 0F45D8 7F0BFAA8 240D0001 */ li $t5, 1 -/* 0F45DC 7F0BFAAC 014B6021 */ addu $t4, $t2, $t3 -/* 0F45E0 7F0BFAB0 AC4C0060 */ sw $t4, 0x60($v0) -/* 0F45E4 7F0BFAB4 8C6E0000 */ lw $t6, ($v1) -/* 0F45E8 7F0BFAB8 10000015 */ b .L7F0BFB10 -/* 0F45EC 7F0BFABC A1CD0069 */ sb $t5, 0x69($t6) -.L7F0BFAC0: -/* 0F45F0 7F0BFAC0 3C0F8008 */ lui $t7, %hi(g_playerPerm) -/* 0F45F4 7F0BFAC4 8DEFA0B4 */ lw $t7, %lo(g_playerPerm)($t7) -/* 0F45F8 7F0BFAC8 10000011 */ b .L7F0BFB10 -/* 0F45FC 7F0BFACC A1E00069 */ sb $zero, 0x69($t7) -.L7F0BFAD0: -/* 0F4600 7F0BFAD0 0FC051D6 */ jal get_scenario -/* 0F4604 7F0BFAD4 00000000 */ nop -/* 0F4608 7F0BFAD8 24010003 */ li $at, 3 -/* 0F460C 7F0BFADC 5441000D */ bnel $v0, $at, .L7F0BFB14 -/* 0F4610 7F0BFAE0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F4614 7F0BFAE4 0FC233F0 */ jal bondinvHasGoldenGun -/* 0F4618 7F0BFAE8 00000000 */ nop -/* 0F461C 7F0BFAEC 10400006 */ beqz $v0, .L7F0BFB08 -/* 0F4620 7F0BFAF0 3C088008 */ lui $t0, %hi(g_playerPerm) -/* 0F4624 7F0BFAF4 3C198008 */ lui $t9, %hi(g_playerPerm) -/* 0F4628 7F0BFAF8 8F39A0B4 */ lw $t9, %lo(g_playerPerm)($t9) -/* 0F462C 7F0BFAFC 24180001 */ li $t8, 1 -/* 0F4630 7F0BFB00 10000003 */ b .L7F0BFB10 -/* 0F4634 7F0BFB04 A3380069 */ sb $t8, 0x69($t9) -.L7F0BFB08: -/* 0F4638 7F0BFB08 8D08A0B4 */ lw $t0, %lo(g_playerPerm)($t0) -/* 0F463C 7F0BFB0C A1000069 */ sb $zero, 0x69($t0) -.L7F0BFB10: -/* 0F4640 7F0BFB10 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0BFB14: -/* 0F4644 7F0BFB14 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0F4648 7F0BFB18 03E00008 */ jr $ra -/* 0F464C 7F0BFB1C 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel lvlUpdateMpPlayerData -/* 0F1634 7F0BEC44 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0F1638 7F0BEC48 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F163C 7F0BEC4C 0FC269A4 */ jal get_cur_playernum -/* 0F1640 7F0BEC50 00000000 */ nop -/* 0F1644 7F0BEC54 0FC2436F */ jal cheat_buttons_mp_related -/* 0F1648 7F0BEC58 A3A2002F */ sb $v0, 0x2f($sp) -/* 0F164C 7F0BEC5C 0FC240FA */ jal get_debug_freeze_processing -/* 0F1650 7F0BEC60 00000000 */ nop -/* 0F1654 7F0BEC64 10400007 */ beqz $v0, .L7F0BEC84 -/* 0F1658 7F0BEC68 24010001 */ li $at, 1 -/* 0F165C 7F0BEC6C 1041002D */ beq $v0, $at, .L7F0BED24 -/* 0F1660 7F0BEC70 24010002 */ li $at, 2 -/* 0F1664 7F0BEC74 1041004C */ beq $v0, $at, .L7F0BEDA8 -/* 0F1668 7F0BEC78 00000000 */ nop -/* 0F166C 7F0BEC7C 1000006B */ b .L7F0BEE2C -/* 0F1670 7F0BEC80 00000000 */ nop -.L7F0BEC84: -/* 0F1674 7F0BEC84 0FC240FC */ jal getDebugMode -/* 0F1678 7F0BEC88 00000000 */ nop -/* 0F167C 7F0BEC8C 10400009 */ beqz $v0, .L7F0BECB4 -/* 0F1680 7F0BEC90 00000000 */ nop -/* 0F1684 7F0BEC94 0FC240FC */ jal getDebugMode -/* 0F1688 7F0BEC98 00000000 */ nop -/* 0F168C 7F0BEC9C 2401003B */ li $at, 59 -/* 0F1690 7F0BECA0 14410013 */ bne $v0, $at, .L7F0BECF0 -/* 0F1694 7F0BECA4 3C0E8003 */ lui $t6, %hi(D_80036ABC) # $t6, 0x8003 -/* 0F1698 7F0BECA8 8DCE2004 */ lw $t6, %lo(D_80036ABC)($t6) -/* 0F169C 7F0BECAC 05C10010 */ bgez $t6, .L7F0BECF0 -/* 0F16A0 7F0BECB0 00000000 */ nop -.L7F0BECB4: -/* 0F16A4 7F0BECB4 0C002B98 */ jal joyGetStickX -/* 0F16A8 7F0BECB8 83A4002F */ lb $a0, 0x2f($sp) -/* 0F16AC 7F0BECBC A3A20018 */ sb $v0, 0x18($sp) -/* 0F16B0 7F0BECC0 0C002BDC */ jal joyGetStickY -/* 0F16B4 7F0BECC4 83A4002F */ lb $a0, 0x2f($sp) -/* 0F16B8 7F0BECC8 A3A20019 */ sb $v0, 0x19($sp) -/* 0F16BC 7F0BECCC 83A4002F */ lb $a0, 0x2f($sp) -/* 0F16C0 7F0BECD0 0C002C20 */ jal joyGetButtons -/* 0F16C4 7F0BECD4 3405FFFF */ li $a1, 65535 -/* 0F16C8 7F0BECD8 83A40018 */ lb $a0, 0x18($sp) -/* 0F16CC 7F0BECDC 83A50019 */ lb $a1, 0x19($sp) -/* 0F16D0 7F0BECE0 0FC24140 */ jal sub_GAME_7F091080 -/* 0F16D4 7F0BECE4 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F16D8 7F0BECE8 10000050 */ b .L7F0BEE2C -/* 0F16DC 7F0BECEC 00000000 */ nop -.L7F0BECF0: -/* 0F16E0 7F0BECF0 0C002B98 */ jal joyGetStickX -/* 0F16E4 7F0BECF4 83A4002F */ lb $a0, 0x2f($sp) -/* 0F16E8 7F0BECF8 A3A20018 */ sb $v0, 0x18($sp) -/* 0F16EC 7F0BECFC 0C002BDC */ jal joyGetStickY -/* 0F16F0 7F0BED00 83A4002F */ lb $a0, 0x2f($sp) -/* 0F16F4 7F0BED04 00022E00 */ sll $a1, $v0, 0x18 -/* 0F16F8 7F0BED08 00057E03 */ sra $t7, $a1, 0x18 -/* 0F16FC 7F0BED0C 01E02825 */ move $a1, $t7 -/* 0F1700 7F0BED10 83A40018 */ lb $a0, 0x18($sp) -/* 0F1704 7F0BED14 0FC24140 */ jal sub_GAME_7F091080 -/* 0F1708 7F0BED18 00003025 */ move $a2, $zero -/* 0F170C 7F0BED1C 10000043 */ b .L7F0BEE2C -/* 0F1710 7F0BED20 00000000 */ nop -.L7F0BED24: -/* 0F1714 7F0BED24 0FC240FC */ jal getDebugMode -/* 0F1718 7F0BED28 00000000 */ nop -/* 0F171C 7F0BED2C 24010001 */ li $at, 1 -/* 0F1720 7F0BED30 14410010 */ bne $v0, $at, .L7F0BED74 -/* 0F1724 7F0BED34 00000000 */ nop -/* 0F1728 7F0BED38 0C002B98 */ jal joyGetStickX -/* 0F172C 7F0BED3C 83A4002F */ lb $a0, 0x2f($sp) -/* 0F1730 7F0BED40 A3A20018 */ sb $v0, 0x18($sp) -/* 0F1734 7F0BED44 0C002BDC */ jal joyGetStickY -/* 0F1738 7F0BED48 83A4002F */ lb $a0, 0x2f($sp) -/* 0F173C 7F0BED4C A3A20019 */ sb $v0, 0x19($sp) -/* 0F1740 7F0BED50 83A4002F */ lb $a0, 0x2f($sp) -/* 0F1744 7F0BED54 0C002C20 */ jal joyGetButtons -/* 0F1748 7F0BED58 3405FFFF */ li $a1, 65535 -/* 0F174C 7F0BED5C 83A40018 */ lb $a0, 0x18($sp) -/* 0F1750 7F0BED60 83A50019 */ lb $a1, 0x19($sp) -/* 0F1754 7F0BED64 0FC2C7FE */ jal sub_GAME_7F0B2D38 -/* 0F1758 7F0BED68 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F175C 7F0BED6C 1000002F */ b .L7F0BEE2C -/* 0F1760 7F0BED70 00000000 */ nop -.L7F0BED74: -/* 0F1764 7F0BED74 0C002B98 */ jal joyGetStickX -/* 0F1768 7F0BED78 83A4002F */ lb $a0, 0x2f($sp) -/* 0F176C 7F0BED7C A3A20018 */ sb $v0, 0x18($sp) -/* 0F1770 7F0BED80 0C002BDC */ jal joyGetStickY -/* 0F1774 7F0BED84 83A4002F */ lb $a0, 0x2f($sp) -/* 0F1778 7F0BED88 00022E00 */ sll $a1, $v0, 0x18 -/* 0F177C 7F0BED8C 0005C603 */ sra $t8, $a1, 0x18 -/* 0F1780 7F0BED90 03002825 */ move $a1, $t8 -/* 0F1784 7F0BED94 83A40018 */ lb $a0, 0x18($sp) -/* 0F1788 7F0BED98 0FC2C7FE */ jal sub_GAME_7F0B2D38 -/* 0F178C 7F0BED9C 00003025 */ move $a2, $zero -/* 0F1790 7F0BEDA0 10000022 */ b .L7F0BEE2C -/* 0F1794 7F0BEDA4 00000000 */ nop -.L7F0BEDA8: -/* 0F1798 7F0BEDA8 0FC240FC */ jal getDebugMode -/* 0F179C 7F0BEDAC 00000000 */ nop -/* 0F17A0 7F0BEDB0 24010002 */ li $at, 2 -/* 0F17A4 7F0BEDB4 14410010 */ bne $v0, $at, .L7F0BEDF8 -/* 0F17A8 7F0BEDB8 00000000 */ nop -/* 0F17AC 7F0BEDBC 0C002B98 */ jal joyGetStickX -/* 0F17B0 7F0BEDC0 83A4002F */ lb $a0, 0x2f($sp) -/* 0F17B4 7F0BEDC4 A3A20018 */ sb $v0, 0x18($sp) -/* 0F17B8 7F0BEDC8 0C002BDC */ jal joyGetStickY -/* 0F17BC 7F0BEDCC 83A4002F */ lb $a0, 0x2f($sp) -/* 0F17C0 7F0BEDD0 A3A20019 */ sb $v0, 0x19($sp) -/* 0F17C4 7F0BEDD4 83A4002F */ lb $a0, 0x2f($sp) -/* 0F17C8 7F0BEDD8 0C002C20 */ jal joyGetButtons -/* 0F17CC 7F0BEDDC 3405FFFF */ li $a1, 65535 -/* 0F17D0 7F0BEDE0 83A40018 */ lb $a0, 0x18($sp) -/* 0F17D4 7F0BEDE4 83A50019 */ lb $a1, 0x19($sp) -/* 0F17D8 7F0BEDE8 0FC21C2F */ jal bondviewMovePlayerUpdateViewport -/* 0F17DC 7F0BEDEC 3046FFFF */ andi $a2, $v0, 0xffff -/* 0F17E0 7F0BEDF0 1000000C */ b .L7F0BEE24 -/* 0F17E4 7F0BEDF4 00000000 */ nop -.L7F0BEDF8: -/* 0F17E8 7F0BEDF8 0C002B98 */ jal joyGetStickX -/* 0F17EC 7F0BEDFC 83A4002F */ lb $a0, 0x2f($sp) -/* 0F17F0 7F0BEE00 A3A20018 */ sb $v0, 0x18($sp) -/* 0F17F4 7F0BEE04 0C002BDC */ jal joyGetStickY -/* 0F17F8 7F0BEE08 83A4002F */ lb $a0, 0x2f($sp) -/* 0F17FC 7F0BEE0C 00022E00 */ sll $a1, $v0, 0x18 -/* 0F1800 7F0BEE10 0005CE03 */ sra $t9, $a1, 0x18 -/* 0F1804 7F0BEE14 03202825 */ move $a1, $t9 -/* 0F1808 7F0BEE18 83A40018 */ lb $a0, 0x18($sp) -/* 0F180C 7F0BEE1C 0FC21C2F */ jal bondviewMovePlayerUpdateViewport -/* 0F1810 7F0BEE20 00003025 */ move $a2, $zero -.L7F0BEE24: -/* 0F1814 7F0BEE24 0FC308D8 */ jal sub_GAME_7F0C2E80 -/* 0F1818 7F0BEE28 00000000 */ nop -.L7F0BEE2C: -/* 0F181C 7F0BEE2C 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0F1820 7F0BEE30 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0F1824 7F0BEE34 8C4300A8 */ lw $v1, 0xa8($v0) -/* 0F1828 7F0BEE38 C4460408 */ lwc1 $f6, 0x408($v0) -/* 0F182C 7F0BEE3C C44A0410 */ lwc1 $f10, 0x410($v0) -/* 0F1830 7F0BEE40 C4640008 */ lwc1 $f4, 8($v1) -/* 0F1834 7F0BEE44 C4680010 */ lwc1 $f8, 0x10($v1) -/* 0F1838 7F0BEE48 46062001 */ sub.s $f0, $f4, $f6 -/* 0F183C 7F0BEE4C 460A4081 */ sub.s $f2, $f8, $f10 -/* 0F1840 7F0BEE50 46000402 */ mul.s $f16, $f0, $f0 -/* 0F1844 7F0BEE54 00000000 */ nop -/* 0F1848 7F0BEE58 46021482 */ mul.s $f18, $f2, $f2 -/* 0F184C 7F0BEE5C 0C007614 */ jal sqrtf -/* 0F1850 7F0BEE60 46128300 */ add.s $f12, $f16, $f18 -/* 0F1854 7F0BEE64 3C028007 */ lui $v0, %hi(g_playerPerm) # $v0, 0x8007 -/* 0F1858 7F0BEE68 8C428BC4 */ lw $v0, %lo(g_playerPerm)($v0) -/* 0F185C 7F0BEE6C C4440038 */ lwc1 $f4, 0x38($v0) -/* 0F1860 7F0BEE70 46002180 */ add.s $f6, $f4, $f0 -/* 0F1864 7F0BEE74 0FC051B2 */ jal get_scenario -/* 0F1868 7F0BEE78 E4460038 */ swc1 $f6, 0x38($v0) -/* 0F186C 7F0BEE7C 24010002 */ li $at, 2 -/* 0F1870 7F0BEE80 14410024 */ bne $v0, $at, .L7F0BEF14 -/* 0F1874 7F0BEE84 00000000 */ nop -/* 0F1878 7F0BEE88 0FC234D9 */ jal bondinvIsAliveWithFlag -/* 0F187C 7F0BEE8C 00000000 */ nop -/* 0F1880 7F0BEE90 1040001C */ beqz $v0, .L7F0BEF04 -/* 0F1884 7F0BEE94 00000000 */ nop -/* 0F1888 7F0BEE98 0FC177A2 */ jal getCurrentPlayerWeaponId -/* 0F188C 7F0BEE9C 00002025 */ move $a0, $zero -/* 0F1890 7F0BEEA0 24010058 */ li $at, 88 -/* 0F1894 7F0BEEA4 1041000B */ beq $v0, $at, .L7F0BEED4 -/* 0F1898 7F0BEEA8 00002025 */ move $a0, $zero -/* 0F189C 7F0BEEAC 0FC17773 */ jal currentPlayerEquipWeaponWrapper -/* 0F18A0 7F0BEEB0 24050058 */ li $a1, 88 -/* 0F18A4 7F0BEEB4 3C028007 */ lui $v0, %hi(g_CurrentPlayer) # $v0, 0x8007 -/* 0F18A8 7F0BEEB8 8C428BC0 */ lw $v0, %lo(g_CurrentPlayer)($v0) -/* 0F18AC 7F0BEEBC 24010002 */ li $at, 2 -/* 0F18B0 7F0BEEC0 24090005 */ li $t1, 5 -/* 0F18B4 7F0BEEC4 8C48088C */ lw $t0, 0x88c($v0) -/* 0F18B8 7F0BEEC8 15010002 */ bne $t0, $at, .L7F0BEED4 -/* 0F18BC 7F0BEECC 00000000 */ nop -/* 0F18C0 7F0BEED0 AC49088C */ sw $t1, 0x88c($v0) -.L7F0BEED4: -/* 0F18C4 7F0BEED4 3C038007 */ lui $v1, %hi(g_playerPerm) # $v1, 0x8007 -/* 0F18C8 7F0BEED8 24638BC4 */ addiu $v1, %lo(g_playerPerm) # addiu $v1, $v1, -0x743c -/* 0F18CC 7F0BEEDC 8C620000 */ lw $v0, ($v1) -/* 0F18D0 7F0BEEE0 3C0B8004 */ lui $t3, %hi(g_ClockTimer) # $t3, 0x8004 -/* 0F18D4 7F0BEEE4 8D6B0FF4 */ lw $t3, %lo(g_ClockTimer)($t3) -/* 0F18D8 7F0BEEE8 8C4A0060 */ lw $t2, 0x60($v0) -/* 0F18DC 7F0BEEEC 240D0001 */ li $t5, 1 -/* 0F18E0 7F0BEEF0 014B6021 */ addu $t4, $t2, $t3 -/* 0F18E4 7F0BEEF4 AC4C0060 */ sw $t4, 0x60($v0) -/* 0F18E8 7F0BEEF8 8C6E0000 */ lw $t6, ($v1) -/* 0F18EC 7F0BEEFC 10000015 */ b .L7F0BEF54 -/* 0F18F0 7F0BEF00 A1CD0069 */ sb $t5, 0x69($t6) -.L7F0BEF04: -/* 0F18F4 7F0BEF04 3C0F8007 */ lui $t7, %hi(g_playerPerm) # $t7, 0x8007 -/* 0F18F8 7F0BEF08 8DEF8BC4 */ lw $t7, %lo(g_playerPerm)($t7) -/* 0F18FC 7F0BEF0C 10000011 */ b .L7F0BEF54 -/* 0F1900 7F0BEF10 A1E00069 */ sb $zero, 0x69($t7) -.L7F0BEF14: -/* 0F1904 7F0BEF14 0FC051B2 */ jal get_scenario -/* 0F1908 7F0BEF18 00000000 */ nop -/* 0F190C 7F0BEF1C 24010003 */ li $at, 3 -/* 0F1910 7F0BEF20 5441000D */ bnel $v0, $at, .L7F0BEF58 -/* 0F1914 7F0BEF24 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F1918 7F0BEF28 0FC234E9 */ jal bondinvHasGoldenGun -/* 0F191C 7F0BEF2C 00000000 */ nop -/* 0F1920 7F0BEF30 10400006 */ beqz $v0, .L7F0BEF4C -/* 0F1924 7F0BEF34 3C088007 */ lui $t0, %hi(g_playerPerm) # $t0, 0x8007 -/* 0F1928 7F0BEF38 3C198007 */ lui $t9, %hi(g_playerPerm) # $t9, 0x8007 -/* 0F192C 7F0BEF3C 8F398BC4 */ lw $t9, %lo(g_playerPerm)($t9) -/* 0F1930 7F0BEF40 24180001 */ li $t8, 1 -/* 0F1934 7F0BEF44 10000003 */ b .L7F0BEF54 -/* 0F1938 7F0BEF48 A3380069 */ sb $t8, 0x69($t9) -.L7F0BEF4C: -/* 0F193C 7F0BEF4C 8D088BC4 */ lw $t0, %lo(g_playerPerm)($t0) -/* 0F1940 7F0BEF50 A1000069 */ sb $zero, 0x69($t0) -.L7F0BEF54: -/* 0F1944 7F0BEF54 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0BEF58: -/* 0F1948 7F0BEF58 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0F194C 7F0BEF5C 03E00008 */ jr $ra -/* 0F1950 7F0BEF60 00000000 */ nop -) -#endif -#endif @@ -5920,8 +4513,8 @@ void lvlUnloadStageTextData(void) if (g_CurrentStageToLoad != LEVELID_TITLE) { - blank_text_bank(get_textbank_number_for_stagenum(g_CurrentStageToLoad)); - sub_GAME_7F007770(); + langClearBank(langGetLangBankIndexFromStagenum(g_CurrentStageToLoad)); + set_favorite_weapon_for_every_player(); } cheatDisableAllCheats(); @@ -5935,8 +4528,8 @@ void lvlUnloadStageTextData(void) cleanupObjectives(); cleanupSFXRelated(); cleanupplayersoundrelated(); - sub_GAME_7F0C1268(); - sub_GAME_7F0B47E0(); + set_missionstate_zero(); + cleanup_rooms(); } diff --git a/src/game/lvl.h b/src/game/lvl.h index 11ebac63..7a4ef228 100644 --- a/src/game/lvl.h +++ b/src/game/lvl.h @@ -23,11 +23,6 @@ #define DEFAULT_007_SOLO_AMMO_MULTIPLIER DEFAULT_00_AGENT_SOLO_AMMO_MULTIPLIER #define DEFAULT_007_AI_REACTION_SPEED DEFAULT_00_AGENT_AI_REACTION_SPEED -struct ramrom_struct { - u32 *address; - u32 locked; -}; - struct LvlMpUnknown { u8 unk_0; u8 unk_1; @@ -48,18 +43,18 @@ extern s32 dword_CODE_bss_8008C268; extern s32 dword_CODE_bss_8008C26C; extern char ramrom_data_target[0x380]; extern s32 record_slot_num; -extern s32 address_demo_loaded; +extern u8 * address_demo_loaded; extern s32 dword_CODE_bss_8008C5F8; #if defined(BUGFIX_R1) extern f32 g_JP_GlobalTimerDelta; #endif -void lvInitDebugNoticeList(void); +void lvInit(void); Gfx * lvlRender(Gfx *); void lvlSetSelectedDifficulty(DIFFICULTY arg0); void lvlManageMpGame(void); -void lvlUpdateMpPlayerData(void); +void lvlViewMoveTick(void); void lvlUnloadStageTextData(void); DIFFICULTY lvlGetSelectedDifficulty(void); void lvlStageLoad(s32 stage); diff --git a/src/game/lvl_text.c b/src/game/lvl_text.c index a58c52e3..605b9b46 100644 --- a/src/game/lvl_text.c +++ b/src/game/lvl_text.c @@ -2,15 +2,17 @@ #include #include #include "lvl_text.h" +#include "ob.h" // bss //CODE.bss:8008C640 -s32 ptr_text[45]; +s32 g_LangBanks[45]; + //CODE.bss:8008C6F4 -s32 ptr_char_data_buf; +struct jpncharpixels* g_JpnCharCachePixels; //CODE.bss:8008C6F8 -s32 ptr_char_registry; +struct jpncacheitem *g_JpnCacheCacheItems; #ifdef LANG_JP @@ -123,7 +125,7 @@ void *LnameX_lookuptable[45][2] = { {"LmiscP", "LmiscJ"}}; /* Cheat options */ #endif -LEVELID get_textbank_number_for_stagenum(LEVELID level) +LEVELID langGetLangBankIndexFromStagenum(LEVELID level) { LEVELID return_id; @@ -221,646 +223,146 @@ LEVELID get_textbank_number_for_stagenum(LEVELID level) } -#ifdef NONMATCHING -void init_LnameX(void) +void langInit(void) { + s32 i; -{ - undefined *puVar1; - u8 **ppuVar2; - int iVar3; - - if (j_text_trigger != 0) { - ptr_char_data_buf = mempAllocBytesInBank(0x2e80,'\x06'); - ptr_char_registry = mempAllocBytesInBank(0x100,'\x06'); - iVar3 = 0; - do { - ptr_char_registry[iVar3] = ptr_char_registry[iVar3] & 0x3f; - *(ushort *)(ptr_char_registry + iVar3) = *(ushort *)(ptr_char_registry + iVar3) | 0x3fff; - (ptr_char_registry + iVar3)[2] = (ptr_char_registry + iVar3)[2] & 0x3f; - *(ushort *)(ptr_char_registry + iVar3 + 2) = *(ushort *)(ptr_char_registry + iVar3 + 2) | 0x3fff; - (ptr_char_registry + iVar3)[4] = (ptr_char_registry + iVar3)[4] & 0x3f; - *(ushort *)(ptr_char_registry + iVar3 + 4) = *(ushort *)(ptr_char_registry + iVar3 + 4) | 0x3fff; - (ptr_char_registry + iVar3)[6] = (ptr_char_registry + iVar3)[6] & 0x3f; - puVar1 = ptr_char_registry + iVar3; - iVar3 += 8; - *(ushort *)(puVar1 + 6) = *(ushort *)(puVar1 + 6) | 0x3fff; - } while (iVar3 != 0xf8); + if (j_text_trigger) { + g_JpnCharCachePixels = mempAllocBytesInBank(0x2E80, MEMPOOL_PERMANENT); + g_JpnCacheCacheItems = mempAllocBytesInBank(0x100, MEMPOOL_PERMANENT); + for(i = 0;i != 124;i++) { + g_JpnCacheCacheItems[i].ttl =0; + g_JpnCacheCacheItems[i].codepoint =-1; + } } - ptr_text = 0; - ppuVar2 = (u8 **)ptr_text; - do { - ppuVar2 = ppuVar2 + 4; - ppuVar2[1] = NULL; - ppuVar2[2] = NULL; - ppuVar2[3] = NULL; - *ppuVar2 = NULL; - ppuVar2 = ppuVar2; - } while (ppuVar2 != &ptr_char_data_buf); - ptr_text[37] = _load_resource_named_to_membank((&ptr_LgunX)[j_text_trigger],1,0x100,6); - ptr_text[38] = _load_resource_named_to_membank((&ptr_LtitleX)[j_text_trigger],1,0x100,6); - ptr_text[39] = _load_resource_named_to_membank((&ptr_LmpmenuX)[j_text_trigger],1,0x100,6); - ptr_text[40] = _load_resource_named_to_membank((&ptr_LpropobjX)[j_text_trigger],1,0x100,6); - ptr_text[41] = _load_resource_named_to_membank((&ptr_LmpweaponsX)[j_text_trigger],1,0x100,6); - ptr_text[42] = _load_resource_named_to_membank((&ptr_LoptionsX)[j_text_trigger],1,0x100,6); - ptr_text[43] = _load_resource_named_to_membank((&ptr_LmiscX)[j_text_trigger],1,0x100,6); - return; + for (i = 0; i < 45; i++) { + g_LangBanks[i] = 0; + } + g_LangBanks[LGUN] = _fileNameLoadToBank(LnameX_lookuptable[LGUN][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LTITLE] = _fileNameLoadToBank(LnameX_lookuptable[LTITLE][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LMPMENU] = _fileNameLoadToBank(LnameX_lookuptable[LMPMENU][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LPROPOBJ] = _fileNameLoadToBank(LnameX_lookuptable[LPROPOBJ][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LMPWEAPONS] = _fileNameLoadToBank(LnameX_lookuptable[LMPWEAPONS][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LOPTIONS] = _fileNameLoadToBank(LnameX_lookuptable[LOPTIONS][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); + g_LangBanks[LMISC] = _fileNameLoadToBank(LnameX_lookuptable[LMISC][j_text_trigger], FILELOADMETHOD_DEFAULT, 0x100, MEMPOOL_PERMANENT); } -#else -GLOBAL_ASM( -.text -glabel init_LnameX -/* 0F621C 7F0C16EC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0F6220 7F0C16F0 AFB20020 */ sw $s2, 0x20($sp) -/* 0F6224 7F0C16F4 3C128005 */ lui $s2, %hi(j_text_trigger) -/* 0F6228 7F0C16F8 265284D0 */ addiu $s2, %lo(j_text_trigger) # addiu $s2, $s2, -0x7b30 -/* 0F622C 7F0C16FC 8E480000 */ lw $t0, ($s2) -/* 0F6230 7F0C1700 AFBF0024 */ sw $ra, 0x24($sp) -/* 0F6234 7F0C1704 AFB1001C */ sw $s1, 0x1c($sp) -/* 0F6238 7F0C1708 11000039 */ beqz $t0, .L7F0C17F0 -/* 0F623C 7F0C170C AFB00018 */ sw $s0, 0x18($sp) -/* 0F6240 7F0C1710 24042E80 */ li $a0, 11904 -/* 0F6244 7F0C1714 0C0025C8 */ jal mempAllocBytesInBank -/* 0F6248 7F0C1718 24050006 */ li $a1, 6 -/* 0F624C 7F0C171C 3C018009 */ lui $at, %hi(ptr_char_data_buf) -/* 0F6250 7F0C1720 AC22C6F4 */ sw $v0, %lo(ptr_char_data_buf)($at) -/* 0F6254 7F0C1724 24040100 */ li $a0, 256 -/* 0F6258 7F0C1728 0C0025C8 */ jal mempAllocBytesInBank -/* 0F625C 7F0C172C 24050006 */ li $a1, 6 -/* 0F6260 7F0C1730 3C048009 */ lui $a0, %hi(ptr_char_registry) -/* 0F6264 7F0C1734 2484C6F8 */ addiu $a0, %lo(ptr_char_registry) # addiu $a0, $a0, -0x3908 -/* 0F6268 7F0C1738 AC820000 */ sw $v0, ($a0) -/* 0F626C 7F0C173C 00001825 */ move $v1, $zero -/* 0F6270 7F0C1740 240500F8 */ li $a1, 248 -.L7F0C1744: -/* 0F6274 7F0C1744 8C8E0000 */ lw $t6, ($a0) -/* 0F6278 7F0C1748 01C31021 */ addu $v0, $t6, $v1 -/* 0F627C 7F0C174C 904F0000 */ lbu $t7, ($v0) -/* 0F6280 7F0C1750 31F8FF3F */ andi $t8, $t7, 0xff3f -/* 0F6284 7F0C1754 A0580000 */ sb $t8, ($v0) -/* 0F6288 7F0C1758 8C990000 */ lw $t9, ($a0) -/* 0F628C 7F0C175C 03231021 */ addu $v0, $t9, $v1 -/* 0F6290 7F0C1760 944A0000 */ lhu $t2, ($v0) -/* 0F6294 7F0C1764 354B3FFF */ ori $t3, $t2, 0x3fff -/* 0F6298 7F0C1768 A44B0000 */ sh $t3, ($v0) -/* 0F629C 7F0C176C 8C8C0000 */ lw $t4, ($a0) -/* 0F62A0 7F0C1770 01831021 */ addu $v0, $t4, $v1 -/* 0F62A4 7F0C1774 904D0002 */ lbu $t5, 2($v0) -/* 0F62A8 7F0C1778 31AEFF3F */ andi $t6, $t5, 0xff3f -/* 0F62AC 7F0C177C A04E0002 */ sb $t6, 2($v0) -/* 0F62B0 7F0C1780 8C8F0000 */ lw $t7, ($a0) -/* 0F62B4 7F0C1784 01E31021 */ addu $v0, $t7, $v1 -/* 0F62B8 7F0C1788 94590002 */ lhu $t9, 2($v0) -/* 0F62BC 7F0C178C 37293FFF */ ori $t1, $t9, 0x3fff -/* 0F62C0 7F0C1790 A4490002 */ sh $t1, 2($v0) -/* 0F62C4 7F0C1794 8C8A0000 */ lw $t2, ($a0) -/* 0F62C8 7F0C1798 01431021 */ addu $v0, $t2, $v1 -/* 0F62CC 7F0C179C 904B0004 */ lbu $t3, 4($v0) -/* 0F62D0 7F0C17A0 316CFF3F */ andi $t4, $t3, 0xff3f -/* 0F62D4 7F0C17A4 A04C0004 */ sb $t4, 4($v0) -/* 0F62D8 7F0C17A8 8C8D0000 */ lw $t5, ($a0) -/* 0F62DC 7F0C17AC 01A31021 */ addu $v0, $t5, $v1 -/* 0F62E0 7F0C17B0 944F0004 */ lhu $t7, 4($v0) -/* 0F62E4 7F0C17B4 35F83FFF */ ori $t8, $t7, 0x3fff -/* 0F62E8 7F0C17B8 A4580004 */ sh $t8, 4($v0) -/* 0F62EC 7F0C17BC 8C990000 */ lw $t9, ($a0) -/* 0F62F0 7F0C17C0 03231021 */ addu $v0, $t9, $v1 -/* 0F62F4 7F0C17C4 90490006 */ lbu $t1, 6($v0) -/* 0F62F8 7F0C17C8 312AFF3F */ andi $t2, $t1, 0xff3f -/* 0F62FC 7F0C17CC A04A0006 */ sb $t2, 6($v0) -/* 0F6300 7F0C17D0 8C8B0000 */ lw $t3, ($a0) -/* 0F6304 7F0C17D4 01631021 */ addu $v0, $t3, $v1 -/* 0F6308 7F0C17D8 944D0006 */ lhu $t5, 6($v0) -/* 0F630C 7F0C17DC 24630008 */ addiu $v1, $v1, 8 -/* 0F6310 7F0C17E0 35AE3FFF */ ori $t6, $t5, 0x3fff -/* 0F6314 7F0C17E4 1465FFD7 */ bne $v1, $a1, .L7F0C1744 -/* 0F6318 7F0C17E8 A44E0006 */ sh $t6, 6($v0) -/* 0F631C 7F0C17EC 8E480000 */ lw $t0, ($s2) -.L7F0C17F0: -/* 0F6320 7F0C17F0 3C018009 */ lui $at, %hi(ptr_text) -/* 0F6324 7F0C17F4 3C028009 */ lui $v0, %hi(ptr_text+0x4) -/* 0F6328 7F0C17F8 3C038009 */ lui $v1, %hi(ptr_char_data_buf) -/* 0F632C 7F0C17FC 2463C6F4 */ addiu $v1, %lo(ptr_char_data_buf) # addiu $v1, $v1, -0x390c -/* 0F6330 7F0C1800 2442C644 */ addiu $v0, %lo(ptr_text+0x4) # addiu $v0, $v0, -0x39bc -/* 0F6334 7F0C1804 AC20C640 */ sw $zero, %lo(ptr_text)($at) -.L7F0C1808: -/* 0F6338 7F0C1808 24420010 */ addiu $v0, $v0, 0x10 -/* 0F633C 7F0C180C AC40FFF4 */ sw $zero, -0xc($v0) -/* 0F6340 7F0C1810 AC40FFF8 */ sw $zero, -8($v0) -/* 0F6344 7F0C1814 AC40FFFC */ sw $zero, -4($v0) -/* 0F6348 7F0C1818 1443FFFB */ bne $v0, $v1, .L7F0C1808 -/* 0F634C 7F0C181C AC40FFF0 */ sw $zero, -0x10($v0) -/* 0F6350 7F0C1820 3C108005 */ lui $s0, %hi(LnameX_lookuptable) -/* 0F6354 7F0C1824 261084D4 */ addiu $s0, %lo(LnameX_lookuptable) # addiu $s0, $s0, -0x7b2c -/* 0F6358 7F0C1828 00087880 */ sll $t7, $t0, 2 -/* 0F635C 7F0C182C 020FC021 */ addu $t8, $s0, $t7 -/* 0F6360 7F0C1830 8F040130 */ lw $a0, 0x130($t8) -/* 0F6364 7F0C1834 24050001 */ li $a1, 1 -/* 0F6368 7F0C1838 24060100 */ li $a2, 256 -/* 0F636C 7F0C183C 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F6370 7F0C1840 24070006 */ li $a3, 6 -/* 0F6374 7F0C1844 8E590000 */ lw $t9, ($s2) -/* 0F6378 7F0C1848 3C118009 */ lui $s1, %hi(ptr_text) -/* 0F637C 7F0C184C 2631C640 */ addiu $s1, %lo(ptr_text) # addiu $s1, $s1, -0x39c0 -/* 0F6380 7F0C1850 00194880 */ sll $t1, $t9, 2 -/* 0F6384 7F0C1854 02095021 */ addu $t2, $s0, $t1 -/* 0F6388 7F0C1858 AE220098 */ sw $v0, 0x98($s1) -/* 0F638C 7F0C185C 8D440138 */ lw $a0, 0x138($t2) -/* 0F6390 7F0C1860 24050001 */ li $a1, 1 -/* 0F6394 7F0C1864 24060100 */ li $a2, 256 -/* 0F6398 7F0C1868 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F639C 7F0C186C 24070006 */ li $a3, 6 -/* 0F63A0 7F0C1870 8E4B0000 */ lw $t3, ($s2) -/* 0F63A4 7F0C1874 AE22009C */ sw $v0, 0x9c($s1) -/* 0F63A8 7F0C1878 24050001 */ li $a1, 1 -/* 0F63AC 7F0C187C 000B6080 */ sll $t4, $t3, 2 -/* 0F63B0 7F0C1880 020C6821 */ addu $t5, $s0, $t4 -/* 0F63B4 7F0C1884 8DA40140 */ lw $a0, 0x140($t5) -/* 0F63B8 7F0C1888 24060100 */ li $a2, 256 -/* 0F63BC 7F0C188C 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F63C0 7F0C1890 24070006 */ li $a3, 6 -/* 0F63C4 7F0C1894 8E4E0000 */ lw $t6, ($s2) -/* 0F63C8 7F0C1898 AE2200A0 */ sw $v0, 0xa0($s1) -/* 0F63CC 7F0C189C 24050001 */ li $a1, 1 -/* 0F63D0 7F0C18A0 000E7880 */ sll $t7, $t6, 2 -/* 0F63D4 7F0C18A4 020FC021 */ addu $t8, $s0, $t7 -/* 0F63D8 7F0C18A8 8F040148 */ lw $a0, 0x148($t8) -/* 0F63DC 7F0C18AC 24060100 */ li $a2, 256 -/* 0F63E0 7F0C18B0 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F63E4 7F0C18B4 24070006 */ li $a3, 6 -/* 0F63E8 7F0C18B8 8E590000 */ lw $t9, ($s2) -/* 0F63EC 7F0C18BC AE2200A4 */ sw $v0, 0xa4($s1) -/* 0F63F0 7F0C18C0 24050001 */ li $a1, 1 -/* 0F63F4 7F0C18C4 00194880 */ sll $t1, $t9, 2 -/* 0F63F8 7F0C18C8 02095021 */ addu $t2, $s0, $t1 -/* 0F63FC 7F0C18CC 8D440150 */ lw $a0, 0x150($t2) -/* 0F6400 7F0C18D0 24060100 */ li $a2, 256 -/* 0F6404 7F0C18D4 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F6408 7F0C18D8 24070006 */ li $a3, 6 -/* 0F640C 7F0C18DC 8E4B0000 */ lw $t3, ($s2) -/* 0F6410 7F0C18E0 AE2200A8 */ sw $v0, 0xa8($s1) -/* 0F6414 7F0C18E4 24050001 */ li $a1, 1 -/* 0F6418 7F0C18E8 000B6080 */ sll $t4, $t3, 2 -/* 0F641C 7F0C18EC 020C6821 */ addu $t5, $s0, $t4 -/* 0F6420 7F0C18F0 8DA40158 */ lw $a0, 0x158($t5) -/* 0F6424 7F0C18F4 24060100 */ li $a2, 256 -/* 0F6428 7F0C18F8 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F642C 7F0C18FC 24070006 */ li $a3, 6 -/* 0F6430 7F0C1900 8E4E0000 */ lw $t6, ($s2) -/* 0F6434 7F0C1904 AE2200AC */ sw $v0, 0xac($s1) -/* 0F6438 7F0C1908 24050001 */ li $a1, 1 -/* 0F643C 7F0C190C 000E7880 */ sll $t7, $t6, 2 -/* 0F6440 7F0C1910 020FC021 */ addu $t8, $s0, $t7 -/* 0F6444 7F0C1914 8F040160 */ lw $a0, 0x160($t8) -/* 0F6448 7F0C1918 24060100 */ li $a2, 256 -/* 0F644C 7F0C191C 0FC2F341 */ jal _load_resource_named_to_membank -/* 0F6450 7F0C1920 24070006 */ li $a3, 6 -/* 0F6454 7F0C1924 8FBF0024 */ lw $ra, 0x24($sp) -/* 0F6458 7F0C1928 AE2200B0 */ sw $v0, 0xb0($s1) -/* 0F645C 7F0C192C 8FB1001C */ lw $s1, 0x1c($sp) -/* 0F6460 7F0C1930 8FB00018 */ lw $s0, 0x18($sp) -/* 0F6464 7F0C1934 8FB20020 */ lw $s2, 0x20($sp) -/* 0F6468 7F0C1938 03E00008 */ jr $ra -/* 0F646C 7F0C193C 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif +void langTick(void) { + s32 i; - -#ifdef NONMATCHING -void something_with_LnameJ(void) -{ - ushort uVar1; - ushort *puVar2; - int iVar3; - - iVar3 = 0; - if (j_text_trigger != 0) { - do { - puVar2 = (ushort *)(ptr_char_registry + iVar3); - if (*puVar2 >> 0xe == 0) { - uVar1 = puVar2[1]; - } - else { - *(byte *)puVar2 = ((byte)(*puVar2 >> 0xe) - 1) * '@' | *(byte *)puVar2 & 0x3f; - puVar2 = (ushort *)(ptr_char_registry + iVar3); - uVar1 = puVar2[1]; - } - if (uVar1 >> 0xe == 0) { - uVar1 = puVar2[2]; - } - else { - *(byte *)(puVar2 + 1) = - ((byte)(uVar1 >> 0xe) - 1) * '@' | *(byte *)(puVar2 + 1) & 0x3f; - puVar2 = (ushort *)(ptr_char_registry + iVar3); - uVar1 = puVar2[2]; - } - if (uVar1 >> 0xe == 0) { - uVar1 = puVar2[3]; - } - else { - *(byte *)(puVar2 + 2) = - ((byte)(uVar1 >> 0xe) - 1) * '@' | *(byte *)(puVar2 + 2) & 0x3f; - puVar2 = (ushort *)(ptr_char_registry + iVar3); - uVar1 = puVar2[3]; - } - iVar3 += 8; - if (uVar1 >> 0xe != 0) { - *(byte *)(puVar2 + 3) = - ((byte)(uVar1 >> 0xe) - 1) * '@' | *(byte *)(puVar2 + 3) & 0x3f; - } - } while (iVar3 != 0xf8); + if (j_text_trigger) { + for (i = 0; i < 0x7c; i++) { + if (g_JpnCacheCacheItems[i].ttl) { + g_JpnCacheCacheItems[i].ttl--; + } + } } - return; } -#else -GLOBAL_ASM( -.text -glabel something_with_LnameJ -/* 0F6470 7F0C1940 3C0E8005 */ lui $t6, %hi(j_text_trigger) -/* 0F6474 7F0C1944 8DCE84D0 */ lw $t6, %lo(j_text_trigger)($t6) -/* 0F6478 7F0C1948 00001825 */ move $v1, $zero -/* 0F647C 7F0C194C 240600F8 */ li $a2, 248 -/* 0F6480 7F0C1950 11C00035 */ beqz $t6, .L7F0C1A28 -/* 0F6484 7F0C1954 3C058009 */ lui $a1, %hi(ptr_char_registry) -/* 0F6488 7F0C1958 24A5C6F8 */ addiu $a1, %lo(ptr_char_registry) # addiu $a1, $a1, -0x3908 -/* 0F648C 7F0C195C 8CAF0000 */ lw $t7, ($a1) -.L7F0C1960: -/* 0F6490 7F0C1960 01E31021 */ addu $v0, $t7, $v1 -/* 0F6494 7F0C1964 94440000 */ lhu $a0, ($v0) -/* 0F6498 7F0C1968 0004C382 */ srl $t8, $a0, 0xe -/* 0F649C 7F0C196C 5300000A */ beql $t8, $zero, .L7F0C1998 -/* 0F64A0 7F0C1970 94440002 */ lhu $a0, 2($v0) -/* 0F64A4 7F0C1974 904A0000 */ lbu $t2, ($v0) -/* 0F64A8 7F0C1978 2719FFFF */ addiu $t9, $t8, -1 -/* 0F64AC 7F0C197C 00194980 */ sll $t1, $t9, 6 -/* 0F64B0 7F0C1980 314BFF3F */ andi $t3, $t2, 0xff3f -/* 0F64B4 7F0C1984 012B6025 */ or $t4, $t1, $t3 -/* 0F64B8 7F0C1988 A04C0000 */ sb $t4, ($v0) -/* 0F64BC 7F0C198C 8CAD0000 */ lw $t5, ($a1) -/* 0F64C0 7F0C1990 01A31021 */ addu $v0, $t5, $v1 -/* 0F64C4 7F0C1994 94440002 */ lhu $a0, 2($v0) -.L7F0C1998: -/* 0F64C8 7F0C1998 00047382 */ srl $t6, $a0, 0xe -/* 0F64CC 7F0C199C 51C0000A */ beql $t6, $zero, .L7F0C19C8 -/* 0F64D0 7F0C19A0 94440004 */ lhu $a0, 4($v0) -/* 0F64D4 7F0C19A4 90480002 */ lbu $t0, 2($v0) -/* 0F64D8 7F0C19A8 25CFFFFF */ addiu $t7, $t6, -1 -/* 0F64DC 7F0C19AC 000FC980 */ sll $t9, $t7, 6 -/* 0F64E0 7F0C19B0 310AFF3F */ andi $t2, $t0, 0xff3f -/* 0F64E4 7F0C19B4 032A4825 */ or $t1, $t9, $t2 -/* 0F64E8 7F0C19B8 A0490002 */ sb $t1, 2($v0) -/* 0F64EC 7F0C19BC 8CAB0000 */ lw $t3, ($a1) -/* 0F64F0 7F0C19C0 01631021 */ addu $v0, $t3, $v1 -/* 0F64F4 7F0C19C4 94440004 */ lhu $a0, 4($v0) -.L7F0C19C8: -/* 0F64F8 7F0C19C8 00046382 */ srl $t4, $a0, 0xe -/* 0F64FC 7F0C19CC 5180000A */ beql $t4, $zero, .L7F0C19F8 -/* 0F6500 7F0C19D0 94440006 */ lhu $a0, 6($v0) -/* 0F6504 7F0C19D4 90580004 */ lbu $t8, 4($v0) -/* 0F6508 7F0C19D8 258DFFFF */ addiu $t5, $t4, -1 -/* 0F650C 7F0C19DC 000D7980 */ sll $t7, $t5, 6 -/* 0F6510 7F0C19E0 3308FF3F */ andi $t0, $t8, 0xff3f -/* 0F6514 7F0C19E4 01E8C825 */ or $t9, $t7, $t0 -/* 0F6518 7F0C19E8 A0590004 */ sb $t9, 4($v0) -/* 0F651C 7F0C19EC 8CAA0000 */ lw $t2, ($a1) -/* 0F6520 7F0C19F0 01431021 */ addu $v0, $t2, $v1 -/* 0F6524 7F0C19F4 94440006 */ lhu $a0, 6($v0) -.L7F0C19F8: -/* 0F6528 7F0C19F8 24630008 */ addiu $v1, $v1, 8 -/* 0F652C 7F0C19FC 00044B82 */ srl $t1, $a0, 0xe -/* 0F6530 7F0C1A00 11200007 */ beqz $t1, .L7F0C1A20 -/* 0F6534 7F0C1A04 00000000 */ nop -/* 0F6538 7F0C1A08 904E0006 */ lbu $t6, 6($v0) -/* 0F653C 7F0C1A0C 252BFFFF */ addiu $t3, $t1, -1 -/* 0F6540 7F0C1A10 000B6980 */ sll $t5, $t3, 6 -/* 0F6544 7F0C1A14 31D8FF3F */ andi $t8, $t6, 0xff3f -/* 0F6548 7F0C1A18 01B87825 */ or $t7, $t5, $t8 -/* 0F654C 7F0C1A1C A04F0006 */ sb $t7, 6($v0) -.L7F0C1A20: -/* 0F6550 7F0C1A20 5466FFCF */ bnel $v1, $a2, .L7F0C1960 -/* 0F6554 7F0C1A24 8CAF0000 */ lw $t7, ($a1) -.L7F0C1A28: -/* 0F6558 7F0C1A28 03E00008 */ jr $ra -/* 0F655C 7F0C1A2C 00000000 */ nop -) -#endif +extern u8 _efontchardataSegmentRomStart; +extern u8 _jfontchardataSegmentRomStart; +void romCopy(void *target, void *source, u32 size); + +struct jpncharpixels *langGetJpnCharPixels(s32 codepoint) +{ + s32 i; + s32 freeindexsingle = -1; + s32 freeindexmulti = -1; + s32 multibyte = 0; + if (codepoint & 0x2000) { + multibyte = 1; + } -#ifdef NONMATCHING -int something_with_LnameX(uint param_1) -{ - bool bVar1; - ushort uVar3; - u8 *puVar2; - int iVar4; - ushort *puVar5; - int iVar6; - int iVar7; - int indexto; - int iVar8; - int iVar9; - int indexfrom; - - indexto = -1; - bVar1 = (param_1 & 0x2000) != 0; - iVar7 = 0; - iVar4 = 0; - iVar9 = -1; - puVar5 = (ushort *)ptr_char_registry; - do { - indexfrom = (int)param_1 >> 1; - if ((!bVar1) && ((longlong)indexfrom == ((ulonglong)*puVar5 & 0x3fff))) break; - if ((bVar1) && - (((iVar4 + 1 < 0x7c && ((longlong)indexfrom == ((ulonglong)*puVar5 & 0x3fff))) && - ((longlong)indexfrom == ((ulonglong)puVar5[1] & 0x3fff))))) break; - uVar3 = *puVar5 >> 0xe; - iVar6 = iVar4 + 1; - if (uVar3 == 0) { - indexto = iVar4; - } - iVar7 += 2; - iVar8 = iVar9; - if (((uVar3 == 0) && (puVar5[1] >> 0xe == 0)) && (iVar8 = iVar4, 0x7b < iVar6)) { - iVar8 = iVar9; - } - puVar5 = puVar5 + 1; - iVar4 = iVar6; - iVar9 = iVar8; - } while (iVar6 != 0x7c); - if (iVar4 < 0x7c) { - if (bVar1) { - *(byte *)puVar5 = *(byte *)puVar5 & 0x3f | 0x80; - (ptr_char_registry + iVar7)[2] = (ptr_char_registry + iVar7)[2] & 0x3f | 0x80; - puVar2 = ptr_char_data_buf + iVar4 * 0x60; - } - else { - *(byte *)puVar5 = *(byte *)puVar5 & 0x3f | 0x80; - puVar2 = ptr_char_data_buf + iVar4 * 0x60; - } - } - else { - if ((bVar1) || (indexto < 0)) { - puVar2 = ptr_char_data_buf; - if ((bVar1) && (iVar4 = iVar9 * 2, -1 < iVar9)) { - ptr_char_registry[iVar4] = ptr_char_registry[iVar4] & 0x3f | 0x80; - (ptr_char_registry + iVar4)[2] = (ptr_char_registry + iVar4)[2] & 0x3f | 0x80; - uVar3 = (ushort)indexfrom & 0x3fff; - *(ushort *)(ptr_char_registry + iVar4) = - uVar3 | *(ushort *)(ptr_char_registry + iVar4) & 0xc000; - *(ushort *)(ptr_char_registry + iVar4 + 2) = - uVar3 | *(ushort *)(ptr_char_registry + iVar4 + 2) & 0xc000; - romCopy((char *)(ptr_char_data_buf + iVar9 * 0x60), - (char *)(_efontchardataSegmentRomStart + ((int)(param_1 & 0x1fff) >> 1) * 0x20), - 0x80); - puVar2 = ptr_char_data_buf + iVar9 * 0x60; - } - } - else { - ptr_char_registry[indexto * 2] = ptr_char_registry[indexto * 2] & 0x3f | 0x80; - *(ushort *)(ptr_char_registry + indexto * 2) = - (ushort)indexfrom & 0x3fff | *(ushort *)(ptr_char_registry + indexto * 2) & 0xc000; - romCopy((char *)(ptr_char_data_buf + indexto * 0x60), - (char *)(_jfontchardataSegmentRomStart + indexfrom * 0x18),0x60); - puVar2 = ptr_char_data_buf + indexto * 0x60; - } - } - return (int)puVar2; + +#define SHIFTAMOUNT 1 +#define TMUL 8 + + for (i = 0; i < 0x7C; i++) { + if (!multibyte && (codepoint >> SHIFTAMOUNT) == g_JpnCacheCacheItems[i].codepoint) { + break; + } + + if (multibyte && i + 1 < 0x7C + && (codepoint >> SHIFTAMOUNT) == g_JpnCacheCacheItems[i].codepoint + && (codepoint >> SHIFTAMOUNT) == g_JpnCacheCacheItems[i + 1].codepoint) { + break; + } + + if (g_JpnCacheCacheItems[i].ttl == 0) { + freeindexsingle = i; + } + + if (g_JpnCacheCacheItems[i].ttl == 0 && g_JpnCacheCacheItems[i + 1].ttl == 0 && i + 1 < 0x7C) { + freeindexmulti = i; + } + } + + if (i < 0x7C) { + if (!multibyte) { + g_JpnCacheCacheItems[i].ttl = 2; + + return &g_JpnCharCachePixels[i * TMUL]; + } else { + g_JpnCacheCacheItems[i + 0].ttl = 2; + g_JpnCacheCacheItems[i + 1].ttl = 2; + + return &g_JpnCharCachePixels[TMUL * i]; + } + } + + + if (!multibyte && freeindexsingle >= 0) { + g_JpnCacheCacheItems[freeindexsingle].ttl = 2; + g_JpnCacheCacheItems[freeindexsingle].codepoint = codepoint >> 1; + + romCopy(&g_JpnCharCachePixels[freeindexsingle * 8], (romptr_t) &_jfontchardataSegmentRomStart + (codepoint >> SHIFTAMOUNT) * 0x60, 0x60); + + return &g_JpnCharCachePixels[freeindexsingle * 8]; + } + + if (multibyte && freeindexmulti >= 0) { + g_JpnCacheCacheItems[freeindexmulti + 0].ttl = 2; + g_JpnCacheCacheItems[freeindexmulti + 1].ttl = 2; + g_JpnCacheCacheItems[freeindexmulti + 0].codepoint = codepoint >> 1; + g_JpnCacheCacheItems[freeindexmulti + 1].codepoint = codepoint >> 1; + + romCopy(&g_JpnCharCachePixels[freeindexmulti * 8], (romptr_t) &_efontchardataSegmentRomStart + ((codepoint & 0x1fff) >> SHIFTAMOUNT) * 0x80, 0x80); + + return &g_JpnCharCachePixels[freeindexmulti * 8]; + } + + return &g_JpnCharCachePixels[0]; } -#else -GLOBAL_ASM( -.text -glabel something_with_LnameX -/* 0F6560 7F0C1A30 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0F6564 7F0C1A34 AFB00018 */ sw $s0, 0x18($sp) -/* 0F6568 7F0C1A38 308E2000 */ andi $t6, $a0, 0x2000 -/* 0F656C 7F0C1A3C 00808025 */ move $s0, $a0 -/* 0F6570 7F0C1A40 AFBF001C */ sw $ra, 0x1c($sp) -/* 0F6574 7F0C1A44 240AFFFF */ li $t2, -1 -/* 0F6578 7F0C1A48 240BFFFF */ li $t3, -1 -/* 0F657C 7F0C1A4C 11C00002 */ beqz $t6, .L7F0C1A58 -/* 0F6580 7F0C1A50 00004025 */ move $t0, $zero -/* 0F6584 7F0C1A54 24080001 */ li $t0, 1 -.L7F0C1A58: -/* 0F6588 7F0C1A58 3C0C8009 */ lui $t4, %hi(ptr_char_registry) -/* 0F658C 7F0C1A5C 8D8CC6F8 */ lw $t4, %lo(ptr_char_registry)($t4) -/* 0F6590 7F0C1A60 00002825 */ move $a1, $zero -/* 0F6594 7F0C1A64 00003825 */ move $a3, $zero -/* 0F6598 7F0C1A68 2409007C */ li $t1, 124 -/* 0F659C 7F0C1A6C 01802025 */ move $a0, $t4 -.L7F0C1A70: -/* 0F65A0 7F0C1A70 15000006 */ bnez $t0, .L7F0C1A8C -/* 0F65A4 7F0C1A74 00000000 */ nop -/* 0F65A8 7F0C1A78 94980000 */ lhu $t8, ($a0) -/* 0F65AC 7F0C1A7C 00107843 */ sra $t7, $s0, 1 -/* 0F65B0 7F0C1A80 33193FFF */ andi $t9, $t8, 0x3fff -/* 0F65B4 7F0C1A84 51F9001F */ beql $t7, $t9, .L7F0C1B04 -/* 0F65B8 7F0C1A88 28A1007C */ slti $at, $a1, 0x7c -.L7F0C1A8C: -/* 0F65BC 7F0C1A8C 1100000B */ beqz $t0, .L7F0C1ABC -/* 0F65C0 7F0C1A90 94830000 */ lhu $v1, ($a0) -/* 0F65C4 7F0C1A94 24AE0001 */ addiu $t6, $a1, 1 -/* 0F65C8 7F0C1A98 29C1007C */ slti $at, $t6, 0x7c -/* 0F65CC 7F0C1A9C 10200007 */ beqz $at, .L7F0C1ABC -/* 0F65D0 7F0C1AA0 00101043 */ sra $v0, $s0, 1 -/* 0F65D4 7F0C1AA4 30783FFF */ andi $t8, $v1, 0x3fff -/* 0F65D8 7F0C1AA8 54580005 */ bnel $v0, $t8, .L7F0C1AC0 -/* 0F65DC 7F0C1AAC 00031382 */ srl $v0, $v1, 0xe -/* 0F65E0 7F0C1AB0 948F0002 */ lhu $t7, 2($a0) -/* 0F65E4 7F0C1AB4 31F93FFF */ andi $t9, $t7, 0x3fff -/* 0F65E8 7F0C1AB8 10590011 */ beq $v0, $t9, .L7F0C1B00 -.L7F0C1ABC: -/* 0F65EC 7F0C1ABC 00031382 */ srl $v0, $v1, 0xe -.L7F0C1AC0: -/* 0F65F0 7F0C1AC0 14400002 */ bnez $v0, .L7F0C1ACC -/* 0F65F4 7F0C1AC4 24A60001 */ addiu $a2, $a1, 1 -/* 0F65F8 7F0C1AC8 00A05025 */ move $t2, $a1 -.L7F0C1ACC: -/* 0F65FC 7F0C1ACC 14400009 */ bnez $v0, .L7F0C1AF4 -/* 0F6600 7F0C1AD0 24E70002 */ addiu $a3, $a3, 2 -/* 0F6604 7F0C1AD4 948E0002 */ lhu $t6, 2($a0) -/* 0F6608 7F0C1AD8 28C1007C */ slti $at, $a2, 0x7c -/* 0F660C 7F0C1ADC 000EC382 */ srl $t8, $t6, 0xe -/* 0F6610 7F0C1AE0 57000005 */ bnezl $t8, .L7F0C1AF8 -/* 0F6614 7F0C1AE4 00C02825 */ move $a1, $a2 -/* 0F6618 7F0C1AE8 50200003 */ beql $at, $zero, .L7F0C1AF8 -/* 0F661C 7F0C1AEC 00C02825 */ move $a1, $a2 -/* 0F6620 7F0C1AF0 00A05825 */ move $t3, $a1 -.L7F0C1AF4: -/* 0F6624 7F0C1AF4 00C02825 */ move $a1, $a2 -.L7F0C1AF8: -/* 0F6628 7F0C1AF8 14C9FFDD */ bne $a2, $t1, .L7F0C1A70 -/* 0F662C 7F0C1AFC 24840002 */ addiu $a0, $a0, 2 -.L7F0C1B00: -/* 0F6630 7F0C1B00 28A1007C */ slti $at, $a1, 0x7c -.L7F0C1B04: -/* 0F6634 7F0C1B04 10200021 */ beqz $at, .L7F0C1B8C -/* 0F6638 7F0C1B08 00000000 */ nop -/* 0F663C 7F0C1B0C 1500000C */ bnez $t0, .L7F0C1B40 -/* 0F6640 7F0C1B10 240D0060 */ li $t5, 96 -/* 0F6644 7F0C1B14 00AD0019 */ multu $a1, $t5 -/* 0F6648 7F0C1B18 908F0000 */ lbu $t7, ($a0) -/* 0F664C 7F0C1B1C 31F9FF3F */ andi $t9, $t7, 0xff3f -/* 0F6650 7F0C1B20 372E0080 */ ori $t6, $t9, 0x80 -/* 0F6654 7F0C1B24 A08E0000 */ sb $t6, ($a0) -/* 0F6658 7F0C1B28 3C0F8009 */ lui $t7, %hi(ptr_char_data_buf) -/* 0F665C 7F0C1B2C 8DEFC6F4 */ lw $t7, %lo(ptr_char_data_buf)($t7) -/* 0F6660 7F0C1B30 0000C012 */ mflo $t8 -/* 0F6664 7F0C1B34 030F1021 */ addu $v0, $t8, $t7 -/* 0F6668 7F0C1B38 1000006F */ b .L7F0C1CF8 -/* 0F666C 7F0C1B3C 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0C1B40: -/* 0F6670 7F0C1B40 90990000 */ lbu $t9, ($a0) -/* 0F6674 7F0C1B44 3C098009 */ lui $t1, %hi(ptr_char_registry) -/* 0F6678 7F0C1B48 2529C6F8 */ addiu $t1, %lo(ptr_char_registry) # addiu $t1, $t1, -0x3908 -/* 0F667C 7F0C1B4C 332EFF3F */ andi $t6, $t9, 0xff3f -/* 0F6680 7F0C1B50 35D80080 */ ori $t8, $t6, 0x80 -/* 0F6684 7F0C1B54 A0980000 */ sb $t8, ($a0) -/* 0F6688 7F0C1B58 8D2F0000 */ lw $t7, ($t1) -/* 0F668C 7F0C1B5C 240D0060 */ li $t5, 96 -/* 0F6690 7F0C1B60 00AD0019 */ multu $a1, $t5 -/* 0F6694 7F0C1B64 01E72021 */ addu $a0, $t7, $a3 -/* 0F6698 7F0C1B68 90990002 */ lbu $t9, 2($a0) -/* 0F669C 7F0C1B6C 332EFF3F */ andi $t6, $t9, 0xff3f -/* 0F66A0 7F0C1B70 35D80080 */ ori $t8, $t6, 0x80 -/* 0F66A4 7F0C1B74 A0980002 */ sb $t8, 2($a0) -/* 0F66A8 7F0C1B78 3C198009 */ lui $t9, %hi(ptr_char_data_buf) -/* 0F66AC 7F0C1B7C 8F39C6F4 */ lw $t9, %lo(ptr_char_data_buf)($t9) -/* 0F66B0 7F0C1B80 00007812 */ mflo $t7 -/* 0F66B4 7F0C1B84 1000005B */ b .L7F0C1CF4 -/* 0F66B8 7F0C1B88 01F91021 */ addu $v0, $t7, $t9 -.L7F0C1B8C: -/* 0F66BC 7F0C1B8C 15000025 */ bnez $t0, .L7F0C1C24 -/* 0F66C0 7F0C1B90 00000000 */ nop -/* 0F66C4 7F0C1B94 05400023 */ bltz $t2, .L7F0C1C24 -/* 0F66C8 7F0C1B98 240D0060 */ li $t5, 96 -/* 0F66CC 7F0C1B9C 014D0019 */ multu $t2, $t5 -/* 0F66D0 7F0C1BA0 000A3840 */ sll $a3, $t2, 1 -/* 0F66D4 7F0C1BA4 01871821 */ addu $v1, $t4, $a3 -/* 0F66D8 7F0C1BA8 906E0000 */ lbu $t6, ($v1) -/* 0F66DC 7F0C1BAC 3C098009 */ lui $t1, %hi(ptr_char_registry) -/* 0F66E0 7F0C1BB0 2529C6F8 */ addiu $t1, %lo(ptr_char_registry) # addiu $t1, $t1, -0x3908 -/* 0F66E4 7F0C1BB4 31D8FF3F */ andi $t8, $t6, 0xff3f -/* 0F66E8 7F0C1BB8 370F0080 */ ori $t7, $t8, 0x80 -/* 0F66EC 7F0C1BBC A06F0000 */ sb $t7, ($v1) -/* 0F66F0 7F0C1BC0 8D390000 */ lw $t9, ($t1) -/* 0F66F4 7F0C1BC4 00004012 */ mflo $t0 -/* 0F66F8 7F0C1BC8 00101043 */ sra $v0, $s0, 1 -/* 0F66FC 7F0C1BCC 03271821 */ addu $v1, $t9, $a3 -/* 0F6700 7F0C1BD0 004D0019 */ multu $v0, $t5 -/* 0F6704 7F0C1BD4 946F0000 */ lhu $t7, ($v1) -/* 0F6708 7F0C1BD8 30583FFF */ andi $t8, $v0, 0x3fff -/* 0F670C 7F0C1BDC 24060060 */ li $a2, 96 -/* 0F6710 7F0C1BE0 31F9C000 */ andi $t9, $t7, 0xc000 -/* 0F6714 7F0C1BE4 03197025 */ or $t6, $t8, $t9 -/* 0F6718 7F0C1BE8 A46E0000 */ sh $t6, ($v1) -/* 0F671C 7F0C1BEC 3C0F8009 */ lui $t7, %hi(ptr_char_data_buf) -/* 0F6720 7F0C1BF0 8DEFC6F4 */ lw $t7, %lo(ptr_char_data_buf)($t7) -/* 0F6724 7F0C1BF4 3C190011 */ lui $t9, %hi(_jfontchardataSegmentRomStart) # $t9, 0x11 -/* 0F6728 7F0C1BF8 27397940 */ addiu $t9, %lo(_jfontchardataSegmentRomStart) # addiu $t9, $t9, 0x7940 -/* 0F672C 7F0C1BFC 0000C012 */ mflo $t8 -/* 0F6730 7F0C1C00 03192821 */ addu $a1, $t8, $t9 -/* 0F6734 7F0C1C04 AFA80024 */ sw $t0, 0x24($sp) -/* 0F6738 7F0C1C08 0C001707 */ jal romCopy -/* 0F673C 7F0C1C0C 010F2021 */ addu $a0, $t0, $t7 -/* 0F6740 7F0C1C10 3C0E8009 */ lui $t6, %hi(ptr_char_data_buf) -/* 0F6744 7F0C1C14 8FA80024 */ lw $t0, 0x24($sp) -/* 0F6748 7F0C1C18 8DCEC6F4 */ lw $t6, %lo(ptr_char_data_buf)($t6) -/* 0F674C 7F0C1C1C 10000035 */ b .L7F0C1CF4 -/* 0F6750 7F0C1C20 010E1021 */ addu $v0, $t0, $t6 -.L7F0C1C24: -/* 0F6754 7F0C1C24 11000032 */ beqz $t0, .L7F0C1CF0 -/* 0F6758 7F0C1C28 3C028009 */ lui $v0, %hi(ptr_char_data_buf) -/* 0F675C 7F0C1C2C 05600030 */ bltz $t3, .L7F0C1CF0 -/* 0F6760 7F0C1C30 000B1840 */ sll $v1, $t3, 1 -/* 0F6764 7F0C1C34 01831021 */ addu $v0, $t4, $v1 -/* 0F6768 7F0C1C38 904F0000 */ lbu $t7, ($v0) -/* 0F676C 7F0C1C3C 3C098009 */ lui $t1, %hi(ptr_char_registry) -/* 0F6770 7F0C1C40 2529C6F8 */ addiu $t1, %lo(ptr_char_registry) # addiu $t1, $t1, -0x3908 -/* 0F6774 7F0C1C44 31F8FF3F */ andi $t8, $t7, 0xff3f -/* 0F6778 7F0C1C48 37190080 */ ori $t9, $t8, 0x80 -/* 0F677C 7F0C1C4C A0590000 */ sb $t9, ($v0) -/* 0F6780 7F0C1C50 8D2E0000 */ lw $t6, ($t1) -/* 0F6784 7F0C1C54 240D0060 */ li $t5, 96 -/* 0F6788 7F0C1C58 016D0019 */ multu $t3, $t5 -/* 0F678C 7F0C1C5C 01C31021 */ addu $v0, $t6, $v1 -/* 0F6790 7F0C1C60 904F0002 */ lbu $t7, 2($v0) -/* 0F6794 7F0C1C64 24060080 */ li $a2, 128 -/* 0F6798 7F0C1C68 31F8FF3F */ andi $t8, $t7, 0xff3f -/* 0F679C 7F0C1C6C 37190080 */ ori $t9, $t8, 0x80 -/* 0F67A0 7F0C1C70 A0590002 */ sb $t9, 2($v0) -/* 0F67A4 7F0C1C74 8D2E0000 */ lw $t6, ($t1) -/* 0F67A8 7F0C1C78 00107843 */ sra $t7, $s0, 1 -/* 0F67AC 7F0C1C7C 31E73FFF */ andi $a3, $t7, 0x3fff -/* 0F67B0 7F0C1C80 01C31021 */ addu $v0, $t6, $v1 -/* 0F67B4 7F0C1C84 94590000 */ lhu $t9, ($v0) -/* 0F67B8 7F0C1C88 00004012 */ mflo $t0 -/* 0F67BC 7F0C1C8C 332EC000 */ andi $t6, $t9, 0xc000 -/* 0F67C0 7F0C1C90 00EE7825 */ or $t7, $a3, $t6 -/* 0F67C4 7F0C1C94 A44F0000 */ sh $t7, ($v0) -/* 0F67C8 7F0C1C98 8D380000 */ lw $t8, ($t1) -/* 0F67CC 7F0C1C9C 03031021 */ addu $v0, $t8, $v1 -/* 0F67D0 7F0C1CA0 94590002 */ lhu $t9, 2($v0) -/* 0F67D4 7F0C1CA4 3C188009 */ lui $t8, %hi(ptr_char_data_buf) -/* 0F67D8 7F0C1CA8 332EC000 */ andi $t6, $t9, 0xc000 -/* 0F67DC 7F0C1CAC 00EE7825 */ or $t7, $a3, $t6 -/* 0F67E0 7F0C1CB0 A44F0002 */ sh $t7, 2($v0) -/* 0F67E4 7F0C1CB4 8F18C6F4 */ lw $t8, %lo(ptr_char_data_buf)($t8) -/* 0F67E8 7F0C1CB8 32191FFF */ andi $t9, $s0, 0x1fff -/* 0F67EC 7F0C1CBC 00197043 */ sra $t6, $t9, 1 -/* 0F67F0 7F0C1CC0 01182021 */ addu $a0, $t0, $t8 -/* 0F67F4 7F0C1CC4 3C180012 */ lui $t8, %hi(_efontchardataSegmentRomStart) # $t8, 0x12 -/* 0F67F8 7F0C1CC8 27183040 */ addiu $t8, %lo(_efontchardataSegmentRomStart) # addiu $t8, $t8, 0x3040 -/* 0F67FC 7F0C1CCC 000E79C0 */ sll $t7, $t6, 7 -/* 0F6800 7F0C1CD0 01F82821 */ addu $a1, $t7, $t8 -/* 0F6804 7F0C1CD4 0C001707 */ jal romCopy -/* 0F6808 7F0C1CD8 AFA80024 */ sw $t0, 0x24($sp) -/* 0F680C 7F0C1CDC 3C198009 */ lui $t9, %hi(ptr_char_data_buf) -/* 0F6810 7F0C1CE0 8FA80024 */ lw $t0, 0x24($sp) -/* 0F6814 7F0C1CE4 8F39C6F4 */ lw $t9, %lo(ptr_char_data_buf)($t9) -/* 0F6818 7F0C1CE8 10000002 */ b .L7F0C1CF4 -/* 0F681C 7F0C1CEC 01191021 */ addu $v0, $t0, $t9 -.L7F0C1CF0: -/* 0F6820 7F0C1CF0 8C42C6F4 */ lw $v0, %lo(ptr_char_data_buf)($v0) -.L7F0C1CF4: -/* 0F6824 7F0C1CF4 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0C1CF8: -/* 0F6828 7F0C1CF8 8FB00018 */ lw $s0, 0x18($sp) -/* 0F682C 7F0C1CFC 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0F6830 7F0C1D00 03E00008 */ jr $ra -/* 0F6834 7F0C1D04 00000000 */ nop -) -#endif -void load_mission_text_bank(u32 id) +void langLoadToAddr(u32 id) { - ptr_text[id] = _load_resource_named_to_membank(LnameX_lookuptable[id][j_text_trigger],1,0x100,4); + g_LangBanks[id] = _fileNameLoadToBank(LnameX_lookuptable[id][j_text_trigger],1,0x100,MEMPOOL_STAGE); } -void load_briefing_text_bank(int lnameID,u8 *target,int size) +void langLoadToBank(int id,u8 *target,int size) { - ptr_text[lnameID] = _load_resource_named_to_buffer(LnameX_lookuptable[lnameID][j_text_trigger],1,target,size); + g_LangBanks[id] = _fileNameLoadToAddr(LnameX_lookuptable[id][j_text_trigger],1,target,size); } -void blank_text_bank(s32 textBank) { - ptr_text[textBank] = 0; +void langClearBank(s32 textBank) { + g_LangBanks[textBank] = 0; } u8 * langGet(s32 slotID) { - u32 * textbank_ptr = ptr_text[slotID >> 10]; /* get the text file bank ID index the text ptr table */ + u32 * textbank_ptr = g_LangBanks[slotID >> 10]; /* get the text file bank ID index the text ptr table */ u32 textslot_offset = textbank_ptr[slotID & 0x03FF]; /* load the textbank ptr table then get the slot's offset */ u32 output_slot = textslot_offset; /* add the text slot offset to the base ptr to get the ptr to text file's slot */ output_slot += (u32)textbank_ptr; return (textslot_offset != 0) ? (u8*)output_slot : NULL; -} +} \ No newline at end of file diff --git a/src/game/lvl_text.h b/src/game/lvl_text.h index 0088fd9d..c48472dc 100644 --- a/src/game/lvl_text.h +++ b/src/game/lvl_text.h @@ -1,11 +1,25 @@ #ifndef _LVL_TEXT_H_ #define _LVL_TEXT_H_ #include +#include "bondconstants.h" + +struct jpncharpixels { + /*0x00*/ u32 unk00; + /*0x04*/ u32 unk04; + /*0x08*/ u32 unk08; +}; + +struct jpncacheitem { + u16 ttl : 2; + u16 codepoint : 14; +}; extern s32 j_text_trigger; -void something_with_LnameJ(void); +void langTick(void); u8 * langGet(s32 slotID); +void langLoadToBank(int id, u8 *target, int size); +LEVELID langGetLangBankIndexFromStagenum(LEVELID level); #endif diff --git a/src/game/math_asinacos.c b/src/game/math_asinacos.c index 689097bb..f9037a2a 100644 --- a/src/game/math_asinacos.c +++ b/src/game/math_asinacos.c @@ -28,6 +28,7 @@ u16 table_3[] = { 0x39A, 0x31E, 0x28C, 0x1CD, 0, 0 }; +// PD: func0f096890 static s32 sub_GAME_7F05AB70(s32 arg0) { s32 mask; diff --git a/src/game/math_asinfacosf.c b/src/game/math_asinfacosf.c index 294e06e9..2947868e 100644 --- a/src/game/math_asinfacosf.c +++ b/src/game/math_asinfacosf.c @@ -14,7 +14,7 @@ f32 acosf(f32 cosinef) cosines = (cosinef * 32767.0f); } - return (acos(cosines) * 3.1415927f) / 65535.0f; + return (acos(cosines) * M_PI_F) / 65535.0f; } f32 asinf(f32 sinef) @@ -29,5 +29,5 @@ f32 asinf(f32 sinef) sines = (sinef * 32767.0f); } - return (asin(sines) * 3.1415927f) / 65535.0f; + return (asin(sines) * M_PI_F) / 65535.0f; } diff --git a/src/game/matrixmath.c b/src/game/matrixmath.c index a0cac177..7b5b5aed 100644 --- a/src/game/matrixmath.c +++ b/src/game/matrixmath.c @@ -20,191 +20,79 @@ f32 D_80032310[2] = {M_U16_MAX_VALUE_F, M_U16_MAX_VALUE_F}; //#ifdef VERSION_EU #ifdef VERSION_EU -#ifdef NONMATCHING -void matrix_4x4_copy_homogeneous_eu(Mtxf *src,Mtxf *dst) +void matrix_4x4_copy_homogeneous_eu(f32 src[3][3], f32 dst[3][3]) { - + s32 i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + dst[i][j] = src[i][j]; + } + } } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_copy_homogeneous_eu -/* 08ACC0 7F0582D0 00001025 */ move $v0, $zero -/* 08ACC4 7F0582D4 00A03025 */ move $a2, $a1 -/* 08ACC8 7F0582D8 00803825 */ move $a3, $a0 -/* 08ACCC 7F0582DC 24080003 */ li $t0, 3 -.L7F0582E0: -/* 08ACD0 7F0582E0 00001825 */ move $v1, $zero -/* 08ACD4 7F0582E4 00C02025 */ move $a0, $a2 -/* 08ACD8 7F0582E8 00E02825 */ move $a1, $a3 -.L7F0582EC: -/* 08ACDC 7F0582EC C4A40000 */ lwc1 $f4, ($a1) -/* 08ACE0 7F0582F0 24630001 */ addiu $v1, $v1, 1 -/* 08ACE4 7F0582F4 24840004 */ addiu $a0, $a0, 4 -/* 08ACE8 7F0582F8 24A50004 */ addiu $a1, $a1, 4 -/* 08ACEC 7F0582FC 1468FFFB */ bne $v1, $t0, .L7F0582EC -/* 08ACF0 7F058300 E484FFFC */ swc1 $f4, -4($a0) -/* 08ACF4 7F058304 24420001 */ addiu $v0, $v0, 1 -/* 08ACF8 7F058308 24C6000C */ addiu $a2, $a2, 0xc -/* 08ACFC 7F05830C 1448FFF4 */ bne $v0, $t0, .L7F0582E0 -/* 08AD00 7F058310 24E7000C */ addiu $a3, $a3, 0xc -/* 08AD04 7F058314 03E00008 */ jr $ra -/* 08AD08 7F058318 00000000 */ nop -) -#endif #endif #ifdef VERSION_EU -#ifdef NONMATCHING -void matrix_4x4_multiply_homogeneous_in_place_eu (f32 src[3][3], f32 dst[3][3]) +void matrix_4x4_multiply_homogeneous_in_place_eu (f32 lhs[3][3], f32 rhs[3][3]) { - + f32 result[3][3]; + matrix_4x4_multiply_homogeneous_eu(lhs, rhs, &result); + matrix_4x4_copy_homogeneous_eu(&result, rhs); } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_multiply_homogeneous_in_place_eu -/* 08AD0C 7F05831C 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 08AD10 7F058320 AFBF0014 */ sw $ra, 0x14($sp) -/* 08AD14 7F058324 AFA50044 */ sw $a1, 0x44($sp) -/* 08AD18 7F058328 0FC160D3 */ jal matrix_4x4_multiply_homogeneous_eu -/* 08AD1C 7F05832C 27A6001C */ addiu $a2, $sp, 0x1c -/* 08AD20 7F058330 27A4001C */ addiu $a0, $sp, 0x1c -/* 08AD24 7F058334 0FC160B4 */ jal matrix_4x4_copy_homogeneous_eu -/* 08AD28 7F058338 8FA50044 */ lw $a1, 0x44($sp) -/* 08AD2C 7F05833C 8FBF0014 */ lw $ra, 0x14($sp) -/* 08AD30 7F058340 27BD0040 */ addiu $sp, $sp, 0x40 -/* 08AD34 7F058344 03E00008 */ jr $ra -/* 08AD38 7F058348 00000000 */ nop -) -#endif #endif #ifdef VERSION_EU -#ifdef NONMATCHING -void matrix_4x4_multiply_homogeneous_eu (Mtxf * lhs, Mtxf * rhs, Mtxf * result) +void matrix_4x4_multiply_homogeneous_eu(f32 lhs[3][3], f32 rhs[3][3], f32 result[3][3]) { - + s32 i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + result[j][i] = (lhs[0][i] * rhs[j][0]) + (lhs[1][i] * rhs[j][1]) + (lhs[2][i] * rhs[j][2]); + } + } } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_multiply_homogeneous_eu -/* 08AD3C 7F05834C 00001825 */ move $v1, $zero -/* 08AD40 7F058350 00804025 */ move $t0, $a0 -/* 08AD44 7F058354 240A000C */ li $t2, 12 -/* 08AD48 7F058358 24090003 */ li $t1, 3 -.L7F05835C: -/* 08AD4C 7F05835C 00001025 */ move $v0, $zero -/* 08AD50 7F058360 00C32021 */ addu $a0, $a2, $v1 -/* 08AD54 7F058364 00A03825 */ move $a3, $a1 -.L7F058368: -/* 08AD58 7F058368 C5120000 */ lwc1 $f18, ($t0) -/* 08AD5C 7F05836C C4F00000 */ lwc1 $f16, ($a3) -/* 08AD60 7F058370 C50E000C */ lwc1 $f14, 0xc($t0) -/* 08AD64 7F058374 C4EC0004 */ lwc1 $f12, 4($a3) -/* 08AD68 7F058378 46109402 */ mul.s $f16, $f18, $f16 -/* 08AD6C 7F05837C C4F20008 */ lwc1 $f18, 8($a3) -/* 08AD70 7F058380 C50A0018 */ lwc1 $f10, 0x18($t0) -/* 08AD74 7F058384 460C7302 */ mul.s $f12, $f14, $f12 -/* 08AD78 7F058388 24420001 */ addiu $v0, $v0, 1 -/* 08AD7C 7F05838C 2484000C */ addiu $a0, $a0, 0xc -/* 08AD80 7F058390 460A9282 */ mul.s $f10, $f18, $f10 -/* 08AD84 7F058394 24E7000C */ addiu $a3, $a3, 0xc -/* 08AD88 7F058398 460C8300 */ add.s $f12, $f16, $f12 -/* 08AD8C 7F05839C 460C5300 */ add.s $f12, $f10, $f12 -/* 08AD90 7F0583A0 1449FFF1 */ bne $v0, $t1, .L7F058368 -/* 08AD94 7F0583A4 E48CFFF4 */ swc1 $f12, -0xc($a0) -/* 08AD98 7F0583A8 24630004 */ addiu $v1, $v1, 4 -/* 08AD9C 7F0583AC 146AFFEB */ bne $v1, $t2, .L7F05835C -/* 08ADA0 7F0583B0 25080004 */ addiu $t0, $t0, 4 -/* 08ADA4 7F0583B4 03E00008 */ jr $ra -/* 08ADA8 7F0583B8 00000000 */ nop -) -#endif #endif #ifdef VERSION_EU -#ifdef NONMATCHING -void matrix_4x4_copy_eu (Mtxf * src, Mtxf * dst) +void matrix_4x4_copy_eu(f32 src[][3], f32 dst[4][4]) { + s32 i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + dst[i][j] = src[i][j]; + } + } + dst[0][3] = 0.0; + dst[1][3] = 0.0; + dst[2][3] = 0.0; + dst[3][0] = 0.0; + dst[3][1] = 0.0; + dst[3][2] = 0.0; + dst[3][3] = 1.0; } -#else -GLOBAL_ASM( -.text -glabel matrix_4x4_copy_eu -/* 08ADAC 7F0583BC 00001025 */ move $v0, $zero -/* 08ADB0 7F0583C0 00A03025 */ move $a2, $a1 -/* 08ADB4 7F0583C4 00803825 */ move $a3, $a0 -/* 08ADB8 7F0583C8 24090003 */ li $t1, 3 -.L7F0583CC: -/* 08ADBC 7F0583CC 00001825 */ move $v1, $zero -/* 08ADC0 7F0583D0 00C02025 */ move $a0, $a2 -/* 08ADC4 7F0583D4 00E04025 */ move $t0, $a3 -.L7F0583D8: -/* 08ADC8 7F0583D8 C5040000 */ lwc1 $f4, ($t0) -/* 08ADCC 7F0583DC 24630001 */ addiu $v1, $v1, 1 -/* 08ADD0 7F0583E0 24840004 */ addiu $a0, $a0, 4 -/* 08ADD4 7F0583E4 25080004 */ addiu $t0, $t0, 4 -/* 08ADD8 7F0583E8 1469FFFB */ bne $v1, $t1, .L7F0583D8 -/* 08ADDC 7F0583EC E484FFFC */ swc1 $f4, -4($a0) -/* 08ADE0 7F0583F0 24420001 */ addiu $v0, $v0, 1 -/* 08ADE4 7F0583F4 24C60010 */ addiu $a2, $a2, 0x10 -/* 08ADE8 7F0583F8 1449FFF4 */ bne $v0, $t1, .L7F0583CC -/* 08ADEC 7F0583FC 24E7000C */ addiu $a3, $a3, 0xc -/* 08ADF0 7F058400 44800000 */ mtc1 $zero, $f0 -/* 08ADF4 7F058404 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08ADF8 7F058408 44813000 */ mtc1 $at, $f6 -/* 08ADFC 7F05840C E4A0000C */ swc1 $f0, 0xc($a1) -/* 08AE00 7F058410 E4A0001C */ swc1 $f0, 0x1c($a1) -/* 08AE04 7F058414 E4A0002C */ swc1 $f0, 0x2c($a1) -/* 08AE08 7F058418 E4A00030 */ swc1 $f0, 0x30($a1) -/* 08AE0C 7F05841C E4A00034 */ swc1 $f0, 0x34($a1) -/* 08AE10 7F058420 E4A00038 */ swc1 $f0, 0x38($a1) -/* 08AE14 7F058424 03E00008 */ jr $ra -/* 08AE18 7F058428 E4A6003C */ swc1 $f6, 0x3c($a1) -) -#endif #endif #ifdef VERSION_EU -#ifdef NONMATCHING -void matrix_7f05842c_eu (Mtxf * src, f32 dst[3][3]) +void matrix_7f05842c_eu(f32 src[][4], f32 dst[3][3]) { - + s32 i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + { + dst[i][j] = src[i][j]; + } + } } -#else -void matrix_7f05842c_eu (Mtxf * src, f32 dst[3][3]); -GLOBAL_ASM( -.text -glabel matrix_7f05842c_eu -/* 08AE1C 7F05842C 00001025 */ move $v0, $zero -/* 08AE20 7F058430 00A03025 */ move $a2, $a1 -/* 08AE24 7F058434 00803825 */ move $a3, $a0 -/* 08AE28 7F058438 24080003 */ li $t0, 3 -.L7F05843C: -/* 08AE2C 7F05843C 00001825 */ move $v1, $zero -/* 08AE30 7F058440 00C02025 */ move $a0, $a2 -/* 08AE34 7F058444 00E02825 */ move $a1, $a3 -.L7F058448: -/* 08AE38 7F058448 C4A40000 */ lwc1 $f4, ($a1) -/* 08AE3C 7F05844C 24630001 */ addiu $v1, $v1, 1 -/* 08AE40 7F058450 24840004 */ addiu $a0, $a0, 4 -/* 08AE44 7F058454 24A50004 */ addiu $a1, $a1, 4 -/* 08AE48 7F058458 1468FFFB */ bne $v1, $t0, .L7F058448 -/* 08AE4C 7F05845C E484FFFC */ swc1 $f4, -4($a0) -/* 08AE50 7F058460 24420001 */ addiu $v0, $v0, 1 -/* 08AE54 7F058464 24C6000C */ addiu $a2, $a2, 0xc -/* 08AE58 7F058468 1448FFF4 */ bne $v0, $t0, .L7F05843C -/* 08AE5C 7F05846C 24E70010 */ addiu $a3, $a3, 0x10 -/* 08AE60 7F058470 03E00008 */ jr $ra -/* 08AE64 7F058474 00000000 */ nop -) -#endif #endif @@ -311,38 +199,38 @@ void matrix_4x4_7F058274(Mtxf *arg0, Mtxf *arg1, Mtxf *arg2) arg2->m[3][3] = (arg0->m[2][3] * arg1->m[3][2]); } -void matrix_4x4_rotate_vector(Mtxf *matrix, vec3 vector, vec3 result) +void matrix_4x4_rotate_vector(Mtxf *matrix, struct coord3d *vector, struct coord3d *result) { s32 i; for (i = 0; i < 3; i++) { - result[i] = matrix->m[0][i] * vector[0] + matrix->m[1][i] * vector[1] + matrix->m[2][i] * vector[2]; + result->f[i] = matrix->m[0][i] * vector->f[0] + matrix->m[1][i] * vector->f[1] + matrix->m[2][i] * vector->f[2]; } } -void matrix_4x4_rotate_vector_in_place(Mtxf *matrix, vec3 vector) +void mtx4RotateVecInPlace(Mtxf *matrix, struct coord3d *vector) { - vec3 result; - matrix_4x4_rotate_vector(matrix, vector, result); - vector[0] = result[0]; - vector[1] = result[1]; - vector[2] = result[2]; + struct coord3d result; + matrix_4x4_rotate_vector(matrix, vector, &result); + vector->f[0] = result.f[0]; + vector->f[1] = result.f[1]; + vector->f[2] = result.f[2]; } -void matrix_4x4_transform_vector(Mtxf *matrix, vec3 vector, vec3 result) +void matrix_4x4_transform_vector(Mtxf *matrix, struct coord3d *vector, struct coord3d *result) { matrix_4x4_rotate_vector(matrix, vector, result); - result[0] += matrix->m[3][0]; - result[1] += matrix->m[3][1]; - result[2] += matrix->m[3][2]; + result->f[0] += matrix->m[3][0]; + result->f[1] += matrix->m[3][1]; + result->f[2] += matrix->m[3][2]; } -void matrix_4x4_transform_vector_in_place(Mtxf *matrix, vec3 vector) +void mtx4TransformVecInPlace(Mtxf *matrix, struct coord3d *vector) { - matrix_4x4_rotate_vector_in_place(matrix, vector); - vector[0] += matrix->m[3][0]; - vector[1] += matrix->m[3][1]; - vector[2] += matrix->m[3][2]; + mtx4RotateVecInPlace(matrix, vector); + vector->f[0] += matrix->m[3][0]; + vector->f[1] += matrix->m[3][1]; + vector->f[2] += matrix->m[3][2]; } void matrix_4x4_set_position_and_rotation_around_y(f32 *position, f32 angle, Mtxf *matrix) @@ -433,14 +321,14 @@ void matrix_4x4_set_rotation_around_z(f32 angle, Mtxf *matrix) matrix->m[3][3] = 1.0f; } -void matrix_4x4_set_rotation_around_xyz(vec3 angles, Mtxf *matrix) +void matrix_4x4_set_rotation_around_xyz(struct coord3d *angles, Mtxf *matrix) { - f32 cos_x = cosf(angles[0]); - f32 sin_x = sinf(angles[0]); - f32 cos_y = cosf(angles[1]); - f32 sin_y = sinf(angles[1]); - f32 cos_z = cosf(angles[2]); - f32 sin_z = sinf(angles[2]); + f32 cos_x = cosf(angles->f[0]); + f32 sin_x = sinf(angles->f[0]); + f32 cos_y = cosf(angles->f[1]); + f32 sin_y = sinf(angles->f[1]); + f32 cos_z = cosf(angles->f[2]); + f32 sin_z = sinf(angles->f[2]); f32 sin_x_sin_z = sin_x * sin_z; f32 cos_x_sin_z = cos_x * sin_z; f32 sin_x_cos_z = sin_x * cos_z; @@ -464,7 +352,7 @@ void matrix_4x4_set_rotation_around_xyz(vec3 angles, Mtxf *matrix) } // https://stackoverflow.com/a/15029416 -void matrix_4x4_get_rotation_around_xyz(Mtxf *matrix, vec3 angles) +void matrix_4x4_get_rotation_around_xyz(Mtxf *matrix, struct coord3d *angles) { f32 norm; f32 sin_x_cos_y = matrix->m[1][2]; @@ -472,35 +360,35 @@ void matrix_4x4_get_rotation_around_xyz(Mtxf *matrix, vec3 angles) norm = sqrtf(SQR(sin_x_cos_y) + SQR(cos_x_cos_y)); if (EPSILON < norm) { - angles[0] = atan2f(matrix->m[1][2], matrix->m[2][2]); - angles[1] = atan2f(-matrix->m[0][2], norm); - angles[2] = atan2f(matrix->m[0][1], matrix->m[0][0]); + angles->f[0] = atan2f(matrix->m[1][2], matrix->m[2][2]); + angles->f[1] = atan2f(-matrix->m[0][2], norm); + angles->f[2] = atan2f(matrix->m[0][1], matrix->m[0][0]); } else { - angles[0] = 0.0f; - angles[1] = atan2f(-matrix->m[0][2], norm); - angles[2] = atan2f(-matrix->m[1][0], matrix->m[1][1]); + angles->f[0] = 0.0f; + angles->f[1] = atan2f(-matrix->m[0][2], norm); + angles->f[2] = atan2f(-matrix->m[1][0], matrix->m[1][1]); } } -void matrix_4x4_set_position_and_rotation_around_xyz(vec3 position, vec3 rotation, Mtxf *matrix) +void matrix_4x4_set_position_and_rotation_around_xyz(struct coord3d *position, struct coord3d * rotation, Mtxf *matrix) { matrix_4x4_set_rotation_around_xyz(rotation, matrix); matrix_4x4_set_position(position, matrix); } -void matrix_4x4_set_identity_and_position(vec3 position, Mtxf *matrix) +void matrix_4x4_set_identity_and_position(struct coord3d * position, Mtxf *matrix) { matrix_4x4_set_identity(matrix); matrix_4x4_set_position(position, matrix); } -void matrix_4x4_set_position(vec3 position, Mtxf *matrix) +void matrix_4x4_set_position(struct coord3d *position, Mtxf *matrix) { - matrix->m[3][0] = position[0]; - matrix->m[3][1] = position[1]; - matrix->m[3][2] = position[2]; + matrix->m[3][0] = position->f[0]; + matrix->m[3][1] = position->f[1]; + matrix->m[3][2] = position->f[2]; } void matrix_column_1_scalar_multiply(f32 scalar, f32 *matrix) diff --git a/src/game/matrixmath.h b/src/game/matrixmath.h index bc933f66..e41cdf28 100644 --- a/src/game/matrixmath.h +++ b/src/game/matrixmath.h @@ -4,11 +4,11 @@ #include #include -void matrix_4x4_rotate_vector_in_place(Mtxf *matrix, vec3 vector); +void mtx4RotateVecInPlace(Mtxf *matrix, struct coord3d *vector); void matrix_4x4_7F059694(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); void matrix_4x4_multiply(Mtxf *lhs, Mtxf *rhs, Mtxf *result); -void matrix_4x4_set_position(vec3 position, Mtxf *matrix); +void matrix_4x4_set_position(struct coord3d *position, Mtxf *matrix); void matrix_4x4_7F059424(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); u32 sub_GAME_7F05997C(f32 arg0, f32 arg1); void matrix_4x4_7F05A310(Mtxf *arg0, Mtxf *arg1); @@ -23,7 +23,7 @@ void matrix_4x4_multiply_homogeneous(Mtxf *lhs, Mtxf *rhs, Mtxf *result); void matrix_4x4_f32_to_s32(Mtxf *a, Mtxf *b); void matrix_4x4_multiply_homogeneous_in_place(Mtxf *lhs, Mtxf *rhs); -void matrix_4x4_transform_vector_in_place(Mtxf *matrix, vec3 vector); +void mtx4TransformVecInPlace(Mtxf *matrix, struct coord3d *vector); void matrix_4x4_set_identity(Mtxf *matrix); void matrix_4x4_set_rotation_around_x(f32 angle, Mtxf *matrix); void matrix_4x4_set_rotation_around_y(f32 angle, Mtxf *matrix); @@ -31,16 +31,25 @@ void matrix_scalar_multiply(f32 scalar, f32 *matrix); void matrix_4x4_7F059908(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); void matrix_4x4_set_rotation_around_z(f32 angle, Mtxf *matrix); void matrix_4x4_multiply_in_place(Mtxf *lhs, Mtxf *rhs); -void matrix_4x4_set_identity_and_position(vec3 position, Mtxf *matrix); +void matrix_4x4_set_identity_and_position(struct coord3d *position, Mtxf *matrix); void matrix_column_3_scalar_multiply_2(f32 scalar, f32 *matrix); void matrix_4x4_set_position_and_rotation_around_y(f32 *position, f32 angle, Mtxf *matrix); void matrix_scalar_multiply_2(f32 scalar, f32 *matrix); -void matrix_4x4_set_rotation_around_xyz(vec3 angles, Mtxf *matrix); +void matrix_4x4_set_rotation_around_xyz(struct coord3d *angles, Mtxf *matrix); +void matrix_4x4_7F059708(Mtxf *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); +void matrix_4x4_7F059E64(Mtxf *arg0, Mtxf *arg1); +void matrix_column_1_scalar_multiply(f32 scalar, f32 *matrix); +void matrix_column_2_scalar_multiply(f32 scalar, f32 *matrix); +void matrix_column_3_scalar_multiply(f32 scalar, f32 *matrix); +void matrix_column_3_scalar_multiply_2(f32 scalar, f32 *matrix); +void matrix_4x4_set_position_and_rotation_around_xyz(struct coord3d *position, struct coord3d * rotation, Mtxf *matrix); +void matrix_scalar_multiply_3(f32 scalar, f32 *matrix); // tenative guess void sub_GAME_7F058E78(Mtxf *arg0, Mtxf *arg1); -void matrix_7f05842c_eu (Mtxf * src, f32 dst[3][3]); -void matrix_4x4_multiply_homogeneous_in_place_eu (f32 src[3][3], f32 dst[3][3]); +void matrix_7f05842c_eu(f32 src[][4], f32 dst[3][3]); +void matrix_4x4_multiply_homogeneous_in_place_eu(f32 src[3][3], f32 dst[3][3]); +void matrix_4x4_multiply_homogeneous_eu(f32 lhs[3][3], f32 rhs[3][3], f32 result[3][3]); /* matrixmath_misc.h */ diff --git a/src/game/matrixmath_misc.c b/src/game/matrixmath_misc.c index 59196e2c..6bdb53af 100644 --- a/src/game/matrixmath_misc.c +++ b/src/game/matrixmath_misc.c @@ -2,7 +2,7 @@ #include "matrixmath.h" /** - * x vector plus ((difference to y vector) * scaler). + * result = x vector plus ((y - x vector) * scaler). */ void sub_GAME_7F05AE00(vec3d *x, vec3d *y, f32 scaler, vec3d *result) { @@ -39,117 +39,26 @@ f32 sub_GAME_7F05AE50(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) return total; } -/** - * Following is cleaned up mips_to_c output. - * - * decomp status: - * - compiles: yes - * - stack resize: fail - * - identical instructions: fail - * - identical registers: fail - */ -#ifdef NONMATCHING -void sub_GAME_7F05AEFC(vec3d *arg0, vec3d *arg1, vec3d *arg2, vec3d *arg3, f32 arg4, vec3d *result) +void sub_GAME_7F05AEFC(coord3d *arg0, coord3d *arg1, coord3d *arg2, coord3d *arg3, f32 arg4, coord3d *arg5) { - f32 square; - f32 cube; - f32 temp_f8; - f32 temp_f14; - f32 temp_f16; - f32 temp_f18; - - square = arg4 * arg4; - cube = square * arg4; - - temp_f8 = 0.5f * (cube - square); - temp_f14 = square - ((arg4 + cube) * 0.5f); - temp_f16 = 1.0f + (1.5f * cube) - (2.5f * square); - temp_f18 = (-1.5f * cube) + (0.5f * arg4) + (2.0f * square); - - result->f[0] = (temp_f8 * arg3->f[0]) + ((temp_f14 * arg0->f[0]) + (temp_f16 * arg1->f[0]) + (temp_f18 * arg2->f[0])); - result->f[1] = (temp_f8 * arg3->f[1]) + ((temp_f14 * arg0->f[1]) + (temp_f16 * arg1->f[1]) + (temp_f18 * arg2->f[1])); - result->f[2] = (temp_f8 * arg3->f[2]) + ((temp_f14 * arg0->f[2]) + (temp_f16 * arg1->f[2]) + (temp_f18 * arg2->f[2])); + f32 stack; + f32 mult0; + f32 mult1; + f32 mult2; + f32 mult3; + + f32 squared = arg4 * arg4; + f32 cubed = arg4 * arg4 * arg4; + + mult0 = squared - 0.5f * (arg4 + cubed); + mult1 = 1.5f * cubed - 2.5f * squared + 1.0f; + mult2 = -1.5f * cubed + 2.0f * squared + 0.5f * arg4; + mult3 = 0.5f * (cubed - squared); + + arg5->x = mult0 * arg0->f[0] + mult1 * arg1->f[0] + mult2 * arg2->f[0] + mult3 * arg3->f[0]; + arg5->y = mult0 * arg0->f[1] + mult1 * arg1->f[1] + mult2 * arg2->f[1] + mult3 * arg3->f[1]; + arg5->z = mult0 * arg0->f[2] + mult1 * arg1->f[2] + mult2 * arg2->f[2] + mult3 * arg3->f[2]; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F05AEFC -/* 08FA2C 7F05AEFC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 08FA30 7F05AF00 C7AC0038 */ lwc1 $f12, 0x38($sp) -/* 08FA34 7F05AF04 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 08FA38 7F05AF08 44813000 */ mtc1 $at, $f6 -/* 08FA3C 7F05AF0C 460C6002 */ mul.s $f0, $f12, $f12 -/* 08FA40 7F05AF10 8FAE003C */ lw $t6, 0x3c($sp) -/* 08FA44 7F05AF14 460C0082 */ mul.s $f2, $f0, $f12 -/* 08FA48 7F05AF18 46001101 */ sub.s $f4, $f2, $f0 -/* 08FA4C 7F05AF1C 46026280 */ add.s $f10, $f12, $f2 -/* 08FA50 7F05AF20 46062202 */ mul.s $f8, $f4, $f6 -/* 08FA54 7F05AF24 44812000 */ mtc1 $at, $f4 -/* 08FA58 7F05AF28 3C013FC0 */ li $at, 0x3FC00000 # 1.500000 -/* 08FA5C 7F05AF2C 46045182 */ mul.s $f6, $f10, $f4 -/* 08FA60 7F05AF30 44815000 */ mtc1 $at, $f10 -/* 08FA64 7F05AF34 3C014020 */ li $at, 0x40200000 # 2.500000 -/* 08FA68 7F05AF38 E7A80000 */ swc1 $f8, ($sp) -/* 08FA6C 7F05AF3C 46025102 */ mul.s $f4, $f10, $f2 -/* 08FA70 7F05AF40 46060381 */ sub.s $f14, $f0, $f6 -/* 08FA74 7F05AF44 44813000 */ mtc1 $at, $f6 -/* 08FA78 7F05AF48 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 08FA7C 7F05AF4C 46003282 */ mul.s $f10, $f6, $f0 -/* 08FA80 7F05AF50 460A2181 */ sub.s $f6, $f4, $f10 -/* 08FA84 7F05AF54 44812000 */ mtc1 $at, $f4 -/* 08FA88 7F05AF58 3C01BFC0 */ li $at, 0xBFC00000 # -1.500000 -/* 08FA8C 7F05AF5C 44815000 */ mtc1 $at, $f10 -/* 08FA90 7F05AF60 46043400 */ add.s $f16, $f6, $f4 -/* 08FA94 7F05AF64 3C013F00 */ li $at, 0x3F000000 # 0.500000 -/* 08FA98 7F05AF68 46025182 */ mul.s $f6, $f10, $f2 -/* 08FA9C 7F05AF6C 46000100 */ add.s $f4, $f0, $f0 -/* 08FAA0 7F05AF70 46043280 */ add.s $f10, $f6, $f4 -/* 08FAA4 7F05AF74 44813000 */ mtc1 $at, $f6 -/* 08FAA8 7F05AF78 00000000 */ nop -/* 08FAAC 7F05AF7C 460C3102 */ mul.s $f4, $f6, $f12 -/* 08FAB0 7F05AF80 C4E60000 */ lwc1 $f6, ($a3) -/* 08FAB4 7F05AF84 46045480 */ add.s $f18, $f10, $f4 -/* 08FAB8 7F05AF88 46083282 */ mul.s $f10, $f6, $f8 -/* 08FABC 7F05AF8C C4840000 */ lwc1 $f4, ($a0) -/* 08FAC0 7F05AF90 46047182 */ mul.s $f6, $f14, $f4 -/* 08FAC4 7F05AF94 C4A40000 */ lwc1 $f4, ($a1) -/* 08FAC8 7F05AF98 46048102 */ mul.s $f4, $f16, $f4 -/* 08FACC 7F05AF9C 46043180 */ add.s $f6, $f6, $f4 -/* 08FAD0 7F05AFA0 C4C40000 */ lwc1 $f4, ($a2) -/* 08FAD4 7F05AFA4 46049102 */ mul.s $f4, $f18, $f4 -/* 08FAD8 7F05AFA8 46043180 */ add.s $f6, $f6, $f4 -/* 08FADC 7F05AFAC 46065100 */ add.s $f4, $f10, $f6 -/* 08FAE0 7F05AFB0 E5C40000 */ swc1 $f4, ($t6) -/* 08FAE4 7F05AFB4 C4EA0004 */ lwc1 $f10, 4($a3) -/* 08FAE8 7F05AFB8 C4840004 */ lwc1 $f4, 4($a0) -/* 08FAEC 7F05AFBC 46085182 */ mul.s $f6, $f10, $f8 -/* 08FAF0 7F05AFC0 00000000 */ nop -/* 08FAF4 7F05AFC4 46047282 */ mul.s $f10, $f14, $f4 -/* 08FAF8 7F05AFC8 C4A40004 */ lwc1 $f4, 4($a1) -/* 08FAFC 7F05AFCC 46048102 */ mul.s $f4, $f16, $f4 -/* 08FB00 7F05AFD0 46045280 */ add.s $f10, $f10, $f4 -/* 08FB04 7F05AFD4 C4C40004 */ lwc1 $f4, 4($a2) -/* 08FB08 7F05AFD8 46049102 */ mul.s $f4, $f18, $f4 -/* 08FB0C 7F05AFDC 46045280 */ add.s $f10, $f10, $f4 -/* 08FB10 7F05AFE0 460A3100 */ add.s $f4, $f6, $f10 -/* 08FB14 7F05AFE4 E5C40004 */ swc1 $f4, 4($t6) -/* 08FB18 7F05AFE8 C4E60008 */ lwc1 $f6, 8($a3) -/* 08FB1C 7F05AFEC C4840008 */ lwc1 $f4, 8($a0) -/* 08FB20 7F05AFF0 46083282 */ mul.s $f10, $f6, $f8 -/* 08FB24 7F05AFF4 C4A80008 */ lwc1 $f8, 8($a1) -/* 08FB28 7F05AFF8 46047182 */ mul.s $f6, $f14, $f4 -/* 08FB2C 7F05AFFC 00000000 */ nop -/* 08FB30 7F05B000 46088102 */ mul.s $f4, $f16, $f8 -/* 08FB34 7F05B004 46043200 */ add.s $f8, $f6, $f4 -/* 08FB38 7F05B008 C4C60008 */ lwc1 $f6, 8($a2) -/* 08FB3C 7F05B00C 27BD0028 */ addiu $sp, $sp, 0x28 -/* 08FB40 7F05B010 46069102 */ mul.s $f4, $f18, $f6 -/* 08FB44 7F05B014 46044180 */ add.s $f6, $f8, $f4 -/* 08FB48 7F05B018 46065200 */ add.s $f8, $f10, $f6 -/* 08FB4C 7F05B01C 03E00008 */ jr $ra -/* 08FB50 7F05B020 E5C80008 */ swc1 $f8, 8($t6) -) -#endif /** * Following is cleaned up mips_to_c output. diff --git a/src/game/objecthandler_1.c b/src/game/model.c similarity index 92% rename from src/game/objecthandler_1.c rename to src/game/model.c index 9c1553bf..4fa4ce6f 100644 --- a/src/game/objecthandler_1.c +++ b/src/game/model.c @@ -139,7 +139,7 @@ glabel get_obj_instance_controller_for_header /* 0A0D1C 7F06C1EC 12C00006 */ beqz $s6, .L7F06C208 /* 0A0D20 7F06C1F0 02C02025 */ move $a0, $s6 /* 0A0D24 7F06C1F4 02A02825 */ move $a1, $s5 -/* 0A0D28 7F06C1F8 0FC1D7DA */ jal sub_GAME_7F075F68 +/* 0A0D28 7F06C1F8 0FC1D7DA */ jal modelInit /* 0A0D2C 7F06C1FC 8FA60040 */ lw $a2, 0x40($sp) /* 0A0D30 7F06C200 87B9003E */ lh $t9, 0x3e($sp) /* 0A0D34 7F06C204 A6D90002 */ sh $t9, 2($s6) @@ -267,7 +267,7 @@ glabel get_aircraft_obj_instance_controller /* 0A0EB4 7F06C384 02002025 */ move $a0, $s0 /* 0A0EB8 7F06C388 8FA50030 */ lw $a1, 0x30($sp) /* 0A0EBC 7F06C38C 8FA60028 */ lw $a2, 0x28($sp) -/* 0A0EC0 7F06C390 0FC1D7EB */ jal sub_GAME_7F075FAC +/* 0A0EC0 7F06C390 0FC1D7EB */ jal animInit /* 0A0EC4 7F06C394 A7A80026 */ sh $t0, 0x26($sp) /* 0A0EC8 7F06C398 87A80026 */ lh $t0, 0x26($sp) /* 0A0ECC 7F06C39C A6080002 */ sh $t0, 2($s0) @@ -285,24 +285,25 @@ glabel get_aircraft_obj_instance_controller -void sub_GAME_7F06C3B4(Model *model, s32 node, ModelFileHeader *header) +void modelAttachHead(Model *model, ModelNode *node, ModelFileHeader *head) { - sub_GAME_7F076030(model,model->obj,node,header); - modelInitRwData(model,header->RootNode); + modelAttachPart(model,model->obj,node,head); + modelInitRwData(model,head->RootNode); } -void set_aircraft_obj_inst_scale_to_zero(Model *objinstance) +void clear_aircraft_model_obj(Model *objinstance) { objinstance->obj = NULL; return; } -void set_80036084(s32 param_1) { +void modelSetDistanceDisabled(s32 param_1) { g_ModelDistanceDisabled = param_1; } -void set_float_80036088(f32 param_1) { +// PD: modelSetDistanceScale +void modelSetDistanceScale(f32 param_1) { g_ModelDistanceScale = param_1; } @@ -350,6 +351,7 @@ void set_vtxallocator(s32 param_1) { #if defined(LEFTOVERDEBUG) +//called after a debug print during failed model operation void return_null(void) { return; } @@ -392,7 +394,8 @@ void sub_GAME_7F06C550(Model* model, coord3d* coord) } -s32 sub_GAME_7F06C570(ModelNode *node, s32 arg1) +// PD: model0001a524 +s32 modelFindNodeMtxIndex(ModelNode *node, s32 arg1) { s32 index; union ModelRoData *rodata1; @@ -404,19 +407,19 @@ s32 sub_GAME_7F06C570(ModelNode *node, s32 arg1) { switch (node->Opcode & 0xff) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: rodata1 = node->Data; return (s16)rodata1->Header.ModelType; - case MODELNODE_OPCODE_GROUPRECORD: + case MODELNODE_OPCODE_GROUP: rodata2 = node->Data; return rodata2->Group.MatrixIDs[arg1 == 0x200 ? 2 : (arg1 == 0x100 ? 1 : 0)]; - case MODELNODE_OPCODE_UNUSED_03: + case MODELNODE_OPCODE_OP03: rodata3 = node->Data; return rodata3->Group.MatrixIDs[arg1 == 0x200 ? 2 : (arg1 == 0x100 ? 1 : 0)]; - case MODELNODE_OPCODE_GROUPSIMPLERECORD: + case MODELNODE_OPCODE_GROUPSIMPLE: rodata4 = node->Data; return rodata4->GroupSimple.Group1; break; @@ -429,8 +432,9 @@ s32 sub_GAME_7F06C570(ModelNode *node, s32 arg1) } -Mtxf *sub_GAME_7F06C660(struct Model *model, struct ModelNode *node, s32 arg2) { - s32 index = sub_GAME_7F06C570(node, arg2); +// PD: model0001a5cc +Mtxf *modelFindNodeMtx(struct Model *model, struct ModelNode *node, s32 arg2) { + s32 index = modelFindNodeMtxIndex(node, arg2); if (index >= 0) { return &model->render_pos[index].pos; @@ -441,6 +445,7 @@ Mtxf *sub_GAME_7F06C660(struct Model *model, struct ModelNode *node, s32 arg2) { //rejoined per EU +// PD: model0001a60c Mtxf *getsubmatrix(Model *objinst) { #if defined(LEFTOVERDEBUG) @@ -455,7 +460,7 @@ Mtxf *getsubmatrix(Model *objinst) return_null(); } #endif - return sub_GAME_7F06C660(objinst, objinst->obj->RootNode, 0); + return modelFindNodeMtx(objinst, objinst->obj->RootNode, 0); } @@ -499,47 +504,47 @@ union ModelRwData* modelGetNodeRwData(Model *Objinst, ModelNode *root) switch (root->Opcode & 0xff) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: { index = root->Data->Header.RwDataIndex; break; } - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: { index = root->Data->DisplayListCollisions.RwDataIndex; break; } - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: { index = root->Data->Op07.RwDataIndex; break; } - case MODELNODE_OPCODE_LODRECORD: + case MODELNODE_OPCODE_LOD: { index = root->Data->LOD.RwDataIndex; break; } - case MODELNODE_OPCODE_SWITCHRECORD: + case MODELNODE_OPCODE_SWITCH: { index = root->Data->Switch.RwDataIndex; break; } - case MODELNODE_OPCODE_BSPRECORD: + case MODELNODE_OPCODE_BSP: { index = root->Data->BSP.RwDataIndex; break; } - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: { index = root->Data->Op11.RwDataIndex; break; } - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: { index = root->Data->Gunfire.RwDataIndex; break; } - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: + case MODELNODE_OPCODE_HEAD: { index = root->Data->HeadPlaceholder.RwDataIndex; break; @@ -549,7 +554,7 @@ union ModelRwData* modelGetNodeRwData(Model *Objinst, ModelNode *root) while (root->Parent) { root = root->Parent; - if ((root->Opcode & 0xFF) == MODELNODE_OPCODE_HEADPLACEHOLDERRECORD) + if ((root->Opcode & 0xFF) == MODELNODE_OPCODE_HEAD) { ModelRwData_HeadPlaceholderRecord *tmp = modelGetNodeRwData(Objinst, root); data = tmp->RwDatas; @@ -578,7 +583,7 @@ void getpartoffset(Model *objinst, ModelNode *part, coord3d *offset) //#MATCH - #endif switch (part->Opcode & 0xFF) { - case 1: + case MODELNODE_OPCODE_HEADER: { struct modeldata_root *root = modelGetNodeRwData(objinst, part); offset->x = root->pos.x; @@ -586,7 +591,7 @@ void getpartoffset(Model *objinst, ModelNode *part, coord3d *offset) //#MATCH - offset->z = root->pos.z; break; } - case 2: + case MODELNODE_OPCODE_GROUP: { ModelRoData_GroupRecord *prt = &part->Data->Group; offset->x = prt->Origin.x; @@ -594,7 +599,7 @@ void getpartoffset(Model *objinst, ModelNode *part, coord3d *offset) //#MATCH - offset->z = prt->Origin.z; break; } - case 3: + case MODELNODE_OPCODE_OP03: { ModelRoData_GroupSimpleRecord *prt = &part->Data->GroupSimple; //UNUSED at this time offset->x = prt->Origin.x; @@ -602,7 +607,7 @@ void getpartoffset(Model *objinst, ModelNode *part, coord3d *offset) //#MATCH - offset->z = prt->Origin.z; break; } - case 21: + case MODELNODE_OPCODE_GROUPSIMPLE: { ModelRoData_GroupSimpleRecord *prt = &part->Data->GroupSimple; offset->x = prt->Origin.x; @@ -640,7 +645,7 @@ void setpartoffset(Model *model, ModelNode *node, coord3d *pos) #endif switch (node->Opcode & 0xff) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: { ModelRwData_HeaderRecord *rwdata = modelGetNodeRwData(model, node); coord3d diff[1]; @@ -658,7 +663,7 @@ void setpartoffset(Model *model, ModelNode *node, coord3d *pos) rwdata->unk4c.x += diff[0].x; rwdata->unk4c.z += diff[0].z; } break; - case MODELNODE_OPCODE_GROUPRECORD: + case MODELNODE_OPCODE_GROUP: { ModelRoData_GroupRecord *rodata = &node->Data->Group; rodata->Origin.x = pos->x; @@ -666,7 +671,7 @@ void setpartoffset(Model *model, ModelNode *node, coord3d *pos) rodata->Origin.z = pos->z; } break; - case MODELNODE_OPCODE_UNUSED_03: + case MODELNODE_OPCODE_OP03: { ModelRoData_GroupRecord *rodata = &node->Data->Group; rodata->Origin.x = pos->x; @@ -674,7 +679,7 @@ void setpartoffset(Model *model, ModelNode *node, coord3d *pos) rodata->Origin.z = pos->z; } break; - case MODELNODE_OPCODE_GROUPSIMPLERECORD: + case MODELNODE_OPCODE_GROUPSIMPLE: { ModelRoData_GroupSimpleRecord *rodata = &node->Data->GroupSimple; rodata->Origin.x = pos->x; @@ -808,7 +813,7 @@ void setsubroty(Model *model, f32 angle) } #endif node = model->obj->RootNode; - if ((node->Opcode & 0xff) == MODELNODE_OPCODE_HEADERRECORD) + if ((node->Opcode & 0xff) == MODELNODE_OPCODE_HEADER) { ModelRwData_HeaderRecord *rwdata = modelGetNodeRwData(model, node); f32 diff = angle - rwdata->unk14; @@ -860,52 +865,52 @@ f32 getjointsize(Model *model, ModelNode *node) { switch (node->Opcode & 0xFF) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: { ModelRoData_HeaderRecord *rodata = &node->Data->Header; return rodata->GroupsAsF32 * model->scale; } - case MODELNODE_OPCODE_GROUPRECORD: + case MODELNODE_OPCODE_GROUP: { ModelRoData_GroupRecord *rodata = &node->Data->Group; return rodata->BoundingVolumeRadius * model->scale; } - case MODELNODE_OPCODE_UNUSED_03: + case MODELNODE_OPCODE_OP03: { ModelRoData_GroupRecord *rodata = &node->Data->Group; return rodata->BoundingVolumeRadius * model->scale; } - case MODELNODE_OPCODE_GROUPSIMPLERECORD: + case MODELNODE_OPCODE_GROUPSIMPLE: { ModelRoData_GroupSimpleRecord *rodata = &node->Data->GroupSimple; return rodata->BoundingVolumeRadius * model->scale; } - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: { ModelRoData_Op11Record *rodata = &node->Data->Op11; return rodata->BoundingVolumeRadius * model->scale; } - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: { ModelRoData_GunfireRecord *rodata = &node->Data->Gunfire; return rodata->Scale * model->scale; } - case MODELNODE_OPCODE_SHADOWRECORD: + case MODELNODE_OPCODE_SHADOW: { ModelRoData_ShadowRecord *rodata = &node->Data->Shadow; return rodata->Scale * model->scale; } - case MODELNODE_OPCODE_OP14RECORD: + case MODELNODE_OPCODE_OP14: { ModelRoData_Op14Record *rodata = &node->Data->Op14; return rodata->Scale * model->scale; } - case MODELNODE_OPCODE_INTERLINKAGERECORD: + case MODELNODE_OPCODE_INTERLINK: { ModelRoData_InterlinkageRecord *rodata = &node->Data->Interlinkage; return rodata->Scale * model->scale; } - case MODELNODE_OPCODE_OP16RECORD: + case MODELNODE_OPCODE_OP16: { ModelNode_Op16Record *rodata = &node->Data->Op16; return rodata->Scale * model->scale; @@ -922,6 +927,7 @@ f32 getjointsize(Model *model, ModelNode *node) /** * Address 0x7F06D00C. + * PD: model0001af80 */ f32 getinstsize(Model *arg0) { @@ -944,15 +950,17 @@ f32 getinstsize(Model *arg0) -void interpolate3dVectors(vec3d *v, vec3d *w, float k) +// PD: model0001af98 +void interpolate3dVectors(vec3d *v, vec3d *w, float frac) { - v->x += (w->x - v->x) * k; - v->y += (w->y - v->y) * k; - v->z += (w->z - v->z) * k; + v->x += (w->x - v->x) * frac; + v->y += (w->y - v->y) * frac; + v->z += (w->z - v->z) * frac; return; } +// PD: model0001afe8 f32 sub_GAME_7F06D0CC(f32 arg0, f32 angle, f32 mult) { f32 value = angle - arg0; @@ -985,6 +993,7 @@ f32 sub_GAME_7F06D0CC(f32 arg0, f32 angle, f32 mult) } +// PD: model0001b07c void sub_GAME_7F06D160(coord3d *arg0, coord3d *arg1, f32 mult) { arg0->x = sub_GAME_7F06D0CC(arg0->x, arg1->x, mult); @@ -1414,122 +1423,61 @@ void subcalcpos(Model *arg0) } } +void process_01_group_heading(ModelRenderData* renderdata, Model* model, ModelNode* node) +{ + union ModelRoData* rodata; + union ModelRwData* rwdata; + f32 scale; + f32* pos; + f32 unk14; + Mtxf* var_a3; + s32 modeltype; + RenderPosView* renderpos; + Mtxf sp20; + + rodata = node->Data; + rwdata = modelGetNodeRwData(model, node); + + scale = model->scale; + pos = &rwdata->Header.pos.x; + unk14 = rwdata->Header.unk14; + modeltype = (s16)rodata->Header.ModelType; + renderpos = &model->render_pos[modeltype]; + + if (node->Parent != NULL) + { + var_a3 = modelFindNodeMtx(model, node->Parent, 0); + } + else + { + var_a3 = renderdata->unk00; + } + if (rwdata->Header.unk18 != 0.0f) + { + unk14 = sub_GAME_7F06D0CC(unk14, rwdata->Header.unk1c, rwdata->Header.unk18); + } -#ifdef NONMATCHING -void process_01_group_heading(ModelRenderData *arg0, Model *model, ModelNode *node) { + if (var_a3 != NULL) + { + matrix_4x4_set_position_and_rotation_around_y(pos, unk14, &sp20); -} -#else -void process_01_group_heading(ModelRenderData *arg0, Model *model, ModelNode *node); -GLOBAL_ASM( -.text -glabel process_01_group_heading -/* 0A2268 7F06D738 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 0A226C 7F06D73C AFBF0014 */ sw $ra, 0x14($sp) -/* 0A2270 7F06D740 AFA40080 */ sw $a0, 0x80($sp) -/* 0A2274 7F06D744 8CCE0004 */ lw $t6, 4($a2) -/* 0A2278 7F06D748 00A03825 */ move $a3, $a1 -/* 0A227C 7F06D74C 00A02025 */ move $a0, $a1 -/* 0A2280 7F06D750 00C02825 */ move $a1, $a2 -/* 0A2284 7F06D754 AFA70084 */ sw $a3, 0x84($sp) -/* 0A2288 7F06D758 AFA60088 */ sw $a2, 0x88($sp) -/* 0A228C 7F06D75C 0FC1B1E7 */ jal modelGetNodeRwData -/* 0A2290 7F06D760 AFAE007C */ sw $t6, 0x7c($sp) -/* 0A2294 7F06D764 8FA70084 */ lw $a3, 0x84($sp) -/* 0A2298 7F06D768 8FB8007C */ lw $t8, 0x7c($sp) -/* 0A229C 7F06D76C 244F0008 */ addiu $t7, $v0, 8 -/* 0A22A0 7F06D770 C4E40014 */ lwc1 $f4, 0x14($a3) -/* 0A22A4 7F06D774 AFAF0070 */ sw $t7, 0x70($sp) -/* 0A22A8 7F06D778 8FA60088 */ lw $a2, 0x88($sp) -/* 0A22AC 7F06D77C E7A40074 */ swc1 $f4, 0x74($sp) -/* 0A22B0 7F06D780 87030002 */ lh $v1, 2($t8) -/* 0A22B4 7F06D784 8CF9000C */ lw $t9, 0xc($a3) -/* 0A22B8 7F06D788 C44C0014 */ lwc1 $f12, 0x14($v0) -/* 0A22BC 7F06D78C 00034980 */ sll $t1, $v1, 6 -/* 0A22C0 7F06D790 03295021 */ addu $t2, $t9, $t1 -/* 0A22C4 7F06D794 AFAA0060 */ sw $t2, 0x60($sp) -/* 0A22C8 7F06D798 8CC50008 */ lw $a1, 8($a2) -/* 0A22CC 7F06D79C 00404025 */ move $t0, $v0 -/* 0A22D0 7F06D7A0 8FAB0080 */ lw $t3, 0x80($sp) -/* 0A22D4 7F06D7A4 10A00009 */ beqz $a1, .L7F06D7CC -/* 0A22D8 7F06D7A8 00E02025 */ move $a0, $a3 -/* 0A22DC 7F06D7AC 00003025 */ move $a2, $zero -/* 0A22E0 7F06D7B0 AFA20078 */ sw $v0, 0x78($sp) -/* 0A22E4 7F06D7B4 0FC1B198 */ jal sub_GAME_7F06C660 -/* 0A22E8 7F06D7B8 E7AC006C */ swc1 $f12, 0x6c($sp) -/* 0A22EC 7F06D7BC 8FA80078 */ lw $t0, 0x78($sp) -/* 0A22F0 7F06D7C0 C7AC006C */ lwc1 $f12, 0x6c($sp) -/* 0A22F4 7F06D7C4 10000002 */ b .L7F06D7D0 -/* 0A22F8 7F06D7C8 00403825 */ move $a3, $v0 -.L7F06D7CC: -/* 0A22FC 7F06D7CC 8D670000 */ lw $a3, ($t3) -.L7F06D7D0: -/* 0A2300 7F06D7D0 C5000018 */ lwc1 $f0, 0x18($t0) -/* 0A2304 7F06D7D4 44803000 */ mtc1 $zero, $f6 -/* 0A2308 7F06D7D8 00000000 */ nop -/* 0A230C 7F06D7DC 46003032 */ c.eq.s $f6, $f0 -/* 0A2310 7F06D7E0 00000000 */ nop -/* 0A2314 7F06D7E4 45010007 */ bc1t .L7F06D804 -/* 0A2318 7F06D7E8 00000000 */ nop -/* 0A231C 7F06D7EC C50E001C */ lwc1 $f14, 0x1c($t0) -/* 0A2320 7F06D7F0 44060000 */ mfc1 $a2, $f0 -/* 0A2324 7F06D7F4 0FC1B433 */ jal sub_GAME_7F06D0CC -/* 0A2328 7F06D7F8 AFA70068 */ sw $a3, 0x68($sp) -/* 0A232C 7F06D7FC 8FA70068 */ lw $a3, 0x68($sp) -/* 0A2330 7F06D800 46000306 */ mov.s $f12, $f0 -.L7F06D804: -/* 0A2334 7F06D804 10E00019 */ beqz $a3, .L7F06D86C -/* 0A2338 7F06D808 8FA40070 */ lw $a0, 0x70($sp) -/* 0A233C 7F06D80C 44056000 */ mfc1 $a1, $f12 -/* 0A2340 7F06D810 8FA40070 */ lw $a0, 0x70($sp) -/* 0A2344 7F06D814 27A60020 */ addiu $a2, $sp, 0x20 -/* 0A2348 7F06D818 0FC16134 */ jal matrix_4x4_set_position_and_rotation_around_y -/* 0A234C 7F06D81C AFA70068 */ sw $a3, 0x68($sp) -/* 0A2350 7F06D820 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A2354 7F06D824 44815000 */ mtc1 $at, $f10 -/* 0A2358 7F06D828 C7A80074 */ lwc1 $f8, 0x74($sp) -/* 0A235C 7F06D82C 8FA70068 */ lw $a3, 0x68($sp) -/* 0A2360 7F06D830 27A50020 */ addiu $a1, $sp, 0x20 -/* 0A2364 7F06D834 460A4032 */ c.eq.s $f8, $f10 -/* 0A2368 7F06D838 00000000 */ nop -/* 0A236C 7F06D83C 45030006 */ bc1tl .L7F06D858 -/* 0A2370 7F06D840 00E02025 */ move $a0, $a3 -/* 0A2374 7F06D844 46004306 */ mov.s $f12, $f8 -/* 0A2378 7F06D848 0FC162C4 */ jal matrix_scalar_multiply_2 -/* 0A237C 7F06D84C AFA70068 */ sw $a3, 0x68($sp) -/* 0A2380 7F06D850 8FA70068 */ lw $a3, 0x68($sp) -/* 0A2384 7F06D854 00E02025 */ move $a0, $a3 -.L7F06D858: -/* 0A2388 7F06D858 27A50020 */ addiu $a1, $sp, 0x20 -/* 0A238C 7F06D85C 0FC16063 */ jal matrix_4x4_multiply_homogeneous -/* 0A2390 7F06D860 8FA60060 */ lw $a2, 0x60($sp) -/* 0A2394 7F06D864 1000000F */ b .L7F06D8A4 -/* 0A2398 7F06D868 8FBF0014 */ lw $ra, 0x14($sp) -.L7F06D86C: -/* 0A239C 7F06D86C 44056000 */ mfc1 $a1, $f12 -/* 0A23A0 7F06D870 0FC16134 */ jal matrix_4x4_set_position_and_rotation_around_y -/* 0A23A4 7F06D874 8FA60060 */ lw $a2, 0x60($sp) -/* 0A23A8 7F06D878 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A23AC 7F06D87C 44819000 */ mtc1 $at, $f18 -/* 0A23B0 7F06D880 C7B00074 */ lwc1 $f16, 0x74($sp) -/* 0A23B4 7F06D884 8FA50060 */ lw $a1, 0x60($sp) -/* 0A23B8 7F06D888 46128032 */ c.eq.s $f16, $f18 -/* 0A23BC 7F06D88C 00000000 */ nop -/* 0A23C0 7F06D890 45030004 */ bc1tl .L7F06D8A4 -/* 0A23C4 7F06D894 8FBF0014 */ lw $ra, 0x14($sp) -/* 0A23C8 7F06D898 0FC162C4 */ jal matrix_scalar_multiply_2 -/* 0A23CC 7F06D89C 46008306 */ mov.s $f12, $f16 -/* 0A23D0 7F06D8A0 8FBF0014 */ lw $ra, 0x14($sp) -.L7F06D8A4: -/* 0A23D4 7F06D8A4 27BD0080 */ addiu $sp, $sp, 0x80 -/* 0A23D8 7F06D8A8 03E00008 */ jr $ra -/* 0A23DC 7F06D8AC 00000000 */ nop -) -#endif + if (scale != 1.0f) + { + matrix_scalar_multiply_2(scale, sp20.m[0]); + } + matrix_4x4_multiply_homogeneous(var_a3, &sp20, &renderpos->pos); + return; + } + matrix_4x4_set_position_and_rotation_around_y(pos, unk14, &renderpos->pos); + if (scale != 1.0f) + { + matrix_scalar_multiply_2(scale, renderpos->pos.m[0]); + } +} #ifdef NONMATCHING @@ -1574,7 +1522,7 @@ glabel sub_GAME_7F06D8B0 /* 0A2428 7F06D8F8 11800006 */ beqz $t4, .L7F06D914 /* 0A242C 7F06D8FC AFAC001C */ sw $t4, 0x1c($sp) /* 0A2430 7F06D900 00A02025 */ move $a0, $a1 -/* 0A2434 7F06D904 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A2434 7F06D904 0FC1B198 */ jal modelFindNodeMtx /* 0A2438 7F06D908 01802825 */ move $a1, $t4 /* 0A243C 7F06D90C 10000003 */ b .L7F06D91C /* 0A2440 7F06D910 AFA200AC */ sw $v0, 0xac($sp) @@ -1788,7 +1736,7 @@ glabel sub_GAME_7F06DB5C /* 0A26D4 7F06DBA4 11800006 */ beqz $t4, .L7F06DBC0 /* 0A26D8 7F06DBA8 AFAC001C */ sw $t4, 0x1c($sp) /* 0A26DC 7F06DBAC 00A02025 */ move $a0, $a1 -/* 0A26E0 7F06DBB0 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A26E0 7F06DBB0 0FC1B198 */ jal modelFindNodeMtx /* 0A26E4 7F06DBB4 01802825 */ move $a1, $t4 /* 0A26E8 7F06DBB8 10000003 */ b .L7F06DBC8 /* 0A26EC 7F06DBBC AFA2009C */ sw $v0, 0x9c($sp) @@ -2369,7 +2317,7 @@ glabel sub_GAME_7F06E2B8 /* 0A2E34 7F06E304 8C8B0000 */ lw $t3, ($a0) /* 0A2E38 7F06E308 00A02025 */ move $a0, $a1 /* 0A2E3C 7F06E30C 00E02825 */ move $a1, $a3 -/* 0A2E40 7F06E310 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A2E40 7F06E310 0FC1B198 */ jal modelFindNodeMtx /* 0A2E44 7F06E314 AFA3004C */ sw $v1, 0x4c($sp) /* 0A2E48 7F06E318 8FA3004C */ lw $v1, 0x4c($sp) /* 0A2E4C 7F06E31C 10000003 */ b .L7F06E32C @@ -2736,7 +2684,7 @@ void process_15_subposition(ModelRenderData* arg0, Model *model, ModelNode *node if (node->Parent) { - sp68 = sub_GAME_7F06C660(model, node->Parent, 0); + sp68 = modelFindNodeMtx(model, node->Parent, 0); } else { @@ -2754,12 +2702,14 @@ void process_15_subposition(ModelRenderData* arg0, Model *model, ModelNode *node } } - -void process_08_distance_triggers(Model* model, ModelNode* node) +/* +* Address: 0x7F06E858 +*/ +void modelUpdateDistanceRelations(Model* model, ModelNode* node) { union ModelRoData *rodata = node->Data; union ModelRwData *rwdata = modelGetNodeRwData(model, node); - Mtxf *mtx = sub_GAME_7F06C660(model, node, 0); + Mtxf *mtx = modelFindNodeMtx(model, node, 0); f32 distance; if (g_ModelDistanceDisabled) @@ -2790,8 +2740,10 @@ void process_08_distance_triggers(Model* model, ModelNode* node) node->Child = NULL; } - -void sub_GAME_7F06E970(Model* model, ModelNode* node) +/* +* Address: 0x7F06E970 +*/ +void modelApplyDistanceRelations(Model* model, ModelNode* node) { ModelRoData_LODRecord *rodata = &node->Data->LOD; ModelRwData_LODRecord *rwdata = modelGetNodeRwData(model, node); @@ -2807,7 +2759,7 @@ void sub_GAME_7F06E970(Model* model, ModelNode* node) } -void process_12_handle_switch(Model* model, ModelNode* node) +void modelApplyToggleRelations(Model* model, ModelNode* node) { ModelRoData_SwitchRecord *rodata = &node->Data->Switch; ModelRwData_SwitchRecord *rwdata = modelGetNodeRwData(model, node); @@ -2823,7 +2775,7 @@ void process_12_handle_switch(Model* model, ModelNode* node) } -void process_17_pointer_to_head(Model* model, ModelNode* bodynode) +void modelApplyHeadRelations(Model* model, ModelNode* bodynode) { struct ModelRwData_HeadPlaceholderRecord *rwdata = modelGetNodeRwData(model, bodynode); @@ -2842,7 +2794,7 @@ void process_17_pointer_to_head(Model* model, ModelNode* bodynode) } -void sub_GAME_7F06EA54(ModelNode *basenode, bool visible) +void modelApplyReorderRelationsByArg(ModelNode *basenode, bool visible) { union ModelRoData *rodata = basenode->Data; ModelNode *node1; @@ -2907,18 +2859,18 @@ void sub_GAME_7F06EA54(ModelNode *basenode, bool visible) } -void sub_GAME_7F06EB10(Model* model, ModelNode* node) +void modelApplyReorderRelations(Model* model, ModelNode* node) { union ModelRwData *rwdata = modelGetNodeRwData(model, node); - sub_GAME_7F06EA54(node, rwdata->BSP.visible); + modelApplyReorderRelationsByArg(node, rwdata->BSP.visible); } -void process_09_head_hat_placement_interlink(Model *model, ModelNode *node) +void modelUpdateReorderRelations(Model *model, ModelNode *node) { union ModelRoData *rodata = node->Data; union ModelRwData *rwdata = modelGetNodeRwData(model, node); - Mtxf *mtx = sub_GAME_7F06C660(model, node, 0); + Mtxf *mtx = modelFindNodeMtx(model, node, 0); coord3d sp38; coord3d sp2c; f32 tmp; @@ -2928,7 +2880,7 @@ void process_09_head_hat_placement_interlink(Model *model, ModelNode *node) sp38.x = rodata->BSP.Vector.f[0]; sp38.y = rodata->BSP.Vector.f[1]; sp38.z = rodata->BSP.Vector.f[2]; - matrix_4x4_rotate_vector_in_place(mtx, sp38.f); + mtx4RotateVecInPlace(mtx, sp38.f); } else if (rodata->BSP.reserved == 2) { @@ -2953,7 +2905,7 @@ void process_09_head_hat_placement_interlink(Model *model, ModelNode *node) sp2c.y = rodata->BSP.Point.f[1]; sp2c.z = rodata->BSP.Point.f[2]; - matrix_4x4_transform_vector_in_place(mtx, sp2c.f); + mtx4TransformVecInPlace(mtx, &sp2c); tmp = sp38.f[0] * sp2c.f[0] + sp38.f[1] * sp2c.f[1] + sp38.f[2] * sp2c.f[2]; @@ -2966,7 +2918,7 @@ void process_09_head_hat_placement_interlink(Model *model, ModelNode *node) rwdata->BSP.visible = FALSE; } - sub_GAME_7F06EB10(model, node); + modelApplyReorderRelations(model, node); } @@ -2974,7 +2926,7 @@ void process_07_unknown(Model *model, ModelNode *node) { union ModelRoData *rodata = node->Data; union ModelRwData *rwdata = modelGetNodeRwData(model, node); - Mtxf *mtx = sub_GAME_7F06C660(model, node, 0); + Mtxf *mtx = modelFindNodeMtx(model, node, 0); f32 ratio; f32 coord_multiplied; coord3d coord; @@ -3006,7 +2958,7 @@ void process_07_unknown(Model *model, ModelNode *node) } -void sub_GAME_7F06EEA4(Model *model, ModelNode *parent) +void modelUpdateRelationsQuick(Model *model, ModelNode *parent) { ModelNode *node = parent->Child; ModelNode **unused_parent; @@ -3018,31 +2970,31 @@ void sub_GAME_7F06EEA4(Model *model, ModelNode *parent) switch (type) { - case MODELNODE_OPCODE_HEADERRECORD: - case MODELNODE_OPCODE_GROUPRECORD: - case MODELNODE_OPCODE_UNUSED_03: - case MODELNODE_OPCODE_OP11RECORD: - case MODELNODE_OPCODE_GUNFIRERECORD: - case MODELNODE_OPCODE_SHADOWRECORD: - case MODELNODE_OPCODE_OP14RECORD: - case MODELNODE_OPCODE_INTERLINKAGERECORD: - case MODELNODE_OPCODE_OP16RECORD: - case MODELNODE_OPCODE_GROUPSIMPLERECORD: + case MODELNODE_OPCODE_HEADER: + case MODELNODE_OPCODE_GROUP: + case MODELNODE_OPCODE_OP03: + case MODELNODE_OPCODE_OP11: + case MODELNODE_OPCODE_GUNFIRE: + case MODELNODE_OPCODE_SHADOW: + case MODELNODE_OPCODE_OP14: + case MODELNODE_OPCODE_INTERLINK: + case MODELNODE_OPCODE_OP16: + case MODELNODE_OPCODE_GROUPSIMPLE: dochildren = FALSE; break; - case MODELNODE_OPCODE_LODRECORD: - process_08_distance_triggers(model, node); + case MODELNODE_OPCODE_LOD: + modelUpdateDistanceRelations(model, node); break; - case MODELNODE_OPCODE_BSPRECORD: - process_09_head_hat_placement_interlink(model, node); + case MODELNODE_OPCODE_BSP: + modelUpdateReorderRelations(model, node); break; - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: process_07_unknown(model, node); break; - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: - process_17_pointer_to_head(model, node); + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); break; - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: break; } @@ -3084,28 +3036,28 @@ void sub_GAME_7F06EFC4(Model *model) switch (type) { - case MODELNODE_OPCODE_LODRECORD: - process_08_distance_triggers(model, node); + case MODELNODE_OPCODE_LOD: + modelUpdateDistanceRelations(model, node); break; - case MODELNODE_OPCODE_BSPRECORD: - process_09_head_hat_placement_interlink(model, node); + case MODELNODE_OPCODE_BSP: + modelUpdateReorderRelations(model, node); break; - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: process_07_unknown(model, node); break; - case MODELNODE_OPCODE_SWITCHRECORD: - process_12_handle_switch(model, node); + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(model, node); break; - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: - process_17_pointer_to_head(model, node); + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); break; - case MODELNODE_OPCODE_HEADERRECORD: - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_HEADER: + case MODELNODE_OPCODE_DLCOLLISION: default: break; } @@ -3131,7 +3083,7 @@ void sub_GAME_7F06EFC4(Model *model) } -void sub_GAME_7F06F0D0(ModelRenderData *arg0, Model *model) +void modelUpdateMatrices(ModelRenderData *arg0, Model *model) { ModelNode *node = model->obj->RootNode; @@ -3141,43 +3093,43 @@ void sub_GAME_7F06F0D0(ModelRenderData *arg0, Model *model) switch (type) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: process_01_group_heading(arg0, model, node); break; - case MODELNODE_OPCODE_GROUPRECORD: + case MODELNODE_OPCODE_GROUP: process_02_position(arg0, model, node); break; - case MODELNODE_OPCODE_UNUSED_03: + case MODELNODE_OPCODE_OP03: process_03_unknown(arg0, model, node); break; - case MODELNODE_OPCODE_GROUPSIMPLERECORD: + case MODELNODE_OPCODE_GROUPSIMPLE: process_15_subposition(arg0, model, node); break; - case MODELNODE_OPCODE_LODRECORD: - process_08_distance_triggers(model, node); + case MODELNODE_OPCODE_LOD: + modelUpdateDistanceRelations(model, node); break; - case MODELNODE_OPCODE_BSPRECORD: - process_09_head_hat_placement_interlink(model, node); + case MODELNODE_OPCODE_BSP: + modelUpdateReorderRelations(model, node); break; - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: process_07_unknown(model, node); break; - case MODELNODE_OPCODE_SWITCHRECORD: - process_12_handle_switch(model, node); + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(model, node); break; - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: - process_17_pointer_to_head(model, node); + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); break; - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: default: break; } @@ -3226,7 +3178,7 @@ void instcalcmatrices(struct unk_joint_list* arg0, Model* arg1) #endif arg1->render_pos = (RenderPosView* ) arg0->mtxlist; arg0->mtxlist += arg1->obj->numMatrices; - sub_GAME_7F06F0D0((ModelRenderData* ) arg0, arg1); + modelUpdateMatrices((ModelRenderData* ) arg0, arg1); } @@ -3365,7 +3317,7 @@ f32 sub_GAME_7F06F5C4(Model *model) f32 unk3c; ModelAnimation *modelAnimation; - unk3c = model->unk3c; + unk3c = model->endframe; if (unk3c >= 0.0f) { return unk3c; @@ -3408,19 +3360,57 @@ f32 modelGetAbsAnimSpeed(Model *model) /** * Unused Function */ -f32 sub_GAME_7F06F640(Model *model) { - return modelGetAnimSpeed(model) * model->unka4; +f32 modelGetEffectiveAnimSpeed(Model *model) { + return modelGetAnimSpeed(model) * model->playspeed; } #ifdef NONMATCHING -void sub_GAME_7F06F66C(void) { +s32 modelConstrainOrWrapAnimFrame(s32 frame, ModelAnimation *anim, f32 endframe) +{ + //s32 frame; + //u16 animnum->unk4; + //u16 animnum->unk4; + //frame = frame; + if (frame < 0) + { + if (animnum->unk7 & 1) + { + //animnum->unk4 = animnum->unk4; + frame = animnum->unk4 - ((s32) -frame % (s32) animnum->unk4); + } + else + { + frame = 0; + } + } + else if ((endframe >= 0.0f) && ((s32) endframe < frame)) + { + frame = ceilFloatToInt(endframe); + } + else + { + //animnum->unk4 = animnum->unk4; + if (frame >= (s32) animnum->unk4) + { + if (animnum->unk7 & 1) + { + frame = frame % (s32) animnum->unk4; + } + else + { + frame = animnum->unk4 - 1; + } + } + } + return frame; } #else +s32 modelConstrainOrWrapAnimFrame(s32 frame, ModelAnimation *anim, f32 endframe); GLOBAL_ASM( .text -glabel sub_GAME_7F06F66C +glabel modelConstrainOrWrapAnimFrame /* 0A419C 7F06F66C 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0A41A0 7F06F670 44866000 */ mtc1 $a2, $f12 /* 0A41A4 7F06F674 04810017 */ bgez $a0, .L7F06F6D4 @@ -3507,7 +3497,7 @@ glabel sub_GAME_7F06F66C #ifdef NONMATCHING -void sub_GAME_7F06F780(Model *model, f32 arg1) +void modelCopyAnimForMerge(Model *model, f32 arg1) { ModelNode *temp_a1; f32 temp_f10; @@ -3517,14 +3507,13 @@ void sub_GAME_7F06F780(Model *model, f32 arg1) f32 temp_f6; f32 temp_f8; modeldata_root *temp_v0_2; - void *temp_v0; - - if ((arg1 > 0.0f) && (temp_v0 = model->anim, (temp_v0 != 0))) + + if ((arg1 > 0.0f) && (model->anim != 0)) { temp_a1 = model->obj->RootNode; model->unk58 = model->unk28; model->unk5C = model->unk2C; - model->unk54 = temp_v0; + model->unk54 = model->anim; model->unk25 = model->unk24; model->unk60 = model->unk30; model->unk62 = model->unk32; @@ -3533,7 +3522,7 @@ void sub_GAME_7F06F780(Model *model, f32 arg1) model->unk78 = model->oldspeed; model->unk7C = model->timespeed; model->unk80 = model->elapsespeed; - model->unk6C = model->unk3C; + model->unk6C = model->endframe; if ((temp_a1->Opcode & 0xFF) == 1) { temp_v0_2 = modelGetNodeRwData(model, temp_a1); @@ -3560,7 +3549,7 @@ void sub_GAME_7F06F780(Model *model, f32 arg1) #else GLOBAL_ASM( .text -glabel sub_GAME_7F06F780 +glabel modelCopyAnimForMerge /* 0A42B0 7F06F780 44856000 */ mtc1 $a1, $f12 /* 0A42B4 7F06F784 44802000 */ mtc1 $zero, $f4 /* 0A42B8 7F06F788 27BDFFE8 */ addiu $sp, $sp, -0x18 @@ -3632,7 +3621,7 @@ glabel sub_GAME_7F06F780 #ifdef NONMATCHING -void sub_GAME_7F06F878(Model *model, void *anim, s32 arg2, f32 startframe, f32 half, f32 arg5) +void modelSetAnimation2(Model *model, void *anim, s32 arg2, f32 startframe, f32 half, f32 arg5) { void *sp80; f32 sp70; @@ -3681,10 +3670,10 @@ void sub_GAME_7F06F878(Model *model, void *anim, s32 arg2, f32 startframe, f32 h } model->anim = anim; model->unk24 = arg2; - model->unk3C = -1.0f; + model->endframe = -1.0f; model->speed = half; model->timespeed = 0.0f; - sub_GAME_7F06FF64(startframe, model, startframe, anim); + modelSetAnimFrame(startframe, model, startframe, anim); model->unk26 = 0; temp_a1 = model->obj->RootNode; if ((temp_a1->Opcode & 0xFF) == 1) @@ -3783,7 +3772,7 @@ glabel D_80054D44 glabel D_80054D48 .word 0x40c90fdb /*6.2831855*/ .text -glabel sub_GAME_7F06F878 +glabel modelSetAnimation2 /* 0A43A8 7F06F878 27BDFF70 */ addiu $sp, $sp, -0x90 /* 0A43AC 7F06F87C AFBF0024 */ sw $ra, 0x24($sp) /* 0A43B0 7F06F880 AFB10020 */ sw $s1, 0x20($sp) @@ -3821,7 +3810,7 @@ glabel sub_GAME_7F06F878 /* 0A4428 7F06F8F8 44805000 */ mtc1 $zero, $f10 /* 0A442C 7F06F8FC 02202025 */ move $a0, $s1 /* 0A4430 7F06F900 E6280040 */ swc1 $f8, 0x40($s1) -/* 0A4434 7F06F904 0FC1BFD9 */ jal sub_GAME_7F06FF64 +/* 0A4434 7F06F904 0FC1BFD9 */ jal modelSetAnimFrame /* 0A4438 7F06F908 E62A004C */ swc1 $f10, 0x4c($s1) /* 0A443C 7F06F90C 8E390008 */ lw $t9, 8($s1) /* 0A4440 7F06F910 A2200026 */ sb $zero, 0x26($s1) @@ -4043,21 +4032,22 @@ glabel sub_GAME_7F06F878 void modelSetAnimationWithMerge(Model *model, ModelAnimation *modelAnimation, s32 flip, f32 startframe, f32 speed, f32 timemerge, s32 domerge) { if (domerge != 0) { - sub_GAME_7F06F780(model, timemerge); + modelCopyAnimForMerge(model, timemerge); } - sub_GAME_7F06F878(model, modelAnimation, flip, startframe, speed, timemerge); + modelSetAnimation2(model, modelAnimation, flip, startframe, speed, timemerge); } void modelSetAnimation(Model *model, ModelAnimation *modelAnimation, s32 flip, f32 startframe, f32 speed, f32 merge) { - sub_GAME_7F06F780(model, merge); - sub_GAME_7F06F878(model, modelAnimation, flip, startframe, speed, merge); + modelCopyAnimForMerge(model, merge); + modelSetAnimation2(model, modelAnimation, flip, startframe, speed, merge); } #ifdef NONMATCHING -void sub_GAME_7F06FCFC(void) { +void sub_GAME_7F06FCFC() +{ } #else @@ -4135,9 +4125,9 @@ void modelSetAnimEndFrame(Model *model, f32 endframe) { ModelAnimation *modelAnimation = model->anim; if ((modelAnimation != NULL) && (endframe < (modelAnimation->unk04 - 1))) { - model->unk3c = endframe; + model->endframe = endframe; } else { - model->unk3c = -1.0f; + model->endframe = -1.0f; } } @@ -4195,15 +4185,15 @@ void sub_GAME_7F06FE90(Model *model, f32 arg1, f32 arg2) modelSetAnimSpeed(model, t, arg2); } -void modelSetAnimRateForDuration(Model *model, f32 animation_rate, f32 arg2) { - if (arg2 > 0.0f) { - model->unkb0 = arg2; +void modelSetAnimPlaySpeed(Model *model, f32 animation_rate, f32 startframe) { + if (startframe > 0.0f) { + model->unkb0 = startframe; model->animrate = animation_rate; model->unkb4 = 0.0f; - model->unkac = model->unka4; + model->unkac = model->playspeed; return; } - model->unka4 = animation_rate; + model->playspeed = animation_rate; model->unkb0 = 0.0f; } @@ -4212,225 +4202,102 @@ void sub_GAME_7F06FF5C(Model *model, s32 arg1) { model->unka0 = arg1; } -#ifdef NONMATCHING -void sub_GAME_7F06FF64(void) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F06FF64 -/* 0A4A94 7F06FF64 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0A4A98 7F06FF68 AFBF001C */ sw $ra, 0x1c($sp) -/* 0A4A9C 7F06FF6C AFB00018 */ sw $s0, 0x18($sp) -/* 0A4AA0 7F06FF70 AFA50034 */ sw $a1, 0x34($sp) -/* 0A4AA4 7F06FF74 00808025 */ move $s0, $a0 -/* 0A4AA8 7F06FF78 0FC170F6 */ jal floorFloatToInt -/* 0A4AAC 7F06FF7C C7AC0034 */ lwc1 $f12, 0x34($sp) -/* 0A4AB0 7F06FF80 C6040040 */ lwc1 $f4, 0x40($s0) -/* 0A4AB4 7F06FF84 44803000 */ mtc1 $zero, $f6 -/* 0A4AB8 7F06FF88 00402025 */ move $a0, $v0 -/* 0A4ABC 7F06FF8C 00004025 */ move $t0, $zero -/* 0A4AC0 7F06FF90 4604303E */ c.le.s $f6, $f4 -/* 0A4AC4 7F06FF94 2447FFFF */ addiu $a3, $v0, -1 -/* 0A4AC8 7F06FF98 45000002 */ bc1f .L7F06FFA4 -/* 0A4ACC 7F06FF9C 00000000 */ nop -/* 0A4AD0 7F06FFA0 24080001 */ li $t0, 1 -.L7F06FFA4: -/* 0A4AD4 7F06FFA4 11000003 */ beqz $t0, .L7F06FFB4 -/* 0A4AD8 7F06FFA8 00000000 */ nop -/* 0A4ADC 7F06FFAC 10000001 */ b .L7F06FFB4 -/* 0A4AE0 7F06FFB0 24470001 */ addiu $a3, $v0, 1 -.L7F06FFB4: -/* 0A4AE4 7F06FFB4 8E050020 */ lw $a1, 0x20($s0) -/* 0A4AE8 7F06FFB8 8E06003C */ lw $a2, 0x3c($s0) -/* 0A4AEC 7F06FFBC AFA80024 */ sw $t0, 0x24($sp) -/* 0A4AF0 7F06FFC0 AFA70028 */ sw $a3, 0x28($sp) -/* 0A4AF4 7F06FFC4 0FC1BD9B */ jal sub_GAME_7F06F66C -/* 0A4AF8 7F06FFC8 AFA4002C */ sw $a0, 0x2c($sp) -/* 0A4AFC 7F06FFCC 8FA40028 */ lw $a0, 0x28($sp) -/* 0A4B00 7F06FFD0 A6020030 */ sh $v0, 0x30($s0) -/* 0A4B04 7F06FFD4 8E050020 */ lw $a1, 0x20($s0) -/* 0A4B08 7F06FFD8 0FC1BD9B */ jal sub_GAME_7F06F66C -/* 0A4B0C 7F06FFDC 8E06003C */ lw $a2, 0x3c($s0) -/* 0A4B10 7F06FFE0 8FA70028 */ lw $a3, 0x28($sp) -/* 0A4B14 7F06FFE4 8FA80024 */ lw $t0, 0x24($sp) -/* 0A4B18 7F06FFE8 A6020032 */ sh $v0, 0x32($s0) -/* 0A4B1C 7F06FFEC 86040032 */ lh $a0, 0x32($s0) -/* 0A4B20 7F06FFF0 86030030 */ lh $v1, 0x30($s0) -/* 0A4B24 7F06FFF4 14830007 */ bne $a0, $v1, .L7F070014 -/* 0A4B28 7F06FFF8 00000000 */ nop -/* 0A4B2C 7F06FFFC 44835000 */ mtc1 $v1, $f10 -/* 0A4B30 7F070000 44804000 */ mtc1 $zero, $f8 -/* 0A4B34 7F070004 46805420 */ cvt.s.w $f16, $f10 -/* 0A4B38 7F070008 E608002C */ swc1 $f8, 0x2c($s0) -/* 0A4B3C 7F07000C 1000001B */ b .L7F07007C -/* 0A4B40 7F070010 E6100028 */ swc1 $f16, 0x28($s0) -.L7F070014: -/* 0A4B44 7F070014 1100000B */ beqz $t0, .L7F070044 -/* 0A4B48 7F070018 8FAE002C */ lw $t6, 0x2c($sp) -/* 0A4B4C 7F07001C 448E2000 */ mtc1 $t6, $f4 -/* 0A4B50 7F070020 44834000 */ mtc1 $v1, $f8 -/* 0A4B54 7F070024 C7B20034 */ lwc1 $f18, 0x34($sp) -/* 0A4B58 7F070028 468021A0 */ cvt.s.w $f6, $f4 -/* 0A4B5C 7F07002C 468042A0 */ cvt.s.w $f10, $f8 -/* 0A4B60 7F070030 46069001 */ sub.s $f0, $f18, $f6 -/* 0A4B64 7F070034 46005400 */ add.s $f16, $f10, $f0 -/* 0A4B68 7F070038 E600002C */ swc1 $f0, 0x2c($s0) -/* 0A4B6C 7F07003C 1000000F */ b .L7F07007C -/* 0A4B70 7F070040 E6100028 */ swc1 $f16, 0x28($s0) -.L7F070044: -/* 0A4B74 7F070044 44879000 */ mtc1 $a3, $f18 -/* 0A4B78 7F070048 C7A40034 */ lwc1 $f4, 0x34($sp) -/* 0A4B7C 7F07004C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A4B80 7F070050 468091A0 */ cvt.s.w $f6, $f18 -/* 0A4B84 7F070054 44811000 */ mtc1 $at, $f2 -/* 0A4B88 7F070058 44845000 */ mtc1 $a0, $f10 -/* 0A4B8C 7F07005C 00000000 */ nop -/* 0A4B90 7F070060 46805420 */ cvt.s.w $f16, $f10 -/* 0A4B94 7F070064 46062201 */ sub.s $f8, $f4, $f6 -/* 0A4B98 7F070068 46081001 */ sub.s $f0, $f2, $f8 -/* 0A4B9C 7F07006C 46001481 */ sub.s $f18, $f2, $f0 -/* 0A4BA0 7F070070 E600002C */ swc1 $f0, 0x2c($s0) -/* 0A4BA4 7F070074 46128100 */ add.s $f4, $f16, $f18 -/* 0A4BA8 7F070078 E6040028 */ swc1 $f4, 0x28($s0) -.L7F07007C: -/* 0A4BAC 7F07007C 8FBF001C */ lw $ra, 0x1c($sp) -/* 0A4BB0 7F070080 8FB00018 */ lw $s0, 0x18($sp) -/* 0A4BB4 7F070084 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0A4BB8 7F070088 03E00008 */ jr $ra -/* 0A4BBC 7F07008C 00000000 */ nop -) -#endif +void modelSetAnimFrame(Model* model, f32 frame) +{ + s32 framea; + s32 frameb; + bool forwards; + framea = floorFloatToInt(frame); + forwards = (model->speed >= 0); + frameb = (forwards ? framea + 1 : framea - 1); + model->framea = modelConstrainOrWrapAnimFrame(framea, model->anim, model->endframe); + model->frameb = modelConstrainOrWrapAnimFrame(frameb, model->anim, model->endframe); + if (model->framea == model->frameb) + { + model->unk2c = 0.0f; + model->unk28 = model->framea; + } + else if (forwards) + { + f32 tmp = frame - framea; + model->unk2c = tmp; + model->unk28 = model->framea + tmp; + } + else + { + f32 tmp = 1.0f - (frame - (f32) frameb); + model->unk2c = tmp; + model->unk28 = model->frameb + (1.0f - tmp); + } +} -#ifdef NONMATCHING -void sub_GAME_7F070090(void) { -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F070090 -/* 0A4BC0 7F070090 44856000 */ mtc1 $a1, $f12 -/* 0A4BC4 7F070094 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0A4BC8 7F070098 AFBF001C */ sw $ra, 0x1c($sp) -/* 0A4BCC 7F07009C AFB00018 */ sw $s0, 0x18($sp) -/* 0A4BD0 7F0700A0 44056000 */ mfc1 $a1, $f12 -/* 0A4BD4 7F0700A4 00808025 */ move $s0, $a0 -/* 0A4BD8 7F0700A8 0FC1BFD9 */ jal sub_GAME_7F06FF64 -/* 0A4BDC 7F0700AC AFA60038 */ sw $a2, 0x38($sp) -/* 0A4BE0 7F0700B0 8E0E0054 */ lw $t6, 0x54($s0) -/* 0A4BE4 7F0700B4 51C00043 */ beql $t6, $zero, .L7F0701C4 -/* 0A4BE8 7F0700B8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0A4BEC 7F0700BC 0FC170F6 */ jal floorFloatToInt -/* 0A4BF0 7F0700C0 C7AC0038 */ lwc1 $f12, 0x38($sp) -/* 0A4BF4 7F0700C4 C6040070 */ lwc1 $f4, 0x70($s0) -/* 0A4BF8 7F0700C8 44803000 */ mtc1 $zero, $f6 -/* 0A4BFC 7F0700CC 00402025 */ move $a0, $v0 -/* 0A4C00 7F0700D0 00004025 */ move $t0, $zero -/* 0A4C04 7F0700D4 4604303E */ c.le.s $f6, $f4 -/* 0A4C08 7F0700D8 2447FFFF */ addiu $a3, $v0, -1 -/* 0A4C0C 7F0700DC 45000002 */ bc1f .L7F0700E8 -/* 0A4C10 7F0700E0 00000000 */ nop -/* 0A4C14 7F0700E4 24080001 */ li $t0, 1 -.L7F0700E8: -/* 0A4C18 7F0700E8 11000003 */ beqz $t0, .L7F0700F8 -/* 0A4C1C 7F0700EC 00000000 */ nop -/* 0A4C20 7F0700F0 10000001 */ b .L7F0700F8 -/* 0A4C24 7F0700F4 24470001 */ addiu $a3, $v0, 1 -.L7F0700F8: -/* 0A4C28 7F0700F8 8E050054 */ lw $a1, 0x54($s0) -/* 0A4C2C 7F0700FC 8E06006C */ lw $a2, 0x6c($s0) -/* 0A4C30 7F070100 AFA80024 */ sw $t0, 0x24($sp) -/* 0A4C34 7F070104 AFA70028 */ sw $a3, 0x28($sp) -/* 0A4C38 7F070108 0FC1BD9B */ jal sub_GAME_7F06F66C -/* 0A4C3C 7F07010C AFA4002C */ sw $a0, 0x2c($sp) -/* 0A4C40 7F070110 8FA40028 */ lw $a0, 0x28($sp) -/* 0A4C44 7F070114 A6020060 */ sh $v0, 0x60($s0) -/* 0A4C48 7F070118 8E050054 */ lw $a1, 0x54($s0) -/* 0A4C4C 7F07011C 0FC1BD9B */ jal sub_GAME_7F06F66C -/* 0A4C50 7F070120 8E06006C */ lw $a2, 0x6c($s0) -/* 0A4C54 7F070124 8FA70028 */ lw $a3, 0x28($sp) -/* 0A4C58 7F070128 8FA80024 */ lw $t0, 0x24($sp) -/* 0A4C5C 7F07012C A6020062 */ sh $v0, 0x62($s0) -/* 0A4C60 7F070130 86040062 */ lh $a0, 0x62($s0) -/* 0A4C64 7F070134 86030060 */ lh $v1, 0x60($s0) -/* 0A4C68 7F070138 14830007 */ bne $a0, $v1, .L7F070158 -/* 0A4C6C 7F07013C 00000000 */ nop -/* 0A4C70 7F070140 44835000 */ mtc1 $v1, $f10 -/* 0A4C74 7F070144 44804000 */ mtc1 $zero, $f8 -/* 0A4C78 7F070148 46805420 */ cvt.s.w $f16, $f10 -/* 0A4C7C 7F07014C E608005C */ swc1 $f8, 0x5c($s0) -/* 0A4C80 7F070150 1000001B */ b .L7F0701C0 -/* 0A4C84 7F070154 E6100058 */ swc1 $f16, 0x58($s0) -.L7F070158: -/* 0A4C88 7F070158 1100000B */ beqz $t0, .L7F070188 -/* 0A4C8C 7F07015C 8FAF002C */ lw $t7, 0x2c($sp) -/* 0A4C90 7F070160 448F2000 */ mtc1 $t7, $f4 -/* 0A4C94 7F070164 44834000 */ mtc1 $v1, $f8 -/* 0A4C98 7F070168 C7B20038 */ lwc1 $f18, 0x38($sp) -/* 0A4C9C 7F07016C 468021A0 */ cvt.s.w $f6, $f4 -/* 0A4CA0 7F070170 468042A0 */ cvt.s.w $f10, $f8 -/* 0A4CA4 7F070174 46069001 */ sub.s $f0, $f18, $f6 -/* 0A4CA8 7F070178 46005400 */ add.s $f16, $f10, $f0 -/* 0A4CAC 7F07017C E600005C */ swc1 $f0, 0x5c($s0) -/* 0A4CB0 7F070180 1000000F */ b .L7F0701C0 -/* 0A4CB4 7F070184 E6100058 */ swc1 $f16, 0x58($s0) -.L7F070188: -/* 0A4CB8 7F070188 44879000 */ mtc1 $a3, $f18 -/* 0A4CBC 7F07018C C7A40038 */ lwc1 $f4, 0x38($sp) -/* 0A4CC0 7F070190 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0A4CC4 7F070194 468091A0 */ cvt.s.w $f6, $f18 -/* 0A4CC8 7F070198 44811000 */ mtc1 $at, $f2 -/* 0A4CCC 7F07019C 44845000 */ mtc1 $a0, $f10 -/* 0A4CD0 7F0701A0 00000000 */ nop -/* 0A4CD4 7F0701A4 46805420 */ cvt.s.w $f16, $f10 -/* 0A4CD8 7F0701A8 46062201 */ sub.s $f8, $f4, $f6 -/* 0A4CDC 7F0701AC 46081001 */ sub.s $f0, $f2, $f8 -/* 0A4CE0 7F0701B0 46001481 */ sub.s $f18, $f2, $f0 -/* 0A4CE4 7F0701B4 E600005C */ swc1 $f0, 0x5c($s0) -/* 0A4CE8 7F0701B8 46128100 */ add.s $f4, $f16, $f18 -/* 0A4CEC 7F0701BC E6040058 */ swc1 $f4, 0x58($s0) -.L7F0701C0: -/* 0A4CF0 7F0701C0 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0701C4: -/* 0A4CF4 7F0701C4 8FB00018 */ lw $s0, 0x18($sp) -/* 0A4CF8 7F0701C8 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0A4CFC 7F0701CC 03E00008 */ jr $ra -/* 0A4D00 7F0701D0 00000000 */ nop -) -#endif +void modelSetAnimFrame2(Model* model, f32 frame1, f32 frame2) +{ + s32 framea; + s32 frameb; + bool forwards; + + modelSetAnimFrame(model, frame1); + + if (model->anim2 != NULL) + { + framea = floorFloatToInt(frame2); + forwards = (model->speed2 >= 0.0f); + frameb = forwards ? (framea + 1) : (framea - 1); + model->frame2a = modelConstrainOrWrapAnimFrame(framea, model->anim2, model->unk6c); + model->frame2b = modelConstrainOrWrapAnimFrame(frameb, model->anim2, model->unk6c); + if (model->frame2a == model->frame2b) + { + model->unk5c = 0.0f; + model->unk58 = model->frame2a; + } + else if (forwards != 0) + { + f32 tmp = frame2 - framea; + model->unk5c = tmp; + model->unk58 = model->frame2a + tmp; + } + else + { + f32 tmp = 1.0f - (frame2 - (f32) frameb); + model->unk5c = tmp; + model->unk58 = model->frame2b + (1.0f - tmp); + } + } +} /** * Address 0x7F0701D4. */ -void sub_GAME_7F0701D4(s32 arg0) +void modelSetAnimMergingEnabled(s32 arg0) { - D_80036250 = arg0; + g_ModelAnimMergingEnabled = arg0; } /** * Address 0x7F0701E0. */ -u32 sub_GAME_7F0701E0(void) +u32 modelIsAnimMergingEnabled(void) { - return D_80036250; + return g_ModelAnimMergingEnabled; } #ifdef NONMATCHING -void sub_GAME_7F0701EC(void) { +void modelSetAnimFrame2WithChrStuff(void) { } #else @@ -4439,7 +4306,7 @@ GLOBAL_ASM( glabel D_80054D4C .word 0x40c90fdb /*6.2831855*/ .text -glabel sub_GAME_7F0701EC +glabel modelSetAnimFrame2WithChrStuff /* 0A4D1C 7F0701EC 27BDFF08 */ addiu $sp, $sp, -0xf8 /* 0A4D20 7F0701F0 AFBF005C */ sw $ra, 0x5c($sp) /* 0A4D24 7F0701F4 AFB30058 */ sw $s3, 0x58($sp) @@ -4563,7 +4430,7 @@ glabel sub_GAME_7F0701EC .L7F0703B0: /* 0A4EE0 7F0703B0 8E26003C */ lw $a2, 0x3c($s1) /* 0A4EE4 7F0703B4 AFA700B8 */ sw $a3, 0xb8($sp) -/* 0A4EE8 7F0703B8 0FC1BD9B */ jal sub_GAME_7F06F66C +/* 0A4EE8 7F0703B8 0FC1BD9B */ jal modelConstrainOrWrapAnimFrame /* 0A4EEC 7F0703BC 02402025 */ move $a0, $s2 /* 0A4EF0 7F0703C0 A6220030 */ sh $v0, 0x30($s1) /* 0A4EF4 7F0703C4 8FB80094 */ lw $t8, 0x94($sp) @@ -4663,7 +4530,7 @@ glabel sub_GAME_7F0701EC .L7F07052C: /* 0A505C 7F07052C 02402025 */ move $a0, $s2 /* 0A5060 7F070530 8E250020 */ lw $a1, 0x20($s1) -/* 0A5064 7F070534 0FC1BD9B */ jal sub_GAME_7F06F66C +/* 0A5064 7F070534 0FC1BD9B */ jal modelConstrainOrWrapAnimFrame /* 0A5068 7F070538 8E26003C */ lw $a2, 0x3c($s1) /* 0A506C 7F07053C A6220032 */ sh $v0, 0x32($s1) /* 0A5070 7F070540 86290032 */ lh $t1, 0x32($s1) @@ -4713,8 +4580,8 @@ glabel sub_GAME_7F0701EC /* 0A5118 7F0705E8 46000506 */ mov.s $f20, $f0 /* 0A511C 7F0705EC 0FC15FAB */ jal sinf /* 0A5120 7F0705F0 C60C0030 */ lwc1 $f12, 0x30($s0) -/* 0A5124 7F0705F4 3C0A8003 */ lui $t2, %hi(D_80036250) -/* 0A5128 7F0705F8 8D4A6250 */ lw $t2, %lo(D_80036250)($t2) +/* 0A5124 7F0705F4 3C0A8003 */ lui $t2, %hi(g_ModelAnimMergingEnabled) +/* 0A5128 7F0705F8 8D4A6250 */ lw $t2, %lo(g_ModelAnimMergingEnabled)($t2) /* 0A512C 7F0705FC C7A200C8 */ lwc1 $f2, 0xc8($sp) /* 0A5130 7F070600 C7AC00D0 */ lwc1 $f12, 0xd0($sp) /* 0A5134 7F070604 11400056 */ beqz $t2, .L7F070760 @@ -4962,13 +4829,13 @@ glabel sub_GAME_7F0701EC .L7F070984: /* 0A54B4 7F070984 8FA4006C */ lw $a0, 0x6c($sp) /* 0A54B8 7F070988 8E250054 */ lw $a1, 0x54($s1) -/* 0A54BC 7F07098C 0FC1BD9B */ jal sub_GAME_7F06F66C +/* 0A54BC 7F07098C 0FC1BD9B */ jal modelConstrainOrWrapAnimFrame /* 0A54C0 7F070990 8E26006C */ lw $a2, 0x6c($s1) /* 0A54C4 7F070994 A6220060 */ sh $v0, 0x60($s1) /* 0A54C8 7F070998 8FA4006C */ lw $a0, 0x6c($sp) /* 0A54CC 7F07099C 8E250054 */ lw $a1, 0x54($s1) /* 0A54D0 7F0709A0 8E26006C */ lw $a2, 0x6c($s1) -/* 0A54D4 7F0709A4 0FC1BD9B */ jal sub_GAME_7F06F66C +/* 0A54D4 7F0709A4 0FC1BD9B */ jal modelConstrainOrWrapAnimFrame /* 0A54D8 7F0709A8 24840001 */ addiu $a0, $a0, 1 /* 0A54DC 7F0709AC A6220062 */ sh $v0, 0x62($s1) /* 0A54E0 7F0709B0 82250025 */ lb $a1, 0x25($s1) @@ -5033,7 +4900,7 @@ glabel sub_GAME_7F0701EC /* 0A55B4 7F070A84 02202025 */ move $a0, $s1 /* 0A55B8 7F070A88 8FA50100 */ lw $a1, 0x100($sp) /* 0A55BC 7F070A8C 4406A000 */ mfc1 $a2, $f20 -/* 0A55C0 7F070A90 0FC1C024 */ jal sub_GAME_7F070090 +/* 0A55C0 7F070A90 0FC1C024 */ jal modelSetAnimFrame2 /* 0A55C4 7F070A94 00000000 */ nop /* 0A55C8 7F070A98 10000008 */ b .L7F070ABC /* 0A55CC 7F070A9C 8FBF005C */ lw $ra, 0x5c($sp) @@ -5042,7 +4909,7 @@ glabel sub_GAME_7F0701EC /* 0A55D4 7F070AA4 02202025 */ move $a0, $s1 /* 0A55D8 7F070AA8 8FA50100 */ lw $a1, 0x100($sp) /* 0A55DC 7F070AAC 4406A000 */ mfc1 $a2, $f20 -/* 0A55E0 7F070AB0 0FC1C024 */ jal sub_GAME_7F070090 +/* 0A55E0 7F070AB0 0FC1C024 */ jal modelSetAnimFrame2 /* 0A55E4 7F070AB4 00000000 */ nop .L7F070AB8: /* 0A55E8 7F070AB8 8FBF005C */ lw $ra, 0x5c($sp) @@ -5067,13 +4934,13 @@ glabel sub_GAME_7F0701EC #ifdef NONMATCHING -void sub_GAME_7F070AEC(void) { +void modelTickAnimQuarterSpeed(void) { } #else GLOBAL_ASM( .text -glabel sub_GAME_7F070AEC +glabel modelTickAnimQuarterSpeed /* 0A561C 7F070AEC 27BDFF78 */ addiu $sp, $sp, -0x88 /* 0A5620 7F070AF0 AFBF0054 */ sw $ra, 0x54($sp) /* 0A5624 7F070AF4 AFB10050 */ sw $s1, 0x50($sp) @@ -5300,14 +5167,14 @@ glabel sub_GAME_7F070AEC /* 0A5948 7F070E18 4407C000 */ mfc1 $a3, $f24 /* 0A594C 7F070E1C E7B20084 */ swc1 $f18, 0x84($sp) /* 0A5950 7F070E20 E7B80010 */ swc1 $f24, 0x10($sp) -/* 0A5954 7F070E24 0FC1C07B */ jal sub_GAME_7F0701EC +/* 0A5954 7F070E24 0FC1C07B */ jal modelSetAnimFrame2WithChrStuff /* 0A5958 7F070E28 02002025 */ move $a0, $s0 /* 0A595C 7F070E2C 10000006 */ b .L7F070E48 /* 0A5960 7F070E30 C7B20084 */ lwc1 $f18, 0x84($sp) .L7F070E34: /* 0A5964 7F070E34 4405A000 */ mfc1 $a1, $f20 /* 0A5968 7F070E38 4406C000 */ mfc1 $a2, $f24 -/* 0A596C 7F070E3C 0FC1C024 */ jal sub_GAME_7F070090 +/* 0A596C 7F070E3C 0FC1C024 */ jal modelSetAnimFrame2 /* 0A5970 7F070E40 E7B20084 */ swc1 $f18, 0x84($sp) /* 0A5974 7F070E44 C7B20084 */ lwc1 $f18, 0x84($sp) .L7F070E48: @@ -5357,7 +5224,7 @@ glabel sub_GAME_7F070AEC /* 0A5A1C 7F070EEC 44069000 */ mfc1 $a2, $f18 /* 0A5A20 7F070EF0 8E070058 */ lw $a3, 0x58($s0) /* 0A5A24 7F070EF4 02002025 */ move $a0, $s0 -/* 0A5A28 7F070EF8 0FC1C07B */ jal sub_GAME_7F0701EC +/* 0A5A28 7F070EF8 0FC1C07B */ jal modelSetAnimFrame2WithChrStuff /* 0A5A2C 7F070EFC E7A40010 */ swc1 $f4, 0x10($sp) /* 0A5A30 7F070F00 10000015 */ b .L7F070F58 /* 0A5A34 7F070F04 8FBF0054 */ lw $ra, 0x54($sp) @@ -5366,7 +5233,7 @@ glabel sub_GAME_7F070AEC /* 0A5A3C 7F070F0C 44069000 */ mfc1 $a2, $f18 /* 0A5A40 7F070F10 4407C000 */ mfc1 $a3, $f24 /* 0A5A44 7F070F14 02002025 */ move $a0, $s0 -/* 0A5A48 7F070F18 0FC1C07B */ jal sub_GAME_7F0701EC +/* 0A5A48 7F070F18 0FC1C07B */ jal modelSetAnimFrame2WithChrStuff /* 0A5A4C 7F070F1C E7B80010 */ swc1 $f24, 0x10($sp) /* 0A5A50 7F070F20 1000000D */ b .L7F070F58 /* 0A5A54 7F070F24 8FBF0054 */ lw $ra, 0x54($sp) @@ -5374,14 +5241,14 @@ glabel sub_GAME_7F070AEC /* 0A5A58 7F070F28 10400006 */ beqz $v0, .L7F070F44 /* 0A5A5C 7F070F2C 02002025 */ move $a0, $s0 /* 0A5A60 7F070F30 44059000 */ mfc1 $a1, $f18 -/* 0A5A64 7F070F34 0FC1C024 */ jal sub_GAME_7F070090 +/* 0A5A64 7F070F34 0FC1C024 */ jal modelSetAnimFrame2 /* 0A5A68 7F070F38 8FA60080 */ lw $a2, 0x80($sp) /* 0A5A6C 7F070F3C 10000006 */ b .L7F070F58 /* 0A5A70 7F070F40 8FBF0054 */ lw $ra, 0x54($sp) .L7F070F44: /* 0A5A74 7F070F44 44059000 */ mfc1 $a1, $f18 /* 0A5A78 7F070F48 4406C000 */ mfc1 $a2, $f24 -/* 0A5A7C 7F070F4C 0FC1C024 */ jal sub_GAME_7F070090 +/* 0A5A7C 7F070F4C 0FC1C024 */ jal modelSetAnimFrame2 /* 0A5A80 7F070F50 02002025 */ move $a0, $s0 .L7F070F54: /* 0A5A84 7F070F54 8FBF0054 */ lw $ra, 0x54($sp) @@ -5400,7 +5267,7 @@ glabel sub_GAME_7F070AEC #endif -void sub_GAME_7F070F80(ModelRenderData *renderdata) +void modelApplyRenderModeType1(ModelRenderData *renderdata) { gDPPipeSync(renderdata->gdl++); gDPSetCycleType(renderdata->gdl++, G_CYC_1CYCLE); @@ -5553,7 +5420,7 @@ Model Type 4: Normal Fog/Lighting object B900031DC41041C8 SetRendermode(AA_OPA_StanFOG_2)//FcBl ClrOnCvg endif */ -void sub_GAME_7F071030(ModelRenderData *renderdata, bool arg1) +void modelApplyRenderModeType3(ModelRenderData *renderdata, bool arg1) { if (renderdata->unk30 == 7) { @@ -5836,7 +5703,7 @@ void sub_GAME_7F071030(ModelRenderData *renderdata, bool arg1) } -void sub_GAME_7F071B44(ModelRenderData *renderdata, bool arg1) +void modelApplyRenderModeType4(ModelRenderData *renderdata, bool arg1) { if (renderdata->unk30 == 7) { @@ -6111,7 +5978,7 @@ void sub_GAME_7F071B44(ModelRenderData *renderdata, bool arg1) } -void sub_GAME_7F072644(ModelRenderData *renderdata) +void modelApplyRenderModeType2(ModelRenderData *renderdata) { gDPPipeSync(renderdata->gdl++); gDPSetCycleType(renderdata->gdl++, G_CYC_2CYCLE); @@ -6163,26 +6030,26 @@ void modelRenderNodeGundl(ModelRenderData* renderdata, ModelNode* arg1) if (rodata->ModelType == 1) { - sub_GAME_7F070F80(renderdata); + modelApplyRenderModeType1(renderdata); } else if (rodata->ModelType == 3) { - sub_GAME_7F071030(renderdata, 1); + modelApplyRenderModeType3(renderdata, 1); } else if (rodata->ModelType == 4) { - sub_GAME_7F071B44(renderdata, 1); + modelApplyRenderModeType4(renderdata, 1); } else if (rodata->ModelType == 2) { - sub_GAME_7F072644(renderdata); + modelApplyRenderModeType2(renderdata); } gSPDisplayList(renderdata->gdl++, rodata->Primary); if ((rodata->ModelType == 3) && rodata->Secondary) { - sub_GAME_7F071030(renderdata, 0); + modelApplyRenderModeType3(renderdata, 0); gSPDisplayList(renderdata->gdl++, rodata->Secondary); } } @@ -6196,7 +6063,7 @@ void modelRenderNodeGundl(ModelRenderData* renderdata, ModelNode* arg1) modelApplyCullMode(renderdata); } - sub_GAME_7F071B44(renderdata, 0); + modelApplyRenderModeType4(renderdata, 0); gSPDisplayList(renderdata->gdl++, rodata->Secondary); } } @@ -6224,19 +6091,19 @@ void modelRenderNodeDl(ModelRenderData *renderdata, Model *model, ModelNode *nod if (rodata->DisplayListCollisions.ModelType == 1) { - sub_GAME_7F070F80(renderdata); + modelApplyRenderModeType1(renderdata); } else if (rodata->DisplayListCollisions.ModelType == 3) { - sub_GAME_7F071030(renderdata, TRUE); + modelApplyRenderModeType3(renderdata, TRUE); } else if (rodata->DisplayListCollisions.ModelType == 4) { - sub_GAME_7F071B44(renderdata, TRUE); + modelApplyRenderModeType4(renderdata, TRUE); } else if (rodata->DisplayListCollisions.ModelType == 2) { - sub_GAME_7F072644(renderdata); + modelApplyRenderModeType2(renderdata); } gSPSegment(renderdata->gdl++, SPSEGMENT_MODEL_VTX, osVirtualToPhysical(rwdata->DisplayListCollisions.Vertices)); @@ -6245,7 +6112,7 @@ void modelRenderNodeDl(ModelRenderData *renderdata, Model *model, ModelNode *nod if (rodata->DisplayListCollisions.ModelType == 3 && rodata->DisplayListCollisions.Secondary) { - sub_GAME_7F071030(renderdata, FALSE); + modelApplyRenderModeType3(renderdata, FALSE); gSPDisplayList(renderdata->gdl++, rodata->DisplayListCollisions.Secondary); } } @@ -6266,7 +6133,7 @@ void modelRenderNodeDl(ModelRenderData *renderdata, Model *model, ModelNode *nod gSPSegment(renderdata->gdl++, SPSEGMENT_MODEL_VTX, osVirtualToPhysical(rwdata->DisplayListCollisions.Vertices)); - sub_GAME_7F071B44(renderdata, FALSE); + modelApplyRenderModeType4(renderdata, FALSE); gSPDisplayList(renderdata->gdl++, rodata->DisplayListCollisions.Secondary); } @@ -6432,7 +6299,7 @@ void dotube(ModelRenderData* renderdata, Model* model, ModelNode* node) if (renderdata->flags & 1) { - renderpos_index2 = sub_GAME_7F06C570(node, 0); + renderpos_index2 = modelFindNodeMtxIndex(node, 0); render_pos2 = &model->render_pos[renderpos_index2]; rw_index = rwdata->index; rw_index2 = rwdata2->index; @@ -6442,13 +6309,13 @@ void dotube(ModelRenderData* renderdata, Model* model, ModelNode* node) { rw_index_sel = rw_index2; rw_index_sel2 = rw_index; - renderpos_index = sub_GAME_7F06C570(node, 0x200); + renderpos_index = modelFindNodeMtxIndex(node, 0x200); } else { rw_index_sel = rw_index; rw_index_sel2 = rw_index2; - renderpos_index = sub_GAME_7F06C570(rodata->unk04, 0x200); + renderpos_index = modelFindNodeMtxIndex(rodata->unk04, 0x200); } render_pos = &model->render_pos[renderpos_index]; @@ -6655,6 +6522,7 @@ void sub_GAME_7F0737FC(s32 param_1,struct Model *param_2,struct ModelNode *param } +// PD: modelRenderNodeChrGunfire void dogfnegx(ModelRenderData *renderdata, Model *model, ModelNode *node) { u32 unused[3]; @@ -6687,7 +6555,7 @@ void dogfnegx(ModelRenderData *renderdata, Model *model, ModelNode *node) if ((renderdata->flags & 2) && rwdata->Gunfire.visible) { - s32 index = sub_GAME_7F06C570(node, 0); + s32 index = modelFindNodeMtxIndex(node, 0); mtx = &model->render_pos[index].pos; spe0.x = -(rodata->Offset.f[0] * mtx->m[0][0] + rodata->Offset.f[1] * mtx->m[1][0] + rodata->Offset.f[2] * mtx->m[2][0] + mtx->m[3][0]); @@ -6902,7 +6770,7 @@ glabel doshadow /* 0A8C00 7F0740D0 AFA7007C */ sw $a3, 0x7c($sp) /* 0A8C04 7F0740D4 E7A20040 */ swc1 $f2, 0x40($sp) /* 0A8C08 7F0740D8 E7AC0048 */ swc1 $f12, 0x48($sp) -/* 0A8C0C 7F0740DC 0FC1B15C */ jal sub_GAME_7F06C570 +/* 0A8C0C 7F0740DC 0FC1B15C */ jal modelFindNodeMtxIndex /* 0A8C10 7F0740E0 E7AE0044 */ swc1 $f14, 0x44($sp) /* 0A8C14 7F0740E4 8FA7007C */ lw $a3, 0x7c($sp) /* 0A8C18 7F0740E8 00024980 */ sll $t1, $v0, 6 @@ -7256,7 +7124,7 @@ glabel doshadow /* 0A6BD4 7F0741E4 AFA7007C */ sw $a3, 0x7c($sp) /* 0A6BD8 7F0741E8 E7A20048 */ swc1 $f2, 0x48($sp) /* 0A6BDC 7F0741EC E7AC0044 */ swc1 $f12, 0x44($sp) -/* 0A6BE0 7F0741F0 0FC1B32A */ jal sub_GAME_7F06C570 +/* 0A6BE0 7F0741F0 0FC1B32A */ jal modelFindNodeMtxIndex /* 0A6BE4 7F0741F4 E7AE0040 */ swc1 $f14, 0x40($sp) /* 0A6BE8 7F0741F8 8FA7007C */ lw $a3, 0x7c($sp) /* 0A6BEC 7F0741FC 00025980 */ sll $t3, $v0, 6 @@ -7547,60 +7415,60 @@ void sub_GAME_7F074524(Gfx *param_1,struct Model *param_2, struct ModelNode *par void sub_GAME_7F074534(ModelRenderData* data, Model* model, ModelNode* node) { u32 id = node->Opcode & 0xFF; switch (id) { - case MODELNODE_OPCODE_LODRECORD: - sub_GAME_7F06E970(model, node); + case MODELNODE_OPCODE_LOD: + modelApplyDistanceRelations(model, node); return; - case MODELNODE_OPCODE_SWITCHRECORD: - process_12_handle_switch(model, node); + case MODELNODE_OPCODE_SWITCH: + modelApplyToggleRelations(model, node); return; - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: - process_17_pointer_to_head(model, node); + case MODELNODE_OPCODE_HEAD: + modelApplyHeadRelations(model, node); return; - case MODELNODE_OPCODE_BSPRECORD: - sub_GAME_7F06EB10(model, node); + case MODELNODE_OPCODE_BSP: + modelApplyReorderRelations(model, node); return; - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: sub_GAME_7F0737FC(data, model, node); return; - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: dogfnegx(data, model, node); return; - case MODELNODE_OPCODE_SHADOWRECORD: + case MODELNODE_OPCODE_SHADOW: doshadow(data, model, node); return; - case MODELNODE_OPCODE_BOUNDINGBOXRECORD: + case MODELNODE_OPCODE_BBOX: sub_GAME_7F074514(data, model, node); return; - case MODELNODE_OPCODE_UNUSED_17: + case MODELNODE_OPCODE_OP17: sub_GAME_7F074524(data, model, node); return; - case MODELNODE_OPCODE_DISPLAYLISTRECORD: + case MODELNODE_OPCODE_DL: modelRenderNodeGundl(data, node); return; - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: modelRenderNodeDl(data, model, node); return; - case MODELNODE_OPCODE_UNUSED_20: + case MODELNODE_OPCODE_OP20: sub_GAME_7F072C10(data, model, node); return; - case MODELNODE_OPCODE_DISPLAYLISTPRIMARYRECORD: + case MODELNODE_OPCODE_DLPRIMARY: dorottex(data, node); return; - case MODELNODE_OPCODE_UNUSED_05: + case MODELNODE_OPCODE_OP05: sub_GAME_7F07306C(data, model, node); return; - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: dotube(data, model, node); return; - case MODELNODE_OPCODE_UNUSED_06: + case MODELNODE_OPCODE_OP06: sub_GAME_7F0737EC(data,model,node); return; - case MODELNODE_OPCODE_HEADERRECORD: - case MODELNODE_OPCODE_GROUPRECORD: - case MODELNODE_OPCODE_UNUSED_03: - case MODELNODE_OPCODE_OP14RECORD: - case MODELNODE_OPCODE_INTERLINKAGERECORD: - case MODELNODE_OPCODE_OP16RECORD: + case MODELNODE_OPCODE_HEADER: + case MODELNODE_OPCODE_GROUP: + case MODELNODE_OPCODE_OP03: + case MODELNODE_OPCODE_OP14: + case MODELNODE_OPCODE_INTERLINK: + case MODELNODE_OPCODE_OP16: default: return; } @@ -8113,7 +7981,7 @@ glabel sub_GAME_7F074C68 /* 0A97A4 7F074C74 AFA7002C */ sw $a3, 0x2c($sp) /* 0A97A8 7F074C78 8CAE0004 */ lw $t6, 4($a1) /* 0A97AC 7F074C7C 00003025 */ move $a2, $zero -/* 0A97B0 7F074C80 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A97B0 7F074C80 0FC1B198 */ jal modelFindNodeMtx /* 0A97B4 7F074C84 AFAE001C */ sw $t6, 0x1c($sp) /* 0A97B8 7F074C88 8FA4001C */ lw $a0, 0x1c($sp) /* 0A97BC 7F074C8C 00402825 */ move $a1, $v0 @@ -8148,7 +8016,7 @@ glabel sub_GAME_7F074CAC /* 0A97F4 7F074CC4 00003025 */ move $a2, $zero /* 0A97F8 7F074CC8 AFA700BC */ sw $a3, 0xbc($sp) /* 0A97FC 7F074CCC AFA500B4 */ sw $a1, 0xb4($sp) -/* 0A9800 7F074CD0 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A9800 7F074CD0 0FC1B198 */ jal modelFindNodeMtx /* 0A9804 7F074CD4 AFA800AC */ sw $t0, 0xac($sp) /* 0A9808 7F074CD8 3C0B8003 */ lui $t3, %hi(D_80036408) /* 0A980C 7F074CDC 256B6408 */ addiu $t3, %lo(D_80036408) # addiu $t3, $t3, 0x6408 @@ -8243,7 +8111,7 @@ glabel sub_GAME_7F074CAC /* 0A996C 7F074E3C 50A0001F */ beql $a1, $zero, .L7F074EBC /* 0A9970 7F074E40 C4480030 */ lwc1 $f8, 0x30($v0) /* 0A9974 7F074E44 AFA300A8 */ sw $v1, 0xa8($sp) -/* 0A9978 7F074E48 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A9978 7F074E48 0FC1B198 */ jal modelFindNodeMtx /* 0A997C 7F074E4C AFA800AC */ sw $t0, 0xac($sp) /* 0A9980 7F074E50 8FA300A8 */ lw $v1, 0xa8($sp) /* 0A9984 7F074E54 C4440030 */ lwc1 $f4, 0x30($v0) @@ -8695,19 +8563,19 @@ glabel sub_GAME_7F0752FC /* 0A9F68 7F075438 00008825 */ move $s1, $zero .L7F07543C: /* 0A9F6C 7F07543C 02402025 */ move $a0, $s2 -/* 0A9F70 7F075440 0FC1BA5C */ jal sub_GAME_7F06E970 +/* 0A9F70 7F075440 0FC1BA5C */ jal modelApplyDistanceRelations /* 0A9F74 7F075444 02002825 */ move $a1, $s0 /* 0A9F78 7F075448 10000009 */ b .L7F075470 /* 0A9F7C 7F07544C 00000000 */ nop .L7F075450: /* 0A9F80 7F075450 02402025 */ move $a0, $s2 -/* 0A9F84 7F075454 0FC1BA6F */ jal process_12_handle_switch +/* 0A9F84 7F075454 0FC1BA6F */ jal modelApplyToggleRelations /* 0A9F88 7F075458 02002825 */ move $a1, $s0 /* 0A9F8C 7F07545C 10000004 */ b .L7F075470 /* 0A9F90 7F075460 00000000 */ nop .L7F075464: /* 0A9F94 7F075464 02402025 */ move $a0, $s2 -/* 0A9F98 7F075468 0FC1BA82 */ jal process_17_pointer_to_head +/* 0A9F98 7F075468 0FC1BA82 */ jal modelApplyHeadRelations /* 0A9F9C 7F07546C 02002825 */ move $a1, $s0 def_7F0753C4: .L7F075470: @@ -8802,7 +8670,7 @@ void sub_GAME_7F0755B0(void) if (var) \ var = (void *)((u32)var + diff) -void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fileramaddr) +void modelPromoteNodeOffsetsToPointers(ModelNode *node, u32 vma, u32 fileramaddr) { s32 diff = fileramaddr - vma; s32 i; @@ -8819,28 +8687,28 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi switch (type) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: { ModelRoData_HeaderRecord* rodata = &node->Data->Header; PROMOTE(rodata->FirstGroup); break; } - case MODELNODE_OPCODE_GROUPRECORD: + case MODELNODE_OPCODE_GROUP: { ModelRoData_GroupRecord* rodata = &node->Data->Group; PROMOTE(rodata->ChildGroup); break; } - case MODELNODE_OPCODE_UNUSED_03: + case MODELNODE_OPCODE_OP03: { ModelRoData_GroupRecord* rodata = &node->Data->Group; PROMOTE(rodata->ChildGroup); break; } - case MODELNODE_OPCODE_DISPLAYLISTRECORD: + case MODELNODE_OPCODE_DL: { ModelRoData_DisplayListRecord* rodata = &node->Data->DisplayList; PROMOTE(rodata->Vertices); @@ -8848,7 +8716,7 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: { ModelRoData_DisplayList_CollisionRecord* rodata = &node->Data->DisplayListCollisions; PROMOTE(rodata->Vertices); @@ -8862,14 +8730,14 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_UNUSED_20: + case MODELNODE_OPCODE_OP20: { ModelRoData_HeaderRecord* rodata = &node->Data->Header; PROMOTE(rodata->FirstGroup); break; } - case MODELNODE_OPCODE_UNUSED_05: + case MODELNODE_OPCODE_OP05: { ModelRoData_Op05Record* rodata = &node->Data->Op05; @@ -8886,7 +8754,7 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: { ModelRoData_Op07Record* rodata = &node->Data->Op07; PROMOTE(rodata->unk00); @@ -8905,14 +8773,14 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_UNUSED_06: + case MODELNODE_OPCODE_OP06: { ModelRoData_Op06Record* rodata = &node->Data->Op06; rodata->BaseAddr = (void *)fileramaddr; break; } - case MODELNODE_OPCODE_LODRECORD: + case MODELNODE_OPCODE_LOD: { ModelRoData_LODRecord* rodata = &node->Data->LOD; PROMOTE(rodata->Affects); @@ -8920,14 +8788,14 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_SWITCHRECORD: + case MODELNODE_OPCODE_SWITCH: { ModelRoData_SwitchRecord* rodata = &node->Data->Switch; PROMOTE(rodata->Controls); break; } - case MODELNODE_OPCODE_BSPRECORD: + case MODELNODE_OPCODE_BSP: { ModelRoData_BSPRecord* rodata = &node->Data->BSP; PROMOTE(rodata->leftChild); @@ -8935,14 +8803,14 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_UNUSED_17: + case MODELNODE_OPCODE_OP17: { ModelRoData_GroupRecord* rodata = &node->Data->Group; PROMOTE(rodata->ChildGroup); break; } - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: { ModelRoData_Op11Record* rodata = &node->Data->Op11; PROMOTE(rodata->unk0c[15]); @@ -8950,7 +8818,7 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: { ModelRoData_GunfireRecord* rodata = &node->Data->Gunfire; PROMOTE(rodata->Image); @@ -8958,7 +8826,7 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_SHADOWRECORD: + case MODELNODE_OPCODE_SHADOW: { ModelRoData_ShadowRecord* rodata = &node->Data->Shadow; PROMOTE(rodata->image); @@ -8967,7 +8835,7 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi break; } - case MODELNODE_OPCODE_DISPLAYLISTPRIMARYRECORD: + case MODELNODE_OPCODE_DLPRIMARY: { ModelRoData_DisplayListPrimaryRecord* rodata = &node->Data->DisplayListPrimary; PROMOTE(rodata->Vertices); @@ -9000,57 +8868,16 @@ void convert_obj_microcode_offset_to_rdram_addr(ModelNode *node, u32 vma, u32 fi } -#ifdef NONMATCHING -void sub_GAME_7F075A90(ModelFileHeader *header, s32 arg1, ModelNode **node) { +void sub_GAME_7F075A90(ModelFileHeader *header, s32 vma, u32 addr) { + s32 diff = addr - vma; s32 i; + for(i = 0;i < header->numSwitches;i++) { - if (header->Switches[i] != 0) { - header->Switches[i] = header->Switches[i] + (node - arg1); - } + PROMOTE(header->Switches[i]); } - convert_obj_microcode_offset_to_rdram_addr(header->RootNode, arg1, header->numSwitches); + modelPromoteNodeOffsetsToPointers(header->RootNode, vma, addr); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F075A90 -/* 0AA5C0 7F075A90 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0AA5C4 7F075A94 AFBF001C */ sw $ra, 0x1c($sp) -/* 0AA5C8 7F075A98 AFB10018 */ sw $s1, 0x18($sp) -/* 0AA5CC 7F075A9C AFB00014 */ sw $s0, 0x14($sp) -/* 0AA5D0 7F075AA0 8487000C */ lh $a3, 0xc($a0) -/* 0AA5D4 7F075AA4 00808025 */ move $s0, $a0 -/* 0AA5D8 7F075AA8 00A08825 */ move $s1, $a1 -/* 0AA5DC 7F075AAC 18E0000E */ blez $a3, .L7F075AE8 -/* 0AA5E0 7F075AB0 00001025 */ move $v0, $zero -/* 0AA5E4 7F075AB4 00001825 */ move $v1, $zero -.L7F075AB8: -/* 0AA5E8 7F075AB8 8E0E0008 */ lw $t6, 8($s0) -/* 0AA5EC 7F075ABC 00D17823 */ subu $t7, $a2, $s1 -/* 0AA5F0 7F075AC0 24420001 */ addiu $v0, $v0, 1 -/* 0AA5F4 7F075AC4 01C32021 */ addu $a0, $t6, $v1 -/* 0AA5F8 7F075AC8 8C850000 */ lw $a1, ($a0) -/* 0AA5FC 7F075ACC 10A00003 */ beqz $a1, .L7F075ADC -/* 0AA600 7F075AD0 00AFC021 */ addu $t8, $a1, $t7 -/* 0AA604 7F075AD4 AC980000 */ sw $t8, ($a0) -/* 0AA608 7F075AD8 8607000C */ lh $a3, 0xc($s0) -.L7F075ADC: -/* 0AA60C 7F075ADC 0047082A */ slt $at, $v0, $a3 -/* 0AA610 7F075AE0 1420FFF5 */ bnez $at, .L7F075AB8 -/* 0AA614 7F075AE4 24630004 */ addiu $v1, $v1, 4 -.L7F075AE8: -/* 0AA618 7F075AE8 8E040000 */ lw $a0, ($s0) -/* 0AA61C 7F075AEC 0FC1D577 */ jal convert_obj_microcode_offset_to_rdram_addr -/* 0AA620 7F075AF0 02202825 */ move $a1, $s1 -/* 0AA624 7F075AF4 8FBF001C */ lw $ra, 0x1c($sp) -/* 0AA628 7F075AF8 8FB00014 */ lw $s0, 0x14($sp) -/* 0AA62C 7F075AFC 8FB10018 */ lw $s1, 0x18($sp) -/* 0AA630 7F075B00 03E00008 */ jr $ra -/* 0AA634 7F075B04 27BD0020 */ addiu $sp, $sp, 0x20 -) -#endif - void REMOVED_sub_GAME_7F075B08(s32 param_1,s32 param_2,s32 param_3,s32 param_4) { @@ -9070,7 +8897,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) switch (type) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: if (1) { ModelRoData_HeaderRecord *rodata = &node->Data->Header; @@ -9078,7 +8905,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) len += sizeof(struct ModelRwData_HeaderRecord) / 4; break; } - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: if (1) { ModelRoData_Op07Record *rodata = &node->Data->Op07; @@ -9086,7 +8913,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) len += sizeof(struct ModelRwData_Op07Record) / 4; break; } - case MODELNODE_OPCODE_LODRECORD: + case MODELNODE_OPCODE_LOD: if (1) { ModelRoData_LODRecord *rodata = &node->Data->LOD; @@ -9095,7 +8922,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) node->Child = rodata->Affects; break; } - case MODELNODE_OPCODE_SWITCHRECORD: + case MODELNODE_OPCODE_SWITCH: if (1) { ModelRoData_SwitchRecord *rodata = &node->Data->Switch; @@ -9104,7 +8931,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) node->Child = rodata->Controls; break; } - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: + case MODELNODE_OPCODE_HEAD: if (1) { ModelRoData_HeadPlaceholderRecord *rodata = &node->Data->HeadPlaceholder; @@ -9113,16 +8940,16 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) node->Child = NULL; break; } - case MODELNODE_OPCODE_BSPRECORD: + case MODELNODE_OPCODE_BSP: if (1) { ModelRoData_BSPRecord *rodata = &node->Data->BSP; rodata->RwDataIndex = len; len += sizeof(struct ModelRwData_BSPRecord) / 4; - sub_GAME_7F06EA54(node, FALSE); + modelApplyReorderRelationsByArg(node, FALSE); break; } - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: if (1) { ModelRoData_Op11Record *rodata = &node->Data->Op11; @@ -9130,7 +8957,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) len += sizeof(struct ModelRwData_Op11Record) / 4; break; } - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: if (1) { ModelRoData_GunfireRecord *rodata = &node->Data->Gunfire; @@ -9138,7 +8965,7 @@ s32 modelCalculateRwDataIndexes(ModelNode *basenode) len += sizeof(struct ModelRwData_GunfireRecord) / 4; break; } - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: if (1) { ModelRoData_DisplayList_CollisionRecord *rodata = &node->Data->DisplayListCollisions; @@ -9198,7 +9025,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) switch (type) { - case MODELNODE_OPCODE_HEADERRECORD: + case MODELNODE_OPCODE_HEADER: if (1) { ModelRwData_HeaderRecord* rwdata = &modelGetNodeRwData(model, node)->Header; @@ -9233,7 +9060,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_OP07RECORD: + case MODELNODE_OPCODE_OP07: if (1) { ModelRwData_Op07Record* rwdata = &modelGetNodeRwData(model, node)->Op07; @@ -9242,7 +9069,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) } - case MODELNODE_OPCODE_LODRECORD: + case MODELNODE_OPCODE_LOD: if (1) { ModelRoData_LODRecord* rodata = &node->Data->LOD; @@ -9252,7 +9079,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_SWITCHRECORD: + case MODELNODE_OPCODE_SWITCH: if (1) { ModelRoData_SwitchRecord* rodata = &node->Data->Switch; @@ -9262,7 +9089,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_HEADPLACEHOLDERRECORD: + case MODELNODE_OPCODE_HEAD: if (1) { ModelRwData_HeadPlaceholderRecord* rwdata = &modelGetNodeRwData(model, node)->HeadPlaceholder; @@ -9271,16 +9098,16 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_BSPRECORD: + case MODELNODE_OPCODE_BSP: if (1) { ModelRwData_BSPRecord* rwdata = &modelGetNodeRwData(model, node)->BSP; rwdata->visible = FALSE; - sub_GAME_7F06EB10(model, node); + modelApplyReorderRelations(model, node); break; } - case MODELNODE_OPCODE_OP11RECORD: + case MODELNODE_OPCODE_OP11: if (1) { ModelRwData_Op11Record* rwdata = &modelGetNodeRwData(model, node)->Op11; @@ -9288,7 +9115,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_GUNFIRERECORD: + case MODELNODE_OPCODE_GUNFIRE: if (1) { ModelRwData_GunfireRecord* rwdata = &modelGetNodeRwData(model, node)->Gunfire; @@ -9296,7 +9123,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) break; } - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: if (1) { ModelRoData_DisplayList_CollisionRecord* rodata = &node->Data->DisplayListCollisions; @@ -9337,7 +9164,7 @@ void modelInitRwData(Model *model, ModelNode *startnode) } -void sub_GAME_7F075F68(struct Model *objinst, struct ModelFileHeader *header, u32 *data) +void modelInit(struct Model *objinst, struct ModelFileHeader *header, u32 *data) { objinst->obj = header; objinst->datas = data; @@ -9349,9 +9176,10 @@ void sub_GAME_7F075F68(struct Model *objinst, struct ModelFileHeader *header, u3 } -void sub_GAME_7F075FAC(struct Model *objinst, struct ModelFileHeader *header, u32 *data) +// PD: animInit +void animInit(struct Model *objinst, struct ModelFileHeader *header, u32 *data) { - sub_GAME_7F075F68(objinst, header, data); + modelInit(objinst, header, data); objinst->anim = NULL; objinst->anim2 = NULL; objinst->animlooping = 0; @@ -9366,15 +9194,16 @@ void sub_GAME_7F075FAC(struct Model *objinst, struct ModelFileHeader *header, u3 objinst->unk88 = 0.0f; objinst->unkb0 = 0.0f; objinst->speed = 1.0f; - objinst->unk70 = 1.0f; - objinst->unka4 = 1.0f; + objinst->speed2 = 1.0f; + objinst->playspeed = 1.0f; objinst->unkb8 = 1.0f; - objinst->unk3c = -1.0f; + objinst->endframe = -1.0f; objinst->unk6c = -1.0f; } -void sub_GAME_7F076030(Model *pmodel, ModelFileHeader *pmodeldef, ModelNode *pnode, ModelFileHeader *cmodeldef) +// PD: model00023108 +void modelAttachPart(Model *pmodel, ModelFileHeader *pmodeldef, ModelNode *pnode, ModelFileHeader *cmodeldef) { ModelRwData_HeadPlaceholderRecord *rwdata = modelGetNodeRwData(pmodel, pnode); ModelNode *node; @@ -9425,7 +9254,7 @@ void modelIterateDisplayLists(ModelFileHeader *fileheader, ModelNode **nodeptr, switch (type) { - case MODELNODE_OPCODE_DISPLAYLISTRECORD: + case MODELNODE_OPCODE_DL: rodata = node->Data; if (node != *nodeptr) @@ -9438,7 +9267,7 @@ void modelIterateDisplayLists(ModelFileHeader *fileheader, ModelNode **nodeptr, } break; - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: rodata = node->Data; if (node != *nodeptr) @@ -9451,7 +9280,7 @@ void modelIterateDisplayLists(ModelFileHeader *fileheader, ModelNode **nodeptr, } break; - case MODELNODE_OPCODE_DISPLAYLISTPRIMARYRECORD: + case MODELNODE_OPCODE_DLPRIMARY: rodata = node->Data; if (node != *nodeptr) @@ -9460,18 +9289,18 @@ void modelIterateDisplayLists(ModelFileHeader *fileheader, ModelNode **nodeptr, } break; - case MODELNODE_OPCODE_LODRECORD: + case MODELNODE_OPCODE_LOD: rodata = node->Data; node->Child = rodata->LOD.Affects; break; - case MODELNODE_OPCODE_SWITCHRECORD: + case MODELNODE_OPCODE_SWITCH: rodata = node->Data; node->Child = rodata->Switch.Controls; break; - case MODELNODE_OPCODE_BSPRECORD: - sub_GAME_7F06EA54(node, TRUE); + case MODELNODE_OPCODE_BSP: + modelApplyReorderRelationsByArg(node, TRUE); break; } @@ -9507,7 +9336,7 @@ void modelNodeReplaceGdl(u32 arg0, ModelNode *node, Gfx *find, Gfx *replacement) u32 type = node->Opcode & 0xff; switch (type) { - case MODELNODE_OPCODE_DISPLAYLISTRECORD: + case MODELNODE_OPCODE_DL: rodata = node->Data; if (rodata->DisplayList.Primary == find) @@ -9523,7 +9352,7 @@ void modelNodeReplaceGdl(u32 arg0, ModelNode *node, Gfx *find, Gfx *replacement) } break; - case MODELNODE_OPCODE_DISPLAYLIST_COLLISIONRECORD: + case MODELNODE_OPCODE_DLCOLLISION: rodata = node->Data; if (rodata->DisplayListCollisions.Primary == find) @@ -9539,7 +9368,7 @@ void modelNodeReplaceGdl(u32 arg0, ModelNode *node, Gfx *find, Gfx *replacement) } break; - case MODELNODE_OPCODE_DISPLAYLISTPRIMARYRECORD: + case MODELNODE_OPCODE_DLPRIMARY: rodata = node->Data; if (rodata->DisplayListPrimary.Primary == find) diff --git a/src/game/mp_music.c b/src/game/mp_music.c index 84e1ea94..fc2eb3b7 100644 --- a/src/game/mp_music.c +++ b/src/game/mp_music.c @@ -1809,7 +1809,7 @@ void sub_GAME_7F0C11FC(s32 stagenum) return; } -void sub_GAME_7F0C1268(void) +void set_missionstate_zero(void) { set_missionstate(MISSION_STATE_0); } diff --git a/src/game/mp_watch.c b/src/game/mp_watch.c index 13b8c1a8..a0ac6040 100644 --- a/src/game/mp_watch.c +++ b/src/game/mp_watch.c @@ -17,6 +17,7 @@ #include "lvl_text.h" #include "mp_music.h" #include "file.h" +#include "assets/obseg/text/LmpmenuE.h" // bss s32 g_stopPlayFlag; @@ -30,9 +31,9 @@ s32 who_paused; // data u16 g_AwardNames[] = { - TEXT(LMPMENU,0),TEXT(LMPMENU,1),TEXT(LMPMENU,2),TEXT(LMPMENU,3),TEXT(LMPMENU,4),TEXT(LMPMENU,5), - TEXT(LMPMENU,6),TEXT(LMPMENU,7),TEXT(LMPMENU,8),TEXT(LMPMENU,9),TEXT(LMPMENU,0xA),TEXT(LMPMENU,0xB), - TEXT(LMPMENU,0xC),TEXT(LMPMENU,0xD),TEXT(LMPMENU,0xE),TEXT(LMPMENU,0xF),TEXT(LMPMENU,0x10) + TEXT(LMPMENU, MPMENU_STR_00),TEXT(LMPMENU, MPMENU_STR_01),TEXT(LMPMENU, MPMENU_STR_02),TEXT(LMPMENU, MPMENU_STR_03),TEXT(LMPMENU, MPMENU_STR_04),TEXT(LMPMENU, MPMENU_STR_05), + TEXT(LMPMENU, MPMENU_STR_06),TEXT(LMPMENU, MPMENU_STR_07),TEXT(LMPMENU, MPMENU_STR_08),TEXT(LMPMENU, MPMENU_STR_09),TEXT(LMPMENU, MPMENU_STR_0A),TEXT(LMPMENU, MPMENU_STR_0B), + TEXT(LMPMENU, MPMENU_STR_0C),TEXT(LMPMENU, MPMENU_STR_0D),TEXT(LMPMENU, MPMENU_STR_0E),TEXT(LMPMENU, MPMENU_STR_0F),TEXT(LMPMENU, MPMENU_STR_10) }; //rodata @@ -271,7 +272,7 @@ void pauseAndLockControls(void) { } -s32 sub_GAME_7F0C24BC(void) +s32 disablePlayerActionsWhenPausedOrInMpMenu(void) { if (getPlayerCount() == 1) { @@ -724,7 +725,7 @@ Gfx *display_text_for_playerdata_on_MP_menu(Gfx *gdl, s32 x, s32 y, u16* arg3, T sprintf(&sp48, &ascii_MP_watch_menu_percentd, arg3); - sub_GAME_7F0AE98C(&sp50, &sp54, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0); + textMeasure(&sp50, &sp54, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0); sp5C = x - (sp54 >> 1); sp58 = y; @@ -734,37 +735,37 @@ Gfx *display_text_for_playerdata_on_MP_menu(Gfx *gdl, s32 x, s32 y, u16* arg3, T case GREEN_NORMAL: viX = viGetX(); viY = viGetY(); - gdl = en_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFF00B0, viX, viY, 0, 0); + gdl = textRender(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF00B0, viX, viY, 0, 0); break; case GREEN_HIGHLIGHT: viX = viGetX(); viY = viGetY(); - gdl = jp_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xA0FFA0F0, 0x7000A0, viX, viY, 0, 0); + gdl = textRenderGlow(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0xA0FFA0F0, 0x7000A0, viX, viY, 0, 0); break; case RED_NORMAL: viX = viGetX(); viY = viGetY(); - gdl = en_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFF4040B0, viX, viY, 0, 0); + gdl = textRender(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0xFF4040B0, viX, viY, 0, 0); break; case RED_HIGHLIGHT: viX = viGetX(); viY = viGetY(); - gdl = jp_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xFFA0A0F0, 0x700000A0, viX, viY, 0, 0); + gdl = textRenderGlow(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0xFFA0A0F0, 0x700000A0, viX, viY, 0, 0); break; case BLUE_NORMAL: viX = viGetX(); viY = viGetY(); - gdl = en_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0x4040FFB0, viX, viY, 0, 0); + gdl = textRender(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0x4040FFB0, viX, viY, 0, 0); break; case BLUE_HIGHLIGHT: viX = viGetX(); viY = viGetY(); - gdl = jp_text_write_stuff(gdl, &sp5C, &sp58, &sp48, ptrSecondFontTableSmall, ptrFirstFontTableSmall, 0xA0A0FFF0, 0x70A0, viX, viY, 0, 0); + gdl = textRenderGlow(gdl, &sp5C, &sp58, &sp48, ptrFontBankGothicChars, ptrFontBankGothic, 0xA0A0FFF0, 0x70A0, viX, viY, 0, 0); break; } @@ -1460,15 +1461,15 @@ glabel mp_watch_menu_display /* 0F8CBC 7F0C418C AFA400CC */ sw $a0, 0xcc($sp) def_7F0C40C0: .L7F0C4190: -/* 0F8CC0 7F0C4190 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0F8CC4 7F0C4194 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F8CC8 7F0C4198 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F8CCC 7F0C419C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F8CC0 7F0C4190 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0F8CC4 7F0C4194 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F8CC8 7F0C4198 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F8CCC 7F0C419C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F8CD0 7F0C41A0 27A400BC */ addiu $a0, $sp, 0xbc /* 0F8CD4 7F0C41A4 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F8CD8 7F0C41A8 8FA600A4 */ lw $a2, 0xa4($sp) /* 0F8CDC 7F0C41AC AFA00014 */ sw $zero, 0x14($sp) -/* 0F8CE0 7F0C41B0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F8CE0 7F0C41B0 0FC2BA63 */ jal textMeasure /* 0F8CE4 7F0C41B4 AFB80010 */ sw $t8, 0x10($sp) /* 0F8CE8 7F0C41B8 0C001145 */ jal viGetViewLeft /* 0F8CEC 7F0C41BC 00000000 */ nop @@ -1492,10 +1493,10 @@ glabel mp_watch_menu_display /* 0F8D34 7F0C4204 0010C403 */ sra $t8, $s0, 0x10 /* 0F8D38 7F0C4208 0C00110B */ jal viGetY /* 0F8D3C 7F0C420C 03008025 */ move $s0, $t8 -/* 0F8D40 7F0C4210 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 0F8D44 7F0C4214 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableSmall) -/* 0F8D48 7F0C4218 8D4A0EAC */ lw $t2, %lo(ptrFirstFontTableSmall)($t2) -/* 0F8D4C 7F0C421C 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F8D40 7F0C4210 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) +/* 0F8D44 7F0C4214 3C0A8004 */ lui $t2, %hi(ptrFontBankGothic) +/* 0F8D48 7F0C4218 8D4A0EAC */ lw $t2, %lo(ptrFontBankGothic)($t2) +/* 0F8D4C 7F0C421C 8F390EB0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F8D50 7F0C4220 3C09A0FF */ lui $t1, (0xA0FFA0F0 >> 16) # lui $t1, 0xa0ff /* 0F8D54 7F0C4224 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 /* 0F8D58 7F0C4228 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 @@ -1511,7 +1512,7 @@ glabel mp_watch_menu_display /* 0F8D80 7F0C4250 AFA00028 */ sw $zero, 0x28($sp) /* 0F8D84 7F0C4254 AFA0002C */ sw $zero, 0x2c($sp) /* 0F8D88 7F0C4258 AFAA0014 */ sw $t2, 0x14($sp) -/* 0F8D8C 7F0C425C 0FC2B9BB */ jal jp_text_write_stuff +/* 0F8D8C 7F0C425C 0FC2B9BB */ jal textRenderGlow /* 0F8D90 7F0C4260 AFB90010 */ sw $t9, 0x10($sp) /* 0F8D94 7F0C4264 1000001A */ b .L7F0C42D0 /* 0F8D98 7F0C4268 00408825 */ move $s1, $v0 @@ -1522,10 +1523,10 @@ glabel mp_watch_menu_display /* 0F8DA8 7F0C4278 00106403 */ sra $t4, $s0, 0x10 /* 0F8DAC 7F0C427C 0C00110B */ jal viGetY /* 0F8DB0 7F0C4280 01808025 */ move $s0, $t4 -/* 0F8DB4 7F0C4284 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) -/* 0F8DB8 7F0C4288 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0F8DBC 7F0C428C 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0F8DC0 7F0C4290 8DAD0EB0 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) +/* 0F8DB4 7F0C4284 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) +/* 0F8DB8 7F0C4288 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0F8DBC 7F0C428C 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0F8DC0 7F0C4290 8DAD0EB0 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) /* 0F8DC4 7F0C4294 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0F8DC8 7F0C4298 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0F8DCC 7F0C429C AFAF0018 */ sw $t7, 0x18($sp) @@ -1538,7 +1539,7 @@ glabel mp_watch_menu_display /* 0F8DE8 7F0C42B8 AFA00024 */ sw $zero, 0x24($sp) /* 0F8DEC 7F0C42BC AFA00028 */ sw $zero, 0x28($sp) /* 0F8DF0 7F0C42C0 AFAE0014 */ sw $t6, 0x14($sp) -/* 0F8DF4 7F0C42C4 0FC2B6AF */ jal en_text_write_stuff +/* 0F8DF4 7F0C42C4 0FC2B6AF */ jal textRender /* 0F8DF8 7F0C42C8 AFAD0010 */ sw $t5, 0x10($sp) /* 0F8DFC 7F0C42CC 00408825 */ move $s1, $v0 .L7F0C42D0: @@ -1583,10 +1584,10 @@ glabel mp_watch_menu_display /* 0F8E90 7F0C4360 00107C03 */ sra $t7, $s0, 0x10 /* 0F8E94 7F0C4364 0C00110B */ jal viGetY /* 0F8E98 7F0C4368 01E08025 */ move $s0, $t7 -/* 0F8E9C 7F0C436C 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) -/* 0F8EA0 7F0C4370 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 0F8EA4 7F0C4374 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F8EA8 7F0C4378 8F180EB0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0F8E9C 7F0C436C 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) +/* 0F8EA0 7F0C4370 3C198004 */ lui $t9, %hi(ptrFontBankGothic) +/* 0F8EA4 7F0C4374 8F390EAC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F8EA8 7F0C4378 8F180EB0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0F8EAC 7F0C437C 3C0A00FF */ lui $t2, (0x00FF00B0 >> 16) # lui $t2, 0xff /* 0F8EB0 7F0C4380 354A00B0 */ ori $t2, (0x00FF00B0 & 0xFFFF) # ori $t2, $t2, 0xb0 /* 0F8EB4 7F0C4384 3C078006 */ lui $a3, %hi(ascii_MP_watch_menu_left_chevron) @@ -1600,7 +1601,7 @@ glabel mp_watch_menu_display /* 0F8ED4 7F0C43A4 AFA00024 */ sw $zero, 0x24($sp) /* 0F8ED8 7F0C43A8 AFA00028 */ sw $zero, 0x28($sp) /* 0F8EDC 7F0C43AC AFB90014 */ sw $t9, 0x14($sp) -/* 0F8EE0 7F0C43B0 0FC2B6AF */ jal en_text_write_stuff +/* 0F8EE0 7F0C43B0 0FC2B6AF */ jal textRender /* 0F8EE4 7F0C43B4 AFB80010 */ sw $t8, 0x10($sp) /* 0F8EE8 7F0C43B8 1000001E */ b .L7F0C4434 /* 0F8EEC 7F0C43BC 00408825 */ move $s1, $v0 @@ -1611,10 +1612,10 @@ glabel mp_watch_menu_display /* 0F8EFC 7F0C43CC 00104C03 */ sra $t1, $s0, 0x10 /* 0F8F00 7F0C43D0 0C00110B */ jal viGetY /* 0F8F04 7F0C43D4 01208025 */ move $s0, $t1 -/* 0F8F08 7F0C43D8 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableSmall) -/* 0F8F0C 7F0C43DC 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0F8F10 7F0C43E0 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F8F14 7F0C43E4 8D6B0EB0 */ lw $t3, %lo(ptrSecondFontTableSmall)($t3) +/* 0F8F08 7F0C43D8 3C0B8004 */ lui $t3, %hi(ptrFontBankGothicChars) +/* 0F8F0C 7F0C43DC 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0F8F10 7F0C43E0 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F8F14 7F0C43E4 8D6B0EB0 */ lw $t3, %lo(ptrFontBankGothicChars)($t3) /* 0F8F18 7F0C43E8 3C0DA0FF */ lui $t5, (0xA0FFA0F0 >> 16) # lui $t5, 0xa0ff /* 0F8F1C 7F0C43EC 3C0E0070 */ lui $t6, (0x007000A0 >> 16) # lui $t6, 0x70 /* 0F8F20 7F0C43F0 35CE00A0 */ ori $t6, (0x007000A0 & 0xFFFF) # ori $t6, $t6, 0xa0 @@ -1631,7 +1632,7 @@ glabel mp_watch_menu_display /* 0F8F4C 7F0C441C AFA00028 */ sw $zero, 0x28($sp) /* 0F8F50 7F0C4420 AFA0002C */ sw $zero, 0x2c($sp) /* 0F8F54 7F0C4424 AFAC0014 */ sw $t4, 0x14($sp) -/* 0F8F58 7F0C4428 0FC2B9BB */ jal jp_text_write_stuff +/* 0F8F58 7F0C4428 0FC2B9BB */ jal textRenderGlow /* 0F8F5C 7F0C442C AFAB0010 */ sw $t3, 0x10($sp) /* 0F8F60 7F0C4430 00408825 */ move $s1, $v0 .L7F0C4434: @@ -1676,10 +1677,10 @@ glabel mp_watch_menu_display /* 0F8FF4 7F0C44C4 00107403 */ sra $t6, $s0, 0x10 /* 0F8FF8 7F0C44C8 0C00110B */ jal viGetY /* 0F8FFC 7F0C44CC 01C08025 */ move $s0, $t6 -/* 0F9000 7F0C44D0 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0F9004 7F0C44D4 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 0F9008 7F0C44D8 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F900C 7F0C44DC 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0F9000 7F0C44D0 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0F9004 7F0C44D4 3C198004 */ lui $t9, %hi(ptrFontBankGothic) +/* 0F9008 7F0C44D8 8F390EAC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F900C 7F0C44DC 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0F9010 7F0C44E0 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff /* 0F9014 7F0C44E4 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 /* 0F9018 7F0C44E8 3C078006 */ lui $a3, %hi(ascii_MP_watch_menu_right_chevron) @@ -1693,7 +1694,7 @@ glabel mp_watch_menu_display /* 0F9038 7F0C4508 AFA00024 */ sw $zero, 0x24($sp) /* 0F903C 7F0C450C AFA00028 */ sw $zero, 0x28($sp) /* 0F9040 7F0C4510 AFB90014 */ sw $t9, 0x14($sp) -/* 0F9044 7F0C4514 0FC2B6AF */ jal en_text_write_stuff +/* 0F9044 7F0C4514 0FC2B6AF */ jal textRender /* 0F9048 7F0C4518 AFAF0010 */ sw $t7, 0x10($sp) /* 0F904C 7F0C451C 1000001E */ b .L7F0C4598 /* 0F9050 7F0C4520 00408825 */ move $s1, $v0 @@ -1704,10 +1705,10 @@ glabel mp_watch_menu_display /* 0F9060 7F0C4530 00105403 */ sra $t2, $s0, 0x10 /* 0F9064 7F0C4534 0C00110B */ jal viGetY /* 0F9068 7F0C4538 01408025 */ move $s0, $t2 -/* 0F906C 7F0C453C 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) -/* 0F9070 7F0C4540 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) -/* 0F9074 7F0C4544 8D6B0EAC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F9078 7F0C4548 8D290EB0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0F906C 7F0C453C 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) +/* 0F9070 7F0C4540 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) +/* 0F9074 7F0C4544 8D6B0EAC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F9078 7F0C4548 8D290EB0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0F907C 7F0C454C 3C0CA0FF */ lui $t4, (0xA0FFA0F0 >> 16) # lui $t4, 0xa0ff /* 0F9080 7F0C4550 3C0D0070 */ lui $t5, (0x007000A0 >> 16) # lui $t5, 0x70 /* 0F9084 7F0C4554 35AD00A0 */ ori $t5, (0x007000A0 & 0xFFFF) # ori $t5, $t5, 0xa0 @@ -1724,7 +1725,7 @@ glabel mp_watch_menu_display /* 0F90B0 7F0C4580 AFA00028 */ sw $zero, 0x28($sp) /* 0F90B4 7F0C4584 AFA0002C */ sw $zero, 0x2c($sp) /* 0F90B8 7F0C4588 AFAB0014 */ sw $t3, 0x14($sp) -/* 0F90BC 7F0C458C 0FC2B9BB */ jal jp_text_write_stuff +/* 0F90BC 7F0C458C 0FC2B9BB */ jal textRenderGlow /* 0F90C0 7F0C4590 AFA90010 */ sw $t1, 0x10($sp) /* 0F90C4 7F0C4594 00408825 */ move $s1, $v0 .L7F0C4598: @@ -1770,15 +1771,15 @@ glabel mp_watch_menu_display /* 0F9154 7F0C4624 27A400AC */ addiu $a0, $sp, 0xac /* 0F9158 7F0C4628 0FC30F25 */ jal write_playerrank_to_buffer /* 0F915C 7F0C462C 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F9160 7F0C4630 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableSmall) -/* 0F9164 7F0C4634 8D4A0EAC */ lw $t2, %lo(ptrFirstFontTableSmall)($t2) -/* 0F9168 7F0C4638 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F916C 7F0C463C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F9160 7F0C4630 3C0A8004 */ lui $t2, %hi(ptrFontBankGothic) +/* 0F9164 7F0C4634 8D4A0EAC */ lw $t2, %lo(ptrFontBankGothic)($t2) +/* 0F9168 7F0C4638 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F916C 7F0C463C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9170 7F0C4640 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9174 7F0C4644 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9178 7F0C4648 27A600AC */ addiu $a2, $sp, 0xac /* 0F917C 7F0C464C AFA00014 */ sw $zero, 0x14($sp) -/* 0F9180 7F0C4650 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F9180 7F0C4650 0FC2BA63 */ jal textMeasure /* 0F9184 7F0C4654 AFAA0010 */ sw $t2, 0x10($sp) /* 0F9188 7F0C4658 0C001145 */ jal viGetViewLeft /* 0F918C 7F0C465C 00000000 */ nop @@ -1800,10 +1801,10 @@ glabel mp_watch_menu_display /* 0F91CC 7F0C469C 00105403 */ sra $t2, $s0, 0x10 /* 0F91D0 7F0C46A0 0C00110B */ jal viGetY /* 0F91D4 7F0C46A4 01408025 */ move $s0, $t2 -/* 0F91D8 7F0C46A8 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) -/* 0F91DC 7F0C46AC 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0F91E0 7F0C46B0 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F91E4 7F0C46B4 8D290EB0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0F91D8 7F0C46A8 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) +/* 0F91DC 7F0C46AC 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0F91E0 7F0C46B0 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F91E4 7F0C46B4 8D290EB0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0F91E8 7F0C46B8 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff /* 0F91EC 7F0C46BC 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 /* 0F91F0 7F0C46C0 AFAB0018 */ sw $t3, 0x18($sp) @@ -1816,7 +1817,7 @@ glabel mp_watch_menu_display /* 0F920C 7F0C46DC AFA00024 */ sw $zero, 0x24($sp) /* 0F9210 7F0C46E0 AFA00028 */ sw $zero, 0x28($sp) /* 0F9214 7F0C46E4 AFAC0014 */ sw $t4, 0x14($sp) -/* 0F9218 7F0C46E8 0FC2B6AF */ jal en_text_write_stuff +/* 0F9218 7F0C46E8 0FC2B6AF */ jal textRender /* 0F921C 7F0C46EC AFA90010 */ sw $t1, 0x10($sp) /* 0F9220 7F0C46F0 00408825 */ move $s1, $v0 .L7F0C46F4: @@ -1839,16 +1840,16 @@ glabel mp_watch_menu_display /* 0F9260 7F0C4730 AFA20080 */ sw $v0, 0x80($sp) /* 0F9264 7F0C4734 0FC30776 */ jal langGet /* 0F9268 7F0C4738 3404A01B */ li $a0, 40987 -/* 0F926C 7F0C473C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) -/* 0F9270 7F0C4740 8DEF0EAC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9274 7F0C4744 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0F926C 7F0C473C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) +/* 0F9270 7F0C4740 8DEF0EAC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9274 7F0C4744 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0F9278 7F0C4748 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F927C 7F0C474C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F927C 7F0C474C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9280 7F0C4750 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9284 7F0C4754 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9288 7F0C4758 00403025 */ move $a2, $v0 /* 0F928C 7F0C475C AFA00014 */ sw $zero, 0x14($sp) -/* 0F9290 7F0C4760 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F9290 7F0C4760 0FC2BA63 */ jal textMeasure /* 0F9294 7F0C4764 AFAF0010 */ sw $t7, 0x10($sp) /* 0F9298 7F0C4768 0C001145 */ jal viGetViewLeft /* 0F929C 7F0C476C 00000000 */ nop @@ -1870,10 +1871,10 @@ glabel mp_watch_menu_display /* 0F92DC 7F0C47AC 00107C03 */ sra $t7, $s0, 0x10 /* 0F92E0 7F0C47B0 0C00110B */ jal viGetY /* 0F92E4 7F0C47B4 01E08025 */ move $s0, $t7 -/* 0F92E8 7F0C47B8 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 0F92EC 7F0C47BC 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableSmall) -/* 0F92F0 7F0C47C0 8D4A0EAC */ lw $t2, %lo(ptrFirstFontTableSmall)($t2) -/* 0F92F4 7F0C47C4 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F92E8 7F0C47B8 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) +/* 0F92EC 7F0C47BC 3C0A8004 */ lui $t2, %hi(ptrFontBankGothic) +/* 0F92F0 7F0C47C0 8D4A0EAC */ lw $t2, %lo(ptrFontBankGothic)($t2) +/* 0F92F4 7F0C47C4 8F390EB0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F92F8 7F0C47C8 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff /* 0F92FC 7F0C47CC 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 /* 0F9300 7F0C47D0 AFB80018 */ sw $t8, 0x18($sp) @@ -1886,7 +1887,7 @@ glabel mp_watch_menu_display /* 0F931C 7F0C47EC AFA00024 */ sw $zero, 0x24($sp) /* 0F9320 7F0C47F0 AFA00028 */ sw $zero, 0x28($sp) /* 0F9324 7F0C47F4 AFAA0014 */ sw $t2, 0x14($sp) -/* 0F9328 7F0C47F8 0FC2B6AF */ jal en_text_write_stuff +/* 0F9328 7F0C47F8 0FC2B6AF */ jal textRender /* 0F932C 7F0C47FC AFB90010 */ sw $t9, 0x10($sp) /* 0F9330 7F0C4800 8FA30080 */ lw $v1, 0x80($sp) /* 0F9334 7F0C4804 24010005 */ li $at, 5 @@ -2210,15 +2211,15 @@ glabel mp_watch_menu_display /* 0F97C4 7F0C4C94 27A400AC */ addiu $a0, $sp, 0xac /* 0F97C8 7F0C4C98 0FC30F25 */ jal write_playerrank_to_buffer /* 0F97CC 7F0C4C9C 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F97D0 7F0C4CA0 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0F97D4 7F0C4CA4 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F97D8 7F0C4CA8 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F97DC 7F0C4CAC 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F97D0 7F0C4CA0 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0F97D4 7F0C4CA4 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F97D8 7F0C4CA8 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F97DC 7F0C4CAC 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F97E0 7F0C4CB0 27A400BC */ addiu $a0, $sp, 0xbc /* 0F97E4 7F0C4CB4 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F97E8 7F0C4CB8 27A600AC */ addiu $a2, $sp, 0xac /* 0F97EC 7F0C4CBC AFA00014 */ sw $zero, 0x14($sp) -/* 0F97F0 7F0C4CC0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F97F0 7F0C4CC0 0FC2BA63 */ jal textMeasure /* 0F97F4 7F0C4CC4 AFAC0010 */ sw $t4, 0x10($sp) /* 0F97F8 7F0C4CC8 0C001145 */ jal viGetViewLeft /* 0F97FC 7F0C4CCC 00000000 */ nop @@ -2240,10 +2241,10 @@ glabel mp_watch_menu_display /* 0F983C 7F0C4D0C 00106403 */ sra $t4, $s0, 0x10 /* 0F9840 7F0C4D10 0C00110B */ jal viGetY /* 0F9844 7F0C4D14 01808025 */ move $s0, $t4 -/* 0F9848 7F0C4D18 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableSmall) -/* 0F984C 7F0C4D1C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) -/* 0F9850 7F0C4D20 8DEF0EAC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9854 7F0C4D24 8D6B0EB0 */ lw $t3, %lo(ptrSecondFontTableSmall)($t3) +/* 0F9848 7F0C4D18 3C0B8004 */ lui $t3, %hi(ptrFontBankGothicChars) +/* 0F984C 7F0C4D1C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) +/* 0F9850 7F0C4D20 8DEF0EAC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9854 7F0C4D24 8D6B0EB0 */ lw $t3, %lo(ptrFontBankGothicChars)($t3) /* 0F9858 7F0C4D28 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0F985C 7F0C4D2C 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0F9860 7F0C4D30 AFAD0018 */ sw $t5, 0x18($sp) @@ -2256,7 +2257,7 @@ glabel mp_watch_menu_display /* 0F987C 7F0C4D4C AFA00024 */ sw $zero, 0x24($sp) /* 0F9880 7F0C4D50 AFA00028 */ sw $zero, 0x28($sp) /* 0F9884 7F0C4D54 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F9888 7F0C4D58 0FC2B6AF */ jal en_text_write_stuff +/* 0F9888 7F0C4D58 0FC2B6AF */ jal textRender /* 0F988C 7F0C4D5C AFAB0010 */ sw $t3, 0x10($sp) /* 0F9890 7F0C4D60 00408825 */ move $s1, $v0 .L7F0C4D64: @@ -2273,15 +2274,15 @@ glabel mp_watch_menu_display /* 0F98BC 7F0C4D8C AFA20010 */ sw $v0, 0x10($sp) /* 0F98C0 7F0C4D90 0C002B25 */ jal sprintf /* 0F98C4 7F0C4D94 24E70001 */ addiu $a3, $a3, 1 -/* 0F98C8 7F0C4D98 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 0F98CC 7F0C4D9C 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F98D0 7F0C4DA0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F98D4 7F0C4DA4 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F98C8 7F0C4D98 3C198004 */ lui $t9, %hi(ptrFontBankGothic) +/* 0F98CC 7F0C4D9C 8F390EAC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F98D0 7F0C4DA0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F98D4 7F0C4DA4 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F98D8 7F0C4DA8 27A400BC */ addiu $a0, $sp, 0xbc /* 0F98DC 7F0C4DAC 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F98E0 7F0C4DB0 27A600AC */ addiu $a2, $sp, 0xac /* 0F98E4 7F0C4DB4 AFA00014 */ sw $zero, 0x14($sp) -/* 0F98E8 7F0C4DB8 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F98E8 7F0C4DB8 0FC2BA63 */ jal textMeasure /* 0F98EC 7F0C4DBC AFB90010 */ sw $t9, 0x10($sp) /* 0F98F0 7F0C4DC0 0C001145 */ jal viGetViewLeft /* 0F98F4 7F0C4DC4 00000000 */ nop @@ -2303,10 +2304,10 @@ glabel mp_watch_menu_display /* 0F9934 7F0C4E04 0010CC03 */ sra $t9, $s0, 0x10 /* 0F9938 7F0C4E08 0C00110B */ jal viGetY /* 0F993C 7F0C4E0C 03208025 */ move $s0, $t9 -/* 0F9940 7F0C4E10 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) -/* 0F9944 7F0C4E14 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0F9948 7F0C4E18 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F994C 7F0C4E1C 8DCE0EB0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0F9940 7F0C4E10 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) +/* 0F9944 7F0C4E14 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0F9948 7F0C4E18 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F994C 7F0C4E1C 8DCE0EB0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0F9950 7F0C4E20 3C0A00FF */ lui $t2, (0x00FF00B0 >> 16) # lui $t2, 0xff /* 0F9954 7F0C4E24 354A00B0 */ ori $t2, (0x00FF00B0 & 0xFFFF) # ori $t2, $t2, 0xb0 /* 0F9958 7F0C4E28 AFAA0018 */ sw $t2, 0x18($sp) @@ -2319,7 +2320,7 @@ glabel mp_watch_menu_display /* 0F9974 7F0C4E44 AFA00024 */ sw $zero, 0x24($sp) /* 0F9978 7F0C4E48 AFA00028 */ sw $zero, 0x28($sp) /* 0F997C 7F0C4E4C AFB80014 */ sw $t8, 0x14($sp) -/* 0F9980 7F0C4E50 0FC2B6AF */ jal en_text_write_stuff +/* 0F9980 7F0C4E50 0FC2B6AF */ jal textRender /* 0F9984 7F0C4E54 AFAE0010 */ sw $t6, 0x10($sp) /* 0F9988 7F0C4E58 8FA900D0 */ lw $t1, 0xd0($sp) /* 0F998C 7F0C4E5C 00408825 */ move $s1, $v0 @@ -2505,15 +2506,15 @@ glabel mp_watch_menu_display /* 0F9C3C 7F0C510C 27A400AC */ addiu $a0, $sp, 0xac /* 0F9C40 7F0C5110 0FC30F25 */ jal write_playerrank_to_buffer /* 0F9C44 7F0C5114 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F9C48 7F0C5118 3C098004 */ lui $t1, %hi(ptrFirstFontTableSmall) -/* 0F9C4C 7F0C511C 8D290EAC */ lw $t1, %lo(ptrFirstFontTableSmall)($t1) -/* 0F9C50 7F0C5120 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F9C54 7F0C5124 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F9C48 7F0C5118 3C098004 */ lui $t1, %hi(ptrFontBankGothic) +/* 0F9C4C 7F0C511C 8D290EAC */ lw $t1, %lo(ptrFontBankGothic)($t1) +/* 0F9C50 7F0C5120 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F9C54 7F0C5124 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9C58 7F0C5128 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9C5C 7F0C512C 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9C60 7F0C5130 27A600AC */ addiu $a2, $sp, 0xac /* 0F9C64 7F0C5134 AFA00014 */ sw $zero, 0x14($sp) -/* 0F9C68 7F0C5138 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F9C68 7F0C5138 0FC2BA63 */ jal textMeasure /* 0F9C6C 7F0C513C AFA90010 */ sw $t1, 0x10($sp) /* 0F9C70 7F0C5140 0C001145 */ jal viGetViewLeft /* 0F9C74 7F0C5144 00000000 */ nop @@ -2535,10 +2536,10 @@ glabel mp_watch_menu_display /* 0F9CB4 7F0C5184 00104C03 */ sra $t1, $s0, 0x10 /* 0F9CB8 7F0C5188 0C00110B */ jal viGetY /* 0F9CBC 7F0C518C 01208025 */ move $s0, $t1 -/* 0F9CC0 7F0C5190 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) -/* 0F9CC4 7F0C5194 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) -/* 0F9CC8 7F0C5198 8DEF0EAC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9CCC 7F0C519C 8D8C0EB0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F9CC0 7F0C5190 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) +/* 0F9CC4 7F0C5194 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) +/* 0F9CC8 7F0C5198 8DEF0EAC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9CCC 7F0C519C 8D8C0EB0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F9CD0 7F0C51A0 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff /* 0F9CD4 7F0C51A4 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 /* 0F9CD8 7F0C51A8 AFAB0018 */ sw $t3, 0x18($sp) @@ -2551,7 +2552,7 @@ glabel mp_watch_menu_display /* 0F9CF4 7F0C51C4 AFA00024 */ sw $zero, 0x24($sp) /* 0F9CF8 7F0C51C8 AFA00028 */ sw $zero, 0x28($sp) /* 0F9CFC 7F0C51CC AFAF0014 */ sw $t7, 0x14($sp) -/* 0F9D00 7F0C51D0 0FC2B6AF */ jal en_text_write_stuff +/* 0F9D00 7F0C51D0 0FC2B6AF */ jal textRender /* 0F9D04 7F0C51D4 AFAC0010 */ sw $t4, 0x10($sp) /* 0F9D08 7F0C51D8 00408825 */ move $s1, $v0 .L7F0C51DC: @@ -2568,15 +2569,15 @@ glabel mp_watch_menu_display /* 0F9D34 7F0C5204 AFA20010 */ sw $v0, 0x10($sp) /* 0F9D38 7F0C5208 0C002B25 */ jal sprintf /* 0F9D3C 7F0C520C 24E70001 */ addiu $a3, $a3, 1 -/* 0F9D40 7F0C5210 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0F9D44 7F0C5214 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F9D48 7F0C5218 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0F9D4C 7F0C521C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F9D40 7F0C5210 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) +/* 0F9D44 7F0C5214 8DAD0EAC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F9D48 7F0C5218 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0F9D4C 7F0C521C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9D50 7F0C5220 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9D54 7F0C5224 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9D58 7F0C5228 27A600AC */ addiu $a2, $sp, 0xac /* 0F9D5C 7F0C522C AFA00014 */ sw $zero, 0x14($sp) -/* 0F9D60 7F0C5230 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0F9D60 7F0C5230 0FC2BA63 */ jal textMeasure /* 0F9D64 7F0C5234 AFAD0010 */ sw $t5, 0x10($sp) /* 0F9D68 7F0C5238 0C001145 */ jal viGetViewLeft /* 0F9D6C 7F0C523C 00000000 */ nop @@ -2598,10 +2599,10 @@ glabel mp_watch_menu_display /* 0F9DAC 7F0C527C 00106C03 */ sra $t5, $s0, 0x10 /* 0F9DB0 7F0C5280 0C00110B */ jal viGetY /* 0F9DB4 7F0C5284 01A08025 */ move $s0, $t5 -/* 0F9DB8 7F0C5288 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 0F9DBC 7F0C528C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0F9DC0 7F0C5290 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F9DC4 7F0C5294 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F9DB8 7F0C5288 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) +/* 0F9DBC 7F0C528C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0F9DC0 7F0C5290 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F9DC4 7F0C5294 8F390EB0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F9DC8 7F0C5298 3C0EFF40 */ lui $t6, (0xFF4040B0 >> 16) # lui $t6, 0xff40 /* 0F9DCC 7F0C529C 35CE40B0 */ ori $t6, (0xFF4040B0 & 0xFFFF) # ori $t6, $t6, 0x40b0 /* 0F9DD0 7F0C52A0 AFAE0018 */ sw $t6, 0x18($sp) @@ -2614,7 +2615,7 @@ glabel mp_watch_menu_display /* 0F9DEC 7F0C52BC AFA00024 */ sw $zero, 0x24($sp) /* 0F9DF0 7F0C52C0 AFA00028 */ sw $zero, 0x28($sp) /* 0F9DF4 7F0C52C4 AFB80014 */ sw $t8, 0x14($sp) -/* 0F9DF8 7F0C52C8 0FC2B6AF */ jal en_text_write_stuff +/* 0F9DF8 7F0C52C8 0FC2B6AF */ jal textRender /* 0F9DFC 7F0C52CC AFB90010 */ sw $t9, 0x10($sp) /* 0F9E00 7F0C52D0 8FAA00D0 */ lw $t2, 0xd0($sp) /* 0F9E04 7F0C52D4 24010002 */ li $at, 2 @@ -2951,16 +2952,16 @@ glabel mp_watch_menu_display .L7F0C57C0: /* 0FA2F0 7F0C57C0 0FC30776 */ jal langGet /* 0FA2F4 7F0C57C4 3404A01F */ li $a0, 40991 -/* 0FA2F8 7F0C57C8 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0FA2FC 7F0C57CC 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA300 7F0C57D0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FA2F8 7F0C57C8 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0FA2FC 7F0C57CC 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA300 7F0C57D0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FA304 7F0C57D4 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FA308 7F0C57D8 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA308 7F0C57D8 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA30C 7F0C57DC 27A4007C */ addiu $a0, $sp, 0x7c /* 0FA310 7F0C57E0 27A50078 */ addiu $a1, $sp, 0x78 /* 0FA314 7F0C57E4 00403025 */ move $a2, $v0 /* 0FA318 7F0C57E8 AFA00014 */ sw $zero, 0x14($sp) -/* 0FA31C 7F0C57EC 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA31C 7F0C57EC 0FC2BA63 */ jal textMeasure /* 0FA320 7F0C57F0 AFAC0010 */ sw $t4, 0x10($sp) /* 0FA324 7F0C57F4 0C001145 */ jal viGetViewLeft /* 0FA328 7F0C57F8 00000000 */ nop @@ -2982,10 +2983,10 @@ glabel mp_watch_menu_display /* 0FA368 7F0C5838 00106403 */ sra $t4, $s0, 0x10 /* 0FA36C 7F0C583C 0C00110B */ jal viGetY /* 0FA370 7F0C5840 01808025 */ move $s0, $t4 -/* 0FA374 7F0C5844 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0FA378 7F0C5848 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) -/* 0FA37C 7F0C584C 8F390EAC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0FA380 7F0C5850 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FA374 7F0C5844 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0FA378 7F0C5848 3C198004 */ lui $t9, %hi(ptrFontBankGothic) +/* 0FA37C 7F0C584C 8F390EAC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0FA380 7F0C5850 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FA384 7F0C5854 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0FA388 7F0C5858 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0FA38C 7F0C585C AFAD0018 */ sw $t5, 0x18($sp) @@ -2998,22 +2999,22 @@ glabel mp_watch_menu_display /* 0FA3A8 7F0C5878 AFA00024 */ sw $zero, 0x24($sp) /* 0FA3AC 7F0C587C AFA00028 */ sw $zero, 0x28($sp) /* 0FA3B0 7F0C5880 AFB90014 */ sw $t9, 0x14($sp) -/* 0FA3B4 7F0C5884 0FC2B6AF */ jal en_text_write_stuff +/* 0FA3B4 7F0C5884 0FC2B6AF */ jal textRender /* 0FA3B8 7F0C5888 AFAF0010 */ sw $t7, 0x10($sp) /* 0FA3BC 7F0C588C 00408825 */ move $s1, $v0 /* 0FA3C0 7F0C5890 8FA400D4 */ lw $a0, 0xd4($sp) /* 0FA3C4 7F0C5894 0FC026D4 */ jal getplayerfavoredweapon /* 0FA3C8 7F0C5898 00002825 */ move $a1, $zero -/* 0FA3CC 7F0C589C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0FA3D0 7F0C58A0 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FA3D4 7F0C58A4 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FA3CC 7F0C589C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0FA3D0 7F0C58A0 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FA3D4 7F0C58A4 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FA3D8 7F0C58A8 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FA3DC 7F0C58AC 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA3DC 7F0C58AC 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA3E0 7F0C58B0 27A4007C */ addiu $a0, $sp, 0x7c /* 0FA3E4 7F0C58B4 27A50078 */ addiu $a1, $sp, 0x78 /* 0FA3E8 7F0C58B8 00403025 */ move $a2, $v0 /* 0FA3EC 7F0C58BC AFA00014 */ sw $zero, 0x14($sp) -/* 0FA3F0 7F0C58C0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA3F0 7F0C58C0 0FC2BA63 */ jal textMeasure /* 0FA3F4 7F0C58C4 AFB80010 */ sw $t8, 0x10($sp) /* 0FA3F8 7F0C58C8 0C001145 */ jal viGetViewLeft /* 0FA3FC 7F0C58CC 00000000 */ nop @@ -3047,10 +3048,10 @@ glabel mp_watch_menu_display /* 0FA464 7F0C5934 00107403 */ sra $t6, $s0, 0x10 /* 0FA468 7F0C5938 0C00110B */ jal viGetY /* 0FA46C 7F0C593C 01C08025 */ move $s0, $t6 -/* 0FA470 7F0C5940 3C098004 */ lui $t1, %hi(ptrSecondFontTableSmall) -/* 0FA474 7F0C5944 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0FA478 7F0C5948 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA47C 7F0C594C 8D290EB0 */ lw $t1, %lo(ptrSecondFontTableSmall)($t1) +/* 0FA470 7F0C5940 3C098004 */ lui $t1, %hi(ptrFontBankGothicChars) +/* 0FA474 7F0C5944 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0FA478 7F0C5948 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA47C 7F0C594C 8D290EB0 */ lw $t1, %lo(ptrFontBankGothicChars)($t1) /* 0FA480 7F0C5950 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0FA484 7F0C5954 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0FA488 7F0C5958 AFAF0018 */ sw $t7, 0x18($sp) @@ -3063,7 +3064,7 @@ glabel mp_watch_menu_display /* 0FA4A4 7F0C5974 AFA00024 */ sw $zero, 0x24($sp) /* 0FA4A8 7F0C5978 AFA00028 */ sw $zero, 0x28($sp) /* 0FA4AC 7F0C597C AFAC0014 */ sw $t4, 0x14($sp) -/* 0FA4B0 7F0C5980 0FC2B6AF */ jal en_text_write_stuff +/* 0FA4B0 7F0C5980 0FC2B6AF */ jal textRender /* 0FA4B4 7F0C5984 AFA90010 */ sw $t1, 0x10($sp) /* 0FA4B8 7F0C5988 3C038008 */ lui $v1, %hi(g_CurrentPlayer) /* 0FA4BC 7F0C598C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -3071,15 +3072,15 @@ glabel mp_watch_menu_display /* 0FA4C4 7F0C5994 27A4007C */ addiu $a0, $sp, 0x7c /* 0FA4C8 7F0C5998 8C682A10 */ lw $t0, 0x2a10($v1) /* 0FA4CC 7F0C599C 27A50078 */ addiu $a1, $sp, 0x78 -/* 0FA4D0 7F0C59A0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FA4D0 7F0C59A0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FA4D4 7F0C59A4 11000031 */ beqz $t0, .L7F0C5A6C /* 0FA4D8 7F0C59A8 01003025 */ move $a2, $t0 -/* 0FA4DC 7F0C59AC 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0FA4E0 7F0C59B0 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FA4E4 7F0C59B4 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA4DC 7F0C59AC 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) +/* 0FA4E0 7F0C59B0 8DAD0EAC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FA4E4 7F0C59B4 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA4E8 7F0C59B8 AFA00014 */ sw $zero, 0x14($sp) /* 0FA4EC 7F0C59BC AFA800A4 */ sw $t0, 0xa4($sp) -/* 0FA4F0 7F0C59C0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA4F0 7F0C59C0 0FC2BA63 */ jal textMeasure /* 0FA4F4 7F0C59C4 AFAD0010 */ sw $t5, 0x10($sp) /* 0FA4F8 7F0C59C8 0C001145 */ jal viGetViewLeft /* 0FA4FC 7F0C59CC 00000000 */ nop @@ -3101,10 +3102,10 @@ glabel mp_watch_menu_display /* 0FA53C 7F0C5A0C 00106C03 */ sra $t5, $s0, 0x10 /* 0FA540 7F0C5A10 0C00110B */ jal viGetY /* 0FA544 7F0C5A14 01A08025 */ move $s0, $t5 -/* 0FA548 7F0C5A18 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 0FA54C 7F0C5A1C 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) -/* 0FA550 7F0C5A20 8D6B0EAC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0FA554 7F0C5A24 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0FA548 7F0C5A18 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) +/* 0FA54C 7F0C5A1C 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) +/* 0FA550 7F0C5A20 8D6B0EAC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0FA554 7F0C5A24 8F390EB0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0FA558 7F0C5A28 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff /* 0FA55C 7F0C5A2C 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 /* 0FA560 7F0C5A30 AFB80018 */ sw $t8, 0x18($sp) @@ -3117,7 +3118,7 @@ glabel mp_watch_menu_display /* 0FA57C 7F0C5A4C AFA00024 */ sw $zero, 0x24($sp) /* 0FA580 7F0C5A50 AFA00028 */ sw $zero, 0x28($sp) /* 0FA584 7F0C5A54 AFAB0014 */ sw $t3, 0x14($sp) -/* 0FA588 7F0C5A58 0FC2B6AF */ jal en_text_write_stuff +/* 0FA588 7F0C5A58 0FC2B6AF */ jal textRender /* 0FA58C 7F0C5A5C AFB90010 */ sw $t9, 0x10($sp) /* 0FA590 7F0C5A60 3C038008 */ lui $v1, %hi(g_CurrentPlayer) /* 0FA594 7F0C5A64 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -3128,13 +3129,13 @@ glabel mp_watch_menu_display /* 0FA5A4 7F0C5A74 27A50078 */ addiu $a1, $sp, 0x78 /* 0FA5A8 7F0C5A78 10400032 */ beqz $v0, .L7F0C5B44 /* 0FA5AC 7F0C5A7C 00403025 */ move $a2, $v0 -/* 0FA5B0 7F0C5A80 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableSmall) -/* 0FA5B4 7F0C5A84 8D4A0EAC */ lw $t2, %lo(ptrFirstFontTableSmall)($t2) -/* 0FA5B8 7F0C5A88 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0FA5BC 7F0C5A8C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA5B0 7F0C5A80 3C0A8004 */ lui $t2, %hi(ptrFontBankGothic) +/* 0FA5B4 7F0C5A84 8D4A0EAC */ lw $t2, %lo(ptrFontBankGothic)($t2) +/* 0FA5B8 7F0C5A88 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0FA5BC 7F0C5A8C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA5C0 7F0C5A90 AFA00014 */ sw $zero, 0x14($sp) /* 0FA5C4 7F0C5A94 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FA5C8 7F0C5A98 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA5C8 7F0C5A98 0FC2BA63 */ jal textMeasure /* 0FA5CC 7F0C5A9C AFAA0010 */ sw $t2, 0x10($sp) /* 0FA5D0 7F0C5AA0 0C001145 */ jal viGetViewLeft /* 0FA5D4 7F0C5AA4 00000000 */ nop @@ -3156,10 +3157,10 @@ glabel mp_watch_menu_display /* 0FA614 7F0C5AE4 00105403 */ sra $t2, $s0, 0x10 /* 0FA618 7F0C5AE8 0C00110B */ jal viGetY /* 0FA61C 7F0C5AEC 01408025 */ move $s0, $t2 -/* 0FA620 7F0C5AF0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) -/* 0FA624 7F0C5AF4 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0FA628 7F0C5AF8 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA62C 7F0C5AFC 8DCE0EB0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0FA620 7F0C5AF0 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) +/* 0FA624 7F0C5AF4 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0FA628 7F0C5AF8 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA62C 7F0C5AFC 8DCE0EB0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0FA630 7F0C5B00 3C0900FF */ lui $t1, (0x00FF00B0 >> 16) # lui $t1, 0xff /* 0FA634 7F0C5B04 352900B0 */ ori $t1, (0x00FF00B0 & 0xFFFF) # ori $t1, $t1, 0xb0 /* 0FA638 7F0C5B08 AFA90018 */ sw $t1, 0x18($sp) @@ -3172,7 +3173,7 @@ glabel mp_watch_menu_display /* 0FA654 7F0C5B24 AFA00024 */ sw $zero, 0x24($sp) /* 0FA658 7F0C5B28 AFA00028 */ sw $zero, 0x28($sp) /* 0FA65C 7F0C5B2C AFAC0014 */ sw $t4, 0x14($sp) -/* 0FA660 7F0C5B30 0FC2B6AF */ jal en_text_write_stuff +/* 0FA660 7F0C5B30 0FC2B6AF */ jal textRender /* 0FA664 7F0C5B34 AFAE0010 */ sw $t6, 0x10($sp) /* 0FA668 7F0C5B38 3C038008 */ lui $v1, %hi(g_CurrentPlayer) /* 0FA66C 7F0C5B3C 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -3185,16 +3186,16 @@ glabel mp_watch_menu_display /* 0FA680 7F0C5B50 00000000 */ nop /* 0FA684 7F0C5B54 0FC30776 */ jal langGet /* 0FA688 7F0C5B58 3404A020 */ li $a0, 40992 -/* 0FA68C 7F0C5B5C 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0FA690 7F0C5B60 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FA694 7F0C5B64 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FA68C 7F0C5B5C 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) +/* 0FA690 7F0C5B60 8DAD0EAC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FA694 7F0C5B64 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FA698 7F0C5B68 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FA69C 7F0C5B6C 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA69C 7F0C5B6C 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA6A0 7F0C5B70 27A400BC */ addiu $a0, $sp, 0xbc /* 0FA6A4 7F0C5B74 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FA6A8 7F0C5B78 00403025 */ move $a2, $v0 /* 0FA6AC 7F0C5B7C AFA00014 */ sw $zero, 0x14($sp) -/* 0FA6B0 7F0C5B80 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA6B0 7F0C5B80 0FC2BA63 */ jal textMeasure /* 0FA6B4 7F0C5B84 AFAD0010 */ sw $t5, 0x10($sp) /* 0FA6B8 7F0C5B88 0C001145 */ jal viGetViewLeft /* 0FA6BC 7F0C5B8C 00000000 */ nop @@ -3222,10 +3223,10 @@ glabel mp_watch_menu_display /* 0FA714 7F0C5BE4 0010C403 */ sra $t8, $s0, 0x10 /* 0FA718 7F0C5BE8 0C00110B */ jal viGetY /* 0FA71C 7F0C5BEC 03008025 */ move $s0, $t8 -/* 0FA720 7F0C5BF0 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableSmall) -/* 0FA724 7F0C5BF4 3C0A8004 */ lui $t2, %hi(ptrFirstFontTableSmall) -/* 0FA728 7F0C5BF8 8D4A0EAC */ lw $t2, %lo(ptrFirstFontTableSmall)($t2) -/* 0FA72C 7F0C5BFC 8D6B0EB0 */ lw $t3, %lo(ptrSecondFontTableSmall)($t3) +/* 0FA720 7F0C5BF0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothicChars) +/* 0FA724 7F0C5BF4 3C0A8004 */ lui $t2, %hi(ptrFontBankGothic) +/* 0FA728 7F0C5BF8 8D4A0EAC */ lw $t2, %lo(ptrFontBankGothic)($t2) +/* 0FA72C 7F0C5BFC 8D6B0EB0 */ lw $t3, %lo(ptrFontBankGothicChars)($t3) /* 0FA730 7F0C5C00 3C0EA0FF */ lui $t6, (0xA0FFA0F0 >> 16) # lui $t6, 0xa0ff /* 0FA734 7F0C5C04 3C0C0070 */ lui $t4, (0x007000A0 >> 16) # lui $t4, 0x70 /* 0FA738 7F0C5C08 358C00A0 */ ori $t4, (0x007000A0 & 0xFFFF) # ori $t4, $t4, 0xa0 @@ -3241,7 +3242,7 @@ glabel mp_watch_menu_display /* 0FA760 7F0C5C30 AFA00028 */ sw $zero, 0x28($sp) /* 0FA764 7F0C5C34 AFA0002C */ sw $zero, 0x2c($sp) /* 0FA768 7F0C5C38 AFAA0014 */ sw $t2, 0x14($sp) -/* 0FA76C 7F0C5C3C 0FC2B9BB */ jal jp_text_write_stuff +/* 0FA76C 7F0C5C3C 0FC2B9BB */ jal textRenderGlow /* 0FA770 7F0C5C40 AFAB0010 */ sw $t3, 0x10($sp) /* 0FA774 7F0C5C44 1000001A */ b .L7F0C5CB0 /* 0FA778 7F0C5C48 00408825 */ move $s1, $v0 @@ -3252,10 +3253,10 @@ glabel mp_watch_menu_display /* 0FA788 7F0C5C58 00104C03 */ sra $t1, $s0, 0x10 /* 0FA78C 7F0C5C5C 0C00110B */ jal viGetY /* 0FA790 7F0C5C60 01208025 */ move $s0, $t1 -/* 0FA794 7F0C5C64 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0FA798 7F0C5C68 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0FA79C 7F0C5C6C 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FA7A0 7F0C5C70 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FA794 7F0C5C64 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0FA798 7F0C5C68 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) +/* 0FA79C 7F0C5C6C 8DAD0EAC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FA7A0 7F0C5C70 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FA7A4 7F0C5C74 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0FA7A8 7F0C5C78 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0FA7AC 7F0C5C7C AFB90018 */ sw $t9, 0x18($sp) @@ -3268,22 +3269,22 @@ glabel mp_watch_menu_display /* 0FA7C8 7F0C5C98 AFA00024 */ sw $zero, 0x24($sp) /* 0FA7CC 7F0C5C9C AFA00028 */ sw $zero, 0x28($sp) /* 0FA7D0 7F0C5CA0 AFAD0014 */ sw $t5, 0x14($sp) -/* 0FA7D4 7F0C5CA4 0FC2B6AF */ jal en_text_write_stuff +/* 0FA7D4 7F0C5CA4 0FC2B6AF */ jal textRender /* 0FA7D8 7F0C5CA8 AFAF0010 */ sw $t7, 0x10($sp) /* 0FA7DC 7F0C5CAC 00408825 */ move $s1, $v0 .L7F0C5CB0: /* 0FA7E0 7F0C5CB0 0FC30776 */ jal langGet /* 0FA7E4 7F0C5CB4 3404A021 */ li $a0, 40993 -/* 0FA7E8 7F0C5CB8 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0FA7EC 7F0C5CBC 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FA7F0 7F0C5CC0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FA7E8 7F0C5CB8 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0FA7EC 7F0C5CBC 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FA7F0 7F0C5CC0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FA7F4 7F0C5CC4 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FA7F8 7F0C5CC8 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA7F8 7F0C5CC8 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA7FC 7F0C5CCC 27A400BC */ addiu $a0, $sp, 0xbc /* 0FA800 7F0C5CD0 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FA804 7F0C5CD4 00403025 */ move $a2, $v0 /* 0FA808 7F0C5CD8 AFA00014 */ sw $zero, 0x14($sp) -/* 0FA80C 7F0C5CDC 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FA80C 7F0C5CDC 0FC2BA63 */ jal textMeasure /* 0FA810 7F0C5CE0 AFB80010 */ sw $t8, 0x10($sp) /* 0FA814 7F0C5CE4 0C001145 */ jal viGetViewLeft /* 0FA818 7F0C5CE8 00000000 */ nop @@ -3312,10 +3313,10 @@ glabel mp_watch_menu_display /* 0FA874 7F0C5D44 00107403 */ sra $t6, $s0, 0x10 /* 0FA878 7F0C5D48 0C00110B */ jal viGetY /* 0FA87C 7F0C5D4C 01C08025 */ move $s0, $t6 -/* 0FA880 7F0C5D50 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) -/* 0FA884 7F0C5D54 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) -/* 0FA888 7F0C5D58 8D8C0EAC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA88C 7F0C5D5C 8D4A0EB0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0FA880 7F0C5D50 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) +/* 0FA884 7F0C5D54 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) +/* 0FA888 7F0C5D58 8D8C0EAC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA88C 7F0C5D5C 8D4A0EB0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0FA890 7F0C5D60 3C09A0FF */ lui $t1, (0xA0FFA0F0 >> 16) # lui $t1, 0xa0ff /* 0FA894 7F0C5D64 3C0F0070 */ lui $t7, (0x007000A0 >> 16) # lui $t7, 0x70 /* 0FA898 7F0C5D68 35EF00A0 */ ori $t7, (0x007000A0 & 0xFFFF) # ori $t7, $t7, 0xa0 @@ -3331,7 +3332,7 @@ glabel mp_watch_menu_display /* 0FA8C0 7F0C5D90 AFA00028 */ sw $zero, 0x28($sp) /* 0FA8C4 7F0C5D94 AFA0002C */ sw $zero, 0x2c($sp) /* 0FA8C8 7F0C5D98 AFAC0014 */ sw $t4, 0x14($sp) -/* 0FA8CC 7F0C5D9C 0FC2B9BB */ jal jp_text_write_stuff +/* 0FA8CC 7F0C5D9C 0FC2B9BB */ jal textRenderGlow /* 0FA8D0 7F0C5DA0 AFAA0010 */ sw $t2, 0x10($sp) /* 0FA8D4 7F0C5DA4 1000001A */ b .L7F0C5E10 /* 0FA8D8 7F0C5DA8 00408825 */ move $s1, $v0 @@ -3342,10 +3343,10 @@ glabel mp_watch_menu_display /* 0FA8E8 7F0C5DB8 00106C03 */ sra $t5, $s0, 0x10 /* 0FA8EC 7F0C5DBC 0C00110B */ jal viGetY /* 0FA8F0 7F0C5DC0 01A08025 */ move $s0, $t5 -/* 0FA8F4 7F0C5DC4 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) -/* 0FA8F8 7F0C5DC8 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) -/* 0FA8FC 7F0C5DCC 8F180EAC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FA900 7F0C5DD0 8F390EB0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0FA8F4 7F0C5DC4 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) +/* 0FA8F8 7F0C5DC8 3C188004 */ lui $t8, %hi(ptrFontBankGothic) +/* 0FA8FC 7F0C5DCC 8F180EAC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FA900 7F0C5DD0 8F390EB0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0FA904 7F0C5DD4 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff /* 0FA908 7F0C5DD8 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 /* 0FA90C 7F0C5DDC AFAB0018 */ sw $t3, 0x18($sp) @@ -3358,7 +3359,7 @@ glabel mp_watch_menu_display /* 0FA928 7F0C5DF8 AFA00024 */ sw $zero, 0x24($sp) /* 0FA92C 7F0C5DFC AFA00028 */ sw $zero, 0x28($sp) /* 0FA930 7F0C5E00 AFB80014 */ sw $t8, 0x14($sp) -/* 0FA934 7F0C5E04 0FC2B6AF */ jal en_text_write_stuff +/* 0FA934 7F0C5E04 0FC2B6AF */ jal textRender /* 0FA938 7F0C5E08 AFB90010 */ sw $t9, 0x10($sp) /* 0FA93C 7F0C5E0C 00408825 */ move $s1, $v0 .L7F0C5E10: @@ -3446,16 +3447,16 @@ glabel mp_watch_menu_display /* 0FAA6C 7F0C5F3C 00408825 */ move $s1, $v0 /* 0FAA70 7F0C5F40 0FC30776 */ jal langGet /* 0FAA74 7F0C5F44 3404A022 */ li $a0, 40994 -/* 0FAA78 7F0C5F48 3C098004 */ lui $t1, %hi(ptrFirstFontTableSmall) -/* 0FAA7C 7F0C5F4C 8D290EAC */ lw $t1, %lo(ptrFirstFontTableSmall)($t1) -/* 0FAA80 7F0C5F50 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) +/* 0FAA78 7F0C5F48 3C098004 */ lui $t1, %hi(ptrFontBankGothic) +/* 0FAA7C 7F0C5F4C 8D290EAC */ lw $t1, %lo(ptrFontBankGothic)($t1) +/* 0FAA80 7F0C5F50 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) /* 0FAA84 7F0C5F54 AFA20060 */ sw $v0, 0x60($sp) -/* 0FAA88 7F0C5F58 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FAA88 7F0C5F58 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FAA8C 7F0C5F5C 27A40064 */ addiu $a0, $sp, 0x64 /* 0FAA90 7F0C5F60 27A50068 */ addiu $a1, $sp, 0x68 /* 0FAA94 7F0C5F64 00403025 */ move $a2, $v0 /* 0FAA98 7F0C5F68 AFA00014 */ sw $zero, 0x14($sp) -/* 0FAA9C 7F0C5F6C 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0FAA9C 7F0C5F6C 0FC2BA63 */ jal textMeasure /* 0FAAA0 7F0C5F70 AFA90010 */ sw $t1, 0x10($sp) /* 0FAAA4 7F0C5F74 0C001145 */ jal viGetViewLeft /* 0FAAA8 7F0C5F78 00000000 */ nop @@ -3483,10 +3484,10 @@ glabel mp_watch_menu_display /* 0FAB00 7F0C5FD0 0010CC03 */ sra $t9, $s0, 0x10 /* 0FAB04 7F0C5FD4 0C00110B */ jal viGetY /* 0FAB08 7F0C5FD8 03208025 */ move $s0, $t9 -/* 0FAB0C 7F0C5FDC 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) -/* 0FAB10 7F0C5FE0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) -/* 0FAB14 7F0C5FE4 8D6B0EAC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0FAB18 7F0C5FE8 8F180EB0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0FAB0C 7F0C5FDC 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) +/* 0FAB10 7F0C5FE0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) +/* 0FAB14 7F0C5FE4 8D6B0EAC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0FAB18 7F0C5FE8 8F180EB0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0FAB1C 7F0C5FEC 3C0E00FF */ lui $t6, (0x00FF00B0 >> 16) # lui $t6, 0xff /* 0FAB20 7F0C5FF0 35CE00B0 */ ori $t6, (0x00FF00B0 & 0xFFFF) # ori $t6, $t6, 0xb0 /* 0FAB24 7F0C5FF4 AFAE0018 */ sw $t6, 0x18($sp) @@ -3499,7 +3500,7 @@ glabel mp_watch_menu_display /* 0FAB40 7F0C6010 AFA00024 */ sw $zero, 0x24($sp) /* 0FAB44 7F0C6014 AFA00028 */ sw $zero, 0x28($sp) /* 0FAB48 7F0C6018 AFAB0014 */ sw $t3, 0x14($sp) -/* 0FAB4C 7F0C601C 0FC2B6AF */ jal en_text_write_stuff +/* 0FAB4C 7F0C601C 0FC2B6AF */ jal textRender /* 0FAB50 7F0C6020 AFB80010 */ sw $t8, 0x10($sp) /* 0FAB54 7F0C6024 0FC2B3BC */ jal combiner_bayer_lod_perspective /* 0FAB58 7F0C6028 00402025 */ move $a0, $v0 @@ -3635,15 +3636,15 @@ glabel mp_watch_menu_display /* 0F99AC 7F0C4E3C AFA400CC */ sw $a0, 0xcc($sp) def_7F0C40C0: .Ljp7F0C4E40: -/* 0F99B0 7F0C4E40 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F99B4 7F0C4E44 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F99B8 7F0C4E48 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F99BC 7F0C4E4C 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F99B0 7F0C4E40 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F99B4 7F0C4E44 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F99B8 7F0C4E48 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F99BC 7F0C4E4C 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F99C0 7F0C4E50 27A400BC */ addiu $a0, $sp, 0xbc /* 0F99C4 7F0C4E54 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F99C8 7F0C4E58 8FA600A4 */ lw $a2, 0xa4($sp) /* 0F99CC 7F0C4E5C AFA00014 */ sw $zero, 0x14($sp) -/* 0F99D0 7F0C4E60 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0F99D0 7F0C4E60 0FC2BD4F */ jal textMeasure /* 0F99D4 7F0C4E64 AFAB0010 */ sw $t3, 0x10($sp) /* 0F99D8 7F0C4E68 0C001145 */ jal viGetViewLeft /* 0F99DC 7F0C4E6C 00000000 */ nop @@ -3667,10 +3668,10 @@ glabel mp_watch_menu_display /* 0F9A24 7F0C4EB4 00107403 */ sra $t6, $s0, 0x10 /* 0F9A28 7F0C4EB8 0C00110B */ jal viGetY /* 0F9A2C 7F0C4EBC 01C08025 */ move $s0, $t6 -/* 0F9A30 7F0C4EC0 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) # $t5, 0x8004 -/* 0F9A34 7F0C4EC4 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F9A38 7F0C4EC8 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9A3C 7F0C4ECC 8DAD0EE0 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) +/* 0F9A30 7F0C4EC0 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) # $t5, 0x8004 +/* 0F9A34 7F0C4EC4 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F9A38 7F0C4EC8 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9A3C 7F0C4ECC 8DAD0EE0 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) /* 0F9A40 7F0C4ED0 3C18A0FF */ lui $t8, (0xA0FFA0F0 >> 16) # lui $t8, 0xa0ff /* 0F9A44 7F0C4ED4 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0F9A48 7F0C4ED8 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -3686,7 +3687,7 @@ glabel mp_watch_menu_display /* 0F9A70 7F0C4F00 AFA00028 */ sw $zero, 0x28($sp) /* 0F9A74 7F0C4F04 AFA0002C */ sw $zero, 0x2c($sp) /* 0F9A78 7F0C4F08 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F9A7C 7F0C4F0C 0FC2BCA7 */ jal jp_text_write_stuff +/* 0F9A7C 7F0C4F0C 0FC2BCA7 */ jal textRenderGlow /* 0F9A80 7F0C4F10 AFAD0010 */ sw $t5, 0x10($sp) /* 0F9A84 7F0C4F14 1000001A */ b .Ljp7F0C4F80 /* 0F9A88 7F0C4F18 00408825 */ move $s1, $v0 @@ -3697,10 +3698,10 @@ glabel mp_watch_menu_display /* 0F9A98 7F0C4F28 00105C03 */ sra $t3, $s0, 0x10 /* 0F9A9C 7F0C4F2C 0C00110B */ jal viGetY /* 0F9AA0 7F0C4F30 01608025 */ move $s0, $t3 -/* 0F9AA4 7F0C4F34 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F9AA8 7F0C4F38 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0F9AAC 7F0C4F3C 8DCE0EDC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0F9AB0 7F0C4F40 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F9AA4 7F0C4F34 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F9AA8 7F0C4F38 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0F9AAC 7F0C4F3C 8DCE0EDC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0F9AB0 7F0C4F40 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F9AB4 7F0C4F44 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0F9AB8 7F0C4F48 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0F9ABC 7F0C4F4C AFAD0018 */ sw $t5, 0x18($sp) @@ -3713,7 +3714,7 @@ glabel mp_watch_menu_display /* 0F9AD8 7F0C4F68 AFA00024 */ sw $zero, 0x24($sp) /* 0F9ADC 7F0C4F6C AFA00028 */ sw $zero, 0x28($sp) /* 0F9AE0 7F0C4F70 AFAE0014 */ sw $t6, 0x14($sp) -/* 0F9AE4 7F0C4F74 0FC2B99B */ jal en_text_write_stuff +/* 0F9AE4 7F0C4F74 0FC2B99B */ jal textRender /* 0F9AE8 7F0C4F78 AFAC0010 */ sw $t4, 0x10($sp) /* 0F9AEC 7F0C4F7C 00408825 */ move $s1, $v0 .Ljp7F0C4F80: @@ -3758,10 +3759,10 @@ glabel mp_watch_menu_display /* 0F9B80 7F0C5010 0010C403 */ sra $t8, $s0, 0x10 /* 0F9B84 7F0C5014 0C00110B */ jal viGetY /* 0F9B88 7F0C5018 03008025 */ move $s0, $t8 -/* 0F9B8C 7F0C501C 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) # $t9, 0x8004 -/* 0F9B90 7F0C5020 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F9B94 7F0C5024 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F9B98 7F0C5028 8F390EE0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F9B8C 7F0C501C 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) # $t9, 0x8004 +/* 0F9B90 7F0C5020 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F9B94 7F0C5024 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F9B98 7F0C5028 8F390EE0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F9B9C 7F0C502C 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0F9BA0 7F0C5030 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0F9BA4 7F0C5034 3C078006 */ lui $a3, %hi(ascii_MP_watch_menu_left_chevron) # $a3, 0x8006 @@ -3775,7 +3776,7 @@ glabel mp_watch_menu_display /* 0F9BC4 7F0C5054 AFA00024 */ sw $zero, 0x24($sp) /* 0F9BC8 7F0C5058 AFA00028 */ sw $zero, 0x28($sp) /* 0F9BCC 7F0C505C AFAB0014 */ sw $t3, 0x14($sp) -/* 0F9BD0 7F0C5060 0FC2B99B */ jal en_text_write_stuff +/* 0F9BD0 7F0C5060 0FC2B99B */ jal textRender /* 0F9BD4 7F0C5064 AFB90010 */ sw $t9, 0x10($sp) /* 0F9BD8 7F0C5068 1000001E */ b .Ljp7F0C50E4 /* 0F9BDC 7F0C506C 00408825 */ move $s1, $v0 @@ -3786,10 +3787,10 @@ glabel mp_watch_menu_display /* 0F9BEC 7F0C507C 00107403 */ sra $t6, $s0, 0x10 /* 0F9BF0 7F0C5080 0C00110B */ jal viGetY /* 0F9BF4 7F0C5084 01C08025 */ move $s0, $t6 -/* 0F9BF8 7F0C5088 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) # $t5, 0x8004 -/* 0F9BFC 7F0C508C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F9C00 7F0C5090 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9C04 7F0C5094 8DAD0EE0 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) +/* 0F9BF8 7F0C5088 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) # $t5, 0x8004 +/* 0F9BFC 7F0C508C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F9C00 7F0C5090 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9C04 7F0C5094 8DAD0EE0 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) /* 0F9C08 7F0C5098 3C18A0FF */ lui $t8, (0xA0FFA0F0 >> 16) # lui $t8, 0xa0ff /* 0F9C0C 7F0C509C 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0F9C10 7F0C50A0 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -3806,7 +3807,7 @@ glabel mp_watch_menu_display /* 0F9C3C 7F0C50CC AFA00028 */ sw $zero, 0x28($sp) /* 0F9C40 7F0C50D0 AFA0002C */ sw $zero, 0x2c($sp) /* 0F9C44 7F0C50D4 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F9C48 7F0C50D8 0FC2BCA7 */ jal jp_text_write_stuff +/* 0F9C48 7F0C50D8 0FC2BCA7 */ jal textRenderGlow /* 0F9C4C 7F0C50DC AFAD0010 */ sw $t5, 0x10($sp) /* 0F9C50 7F0C50E0 00408825 */ move $s1, $v0 .Ljp7F0C50E4: @@ -3851,10 +3852,10 @@ glabel mp_watch_menu_display /* 0F9CE4 7F0C5174 00107403 */ sra $t6, $s0, 0x10 /* 0F9CE8 7F0C5178 0C00110B */ jal viGetY /* 0F9CEC 7F0C517C 01C08025 */ move $s0, $t6 -/* 0F9CF0 7F0C5180 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F9CF4 7F0C5184 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F9CF8 7F0C5188 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F9CFC 7F0C518C 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F9CF0 7F0C5180 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F9CF4 7F0C5184 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F9CF8 7F0C5188 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F9CFC 7F0C518C 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F9D00 7F0C5190 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0F9D04 7F0C5194 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0F9D08 7F0C5198 3C078006 */ lui $a3, %hi(ascii_MP_watch_menu_right_chevron) # $a3, 0x8006 @@ -3868,7 +3869,7 @@ glabel mp_watch_menu_display /* 0F9D28 7F0C51B8 AFA00024 */ sw $zero, 0x24($sp) /* 0F9D2C 7F0C51BC AFA00028 */ sw $zero, 0x28($sp) /* 0F9D30 7F0C51C0 AFAD0014 */ sw $t5, 0x14($sp) -/* 0F9D34 7F0C51C4 0FC2B99B */ jal en_text_write_stuff +/* 0F9D34 7F0C51C4 0FC2B99B */ jal textRender /* 0F9D38 7F0C51C8 AFAC0010 */ sw $t4, 0x10($sp) /* 0F9D3C 7F0C51CC 1000001E */ b .Ljp7F0C5248 /* 0F9D40 7F0C51D0 00408825 */ move $s1, $v0 @@ -3879,10 +3880,10 @@ glabel mp_watch_menu_display /* 0F9D50 7F0C51E0 0010C403 */ sra $t8, $s0, 0x10 /* 0F9D54 7F0C51E4 0C00110B */ jal viGetY /* 0F9D58 7F0C51E8 03008025 */ move $s0, $t8 -/* 0F9D5C 7F0C51EC 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) # $t9, 0x8004 -/* 0F9D60 7F0C51F0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F9D64 7F0C51F4 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F9D68 7F0C51F8 8F390EE0 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F9D5C 7F0C51EC 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) # $t9, 0x8004 +/* 0F9D60 7F0C51F0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F9D64 7F0C51F4 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F9D68 7F0C51F8 8F390EE0 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F9D6C 7F0C51FC 3C0EA0FF */ lui $t6, (0xA0FFA0F0 >> 16) # lui $t6, 0xa0ff /* 0F9D70 7F0C5200 3C0C0070 */ lui $t4, (0x007000A0 >> 16) # lui $t4, 0x70 /* 0F9D74 7F0C5204 358C00A0 */ ori $t4, (0x007000A0 & 0xFFFF) # ori $t4, $t4, 0xa0 @@ -3899,7 +3900,7 @@ glabel mp_watch_menu_display /* 0F9DA0 7F0C5230 AFA00028 */ sw $zero, 0x28($sp) /* 0F9DA4 7F0C5234 AFA0002C */ sw $zero, 0x2c($sp) /* 0F9DA8 7F0C5238 AFAB0014 */ sw $t3, 0x14($sp) -/* 0F9DAC 7F0C523C 0FC2BCA7 */ jal jp_text_write_stuff +/* 0F9DAC 7F0C523C 0FC2BCA7 */ jal textRenderGlow /* 0F9DB0 7F0C5240 AFB90010 */ sw $t9, 0x10($sp) /* 0F9DB4 7F0C5244 00408825 */ move $s1, $v0 .Ljp7F0C5248: @@ -3945,15 +3946,15 @@ glabel mp_watch_menu_display /* 0F9E44 7F0C52D4 27A400AC */ addiu $a0, $sp, 0xac /* 0F9E48 7F0C52D8 0FC31251 */ jal write_playerrank_to_buffer /* 0F9E4C 7F0C52DC 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F9E50 7F0C52E0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F9E54 7F0C52E4 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F9E58 7F0C52E8 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F9E5C 7F0C52EC 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F9E50 7F0C52E0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F9E54 7F0C52E4 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F9E58 7F0C52E8 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F9E5C 7F0C52EC 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9E60 7F0C52F0 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9E64 7F0C52F4 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9E68 7F0C52F8 27A600AC */ addiu $a2, $sp, 0xac /* 0F9E6C 7F0C52FC AFA00014 */ sw $zero, 0x14($sp) -/* 0F9E70 7F0C5300 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0F9E70 7F0C5300 0FC2BD4F */ jal textMeasure /* 0F9E74 7F0C5304 AFAB0010 */ sw $t3, 0x10($sp) /* 0F9E78 7F0C5308 0C001145 */ jal viGetViewLeft /* 0F9E7C 7F0C530C 00000000 */ nop @@ -3975,10 +3976,10 @@ glabel mp_watch_menu_display /* 0F9EBC 7F0C534C 00106C03 */ sra $t5, $s0, 0x10 /* 0F9EC0 7F0C5350 0C00110B */ jal viGetY /* 0F9EC4 7F0C5354 01A08025 */ move $s0, $t5 -/* 0F9EC8 7F0C5358 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F9ECC 7F0C535C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F9ED0 7F0C5360 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F9ED4 7F0C5364 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F9EC8 7F0C5358 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F9ECC 7F0C535C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F9ED0 7F0C5360 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F9ED4 7F0C5364 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F9ED8 7F0C5368 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff /* 0F9EDC 7F0C536C 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 /* 0F9EE0 7F0C5370 AFB80018 */ sw $t8, 0x18($sp) @@ -3991,7 +3992,7 @@ glabel mp_watch_menu_display /* 0F9EFC 7F0C538C AFA00024 */ sw $zero, 0x24($sp) /* 0F9F00 7F0C5390 AFA00028 */ sw $zero, 0x28($sp) /* 0F9F04 7F0C5394 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F9F08 7F0C5398 0FC2B99B */ jal en_text_write_stuff +/* 0F9F08 7F0C5398 0FC2B99B */ jal textRender /* 0F9F0C 7F0C539C AFAC0010 */ sw $t4, 0x10($sp) /* 0F9F10 7F0C53A0 00408825 */ move $s1, $v0 .Ljp7F0C53A4: @@ -4014,16 +4015,16 @@ glabel mp_watch_menu_display /* 0F9F50 7F0C53E0 AFA20080 */ sw $v0, 0x80($sp) /* 0F9F54 7F0C53E4 0FC30AA2 */ jal langGet /* 0F9F58 7F0C53E8 3404A01B */ li $a0, 40987 -/* 0F9F5C 7F0C53EC 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0F9F60 7F0C53F0 8DCE0EDC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0F9F64 7F0C53F4 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F9F5C 7F0C53EC 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0F9F60 7F0C53F0 8DCE0EDC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0F9F64 7F0C53F4 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F9F68 7F0C53F8 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F9F6C 7F0C53FC 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F9F6C 7F0C53FC 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F9F70 7F0C5400 27A400BC */ addiu $a0, $sp, 0xbc /* 0F9F74 7F0C5404 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F9F78 7F0C5408 00403025 */ move $a2, $v0 /* 0F9F7C 7F0C540C AFA00014 */ sw $zero, 0x14($sp) -/* 0F9F80 7F0C5410 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0F9F80 7F0C5410 0FC2BD4F */ jal textMeasure /* 0F9F84 7F0C5414 AFAE0010 */ sw $t6, 0x10($sp) /* 0F9F88 7F0C5418 0C001145 */ jal viGetViewLeft /* 0F9F8C 7F0C541C 00000000 */ nop @@ -4045,10 +4046,10 @@ glabel mp_watch_menu_display /* 0F9FCC 7F0C545C 00107C03 */ sra $t7, $s0, 0x10 /* 0F9FD0 7F0C5460 0C00110B */ jal viGetY /* 0F9FD4 7F0C5464 01E08025 */ move $s0, $t7 -/* 0F9FD8 7F0C5468 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F9FDC 7F0C546C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F9FE0 7F0C5470 8F180EDC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F9FE4 7F0C5474 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F9FD8 7F0C5468 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F9FDC 7F0C546C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F9FE0 7F0C5470 8F180EDC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F9FE4 7F0C5474 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F9FE8 7F0C5478 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0F9FEC 7F0C547C 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0F9FF0 7F0C5480 AFB90018 */ sw $t9, 0x18($sp) @@ -4061,7 +4062,7 @@ glabel mp_watch_menu_display /* 0FA00C 7F0C549C AFA00024 */ sw $zero, 0x24($sp) /* 0FA010 7F0C54A0 AFA00028 */ sw $zero, 0x28($sp) /* 0FA014 7F0C54A4 AFB80014 */ sw $t8, 0x14($sp) -/* 0FA018 7F0C54A8 0FC2B99B */ jal en_text_write_stuff +/* 0FA018 7F0C54A8 0FC2B99B */ jal textRender /* 0FA01C 7F0C54AC AFAC0010 */ sw $t4, 0x10($sp) /* 0FA020 7F0C54B0 8FA30080 */ lw $v1, 0x80($sp) /* 0FA024 7F0C54B4 24010005 */ li $at, 5 @@ -4385,15 +4386,15 @@ glabel mp_watch_menu_display /* 0FA4B4 7F0C5944 27A400AC */ addiu $a0, $sp, 0xac /* 0FA4B8 7F0C5948 0FC31251 */ jal write_playerrank_to_buffer /* 0FA4BC 7F0C594C 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0FA4C0 7F0C5950 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0FA4C4 7F0C5954 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0FA4C8 7F0C5958 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0FA4CC 7F0C595C 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA4C0 7F0C5950 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0FA4C4 7F0C5954 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0FA4C8 7F0C5958 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0FA4CC 7F0C595C 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA4D0 7F0C5960 27A400BC */ addiu $a0, $sp, 0xbc /* 0FA4D4 7F0C5964 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FA4D8 7F0C5968 27A600AC */ addiu $a2, $sp, 0xac /* 0FA4DC 7F0C596C AFA00014 */ sw $zero, 0x14($sp) -/* 0FA4E0 7F0C5970 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FA4E0 7F0C5970 0FC2BD4F */ jal textMeasure /* 0FA4E4 7F0C5974 AFAF0010 */ sw $t7, 0x10($sp) /* 0FA4E8 7F0C5978 0C001145 */ jal viGetViewLeft /* 0FA4EC 7F0C597C 00000000 */ nop @@ -4415,10 +4416,10 @@ glabel mp_watch_menu_display /* 0FA52C 7F0C59BC 0010C403 */ sra $t8, $s0, 0x10 /* 0FA530 7F0C59C0 0C00110B */ jal viGetY /* 0FA534 7F0C59C4 03008025 */ move $s0, $t8 -/* 0FA538 7F0C59C8 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0FA53C 7F0C59CC 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0FA540 7F0C59D0 8F390EDC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0FA544 7F0C59D4 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0FA538 7F0C59C8 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0FA53C 7F0C59CC 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0FA540 7F0C59D0 8F390EDC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0FA544 7F0C59D4 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0FA548 7F0C59D8 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff /* 0FA54C 7F0C59DC 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 /* 0FA550 7F0C59E0 AFAB0018 */ sw $t3, 0x18($sp) @@ -4431,7 +4432,7 @@ glabel mp_watch_menu_display /* 0FA56C 7F0C59FC AFA00024 */ sw $zero, 0x24($sp) /* 0FA570 7F0C5A00 AFA00028 */ sw $zero, 0x28($sp) /* 0FA574 7F0C5A04 AFB90014 */ sw $t9, 0x14($sp) -/* 0FA578 7F0C5A08 0FC2B99B */ jal en_text_write_stuff +/* 0FA578 7F0C5A08 0FC2B99B */ jal textRender /* 0FA57C 7F0C5A0C AFAC0010 */ sw $t4, 0x10($sp) /* 0FA580 7F0C5A10 00408825 */ move $s1, $v0 .Ljp7F0C5A14: @@ -4448,15 +4449,15 @@ glabel mp_watch_menu_display /* 0FA5AC 7F0C5A3C AFA20010 */ sw $v0, 0x10($sp) /* 0FA5B0 7F0C5A40 0C002B29 */ jal sprintf /* 0FA5B4 7F0C5A44 24E70001 */ addiu $a3, $a3, 1 -/* 0FA5B8 7F0C5A48 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FA5BC 7F0C5A4C 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FA5C0 7F0C5A50 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0FA5C4 7F0C5A54 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA5B8 7F0C5A48 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FA5BC 7F0C5A4C 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FA5C0 7F0C5A50 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0FA5C4 7F0C5A54 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA5C8 7F0C5A58 27A400BC */ addiu $a0, $sp, 0xbc /* 0FA5CC 7F0C5A5C 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FA5D0 7F0C5A60 27A600AC */ addiu $a2, $sp, 0xac /* 0FA5D4 7F0C5A64 AFA00014 */ sw $zero, 0x14($sp) -/* 0FA5D8 7F0C5A68 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FA5D8 7F0C5A68 0FC2BD4F */ jal textMeasure /* 0FA5DC 7F0C5A6C AFAD0010 */ sw $t5, 0x10($sp) /* 0FA5E0 7F0C5A70 0C001145 */ jal viGetViewLeft /* 0FA5E4 7F0C5A74 00000000 */ nop @@ -4478,10 +4479,10 @@ glabel mp_watch_menu_display /* 0FA624 7F0C5AB4 0010C403 */ sra $t8, $s0, 0x10 /* 0FA628 7F0C5AB8 0C00110B */ jal viGetY /* 0FA62C 7F0C5ABC 03008025 */ move $s0, $t8 -/* 0FA630 7F0C5AC0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0FA634 7F0C5AC4 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0FA638 7F0C5AC8 8D8C0EDC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA63C 7F0C5ACC 8DCE0EE0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0FA630 7F0C5AC0 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0FA634 7F0C5AC4 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0FA638 7F0C5AC8 8D8C0EDC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA63C 7F0C5ACC 8DCE0EE0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0FA640 7F0C5AD0 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0FA644 7F0C5AD4 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0FA648 7F0C5AD8 AFB90018 */ sw $t9, 0x18($sp) @@ -4494,7 +4495,7 @@ glabel mp_watch_menu_display /* 0FA664 7F0C5AF4 AFA00024 */ sw $zero, 0x24($sp) /* 0FA668 7F0C5AF8 AFA00028 */ sw $zero, 0x28($sp) /* 0FA66C 7F0C5AFC AFAC0014 */ sw $t4, 0x14($sp) -/* 0FA670 7F0C5B00 0FC2B99B */ jal en_text_write_stuff +/* 0FA670 7F0C5B00 0FC2B99B */ jal textRender /* 0FA674 7F0C5B04 AFAE0010 */ sw $t6, 0x10($sp) /* 0FA678 7F0C5B08 8FAB00D0 */ lw $t3, 0xd0($sp) /* 0FA67C 7F0C5B0C 00408825 */ move $s1, $v0 @@ -4680,15 +4681,15 @@ glabel mp_watch_menu_display /* 0FA92C 7F0C5DBC 27A400AC */ addiu $a0, $sp, 0xac /* 0FA930 7F0C5DC0 0FC31251 */ jal write_playerrank_to_buffer /* 0FA934 7F0C5DC4 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0FA938 7F0C5DC8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FA93C 7F0C5DCC 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FA940 7F0C5DD0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0FA944 7F0C5DD4 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FA938 7F0C5DC8 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FA93C 7F0C5DCC 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FA940 7F0C5DD0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0FA944 7F0C5DD4 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FA948 7F0C5DD8 27A400BC */ addiu $a0, $sp, 0xbc /* 0FA94C 7F0C5DDC 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FA950 7F0C5DE0 27A600AC */ addiu $a2, $sp, 0xac /* 0FA954 7F0C5DE4 AFA00014 */ sw $zero, 0x14($sp) -/* 0FA958 7F0C5DE8 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FA958 7F0C5DE8 0FC2BD4F */ jal textMeasure /* 0FA95C 7F0C5DEC AFAD0010 */ sw $t5, 0x10($sp) /* 0FA960 7F0C5DF0 0C001145 */ jal viGetViewLeft /* 0FA964 7F0C5DF4 00000000 */ nop @@ -4710,10 +4711,10 @@ glabel mp_watch_menu_display /* 0FA9A4 7F0C5E34 00107403 */ sra $t6, $s0, 0x10 /* 0FA9A8 7F0C5E38 0C00110B */ jal viGetY /* 0FA9AC 7F0C5E3C 01C08025 */ move $s0, $t6 -/* 0FA9B0 7F0C5E40 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0FA9B4 7F0C5E44 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0FA9B8 7F0C5E48 8D8C0EDC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FA9BC 7F0C5E4C 8F180EE0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0FA9B0 7F0C5E40 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0FA9B4 7F0C5E44 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0FA9B8 7F0C5E48 8D8C0EDC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FA9BC 7F0C5E4C 8F180EE0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0FA9C0 7F0C5E50 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0FA9C4 7F0C5E54 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0FA9C8 7F0C5E58 AFB90018 */ sw $t9, 0x18($sp) @@ -4726,7 +4727,7 @@ glabel mp_watch_menu_display /* 0FA9E4 7F0C5E74 AFA00024 */ sw $zero, 0x24($sp) /* 0FA9E8 7F0C5E78 AFA00028 */ sw $zero, 0x28($sp) /* 0FA9EC 7F0C5E7C AFAC0014 */ sw $t4, 0x14($sp) -/* 0FA9F0 7F0C5E80 0FC2B99B */ jal en_text_write_stuff +/* 0FA9F0 7F0C5E80 0FC2B99B */ jal textRender /* 0FA9F4 7F0C5E84 AFB80010 */ sw $t8, 0x10($sp) /* 0FA9F8 7F0C5E88 00408825 */ move $s1, $v0 .Ljp7F0C5E8C: @@ -4743,15 +4744,15 @@ glabel mp_watch_menu_display /* 0FAA24 7F0C5EB4 AFA20010 */ sw $v0, 0x10($sp) /* 0FAA28 7F0C5EB8 0C002B29 */ jal sprintf /* 0FAA2C 7F0C5EBC 24E70001 */ addiu $a3, $a3, 1 -/* 0FAA30 7F0C5EC0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0FAA34 7F0C5EC4 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0FAA38 7F0C5EC8 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0FAA3C 7F0C5ECC 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FAA30 7F0C5EC0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0FAA34 7F0C5EC4 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0FAA38 7F0C5EC8 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0FAA3C 7F0C5ECC 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FAA40 7F0C5ED0 27A400BC */ addiu $a0, $sp, 0xbc /* 0FAA44 7F0C5ED4 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FAA48 7F0C5ED8 27A600AC */ addiu $a2, $sp, 0xac /* 0FAA4C 7F0C5EDC AFA00014 */ sw $zero, 0x14($sp) -/* 0FAA50 7F0C5EE0 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FAA50 7F0C5EE0 0FC2BD4F */ jal textMeasure /* 0FAA54 7F0C5EE4 AFAB0010 */ sw $t3, 0x10($sp) /* 0FAA58 7F0C5EE8 0C001145 */ jal viGetViewLeft /* 0FAA5C 7F0C5EEC 00000000 */ nop @@ -4773,10 +4774,10 @@ glabel mp_watch_menu_display /* 0FAA9C 7F0C5F2C 00107403 */ sra $t6, $s0, 0x10 /* 0FAAA0 7F0C5F30 0C00110B */ jal viGetY /* 0FAAA4 7F0C5F34 01C08025 */ move $s0, $t6 -/* 0FAAA8 7F0C5F38 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0FAAAC 7F0C5F3C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0FAAB0 7F0C5F40 8F180EDC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FAAB4 7F0C5F44 8DEF0EE0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FAAA8 7F0C5F38 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0FAAAC 7F0C5F3C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0FAAB0 7F0C5F40 8F180EDC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FAAB4 7F0C5F44 8DEF0EE0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FAAB8 7F0C5F48 3C0CFF40 */ lui $t4, (0xFF4040B0 >> 16) # lui $t4, 0xff40 /* 0FAABC 7F0C5F4C 358C40B0 */ ori $t4, (0xFF4040B0 & 0xFFFF) # ori $t4, $t4, 0x40b0 /* 0FAAC0 7F0C5F50 AFAC0018 */ sw $t4, 0x18($sp) @@ -4789,7 +4790,7 @@ glabel mp_watch_menu_display /* 0FAADC 7F0C5F6C AFA00024 */ sw $zero, 0x24($sp) /* 0FAAE0 7F0C5F70 AFA00028 */ sw $zero, 0x28($sp) /* 0FAAE4 7F0C5F74 AFB80014 */ sw $t8, 0x14($sp) -/* 0FAAE8 7F0C5F78 0FC2B99B */ jal en_text_write_stuff +/* 0FAAE8 7F0C5F78 0FC2B99B */ jal textRender /* 0FAAEC 7F0C5F7C AFAF0010 */ sw $t7, 0x10($sp) /* 0FAAF0 7F0C5F80 8FB900D0 */ lw $t9, 0xd0($sp) /* 0FAAF4 7F0C5F84 24010002 */ li $at, 2 @@ -5126,16 +5127,16 @@ glabel mp_watch_menu_display .Ljp7F0C6470: /* 0FAFE0 7F0C6470 0FC30AA2 */ jal langGet /* 0FAFE4 7F0C6474 3404A01F */ li $a0, 40991 -/* 0FAFE8 7F0C6478 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FAFEC 7F0C647C 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FAFF0 7F0C6480 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FAFE8 7F0C6478 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FAFEC 7F0C647C 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FAFF0 7F0C6480 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FAFF4 7F0C6484 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FAFF8 7F0C6488 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FAFF8 7F0C6488 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FAFFC 7F0C648C 27A4007C */ addiu $a0, $sp, 0x7c /* 0FB000 7F0C6490 27A50078 */ addiu $a1, $sp, 0x78 /* 0FB004 7F0C6494 00403025 */ move $a2, $v0 /* 0FB008 7F0C6498 AFA00014 */ sw $zero, 0x14($sp) -/* 0FB00C 7F0C649C 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB00C 7F0C649C 0FC2BD4F */ jal textMeasure /* 0FB010 7F0C64A0 AFAD0010 */ sw $t5, 0x10($sp) /* 0FB014 7F0C64A4 0C001145 */ jal viGetViewLeft /* 0FB018 7F0C64A8 00000000 */ nop @@ -5157,10 +5158,10 @@ glabel mp_watch_menu_display /* 0FB058 7F0C64E8 00105C03 */ sra $t3, $s0, 0x10 /* 0FB05C 7F0C64EC 0C00110B */ jal viGetY /* 0FB060 7F0C64F0 01608025 */ move $s0, $t3 -/* 0FB064 7F0C64F4 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0FB068 7F0C64F8 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0FB06C 7F0C64FC 8F180EDC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FB070 7F0C6500 8DEF0EE0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FB064 7F0C64F4 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0FB068 7F0C64F8 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0FB06C 7F0C64FC 8F180EDC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FB070 7F0C6500 8DEF0EE0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FB074 7F0C6504 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0FB078 7F0C6508 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0FB07C 7F0C650C AFAC0018 */ sw $t4, 0x18($sp) @@ -5173,22 +5174,22 @@ glabel mp_watch_menu_display /* 0FB098 7F0C6528 AFA00024 */ sw $zero, 0x24($sp) /* 0FB09C 7F0C652C AFA00028 */ sw $zero, 0x28($sp) /* 0FB0A0 7F0C6530 AFB80014 */ sw $t8, 0x14($sp) -/* 0FB0A4 7F0C6534 0FC2B99B */ jal en_text_write_stuff +/* 0FB0A4 7F0C6534 0FC2B99B */ jal textRender /* 0FB0A8 7F0C6538 AFAF0010 */ sw $t7, 0x10($sp) /* 0FB0AC 7F0C653C 00408825 */ move $s1, $v0 /* 0FB0B0 7F0C6540 8FA400D4 */ lw $a0, 0xd4($sp) /* 0FB0B4 7F0C6544 0FC026DC */ jal getplayerfavoredweapon /* 0FB0B8 7F0C6548 00002825 */ move $a1, $zero -/* 0FB0BC 7F0C654C 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0FB0C0 7F0C6550 8F390EDC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0FB0C4 7F0C6554 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FB0BC 7F0C654C 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0FB0C0 7F0C6550 8F390EDC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0FB0C4 7F0C6554 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FB0C8 7F0C6558 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FB0CC 7F0C655C 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB0CC 7F0C655C 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB0D0 7F0C6560 27A4007C */ addiu $a0, $sp, 0x7c /* 0FB0D4 7F0C6564 27A50078 */ addiu $a1, $sp, 0x78 /* 0FB0D8 7F0C6568 00403025 */ move $a2, $v0 /* 0FB0DC 7F0C656C AFA00014 */ sw $zero, 0x14($sp) -/* 0FB0E0 7F0C6570 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB0E0 7F0C6570 0FC2BD4F */ jal textMeasure /* 0FB0E4 7F0C6574 AFB90010 */ sw $t9, 0x10($sp) /* 0FB0E8 7F0C6578 0C001145 */ jal viGetViewLeft /* 0FB0EC 7F0C657C 00000000 */ nop @@ -5222,10 +5223,10 @@ glabel mp_watch_menu_display /* 0FB154 7F0C65E4 0010C403 */ sra $t8, $s0, 0x10 /* 0FB158 7F0C65E8 0C00110B */ jal viGetY /* 0FB15C 7F0C65EC 03008025 */ move $s0, $t8 -/* 0FB160 7F0C65F0 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0FB164 7F0C65F4 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FB168 7F0C65F8 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FB16C 7F0C65FC 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0FB160 7F0C65F0 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0FB164 7F0C65F4 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FB168 7F0C65F8 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FB16C 7F0C65FC 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0FB170 7F0C6600 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0FB174 7F0C6604 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0FB178 7F0C6608 AFB90018 */ sw $t9, 0x18($sp) @@ -5238,7 +5239,7 @@ glabel mp_watch_menu_display /* 0FB194 7F0C6624 AFA00024 */ sw $zero, 0x24($sp) /* 0FB198 7F0C6628 AFA00028 */ sw $zero, 0x28($sp) /* 0FB19C 7F0C662C AFAD0014 */ sw $t5, 0x14($sp) -/* 0FB1A0 7F0C6630 0FC2B99B */ jal en_text_write_stuff +/* 0FB1A0 7F0C6630 0FC2B99B */ jal textRender /* 0FB1A4 7F0C6634 AFAC0010 */ sw $t4, 0x10($sp) /* 0FB1A8 7F0C6638 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 /* 0FB1AC 7F0C663C 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -5246,15 +5247,15 @@ glabel mp_watch_menu_display /* 0FB1B4 7F0C6644 27A4007C */ addiu $a0, $sp, 0x7c /* 0FB1B8 7F0C6648 8C682A10 */ lw $t0, 0x2a10($v1) /* 0FB1BC 7F0C664C 27A50078 */ addiu $a1, $sp, 0x78 -/* 0FB1C0 7F0C6650 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FB1C0 7F0C6650 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FB1C4 7F0C6654 11000031 */ beqz $t0, .Ljp7F0C671C /* 0FB1C8 7F0C6658 01003025 */ move $a2, $t0 -/* 0FB1CC 7F0C665C 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0FB1D0 7F0C6660 8D6B0EDC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0FB1D4 7F0C6664 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB1CC 7F0C665C 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0FB1D0 7F0C6660 8D6B0EDC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0FB1D4 7F0C6664 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB1D8 7F0C6668 AFA00014 */ sw $zero, 0x14($sp) /* 0FB1DC 7F0C666C AFA800A4 */ sw $t0, 0xa4($sp) -/* 0FB1E0 7F0C6670 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB1E0 7F0C6670 0FC2BD4F */ jal textMeasure /* 0FB1E4 7F0C6674 AFAB0010 */ sw $t3, 0x10($sp) /* 0FB1E8 7F0C6678 0C001145 */ jal viGetViewLeft /* 0FB1EC 7F0C667C 00000000 */ nop @@ -5276,10 +5277,10 @@ glabel mp_watch_menu_display /* 0FB22C 7F0C66BC 0010C403 */ sra $t8, $s0, 0x10 /* 0FB230 7F0C66C0 0C00110B */ jal viGetY /* 0FB234 7F0C66C4 03008025 */ move $s0, $t8 -/* 0FB238 7F0C66C8 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0FB23C 7F0C66CC 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0FB240 7F0C66D0 8D8C0EDC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FB244 7F0C66D4 8DEF0EE0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FB238 7F0C66C8 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0FB23C 7F0C66CC 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0FB240 7F0C66D0 8D8C0EDC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FB244 7F0C66D4 8DEF0EE0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FB248 7F0C66D8 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0FB24C 7F0C66DC 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0FB250 7F0C66E0 AFAD0018 */ sw $t5, 0x18($sp) @@ -5292,7 +5293,7 @@ glabel mp_watch_menu_display /* 0FB26C 7F0C66FC AFA00024 */ sw $zero, 0x24($sp) /* 0FB270 7F0C6700 AFA00028 */ sw $zero, 0x28($sp) /* 0FB274 7F0C6704 AFAC0014 */ sw $t4, 0x14($sp) -/* 0FB278 7F0C6708 0FC2B99B */ jal en_text_write_stuff +/* 0FB278 7F0C6708 0FC2B99B */ jal textRender /* 0FB27C 7F0C670C AFAF0010 */ sw $t7, 0x10($sp) /* 0FB280 7F0C6710 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 /* 0FB284 7F0C6714 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -5303,13 +5304,13 @@ glabel mp_watch_menu_display /* 0FB294 7F0C6724 27A50078 */ addiu $a1, $sp, 0x78 /* 0FB298 7F0C6728 10400032 */ beqz $v0, .Ljp7F0C67F4 /* 0FB29C 7F0C672C 00403025 */ move $a2, $v0 -/* 0FB2A0 7F0C6730 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0FB2A4 7F0C6734 8F390EDC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0FB2A8 7F0C6738 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0FB2AC 7F0C673C 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB2A0 7F0C6730 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0FB2A4 7F0C6734 8F390EDC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0FB2A8 7F0C6738 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0FB2AC 7F0C673C 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB2B0 7F0C6740 AFA00014 */ sw $zero, 0x14($sp) /* 0FB2B4 7F0C6744 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FB2B8 7F0C6748 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB2B8 7F0C6748 0FC2BD4F */ jal textMeasure /* 0FB2BC 7F0C674C AFB90010 */ sw $t9, 0x10($sp) /* 0FB2C0 7F0C6750 0C001145 */ jal viGetViewLeft /* 0FB2C4 7F0C6754 00000000 */ nop @@ -5331,10 +5332,10 @@ glabel mp_watch_menu_display /* 0FB304 7F0C6794 0010C403 */ sra $t8, $s0, 0x10 /* 0FB308 7F0C6798 0C00110B */ jal viGetY /* 0FB30C 7F0C679C 03008025 */ move $s0, $t8 -/* 0FB310 7F0C67A0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0FB314 7F0C67A4 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0FB318 7F0C67A8 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0FB31C 7F0C67AC 8DCE0EE0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0FB310 7F0C67A0 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0FB314 7F0C67A4 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0FB318 7F0C67A8 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0FB31C 7F0C67AC 8DCE0EE0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0FB320 7F0C67B0 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0FB324 7F0C67B4 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0FB328 7F0C67B8 AFAC0018 */ sw $t4, 0x18($sp) @@ -5347,7 +5348,7 @@ glabel mp_watch_menu_display /* 0FB344 7F0C67D4 AFA00024 */ sw $zero, 0x24($sp) /* 0FB348 7F0C67D8 AFA00028 */ sw $zero, 0x28($sp) /* 0FB34C 7F0C67DC AFAF0014 */ sw $t7, 0x14($sp) -/* 0FB350 7F0C67E0 0FC2B99B */ jal en_text_write_stuff +/* 0FB350 7F0C67E0 0FC2B99B */ jal textRender /* 0FB354 7F0C67E4 AFAE0010 */ sw $t6, 0x10($sp) /* 0FB358 7F0C67E8 3C038008 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8008 /* 0FB35C 7F0C67EC 8C63A120 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -5360,16 +5361,16 @@ glabel mp_watch_menu_display /* 0FB370 7F0C6800 00000000 */ nop /* 0FB374 7F0C6804 0FC30AA2 */ jal langGet /* 0FB378 7F0C6808 3404A020 */ li $a0, 40992 -/* 0FB37C 7F0C680C 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0FB380 7F0C6810 8F390EDC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0FB384 7F0C6814 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FB37C 7F0C680C 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0FB380 7F0C6810 8F390EDC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0FB384 7F0C6814 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FB388 7F0C6818 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FB38C 7F0C681C 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB38C 7F0C681C 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB390 7F0C6820 27A400BC */ addiu $a0, $sp, 0xbc /* 0FB394 7F0C6824 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FB398 7F0C6828 00403025 */ move $a2, $v0 /* 0FB39C 7F0C682C AFA00014 */ sw $zero, 0x14($sp) -/* 0FB3A0 7F0C6830 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB3A0 7F0C6830 0FC2BD4F */ jal textMeasure /* 0FB3A4 7F0C6834 AFB90010 */ sw $t9, 0x10($sp) /* 0FB3A8 7F0C6838 0C001145 */ jal viGetViewLeft /* 0FB3AC 7F0C683C 00000000 */ nop @@ -5397,10 +5398,10 @@ glabel mp_watch_menu_display /* 0FB404 7F0C6894 00107C03 */ sra $t7, $s0, 0x10 /* 0FB408 7F0C6898 0C00110B */ jal viGetY /* 0FB40C 7F0C689C 01E08025 */ move $s0, $t7 -/* 0FB410 7F0C68A0 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0FB414 7F0C68A4 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FB418 7F0C68A8 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FB41C 7F0C68AC 8D8C0EE0 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0FB410 7F0C68A0 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0FB414 7F0C68A4 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FB418 7F0C68A8 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FB41C 7F0C68AC 8D8C0EE0 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0FB420 7F0C68B0 3C19A0FF */ lui $t9, (0xA0FFA0F0 >> 16) # lui $t9, 0xa0ff /* 0FB424 7F0C68B4 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 /* 0FB428 7F0C68B8 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 @@ -5416,7 +5417,7 @@ glabel mp_watch_menu_display /* 0FB450 7F0C68E0 AFA00028 */ sw $zero, 0x28($sp) /* 0FB454 7F0C68E4 AFA0002C */ sw $zero, 0x2c($sp) /* 0FB458 7F0C68E8 AFAD0014 */ sw $t5, 0x14($sp) -/* 0FB45C 7F0C68EC 0FC2BCA7 */ jal jp_text_write_stuff +/* 0FB45C 7F0C68EC 0FC2BCA7 */ jal textRenderGlow /* 0FB460 7F0C68F0 AFAC0010 */ sw $t4, 0x10($sp) /* 0FB464 7F0C68F4 1000001A */ b .Ljp7F0C6960 /* 0FB468 7F0C68F8 00408825 */ move $s1, $v0 @@ -5427,10 +5428,10 @@ glabel mp_watch_menu_display /* 0FB478 7F0C6908 00107403 */ sra $t6, $s0, 0x10 /* 0FB47C 7F0C690C 0C00110B */ jal viGetY /* 0FB480 7F0C6910 01C08025 */ move $s0, $t6 -/* 0FB484 7F0C6914 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0FB488 7F0C6918 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0FB48C 7F0C691C 8DEF0EDC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0FB490 7F0C6920 8F180EE0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0FB484 7F0C6914 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0FB488 7F0C6918 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0FB48C 7F0C691C 8DEF0EDC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0FB490 7F0C6920 8F180EE0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0FB494 7F0C6924 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0FB498 7F0C6928 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0FB49C 7F0C692C AFAC0018 */ sw $t4, 0x18($sp) @@ -5443,22 +5444,22 @@ glabel mp_watch_menu_display /* 0FB4B8 7F0C6948 AFA00024 */ sw $zero, 0x24($sp) /* 0FB4BC 7F0C694C AFA00028 */ sw $zero, 0x28($sp) /* 0FB4C0 7F0C6950 AFAF0014 */ sw $t7, 0x14($sp) -/* 0FB4C4 7F0C6954 0FC2B99B */ jal en_text_write_stuff +/* 0FB4C4 7F0C6954 0FC2B99B */ jal textRender /* 0FB4C8 7F0C6958 AFB80010 */ sw $t8, 0x10($sp) /* 0FB4CC 7F0C695C 00408825 */ move $s1, $v0 .Ljp7F0C6960: /* 0FB4D0 7F0C6960 0FC30AA2 */ jal langGet /* 0FB4D4 7F0C6964 3404A021 */ li $a0, 40993 -/* 0FB4D8 7F0C6968 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0FB4DC 7F0C696C 8DAD0EDC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0FB4E0 7F0C6970 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FB4D8 7F0C6968 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0FB4DC 7F0C696C 8DAD0EDC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0FB4E0 7F0C6970 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FB4E4 7F0C6974 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0FB4E8 7F0C6978 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB4E8 7F0C6978 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB4EC 7F0C697C 27A400BC */ addiu $a0, $sp, 0xbc /* 0FB4F0 7F0C6980 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0FB4F4 7F0C6984 00403025 */ move $a2, $v0 /* 0FB4F8 7F0C6988 AFA00014 */ sw $zero, 0x14($sp) -/* 0FB4FC 7F0C698C 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB4FC 7F0C698C 0FC2BD4F */ jal textMeasure /* 0FB500 7F0C6990 AFAD0010 */ sw $t5, 0x10($sp) /* 0FB504 7F0C6994 0C001145 */ jal viGetViewLeft /* 0FB508 7F0C6998 00000000 */ nop @@ -5487,10 +5488,10 @@ glabel mp_watch_menu_display /* 0FB564 7F0C69F4 0010C403 */ sra $t8, $s0, 0x10 /* 0FB568 7F0C69F8 0C00110B */ jal viGetY /* 0FB56C 7F0C69FC 03008025 */ move $s0, $t8 -/* 0FB570 7F0C6A00 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0FB574 7F0C6A04 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0FB578 7F0C6A08 8D8C0EDC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FB57C 7F0C6A0C 8DEF0EE0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0FB570 7F0C6A00 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0FB574 7F0C6A04 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0FB578 7F0C6A08 8D8C0EDC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FB57C 7F0C6A0C 8DEF0EE0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0FB580 7F0C6A10 3C0DA0FF */ lui $t5, (0xA0FFA0F0 >> 16) # lui $t5, 0xa0ff /* 0FB584 7F0C6A14 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0FB588 7F0C6A18 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -5506,7 +5507,7 @@ glabel mp_watch_menu_display /* 0FB5B0 7F0C6A40 AFA00028 */ sw $zero, 0x28($sp) /* 0FB5B4 7F0C6A44 AFA0002C */ sw $zero, 0x2c($sp) /* 0FB5B8 7F0C6A48 AFAC0014 */ sw $t4, 0x14($sp) -/* 0FB5BC 7F0C6A4C 0FC2BCA7 */ jal jp_text_write_stuff +/* 0FB5BC 7F0C6A4C 0FC2BCA7 */ jal textRenderGlow /* 0FB5C0 7F0C6A50 AFAF0010 */ sw $t7, 0x10($sp) /* 0FB5C4 7F0C6A54 1000001A */ b .Ljp7F0C6AC0 /* 0FB5C8 7F0C6A58 00408825 */ move $s1, $v0 @@ -5517,10 +5518,10 @@ glabel mp_watch_menu_display /* 0FB5D8 7F0C6A68 00107403 */ sra $t6, $s0, 0x10 /* 0FB5DC 7F0C6A6C 0C00110B */ jal viGetY /* 0FB5E0 7F0C6A70 01C08025 */ move $s0, $t6 -/* 0FB5E4 7F0C6A74 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableSmall) # $t3, 0x8004 -/* 0FB5E8 7F0C6A78 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0FB5EC 7F0C6A7C 8F180EDC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FB5F0 7F0C6A80 8D6B0EE0 */ lw $t3, %lo(ptrSecondFontTableSmall)($t3) +/* 0FB5E4 7F0C6A74 3C0B8004 */ lui $t3, %hi(ptrFontBankGothicChars) # $t3, 0x8004 +/* 0FB5E8 7F0C6A78 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0FB5EC 7F0C6A7C 8F180EDC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FB5F0 7F0C6A80 8D6B0EE0 */ lw $t3, %lo(ptrFontBankGothicChars)($t3) /* 0FB5F4 7F0C6A84 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0FB5F8 7F0C6A88 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0FB5FC 7F0C6A8C AFAF0018 */ sw $t7, 0x18($sp) @@ -5533,7 +5534,7 @@ glabel mp_watch_menu_display /* 0FB618 7F0C6AA8 AFA00024 */ sw $zero, 0x24($sp) /* 0FB61C 7F0C6AAC AFA00028 */ sw $zero, 0x28($sp) /* 0FB620 7F0C6AB0 AFB80014 */ sw $t8, 0x14($sp) -/* 0FB624 7F0C6AB4 0FC2B99B */ jal en_text_write_stuff +/* 0FB624 7F0C6AB4 0FC2B99B */ jal textRender /* 0FB628 7F0C6AB8 AFAB0010 */ sw $t3, 0x10($sp) /* 0FB62C 7F0C6ABC 00408825 */ move $s1, $v0 .Ljp7F0C6AC0: @@ -5621,16 +5622,16 @@ glabel mp_watch_menu_display /* 0FB75C 7F0C6BEC 00408825 */ move $s1, $v0 /* 0FB760 7F0C6BF0 0FC30AA2 */ jal langGet /* 0FB764 7F0C6BF4 3404A022 */ li $a0, 40994 -/* 0FB768 7F0C6BF8 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0FB76C 7F0C6BFC 8F180EDC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0FB770 7F0C6C00 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0FB768 7F0C6BF8 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0FB76C 7F0C6BFC 8F180EDC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0FB770 7F0C6C00 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0FB774 7F0C6C04 AFA20060 */ sw $v0, 0x60($sp) -/* 0FB778 7F0C6C08 8CE70EE0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0FB778 7F0C6C08 8CE70EE0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0FB77C 7F0C6C0C 27A40064 */ addiu $a0, $sp, 0x64 /* 0FB780 7F0C6C10 27A50068 */ addiu $a1, $sp, 0x68 /* 0FB784 7F0C6C14 00403025 */ move $a2, $v0 /* 0FB788 7F0C6C18 AFA00014 */ sw $zero, 0x14($sp) -/* 0FB78C 7F0C6C1C 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0FB78C 7F0C6C1C 0FC2BD4F */ jal textMeasure /* 0FB790 7F0C6C20 AFB80010 */ sw $t8, 0x10($sp) /* 0FB794 7F0C6C24 0C001145 */ jal viGetViewLeft /* 0FB798 7F0C6C28 00000000 */ nop @@ -5671,10 +5672,10 @@ glabel mp_watch_menu_display /* 0FB824 7F0C6CB4 00105C03 */ sra $t3, $s0, 0x10 /* 0FB828 7F0C6CB8 0C00110B */ jal viGetY /* 0FB82C 7F0C6CBC 01608025 */ move $s0, $t3 -/* 0FB830 7F0C6CC0 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0FB834 7F0C6CC4 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0FB838 7F0C6CC8 8D8C0EDC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0FB83C 7F0C6CCC 8F180EE0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0FB830 7F0C6CC0 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0FB834 7F0C6CC4 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0FB838 7F0C6CC8 8D8C0EDC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0FB83C 7F0C6CCC 8F180EE0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0FB840 7F0C6CD0 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0FB844 7F0C6CD4 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0FB848 7F0C6CD8 AFAD0018 */ sw $t5, 0x18($sp) @@ -5687,7 +5688,7 @@ glabel mp_watch_menu_display /* 0FB864 7F0C6CF4 AFA00024 */ sw $zero, 0x24($sp) /* 0FB868 7F0C6CF8 AFA00028 */ sw $zero, 0x28($sp) /* 0FB86C 7F0C6CFC AFAC0014 */ sw $t4, 0x14($sp) -/* 0FB870 7F0C6D00 0FC2B99B */ jal en_text_write_stuff +/* 0FB870 7F0C6D00 0FC2B99B */ jal textRender /* 0FB874 7F0C6D04 AFB80010 */ sw $t8, 0x10($sp) /* 0FB878 7F0C6D08 0FC2B6A8 */ jal combiner_bayer_lod_perspective /* 0FB87C 7F0C6D0C 00402025 */ move $a0, $v0 @@ -5822,15 +5823,15 @@ glabel mp_watch_menu_display /* 0F6058 7F0C3668 24840041 */ addiu $a0, $a0, 0x41 /* 0F605C 7F0C366C AFA400CC */ sw $a0, 0xcc($sp) .L7F0C3670: -/* 0F6060 7F0C3670 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F6064 7F0C3674 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F6068 7F0C3678 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F606C 7F0C367C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F6060 7F0C3670 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F6064 7F0C3674 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F6068 7F0C3678 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F606C 7F0C367C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6070 7F0C3680 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6074 7F0C3684 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F6078 7F0C3688 8FA600A4 */ lw $a2, 0xa4($sp) /* 0F607C 7F0C368C AFA00014 */ sw $zero, 0x14($sp) -/* 0F6080 7F0C3690 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F6080 7F0C3690 0FC2B713 */ jal textMeasure /* 0F6084 7F0C3694 AFAB0010 */ sw $t3, 0x10($sp) /* 0F6088 7F0C3698 0C000FD9 */ jal viGetViewLeft /* 0F608C 7F0C369C 00000000 */ nop @@ -5854,10 +5855,10 @@ glabel mp_watch_menu_display /* 0F60D4 7F0C36E4 00107403 */ sra $t6, $s0, 0x10 /* 0F60D8 7F0C36E8 0C000F9F */ jal viGetY /* 0F60DC 7F0C36EC 01C08025 */ move $s0, $t6 -/* 0F60E0 7F0C36F0 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) # $t5, 0x8004 -/* 0F60E4 7F0C36F4 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F60E8 7F0C36F8 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F60EC 7F0C36FC 8DADAB00 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) +/* 0F60E0 7F0C36F0 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) # $t5, 0x8004 +/* 0F60E4 7F0C36F4 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F60E8 7F0C36F8 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F60EC 7F0C36FC 8DADAB00 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) /* 0F60F0 7F0C3700 3C18A0FF */ lui $t8, (0xA0FFA0F0 >> 16) # lui $t8, 0xa0ff /* 0F60F4 7F0C3704 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0F60F8 7F0C3708 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -5873,7 +5874,7 @@ glabel mp_watch_menu_display /* 0F6120 7F0C3730 AFA00028 */ sw $zero, 0x28($sp) /* 0F6124 7F0C3734 AFA0002C */ sw $zero, 0x2c($sp) /* 0F6128 7F0C3738 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F612C 7F0C373C 0FC2B66B */ jal jp_text_write_stuff +/* 0F612C 7F0C373C 0FC2B66B */ jal textRenderGlow /* 0F6130 7F0C3740 AFAD0010 */ sw $t5, 0x10($sp) /* 0F6134 7F0C3744 1000001A */ b .L7F0C37B0 /* 0F6138 7F0C3748 00408825 */ move $s1, $v0 @@ -5884,10 +5885,10 @@ glabel mp_watch_menu_display /* 0F6148 7F0C3758 00105C03 */ sra $t3, $s0, 0x10 /* 0F614C 7F0C375C 0C000F9F */ jal viGetY /* 0F6150 7F0C3760 01608025 */ move $s0, $t3 -/* 0F6154 7F0C3764 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F6158 7F0C3768 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0F615C 7F0C376C 8DCEAAFC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0F6160 7F0C3770 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F6154 7F0C3764 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F6158 7F0C3768 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0F615C 7F0C376C 8DCEAAFC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0F6160 7F0C3770 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F6164 7F0C3774 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0F6168 7F0C3778 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0F616C 7F0C377C AFAD0018 */ sw $t5, 0x18($sp) @@ -5900,7 +5901,7 @@ glabel mp_watch_menu_display /* 0F6188 7F0C3798 AFA00024 */ sw $zero, 0x24($sp) /* 0F618C 7F0C379C AFA00028 */ sw $zero, 0x28($sp) /* 0F6190 7F0C37A0 AFAE0014 */ sw $t6, 0x14($sp) -/* 0F6194 7F0C37A4 0FC2B35F */ jal en_text_write_stuff +/* 0F6194 7F0C37A4 0FC2B35F */ jal textRender /* 0F6198 7F0C37A8 AFAC0010 */ sw $t4, 0x10($sp) /* 0F619C 7F0C37AC 00408825 */ move $s1, $v0 .L7F0C37B0: @@ -5945,10 +5946,10 @@ glabel mp_watch_menu_display /* 0F6230 7F0C3840 0010C403 */ sra $t8, $s0, 0x10 /* 0F6234 7F0C3844 0C000F9F */ jal viGetY /* 0F6238 7F0C3848 03008025 */ move $s0, $t8 -/* 0F623C 7F0C384C 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) # $t9, 0x8004 -/* 0F6240 7F0C3850 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F6244 7F0C3854 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F6248 7F0C3858 8F39AB00 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F623C 7F0C384C 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) # $t9, 0x8004 +/* 0F6240 7F0C3850 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F6244 7F0C3854 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F6248 7F0C3858 8F39AB00 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F624C 7F0C385C 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0F6250 7F0C3860 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0F6254 7F0C3864 3C078005 */ lui $a3, %hi(ascii_MP_watch_menu_left_chevron) # $a3, 0x8005 @@ -5962,7 +5963,7 @@ glabel mp_watch_menu_display /* 0F6274 7F0C3884 AFA00024 */ sw $zero, 0x24($sp) /* 0F6278 7F0C3888 AFA00028 */ sw $zero, 0x28($sp) /* 0F627C 7F0C388C AFAB0014 */ sw $t3, 0x14($sp) -/* 0F6280 7F0C3890 0FC2B35F */ jal en_text_write_stuff +/* 0F6280 7F0C3890 0FC2B35F */ jal textRender /* 0F6284 7F0C3894 AFB90010 */ sw $t9, 0x10($sp) /* 0F6288 7F0C3898 1000001E */ b .L7F0C3914 /* 0F628C 7F0C389C 00408825 */ move $s1, $v0 @@ -5973,10 +5974,10 @@ glabel mp_watch_menu_display /* 0F629C 7F0C38AC 00107403 */ sra $t6, $s0, 0x10 /* 0F62A0 7F0C38B0 0C000F9F */ jal viGetY /* 0F62A4 7F0C38B4 01C08025 */ move $s0, $t6 -/* 0F62A8 7F0C38B8 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) # $t5, 0x8004 -/* 0F62AC 7F0C38BC 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F62B0 7F0C38C0 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F62B4 7F0C38C4 8DADAB00 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) +/* 0F62A8 7F0C38B8 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) # $t5, 0x8004 +/* 0F62AC 7F0C38BC 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F62B0 7F0C38C0 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F62B4 7F0C38C4 8DADAB00 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) /* 0F62B8 7F0C38C8 3C18A0FF */ lui $t8, (0xA0FFA0F0 >> 16) # lui $t8, 0xa0ff /* 0F62BC 7F0C38CC 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0F62C0 7F0C38D0 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -5993,7 +5994,7 @@ glabel mp_watch_menu_display /* 0F62EC 7F0C38FC AFA00028 */ sw $zero, 0x28($sp) /* 0F62F0 7F0C3900 AFA0002C */ sw $zero, 0x2c($sp) /* 0F62F4 7F0C3904 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F62F8 7F0C3908 0FC2B66B */ jal jp_text_write_stuff +/* 0F62F8 7F0C3908 0FC2B66B */ jal textRenderGlow /* 0F62FC 7F0C390C AFAD0010 */ sw $t5, 0x10($sp) /* 0F6300 7F0C3910 00408825 */ move $s1, $v0 .L7F0C3914: @@ -6038,10 +6039,10 @@ glabel mp_watch_menu_display /* 0F6394 7F0C39A4 00107403 */ sra $t6, $s0, 0x10 /* 0F6398 7F0C39A8 0C000F9F */ jal viGetY /* 0F639C 7F0C39AC 01C08025 */ move $s0, $t6 -/* 0F63A0 7F0C39B0 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F63A4 7F0C39B4 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F63A8 7F0C39B8 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F63AC 7F0C39BC 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F63A0 7F0C39B0 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F63A4 7F0C39B4 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F63A8 7F0C39B8 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F63AC 7F0C39BC 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F63B0 7F0C39C0 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0F63B4 7F0C39C4 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0F63B8 7F0C39C8 3C078005 */ lui $a3, %hi(ascii_MP_watch_menu_right_chevron) # $a3, 0x8005 @@ -6055,7 +6056,7 @@ glabel mp_watch_menu_display /* 0F63D8 7F0C39E8 AFA00024 */ sw $zero, 0x24($sp) /* 0F63DC 7F0C39EC AFA00028 */ sw $zero, 0x28($sp) /* 0F63E0 7F0C39F0 AFAD0014 */ sw $t5, 0x14($sp) -/* 0F63E4 7F0C39F4 0FC2B35F */ jal en_text_write_stuff +/* 0F63E4 7F0C39F4 0FC2B35F */ jal textRender /* 0F63E8 7F0C39F8 AFAC0010 */ sw $t4, 0x10($sp) /* 0F63EC 7F0C39FC 1000001E */ b .L7F0C3A78 /* 0F63F0 7F0C3A00 00408825 */ move $s1, $v0 @@ -6066,10 +6067,10 @@ glabel mp_watch_menu_display /* 0F6400 7F0C3A10 0010C403 */ sra $t8, $s0, 0x10 /* 0F6404 7F0C3A14 0C000F9F */ jal viGetY /* 0F6408 7F0C3A18 03008025 */ move $s0, $t8 -/* 0F640C 7F0C3A1C 3C198004 */ lui $t9, %hi(ptrSecondFontTableSmall) # $t9, 0x8004 -/* 0F6410 7F0C3A20 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F6414 7F0C3A24 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F6418 7F0C3A28 8F39AB00 */ lw $t9, %lo(ptrSecondFontTableSmall)($t9) +/* 0F640C 7F0C3A1C 3C198004 */ lui $t9, %hi(ptrFontBankGothicChars) # $t9, 0x8004 +/* 0F6410 7F0C3A20 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F6414 7F0C3A24 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F6418 7F0C3A28 8F39AB00 */ lw $t9, %lo(ptrFontBankGothicChars)($t9) /* 0F641C 7F0C3A2C 3C0EA0FF */ lui $t6, (0xA0FFA0F0 >> 16) # lui $t6, 0xa0ff /* 0F6420 7F0C3A30 3C0C0070 */ lui $t4, (0x007000A0 >> 16) # lui $t4, 0x70 /* 0F6424 7F0C3A34 358C00A0 */ ori $t4, (0x007000A0 & 0xFFFF) # ori $t4, $t4, 0xa0 @@ -6086,7 +6087,7 @@ glabel mp_watch_menu_display /* 0F6450 7F0C3A60 AFA00028 */ sw $zero, 0x28($sp) /* 0F6454 7F0C3A64 AFA0002C */ sw $zero, 0x2c($sp) /* 0F6458 7F0C3A68 AFAB0014 */ sw $t3, 0x14($sp) -/* 0F645C 7F0C3A6C 0FC2B66B */ jal jp_text_write_stuff +/* 0F645C 7F0C3A6C 0FC2B66B */ jal textRenderGlow /* 0F6460 7F0C3A70 AFB90010 */ sw $t9, 0x10($sp) /* 0F6464 7F0C3A74 00408825 */ move $s1, $v0 .L7F0C3A78: @@ -6132,15 +6133,15 @@ glabel mp_watch_menu_display /* 0F64F4 7F0C3B04 27A400AC */ addiu $a0, $sp, 0xac /* 0F64F8 7F0C3B08 0FC30C5D */ jal write_playerrank_to_buffer /* 0F64FC 7F0C3B0C 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F6500 7F0C3B10 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F6504 7F0C3B14 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F6508 7F0C3B18 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F650C 7F0C3B1C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F6500 7F0C3B10 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F6504 7F0C3B14 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F6508 7F0C3B18 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F650C 7F0C3B1C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6510 7F0C3B20 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6514 7F0C3B24 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F6518 7F0C3B28 27A600AC */ addiu $a2, $sp, 0xac /* 0F651C 7F0C3B2C AFA00014 */ sw $zero, 0x14($sp) -/* 0F6520 7F0C3B30 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F6520 7F0C3B30 0FC2B713 */ jal textMeasure /* 0F6524 7F0C3B34 AFAB0010 */ sw $t3, 0x10($sp) /* 0F6528 7F0C3B38 0C000FD9 */ jal viGetViewLeft /* 0F652C 7F0C3B3C 00000000 */ nop @@ -6162,10 +6163,10 @@ glabel mp_watch_menu_display /* 0F656C 7F0C3B7C 00106C03 */ sra $t5, $s0, 0x10 /* 0F6570 7F0C3B80 0C000F9F */ jal viGetY /* 0F6574 7F0C3B84 01A08025 */ move $s0, $t5 -/* 0F6578 7F0C3B88 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F657C 7F0C3B8C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F6580 7F0C3B90 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F6584 7F0C3B94 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F6578 7F0C3B88 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F657C 7F0C3B8C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F6580 7F0C3B90 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F6584 7F0C3B94 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F6588 7F0C3B98 3C1800FF */ lui $t8, (0x00FF00B0 >> 16) # lui $t8, 0xff /* 0F658C 7F0C3B9C 371800B0 */ ori $t8, (0x00FF00B0 & 0xFFFF) # ori $t8, $t8, 0xb0 /* 0F6590 7F0C3BA0 AFB80018 */ sw $t8, 0x18($sp) @@ -6178,7 +6179,7 @@ glabel mp_watch_menu_display /* 0F65AC 7F0C3BBC AFA00024 */ sw $zero, 0x24($sp) /* 0F65B0 7F0C3BC0 AFA00028 */ sw $zero, 0x28($sp) /* 0F65B4 7F0C3BC4 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F65B8 7F0C3BC8 0FC2B35F */ jal en_text_write_stuff +/* 0F65B8 7F0C3BC8 0FC2B35F */ jal textRender /* 0F65BC 7F0C3BCC AFAC0010 */ sw $t4, 0x10($sp) /* 0F65C0 7F0C3BD0 00408825 */ move $s1, $v0 .L7F0C3BD4: @@ -6201,16 +6202,16 @@ glabel mp_watch_menu_display /* 0F6600 7F0C3C10 AFA20080 */ sw $v0, 0x80($sp) /* 0F6604 7F0C3C14 0FC304AE */ jal langGet /* 0F6608 7F0C3C18 3404A01B */ li $a0, 40987 -/* 0F660C 7F0C3C1C 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0F6610 7F0C3C20 8DCEAAFC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0F6614 7F0C3C24 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F660C 7F0C3C1C 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0F6610 7F0C3C20 8DCEAAFC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0F6614 7F0C3C24 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F6618 7F0C3C28 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F661C 7F0C3C2C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F661C 7F0C3C2C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6620 7F0C3C30 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6624 7F0C3C34 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F6628 7F0C3C38 00403025 */ move $a2, $v0 /* 0F662C 7F0C3C3C AFA00014 */ sw $zero, 0x14($sp) -/* 0F6630 7F0C3C40 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F6630 7F0C3C40 0FC2B713 */ jal textMeasure /* 0F6634 7F0C3C44 AFAE0010 */ sw $t6, 0x10($sp) /* 0F6638 7F0C3C48 0C000FD9 */ jal viGetViewLeft /* 0F663C 7F0C3C4C 00000000 */ nop @@ -6232,10 +6233,10 @@ glabel mp_watch_menu_display /* 0F667C 7F0C3C8C 00107C03 */ sra $t7, $s0, 0x10 /* 0F6680 7F0C3C90 0C000F9F */ jal viGetY /* 0F6684 7F0C3C94 01E08025 */ move $s0, $t7 -/* 0F6688 7F0C3C98 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F668C 7F0C3C9C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F6690 7F0C3CA0 8F18AAFC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F6694 7F0C3CA4 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F6688 7F0C3C98 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F668C 7F0C3C9C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F6690 7F0C3CA0 8F18AAFC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F6694 7F0C3CA4 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F6698 7F0C3CA8 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0F669C 7F0C3CAC 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0F66A0 7F0C3CB0 AFB90018 */ sw $t9, 0x18($sp) @@ -6248,7 +6249,7 @@ glabel mp_watch_menu_display /* 0F66BC 7F0C3CCC AFA00024 */ sw $zero, 0x24($sp) /* 0F66C0 7F0C3CD0 AFA00028 */ sw $zero, 0x28($sp) /* 0F66C4 7F0C3CD4 AFB80014 */ sw $t8, 0x14($sp) -/* 0F66C8 7F0C3CD8 0FC2B35F */ jal en_text_write_stuff +/* 0F66C8 7F0C3CD8 0FC2B35F */ jal textRender /* 0F66CC 7F0C3CDC AFAC0010 */ sw $t4, 0x10($sp) /* 0F66D0 7F0C3CE0 8FA30080 */ lw $v1, 0x80($sp) /* 0F66D4 7F0C3CE4 24010005 */ li $at, 5 @@ -6572,15 +6573,15 @@ glabel mp_watch_menu_display /* 0F6B64 7F0C4174 27A400AC */ addiu $a0, $sp, 0xac /* 0F6B68 7F0C4178 0FC30C5D */ jal write_playerrank_to_buffer /* 0F6B6C 7F0C417C 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F6B70 7F0C4180 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F6B74 7F0C4184 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F6B78 7F0C4188 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F6B7C 7F0C418C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F6B70 7F0C4180 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F6B74 7F0C4184 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F6B78 7F0C4188 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F6B7C 7F0C418C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6B80 7F0C4190 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6B84 7F0C4194 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F6B88 7F0C4198 27A600AC */ addiu $a2, $sp, 0xac /* 0F6B8C 7F0C419C AFA00014 */ sw $zero, 0x14($sp) -/* 0F6B90 7F0C41A0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F6B90 7F0C41A0 0FC2B713 */ jal textMeasure /* 0F6B94 7F0C41A4 AFAF0010 */ sw $t7, 0x10($sp) /* 0F6B98 7F0C41A8 0C000FD9 */ jal viGetViewLeft /* 0F6B9C 7F0C41AC 00000000 */ nop @@ -6602,10 +6603,10 @@ glabel mp_watch_menu_display /* 0F6BDC 7F0C41EC 0010C403 */ sra $t8, $s0, 0x10 /* 0F6BE0 7F0C41F0 0C000F9F */ jal viGetY /* 0F6BE4 7F0C41F4 03008025 */ move $s0, $t8 -/* 0F6BE8 7F0C41F8 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F6BEC 7F0C41FC 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0F6BF0 7F0C4200 8F39AAFC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F6BF4 7F0C4204 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F6BE8 7F0C41F8 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F6BEC 7F0C41FC 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0F6BF0 7F0C4200 8F39AAFC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F6BF4 7F0C4204 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F6BF8 7F0C4208 3C0B00FF */ lui $t3, (0x00FF00B0 >> 16) # lui $t3, 0xff /* 0F6BFC 7F0C420C 356B00B0 */ ori $t3, (0x00FF00B0 & 0xFFFF) # ori $t3, $t3, 0xb0 /* 0F6C00 7F0C4210 AFAB0018 */ sw $t3, 0x18($sp) @@ -6618,7 +6619,7 @@ glabel mp_watch_menu_display /* 0F6C1C 7F0C422C AFA00024 */ sw $zero, 0x24($sp) /* 0F6C20 7F0C4230 AFA00028 */ sw $zero, 0x28($sp) /* 0F6C24 7F0C4234 AFB90014 */ sw $t9, 0x14($sp) -/* 0F6C28 7F0C4238 0FC2B35F */ jal en_text_write_stuff +/* 0F6C28 7F0C4238 0FC2B35F */ jal textRender /* 0F6C2C 7F0C423C AFAC0010 */ sw $t4, 0x10($sp) /* 0F6C30 7F0C4240 00408825 */ move $s1, $v0 .L7F0C4244: @@ -6635,15 +6636,15 @@ glabel mp_watch_menu_display /* 0F6C5C 7F0C426C AFA20010 */ sw $v0, 0x10($sp) /* 0F6C60 7F0C4270 0C00283D */ jal sprintf /* 0F6C64 7F0C4274 24E70001 */ addiu $a3, $a3, 1 -/* 0F6C68 7F0C4278 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F6C6C 7F0C427C 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F6C70 7F0C4280 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F6C74 7F0C4284 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F6C68 7F0C4278 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F6C6C 7F0C427C 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F6C70 7F0C4280 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F6C74 7F0C4284 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6C78 7F0C4288 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6C7C 7F0C428C 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F6C80 7F0C4290 27A600AC */ addiu $a2, $sp, 0xac /* 0F6C84 7F0C4294 AFA00014 */ sw $zero, 0x14($sp) -/* 0F6C88 7F0C4298 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F6C88 7F0C4298 0FC2B713 */ jal textMeasure /* 0F6C8C 7F0C429C AFAD0010 */ sw $t5, 0x10($sp) /* 0F6C90 7F0C42A0 0C000FD9 */ jal viGetViewLeft /* 0F6C94 7F0C42A4 00000000 */ nop @@ -6665,10 +6666,10 @@ glabel mp_watch_menu_display /* 0F6CD4 7F0C42E4 0010C403 */ sra $t8, $s0, 0x10 /* 0F6CD8 7F0C42E8 0C000F9F */ jal viGetY /* 0F6CDC 7F0C42EC 03008025 */ move $s0, $t8 -/* 0F6CE0 7F0C42F0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0F6CE4 7F0C42F4 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0F6CE8 7F0C42F8 8D8CAAFC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F6CEC 7F0C42FC 8DCEAB00 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0F6CE0 7F0C42F0 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0F6CE4 7F0C42F4 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0F6CE8 7F0C42F8 8D8CAAFC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F6CEC 7F0C42FC 8DCEAB00 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0F6CF0 7F0C4300 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0F6CF4 7F0C4304 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0F6CF8 7F0C4308 AFB90018 */ sw $t9, 0x18($sp) @@ -6681,7 +6682,7 @@ glabel mp_watch_menu_display /* 0F6D14 7F0C4324 AFA00024 */ sw $zero, 0x24($sp) /* 0F6D18 7F0C4328 AFA00028 */ sw $zero, 0x28($sp) /* 0F6D1C 7F0C432C AFAC0014 */ sw $t4, 0x14($sp) -/* 0F6D20 7F0C4330 0FC2B35F */ jal en_text_write_stuff +/* 0F6D20 7F0C4330 0FC2B35F */ jal textRender /* 0F6D24 7F0C4334 AFAE0010 */ sw $t6, 0x10($sp) /* 0F6D28 7F0C4338 8FAB00D0 */ lw $t3, 0xd0($sp) /* 0F6D2C 7F0C433C 00408825 */ move $s1, $v0 @@ -6867,15 +6868,15 @@ glabel mp_watch_menu_display /* 0F6FDC 7F0C45EC 27A400AC */ addiu $a0, $sp, 0xac /* 0F6FE0 7F0C45F0 0FC30C5D */ jal write_playerrank_to_buffer /* 0F6FE4 7F0C45F4 8FA500D4 */ lw $a1, 0xd4($sp) -/* 0F6FE8 7F0C45F8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F6FEC 7F0C45FC 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F6FF0 7F0C4600 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F6FF4 7F0C4604 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F6FE8 7F0C45F8 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F6FEC 7F0C45FC 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F6FF0 7F0C4600 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F6FF4 7F0C4604 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F6FF8 7F0C4608 27A400BC */ addiu $a0, $sp, 0xbc /* 0F6FFC 7F0C460C 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F7000 7F0C4610 27A600AC */ addiu $a2, $sp, 0xac /* 0F7004 7F0C4614 AFA00014 */ sw $zero, 0x14($sp) -/* 0F7008 7F0C4618 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7008 7F0C4618 0FC2B713 */ jal textMeasure /* 0F700C 7F0C461C AFAD0010 */ sw $t5, 0x10($sp) /* 0F7010 7F0C4620 0C000FD9 */ jal viGetViewLeft /* 0F7014 7F0C4624 00000000 */ nop @@ -6897,10 +6898,10 @@ glabel mp_watch_menu_display /* 0F7054 7F0C4664 00107403 */ sra $t6, $s0, 0x10 /* 0F7058 7F0C4668 0C000F9F */ jal viGetY /* 0F705C 7F0C466C 01C08025 */ move $s0, $t6 -/* 0F7060 7F0C4670 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0F7064 7F0C4674 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0F7068 7F0C4678 8D8CAAFC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F706C 7F0C467C 8F18AB00 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0F7060 7F0C4670 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0F7064 7F0C4674 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0F7068 7F0C4678 8D8CAAFC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F706C 7F0C467C 8F18AB00 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0F7070 7F0C4680 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0F7074 7F0C4684 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0F7078 7F0C4688 AFB90018 */ sw $t9, 0x18($sp) @@ -6913,7 +6914,7 @@ glabel mp_watch_menu_display /* 0F7094 7F0C46A4 AFA00024 */ sw $zero, 0x24($sp) /* 0F7098 7F0C46A8 AFA00028 */ sw $zero, 0x28($sp) /* 0F709C 7F0C46AC AFAC0014 */ sw $t4, 0x14($sp) -/* 0F70A0 7F0C46B0 0FC2B35F */ jal en_text_write_stuff +/* 0F70A0 7F0C46B0 0FC2B35F */ jal textRender /* 0F70A4 7F0C46B4 AFB80010 */ sw $t8, 0x10($sp) /* 0F70A8 7F0C46B8 00408825 */ move $s1, $v0 .L7F0C46BC: @@ -6930,15 +6931,15 @@ glabel mp_watch_menu_display /* 0F70D4 7F0C46E4 AFA20010 */ sw $v0, 0x10($sp) /* 0F70D8 7F0C46E8 0C00283D */ jal sprintf /* 0F70DC 7F0C46EC 24E70001 */ addiu $a3, $a3, 1 -/* 0F70E0 7F0C46F0 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F70E4 7F0C46F4 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F70E8 7F0C46F8 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F70EC 7F0C46FC 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F70E0 7F0C46F0 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F70E4 7F0C46F4 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F70E8 7F0C46F8 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F70EC 7F0C46FC 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F70F0 7F0C4700 27A400BC */ addiu $a0, $sp, 0xbc /* 0F70F4 7F0C4704 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F70F8 7F0C4708 27A600AC */ addiu $a2, $sp, 0xac /* 0F70FC 7F0C470C AFA00014 */ sw $zero, 0x14($sp) -/* 0F7100 7F0C4710 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7100 7F0C4710 0FC2B713 */ jal textMeasure /* 0F7104 7F0C4714 AFAB0010 */ sw $t3, 0x10($sp) /* 0F7108 7F0C4718 0C000FD9 */ jal viGetViewLeft /* 0F710C 7F0C471C 00000000 */ nop @@ -6960,10 +6961,10 @@ glabel mp_watch_menu_display /* 0F714C 7F0C475C 00107403 */ sra $t6, $s0, 0x10 /* 0F7150 7F0C4760 0C000F9F */ jal viGetY /* 0F7154 7F0C4764 01C08025 */ move $s0, $t6 -/* 0F7158 7F0C4768 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0F715C 7F0C476C 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F7160 7F0C4770 8F18AAFC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F7164 7F0C4774 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0F7158 7F0C4768 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0F715C 7F0C476C 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F7160 7F0C4770 8F18AAFC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F7164 7F0C4774 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0F7168 7F0C4778 3C0CFF40 */ lui $t4, (0xFF4040B0 >> 16) # lui $t4, 0xff40 /* 0F716C 7F0C477C 358C40B0 */ ori $t4, (0xFF4040B0 & 0xFFFF) # ori $t4, $t4, 0x40b0 /* 0F7170 7F0C4780 AFAC0018 */ sw $t4, 0x18($sp) @@ -6976,7 +6977,7 @@ glabel mp_watch_menu_display /* 0F718C 7F0C479C AFA00024 */ sw $zero, 0x24($sp) /* 0F7190 7F0C47A0 AFA00028 */ sw $zero, 0x28($sp) /* 0F7194 7F0C47A4 AFB80014 */ sw $t8, 0x14($sp) -/* 0F7198 7F0C47A8 0FC2B35F */ jal en_text_write_stuff +/* 0F7198 7F0C47A8 0FC2B35F */ jal textRender /* 0F719C 7F0C47AC AFAF0010 */ sw $t7, 0x10($sp) /* 0F71A0 7F0C47B0 8FB900D0 */ lw $t9, 0xd0($sp) /* 0F71A4 7F0C47B4 24010002 */ li $at, 2 @@ -7313,16 +7314,16 @@ glabel mp_watch_menu_display .L7F0C4CA0: /* 0F7690 7F0C4CA0 0FC304AE */ jal langGet /* 0F7694 7F0C4CA4 3404A01F */ li $a0, 40991 -/* 0F7698 7F0C4CA8 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F769C 7F0C4CAC 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F76A0 7F0C4CB0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F7698 7F0C4CA8 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F769C 7F0C4CAC 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F76A0 7F0C4CB0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F76A4 7F0C4CB4 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F76A8 7F0C4CB8 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F76A8 7F0C4CB8 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F76AC 7F0C4CBC 27A4007C */ addiu $a0, $sp, 0x7c /* 0F76B0 7F0C4CC0 27A50078 */ addiu $a1, $sp, 0x78 /* 0F76B4 7F0C4CC4 00403025 */ move $a2, $v0 /* 0F76B8 7F0C4CC8 AFA00014 */ sw $zero, 0x14($sp) -/* 0F76BC 7F0C4CCC 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F76BC 7F0C4CCC 0FC2B713 */ jal textMeasure /* 0F76C0 7F0C4CD0 AFAD0010 */ sw $t5, 0x10($sp) /* 0F76C4 7F0C4CD4 0C000FD9 */ jal viGetViewLeft /* 0F76C8 7F0C4CD8 00000000 */ nop @@ -7344,10 +7345,10 @@ glabel mp_watch_menu_display /* 0F7708 7F0C4D18 00105C03 */ sra $t3, $s0, 0x10 /* 0F770C 7F0C4D1C 0C000F9F */ jal viGetY /* 0F7710 7F0C4D20 01608025 */ move $s0, $t3 -/* 0F7714 7F0C4D24 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0F7718 7F0C4D28 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F771C 7F0C4D2C 8F18AAFC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F7720 7F0C4D30 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0F7714 7F0C4D24 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0F7718 7F0C4D28 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F771C 7F0C4D2C 8F18AAFC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F7720 7F0C4D30 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0F7724 7F0C4D34 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0F7728 7F0C4D38 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0F772C 7F0C4D3C AFAC0018 */ sw $t4, 0x18($sp) @@ -7360,22 +7361,22 @@ glabel mp_watch_menu_display /* 0F7748 7F0C4D58 AFA00024 */ sw $zero, 0x24($sp) /* 0F774C 7F0C4D5C AFA00028 */ sw $zero, 0x28($sp) /* 0F7750 7F0C4D60 AFB80014 */ sw $t8, 0x14($sp) -/* 0F7754 7F0C4D64 0FC2B35F */ jal en_text_write_stuff +/* 0F7754 7F0C4D64 0FC2B35F */ jal textRender /* 0F7758 7F0C4D68 AFAF0010 */ sw $t7, 0x10($sp) /* 0F775C 7F0C4D6C 00408825 */ move $s1, $v0 /* 0F7760 7F0C4D70 8FA400D4 */ lw $a0, 0xd4($sp) /* 0F7764 7F0C4D74 0FC02694 */ jal getplayerfavoredweapon /* 0F7768 7F0C4D78 00002825 */ move $a1, $zero -/* 0F776C 7F0C4D7C 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0F7770 7F0C4D80 8F39AAFC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F7774 7F0C4D84 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F776C 7F0C4D7C 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0F7770 7F0C4D80 8F39AAFC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F7774 7F0C4D84 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F7778 7F0C4D88 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F777C 7F0C4D8C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F777C 7F0C4D8C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7780 7F0C4D90 27A4007C */ addiu $a0, $sp, 0x7c /* 0F7784 7F0C4D94 27A50078 */ addiu $a1, $sp, 0x78 /* 0F7788 7F0C4D98 00403025 */ move $a2, $v0 /* 0F778C 7F0C4D9C AFA00014 */ sw $zero, 0x14($sp) -/* 0F7790 7F0C4DA0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7790 7F0C4DA0 0FC2B713 */ jal textMeasure /* 0F7794 7F0C4DA4 AFB90010 */ sw $t9, 0x10($sp) /* 0F7798 7F0C4DA8 0C000FD9 */ jal viGetViewLeft /* 0F779C 7F0C4DAC 00000000 */ nop @@ -7409,10 +7410,10 @@ glabel mp_watch_menu_display /* 0F7804 7F0C4E14 0010C403 */ sra $t8, $s0, 0x10 /* 0F7808 7F0C4E18 0C000F9F */ jal viGetY /* 0F780C 7F0C4E1C 03008025 */ move $s0, $t8 -/* 0F7810 7F0C4E20 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F7814 7F0C4E24 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F7818 7F0C4E28 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F781C 7F0C4E2C 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F7810 7F0C4E20 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F7814 7F0C4E24 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F7818 7F0C4E28 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F781C 7F0C4E2C 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F7820 7F0C4E30 3C1900FF */ lui $t9, (0x00FF00B0 >> 16) # lui $t9, 0xff /* 0F7824 7F0C4E34 373900B0 */ ori $t9, (0x00FF00B0 & 0xFFFF) # ori $t9, $t9, 0xb0 /* 0F7828 7F0C4E38 AFB90018 */ sw $t9, 0x18($sp) @@ -7425,7 +7426,7 @@ glabel mp_watch_menu_display /* 0F7844 7F0C4E54 AFA00024 */ sw $zero, 0x24($sp) /* 0F7848 7F0C4E58 AFA00028 */ sw $zero, 0x28($sp) /* 0F784C 7F0C4E5C AFAD0014 */ sw $t5, 0x14($sp) -/* 0F7850 7F0C4E60 0FC2B35F */ jal en_text_write_stuff +/* 0F7850 7F0C4E60 0FC2B35F */ jal textRender /* 0F7854 7F0C4E64 AFAC0010 */ sw $t4, 0x10($sp) /* 0F7858 7F0C4E68 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 /* 0F785C 7F0C4E6C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -7433,15 +7434,15 @@ glabel mp_watch_menu_display /* 0F7864 7F0C4E74 27A4007C */ addiu $a0, $sp, 0x7c /* 0F7868 7F0C4E78 8C682A08 */ lw $t0, 0x2a08($v1) /* 0F786C 7F0C4E7C 27A50078 */ addiu $a1, $sp, 0x78 -/* 0F7870 7F0C4E80 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F7870 7F0C4E80 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F7874 7F0C4E84 11000031 */ beqz $t0, .L7F0C4F4C /* 0F7878 7F0C4E88 01003025 */ move $a2, $t0 -/* 0F787C 7F0C4E8C 3C0B8004 */ lui $t3, %hi(ptrFirstFontTableSmall) # $t3, 0x8004 -/* 0F7880 7F0C4E90 8D6BAAFC */ lw $t3, %lo(ptrFirstFontTableSmall)($t3) -/* 0F7884 7F0C4E94 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F787C 7F0C4E8C 3C0B8004 */ lui $t3, %hi(ptrFontBankGothic) # $t3, 0x8004 +/* 0F7880 7F0C4E90 8D6BAAFC */ lw $t3, %lo(ptrFontBankGothic)($t3) +/* 0F7884 7F0C4E94 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7888 7F0C4E98 AFA00014 */ sw $zero, 0x14($sp) /* 0F788C 7F0C4E9C AFA800A4 */ sw $t0, 0xa4($sp) -/* 0F7890 7F0C4EA0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7890 7F0C4EA0 0FC2B713 */ jal textMeasure /* 0F7894 7F0C4EA4 AFAB0010 */ sw $t3, 0x10($sp) /* 0F7898 7F0C4EA8 0C000FD9 */ jal viGetViewLeft /* 0F789C 7F0C4EAC 00000000 */ nop @@ -7463,10 +7464,10 @@ glabel mp_watch_menu_display /* 0F78DC 7F0C4EEC 0010C403 */ sra $t8, $s0, 0x10 /* 0F78E0 7F0C4EF0 0C000F9F */ jal viGetY /* 0F78E4 7F0C4EF4 03008025 */ move $s0, $t8 -/* 0F78E8 7F0C4EF8 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0F78EC 7F0C4EFC 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0F78F0 7F0C4F00 8D8CAAFC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F78F4 7F0C4F04 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0F78E8 7F0C4EF8 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0F78EC 7F0C4EFC 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0F78F0 7F0C4F00 8D8CAAFC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F78F4 7F0C4F04 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0F78F8 7F0C4F08 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0F78FC 7F0C4F0C 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0F7900 7F0C4F10 AFAD0018 */ sw $t5, 0x18($sp) @@ -7479,7 +7480,7 @@ glabel mp_watch_menu_display /* 0F791C 7F0C4F2C AFA00024 */ sw $zero, 0x24($sp) /* 0F7920 7F0C4F30 AFA00028 */ sw $zero, 0x28($sp) /* 0F7924 7F0C4F34 AFAC0014 */ sw $t4, 0x14($sp) -/* 0F7928 7F0C4F38 0FC2B35F */ jal en_text_write_stuff +/* 0F7928 7F0C4F38 0FC2B35F */ jal textRender /* 0F792C 7F0C4F3C AFAF0010 */ sw $t7, 0x10($sp) /* 0F7930 7F0C4F40 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 /* 0F7934 7F0C4F44 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -7490,13 +7491,13 @@ glabel mp_watch_menu_display /* 0F7944 7F0C4F54 27A50078 */ addiu $a1, $sp, 0x78 /* 0F7948 7F0C4F58 10400032 */ beqz $v0, .L7F0C5024 /* 0F794C 7F0C4F5C 00403025 */ move $a2, $v0 -/* 0F7950 7F0C4F60 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0F7954 7F0C4F64 8F39AAFC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F7958 7F0C4F68 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 -/* 0F795C 7F0C4F6C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F7950 7F0C4F60 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0F7954 7F0C4F64 8F39AAFC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F7958 7F0C4F68 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 +/* 0F795C 7F0C4F6C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7960 7F0C4F70 AFA00014 */ sw $zero, 0x14($sp) /* 0F7964 7F0C4F74 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F7968 7F0C4F78 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7968 7F0C4F78 0FC2B713 */ jal textMeasure /* 0F796C 7F0C4F7C AFB90010 */ sw $t9, 0x10($sp) /* 0F7970 7F0C4F80 0C000FD9 */ jal viGetViewLeft /* 0F7974 7F0C4F84 00000000 */ nop @@ -7518,10 +7519,10 @@ glabel mp_watch_menu_display /* 0F79B4 7F0C4FC4 0010C403 */ sra $t8, $s0, 0x10 /* 0F79B8 7F0C4FC8 0C000F9F */ jal viGetY /* 0F79BC 7F0C4FCC 03008025 */ move $s0, $t8 -/* 0F79C0 7F0C4FD0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0F79C4 7F0C4FD4 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F79C8 7F0C4FD8 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F79CC 7F0C4FDC 8DCEAB00 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0F79C0 7F0C4FD0 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0F79C4 7F0C4FD4 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F79C8 7F0C4FD8 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F79CC 7F0C4FDC 8DCEAB00 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0F79D0 7F0C4FE0 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0F79D4 7F0C4FE4 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0F79D8 7F0C4FE8 AFAC0018 */ sw $t4, 0x18($sp) @@ -7534,7 +7535,7 @@ glabel mp_watch_menu_display /* 0F79F4 7F0C5004 AFA00024 */ sw $zero, 0x24($sp) /* 0F79F8 7F0C5008 AFA00028 */ sw $zero, 0x28($sp) /* 0F79FC 7F0C500C AFAF0014 */ sw $t7, 0x14($sp) -/* 0F7A00 7F0C5010 0FC2B35F */ jal en_text_write_stuff +/* 0F7A00 7F0C5010 0FC2B35F */ jal textRender /* 0F7A04 7F0C5014 AFAE0010 */ sw $t6, 0x10($sp) /* 0F7A08 7F0C5018 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 /* 0F7A0C 7F0C501C 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -7547,16 +7548,16 @@ glabel mp_watch_menu_display /* 0F7A20 7F0C5030 00000000 */ nop /* 0F7A24 7F0C5034 0FC304AE */ jal langGet /* 0F7A28 7F0C5038 3404A020 */ li $a0, 40992 -/* 0F7A2C 7F0C503C 3C198004 */ lui $t9, %hi(ptrFirstFontTableSmall) # $t9, 0x8004 -/* 0F7A30 7F0C5040 8F39AAFC */ lw $t9, %lo(ptrFirstFontTableSmall)($t9) -/* 0F7A34 7F0C5044 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F7A2C 7F0C503C 3C198004 */ lui $t9, %hi(ptrFontBankGothic) # $t9, 0x8004 +/* 0F7A30 7F0C5040 8F39AAFC */ lw $t9, %lo(ptrFontBankGothic)($t9) +/* 0F7A34 7F0C5044 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F7A38 7F0C5048 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F7A3C 7F0C504C 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F7A3C 7F0C504C 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7A40 7F0C5050 27A400BC */ addiu $a0, $sp, 0xbc /* 0F7A44 7F0C5054 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F7A48 7F0C5058 00403025 */ move $a2, $v0 /* 0F7A4C 7F0C505C AFA00014 */ sw $zero, 0x14($sp) -/* 0F7A50 7F0C5060 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7A50 7F0C5060 0FC2B713 */ jal textMeasure /* 0F7A54 7F0C5064 AFB90010 */ sw $t9, 0x10($sp) /* 0F7A58 7F0C5068 0C000FD9 */ jal viGetViewLeft /* 0F7A5C 7F0C506C 00000000 */ nop @@ -7584,10 +7585,10 @@ glabel mp_watch_menu_display /* 0F7AB4 7F0C50C4 00107C03 */ sra $t7, $s0, 0x10 /* 0F7AB8 7F0C50C8 0C000F9F */ jal viGetY /* 0F7ABC 7F0C50CC 01E08025 */ move $s0, $t7 -/* 0F7AC0 7F0C50D0 3C0C8004 */ lui $t4, %hi(ptrSecondFontTableSmall) # $t4, 0x8004 -/* 0F7AC4 7F0C50D4 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F7AC8 7F0C50D8 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F7ACC 7F0C50DC 8D8CAB00 */ lw $t4, %lo(ptrSecondFontTableSmall)($t4) +/* 0F7AC0 7F0C50D0 3C0C8004 */ lui $t4, %hi(ptrFontBankGothicChars) # $t4, 0x8004 +/* 0F7AC4 7F0C50D4 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F7AC8 7F0C50D8 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F7ACC 7F0C50DC 8D8CAB00 */ lw $t4, %lo(ptrFontBankGothicChars)($t4) /* 0F7AD0 7F0C50E0 3C19A0FF */ lui $t9, (0xA0FFA0F0 >> 16) # lui $t9, 0xa0ff /* 0F7AD4 7F0C50E4 3C0B0070 */ lui $t3, (0x007000A0 >> 16) # lui $t3, 0x70 /* 0F7AD8 7F0C50E8 356B00A0 */ ori $t3, (0x007000A0 & 0xFFFF) # ori $t3, $t3, 0xa0 @@ -7603,7 +7604,7 @@ glabel mp_watch_menu_display /* 0F7B00 7F0C5110 AFA00028 */ sw $zero, 0x28($sp) /* 0F7B04 7F0C5114 AFA0002C */ sw $zero, 0x2c($sp) /* 0F7B08 7F0C5118 AFAD0014 */ sw $t5, 0x14($sp) -/* 0F7B0C 7F0C511C 0FC2B66B */ jal jp_text_write_stuff +/* 0F7B0C 7F0C511C 0FC2B66B */ jal textRenderGlow /* 0F7B10 7F0C5120 AFAC0010 */ sw $t4, 0x10($sp) /* 0F7B14 7F0C5124 1000001A */ b .L7F0C5190 /* 0F7B18 7F0C5128 00408825 */ move $s1, $v0 @@ -7614,10 +7615,10 @@ glabel mp_watch_menu_display /* 0F7B28 7F0C5138 00107403 */ sra $t6, $s0, 0x10 /* 0F7B2C 7F0C513C 0C000F9F */ jal viGetY /* 0F7B30 7F0C5140 01C08025 */ move $s0, $t6 -/* 0F7B34 7F0C5144 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0F7B38 7F0C5148 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0F7B3C 7F0C514C 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0F7B40 7F0C5150 8F18AB00 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0F7B34 7F0C5144 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0F7B38 7F0C5148 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0F7B3C 7F0C514C 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0F7B40 7F0C5150 8F18AB00 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0F7B44 7F0C5154 3C0C00FF */ lui $t4, (0x00FF00B0 >> 16) # lui $t4, 0xff /* 0F7B48 7F0C5158 358C00B0 */ ori $t4, (0x00FF00B0 & 0xFFFF) # ori $t4, $t4, 0xb0 /* 0F7B4C 7F0C515C AFAC0018 */ sw $t4, 0x18($sp) @@ -7630,22 +7631,22 @@ glabel mp_watch_menu_display /* 0F7B68 7F0C5178 AFA00024 */ sw $zero, 0x24($sp) /* 0F7B6C 7F0C517C AFA00028 */ sw $zero, 0x28($sp) /* 0F7B70 7F0C5180 AFAF0014 */ sw $t7, 0x14($sp) -/* 0F7B74 7F0C5184 0FC2B35F */ jal en_text_write_stuff +/* 0F7B74 7F0C5184 0FC2B35F */ jal textRender /* 0F7B78 7F0C5188 AFB80010 */ sw $t8, 0x10($sp) /* 0F7B7C 7F0C518C 00408825 */ move $s1, $v0 .L7F0C5190: /* 0F7B80 7F0C5190 0FC304AE */ jal langGet /* 0F7B84 7F0C5194 3404A021 */ li $a0, 40993 -/* 0F7B88 7F0C5198 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) # $t5, 0x8004 -/* 0F7B8C 7F0C519C 8DADAAFC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0F7B90 7F0C51A0 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F7B88 7F0C5198 3C0D8004 */ lui $t5, %hi(ptrFontBankGothic) # $t5, 0x8004 +/* 0F7B8C 7F0C519C 8DADAAFC */ lw $t5, %lo(ptrFontBankGothic)($t5) +/* 0F7B90 7F0C51A0 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F7B94 7F0C51A4 AFA200A4 */ sw $v0, 0xa4($sp) -/* 0F7B98 7F0C51A8 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F7B98 7F0C51A8 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7B9C 7F0C51AC 27A400BC */ addiu $a0, $sp, 0xbc /* 0F7BA0 7F0C51B0 27A500C0 */ addiu $a1, $sp, 0xc0 /* 0F7BA4 7F0C51B4 00403025 */ move $a2, $v0 /* 0F7BA8 7F0C51B8 AFA00014 */ sw $zero, 0x14($sp) -/* 0F7BAC 7F0C51BC 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7BAC 7F0C51BC 0FC2B713 */ jal textMeasure /* 0F7BB0 7F0C51C0 AFAD0010 */ sw $t5, 0x10($sp) /* 0F7BB4 7F0C51C4 0C000FD9 */ jal viGetViewLeft /* 0F7BB8 7F0C51C8 00000000 */ nop @@ -7674,10 +7675,10 @@ glabel mp_watch_menu_display /* 0F7C14 7F0C5224 0010C403 */ sra $t8, $s0, 0x10 /* 0F7C18 7F0C5228 0C000F9F */ jal viGetY /* 0F7C1C 7F0C522C 03008025 */ move $s0, $t8 -/* 0F7C20 7F0C5230 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0F7C24 7F0C5234 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0F7C28 7F0C5238 8D8CAAFC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F7C2C 7F0C523C 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0F7C20 7F0C5230 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0F7C24 7F0C5234 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0F7C28 7F0C5238 8D8CAAFC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F7C2C 7F0C523C 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0F7C30 7F0C5240 3C0DA0FF */ lui $t5, (0xA0FFA0F0 >> 16) # lui $t5, 0xa0ff /* 0F7C34 7F0C5244 3C190070 */ lui $t9, (0x007000A0 >> 16) # lui $t9, 0x70 /* 0F7C38 7F0C5248 373900A0 */ ori $t9, (0x007000A0 & 0xFFFF) # ori $t9, $t9, 0xa0 @@ -7693,7 +7694,7 @@ glabel mp_watch_menu_display /* 0F7C60 7F0C5270 AFA00028 */ sw $zero, 0x28($sp) /* 0F7C64 7F0C5274 AFA0002C */ sw $zero, 0x2c($sp) /* 0F7C68 7F0C5278 AFAC0014 */ sw $t4, 0x14($sp) -/* 0F7C6C 7F0C527C 0FC2B66B */ jal jp_text_write_stuff +/* 0F7C6C 7F0C527C 0FC2B66B */ jal textRenderGlow /* 0F7C70 7F0C5280 AFAF0010 */ sw $t7, 0x10($sp) /* 0F7C74 7F0C5284 1000001A */ b .L7F0C52F0 /* 0F7C78 7F0C5288 00408825 */ move $s1, $v0 @@ -7704,10 +7705,10 @@ glabel mp_watch_menu_display /* 0F7C88 7F0C5298 00107403 */ sra $t6, $s0, 0x10 /* 0F7C8C 7F0C529C 0C000F9F */ jal viGetY /* 0F7C90 7F0C52A0 01C08025 */ move $s0, $t6 -/* 0F7C94 7F0C52A4 3C0B8004 */ lui $t3, %hi(ptrSecondFontTableSmall) # $t3, 0x8004 -/* 0F7C98 7F0C52A8 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F7C9C 7F0C52AC 8F18AAFC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F7CA0 7F0C52B0 8D6BAB00 */ lw $t3, %lo(ptrSecondFontTableSmall)($t3) +/* 0F7C94 7F0C52A4 3C0B8004 */ lui $t3, %hi(ptrFontBankGothicChars) # $t3, 0x8004 +/* 0F7C98 7F0C52A8 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F7C9C 7F0C52AC 8F18AAFC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F7CA0 7F0C52B0 8D6BAB00 */ lw $t3, %lo(ptrFontBankGothicChars)($t3) /* 0F7CA4 7F0C52B4 3C0F00FF */ lui $t7, (0x00FF00B0 >> 16) # lui $t7, 0xff /* 0F7CA8 7F0C52B8 35EF00B0 */ ori $t7, (0x00FF00B0 & 0xFFFF) # ori $t7, $t7, 0xb0 /* 0F7CAC 7F0C52BC AFAF0018 */ sw $t7, 0x18($sp) @@ -7720,7 +7721,7 @@ glabel mp_watch_menu_display /* 0F7CC8 7F0C52D8 AFA00024 */ sw $zero, 0x24($sp) /* 0F7CCC 7F0C52DC AFA00028 */ sw $zero, 0x28($sp) /* 0F7CD0 7F0C52E0 AFB80014 */ sw $t8, 0x14($sp) -/* 0F7CD4 7F0C52E4 0FC2B35F */ jal en_text_write_stuff +/* 0F7CD4 7F0C52E4 0FC2B35F */ jal textRender /* 0F7CD8 7F0C52E8 AFAB0010 */ sw $t3, 0x10($sp) /* 0F7CDC 7F0C52EC 00408825 */ move $s1, $v0 .L7F0C52F0: @@ -7808,16 +7809,16 @@ glabel mp_watch_menu_display /* 0F7E0C 7F0C541C 00408825 */ move $s1, $v0 /* 0F7E10 7F0C5420 0FC304AE */ jal langGet /* 0F7E14 7F0C5424 3404A022 */ li $a0, 40994 -/* 0F7E18 7F0C5428 3C188004 */ lui $t8, %hi(ptrFirstFontTableSmall) # $t8, 0x8004 -/* 0F7E1C 7F0C542C 8F18AAFC */ lw $t8, %lo(ptrFirstFontTableSmall)($t8) -/* 0F7E20 7F0C5430 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) # $a3, 0x8004 +/* 0F7E18 7F0C5428 3C188004 */ lui $t8, %hi(ptrFontBankGothic) # $t8, 0x8004 +/* 0F7E1C 7F0C542C 8F18AAFC */ lw $t8, %lo(ptrFontBankGothic)($t8) +/* 0F7E20 7F0C5430 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) # $a3, 0x8004 /* 0F7E24 7F0C5434 AFA20060 */ sw $v0, 0x60($sp) -/* 0F7E28 7F0C5438 8CE7AB00 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0F7E28 7F0C5438 8CE7AB00 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0F7E2C 7F0C543C 27A40064 */ addiu $a0, $sp, 0x64 /* 0F7E30 7F0C5440 27A50068 */ addiu $a1, $sp, 0x68 /* 0F7E34 7F0C5444 00403025 */ move $a2, $v0 /* 0F7E38 7F0C5448 AFA00014 */ sw $zero, 0x14($sp) -/* 0F7E3C 7F0C544C 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0F7E3C 7F0C544C 0FC2B713 */ jal textMeasure /* 0F7E40 7F0C5450 AFB80010 */ sw $t8, 0x10($sp) /* 0F7E44 7F0C5454 0C000FD9 */ jal viGetViewLeft /* 0F7E48 7F0C5458 00000000 */ nop @@ -7858,10 +7859,10 @@ glabel mp_watch_menu_display /* 0F7ED4 7F0C54E4 00105C03 */ sra $t3, $s0, 0x10 /* 0F7ED8 7F0C54E8 0C000F9F */ jal viGetY /* 0F7EDC 7F0C54EC 01608025 */ move $s0, $t3 -/* 0F7EE0 7F0C54F0 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0F7EE4 7F0C54F4 3C0C8004 */ lui $t4, %hi(ptrFirstFontTableSmall) # $t4, 0x8004 -/* 0F7EE8 7F0C54F8 8D8CAAFC */ lw $t4, %lo(ptrFirstFontTableSmall)($t4) -/* 0F7EEC 7F0C54FC 8F18AB00 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) +/* 0F7EE0 7F0C54F0 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0F7EE4 7F0C54F4 3C0C8004 */ lui $t4, %hi(ptrFontBankGothic) # $t4, 0x8004 +/* 0F7EE8 7F0C54F8 8D8CAAFC */ lw $t4, %lo(ptrFontBankGothic)($t4) +/* 0F7EEC 7F0C54FC 8F18AB00 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) /* 0F7EF0 7F0C5500 3C0D00FF */ lui $t5, (0x00FF00B0 >> 16) # lui $t5, 0xff /* 0F7EF4 7F0C5504 35AD00B0 */ ori $t5, (0x00FF00B0 & 0xFFFF) # ori $t5, $t5, 0xb0 /* 0F7EF8 7F0C5508 AFAD0018 */ sw $t5, 0x18($sp) @@ -7874,7 +7875,7 @@ glabel mp_watch_menu_display /* 0F7F14 7F0C5524 AFA00024 */ sw $zero, 0x24($sp) /* 0F7F18 7F0C5528 AFA00028 */ sw $zero, 0x28($sp) /* 0F7F1C 7F0C552C AFAC0014 */ sw $t4, 0x14($sp) -/* 0F7F20 7F0C5530 0FC2B35F */ jal en_text_write_stuff +/* 0F7F20 7F0C5530 0FC2B35F */ jal textRender /* 0F7F24 7F0C5534 AFB80010 */ sw $t8, 0x10($sp) /* 0F7F28 7F0C5538 0FC2B06C */ jal combiner_bayer_lod_perspective /* 0F7F2C 7F0C553C 00402025 */ move $a0, $v0 diff --git a/src/game/mp_watch.h b/src/game/mp_watch.h index f0d38805..590d8f22 100644 --- a/src/game/mp_watch.h +++ b/src/game/mp_watch.h @@ -28,6 +28,9 @@ struct AwardMetrics { s32 shortest_inning; // 0x34 }; +extern s32 g_stopPlayFlag; +extern s32 g_gameOverFlag; + s32 mpFindMaxInt(int param_1, int param_2, int param_3, int param_4, int param_5); s32 mpFindMinInt(int param_1, int param_2, int param_3, int param_4, int param_5); @@ -41,5 +44,6 @@ void mpCalculateAwards(int arg0); s32 get_points_for_mp_player(s32 arg0); void mpwatchSetStopPlayFlag(void); Gfx * mp_watch_menu_display(Gfx *arg0); +s32 disablePlayerActionsWhenPausedOrInMpMenu(void); #endif diff --git a/src/game/mp_weapon.c b/src/game/mp_weapon.c index 56f1041b..d3a49a4e 100644 --- a/src/game/mp_weapon.c +++ b/src/game/mp_weapon.c @@ -1,7 +1,7 @@ #include #include #include "mp_weapon.h" - +#include "assets/obseg/text/LmpweaponsE.h" // data //D:80048670 struct s_mp_weapon_set mp_weapon_set_slaps[] = @@ -101,7 +101,7 @@ struct s_mp_weapon_set mp_weapon_set_remote_m[] = INLINE_S_MP_WEAPON_SET(ITEM_WPPK, PROP_CHRWPPK, 3.0, AMMO_9MM, 0x32, 1), INLINE_S_MP_WEAPON_SET(ITEM_UZI, PROP_CHRUZI, 1.5, AMMO_9MM, 0x64, 1), INLINE_S_MP_WEAPON_SET(ITEM_UZI, PROP_CHRUZI, 1.5, AMMO_9MM, 0x64, 1), -#ifdef VERSION_US +#ifdef BUGFIX_R0 INLINE_S_MP_WEAPON_SET(ITEM_M16, PROP_CHRKALASH, 1.5, AMMO_RIFLE, 0x64, 1), INLINE_S_MP_WEAPON_SET(ITEM_M16, PROP_CHRKALASH, 1.5, AMMO_RIFLE, 0x64, 1), #else @@ -199,20 +199,20 @@ struct s_mp_weapon_set mp_weapon_set_golden[] = //D:800490F0 struct s_mp_weapon_set_text mp_weapon_set_text_table[] = { - {TEXT(LMPWEAPONS, 0x0), mp_weapon_set_slaps}, - {TEXT(LMPWEAPONS, 0x1), mp_weapon_set_pistols}, - {TEXT(LMPWEAPONS, 0xD), mp_weapon_set_knife}, - {TEXT(LMPWEAPONS, 0x2), mp_weapon_set_auto}, - {TEXT(LMPWEAPONS, 0x3), mp_weapon_set_power}, - {TEXT(LMPWEAPONS, 0x4), mp_weapon_set_sniper}, - {TEXT(LMPWEAPONS, 0x5), mp_weapon_set_grenade}, - {TEXT(LMPWEAPONS, 0x6), mp_weapon_set_remote_m}, - {TEXT(LMPWEAPONS, 0x7), mp_weapon_set_glaunch}, - {TEXT(LMPWEAPONS, 0x8), mp_weapon_set_timed_m}, - {TEXT(LMPWEAPONS, 0x9), mp_weapon_set_prox_m}, - {TEXT(LMPWEAPONS, 0xA), mp_weapon_set_rockets}, - {TEXT(LMPWEAPONS, 0xB), mp_weapon_set_lasers}, - {TEXT(LMPWEAPONS, 0xC), mp_weapon_set_golden} + {TEXT(LMPWEAPONS, MPWEAPON_STR_00), mp_weapon_set_slaps}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_01), mp_weapon_set_pistols}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_0D), mp_weapon_set_knife}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_02), mp_weapon_set_auto}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_03), mp_weapon_set_power}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_04), mp_weapon_set_sniper}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_05), mp_weapon_set_grenade}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_06), mp_weapon_set_remote_m}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_07), mp_weapon_set_glaunch}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_08), mp_weapon_set_timed_m}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_09), mp_weapon_set_prox_m}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_0A), mp_weapon_set_rockets}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_0B), mp_weapon_set_lasers}, + {TEXT(LMPWEAPONS, MPWEAPON_STR_0C), mp_weapon_set_golden} }; s32 mp_weapon_set = 0xB; diff --git a/src/game/ob.c b/src/game/ob.c index 73788c6e..71fc2756 100644 --- a/src/game/ob.c +++ b/src/game/ob.c @@ -110,14 +110,15 @@ void resource_load_from_indy(u8 *ptrdata, s32 bytes, fileentry *srcfile, resou #ifdef NONMATCHING -void obInitDebugNoticeList(void) +void obInit(void) { s32 i; debTryAdd(&ob_c_debug_notice_list_entry,"ob_c_debug"); - for (i = 0; i < (file_entry_max - 1); i++) + for (i = file_entry_max-1; i > 1 ; i--) { - resource_lookup_data_array[i].rom_size = (file_resource_table[i+1].hw_address - file_resource_table[i].hw_address); + s32 size = (file_resource_table[i+1].hw_address - file_resource_table[i].hw_address); + resource_lookup_data_array[i].rom_size = size; resource_lookup_data_array[i].poolRemaining = 0; resource_lookup_data_array[i].pc_size = 0; resource_lookup_data_array[i].rom_remaining = 0; @@ -131,7 +132,7 @@ glabel aOb_c_debug /*"ob_c_debug"*/ .word 0x6F625F63, 0x5F646562, 0x75670000 .text -glabel obInitDebugNoticeList +glabel obInit /* 0F1758 7F0BCC28 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0F175C 7F0BCC2C AFBF0014 */ sw $ra, 0x14($sp) /* 0F1760 7F0BCC30 3C048004 */ lui $a0, %hi(ob_c_debug_notice_list_entry) @@ -183,7 +184,7 @@ void obLoadBGFileBytesAtOffset(u8 *bgname, u8 *target, s32 offset, s32 len) s32 index; fileentry *fileentry; - index = get_index_num_of_named_resource(bgname); + index = fileGetIndex(bgname); fileentry = &file_resource_table[index]; if (resource_lookup_data_array[index].rom_size != 0) @@ -201,28 +202,28 @@ void obLoadBGFileBytesAtOffset(u8 *bgname, u8 *target, s32 offset, s32 len) #if defined(LEFTOVERDEBUG) /* no VERSION_EU */ -void _load_rom_index_to_membank(s32 index,s32 param_2,s32 size,u8 bank) +void *_fileIndexLoadToBank(s32 index, FILELOADMETHOD param_2, s32 size, u8 bank) { - load_rom_resource_index_to_membank(index, param_2, size, bank); + return fileIndexLoadToBank(index, param_2, size, bank); } #endif #if defined(LEFTOVERDEBUG) /* no VERSION_EU */ -void _load_resource_index_to_membank(int index,s32 param_2,u8 *ptrdata,int size) +void *_fileIndexLoadToAddr(int index, FILELOADMETHOD param_2, u8 *ptrdata, int size) { - load_resource_index_to_buffer(index, param_2, ptrdata, size); + return fileIndexLoadToAddr(index, param_2, ptrdata, size); } #endif -void _load_resource_named_to_membank(char *filename, FILELOADMETHOD loadMethod, s32 size, u8 bank) +void *_fileNameLoadToBank(char *filename, FILELOADMETHOD loadMethod, s32 size, u8 bank) { - load_rom_resource_index_to_membank(get_index_num_of_named_resource(filename), loadMethod, size, bank); + return fileIndexLoadToBank(fileGetIndex(filename), loadMethod, size, bank); } -void _load_resource_named_to_buffer(char *filename, FILELOADMETHOD loadMethod, u8 *ptrdata, s32 size) +void * _fileNameLoadToAddr(char *filename, FILELOADMETHOD loadMethod, u8 *ptrdata, s32 size) { - load_resource_index_to_buffer(get_index_num_of_named_resource(filename), loadMethod, ptrdata, size); + return fileIndexLoadToAddr(fileGetIndex(filename), loadMethod, ptrdata, size); } #if defined(LEFTOVERDEBUG) @@ -236,7 +237,7 @@ void obLoadBGFileBytesAtOffset(u8 *bgname, u8 *target, s32 offset, s32 len) s32 index; fileentry *fileentry; - index = get_index_num_of_named_resource(bgname); + index = fileGetIndex(bgname); fileentry = &file_resource_table[index]; if (resource_lookup_data_array[index].rom_size != 0) @@ -256,7 +257,7 @@ void obLoadBGFileBytesAtOffset(u8 *bgname, u8 *target, s32 offset, s32 len) -void *load_rom_resource_index_to_membank(s32 index, FILELOADMETHOD loadMethod, s32 size, u8 bank) //#MATCH https://decomp.me/scratch/uqiBe +void *fileIndexLoadToBank(s32 index, FILELOADMETHOD loadMethod, s32 size, u8 bank) //#MATCH https://decomp.me/scratch/uqiBe { resource_lookup_data_entry *info = &resource_lookup_data_array[index]; s32 bytes; @@ -324,7 +325,7 @@ void *load_rom_resource_index_to_membank(s32 index, FILELOADMETHOD loadMethod, s -void *load_resource_index_to_buffer(s32 index, FILELOADMETHOD loadMethod, void *ptrdata, s32 bytes) //#match https://decomp.me/scratch/YExRh +void *fileIndexLoadToAddr(s32 index, FILELOADMETHOD loadMethod, void *ptrdata, s32 bytes) //#match https://decomp.me/scratch/YExRh { resource_lookup_data_entry *info = &resource_lookup_data_array[index]; @@ -385,64 +386,22 @@ s32 get_rom_remaining_buffer_for_index(s32 index) } - -#ifdef NONMATCHING -//f1c74: addiu t7,t7,-0x7750 | f1c74: addiu sp,sp,-0x18 //moved -// > f1c78: addiu t7,t7,-0x7750 -//f1c78: sll t6,t6,0x2 f1c7c: sll t6,t6,0x2 -//f1c7c: addiu sp,sp,-0x18 | f1c80: addu v0,t6,t7 -//f1c80: addu v0,t6,t7 | f1c84: sw ra,0x14(sp) -//f1c84: sw ra,0x14(sp) r f1c88: sw a1,0x1c(sp) -//f1c88: sw a1,0x1c(sp) r f1c8c: sw a2,0x20(sp) //extra reg save -void sub_GAME_7F0BD138(int index, u8 *ptrdata, u32 size, u32 param_4) +void fileSetSize(s32 filenum, u8* ptr, u32 size, s32 reallocate) { - resource_lookup_data_array[index].poolRemaining = size; - resource_lookup_data_array[index].rom_remaining = size; - - - if (param_4 !=0 ) + resource_lookup_data_array[filenum].poolRemaining = size; + resource_lookup_data_array[filenum].rom_remaining = size; + if (reallocate != 0) { - mempAddEntryOfSizeToBank(ptrdata, size, 4); + mempAddEntryOfSizeToBank(ptr, resource_lookup_data_array[filenum].poolRemaining, 4U); } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0BD138 -/* 0F1C68 7F0BD138 00047080 */ sll $t6, $a0, 2 -/* 0F1C6C 7F0BD13C 01C47021 */ addu $t6, $t6, $a0 -/* 0F1C70 7F0BD140 3C0F8009 */ lui $t7, %hi(resource_lookup_data_array) -/* 0F1C74 7F0BD144 25EF88B0 */ addiu $t7, %lo(resource_lookup_data_array) # addiu $t7, $t7, -0x7750 -/* 0F1C78 7F0BD148 000E7080 */ sll $t6, $t6, 2 -/* 0F1C7C 7F0BD14C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0F1C80 7F0BD150 01CF1021 */ addu $v0, $t6, $t7 -/* 0F1C84 7F0BD154 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F1C88 7F0BD158 AFA5001C */ sw $a1, 0x1c($sp) -/* 0F1C8C 7F0BD15C AC460004 */ sw $a2, 4($v0) -/* 0F1C90 7F0BD160 10E00005 */ beqz $a3, .L7F0BD178 -/* 0F1C94 7F0BD164 AC46000C */ sw $a2, 0xc($v0) -/* 0F1C98 7F0BD168 00A02025 */ move $a0, $a1 -/* 0F1C9C 7F0BD16C 00C02825 */ move $a1, $a2 -/* 0F1CA0 7F0BD170 0C002601 */ jal mempAddEntryOfSizeToBank -/* 0F1CA4 7F0BD174 24060004 */ li $a2, 4 -.L7F0BD178: -/* 0F1CA8 7F0BD178 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F1CAC 7F0BD17C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0F1CB0 7F0BD180 03E00008 */ jr $ra -/* 0F1CB4 7F0BD184 00000000 */ nop -) -#endif - - - - s32 get_pc_buffer_remaining_value(u8 *name) { int index; - index = get_index_num_of_named_resource(name); + index = fileGetIndex(name); return resource_lookup_data_array[index].poolRemaining; } @@ -461,7 +420,7 @@ void obBlankResourcesLoadedInBank(u8 bank) } void obBlankResourcesInBank5(void) { - obBlankResourcesLoadedInBank(5); + obBlankResourcesLoadedInBank(MEMPOOL_ME); } @@ -470,7 +429,7 @@ void obBlankResourcesInBank5(void) { #ifdef NONMATCHING //needs work -int get_index_num_of_named_resource(u8 *resname) +int fileGetIndex(u8 *resname) { int i; int size; @@ -509,7 +468,7 @@ int get_index_num_of_named_resource(u8 *resname) #if defined(LEFTOVERDEBUG) GLOBAL_ASM( .text -glabel get_index_num_of_named_resource +glabel fileGetIndex /* 0F1D84 7F0BD254 27BDFFC0 */ addiu $sp, $sp, -0x40 /* 0F1D88 7F0BD258 AFB2001C */ sw $s2, 0x1c($sp) /* 0F1D8C 7F0BD25C 3C128005 */ lui $s2, %hi(file_entry_max) @@ -598,7 +557,7 @@ glabel get_index_num_of_named_resource #if !defined(LEFTOVERDEBUG) GLOBAL_ASM( .text -glabel get_index_num_of_named_resource +glabel fileGetIndex /* 0EEFFC 7F0BC60C 27BDFFC0 */ addiu $sp, $sp, -0x40 /* 0EF000 7F0BC610 AFB2001C */ sw $s2, 0x1c($sp) /* 0EF004 7F0BC614 3C128004 */ lui $s2, %hi(file_entry_max) # $s2, 0x8004 diff --git a/src/game/ob.h b/src/game/ob.h index 5dc23978..14f53f7f 100644 --- a/src/game/ob.h +++ b/src/game/ob.h @@ -29,9 +29,21 @@ typedef enum FILELOADMETHOD void load_resource(u8 *ptrdata, s32 bytes, fileentry *srcfile, resource_lookup_data_entry *lookupdata); void resource_load_from_indy(u8 *ptrdata, s32 bytes, fileentry *srcfile, resource_lookup_data_entry *lookupdata); -void *load_rom_resource_index_to_membank(s32 index, FILELOADMETHOD loadMethod, s32 size, u8 bank); -void *load_resource_index_to_buffer(s32 index, FILELOADMETHOD loadMethod, void *ptrdata, s32 bytes); + void obBlankResourcesLoadedInBank(u8 i); void obBlankResourcesInBank5(void); +void *fileIndexLoadToBank(s32 index, FILELOADMETHOD loadMethod, s32 size, u8 bank); +void *fileIndexLoadToAddr(s32 index, FILELOADMETHOD loadMethod, void *ptrdata, s32 bytes); + +void *_fileNameLoadToAddr(char *filename, FILELOADMETHOD loadMethod, u8 *ptrdata, s32 size); +void *_fileNameLoadToBank(char *filename, FILELOADMETHOD loadMethod, s32 size, u8 bank); + +#if defined(LEFTOVERDEBUG) +void *_fileIndexLoadToAddr(int index, FILELOADMETHOD param_2, u8 *ptrdata, int size); +void *_fileIndexLoadToBank(s32 index, FILELOADMETHOD param_2, s32 size, u8 bank); +#endif + +s32 get_pc_buffer_remaining_value(u8 *name); + #endif diff --git a/src/game/objecthandler.c b/src/game/objecthandler.c index 888db831..46893fbf 100644 --- a/src/game/objecthandler.c +++ b/src/game/objecthandler.c @@ -142,7 +142,7 @@ u32 D_80036248 = 0; //D:8003624C u32 D_8003624C = 0; //D:80036250 -u32 D_80036250 = 1; +u32 g_ModelAnimMergingEnabled = 1; //D:80036254 u32 D_80036254 = 0; //D:80036258 @@ -286,15 +286,7 @@ s32 D_80036418 = 0; s32 D_8003641C = 0; -#if defined(LEFTOVERDEBUG) -// rodata -//D:80054420 -const char aDrawjointlistNoGfxlist[] = "drawjointlist: no gfxlist!\n"; -//D:8005443C -const char aDrawjointlistNoObject0xX[] = "drawjointlist: no object! (0x%X)\n"; -//D:80054460 -const char aDrawjointlistObjectNotInitialised0[] = "drawjointlist: object not initialised! (0x%X)\n"; -#endif + /* */ @@ -533,14 +525,14 @@ glabel sub_GAME_7F06B29C /* 09FE34 7F06B304 02002825 */ move $a1, $s0 /* 09FE38 7F06B308 8C470004 */ lw $a3, 4($v0) /* 09FE3C 7F06B30C 00003025 */ move $a2, $zero -/* 09FE40 7F06B310 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FE40 7F06B310 0FC1B198 */ jal modelFindNodeMtx /* 09FE44 7F06B314 AFA70100 */ sw $a3, 0x100($sp) /* 09FE48 7F06B318 8FA70100 */ lw $a3, 0x100($sp) /* 09FE4C 7F06B31C 00408025 */ move $s0, $v0 /* 09FE50 7F06B320 00003025 */ move $a2, $zero /* 09FE54 7F06B324 10E0000A */ beqz $a3, .L7F06B350 /* 09FE58 7F06B328 00E02825 */ move $a1, $a3 -/* 09FE5C 7F06B32C 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FE5C 7F06B32C 0FC1B198 */ jal modelFindNodeMtx /* 09FE60 7F06B330 8E240000 */ lw $a0, ($s1) /* 09FE64 7F06B334 C44A0038 */ lwc1 $f10, 0x38($v0) /* 09FE68 7F06B338 C6040038 */ lwc1 $f4, 0x38($s0) @@ -560,14 +552,14 @@ glabel sub_GAME_7F06B29C /* 09FE98 7F06B368 02002825 */ move $a1, $s0 /* 09FE9C 7F06B36C 8C470014 */ lw $a3, 0x14($v0) /* 09FEA0 7F06B370 00003025 */ move $a2, $zero -/* 09FEA4 7F06B374 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FEA4 7F06B374 0FC1B198 */ jal modelFindNodeMtx /* 09FEA8 7F06B378 AFA700F0 */ sw $a3, 0xf0($sp) /* 09FEAC 7F06B37C 8FA700F0 */ lw $a3, 0xf0($sp) /* 09FEB0 7F06B380 00408025 */ move $s0, $v0 /* 09FEB4 7F06B384 00003025 */ move $a2, $zero /* 09FEB8 7F06B388 10E0000A */ beqz $a3, .L7F06B3B4 /* 09FEBC 7F06B38C 00E02825 */ move $a1, $a3 -/* 09FEC0 7F06B390 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FEC0 7F06B390 0FC1B198 */ jal modelFindNodeMtx /* 09FEC4 7F06B394 8E240000 */ lw $a0, ($s1) /* 09FEC8 7F06B398 C4480038 */ lwc1 $f8, 0x38($v0) /* 09FECC 7F06B39C C60A0038 */ lwc1 $f10, 0x38($s0) @@ -587,14 +579,14 @@ glabel sub_GAME_7F06B29C /* 09FEFC 7F06B3CC 02002825 */ move $a1, $s0 /* 09FF00 7F06B3D0 8C470014 */ lw $a3, 0x14($v0) /* 09FF04 7F06B3D4 00003025 */ move $a2, $zero -/* 09FF08 7F06B3D8 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FF08 7F06B3D8 0FC1B198 */ jal modelFindNodeMtx /* 09FF0C 7F06B3DC AFA700E0 */ sw $a3, 0xe0($sp) /* 09FF10 7F06B3E0 8FA700E0 */ lw $a3, 0xe0($sp) /* 09FF14 7F06B3E4 00408025 */ move $s0, $v0 /* 09FF18 7F06B3E8 00003025 */ move $a2, $zero /* 09FF1C 7F06B3EC 10E0000A */ beqz $a3, .L7F06B418 /* 09FF20 7F06B3F0 00E02825 */ move $a1, $a3 -/* 09FF24 7F06B3F4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FF24 7F06B3F4 0FC1B198 */ jal modelFindNodeMtx /* 09FF28 7F06B3F8 8E240000 */ lw $a0, ($s1) /* 09FF2C 7F06B3FC C4460038 */ lwc1 $f6, 0x38($v0) /* 09FF30 7F06B400 C6080038 */ lwc1 $f8, 0x38($s0) @@ -611,7 +603,7 @@ glabel sub_GAME_7F06B29C .L7F06B428: /* 09FF58 7F06B428 8E240000 */ lw $a0, ($s1) /* 09FF5C 7F06B42C 02002825 */ move $a1, $s0 -/* 09FF60 7F06B430 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FF60 7F06B430 0FC1B198 */ jal modelFindNodeMtx /* 09FF64 7F06B434 00003025 */ move $a2, $zero /* 09FF68 7F06B438 C4440038 */ lwc1 $f4, 0x38($v0) /* 09FF6C 7F06B43C 46002187 */ neg.s $f6, $f4 @@ -620,7 +612,7 @@ glabel sub_GAME_7F06B29C .L7F06B448: /* 09FF78 7F06B448 8E240000 */ lw $a0, ($s1) /* 09FF7C 7F06B44C 02002825 */ move $a1, $s0 -/* 09FF80 7F06B450 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FF80 7F06B450 0FC1B198 */ jal modelFindNodeMtx /* 09FF84 7F06B454 00003025 */ move $a2, $zero /* 09FF88 7F06B458 8E030004 */ lw $v1, 4($s0) /* 09FF8C 7F06B45C C44A0008 */ lwc1 $f10, 8($v0) @@ -642,7 +634,7 @@ glabel sub_GAME_7F06B29C .L7F06B49C: /* 09FFCC 7F06B49C 8E240000 */ lw $a0, ($s1) /* 09FFD0 7F06B4A0 02002825 */ move $a1, $s0 -/* 09FFD4 7F06B4A4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 09FFD4 7F06B4A4 0FC1B198 */ jal modelFindNodeMtx /* 09FFD8 7F06B4A8 00003025 */ move $a2, $zero /* 09FFDC 7F06B4AC 8E030004 */ lw $v1, 4($s0) /* 09FFE0 7F06B4B0 C4420008 */ lwc1 $f2, 8($v0) @@ -681,7 +673,7 @@ glabel sub_GAME_7F06B29C .L7F06B530: /* 0A0060 7F06B530 8E240000 */ lw $a0, ($s1) /* 0A0064 7F06B534 02002825 */ move $a1, $s0 -/* 0A0068 7F06B538 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A0068 7F06B538 0FC1B198 */ jal modelFindNodeMtx /* 0A006C 7F06B53C 00003025 */ move $a2, $zero /* 0A0070 7F06B540 8E030004 */ lw $v1, 4($s0) /* 0A0074 7F06B544 C4460008 */ lwc1 $f6, 8($v0) @@ -704,7 +696,7 @@ glabel sub_GAME_7F06B29C .L7F06B588: /* 0A00B8 7F06B588 8E240000 */ lw $a0, ($s1) /* 0A00BC 7F06B58C 02002825 */ move $a1, $s0 -/* 0A00C0 7F06B590 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A00C0 7F06B590 0FC1B198 */ jal modelFindNodeMtx /* 0A00C4 7F06B594 00003025 */ move $a2, $zero /* 0A00C8 7F06B598 8E030004 */ lw $v1, 4($s0) /* 0A00CC 7F06B59C C4480008 */ lwc1 $f8, 8($v0) @@ -726,7 +718,7 @@ glabel sub_GAME_7F06B29C .L7F06B5DC: /* 0A010C 7F06B5DC 8E240000 */ lw $a0, ($s1) /* 0A0110 7F06B5E0 02002825 */ move $a1, $s0 -/* 0A0114 7F06B5E4 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A0114 7F06B5E4 0FC1B198 */ jal modelFindNodeMtx /* 0A0118 7F06B5E8 00003025 */ move $a2, $zero /* 0A011C 7F06B5EC 8E030004 */ lw $v1, 4($s0) /* 0A0120 7F06B5F0 C4440008 */ lwc1 $f4, 8($v0) @@ -748,7 +740,7 @@ glabel sub_GAME_7F06B29C .L7F06B630: /* 0A0160 7F06B630 8E240000 */ lw $a0, ($s1) /* 0A0164 7F06B634 02002825 */ move $a1, $s0 -/* 0A0168 7F06B638 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A0168 7F06B638 0FC1B198 */ jal modelFindNodeMtx /* 0A016C 7F06B63C 00003025 */ move $a2, $zero /* 0A0170 7F06B640 8E060004 */ lw $a2, 4($s0) /* 0A0174 7F06B644 8E240000 */ lw $a0, ($s1) @@ -810,7 +802,7 @@ glabel sub_GAME_7F06B29C /* 0A0248 7F06B718 AFA00078 */ sw $zero, 0x78($sp) /* 0A024C 7F06B71C AFA00074 */ sw $zero, 0x74($sp) /* 0A0250 7F06B720 AFA70080 */ sw $a3, 0x80($sp) -/* 0A0254 7F06B724 0FC1B198 */ jal sub_GAME_7F06C660 +/* 0A0254 7F06B724 0FC1B198 */ jal modelFindNodeMtx /* 0A0258 7F06B728 AFA8007C */ sw $t0, 0x7c($sp) /* 0A025C 7F06B72C 8FA30114 */ lw $v1, 0x114($sp) /* 0A0260 7F06B730 8FA70080 */ lw $a3, 0x80($sp) @@ -1173,6 +1165,15 @@ glabel sub_GAME_7F06BB28 +#if defined(LEFTOVERDEBUG) +// rodata +//D:80054420 +const char aDrawjointlistNoGfxlist[] = "drawjointlist: no gfxlist!\n"; +//D:8005443C +const char aDrawjointlistNoObject0xX[] = "drawjointlist: no object! (0x%X)\n"; +//D:80054460 +const char aDrawjointlistObjectNotInitialised0[] = "drawjointlist: object not initialised! (0x%X)\n"; +#endif #ifdef NONMATCHING void drawjointlist(void) { @@ -1670,19 +1671,19 @@ glabel probably_damage_detail_blood_effect_related /* 0A0AC0 7F06BF90 00008825 */ move $s1, $zero .L7F06BF94: /* 0A0AC4 7F06BF94 8E640000 */ lw $a0, ($s3) -/* 0A0AC8 7F06BF98 0FC1BA5C */ jal sub_GAME_7F06E970 +/* 0A0AC8 7F06BF98 0FC1BA5C */ jal modelApplyDistanceRelations /* 0A0ACC 7F06BF9C 02002825 */ move $a1, $s0 /* 0A0AD0 7F06BFA0 10000009 */ b .L7F06BFC8 /* 0A0AD4 7F06BFA4 00000000 */ nop .L7F06BFA8: /* 0A0AD8 7F06BFA8 8E640000 */ lw $a0, ($s3) -/* 0A0ADC 7F06BFAC 0FC1BA6F */ jal process_12_handle_switch +/* 0A0ADC 7F06BFAC 0FC1BA6F */ jal modelApplyToggleRelations /* 0A0AE0 7F06BFB0 02002825 */ move $a1, $s0 /* 0A0AE4 7F06BFB4 10000004 */ b .L7F06BFC8 /* 0A0AE8 7F06BFB8 00000000 */ nop .L7F06BFBC: /* 0A0AEC 7F06BFBC 8E640000 */ lw $a0, ($s3) -/* 0A0AF0 7F06BFC0 0FC1BA82 */ jal process_17_pointer_to_head +/* 0A0AF0 7F06BFC0 0FC1BA82 */ jal modelApplyHeadRelations /* 0A0AF4 7F06BFC4 02002825 */ move $a1, $s0 def_7F06BEEC: .L7F06BFC8: diff --git a/src/game/objecthandler.h b/src/game/objecthandler.h index d49b8268..2a34df9e 100644 --- a/src/game/objecthandler.h +++ b/src/game/objecthandler.h @@ -17,7 +17,7 @@ struct bondstruct_unk_op07_related { extern s32 g_ModelDistanceDisabled; extern f32 g_ModelDistanceScale; -extern u32 D_80036250; +extern u32 g_ModelAnimMergingEnabled; extern s32 D_80036410; extern struct bondstruct_unk_animation_related* D_80036414; extern s32 D_80036418; @@ -28,17 +28,17 @@ extern struct bondstruct_unk_op07_related D_800360C4[]; extern Vertex D_800363E0; // arg0 unknown pointer -void sub_GAME_7F070090(void *arg0, f32 arg1, f32 arg2); -void modelSetAnimRateForDuration(Model *, f32, f32); +void modelSetAnimFrame2(Model* model, f32 frame1, f32 frame2); +void modelSetAnimPlaySpeed(Model *, f32, f32); void sub_GAME_7F06FF5C(Model *model, s32 arg1); void modelSetScale(Model*, f32); void getsuboffset(Model *, coord3d *); -void sub_GAME_7F070AEC(Model *, s32, s32); +void modelTickAnimQuarterSpeed(Model *, s32, s32); void subcalcpos(Model *); void modelSetAnimEndFrame(Model *model, f32 endframe); -void sub_GAME_7F06F780(Model *, f32); -void sub_GAME_7F06F878(Model *, ModelAnimation *, s32, f32, f32, f32); +void modelCopyAnimForMerge(Model *, f32); +void modelSetAnimation2(Model *, ModelAnimation *, s32, f32, f32, f32); void modelSetAnimation(Model *, ModelAnimation *, s32, f32, f32, f32 duration); void modelSetAnimLooping(Model *, f32, f32); @@ -64,7 +64,7 @@ void fileLoad(ModelFileHeader *header,char *name); void load_object_into_memory_unused_maybe(ModelFileHeader *header,int *recallstring,int *targetloc,int sizeleft); void modelCalculateRwDataLen(ModelFileHeader *objheader); Model *get_aircraft_obj_instance_controller(ModelFileHeader *); -void sub_GAME_7F06C3B4(Model *, s32, ModelFileHeader *); +void modelAttachHead(Model *, ModelNode*, ModelFileHeader *); Mtxf *getsubmatrix(Model *objinst); // tentative signature @@ -77,29 +77,32 @@ void setsuboffset(Model *arg0, coord3d *arg1); PropRecord *chrGiveWeapon(ChrRecord *self, s32 PropID, ITEM_IDS ItemID, s32 flags); // tentative signature -Mtxf* sub_GAME_7F06C660(Model *arg0, ModelNode *arg1, s32 arg2); +Mtxf* modelFindNodeMtx(Model *arg0, ModelNode *arg1, s32 arg2); // called with struct ChrRecord->field_20 void sub_GAME_7F06B248(void *arg0); void drawjointlist(struct unk_joint_list *arg0, void* arg1); void sub_GAME_7F073FC8(s32); -void sub_GAME_7F0701D4(s32 arg0); -u32 sub_GAME_7F0701E0(void); +void modelSetAnimMergingEnabled(s32 arg0); +u32 modelIsAnimMergingEnabled(void); // arg0: unknown type. arg1: unknown type. arg5: unknown type, maybe struct. void sub_GAME_7F06D2E4(s32, s32, ModelSkeleton*, void* anim, s32, s16*); -void sub_GAME_7F075F68(struct Model *, struct ModelFileHeader *, u32 *); -void sub_GAME_7F075FAC(struct Model *, struct ModelFileHeader *, u32 *); +void modelInit(struct Model *, struct ModelFileHeader *, u32 *); +void animInit(struct Model *, struct ModelFileHeader *, u32 *); void modelSetAnimFlipFunction(Model *, void *); void subcalcmatrices(struct unk_joint_list *, Model *); void instcalcmatrices(struct unk_joint_list *arg0, Model *arg1); -void load_object_fill_header(struct ModelFileHeader *objheader, u8 *name, void *targetloc, s32 sizeleft, s32 buffer); +void load_object_fill_header(struct ModelFileHeader *objheader, u8 *name, void *targetloc, s32 sizeleft, struct texpool * buffer); void* get_obj_instance_controller_for_header(struct ModelFileHeader* arg0); -void subdraw(s32 arg0, struct Model *); +void subdraw(struct unk_joint_list *arg0, struct Model *); void sub_GAME_7F06EFC4(struct Model *); -void sub_GAME_7F076030(Model *pmodel, ModelFileHeader *pmodeldef, ModelNode *pnode, ModelFileHeader *cmodeldef); +void modelAttachPart(Model *pmodel, ModelFileHeader *pmodeldef, ModelNode *pnode, ModelFileHeader *cmodeldef); void modelInitRwData(Model *model, ModelNode *startnode); +void modelApplyDistanceRelations(Model* model, ModelNode* node); +void modelApplyHeadRelations(Model* model, ModelNode* bodynode); +void modelApplyToggleRelations(Model* model, ModelNode* node); #ifndef VERSION_EU void return_null(void); diff --git a/src/game/objecthandler_2.c b/src/game/objecthandler_2.c index 1199cdfe..48ebaa94 100644 --- a/src/game/objecthandler_2.c +++ b/src/game/objecthandler_2.c @@ -5,7 +5,7 @@ #include "math_asinfacosf.h" #include "math_unk_05A9E0.h" #include "chrobjdata.h" - +#include "ob.h" //file split per EU #ifdef NONMATCHING @@ -32,7 +32,7 @@ glabel sub_GAME_7F0762E0 /* 0AAE44 7F076314 8C8E0008 */ lw $t6, 8($a0) /* 0AAE48 7F076318 0080A825 */ move $s5, $a0 /* 0AAE4C 7F07631C 00A02025 */ move $a0, $a1 -/* 0AAE50 7F076320 0FC2F495 */ jal get_index_num_of_named_resource +/* 0AAE50 7F076320 0FC2F495 */ jal fileGetIndex /* 0AAE54 7F076324 AFAE0054 */ sw $t6, 0x54($sp) /* 0AAE58 7F076328 AFA20050 */ sw $v0, 0x50($sp) /* 0AAE5C 7F07632C 0FC2F447 */ jal get_rom_remaining_buffer_for_index @@ -119,7 +119,7 @@ glabel sub_GAME_7F0762E0 /* 0AAF90 7F076460 2CEE0001 */ sltiu $t6, $a3, 1 /* 0AAF94 7F076464 01C03825 */ move $a3, $t6 /* 0AAF98 7F076468 01A03025 */ move $a2, $t5 -/* 0AAF9C 7F07646C 0FC2F44E */ jal sub_GAME_7F0BD138 +/* 0AAF9C 7F07646C 0FC2F44E */ jal fileSetSize /* 0AAFA0 7F076470 8FA40050 */ lw $a0, 0x50($sp) .L7F076474: /* 0AAFA4 7F076474 8FBF003C */ lw $ra, 0x3c($sp) @@ -142,24 +142,24 @@ glabel sub_GAME_7F0762E0 #ifdef NONMATCHING -void load_object_fill_header(struct ModelFileHeader *objheader, s8 *name, s32 targetloc, s32 sizeleft, s32 buffer) +void load_object_fill_header(struct ModelFileHeader *objheader, s8 *name, u8* dst, s32 size, struct texpool * buffer) { - struct ModelNode **phi_v0; + struct ModelNode *filedata; - if (targetloc != 0) + if (dst != 0) { - phi_v0 = _load_resource_named_to_buffer(name, 0, targetloc, sizeleft); + filedata = _fileNameLoadToAddr(name, 0, dst, size); } else { - phi_v0 = _load_resource_named_to_membank(name, 0, 0x100, 4); + filedata = _fileNameLoadToBank(name, 0, 0x100, 4); } - objheader->Switches = phi_v0; - objheader->Textures = &phi_v0[objheader->numSwitches]; - objheader->RootNode = objheader->Textures + (objheader->numtextures * 0xC); - sub_GAME_7F075A90(objheader, 0x5000000, phi_v0); - sub_GAME_7F0762E0(objheader, name, targetloc, buffer); + objheader->Switches = filedata; + objheader->Textures = &filedata[objheader->numSwitches]; + objheader->RootNode = objheader->Textures[objheader->numtextures]; + sub_GAME_7F075A90(objheader, 0x5000000, filedata); + sub_GAME_7F0762E0(objheader, name, dst, buffer); } #else @@ -174,7 +174,7 @@ glabel load_object_fill_header /* 0AAFE8 7F0764B8 10C00006 */ beqz $a2, .L7F0764D4 /* 0AAFEC 7F0764BC AFA60028 */ sw $a2, 0x28($sp) /* 0AAFF0 7F0764C0 00A02025 */ move $a0, $a1 -/* 0AAFF4 7F0764C4 0FC2F350 */ jal _load_resource_named_to_buffer +/* 0AAFF4 7F0764C4 0FC2F350 */ jal _fileNameLoadToAddr /* 0AAFF8 7F0764C8 00002825 */ move $a1, $zero /* 0AAFFC 7F0764CC 10000007 */ b .L7F0764EC /* 0AB000 7F0764D0 00403025 */ move $a2, $v0 @@ -182,7 +182,7 @@ glabel load_object_fill_header /* 0AB004 7F0764D4 8FA40024 */ lw $a0, 0x24($sp) /* 0AB008 7F0764D8 00002825 */ move $a1, $zero /* 0AB00C 7F0764DC 24060100 */ li $a2, 256 -/* 0AB010 7F0764E0 0FC2F341 */ jal _load_resource_named_to_membank +/* 0AB010 7F0764E0 0FC2F341 */ jal _fileNameLoadToBank /* 0AB014 7F0764E4 24070004 */ li $a3, 4 /* 0AB018 7F0764E8 00403025 */ move $a2, $v0 .L7F0764EC: diff --git a/src/game/objective.c b/src/game/objective.c index 23a9f487..6575e174 100644 --- a/src/game/objective.c +++ b/src/game/objective.c @@ -7,21 +7,22 @@ #ifdef NONMATCHING //CODE.bss:80075D30 -extern struct objective_entry *objective_ptrs[10]; -extern OBJECTIVESTATUS dword_CODE_bss_80075D58[10]; //This is an array of 10 OBJECTIVESTATUS, +extern struct objective_entry *objective_ptrs[OBJECTIVES_MAX]; +extern OBJECTIVESTATUS dword_CODE_bss_80075D58[OBJECTIVES_MAX]; //This is an array of 10 OBJECTIVESTATUS, //CODE.bss:80075D80 extern u32 *ptr_last_tag_entry_type16; //CODE.bss:80075D84 extern u32 *ptr_last_briefing_setup_entry_type23; //CODE.bss:80075D88 -extern u32 *ptr_last_enter_room_subobject_entry_type20; +struct criteria_roomentered *ptr_last_enter_room_subobject_entry_type20; //CODE.bss:80075D8C -extern u32 *ptr_last_deposit_in_room_subobject_entry_type21; +extern struct criteria_deposit *ptr_last_deposit_in_room_subobject_entry_type21; //CODE.bss:80075D90 extern u32 *ptr_last_photo_obj_in_room_subobject_entry_type1E; // data -extern s32 num_objective_ptrs[]; +extern s32 objective_count; +extern s32 objective_count_related; /* * Clears Objectives and states * Note: this matches in everthing except that calling the var "dword_CODE_bss_80075D58" @@ -35,7 +36,7 @@ void something_with_stage_objectives() //#99% MATCH if (bossGetStageNum() != LEVELID_TITLE) { - num_objective_ptrs[0] = -1; + objective_count = -1; //dword_CODE_bss_80075D58 = NULL; //dword_CODE_bss_80075D58+4 = NULL; //*dword_CODE_bss_80075D58+8 = *clear2; @@ -69,8 +70,8 @@ glabel something_with_stage_objectives /* 039A00 7F004ED0 2401005A */ li $at, 90 /* 039A04 7F004ED4 10410011 */ beq $v0, $at, .L7F004F1C /* 039A08 7F004ED8 240EFFFF */ li $t6, -1 -/* 039A0C 7F004EDC 3C018003 */ lui $at, %hi(num_objective_ptrs) -/* 039A10 7F004EE0 AC2E22F0 */ sw $t6, %lo(num_objective_ptrs)($at) +/* 039A0C 7F004EDC 3C018003 */ lui $at, %hi(objective_count) +/* 039A10 7F004EE0 AC2E22F0 */ sw $t6, %lo(objective_count)($at) /* 039A14 7F004EE4 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58) /* 039A18 7F004EE8 AC205D58 */ sw $zero, %lo(dword_CODE_bss_80075D58)($at) /* 039A1C 7F004EEC 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58+4) @@ -129,8 +130,8 @@ glabel something_with_stage_objectives /* 039A50 7F004EE0 2401005A */ li $at, 90 /* 039A54 7F004EE4 10410011 */ beq $v0, $at, .L7F004F2C /* 039A58 7F004EE8 240EFFFF */ li $t6, -1 -/* 039A5C 7F004EEC 3C018003 */ lui $at, %hi(num_objective_ptrs) # $at, 0x8003 -/* 039A60 7F004EF0 AC2E2330 */ sw $t6, %lo(num_objective_ptrs)($at) +/* 039A5C 7F004EEC 3C018003 */ lui $at, %hi(objective_count) # $at, 0x8003 +/* 039A60 7F004EF0 AC2E2330 */ sw $t6, %lo(objective_count)($at) /* 039A64 7F004EF4 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58) # $at, 0x8007 /* 039A68 7F004EF8 AC205D98 */ sw $zero, %lo(dword_CODE_bss_80075D58)($at) /* 039A6C 7F004EFC 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58+4) # $at, 0x8007 @@ -147,8 +148,8 @@ glabel something_with_stage_objectives /* 039A94 7F004F24 1443FFFB */ bne $v0, $v1, .L7F004F14 /* 039A98 7F004F28 AC40FFF0 */ sw $zero, -0x10($v0) .L7F004F2C: -/* 039A9C 7F004F2C 3C018003 */ lui $at, %hi(num_objective_ptrs+4) # $at, 0x8003 -/* 039AA0 7F004F30 AC202334 */ sw $zero, %lo(num_objective_ptrs+4)($at) +/* 039A9C 7F004F2C 3C018003 */ lui $at, %hi(objective_count+4) # $at, 0x8003 +/* 039AA0 7F004F30 AC202334 */ sw $zero, %lo(objective_count+4)($at) /* 039AA4 7F004F34 3C018007 */ lui $at, %hi(objective_ptrs) # $at, 0x8007 /* 039AA8 7F004F38 AC205D70 */ sw $zero, %lo(objective_ptrs)($at) /* 039AAC 7F004F3C 3C018007 */ lui $at, %hi(objective_ptrs+4) # $at, 0x8007 @@ -191,8 +192,8 @@ glabel something_with_stage_objectives /* 039A50 7F004EE0 2401005A */ li $at, 90 /* 039A54 7F004EE4 10410011 */ beq $v0, $at, .L7F004F2C /* 039A58 7F004EE8 240EFFFF */ li $t6, -1 -/* 039A5C 7F004EEC 3C018003 */ lui $at, %hi(num_objective_ptrs) # $at, 0x8003 -/* 039A60 7F004EF0 AC2E2330 */ sw $t6, %lo(num_objective_ptrs)($at) +/* 039A5C 7F004EEC 3C018003 */ lui $at, %hi(objective_count) # $at, 0x8003 +/* 039A60 7F004EF0 AC2E2330 */ sw $t6, %lo(objective_count)($at) /* 039A64 7F004EF4 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58) # $at, 0x8007 /* 039A68 7F004EF8 AC205D98 */ sw $zero, %lo(dword_CODE_bss_80075D58)($at) /* 039A6C 7F004EFC 3C018007 */ lui $at, %hi(dword_CODE_bss_80075D58+4) # $at, 0x8007 @@ -209,8 +210,8 @@ glabel something_with_stage_objectives /* 039A94 7F004F24 1443FFFB */ bne $v0, $v1, .L7F004F14 /* 039A98 7F004F28 AC40FFF0 */ sw $zero, -0x10($v0) .L7F004F2C: -/* 039A9C 7F004F2C 3C018003 */ lui $at, %hi(num_objective_ptrs+4) # $at, 0x8003 -/* 039AA0 7F004F30 AC202334 */ sw $zero, %lo(num_objective_ptrs+4)($at) +/* 039A9C 7F004F2C 3C018003 */ lui $at, %hi(objective_count+4) # $at, 0x8003 +/* 039AA0 7F004F30 AC202334 */ sw $zero, %lo(objective_count+4)($at) /* 039AA4 7F004F34 3C018007 */ lui $at, %hi(objective_ptrs) # $at, 0x8007 /* 039AA8 7F004F38 AC205D70 */ sw $zero, %lo(objective_ptrs)($at) /* 039AAC 7F004F3C 3C018007 */ lui $at, %hi(objective_ptrs+4) # $at, 0x8007 @@ -291,43 +292,16 @@ glabel setup_briefing_text_entry_parent #endif -#ifdef NONMATCHING -s32 add_ptr_to_objective(void *arg0) { - // Node 0 - (0x80070000 + (arg0->unk4 * 4))->unk5D30 = arg0; - if (num_objective_ptrs < arg0->unk4) +void add_ptr_to_objective(struct objective_entry* objective) +{ + objective_ptrs[objective->menu] = objective; + + if (objective_count < objective->menu) { - // Node 1 - num_objective_ptrs = (s32) arg0->unk4; - return; - // (possible return value: arg0->unk4) + objective_count = objective->menu; } - // (possible return value: arg0->unk4) } -#else -GLOBAL_ASM( -.text -glabel add_ptr_to_objective -/* 039AE8 7F004FB8 8C8E0004 */ lw $t6, 4($a0) -/* 039AEC 7F004FBC 3C018007 */ lui $at, %hi(objective_ptrs) -/* 039AF0 7F004FC0 3C038003 */ lui $v1, %hi(num_objective_ptrs) -/* 039AF4 7F004FC4 000E7880 */ sll $t7, $t6, 2 -/* 039AF8 7F004FC8 002F0821 */ addu $at, $at, $t7 -/* 039AFC 7F004FCC AC245D30 */ sw $a0, %lo(objective_ptrs)($at) -/* 039B00 7F004FD0 246322F0 */ addiu $v1, %lo(num_objective_ptrs) # addiu $v1, $v1, 0x22f0 -/* 039B04 7F004FD4 8C780000 */ lw $t8, ($v1) -/* 039B08 7F004FD8 8C820004 */ lw $v0, 4($a0) -/* 039B0C 7F004FDC 0302082A */ slt $at, $t8, $v0 -/* 039B10 7F004FE0 10200002 */ beqz $at, .L7F004FEC -/* 039B14 7F004FE4 00000000 */ nop -/* 039B18 7F004FE8 AC620000 */ sw $v0, ($v1) -.L7F004FEC: -/* 039B1C 7F004FEC 03E00008 */ jr $ra -/* 039B20 7F004FF0 00000000 */ nop -) -#endif - #ifdef NONMATCHING void *set_parent_cur_obj_enter_room(void *arg0) { diff --git a/src/game/objective_status.c b/src/game/objective_status.c index f330c94a..58334ab3 100644 --- a/src/game/objective_status.c +++ b/src/game/objective_status.c @@ -2,6 +2,11 @@ #include #include #include "objective_status.h" +#include "assets/obseg/text/LmiscE.h" +#include "lvl_text.h" +#include "PR/os.h" +#include "str.h" +#include "bondview.h" //Public variables - move to header // bss @@ -14,23 +19,15 @@ u32 *ptr_last_tag_entry_type16; //CODE.bss:80075D84 struct watchMenuObjectiveText *ptr_last_briefing_setup_entry_type23; //CODE.bss:80075D88 -u32 *ptr_last_enter_room_subobject_entry_type20; +struct criteria_roomentered *ptr_last_enter_room_subobject_entry_type20; //CODE.bss:80075D8C -u32 *ptr_last_deposit_in_room_subobject_entry_type21; +struct criteria_deposit *ptr_last_deposit_in_room_subobject_entry_type21; //CODE.bss:80075D90 u32 *ptr_last_photo_obj_in_room_subobject_entry_type1E; // data -s32 num_objective_ptrs[] = {0xFFFFFFFF, 0}; - - - -// rodata -const u32 D_80053610[] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; -//D:80053644 -const u32 aSAC[] = {0x25732080, 0x25632000}; -//D:8005364C -const char aSC[] = "%s %c: "; +s32 objective_count = 0xFFFFFFFF; +s32 objective_count_related = 0; @@ -98,15 +95,15 @@ u8 * get_ptr_text_for_watch_breifing_page(WATCH_BRIEFING_PAGE page) { if (page == 0) { - textptr = langGet(TEXT(LMISC, 0x29)); //"E R R O R\n" + textptr = langGet(TEXT(LMISC, MISC_STR_29)); //"E R R O R\n" } else if (page == 1) { - textptr = langGet(TEXT(LMISC, 0x2a)); //"no briefing for this mission\n" + textptr = langGet(TEXT(LMISC, MISC_STR_2A)); //"no briefing for this mission\n" } else { - textptr = langGet(TEXT(LMISC, 0x2b)); //"\n" + textptr = langGet(TEXT(LMISC, MISC_STR_2B)); //"\n" } } @@ -118,30 +115,30 @@ u8 * get_ptr_text_for_watch_breifing_page(WATCH_BRIEFING_PAGE page) //objectiveGetCount s32 objectiveGetCount(void) { - return num_objective_ptrs[0]+1; + return objective_count + 1; } -u8 * get_text_for_objective(int objective) +u8 * get_text_for_objective(int objectiveIndex) { u8 *textptr; - if ((objective < 10) && (objective_ptrs[objective] != 0)) { - return langGet(objective_ptrs[objective]->text); + if ((objectiveIndex < 10) && (objective_ptrs[objectiveIndex] != 0)) { + return langGet(objective_ptrs[objectiveIndex]->text); } return 0; } -s8 get_difficulty_for_objective(s32 objective) +s32 get_difficulty_for_objective(s32 objectiveIndex) { struct objective_entry * entry; - if (objective < OBJECTIVES_MAX) + if (objectiveIndex < OBJECTIVES_MAX) { - entry = objective_ptrs[objective]; + entry = objective_ptrs[objectiveIndex]; if (entry != NULL) { return entry->difficulty; @@ -332,597 +329,128 @@ bool objectiveIsAllComplete(void) #ifdef BUGFIX_R1 void FUN_7f057a40(void) { - num_objective_ptrs[1] = 1; + objective_count_related = 1; return; } #endif -#ifdef NONMATCHING -void display_objective_status_text_on_status_change(void) { -} -#else +void display_objective_status_text_on_status_change(void) { + s32 i; + s32 availableindex = 0; + char buffer[50] = ""; + enum OBJECTIVESTATUS status; -#ifdef VERSION_US -GLOBAL_ASM( -.rdata -/*glabel D_80053610*/ -/*.word 0,0,0,0,0,0,0,0,0,0*/ -/*glabel D_80053640*/ -/*.word 0*/ -.text -glabel display_objective_status_text_on_status_change -/* 08C070 7F057540 27BDFF70 */ addiu $sp, $sp, -0x90 -/* 08C074 7F057544 AFB60030 */ sw $s6, 0x30($sp) -/* 08C078 7F057548 AFB30024 */ sw $s3, 0x24($sp) -/* 08C07C 7F05754C 3C0E8005 */ lui $t6, %hi(D_80053610) -/* 08C080 7F057550 27B30054 */ addiu $s3, $sp, 0x54 -/* 08C084 7F057554 3C168003 */ lui $s6, %hi(num_objective_ptrs) -/* 08C088 7F057558 AFB40028 */ sw $s4, 0x28($sp) -/* 08C08C 7F05755C 25CE3610 */ addiu $t6, %lo(D_80053610) # addiu $t6, $t6, 0x3610 -/* 08C090 7F057560 26D622F0 */ addiu $s6, %lo(num_objective_ptrs) # addiu $s6, $s6, 0x22f0 -/* 08C094 7F057564 AFBF003C */ sw $ra, 0x3c($sp) -/* 08C098 7F057568 AFBE0038 */ sw $fp, 0x38($sp) -/* 08C09C 7F05756C AFB70034 */ sw $s7, 0x34($sp) -/* 08C0A0 7F057570 AFB5002C */ sw $s5, 0x2c($sp) -/* 08C0A4 7F057574 AFB20020 */ sw $s2, 0x20($sp) -/* 08C0A8 7F057578 AFB1001C */ sw $s1, 0x1c($sp) -/* 08C0AC 7F05757C AFB00018 */ sw $s0, 0x18($sp) -/* 08C0B0 7F057580 0000A025 */ move $s4, $zero -/* 08C0B4 7F057584 25D90030 */ addiu $t9, $t6, 0x30 -/* 08C0B8 7F057588 02604025 */ move $t0, $s3 -.L7F05758C: -/* 08C0BC 7F05758C 8DC10000 */ lw $at, ($t6) -/* 08C0C0 7F057590 25CE000C */ addiu $t6, $t6, 0xc -/* 08C0C4 7F057594 2508000C */ addiu $t0, $t0, 0xc -/* 08C0C8 7F057598 AD01FFF4 */ sw $at, -0xc($t0) -/* 08C0CC 7F05759C 8DC1FFF8 */ lw $at, -8($t6) -/* 08C0D0 7F0575A0 AD01FFF8 */ sw $at, -8($t0) -/* 08C0D4 7F0575A4 8DC1FFFC */ lw $at, -4($t6) -/* 08C0D8 7F0575A8 15D9FFF8 */ bne $t6, $t9, .L7F05758C -/* 08C0DC 7F0575AC AD01FFFC */ sw $at, -4($t0) -/* 08C0E0 7F0575B0 95C10000 */ lhu $at, ($t6) -/* 08C0E4 7F0575B4 3C158007 */ lui $s5, %hi(dword_CODE_bss_80075D58) -/* 08C0E8 7F0575B8 3C1E8005 */ lui $fp, %hi(aSAC) -/* 08C0EC 7F0575BC A5010000 */ sh $at, ($t0) -/* 08C0F0 7F0575C0 8EC90000 */ lw $t1, ($s6) -/* 08C0F4 7F0575C4 27DE3644 */ addiu $fp, %lo(aSAC) # addiu $fp, $fp, 0x3644 -/* 08C0F8 7F0575C8 26B55D58 */ addiu $s5, %lo(dword_CODE_bss_80075D58) # addiu $s5, $s5, 0x5d58 -/* 08C0FC 7F0575CC 05200051 */ bltz $t1, .L7F057714 -/* 08C100 7F0575D0 00009025 */ move $s2, $zero -/* 08C104 7F0575D4 3C178005 */ lui $s7, %hi(j_text_trigger) -/* 08C108 7F0575D8 26F784D0 */ addiu $s7, %lo(j_text_trigger) # addiu $s7, $s7, -0x7b30 -.L7F0575DC: -/* 08C10C 7F0575DC 0FC15C8E */ jal get_status_of_objective -/* 08C110 7F0575E0 02402025 */ move $a0, $s2 -/* 08C114 7F0575E4 8EAA0000 */ lw $t2, ($s5) -/* 08C118 7F0575E8 00408825 */ move $s1, $v0 -/* 08C11C 7F0575EC 02402025 */ move $a0, $s2 -/* 08C120 7F0575F0 104A003A */ beq $v0, $t2, .L7F0576DC -/* 08C124 7F0575F4 00000000 */ nop -/* 08C128 7F0575F8 0FC15C81 */ jal get_difficulty_for_objective -/* 08C12C 7F0575FC AEA20000 */ sw $v0, ($s5) -/* 08C130 7F057600 0FC2FF04 */ jal lvlGetSelectedDifficulty -/* 08C134 7F057604 00408025 */ move $s0, $v0 -/* 08C138 7F057608 0050082A */ slt $at, $v0, $s0 -/* 08C13C 7F05760C 14200033 */ bnez $at, .L7F0576DC -/* 08C140 7F057610 00000000 */ nop -/* 08C144 7F057614 8EEB0000 */ lw $t3, ($s7) -/* 08C148 7F057618 2690001A */ addiu $s0, $s4, 0x1a -/* 08C14C 7F05761C 3404B02C */ li $a0, 45100 -/* 08C150 7F057620 1160000A */ beqz $t3, .L7F05764C -/* 08C154 7F057624 00000000 */ nop -/* 08C158 7F057628 0FC30776 */ jal langGet -/* 08C15C 7F05762C 3404B02C */ li $a0, 45100 -/* 08C160 7F057630 02602025 */ move $a0, $s3 -/* 08C164 7F057634 03C02825 */ move $a1, $fp -/* 08C168 7F057638 00403025 */ move $a2, $v0 -/* 08C16C 7F05763C 0C002B25 */ jal sprintf -/* 08C170 7F057640 02003825 */ move $a3, $s0 -/* 08C174 7F057644 1000000A */ b .L7F057670 -/* 08C178 7F057648 24010001 */ li $at, 1 -.L7F05764C: -/* 08C17C 7F05764C 0FC30776 */ jal langGet -/* 08C180 7F057650 26900061 */ addiu $s0, $s4, 0x61 -/* 08C184 7F057654 3C058005 */ lui $a1, %hi(aSC) -/* 08C188 7F057658 24A5364C */ addiu $a1, %lo(aSC) # addiu $a1, $a1, 0x364c -/* 08C18C 7F05765C 02602025 */ move $a0, $s3 -/* 08C190 7F057660 00403025 */ move $a2, $v0 -/* 08C194 7F057664 0C002B25 */ jal sprintf -/* 08C198 7F057668 02003825 */ move $a3, $s0 -/* 08C19C 7F05766C 24010001 */ li $at, 1 -.L7F057670: -/* 08C1A0 7F057670 16210008 */ bne $s1, $at, .L7F057694 -/* 08C1A4 7F057674 00000000 */ nop -/* 08C1A8 7F057678 0FC30776 */ jal langGet -/* 08C1AC 7F05767C 3404B02D */ li $a0, 45101 -/* 08C1B0 7F057680 02602025 */ move $a0, $s3 -/* 08C1B4 7F057684 0C0029FF */ jal strcat -/* 08C1B8 7F057688 00402825 */ move $a1, $v0 -/* 08C1BC 7F05768C 10000011 */ b .L7F0576D4 -/* 08C1C0 7F057690 00000000 */ nop -.L7F057694: -/* 08C1C4 7F057694 16200008 */ bnez $s1, .L7F0576B8 -/* 08C1C8 7F057698 24010002 */ li $at, 2 -/* 08C1CC 7F05769C 0FC30776 */ jal langGet -/* 08C1D0 7F0576A0 3404B02E */ li $a0, 45102 -/* 08C1D4 7F0576A4 02602025 */ move $a0, $s3 -/* 08C1D8 7F0576A8 0C0029FF */ jal strcat -/* 08C1DC 7F0576AC 00402825 */ move $a1, $v0 -/* 08C1E0 7F0576B0 10000008 */ b .L7F0576D4 -/* 08C1E4 7F0576B4 00000000 */ nop -.L7F0576B8: -/* 08C1E8 7F0576B8 16210006 */ bne $s1, $at, .L7F0576D4 -/* 08C1EC 7F0576BC 00000000 */ nop -/* 08C1F0 7F0576C0 0FC30776 */ jal langGet -/* 08C1F4 7F0576C4 3404B02F */ li $a0, 45103 -/* 08C1F8 7F0576C8 02602025 */ move $a0, $s3 -/* 08C1FC 7F0576CC 0C0029FF */ jal strcat -/* 08C200 7F0576D0 00402825 */ move $a1, $v0 -.L7F0576D4: -/* 08C204 7F0576D4 0FC228F2 */ jal hudmsgBottomShow -/* 08C208 7F0576D8 02602025 */ move $a0, $s3 -.L7F0576DC: -/* 08C20C 7F0576DC 0FC15C81 */ jal get_difficulty_for_objective -/* 08C210 7F0576E0 02402025 */ move $a0, $s2 -/* 08C214 7F0576E4 0FC2FF04 */ jal lvlGetSelectedDifficulty -/* 08C218 7F0576E8 00408025 */ move $s0, $v0 -/* 08C21C 7F0576EC 0050082A */ slt $at, $v0, $s0 -/* 08C220 7F0576F0 54200003 */ bnezl $at, .L7F057700 -/* 08C224 7F0576F4 8ECC0000 */ lw $t4, ($s6) -/* 08C228 7F0576F8 26940001 */ addiu $s4, $s4, 1 -/* 08C22C 7F0576FC 8ECC0000 */ lw $t4, ($s6) -.L7F057700: -/* 08C230 7F057700 26520001 */ addiu $s2, $s2, 1 -/* 08C234 7F057704 26B50004 */ addiu $s5, $s5, 4 -/* 08C238 7F057708 0192082A */ slt $at, $t4, $s2 -/* 08C23C 7F05770C 1020FFB3 */ beqz $at, .L7F0575DC -/* 08C240 7F057710 00000000 */ nop -.L7F057714: -/* 08C244 7F057714 8FBF003C */ lw $ra, 0x3c($sp) -/* 08C248 7F057718 8FB00018 */ lw $s0, 0x18($sp) -/* 08C24C 7F05771C 8FB1001C */ lw $s1, 0x1c($sp) -/* 08C250 7F057720 8FB20020 */ lw $s2, 0x20($sp) -/* 08C254 7F057724 8FB30024 */ lw $s3, 0x24($sp) -/* 08C258 7F057728 8FB40028 */ lw $s4, 0x28($sp) -/* 08C25C 7F05772C 8FB5002C */ lw $s5, 0x2c($sp) -/* 08C260 7F057730 8FB60030 */ lw $s6, 0x30($sp) -/* 08C264 7F057734 8FB70034 */ lw $s7, 0x34($sp) -/* 08C268 7F057738 8FBE0038 */ lw $fp, 0x38($sp) -/* 08C26C 7F05773C 03E00008 */ jr $ra -/* 08C270 7F057740 27BD0090 */ addiu $sp, $sp, 0x90 -) +#ifdef BUGFIX_R1 + if (objective_count_related != 0) { return; } #endif -#ifdef VERSION_JP -GLOBAL_ASM( -.text -glabel display_objective_status_text_on_status_change -/* 08C5C0 7F057A50 27BDFF70 */ addiu $sp, $sp, -0x90 -/* 08C5C4 7F057A54 AFB30024 */ sw $s3, 0x24($sp) -/* 08C5C8 7F057A58 3C0E8005 */ lui $t6, %hi(D_80053610) # $t6, 0x8005 -/* 08C5CC 7F057A5C 27B30054 */ addiu $s3, $sp, 0x54 -/* 08C5D0 7F057A60 AFB5002C */ sw $s5, 0x2c($sp) -/* 08C5D4 7F057A64 25CE3640 */ addiu $t6, %lo(D_80053610) # addiu $t6, $t6, 0x3640 -/* 08C5D8 7F057A68 AFBF003C */ sw $ra, 0x3c($sp) -/* 08C5DC 7F057A6C AFBE0038 */ sw $fp, 0x38($sp) -/* 08C5E0 7F057A70 AFB70034 */ sw $s7, 0x34($sp) -/* 08C5E4 7F057A74 AFB60030 */ sw $s6, 0x30($sp) -/* 08C5E8 7F057A78 AFB40028 */ sw $s4, 0x28($sp) -/* 08C5EC 7F057A7C AFB20020 */ sw $s2, 0x20($sp) -/* 08C5F0 7F057A80 AFB1001C */ sw $s1, 0x1c($sp) -/* 08C5F4 7F057A84 AFB00018 */ sw $s0, 0x18($sp) -/* 08C5F8 7F057A88 0000A825 */ move $s5, $zero -/* 08C5FC 7F057A8C 25D90030 */ addiu $t9, $t6, 0x30 -/* 08C600 7F057A90 02604025 */ move $t0, $s3 -.L7F057A94: -/* 08C604 7F057A94 8DC10000 */ lw $at, ($t6) -/* 08C608 7F057A98 25CE000C */ addiu $t6, $t6, 0xc -/* 08C60C 7F057A9C 2508000C */ addiu $t0, $t0, 0xc -/* 08C610 7F057AA0 AD01FFF4 */ sw $at, -0xc($t0) -/* 08C614 7F057AA4 8DC1FFF8 */ lw $at, -8($t6) -/* 08C618 7F057AA8 AD01FFF8 */ sw $at, -8($t0) -/* 08C61C 7F057AAC 8DC1FFFC */ lw $at, -4($t6) -/* 08C620 7F057AB0 15D9FFF8 */ bne $t6, $t9, .L7F057A94 -/* 08C624 7F057AB4 AD01FFFC */ sw $at, -4($t0) -/* 08C628 7F057AB8 95C10000 */ lhu $at, ($t6) -/* 08C62C 7F057ABC 3C098003 */ lui $t1, %hi(num_objective_ptrs+4) # $t1, 0x8003 -/* 08C630 7F057AC0 3C168003 */ lui $s6, %hi(num_objective_ptrs) # $s6, 0x8003 -/* 08C634 7F057AC4 A5010000 */ sh $at, ($t0) -/* 08C638 7F057AC8 8D292334 */ lw $t1, %lo(num_objective_ptrs+4)($t1) -/* 08C63C 7F057ACC 26D62330 */ addiu $s6, %lo(num_objective_ptrs) # addiu $s6, $s6, 0x2330 -/* 08C640 7F057AD0 55200058 */ bnezl $t1, .L7F057C34 -/* 08C644 7F057AD4 8FBF003C */ lw $ra, 0x3c($sp) -/* 08C648 7F057AD8 8ECA0000 */ lw $t2, ($s6) -/* 08C64C 7F057ADC 3C148007 */ lui $s4, %hi(dword_CODE_bss_80075D58) # $s4, 0x8007 -/* 08C650 7F057AE0 26945D98 */ addiu $s4, %lo(dword_CODE_bss_80075D58) # addiu $s4, $s4, 0x5d98 -/* 08C654 7F057AE4 05400052 */ bltz $t2, .L7F057C30 -/* 08C658 7F057AE8 00009025 */ move $s2, $zero -/* 08C65C 7F057AEC 3C178005 */ lui $s7, %hi(j_text_trigger) # $s7, 0x8005 -/* 08C660 7F057AF0 26F78500 */ addiu $s7, %lo(j_text_trigger) # addiu $s7, $s7, -0x7b00 -/* 08C664 7F057AF4 241E0001 */ li $fp, 1 -.L7F057AF8: -/* 08C668 7F057AF8 0FC15DCE */ jal get_status_of_objective -/* 08C66C 7F057AFC 02402025 */ move $a0, $s2 -/* 08C670 7F057B00 8E8B0000 */ lw $t3, ($s4) -/* 08C674 7F057B04 00408825 */ move $s1, $v0 -/* 08C678 7F057B08 02402025 */ move $a0, $s2 -/* 08C67C 7F057B0C 104B003A */ beq $v0, $t3, .L7F057BF8 -/* 08C680 7F057B10 00000000 */ nop -/* 08C684 7F057B14 0FC15DC1 */ jal get_difficulty_for_objective -/* 08C688 7F057B18 AE820000 */ sw $v0, ($s4) -/* 08C68C 7F057B1C 0FC3021E */ jal lvlGetSelectedDifficulty -/* 08C690 7F057B20 00408025 */ move $s0, $v0 -/* 08C694 7F057B24 0050082A */ slt $at, $v0, $s0 -/* 08C698 7F057B28 14200033 */ bnez $at, .L7F057BF8 -/* 08C69C 7F057B2C 00000000 */ nop -/* 08C6A0 7F057B30 8EEC0000 */ lw $t4, ($s7) -/* 08C6A4 7F057B34 26B0001A */ addiu $s0, $s5, 0x1a -/* 08C6A8 7F057B38 3404B02C */ li $a0, 45100 -/* 08C6AC 7F057B3C 1180000B */ beqz $t4, .L7F057B6C -/* 08C6B0 7F057B40 00000000 */ nop -/* 08C6B4 7F057B44 0FC30AA2 */ jal langGet -/* 08C6B8 7F057B48 3404B02C */ li $a0, 45100 -/* 08C6BC 7F057B4C 3C058005 */ lui $a1, %hi(aSAC) # $a1, 0x8005 -/* 08C6C0 7F057B50 24A53674 */ addiu $a1, %lo(aSAC) # addiu $a1, $a1, 0x3674 -/* 08C6C4 7F057B54 02602025 */ move $a0, $s3 -/* 08C6C8 7F057B58 00403025 */ move $a2, $v0 -/* 08C6CC 7F057B5C 0C002B29 */ jal sprintf -/* 08C6D0 7F057B60 02003825 */ move $a3, $s0 -/* 08C6D4 7F057B64 10000009 */ b .L7F057B8C -/* 08C6D8 7F057B68 00000000 */ nop -.L7F057B6C: -/* 08C6DC 7F057B6C 0FC30AA2 */ jal langGet -/* 08C6E0 7F057B70 26B00061 */ addiu $s0, $s5, 0x61 -/* 08C6E4 7F057B74 3C058005 */ lui $a1, %hi(aSC) # $a1, 0x8005 -/* 08C6E8 7F057B78 24A5367C */ addiu $a1, %lo(aSC) # addiu $a1, $a1, 0x367c -/* 08C6EC 7F057B7C 02602025 */ move $a0, $s3 -/* 08C6F0 7F057B80 00403025 */ move $a2, $v0 -/* 08C6F4 7F057B84 0C002B29 */ jal sprintf -/* 08C6F8 7F057B88 02003825 */ move $a3, $s0 -.L7F057B8C: -/* 08C6FC 7F057B8C 163E0008 */ bne $s1, $fp, .L7F057BB0 -/* 08C700 7F057B90 00000000 */ nop -/* 08C704 7F057B94 0FC30AA2 */ jal langGet -/* 08C708 7F057B98 3404B02D */ li $a0, 45101 -/* 08C70C 7F057B9C 02602025 */ move $a0, $s3 -/* 08C710 7F057BA0 0C002A03 */ jal strcat -/* 08C714 7F057BA4 00402825 */ move $a1, $v0 -/* 08C718 7F057BA8 10000011 */ b .L7F057BF0 -/* 08C71C 7F057BAC 00000000 */ nop -.L7F057BB0: -/* 08C720 7F057BB0 16200008 */ bnez $s1, .L7F057BD4 -/* 08C724 7F057BB4 24010002 */ li $at, 2 -/* 08C728 7F057BB8 0FC30AA2 */ jal langGet -/* 08C72C 7F057BBC 3404B02E */ li $a0, 45102 -/* 08C730 7F057BC0 02602025 */ move $a0, $s3 -/* 08C734 7F057BC4 0C002A03 */ jal strcat -/* 08C738 7F057BC8 00402825 */ move $a1, $v0 -/* 08C73C 7F057BCC 10000008 */ b .L7F057BF0 -/* 08C740 7F057BD0 00000000 */ nop -.L7F057BD4: -/* 08C744 7F057BD4 16210006 */ bne $s1, $at, .L7F057BF0 -/* 08C748 7F057BD8 00000000 */ nop -/* 08C74C 7F057BDC 0FC30AA2 */ jal langGet -/* 08C750 7F057BE0 3404B02F */ li $a0, 45103 -/* 08C754 7F057BE4 02602025 */ move $a0, $s3 -/* 08C758 7F057BE8 0C002A03 */ jal strcat -/* 08C75C 7F057BEC 00402825 */ move $a1, $v0 -.L7F057BF0: -/* 08C760 7F057BF0 0FC22B10 */ jal jp_hudmsgBottomShow -/* 08C764 7F057BF4 02602025 */ move $a0, $s3 -.L7F057BF8: -/* 08C768 7F057BF8 0FC15DC1 */ jal get_difficulty_for_objective -/* 08C76C 7F057BFC 02402025 */ move $a0, $s2 -/* 08C770 7F057C00 0FC3021E */ jal lvlGetSelectedDifficulty -/* 08C774 7F057C04 00408025 */ move $s0, $v0 -/* 08C778 7F057C08 0050082A */ slt $at, $v0, $s0 -/* 08C77C 7F057C0C 54200003 */ bnezl $at, .L7F057C1C -/* 08C780 7F057C10 8ECD0000 */ lw $t5, ($s6) -/* 08C784 7F057C14 26B50001 */ addiu $s5, $s5, 1 -/* 08C788 7F057C18 8ECD0000 */ lw $t5, ($s6) -.L7F057C1C: -/* 08C78C 7F057C1C 26520001 */ addiu $s2, $s2, 1 -/* 08C790 7F057C20 26940004 */ addiu $s4, $s4, 4 -/* 08C794 7F057C24 01B2082A */ slt $at, $t5, $s2 -/* 08C798 7F057C28 1020FFB3 */ beqz $at, .L7F057AF8 -/* 08C79C 7F057C2C 00000000 */ nop -.L7F057C30: -/* 08C7A0 7F057C30 8FBF003C */ lw $ra, 0x3c($sp) -.L7F057C34: -/* 08C7A4 7F057C34 8FB00018 */ lw $s0, 0x18($sp) -/* 08C7A8 7F057C38 8FB1001C */ lw $s1, 0x1c($sp) -/* 08C7AC 7F057C3C 8FB20020 */ lw $s2, 0x20($sp) -/* 08C7B0 7F057C40 8FB30024 */ lw $s3, 0x24($sp) -/* 08C7B4 7F057C44 8FB40028 */ lw $s4, 0x28($sp) -/* 08C7B8 7F057C48 8FB5002C */ lw $s5, 0x2c($sp) -/* 08C7BC 7F057C4C 8FB60030 */ lw $s6, 0x30($sp) -/* 08C7C0 7F057C50 8FB70034 */ lw $s7, 0x34($sp) -/* 08C7C4 7F057C54 8FBE0038 */ lw $fp, 0x38($sp) -/* 08C7C8 7F057C58 03E00008 */ jr $ra -/* 08C7CC 7F057C5C 27BD0090 */ addiu $sp, $sp, 0x90 -) -#endif -#ifdef VERSION_EU -GLOBAL_ASM( -.rdata -/*glabel D_80053610*/ -/*.word 0,0,0,0,0,0,0,0,0,0*/ -/*glabel D_80053640*/ -/*.word 0*/ -.text -glabel display_objective_status_text_on_status_change -/* 08A220 7F057830 27BDFF70 */ addiu $sp, $sp, -0x90 -/* 08A224 7F057834 AFB30024 */ sw $s3, 0x24($sp) -/* 08A228 7F057838 3C0E8005 */ lui $t6, %hi(D_80053610) # $t6, 0x8005 -/* 08A22C 7F05783C 27B30054 */ addiu $s3, $sp, 0x54 -/* 08A230 7F057840 AFB5002C */ sw $s5, 0x2c($sp) -/* 08A234 7F057844 25CE9750 */ addiu $t6, %lo(D_80053610) # addiu $t6, $t6, -0x68b0 -/* 08A238 7F057848 AFBF003C */ sw $ra, 0x3c($sp) -/* 08A23C 7F05784C AFBE0038 */ sw $fp, 0x38($sp) -/* 08A240 7F057850 AFB70034 */ sw $s7, 0x34($sp) -/* 08A244 7F057854 AFB60030 */ sw $s6, 0x30($sp) -/* 08A248 7F057858 AFB40028 */ sw $s4, 0x28($sp) -/* 08A24C 7F05785C AFB20020 */ sw $s2, 0x20($sp) -/* 08A250 7F057860 AFB1001C */ sw $s1, 0x1c($sp) -/* 08A254 7F057864 AFB00018 */ sw $s0, 0x18($sp) -/* 08A258 7F057868 0000A825 */ move $s5, $zero -/* 08A25C 7F05786C 25D90030 */ addiu $t9, $t6, 0x30 -/* 08A260 7F057870 02604025 */ move $t0, $s3 -.L7F057874: -/* 08A264 7F057874 8DC10000 */ lw $at, ($t6) -/* 08A268 7F057878 25CE000C */ addiu $t6, $t6, 0xc -/* 08A26C 7F05787C 2508000C */ addiu $t0, $t0, 0xc -/* 08A270 7F057880 AD01FFF4 */ sw $at, -0xc($t0) -/* 08A274 7F057884 8DC1FFF8 */ lw $at, -8($t6) -/* 08A278 7F057888 AD01FFF8 */ sw $at, -8($t0) -/* 08A27C 7F05788C 8DC1FFFC */ lw $at, -4($t6) -/* 08A280 7F057890 15D9FFF8 */ bne $t6, $t9, .L7F057874 -/* 08A284 7F057894 AD01FFFC */ sw $at, -4($t0) -/* 08A288 7F057898 95C10000 */ lhu $at, ($t6) -/* 08A28C 7F05789C 3C098003 */ lui $t1, %hi(num_objective_ptrs+4) # $t1, 0x8003 -/* 08A290 7F0578A0 3C168003 */ lui $s6, %hi(num_objective_ptrs) # $s6, 0x8003 -/* 08A294 7F0578A4 A5010000 */ sh $at, ($t0) -/* 08A298 7F0578A8 8D29D844 */ lw $t1, %lo(num_objective_ptrs+4)($t1) -/* 08A29C 7F0578AC 26D6D840 */ addiu $s6, %lo(num_objective_ptrs) # addiu $s6, $s6, -0x27c0 -/* 08A2A0 7F0578B0 55200058 */ bnezl $t1, .L7F057A14 -/* 08A2A4 7F0578B4 8FBF003C */ lw $ra, 0x3c($sp) -/* 08A2A8 7F0578B8 8ECA0000 */ lw $t2, ($s6) -/* 08A2AC 7F0578BC 3C148006 */ lui $s4, %hi(dword_CODE_bss_80075D58) # $s4, 0x8006 -/* 08A2B0 7F0578C0 26944C98 */ addiu $s4, %lo(dword_CODE_bss_80075D58) # addiu $s4, $s4, 0x4c98 -/* 08A2B4 7F0578C4 05400052 */ bltz $t2, .L7F057A10 -/* 08A2B8 7F0578C8 00009025 */ move $s2, $zero -/* 08A2BC 7F0578CC 3C178004 */ lui $s7, %hi(j_text_trigger) # $s7, 0x8004 -/* 08A2C0 7F0578D0 26F71150 */ addiu $s7, %lo(j_text_trigger) # addiu $s7, $s7, 0x1150 -/* 08A2C4 7F0578D4 241E0001 */ li $fp, 1 -.L7F0578D8: -/* 08A2C8 7F0578D8 0FC15D46 */ jal get_status_of_objective -/* 08A2CC 7F0578DC 02402025 */ move $a0, $s2 -/* 08A2D0 7F0578E0 8E8B0000 */ lw $t3, ($s4) -/* 08A2D4 7F0578E4 00408825 */ move $s1, $v0 -/* 08A2D8 7F0578E8 02402025 */ move $a0, $s2 -/* 08A2DC 7F0578EC 104B003A */ beq $v0, $t3, .L7F0579D8 -/* 08A2E0 7F0578F0 00000000 */ nop -/* 08A2E4 7F0578F4 0FC15D39 */ jal get_difficulty_for_objective -/* 08A2E8 7F0578F8 AE820000 */ sw $v0, ($s4) -/* 08A2EC 7F0578FC 0FC2FC21 */ jal lvlGetSelectedDifficulty -/* 08A2F0 7F057900 00408025 */ move $s0, $v0 -/* 08A2F4 7F057904 0050082A */ slt $at, $v0, $s0 -/* 08A2F8 7F057908 14200033 */ bnez $at, .L7F0579D8 -/* 08A2FC 7F05790C 00000000 */ nop -/* 08A300 7F057910 8EEC0000 */ lw $t4, ($s7) -/* 08A304 7F057914 26B0001A */ addiu $s0, $s5, 0x1a -/* 08A308 7F057918 3404B02C */ li $a0, 45100 -/* 08A30C 7F05791C 1180000B */ beqz $t4, .L7F05794C -/* 08A310 7F057920 00000000 */ nop -/* 08A314 7F057924 0FC304AE */ jal langGet -/* 08A318 7F057928 3404B02C */ li $a0, 45100 -/* 08A31C 7F05792C 3C058005 */ lui $a1, %hi(aSAC) # $a1, 0x8005 -/* 08A320 7F057930 24A59784 */ addiu $a1, %lo(aSAC) # addiu $a1, $a1, -0x687c -/* 08A324 7F057934 02602025 */ move $a0, $s3 -/* 08A328 7F057938 00403025 */ move $a2, $v0 -/* 08A32C 7F05793C 0C00283D */ jal sprintf -/* 08A330 7F057940 02003825 */ move $a3, $s0 -/* 08A334 7F057944 10000009 */ b .L7F05796C -/* 08A338 7F057948 00000000 */ nop -.L7F05794C: -/* 08A33C 7F05794C 0FC304AE */ jal langGet -/* 08A340 7F057950 26B00061 */ addiu $s0, $s5, 0x61 -/* 08A344 7F057954 3C058005 */ lui $a1, %hi(aSC) # $a1, 0x8005 -/* 08A348 7F057958 24A5978C */ addiu $a1, %lo(aSC) # addiu $a1, $a1, -0x6874 -/* 08A34C 7F05795C 02602025 */ move $a0, $s3 -/* 08A350 7F057960 00403025 */ move $a2, $v0 -/* 08A354 7F057964 0C00283D */ jal sprintf -/* 08A358 7F057968 02003825 */ move $a3, $s0 -.L7F05796C: -/* 08A35C 7F05796C 163E0008 */ bne $s1, $fp, .L7F057990 -/* 08A360 7F057970 00000000 */ nop -/* 08A364 7F057974 0FC304AE */ jal langGet -/* 08A368 7F057978 3404B02D */ li $a0, 45101 -/* 08A36C 7F05797C 02602025 */ move $a0, $s3 -/* 08A370 7F057980 0C002717 */ jal strcat -/* 08A374 7F057984 00402825 */ move $a1, $v0 -/* 08A378 7F057988 10000011 */ b .L7F0579D0 -/* 08A37C 7F05798C 00000000 */ nop -.L7F057990: -/* 08A380 7F057990 16200008 */ bnez $s1, .L7F0579B4 -/* 08A384 7F057994 24010002 */ li $at, 2 -/* 08A388 7F057998 0FC304AE */ jal langGet -/* 08A38C 7F05799C 3404B02E */ li $a0, 45102 -/* 08A390 7F0579A0 02602025 */ move $a0, $s3 -/* 08A394 7F0579A4 0C002717 */ jal strcat -/* 08A398 7F0579A8 00402825 */ move $a1, $v0 -/* 08A39C 7F0579AC 10000008 */ b .L7F0579D0 -/* 08A3A0 7F0579B0 00000000 */ nop -.L7F0579B4: -/* 08A3A4 7F0579B4 16210006 */ bne $s1, $at, .L7F0579D0 -/* 08A3A8 7F0579B8 00000000 */ nop -/* 08A3AC 7F0579BC 0FC304AE */ jal langGet -/* 08A3B0 7F0579C0 3404B02F */ li $a0, 45103 -/* 08A3B4 7F0579C4 02602025 */ move $a0, $s3 -/* 08A3B8 7F0579C8 0C002717 */ jal strcat -/* 08A3BC 7F0579CC 00402825 */ move $a1, $v0 -.L7F0579D0: -/* 08A3C0 7F0579D0 0FC229B5 */ jal jp_hudmsgBottomShow -/* 08A3C4 7F0579D4 02602025 */ move $a0, $s3 -.L7F0579D8: -/* 08A3C8 7F0579D8 0FC15D39 */ jal get_difficulty_for_objective -/* 08A3CC 7F0579DC 02402025 */ move $a0, $s2 -/* 08A3D0 7F0579E0 0FC2FC21 */ jal lvlGetSelectedDifficulty -/* 08A3D4 7F0579E4 00408025 */ move $s0, $v0 -/* 08A3D8 7F0579E8 0050082A */ slt $at, $v0, $s0 -/* 08A3DC 7F0579EC 54200003 */ bnezl $at, .L7F0579FC -/* 08A3E0 7F0579F0 8ECD0000 */ lw $t5, ($s6) -/* 08A3E4 7F0579F4 26B50001 */ addiu $s5, $s5, 1 -/* 08A3E8 7F0579F8 8ECD0000 */ lw $t5, ($s6) -.L7F0579FC: -/* 08A3EC 7F0579FC 26520001 */ addiu $s2, $s2, 1 -/* 08A3F0 7F057A00 26940004 */ addiu $s4, $s4, 4 -/* 08A3F4 7F057A04 01B2082A */ slt $at, $t5, $s2 -/* 08A3F8 7F057A08 1020FFB3 */ beqz $at, .L7F0578D8 -/* 08A3FC 7F057A0C 00000000 */ nop -.L7F057A10: -/* 08A400 7F057A10 8FBF003C */ lw $ra, 0x3c($sp) -.L7F057A14: -/* 08A404 7F057A14 8FB00018 */ lw $s0, 0x18($sp) -/* 08A408 7F057A18 8FB1001C */ lw $s1, 0x1c($sp) -/* 08A40C 7F057A1C 8FB20020 */ lw $s2, 0x20($sp) -/* 08A410 7F057A20 8FB30024 */ lw $s3, 0x24($sp) -/* 08A414 7F057A24 8FB40028 */ lw $s4, 0x28($sp) -/* 08A418 7F057A28 8FB5002C */ lw $s5, 0x2c($sp) -/* 08A41C 7F057A2C 8FB60030 */ lw $s6, 0x30($sp) -/* 08A420 7F057A30 8FB70034 */ lw $s7, 0x34($sp) -/* 08A424 7F057A34 8FBE0038 */ lw $fp, 0x38($sp) -/* 08A428 7F057A38 03E00008 */ jr $ra -/* 08A42C 7F057A3C 27BD0090 */ addiu $sp, $sp, 0x90 -) + for (i = 0; i <= objective_count; i++) { + status = get_status_of_objective(i); + if (dword_CODE_bss_80075D58[i] != status) { + dword_CODE_bss_80075D58[i] = status; + if (get_difficulty_for_objective(i) <= lvlGetSelectedDifficulty()) { + if (j_text_trigger != 0) { + sprintf(&buffer, "%s \x80%c ", langGet(0xB02C), availableindex + 0x1A); + } else { + sprintf(&buffer, "%s %c: ", langGet(0xB02C), availableindex + 0x61); + } + if (status == OBJECTIVESTATUS_COMPLETE) { + strcat(&buffer, langGet(0xB02D)); + } else if (status == OBJECTIVESTATUS_INCOMPLETE) { + strcat(&buffer, langGet(0xB02E)); + } else if (status == OBJECTIVESTATUS_FAILED) { + strcat(&buffer, langGet(0xB02F)); + } +#ifdef VERSION_US + hudmsgBottomShow(&buffer); +#else + jp_hudmsgBottomShow(&buffer); #endif + } + } + if (get_difficulty_for_objective(i) <= lvlGetSelectedDifficulty()) { + availableindex++; + } + } +} -#endif +/** + * Iterate list of ptr_last_enter_room_subobject_entry_type20, if it's the same + * room as the argument then set the `flag` property. + * + * US address 7F057744. + * + * Perfect Dark method objectiveCheckRoomEntered. +*/ +void objectivestatusCheckRoomEntered(s32 roomid) +{ + struct criteria_roomentered *var_v0; + struct PadRecord* setupPad; + struct StandTile *stan; + + var_v0 = ptr_last_enter_room_subobject_entry_type20; + while (var_v0 != NULL) + { + if (var_v0->status == 0) + { + if (isNotBoundPad(var_v0->pad)) + { + setupPad = &g_CurrentSetup.pads[var_v0->pad]; + } + else + { + setupPad = (struct PadRecord*)&g_CurrentSetup.boundpads[getBoundPadNum((s32)var_v0->pad)]; + } + stan = setupPad->stan; -#ifdef NONMATCHING -void sub_GAME_7F057744(void) { + if ((stan != NULL) && (roomid == stan->room)) + { + var_v0->status = 1; + } + } + var_v0 = var_v0->next; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F057744 -/* 08C274 7F057744 3C028007 */ lui $v0, %hi(ptr_last_enter_room_subobject_entry_type20) -/* 08C278 7F057748 8C425D88 */ lw $v0, %lo(ptr_last_enter_room_subobject_entry_type20)($v0) -/* 08C27C 7F05774C 3C0AFFF5 */ lui $t2, (0xFFF59FC0 >> 16) # lui $t2, 0xfff5 -/* 08C280 7F057750 00802825 */ move $a1, $a0 -/* 08C284 7F057754 10400022 */ beqz $v0, .L7F0577E0 -/* 08C288 7F057758 354A9FC0 */ ori $t2, (0xFFF59FC0 & 0xFFFF) # ori $t2, $t2, 0x9fc0 -/* 08C28C 7F05775C 3C078007 */ lui $a3, %hi(g_CurrentSetup+0) -/* 08C290 7F057760 24E75D00 */ addiu $a3, %lo(g_CurrentSetup+0) # addiu $a3, $a3, 0x5d00 -/* 08C294 7F057764 24090044 */ li $t1, 68 -/* 08C298 7F057768 24080001 */ li $t0, 1 -/* 08C29C 7F05776C 2406002C */ li $a2, 44 -/* 08C2A0 7F057770 8C4E0008 */ lw $t6, 8($v0) -.L7F057774: -/* 08C2A4 7F057774 55C00018 */ bnezl $t6, .L7F0577D8 -/* 08C2A8 7F057778 8C42000C */ lw $v0, 0xc($v0) -/* 08C2AC 7F05777C 8C430004 */ lw $v1, 4($v0) -/* 08C2B0 7F057780 2C612710 */ sltiu $at, $v1, 0x2710 -/* 08C2B4 7F057784 10200007 */ beqz $at, .L7F0577A4 -/* 08C2B8 7F057788 00000000 */ nop -/* 08C2BC 7F05778C 00660019 */ multu $v1, $a2 -/* 08C2C0 7F057790 8CF80018 */ lw $t8, 0x18($a3) -/* 08C2C4 7F057794 00007812 */ mflo $t7 -/* 08C2C8 7F057798 01F82021 */ addu $a0, $t7, $t8 -/* 08C2CC 7F05779C 10000007 */ b .L7F0577BC -/* 08C2D0 7F0577A0 8C830028 */ lw $v1, 0x28($a0) -.L7F0577A4: -/* 08C2D4 7F0577A4 00690019 */ multu $v1, $t1 -/* 08C2D8 7F0577A8 8CEB001C */ lw $t3, 0x1c($a3) -/* 08C2DC 7F0577AC 0000C812 */ mflo $t9 -/* 08C2E0 7F0577B0 032B6021 */ addu $t4, $t9, $t3 -/* 08C2E4 7F0577B4 018A2021 */ addu $a0, $t4, $t2 -/* 08C2E8 7F0577B8 8C830028 */ lw $v1, 0x28($a0) -.L7F0577BC: -/* 08C2EC 7F0577BC 50600006 */ beql $v1, $zero, .L7F0577D8 -/* 08C2F0 7F0577C0 8C42000C */ lw $v0, 0xc($v0) -/* 08C2F4 7F0577C4 906D0003 */ lbu $t5, 3($v1) -/* 08C2F8 7F0577C8 54AD0003 */ bnel $a1, $t5, .L7F0577D8 -/* 08C2FC 7F0577CC 8C42000C */ lw $v0, 0xc($v0) -/* 08C300 7F0577D0 AC480008 */ sw $t0, 8($v0) -/* 08C304 7F0577D4 8C42000C */ lw $v0, 0xc($v0) -.L7F0577D8: -/* 08C308 7F0577D8 5440FFE6 */ bnezl $v0, .L7F057774 -/* 08C30C 7F0577DC 8C4E0008 */ lw $t6, 8($v0) -.L7F0577E0: -/* 08C310 7F0577E0 03E00008 */ jr $ra -/* 08C314 7F0577E4 00000000 */ nop -) -#endif -#ifdef NONMATCHING -void sub_GAME_7F0577E8(void) { +/** + * US address 7F0577E8. +*/ +void objectivestatusCheckDeposit(s32 weaponnum, s32 roomid) +{ + struct criteria_deposit *dep; + s32 padid; + PadRecord *pad; -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0577E8 -/* 08C318 7F0577E8 3C028007 */ lui $v0, %hi(ptr_last_deposit_in_room_subobject_entry_type21) -/* 08C31C 7F0577EC 8C425D8C */ lw $v0, %lo(ptr_last_deposit_in_room_subobject_entry_type21)($v0) -/* 08C320 7F0577F0 3C0BFFF5 */ lui $t3, (0xFFF59FC0 >> 16) # lui $t3, 0xfff5 -/* 08C324 7F0577F4 00A03025 */ move $a2, $a1 -/* 08C328 7F0577F8 10400025 */ beqz $v0, .L7F057890 -/* 08C32C 7F0577FC 356B9FC0 */ ori $t3, (0xFFF59FC0 & 0xFFFF) # ori $t3, $t3, 0x9fc0 -/* 08C330 7F057800 3C088007 */ lui $t0, %hi(g_CurrentSetup+0) -/* 08C334 7F057804 25085D00 */ addiu $t0, %lo(g_CurrentSetup+0) # addiu $t0, $t0, 0x5d00 -/* 08C338 7F057808 240A0044 */ li $t2, 68 -/* 08C33C 7F05780C 24090001 */ li $t1, 1 -/* 08C340 7F057810 2407002C */ li $a3, 44 -/* 08C344 7F057814 8C4E000C */ lw $t6, 0xc($v0) -.L7F057818: -/* 08C348 7F057818 55C0001B */ bnezl $t6, .L7F057888 -/* 08C34C 7F05781C 8C420010 */ lw $v0, 0x10($v0) -/* 08C350 7F057820 8C4F0004 */ lw $t7, 4($v0) -/* 08C354 7F057824 548F0018 */ bnel $a0, $t7, .L7F057888 -/* 08C358 7F057828 8C420010 */ lw $v0, 0x10($v0) -/* 08C35C 7F05782C 8C430008 */ lw $v1, 8($v0) -/* 08C360 7F057830 2C612710 */ sltiu $at, $v1, 0x2710 -/* 08C364 7F057834 10200007 */ beqz $at, .L7F057854 -/* 08C368 7F057838 00000000 */ nop -/* 08C36C 7F05783C 00670019 */ multu $v1, $a3 -/* 08C370 7F057840 8D190018 */ lw $t9, 0x18($t0) -/* 08C374 7F057844 0000C012 */ mflo $t8 -/* 08C378 7F057848 03192821 */ addu $a1, $t8, $t9 -/* 08C37C 7F05784C 10000007 */ b .L7F05786C -/* 08C380 7F057850 8CA30028 */ lw $v1, 0x28($a1) -.L7F057854: -/* 08C384 7F057854 006A0019 */ multu $v1, $t2 -/* 08C388 7F057858 8D0D001C */ lw $t5, 0x1c($t0) -/* 08C38C 7F05785C 00006012 */ mflo $t4 -/* 08C390 7F057860 018D7021 */ addu $t6, $t4, $t5 -/* 08C394 7F057864 01CB2821 */ addu $a1, $t6, $t3 -/* 08C398 7F057868 8CA30028 */ lw $v1, 0x28($a1) -.L7F05786C: -/* 08C39C 7F05786C 50600006 */ beql $v1, $zero, .L7F057888 -/* 08C3A0 7F057870 8C420010 */ lw $v0, 0x10($v0) -/* 08C3A4 7F057874 906F0003 */ lbu $t7, 3($v1) -/* 08C3A8 7F057878 54CF0003 */ bnel $a2, $t7, .L7F057888 -/* 08C3AC 7F05787C 8C420010 */ lw $v0, 0x10($v0) -/* 08C3B0 7F057880 AC49000C */ sw $t1, 0xc($v0) -/* 08C3B4 7F057884 8C420010 */ lw $v0, 0x10($v0) -.L7F057888: -/* 08C3B8 7F057888 5440FFE3 */ bnezl $v0, .L7F057818 -/* 08C3BC 7F05788C 8C4E000C */ lw $t6, 0xc($v0) -.L7F057890: -/* 08C3C0 7F057890 03E00008 */ jr $ra -/* 08C3C4 7F057894 00000000 */ nop -) -#endif + for (dep = ptr_last_deposit_in_room_subobject_entry_type21; dep != NULL; dep = dep->next) + { + if (dep->flag == 0 && weaponnum == dep->weaponnum) + { + padid = dep->padid; + if (isNotBoundPad((u32)padid)) + { + pad = &g_CurrentSetup.pads[padid]; + } + else + { + pad = (PadRecord *)&g_CurrentSetup.boundpads[getBoundPadNum(padid)]; + } + + if (pad->stan != NULL && roomid == pad->stan->room) + { + dep->flag = 1; + } + } + } +} diff --git a/src/game/objective_status.h b/src/game/objective_status.h index 73d63454..40992f1f 100644 --- a/src/game/objective_status.h +++ b/src/game/objective_status.h @@ -3,11 +3,16 @@ #include #include +extern struct objective_entry * objective_ptrs[]; +extern s32 objective_count; +extern s32 objective_count_related; + void objectiveTakePictureHandler(); bool objectiveIsAllComplete(void); TagObjectRecord *sub_GAME_7F057080(s32 TagID); s32 objectiveGetCount(void); ObjectRecord * objFindByTagId(s32 TagID); OBJECTIVESTATUS get_status_of_objective(s32 objectiveNum); -void sub_GAME_7F057C14(struct coord3d *arg0, s32 *arg1); +void sub_GAME_7F057C14(coord3d *coord, Mtxf *mtx); +void objectivestatusCheckDeposit(s32 weaponnum, s32 roomid); #endif diff --git a/src/game/objective_status2.c b/src/game/objective_status2.c index 1ececb44..57c9abaa 100644 --- a/src/game/objective_status2.c +++ b/src/game/objective_status2.c @@ -1,357 +1,39 @@ #include +#include "math.h" +#include "bondconstants.h" +#include "bondtypes.h" +#include "random.h" +#include "matrixmath.h" //D:80032300 -u32 D_80032300 = 0; -//D:80032304 -u32 D_80032304 = 0; -//D:80032308 -u32 D_80032308 = 0; +coord3d ZeroCoord = { 0, 0, 0 }; -#ifdef NONMATCHING -void sub_GAME_7F057AC0(float *param_1) -{ - float firstrandfinal; - float secondrandfinal; - float thirdrandfinal; - - firstrandfinal = D_80032300; - secondrandfinal = D_80032304; - thirdrandfinal = D_80032308; - firstrandfinal = randomGetNext() * 0.00000000 * 6.28318548 * 0.03125000 - 0.09817477; - secondrandfinal = randomGetNext() * 0.00000000 * 6.28318548 * 0.03125000 - 0.09817477; - thirdrandfinal = randomGetNext() * 0.00000000 * 6.28318548 * 0.03125000 - 0.09817477; - matrix_4x4_set_rotation_around_xyz(&firstrandfinal,param_1); - return; -} -#else +void mtxLoadRandomRotation(Mtxf *mtx) +{ + coord3d coord; + coord = ZeroCoord; #if defined(LEFTOVERDEBUG) - -GLOBAL_ASM( -.late_rodata -glabel D_80053690 -.word 0x40c90fdb /*6.2831855*/ -glabel D_80053694 -.word 0x3dc90fdb /*0.098174773*/ -glabel D_80053698 -.word 0x40c90fdb /*6.2831855*/ -glabel D_8005369C -.word 0x3dc90fdb /*0.098174773*/ -glabel D_800536A0 -.word 0x40c90fdb /*6.2831855*/ -glabel D_800536A4 -.word 0x3dc90fdb /*0.098174773*/ -.text -glabel sub_GAME_7F057AC0 -/* 08C5F0 7F057AC0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 08C5F4 7F057AC4 3C0F8003 */ lui $t7, %hi(D_80032300) -/* 08C5F8 7F057AC8 AFBF0014 */ sw $ra, 0x14($sp) -/* 08C5FC 7F057ACC AFA40028 */ sw $a0, 0x28($sp) -/* 08C600 7F057AD0 25EF2300 */ addiu $t7, %lo(D_80032300) # addiu $t7, $t7, 0x2300 -/* 08C604 7F057AD4 8DE10000 */ lw $at, ($t7) -/* 08C608 7F057AD8 27AE001C */ addiu $t6, $sp, 0x1c -/* 08C60C 7F057ADC 8DE80004 */ lw $t0, 4($t7) -/* 08C610 7F057AE0 ADC10000 */ sw $at, ($t6) -/* 08C614 7F057AE4 8DE10008 */ lw $at, 8($t7) -/* 08C618 7F057AE8 ADC80004 */ sw $t0, 4($t6) -/* 08C61C 7F057AEC 0C002914 */ jal randomGetNext -/* 08C620 7F057AF0 ADC10008 */ sw $at, 8($t6) -/* 08C624 7F057AF4 44822000 */ mtc1 $v0, $f4 -/* 08C628 7F057AF8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C62C 7F057AFC 04410004 */ bgez $v0, .L7F057B10 -/* 08C630 7F057B00 468021A0 */ cvt.s.w $f6, $f4 -/* 08C634 7F057B04 44814000 */ mtc1 $at, $f8 -/* 08C638 7F057B08 00000000 */ nop -/* 08C63C 7F057B0C 46083180 */ add.s $f6, $f6, $f8 -.L7F057B10: -/* 08C640 7F057B10 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C644 7F057B14 44815000 */ mtc1 $at, $f10 -/* 08C648 7F057B18 3C018005 */ lui $at, %hi(D_80053690) -/* 08C64C 7F057B1C C4323690 */ lwc1 $f18, %lo(D_80053690)($at) -/* 08C650 7F057B20 460A3402 */ mul.s $f16, $f6, $f10 -/* 08C654 7F057B24 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C658 7F057B28 44814000 */ mtc1 $at, $f8 -/* 08C65C 7F057B2C 3C018005 */ lui $at, %hi(D_80053694) -/* 08C660 7F057B30 C42A3694 */ lwc1 $f10, %lo(D_80053694)($at) -/* 08C664 7F057B34 46128102 */ mul.s $f4, $f16, $f18 -/* 08C668 7F057B38 00000000 */ nop -/* 08C66C 7F057B3C 46082182 */ mul.s $f6, $f4, $f8 -/* 08C670 7F057B40 460A3401 */ sub.s $f16, $f6, $f10 -/* 08C674 7F057B44 0C002914 */ jal randomGetNext -/* 08C678 7F057B48 E7B0001C */ swc1 $f16, 0x1c($sp) -/* 08C67C 7F057B4C 44829000 */ mtc1 $v0, $f18 -/* 08C680 7F057B50 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C684 7F057B54 04410004 */ bgez $v0, .L7F057B68 -/* 08C688 7F057B58 46809120 */ cvt.s.w $f4, $f18 -/* 08C68C 7F057B5C 44814000 */ mtc1 $at, $f8 -/* 08C690 7F057B60 00000000 */ nop -/* 08C694 7F057B64 46082100 */ add.s $f4, $f4, $f8 -.L7F057B68: -/* 08C698 7F057B68 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C69C 7F057B6C 44813000 */ mtc1 $at, $f6 -/* 08C6A0 7F057B70 3C018005 */ lui $at, %hi(D_80053698) -/* 08C6A4 7F057B74 C4303698 */ lwc1 $f16, %lo(D_80053698)($at) -/* 08C6A8 7F057B78 46062282 */ mul.s $f10, $f4, $f6 -/* 08C6AC 7F057B7C 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C6B0 7F057B80 44814000 */ mtc1 $at, $f8 -/* 08C6B4 7F057B84 3C018005 */ lui $at, %hi(D_8005369C) -/* 08C6B8 7F057B88 C426369C */ lwc1 $f6, %lo(D_8005369C)($at) -/* 08C6BC 7F057B8C 46105482 */ mul.s $f18, $f10, $f16 -/* 08C6C0 7F057B90 00000000 */ nop -/* 08C6C4 7F057B94 46089102 */ mul.s $f4, $f18, $f8 -/* 08C6C8 7F057B98 46062281 */ sub.s $f10, $f4, $f6 -/* 08C6CC 7F057B9C 0C002914 */ jal randomGetNext -/* 08C6D0 7F057BA0 E7AA0020 */ swc1 $f10, 0x20($sp) -/* 08C6D4 7F057BA4 44828000 */ mtc1 $v0, $f16 -/* 08C6D8 7F057BA8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C6DC 7F057BAC 04410004 */ bgez $v0, .L7F057BC0 -/* 08C6E0 7F057BB0 468084A0 */ cvt.s.w $f18, $f16 -/* 08C6E4 7F057BB4 44814000 */ mtc1 $at, $f8 -/* 08C6E8 7F057BB8 00000000 */ nop -/* 08C6EC 7F057BBC 46089480 */ add.s $f18, $f18, $f8 -.L7F057BC0: -/* 08C6F0 7F057BC0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C6F4 7F057BC4 44812000 */ mtc1 $at, $f4 -/* 08C6F8 7F057BC8 3C018005 */ lui $at, %hi(D_800536A0) -/* 08C6FC 7F057BCC C42A36A0 */ lwc1 $f10, %lo(D_800536A0)($at) -/* 08C700 7F057BD0 46049182 */ mul.s $f6, $f18, $f4 -/* 08C704 7F057BD4 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C708 7F057BD8 44814000 */ mtc1 $at, $f8 -/* 08C70C 7F057BDC 3C018005 */ lui $at, %hi(D_800536A4) -/* 08C710 7F057BE0 C42436A4 */ lwc1 $f4, %lo(D_800536A4)($at) -/* 08C714 7F057BE4 27A4001C */ addiu $a0, $sp, 0x1c -/* 08C718 7F057BE8 8FA50028 */ lw $a1, 0x28($sp) -/* 08C71C 7F057BEC 460A3402 */ mul.s $f16, $f6, $f10 -/* 08C720 7F057BF0 00000000 */ nop -/* 08C724 7F057BF4 46088482 */ mul.s $f18, $f16, $f8 -/* 08C728 7F057BF8 46049181 */ sub.s $f6, $f18, $f4 -/* 08C72C 7F057BFC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 08C730 7F057C00 E7A60024 */ swc1 $f6, 0x24($sp) -/* 08C734 7F057C04 8FBF0014 */ lw $ra, 0x14($sp) -/* 08C738 7F057C08 27BD0028 */ addiu $sp, $sp, 0x28 -/* 08C73C 7F057C0C 03E00008 */ jr $ra -/* 08C740 7F057C10 00000000 */ nop -) -#endif - -#if !defined(LEFTOVERDEBUG) - -/* same asm, different float .rodata */ - -GLOBAL_ASM( -.late_rodata -glabel D_80053690 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_80053694 -.word 0x3df1463a /* 0.117809727788 */ -glabel D_80053698 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_8005369C -.word 0x3df1463a /* 0.117809727788 */ -glabel D_800536A0 -.word 0x40f1463a /* 6.2831855 * 1.2 = 7.53982257843 */ -glabel D_800536A4 -.word 0x3df1463a /* 0.117809727788 */ -.text -glabel sub_GAME_7F057AC0 -/* 08C5F0 7F057AC0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 08C5F4 7F057AC4 3C0F8003 */ lui $t7, %hi(D_80032300) -/* 08C5F8 7F057AC8 AFBF0014 */ sw $ra, 0x14($sp) -/* 08C5FC 7F057ACC AFA40028 */ sw $a0, 0x28($sp) -/* 08C600 7F057AD0 25EF2300 */ addiu $t7, %lo(D_80032300) # addiu $t7, $t7, 0x2300 -/* 08C604 7F057AD4 8DE10000 */ lw $at, ($t7) -/* 08C608 7F057AD8 27AE001C */ addiu $t6, $sp, 0x1c -/* 08C60C 7F057ADC 8DE80004 */ lw $t0, 4($t7) -/* 08C610 7F057AE0 ADC10000 */ sw $at, ($t6) -/* 08C614 7F057AE4 8DE10008 */ lw $at, 8($t7) -/* 08C618 7F057AE8 ADC80004 */ sw $t0, 4($t6) -/* 08C61C 7F057AEC 0C002914 */ jal randomGetNext -/* 08C620 7F057AF0 ADC10008 */ sw $at, 8($t6) -/* 08C624 7F057AF4 44822000 */ mtc1 $v0, $f4 -/* 08C628 7F057AF8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C62C 7F057AFC 04410004 */ bgez $v0, .L7F057B10 -/* 08C630 7F057B00 468021A0 */ cvt.s.w $f6, $f4 -/* 08C634 7F057B04 44814000 */ mtc1 $at, $f8 -/* 08C638 7F057B08 00000000 */ nop -/* 08C63C 7F057B0C 46083180 */ add.s $f6, $f6, $f8 -.L7F057B10: -/* 08C640 7F057B10 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C644 7F057B14 44815000 */ mtc1 $at, $f10 -/* 08C648 7F057B18 3C018005 */ lui $at, %hi(D_80053690) -/* 08C64C 7F057B1C C4323690 */ lwc1 $f18, %lo(D_80053690)($at) -/* 08C650 7F057B20 460A3402 */ mul.s $f16, $f6, $f10 -/* 08C654 7F057B24 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C658 7F057B28 44814000 */ mtc1 $at, $f8 -/* 08C65C 7F057B2C 3C018005 */ lui $at, %hi(D_80053694) -/* 08C660 7F057B30 C42A3694 */ lwc1 $f10, %lo(D_80053694)($at) -/* 08C664 7F057B34 46128102 */ mul.s $f4, $f16, $f18 -/* 08C668 7F057B38 00000000 */ nop -/* 08C66C 7F057B3C 46082182 */ mul.s $f6, $f4, $f8 -/* 08C670 7F057B40 460A3401 */ sub.s $f16, $f6, $f10 -/* 08C674 7F057B44 0C002914 */ jal randomGetNext -/* 08C678 7F057B48 E7B0001C */ swc1 $f16, 0x1c($sp) -/* 08C67C 7F057B4C 44829000 */ mtc1 $v0, $f18 -/* 08C680 7F057B50 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C684 7F057B54 04410004 */ bgez $v0, .L7F057B68 -/* 08C688 7F057B58 46809120 */ cvt.s.w $f4, $f18 -/* 08C68C 7F057B5C 44814000 */ mtc1 $at, $f8 -/* 08C690 7F057B60 00000000 */ nop -/* 08C694 7F057B64 46082100 */ add.s $f4, $f4, $f8 -.L7F057B68: -/* 08C698 7F057B68 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C69C 7F057B6C 44813000 */ mtc1 $at, $f6 -/* 08C6A0 7F057B70 3C018005 */ lui $at, %hi(D_80053698) -/* 08C6A4 7F057B74 C4303698 */ lwc1 $f16, %lo(D_80053698)($at) -/* 08C6A8 7F057B78 46062282 */ mul.s $f10, $f4, $f6 -/* 08C6AC 7F057B7C 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C6B0 7F057B80 44814000 */ mtc1 $at, $f8 -/* 08C6B4 7F057B84 3C018005 */ lui $at, %hi(D_8005369C) -/* 08C6B8 7F057B88 C426369C */ lwc1 $f6, %lo(D_8005369C)($at) -/* 08C6BC 7F057B8C 46105482 */ mul.s $f18, $f10, $f16 -/* 08C6C0 7F057B90 00000000 */ nop -/* 08C6C4 7F057B94 46089102 */ mul.s $f4, $f18, $f8 -/* 08C6C8 7F057B98 46062281 */ sub.s $f10, $f4, $f6 -/* 08C6CC 7F057B9C 0C002914 */ jal randomGetNext -/* 08C6D0 7F057BA0 E7AA0020 */ swc1 $f10, 0x20($sp) -/* 08C6D4 7F057BA4 44828000 */ mtc1 $v0, $f16 -/* 08C6D8 7F057BA8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C6DC 7F057BAC 04410004 */ bgez $v0, .L7F057BC0 -/* 08C6E0 7F057BB0 468084A0 */ cvt.s.w $f18, $f16 -/* 08C6E4 7F057BB4 44814000 */ mtc1 $at, $f8 -/* 08C6E8 7F057BB8 00000000 */ nop -/* 08C6EC 7F057BBC 46089480 */ add.s $f18, $f18, $f8 -.L7F057BC0: -/* 08C6F0 7F057BC0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C6F4 7F057BC4 44812000 */ mtc1 $at, $f4 -/* 08C6F8 7F057BC8 3C018005 */ lui $at, %hi(D_800536A0) -/* 08C6FC 7F057BCC C42A36A0 */ lwc1 $f10, %lo(D_800536A0)($at) -/* 08C700 7F057BD0 46049182 */ mul.s $f6, $f18, $f4 -/* 08C704 7F057BD4 3C013D00 */ li $at, 0x3D000000 # 0.031250 -/* 08C708 7F057BD8 44814000 */ mtc1 $at, $f8 -/* 08C70C 7F057BDC 3C018005 */ lui $at, %hi(D_800536A4) -/* 08C710 7F057BE0 C42436A4 */ lwc1 $f4, %lo(D_800536A4)($at) -/* 08C714 7F057BE4 27A4001C */ addiu $a0, $sp, 0x1c -/* 08C718 7F057BE8 8FA50028 */ lw $a1, 0x28($sp) -/* 08C71C 7F057BEC 460A3402 */ mul.s $f16, $f6, $f10 -/* 08C720 7F057BF0 00000000 */ nop -/* 08C724 7F057BF4 46088482 */ mul.s $f18, $f16, $f8 -/* 08C728 7F057BF8 46049181 */ sub.s $f6, $f18, $f4 -/* 08C72C 7F057BFC 0FC161C5 */ jal matrix_4x4_set_rotation_around_xyz -/* 08C730 7F057C00 E7A60024 */ swc1 $f6, 0x24($sp) -/* 08C734 7F057C04 8FBF0014 */ lw $ra, 0x14($sp) -/* 08C738 7F057C08 27BD0028 */ addiu $sp, $sp, 0x28 -/* 08C73C 7F057C0C 03E00008 */ jr $ra -/* 08C740 7F057C10 00000000 */ nop -) -#endif - + coord.x = RANDOMFRAC() * M_TAU_F * 0.03125f - 0.09817477f; + coord.y = RANDOMFRAC() * M_TAU_F * 0.03125f - 0.09817477f; + coord.z = RANDOMFRAC() * M_TAU_F * 0.03125f - 0.09817477f; +#else + coord.x = RANDOMFRAC() * 7.53982257f * 0.03125f - 0.11780973f; + coord.y = RANDOMFRAC() * 7.53982257f * 0.03125f - 0.11780973f; + coord.z = RANDOMFRAC() * 7.53982257f * 0.03125f - 0.11780973f; #endif + matrix_4x4_set_rotation_around_xyz(&coord, mtx); +} +void sub_GAME_7F057C14(coord3d *coord, Mtxf *mtx) +{ + coord->x = RANDOMFRAC() * 1.6666666f * 4.0f - 3.3333333f; + coord->y = RANDOMFRAC() * 1.6666666f * 4.0f; + coord->z = RANDOMFRAC() * 1.6666666f * 4.0f - 3.3333333f; - - -#ifdef NONMATCHING -void sub_GAME_7F057C14(void) { - + mtxLoadRandomRotation(mtx); } -#else -GLOBAL_ASM( -.late_rodata -glabel D_800536A8 -.word 0x3fd55555 /*1.6666666*/ -glabel D_800536AC -.word 0x40555555 /*3.3333333*/ -glabel D_800536B0 -.word 0x3fd55555 /*1.6666666*/ -glabel D_800536B4 -.word 0x3fd55555 /*1.6666666*/ -glabel D_800536B8 -.word 0x40555555 /*3.3333333*/ -.text -glabel sub_GAME_7F057C14 -/* 08C744 7F057C14 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 08C748 7F057C18 AFBF0014 */ sw $ra, 0x14($sp) -/* 08C74C 7F057C1C AFA40018 */ sw $a0, 0x18($sp) -/* 08C750 7F057C20 0C002914 */ jal randomGetNext -/* 08C754 7F057C24 AFA5001C */ sw $a1, 0x1c($sp) -/* 08C758 7F057C28 44822000 */ mtc1 $v0, $f4 -/* 08C75C 7F057C2C 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C760 7F057C30 04410004 */ bgez $v0, .L7F057C44 -/* 08C764 7F057C34 468021A0 */ cvt.s.w $f6, $f4 -/* 08C768 7F057C38 44814000 */ mtc1 $at, $f8 -/* 08C76C 7F057C3C 00000000 */ nop -/* 08C770 7F057C40 46083180 */ add.s $f6, $f6, $f8 -.L7F057C44: -/* 08C774 7F057C44 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C778 7F057C48 44815000 */ mtc1 $at, $f10 -/* 08C77C 7F057C4C 3C018005 */ lui $at, %hi(D_800536A8) -/* 08C780 7F057C50 C43236A8 */ lwc1 $f18, %lo(D_800536A8)($at) -/* 08C784 7F057C54 460A3402 */ mul.s $f16, $f6, $f10 -/* 08C788 7F057C58 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 08C78C 7F057C5C 44814000 */ mtc1 $at, $f8 -/* 08C790 7F057C60 3C018005 */ lui $at, %hi(D_800536AC) -/* 08C794 7F057C64 C42A36AC */ lwc1 $f10, %lo(D_800536AC)($at) -/* 08C798 7F057C68 8FAE0018 */ lw $t6, 0x18($sp) -/* 08C79C 7F057C6C 46128102 */ mul.s $f4, $f16, $f18 -/* 08C7A0 7F057C70 00000000 */ nop -/* 08C7A4 7F057C74 46082182 */ mul.s $f6, $f4, $f8 -/* 08C7A8 7F057C78 460A3401 */ sub.s $f16, $f6, $f10 -/* 08C7AC 7F057C7C 0C002914 */ jal randomGetNext -/* 08C7B0 7F057C80 E5D00000 */ swc1 $f16, ($t6) -/* 08C7B4 7F057C84 44829000 */ mtc1 $v0, $f18 -/* 08C7B8 7F057C88 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C7BC 7F057C8C 04410004 */ bgez $v0, .L7F057CA0 -/* 08C7C0 7F057C90 46809120 */ cvt.s.w $f4, $f18 -/* 08C7C4 7F057C94 44814000 */ mtc1 $at, $f8 -/* 08C7C8 7F057C98 00000000 */ nop -/* 08C7CC 7F057C9C 46082100 */ add.s $f4, $f4, $f8 -.L7F057CA0: -/* 08C7D0 7F057CA0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C7D4 7F057CA4 44813000 */ mtc1 $at, $f6 -/* 08C7D8 7F057CA8 3C018005 */ lui $at, %hi(D_800536B0) -/* 08C7DC 7F057CAC C43036B0 */ lwc1 $f16, %lo(D_800536B0)($at) -/* 08C7E0 7F057CB0 46062282 */ mul.s $f10, $f4, $f6 -/* 08C7E4 7F057CB4 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 08C7E8 7F057CB8 44814000 */ mtc1 $at, $f8 -/* 08C7EC 7F057CBC 8FAF0018 */ lw $t7, 0x18($sp) -/* 08C7F0 7F057CC0 46105482 */ mul.s $f18, $f10, $f16 -/* 08C7F4 7F057CC4 00000000 */ nop -/* 08C7F8 7F057CC8 46089102 */ mul.s $f4, $f18, $f8 -/* 08C7FC 7F057CCC 0C002914 */ jal randomGetNext -/* 08C800 7F057CD0 E5E40004 */ swc1 $f4, 4($t7) -/* 08C804 7F057CD4 44823000 */ mtc1 $v0, $f6 -/* 08C808 7F057CD8 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 08C80C 7F057CDC 04410004 */ bgez $v0, .L7F057CF0 -/* 08C810 7F057CE0 468032A0 */ cvt.s.w $f10, $f6 -/* 08C814 7F057CE4 44818000 */ mtc1 $at, $f16 -/* 08C818 7F057CE8 00000000 */ nop -/* 08C81C 7F057CEC 46105280 */ add.s $f10, $f10, $f16 -.L7F057CF0: -/* 08C820 7F057CF0 3C012F80 */ li $at, 0x2F800000 # 0.000000 -/* 08C824 7F057CF4 44819000 */ mtc1 $at, $f18 -/* 08C828 7F057CF8 3C018005 */ lui $at, %hi(D_800536B4) -/* 08C82C 7F057CFC C42436B4 */ lwc1 $f4, %lo(D_800536B4)($at) -/* 08C830 7F057D00 46125202 */ mul.s $f8, $f10, $f18 -/* 08C834 7F057D04 3C014080 */ li $at, 0x40800000 # 4.000000 -/* 08C838 7F057D08 44818000 */ mtc1 $at, $f16 -/* 08C83C 7F057D0C 3C018005 */ lui $at, %hi(D_800536B8) -/* 08C840 7F057D10 C43236B8 */ lwc1 $f18, %lo(D_800536B8)($at) -/* 08C844 7F057D14 8FB80018 */ lw $t8, 0x18($sp) -/* 08C848 7F057D18 46044182 */ mul.s $f6, $f8, $f4 -/* 08C84C 7F057D1C 00000000 */ nop -/* 08C850 7F057D20 46103282 */ mul.s $f10, $f6, $f16 -/* 08C854 7F057D24 46125201 */ sub.s $f8, $f10, $f18 -/* 08C858 7F057D28 E7080008 */ swc1 $f8, 8($t8) -/* 08C85C 7F057D2C 0FC15EB0 */ jal sub_GAME_7F057AC0 -/* 08C860 7F057D30 8FA4001C */ lw $a0, 0x1c($sp) -/* 08C864 7F057D34 8FBF0014 */ lw $ra, 0x14($sp) -/* 08C868 7F057D38 27BD0018 */ addiu $sp, $sp, 0x18 -/* 08C86C 7F057D3C 03E00008 */ jr $ra -/* 08C870 7F057D40 00000000 */ nop -) -#endif - void sub_GAME_7F057D44(f32* arg0, f32* arg1, f32 arg2) diff --git a/src/game/othermodemicrocode.c b/src/game/othermodemicrocode.c index 5af4d9f6..f53b720e 100644 --- a/src/game/othermodemicrocode.c +++ b/src/game/othermodemicrocode.c @@ -86,7 +86,8 @@ s32 ceil1000(s32 arg0) } -s32 sub_GAME_7F0767D8(s32 arg0, s32 arg1, s32 arg2) { +s32 sub_GAME_7F0767D8(s32 arg0, s32 arg1, s32 arg2) +{ s32 ret; ret = 0; @@ -103,7 +104,8 @@ s32 sub_GAME_7F0767D8(s32 arg0, s32 arg1, s32 arg2) { } -s32 sub_GAME_7F076848(s32 arg0, s32 arg1, s32 arg2) { +s32 sub_GAME_7F076848(s32 arg0, s32 arg1, s32 arg2) +{ s32 ret; ret = 0; @@ -120,7 +122,8 @@ s32 sub_GAME_7F076848(s32 arg0, s32 arg1, s32 arg2) { } -s32 sub_GAME_7F0768B8(s32 arg0, s32 arg1, s32 arg2) { +s32 sub_GAME_7F0768B8(s32 arg0, s32 arg1, s32 arg2) +{ s32 ret; ret = 0; @@ -137,7 +140,8 @@ s32 sub_GAME_7F0768B8(s32 arg0, s32 arg1, s32 arg2) { } -s32 sub_GAME_7F076928(s32 arg0, s32 arg1, s32 arg2) { +s32 sub_GAME_7F076928(s32 arg0, s32 arg1, s32 arg2) +{ s32 ret; ret = 0; @@ -298,8 +302,392 @@ void texSetRenderMode(Gfx **gdlptr, s32 arg1, s32 numcycles, s32 arg3) #ifdef NONMATCHING -void likely_generate_DL_for_image_declaration(Gfx**, struct sImageTableEntry*, s32, s32, s32) { +// First pass mips2c output (initial guess at variables, everything compiles). +// Display list commands are probably correct, but almost every single one has wrong arguments. +// https://decomp.me/scratch/Q6Ss8 28% +void likely_generate_DL_for_image_declaration(Gfx **arg0, sImageTableEntry *arg1, s32 arg2, s32 arg3, s32 arg4) +{ + Gfx *sp16C; + u32 sp144; + s32 sp140; + s32 sp13C; + s32 sp138; + s32 sp134; + s32 spD0; + s32 spCC; + s32 spCA; + s32 spC4; + s32 spC0; + s32 spBC; + + struct tex *temp_s6; + + u8 var_s1; + u8 var_s2; + s32 var_s3; + u8 var_s4; + u8 var_s5; + s32 var_a2; + s32 var_v0; + s32 var_s0; + + sp16C = *arg0; + + if (arg1 == NULL) + { + texSetRenderMode(&sp16C, arg2, 1, arg3); + + if (arg3 >= 2) + { + gSPTexture(sp16C++, 0xffff, 0xffff, arg3, G_TX_RENDERTILE, G_ON); + } + else + { + gSPTexture(sp16C++, 0xffff, 0xffff, 0, G_TX_RENDERTILE, G_ON); + } + + gDPSetCombineMode(sp16C++, G_CC_SHADE, G_CC_SHADE); + } + else + { + var_s5 = arg1->width; + var_s4 = arg1->height; + + if ((u32) arg1->index < 0xBB9U) + { + texLoad((s32 *) arg1, NULL); + } + + temp_s6 = texFindInPool((s32) (arg1->index | 0x80000000) - 8, NULL); + + if (arg1->level == 0) + { + if (temp_s6 != NULL) + { + var_s1 = temp_s6->gbiformat; + var_s2 = temp_s6->depth; + sp144 = temp_s6->next; + } + else + { + var_s1 = arg1->format; + var_s2 = arg1->depth; + } + + switch (var_s2) + { + default: /* switch 1 */ + var_s3 = sp13C; + break; + case 3: /* switch 1 */ + sp140 = 3; + var_s3 = sub_GAME_7F076928((s32) var_s5, (s32) var_s4, 1) - 1; + sp138 = ceil1000((s32) var_s5); + sp134 = (s32) (var_s5 + 3) >> 2; + break; + case 2: /* switch 1 */ + sp140 = 2; + var_s3 = sub_GAME_7F0768B8((s32) var_s5, (s32) var_s4, 1) - 1; + sp138 = ceil2000((s32) var_s5); + sp134 = (s32) (var_s5 + 3) >> 2; + break; + case 1: /* switch 1 */ + sp140 = 2; + var_s3 = sub_GAME_7F076848((s32) var_s5, (s32) var_s4, 1) - 1; + sp138 = ceil4000((s32) var_s5); + sp134 = (s32) (var_s5 + 7) >> 3; + break; + case 0: /* switch 1 */ + sp140 = 2; + var_s3 = sub_GAME_7F0767D8((s32) var_s5, (s32) var_s4, 1) - 1; + sp138 = ceil8000((s32) var_s5); + sp134 = (s32) (var_s5 + 0xF) >> 4; + break; + } + + texSetRenderMode(&sp16C, arg2, 1, arg3); + + if (arg3 >= 2) + { + gSPTexture(sp16C++, 0xffff, 0xffff, arg3, G_TX_RENDERTILE, G_ON); + } + else + { + gSPTexture(sp16C++, 0xffff, 0xffff, 0, G_TX_RENDERTILE, G_ON); + } + + gSPTexture(sp16C++, 0, 0, 2, G_TX_RENDERTILE, G_ON); + + // line 206 + switch (var_s1) + { + case 0: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 3: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 4: + gDPSetCombineLERP(sp16C++, TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, SHADE, COMBINED, 0, COMBINED, 0, SHADE); + break; + + case 2: + switch (sp144) + { + case 0x8000: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 0xc000: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + } + break; + } + + // line 264 + // temp_v0_4->words.w0 = (var_s1 & 7) << 0x15 | 0xFD000000 | (sp140 & 3) << 0x13; + // temp_v0_4->words.w1 = arg1->index; + gDPSetTextureImage(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 1, arg1->index); + + // temp_a1->words.w0 = (var_s1 & 7) << 0x15 | 0xF5000000 | (sp140 & 3) << 0x13; + // temp_a1->words.w1 = ((arg1->flagsT & 3) << 0x12) | 0x07000000U | ((arg1->flagsS & 3) << 8); + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + + gDPLoadSync(sp16C++); + + //if (var_s3 < 0x7FF) + //{ + // var_a3 = var_s3; + //} + + // temp_t0->words.w0 = 0xF3000000; + // temp_t0->words.w1 = ((var_a3 & 0xFFF) << 0xC) | 0x07000000U | (sp138 & 0xFFF); + gDPLoadBlock(sp16C++, G_TX_LOADTILE, 0, 0, 0, 0); + + gDPPipeSync(sp16C++); + + if (var_s1 == 2) + { + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPLoadSync(sp16C++); + + // temp_a0_2->words.w0 = ((temp_a2 & 0x3FF) << 0xE) | 0xF0000000 | temp_t6_3; + // temp_a0_2->words.w1 = (((temp_s6->unk0a + temp_a2) & 0x3FF) << 0xE) | 0x07000000U | temp_t6_3; + gDPLoadTLUTCmd(sp16C++, G_TX_LOADTILE, 0); + gDPPipeSync(sp16C++); + + // temp_t8_8->words.w0 = 0xBA000E02; + // temp_t8_8->words.w1 = sp144; + gDPSetTextureLUT(sp16C++, sp144); + } + else + { + gDPSetTextureLUT(sp16C++, G_TT_NONE); + } + + // temp_s0->words.w0 = (var_s1 & 7) << 0x15 | 0xF5000000 | ((var_s2 & 3) << 0x13) | ((sp134 & 0x1FF) << 9); + // temp_s0->words.w1 = ((is_less_than_certain_power_of_2((s32) var_s5) & 0xF) * 0x10) | ((arg1->flagsT & 3) << 0x12) | ((sp58 & 0xF) << 0xE) | ((arg1->flagsS & 3) << 8); + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + + // temp_v1_2->words.w0 = (temp_a0_3 << 0xC) | 0xF2000000 | temp_a0_3; + // temp_v1_2->words.w1 = (((((var_s5 - 1) * 4) + arg4) & 0xFFF) << 0xC) | ((((var_s4 - 1) * 4) + arg4) & 0xFFF); + gDPSetTileSize(sp16C++, G_TX_RENDERTILE, 0, 0, 0, 0); + } + else + { + spD0 = 0; + spCC = (s32) arg1->level; + + if (temp_s6 != NULL) + { + var_s1 = temp_s6->gbiformat; + var_s2 = temp_s6->depth; + spCA = temp_s6->maxlod; + } + else + { + var_s1 = arg1->format; + var_s2 = spC4; + spCA = arg1->depth; + } + + // line 362 + if ((temp_s6 != NULL) && (temp_s6->next & 0x20000000)) + { + sub_GAME_7F0CC9D4(temp_s6, &spC0, &spBC); + } + else if (spCA == 0) + { + spC0 = 2; + spBC = sub_GAME_7F0767D8((s32) var_s5, (s32) var_s4, spCC) - 1; + } + else if (spCA == 1) + { + spC0 = 2; + spBC = sub_GAME_7F076848((s32) var_s5, (s32) var_s4, spCC) - 1; + } + else if (spCA == 2) + { + spC0 = 2; + spBC = sub_GAME_7F0768B8((s32) var_s5, (s32) var_s4, spCC) - 1; + } + else if (spCA == 3) + { + spC0 = 3; + spBC = sub_GAME_7F076928((s32) var_s5, (s32) var_s4, spCC) - 1; + } + + texSetRenderMode(&sp16C, arg2, 2, arg3); + + // line 400 + if (arg3 >= 2) + { + gSPTexture(sp16C++, 0xffff, 0xffff, 0, G_TX_RENDERTILE, G_OFF); + } + else + { + gSPTexture(sp16C++, 0xffff, 0xffff, 1, G_TX_RENDERTILE, G_OFF); + } + + // line 417 + switch (var_s1) + { + case 0: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 3: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 4: + gDPSetCombineLERP(sp16C++, TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, SHADE, COMBINED, 0, COMBINED, 0, SHADE); + break; + + case 2: + switch (var_s2) + { + case 0x8000: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + + case 0xc000: + gDPSetCombineMode(sp16C++, G_CC_MODULATEIA, G_CC_MODULATEIA); + break; + } + break; + } + + // line 478 + // temp_v0_8->words.w0 = (var_s1_2 & 7) << 0x15 | 0xFD000000 | ((spC0 & 3) << 0x13); + // temp_v0_8->words.w1 = arg1->index; + gDPSetTextureImage(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 1, arg1->index); + + // temp_a0_4->words.w0 = (var_s1_2 & 7) << 0x15 | 0xF5000000 | ((spC0 & 3) << 0x13); + // temp_a0_4->words.w1 = 0x07000000; + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + + gDPLoadSync(sp16C++); + + // line 496 + // if (spBC < 0x7FF) + // { + // var_a3_2 = spBC; + // } + + // temp_a2_2->words.w0 = 0xF3000000; + // temp_a2_2->words.w1 = ((var_a3_2 & 0xFFF) << 0xC) | 0x07000000U; + gDPLoadBlock(sp16C++, G_TX_LOADTILE, 0, 0, 0, 0); + + gDPPipeSync(sp16C++); + + // line 505 + if (var_s1 == 2) + { + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPLoadSync(sp16C++); + + // temp_a2_4 = temp_a2_3 - var_a3_3; + + // temp_a0_5->words.w0 = ((temp_a2_4 & 0x3FF) << 0xE) | 0xF0000000 | (var_a3_3 & 0x3FF) * 4; + // temp_a0_5->words.w1 = (((temp_s6->unk0a + temp_a2_4) & 0x3FF) << 0xE) | 0x07000000U | (var_a3_3 & 0x3FF) * 4; + gDPLoadTLUTCmd(sp16C++, G_TX_LOADTILE, 0); + gDPPipeSync(sp16C++); + + // temp_t9_4->words.w0 = 0xBA000E02; + // temp_t9_4->words.w1 = var_s2_2; + gDPSetTextureLUT(sp16C++, var_s2); + } + else + { + gDPSetTextureLUT(sp16C++, G_TT_NONE); + } + + for (var_s1 = 0; var_s1 < spCC; var_s1++) + { + if (var_s1 > 0) + { + if ((temp_s6 != NULL) && (temp_s6->next & 0x20000000)) + { + var_s5 = texGetWidthAtLod(temp_s6, var_s1); + var_s4 = texGetHeightAtLod(temp_s6, var_s1); + } + else + { + if ((s32) var_s5 >= 2) + { + var_s5 = (u8) ((s32) var_s5 >> 1); + } + + if ((s32) var_s4 >= 2) + { + var_s4 = (u8) ((s32) var_s4 >> 1); + } + } + } + + switch (spCA) + { + default: + var_v0 = ((var_s0 & 0x1FF) << 9); + var_a2 = var_s0 * var_s4; + break; + case 3: + var_s0 = (s32) (var_s5 + 3) / 4; + var_v0 = ((var_s0 & 0x1FF) << 9); + var_a2 = var_s0 * var_s4; + break; + case 2: + var_s0 = (s32) (var_s5 + 3) / 4; + var_v0 = ((var_s0 & 0x1FF) << 9); + var_a2 = var_s0 * var_s4; + break; + case 1: + var_s0 = (s32) (var_s5 + 7) / 8; + var_v0 = ((var_s0 & 0x1FF) << 9); + var_a2 = var_s0 * var_s4; + break; + case 0: + var_s0 = (s32) (var_s5 + 0xF) / 16; + var_v0 = ((var_s0 & 0x1FF) << 9); + var_a2 = var_s0 * var_s4; + break; + } + + gDPSetTile(sp16C++, G_IM_FMT_RGBA, G_IM_SIZ_4b, is_less_than_certain_power_of_2(var_s5), 0x0000, G_TX_RENDERTILE, var_v0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTileSize(sp16C++, G_TX_RENDERTILE, 0, arg4, var_s5 - 1, var_s4 - 1); + + spD0 += var_a2; + } + } + + } + + *arg0 = sp16C; } #else GLOBAL_ASM( diff --git a/src/game/padhalllv.c b/src/game/padhalllv.c index 3ee2ab5a..1e12503e 100644 --- a/src/game/padhalllv.c +++ b/src/game/padhalllv.c @@ -8,138 +8,79 @@ //all ge versions align properly -#ifdef NONMATCHING -void sub_GAME_7F08EBD0(void) { +waypoint *sub_GAME_7F08EBD0(coord3d *pos, s32 arg1) +{ + waypoint *head; + PadRecord *pad; + f32 sqrdist; + f32 compare; + waypoint *node; + waypoint *ret; + + head = g_CurrentSetup.pathwaypoints; + ret = NULL; + + if (head) + { + node = head; + compare = -1.0f; + while (node->padID >= 0) + { + pad = &g_CurrentSetup.pads[node->padID]; + sqrdist = ((pos->z - pad->pos.z) * (pos->z - pad->pos.z)) + + ((pos->x - pad->pos.x) * (pos->x - pad->pos.x)); + + if ((compare < 0.0f) || (sqrdist < compare)) + { + compare = sqrdist; + ret = node; + } + + node++; + } + } + return ret; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08EBD0 -/* 0C3700 7F08EBD0 3C028007 */ lui $v0, %hi(g_CurrentSetup+0) -/* 0C3704 7F08EBD4 8C425D00 */ lw $v0, %lo(g_CurrentSetup+0)($v0) -/* 0C3708 7F08EBD8 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 0C370C 7F08EBDC F7B40008 */ sdc1 $f20, 8($sp) -/* 0C3710 7F08EBE0 AFA50014 */ sw $a1, 0x14($sp) -/* 0C3714 7F08EBE4 00803825 */ move $a3, $a0 -/* 0C3718 7F08EBE8 10400024 */ beqz $v0, .L7F08EC7C -/* 0C371C 7F08EBEC 00001825 */ move $v1, $zero -/* 0C3720 7F08EBF0 8C4E0000 */ lw $t6, ($v0) -/* 0C3724 7F08EBF4 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0C3728 7F08EBF8 44810000 */ mtc1 $at, $f0 -/* 0C372C 7F08EBFC 05C0001F */ bltz $t6, .L7F08EC7C -/* 0C3730 7F08EC00 00402025 */ move $a0, $v0 -/* 0C3734 7F08EC04 3C068007 */ lui $a2, %hi(g_CurrentSetup+0x18) -/* 0C3738 7F08EC08 C4EC0008 */ lwc1 $f12, 8($a3) -/* 0C373C 7F08EC0C C4F00000 */ lwc1 $f16, ($a3) -/* 0C3740 7F08EC10 4480A000 */ mtc1 $zero, $f20 -/* 0C3744 7F08EC14 2407002C */ li $a3, 44 -/* 0C3748 7F08EC18 8CC65D18 */ lw $a2, %lo(g_CurrentSetup+0x18)($a2) -/* 0C374C 7F08EC1C 8C450000 */ lw $a1, ($v0) -.L7F08EC20: -/* 0C3750 7F08EC20 00A70019 */ multu $a1, $a3 -/* 0C3754 7F08EC24 4614003C */ c.lt.s $f0, $f20 -/* 0C3758 7F08EC28 00007812 */ mflo $t7 -/* 0C375C 7F08EC2C 01E61021 */ addu $v0, $t7, $a2 -/* 0C3760 7F08EC30 C4440008 */ lwc1 $f4, 8($v0) -/* 0C3764 7F08EC34 C4460000 */ lwc1 $f6, ($v0) -/* 0C3768 7F08EC38 46046381 */ sub.s $f14, $f12, $f4 -/* 0C376C 7F08EC3C 46068481 */ sub.s $f18, $f16, $f6 -/* 0C3770 7F08EC40 460E7202 */ mul.s $f8, $f14, $f14 -/* 0C3774 7F08EC44 00000000 */ nop -/* 0C3778 7F08EC48 46129282 */ mul.s $f10, $f18, $f18 -/* 0C377C 7F08EC4C 45010005 */ bc1t .L7F08EC64 -/* 0C3780 7F08EC50 460A4080 */ add.s $f2, $f8, $f10 -/* 0C3784 7F08EC54 4600103C */ c.lt.s $f2, $f0 -/* 0C3788 7F08EC58 00000000 */ nop -/* 0C378C 7F08EC5C 45020004 */ bc1fl .L7F08EC70 -/* 0C3790 7F08EC60 8C850010 */ lw $a1, 0x10($a0) -.L7F08EC64: -/* 0C3794 7F08EC64 46001006 */ mov.s $f0, $f2 -/* 0C3798 7F08EC68 00801825 */ move $v1, $a0 -/* 0C379C 7F08EC6C 8C850010 */ lw $a1, 0x10($a0) -.L7F08EC70: -/* 0C37A0 7F08EC70 24840010 */ addiu $a0, $a0, 0x10 -/* 0C37A4 7F08EC74 04A1FFEA */ bgez $a1, .L7F08EC20 -/* 0C37A8 7F08EC78 00000000 */ nop -.L7F08EC7C: -/* 0C37AC 7F08EC7C D7B40008 */ ldc1 $f20, 8($sp) -/* 0C37B0 7F08EC80 27BD0010 */ addiu $sp, $sp, 0x10 -/* 0C37B4 7F08EC84 03E00008 */ jr $ra -/* 0C37B8 7F08EC88 00601025 */ move $v0, $v1 -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F08EC8C(void) { + +waypoint* sub_GAME_7F08EC8C(coord3d* pos, s32 arg1, waypoint* arg2) +{ + PadRecord* pad; + f32 sqrdist2; + f32 sqrdist; + s32* neighbor; + waypoint* node; + waypoint* ret; + waypoint* waypoints; + + neighbor = arg2->neighbours; + ret = arg2; + + if (neighbor != NULL) + { + pad = &g_CurrentSetup.pads[arg2->padID]; + sqrdist = ((pos->z - pad->pos.z) * (pos->z - pad->pos.z)) + + ((pos->x - pad->pos.x) * (pos->x - pad->pos.x)); + waypoints = g_CurrentSetup.pathwaypoints; + + while (*neighbor >= 0) + { + node = &waypoints[*neighbor]; + pad = &g_CurrentSetup.pads[node->padID]; + sqrdist2 = ((pos->z - pad->pos.z) * (pos->z - pad->pos.z)) + + ((pos->x - pad->pos.x) * (pos->x - pad->pos.x)); + + if (sqrdist2 < sqrdist) + { + sqrdist = sqrdist2; + ret = node; + } + neighbor++; + } + } + return ret; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08EC8C -/* 0C37BC 7F08EC8C AFA50004 */ sw $a1, 4($sp) -/* 0C37C0 7F08EC90 8CC20004 */ lw $v0, 4($a2) -/* 0C37C4 7F08EC94 00803825 */ move $a3, $a0 -/* 0C37C8 7F08EC98 00C01825 */ move $v1, $a2 -/* 0C37CC 7F08EC9C 1040002E */ beqz $v0, .L7F08ED58 -/* 0C37D0 7F08ECA0 00000000 */ nop -/* 0C37D4 7F08ECA4 8CCE0000 */ lw $t6, ($a2) -/* 0C37D8 7F08ECA8 240A002C */ li $t2, 44 -/* 0C37DC 7F08ECAC 3C0B8007 */ lui $t3, %hi(g_CurrentSetup+0) -/* 0C37E0 7F08ECB0 01CA0019 */ multu $t6, $t2 -/* 0C37E4 7F08ECB4 256B5D00 */ addiu $t3, %lo(g_CurrentSetup+0) # addiu $t3, $t3, 0x5d00 -/* 0C37E8 7F08ECB8 8D650018 */ lw $a1, 0x18($t3) -/* 0C37EC 7F08ECBC C4E20008 */ lwc1 $f2, 8($a3) -/* 0C37F0 7F08ECC0 C4EE0000 */ lwc1 $f14, ($a3) -/* 0C37F4 7F08ECC4 8C490000 */ lw $t1, ($v0) -/* 0C37F8 7F08ECC8 8D680000 */ lw $t0, ($t3) -/* 0C37FC 7F08ECCC 00007812 */ mflo $t7 -/* 0C3800 7F08ECD0 01E52021 */ addu $a0, $t7, $a1 -/* 0C3804 7F08ECD4 C4840008 */ lwc1 $f4, 8($a0) -/* 0C3808 7F08ECD8 C4860000 */ lwc1 $f6, ($a0) -/* 0C380C 7F08ECDC 46041301 */ sub.s $f12, $f2, $f4 -/* 0C3810 7F08ECE0 46067401 */ sub.s $f16, $f14, $f6 -/* 0C3814 7F08ECE4 460C6202 */ mul.s $f8, $f12, $f12 -/* 0C3818 7F08ECE8 00000000 */ nop -/* 0C381C 7F08ECEC 46108282 */ mul.s $f10, $f16, $f16 -/* 0C3820 7F08ECF0 05200019 */ bltz $t1, .L7F08ED58 -/* 0C3824 7F08ECF4 460A4000 */ add.s $f0, $f8, $f10 -/* 0C3828 7F08ECF8 0009C100 */ sll $t8, $t1, 4 -.L7F08ECFC: -/* 0C382C 7F08ECFC 03083021 */ addu $a2, $t8, $t0 -/* 0C3830 7F08ED00 8CD90000 */ lw $t9, ($a2) -/* 0C3834 7F08ED04 032A0019 */ multu $t9, $t2 -/* 0C3838 7F08ED08 00006012 */ mflo $t4 -/* 0C383C 7F08ED0C 01852021 */ addu $a0, $t4, $a1 -/* 0C3840 7F08ED10 C4840008 */ lwc1 $f4, 8($a0) -/* 0C3844 7F08ED14 C4860000 */ lwc1 $f6, ($a0) -/* 0C3848 7F08ED18 46041301 */ sub.s $f12, $f2, $f4 -/* 0C384C 7F08ED1C 46067401 */ sub.s $f16, $f14, $f6 -/* 0C3850 7F08ED20 460C6202 */ mul.s $f8, $f12, $f12 -/* 0C3854 7F08ED24 00000000 */ nop -/* 0C3858 7F08ED28 46108282 */ mul.s $f10, $f16, $f16 -/* 0C385C 7F08ED2C 460A4480 */ add.s $f18, $f8, $f10 -/* 0C3860 7F08ED30 4600903C */ c.lt.s $f18, $f0 -/* 0C3864 7F08ED34 00000000 */ nop -/* 0C3868 7F08ED38 45000003 */ bc1f .L7F08ED48 -/* 0C386C 7F08ED3C 00000000 */ nop -/* 0C3870 7F08ED40 46009006 */ mov.s $f0, $f18 -/* 0C3874 7F08ED44 00C01825 */ move $v1, $a2 -.L7F08ED48: -/* 0C3878 7F08ED48 8C490004 */ lw $t1, 4($v0) -/* 0C387C 7F08ED4C 24420004 */ addiu $v0, $v0, 4 -/* 0C3880 7F08ED50 0523FFEA */ bgezl $t1, .L7F08ECFC -/* 0C3884 7F08ED54 0009C100 */ sll $t8, $t1, 4 -.L7F08ED58: -/* 0C3888 7F08ED58 03E00008 */ jr $ra -/* 0C388C 7F08ED5C 00601025 */ move $v0, $v1 -) -#endif waygroup *sub_GAME_7F08ED60(s32 *groupnums, s32 value) @@ -255,80 +196,35 @@ bool sub_GAME_7F08EF1C(waygroup *from, waygroup *to, waygroup *groups) } -#ifdef NONMATCHING -// unused and similar to waypointFindRoute -void sub_GAME_7F08EFA0(void) { +s32 sub_GAME_7F08EFA0(waygroup* from, waygroup* to, waygroup** arr, s32 arrlen) +{ + waygroup **arrptr = arr; + waygroup *curfrom; + s32 i; + + if (arrlen >= 2 && g_CurrentSetup.waypointgroups && sub_GAME_7F08EF1C(from, to, g_CurrentSetup.waypointgroups) != 0) + { + *arr = from; + arrptr++; + + curfrom = from; + arrlen += 9999; + i = 10001; + while (i <= to->dist && i < arrlen) + { + curfrom = sub_GAME_7F08ED60(curfrom->neighbours, i); + *arrptr = curfrom; + arrptr++; + i++; + } + } + + *arrptr = NULL; + arrptr++; + + return arrptr - arr; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F08EFA0 -/* 0C3AD0 7F08EFA0 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0C3AD4 7F08EFA4 AFB40028 */ sw $s4, 0x28($sp) -/* 0C3AD8 7F08EFA8 AFB30024 */ sw $s3, 0x24($sp) -/* 0C3ADC 7F08EFAC AFB1001C */ sw $s1, 0x1c($sp) -/* 0C3AE0 7F08EFB0 28E10002 */ slti $at, $a3, 2 -/* 0C3AE4 7F08EFB4 00E09825 */ move $s3, $a3 -/* 0C3AE8 7F08EFB8 00A0A025 */ move $s4, $a1 -/* 0C3AEC 7F08EFBC AFBF002C */ sw $ra, 0x2c($sp) -/* 0C3AF0 7F08EFC0 AFB20020 */ sw $s2, 0x20($sp) -/* 0C3AF4 7F08EFC4 AFB00018 */ sw $s0, 0x18($sp) -/* 0C3AF8 7F08EFC8 AFA60038 */ sw $a2, 0x38($sp) -/* 0C3AFC 7F08EFCC 14200022 */ bnez $at, .L7F08F058 -/* 0C3B00 7F08EFD0 00C08825 */ move $s1, $a2 -/* 0C3B04 7F08EFD4 3C068007 */ lui $a2, %hi(g_CurrentSetup+4) -/* 0C3B08 7F08EFD8 8CC65D04 */ lw $a2, %lo(g_CurrentSetup+4)($a2) -/* 0C3B0C 7F08EFDC 50C0001F */ beql $a2, $zero, .L7F08F05C -/* 0C3B10 7F08EFE0 AE200000 */ sw $zero, ($s1) -/* 0C3B14 7F08EFE4 0FC23BC7 */ jal sub_GAME_7F08EF1C -/* 0C3B18 7F08EFE8 AFA40030 */ sw $a0, 0x30($sp) -/* 0C3B1C 7F08EFEC 1040001A */ beqz $v0, .L7F08F058 -/* 0C3B20 7F08EFF0 8FA40030 */ lw $a0, 0x30($sp) -/* 0C3B24 7F08EFF4 8FA20038 */ lw $v0, 0x38($sp) -/* 0C3B28 7F08EFF8 00809025 */ move $s2, $a0 -/* 0C3B2C 7F08EFFC 2673270F */ addiu $s3, $s3, 0x270f -/* 0C3B30 7F08F000 AC440000 */ sw $a0, ($v0) -/* 0C3B34 7F08F004 8E8E0008 */ lw $t6, 8($s4) -/* 0C3B38 7F08F008 24102711 */ li $s0, 10001 -/* 0C3B3C 7F08F00C 24510004 */ addiu $s1, $v0, 4 -/* 0C3B40 7F08F010 29C12711 */ slti $at, $t6, 0x2711 -/* 0C3B44 7F08F014 14200010 */ bnez $at, .L7F08F058 -/* 0C3B48 7F08F018 2A612712 */ slti $at, $s3, 0x2712 -/* 0C3B4C 7F08F01C 5420000F */ bnezl $at, .L7F08F05C -/* 0C3B50 7F08F020 AE200000 */ sw $zero, ($s1) -/* 0C3B54 7F08F024 8E440000 */ lw $a0, ($s2) -.L7F08F028: -/* 0C3B58 7F08F028 0FC23B58 */ jal sub_GAME_7F08ED60 -/* 0C3B5C 7F08F02C 02002825 */ move $a1, $s0 -/* 0C3B60 7F08F030 AE220000 */ sw $v0, ($s1) -/* 0C3B64 7F08F034 8E8F0008 */ lw $t7, 8($s4) -/* 0C3B68 7F08F038 26100001 */ addiu $s0, $s0, 1 -/* 0C3B6C 7F08F03C 00409025 */ move $s2, $v0 -/* 0C3B70 7F08F040 01F0082A */ slt $at, $t7, $s0 -/* 0C3B74 7F08F044 14200004 */ bnez $at, .L7F08F058 -/* 0C3B78 7F08F048 26310004 */ addiu $s1, $s1, 4 -/* 0C3B7C 7F08F04C 0213082A */ slt $at, $s0, $s3 -/* 0C3B80 7F08F050 5420FFF5 */ bnezl $at, .L7F08F028 -/* 0C3B84 7F08F054 8E440000 */ lw $a0, ($s2) -.L7F08F058: -/* 0C3B88 7F08F058 AE200000 */ sw $zero, ($s1) -.L7F08F05C: -/* 0C3B8C 7F08F05C 8FB80038 */ lw $t8, 0x38($sp) -/* 0C3B90 7F08F060 26310004 */ addiu $s1, $s1, 4 -/* 0C3B94 7F08F064 8FBF002C */ lw $ra, 0x2c($sp) -/* 0C3B98 7F08F068 02381023 */ subu $v0, $s1, $t8 -/* 0C3B9C 7F08F06C 0002C883 */ sra $t9, $v0, 2 -/* 0C3BA0 7F08F070 8FB1001C */ lw $s1, 0x1c($sp) -/* 0C3BA4 7F08F074 8FB40028 */ lw $s4, 0x28($sp) -/* 0C3BA8 7F08F078 8FB30024 */ lw $s3, 0x24($sp) -/* 0C3BAC 7F08F07C 8FB20020 */ lw $s2, 0x20($sp) -/* 0C3BB0 7F08F080 8FB00018 */ lw $s0, 0x18($sp) -/* 0C3BB4 7F08F084 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0C3BB8 7F08F088 03E00008 */ jr $ra -/* 0C3BBC 7F08F08C 03201025 */ move $v0, $t9 -) -#endif waypoint *findPadWithDistAndSet(s32 *pointnums, s32 arg1, s32 groupnum) diff --git a/src/game/player.c b/src/game/player.c index 7b03df41..18d84046 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -45,7 +45,7 @@ void sub_GAME_7F093880(f32 offset_x, f32 offset_y, coord3d* out) { screen_top = getPlayer_c_screentop(); coords.y = fogGetCurrentEnvironmentp()->WaterConcavity + (offset_y + screen_top); sub_GAME_7F077EEC(&coords, out, 100.0f); - matrix_4x4_rotate_vector_in_place(player_mtxf, out->f); + mtx4RotateVecInPlace(player_mtxf, out->f); } @@ -794,7 +794,7 @@ Gfx *skyRender(Gfx *gdl) s32 i; s32 unused[3]; - matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), currentPlayerGetMatrix10CC(), &sp3cc); + matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), camGetWorldToScreenMtxf(), &sp3cc); guScaleF(dword_CODE_bss_80079E98.m, 1.0f / scale, 1.0f / scale, 1.0f / scale); matrix_4x4_multiply(&sp3cc, &dword_CODE_bss_80079E98, &sp38c); @@ -1275,7 +1275,7 @@ Gfx *skyRender(Gfx *gdl) s32 i; s32 stack[2]; - matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), currentPlayerGetMatrix10CC(), &sp1ec); + matrix_4x4_multiply(currentPlayerGetProjectionMatrixF(), camGetWorldToScreenMtxf(), &sp1ec); guScaleF(dword_CODE_bss_80079E98.m, 1.0f / scale, 1.0f / scale, 1.0f / scale); matrix_4x4_multiply(&sp1ec, &dword_CODE_bss_80079E98, &sp1ac); diff --git a/src/game/player_2.c b/src/game/player_2.c index eb8f2357..737a43ec 100644 --- a/src/game/player_2.c +++ b/src/game/player_2.c @@ -14,19 +14,19 @@ #define DEFAULT_HEADDAMP 0.9166f #define DEFAULT_HEADLOOKSUM_VAL 11.990406f #define DEFAULT_VIEWPORT_V_VAL 0x220 -#define DEFAULT_C_SCREENHEIGHT 272.0f +#define DEFAULT_C_SCREENHEIGHT (f32)SCREEN_HEIGHT #define DEFAULT_C_HALFHEIGHT 136.0f -#define DEFAULT_SCREENYMAXF 272.0f -#define DEFAULT_ASPECT 1.1764706f +#define DEFAULT_SCREENYMAXF (f32)SCREEN_HEIGHT +#define DEFAULT_ASPECT ASPECT_RATIO #elif defined(VERSION_US) || defined(VERSION_JP) #define DEFAULT_FIELD_3B8_Z 9.999998f #define DEFAULT_HEADDAMP 0.93f #define DEFAULT_HEADLOOKSUM_VAL 14.285716f #define DEFAULT_VIEWPORT_V_VAL 0x1E0 -#define DEFAULT_C_SCREENHEIGHT 240.0f +#define DEFAULT_C_SCREENHEIGHT (f32)SCREEN_HEIGHT #define DEFAULT_C_HALFHEIGHT 120.0f -#define DEFAULT_SCREENYMAXF 240.0f -#define DEFAULT_ASPECT 1.3333334f +#define DEFAULT_SCREENYMAXF (f32)SCREEN_HEIGHT +#define DEFAULT_ASPECT ASPECT_RATIO #endif //newfile per EU @@ -144,12 +144,12 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->field_84 = 0.0f; g_playerPointers[player_num]->field_88 = 0.0f; g_playerPointers[player_num]->field_8C = 0; - g_playerPointers[player_num]->field_90 = 0.0f; + g_playerPointers[player_num]->vertical_bounce_adjust = 0.0f; g_playerPointers[player_num]->field_94 = 0; g_playerPointers[player_num]->field_98 = 0.0f; g_playerPointers[player_num]->swaytarget = 0.0f; - g_playerPointers[player_num]->field_1278 = 0.0f; - g_playerPointers[player_num]->field_127C = 0.0f; + g_playerPointers[player_num]->swayoffset0 = 0.0f; + g_playerPointers[player_num]->swayoffset2 = 0.0f; g_playerPointers[player_num]->crouchpos = 2; g_playerPointers[player_num]->autocrouchpos = 2; g_playerPointers[player_num]->ducking_height_offset = 0.0f; @@ -178,17 +178,20 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->insightaimmode = 0; g_playerPointers[player_num]->autoyaimenabled = 1; g_playerPointers[player_num]->autoaimy = 0.0f; - g_playerPointers[player_num]->autoyaimtime = 0; + g_playerPointers[player_num]->autoaim_target_y = NULL; g_playerPointers[player_num]->autoyaimtime60 = -1; g_playerPointers[player_num]->autoxaimenabled = 1; g_playerPointers[player_num]->autoaimx = 0.0f; - g_playerPointers[player_num]->autoxaimtime = 0; + g_playerPointers[player_num]->autoaim_target_x = NULL; g_playerPointers[player_num]->autoxaimtime60 = -1; g_playerPointers[player_num]->vv_theta = 0.0f; g_playerPointers[player_num]->speedtheta = 0.0f; g_playerPointers[player_num]->vv_costheta = 1.0f; g_playerPointers[player_num]->vv_sintheta = 0.0f; g_playerPointers[player_num]->vv_verta = -4.0f; + // @bug + // -229.1831 degrees = -4 radians + // This doesn't matter, because bondviewApplyVertaTheta overwrites vv_verta360 with the value from vv_verta g_playerPointers[player_num]->vv_verta360 = -229.1831f; g_playerPointers[player_num]->speedverta = 0.0f; g_playerPointers[player_num]->vv_cosverta = 1.0f; @@ -232,7 +235,7 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->step_in_view_watch_animation = 0; g_playerPointers[player_num]->pause_animation_counter = 0.0f; g_playerPointers[player_num]->buttons_pressed = 0; - g_playerPointers[player_num]->field_3B6 = 0; + g_playerPointers[player_num]->prev_buttons_pressed = 0; g_playerPointers[player_num]->field_3B8.x = 0.0f; g_playerPointers[player_num]->field_3B8.y = 0.0f; g_playerPointers[player_num]->field_3B8.z = DEFAULT_FIELD_3B8_Z; @@ -267,44 +270,44 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->headwalkingtime60 = 0; g_playerPointers[player_num]->headamplitude = 1.0f; g_playerPointers[player_num]->sideamplitude = 1.0f; - g_playerPointers[player_num]->headpos[0] = 0.0f; - g_playerPointers[player_num]->headpos[1] = 0.0f; - g_playerPointers[player_num]->headpos[2] = 0.0f; - g_playerPointers[player_num]->headlook[0] = 0.0f; - g_playerPointers[player_num]->headlook[1] = 0.0f; - g_playerPointers[player_num]->headlook[2] = 1.0f; - g_playerPointers[player_num]->headup[0] = 0.0f; - g_playerPointers[player_num]->headup[1] = 1.0f; - g_playerPointers[player_num]->headup[2] = 0.0f; - g_playerPointers[player_num]->headpossum[0] = 0.0f; - g_playerPointers[player_num]->headpossum[1] = 0.0f; - g_playerPointers[player_num]->headpossum[2] = 0.0f; - g_playerPointers[player_num]->headlooksum[0] = 0.0f; - g_playerPointers[player_num]->headlooksum[1] = 0.0f; - g_playerPointers[player_num]->headlooksum[2] = DEFAULT_HEADLOOKSUM_VAL; - g_playerPointers[player_num]->headupsum[0] = 0.0f; - g_playerPointers[player_num]->headupsum[1] = DEFAULT_HEADLOOKSUM_VAL; - g_playerPointers[player_num]->headupsum[2] = 0.0f; - g_playerPointers[player_num]->headbodyoffset[0] = 0.0f; - g_playerPointers[player_num]->headbodyoffset[1] = 0.0f; - g_playerPointers[player_num]->headbodyoffset[2] = 0.0f; + g_playerPointers[player_num]->headpos.f[0] = 0.0f; + g_playerPointers[player_num]->headpos.f[1] = 0.0f; + g_playerPointers[player_num]->headpos.f[2] = 0.0f; + g_playerPointers[player_num]->headlook.f[0] = 0.0f; + g_playerPointers[player_num]->headlook.f[1] = 0.0f; + g_playerPointers[player_num]->headlook.f[2] = 1.0f; + g_playerPointers[player_num]->headup.f[0] = 0.0f; + g_playerPointers[player_num]->headup.f[1] = 1.0f; + g_playerPointers[player_num]->headup.f[2] = 0.0f; + g_playerPointers[player_num]->headpossum.f[0] = 0.0f; + g_playerPointers[player_num]->headpossum.f[1] = 0.0f; + g_playerPointers[player_num]->headpossum.f[2] = 0.0f; + g_playerPointers[player_num]->headlooksum.f[0] = 0.0f; + g_playerPointers[player_num]->headlooksum.f[1] = 0.0f; + g_playerPointers[player_num]->headlooksum.f[2] = DEFAULT_HEADLOOKSUM_VAL; + g_playerPointers[player_num]->headupsum.f[0] = 0.0f; + g_playerPointers[player_num]->headupsum.f[1] = DEFAULT_HEADLOOKSUM_VAL; + g_playerPointers[player_num]->headupsum.f[2] = 0.0f; + g_playerPointers[player_num]->headbodyoffset.f[0] = 0.0f; + g_playerPointers[player_num]->headbodyoffset.f[1] = 0.0f; + g_playerPointers[player_num]->headbodyoffset.f[2] = 0.0f; g_playerPointers[player_num]->standheight = 0.0f; g_playerPointers[player_num]->standbodyoffset.x = 0.0f; g_playerPointers[player_num]->standbodyoffset.y = 0.0f; g_playerPointers[player_num]->standbodyoffset.z = 0.0f; g_playerPointers[player_num]->standfrac = 0.0f; - g_playerPointers[player_num]->standlook[0][0] = 0.0f; - g_playerPointers[player_num]->standlook[0][1] = 0.0f; - g_playerPointers[player_num]->standlook[0][2] = 1.0f; - g_playerPointers[player_num]->standlook[1][0] = 0.0f; - g_playerPointers[player_num]->standlook[1][1] = 0.0f; - g_playerPointers[player_num]->standlook[1][2] = 1.0f; - g_playerPointers[player_num]->standup[0][0] = 0.0f; - g_playerPointers[player_num]->standup[0][1] = 1.0f; - g_playerPointers[player_num]->standup[0][2] = 0.0f; - g_playerPointers[player_num]->standup[1][0] = 0.0f; - g_playerPointers[player_num]->standup[1][1] = 1.0f; - g_playerPointers[player_num]->standup[1][2] = 0.0f; + g_playerPointers[player_num]->standlook[0].f[0] = 0.0f; + g_playerPointers[player_num]->standlook[0].f[1] = 0.0f; + g_playerPointers[player_num]->standlook[0].f[2] = 1.0f; + g_playerPointers[player_num]->standlook[1].f[0] = 0.0f; + g_playerPointers[player_num]->standlook[1].f[1] = 0.0f; + g_playerPointers[player_num]->standlook[1].f[2] = 1.0f; + g_playerPointers[player_num]->standup[0].f[0] = 0.0f; + g_playerPointers[player_num]->standup[0].f[1] = 1.0f; + g_playerPointers[player_num]->standup[0].f[2] = 0.0f; + g_playerPointers[player_num]->standup[1].f[0] = 0.0f; + g_playerPointers[player_num]->standup[1].f[1] = 1.0f; + g_playerPointers[player_num]->standup[1].f[2] = 0.0f; g_playerPointers[player_num]->standcnt = 0; for (i = 0; i < 2; i++) @@ -344,12 +347,12 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->field_FD0 = 0; g_playerPointers[player_num]->z_trigger_timer = 0; g_playerPointers[player_num]->field_FD8 = 0; - g_playerPointers[player_num]->field_FDC = 0xFF; - g_playerPointers[player_num]->field_FDD = 0xFF; - g_playerPointers[player_num]->field_FDE = 0xFF; - g_playerPointers[player_num]->field_FDF = 0; + g_playerPointers[player_num]->tileColor.rgba[0] = 0xFF; + g_playerPointers[player_num]->tileColor.rgba[1] = 0xFF; + g_playerPointers[player_num]->tileColor.rgba[2] = 0xFF; + g_playerPointers[player_num]->tileColor.rgba[3] = 0; g_playerPointers[player_num]->resetshadecol = 1; - g_playerPointers[player_num]->field_FE4 = 0; + g_playerPointers[player_num]->aimtype = 0; g_playerPointers[player_num]->crosshair_angle.x = 0.0f; g_playerPointers[player_num]->crosshair_angle.y = 0.0f; g_playerPointers[player_num]->crosshair_x_pos = 0.0f; @@ -361,11 +364,11 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->gun_azimuth_turning = 0.0f; g_playerPointers[player_num]->gunaimdamp = 0.9f; g_playerPointers[player_num]->field_1010.x = 0.0f; - g_playerPointers[player_num]->field_1010.y = -3.1415927f; + g_playerPointers[player_num]->field_1010.y = -M_PI_F; g_playerPointers[player_num]->field_1010.z = 0.0f; g_playerPointers[player_num]->last_z_trigger_timer = 0; g_playerPointers[player_num]->copiedgoldeneye = 0; - g_playerPointers[player_num]->ammodispflags = 0; + g_playerPointers[player_num]->gunammooff = 0; g_playerPointers[player_num]->gunsync = 0.0f; g_playerPointers[player_num]->syncchange = 0.0f; g_playerPointers[player_num]->synccount = 0.0f; @@ -431,7 +434,7 @@ void initBONDdataforPlayer(s32 player_num) g_playerPointers[player_num]->players_cur_animation = 0; g_playerPointers[player_num]->field_1288 = 0.0f; g_playerPointers[player_num]->bondinvincible = 0; - g_playerPointers[player_num]->field_29B8 = 7; + g_playerPointers[player_num]->healthDamageType = 7; g_playerPointers[player_num]->field_29BC = 1.0f; g_playerPointers[player_num]->field_29C0 = 0.0f; g_playerPointers[player_num]->mpmenuon = 0; @@ -473,8 +476,7 @@ s32 get_cur_playernum(void) { return player_num; } - -s32 sub_GAME_7F09B15C( PropRecord* prop) +s32 getPlayerPointerIndex(PropRecord* prop) { s32 i; @@ -509,7 +511,7 @@ void set_cur_player_viewport_size(u32 ulx, u32 uly) { } void set_cur_player_fovy(f32 fovy) { - #ifdef XBLADEBUG + #ifdef XBLADEBUG if (g_CurrentPlayer == NULL) { assertPrint_8291E690(".\\ported\\player.cpp",0x26a,"Assertion failed: g_CurrentPlayer"); } @@ -536,314 +538,73 @@ f32 get_cur_player_fovy(void) { } - - - - -#ifdef NONMATCHING - -/* looks vaguely like this, couldn't quite get there */ -PROP sub_GAME_7F09B244(ITEM_IDS arg0) +PROP getPropForHeldItem(ITEM_IDS arg0) { PROP ret = -1; switch (arg0) { - case ITEM_KNIFE: return PROP_CHRKNIFE; /* weapon_multi_hunting_knife */ - case ITEM_WPPK: return PROP_CHRWPPK; /* weapon_multi_pp7 */ - case ITEM_SKORPION: return PROP_CHRSKORPION; /* weapon_multi_klobb */ - case ITEM_AK47: return PROP_CHRKALASH; /* weapon_multi_kf7 */ - case ITEM_UZI: return PROP_CHRUZI; /* weapon_multi_zmg */ - case ITEM_MP5K: return PROP_CHRMP5K; /* weapon_multi_d5k */ - case ITEM_SPECTRE: return PROP_CHRSPECTRE; /* weapon_multi_phantom */ - case ITEM_M16: return PROP_CHRM16; /* weapon_multi_ar33 */ - case ITEM_FNP90: return PROP_CHRFNP90; /* weapon_multi_rcp90 */ - case ITEM_SHOTGUN: return PROP_CHRSHOTGUN; /* weapon_multi_shotgun */ - case ITEM_GRENADELAUNCH: return PROP_CHRGRENADELAUNCH; /* weapon_multi_grenade_laun */ - case ITEM_GRENADE: return PROP_CHRGRENADE; /* weapon_multi_hand */ - case ITEM_REMOTEMINE: return PROP_CHRREMOTEMINE; /* weapon_multi_remote */ - case ITEM_PROXIMITYMINE: return PROP_CHRPROXIMITYMINE; /* weapon_multi_prox */ - case ITEM_TIMEDMINE: return PROP_CHRTIMEDMINE; /* weapon_multi_timed */ - case ITEM_RUGER: return PROP_CHRRUGER; /* weapon_multi_cougar */ - case ITEM_LASER: return PROP_CHRLASER; /* weapon_multi_moonraker */ - case ITEM_SNIPERRIFLE: return PROP_CHRSNIPERRIFLE; /* weapon_multi_sniper */ - case ITEM_MP5KSIL: return PROP_CHRMP5KSIL; /* weapon_multi_d5k_silent */ - case ITEM_TT33: return PROP_CHRTT33; /* weapon_multi_dd44 */ - case ITEM_WPPKSIL: return PROP_CHRWPPKSIL; /* weapon_multi_pp7_silent */ - case ITEM_THROWKNIFE: return PROP_CHRTHROWKNIFE; /* weapon_multi_throwing_knife */ - case ITEM_AUTOSHOT: return PROP_CHRAUTOSHOT; /* weapon_multi_auto_shot */ - case ITEM_ROCKETLAUNCH: return PROP_CHRROCKETLAUNCH; /* weapon_multi_rocket_launch */ - case ITEM_GOLDENGUN: return PROP_CHRGOLDEN; /* weapon_multi_goldengun */ - case ITEM_SILVERWPPK: return PROP_CHRWPPK; /* weapon_multi_pp7_special1 */ - case ITEM_GOLDWPPK: return PROP_CHRWPPK; /* weapon_multi_pp7_special2 */ - case ITEM_TOKEN: ret = PROP_FLAG; - /* weapon_multi_none */ - case ITEM_UNARMED: - case ITEM_FIST: - default: - return ret; + case ITEM_KNIFE: ret = PROP_CHRKNIFE; break; /* weapon_multi_hunting_knife */ + case ITEM_WPPK: ret = PROP_CHRWPPK; break; /* weapon_multi_pp7 */ + case ITEM_SKORPION: ret = PROP_CHRSKORPION; break; /* weapon_multi_klobb */ + case ITEM_AK47: ret = PROP_CHRKALASH; break; /* weapon_multi_kf7 */ + case ITEM_UZI: ret = PROP_CHRUZI; break; /* weapon_multi_zmg */ + case ITEM_MP5K: ret = PROP_CHRMP5K; break; /* weapon_multi_d5k */ + case ITEM_SPECTRE: ret = PROP_CHRSPECTRE; break; /* weapon_multi_phantom */ + case ITEM_M16: ret = PROP_CHRM16; break; /* weapon_multi_ar33 */ + case ITEM_FNP90: ret = PROP_CHRFNP90; break; /* weapon_multi_rcp90 */ + case ITEM_SHOTGUN: ret = PROP_CHRSHOTGUN; break; /* weapon_multi_shotgun */ + case ITEM_GRENADELAUNCH: ret = PROP_CHRGRENADELAUNCH; break; /* weapon_multi_grenade_laun */ + case ITEM_GRENADE: ret = PROP_CHRGRENADE; break; /* weapon_multi_hand */ + case ITEM_REMOTEMINE: ret = PROP_CHRREMOTEMINE; break; /* weapon_multi_remote */ + case ITEM_PROXIMITYMINE: ret = PROP_CHRPROXIMITYMINE; break; /* weapon_multi_prox */ + case ITEM_TIMEDMINE: ret = PROP_CHRTIMEDMINE; break; /* weapon_multi_timed */ + case ITEM_RUGER: ret = PROP_CHRRUGER; break; /* weapon_multi_cougar */ + case ITEM_LASER: ret = PROP_CHRLASER; break; /* weapon_multi_moonraker */ + case ITEM_SNIPERRIFLE: ret = PROP_CHRSNIPERRIFLE; break; /* weapon_multi_sniper */ + case ITEM_MP5KSIL: ret = PROP_CHRMP5KSIL; break; /* weapon_multi_d5k_silent */ + case ITEM_TT33: ret = PROP_CHRTT33; break; /* weapon_multi_dd44 */ + case ITEM_WPPKSIL: ret = PROP_CHRWPPKSIL; break; /* weapon_multi_pp7_silent */ + case ITEM_THROWKNIFE: ret = PROP_CHRTHROWKNIFE; break; /* weapon_multi_throwing_knife */ + case ITEM_AUTOSHOT: ret = PROP_CHRAUTOSHOT; break; /* weapon_multi_auto_shot */ + case ITEM_ROCKETLAUNCH: ret = PROP_CHRROCKETLAUNCH; break; /* weapon_multi_rocket_launch */ + case ITEM_GOLDENGUN: ret = PROP_CHRGOLDEN; break; /* weapon_multi_goldengun */ + case ITEM_SILVERWPPK: ret = PROP_CHRWPPK; break; /* weapon_multi_pp7_special1 */ + case ITEM_GOLDWPPK: ret = PROP_CHRWPPK; break; /* weapon_multi_pp7_special2 */ + case ITEM_TOKEN: ret = PROP_FLAG; break; + case ITEM_UNARMED: break; + case ITEM_TASER: break; } return ret; } -#else -GLOBAL_ASM( -.late_rodata -/*D:8005762C*/ -glabel jpt_weapon_multi -.word weapon_multi_none -.word weapon_multi_none -.word weapon_multi_hunting_knife -.word weapon_multi_throwing_knife -.word weapon_multi_pp7 -.word weapon_multi_pp7_silent -.word weapon_multi_dd44 -.word weapon_multi_klobb -.word weapon_multi_kf7 -.word weapon_multi_zmg -.word weapon_multi_d5k -.word weapon_multi_d5k_silent -.word weapon_multi_phantom -.word weapon_multi_ar33 -.word weapon_multi_rcp90 -.word weapon_multi_shotgun -.word weapon_multi_auto_shot -.word weapon_multi_sniper -.word weapon_multi_cougar -.word weapon_multi_goldengun -.word weapon_multi_pp7_special1 -.word weapon_multi_pp7_special2 -.word weapon_multi_moonraker -/*.word weapon_multi_none*/ -/*.word weapon_multi_grenade_laun*/ -/*.word weapon_multi_rocket_launch*/ -/*.word weapon_multi_hand*/ -/*.word weapon_multi_timed*/ -/*.word weapon_multi_prox*/ -/*.word weapon_multi_remote*/ -/*.word weapon_multi_none*/ -/*.word weapon_multi_none*/ - -.text -glabel sub_GAME_7F09B244 -/* 0CFD74 7F09B244 28810020 */ slti $at, $a0, 0x20 -/* 0CFD78 7F09B248 14200006 */ bnez $at, .L7F09B264 -/* 0CFD7C 7F09B24C 2403FFFF */ li $v1, -1 -/* 0CFD80 7F09B250 24010058 */ li $at, 88 -/* 0CFD84 7F09B254 50810042 */ beql $a0, $at, .L7F09B360 -/* 0CFD88 7F09B258 2403014D */ li $v1, 333 -/* 0CFD8C 7F09B25C 03E00008 */ jr $ra -/* 0CFD90 7F09B260 00601025 */ move $v0, $v1 - -.L7F09B264: -/* 0CFD94 7F09B264 2C810020 */ sltiu $at, $a0, 0x20 -/* 0CFD98 7F09B268 1020003D */ beqz $at, .L7F09B360 -/* 0CFD9C 7F09B26C 00047080 */ sll $t6, $a0, 2 -/* 0CFDA0 7F09B270 3C018005 */ lui $at, %hi(jpt_weapon_multi) -/* 0CFDA4 7F09B274 002E0821 */ addu $at, $at, $t6 -/* 0CFDA8 7F09B278 8C2E762C */ lw $t6, %lo(jpt_weapon_multi)($at) -/* 0CFDAC 7F09B27C 01C00008 */ jr $t6 -/* 0CFDB0 7F09B280 00000000 */ nop -weapon_multi_hunting_knife: -/* 0CFDB4 7F09B284 03E00008 */ jr $ra -/* 0CFDB8 7F09B288 240200BA */ li $v0, 186 - -weapon_multi_pp7: -/* 0CFDBC 7F09B28C 03E00008 */ jr $ra -/* 0CFDC0 7F09B290 240200BF */ li $v0, 191 - -weapon_multi_klobb: -/* 0CFDC4 7F09B294 03E00008 */ jr $ra -/* 0CFDC8 7F09B298 240200C1 */ li $v0, 193 - -weapon_multi_kf7: -/* 0CFDCC 7F09B29C 03E00008 */ jr $ra -/* 0CFDD0 7F09B2A0 240200B8 */ li $v0, 184 - -weapon_multi_zmg: -/* 0CFDD4 7F09B2A4 03E00008 */ jr $ra -/* 0CFDD8 7F09B2A8 240200C3 */ li $v0, 195 - -weapon_multi_d5k: -/* 0CFDDC 7F09B2AC 03E00008 */ jr $ra -/* 0CFDE0 7F09B2B0 240200BD */ li $v0, 189 - -weapon_multi_phantom: -/* 0CFDE4 7F09B2B4 03E00008 */ jr $ra -/* 0CFDE8 7F09B2B8 240200C2 */ li $v0, 194 - -weapon_multi_ar33: -/* 0CFDEC 7F09B2BC 03E00008 */ jr $ra -/* 0CFDF0 7F09B2C0 240200BC */ li $v0, 188 - -weapon_multi_rcp90: -/* 0CFDF4 7F09B2C4 03E00008 */ jr $ra -/* 0CFDF8 7F09B2C8 240200C5 */ li $v0, 197 - -weapon_multi_shotgun: -/* 0CFDFC 7F09B2CC 03E00008 */ jr $ra -/* 0CFE00 7F09B2D0 240200C0 */ li $v0, 192 - -weapon_multi_grenade_laun: -/* 0CFE04 7F09B2D4 03E00008 */ jr $ra -/* 0CFE08 7F09B2D8 240200B9 */ li $v0, 185 - -weapon_multi_hand: -/* 0CFE0C 7F09B2DC 03E00008 */ jr $ra -/* 0CFE10 7F09B2E0 240200C4 */ li $v0, 196 - -weapon_multi_remote: -/* 0CFE14 7F09B2E4 03E00008 */ jr $ra -/* 0CFE18 7F09B2E8 240200C7 */ li $v0, 199 - -weapon_multi_prox: -/* 0CFE1C 7F09B2EC 03E00008 */ jr $ra -/* 0CFE20 7F09B2F0 240200C8 */ li $v0, 200 - -weapon_multi_timed: -/* 0CFE24 7F09B2F4 03E00008 */ jr $ra -/* 0CFE28 7F09B2F8 240200C9 */ li $v0, 201 - -weapon_multi_cougar: -/* 0CFE2C 7F09B2FC 03E00008 */ jr $ra -/* 0CFE30 7F09B300 240200BE */ li $v0, 190 - -weapon_multi_moonraker: -/* 0CFE34 7F09B304 03E00008 */ jr $ra -/* 0CFE38 7F09B308 240200BB */ li $v0, 187 - -weapon_multi_sniper: -/* 0CFE3C 7F09B30C 03E00008 */ jr $ra -/* 0CFE40 7F09B310 240200D2 */ li $v0, 210 - -weapon_multi_d5k_silent: -/* 0CFE44 7F09B314 03E00008 */ jr $ra -/* 0CFE48 7F09B318 240200CE */ li $v0, 206 - -weapon_multi_dd44: -/* 0CFE4C 7F09B31C 03E00008 */ jr $ra -/* 0CFE50 7F09B320 240200CD */ li $v0, 205 - -weapon_multi_pp7_silent: -/* 0CFE54 7F09B324 03E00008 */ jr $ra -/* 0CFE58 7F09B328 240200CC */ li $v0, 204 - -weapon_multi_throwing_knife: -/* 0CFE5C 7F09B32C 03E00008 */ jr $ra -/* 0CFE60 7F09B330 240200D1 */ li $v0, 209 - -weapon_multi_auto_shot: -/* 0CFE64 7F09B334 03E00008 */ jr $ra -/* 0CFE68 7F09B338 240200CF */ li $v0, 207 - -weapon_multi_rocket_launch: -/* 0CFE6C 7F09B33C 03E00008 */ jr $ra -/* 0CFE70 7F09B340 240200D3 */ li $v0, 211 - -weapon_multi_goldengun: -/* 0CFE74 7F09B344 03E00008 */ jr $ra -/* 0CFE78 7F09B348 240200D0 */ li $v0, 208 - -weapon_multi_pp7_special1: -/* 0CFE7C 7F09B34C 03E00008 */ jr $ra -/* 0CFE80 7F09B350 240200BF */ li $v0, 191 - -weapon_multi_pp7_special2: -/* 0CFE84 7F09B354 03E00008 */ jr $ra -/* 0CFE88 7F09B358 240200BF */ li $v0, 191 - -/* 0CFE8C 7F09B35C 2403014D */ li $v1, 333 -weapon_multi_none: -.L7F09B360: -/* 0CFE90 7F09B360 03E00008 */ jr $ra -/* 0CFE94 7F09B364 00601025 */ move $v0, $v1 -) -#endif - - void sub_GAME_7F09B368(enum GUNHAND hand) { chrSetWeaponFlag4(g_CurrentPlayer->prop->chr, hand); } +void sub_GAME_7F09B398(enum GUNHAND hand) +{ + ChrRecord *chr; + enum ITEM_IDS wepid; + enum PROP prop; + s32 flags; + + chr = g_CurrentPlayer->prop->chr; -#ifdef NONMATCHING -// NOTE: i think the return value from -// something_with_generating_object is supposed -// to be returned here? -void sub_GAME_7F09B398(GUNHAND hand) { - struct ChrRecord* temp_v0; - ITEM_IDS weaponNum; - s32 weaponIdMaybe; - - temp_v0 = g_CurrentPlayer->prop->chr; - if (!temp_v0->handle_positiondata[hand]) { - weaponNum = getCurrentPlayerWeaponId(hand); - weaponIdMaybe = sub_GAME_7F09B244(weaponNum); - if (weaponIdMaybe >= 0) { - something_with_generating_object(temp_v0, weaponIdMaybe, weaponNum, hand == GUNRIGHT ? 0 : 0x10000000, 0, 0); + if (chr->weapons_held[hand] == NULL) + { + wepid = getCurrentPlayerWeaponId(hand); + prop = getPropForHeldItem(wepid); + if (prop >= 0) + { + flags = ((hand * 4) == 0) + ? 0 + : PROPFLAG_WEAPON_LEFTHANDED; + something_with_generating_object(chr, prop, wepid, flags, NULL, NULL); } } } -#else -GLOBAL_ASM( -.late_rodata -/*hack for jtbl*/ -.word weapon_multi_none -.word weapon_multi_grenade_laun -.word weapon_multi_rocket_launch -.word weapon_multi_hand -.word weapon_multi_timed -.word weapon_multi_prox -.word weapon_multi_remote -.word weapon_multi_none -.word weapon_multi_none - -.text -glabel sub_GAME_7F09B398 -/* 0CFEC8 7F09B398 3C0E8008 */ lui $t6, %hi(g_CurrentPlayer) -/* 0CFECC 7F09B39C 8DCEA0B0 */ lw $t6, %lo(g_CurrentPlayer)($t6) -/* 0CFED0 7F09B3A0 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0CFED4 7F09B3A4 AFBF001C */ sw $ra, 0x1c($sp) -/* 0CFED8 7F09B3A8 8DCF00A8 */ lw $t7, 0xa8($t6) -/* 0CFEDC 7F09B3AC 00041880 */ sll $v1, $a0, 2 -/* 0CFEE0 7F09B3B0 8DE20004 */ lw $v0, 4($t7) -/* 0CFEE4 7F09B3B4 0043C021 */ addu $t8, $v0, $v1 -/* 0CFEE8 7F09B3B8 8F190160 */ lw $t9, 0x160($t8) -/* 0CFEEC 7F09B3BC 57200014 */ bnezl $t9, .L7F09B410 -/* 0CFEF0 7F09B3C0 8FBF001C */ lw $ra, 0x1c($sp) -/* 0CFEF4 7F09B3C4 AFA20034 */ sw $v0, 0x34($sp) -/* 0CFEF8 7F09B3C8 0FC17674 */ jal getCurrentPlayerWeaponId -/* 0CFEFC 7F09B3CC AFA30024 */ sw $v1, 0x24($sp) -/* 0CFF00 7F09B3D0 AFA20030 */ sw $v0, 0x30($sp) -/* 0CFF04 7F09B3D4 0FC26C91 */ jal sub_GAME_7F09B244 -/* 0CFF08 7F09B3D8 00402025 */ move $a0, $v0 -/* 0CFF0C 7F09B3DC 8FA30024 */ lw $v1, 0x24($sp) -/* 0CFF10 7F09B3E0 0440000A */ bltz $v0, .L7F09B40C -/* 0CFF14 7F09B3E4 00402825 */ move $a1, $v0 -/* 0CFF18 7F09B3E8 14600003 */ bnez $v1, .L7F09B3F8 -/* 0CFF1C 7F09B3EC 8FA40034 */ lw $a0, 0x34($sp) -/* 0CFF20 7F09B3F0 10000002 */ b .L7F09B3FC -/* 0CFF24 7F09B3F4 00003825 */ move $a3, $zero -.L7F09B3F8: -/* 0CFF28 7F09B3F8 3C071000 */ lui $a3, 0x1000 -.L7F09B3FC: -/* 0CFF2C 7F09B3FC 8FA60030 */ lw $a2, 0x30($sp) -/* 0CFF30 7F09B400 AFA00010 */ sw $zero, 0x10($sp) -/* 0CFF34 7F09B404 0FC14885 */ jal something_with_generating_object -/* 0CFF38 7F09B408 AFA00014 */ sw $zero, 0x14($sp) -.L7F09B40C: -/* 0CFF3C 7F09B40C 8FBF001C */ lw $ra, 0x1c($sp) -.L7F09B410: -/* 0CFF40 7F09B410 27BD0038 */ addiu $sp, $sp, 0x38 -/* 0CFF44 7F09B414 03E00008 */ jr $ra -/* 0CFF48 7F09B418 00000000 */ nop -) -#endif - - - - void shuffle_player_ids(void) { s32 i; @@ -862,10 +623,6 @@ void shuffle_player_ids(void) { } } - - - - s32 sub_GAME_7F09B4D8(s32 current_player_num) { s32 i; s32 position = 0; @@ -887,11 +644,6 @@ s32 sub_GAME_7F09B4D8(s32 current_player_num) { return position; } - - - - - s32 get_nth_player_from_shuffled(PLAYER_ID id) { s32 i; @@ -907,4 +659,3 @@ s32 get_nth_player_from_shuffled(PLAYER_ID id) return 0; } - diff --git a/src/game/player_2.h b/src/game/player_2.h index 6a1b9077..8d7f3baf 100644 --- a/src/game/player_2.h +++ b/src/game/player_2.h @@ -6,7 +6,7 @@ s32 getPlayerCount(void); s32 get_cur_playernum(void); void set_cur_player_fovy(f32 fovy); -s32 sub_GAME_7F09B15C( PropRecord* prop); +s32 getPlayerPointerIndex( PropRecord* prop); void set_cur_player_aspect(f32 aspect); void initBONDdataforPlayer(s32 player_num); s32 sub_GAME_7F09B4D8(s32 current_player_num); diff --git a/src/game/playerstats_007770.c b/src/game/playerstats_007770.c index f042b284..1daf120f 100644 --- a/src/game/playerstats_007770.c +++ b/src/game/playerstats_007770.c @@ -1,6 +1,6 @@ #include -void sub_GAME_7F007770(void) { +void set_favorite_weapon_for_every_player(void) { int right_hand; int left_hand; int player_count; diff --git a/src/game/prop.c b/src/game/prop.c index 1ffe7a25..7f03ca4b 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -1,11 +1,18 @@ #include #include +#include "stan.h" #include "chrai.h" #include "chrlv.h" -#include "math_atan2f.h" -#include "prop.h" +#include "chrobjhandler.h" #include "game/mp_weapon.h" #include "game/player_2.h" +#include "loadobjectmodel.h" +#include "math_atan2f.h" +#include "matrixmath.h" +#include "objecthandler.h" +#include "prop.h" +#include "bg.h" +#include "limits.h" /** * EU .bss 0x80068480 @@ -29,6 +36,9 @@ const u32 only_read_by_stageload[] = { const char aMp_[] = "mp_"; +void sub_GAME_7F001BD4(struct BoundPadRecord *pad, struct coord3d *arg1); +void sub_GAME_7F00324C(struct BoundPadRecord *arg0, s32 *arg1, s32 *arg2, struct coord3d *arg3, struct coord3d *arg4); + s32 load_proptype(PROPDEF_TYPE type) { @@ -54,53 +64,48 @@ s32 load_proptype(PROPDEF_TYPE type) #ifdef NONMATCHING -void sub_GAME_7F001BD4(void *arg0, s32 arg1, void *arg12, void *arg13) { - f32 sp18; - f32 sp20; - f32 sp24; - f32 sp28; - f32 sp2C; - f32 sp30; - f32 sp34; - f32 sp3C; - f32 sp40; - f32 sp44; - f32 temp_f6; - f32 temp_f4; - f32 temp_f6_2; - f32 temp_f2; - f32 temp_f10; + +// decomp.me 72% https://decomp.me/scratch/ygs4O + +// perfect dark padGetCentre (pad.c) +void sub_GAME_7F001BD4(struct pad3d *pad, struct coord3d *arg1) +{ f32 temp_f12; f32 temp_f14; f32 temp_f16; - // Node 0 - sp34 = (f32) arg0->unk2C; - sp30 = (f32) arg0->unk30; - sp2C = (f32) arg0->unk34; - sp28 = (f32) arg0->unk38; - sp24 = (f32) arg0->unk3C; - sp20 = (f32) arg0->unk40; - temp_f6 = ((arg0->unk10 * arg0->unk20) - (arg0->unk1C * arg0->unk14)); - sp3C = temp_f6; - temp_f4 = ((arg0->unk14 * arg0->unk18) - (arg0->unk20 * arg0->unkC)); - sp40 = temp_f4; - sp18 = temp_f6; - temp_f6_2 = ((arg0->unkC * arg0->unk1C) - (arg0->unk18 * arg0->unk10)); - sp44 = temp_f6_2; - temp_f2 = (1.0f / sqrtf(((temp_f6_2 * temp_f6_2) + ((sp18 * sp18) + (temp_f4 * temp_f4))))); - temp_f10 = (sp3C * temp_f2); - sp3C = temp_f10; - sp40 = (f32) (sp40 * temp_f2); - temp_f12 = (sp24 + sp20); - sp44 = (f32) (sp44 * temp_f2); - temp_f14 = (sp34 + sp30); - temp_f16 = (sp2C + sp28); - *arg13 = (f32) ((((arg12->unk18 * temp_f12) + ((temp_f14 * temp_f10) + (temp_f16 * arg12->unkC))) * 0.5f) + *arg12); - arg13->unk4 = (f32) ((((arg12->unk1C * temp_f12) + ((temp_f14 * sp40) + (temp_f16 * arg12->unk10))) * 0.5f) + arg12->unk4); - arg13->unk8 = (f32) ((((arg12->unk20 * temp_f12) + ((temp_f14 * sp44) + (temp_f16 * arg12->unk14))) * 0.5f) + arg12->unk8); - return; - // (possible return value: sqrtf(((temp_f6_2 * temp_f6_2) + ((sp18 * sp18) + (temp_f4 * temp_f4))))) + struct coord3d normal; + f32 scale; + + normal.f[0] = (pad->up.f[1] * pad->look.f[2]) - (pad->look.f[1] * pad->up.f[2]); + normal.f[1] = (pad->up.f[2] * pad->look.f[0]) - (pad->look.f[2] * pad->up.f[0]); + normal.f[2] = (pad->up.f[0] * pad->look.f[1]) - (pad->look.f[0] * pad->up.f[1]); + + scale = 1.0f / sqrtf((normal.f[0] * normal.f[0]) + ((normal.f[1] * normal.f[1]) + (normal.f[2] * normal.f[2]))); + + normal.f[0] *= scale; + normal.f[1] *= scale; + normal.f[2] *= scale; + + temp_f16 = pad->bbox.xmin + pad->bbox.xmax; + temp_f14 = pad->bbox.ymin + pad->bbox.ymax; + temp_f12 = pad->bbox.zmin + pad->bbox.zmax; + + arg1->f[0] = pad->pos.f[0] + ( + (temp_f16) * normal.f[0] + + (temp_f14) * pad->up.f[0] + + (temp_f12) * pad->look.f[0]) * 0.5f; + + arg1->f[1] = pad->pos.f[1] + ( + (temp_f16) * normal.f[1] + + (temp_f14) * pad->up.f[1] + + (temp_f12) * pad->look.f[1]) * 0.5f; + + arg1->f[2] = pad->pos.f[2] + ( + (temp_f16) * normal.f[2] + + (temp_f14) * pad->up.f[2] + + (temp_f12) * pad->look.f[2]) * 0.5f; + } #else @@ -227,7 +232,7 @@ glabel sub_GAME_7F001BD4 #ifdef NONMATCHING // maybe domakedefaultobj -void domakedefaultobj(s32 arg0, ObjectRecord *arg1, ? cmdindex) +void domakedefaultobj(s32 arg0, ObjectRecord *arg1, s32 cmdindex) { s32 spF0; ? spE0; @@ -342,7 +347,7 @@ void domakedefaultobj(s32 arg0, ObjectRecord *arg1, ? cmdindex) } else { - sub_GAME_7F0406F8(arg1, PitemZ_entries[spF0].Header); + objInitWithModelDef(arg1, PitemZ_entries[spF0].Header); } monitor->model = arg1->model; modelSetScale(monitor->model, monitor->model->scale * sp78); @@ -360,7 +365,7 @@ void domakedefaultobj(s32 arg0, ObjectRecord *arg1, ? cmdindex) } else { - phi_v0 = sub_GAME_7F0406F8(arg1, PitemZ_entries[spF0].Header); + phi_v0 = objInitWithModelDef(arg1, PitemZ_entries[spF0].Header); } temp_a0_3 = arg1->model; modelSetScale(temp_a0_3, temp_a0_3->scale * sp78); @@ -442,7 +447,7 @@ void domakedefaultobj(s32 arg0, ObjectRecord *arg1, ? cmdindex) sp60 = phi_v0_2; if (phi_s0 != 0) { - temp_v0_3 = sub_GAME_7F040078(arg1); + temp_v0_3 = chrobjGetBboxFromObjectRecord(arg1); if (temp_v0_3 != 0) { sp58 = 1.0f; @@ -622,6 +627,7 @@ void domakedefaultobj(s32 arg0, ObjectRecord *arg1, ? cmdindex) } #else +void domakedefaultobj(s32 arg0, ObjectRecord *arg1, s32 cmdindex); GLOBAL_ASM( .late_rodata glabel D_8004EEB4 @@ -720,7 +726,7 @@ glabel domakedefaultobj /* 036A18 7F001EE8 3C058004 */ lui $a1, %hi(PitemZ_entries) /* 036A1C 7F001EEC 00AF2821 */ addu $a1, $a1, $t7 /* 036A20 7F001EF0 8CA5A228 */ lw $a1, %lo(PitemZ_entries)($a1) -/* 036A24 7F001EF4 0FC101BE */ jal sub_GAME_7F0406F8 +/* 036A24 7F001EF4 0FC101BE */ jal objInitWithModelDef /* 036A28 7F001EF8 02202025 */ move $a0, $s1 /* 036A2C 7F001EFC 8E240014 */ lw $a0, 0x14($s1) .L7F001F00: @@ -767,7 +773,7 @@ glabel domakedefaultobj /* 036AC8 7F001F98 3C058004 */ lui $a1, %hi(PitemZ_entries) /* 036ACC 7F001F9C 00AD2821 */ addu $a1, $a1, $t5 /* 036AD0 7F001FA0 8CA5A228 */ lw $a1, %lo(PitemZ_entries)($a1) -/* 036AD4 7F001FA4 0FC101BE */ jal sub_GAME_7F0406F8 +/* 036AD4 7F001FA4 0FC101BE */ jal objInitWithModelDef /* 036AD8 7F001FA8 02202025 */ move $a0, $s1 /* 036ADC 7F001FAC 00408025 */ move $s0, $v0 .L7F001FB0: @@ -1015,7 +1021,7 @@ glabel domakedefaultobj .L7F002354: /* 036E84 7F002354 520000D0 */ beql $s0, $zero, .L7F002698 /* 036E88 7F002358 8E240014 */ lw $a0, 0x14($s1) -/* 036E8C 7F00235C 0FC1001E */ jal sub_GAME_7F040078 +/* 036E8C 7F00235C 0FC1001E */ jal chrobjGetBboxFromObjectRecord /* 036E90 7F002360 02202025 */ move $a0, $s1 /* 036E94 7F002364 104000CB */ beqz $v0, .L7F002694 /* 036E98 7F002368 3C013F80 */ li $at, 0x3F800000 # 1.000000 @@ -1858,7 +1864,7 @@ glabel setupCctv /* 037604 7F002AD4 E7A60048 */ swc1 $f6, 0x48($sp) /* 037608 7F002AD8 C4C80008 */ lwc1 $f8, 8($a2) /* 03760C 7F002ADC AFA30050 */ sw $v1, 0x50($sp) -/* 037610 7F002AE0 0FC160F6 */ jal matrix_4x4_rotate_vector_in_place +/* 037610 7F002AE0 0FC160F6 */ jal mtx4RotateVecInPlace /* 037614 7F002AE4 E7A8004C */ swc1 $f8, 0x4c($sp) /* 037618 7F002AE8 8E0C0010 */ lw $t4, 0x10($s0) /* 03761C 7F002AEC C7AA0044 */ lwc1 $f10, 0x44($sp) @@ -1957,326 +1963,77 @@ glabel setupCctv ) #endif +void setupAutogun(s32 stageID, AutogunRecord *autogun, s32 cmdindex) +{ + s8 *beam; -#ifdef NONMATCHING -void setupAutogun(undefined8 param_1,ObjectRecord.conflict *param_2) + domakedefaultobj(stageID, (ObjectRecord *) autogun, cmdindex); -{ - int iVar1; - PropRecord *pPVar2; - u8 *puVar3; - OSScMsg *pOVar4; - f32 fVar5; - undefined *puVar6; - float fVar7; - float fVar8; - float fVar9; - float vector2; - - domakedefaultobj(param_1._4_4_,param_2); - param_2[1].field_0x2c = NULL; - param_2[1].field_0x38 = 0xffffffff; - param_2[1].field_0x3c = 0xffffffff; - param_2[1].field_0x40 = 0xffffffff; - param_2[1].field_0x44 = NULL; - param_2[1].field_0x48 = NULL; - param_2[1].Prop = NULL; - param_2[1].model = NULL; - *¶m_2[1].obj = 0; - param_2[1].field_0x1c = NULL; - param_2[1].field_0x20 = NULL; - param_2[1].field_0x18 = NULL; - param_2[1].field_0x30 = NULL; - param_2[1].field_0x34 = NULL; - param_2[1].field_0x24 = (param_2[1].field_0x24 * 6.283185) / 65536.0; - param_2[1].field_0x28 = (param_2[1].field_0x28 * 100.0) / 65536.0; - param_2[1].flags = (param_2[1].flags * 6.283185) / 65536.0; - param_2[1].flags2 = (param_2[1].flags2 * 6.283185) / 65536.0; - puVar3 = mempAllocBytesInBank(0x30,'\x04'); - param_2[1].field_0x4c = puVar3; - *puVar3 = 0xff; - iVar1 = *(param_2 + 1); - param_2[1].field_0x50 = NULL; - param_2[1].field_0x54 = NULL; - if (-1 < iVar1) { - if (iVar1 < 10000) { - pOVar4 = &g_CurrentSetup.pads->pos + iVar1 * 0x2c; +#ifdef VERSION_EU + autogun->speed = ((*((s32 *) (&autogun->speed))) * 7.5398226f) / 65536.0f; + autogun->aimdist = ((*((s32 *) (&autogun->aimdist))) * 100.0f) / 65536.0f; + autogun->unk88 = ((*((s32 *) (&autogun->unk88))) * M_TAU_F) / 65536.0f; + autogun->unk8C = ((*((s32 *) (&autogun->unk8C))) * M_TAU_F) / 65536.0f; +#endif + + autogun->unkAC = 0; + autogun->unkB8 = -1; + autogun->unkBC = -1; + autogun->unkC0 = -1; + autogun->unkC4 = 0; + autogun->unkC8 = 0; + autogun->unk90 = 0.0f; + autogun->unk94 = 0.0f; + autogun->rot_related = 0.0f; + autogun->unk9C = 0.0f; + autogun->unkA0 = 0.0f; + autogun->unk98 = 0.0f; + autogun->unkB0 = 0.0f; + autogun->unkB4 = 0.0f; + +#ifndef VERSION_EU + autogun->speed = ((*((s32 *) (&autogun->speed))) * M_TAU_F) / 65536.0f; + autogun->aimdist = ((*((s32 *) (&autogun->aimdist))) * 100.0f) / 65536.0f; + autogun->unk88 = ((*((s32 *) (&autogun->unk88))) * M_TAU_F) / 65536.0f; + autogun->unk8C = ((*((s32 *) (&autogun->unk8C))) * M_TAU_F) / 65536.0f; +#endif + + beam = mempAllocBytesInBank(0x30U, 4U); + autogun->beam = beam; + *beam = -1; + + autogun->is_active = FALSE; + autogun->unkD4 = 0.0f; + + if (autogun->padID >= 0) + { + s32 stack1; + f32 xdiff; + f32 ydiff; + f32 zdiff; + PadRecord *pad; + PropRecord *prop; + + if (autogun->padID < 0x2710) + { + if (1); + pad = &g_CurrentSetup.pads[autogun->padID]; } - else { - pOVar4 = g_CurrentSetup.boundpads + iVar1 * 0x44 + -680000; + else + { + pad = &g_CurrentSetup.boundpads[getBoundPadNum(autogun->padID)]; } - pPVar2 = param_2->Prop; - fVar7 = *(&pOVar4->type + 2); - fVar8 = (pPVar2->pos).y; - fVar9 = *&pOVar4->type - (pPVar2->pos).x; - vector2 = *(&pOVar4->type + 4) - (pPVar2->pos).z; - fVar5 = atan2f(fVar9,vector2); - *¶m_2[1].obj = fVar5; - fVar9 = sqrtf(fVar9 * fVar9 + vector2 * vector2); - puVar6 = atan2f(fVar7 - fVar8,fVar9); - param_2[1].field_0x18 = puVar6; - } - return; -} -#else -#ifndef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_8004EF54 -.word 0x40c90fdb #6.2831855 -.text -glabel setupAutogun -/* 037788 7F002C58 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 03778C 7F002C5C AFBF001C */ sw $ra, 0x1c($sp) -/* 037790 7F002C60 AFB00018 */ sw $s0, 0x18($sp) -/* 037794 7F002C64 0FC00767 */ jal domakedefaultobj -/* 037798 7F002C68 00A08025 */ move $s0, $a1 -/* 03779C 7F002C6C 8E0E00A4 */ lw $t6, 0xa4($s0) -/* 0377A0 7F002C70 8E0F00A8 */ lw $t7, 0xa8($s0) -/* 0377A4 7F002C74 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 0377A8 7F002C78 448E2000 */ mtc1 $t6, $f4 -/* 0377AC 7F002C7C 44811000 */ mtc1 $at, $f2 -/* 0377B0 7F002C80 3C018005 */ lui $at, %hi(D_8004EF54) -/* 0377B4 7F002C84 468021A0 */ cvt.s.w $f6, $f4 -/* 0377B8 7F002C88 C42CEF54 */ lwc1 $f12, %lo(D_8004EF54)($at) -/* 0377BC 7F002C8C 448F8000 */ mtc1 $t7, $f16 -/* 0377C0 7F002C90 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0377C4 7F002C94 44812000 */ mtc1 $at, $f4 -/* 0377C8 7F002C98 468084A0 */ cvt.s.w $f18, $f16 -/* 0377CC 7F002C9C 460C3202 */ mul.s $f8, $f6, $f12 -/* 0377D0 7F002CA0 8E180088 */ lw $t8, 0x88($s0) -/* 0377D4 7F002CA4 8E19008C */ lw $t9, 0x8c($s0) -/* 0377D8 7F002CA8 44800000 */ mtc1 $zero, $f0 -/* 0377DC 7F002CAC 2403FFFF */ li $v1, -1 -/* 0377E0 7F002CB0 46049182 */ mul.s $f6, $f18, $f4 -/* 0377E4 7F002CB4 AE0000AC */ sw $zero, 0xac($s0) -/* 0377E8 7F002CB8 AE0300B8 */ sw $v1, 0xb8($s0) -/* 0377EC 7F002CBC AE0300BC */ sw $v1, 0xbc($s0) -/* 0377F0 7F002CC0 AE0300C0 */ sw $v1, 0xc0($s0) -/* 0377F4 7F002CC4 AE0000C4 */ sw $zero, 0xc4($s0) -/* 0377F8 7F002CC8 46024283 */ div.s $f10, $f8, $f2 -/* 0377FC 7F002CCC AE0000C8 */ sw $zero, 0xc8($s0) -/* 037800 7F002CD0 24040030 */ li $a0, 48 -/* 037804 7F002CD4 24050004 */ li $a1, 4 -/* 037808 7F002CD8 E6000090 */ swc1 $f0, 0x90($s0) -/* 03780C 7F002CDC E6000094 */ swc1 $f0, 0x94($s0) -/* 037810 7F002CE0 E6000084 */ swc1 $f0, 0x84($s0) -/* 037814 7F002CE4 E600009C */ swc1 $f0, 0x9c($s0) -/* 037818 7F002CE8 E60000A0 */ swc1 $f0, 0xa0($s0) -/* 03781C 7F002CEC E6000098 */ swc1 $f0, 0x98($s0) -/* 037820 7F002CF0 E60000B0 */ swc1 $f0, 0xb0($s0) -/* 037824 7F002CF4 E60000B4 */ swc1 $f0, 0xb4($s0) -/* 037828 7F002CF8 46023203 */ div.s $f8, $f6, $f2 -/* 03782C 7F002CFC E60A00A4 */ swc1 $f10, 0xa4($s0) -/* 037830 7F002D00 44985000 */ mtc1 $t8, $f10 -/* 037834 7F002D04 44993000 */ mtc1 $t9, $f6 -/* 037838 7F002D08 46805420 */ cvt.s.w $f16, $f10 -/* 03783C 7F002D0C 460C8482 */ mul.s $f18, $f16, $f12 -/* 037840 7F002D10 E60800A8 */ swc1 $f8, 0xa8($s0) -/* 037844 7F002D14 46803220 */ cvt.s.w $f8, $f6 -/* 037848 7F002D18 46029103 */ div.s $f4, $f18, $f2 -/* 03784C 7F002D1C 460C4282 */ mul.s $f10, $f8, $f12 -/* 037850 7F002D20 46025403 */ div.s $f16, $f10, $f2 -/* 037854 7F002D24 E6040088 */ swc1 $f4, 0x88($s0) -/* 037858 7F002D28 0C0025C8 */ jal mempAllocBytesInBank -/* 03785C 7F002D2C E610008C */ swc1 $f16, 0x8c($s0) -/* 037860 7F002D30 2403FFFF */ li $v1, -1 -/* 037864 7F002D34 AE0200CC */ sw $v0, 0xcc($s0) -/* 037868 7F002D38 A0430000 */ sb $v1, ($v0) -/* 03786C 7F002D3C 8E040080 */ lw $a0, 0x80($s0) -/* 037870 7F002D40 44800000 */ mtc1 $zero, $f0 -/* 037874 7F002D44 AE0000D0 */ sw $zero, 0xd0($s0) -/* 037878 7F002D48 0480002F */ bltz $a0, .L7F002E08 -/* 03787C 7F002D4C E60000D4 */ swc1 $f0, 0xd4($s0) -/* 037880 7F002D50 28812710 */ slti $at, $a0, 0x2710 -/* 037884 7F002D54 1020000A */ beqz $at, .L7F002D80 -/* 037888 7F002D58 00045100 */ sll $t2, $a0, 4 -/* 03788C 7F002D5C 00044080 */ sll $t0, $a0, 2 -/* 037890 7F002D60 01044023 */ subu $t0, $t0, $a0 -/* 037894 7F002D64 00084080 */ sll $t0, $t0, 2 -/* 037898 7F002D68 3C098007 */ lui $t1, %hi(g_CurrentSetup+0x18) -/* 03789C 7F002D6C 8D295D18 */ lw $t1, %lo(g_CurrentSetup+0x18)($t1) -/* 0378A0 7F002D70 01044023 */ subu $t0, $t0, $a0 -/* 0378A4 7F002D74 00084080 */ sll $t0, $t0, 2 -/* 0378A8 7F002D78 10000009 */ b .L7F002DA0 -/* 0378AC 7F002D7C 01091821 */ addu $v1, $t0, $t1 -.L7F002D80: -/* 0378B0 7F002D80 3C0B8007 */ lui $t3, %hi(g_CurrentSetup+0x1C) -/* 0378B4 7F002D84 8D6B5D1C */ lw $t3, %lo(g_CurrentSetup+0x1C)($t3) -/* 0378B8 7F002D88 01445021 */ addu $t2, $t2, $a0 -/* 0378BC 7F002D8C 000A5080 */ sll $t2, $t2, 2 -/* 0378C0 7F002D90 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0378C4 7F002D94 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0378C8 7F002D98 014B1821 */ addu $v1, $t2, $t3 -/* 0378CC 7F002D9C 00611821 */ addu $v1, $v1, $at -.L7F002DA0: -/* 0378D0 7F002DA0 8E020010 */ lw $v0, 0x10($s0) -/* 0378D4 7F002DA4 C4660004 */ lwc1 $f6, 4($v1) -/* 0378D8 7F002DA8 C4720000 */ lwc1 $f18, ($v1) -/* 0378DC 7F002DAC C448000C */ lwc1 $f8, 0xc($v0) -/* 0378E0 7F002DB0 C4440008 */ lwc1 $f4, 8($v0) -/* 0378E4 7F002DB4 46083281 */ sub.s $f10, $f6, $f8 -/* 0378E8 7F002DB8 46049301 */ sub.s $f12, $f18, $f4 -/* 0378EC 7F002DBC E7AA0028 */ swc1 $f10, 0x28($sp) -/* 0378F0 7F002DC0 C4700008 */ lwc1 $f16, 8($v1) -/* 0378F4 7F002DC4 C4520010 */ lwc1 $f18, 0x10($v0) -/* 0378F8 7F002DC8 E7AC002C */ swc1 $f12, 0x2c($sp) -/* 0378FC 7F002DCC 46128381 */ sub.s $f14, $f16, $f18 -/* 037900 7F002DD0 0FC16A8C */ jal atan2f -/* 037904 7F002DD4 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 037908 7F002DD8 C7A2002C */ lwc1 $f2, 0x2c($sp) -/* 03790C 7F002DDC C7AE0024 */ lwc1 $f14, 0x24($sp) -/* 037910 7F002DE0 E6000084 */ swc1 $f0, 0x84($s0) -/* 037914 7F002DE4 46021102 */ mul.s $f4, $f2, $f2 -/* 037918 7F002DE8 00000000 */ nop -/* 03791C 7F002DEC 460E7182 */ mul.s $f6, $f14, $f14 -/* 037920 7F002DF0 0C007DF8 */ jal sqrtf -/* 037924 7F002DF4 46062300 */ add.s $f12, $f4, $f6 -/* 037928 7F002DF8 C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 03792C 7F002DFC 0FC16A8C */ jal atan2f -/* 037930 7F002E00 46000386 */ mov.s $f14, $f0 -/* 037934 7F002E04 E6000098 */ swc1 $f0, 0x98($s0) -.L7F002E08: -/* 037938 7F002E08 8FBF001C */ lw $ra, 0x1c($sp) -/* 03793C 7F002E0C 8FB00018 */ lw $s0, 0x18($sp) -/* 037940 7F002E10 27BD0038 */ addiu $sp, $sp, 0x38 -/* 037944 7F002E14 03E00008 */ jr $ra -/* 037948 7F002E18 00000000 */ nop -) -#endif -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_80047394 -.word 0x40c90fdb #6.2831855 -glabel D_80047398 -.word 0x40f1463a #7.53982257843 + prop = autogun->prop; + xdiff = pad->pos.x - prop->pos.x; + ydiff = pad->pos.y - prop->pos.y; + zdiff = pad->pos.z - prop->pos.z; -.text -glabel setupAutogun -/* 0355B0 7F002BC0 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0355B4 7F002BC4 AFBF001C */ sw $ra, 0x1c($sp) -/* 0355B8 7F002BC8 AFB00018 */ sw $s0, 0x18($sp) -/* 0355BC 7F002BCC 0FC00767 */ jal domakedefaultobj -/* 0355C0 7F002BD0 00A08025 */ move $s0, $a1 -/* 0355C4 7F002BD4 8E0E00A4 */ lw $t6, 0xa4($s0) -/* 0355C8 7F002BD8 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 0355CC 7F002BDC 44811000 */ mtc1 $at, $f2 -/* 0355D0 7F002BE0 448E2000 */ mtc1 $t6, $f4 -/* 0355D4 7F002BE4 8E0F00A8 */ lw $t7, 0xa8($s0) -/* 0355D8 7F002BE8 3C018004 */ lui $at, %hi(D_80047394) # $at, 0x8004 -/* 0355DC 7F002BEC 468021A0 */ cvt.s.w $f6, $f4 -/* 0355E0 7F002BF0 C42C7394 */ lwc1 $f12, %lo(D_80047394)($at) -/* 0355E4 7F002BF4 3C018004 */ lui $at, %hi(D_80047398) # $at, 0x8004 -/* 0355E8 7F002BF8 C4287398 */ lwc1 $f8, %lo(D_80047398)($at) -/* 0355EC 7F002BFC 448F9000 */ mtc1 $t7, $f18 -/* 0355F0 7F002C00 3C0142C8 */ li $at, 0x42C80000 # 100.000000 -/* 0355F4 7F002C04 46083282 */ mul.s $f10, $f6, $f8 -/* 0355F8 7F002C08 44813000 */ mtc1 $at, $f6 -/* 0355FC 7F002C0C 8E180088 */ lw $t8, 0x88($s0) -/* 035600 7F002C10 8E19008C */ lw $t9, 0x8c($s0) -/* 035604 7F002C14 44800000 */ mtc1 $zero, $f0 -/* 035608 7F002C18 2403FFFF */ li $v1, -1 -/* 03560C 7F002C1C 46809120 */ cvt.s.w $f4, $f18 -/* 035610 7F002C20 AE0000AC */ sw $zero, 0xac($s0) -/* 035614 7F002C24 AE0300B8 */ sw $v1, 0xb8($s0) -/* 035618 7F002C28 AE0300BC */ sw $v1, 0xbc($s0) -/* 03561C 7F002C2C AE0300C0 */ sw $v1, 0xc0($s0) -/* 035620 7F002C30 46025403 */ div.s $f16, $f10, $f2 -/* 035624 7F002C34 AE0000C4 */ sw $zero, 0xc4($s0) -/* 035628 7F002C38 AE0000C8 */ sw $zero, 0xc8($s0) -/* 03562C 7F002C3C 24040030 */ li $a0, 48 -/* 035630 7F002C40 46062202 */ mul.s $f8, $f4, $f6 -/* 035634 7F002C44 24050004 */ li $a1, 4 -/* 035638 7F002C48 E6000090 */ swc1 $f0, 0x90($s0) -/* 03563C 7F002C4C E6000094 */ swc1 $f0, 0x94($s0) -/* 035640 7F002C50 E6000084 */ swc1 $f0, 0x84($s0) -/* 035644 7F002C54 E600009C */ swc1 $f0, 0x9c($s0) -/* 035648 7F002C58 E60000A0 */ swc1 $f0, 0xa0($s0) -/* 03564C 7F002C5C E6000098 */ swc1 $f0, 0x98($s0) -/* 035650 7F002C60 E60000B0 */ swc1 $f0, 0xb0($s0) -/* 035654 7F002C64 E60000B4 */ swc1 $f0, 0xb4($s0) -/* 035658 7F002C68 46024283 */ div.s $f10, $f8, $f2 -/* 03565C 7F002C6C E61000A4 */ swc1 $f16, 0xa4($s0) -/* 035660 7F002C70 44988000 */ mtc1 $t8, $f16 -/* 035664 7F002C74 44994000 */ mtc1 $t9, $f8 -/* 035668 7F002C78 468084A0 */ cvt.s.w $f18, $f16 -/* 03566C 7F002C7C 460C9102 */ mul.s $f4, $f18, $f12 -/* 035670 7F002C80 E60A00A8 */ swc1 $f10, 0xa8($s0) -/* 035674 7F002C84 468042A0 */ cvt.s.w $f10, $f8 -/* 035678 7F002C88 46022183 */ div.s $f6, $f4, $f2 -/* 03567C 7F002C8C 460C5402 */ mul.s $f16, $f10, $f12 -/* 035680 7F002C90 46028483 */ div.s $f18, $f16, $f2 -/* 035684 7F002C94 E6060088 */ swc1 $f6, 0x88($s0) -/* 035688 7F002C98 0C0022E0 */ jal mempAllocBytesInBank -/* 03568C 7F002C9C E612008C */ swc1 $f18, 0x8c($s0) -/* 035690 7F002CA0 2403FFFF */ li $v1, -1 -/* 035694 7F002CA4 AE0200CC */ sw $v0, 0xcc($s0) -/* 035698 7F002CA8 A0430000 */ sb $v1, ($v0) -/* 03569C 7F002CAC 8E040080 */ lw $a0, 0x80($s0) -/* 0356A0 7F002CB0 44800000 */ mtc1 $zero, $f0 -/* 0356A4 7F002CB4 AE0000D0 */ sw $zero, 0xd0($s0) -/* 0356A8 7F002CB8 0480002F */ bltz $a0, .L7F002D78 -/* 0356AC 7F002CBC E60000D4 */ swc1 $f0, 0xd4($s0) -/* 0356B0 7F002CC0 28812710 */ slti $at, $a0, 0x2710 -/* 0356B4 7F002CC4 1020000A */ beqz $at, .L7F002CF0 -/* 0356B8 7F002CC8 00045100 */ sll $t2, $a0, 4 -/* 0356BC 7F002CCC 00044080 */ sll $t0, $a0, 2 -/* 0356C0 7F002CD0 01044023 */ subu $t0, $t0, $a0 -/* 0356C4 7F002CD4 00084080 */ sll $t0, $t0, 2 -/* 0356C8 7F002CD8 3C098006 */ lui $t1, %hi(g_CurrentSetup+0x18) # $t1, 0x8006 -/* 0356CC 7F002CDC 8D294C58 */ lw $t1, %lo(g_CurrentSetup+0x18)($t1) -/* 0356D0 7F002CE0 01044023 */ subu $t0, $t0, $a0 -/* 0356D4 7F002CE4 00084080 */ sll $t0, $t0, 2 -/* 0356D8 7F002CE8 10000009 */ b .L7F002D10 -/* 0356DC 7F002CEC 01091821 */ addu $v1, $t0, $t1 -.L7F002CF0: -/* 0356E0 7F002CF0 3C0B8006 */ lui $t3, %hi(g_CurrentSetup+0x1C) # $t3, 0x8006 -/* 0356E4 7F002CF4 8D6B4C5C */ lw $t3, %lo(g_CurrentSetup+0x1C)($t3) -/* 0356E8 7F002CF8 01445021 */ addu $t2, $t2, $a0 -/* 0356EC 7F002CFC 000A5080 */ sll $t2, $t2, 2 -/* 0356F0 7F002D00 3C01FFF5 */ lui $at, (0xFFF59FC0 >> 16) # lui $at, 0xfff5 -/* 0356F4 7F002D04 34219FC0 */ ori $at, (0xFFF59FC0 & 0xFFFF) # ori $at, $at, 0x9fc0 -/* 0356F8 7F002D08 014B1821 */ addu $v1, $t2, $t3 -/* 0356FC 7F002D0C 00611821 */ addu $v1, $v1, $at -.L7F002D10: -/* 035700 7F002D10 8E020010 */ lw $v0, 0x10($s0) -/* 035704 7F002D14 C4680004 */ lwc1 $f8, 4($v1) -/* 035708 7F002D18 C4640000 */ lwc1 $f4, ($v1) -/* 03570C 7F002D1C C44A000C */ lwc1 $f10, 0xc($v0) -/* 035710 7F002D20 C4460008 */ lwc1 $f6, 8($v0) -/* 035714 7F002D24 460A4401 */ sub.s $f16, $f8, $f10 -/* 035718 7F002D28 46062301 */ sub.s $f12, $f4, $f6 -/* 03571C 7F002D2C E7B00028 */ swc1 $f16, 0x28($sp) -/* 035720 7F002D30 C4720008 */ lwc1 $f18, 8($v1) -/* 035724 7F002D34 C4440010 */ lwc1 $f4, 0x10($v0) -/* 035728 7F002D38 E7AC002C */ swc1 $f12, 0x2c($sp) -/* 03572C 7F002D3C 46049381 */ sub.s $f14, $f18, $f4 -/* 035730 7F002D40 0FC16BB8 */ jal atan2f -/* 035734 7F002D44 E7AE0024 */ swc1 $f14, 0x24($sp) -/* 035738 7F002D48 C7A2002C */ lwc1 $f2, 0x2c($sp) -/* 03573C 7F002D4C C7AE0024 */ lwc1 $f14, 0x24($sp) -/* 035740 7F002D50 E6000084 */ swc1 $f0, 0x84($s0) -/* 035744 7F002D54 46021182 */ mul.s $f6, $f2, $f2 -/* 035748 7F002D58 00000000 */ nop -/* 03574C 7F002D5C 460E7202 */ mul.s $f8, $f14, $f14 -/* 035750 7F002D60 0C007614 */ jal sqrtf -/* 035754 7F002D64 46083300 */ add.s $f12, $f6, $f8 -/* 035758 7F002D68 C7AC0028 */ lwc1 $f12, 0x28($sp) -/* 03575C 7F002D6C 0FC16BB8 */ jal atan2f -/* 035760 7F002D70 46000386 */ mov.s $f14, $f0 -/* 035764 7F002D74 E6000098 */ swc1 $f0, 0x98($s0) -.L7F002D78: -/* 035768 7F002D78 8FBF001C */ lw $ra, 0x1c($sp) -/* 03576C 7F002D7C 8FB00018 */ lw $s0, 0x18($sp) -/* 035770 7F002D80 27BD0038 */ addiu $sp, $sp, 0x38 -/* 035774 7F002D84 03E00008 */ jr $ra -/* 035778 7F002D88 00000000 */ nop -) -#endif -#endif + autogun->rot_related = atan2f(xdiff, zdiff); + autogun->unk98 = atan2f(ydiff, sqrtf((xdiff * xdiff) + (zdiff * zdiff))); + } +} //i should be object rack @@ -2286,1557 +2043,422 @@ void setupHangingMonitors(s32 arg0, ObjectRecord* rack, s32 cmdindex) } -#ifdef NONMATCHING -void setupSingleMonitor(s32 arg0, void* monitor, s32 cmdindex) +void setupSingleMonitor(s32 stageID, MonitorObjRecord *monitor, s32 cmdindex) { - monitor->screen = g_MonitorAnimController; - monitorSetImageByNum(monitor->screen, monitor->imagenum); - if (((s32) monitor->pad < 0) && ((monitor->flags & 0x8000) == 0)) { - modelnum = (s32) monitor->modelnum; - void* owner = setupGetPtrToCommandByIndex(monitor->owneroffset + cmdindex, monitor); - Mtxf sp64; + MonitorRecord *record; + s32 unused; + s32 modelnum; + ObjectRecord *owner; + PropRecord *prop; + f32 scale; + + monitor->Monitor = g_MonitorAnimController; + record = &monitor->Monitor; + monitorSetImageByNum(&monitor->Monitor, monitor->ImageNum); + + if (monitor->pad < 0 && (monitor->flags & PROPFLAG_INSIDEANOTHEROBJ) == 0) + { + modelnum = monitor->obj; + owner = (struct ObjectRecord *)setupGetPtrToCommandByIndex(cmdindex + monitor->OwnerOffset); + modelLoad(modelnum); - scale = monitor->extrascale * (1.0f / 256.0f); - monitor->unk74 = (bitwise s32) ((f32) monitor->unk74 / M_U16_MAX_VALUE_F); + scale = monitor->extrascale * (1.0f / 256.0f); + monitor->damage = *(s32*)&monitor->damage / M_U16_MAX_VALUE_F; - if (getPlayerCount() >= 2) { - monitor->hidden2 |= 4; + if (getPlayerCount() >= 2) + { + monitor->state |= PROPSTATE_RESPAWN; } - prop = objInitWithAutoModel(monitor); - monitor->monitorthing = monitorthingGetNew(); - if (prop && monitor->monitorthing) { - monitor->hidden |= 0x40; + prop = objInitWithAutoModel((ObjectRecord*)monitor); + monitor->embedment = embedmentAllocate(); + + if (prop && monitor->embedment) + { + monitor->runtime_bitflags |= RUNTIMEBITFLAG_EMBEDDED; modelSetScale(monitor->model, monitor->model->scale * scale); - monitor->model->attachedtomodel = owner->model; - - if (monitor->ownerpart == 0) { - monitor->model->attachedtonode = owner->model->filedata->unk8->unk0; - } else if (monitor->ownerpart == 1) { - monitor->model->attachedtonode = owner->model->filedata->unk8->unk4; - } else if (monitor->ownerpart == 2) { - monitor->model->attachedtonode = owner->model->filedata->unk8->unk8; - } else { - monitor->model->attachedtonode = owner->model->filedata->unk8->unkC; + monitor->model->attachedto = owner->model; + + if (monitor->OwnerPart == 0) + { + monitor->model->attachedto_objinst = owner->model->obj->Switches[0]; + } + else if (monitor->OwnerPart == 1) + { + monitor->model->attachedto_objinst = owner->model->obj->Switches[1]; } + else if (monitor->OwnerPart == 2) + { + monitor->model->attachedto_objinst = owner->model->obj->Switches[2]; + } + else + { + monitor->model->attachedto_objinst = owner->model->obj->Switches[3];; + } + chrpropReparent(prop, owner->prop); - matrix_4x4_set_rotation_around_x(0.36651915f, &sp64); - matrix_scalar_multiply(monitor->model->scale / owner->model->scale, &sp64); + matrix_4x4_set_rotation_around_x(0.36651915f, (Mtxf*)&monitor->embedment->matrix); + matrix_scalar_multiply(monitor->model->scale / owner->model->scale, (f32*)&monitor->embedment->matrix); } - } else { - domakedefaultobj(arg0, monitor, cmdindex); } - if (monitor->prop && (monitor->flags & 0x40000000)) + else + { + domakedefaultobj(stageID, (ObjectRecord*)monitor, cmdindex); + } + + if ((monitor->flags & PROPFLAG_MONITOR_RENDERPOSTBG) && monitor->prop) { - monitor->prop->flags |= 1; + monitor->prop->flags |= PROPFLAG_RENDERPOSTBG; } } -#else -GLOBAL_ASM( -.late_rodata -glabel D_8004EF58 -.word 0x3ebba866 -glabel D_8004EF5C -.word 0x3fc90fdb -glabel D_8004EF60 -.word 0x3fc90fdb -.text -glabel setupSingleMonitor -/* 03796C 7F002E3C 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 037970 7F002E40 AFA40038 */ sw $a0, 0x38($sp) -/* 037974 7F002E44 3C0E8007 */ lui $t6, %hi(g_MonitorAnimController) -/* 037978 7F002E48 AFB10018 */ sw $s1, 0x18($sp) -/* 03797C 7F002E4C AFB00014 */ sw $s0, 0x14($sp) -/* 037980 7F002E50 25CE5B98 */ addiu $t6, %lo(g_MonitorAnimController) # addiu $t6, $t6, 0x5b98 -/* 037984 7F002E54 24A40080 */ addiu $a0, $a1, 0x80 -/* 037988 7F002E58 00A08025 */ move $s0, $a1 -/* 03798C 7F002E5C 00C08825 */ move $s1, $a2 -/* 037990 7F002E60 AFBF001C */ sw $ra, 0x1c($sp) -/* 037994 7F002E64 00804025 */ move $t0, $a0 -/* 037998 7F002E68 25D9006C */ addiu $t9, $t6, 0x6c -.L7F002E6C: -/* 03799C 7F002E6C 8DC10000 */ lw $at, ($t6) -/* 0379A0 7F002E70 25CE000C */ addiu $t6, $t6, 0xc -/* 0379A4 7F002E74 2508000C */ addiu $t0, $t0, 0xc -/* 0379A8 7F002E78 AD01FFF4 */ sw $at, -0xc($t0) -/* 0379AC 7F002E7C 8DC1FFF8 */ lw $at, -8($t6) -/* 0379B0 7F002E80 AD01FFF8 */ sw $at, -8($t0) -/* 0379B4 7F002E84 8DC1FFFC */ lw $at, -4($t6) -/* 0379B8 7F002E88 15D9FFF8 */ bne $t6, $t9, .L7F002E6C -/* 0379BC 7F002E8C AD01FFFC */ sw $at, -4($t0) -/* 0379C0 7F002E90 8DC10000 */ lw $at, ($t6) -/* 0379C4 7F002E94 AD010000 */ sw $at, ($t0) -/* 0379C8 7F002E98 8DD90004 */ lw $t9, 4($t6) -/* 0379CC 7F002E9C AD190004 */ sw $t9, 4($t0) -/* 0379D0 7F002EA0 0FC12726 */ jal monitorSetImageByNum -/* 0379D4 7F002EA4 8E0500FC */ lw $a1, 0xfc($s0) -/* 0379D8 7F002EA8 86090006 */ lh $t1, 6($s0) -/* 0379DC 7F002EAC 8FA40038 */ lw $a0, 0x38($sp) -/* 0379E0 7F002EB0 02002825 */ move $a1, $s0 -/* 0379E4 7F002EB4 05210075 */ bgez $t1, .L7F00308C -/* 0379E8 7F002EB8 00000000 */ nop -/* 0379EC 7F002EBC 8E0A0008 */ lw $t2, 8($s0) -/* 0379F0 7F002EC0 314B8000 */ andi $t3, $t2, 0x8000 -/* 0379F4 7F002EC4 15600071 */ bnez $t3, .L7F00308C -/* 0379F8 7F002EC8 00000000 */ nop -/* 0379FC 7F002ECC 860C0004 */ lh $t4, 4($s0) -/* 037A00 7F002ED0 AFAC002C */ sw $t4, 0x2c($sp) -/* 037A04 7F002ED4 8E0D00F4 */ lw $t5, 0xf4($s0) -/* 037A08 7F002ED8 0FC15AA2 */ jal setupGetPtrToCommandByIndex -/* 037A0C 7F002EDC 01B12021 */ addu $a0, $t5, $s1 -/* 037A10 7F002EE0 00408825 */ move $s1, $v0 -/* 037A14 7F002EE4 0FC15B0E */ jal modelLoad -/* 037A18 7F002EE8 8FA4002C */ lw $a0, 0x2c($sp) -/* 037A1C 7F002EEC 96180000 */ lhu $t8, ($s0) -/* 037A20 7F002EF0 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 037A24 7F002EF4 44982000 */ mtc1 $t8, $f4 -/* 037A28 7F002EF8 07010004 */ bgez $t8, .L7F002F0C -/* 037A2C 7F002EFC 468021A0 */ cvt.s.w $f6, $f4 -/* 037A30 7F002F00 44814000 */ mtc1 $at, $f8 -/* 037A34 7F002F04 00000000 */ nop -/* 037A38 7F002F08 46083180 */ add.s $f6, $f6, $f8 -.L7F002F0C: -/* 037A3C 7F002F0C 3C013B80 */ li $at, 0x3B800000 # 0.003906 -/* 037A40 7F002F10 44815000 */ mtc1 $at, $f10 -/* 037A44 7F002F14 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 037A48 7F002F18 44814000 */ mtc1 $at, $f8 -/* 037A4C 7F002F1C 460A3402 */ mul.s $f16, $f6, $f10 -/* 037A50 7F002F20 E7B00020 */ swc1 $f16, 0x20($sp) -/* 037A54 7F002F24 8E0F0074 */ lw $t7, 0x74($s0) -/* 037A58 7F002F28 448F9000 */ mtc1 $t7, $f18 -/* 037A5C 7F002F2C 00000000 */ nop -/* 037A60 7F002F30 46809120 */ cvt.s.w $f4, $f18 -/* 037A64 7F002F34 46082183 */ div.s $f6, $f4, $f8 -/* 037A68 7F002F38 0FC26919 */ jal getPlayerCount -/* 037A6C 7F002F3C E6060074 */ swc1 $f6, 0x74($s0) -/* 037A70 7F002F40 28410002 */ slti $at, $v0, 2 -/* 037A74 7F002F44 14200004 */ bnez $at, .L7F002F58 -/* 037A78 7F002F48 00000000 */ nop -/* 037A7C 7F002F4C 92190002 */ lbu $t9, 2($s0) -/* 037A80 7F002F50 372E0004 */ ori $t6, $t9, 4 -/* 037A84 7F002F54 A20E0002 */ sb $t6, 2($s0) -.L7F002F58: -/* 037A88 7F002F58 0FC101C7 */ jal objInitWithAutoModel -/* 037A8C 7F002F5C 02002025 */ move $a0, $s0 -/* 037A90 7F002F60 0FC0FFA6 */ jal monitorthingGetNew -/* 037A94 7F002F64 AFA20024 */ sw $v0, 0x24($sp) -/* 037A98 7F002F68 AE02006C */ sw $v0, 0x6c($s0) -/* 037A9C 7F002F6C 8FA80024 */ lw $t0, 0x24($sp) -/* 037AA0 7F002F70 51000049 */ beql $t0, $zero, .L7F003098 -/* 037AA4 7F002F74 8E190008 */ lw $t9, 8($s0) -/* 037AA8 7F002F78 50400047 */ beql $v0, $zero, .L7F003098 -/* 037AAC 7F002F7C 8E190008 */ lw $t9, 8($s0) -/* 037AB0 7F002F80 8E0A0064 */ lw $t2, 0x64($s0) -/* 037AB4 7F002F84 8E040014 */ lw $a0, 0x14($s0) -/* 037AB8 7F002F88 354B0040 */ ori $t3, $t2, 0x40 -/* 037ABC 7F002F8C AE0B0064 */ sw $t3, 0x64($s0) -/* 037AC0 7F002F90 C7B00020 */ lwc1 $f16, 0x20($sp) -/* 037AC4 7F002F94 C48A0014 */ lwc1 $f10, 0x14($a0) -/* 037AC8 7F002F98 46105482 */ mul.s $f18, $f10, $f16 -/* 037ACC 7F002F9C 44059000 */ mfc1 $a1, $f18 -/* 037AD0 7F002FA0 0FC1B39E */ jal modelSetScale -/* 037AD4 7F002FA4 00000000 */ nop -/* 037AD8 7F002FA8 8E2C0014 */ lw $t4, 0x14($s1) -/* 037ADC 7F002FAC 8E0D0014 */ lw $t5, 0x14($s0) -/* 037AE0 7F002FB0 24010001 */ li $at, 1 -/* 037AE4 7F002FB4 ADAC0018 */ sw $t4, 0x18($t5) -/* 037AE8 7F002FB8 8E0200F8 */ lw $v0, 0xf8($s0) -/* 037AEC 7F002FBC 14400008 */ bnez $v0, .L7F002FE0 -/* 037AF0 7F002FC0 00000000 */ nop -/* 037AF4 7F002FC4 8E380014 */ lw $t8, 0x14($s1) -/* 037AF8 7F002FC8 8E080014 */ lw $t0, 0x14($s0) -/* 037AFC 7F002FCC 8F0F0008 */ lw $t7, 8($t8) -/* 037B00 7F002FD0 8DF90008 */ lw $t9, 8($t7) -/* 037B04 7F002FD4 8F2E0000 */ lw $t6, ($t9) -/* 037B08 7F002FD8 1000001A */ b .L7F003044 -/* 037B0C 7F002FDC AD0E001C */ sw $t6, 0x1c($t0) -.L7F002FE0: -/* 037B10 7F002FE0 54410009 */ bnel $v0, $at, .L7F003008 -/* 037B14 7F002FE4 24010002 */ li $at, 2 -/* 037B18 7F002FE8 8E290014 */ lw $t1, 0x14($s1) -/* 037B1C 7F002FEC 8E0D0014 */ lw $t5, 0x14($s0) -/* 037B20 7F002FF0 8D2A0008 */ lw $t2, 8($t1) -/* 037B24 7F002FF4 8D4B0008 */ lw $t3, 8($t2) -/* 037B28 7F002FF8 8D6C0004 */ lw $t4, 4($t3) -/* 037B2C 7F002FFC 10000011 */ b .L7F003044 -/* 037B30 7F003000 ADAC001C */ sw $t4, 0x1c($t5) -/* 037B34 7F003004 24010002 */ li $at, 2 -.L7F003008: -/* 037B38 7F003008 54410009 */ bnel $v0, $at, .L7F003030 -/* 037B3C 7F00300C 8E290014 */ lw $t1, 0x14($s1) -/* 037B40 7F003010 8E380014 */ lw $t8, 0x14($s1) -/* 037B44 7F003014 8E080014 */ lw $t0, 0x14($s0) -/* 037B48 7F003018 8F0F0008 */ lw $t7, 8($t8) -/* 037B4C 7F00301C 8DF90008 */ lw $t9, 8($t7) -/* 037B50 7F003020 8F2E0008 */ lw $t6, 8($t9) -/* 037B54 7F003024 10000007 */ b .L7F003044 -/* 037B58 7F003028 AD0E001C */ sw $t6, 0x1c($t0) -/* 037B5C 7F00302C 8E290014 */ lw $t1, 0x14($s1) -.L7F003030: -/* 037B60 7F003030 8E0D0014 */ lw $t5, 0x14($s0) -/* 037B64 7F003034 8D2A0008 */ lw $t2, 8($t1) -/* 037B68 7F003038 8D4B0008 */ lw $t3, 8($t2) -/* 037B6C 7F00303C 8D6C000C */ lw $t4, 0xc($t3) -/* 037B70 7F003040 ADAC001C */ sw $t4, 0x1c($t5) -.L7F003044: -/* 037B74 7F003044 8FA40024 */ lw $a0, 0x24($sp) -/* 037B78 7F003048 0FC0E969 */ jal chrpropReparent -/* 037B7C 7F00304C 8E250010 */ lw $a1, 0x10($s1) -/* 037B80 7F003050 8E05006C */ lw $a1, 0x6c($s0) -/* 037B84 7F003054 3C018005 */ lui $at, %hi(D_8004EF58) -/* 037B88 7F003058 C42CEF58 */ lwc1 $f12, %lo(D_8004EF58)($at) -/* 037B8C 7F00305C 0FC1615C */ jal matrix_4x4_set_rotation_around_x -/* 037B90 7F003060 24A50004 */ addiu $a1, $a1, 4 -/* 037B94 7F003064 8E180014 */ lw $t8, 0x14($s0) -/* 037B98 7F003068 8E2F0014 */ lw $t7, 0x14($s1) -/* 037B9C 7F00306C 8E05006C */ lw $a1, 0x6c($s0) -/* 037BA0 7F003070 C7040014 */ lwc1 $f4, 0x14($t8) -/* 037BA4 7F003074 C5E80014 */ lwc1 $f8, 0x14($t7) -/* 037BA8 7F003078 24A50004 */ addiu $a1, $a1, 4 -/* 037BAC 7F00307C 0FC1629F */ jal matrix_scalar_multiply -/* 037BB0 7F003080 46082303 */ div.s $f12, $f4, $f8 -/* 037BB4 7F003084 10000004 */ b .L7F003098 -/* 037BB8 7F003088 8E190008 */ lw $t9, 8($s0) -.L7F00308C: -/* 037BBC 7F00308C 0FC00767 */ jal domakedefaultobj -/* 037BC0 7F003090 02203025 */ move $a2, $s1 -/* 037BC4 7F003094 8E190008 */ lw $t9, 8($s0) -.L7F003098: -/* 037BC8 7F003098 00197040 */ sll $t6, $t9, 1 -/* 037BCC 7F00309C 05C30008 */ bgezl $t6, .L7F0030C0 -/* 037BD0 7F0030A0 8FBF001C */ lw $ra, 0x1c($sp) -/* 037BD4 7F0030A4 8E020010 */ lw $v0, 0x10($s0) -/* 037BD8 7F0030A8 50400005 */ beql $v0, $zero, .L7F0030C0 -/* 037BDC 7F0030AC 8FBF001C */ lw $ra, 0x1c($sp) -/* 037BE0 7F0030B0 90480001 */ lbu $t0, 1($v0) -/* 037BE4 7F0030B4 35090001 */ ori $t1, $t0, 1 -/* 037BE8 7F0030B8 A0490001 */ sb $t1, 1($v0) -/* 037BEC 7F0030BC 8FBF001C */ lw $ra, 0x1c($sp) -.L7F0030C0: -/* 037BF0 7F0030C0 8FB00014 */ lw $s0, 0x14($sp) -/* 037BF4 7F0030C4 8FB10018 */ lw $s1, 0x18($sp) -/* 037BF8 7F0030C8 03E00008 */ jr $ra -/* 037BFC 7F0030CC 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif +void setupMultiMonitor(s32 stageID, MultiMonitorObjRecord* monitor, s32 cmdindex) +{ + monitor->Monitor[0] = g_MonitorAnimController; + monitorSetImageByNum(&monitor->Monitor[0], monitor->ImageNums[0]); + monitor->Monitor[1] = g_MonitorAnimController; + monitorSetImageByNum(&monitor->Monitor[1], monitor->ImageNums[1]); -#ifdef NONMATCHING -void setupMultiMonitor(void) { + monitor->Monitor[2] = g_MonitorAnimController; + monitorSetImageByNum(&monitor->Monitor[2], monitor->ImageNums[2]); + + monitor->Monitor[3] = g_MonitorAnimController; + monitorSetImageByNum(&monitor->Monitor[3], monitor->ImageNums[3]); + domakedefaultobj(stageID, monitor, cmdindex); } -#else -GLOBAL_ASM( -.text -glabel setupMultiMonitor -/* 037C00 7F0030D0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 037C04 7F0030D4 AFA40020 */ sw $a0, 0x20($sp) -/* 037C08 7F0030D8 3C0E8007 */ lui $t6, %hi(g_MonitorAnimController) -/* 037C0C 7F0030DC AFB00018 */ sw $s0, 0x18($sp) -/* 037C10 7F0030E0 25CE5B98 */ addiu $t6, %lo(g_MonitorAnimController) # addiu $t6, $t6, 0x5b98 -/* 037C14 7F0030E4 24A40080 */ addiu $a0, $a1, 0x80 -/* 037C18 7F0030E8 00A08025 */ move $s0, $a1 -/* 037C1C 7F0030EC AFBF001C */ sw $ra, 0x1c($sp) -/* 037C20 7F0030F0 AFA60028 */ sw $a2, 0x28($sp) -/* 037C24 7F0030F4 00804025 */ move $t0, $a0 -/* 037C28 7F0030F8 25D9006C */ addiu $t9, $t6, 0x6c -.L7F0030FC: -/* 037C2C 7F0030FC 8DC10000 */ lw $at, ($t6) -/* 037C30 7F003100 25CE000C */ addiu $t6, $t6, 0xc -/* 037C34 7F003104 2508000C */ addiu $t0, $t0, 0xc -/* 037C38 7F003108 AD01FFF4 */ sw $at, -0xc($t0) -/* 037C3C 7F00310C 8DC1FFF8 */ lw $at, -8($t6) -/* 037C40 7F003110 AD01FFF8 */ sw $at, -8($t0) -/* 037C44 7F003114 8DC1FFFC */ lw $at, -4($t6) -/* 037C48 7F003118 15D9FFF8 */ bne $t6, $t9, .L7F0030FC -/* 037C4C 7F00311C AD01FFFC */ sw $at, -4($t0) -/* 037C50 7F003120 8DC10000 */ lw $at, ($t6) -/* 037C54 7F003124 AD010000 */ sw $at, ($t0) -/* 037C58 7F003128 8DD90004 */ lw $t9, 4($t6) -/* 037C5C 7F00312C AD190004 */ sw $t9, 4($t0) -/* 037C60 7F003130 0FC12726 */ jal monitorSetImageByNum -/* 037C64 7F003134 92050250 */ lbu $a1, 0x250($s0) -/* 037C68 7F003138 3C098007 */ lui $t1, %hi(g_MonitorAnimController) -/* 037C6C 7F00313C 25295B98 */ addiu $t1, %lo(g_MonitorAnimController) # addiu $t1, $t1, 0x5b98 -/* 037C70 7F003140 260400F4 */ addiu $a0, $s0, 0xf4 -/* 037C74 7F003144 00806825 */ move $t5, $a0 -/* 037C78 7F003148 252C006C */ addiu $t4, $t1, 0x6c -.L7F00314C: -/* 037C7C 7F00314C 8D210000 */ lw $at, ($t1) -/* 037C80 7F003150 2529000C */ addiu $t1, $t1, 0xc -/* 037C84 7F003154 25AD000C */ addiu $t5, $t5, 0xc -/* 037C88 7F003158 ADA1FFF4 */ sw $at, -0xc($t5) -/* 037C8C 7F00315C 8D21FFF8 */ lw $at, -8($t1) -/* 037C90 7F003160 ADA1FFF8 */ sw $at, -8($t5) -/* 037C94 7F003164 8D21FFFC */ lw $at, -4($t1) -/* 037C98 7F003168 152CFFF8 */ bne $t1, $t4, .L7F00314C -/* 037C9C 7F00316C ADA1FFFC */ sw $at, -4($t5) -/* 037CA0 7F003170 8D210000 */ lw $at, ($t1) -/* 037CA4 7F003174 ADA10000 */ sw $at, ($t5) -/* 037CA8 7F003178 8D2C0004 */ lw $t4, 4($t1) -/* 037CAC 7F00317C ADAC0004 */ sw $t4, 4($t5) -/* 037CB0 7F003180 0FC12726 */ jal monitorSetImageByNum -/* 037CB4 7F003184 92050251 */ lbu $a1, 0x251($s0) -/* 037CB8 7F003188 3C188007 */ lui $t8, %hi(g_MonitorAnimController) -/* 037CBC 7F00318C 27185B98 */ addiu $t8, %lo(g_MonitorAnimController) # addiu $t8, $t8, 0x5b98 -/* 037CC0 7F003190 26040168 */ addiu $a0, $s0, 0x168 -/* 037CC4 7F003194 00804025 */ move $t0, $a0 -/* 037CC8 7F003198 270E006C */ addiu $t6, $t8, 0x6c -.L7F00319C: -/* 037CCC 7F00319C 8F010000 */ lw $at, ($t8) -/* 037CD0 7F0031A0 2718000C */ addiu $t8, $t8, 0xc -/* 037CD4 7F0031A4 2508000C */ addiu $t0, $t0, 0xc -/* 037CD8 7F0031A8 AD01FFF4 */ sw $at, -0xc($t0) -/* 037CDC 7F0031AC 8F01FFF8 */ lw $at, -8($t8) -/* 037CE0 7F0031B0 AD01FFF8 */ sw $at, -8($t0) -/* 037CE4 7F0031B4 8F01FFFC */ lw $at, -4($t8) -/* 037CE8 7F0031B8 170EFFF8 */ bne $t8, $t6, .L7F00319C -/* 037CEC 7F0031BC AD01FFFC */ sw $at, -4($t0) -/* 037CF0 7F0031C0 8F010000 */ lw $at, ($t8) -/* 037CF4 7F0031C4 AD010000 */ sw $at, ($t0) -/* 037CF8 7F0031C8 8F0E0004 */ lw $t6, 4($t8) -/* 037CFC 7F0031CC AD0E0004 */ sw $t6, 4($t0) -/* 037D00 7F0031D0 0FC12726 */ jal monitorSetImageByNum -/* 037D04 7F0031D4 92050252 */ lbu $a1, 0x252($s0) -/* 037D08 7F0031D8 3C0B8007 */ lui $t3, %hi(g_MonitorAnimController) -/* 037D0C 7F0031DC 256B5B98 */ addiu $t3, %lo(g_MonitorAnimController) # addiu $t3, $t3, 0x5b98 -/* 037D10 7F0031E0 260401DC */ addiu $a0, $s0, 0x1dc -/* 037D14 7F0031E4 00806825 */ move $t5, $a0 -/* 037D18 7F0031E8 2569006C */ addiu $t1, $t3, 0x6c -.L7F0031EC: -/* 037D1C 7F0031EC 8D610000 */ lw $at, ($t3) -/* 037D20 7F0031F0 256B000C */ addiu $t3, $t3, 0xc -/* 037D24 7F0031F4 25AD000C */ addiu $t5, $t5, 0xc -/* 037D28 7F0031F8 ADA1FFF4 */ sw $at, -0xc($t5) -/* 037D2C 7F0031FC 8D61FFF8 */ lw $at, -8($t3) -/* 037D30 7F003200 ADA1FFF8 */ sw $at, -8($t5) -/* 037D34 7F003204 8D61FFFC */ lw $at, -4($t3) -/* 037D38 7F003208 1569FFF8 */ bne $t3, $t1, .L7F0031EC -/* 037D3C 7F00320C ADA1FFFC */ sw $at, -4($t5) -/* 037D40 7F003210 8D610000 */ lw $at, ($t3) -/* 037D44 7F003214 ADA10000 */ sw $at, ($t5) -/* 037D48 7F003218 8D690004 */ lw $t1, 4($t3) -/* 037D4C 7F00321C ADA90004 */ sw $t1, 4($t5) -/* 037D50 7F003220 0FC12726 */ jal monitorSetImageByNum -/* 037D54 7F003224 92050253 */ lbu $a1, 0x253($s0) -/* 037D58 7F003228 8FA40020 */ lw $a0, 0x20($sp) -/* 037D5C 7F00322C 02002825 */ move $a1, $s0 -/* 037D60 7F003230 0FC00767 */ jal domakedefaultobj -/* 037D64 7F003234 8FA60028 */ lw $a2, 0x28($sp) -/* 037D68 7F003238 8FBF001C */ lw $ra, 0x1c($sp) -/* 037D6C 7F00323C 8FB00018 */ lw $s0, 0x18($sp) -/* 037D70 7F003240 27BD0020 */ addiu $sp, $sp, 0x20 -/* 037D74 7F003244 03E00008 */ jr $ra -/* 037D78 7F003248 00000000 */ nop -) -#endif +void sub_GAME_7F00324C(struct BoundPadRecord *arg0, s32 *arg1, s32 *arg2, struct coord3d *arg3, struct coord3d *arg4) +{ + StandTile *sp4C; + struct coord3d normal; + s32 padding; + struct coord3d center; + StandTile *sp2C; + f32 scale; -#ifdef NONMATCHING -void sub_GAME_7F00324C(void) { + sub_GAME_7F001BD4(arg0, ¢er); + sp2C = (StandTile *)arg0->stan; + + if (walkTilesBetweenPoints_NoCallback(&sp2C, arg0->pos.f[0], arg0->pos.f[2], center.f[0], center.f[2]) == 0) + { + sp2C = (StandTile *)arg0->stan; + center.f[0] = arg0->pos.f[0]; + center.f[1] = arg0->pos.f[1]; + center.f[2] = arg0->pos.f[2]; + } + normal.f[0] = (arg0->up.f[1] * arg0->look.f[2]) - (arg0->up.f[2] * arg0->look.f[1]); + normal.f[1] = (arg0->up.f[2] * arg0->look.f[0]) - (arg0->up.f[0] * arg0->look.f[2]); + normal.f[2] = (arg0->up.f[0] * arg0->look.f[1]) - (arg0->up.f[1] * arg0->look.f[0]); + + scale = 1.0f / sqrtf(((normal.f[0] * normal.f[0]) + (normal.f[1] * normal.f[1])) + (normal.f[2] * normal.f[2])); + sp4C = sp2C; + + normal.f[0] *= scale; + normal.f[1] *= scale; + normal.f[2] *= scale; + + arg3->f[0] = center.f[0] + (normal.f[0] * 50.0f); + arg3->f[1] = center.f[1]; + arg3->f[2] = center.f[2] + (normal.f[2] * 50.0f); + + + walkTilesBetweenPoints_NoCallback(&sp4C, center.f[0], center.f[2], arg3->f[0], arg3->f[2]); + + if (1); + + *arg1 = (s32) sp4C->room; + sp4C = sp2C; + + arg4->f[0] = center.f[0] - (normal.f[0] * 50.0f); + arg4->f[1] = center.f[1]; + arg4->f[2] = center.f[2] - (normal.f[2] * 50.0f); + + walkTilesBetweenPoints_NoCallback(&sp4C, center.f[0], center.f[2], arg4->f[0], arg4->f[2]); + + if (1); + + *arg2 = (s32) sp4C->room; + + if (*arg2 == *arg1) + { + *arg2 = -1; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F00324C -/* 037D7C 7F00324C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* 037D80 7F003250 AFBF0024 */ sw $ra, 0x24($sp) -/* 037D84 7F003254 AFB10020 */ sw $s1, 0x20($sp) -/* 037D88 7F003258 AFB0001C */ sw $s0, 0x1c($sp) -/* 037D8C 7F00325C AFA50054 */ sw $a1, 0x54($sp) -/* 037D90 7F003260 00808025 */ move $s0, $a0 -/* 037D94 7F003264 00E08825 */ move $s1, $a3 -/* 037D98 7F003268 AFA60058 */ sw $a2, 0x58($sp) -/* 037D9C 7F00326C 0FC006F5 */ jal sub_GAME_7F001BD4 -/* 037DA0 7F003270 27A50030 */ addiu $a1, $sp, 0x30 -/* 037DA4 7F003274 8E0E0028 */ lw $t6, 0x28($s0) -/* 037DA8 7F003278 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 037DAC 7F00327C 27A4002C */ addiu $a0, $sp, 0x2c -/* 037DB0 7F003280 AFAE002C */ sw $t6, 0x2c($sp) -/* 037DB4 7F003284 8E060008 */ lw $a2, 8($s0) -/* 037DB8 7F003288 8E050000 */ lw $a1, ($s0) -/* 037DBC 7F00328C 8FA70030 */ lw $a3, 0x30($sp) -/* 037DC0 7F003290 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 037DC4 7F003294 E7A40010 */ swc1 $f4, 0x10($sp) -/* 037DC8 7F003298 5440000A */ bnezl $v0, .L7F0032C4 -/* 037DCC 7F00329C C6100010 */ lwc1 $f16, 0x10($s0) -/* 037DD0 7F0032A0 8E0F0028 */ lw $t7, 0x28($s0) -/* 037DD4 7F0032A4 AFAF002C */ sw $t7, 0x2c($sp) -/* 037DD8 7F0032A8 C6060000 */ lwc1 $f6, ($s0) -/* 037DDC 7F0032AC E7A60030 */ swc1 $f6, 0x30($sp) -/* 037DE0 7F0032B0 C6080004 */ lwc1 $f8, 4($s0) -/* 037DE4 7F0032B4 E7A80034 */ swc1 $f8, 0x34($sp) -/* 037DE8 7F0032B8 C60A0008 */ lwc1 $f10, 8($s0) -/* 037DEC 7F0032BC E7AA0038 */ swc1 $f10, 0x38($sp) -/* 037DF0 7F0032C0 C6100010 */ lwc1 $f16, 0x10($s0) -.L7F0032C4: -/* 037DF4 7F0032C4 C6120020 */ lwc1 $f18, 0x20($s0) -/* 037DF8 7F0032C8 C606001C */ lwc1 $f6, 0x1c($s0) -/* 037DFC 7F0032CC C6080014 */ lwc1 $f8, 0x14($s0) -/* 037E00 7F0032D0 46128102 */ mul.s $f4, $f16, $f18 -/* 037E04 7F0032D4 00000000 */ nop -/* 037E08 7F0032D8 46083282 */ mul.s $f10, $f6, $f8 -/* 037E0C 7F0032DC 460A2401 */ sub.s $f16, $f4, $f10 -/* 037E10 7F0032E0 E7B00040 */ swc1 $f16, 0x40($sp) -/* 037E14 7F0032E4 C6060018 */ lwc1 $f6, 0x18($s0) -/* 037E18 7F0032E8 C6120014 */ lwc1 $f18, 0x14($s0) -/* 037E1C 7F0032EC C60A000C */ lwc1 $f10, 0xc($s0) -/* 037E20 7F0032F0 C6040020 */ lwc1 $f4, 0x20($s0) -/* 037E24 7F0032F4 46069202 */ mul.s $f8, $f18, $f6 -/* 037E28 7F0032F8 00000000 */ nop -/* 037E2C 7F0032FC 460A2482 */ mul.s $f18, $f4, $f10 -/* 037E30 7F003300 46124181 */ sub.s $f6, $f8, $f18 -/* 037E34 7F003304 E7A60044 */ swc1 $f6, 0x44($sp) -/* 037E38 7F003308 C60A001C */ lwc1 $f10, 0x1c($s0) -/* 037E3C 7F00330C C604000C */ lwc1 $f4, 0xc($s0) -/* 037E40 7F003310 C6120018 */ lwc1 $f18, 0x18($s0) -/* 037E44 7F003314 460A2202 */ mul.s $f8, $f4, $f10 -/* 037E48 7F003318 C6040010 */ lwc1 $f4, 0x10($s0) -/* 037E4C 7F00331C 46049282 */ mul.s $f10, $f18, $f4 -/* 037E50 7F003320 460A4481 */ sub.s $f18, $f8, $f10 -/* 037E54 7F003324 46108102 */ mul.s $f4, $f16, $f16 -/* 037E58 7F003328 00000000 */ nop -/* 037E5C 7F00332C 46063202 */ mul.s $f8, $f6, $f6 -/* 037E60 7F003330 E7B20048 */ swc1 $f18, 0x48($sp) -/* 037E64 7F003334 46129402 */ mul.s $f16, $f18, $f18 -/* 037E68 7F003338 46082280 */ add.s $f10, $f4, $f8 -/* 037E6C 7F00333C 0C007DF8 */ jal sqrtf -/* 037E70 7F003340 460A8300 */ add.s $f12, $f16, $f10 -/* 037E74 7F003344 3C014248 */ li $at, 0x42480000 # 50.000000 -/* 037E78 7F003348 44816000 */ mtc1 $at, $f12 -/* 037E7C 7F00334C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 037E80 7F003350 44813000 */ mtc1 $at, $f6 -/* 037E84 7F003354 C7A40040 */ lwc1 $f4, 0x40($sp) -/* 037E88 7F003358 C7B20044 */ lwc1 $f18, 0x44($sp) -/* 037E8C 7F00335C 46003083 */ div.s $f2, $f6, $f0 -/* 037E90 7F003360 C7AA0048 */ lwc1 $f10, 0x48($sp) -/* 037E94 7F003364 8FB8002C */ lw $t8, 0x2c($sp) -/* 037E98 7F003368 27B0004C */ addiu $s0, $sp, 0x4c -/* 037E9C 7F00336C 02002025 */ move $a0, $s0 -/* 037EA0 7F003370 AFB8004C */ sw $t8, 0x4c($sp) -/* 037EA4 7F003374 46022202 */ mul.s $f8, $f4, $f2 -/* 037EA8 7F003378 00000000 */ nop -/* 037EAC 7F00337C 46029402 */ mul.s $f16, $f18, $f2 -/* 037EB0 7F003380 C7B20030 */ lwc1 $f18, 0x30($sp) -/* 037EB4 7F003384 46025182 */ mul.s $f6, $f10, $f2 -/* 037EB8 7F003388 E7A80040 */ swc1 $f8, 0x40($sp) -/* 037EBC 7F00338C 460C4102 */ mul.s $f4, $f8, $f12 -/* 037EC0 7F003390 E7B00044 */ swc1 $f16, 0x44($sp) -/* 037EC4 7F003394 E7A60048 */ swc1 $f6, 0x48($sp) -/* 037EC8 7F003398 46122400 */ add.s $f16, $f4, $f18 -/* 037ECC 7F00339C E6300000 */ swc1 $f16, ($s1) -/* 037ED0 7F0033A0 C7AA0034 */ lwc1 $f10, 0x34($sp) -/* 037ED4 7F0033A4 8E270000 */ lw $a3, ($s1) -/* 037ED8 7F0033A8 E62A0004 */ swc1 $f10, 4($s1) -/* 037EDC 7F0033AC C7A60048 */ lwc1 $f6, 0x48($sp) -/* 037EE0 7F0033B0 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 037EE4 7F0033B4 460C3202 */ mul.s $f8, $f6, $f12 -/* 037EE8 7F0033B8 46044480 */ add.s $f18, $f8, $f4 -/* 037EEC 7F0033BC E6320008 */ swc1 $f18, 8($s1) -/* 037EF0 7F0033C0 C6300008 */ lwc1 $f16, 8($s1) -/* 037EF4 7F0033C4 8FA60038 */ lw $a2, 0x38($sp) -/* 037EF8 7F0033C8 8FA50030 */ lw $a1, 0x30($sp) -/* 037EFC 7F0033CC 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 037F00 7F0033D0 E7B00010 */ swc1 $f16, 0x10($sp) -/* 037F04 7F0033D4 8FB9004C */ lw $t9, 0x4c($sp) -/* 037F08 7F0033D8 8FA90054 */ lw $t1, 0x54($sp) -/* 037F0C 7F0033DC 8FA20060 */ lw $v0, 0x60($sp) -/* 037F10 7F0033E0 93280003 */ lbu $t0, 3($t9) -/* 037F14 7F0033E4 3C014248 */ li $at, 0x42480000 # 50.000000 -/* 037F18 7F0033E8 44816000 */ mtc1 $at, $f12 -/* 037F1C 7F0033EC AD280000 */ sw $t0, ($t1) -/* 037F20 7F0033F0 C7A60040 */ lwc1 $f6, 0x40($sp) -/* 037F24 7F0033F4 C7AA0030 */ lwc1 $f10, 0x30($sp) -/* 037F28 7F0033F8 8FAA002C */ lw $t2, 0x2c($sp) -/* 037F2C 7F0033FC 460C3202 */ mul.s $f8, $f6, $f12 -/* 037F30 7F003400 02002025 */ move $a0, $s0 -/* 037F34 7F003404 AFAA004C */ sw $t2, 0x4c($sp) -/* 037F38 7F003408 46085101 */ sub.s $f4, $f10, $f8 -/* 037F3C 7F00340C E4440000 */ swc1 $f4, ($v0) -/* 037F40 7F003410 C7B20034 */ lwc1 $f18, 0x34($sp) -/* 037F44 7F003414 8C470000 */ lw $a3, ($v0) -/* 037F48 7F003418 E4520004 */ swc1 $f18, 4($v0) -/* 037F4C 7F00341C C7A60048 */ lwc1 $f6, 0x48($sp) -/* 037F50 7F003420 C7B00038 */ lwc1 $f16, 0x38($sp) -/* 037F54 7F003424 460C3282 */ mul.s $f10, $f6, $f12 -/* 037F58 7F003428 460A8201 */ sub.s $f8, $f16, $f10 -/* 037F5C 7F00342C E4480008 */ swc1 $f8, 8($v0) -/* 037F60 7F003430 C4440008 */ lwc1 $f4, 8($v0) -/* 037F64 7F003434 8FA60038 */ lw $a2, 0x38($sp) -/* 037F68 7F003438 8FA50030 */ lw $a1, 0x30($sp) -/* 037F6C 7F00343C 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 037F70 7F003440 E7A40010 */ swc1 $f4, 0x10($sp) -/* 037F74 7F003444 8FAB004C */ lw $t3, 0x4c($sp) -/* 037F78 7F003448 8FA20058 */ lw $v0, 0x58($sp) -/* 037F7C 7F00344C 2418FFFF */ li $t8, -1 -/* 037F80 7F003450 916C0003 */ lbu $t4, 3($t3) -/* 037F84 7F003454 AC4C0000 */ sw $t4, ($v0) -/* 037F88 7F003458 8FAE0054 */ lw $t6, 0x54($sp) -/* 037F8C 7F00345C 8DCF0000 */ lw $t7, ($t6) -/* 037F90 7F003460 558F0003 */ bnel $t4, $t7, .L7F003470 -/* 037F94 7F003464 8FBF0024 */ lw $ra, 0x24($sp) -/* 037F98 7F003468 AC580000 */ sw $t8, ($v0) -/* 037F9C 7F00346C 8FBF0024 */ lw $ra, 0x24($sp) -.L7F003470: -/* 037FA0 7F003470 8FB0001C */ lw $s0, 0x1c($sp) -/* 037FA4 7F003474 8FB10020 */ lw $s1, 0x20($sp) -/* 037FA8 7F003478 03E00008 */ jr $ra -/* 037FAC 7F00347C 27BD0050 */ addiu $sp, $sp, 0x50 -) -#endif -#ifdef NONMATCHING -void setupDoor(void) { +extern f32 g_DoorScale; +/** + * + * NTSC ADDRESS: 7F003480 + * PAL ADDRESS: 7F0033F0 + * Perfect Dark: void setupCreateDoor(struct doorobj *door, s32 cmdindex) +*/ +void setupDoor(s32 arg0, struct DoorRecord *door, s32 arg2) +{ + s32 padding; // no sp + s32 modelnum; + struct BoundPadRecord *pad; + StandTile *sp1C8_stan; + PropRecord *prop; + struct coord3d sp1B8; + s32 portalnum; //sp1b4 + s32 sp1B0; + s32 sp1AC; + struct coord3d sp1A0; + struct coord3d sp194; + struct PortalMetric sp180; + struct ModelRoData_BoundingBoxRecord *temp_v0; + struct coord3d sp170; + StandTile *sp16C; + Mtxf sp12C; + f32 temp_f2; // no sp + ModelFileHeader *sp124; + struct coord3d sp118; /* compiler-managed */ + StandTile *sp114_stan; + Mtxf spD4; + struct coord3d spC8; + Mtxf sp88; + struct coord3d sp7C; + struct bbox bb2; + f32 xscale; + f32 yscale; + f32 zscale; + f32 scale; + //StandTile *stan; + u8 *padding2; -} + modelnum = door->obj; + + portalnum = -1; + sp1B0 = -1; + sp1AC = -1; + + modelLoad(modelnum); + + pad = &(g_CurrentSetup.boundpads[door->pad]); + + if ((door->flags & PROPFLAG_CULL_BEHIND_DOOR) || (door->flags & PROPFLAG_NO_PORTAL_CLOSE)) + { + sub_GAME_7F00324C(pad, &sp1B0, &sp1AC, &sp1A0, &sp194); + + if ((door->flags & PROPFLAG_CULL_BEHIND_DOOR) && (sp1B0 >= 0) && (sp1AC >= 0)) + { + portalnum = sub_GAME_7F0B9CC8(sp1B0, sp1AC, &sp1A0, &sp194); + } + } + + if (g_DoorScale != 1.0f) + { + if (portalnum >= 0) + { + sub_GAME_7F0B96CC(portalnum, &sp180); + sp180.min *= get_room_data_float2(); + + temp_f2 = (pad->pos.f[0] * sp180.normal.f[0]) + (pad->pos.f[1] * sp180.normal.f[1]) + (pad->pos.f[2] * sp180.normal.f[2]); + + if (g_DoorScale < 1.0f) + { + temp_f2 = (temp_f2 - sp180.min) * (1.0f - g_DoorScale); + sp170.f[0] = pad->pos.f[0] - (sp180.normal.f[0] * temp_f2); + sp170.f[1] = pad->pos.f[1] - (sp180.normal.f[1] * temp_f2); + sp170.f[2] = pad->pos.f[2] - (sp180.normal.f[2] * temp_f2); + } + else + { + temp_f2 = (temp_f2 - sp180.min) * (g_DoorScale - 1.0f); + sp170.f[0] = pad->pos.f[0] + (sp180.normal.f[0] * temp_f2); + sp170.f[1] = pad->pos.f[1] + (sp180.normal.f[1] * temp_f2); + sp170.f[2] = pad->pos.f[2] + (sp180.normal.f[2] * temp_f2); + } + + sp16C = pad->stan; + if (walkTilesBetweenPoints_NoCallback(&sp16C, pad->pos.f[0], pad->pos.f[2], sp170.f[0], sp170.f[2]) != 0) + { + pad->stan = sp16C; + pad->pos.f[0] = sp170.f[0]; + pad->pos.f[1] = sp170.f[1]; + pad->pos.f[2] = sp170.f[2]; + pad->bbox.xmin *= g_DoorScale; + pad->bbox.xmax *= g_DoorScale; + } + } + else + { + pad->bbox.xmin *= g_DoorScale; + pad->bbox.xmax *= g_DoorScale; + } + } + + if (sub_GAME_7F056850((PadRecord *)pad, pad->stan, 0.0f, &sp1B8, &sp1C8_stan) != 0) + { + matrix_4x4_7F059908(&sp12C, 0, 0, 0, -pad->look.f[0], -pad->look.f[1], -pad->look.f[2], pad->up.f[0], pad->up.f[1], pad->up.f[2]); + sp124 = PitemZ_entries[modelnum].header; + sp114_stan = sp1C8_stan; + + bb2.zmax = pad->bbox.xmin; + bb2.zmin = pad->bbox.xmax; //78 + bb2.ymax = pad->bbox.ymin; //74 + bb2.ymin = pad->bbox.ymax; //70 + bb2.xmax = pad->bbox.zmin; //6c + bb2.xmin = pad->bbox.zmax; //68 + + matrix_4x4_set_rotation_around_x(M_HALF_PI, &spD4); + matrix_4x4_set_rotation_around_z(M_HALF_PI, &sp88); + matrix_4x4_multiply_in_place(&sp88, &spD4); + matrix_4x4_multiply_in_place(&sp12C, &spD4); + sub_GAME_7F001BD4(pad, &sp118); + + temp_v0 = (struct ModelRoData_BoundingBoxRecord *)sp124->RootNode->Child->Data; + + xscale = (bb2.ymin - bb2.ymax) / (temp_v0->Bounds.xmax - temp_v0->Bounds.xmin); + yscale = (bb2.xmin - bb2.xmax) / (temp_v0->Bounds.ymax - temp_v0->Bounds.ymin); + zscale = (bb2.zmin - bb2.zmax) / (temp_v0->Bounds.zmax - temp_v0->Bounds.zmin); + + if ((xscale <= 0.000001f) || (yscale <= 0.000001f) || (zscale <= 0.000001f)) + { + xscale = + yscale = + zscale = 1.0f; + } + + matrix_column_1_scalar_multiply(xscale, spD4.m[0]); + matrix_column_2_scalar_multiply(yscale, spD4.m[0]); + matrix_column_3_scalar_multiply_2(zscale, spD4.m[0]); + + spC8.f[0] = sp118.f[0]; + spC8.f[1] = sp118.f[1]; + spC8.f[2] = sp118.f[2]; + + if (!(door->flags2 & 1)) + { + if (walkTilesBetweenPoints_NoCallback(&sp114_stan, sp1B8.f[0], sp1B8.f[2], sp118.f[0], sp118.f[2]) != 0) + { + sp1C8_stan = sp114_stan; + } + else + { + sp118.f[0] = sp1B8.f[0]; + sp118.f[2] = sp1B8.f[2]; + + if (!(door->flags & 0x1000)) // prop flag PROPFLAG_00001000 "Absolute Position" + { + // + } + } + } + else + { + sp118.f[0] = sp1B8.f[0]; + sp118.f[1] = sp1B8.f[1]; + sp118.f[2] = sp1B8.f[2]; + } + + if ((door->doorType == 4) || (door->doorType == 8)) + { + sp7C.f[0] = pad->look.f[0] * (bb2.xmin - bb2.xmax); + sp7C.f[1] = pad->look.f[1] * (bb2.xmin - bb2.xmax); + sp7C.f[2] = pad->look.f[2] * (bb2.xmin - bb2.xmax); + } + else + { + sp7C.f[0] = pad->up.f[0] * (bb2.ymax - bb2.ymin); + sp7C.f[1] = pad->up.f[1] * (bb2.ymax - bb2.ymin); + sp7C.f[2] = pad->up.f[2] * (bb2.ymax - bb2.ymin); + } + + // These values are stored in the setup files as integers, but at + // runtime they are floats. Hence reading a "float" as an integer, + // converting it to a float and writing it back to the same property. + door->maxFrac = *(s32 *) &door->maxFrac / 65536.0f; + door->perimFrac = *(s32 *) &door->perimFrac / 65536.0f; +#if defined(VERSION_EU) + door->accel = (*(s32 *) &door->accel) * 1.2f / 65536.0f; + door->decel = (*(s32 *) &door->decel) * 1.2f / 65536.0f; + door->maxSpeed = (*(s32 *) &door->maxSpeed) * 1.2f / 65536.0f; #else -#ifndef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_8004EF64 -.word 0x358637bd -.text -glabel setupDoor -/* 037FB0 7F003480 27BDFE28 */ addiu $sp, $sp, -0x1d8 -/* 037FB4 7F003484 AFBF0034 */ sw $ra, 0x34($sp) -/* 037FB8 7F003488 AFB10030 */ sw $s1, 0x30($sp) -/* 037FBC 7F00348C AFB0002C */ sw $s0, 0x2c($sp) -/* 037FC0 7F003490 AFA401D8 */ sw $a0, 0x1d8($sp) -/* 037FC4 7F003494 AFA601E0 */ sw $a2, 0x1e0($sp) -/* 037FC8 7F003498 84A40004 */ lh $a0, 4($a1) -/* 037FCC 7F00349C 240DFFFF */ li $t5, -1 -/* 037FD0 7F0034A0 240EFFFF */ li $t6, -1 -/* 037FD4 7F0034A4 2418FFFF */ li $t8, -1 -/* 037FD8 7F0034A8 00A08825 */ move $s1, $a1 -/* 037FDC 7F0034AC AFAD01B4 */ sw $t5, 0x1b4($sp) -/* 037FE0 7F0034B0 AFAE01B0 */ sw $t6, 0x1b0($sp) -/* 037FE4 7F0034B4 AFB801AC */ sw $t8, 0x1ac($sp) -/* 037FE8 7F0034B8 0FC15B0E */ jal modelLoad -/* 037FEC 7F0034BC AFA401D0 */ sw $a0, 0x1d0($sp) -/* 037FF0 7F0034C0 86390006 */ lh $t9, 6($s1) -/* 037FF4 7F0034C4 8E230008 */ lw $v1, 8($s1) -/* 037FF8 7F0034C8 3C088007 */ lui $t0, %hi(g_CurrentSetup+0x1C) -/* 037FFC 7F0034CC 00197900 */ sll $t7, $t9, 4 -/* 038000 7F0034D0 8D085D1C */ lw $t0, %lo(g_CurrentSetup+0x1C)($t0) -/* 038004 7F0034D4 01F97821 */ addu $t7, $t7, $t9 -/* 038008 7F0034D8 000F7880 */ sll $t7, $t7, 2 -/* 03800C 7F0034DC 000348C0 */ sll $t1, $v1, 3 -/* 038010 7F0034E0 05200003 */ bltz $t1, .L7F0034F0 -/* 038014 7F0034E4 01E88021 */ addu $s0, $t7, $t0 -/* 038018 7F0034E8 00035040 */ sll $t2, $v1, 1 -/* 03801C 7F0034EC 05410013 */ bgez $t2, .L7F00353C -.L7F0034F0: -/* 038020 7F0034F0 27AB0194 */ addiu $t3, $sp, 0x194 -/* 038024 7F0034F4 AFAB0010 */ sw $t3, 0x10($sp) -/* 038028 7F0034F8 02002025 */ move $a0, $s0 -/* 03802C 7F0034FC 27A501B0 */ addiu $a1, $sp, 0x1b0 -/* 038030 7F003500 27A601AC */ addiu $a2, $sp, 0x1ac -/* 038034 7F003504 0FC00C93 */ jal sub_GAME_7F00324C -/* 038038 7F003508 27A701A0 */ addiu $a3, $sp, 0x1a0 -/* 03803C 7F00350C 8E2C0008 */ lw $t4, 8($s1) -/* 038040 7F003510 8FA401B0 */ lw $a0, 0x1b0($sp) -/* 038044 7F003514 000C68C0 */ sll $t5, $t4, 3 -/* 038048 7F003518 05A10008 */ bgez $t5, .L7F00353C -/* 03804C 7F00351C 00000000 */ nop -/* 038050 7F003520 04800006 */ bltz $a0, .L7F00353C -/* 038054 7F003524 8FA501AC */ lw $a1, 0x1ac($sp) -/* 038058 7F003528 04A00004 */ bltz $a1, .L7F00353C -/* 03805C 7F00352C 27A601A0 */ addiu $a2, $sp, 0x1a0 -/* 038060 7F003530 0FC2E732 */ jal sub_GAME_7F0B9CC8 -/* 038064 7F003534 27A70194 */ addiu $a3, $sp, 0x194 -/* 038068 7F003538 AFA201B4 */ sw $v0, 0x1b4($sp) -.L7F00353C: -/* 03806C 7F00353C 3C038003 */ lui $v1, %hi(scale_1_0_item_related) -/* 038070 7F003540 2463A3C0 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, -0x5c40 -/* 038074 7F003544 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 038078 7F003548 44814000 */ mtc1 $at, $f8 -/* 03807C 7F00354C C46C0000 */ lwc1 $f12, ($v1) -/* 038080 7F003550 8FAE01B4 */ lw $t6, 0x1b4($sp) -/* 038084 7F003554 460C4032 */ c.eq.s $f8, $f12 -/* 038088 7F003558 00000000 */ nop -/* 03808C 7F00355C 45030067 */ bc1tl .L7F0036FC -/* 038090 7F003560 8E050028 */ lw $a1, 0x28($s0) -/* 038094 7F003564 05C0005D */ bltz $t6, .L7F0036DC -/* 038098 7F003568 01C02025 */ move $a0, $t6 -/* 03809C 7F00356C 0FC2E5B3 */ jal sub_GAME_7F0B96CC -/* 0380A0 7F003570 27A50180 */ addiu $a1, $sp, 0x180 -/* 0380A4 7F003574 0FC2D20C */ jal get_room_data_float2 -/* 0380A8 7F003578 00000000 */ nop -/* 0380AC 7F00357C C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 0380B0 7F003580 C7B20188 */ lwc1 $f18, 0x188($sp) -/* 0380B4 7F003584 3C038003 */ lui $v1, %hi(scale_1_0_item_related) -/* 0380B8 7F003588 46005182 */ mul.s $f6, $f10, $f0 -/* 0380BC 7F00358C 2463A3C0 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, -0x5c40 -/* 0380C0 7F003590 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0380C4 7F003594 44818000 */ mtc1 $at, $f16 -/* 0380C8 7F003598 C46C0000 */ lwc1 $f12, ($v1) -/* 0380CC 7F00359C 27A4016C */ addiu $a0, $sp, 0x16c -/* 0380D0 7F0035A0 E7A6018C */ swc1 $f6, 0x18c($sp) -/* 0380D4 7F0035A4 C6040008 */ lwc1 $f4, 8($s0) -/* 0380D8 7F0035A8 C60A0004 */ lwc1 $f10, 4($s0) -/* 0380DC 7F0035AC C60E0000 */ lwc1 $f14, ($s0) -/* 0380E0 7F0035B0 46049202 */ mul.s $f8, $f18, $f4 -/* 0380E4 7F0035B4 C7A40184 */ lwc1 $f4, 0x184($sp) -/* 0380E8 7F0035B8 E7A60038 */ swc1 $f6, 0x38($sp) -/* 0380EC 7F0035BC C7A60180 */ lwc1 $f6, 0x180($sp) -/* 0380F0 7F0035C0 46045282 */ mul.s $f10, $f10, $f4 -/* 0380F4 7F0035C4 E7B2003C */ swc1 $f18, 0x3c($sp) -/* 0380F8 7F0035C8 4610603C */ c.lt.s $f12, $f16 -/* 0380FC 7F0035CC 46067482 */ mul.s $f18, $f14, $f6 -/* 038100 7F0035D0 460A9480 */ add.s $f18, $f18, $f10 -/* 038104 7F0035D4 C7AA018C */ lwc1 $f10, 0x18c($sp) -/* 038108 7F0035D8 45000013 */ bc1f .L7F003628 -/* 03810C 7F0035DC 46124080 */ add.s $f2, $f8, $f18 -/* 038110 7F0035E0 C7AA0038 */ lwc1 $f10, 0x38($sp) -/* 038114 7F0035E4 460C8481 */ sub.s $f18, $f16, $f12 -/* 038118 7F0035E8 460A1201 */ sub.s $f8, $f2, $f10 -/* 03811C 7F0035EC 46124082 */ mul.s $f2, $f8, $f18 -/* 038120 7F0035F0 00000000 */ nop -/* 038124 7F0035F4 46023282 */ mul.s $f10, $f6, $f2 -/* 038128 7F0035F8 460A7201 */ sub.s $f8, $f14, $f10 -/* 03812C 7F0035FC 46022182 */ mul.s $f6, $f4, $f2 -/* 038130 7F003600 C7A4003C */ lwc1 $f4, 0x3c($sp) -/* 038134 7F003604 E7A80170 */ swc1 $f8, 0x170($sp) -/* 038138 7F003608 C6120004 */ lwc1 $f18, 4($s0) -/* 03813C 7F00360C 46069281 */ sub.s $f10, $f18, $f6 -/* 038140 7F003610 46022482 */ mul.s $f18, $f4, $f2 -/* 038144 7F003614 E7AA0174 */ swc1 $f10, 0x174($sp) -/* 038148 7F003618 C6080008 */ lwc1 $f8, 8($s0) -/* 03814C 7F00361C 46124181 */ sub.s $f6, $f8, $f18 -/* 038150 7F003620 10000012 */ b .L7F00366C -/* 038154 7F003624 E7A60178 */ swc1 $f6, 0x178($sp) -.L7F003628: -/* 038158 7F003628 460A1101 */ sub.s $f4, $f2, $f10 -/* 03815C 7F00362C C7B20180 */ lwc1 $f18, 0x180($sp) -/* 038160 7F003630 46106201 */ sub.s $f8, $f12, $f16 -/* 038164 7F003634 46082082 */ mul.s $f2, $f4, $f8 -/* 038168 7F003638 C7A40184 */ lwc1 $f4, 0x184($sp) -/* 03816C 7F00363C 46029182 */ mul.s $f6, $f18, $f2 -/* 038170 7F003640 460E3280 */ add.s $f10, $f6, $f14 -/* 038174 7F003644 46022202 */ mul.s $f8, $f4, $f2 -/* 038178 7F003648 E7AA0170 */ swc1 $f10, 0x170($sp) -/* 03817C 7F00364C C6120004 */ lwc1 $f18, 4($s0) -/* 038180 7F003650 C7AA0188 */ lwc1 $f10, 0x188($sp) -/* 038184 7F003654 46124180 */ add.s $f6, $f8, $f18 -/* 038188 7F003658 46025102 */ mul.s $f4, $f10, $f2 -/* 03818C 7F00365C E7A60174 */ swc1 $f6, 0x174($sp) -/* 038190 7F003660 C6080008 */ lwc1 $f8, 8($s0) -/* 038194 7F003664 46082480 */ add.s $f18, $f4, $f8 -/* 038198 7F003668 E7B20178 */ swc1 $f18, 0x178($sp) -.L7F00366C: -/* 03819C 7F00366C 8E180028 */ lw $t8, 0x28($s0) -/* 0381A0 7F003670 C7A60178 */ lwc1 $f6, 0x178($sp) -/* 0381A4 7F003674 8FA70170 */ lw $a3, 0x170($sp) -/* 0381A8 7F003678 AFB8016C */ sw $t8, 0x16c($sp) -/* 0381AC 7F00367C 8E060008 */ lw $a2, 8($s0) -/* 0381B0 7F003680 8E050000 */ lw $a1, ($s0) -/* 0381B4 7F003684 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 0381B8 7F003688 E7A60010 */ swc1 $f6, 0x10($sp) -/* 0381BC 7F00368C 3C038003 */ lui $v1, %hi(scale_1_0_item_related) -/* 0381C0 7F003690 10400019 */ beqz $v0, .L7F0036F8 -/* 0381C4 7F003694 2463A3C0 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, -0x5c40 -/* 0381C8 7F003698 8FB9016C */ lw $t9, 0x16c($sp) -/* 0381CC 7F00369C C612002C */ lwc1 $f18, 0x2c($s0) -/* 0381D0 7F0036A0 AE190028 */ sw $t9, 0x28($s0) -/* 0381D4 7F0036A4 C7AA0170 */ lwc1 $f10, 0x170($sp) -/* 0381D8 7F0036A8 E60A0000 */ swc1 $f10, ($s0) -/* 0381DC 7F0036AC C7A40174 */ lwc1 $f4, 0x174($sp) -/* 0381E0 7F0036B0 E6040004 */ swc1 $f4, 4($s0) -/* 0381E4 7F0036B4 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0381E8 7F0036B8 C6040030 */ lwc1 $f4, 0x30($s0) -/* 0381EC 7F0036BC E6080008 */ swc1 $f8, 8($s0) -/* 0381F0 7F0036C0 C4660000 */ lwc1 $f6, ($v1) -/* 0381F4 7F0036C4 46069282 */ mul.s $f10, $f18, $f6 -/* 0381F8 7F0036C8 E60A002C */ swc1 $f10, 0x2c($s0) -/* 0381FC 7F0036CC C4680000 */ lwc1 $f8, ($v1) -/* 038200 7F0036D0 46082482 */ mul.s $f18, $f4, $f8 -/* 038204 7F0036D4 10000008 */ b .L7F0036F8 -/* 038208 7F0036D8 E6120030 */ swc1 $f18, 0x30($s0) -.L7F0036DC: -/* 03820C 7F0036DC C606002C */ lwc1 $f6, 0x2c($s0) -/* 038210 7F0036E0 C6040030 */ lwc1 $f4, 0x30($s0) -/* 038214 7F0036E4 460C3282 */ mul.s $f10, $f6, $f12 -/* 038218 7F0036E8 E60A002C */ swc1 $f10, 0x2c($s0) -/* 03821C 7F0036EC C4680000 */ lwc1 $f8, ($v1) -/* 038220 7F0036F0 46082482 */ mul.s $f18, $f4, $f8 -/* 038224 7F0036F4 E6120030 */ swc1 $f18, 0x30($s0) -.L7F0036F8: -/* 038228 7F0036F8 8E050028 */ lw $a1, 0x28($s0) -.L7F0036FC: -/* 03822C 7F0036FC 27AF01C8 */ addiu $t7, $sp, 0x1c8 -/* 038230 7F003700 AFAF0010 */ sw $t7, 0x10($sp) -/* 038234 7F003704 02002025 */ move $a0, $s0 -/* 038238 7F003708 24060000 */ li $a2, 0 -/* 03823C 7F00370C 0FC15A14 */ jal sub_GAME_7F056850 -/* 038240 7F003710 27A701B8 */ addiu $a3, $sp, 0x1b8 -/* 038244 7F003714 50400131 */ beql $v0, $zero, .L7F003BDC -/* 038248 7F003718 AE200010 */ sw $zero, 0x10($s1) -/* 03824C 7F00371C C6060018 */ lwc1 $f6, 0x18($s0) -/* 038250 7F003720 44800000 */ mtc1 $zero, $f0 -/* 038254 7F003724 27A4012C */ addiu $a0, $sp, 0x12c -/* 038258 7F003728 46003287 */ neg.s $f10, $f6 -/* 03825C 7F00372C 44050000 */ mfc1 $a1, $f0 -/* 038260 7F003730 E7AA0010 */ swc1 $f10, 0x10($sp) -/* 038264 7F003734 C604001C */ lwc1 $f4, 0x1c($s0) -/* 038268 7F003738 44060000 */ mfc1 $a2, $f0 -/* 03826C 7F00373C 44070000 */ mfc1 $a3, $f0 -/* 038270 7F003740 46002207 */ neg.s $f8, $f4 -/* 038274 7F003744 E7A80014 */ swc1 $f8, 0x14($sp) -/* 038278 7F003748 C6120020 */ lwc1 $f18, 0x20($s0) -/* 03827C 7F00374C 46009187 */ neg.s $f6, $f18 -/* 038280 7F003750 E7A60018 */ swc1 $f6, 0x18($sp) -/* 038284 7F003754 C60A000C */ lwc1 $f10, 0xc($s0) -/* 038288 7F003758 E7AA001C */ swc1 $f10, 0x1c($sp) -/* 03828C 7F00375C C6040010 */ lwc1 $f4, 0x10($s0) -/* 038290 7F003760 E7A40020 */ swc1 $f4, 0x20($sp) -/* 038294 7F003764 C6080014 */ lwc1 $f8, 0x14($s0) -/* 038298 7F003768 0FC16642 */ jal matrix_4x4_7F059908 -/* 03829C 7F00376C E7A80024 */ swc1 $f8, 0x24($sp) -/* 0382A0 7F003770 8FA801D0 */ lw $t0, 0x1d0($sp) -/* 0382A4 7F003774 3C0A8004 */ lui $t2, %hi(PitemZ_entries) -/* 0382A8 7F003778 8FAB01C8 */ lw $t3, 0x1c8($sp) -/* 0382AC 7F00377C 00084880 */ sll $t1, $t0, 2 -/* 0382B0 7F003780 01284823 */ subu $t1, $t1, $t0 -/* 0382B4 7F003784 00094880 */ sll $t1, $t1, 2 -/* 0382B8 7F003788 01495021 */ addu $t2, $t2, $t1 -/* 0382BC 7F00378C 8D4AA228 */ lw $t2, %lo(PitemZ_entries)($t2) -/* 0382C0 7F003790 AFAB0114 */ sw $t3, 0x114($sp) -/* 0382C4 7F003794 3C018005 */ lui $at, %hi(D_8004EF5C) -/* 0382C8 7F003798 AFAA0124 */ sw $t2, 0x124($sp) -/* 0382CC 7F00379C C612002C */ lwc1 $f18, 0x2c($s0) -/* 0382D0 7F0037A0 C42CEF5C */ lwc1 $f12, %lo(D_8004EF5C)($at) -/* 0382D4 7F0037A4 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 0382D8 7F0037A8 E7B20078 */ swc1 $f18, 0x78($sp) -/* 0382DC 7F0037AC C6060030 */ lwc1 $f6, 0x30($s0) -/* 0382E0 7F0037B0 E7A60074 */ swc1 $f6, 0x74($sp) -/* 0382E4 7F0037B4 C60A0034 */ lwc1 $f10, 0x34($s0) -/* 0382E8 7F0037B8 E7AA0070 */ swc1 $f10, 0x70($sp) -/* 0382EC 7F0037BC C6040038 */ lwc1 $f4, 0x38($s0) -/* 0382F0 7F0037C0 E7A4006C */ swc1 $f4, 0x6c($sp) -/* 0382F4 7F0037C4 C608003C */ lwc1 $f8, 0x3c($s0) -/* 0382F8 7F0037C8 E7A80068 */ swc1 $f8, 0x68($sp) -/* 0382FC 7F0037CC C6120040 */ lwc1 $f18, 0x40($s0) -/* 038300 7F0037D0 0FC1615C */ jal matrix_4x4_set_rotation_around_x -/* 038304 7F0037D4 E7B20064 */ swc1 $f18, 0x64($sp) -/* 038308 7F0037D8 3C018005 */ lui $at, %hi(D_8004EF60) -/* 03830C 7F0037DC C42CEF60 */ lwc1 $f12, %lo(D_8004EF60)($at) -/* 038310 7F0037E0 0FC161A2 */ jal matrix_4x4_set_rotation_around_z -/* 038314 7F0037E4 27A50088 */ addiu $a1, $sp, 0x88 -/* 038318 7F0037E8 27A40088 */ addiu $a0, $sp, 0x88 -/* 03831C 7F0037EC 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 038320 7F0037F0 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 038324 7F0037F4 27A4012C */ addiu $a0, $sp, 0x12c -/* 038328 7F0037F8 0FC1601A */ jal matrix_4x4_multiply_in_place -/* 03832C 7F0037FC 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 038330 7F003800 02002025 */ move $a0, $s0 -/* 038334 7F003804 0FC006F5 */ jal sub_GAME_7F001BD4 -/* 038338 7F003808 27A50118 */ addiu $a1, $sp, 0x118 -/* 03833C 7F00380C 8FAC0124 */ lw $t4, 0x124($sp) -/* 038340 7F003810 C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 038344 7F003814 C7AA0070 */ lwc1 $f10, 0x70($sp) -/* 038348 7F003818 8D8D0000 */ lw $t5, ($t4) -/* 03834C 7F00381C 3C018005 */ lui $at, %hi(D_8004EF64) -/* 038350 7F003820 460A3101 */ sub.s $f4, $f6, $f10 -/* 038354 7F003824 8DAE0014 */ lw $t6, 0x14($t5) -/* 038358 7F003828 C7AA0064 */ lwc1 $f10, 0x64($sp) -/* 03835C 7F00382C C420EF64 */ lwc1 $f0, %lo(D_8004EF64)($at) -/* 038360 7F003830 8DC20004 */ lw $v0, 4($t6) -/* 038364 7F003834 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 038368 7F003838 C4480008 */ lwc1 $f8, 8($v0) -/* 03836C 7F00383C C4520004 */ lwc1 $f18, 4($v0) -/* 038370 7F003840 46124181 */ sub.s $f6, $f8, $f18 -/* 038374 7F003844 C7A80068 */ lwc1 $f8, 0x68($sp) -/* 038378 7F003848 C4520010 */ lwc1 $f18, 0x10($v0) -/* 03837C 7F00384C 46062303 */ div.s $f12, $f4, $f6 -/* 038380 7F003850 C444000C */ lwc1 $f4, 0xc($v0) -/* 038384 7F003854 46085081 */ sub.s $f2, $f10, $f8 -/* 038388 7F003858 C7A80078 */ lwc1 $f8, 0x78($sp) -/* 03838C 7F00385C C7AA0074 */ lwc1 $f10, 0x74($sp) -/* 038390 7F003860 46049181 */ sub.s $f6, $f18, $f4 -/* 038394 7F003864 C4440018 */ lwc1 $f4, 0x18($v0) -/* 038398 7F003868 46061383 */ div.s $f14, $f2, $f6 -/* 03839C 7F00386C C4460014 */ lwc1 $f6, 0x14($v0) -/* 0383A0 7F003870 4600603E */ c.le.s $f12, $f0 -/* 0383A4 7F003874 46085481 */ sub.s $f18, $f10, $f8 -/* 0383A8 7F003878 46062281 */ sub.s $f10, $f4, $f6 -/* 0383AC 7F00387C 45010008 */ bc1t .L7F0038A0 -/* 0383B0 7F003880 460A9403 */ div.s $f16, $f18, $f10 -/* 0383B4 7F003884 4600703E */ c.le.s $f14, $f0 -/* 0383B8 7F003888 00000000 */ nop -/* 0383BC 7F00388C 45030005 */ bc1tl .L7F0038A4 -/* 0383C0 7F003890 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0383C4 7F003894 4600803E */ c.le.s $f16, $f0 -/* 0383C8 7F003898 00000000 */ nop -/* 0383CC 7F00389C 45000005 */ bc1f .L7F0038B4 -.L7F0038A0: -/* 0383D0 7F0038A0 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F0038A4: -/* 0383D4 7F0038A4 44818000 */ mtc1 $at, $f16 -/* 0383D8 7F0038A8 44817000 */ mtc1 $at, $f14 -/* 0383DC 7F0038AC 44816000 */ mtc1 $at, $f12 -/* 0383E0 7F0038B0 00000000 */ nop -.L7F0038B4: -/* 0383E4 7F0038B4 E7A20048 */ swc1 $f2, 0x48($sp) -/* 0383E8 7F0038B8 E7AC0060 */ swc1 $f12, 0x60($sp) -/* 0383EC 7F0038BC E7AE005C */ swc1 $f14, 0x5c($sp) -/* 0383F0 7F0038C0 0FC1626D */ jal matrix_column_1_scalar_multiply -/* 0383F4 7F0038C4 E7B00058 */ swc1 $f16, 0x58($sp) -/* 0383F8 7F0038C8 C7AC005C */ lwc1 $f12, 0x5c($sp) -/* 0383FC 7F0038CC 0FC16279 */ jal matrix_column_2_scalar_multiply -/* 038400 7F0038D0 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 038404 7F0038D4 C7AC0058 */ lwc1 $f12, 0x58($sp) -/* 038408 7F0038D8 0FC16293 */ jal matrix_column_3_scalar_multiply_2 -/* 03840C 7F0038DC 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 038410 7F0038E0 C7A80118 */ lwc1 $f8, 0x118($sp) -/* 038414 7F0038E4 C7A4011C */ lwc1 $f4, 0x11c($sp) -/* 038418 7F0038E8 C7A60120 */ lwc1 $f6, 0x120($sp) -/* 03841C 7F0038EC E7A800C8 */ swc1 $f8, 0xc8($sp) -/* 038420 7F0038F0 E7A400CC */ swc1 $f4, 0xcc($sp) -/* 038424 7F0038F4 E7A600D0 */ swc1 $f6, 0xd0($sp) -/* 038428 7F0038F8 8E38000C */ lw $t8, 0xc($s1) -/* 03842C 7F0038FC C7A20048 */ lwc1 $f2, 0x48($sp) -/* 038430 7F003900 27A40114 */ addiu $a0, $sp, 0x114 -/* 038434 7F003904 33190001 */ andi $t9, $t8, 1 -/* 038438 7F003908 17200016 */ bnez $t9, .L7F003964 -/* 03843C 7F00390C C7A401B8 */ lwc1 $f4, 0x1b8($sp) -/* 038440 7F003910 44074000 */ mfc1 $a3, $f8 -/* 038444 7F003914 8FA501B8 */ lw $a1, 0x1b8($sp) -/* 038448 7F003918 8FA601C0 */ lw $a2, 0x1c0($sp) -/* 03844C 7F00391C E7A60010 */ swc1 $f6, 0x10($sp) -/* 038450 7F003920 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 038454 7F003924 E7A20048 */ swc1 $f2, 0x48($sp) -/* 038458 7F003928 10400004 */ beqz $v0, .L7F00393C -/* 03845C 7F00392C C7A20048 */ lwc1 $f2, 0x48($sp) -/* 038460 7F003930 8FAF0114 */ lw $t7, 0x114($sp) -/* 038464 7F003934 10000010 */ b .L7F003978 -/* 038468 7F003938 AFAF01C8 */ sw $t7, 0x1c8($sp) -.L7F00393C: -/* 03846C 7F00393C C7B201B8 */ lwc1 $f18, 0x1b8($sp) -/* 038470 7F003940 C7AA01C0 */ lwc1 $f10, 0x1c0($sp) -/* 038474 7F003944 E7B20118 */ swc1 $f18, 0x118($sp) -/* 038478 7F003948 E7AA0120 */ swc1 $f10, 0x120($sp) -/* 03847C 7F00394C 8E280008 */ lw $t0, 8($s1) -/* 038480 7F003950 31091000 */ andi $t1, $t0, 0x1000 -/* 038484 7F003954 55200009 */ bnezl $t1, .L7F00397C -/* 038488 7F003958 9622009A */ lhu $v0, 0x9a($s1) -/* 03848C 7F00395C 10000007 */ b .L7F00397C -/* 038490 7F003960 9622009A */ lhu $v0, 0x9a($s1) -.L7F003964: -/* 038494 7F003964 C7A801BC */ lwc1 $f8, 0x1bc($sp) -/* 038498 7F003968 C7A601C0 */ lwc1 $f6, 0x1c0($sp) -/* 03849C 7F00396C E7A40118 */ swc1 $f4, 0x118($sp) -/* 0384A0 7F003970 E7A8011C */ swc1 $f8, 0x11c($sp) -/* 0384A4 7F003974 E7A60120 */ swc1 $f6, 0x120($sp) -.L7F003978: -/* 0384A8 7F003978 9622009A */ lhu $v0, 0x9a($s1) -.L7F00397C: -/* 0384AC 7F00397C 24010004 */ li $at, 4 -/* 0384B0 7F003980 10410003 */ beq $v0, $at, .L7F003990 -/* 0384B4 7F003984 24010008 */ li $at, 8 -/* 0384B8 7F003988 1441000B */ bne $v0, $at, .L7F0039B8 -/* 0384BC 7F00398C C7AA0070 */ lwc1 $f10, 0x70($sp) -.L7F003990: -/* 0384C0 7F003990 C6120018 */ lwc1 $f18, 0x18($s0) -/* 0384C4 7F003994 46029282 */ mul.s $f10, $f18, $f2 -/* 0384C8 7F003998 E7AA007C */ swc1 $f10, 0x7c($sp) -/* 0384CC 7F00399C C604001C */ lwc1 $f4, 0x1c($s0) -/* 0384D0 7F0039A0 46022202 */ mul.s $f8, $f4, $f2 -/* 0384D4 7F0039A4 E7A80080 */ swc1 $f8, 0x80($sp) -/* 0384D8 7F0039A8 C6060020 */ lwc1 $f6, 0x20($s0) -/* 0384DC 7F0039AC 46023482 */ mul.s $f18, $f6, $f2 -/* 0384E0 7F0039B0 1000000C */ b .L7F0039E4 -/* 0384E4 7F0039B4 E7B20084 */ swc1 $f18, 0x84($sp) -.L7F0039B8: -/* 0384E8 7F0039B8 C7A4006C */ lwc1 $f4, 0x6c($sp) -/* 0384EC 7F0039BC C608000C */ lwc1 $f8, 0xc($s0) -/* 0384F0 7F0039C0 46045001 */ sub.s $f0, $f10, $f4 -/* 0384F4 7F0039C4 46004182 */ mul.s $f6, $f8, $f0 -/* 0384F8 7F0039C8 E7A6007C */ swc1 $f6, 0x7c($sp) -/* 0384FC 7F0039CC C6120010 */ lwc1 $f18, 0x10($s0) -/* 038500 7F0039D0 46009282 */ mul.s $f10, $f18, $f0 -/* 038504 7F0039D4 E7AA0080 */ swc1 $f10, 0x80($sp) -/* 038508 7F0039D8 C6040014 */ lwc1 $f4, 0x14($s0) -/* 03850C 7F0039DC 46002202 */ mul.s $f8, $f4, $f0 -/* 038510 7F0039E0 E7A80084 */ swc1 $f8, 0x84($sp) -.L7F0039E4: -/* 038514 7F0039E4 8E2A0084 */ lw $t2, 0x84($s1) -/* 038518 7F0039E8 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 03851C 7F0039EC 44810000 */ mtc1 $at, $f0 -/* 038520 7F0039F0 448A3000 */ mtc1 $t2, $f6 -/* 038524 7F0039F4 8E2B0088 */ lw $t3, 0x88($s1) -/* 038528 7F0039F8 8E2C008C */ lw $t4, 0x8c($s1) -/* 03852C 7F0039FC 468034A0 */ cvt.s.w $f18, $f6 -/* 038530 7F003A00 448B2000 */ mtc1 $t3, $f4 -/* 038534 7F003A04 8E2D0090 */ lw $t5, 0x90($s1) -/* 038538 7F003A08 8E2E0094 */ lw $t6, 0x94($s1) -/* 03853C 7F003A0C 27B8007C */ addiu $t8, $sp, 0x7c -/* 038540 7F003A10 46802220 */ cvt.s.w $f8, $f4 -/* 038544 7F003A14 27B900C8 */ addiu $t9, $sp, 0xc8 -/* 038548 7F003A18 02202025 */ move $a0, $s1 -/* 03854C 7F003A1C 27A50118 */ addiu $a1, $sp, 0x118 -/* 038550 7F003A20 27A600D4 */ addiu $a2, $sp, 0xd4 -/* 038554 7F003A24 46009283 */ div.s $f10, $f18, $f0 -/* 038558 7F003A28 448C9000 */ mtc1 $t4, $f18 -/* 03855C 7F003A2C 46004183 */ div.s $f6, $f8, $f0 -/* 038560 7F003A30 E62A0084 */ swc1 $f10, 0x84($s1) -/* 038564 7F003A34 448D4000 */ mtc1 $t5, $f8 -/* 038568 7F003A38 468092A0 */ cvt.s.w $f10, $f18 -/* 03856C 7F003A3C 46005103 */ div.s $f4, $f10, $f0 -/* 038570 7F003A40 448E5000 */ mtc1 $t6, $f10 -/* 038574 7F003A44 E6260088 */ swc1 $f6, 0x88($s1) -/* 038578 7F003A48 468041A0 */ cvt.s.w $f6, $f8 -/* 03857C 7F003A4C 46003483 */ div.s $f18, $f6, $f0 -/* 038580 7F003A50 E624008C */ swc1 $f4, 0x8c($s1) -/* 038584 7F003A54 46805120 */ cvt.s.w $f4, $f10 -/* 038588 7F003A58 46002203 */ div.s $f8, $f4, $f0 -/* 03858C 7F003A5C E6320090 */ swc1 $f18, 0x90($s1) -/* 038590 7F003A60 E6280094 */ swc1 $f8, 0x94($s1) -/* 038594 7F003A64 AFB90014 */ sw $t9, 0x14($sp) -/* 038598 7F003A68 AFB80010 */ sw $t8, 0x10($sp) -/* 03859C 7F003A6C 0FC14D7C */ jal initialize_door -/* 0385A0 7F003A70 8FA701C8 */ lw $a3, 0x1c8($sp) -/* 0385A4 7F003A74 8E2F0008 */ lw $t7, 8($s1) -/* 0385A8 7F003A78 00408025 */ move $s0, $v0 -/* 0385AC 7F003A7C 8FA901B4 */ lw $t1, 0x1b4($sp) -/* 0385B0 7F003A80 000F40C0 */ sll $t0, $t7, 3 -/* 0385B4 7F003A84 0503000E */ bgezl $t0, .L7F003AC0 -/* 0385B8 7F003A88 8E020014 */ lw $v0, 0x14($s0) -/* 0385BC 7F003A8C AE2900F0 */ sw $t1, 0xf0($s1) -/* 0385C0 7F003A90 8FAA01B4 */ lw $t2, 0x1b4($sp) -/* 0385C4 7F003A94 0542000A */ bltzl $t2, .L7F003AC0 -/* 0385C8 7F003A98 8E020014 */ lw $v0, 0x14($s0) -/* 0385CC 7F003A9C 44803000 */ mtc1 $zero, $f6 -/* 0385D0 7F003AA0 C63200B4 */ lwc1 $f18, 0xb4($s1) -/* 0385D4 7F003AA4 46123032 */ c.eq.s $f6, $f18 -/* 0385D8 7F003AA8 00000000 */ nop -/* 0385DC 7F003AAC 45020004 */ bc1fl .L7F003AC0 -/* 0385E0 7F003AB0 8E020014 */ lw $v0, 0x14($s0) -/* 0385E4 7F003AB4 0FC14D71 */ jal doorDeactivatePortal -/* 0385E8 7F003AB8 02202025 */ move $a0, $s1 -/* 0385EC 7F003ABC 8E020014 */ lw $v0, 0x14($s0) -.L7F003AC0: -/* 0385F0 7F003AC0 02002025 */ move $a0, $s0 -/* 0385F4 7F003AC4 904B0003 */ lbu $t3, 3($v0) -/* 0385F8 7F003AC8 A20B002C */ sb $t3, 0x2c($s0) -/* 0385FC 7F003ACC 0FC0F767 */ jal chrpropRegisterRoom -/* 038600 7F003AD0 90450003 */ lbu $a1, 3($v0) -/* 038604 7F003AD4 240200FF */ li $v0, 255 -/* 038608 7F003AD8 A202002D */ sb $v0, 0x2d($s0) -/* 03860C 7F003ADC A202002E */ sb $v0, 0x2e($s0) -/* 038610 7F003AE0 8E230008 */ lw $v1, 8($s1) -/* 038614 7F003AE4 000360C0 */ sll $t4, $v1, 3 -/* 038618 7F003AE8 05800003 */ bltz $t4, .L7F003AF8 -/* 03861C 7F003AEC 00036840 */ sll $t5, $v1, 1 -/* 038620 7F003AF0 05A3001A */ bgezl $t5, .L7F003B5C -/* 038624 7F003AF4 8E240014 */ lw $a0, 0x14($s1) -.L7F003AF8: -/* 038628 7F003AF8 8E180014 */ lw $t8, 0x14($s0) -/* 03862C 7F003AFC 8FAE01B0 */ lw $t6, 0x1b0($sp) -/* 038630 7F003B00 8FA501AC */ lw $a1, 0x1ac($sp) -/* 038634 7F003B04 93190003 */ lbu $t9, 3($t8) -/* 038638 7F003B08 11D90009 */ beq $t6, $t9, .L7F003B30 -/* 03863C 7F003B0C 00000000 */ nop -/* 038640 7F003B10 05C0000D */ bltz $t6, .L7F003B48 -/* 038644 7F003B14 8FAF01B0 */ lw $t7, 0x1b0($sp) -/* 038648 7F003B18 A20F002D */ sb $t7, 0x2d($s0) -/* 03864C 7F003B1C 87A501B2 */ lh $a1, 0x1b2($sp) -/* 038650 7F003B20 0FC0F767 */ jal chrpropRegisterRoom -/* 038654 7F003B24 02002025 */ move $a0, $s0 -/* 038658 7F003B28 10000008 */ b .L7F003B4C -/* 03865C 7F003B2C 9209002D */ lbu $t1, 0x2d($s0) -.L7F003B30: -/* 038660 7F003B30 04A00005 */ bltz $a1, .L7F003B48 -/* 038664 7F003B34 8FA801AC */ lw $t0, 0x1ac($sp) -/* 038668 7F003B38 A208002D */ sb $t0, 0x2d($s0) -/* 03866C 7F003B3C 87A501AE */ lh $a1, 0x1ae($sp) -/* 038670 7F003B40 0FC0F767 */ jal chrpropRegisterRoom -/* 038674 7F003B44 02002025 */ move $a0, $s0 -.L7F003B48: -/* 038678 7F003B48 9209002D */ lbu $t1, 0x2d($s0) -.L7F003B4C: -/* 03867C 7F003B4C 240100FF */ li $at, 255 -/* 038680 7F003B50 51210002 */ beql $t1, $at, .L7F003B5C -/* 038684 7F003B54 8E240014 */ lw $a0, 0x14($s1) -/* 038688 7F003B58 8E240014 */ lw $a0, 0x14($s1) -.L7F003B5C: -/* 03868C 7F003B5C C7A00060 */ lwc1 $f0, 0x60($sp) -/* 038690 7F003B60 C7AC005C */ lwc1 $f12, 0x5c($sp) -/* 038694 7F003B64 10800010 */ beqz $a0, .L7F003BA8 -/* 038698 7F003B68 C7AA0058 */ lwc1 $f10, 0x58($sp) -/* 03869C 7F003B6C 460C003C */ c.lt.s $f0, $f12 -/* 0386A0 7F003B70 00000000 */ nop -/* 0386A4 7F003B74 45020003 */ bc1fl .L7F003B84 -/* 0386A8 7F003B78 460A003C */ c.lt.s $f0, $f10 -/* 0386AC 7F003B7C 46006006 */ mov.s $f0, $f12 -/* 0386B0 7F003B80 460A003C */ c.lt.s $f0, $f10 -.L7F003B84: -/* 0386B4 7F003B84 00000000 */ nop -/* 0386B8 7F003B88 45020003 */ bc1fl .L7F003B98 -/* 0386BC 7F003B8C C4840014 */ lwc1 $f4, 0x14($a0) -/* 0386C0 7F003B90 46005006 */ mov.s $f0, $f10 -/* 0386C4 7F003B94 C4840014 */ lwc1 $f4, 0x14($a0) -.L7F003B98: -/* 0386C8 7F003B98 46002202 */ mul.s $f8, $f4, $f0 -/* 0386CC 7F003B9C 44054000 */ mfc1 $a1, $f8 -/* 0386D0 7F003BA0 0FC1B39E */ jal modelSetScale -/* 0386D4 7F003BA4 00000000 */ nop -.L7F003BA8: -/* 0386D8 7F003BA8 0FC0E929 */ jal chrpropActivate -/* 0386DC 7F003BAC 02002025 */ move $a0, $s0 -/* 0386E0 7F003BB0 0FC0E901 */ jal chrpropEnable -/* 0386E4 7F003BB4 02002025 */ move $a0, $s0 -/* 0386E8 7F003BB8 8E220080 */ lw $v0, 0x80($s1) -/* 0386EC 7F003BBC 8FAB01E0 */ lw $t3, 0x1e0($sp) -/* 0386F0 7F003BC0 50400007 */ beql $v0, $zero, .L7F003BE0 -/* 0386F4 7F003BC4 8FBF0034 */ lw $ra, 0x34($sp) -/* 0386F8 7F003BC8 0FC15AA2 */ jal setupGetPtrToCommandByIndex -/* 0386FC 7F003BCC 004B2021 */ addu $a0, $v0, $t3 -/* 038700 7F003BD0 10000002 */ b .L7F003BDC -/* 038704 7F003BD4 AE2200C8 */ sw $v0, 0xc8($s1) -/* 038708 7F003BD8 AE200010 */ sw $zero, 0x10($s1) -.L7F003BDC: -/* 03870C 7F003BDC 8FBF0034 */ lw $ra, 0x34($sp) -.L7F003BE0: -/* 038710 7F003BE0 8FB0002C */ lw $s0, 0x2c($sp) -/* 038714 7F003BE4 8FB10030 */ lw $s1, 0x30($sp) -/* 038718 7F003BE8 03E00008 */ jr $ra -/* 03871C 7F003BEC 27BD01D8 */ addiu $sp, $sp, 0x1d8 -) + door->accel = (*(s32 *) &door->accel) / 65536.0f; + door->decel = (*(s32 *) &door->decel) / 65536.0f; + door->maxSpeed = (*(s32 *) &door->maxSpeed) / 65536.0f; #endif -#ifdef VERSION_EU -GLOBAL_ASM( -.late_rodata -glabel D_8004EF64 -.word 0x358637bd #1.0E-6 -glabel D_800473AC -.word 0x3f99999a #1.2 + + prop = doorInit(door, &sp118, &spD4, sp1C8_stan, &sp7C, &spC8); + if (door->flags & PROPFLAG_CULL_BEHIND_DOOR) + { + door->portalNumber = portalnum; + if ((portalnum >= 0) && (door->openPosition == 0.0f)) + { + doorDeactivatePortal(door); + } + } + + prop->rooms[0] = prop->stan->room; + chrpropRegisterRoom(prop, prop->stan->room); + prop->rooms[1] = 0xFFU; + prop->rooms[2] = 0xFFU; -.text -glabel setupDoor -/* 035DE0 7F0033F0 27BDFE28 */ addiu $sp, $sp, -0x1d8 -/* 035DE4 7F0033F4 AFBF0034 */ sw $ra, 0x34($sp) -/* 035DE8 7F0033F8 AFB10030 */ sw $s1, 0x30($sp) -/* 035DEC 7F0033FC AFB0002C */ sw $s0, 0x2c($sp) -/* 035DF0 7F003400 AFA401D8 */ sw $a0, 0x1d8($sp) -/* 035DF4 7F003404 AFA601E0 */ sw $a2, 0x1e0($sp) -/* 035DF8 7F003408 84A40004 */ lh $a0, 4($a1) -/* 035DFC 7F00340C 240DFFFF */ li $t5, -1 -/* 035E00 7F003410 240EFFFF */ li $t6, -1 -/* 035E04 7F003414 2418FFFF */ li $t8, -1 -/* 035E08 7F003418 00A08825 */ move $s1, $a1 -/* 035E0C 7F00341C AFAD01B4 */ sw $t5, 0x1b4($sp) -/* 035E10 7F003420 AFAE01B0 */ sw $t6, 0x1b0($sp) -/* 035E14 7F003424 AFB801AC */ sw $t8, 0x1ac($sp) -/* 035E18 7F003428 0FC15BC6 */ jal modelLoad -/* 035E1C 7F00342C AFA401D0 */ sw $a0, 0x1d0($sp) -/* 035E20 7F003430 86390006 */ lh $t9, 6($s1) -/* 035E24 7F003434 8E230008 */ lw $v1, 8($s1) -/* 035E28 7F003438 3C088006 */ lui $t0, %hi(g_CurrentSetup+0x1C) # $t0, 0x8006 -/* 035E2C 7F00343C 00197900 */ sll $t7, $t9, 4 -/* 035E30 7F003440 8D084C5C */ lw $t0, %lo(g_CurrentSetup+0x1C)($t0) -/* 035E34 7F003444 01F97821 */ addu $t7, $t7, $t9 -/* 035E38 7F003448 000F7880 */ sll $t7, $t7, 2 -/* 035E3C 7F00344C 000348C0 */ sll $t1, $v1, 3 -/* 035E40 7F003450 05200003 */ bltz $t1, .L7F003460 -/* 035E44 7F003454 01E88021 */ addu $s0, $t7, $t0 -/* 035E48 7F003458 00035040 */ sll $t2, $v1, 1 -/* 035E4C 7F00345C 05410013 */ bgez $t2, .L7F0034AC -.L7F003460: -/* 035E50 7F003460 27AB0194 */ addiu $t3, $sp, 0x194 -/* 035E54 7F003464 AFAB0010 */ sw $t3, 0x10($sp) -/* 035E58 7F003468 02002025 */ move $a0, $s0 -/* 035E5C 7F00346C 27A501B0 */ addiu $a1, $sp, 0x1b0 -/* 035E60 7F003470 27A601AC */ addiu $a2, $sp, 0x1ac -/* 035E64 7F003474 0FC00C6F */ jal sub_GAME_7F00324C -/* 035E68 7F003478 27A701A0 */ addiu $a3, $sp, 0x1a0 -/* 035E6C 7F00347C 8E2C0008 */ lw $t4, 8($s1) -/* 035E70 7F003480 8FA401B0 */ lw $a0, 0x1b0($sp) -/* 035E74 7F003484 000C68C0 */ sll $t5, $t4, 3 -/* 035E78 7F003488 05A10008 */ bgez $t5, .L7F0034AC -/* 035E7C 7F00348C 00000000 */ nop -/* 035E80 7F003490 04800006 */ bltz $a0, .L7F0034AC -/* 035E84 7F003494 8FA501AC */ lw $a1, 0x1ac($sp) -/* 035E88 7F003498 04A00004 */ bltz $a1, .L7F0034AC -/* 035E8C 7F00349C 27A601A0 */ addiu $a2, $sp, 0x1a0 -/* 035E90 7F0034A0 0FC2E3D9 */ jal sub_GAME_7F0B9CC8 -/* 035E94 7F0034A4 27A70194 */ addiu $a3, $sp, 0x194 -/* 035E98 7F0034A8 AFA201B4 */ sw $v0, 0x1b4($sp) -.L7F0034AC: -/* 035E9C 7F0034AC 3C038002 */ lui $v1, %hi(scale_1_0_item_related) # $v1, 0x8002 -/* 035EA0 7F0034B0 24635910 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, 0x5910 -/* 035EA4 7F0034B4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 035EA8 7F0034B8 44819000 */ mtc1 $at, $f18 -/* 035EAC 7F0034BC C46C0000 */ lwc1 $f12, ($v1) -/* 035EB0 7F0034C0 8FAE01B4 */ lw $t6, 0x1b4($sp) -/* 035EB4 7F0034C4 460C9032 */ c.eq.s $f18, $f12 -/* 035EB8 7F0034C8 00000000 */ nop -/* 035EBC 7F0034CC 45030067 */ bc1tl .L7F00366C -/* 035EC0 7F0034D0 8E050028 */ lw $a1, 0x28($s0) -/* 035EC4 7F0034D4 05C0005D */ bltz $t6, .L7F00364C -/* 035EC8 7F0034D8 01C02025 */ move $a0, $t6 -/* 035ECC 7F0034DC 0FC2E25A */ jal sub_GAME_7F0B96CC -/* 035ED0 7F0034E0 27A50180 */ addiu $a1, $sp, 0x180 -/* 035ED4 7F0034E4 0FC2CEDB */ jal get_room_data_float2 -/* 035ED8 7F0034E8 00000000 */ nop -/* 035EDC 7F0034EC C7A4018C */ lwc1 $f4, 0x18c($sp) -/* 035EE0 7F0034F0 C7AA0188 */ lwc1 $f10, 0x188($sp) -/* 035EE4 7F0034F4 3C038002 */ lui $v1, %hi(scale_1_0_item_related) # $v1, 0x8002 -/* 035EE8 7F0034F8 46002202 */ mul.s $f8, $f4, $f0 -/* 035EEC 7F0034FC 24635910 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, 0x5910 -/* 035EF0 7F003500 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 035EF4 7F003504 44818000 */ mtc1 $at, $f16 -/* 035EF8 7F003508 C46C0000 */ lwc1 $f12, ($v1) -/* 035EFC 7F00350C 27A4016C */ addiu $a0, $sp, 0x16c -/* 035F00 7F003510 E7A8018C */ swc1 $f8, 0x18c($sp) -/* 035F04 7F003514 C6060008 */ lwc1 $f6, 8($s0) -/* 035F08 7F003518 C6040004 */ lwc1 $f4, 4($s0) -/* 035F0C 7F00351C C60E0000 */ lwc1 $f14, ($s0) -/* 035F10 7F003520 46065482 */ mul.s $f18, $f10, $f6 -/* 035F14 7F003524 C7A60184 */ lwc1 $f6, 0x184($sp) -/* 035F18 7F003528 E7A80038 */ swc1 $f8, 0x38($sp) -/* 035F1C 7F00352C C7A80180 */ lwc1 $f8, 0x180($sp) -/* 035F20 7F003530 46062102 */ mul.s $f4, $f4, $f6 -/* 035F24 7F003534 E7AA003C */ swc1 $f10, 0x3c($sp) -/* 035F28 7F003538 4610603C */ c.lt.s $f12, $f16 -/* 035F2C 7F00353C 46087282 */ mul.s $f10, $f14, $f8 -/* 035F30 7F003540 46045280 */ add.s $f10, $f10, $f4 -/* 035F34 7F003544 C7A4018C */ lwc1 $f4, 0x18c($sp) -/* 035F38 7F003548 45000013 */ bc1f .L7F003598 -/* 035F3C 7F00354C 460A9080 */ add.s $f2, $f18, $f10 -/* 035F40 7F003550 C7A40038 */ lwc1 $f4, 0x38($sp) -/* 035F44 7F003554 460C8281 */ sub.s $f10, $f16, $f12 -/* 035F48 7F003558 46041481 */ sub.s $f18, $f2, $f4 -/* 035F4C 7F00355C 460A9082 */ mul.s $f2, $f18, $f10 -/* 035F50 7F003560 00000000 */ nop -/* 035F54 7F003564 46024102 */ mul.s $f4, $f8, $f2 -/* 035F58 7F003568 46047481 */ sub.s $f18, $f14, $f4 -/* 035F5C 7F00356C 46023202 */ mul.s $f8, $f6, $f2 -/* 035F60 7F003570 C7A6003C */ lwc1 $f6, 0x3c($sp) -/* 035F64 7F003574 E7B20170 */ swc1 $f18, 0x170($sp) -/* 035F68 7F003578 C60A0004 */ lwc1 $f10, 4($s0) -/* 035F6C 7F00357C 46085101 */ sub.s $f4, $f10, $f8 -/* 035F70 7F003580 46023282 */ mul.s $f10, $f6, $f2 -/* 035F74 7F003584 E7A40174 */ swc1 $f4, 0x174($sp) -/* 035F78 7F003588 C6120008 */ lwc1 $f18, 8($s0) -/* 035F7C 7F00358C 460A9201 */ sub.s $f8, $f18, $f10 -/* 035F80 7F003590 10000012 */ b .L7F0035DC -/* 035F84 7F003594 E7A80178 */ swc1 $f8, 0x178($sp) -.L7F003598: -/* 035F88 7F003598 46041181 */ sub.s $f6, $f2, $f4 -/* 035F8C 7F00359C C7AA0180 */ lwc1 $f10, 0x180($sp) -/* 035F90 7F0035A0 46106481 */ sub.s $f18, $f12, $f16 -/* 035F94 7F0035A4 46123082 */ mul.s $f2, $f6, $f18 -/* 035F98 7F0035A8 C7A60184 */ lwc1 $f6, 0x184($sp) -/* 035F9C 7F0035AC 46025202 */ mul.s $f8, $f10, $f2 -/* 035FA0 7F0035B0 460E4100 */ add.s $f4, $f8, $f14 -/* 035FA4 7F0035B4 46023482 */ mul.s $f18, $f6, $f2 -/* 035FA8 7F0035B8 E7A40170 */ swc1 $f4, 0x170($sp) -/* 035FAC 7F0035BC C60A0004 */ lwc1 $f10, 4($s0) -/* 035FB0 7F0035C0 C7A40188 */ lwc1 $f4, 0x188($sp) -/* 035FB4 7F0035C4 460A9200 */ add.s $f8, $f18, $f10 -/* 035FB8 7F0035C8 46022182 */ mul.s $f6, $f4, $f2 -/* 035FBC 7F0035CC E7A80174 */ swc1 $f8, 0x174($sp) -/* 035FC0 7F0035D0 C6120008 */ lwc1 $f18, 8($s0) -/* 035FC4 7F0035D4 46123280 */ add.s $f10, $f6, $f18 -/* 035FC8 7F0035D8 E7AA0178 */ swc1 $f10, 0x178($sp) -.L7F0035DC: -/* 035FCC 7F0035DC 8E180028 */ lw $t8, 0x28($s0) -/* 035FD0 7F0035E0 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 035FD4 7F0035E4 8FA70170 */ lw $a3, 0x170($sp) -/* 035FD8 7F0035E8 AFB8016C */ sw $t8, 0x16c($sp) -/* 035FDC 7F0035EC 8E060008 */ lw $a2, 8($s0) -/* 035FE0 7F0035F0 8E050000 */ lw $a1, ($s0) -/* 035FE4 7F0035F4 0FC2BFA9 */ jal walkTilesBetweenPoints_NoCallback -/* 035FE8 7F0035F8 E7A80010 */ swc1 $f8, 0x10($sp) -/* 035FEC 7F0035FC 3C038002 */ lui $v1, %hi(scale_1_0_item_related) # $v1, 0x8002 -/* 035FF0 7F003600 10400019 */ beqz $v0, .L7F003668 -/* 035FF4 7F003604 24635910 */ addiu $v1, %lo(scale_1_0_item_related) # addiu $v1, $v1, 0x5910 -/* 035FF8 7F003608 8FB9016C */ lw $t9, 0x16c($sp) -/* 035FFC 7F00360C C60A002C */ lwc1 $f10, 0x2c($s0) -/* 036000 7F003610 AE190028 */ sw $t9, 0x28($s0) -/* 036004 7F003614 C7A40170 */ lwc1 $f4, 0x170($sp) -/* 036008 7F003618 E6040000 */ swc1 $f4, ($s0) -/* 03600C 7F00361C C7A60174 */ lwc1 $f6, 0x174($sp) -/* 036010 7F003620 E6060004 */ swc1 $f6, 4($s0) -/* 036014 7F003624 C7B20178 */ lwc1 $f18, 0x178($sp) -/* 036018 7F003628 C6060030 */ lwc1 $f6, 0x30($s0) -/* 03601C 7F00362C E6120008 */ swc1 $f18, 8($s0) -/* 036020 7F003630 C4680000 */ lwc1 $f8, ($v1) -/* 036024 7F003634 46085102 */ mul.s $f4, $f10, $f8 -/* 036028 7F003638 E604002C */ swc1 $f4, 0x2c($s0) -/* 03602C 7F00363C C4720000 */ lwc1 $f18, ($v1) -/* 036030 7F003640 46123282 */ mul.s $f10, $f6, $f18 -/* 036034 7F003644 10000008 */ b .L7F003668 -/* 036038 7F003648 E60A0030 */ swc1 $f10, 0x30($s0) -.L7F00364C: -/* 03603C 7F00364C C608002C */ lwc1 $f8, 0x2c($s0) -/* 036040 7F003650 C6060030 */ lwc1 $f6, 0x30($s0) -/* 036044 7F003654 460C4102 */ mul.s $f4, $f8, $f12 -/* 036048 7F003658 E604002C */ swc1 $f4, 0x2c($s0) -/* 03604C 7F00365C C4720000 */ lwc1 $f18, ($v1) -/* 036050 7F003660 46123282 */ mul.s $f10, $f6, $f18 -/* 036054 7F003664 E60A0030 */ swc1 $f10, 0x30($s0) -.L7F003668: -/* 036058 7F003668 8E050028 */ lw $a1, 0x28($s0) -.L7F00366C: -/* 03605C 7F00366C 27AF01C8 */ addiu $t7, $sp, 0x1c8 -/* 036060 7F003670 AFAF0010 */ sw $t7, 0x10($sp) -/* 036064 7F003674 02002025 */ move $a0, $s0 -/* 036068 7F003678 24060000 */ li $a2, 0 -/* 03606C 7F00367C 0FC15ACC */ jal sub_GAME_7F056850 -/* 036070 7F003680 27A701B8 */ addiu $a3, $sp, 0x1b8 -/* 036074 7F003684 50400138 */ beql $v0, $zero, .L7F003B68 -/* 036078 7F003688 AE200010 */ sw $zero, 0x10($s1) -/* 03607C 7F00368C C6080018 */ lwc1 $f8, 0x18($s0) -/* 036080 7F003690 44800000 */ mtc1 $zero, $f0 -/* 036084 7F003694 27A4012C */ addiu $a0, $sp, 0x12c -/* 036088 7F003698 46004107 */ neg.s $f4, $f8 -/* 03608C 7F00369C 44050000 */ mfc1 $a1, $f0 -/* 036090 7F0036A0 E7A40010 */ swc1 $f4, 0x10($sp) -/* 036094 7F0036A4 C606001C */ lwc1 $f6, 0x1c($s0) -/* 036098 7F0036A8 44060000 */ mfc1 $a2, $f0 -/* 03609C 7F0036AC 44070000 */ mfc1 $a3, $f0 -/* 0360A0 7F0036B0 46003487 */ neg.s $f18, $f6 -/* 0360A4 7F0036B4 E7B20014 */ swc1 $f18, 0x14($sp) -/* 0360A8 7F0036B8 C60A0020 */ lwc1 $f10, 0x20($s0) -/* 0360AC 7F0036BC 46005207 */ neg.s $f8, $f10 -/* 0360B0 7F0036C0 E7A80018 */ swc1 $f8, 0x18($sp) -/* 0360B4 7F0036C4 C604000C */ lwc1 $f4, 0xc($s0) -/* 0360B8 7F0036C8 E7A4001C */ swc1 $f4, 0x1c($sp) -/* 0360BC 7F0036CC C6060010 */ lwc1 $f6, 0x10($s0) -/* 0360C0 7F0036D0 E7A60020 */ swc1 $f6, 0x20($sp) -/* 0360C4 7F0036D4 C6120014 */ lwc1 $f18, 0x14($s0) -/* 0360C8 7F0036D8 0FC1676C */ jal matrix_4x4_7F059908 -/* 0360CC 7F0036DC E7B20024 */ swc1 $f18, 0x24($sp) -/* 0360D0 7F0036E0 8FA801D0 */ lw $t0, 0x1d0($sp) -/* 0360D4 7F0036E4 3C0A8003 */ lui $t2, %hi(PitemZ_entries) -/* 0360D8 7F0036E8 8FAB01C8 */ lw $t3, 0x1c8($sp) -/* 0360DC 7F0036EC 00084880 */ sll $t1, $t0, 2 -/* 0360E0 7F0036F0 01284823 */ subu $t1, $t1, $t0 -/* 0360E4 7F0036F4 00094880 */ sll $t1, $t1, 2 -/* 0360E8 7F0036F8 01495021 */ addu $t2, $t2, $t1 -/* 0360EC 7F0036FC 8D4A4D88 */ lw $t2, %lo(PitemZ_entries)($t2) -/* 0360F0 7F003700 AFAB0114 */ sw $t3, 0x114($sp) -/* 0360F4 7F003704 3C018004 */ lui $at, %hi(D_8004EF5C) # $at, 0x8004 -/* 0360F8 7F003708 AFAA0124 */ sw $t2, 0x124($sp) -/* 0360FC 7F00370C C60A002C */ lwc1 $f10, 0x2c($s0) -/* 036100 7F003710 C42C73A0 */ lwc1 $f12, %lo(D_8004EF5C)($at) -/* 036104 7F003714 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036108 7F003718 E7AA0078 */ swc1 $f10, 0x78($sp) -/* 03610C 7F00371C C6080030 */ lwc1 $f8, 0x30($s0) -/* 036110 7F003720 E7A80074 */ swc1 $f8, 0x74($sp) -/* 036114 7F003724 C6040034 */ lwc1 $f4, 0x34($s0) -/* 036118 7F003728 E7A40070 */ swc1 $f4, 0x70($sp) -/* 03611C 7F00372C C6060038 */ lwc1 $f6, 0x38($s0) -/* 036120 7F003730 E7A6006C */ swc1 $f6, 0x6c($sp) -/* 036124 7F003734 C612003C */ lwc1 $f18, 0x3c($s0) -/* 036128 7F003738 E7B20068 */ swc1 $f18, 0x68($sp) -/* 03612C 7F00373C C60A0040 */ lwc1 $f10, 0x40($s0) -/* 036130 7F003740 0FC16286 */ jal matrix_4x4_set_rotation_around_x -/* 036134 7F003744 E7AA0064 */ swc1 $f10, 0x64($sp) -/* 036138 7F003748 3C018004 */ lui $at, %hi(D_8004EF60) # $at, 0x8004 -/* 03613C 7F00374C C42C73A4 */ lwc1 $f12, %lo(D_8004EF60)($at) -/* 036140 7F003750 0FC162CC */ jal matrix_4x4_set_rotation_around_z -/* 036144 7F003754 27A50088 */ addiu $a1, $sp, 0x88 -/* 036148 7F003758 27A40088 */ addiu $a0, $sp, 0x88 -/* 03614C 7F00375C 0FC16144 */ jal matrix_4x4_multiply_in_place -/* 036150 7F003760 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036154 7F003764 27A4012C */ addiu $a0, $sp, 0x12c -/* 036158 7F003768 0FC16144 */ jal matrix_4x4_multiply_in_place -/* 03615C 7F00376C 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036160 7F003770 02002025 */ move $a0, $s0 -/* 036164 7F003774 0FC006F5 */ jal sub_GAME_7F001BD4 -/* 036168 7F003778 27A50118 */ addiu $a1, $sp, 0x118 -/* 03616C 7F00377C 8FAC0124 */ lw $t4, 0x124($sp) -/* 036170 7F003780 C7A8006C */ lwc1 $f8, 0x6c($sp) -/* 036174 7F003784 C7A40070 */ lwc1 $f4, 0x70($sp) -/* 036178 7F003788 8D8D0000 */ lw $t5, ($t4) -/* 03617C 7F00378C 3C018004 */ lui $at, %hi(D_8004EF64) -/* 036180 7F003790 46044181 */ sub.s $f6, $f8, $f4 -/* 036184 7F003794 8DAE0014 */ lw $t6, 0x14($t5) -/* 036188 7F003798 C7A40064 */ lwc1 $f4, 0x64($sp) -/* 03618C 7F00379C C42073A8 */ lwc1 $f0, %lo(D_8004EF64)($at) -/* 036190 7F0037A0 8DC20004 */ lw $v0, 4($t6) -/* 036194 7F0037A4 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036198 7F0037A8 C4520008 */ lwc1 $f18, 8($v0) -/* 03619C 7F0037AC C44A0004 */ lwc1 $f10, 4($v0) -/* 0361A0 7F0037B0 460A9201 */ sub.s $f8, $f18, $f10 -/* 0361A4 7F0037B4 C7B20068 */ lwc1 $f18, 0x68($sp) -/* 0361A8 7F0037B8 C44A0010 */ lwc1 $f10, 0x10($v0) -/* 0361AC 7F0037BC 46083303 */ div.s $f12, $f6, $f8 -/* 0361B0 7F0037C0 C446000C */ lwc1 $f6, 0xc($v0) -/* 0361B4 7F0037C4 46122081 */ sub.s $f2, $f4, $f18 -/* 0361B8 7F0037C8 C7B20078 */ lwc1 $f18, 0x78($sp) -/* 0361BC 7F0037CC C7A40074 */ lwc1 $f4, 0x74($sp) -/* 0361C0 7F0037D0 46065201 */ sub.s $f8, $f10, $f6 -/* 0361C4 7F0037D4 C4460018 */ lwc1 $f6, 0x18($v0) -/* 0361C8 7F0037D8 46081383 */ div.s $f14, $f2, $f8 -/* 0361CC 7F0037DC C4480014 */ lwc1 $f8, 0x14($v0) -/* 0361D0 7F0037E0 4600603E */ c.le.s $f12, $f0 -/* 0361D4 7F0037E4 46122281 */ sub.s $f10, $f4, $f18 -/* 0361D8 7F0037E8 46083101 */ sub.s $f4, $f6, $f8 -/* 0361DC 7F0037EC 45010008 */ bc1t .L7F003810 -/* 0361E0 7F0037F0 46045403 */ div.s $f16, $f10, $f4 -/* 0361E4 7F0037F4 4600703E */ c.le.s $f14, $f0 -/* 0361E8 7F0037F8 00000000 */ nop -/* 0361EC 7F0037FC 45030005 */ bc1tl .L7F003814 -/* 0361F0 7F003800 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0361F4 7F003804 4600803E */ c.le.s $f16, $f0 -/* 0361F8 7F003808 00000000 */ nop -/* 0361FC 7F00380C 45000005 */ bc1f .L7F003824 -.L7F003810: -/* 036200 7F003810 3C013F80 */ li $at, 0x3F800000 # 1.000000 -.L7F003814: -/* 036204 7F003814 44818000 */ mtc1 $at, $f16 -/* 036208 7F003818 44817000 */ mtc1 $at, $f14 -/* 03620C 7F00381C 44816000 */ mtc1 $at, $f12 -/* 036210 7F003820 00000000 */ nop -.L7F003824: -/* 036214 7F003824 E7A20048 */ swc1 $f2, 0x48($sp) -/* 036218 7F003828 E7AC0060 */ swc1 $f12, 0x60($sp) -/* 03621C 7F00382C E7AE005C */ swc1 $f14, 0x5c($sp) -/* 036220 7F003830 0FC16397 */ jal matrix_column_1_scalar_multiply -/* 036224 7F003834 E7B00058 */ swc1 $f16, 0x58($sp) -/* 036228 7F003838 C7AC005C */ lwc1 $f12, 0x5c($sp) -/* 03622C 7F00383C 0FC163A3 */ jal matrix_column_2_scalar_multiply -/* 036230 7F003840 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036234 7F003844 C7AC0058 */ lwc1 $f12, 0x58($sp) -/* 036238 7F003848 0FC163BD */ jal matrix_column_3_scalar_multiply_2 -/* 03623C 7F00384C 27A500D4 */ addiu $a1, $sp, 0xd4 -/* 036240 7F003850 C7B20118 */ lwc1 $f18, 0x118($sp) -/* 036244 7F003854 C7A6011C */ lwc1 $f6, 0x11c($sp) -/* 036248 7F003858 C7A80120 */ lwc1 $f8, 0x120($sp) -/* 03624C 7F00385C E7B200C8 */ swc1 $f18, 0xc8($sp) -/* 036250 7F003860 E7A600CC */ swc1 $f6, 0xcc($sp) -/* 036254 7F003864 E7A800D0 */ swc1 $f8, 0xd0($sp) -/* 036258 7F003868 8E38000C */ lw $t8, 0xc($s1) -/* 03625C 7F00386C C7A20048 */ lwc1 $f2, 0x48($sp) -/* 036260 7F003870 27A40114 */ addiu $a0, $sp, 0x114 -/* 036264 7F003874 33190001 */ andi $t9, $t8, 1 -/* 036268 7F003878 17200016 */ bnez $t9, .L7F0038D4 -/* 03626C 7F00387C C7A601B8 */ lwc1 $f6, 0x1b8($sp) -/* 036270 7F003880 44079000 */ mfc1 $a3, $f18 -/* 036274 7F003884 8FA501B8 */ lw $a1, 0x1b8($sp) -/* 036278 7F003888 8FA601C0 */ lw $a2, 0x1c0($sp) -/* 03627C 7F00388C E7A80010 */ swc1 $f8, 0x10($sp) -/* 036280 7F003890 0FC2BFA9 */ jal walkTilesBetweenPoints_NoCallback -/* 036284 7F003894 E7A20048 */ swc1 $f2, 0x48($sp) -/* 036288 7F003898 10400004 */ beqz $v0, .L7F0038AC -/* 03628C 7F00389C C7A20048 */ lwc1 $f2, 0x48($sp) -/* 036290 7F0038A0 8FAF0114 */ lw $t7, 0x114($sp) -/* 036294 7F0038A4 10000010 */ b .L7F0038E8 -/* 036298 7F0038A8 AFAF01C8 */ sw $t7, 0x1c8($sp) -.L7F0038AC: -/* 03629C 7F0038AC C7AA01B8 */ lwc1 $f10, 0x1b8($sp) -/* 0362A0 7F0038B0 C7A401C0 */ lwc1 $f4, 0x1c0($sp) -/* 0362A4 7F0038B4 E7AA0118 */ swc1 $f10, 0x118($sp) -/* 0362A8 7F0038B8 E7A40120 */ swc1 $f4, 0x120($sp) -/* 0362AC 7F0038BC 8E280008 */ lw $t0, 8($s1) -/* 0362B0 7F0038C0 31091000 */ andi $t1, $t0, 0x1000 -/* 0362B4 7F0038C4 55200009 */ bnezl $t1, .L7F0038EC -/* 0362B8 7F0038C8 9622009A */ lhu $v0, 0x9a($s1) -/* 0362BC 7F0038CC 10000007 */ b .L7F0038EC -/* 0362C0 7F0038D0 9622009A */ lhu $v0, 0x9a($s1) -.L7F0038D4: -/* 0362C4 7F0038D4 C7B201BC */ lwc1 $f18, 0x1bc($sp) -/* 0362C8 7F0038D8 C7A801C0 */ lwc1 $f8, 0x1c0($sp) -/* 0362CC 7F0038DC E7A60118 */ swc1 $f6, 0x118($sp) -/* 0362D0 7F0038E0 E7B2011C */ swc1 $f18, 0x11c($sp) -/* 0362D4 7F0038E4 E7A80120 */ swc1 $f8, 0x120($sp) -.L7F0038E8: -/* 0362D8 7F0038E8 9622009A */ lhu $v0, 0x9a($s1) -.L7F0038EC: -/* 0362DC 7F0038EC 24010004 */ li $at, 4 -/* 0362E0 7F0038F0 10410003 */ beq $v0, $at, .L7F003900 -/* 0362E4 7F0038F4 24010008 */ li $at, 8 -/* 0362E8 7F0038F8 1441000B */ bne $v0, $at, .L7F003928 -/* 0362EC 7F0038FC C7A40070 */ lwc1 $f4, 0x70($sp) -.L7F003900: -/* 0362F0 7F003900 C60A0018 */ lwc1 $f10, 0x18($s0) -/* 0362F4 7F003904 46025102 */ mul.s $f4, $f10, $f2 -/* 0362F8 7F003908 E7A4007C */ swc1 $f4, 0x7c($sp) -/* 0362FC 7F00390C C606001C */ lwc1 $f6, 0x1c($s0) -/* 036300 7F003910 46023482 */ mul.s $f18, $f6, $f2 -/* 036304 7F003914 E7B20080 */ swc1 $f18, 0x80($sp) -/* 036308 7F003918 C6080020 */ lwc1 $f8, 0x20($s0) -/* 03630C 7F00391C 46024282 */ mul.s $f10, $f8, $f2 -/* 036310 7F003920 1000000C */ b .L7F003954 -/* 036314 7F003924 E7AA0084 */ swc1 $f10, 0x84($sp) -.L7F003928: -/* 036318 7F003928 C7A6006C */ lwc1 $f6, 0x6c($sp) -/* 03631C 7F00392C C612000C */ lwc1 $f18, 0xc($s0) -/* 036320 7F003930 46062001 */ sub.s $f0, $f4, $f6 -/* 036324 7F003934 46009202 */ mul.s $f8, $f18, $f0 -/* 036328 7F003938 E7A8007C */ swc1 $f8, 0x7c($sp) -/* 03632C 7F00393C C60A0010 */ lwc1 $f10, 0x10($s0) -/* 036330 7F003940 46005102 */ mul.s $f4, $f10, $f0 -/* 036334 7F003944 E7A40080 */ swc1 $f4, 0x80($sp) -/* 036338 7F003948 C6060014 */ lwc1 $f6, 0x14($s0) -/* 03633C 7F00394C 46003482 */ mul.s $f18, $f6, $f0 -/* 036340 7F003950 E7B20084 */ swc1 $f18, 0x84($sp) -.L7F003954: -/* 036344 7F003954 8E2A0084 */ lw $t2, 0x84($s1) -/* 036348 7F003958 3C014780 */ li $at, 0x47800000 # 65536.000000 -/* 03634C 7F00395C 44810000 */ mtc1 $at, $f0 -/* 036350 7F003960 448A4000 */ mtc1 $t2, $f8 -/* 036354 7F003964 8E2C008C */ lw $t4, 0x8c($s1) -/* 036358 7F003968 3C018004 */ lui $at, %hi(D_800473AC) # $at, 0x8004 -/* 03635C 7F00396C 468042A0 */ cvt.s.w $f10, $f8 -/* 036360 7F003970 C42273AC */ lwc1 $f2, %lo(D_800473AC)($at) -/* 036364 7F003974 8E2B0088 */ lw $t3, 0x88($s1) -/* 036368 7F003978 8E2D0090 */ lw $t5, 0x90($s1) -/* 03636C 7F00397C 8E2E0094 */ lw $t6, 0x94($s1) -/* 036370 7F003980 448B3000 */ mtc1 $t3, $f6 -/* 036374 7F003984 46005103 */ div.s $f4, $f10, $f0 -/* 036378 7F003988 448C5000 */ mtc1 $t4, $f10 -/* 03637C 7F00398C 27B8007C */ addiu $t8, $sp, 0x7c -/* 036380 7F003990 27B900C8 */ addiu $t9, $sp, 0xc8 -/* 036384 7F003994 468034A0 */ cvt.s.w $f18, $f6 -/* 036388 7F003998 02202025 */ move $a0, $s1 -/* 03638C 7F00399C 27A50118 */ addiu $a1, $sp, 0x118 -/* 036390 7F0039A0 27A600D4 */ addiu $a2, $sp, 0xd4 -/* 036394 7F0039A4 46009203 */ div.s $f8, $f18, $f0 -/* 036398 7F0039A8 E6240084 */ swc1 $f4, 0x84($s1) -/* 03639C 7F0039AC 46805120 */ cvt.s.w $f4, $f10 -/* 0363A0 7F0039B0 46022182 */ mul.s $f6, $f4, $f2 -/* 0363A4 7F0039B4 E6280088 */ swc1 $f8, 0x88($s1) -/* 0363A8 7F0039B8 448D4000 */ mtc1 $t5, $f8 -/* 0363AC 7F0039BC 00000000 */ nop -/* 0363B0 7F0039C0 468042A0 */ cvt.s.w $f10, $f8 -/* 0363B4 7F0039C4 46003483 */ div.s $f18, $f6, $f0 -/* 0363B8 7F0039C8 46025102 */ mul.s $f4, $f10, $f2 -/* 0363BC 7F0039CC 46002183 */ div.s $f6, $f4, $f0 -/* 0363C0 7F0039D0 E632008C */ swc1 $f18, 0x8c($s1) -/* 0363C4 7F0039D4 448E9000 */ mtc1 $t6, $f18 -/* 0363C8 7F0039D8 00000000 */ nop -/* 0363CC 7F0039DC 46809220 */ cvt.s.w $f8, $f18 -/* 0363D0 7F0039E0 46024282 */ mul.s $f10, $f8, $f2 -/* 0363D4 7F0039E4 E6260090 */ swc1 $f6, 0x90($s1) -/* 0363D8 7F0039E8 46005103 */ div.s $f4, $f10, $f0 -/* 0363DC 7F0039EC E6240094 */ swc1 $f4, 0x94($s1) -/* 0363E0 7F0039F0 AFB90014 */ sw $t9, 0x14($sp) -/* 0363E4 7F0039F4 AFB80010 */ sw $t8, 0x10($sp) -/* 0363E8 7F0039F8 0FC14E34 */ jal initialize_door -/* 0363EC 7F0039FC 8FA701C8 */ lw $a3, 0x1c8($sp) -/* 0363F0 7F003A00 8E2F0008 */ lw $t7, 8($s1) -/* 0363F4 7F003A04 00408025 */ move $s0, $v0 -/* 0363F8 7F003A08 8FA901B4 */ lw $t1, 0x1b4($sp) -/* 0363FC 7F003A0C 000F40C0 */ sll $t0, $t7, 3 -/* 036400 7F003A10 0503000E */ bgezl $t0, .L7F003A4C -/* 036404 7F003A14 8E020014 */ lw $v0, 0x14($s0) -/* 036408 7F003A18 AE2900F0 */ sw $t1, 0xf0($s1) -/* 03640C 7F003A1C 8FAA01B4 */ lw $t2, 0x1b4($sp) -/* 036410 7F003A20 0542000A */ bltzl $t2, .L7F003A4C -/* 036414 7F003A24 8E020014 */ lw $v0, 0x14($s0) -/* 036418 7F003A28 44803000 */ mtc1 $zero, $f6 -/* 03641C 7F003A2C C63200B4 */ lwc1 $f18, 0xb4($s1) -/* 036420 7F003A30 46123032 */ c.eq.s $f6, $f18 -/* 036424 7F003A34 00000000 */ nop -/* 036428 7F003A38 45020004 */ bc1fl .L7F003A4C -/* 03642C 7F003A3C 8E020014 */ lw $v0, 0x14($s0) -/* 036430 7F003A40 0FC14E29 */ jal doorDeactivatePortal -/* 036434 7F003A44 02202025 */ move $a0, $s1 -/* 036438 7F003A48 8E020014 */ lw $v0, 0x14($s0) -.L7F003A4C: -/* 03643C 7F003A4C 02002025 */ move $a0, $s0 -/* 036440 7F003A50 904B0003 */ lbu $t3, 3($v0) -/* 036444 7F003A54 A20B002C */ sb $t3, 0x2c($s0) -/* 036448 7F003A58 0FC0F797 */ jal chrpropRegisterRoom -/* 03644C 7F003A5C 90450003 */ lbu $a1, 3($v0) -/* 036450 7F003A60 240200FF */ li $v0, 255 -/* 036454 7F003A64 A202002D */ sb $v0, 0x2d($s0) -/* 036458 7F003A68 A202002E */ sb $v0, 0x2e($s0) -/* 03645C 7F003A6C 8E230008 */ lw $v1, 8($s1) -/* 036460 7F003A70 000360C0 */ sll $t4, $v1, 3 -/* 036464 7F003A74 05800003 */ bltz $t4, .L7F003A84 -/* 036468 7F003A78 00036840 */ sll $t5, $v1, 1 -/* 03646C 7F003A7C 05A3001A */ bgezl $t5, .L7F003AE8 -/* 036470 7F003A80 8E240014 */ lw $a0, 0x14($s1) -.L7F003A84: -/* 036474 7F003A84 8E180014 */ lw $t8, 0x14($s0) -/* 036478 7F003A88 8FAE01B0 */ lw $t6, 0x1b0($sp) -/* 03647C 7F003A8C 8FA501AC */ lw $a1, 0x1ac($sp) -/* 036480 7F003A90 93190003 */ lbu $t9, 3($t8) -/* 036484 7F003A94 11D90009 */ beq $t6, $t9, .L7F003ABC -/* 036488 7F003A98 00000000 */ nop -/* 03648C 7F003A9C 05C0000D */ bltz $t6, .L7F003AD4 -/* 036490 7F003AA0 8FAF01B0 */ lw $t7, 0x1b0($sp) -/* 036494 7F003AA4 A20F002D */ sb $t7, 0x2d($s0) -/* 036498 7F003AA8 87A501B2 */ lh $a1, 0x1b2($sp) -/* 03649C 7F003AAC 0FC0F797 */ jal chrpropRegisterRoom -/* 0364A0 7F003AB0 02002025 */ move $a0, $s0 -/* 0364A4 7F003AB4 10000008 */ b .L7F003AD8 -/* 0364A8 7F003AB8 9209002D */ lbu $t1, 0x2d($s0) -.L7F003ABC: -/* 0364AC 7F003ABC 04A00005 */ bltz $a1, .L7F003AD4 -/* 0364B0 7F003AC0 8FA801AC */ lw $t0, 0x1ac($sp) -/* 0364B4 7F003AC4 A208002D */ sb $t0, 0x2d($s0) -/* 0364B8 7F003AC8 87A501AE */ lh $a1, 0x1ae($sp) -/* 0364BC 7F003ACC 0FC0F797 */ jal chrpropRegisterRoom -/* 0364C0 7F003AD0 02002025 */ move $a0, $s0 -.L7F003AD4: -/* 0364C4 7F003AD4 9209002D */ lbu $t1, 0x2d($s0) -.L7F003AD8: -/* 0364C8 7F003AD8 240100FF */ li $at, 255 -/* 0364CC 7F003ADC 51210002 */ beql $t1, $at, .L7F003AE8 -/* 0364D0 7F003AE0 8E240014 */ lw $a0, 0x14($s1) -/* 0364D4 7F003AE4 8E240014 */ lw $a0, 0x14($s1) -.L7F003AE8: -/* 0364D8 7F003AE8 C7A00060 */ lwc1 $f0, 0x60($sp) -/* 0364DC 7F003AEC C7AC005C */ lwc1 $f12, 0x5c($sp) -/* 0364E0 7F003AF0 10800010 */ beqz $a0, .L7F003B34 -/* 0364E4 7F003AF4 C7A80058 */ lwc1 $f8, 0x58($sp) -/* 0364E8 7F003AF8 460C003C */ c.lt.s $f0, $f12 -/* 0364EC 7F003AFC 00000000 */ nop -/* 0364F0 7F003B00 45020003 */ bc1fl .L7F003B10 -/* 0364F4 7F003B04 4608003C */ c.lt.s $f0, $f8 -/* 0364F8 7F003B08 46006006 */ mov.s $f0, $f12 -/* 0364FC 7F003B0C 4608003C */ c.lt.s $f0, $f8 -.L7F003B10: -/* 036500 7F003B10 00000000 */ nop -/* 036504 7F003B14 45020003 */ bc1fl .L7F003B24 -/* 036508 7F003B18 C48A0014 */ lwc1 $f10, 0x14($a0) -/* 03650C 7F003B1C 46004006 */ mov.s $f0, $f8 -/* 036510 7F003B20 C48A0014 */ lwc1 $f10, 0x14($a0) -.L7F003B24: -/* 036514 7F003B24 46005102 */ mul.s $f4, $f10, $f0 -/* 036518 7F003B28 44052000 */ mfc1 $a1, $f4 -/* 03651C 7F003B2C 0FC1B4CF */ jal modelSetScale -/* 036520 7F003B30 00000000 */ nop -.L7F003B34: -/* 036524 7F003B34 0FC0E959 */ jal chrpropActivate -/* 036528 7F003B38 02002025 */ move $a0, $s0 -/* 03652C 7F003B3C 0FC0E931 */ jal chrpropEnable -/* 036530 7F003B40 02002025 */ move $a0, $s0 -/* 036534 7F003B44 8E220080 */ lw $v0, 0x80($s1) -/* 036538 7F003B48 8FAB01E0 */ lw $t3, 0x1e0($sp) -/* 03653C 7F003B4C 50400007 */ beql $v0, $zero, .L7F003B6C -/* 036540 7F003B50 8FBF0034 */ lw $ra, 0x34($sp) -/* 036544 7F003B54 0FC15B5A */ jal setupGetPtrToCommandByIndex -/* 036548 7F003B58 004B2021 */ addu $a0, $v0, $t3 -/* 03654C 7F003B5C 10000002 */ b .L7F003B68 -/* 036550 7F003B60 AE2200C8 */ sw $v0, 0xc8($s1) -/* 036554 7F003B64 AE200010 */ sw $zero, 0x10($s1) -.L7F003B68: -/* 036558 7F003B68 8FBF0034 */ lw $ra, 0x34($sp) -.L7F003B6C: -/* 03655C 7F003B6C 8FB0002C */ lw $s0, 0x2c($sp) -/* 036560 7F003B70 8FB10030 */ lw $s1, 0x30($sp) -/* 036564 7F003B74 03E00008 */ jr $ra -/* 036568 7F003B78 27BD01D8 */ addiu $sp, $sp, 0x1d8 + if ((door->flags & PROPFLAG_CULL_BEHIND_DOOR) || (door->flags & PROPFLAG_NO_PORTAL_CLOSE)) + { + if (sp1B0 != prop->stan->room) + { + if (sp1B0 >= 0) + { + prop->rooms[1] = sp1B0; + chrpropRegisterRoom(prop, sp1B0); + } + } + else if (sp1AC >= 0) + { + prop->rooms[1] = sp1AC; + chrpropRegisterRoom(prop, sp1AC); + } + + if (prop->rooms[1] != 0xff && 1) + { + if (prop->stan->room); + } + } + + if (door->model != NULL) + { + scale = xscale; + + if (scale < yscale) + { + scale = yscale; + } -) -#endif -#endif + if (scale < zscale) + { + scale = zscale; + } + + modelSetScale(door->model, door->model->scale * scale); + } + + chrpropActivate(prop); + chrpropEnable(prop); + + if (door->linkedDoorOffset != 0) + { + door->linkedDoor = (struct DoorRecord *)setupGetPtrToCommandByIndex(door->linkedDoorOffset + arg2); + } + } + else + { + door->prop = NULL; + } + +} #ifdef NONMATCHING +// https://decomp.me/scratch/lwIUY 68.9% void proplvreset2(void) { } @@ -3989,12 +2611,12 @@ glabel proplvreset2 /* 0387B0 7F003C80 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0387B4 7F003C84 44812000 */ mtc1 $at, $f4 /* 0387B8 7F003C88 0060F025 */ move $fp, $v1 -/* 0387BC 7F003C8C 3C018003 */ lui $at, %hi(scale_1_0_item_related) +/* 0387BC 7F003C8C 3C018003 */ lui $at, %hi(g_DoorScale) /* 0387C0 7F003C90 3C038004 */ lui $v1, %hi(PitemZ_entries+0xFF0) /* 0387C4 7F003C94 3C028004 */ lui $v0, %hi(PitemZ_entries) /* 0387C8 7F003C98 2442A228 */ addiu $v0, %lo(PitemZ_entries) # addiu $v0, $v0, -0x5dd8 /* 0387CC 7F003C9C 2463B218 */ addiu $v1, $v1, %lo(PitemZ_entries+0xFF0) -/* 0387D0 7F003CA0 E424A3C0 */ swc1 $f4, %lo(scale_1_0_item_related)($at) +/* 0387D0 7F003CA0 E424A3C0 */ swc1 $f4, %lo(g_DoorScale)($at) .L7F003CA4: /* 0387D4 7F003CA4 8C4E0000 */ lw $t6, ($v0) /* 0387D8 7F003CA8 2442000C */ addiu $v0, $v0, 0xc @@ -4046,15 +2668,15 @@ glabel proplvreset2 /* 038888 7F003D58 02202025 */ move $a0, $s1 /* 03888C 7F003D5C 24050001 */ li $a1, 1 /* 038890 7F003D60 24060100 */ li $a2, 256 -/* 038894 7F003D64 0FC2F341 */ jal _load_resource_named_to_membank +/* 038894 7F003D64 0FC2F341 */ jal _fileNameLoadToBank /* 038898 7F003D68 24070004 */ li $a3, 4 /* 03889C 7F003D6C 3C038007 */ lui $v1, %hi(g_ptrStageSetupFile) /* 0388A0 7F003D70 24635D28 */ addiu $v1, %lo(g_ptrStageSetupFile) # addiu $v1, $v1, 0x5d28 /* 0388A4 7F003D74 AC620000 */ sw $v0, ($v1) /* 0388A8 7F003D78 00408825 */ move $s1, $v0 -/* 0388AC 7F003D7C 0FC30578 */ jal get_textbank_number_for_stagenum +/* 0388AC 7F003D7C 0FC30578 */ jal langGetLangBankIndexFromStagenum /* 0388B0 7F003D80 02A02025 */ move $a0, $s5 -/* 0388B4 7F003D84 0FC30742 */ jal load_mission_text_bank +/* 0388B4 7F003D84 0FC30742 */ jal langLoadToAddr /* 0388B8 7F003D88 00402025 */ move $a0, $v0 /* 0388BC 7F003D8C 8E2C0000 */ lw $t4, ($s1) /* 0388C0 7F003D90 3C078007 */ lui $a3, %hi(g_CurrentSetup+0) @@ -4511,11 +3133,11 @@ glabel proplvreset2 /* 038F44 7F004414 3C014780 */ li $at, 0x47800000 # 65536.000000 /* 038F48 7F004418 44815000 */ mtc1 $at, $f10 /* 038F4C 7F00441C 448C3000 */ mtc1 $t4, $f6 -/* 038F50 7F004420 3C018003 */ lui $at, %hi(scale_1_0_item_related) +/* 038F50 7F004420 3C018003 */ lui $at, %hi(g_DoorScale) /* 038F54 7F004424 46803220 */ cvt.s.w $f8, $f6 /* 038F58 7F004428 460A4403 */ div.s $f16, $f8, $f10 /* 038F5C 7F00442C 100001B3 */ b other_obj_expand -/* 038F60 7F004430 E430A3C0 */ swc1 $f16, %lo(scale_1_0_item_related)($at) +/* 038F60 7F004430 E430A3C0 */ swc1 $f16, %lo(g_DoorScale)($at) item_expand: /* 038F64 7F004434 8FAF0278 */ lw $t7, 0x278($sp) /* 038F68 7F004438 11E001B0 */ beqz $t7, other_obj_expand @@ -5382,12 +4004,12 @@ glabel jpt_8004F02C /* 0387F0 7F003C80 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 0387F4 7F003C84 44812000 */ mtc1 $at, $f4 /* 0387F8 7F003C88 0060F025 */ move $fp, $v1 -/* 0387FC 7F003C8C 3C018003 */ lui $at, %hi(scale_1_0_item_related) # $at, 0x8003 +/* 0387FC 7F003C8C 3C018003 */ lui $at, %hi(g_DoorScale) # $at, 0x8003 /* 038800 7F003C90 3C038004 */ lui $v1, %hi(PitemZ_entries+0xFF0) # $v1, 0x8004 /* 038804 7F003C94 3C028004 */ lui $v0, %hi(PitemZ_entries) # $v0, 0x8004 /* 038808 7F003C98 2442A258 */ addiu $v0, %lo(PitemZ_entries) # addiu $v0, $v0, -0x5da8 /* 03880C 7F003C9C 2463B248 */ addiu $v1, %lo(PitemZ_entries+0xFF0) # addiu $v1, $v1, -0x4db8 -/* 038810 7F003CA0 E424A400 */ swc1 $f4, %lo(scale_1_0_item_related)($at) +/* 038810 7F003CA0 E424A400 */ swc1 $f4, %lo(g_DoorScale)($at) .L7F003CA4: /* 038814 7F003CA4 8C4E0000 */ lw $t6, ($v0) /* 038818 7F003CA8 2442000C */ addiu $v0, $v0, 0xc @@ -5439,15 +4061,15 @@ glabel jpt_8004F02C /* 0388C8 7F003D58 02202025 */ move $a0, $s1 /* 0388CC 7F003D5C 24050001 */ li $a1, 1 /* 0388D0 7F003D60 24060100 */ li $a2, 256 -/* 0388D4 7F003D64 0FC2F62D */ jal _load_resource_named_to_membank +/* 0388D4 7F003D64 0FC2F62D */ jal _fileNameLoadToBank /* 0388D8 7F003D68 24070004 */ li $a3, 4 /* 0388DC 7F003D6C 3C038007 */ lui $v1, %hi(g_ptrStageSetupFile) # $v1, 0x8007 /* 0388E0 7F003D70 24635D68 */ addiu $v1, %lo(g_ptrStageSetupFile) # addiu $v1, $v1, 0x5d68 /* 0388E4 7F003D74 AC620000 */ sw $v0, ($v1) /* 0388E8 7F003D78 00408825 */ move $s1, $v0 -/* 0388EC 7F003D7C 0FC308A4 */ jal get_textbank_number_for_stagenum +/* 0388EC 7F003D7C 0FC308A4 */ jal langGetLangBankIndexFromStagenum /* 0388F0 7F003D80 02A02025 */ move $a0, $s5 -/* 0388F4 7F003D84 0FC30A6E */ jal load_mission_text_bank +/* 0388F4 7F003D84 0FC30A6E */ jal langLoadToAddr /* 0388F8 7F003D88 00402025 */ move $a0, $v0 /* 0388FC 7F003D8C 8E2C0000 */ lw $t4, ($s1) /* 038900 7F003D90 3C078007 */ lui $a3, %hi(g_CurrentSetup+0) # $a3, 0x8007 @@ -5904,11 +4526,11 @@ glabel jpt_8004F02C /* 038F84 7F004414 3C014780 */ li $at, 0x47800000 # 65536.000000 /* 038F88 7F004418 44815000 */ mtc1 $at, $f10 /* 038F8C 7F00441C 448C3000 */ mtc1 $t4, $f6 -/* 038F90 7F004420 3C018003 */ lui $at, %hi(scale_1_0_item_related) # $at, 0x8003 +/* 038F90 7F004420 3C018003 */ lui $at, %hi(g_DoorScale) # $at, 0x8003 /* 038F94 7F004424 46803220 */ cvt.s.w $f8, $f6 /* 038F98 7F004428 460A4403 */ div.s $f16, $f8, $f10 /* 038F9C 7F00442C 100001B7 */ b other_obj_expand -/* 038FA0 7F004430 E430A400 */ swc1 $f16, %lo(scale_1_0_item_related)($at) +/* 038FA0 7F004430 E430A400 */ swc1 $f16, %lo(g_DoorScale)($at) item_expand: /* 038FA4 7F004434 8FAF0278 */ lw $t7, 0x278($sp) /* 038FA8 7F004438 11E001B4 */ beqz $t7, other_obj_expand @@ -6780,12 +5402,12 @@ glabel proplvreset2 /* 0365FC 7F003C0C 3C013F80 */ li $at, 0x3F800000 # 1.000000 /* 036600 7F003C10 44812000 */ mtc1 $at, $f4 /* 036604 7F003C14 0060F025 */ move $fp, $v1 -/* 036608 7F003C18 3C018002 */ lui $at, %hi(scale_1_0_item_related) # $at, 0x8002 +/* 036608 7F003C18 3C018002 */ lui $at, %hi(g_DoorScale) # $at, 0x8002 /* 03660C 7F003C1C 3C038003 */ lui $v1, %hi(PitemZ_entries+0xFF0) # $v1, 0x8003 /* 036610 7F003C20 3C028003 */ lui $v0, %hi(PitemZ_entries) # $v0, 0x8003 /* 036614 7F003C24 24424D88 */ addiu $v0, %lo(PitemZ_entries) # addiu $v0, $v0, 0x4d88 /* 036618 7F003C28 24635D78 */ addiu $v1, %lo(PitemZ_entries+0xFF0) # addiu $v1, $v1, 0x5d78 -/* 03661C 7F003C2C E4245910 */ swc1 $f4, %lo(scale_1_0_item_related)($at) +/* 03661C 7F003C2C E4245910 */ swc1 $f4, %lo(g_DoorScale)($at) .L7F003C30: /* 036620 7F003C30 8C4E0000 */ lw $t6, ($v0) /* 036624 7F003C34 2442000C */ addiu $v0, $v0, 0xc @@ -6837,15 +5459,15 @@ glabel proplvreset2 /* 0366D4 7F003CE4 02202025 */ move $a0, $s1 /* 0366D8 7F003CE8 24050001 */ li $a1, 1 /* 0366DC 7F003CEC 24060100 */ li $a2, 256 -/* 0366E0 7F003CF0 0FC2F053 */ jal _load_resource_named_to_membank +/* 0366E0 7F003CF0 0FC2F053 */ jal _fileNameLoadToBank /* 0366E4 7F003CF4 24070004 */ li $a3, 4 /* 0366E8 7F003CF8 3C038006 */ lui $v1, %hi(g_ptrStageSetupFile) # $v1, 0x8006 /* 0366EC 7F003CFC 24634C68 */ addiu $v1, %lo(g_ptrStageSetupFile) # addiu $v1, $v1, 0x4c68 /* 0366F0 7F003D00 AC620000 */ sw $v0, ($v1) /* 0366F4 7F003D04 00408825 */ move $s1, $v0 -/* 0366F8 7F003D08 0FC302B0 */ jal get_textbank_number_for_stagenum +/* 0366F8 7F003D08 0FC302B0 */ jal langGetLangBankIndexFromStagenum /* 0366FC 7F003D0C 02A02025 */ move $a0, $s5 -/* 036700 7F003D10 0FC3047A */ jal load_mission_text_bank +/* 036700 7F003D10 0FC3047A */ jal langLoadToAddr /* 036704 7F003D14 00402025 */ move $a0, $v0 /* 036708 7F003D18 8E2C0000 */ lw $t4, ($s1) /* 03670C 7F003D1C 3C078006 */ lui $a3, %hi(g_CurrentSetup+0) # $a3, 0x8006 @@ -7302,11 +5924,11 @@ glabel proplvreset2 /* 036D90 7F0043A0 3C014780 */ li $at, 0x47800000 # 65536.000000 /* 036D94 7F0043A4 44815000 */ mtc1 $at, $f10 /* 036D98 7F0043A8 448C3000 */ mtc1 $t4, $f6 -/* 036D9C 7F0043AC 3C018002 */ lui $at, %hi(scale_1_0_item_related) # $at, 0x8002 +/* 036D9C 7F0043AC 3C018002 */ lui $at, %hi(g_DoorScale) # $at, 0x8002 /* 036DA0 7F0043B0 46803220 */ cvt.s.w $f8, $f6 /* 036DA4 7F0043B4 460A4403 */ div.s $f16, $f8, $f10 /* 036DA8 7F0043B8 100001B5 */ b other_obj_expand -/* 036DAC 7F0043BC E4305910 */ swc1 $f16, %lo(scale_1_0_item_related)($at) +/* 036DAC 7F0043BC E4305910 */ swc1 $f16, %lo(g_DoorScale)($at) item_expand: /* 036DB0 7F0043C0 8FAF0278 */ lw $t7, 0x278($sp) /* 036DB4 7F0043C4 11E001B2 */ beqz $t7, other_obj_expand diff --git a/src/game/radar.c b/src/game/radar.c index cc8bd85d..e0ca9a6d 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -51,15 +51,10 @@ Gfx *display_red_blue_on_radar(Gfx *DL) return DL; } g_CurrentPlayer = g_CurrentPlayer; - if (g_CurrentPlayer->mpmenuon != 0) + if (g_CurrentPlayer->mpmenuon || g_CurrentPlayer->bonddead) { -block_4: return DL; } - if (g_CurrentPlayer->bonddead != 0) - { - goto block_4; - } if (cheatIsActive(CHEAT_NORADAR) != 0) { return DL; @@ -73,6 +68,7 @@ Gfx *display_red_blue_on_radar(Gfx *DL) phi_s5 = temp_s5; if ((curplayernum & 1) == 0) { + // phi_s5 and temp_s5 are the same phi_s5 = temp_s5 + 0xF; } } @@ -118,6 +114,7 @@ Gfx *display_red_blue_on_radar(Gfx *DL) if (playerCount_2 > 0) { phi_s3 = 0; + // should be a for loop loop_22: if (phi_s3 != curplayernum) { @@ -129,7 +126,7 @@ Gfx *display_red_blue_on_radar(Gfx *DL) temp_f20 = temp_v0_4->position.x - temp_v1->position.x; temp_f22 = temp_v0_4->position.z - temp_v1->position.z; temp_f24 = (f32) 0x10; - temp_f28 = ((atan2f(temp_f20, temp_f22, temp_a0_2) * 180.0f) / 3.1415927f) + g_CurrentPlayer->vv_theta + 180.0f; + temp_f28 = ((atan2f(temp_f20, temp_f22, temp_a0_2) * 180.0f) / M_PI_F) + g_CurrentPlayer->vv_theta + 180.0f; temp_f2 = sqrtf((temp_f20 * temp_f20) + (temp_f22 * temp_f22)) * (16.0f / 4000.0f); if ((scenario == 5) || (scenario == 6) || (scenario == 7) || (scenario == 2) || (scenario == 3)) { diff --git a/src/game/ramromreplay.c b/src/game/ramromreplay.c index a302603a..17ee0857 100644 --- a/src/game/ramromreplay.c +++ b/src/game/ramromreplay.c @@ -6,9 +6,33 @@ #include "front.h" #include "ramromreplay.h" #include +#include +#include "file.h" +#include "file2.h" +#include +#include "joy.h" //D:800483F0 +struct ramrom_struct +{ + ramromfilestructure *fdata; + s32 locked; +}; +struct ramrom_blockbuf +{ + s8 stick_x; + s8 stick_y; + u8 button_low; + u8 button_high; +}; +struct ramrom_seed +{ + u8 speedframes; + u8 count; + u8 randseed; + u8 check; +}; //move me to better home extern u32* ramrom_Dam_1; @@ -26,18 +50,33 @@ extern u32* ramrom_Frigate_1; extern u32* ramrom_Frigate_2; extern u32* ramrom_Train; +extern u64 g_randomSeed; +extern u64 g_chrObjRandomSeed; + struct ramrom_struct ramrom_table[] = { - {&ramrom_Dam_1, 0}, {&ramrom_Dam_2, 0}, {&ramrom_Facility_1, 0}, {&ramrom_Facility_2, 0}, {&ramrom_Facility_3, 0}, - {&ramrom_Runway_1, 0}, {&ramrom_Runway_2, 0}, {&ramrom_BunkerI_1, 0}, {&ramrom_BunkerI_2, 0}, {&ramrom_Silo_1, 0}, - {&ramrom_Silo_2, 0}, {&ramrom_Frigate_1, 0}, {&ramrom_Frigate_2, 0}, {&ramrom_Train, 0}, {0,0} + {&ramrom_Dam_1, 0}, + {&ramrom_Dam_2, 0}, + {&ramrom_Facility_1, 0}, + {&ramrom_Facility_2, 0}, + {&ramrom_Facility_3, 0}, + {&ramrom_Runway_1, 0}, + {&ramrom_Runway_2, 0}, + {&ramrom_BunkerI_1, 0}, + {&ramrom_BunkerI_2, 0}, + {&ramrom_Silo_1, 0}, + {&ramrom_Silo_2, 0}, + {&ramrom_Frigate_1, 0}, + {&ramrom_Frigate_2, 0}, + {&ramrom_Train, 0}, + {0,0} }; //D:80048468 ramromfilestructure* ptr_active_demofile = 0; //D:8004846C -s32 ramrom_blkbuf_2 = 0; +struct ramrom_seed * ramrom_blkbuf_2 = NULL; //D:80048470 -s32 ramrom_blkbuf_3 = 0; +struct ramrom_blockbuf * ramrom_blkbuf_3 = NULL; //D:80048474 s32 is_ramrom_flag = 0; //D:80048478 @@ -57,9 +96,11 @@ s32 g_ramromRecordFlag = 0; - - - +void ensureCameraModeA(void); +s32 ramrom_replay_handler(struct contsample *arg0, s32 arg1); +void record_player_input_as_packet(struct contsample *arg0, s32 arg1, s32 arg2); +void copy_current_ingame_registers_before_ramrom_playback(ramromfilestructure *state); +void copy_recorded_ramrom_registers_to_proper_place_ingame(ramromfilestructure *state); void clear_ramrom_block_buffer_heading_ptrs(void) { @@ -83,164 +124,50 @@ s32 interface_menu0B_runstage(void) { return g_ramromPlayBackFlag; } -#ifdef NONMATCHING +// Address 0x7F0BFCB0 NTSC. void finalize_ramrom_on_hw(void) { - undefined *source; - undefined auStack25 [25]; - - source = (auStack25 | 0xf) ^ 0xf; - *source = 0; - source[1] = 0; - romWrite(source,address_demo_loaded,0x10); - address_demo_loaded = address_demo_loaded + 4; - ptr_active_demofile = romCopyAligned(&ramrom_data_target,0xf00000,0xf0); - ptr_active_demofile->totaltime_ms = g_GlobalTimer - g_ClockTimer; - ptr_active_demofile->filesize = address_demo_loaded - 0xf00000; - romWrite(ptr_active_demofile,0xf00000,0xf0); - return; -} -#else -GLOBAL_ASM( -.text -glabel finalize_ramrom_on_hw -/* 0F47E0 7F0BFCB0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0F47E4 7F0BFCB4 03A02025 */ move $a0, $sp -/* 0F47E8 7F0BFCB8 2484002F */ addiu $a0, $a0, 0x2f -/* 0F47EC 7F0BFCBC 348E000F */ ori $t6, $a0, 0xf -/* 0F47F0 7F0BFCC0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F47F4 7F0BFCC4 39C4000F */ xori $a0, $t6, 0xf -/* 0F47F8 7F0BFCC8 A0800000 */ sb $zero, ($a0) -/* 0F47FC 7F0BFCCC A0800001 */ sb $zero, 1($a0) -/* 0F4800 7F0BFCD0 3C058009 */ lui $a1, %hi(address_demo_loaded) -/* 0F4804 7F0BFCD4 8CA5C5F4 */ lw $a1, %lo(address_demo_loaded)($a1) -/* 0F4808 7F0BFCD8 0C001742 */ jal romWrite -/* 0F480C 7F0BFCDC 24060010 */ li $a2, 16 -/* 0F4810 7F0BFCE0 3C028009 */ lui $v0, %hi(address_demo_loaded) -/* 0F4814 7F0BFCE4 2442C5F4 */ addiu $v0, %lo(address_demo_loaded) # addiu $v0, $v0, -0x3a0c -/* 0F4818 7F0BFCE8 8C580000 */ lw $t8, ($v0) -/* 0F481C 7F0BFCEC 3C048009 */ lui $a0, %hi(ramrom_data_target) -/* 0F4820 7F0BFCF0 2484C270 */ addiu $a0, %lo(ramrom_data_target) # addiu $a0, $a0, -0x3d90 -/* 0F4824 7F0BFCF4 27190004 */ addiu $t9, $t8, 4 -/* 0F4828 7F0BFCF8 AC590000 */ sw $t9, ($v0) -/* 0F482C 7F0BFCFC 3C0500F0 */ lui $a1, 0xf0 -/* 0F4830 7F0BFD00 0C001711 */ jal romCopyAligned -/* 0F4834 7F0BFD04 240600F0 */ li $a2, 240 -/* 0F4838 7F0BFD08 3C038005 */ lui $v1, %hi(ptr_active_demofile) -/* 0F483C 7F0BFD0C 24638468 */ addiu $v1, %lo(ptr_active_demofile) # addiu $v1, $v1, -0x7b98 -/* 0F4840 7F0BFD10 AC620000 */ sw $v0, ($v1) -/* 0F4844 7F0BFD14 3C088005 */ lui $t0, %hi(g_GlobalTimer) -/* 0F4848 7F0BFD18 3C098005 */ lui $t1, %hi(g_ClockTimer) -/* 0F484C 7F0BFD1C 8D298374 */ lw $t1, %lo(g_ClockTimer)($t1) -/* 0F4850 7F0BFD20 8D08837C */ lw $t0, %lo(g_GlobalTimer)($t0) -/* 0F4854 7F0BFD24 3C0C8009 */ lui $t4, %hi(address_demo_loaded) -/* 0F4858 7F0BFD28 3C0500F0 */ lui $a1, 0xf0 -/* 0F485C 7F0BFD2C 01095023 */ subu $t2, $t0, $t1 -/* 0F4860 7F0BFD30 AC4A007C */ sw $t2, 0x7c($v0) -/* 0F4864 7F0BFD34 8D8CC5F4 */ lw $t4, %lo(address_demo_loaded)($t4) -/* 0F4868 7F0BFD38 8C6E0000 */ lw $t6, ($v1) -/* 0F486C 7F0BFD3C 240600F0 */ li $a2, 240 -/* 0F4870 7F0BFD40 01856823 */ subu $t5, $t4, $a1 -/* 0F4874 7F0BFD44 ADCD0080 */ sw $t5, 0x80($t6) -/* 0F4878 7F0BFD48 0C001742 */ jal romWrite -/* 0F487C 7F0BFD4C 8C640000 */ lw $a0, ($v1) -/* 0F4880 7F0BFD50 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F4884 7F0BFD54 27BD0048 */ addiu $sp, $sp, 0x48 -/* 0F4888 7F0BFD58 03E00008 */ jr $ra -/* 0F488C 7F0BFD5C 00000000 */ nop -) -#endif + u8 buffer[0x28]; + u8 *p; + void *a1; + p = ALIGN16_a((s32)buffer); + p[0] = 0; + p[1] = 0; + romWrite((void *) p, (void *) address_demo_loaded, 0x10U); + + address_demo_loaded += 4; + a1 = INDY_RAMROM_DEMO_POINTER; + ptr_active_demofile = romCopyAligned(ramrom_data_target, a1, 0xf0); + ptr_active_demofile->totaltime_ms = g_GlobalTimer - g_ClockTimer; + ptr_active_demofile->filesize = (s32)address_demo_loaded - (s32)a1; + romWrite(ptr_active_demofile, a1, 0xf0); +} -#ifdef NONMATCHING -/* - * just 2 lines swapped - * f48ac: addiu s2,s2,-0x48b0 | f48ac: li s0,1 - * f48b0: li s0,1 | f48b0: addiu s2,s2,-0x48b0 - * - */ + +// Address 0x7F0BFD60 NTSC. void save_ramrom_to_devtool(void) { - int i=1; + int i; char indyFileName [256]; u32 size; - while( TRUE ) { - sprintf(indyFileName,"replay/demo.%d",i); - if (!indycommHostCheckFileExists(indyFileName,&size)) break; - i++; + for (i = 1; ; i++) + { + sprintf(indyFileName, "replay/demo.%d", i); + + if (!indycommHostCheckFileExists(indyFileName, &size)) + { + break; + } } - sprintf(indyFileName,"replay/demo.%d",i); - indycommHostSaveFile(indyFileName,0xf00000,ptr_active_demofile->filesize); - return; + + sprintf(indyFileName, "replay/demo.%d", i); + indycommHostSaveFile(indyFileName, INDY_RAMROM_DEMO_POINTER, ptr_active_demofile->filesize); } -#else - -GLOBAL_ASM( -.rdata -#const char aReplayDemo_D[] = "replay/demo.%d"; -glabel aReplayDemo_D -.word 0x7265706c -.word 0x61792f64 -.word 0x656d6f2e -.word 0x25640000 - -#const char aReplayDemo_D_1[] = "replay/demo.%d"; -glabel aReplayDemo_D_1 -.word 0x7265706c -.word 0x61792f64 -.word 0x656d6f2e -.word 0x25640000 - -.text -glabel save_ramrom_to_devtool -/* 0F4890 7F0BFD60 27BDFED0 */ addiu $sp, $sp, -0x130 -/* 0F4894 7F0BFD64 AFB2001C */ sw $s2, 0x1c($sp) -/* 0F4898 7F0BFD68 AFB30020 */ sw $s3, 0x20($sp) -/* 0F489C 7F0BFD6C AFB10018 */ sw $s1, 0x18($sp) -/* 0F48A0 7F0BFD70 AFB00014 */ sw $s0, 0x14($sp) -/* 0F48A4 7F0BFD74 3C128006 */ lui $s2, %hi(aReplayDemo_D) -/* 0F48A8 7F0BFD78 AFBF0024 */ sw $ra, 0x24($sp) -/* 0F48AC 7F0BFD7C 2652B750 */ addiu $s2, %lo(aReplayDemo_D) # addiu $s2, $s2, -0x48b0 -/* 0F48B0 7F0BFD80 24100001 */ li $s0, 1 -/* 0F48B4 7F0BFD84 27B1002C */ addiu $s1, $sp, 0x2c -/* 0F48B8 7F0BFD88 27B30028 */ addiu $s3, $sp, 0x28 -.L7F0BFD8C: -/* 0F48BC 7F0BFD8C 02202025 */ move $a0, $s1 -/* 0F48C0 7F0BFD90 02402825 */ move $a1, $s2 -/* 0F48C4 7F0BFD94 0C002B25 */ jal sprintf -/* 0F48C8 7F0BFD98 02003025 */ move $a2, $s0 -/* 0F48CC 7F0BFD9C 02202025 */ move $a0, $s1 -/* 0F48D0 7F0BFDA0 0FC34026 */ jal indycommHostCheckFileExists -/* 0F48D4 7F0BFDA4 02602825 */ move $a1, $s3 -/* 0F48D8 7F0BFDA8 10400003 */ beqz $v0, .L7F0BFDB8 -/* 0F48DC 7F0BFDAC 00000000 */ nop -/* 0F48E0 7F0BFDB0 1000FFF6 */ b .L7F0BFD8C -/* 0F48E4 7F0BFDB4 26100001 */ addiu $s0, $s0, 1 -.L7F0BFDB8: -/* 0F48E8 7F0BFDB8 3C058006 */ lui $a1, %hi(aReplayDemo_D_1) -/* 0F48EC 7F0BFDBC 24A5B760 */ addiu $a1, %lo(aReplayDemo_D_1) # addiu $a1, $a1, -0x48a0 -/* 0F48F0 7F0BFDC0 02202025 */ move $a0, $s1 -/* 0F48F4 7F0BFDC4 0C002B25 */ jal sprintf -/* 0F48F8 7F0BFDC8 02003025 */ move $a2, $s0 -/* 0F48FC 7F0BFDCC 3C0E8005 */ lui $t6, %hi(ptr_active_demofile) -/* 0F4900 7F0BFDD0 8DCE8468 */ lw $t6, %lo(ptr_active_demofile)($t6) -/* 0F4904 7F0BFDD4 02202025 */ move $a0, $s1 -/* 0F4908 7F0BFDD8 3C0500F0 */ lui $a1, 0xf0 -/* 0F490C 7F0BFDDC 0FC34017 */ jal indycommHostSaveFile -/* 0F4910 7F0BFDE0 8DC60080 */ lw $a2, 0x80($t6) -/* 0F4914 7F0BFDE4 8FBF0024 */ lw $ra, 0x24($sp) -/* 0F4918 7F0BFDE8 8FB00014 */ lw $s0, 0x14($sp) -/* 0F491C 7F0BFDEC 8FB10018 */ lw $s1, 0x18($sp) -/* 0F4920 7F0BFDF0 8FB2001C */ lw $s2, 0x1c($sp) -/* 0F4924 7F0BFDF4 8FB30020 */ lw $s3, 0x20($sp) -/* 0F4928 7F0BFDF8 03E00008 */ jr $ra -/* 0F492C 7F0BFDFC 27BD0130 */ addiu $sp, $sp, 0x130 -) -#endif @@ -254,8 +181,8 @@ void load_ramrom_from_devtool(void) if (indycommHostCheckFileExists(&strDemoFileName, &size) != 0) { - indycommHostRamRomLoad(&strDemoFileName,(u8 *)INDY_RAMROM_DEMO_ADDRESS,size); - ptr_active_demofile = romCopyAligned(&ramrom_data_target,(u8 *)INDY_RAMROM_DEMO_ADDRESS,0xe8); + indycommHostRamRomLoad(&strDemoFileName, (u8 *)INDY_RAMROM_DEMO_ADDRESS, size); + ptr_active_demofile = romCopyAligned(&ramrom_data_target, (u8 *)INDY_RAMROM_DEMO_ADDRESS, sizeof(struct ramromfilestructure)); } } @@ -265,11 +192,78 @@ void load_ramrom_from_devtool(void) #ifdef NONMATCHING -void record_player_input_as_packet(void) { +// Address 0x7F0BFE5C NTSC +// +// https://decomp.me/scratch/RNdWO 93% +void record_player_input_as_packet(struct contsample *arg0, s32 arg1, s32 arg2) +{ + s32 temp_t5; + s32 temp_t1; + s32 var_a0; + s32 var_a2; + u8 var_a3; + s32 var_t2; + struct ramrom_blockbuf *temp_v0; + s32 temp_s0; + u8 t1; + s32 others0; + + temp_t5 = ALIGN16_a((s32)&ramrom_data_target[0x1f8]); + temp_t1 = ptr_active_demofile->size_cmds; + + var_t2 = 0; + var_a3 = 0; + + ramrom_blkbuf_2 = (struct ramrom_seed *)temp_t5; + ramrom_blkbuf_3 = (struct ramrom_blockbuf *)(ramrom_blkbuf_2 + 1); + + // loop structure based on: void joyConsumeSamples(struct contdata *contdata) + if (arg1 != arg2) + { + var_a2 = (s32) (arg1 + 1) % CONTSAMPLE_LEN; + while (1) + { + for (var_a0 = 0; var_a0 < temp_t1; var_a0++) + { + temp_v0 = ramrom_blkbuf_3 + (var_t2 * temp_t1) + var_a0; + + temp_v0->stick_x = arg0->pads[var_a2*4 + var_a0].stick_x; + temp_v0->stick_y = arg0->pads[var_a2*4 + var_a0].stick_y; + temp_v0->button_low = arg0->pads[var_a2*4 + var_a0].button; + temp_v0->button_high = arg0->pads[var_a2*4 + var_a0].button >> 8; + + var_a3 += (u8) ( + (u8)temp_v0->stick_x + + (u8)temp_v0->stick_y + + temp_v0->button_low + + temp_v0->button_high); + } + + var_t2++; + if (var_a2 == arg2) + { + break; + } + + var_a2 = (s32) (var_a2 + 1) % CONTSAMPLE_LEN; + } + } + + ramrom_blkbuf_2->count = var_t2; + ramrom_blkbuf_2->speedframes = speedgraphframes; + ramrom_blkbuf_2->randseed = g_randomSeed; + + var_a3 += (u8) ((u8)ramrom_blkbuf_2->speedframes + (u8)ramrom_blkbuf_2->count + ramrom_blkbuf_2->randseed); + ramrom_blkbuf_2->check = var_a3; + + temp_s0 = (temp_t1 * 4 * var_t2) + sizeof(s32); + + romWrite((void *) ramrom_blkbuf_2, address_demo_loaded, ALIGN16_a(temp_s0)); + + address_demo_loaded += align_addr_even(temp_s0 + 1); } #else -void record_player_input_as_packet(int param_1,int param_2,int param_3); GLOBAL_ASM( .text glabel record_player_input_as_packet @@ -424,306 +418,113 @@ glabel record_player_input_as_packet +// Address 0x7F0C0080 NTSC. +s32 ramrom_replay_handler(struct contsample *arg0, s32 arg1) +{ + s32 padding[2]; + s32 var_a3; + s32 var_a0; + struct ramrom_blockbuf *temp_v0; + u8 var_t0; + s32 temp_a2; + s32 temp_t2; + + var_t0 = 0; + temp_a2 = (s32) ptr_active_demofile->size_cmds; + temp_t2 = ramrom_blkbuf_2->count; + + for (var_a3 = 0; var_a3 < temp_t2; var_a3++) + { + arg1 = (s32) (arg1 + 1) % CONTSAMPLE_LEN; -#ifdef NONMATCHING -void ramrom_replay_handler(void) { + for (var_a0 = 0; var_a0 < MAXCONTROLLERS; var_a0++) + { + if (var_a0 < temp_a2) + { + temp_v0 = ramrom_blkbuf_3 + (var_a3 * temp_a2) + var_a0; + + arg0->pads[arg1 * 4 + var_a0].stick_x = temp_v0->stick_x; + arg0->pads[arg1 * 4 + var_a0].stick_y = temp_v0->stick_y; + arg0->pads[arg1 * 4 + var_a0].button = (temp_v0->button_high << 8) | temp_v0->button_low; + + var_t0 += (u8)((u8)temp_v0->stick_x + (u8)temp_v0->stick_y + temp_v0->button_low + temp_v0->button_high); + } + else + { + arg0->pads[arg1 * 4 + var_a0].stick_x = 0; + arg0->pads[arg1 * 4 + var_a0].stick_y = 0; + arg0->pads[arg1 * 4 + var_a0].button = 0; + } + } + } -} -#else -int ramrom_replay_handler(int param_1,int param_2); -GLOBAL_ASM( -.text -glabel ramrom_replay_handler -/* 0F4BB0 7F0C0080 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 0F4BB4 7F0C0084 3C028005 */ lui $v0, %hi(ramrom_blkbuf_2) -/* 0F4BB8 7F0C0088 8C42846C */ lw $v0, %lo(ramrom_blkbuf_2)($v0) -/* 0F4BBC 7F0C008C AFBF001C */ sw $ra, 0x1c($sp) -/* 0F4BC0 7F0C0090 AFB10018 */ sw $s1, 0x18($sp) -/* 0F4BC4 7F0C0094 AFB00014 */ sw $s0, 0x14($sp) -/* 0F4BC8 7F0C0098 904A0001 */ lbu $t2, 1($v0) -/* 0F4BCC 7F0C009C 3C0E8005 */ lui $t6, %hi(ptr_active_demofile) -/* 0F4BD0 7F0C00A0 8DCE8468 */ lw $t6, %lo(ptr_active_demofile)($t6) -/* 0F4BD4 7F0C00A4 00A08025 */ move $s0, $a1 -/* 0F4BD8 7F0C00A8 00808825 */ move $s1, $a0 -/* 0F4BDC 7F0C00AC 00004025 */ move $t0, $zero -/* 0F4BE0 7F0C00B0 00003825 */ move $a3, $zero -/* 0F4BE4 7F0C00B4 19400041 */ blez $t2, .L7F0C01BC -/* 0F4BE8 7F0C00B8 8DC60018 */ lw $a2, 0x18($t6) -/* 0F4BEC 7F0C00BC 3C058005 */ lui $a1, %hi(ramrom_blkbuf_3) -/* 0F4BF0 7F0C00C0 24A58470 */ addiu $a1, %lo(ramrom_blkbuf_3) # addiu $a1, $a1, -0x7b90 -/* 0F4BF4 7F0C00C4 240B0014 */ li $t3, 20 -/* 0F4BF8 7F0C00C8 24090004 */ li $t1, 4 -/* 0F4BFC 7F0C00CC 260F0001 */ addiu $t7, $s0, 1 -.L7F0C00D0: -/* 0F4C00 7F0C00D0 01EB001A */ div $zero, $t7, $t3 -/* 0F4C04 7F0C00D4 00008010 */ mfhi $s0 -/* 0F4C08 7F0C00D8 0010C080 */ sll $t8, $s0, 2 -/* 0F4C0C 7F0C00DC 0018C880 */ sll $t9, $t8, 2 -/* 0F4C10 7F0C00E0 0338C823 */ subu $t9, $t9, $t8 -/* 0F4C14 7F0C00E4 0019C840 */ sll $t9, $t9, 1 -/* 0F4C18 7F0C00E8 15600002 */ bnez $t3, .L7F0C00F4 -/* 0F4C1C 7F0C00EC 00000000 */ nop -/* 0F4C20 7F0C00F0 0007000D */ break 7 -.L7F0C00F4: -/* 0F4C24 7F0C00F4 2401FFFF */ li $at, -1 -/* 0F4C28 7F0C00F8 15610004 */ bne $t3, $at, .L7F0C010C -/* 0F4C2C 7F0C00FC 3C018000 */ lui $at, 0x8000 -/* 0F4C30 7F0C0100 15E10002 */ bne $t7, $at, .L7F0C010C -/* 0F4C34 7F0C0104 00000000 */ nop -/* 0F4C38 7F0C0108 0006000D */ break 6 -.L7F0C010C: -/* 0F4C3C 7F0C010C 02391821 */ addu $v1, $s1, $t9 -/* 0F4C40 7F0C0110 00002025 */ move $a0, $zero -.L7F0C0114: -/* 0F4C44 7F0C0114 0086082A */ slt $at, $a0, $a2 -/* 0F4C48 7F0C0118 5020001E */ beql $at, $zero, .L7F0C0194 -/* 0F4C4C 7F0C011C A0600002 */ sb $zero, 2($v1) -/* 0F4C50 7F0C0120 00E60019 */ multu $a3, $a2 -/* 0F4C54 7F0C0124 8CAE0000 */ lw $t6, ($a1) -/* 0F4C58 7F0C0128 0004C080 */ sll $t8, $a0, 2 -/* 0F4C5C 7F0C012C 00006012 */ mflo $t4 -/* 0F4C60 7F0C0130 000C6880 */ sll $t5, $t4, 2 -/* 0F4C64 7F0C0134 01AE7821 */ addu $t7, $t5, $t6 -/* 0F4C68 7F0C0138 01F81021 */ addu $v0, $t7, $t8 -/* 0F4C6C 7F0C013C 80590000 */ lb $t9, ($v0) -/* 0F4C70 7F0C0140 A0790002 */ sb $t9, 2($v1) -/* 0F4C74 7F0C0144 804C0001 */ lb $t4, 1($v0) -/* 0F4C78 7F0C0148 A06C0003 */ sb $t4, 3($v1) -/* 0F4C7C 7F0C014C 904D0003 */ lbu $t5, 3($v0) -/* 0F4C80 7F0C0150 904F0002 */ lbu $t7, 2($v0) -/* 0F4C84 7F0C0154 000D7200 */ sll $t6, $t5, 8 -/* 0F4C88 7F0C0158 01CFC025 */ or $t8, $t6, $t7 -/* 0F4C8C 7F0C015C A4780000 */ sh $t8, ($v1) -/* 0F4C90 7F0C0160 904C0001 */ lbu $t4, 1($v0) -/* 0F4C94 7F0C0164 90590000 */ lbu $t9, ($v0) -/* 0F4C98 7F0C0168 904E0002 */ lbu $t6, 2($v0) -/* 0F4C9C 7F0C016C 90580003 */ lbu $t8, 3($v0) -/* 0F4CA0 7F0C0170 032C6821 */ addu $t5, $t9, $t4 -/* 0F4CA4 7F0C0174 01AE7821 */ addu $t7, $t5, $t6 -/* 0F4CA8 7F0C0178 01F8C821 */ addu $t9, $t7, $t8 -/* 0F4CAC 7F0C017C 332C00FF */ andi $t4, $t9, 0xff -/* 0F4CB0 7F0C0180 010C4021 */ addu $t0, $t0, $t4 -/* 0F4CB4 7F0C0184 310D00FF */ andi $t5, $t0, 0xff -/* 0F4CB8 7F0C0188 10000004 */ b .L7F0C019C -/* 0F4CBC 7F0C018C 01A04025 */ move $t0, $t5 -/* 0F4CC0 7F0C0190 A0600002 */ sb $zero, 2($v1) -.L7F0C0194: -/* 0F4CC4 7F0C0194 A0600003 */ sb $zero, 3($v1) -/* 0F4CC8 7F0C0198 A4600000 */ sh $zero, ($v1) -.L7F0C019C: -/* 0F4CCC 7F0C019C 24840001 */ addiu $a0, $a0, 1 -/* 0F4CD0 7F0C01A0 1489FFDC */ bne $a0, $t1, .L7F0C0114 -/* 0F4CD4 7F0C01A4 24630006 */ addiu $v1, $v1, 6 -/* 0F4CD8 7F0C01A8 24E70001 */ addiu $a3, $a3, 1 -/* 0F4CDC 7F0C01AC 54EAFFC8 */ bnel $a3, $t2, .L7F0C00D0 -/* 0F4CE0 7F0C01B0 260F0001 */ addiu $t7, $s0, 1 -/* 0F4CE4 7F0C01B4 3C028005 */ lui $v0, %hi(ramrom_blkbuf_2) -/* 0F4CE8 7F0C01B8 8C42846C */ lw $v0, %lo(ramrom_blkbuf_2)($v0) -.L7F0C01BC: -/* 0F4CEC 7F0C01BC 3C0F8002 */ lui $t7, %hi(g_randomSeed + 0x4) -/* 0F4CF0 7F0C01C0 8DEF4464 */ lw $t7, %lo(g_randomSeed + 0x4)($t7) -/* 0F4CF4 7F0C01C4 90430002 */ lbu $v1, 2($v0) -/* 0F4CF8 7F0C01C8 31F900FF */ andi $t9, $t7, 0xff -/* 0F4CFC 7F0C01CC 53230008 */ beql $t9, $v1, .L7F0C01F0 -/* 0F4D00 7F0C01D0 904C0000 */ lbu $t4, ($v0) -/* 0F4D04 7F0C01D4 0FC30232 */ jal ensureCameraModeA -/* 0F4D08 7F0C01D8 A3A80023 */ sb $t0, 0x23($sp) -/* 0F4D0C 7F0C01DC 3C028005 */ lui $v0, %hi(ramrom_blkbuf_2) -/* 0F4D10 7F0C01E0 8C42846C */ lw $v0, %lo(ramrom_blkbuf_2)($v0) -/* 0F4D14 7F0C01E4 93A80023 */ lbu $t0, 0x23($sp) -/* 0F4D18 7F0C01E8 90430002 */ lbu $v1, 2($v0) -/* 0F4D1C 7F0C01EC 904C0000 */ lbu $t4, ($v0) -.L7F0C01F0: -/* 0F4D20 7F0C01F0 904D0001 */ lbu $t5, 1($v0) -/* 0F4D24 7F0C01F4 018D7021 */ addu $t6, $t4, $t5 -/* 0F4D28 7F0C01F8 904C0003 */ lbu $t4, 3($v0) -/* 0F4D2C 7F0C01FC 01C3C021 */ addu $t8, $t6, $v1 -/* 0F4D30 7F0C0200 01184021 */ addu $t0, $t0, $t8 -/* 0F4D34 7F0C0204 311900FF */ andi $t9, $t0, 0xff -/* 0F4D38 7F0C0208 132C0003 */ beq $t9, $t4, .L7F0C0218 -/* 0F4D3C 7F0C020C 00000000 */ nop -/* 0F4D40 7F0C0210 0FC30232 */ jal ensureCameraModeA -/* 0F4D44 7F0C0214 00000000 */ nop -.L7F0C0218: -/* 0F4D48 7F0C0218 0C00324C */ jal joySetContDataIndex -/* 0F4D4C 7F0C021C 00002025 */ move $a0, $zero -/* 0F4D50 7F0C0220 00002025 */ move $a0, $zero -/* 0F4D54 7F0C0224 0C0030EB */ jal joyGetButtonsPressedThisFrame -/* 0F4D58 7F0C0228 3405FFFF */ li $a1, 65535 -/* 0F4D5C 7F0C022C 10400006 */ beqz $v0, .L7F0C0248 -/* 0F4D60 7F0C0230 00000000 */ nop -/* 0F4D64 7F0C0234 0FC30232 */ jal ensureCameraModeA -/* 0F4D68 7F0C0238 00000000 */ nop -/* 0F4D6C 7F0C023C 240D0001 */ li $t5, 1 -/* 0F4D70 7F0C0240 3C018003 */ lui $at, %hi(prev_keypresses) -/* 0F4D74 7F0C0244 AC2DA934 */ sw $t5, %lo(prev_keypresses)($at) -.L7F0C0248: -/* 0F4D78 7F0C0248 0C00324C */ jal joySetContDataIndex -/* 0F4D7C 7F0C024C 24040001 */ li $a0, 1 -/* 0F4D80 7F0C0250 8FBF001C */ lw $ra, 0x1c($sp) -/* 0F4D84 7F0C0254 02001025 */ move $v0, $s0 -/* 0F4D88 7F0C0258 8FB00014 */ lw $s0, 0x14($sp) -/* 0F4D8C 7F0C025C 8FB10018 */ lw $s1, 0x18($sp) -/* 0F4D90 7F0C0260 03E00008 */ jr $ra -/* 0F4D94 7F0C0264 27BD0038 */ addiu $sp, $sp, 0x38 -) -#endif + if (ramrom_blkbuf_2->randseed != (u8)g_randomSeed) + { + ensureCameraModeA(); + } + var_t0 += (u8)((u8)ramrom_blkbuf_2->speedframes + (u8)ramrom_blkbuf_2->count + ramrom_blkbuf_2->randseed); + if (ramrom_blkbuf_2->check != var_t0) + { + ensureCameraModeA(); + } + + joySetContDataIndex(0); + + if (joyGetButtonsPressedThisFrame(0, 0xFFFFU) != 0) + { + ensureCameraModeA(); + prev_keypresses = 1; + } + + joySetContDataIndex(1); + return arg1; +} -#ifdef NONMATCHING -s32 iterate_ramrom_entries_handle_camera_out(void) { - ? temp_ret; - s32 temp_a3; +// Address 0x7F0C0268 NTSC. +void iterate_ramrom_entries_handle_camera_out(void) +{ s32 temp_v1; - s32 phi_a0; - void *phi_v1; - s32 phi_a3; - void *phi_v1_2; - s32 phi_return; - - // Node 0 - temp_ret = romCopyAligned(&ramrom_data_target + 0x1F8, address_demo_loaded, 4); - ramrom_blkbuf_2 = temp_ret; - temp_a3 = temp_ret->unk1; - phi_a0 = temp_a3; - phi_v1 = temp_ret; - phi_a3 = temp_a3; - if (temp_a3 > 0) + s32 var_a3; + + ramrom_blkbuf_2 = romCopyAligned(ramrom_data_target + 0x1F8, address_demo_loaded, sizeof(struct ramrom_seed)); + + var_a3 = ramrom_blkbuf_2->count; + if (var_a3 > 0) { - // Node 1 - ramrom_blkbuf_3 = romCopyAligned(&ramrom_data_target + 0x21E, (address_demo_loaded + 4), ((ptr_active_demofile->unk18 * 4) * temp_a3), temp_a3); - phi_a0 = ramrom_blkbuf_2->unk1; - phi_v1 = (void *) ramrom_blkbuf_2; - phi_a3 = ramrom_blkbuf_2->unk1; + ramrom_blkbuf_3 = romCopyAligned( + ramrom_data_target + 0x21E, + address_demo_loaded + 4, + ptr_active_demofile->size_cmds * sizeof(struct ramrom_blockbuf) * ramrom_blkbuf_2->count); } - // Node 2 - if ((phi_a0 == 0) && (*phi_v1 == 0)) + + var_a3 = ramrom_blkbuf_2->count; + if (var_a3 == 0 && ramrom_blkbuf_2->speedframes == 0) { - // Node 4 - ensureCameraModeA(phi_a0, phi_a3); - phi_v1_2 = (void *) ramrom_blkbuf_2; + ensureCameraModeA(); } else { - // Node 5 - address_demo_loaded = (s32) (address_demo_loaded + (((((ptr_active_demofile->unk18 * 4) * phi_a3) + 5) | 1) ^ 1)); - phi_v1_2 = phi_v1; + // 5 is ?? + address_demo_loaded += align_addr_even((ptr_active_demofile->size_cmds * sizeof(struct ramrom_blockbuf) * ramrom_blkbuf_2->count) + 5); } - // Node 6 - sub_GAME_7F0C0AA0(*phi_v1_2); - temp_v1 = (ptr_active_demofile->unk7C + -0x3c); - phi_return = g_GlobalTimer; - if (g_GlobalTimer >= temp_v1) + + sub_GAME_7F0C0AA0(ramrom_blkbuf_2->speedframes); + + // BUG? Does this need to be adjusted for PAL? + temp_v1 = ptr_active_demofile->totaltime_ms - 0x3C; + if(0); + if ((g_GlobalTimer >= temp_v1) && ((g_GlobalTimer - g_ClockTimer) < temp_v1)) { - // Node 7 - phi_return = g_GlobalTimer; - if ((g_GlobalTimer - g_ClockTimer) < temp_v1) - { - // Node 8 - phi_return = ensureCameraModeA(); - } + ensureCameraModeA(); } - // Node 9 - return phi_return; } -#else -GLOBAL_ASM( -.text -glabel iterate_ramrom_entries_handle_camera_out -/* 0F4D98 7F0C0268 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0F4D9C 7F0C026C AFBF0014 */ sw $ra, 0x14($sp) -/* 0F4DA0 7F0C0270 3C048009 */ lui $a0, %hi(ramrom_data_target + 0x1F8) -/* 0F4DA4 7F0C0274 3C058009 */ lui $a1, %hi(address_demo_loaded) -/* 0F4DA8 7F0C0278 8CA5C5F4 */ lw $a1, %lo(address_demo_loaded)($a1) -/* 0F4DAC 7F0C027C 2484C468 */ addiu $a0, %lo(ramrom_data_target + 0x1F8) # addiu $a0, $a0, -0x3b98 -/* 0F4DB0 7F0C0280 0C001711 */ jal romCopyAligned -/* 0F4DB4 7F0C0284 24060004 */ li $a2, 4 -/* 0F4DB8 7F0C0288 3C058005 */ lui $a1, %hi(ramrom_blkbuf_2) -/* 0F4DBC 7F0C028C 24A5846C */ addiu $a1, %lo(ramrom_blkbuf_2) # addiu $a1, $a1, -0x7b94 -/* 0F4DC0 7F0C0290 ACA20000 */ sw $v0, ($a1) -/* 0F4DC4 7F0C0294 90470001 */ lbu $a3, 1($v0) -/* 0F4DC8 7F0C0298 00401825 */ move $v1, $v0 -/* 0F4DCC 7F0C029C 3C0E8005 */ lui $t6, %hi(ptr_active_demofile) -/* 0F4DD0 7F0C02A0 18E00013 */ blez $a3, .L7F0C02F0 -/* 0F4DD4 7F0C02A4 00E02025 */ move $a0, $a3 -/* 0F4DD8 7F0C02A8 8DCE8468 */ lw $t6, %lo(ptr_active_demofile)($t6) -/* 0F4DDC 7F0C02AC 3C058009 */ lui $a1, %hi(address_demo_loaded) -/* 0F4DE0 7F0C02B0 8CA5C5F4 */ lw $a1, %lo(address_demo_loaded)($a1) -/* 0F4DE4 7F0C02B4 8DCF0018 */ lw $t7, 0x18($t6) -/* 0F4DE8 7F0C02B8 3C048009 */ lui $a0, %hi(ramrom_data_target + 0x21E) -/* 0F4DEC 7F0C02BC 2484C48E */ addiu $a0, %lo(ramrom_data_target + 0x21E) # addiu $a0, $a0, -0x3b72 -/* 0F4DF0 7F0C02C0 000FC080 */ sll $t8, $t7, 2 -/* 0F4DF4 7F0C02C4 03070019 */ multu $t8, $a3 -/* 0F4DF8 7F0C02C8 24A50004 */ addiu $a1, $a1, 4 -/* 0F4DFC 7F0C02CC 00003012 */ mflo $a2 -/* 0F4E00 7F0C02D0 0C001711 */ jal romCopyAligned -/* 0F4E04 7F0C02D4 00000000 */ nop -/* 0F4E08 7F0C02D8 3C038005 */ lui $v1, %hi(ramrom_blkbuf_2) -/* 0F4E0C 7F0C02DC 8C63846C */ lw $v1, %lo(ramrom_blkbuf_2)($v1) -/* 0F4E10 7F0C02E0 3C018005 */ lui $at, %hi(ramrom_blkbuf_3) -/* 0F4E14 7F0C02E4 AC228470 */ sw $v0, %lo(ramrom_blkbuf_3)($at) -/* 0F4E18 7F0C02E8 90670001 */ lbu $a3, 1($v1) -/* 0F4E1C 7F0C02EC 00E02025 */ move $a0, $a3 -.L7F0C02F0: -/* 0F4E20 7F0C02F0 14800009 */ bnez $a0, .L7F0C0318 -/* 0F4E24 7F0C02F4 3C098005 */ lui $t1, %hi(ptr_active_demofile) -/* 0F4E28 7F0C02F8 90790000 */ lbu $t9, ($v1) -/* 0F4E2C 7F0C02FC 17200006 */ bnez $t9, .L7F0C0318 -/* 0F4E30 7F0C0300 00000000 */ nop -/* 0F4E34 7F0C0304 0FC30232 */ jal ensureCameraModeA -/* 0F4E38 7F0C0308 00000000 */ nop -/* 0F4E3C 7F0C030C 3C038005 */ lui $v1, %hi(ramrom_blkbuf_2) -/* 0F4E40 7F0C0310 1000000E */ b .L7F0C034C -/* 0F4E44 7F0C0314 8C63846C */ lw $v1, %lo(ramrom_blkbuf_2)($v1) -.L7F0C0318: -/* 0F4E48 7F0C0318 8D298468 */ lw $t1, %lo(ptr_active_demofile)($t1) -/* 0F4E4C 7F0C031C 3C088009 */ lui $t0, %hi(address_demo_loaded) -/* 0F4E50 7F0C0320 8D08C5F4 */ lw $t0, %lo(address_demo_loaded)($t0) -/* 0F4E54 7F0C0324 8D2A0018 */ lw $t2, 0x18($t1) -/* 0F4E58 7F0C0328 3C018009 */ lui $at, %hi(address_demo_loaded) -/* 0F4E5C 7F0C032C 000A5880 */ sll $t3, $t2, 2 -/* 0F4E60 7F0C0330 01670019 */ multu $t3, $a3 -/* 0F4E64 7F0C0334 00006012 */ mflo $t4 -/* 0F4E68 7F0C0338 258D0005 */ addiu $t5, $t4, 5 -/* 0F4E6C 7F0C033C 35AE0001 */ ori $t6, $t5, 1 -/* 0F4E70 7F0C0340 39CF0001 */ xori $t7, $t6, 1 -/* 0F4E74 7F0C0344 010FC021 */ addu $t8, $t0, $t7 -/* 0F4E78 7F0C0348 AC38C5F4 */ sw $t8, %lo(address_demo_loaded)($at) -.L7F0C034C: -/* 0F4E7C 7F0C034C 0FC302A8 */ jal sub_GAME_7F0C0AA0 -/* 0F4E80 7F0C0350 90640000 */ lbu $a0, ($v1) -/* 0F4E84 7F0C0354 3C198005 */ lui $t9, %hi(ptr_active_demofile) -/* 0F4E88 7F0C0358 8F398468 */ lw $t9, %lo(ptr_active_demofile)($t9) -/* 0F4E8C 7F0C035C 3C028005 */ lui $v0, %hi(g_GlobalTimer) -/* 0F4E90 7F0C0360 8C42837C */ lw $v0, %lo(g_GlobalTimer)($v0) -/* 0F4E94 7F0C0364 8F23007C */ lw $v1, 0x7c($t9) -/* 0F4E98 7F0C0368 3C098005 */ lui $t1, %hi(g_ClockTimer) -/* 0F4E9C 7F0C036C 2463FFC4 */ addiu $v1, $v1, -0x3c -/* 0F4EA0 7F0C0370 0043082A */ slt $at, $v0, $v1 -/* 0F4EA4 7F0C0374 54200009 */ bnezl $at, .L7F0C039C -/* 0F4EA8 7F0C0378 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F4EAC 7F0C037C 8D298374 */ lw $t1, %lo(g_ClockTimer)($t1) -/* 0F4EB0 7F0C0380 00495023 */ subu $t2, $v0, $t1 -/* 0F4EB4 7F0C0384 0143082A */ slt $at, $t2, $v1 -/* 0F4EB8 7F0C0388 50200004 */ beql $at, $zero, .L7F0C039C -/* 0F4EBC 7F0C038C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F4EC0 7F0C0390 0FC30232 */ jal ensureCameraModeA -/* 0F4EC4 7F0C0394 00000000 */ nop -/* 0F4EC8 7F0C0398 8FBF0014 */ lw $ra, 0x14($sp) -.L7F0C039C: -/* 0F4ECC 7F0C039C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0F4ED0 7F0C03A0 03E00008 */ jr $ra -/* 0F4ED4 7F0C03A4 00000000 */ nop -) -#endif - -extern u64 g_randomSeed; -extern u64 g_chrObjRandomSeed; -void copy_current_ingame_registers_before_ramrom_playback(ramromfilestructure *state) { +void copy_current_ingame_registers_before_ramrom_playback(ramromfilestructure *state) +{ state->randomseed = g_randomSeed; state->randomizer = g_chrObjRandomSeed; state->mode = gamemode; @@ -751,7 +552,8 @@ void copy_current_ingame_registers_before_ramrom_playback(ramromfilestructure *s state->mp_flags[3] = get_players_team_or_scenario_item_flag(3); } -void copy_recorded_ramrom_registers_to_proper_place_ingame(ramromfilestructure *state) { +void copy_recorded_ramrom_registers_to_proper_place_ingame(ramromfilestructure *state) +{ g_randomSeed = state->randomseed; g_chrObjRandomSeed = state->randomizer; gamemode = state->mode; @@ -779,149 +581,45 @@ void copy_recorded_ramrom_registers_to_proper_place_ingame(ramromfilestructure * set_players_team_or_scenario_item_flag(3, state->mp_flags[3]); } -#define ALIGN16_a(val) (((val) + 0xf | 0xf) ^ 0xf) -#ifdef NONMATCHING -//uses v1 instead of v0 for address_demo_loaded -void test_if_recording_demos_this_stage_load(s32 levelid, s32 difficulty) +// Address 0x7F0C0640 NTSC +void test_if_recording_demos_this_stage_load(enum LEVELID arg0, enum DIFFICULTY arg1) { if (g_ramromRecordFlag != 0) { - ptr_active_demofile = (ramromfilestructure*) ALIGN16_a((s32)ramrom_data_target); + ptr_active_demofile = (ramromfilestructure *) ALIGN16_a((s32)ramrom_data_target); dword_CODE_bss_8008C5F8 = 0; - ptr_active_demofile->stagenum = levelid; - ptr_active_demofile->difficulty = difficulty; + ptr_active_demofile->stagenum = arg0; + ptr_active_demofile->difficulty = arg1; ptr_active_demofile->size_cmds = joyGetControllerCount(); ptr_active_demofile->slotnum = record_slot_num; sub_GAME_7F01D61C(&ptr_active_demofile->savefile); copy_current_ingame_registers_before_ramrom_playback(ptr_active_demofile); recording_ramrom_flag = 1; ramrom_demo_related_6 = 1; - joySetRecordFunc(&record_player_input_as_packet); - address_demo_loaded = INDY_RAMROM_DEMO_ADDRESS; - romWrite(ptr_active_demofile, address_demo_loaded, 0xF0); - address_demo_loaded += 0xE8; + joySetRecordFunc(record_player_input_as_packet); + address_demo_loaded = INDY_RAMROM_DEMO_POINTER; + romWrite(ptr_active_demofile, address_demo_loaded, 0xF0U); + address_demo_loaded += sizeof(struct ramromfilestructure); g_ramromRecordFlag = 0; + return; } + if (g_ramromPlayBackFlag != 0) { dword_CODE_bss_8008C5F8 = 0; set_selected_difficulty(ptr_active_demofile->difficulty); set_solo_and_ptr_briefing(ptr_active_demofile->stagenum); set_selected_foldernum_and_copy_demo_eeprom(&ptr_active_demofile->savefile); - copy_current_ingame_registers_before_ramrom_playback(ramrom_data_target + 0x110); + copy_current_ingame_registers_before_ramrom_playback((ramromfilestructure *) (ramrom_data_target + 0x110)); copy_recorded_ramrom_registers_to_proper_place_ingame(ptr_active_demofile); is_ramrom_flag = 1; ramrom_demo_related_3 = 1; - joySetPlaybackFunc(&ramrom_replay_handler, ptr_active_demofile->size_cmds); + joySetPlaybackFunc(ramrom_replay_handler, ptr_active_demofile->size_cmds); joySetContDataIndex(1); g_ramromPlayBackFlag = 0; } } -#else -GLOBAL_ASM( -.text -glabel test_if_recording_demos_this_stage_load -/* 0F5170 7F0C0640 3C0E8005 */ lui $t6, %hi(g_ramromRecordFlag) -/* 0F5174 7F0C0644 8DCE8488 */ lw $t6, %lo(g_ramromRecordFlag)($t6) -/* 0F5178 7F0C0648 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0F517C 7F0C064C AFBF001C */ sw $ra, 0x1c($sp) -/* 0F5180 7F0C0650 11C00032 */ beqz $t6, .L7F0C071C -/* 0F5184 7F0C0654 AFB00018 */ sw $s0, 0x18($sp) -/* 0F5188 7F0C0658 3C0F8009 */ lui $t7, %hi(ramrom_data_target) -/* 0F518C 7F0C065C 25EFC270 */ addiu $t7, %lo(ramrom_data_target) # addiu $t7, $t7, -0x3d90 -/* 0F5190 7F0C0660 25F8000F */ addiu $t8, $t7, 0xf -/* 0F5194 7F0C0664 3C108005 */ lui $s0, %hi(ptr_active_demofile) -/* 0F5198 7F0C0668 3719000F */ ori $t9, $t8, 0xf -/* 0F519C 7F0C066C 26108468 */ addiu $s0, %lo(ptr_active_demofile) # addiu $s0, $s0, -0x7b98 -/* 0F51A0 7F0C0670 3B28000F */ xori $t0, $t9, 0xf -/* 0F51A4 7F0C0674 AE080000 */ sw $t0, ($s0) -/* 0F51A8 7F0C0678 3C018009 */ lui $at, %hi(dword_CODE_bss_8008C5F8) -/* 0F51AC 7F0C067C AC20C5F8 */ sw $zero, %lo(dword_CODE_bss_8008C5F8)($at) -/* 0F51B0 7F0C0680 8E090000 */ lw $t1, ($s0) -/* 0F51B4 7F0C0684 AD240010 */ sw $a0, 0x10($t1) -/* 0F51B8 7F0C0688 8E0A0000 */ lw $t2, ($s0) -/* 0F51BC 7F0C068C 0C002E7E */ jal joyGetControllerCount -/* 0F51C0 7F0C0690 AD450014 */ sw $a1, 0x14($t2) -/* 0F51C4 7F0C0694 8E0B0000 */ lw $t3, ($s0) -/* 0F51C8 7F0C0698 3C0C8009 */ lui $t4, %hi(record_slot_num) -/* 0F51CC 7F0C069C AD620018 */ sw $v0, 0x18($t3) -/* 0F51D0 7F0C06A0 8E0D0000 */ lw $t5, ($s0) -/* 0F51D4 7F0C06A4 8D8CC5F0 */ lw $t4, %lo(record_slot_num)($t4) -/* 0F51D8 7F0C06A8 ADAC0088 */ sw $t4, 0x88($t5) -/* 0F51DC 7F0C06AC 8E040000 */ lw $a0, ($s0) -/* 0F51E0 7F0C06B0 0FC07587 */ jal sub_GAME_7F01D61C -/* 0F51E4 7F0C06B4 2484001C */ addiu $a0, $a0, 0x1c -/* 0F51E8 7F0C06B8 0FC300EA */ jal copy_current_ingame_registers_before_ramrom_playback -/* 0F51EC 7F0C06BC 8E040000 */ lw $a0, ($s0) -/* 0F51F0 7F0C06C0 24020001 */ li $v0, 1 -/* 0F51F4 7F0C06C4 3C018005 */ lui $at, %hi(recording_ramrom_flag) -/* 0F51F8 7F0C06C8 AC228480 */ sw $v0, %lo(recording_ramrom_flag)($at) -/* 0F51FC 7F0C06CC 3C018005 */ lui $at, %hi(ramrom_demo_related_6) -/* 0F5200 7F0C06D0 3C047F0C */ lui $a0, %hi(record_player_input_as_packet) # $a0, 0x7f0c -/* 0F5204 7F0C06D4 AC228484 */ sw $v0, %lo(ramrom_demo_related_6)($at) -/* 0F5208 7F0C06D8 0C002EEF */ jal joySetRecordFunc -/* 0F520C 7F0C06DC 2484FE5C */ addiu $a0, %lo(record_player_input_as_packet) # addiu $a0, $a0, -0x1a4 -/* 0F5210 7F0C06E0 3C028009 */ lui $v0, %hi(address_demo_loaded) -/* 0F5214 7F0C06E4 2442C5F4 */ addiu $v0, %lo(address_demo_loaded) # addiu $v0, $v0, -0x3a0c -/* 0F5218 7F0C06E8 3C0500F0 */ lui $a1, 0xf0 -/* 0F521C 7F0C06EC AC450000 */ sw $a1, ($v0) -/* 0F5220 7F0C06F0 8E040000 */ lw $a0, ($s0) -/* 0F5224 7F0C06F4 0C001742 */ jal romWrite -/* 0F5228 7F0C06F8 240600F0 */ li $a2, 240 -/* 0F522C 7F0C06FC 3C028009 */ lui $v0, %hi(address_demo_loaded) -/* 0F5230 7F0C0700 2442C5F4 */ addiu $v0, %lo(address_demo_loaded) # addiu $v0, $v0, -0x3a0c -/* 0F5234 7F0C0704 8C4F0000 */ lw $t7, ($v0) -/* 0F5238 7F0C0708 3C018005 */ lui $at, %hi(g_ramromRecordFlag) -/* 0F523C 7F0C070C 25F800E8 */ addiu $t8, $t7, 0xe8 -/* 0F5240 7F0C0710 AC580000 */ sw $t8, ($v0) -/* 0F5244 7F0C0714 10000024 */ b .L7F0C07A8 -/* 0F5248 7F0C0718 AC208488 */ sw $zero, %lo(g_ramromRecordFlag)($at) -.L7F0C071C: -/* 0F524C 7F0C071C 3C198005 */ lui $t9, %hi(g_ramromPlayBackFlag) -/* 0F5250 7F0C0720 8F39847C */ lw $t9, %lo(g_ramromPlayBackFlag)($t9) -/* 0F5254 7F0C0724 13200020 */ beqz $t9, .L7F0C07A8 -/* 0F5258 7F0C0728 3C108005 */ lui $s0, %hi(ptr_active_demofile) -/* 0F525C 7F0C072C 3C018009 */ lui $at, %hi(dword_CODE_bss_8008C5F8) -/* 0F5260 7F0C0730 26108468 */ addiu $s0, %lo(ptr_active_demofile) # addiu $s0, $s0, -0x7b98 -/* 0F5264 7F0C0734 AC20C5F8 */ sw $zero, %lo(dword_CODE_bss_8008C5F8)($at) -/* 0F5268 7F0C0738 8E080000 */ lw $t0, ($s0) -/* 0F526C 7F0C073C 0FC07567 */ jal set_selected_difficulty -/* 0F5270 7F0C0740 8D040014 */ lw $a0, 0x14($t0) -/* 0F5274 7F0C0744 8E090000 */ lw $t1, ($s0) -/* 0F5278 7F0C0748 0FC0757B */ jal set_solo_and_ptr_briefing -/* 0F527C 7F0C074C 8D240010 */ lw $a0, 0x10($t1) -/* 0F5280 7F0C0750 8E040000 */ lw $a0, ($s0) -/* 0F5284 7F0C0754 0FC07591 */ jal set_selected_foldernum_and_copy_demo_eeprom -/* 0F5288 7F0C0758 2484001C */ addiu $a0, $a0, 0x1c -/* 0F528C 7F0C075C 3C048009 */ lui $a0, %hi(ramrom_data_target + 0x110) -/* 0F5290 7F0C0760 0FC300EA */ jal copy_current_ingame_registers_before_ramrom_playback -/* 0F5294 7F0C0764 2484C380 */ addiu $a0, %lo(ramrom_data_target + 0x110) # addiu $a0, $a0, -0x3c80 -/* 0F5298 7F0C0768 0FC3013D */ jal copy_recorded_ramrom_registers_to_proper_place_ingame -/* 0F529C 7F0C076C 8E040000 */ lw $a0, ($s0) -/* 0F52A0 7F0C0770 24020001 */ li $v0, 1 -/* 0F52A4 7F0C0774 3C018005 */ lui $at, %hi(is_ramrom_flag) -/* 0F52A8 7F0C0778 AC228474 */ sw $v0, %lo(is_ramrom_flag)($at) -/* 0F52AC 7F0C077C 3C018005 */ lui $at, %hi(ramrom_demo_related_3) -/* 0F52B0 7F0C0780 AC228478 */ sw $v0, %lo(ramrom_demo_related_3)($at) -/* 0F52B4 7F0C0784 8E0A0000 */ lw $t2, ($s0) -/* 0F52B8 7F0C0788 3C047F0C */ lui $a0, %hi(ramrom_replay_handler) # $a0, 0x7f0c -/* 0F52BC 7F0C078C 24840080 */ addiu $a0, %lo(ramrom_replay_handler) # addiu $a0, $a0, 0x80 -/* 0F52C0 7F0C0790 0C002EEA */ jal joySetPlaybackFunc -/* 0F52C4 7F0C0794 8D450018 */ lw $a1, 0x18($t2) -/* 0F52C8 7F0C0798 0C00324C */ jal joySetContDataIndex -/* 0F52CC 7F0C079C 24040001 */ li $a0, 1 -/* 0F52D0 7F0C07A0 3C018005 */ lui $at, %hi(g_ramromPlayBackFlag) -/* 0F52D4 7F0C07A4 AC20847C */ sw $zero, %lo(g_ramromPlayBackFlag)($at) -.L7F0C07A8: -/* 0F52D8 7F0C07A8 8FBF001C */ lw $ra, 0x1c($sp) -/* 0F52DC 7F0C07AC 8FB00018 */ lw $s0, 0x18($sp) -/* 0F52E0 7F0C07B0 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0F52E4 7F0C07B4 03E00008 */ jr $ra -/* 0F52E8 7F0C07B8 00000000 */ nop -) -#endif - @@ -947,12 +645,12 @@ void stop_recording_ramrom(void) void replay_recorded_ramrom_at_address(ramromfilestructure *demofile) { address_demo_loaded = demofile; - ptr_active_demofile = romCopyAligned(&ramrom_data_target,address_demo_loaded,0xe8); + ptr_active_demofile = romCopyAligned(&ramrom_data_target, address_demo_loaded, sizeof(struct ramromfilestructure)); address_demo_loaded += sizeof(ramromfilestructure); g_ramromPlayBackFlag = 1; set_solo_and_ptr_briefing(ptr_active_demofile->stagenum); set_selected_difficulty(ptr_active_demofile->difficulty); - set_menu_to_mode(MENU_RUN_STAGE,1); + frontChangeMenu(MENU_RUN_STAGE,1); } void replay_recorded_ramrom_from_indy(void) @@ -987,72 +685,19 @@ void stop_demo_playback(void) - -#ifdef NONMATCHING +// Address 0x7F0C0970 NTSC. void select_ramrom_to_play(void) { - u32 i=0; + s32 i; + s32 temp_v0; - while((ramrom_table[i].address != 0) && ( fileGetHighestStageUnlockedAnyFolder() >= ramrom_table[i].locked )) - { - i++; - } + temp_v0 = fileGetHighestStageUnlockedAnyFolder(); - replay_recorded_ramrom_at_address(ramrom_table[randomGetNext() % i].address); + for (i = 0; ramrom_table[i].fdata != NULL && temp_v0 >= ramrom_table[i].locked; i++) + {} + + replay_recorded_ramrom_at_address(ramrom_table[randomGetNext() % i].fdata); } -#else -GLOBAL_ASM( -.text -glabel select_ramrom_to_play -/* 0F54A0 7F0C0970 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0F54A4 7F0C0974 AFBF0014 */ sw $ra, 0x14($sp) -/* 0F54A8 7F0C0978 0FC07A66 */ jal fileGetHighestStageUnlockedAnyFolder -/* 0F54AC 7F0C097C 00000000 */ nop -/* 0F54B0 7F0C0980 3C0E8005 */ lui $t6, %hi(ramrom_table) -/* 0F54B4 7F0C0984 8DCE83F0 */ lw $t6, %lo(ramrom_table)($t6) -/* 0F54B8 7F0C0988 00402025 */ move $a0, $v0 -/* 0F54BC 7F0C098C 00001825 */ move $v1, $zero -/* 0F54C0 7F0C0990 11C00011 */ beqz $t6, .L7F0C09D8 -/* 0F54C4 7F0C0994 3C0F8005 */ lui $t7, %hi(ramrom_table + 0x4) -/* 0F54C8 7F0C0998 8DEF83F4 */ lw $t7, %lo(ramrom_table + 0x4)($t7) -/* 0F54CC 7F0C099C 3C198005 */ lui $t9, %hi(ramrom_table) -/* 0F54D0 7F0C09A0 273983F0 */ addiu $t9, %lo(ramrom_table) # addiu $t9, $t9, -0x7c10 -/* 0F54D4 7F0C09A4 004F082A */ slt $at, $v0, $t7 -/* 0F54D8 7F0C09A8 1420000B */ bnez $at, .L7F0C09D8 -/* 0F54DC 7F0C09AC 0003C0C0 */ sll $t8, $v1, 3 -/* 0F54E0 7F0C09B0 03191021 */ addu $v0, $t8, $t9 -/* 0F54E4 7F0C09B4 8C480008 */ lw $t0, 8($v0) -.L7F0C09B8: -/* 0F54E8 7F0C09B8 24630001 */ addiu $v1, $v1, 1 -/* 0F54EC 7F0C09BC 24420008 */ addiu $v0, $v0, 8 -/* 0F54F0 7F0C09C0 11000005 */ beqz $t0, .L7F0C09D8 -/* 0F54F4 7F0C09C4 00000000 */ nop -/* 0F54F8 7F0C09C8 8C490004 */ lw $t1, 4($v0) -/* 0F54FC 7F0C09CC 0089082A */ slt $at, $a0, $t1 -/* 0F5500 7F0C09D0 5020FFF9 */ beql $at, $zero, .L7F0C09B8 -/* 0F5504 7F0C09D4 8C480008 */ lw $t0, 8($v0) -.L7F0C09D8: -/* 0F5508 7F0C09D8 0C002914 */ jal randomGetNext -/* 0F550C 7F0C09DC AFA3001C */ sw $v1, 0x1c($sp) -/* 0F5510 7F0C09E0 8FA3001C */ lw $v1, 0x1c($sp) -/* 0F5514 7F0C09E4 3C048005 */ lui $a0, %hi(ramrom_table) -/* 0F5518 7F0C09E8 0043001B */ divu $zero, $v0, $v1 -/* 0F551C 7F0C09EC 00005010 */ mfhi $t2 -/* 0F5520 7F0C09F0 000A58C0 */ sll $t3, $t2, 3 -/* 0F5524 7F0C09F4 008B2021 */ addu $a0, $a0, $t3 -/* 0F5528 7F0C09F8 14600002 */ bnez $v1, .L7F0C0A04 -/* 0F552C 7F0C09FC 00000000 */ nop -/* 0F5530 7F0C0A00 0007000D */ break 7 -.L7F0C0A04: -/* 0F5534 7F0C0A04 8C8483F0 */ lw $a0, %lo(ramrom_table)($a0) -/* 0F5538 7F0C0A08 0FC30207 */ jal replay_recorded_ramrom_at_address -/* 0F553C 7F0C0A0C 00000000 */ nop -/* 0F5540 7F0C0A10 8FBF0014 */ lw $ra, 0x14($sp) -/* 0F5544 7F0C0A14 27BD0020 */ addiu $sp, $sp, 0x20 -/* 0F5548 7F0C0A18 03E00008 */ jr $ra -/* 0F554C 7F0C0A1C 00000000 */ nop -) -#endif diff --git a/src/game/ramromreplay.h b/src/game/ramromreplay.h index d47806f9..38c24169 100644 --- a/src/game/ramromreplay.h +++ b/src/game/ramromreplay.h @@ -3,7 +3,10 @@ #include #include "file.h" +#include "bondconstants.h" + #define INDY_RAMROM_DEMO_ADDRESS 0x00F00000 +#define INDY_RAMROM_DEMO_POINTER ((void*)INDY_RAMROM_DEMO_ADDRESS) typedef struct ramromfilestructure { u64 randomseed; @@ -12,8 +15,8 @@ typedef struct ramromfilestructure { enum DIFFICULTY difficulty; u32 size_cmds; save_data savefile; - f32 totaltime_ms; - u32 filesize; + s32 totaltime_ms; + s32 filesize; enum GAMEMODE mode; u32 slotnum; u32 numplayers; @@ -28,8 +31,8 @@ typedef struct ramromfilestructure { u32 mp_flags[4]; } ramromfilestructure; -void test_if_recording_demos_this_stage_load(s32 arg0, s32 arg1); -s32 iterate_ramrom_entries_handle_camera_out(void); +void test_if_recording_demos_this_stage_load(enum LEVELID arg0, enum DIFFICULTY arg1); +void iterate_ramrom_entries_handle_camera_out(void); void stop_demo_playback(void); s32 get_is_reamrom_flag(void); u32 check_ramrom_flags(void); diff --git a/src/game/rsp.c b/src/game/rsp.c index 4694c42f..75d462dd 100644 --- a/src/game/rsp.c +++ b/src/game/rsp.c @@ -208,7 +208,7 @@ extern long long int rspbootTextEnd[]; extern long long int gsp3DTextStart[]; extern long long int gsp3DDataStart[]; -void rspInitDebugNoticeList(void) +void rspInit(void) { debTryAdd(&g_gfxDebugEntryData, "rsp_c_debug"); } diff --git a/src/game/rsp.h b/src/game/rsp.h index 3fcc87bc..ade90d99 100644 --- a/src/game/rsp.h +++ b/src/game/rsp.h @@ -18,7 +18,7 @@ struct GfxInfo_s { u32 unk5C; }; -void rspInitDebugNoticeList(void); +void rspInit(void); void rspAllocateBuffers(void); void rspGfxTaskStart(Gfx *firstGdl, Gfx *gdl, s32 arg2, OSMesg rspReplyMsg); diff --git a/src/game/spectrum.c b/src/game/spectrum.c index 91283ed5..cca55885 100644 --- a/src/game/spectrum.c +++ b/src/game/spectrum.c @@ -101,9 +101,144 @@ u8 spec_OUT_port[] = #ifdef NONMATCHING -void sub_GAME_7F0D28E0(void) { +// https://decomp.me/scratch/lXRos 89.33% + +struct spec_struct { + u32 D_8004EC40; + s16 D_8004EC44[96]; + u8 D_8004ED04; + u8 D_8004ED05; + u8 D_8004ED06; + u8 D_8004ED07; +}; + +extern struct spec_struct D_8004EC40; + +void sub_GAME_7F0D28E0(u8 *arg0, s32 arg1, s32 arg2, u8 *arg3) +{ + s32 var_a1; + s32 temp_t1; + u8 *var_s0; + u8 *var_v0; + s32 var_v1; + s32 var_a0; + s32 var_t0; + u8 temp_a3; + s32 var_a2; + s32 i; + + void* pp; + s32 temp_v1; + + + var_v0 = &arg0[((arg2 << 5) & 0x1800) | ((arg2 << 8) & 0x700) | ((arg2 << 2) & 0xE0) | (arg1 >> 3)]; + temp_t1 = arg0[((arg2 << 2) & 0x3E0) + (arg1 >> 3) + 0x1800]; + + if(*var_v0); + + // problem area: need copy of t1, one for each `if` branch. + + if ((temp_t1 & 0x80) && (D_8004EC40.D_8004ED04 != 0)) + { + var_a0 = (temp_t1 >> 3) & 7; + var_v1 = temp_t1 & 7; + } + else + { + var_v1 = (temp_t1 >> 3) & 7; + var_a0 = temp_t1 & 7; + } + + if (!(temp_t1 & 0x40)) + { + var_a0 = (var_a0 + 8) & 0xff; + var_v1 = (var_v1 + 8) & 0xff; + } + + for (i = 0; i < 8; i++) + { + temp_a3 = *var_v0; + + if (temp_a3 & 0x80) + { + var_a2 = var_a0; + } + else + { + var_a2 = var_v1; + } + + if (temp_a3 & 0x40) + { + var_t0 = var_a0; + } + else + { + var_t0 = var_v1; + } + + arg3[0] = (s8) (var_t0 | (var_a2 * 0x10)); + + if (temp_a3 & 0x20) + { + var_a2 = var_a0; + } + else + { + var_a2 = var_v1; + } + if (temp_a3 & 0x10) + { + var_t0 = var_a0; + } + else + { + var_t0 = var_v1; + } + arg3[1] = (s8) (var_t0 | (var_a2 * 0x10)); + + if (temp_a3 & 8) + { + var_a2 = var_a0; + } + else + { + var_a2 = var_v1; + } + if (temp_a3 & 4) + { + var_t0 = var_a0; + } + else + { + var_t0 = var_v1; + } + arg3[2] = (s8) (var_t0 | (var_a2 * 0x10)); + + if (temp_a3 & 2) + { + var_a2 = var_a0; + } + else + { + var_a2 = var_v1; + } + if (temp_a3 & 1) + { + var_t0 = var_a0; + } + else + { + var_t0 = var_v1; + } + arg3[3] = (s8) (var_t0 | (var_a2 * 0x10)); + + arg3 += 0x20; + var_v0 += 0x100; + } } + #else GLOBAL_ASM( .text @@ -836,7 +971,7 @@ glabel init_spectrum_game /* 107BE8 7F0D30B8 2484C114 */ addiu $a0, %lo(aEmDataSpec_rom_seg_rz) # addiu $a0, $a0, -0x3eec /* 107BEC 7F0D30BC 24050001 */ li $a1, 1 /* 107BF0 7F0D30C0 24060100 */ li $a2, 256 -/* 107BF4 7F0D30C4 0FC2F341 */ jal _load_resource_named_to_membank +/* 107BF4 7F0D30C4 0FC2F341 */ jal _fileNameLoadToBank /* 107BF8 7F0D30C8 24070004 */ li $a3, 4 /* 107BFC 7F0D30CC 3C038009 */ lui $v1, %hi(ptr_sectrum_monitor_data_temp_buf) /* 107C00 7F0D30D0 2463E320 */ addiu $v1, %lo(ptr_sectrum_monitor_data_temp_buf) # addiu $v1, $v1, -0x1ce0 @@ -870,7 +1005,7 @@ glabel init_spectrum_game /* 107C68 7F0D3138 8C84ED2C */ lw $a0, %lo(romnames)($a0) /* 107C6C 7F0D313C 24050001 */ li $a1, 1 /* 107C70 7F0D3140 24060100 */ li $a2, 256 -/* 107C74 7F0D3144 0FC2F341 */ jal _load_resource_named_to_membank +/* 107C74 7F0D3144 0FC2F341 */ jal _fileNameLoadToBank /* 107C78 7F0D3148 24070004 */ li $a3, 4 /* 107C7C 7F0D314C 3C038009 */ lui $v1, %hi(ptr_sectrum_game_data_temp_buf) /* 107C80 7F0D3150 2463E324 */ addiu $v1, %lo(ptr_sectrum_game_data_temp_buf) # addiu $v1, $v1, -0x1cdc @@ -1394,19 +1529,19 @@ void nullsub_50(void) { u8 sub_GAME_7F0D37DC(u32 cycles, u8 specA, u8 port, u8 value) { - int temp_v0; - if (port == 0xFE) - { - temp_v0 = value & 7; - if (temp_v0 != spec_OUT_port[0]) + int temp_v0; + if (port == 0xFE) { - spec_OUT_port[0] = temp_v0; + temp_v0 = value & 7; + if (temp_v0 != spec_OUT_port[0]) + { + spec_OUT_port[0] = temp_v0; + } + + return 0; } return 0; - } - - return 0; } diff --git a/src/game/stan.c b/src/game/stan.c index c36d1b7f..7517a6ef 100644 --- a/src/game/stan.c +++ b/src/game/stan.c @@ -3,6 +3,9 @@ #include #include "stan.h" #include "bg.h" +#include "chrai.h" +#include "chr.h" +#include "unk_0B3200.h" // bss struct StanPrefixRecord { @@ -47,9 +50,9 @@ s32 stanSavedColl_pointI; //CODE.bss:8007B9EC s32 stanSavedColl_unknown; //CODE.bss:8007B9F0 -f32 stanSavedColl_pntA[2]; +struct coord2d stanSavedColl_pntA; //CODE.bss:8007B9F8 -f32 stanSavedColl_pntB[2]; +struct coord2d stanSavedColl_pntB; //CODE.bss:8007BA00 f32 stanSavedColl_someMin; @@ -145,6 +148,7 @@ const char aStanlinelog[] = "-stanlinelog"; s32 stanIsSpecialBit1Set(StandTile *arg0, struct StandTileLocusCallbackRecord* arg1); s32 sub_GAME_7F0B2274(StandTile *arg0, s32 arg1, f32 arg2, f32 arg3, s32 arg4, struct StandTileLocusCallbackRecord *arg5); +s32 sub_GAME_7F0B21B0(StandTile **tileStack, f32 target_x, f32 target_z, f32 unknown, s32 unk00, s32 *count_rtn, s32 bufMax); s32 sub_GAME_7F0B1DDC( struct StandTile**, @@ -159,6 +163,7 @@ s32 sub_GAME_7F0B1DDC( s32 sub_GAME_7F0B2110(StandTile *tile, struct StandTileLocusCallbackRecord*); s32 stanGetLocusField0(struct StandTileLocusCallbackRecord *arg0); s32 stanGetLocusCount(struct StandTileLocusCallbackRecord *arg0); +s32 sub_GAME_7F0B260C(StandTile *tile, s32 index, f32 p_x, f32 p_z, s32 arg4, struct StandTileLocusCallbackRecord *arg5); // end forward declarations @@ -254,7 +259,7 @@ u32 stanRemovedAnimationRoutine(s32 arg0) { return 0; } -void stanInitDebugNoticeList(void) { +void stanInit(void) { debTryAdd(&stan_c_debug_notice_list_entry, &aStan_c_debug);//"stan_c_debug"); } @@ -2260,46 +2265,58 @@ s32 isPointInsideTriStandTileUnscaled_Maybe(StandTile *tile, f32 p_x, f32 p_z) f32 sub_GAME_7F0B0400(StandTile *tile, s32 start3index, f32 p_x,f32 p_z); #ifdef NONMATCHING -// Similar to a prev func, but simplier. -f32 sub_GAME_7F0B0400(void *arg0, s32 arg1, f32 arg2, f32 arg3) { - f32 sp38; - s32 temp_a1; - s32 temp_a0; - void *temp_a2; - void *temp_v1; +struct stan_7F0B0E24 { + /***/ + s32 unk00; + s32 unk04; + s16 unk08; + s16 unk0A; + s16 unk0C; + s16 unk0E; +}; + +// decomp.me 98.89% https://decomp.me/scratch/tj1r4 +f32 sub_GAME_7F0B0400(StandTile *tile, s32 start3index, f32 p_x, f32 p_z) +{ + f32 temp_f0; f32 temp_f2; f32 temp_f14; - ? temp_ret; - s32 phi_a0; - - // Node 0 - if (arg1 != 2) + s32 var_a0; + s32 padding3; + s32 padding4; + //s32 padding; + f32 tempf; + struct stan_7F0B0E24 *temp_a2; + struct stan_7F0B0E24 *temp_v1; + + if (start3index != 2) { - // Node 1 - phi_a0 = (arg1 + 1); + var_a0 = start3index + 1; } else { - // Node 2 - phi_a0 = 0; + var_a0 = 0; } - // Node 3 - temp_a1 = ((s32) arg0->unk6 >> (8 - (arg1 * 4))); - temp_a0 = ((s32) arg0->unk6 >> (8 - (phi_a0 * 4))); - temp_a2 = (arg0 + ((temp_a1 & 0xf) * 8)); - temp_v1 = (arg0 + ((temp_a0 & 0xf) * 8)); - temp_f2 = (f32) (temp_v1->unk8 - temp_a2->unk8); - temp_f14 = (f32) (temp_v1->unkC - temp_a2->unkC); - sp38 = temp_f2; - temp_ret = sqrtf(((temp_f2 * temp_f2) + (temp_f14 * temp_f14)), temp_f14, temp_a0, temp_a1, temp_a2, arg0); - if (temp_ret != 0.0f) + + var_a0 = tile->tail.half >> (8 - (var_a0 * 4)); + temp_v1 = ((struct stan_7F0B0E24 *)((struct StandTilePoint *)tile + (( var_a0) & 0xF))); + + start3index = tile->tail.half >> (8 - (start3index * 4)); + temp_a2 = ((struct stan_7F0B0E24 *)((struct StandTilePoint *)tile + (( start3index) & 0xF))); + + + temp_f2 = (f32) (temp_v1->unk08 - temp_a2->unk08); + temp_f14 = (f32) (temp_v1->unk0C - temp_a2->unk0C); + + temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14)); + + if (temp_f0 == 0.0f) { - // Node 5 - // Node 6 - return ((((arg3 - (f32) sp1C->unkC) * -temp_f2) + (sp34 * (arg2 - (f32) sp1C->unk8))) / temp_ret); + return 0.0f; } - // Node 4 - return ((((arg3 - (f32) sp1C->unkC) * -temp_f2) + (sp34 * (arg2 - (f32) sp1C->unk8))) / temp_ret); + + tempf = (((p_z - (f32) temp_a2->unk0C) * -temp_f2) + (temp_f14 * (p_x - (f32) temp_a2->unk08))); + return tempf / temp_f0; } #else GLOBAL_ASM( @@ -2386,7 +2403,7 @@ glabel sub_GAME_7F0B0400 -s32 sub_GAME_7F0B0518(StandTile *tile, f32 p_x, f32 p_z) +s32 stanTestPointWithinTileBoundsMaybe(StandTile *tile, f32 p_x, f32 p_z) { f32 unk; s32 i; @@ -2396,8 +2413,10 @@ s32 sub_GAME_7F0B0518(StandTile *tile, f32 p_x, f32 p_z) for (i = 0; i != 3; i++) { - unk = sub_GAME_7F0B0400(tile,i,p_x,p_z); - if (unk < -2) { + unk = sub_GAME_7F0B0400(tile, i, p_x, p_z); + + if (unk < -2) + { return 0; } } @@ -2439,121 +2458,31 @@ int getRotationalDirectionBetween(f32 a_x,f32 a_z,f32 b_x,f32 b_z) -#ifdef NONMATCHING -s32 sub_GAME_7F0B0688(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - f32 sp20; +s32 sub_GAME_7F0B0688(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) +{ + s32 unused1; + s32 unused2; f32 sp24; - s32 sp28; - s32 sp2C; - f32 temp_f0; - f32 temp_f2; - s32 temp_t7; - s32 phi_return; - - // Node 0 - temp_f0 = (arg0 - arg4); - temp_f2 = (arg1 - arg5); - sp24 = temp_f0; - sp20 = temp_f2; - sp2C = getRotationalDirectionBetween((arg2 - arg0), (arg3 - arg1), -temp_f0, -temp_f2); - temp_t7 = ((getRotationalDirectionBetween(sp1C, sp18, (arg6 - arg0), (arg7 - arg1)) * sp2C) < 1); - phi_return = temp_t7; - if (temp_t7 != 0) - { - // Node 1 - sp28 = getRotationalDirectionBetween((arg6 - arg4), (arg7 - arg5), sp24, sp20); - phi_return = ((getRotationalDirectionBetween(sp1C, sp18, (arg2 - arg4), (arg3 - arg5)) * sp28) < 1); - } - // Node 2 - return phi_return; + f32 sp20; + f32 sp1C; + f32 sp18; + + sp24 = arg0 - arg4; + sp20 = arg1 - arg5; + sp1C = arg2 - arg0; + sp18 = arg3 - arg1; + + return + ( + (getRotationalDirectionBetween(sp1C, sp18, -sp24, -sp20) + * getRotationalDirectionBetween(sp1C, sp18, arg6 - arg0, arg7 - arg1)) < 1) + && + ( + (getRotationalDirectionBetween(arg6 - arg4, arg7 - arg5, sp24, sp20) + * getRotationalDirectionBetween(arg6 - arg4, arg7 - arg5, arg2 - arg4, arg3 - arg5)) < 1) + ; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0688 -/* 0E51B8 7F0B0688 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 0E51BC 7F0B068C C7B20058 */ lwc1 $f18, 0x58($sp) -/* 0E51C0 7F0B0690 C7B0005C */ lwc1 $f16, 0x5c($sp) -/* 0E51C4 7F0B0694 E7AC0048 */ swc1 $f12, 0x48($sp) -/* 0E51C8 7F0B0698 C7AA0048 */ lwc1 $f10, 0x48($sp) -/* 0E51CC 7F0B069C E7AE004C */ swc1 $f14, 0x4c($sp) -/* 0E51D0 7F0B06A0 C7A8004C */ lwc1 $f8, 0x4c($sp) -/* 0E51D4 7F0B06A4 46125001 */ sub.s $f0, $f10, $f18 -/* 0E51D8 7F0B06A8 AFA60050 */ sw $a2, 0x50($sp) -/* 0E51DC 7F0B06AC C7B20050 */ lwc1 $f18, 0x50($sp) -/* 0E51E0 7F0B06B0 46104081 */ sub.s $f2, $f8, $f16 -/* 0E51E4 7F0B06B4 AFA70054 */ sw $a3, 0x54($sp) -/* 0E51E8 7F0B06B8 C7B00054 */ lwc1 $f16, 0x54($sp) -/* 0E51EC 7F0B06BC 460A9301 */ sub.s $f12, $f18, $f10 -/* 0E51F0 7F0B06C0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E51F4 7F0B06C4 E7A00024 */ swc1 $f0, 0x24($sp) -/* 0E51F8 7F0B06C8 46088381 */ sub.s $f14, $f16, $f8 -/* 0E51FC 7F0B06CC E7A20020 */ swc1 $f2, 0x20($sp) -/* 0E5200 7F0B06D0 E7AC001C */ swc1 $f12, 0x1c($sp) -/* 0E5204 7F0B06D4 46000207 */ neg.s $f8, $f0 -/* 0E5208 7F0B06D8 46001407 */ neg.s $f16, $f2 -/* 0E520C 7F0B06DC 44064000 */ mfc1 $a2, $f8 -/* 0E5210 7F0B06E0 44078000 */ mfc1 $a3, $f16 -/* 0E5214 7F0B06E4 0FC2C170 */ jal getRotationalDirectionBetween -/* 0E5218 7F0B06E8 E7AE0018 */ swc1 $f14, 0x18($sp) -/* 0E521C 7F0B06EC C7A60060 */ lwc1 $f6, 0x60($sp) -/* 0E5220 7F0B06F0 C7B00048 */ lwc1 $f16, 0x48($sp) -/* 0E5224 7F0B06F4 C7AA0064 */ lwc1 $f10, 0x64($sp) -/* 0E5228 7F0B06F8 C7A4004C */ lwc1 $f4, 0x4c($sp) -/* 0E522C 7F0B06FC 46103481 */ sub.s $f18, $f6, $f16 -/* 0E5230 7F0B0700 C7AC001C */ lwc1 $f12, 0x1c($sp) -/* 0E5234 7F0B0704 C7AE0018 */ lwc1 $f14, 0x18($sp) -/* 0E5238 7F0B0708 46045201 */ sub.s $f8, $f10, $f4 -/* 0E523C 7F0B070C 44069000 */ mfc1 $a2, $f18 -/* 0E5240 7F0B0710 AFA2002C */ sw $v0, 0x2c($sp) -/* 0E5244 7F0B0714 44074000 */ mfc1 $a3, $f8 -/* 0E5248 7F0B0718 0FC2C170 */ jal getRotationalDirectionBetween -/* 0E524C 7F0B071C 00000000 */ nop -/* 0E5250 7F0B0720 8FAE002C */ lw $t6, 0x2c($sp) -/* 0E5254 7F0B0724 C7A60060 */ lwc1 $f6, 0x60($sp) -/* 0E5258 7F0B0728 C7B00058 */ lwc1 $f16, 0x58($sp) -/* 0E525C 7F0B072C 004E0019 */ multu $v0, $t6 -/* 0E5260 7F0B0730 C7B20064 */ lwc1 $f18, 0x64($sp) -/* 0E5264 7F0B0734 C7AA005C */ lwc1 $f10, 0x5c($sp) -/* 0E5268 7F0B0738 00001012 */ mflo $v0 -/* 0E526C 7F0B073C 284F0001 */ slti $t7, $v0, 1 -/* 0E5270 7F0B0740 11E0001A */ beqz $t7, .L7F0B07AC -/* 0E5274 7F0B0744 01E01025 */ move $v0, $t7 -/* 0E5278 7F0B0748 46103301 */ sub.s $f12, $f6, $f16 -/* 0E527C 7F0B074C 8FA60024 */ lw $a2, 0x24($sp) -/* 0E5280 7F0B0750 8FA70020 */ lw $a3, 0x20($sp) -/* 0E5284 7F0B0754 460A9381 */ sub.s $f14, $f18, $f10 -/* 0E5288 7F0B0758 E7AC001C */ swc1 $f12, 0x1c($sp) -/* 0E528C 7F0B075C 0FC2C170 */ jal getRotationalDirectionBetween -/* 0E5290 7F0B0760 E7AE0018 */ swc1 $f14, 0x18($sp) -/* 0E5294 7F0B0764 C7A40050 */ lwc1 $f4, 0x50($sp) -/* 0E5298 7F0B0768 C7A80058 */ lwc1 $f8, 0x58($sp) -/* 0E529C 7F0B076C C7B00054 */ lwc1 $f16, 0x54($sp) -/* 0E52A0 7F0B0770 C7B2005C */ lwc1 $f18, 0x5c($sp) -/* 0E52A4 7F0B0774 46082181 */ sub.s $f6, $f4, $f8 -/* 0E52A8 7F0B0778 C7AC001C */ lwc1 $f12, 0x1c($sp) -/* 0E52AC 7F0B077C C7AE0018 */ lwc1 $f14, 0x18($sp) -/* 0E52B0 7F0B0780 46128281 */ sub.s $f10, $f16, $f18 -/* 0E52B4 7F0B0784 44063000 */ mfc1 $a2, $f6 -/* 0E52B8 7F0B0788 AFA20028 */ sw $v0, 0x28($sp) -/* 0E52BC 7F0B078C 44075000 */ mfc1 $a3, $f10 -/* 0E52C0 7F0B0790 0FC2C170 */ jal getRotationalDirectionBetween -/* 0E52C4 7F0B0794 00000000 */ nop -/* 0E52C8 7F0B0798 8FB80028 */ lw $t8, 0x28($sp) -/* 0E52CC 7F0B079C 00580019 */ multu $v0, $t8 -/* 0E52D0 7F0B07A0 00001012 */ mflo $v0 -/* 0E52D4 7F0B07A4 28590001 */ slti $t9, $v0, 1 -/* 0E52D8 7F0B07A8 03201025 */ move $v0, $t9 -.L7F0B07AC: -/* 0E52DC 7F0B07AC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E52E0 7F0B07B0 27BD0048 */ addiu $sp, $sp, 0x48 -/* 0E52E4 7F0B07B4 03E00008 */ jr $ra -/* 0E52E8 7F0B07B8 00000000 */ nop -) -#endif - - @@ -3171,421 +3100,216 @@ glabel sub_GAME_7F0B0D0C ) #endif +// TODO: remove this struct. +// This should be a StanTile, offset 08 onwards are for the points. +struct stan_7F0B0E24 { + /***/ + s32 unk00; + s32 unk04; + s16 unk08; + s16 unk0A; + s16 unk0C; + s16 unk0E; +}; +/** + * Can change global variables: + * + * - D_800413BC + * - stanSavedColl_pntA + * - stanSavedColl_pntB + * - stanSavedColl_tile + * - stanSavedColl_pointI + * - stanSavedColl_posData + * + * US address 7F0B0E24. + * + * 'testLineUnobstructed' +*/ +s32 stanTestLineUnobstructed(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, s32 objFlags, f32 unkHeight, f32 unkA, f32 unkB, f32 unkC) +{ + struct PropRecord *temp_s6; + s32 retval; // sp158 + StandTile *sp154; // sp154 + struct coord2d sp14C; + struct coord2d sp144; + f32 sp140; + s32 point_index; + struct coord2d sp134; + struct coord2d sp12C; + s32 loop_flag; + s32 sp124; // sp124 + s32 padding; + s32 spD0[0x14]; //spD0 + s32 spCC; // spCC + s32 next; + f32 spC4; + f32 spC0; + f32 temp_f0_2; + s16 *spB8; + struct rect4f *spB4; // spB4 + s32 numvertices0; // spB0 + //f32 unused2; + s32 i; + f32 temp_f0; + f32 spA4; + f32 spA0; // spA0 + f32 temp_f2; + s32 already_set; -// sig for caller matches + sp140 = 1.0f; + sp124 = 0; + spCC = (unkA <= unkHeight); + already_set = 0; + + sp154 = *pTile; + sp14C.f[0] = p_x; + sp14C.f[1] = p_z; + sp144.f[0] = dest_x; + sp144.f[1] = dest_z; -#ifdef NONMATCHING -// 'testLineUnobstructed' -s32 sub_GAME_7F0B0E24(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, - int objFlags, f32 unkHeight, f32 unkA, f32 unkB, f32 unkC) { + retval = sub_GAME_7F0B0C24(&sp154, p_x, p_z, dest_x, dest_z, &spD0[0], &sp124, 0x14); + + + if (sp124 > 0x14) + { + sp124 = 0x14; + } + + if (retval == 0) + { + /// TODO: fix the horrible casts below. + + struct stan_7F0B0E24 * stack_padding_1; + struct stan_7F0B0E24 * stack_padding_2; + + point_index = (stanSavedColl_pointI + 1) % (s32) (((s16) (stanSavedColl_tile)->tail.half >> 0xC) & 0xF); + D_800413BC = 1; + + stanSavedColl_pntA.f[0] = (f32) ((struct stan_7F0B0E24 *)((struct StandTilePoint *)stanSavedColl_tile + stanSavedColl_pointI))->unk08 * inv_level_scale; + stanSavedColl_pntA.f[1] = (f32) ((struct stan_7F0B0E24 *)((struct StandTilePoint *)stanSavedColl_tile + stanSavedColl_pointI))->unk0C * inv_level_scale; + + stanSavedColl_pntB.f[0] = (f32) ((struct stan_7F0B0E24 *)((struct StandTilePoint *)stanSavedColl_tile + point_index))->unk08 * inv_level_scale; + stanSavedColl_pntB.f[1] = (f32) ((struct stan_7F0B0E24 *)((struct StandTilePoint *)stanSavedColl_tile + point_index))->unk0C * inv_level_scale; + + sp140 = unkGeometry7F0B3200(&sp14C, &sp144, &stanSavedColl_pntA, &stanSavedColl_pntB); + } + else + { + // + } + + stanSavedColl_posData = NULL; + + if (objFlags != 0) + { + spD0[sp124] = -1; + roomGetProps((s32 *)&spD0); + + for (spB8 = ptr_list_object_lookup_indices; *spB8 >= 0; spB8++) + { + temp_s6 = &pos_data_entry[*spB8]; + + if (sub_GAME_7F03DA50(temp_s6, objFlags) != 0) + { + chraiGetCollisionBounds(temp_s6, &spB4, &numvertices0, &spA4, &spA0); + if (numvertices0 > 0) + { + for (i = 0; i < numvertices0; i++) + { + next = (i + 1) % numvertices0; + + if (sub_GAME_7F0B0688(p_x, p_z, dest_x, dest_z, spB4->points[i].f[0], spB4->points[i].f[1], spB4->points[next].f[0], spB4->points[next].f[1]) != 0) + { + sp134.f[0] = spB4->points[i].f[0]; + sp134.f[1] = spB4->points[i].f[1]; + sp12C.f[0] = spB4->points[next].f[0]; + sp12C.f[1] = spB4->points[next].f[1]; + + temp_f0 = unkGeometry7F0B3200(&sp14C, &sp144, &sp134, &sp12C); + + if (temp_f0 < sp140) + { + loop_flag = 1; + + if (spCC != 0) + { + if (already_set == 0) + { + already_set = 1; + + if (unkC <= unkB) + { + spC4 = unkB - unkHeight; + spC0 = unkC - unkA; + } + else + { + if (sp140 < 1.0f) + { + dest_x -= p_x; + dest_x *= sp140; + dest_x = p_x + dest_x; + + dest_z -= p_z; + dest_z *= sp140; + dest_z = p_z + dest_z; + } + + temp_f0_2 = stanGetPositionYValue(*pTile, p_x, p_z); + unkHeight += temp_f0_2; + unkA += temp_f0_2; + temp_f2 = (stanGetPositionYValue(sp154, dest_x, dest_z) - temp_f0_2) / sp140; + spC0 = temp_f2; + spC4 = temp_f2; + } + } + + if ((spA4 <= ((spC0 * temp_f0) + unkA)) || (((spC4 * temp_f0) + unkHeight) <= spA0)) + { + loop_flag = 0; + } + } + + if (loop_flag != 0) + { + retval = 0; + sp140 = temp_f0; + D_800413BC = 1; + stanSavedColl_pntA = sp134; + stanSavedColl_pntB = sp12C; + stanSavedColl_tile = NULL; + stanSavedColl_pointI = 0; + stanSavedColl_posData = temp_s6; + sp154 = NULL; + } + } + } + } + } + } + } + } + + if (sp154 == NULL) + { + sp154 = *pTile; + + dest_x -= p_x; + dest_x *= sp140; + dest_x = p_x + dest_x; + + dest_z -= p_z; + dest_z *= sp140; + dest_z = p_z + dest_z; + walkTilesBetweenPoints_NoCallback(&sp154, p_x, p_z, dest_x, dest_z); + } + + *pTile = sp154; + stanSavedColl_someMin = sp140; + + return retval; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B0E24 -/* 0E5954 7F0B0E24 27BDFEA0 */ addiu $sp, $sp, -0x160 -/* 0E5958 7F0B0E28 C7A40178 */ lwc1 $f4, 0x178($sp) -/* 0E595C 7F0B0E2C C7A6017C */ lwc1 $f6, 0x17c($sp) -/* 0E5960 7F0B0E30 F7BC0048 */ sdc1 $f28, 0x48($sp) -/* 0E5964 7F0B0E34 F7B80038 */ sdc1 $f24, 0x38($sp) -/* 0E5968 7F0B0E38 4604303E */ c.le.s $f6, $f4 -/* 0E596C 7F0B0E3C 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0E5970 7F0B0E40 4487C000 */ mtc1 $a3, $f24 -/* 0E5974 7F0B0E44 AFB00058 */ sw $s0, 0x58($sp) -/* 0E5978 7F0B0E48 F7BA0040 */ sdc1 $f26, 0x40($sp) -/* 0E597C 7F0B0E4C 44856000 */ mtc1 $a1, $f12 -/* 0E5980 7F0B0E50 44867000 */ mtc1 $a2, $f14 -/* 0E5984 7F0B0E54 4481E000 */ mtc1 $at, $f28 -/* 0E5988 7F0B0E58 C7BA0170 */ lwc1 $f26, 0x170($sp) -/* 0E598C 7F0B0E5C 27B000D0 */ addiu $s0, $sp, 0xd0 -/* 0E5990 7F0B0E60 AFBF007C */ sw $ra, 0x7c($sp) -/* 0E5994 7F0B0E64 AFBE0078 */ sw $fp, 0x78($sp) -/* 0E5998 7F0B0E68 AFB70074 */ sw $s7, 0x74($sp) -/* 0E599C 7F0B0E6C AFB60070 */ sw $s6, 0x70($sp) -/* 0E59A0 7F0B0E70 AFB5006C */ sw $s5, 0x6c($sp) -/* 0E59A4 7F0B0E74 AFB40068 */ sw $s4, 0x68($sp) -/* 0E59A8 7F0B0E78 AFB30064 */ sw $s3, 0x64($sp) -/* 0E59AC 7F0B0E7C AFB20060 */ sw $s2, 0x60($sp) -/* 0E59B0 7F0B0E80 AFB1005C */ sw $s1, 0x5c($sp) -/* 0E59B4 7F0B0E84 F7BE0050 */ sdc1 $f30, 0x50($sp) -/* 0E59B8 7F0B0E88 F7B60030 */ sdc1 $f22, 0x30($sp) -/* 0E59BC 7F0B0E8C F7B40028 */ sdc1 $f20, 0x28($sp) -/* 0E59C0 7F0B0E90 AFA40160 */ sw $a0, 0x160($sp) -/* 0E59C4 7F0B0E94 AFA00124 */ sw $zero, 0x124($sp) -/* 0E59C8 7F0B0E98 45000002 */ bc1f .L7F0B0EA4 -/* 0E59CC 7F0B0E9C 00007025 */ move $t6, $zero -/* 0E59D0 7F0B0EA0 240E0001 */ li $t6, 1 -.L7F0B0EA4: -/* 0E59D4 7F0B0EA4 8FAF0160 */ lw $t7, 0x160($sp) -/* 0E59D8 7F0B0EA8 AFAE00CC */ sw $t6, 0xcc($sp) -/* 0E59DC 7F0B0EAC 44056000 */ mfc1 $a1, $f12 -/* 0E59E0 7F0B0EB0 8DF80000 */ lw $t8, ($t7) -/* 0E59E4 7F0B0EB4 44067000 */ mfc1 $a2, $f14 -/* 0E59E8 7F0B0EB8 4407C000 */ mfc1 $a3, $f24 -/* 0E59EC 7F0B0EBC 27B90124 */ addiu $t9, $sp, 0x124 -/* 0E59F0 7F0B0EC0 240B0014 */ li $t3, 20 -/* 0E59F4 7F0B0EC4 0000A825 */ move $s5, $zero -/* 0E59F8 7F0B0EC8 E7AC014C */ swc1 $f12, 0x14c($sp) -/* 0E59FC 7F0B0ECC E7AE0150 */ swc1 $f14, 0x150($sp) -/* 0E5A00 7F0B0ED0 E7B80144 */ swc1 $f24, 0x144($sp) -/* 0E5A04 7F0B0ED4 E7BA0148 */ swc1 $f26, 0x148($sp) -/* 0E5A08 7F0B0ED8 AFAB001C */ sw $t3, 0x1c($sp) -/* 0E5A0C 7F0B0EDC AFB90018 */ sw $t9, 0x18($sp) -/* 0E5A10 7F0B0EE0 E7AE0168 */ swc1 $f14, 0x168($sp) -/* 0E5A14 7F0B0EE4 E7AC0164 */ swc1 $f12, 0x164($sp) -/* 0E5A18 7F0B0EE8 AFB00014 */ sw $s0, 0x14($sp) -/* 0E5A1C 7F0B0EEC E7BA0010 */ swc1 $f26, 0x10($sp) -/* 0E5A20 7F0B0EF0 27A40154 */ addiu $a0, $sp, 0x154 -/* 0E5A24 7F0B0EF4 0FC2C309 */ jal sub_GAME_7F0B0C24 -/* 0E5A28 7F0B0EF8 AFB80154 */ sw $t8, 0x154($sp) -/* 0E5A2C 7F0B0EFC 8FAC0124 */ lw $t4, 0x124($sp) -/* 0E5A30 7F0B0F00 3C078008 */ lui $a3, %hi(stanSavedColl_pntB) -/* 0E5A34 7F0B0F04 AFA20158 */ sw $v0, 0x158($sp) -/* 0E5A38 7F0B0F08 29810015 */ slti $at, $t4, 0x15 -/* 0E5A3C 7F0B0F0C 14200003 */ bnez $at, .L7F0B0F1C -/* 0E5A40 7F0B0F10 24E7B9F8 */ addiu $a3, %lo(stanSavedColl_pntB) # addiu $a3, $a3, -0x4608 -/* 0E5A44 7F0B0F14 240D0014 */ li $t5, 20 -/* 0E5A48 7F0B0F18 AFAD0124 */ sw $t5, 0x124($sp) -.L7F0B0F1C: -/* 0E5A4C 7F0B0F1C 1440003B */ bnez $v0, .L7F0B100C -/* 0E5A50 7F0B0F20 3C1E8008 */ lui $fp, %hi(stanSavedColl_pntA) -/* 0E5A54 7F0B0F24 3C028008 */ lui $v0, %hi(stanSavedColl_tile) -/* 0E5A58 7F0B0F28 8C42B9E4 */ lw $v0, %lo(stanSavedColl_tile)($v0) -/* 0E5A5C 7F0B0F2C 3C038008 */ lui $v1, %hi(stanSavedColl_pointI) -/* 0E5A60 7F0B0F30 8C63B9E8 */ lw $v1, %lo(stanSavedColl_pointI)($v1) -/* 0E5A64 7F0B0F34 844F0006 */ lh $t7, 6($v0) -/* 0E5A68 7F0B0F38 240B0001 */ li $t3, 1 -/* 0E5A6C 7F0B0F3C 246E0001 */ addiu $t6, $v1, 1 -/* 0E5A70 7F0B0F40 000FC303 */ sra $t8, $t7, 0xc -/* 0E5A74 7F0B0F44 3319000F */ andi $t9, $t8, 0xf -/* 0E5A78 7F0B0F48 01D9001A */ div $zero, $t6, $t9 -/* 0E5A7C 7F0B0F4C 000360C0 */ sll $t4, $v1, 3 -/* 0E5A80 7F0B0F50 004C4021 */ addu $t0, $v0, $t4 -/* 0E5A84 7F0B0F54 27DEB9F0 */ addiu $fp, %lo(stanSavedColl_pntA) # addiu $fp, $fp, -0x4610 -/* 0E5A88 7F0B0F58 17200002 */ bnez $t9, .L7F0B0F64 -/* 0E5A8C 7F0B0F5C 00000000 */ nop -/* 0E5A90 7F0B0F60 0007000D */ break 7 -.L7F0B0F64: -/* 0E5A94 7F0B0F64 2401FFFF */ li $at, -1 -/* 0E5A98 7F0B0F68 17210004 */ bne $t9, $at, .L7F0B0F7C -/* 0E5A9C 7F0B0F6C 3C018000 */ lui $at, 0x8000 -/* 0E5AA0 7F0B0F70 15C10002 */ bne $t6, $at, .L7F0B0F7C -/* 0E5AA4 7F0B0F74 00000000 */ nop -/* 0E5AA8 7F0B0F78 0006000D */ break 6 -.L7F0B0F7C: -/* 0E5AAC 7F0B0F7C 3C018004 */ lui $at, %hi(D_800413BC) -/* 0E5AB0 7F0B0F80 AC2B13BC */ sw $t3, %lo(D_800413BC)($at) -/* 0E5AB4 7F0B0F84 850D0008 */ lh $t5, 8($t0) -/* 0E5AB8 7F0B0F88 3C018004 */ lui $at, %hi(inv_level_scale) -/* 0E5ABC 7F0B0F8C C4200F48 */ lwc1 $f0, %lo(inv_level_scale)($at) -/* 0E5AC0 7F0B0F90 448D4000 */ mtc1 $t5, $f8 -/* 0E5AC4 7F0B0F94 00005010 */ mfhi $t2 -/* 0E5AC8 7F0B0F98 000AC0C0 */ sll $t8, $t2, 3 -/* 0E5ACC 7F0B0F9C 468042A0 */ cvt.s.w $f10, $f8 -/* 0E5AD0 7F0B0FA0 00584821 */ addu $t1, $v0, $t8 -/* 0E5AD4 7F0B0FA4 03C03025 */ move $a2, $fp -/* 0E5AD8 7F0B0FA8 27A4014C */ addiu $a0, $sp, 0x14c -/* 0E5ADC 7F0B0FAC 27A50144 */ addiu $a1, $sp, 0x144 -/* 0E5AE0 7F0B0FB0 46005482 */ mul.s $f18, $f10, $f0 -/* 0E5AE4 7F0B0FB4 E7D20000 */ swc1 $f18, ($fp) -/* 0E5AE8 7F0B0FB8 850F000C */ lh $t7, 0xc($t0) -/* 0E5AEC 7F0B0FBC 448F2000 */ mtc1 $t7, $f4 -/* 0E5AF0 7F0B0FC0 00000000 */ nop -/* 0E5AF4 7F0B0FC4 468021A0 */ cvt.s.w $f6, $f4 -/* 0E5AF8 7F0B0FC8 46003202 */ mul.s $f8, $f6, $f0 -/* 0E5AFC 7F0B0FCC E7C80004 */ swc1 $f8, 4($fp) -/* 0E5B00 7F0B0FD0 852E0008 */ lh $t6, 8($t1) -/* 0E5B04 7F0B0FD4 448E5000 */ mtc1 $t6, $f10 -/* 0E5B08 7F0B0FD8 00000000 */ nop -/* 0E5B0C 7F0B0FDC 468054A0 */ cvt.s.w $f18, $f10 -/* 0E5B10 7F0B0FE0 46009102 */ mul.s $f4, $f18, $f0 -/* 0E5B14 7F0B0FE4 E4E40000 */ swc1 $f4, ($a3) -/* 0E5B18 7F0B0FE8 8539000C */ lh $t9, 0xc($t1) -/* 0E5B1C 7F0B0FEC 44993000 */ mtc1 $t9, $f6 -/* 0E5B20 7F0B0FF0 00000000 */ nop -/* 0E5B24 7F0B0FF4 46803220 */ cvt.s.w $f8, $f6 -/* 0E5B28 7F0B0FF8 46004282 */ mul.s $f10, $f8, $f0 -/* 0E5B2C 7F0B0FFC 0FC2CC80 */ jal sub_GAME_7F0B3200 -/* 0E5B30 7F0B1000 E4EA0004 */ swc1 $f10, 4($a3) -/* 0E5B34 7F0B1004 10000003 */ b .L7F0B1014 -/* 0E5B38 7F0B1008 46000706 */ mov.s $f28, $f0 -.L7F0B100C: -/* 0E5B3C 7F0B100C 3C1E8008 */ lui $fp, %hi(stanSavedColl_pntA) -/* 0E5B40 7F0B1010 27DEB9F0 */ addiu $fp, %lo(stanSavedColl_pntA) # addiu $fp, $fp, -0x4610 -.L7F0B1014: -/* 0E5B44 7F0B1014 8FAB0174 */ lw $t3, 0x174($sp) -/* 0E5B48 7F0B1018 3C178008 */ lui $s7, %hi(stanSavedColl_posData) -/* 0E5B4C 7F0B101C 26F7BA04 */ addiu $s7, %lo(stanSavedColl_posData) # addiu $s7, $s7, -0x45fc -/* 0E5B50 7F0B1020 116000CF */ beqz $t3, .L7F0B1360 -/* 0E5B54 7F0B1024 AEE00000 */ sw $zero, ($s7) -/* 0E5B58 7F0B1028 8FAD0124 */ lw $t5, 0x124($sp) -/* 0E5B5C 7F0B102C 240CFFFF */ li $t4, -1 -/* 0E5B60 7F0B1030 02002025 */ move $a0, $s0 -/* 0E5B64 7F0B1034 000D7880 */ sll $t7, $t5, 2 -/* 0E5B68 7F0B1038 020FC021 */ addu $t8, $s0, $t7 -/* 0E5B6C 7F0B103C 0FC0F8FF */ jal sub_GAME_7F03E3FC -/* 0E5B70 7F0B1040 AF0C0000 */ sw $t4, ($t8) -/* 0E5B74 7F0B1044 3C038007 */ lui $v1, %hi(ptr_list_object_lookup_indices) -/* 0E5B78 7F0B1048 8C639C30 */ lw $v1, %lo(ptr_list_object_lookup_indices)($v1) -/* 0E5B7C 7F0B104C 27B4012C */ addiu $s4, $sp, 0x12c -/* 0E5B80 7F0B1050 27B30134 */ addiu $s3, $sp, 0x134 -/* 0E5B84 7F0B1054 84620000 */ lh $v0, ($v1) -/* 0E5B88 7F0B1058 044200C2 */ bltzl $v0, .L7F0B1364 -/* 0E5B8C 7F0B105C 8FAC0154 */ lw $t4, 0x154($sp) -/* 0E5B90 7F0B1060 AFA300B8 */ sw $v1, 0xb8($sp) -/* 0E5B94 7F0B1064 C7BE00C4 */ lwc1 $f30, 0xc4($sp) -.L7F0B1068: -/* 0E5B98 7F0B1068 00027080 */ sll $t6, $v0, 2 -/* 0E5B9C 7F0B106C 01C27023 */ subu $t6, $t6, $v0 -/* 0E5BA0 7F0B1070 000E7080 */ sll $t6, $t6, 2 -/* 0E5BA4 7F0B1074 01C27021 */ addu $t6, $t6, $v0 -/* 0E5BA8 7F0B1078 3C198007 */ lui $t9, %hi(pos_data_entry) -/* 0E5BAC 7F0B107C 27399C38 */ addiu $t9, %lo(pos_data_entry) # addiu $t9, $t9, -0x63c8 -/* 0E5BB0 7F0B1080 000E7080 */ sll $t6, $t6, 2 -/* 0E5BB4 7F0B1084 01D9B021 */ addu $s6, $t6, $t9 -/* 0E5BB8 7F0B1088 02C02025 */ move $a0, $s6 -/* 0E5BBC 7F0B108C 0FC0F694 */ jal sub_GAME_7F03DA50 -/* 0E5BC0 7F0B1090 8FA50174 */ lw $a1, 0x174($sp) -/* 0E5BC4 7F0B1094 104000AB */ beqz $v0, .L7F0B1344 -/* 0E5BC8 7F0B1098 C7B000C0 */ lwc1 $f16, 0xc0($sp) -/* 0E5BCC 7F0B109C 27AB00A0 */ addiu $t3, $sp, 0xa0 -/* 0E5BD0 7F0B10A0 AFAB0010 */ sw $t3, 0x10($sp) -/* 0E5BD4 7F0B10A4 02C02025 */ move $a0, $s6 -/* 0E5BD8 7F0B10A8 27A500B4 */ addiu $a1, $sp, 0xb4 -/* 0E5BDC 7F0B10AC 27A600B0 */ addiu $a2, $sp, 0xb0 -/* 0E5BE0 7F0B10B0 27A700A4 */ addiu $a3, $sp, 0xa4 -/* 0E5BE4 7F0B10B4 0FC0F308 */ jal chraiGetCollisionBounds -/* 0E5BE8 7F0B10B8 E7B000C0 */ swc1 $f16, 0xc0($sp) -/* 0E5BEC 7F0B10BC 8FA200B0 */ lw $v0, 0xb0($sp) -/* 0E5BF0 7F0B10C0 C7B000C0 */ lwc1 $f16, 0xc0($sp) -/* 0E5BF4 7F0B10C4 584000A0 */ blezl $v0, .L7F0B1348 -/* 0E5BF8 7F0B10C8 8FA300B8 */ lw $v1, 0xb8($sp) -/* 0E5BFC 7F0B10CC 1840009D */ blez $v0, .L7F0B1344 -/* 0E5C00 7F0B10D0 00002825 */ move $a1, $zero -/* 0E5C04 7F0B10D4 00008825 */ move $s1, $zero -/* 0E5C08 7F0B10D8 8FAD00B0 */ lw $t5, 0xb0($sp) -.L7F0B10DC: -/* 0E5C0C 7F0B10DC 24B20001 */ addiu $s2, $a1, 1 -/* 0E5C10 7F0B10E0 8FAF00B4 */ lw $t7, 0xb4($sp) -/* 0E5C14 7F0B10E4 024D001A */ div $zero, $s2, $t5 -/* 0E5C18 7F0B10E8 01F11821 */ addu $v1, $t7, $s1 -/* 0E5C1C 7F0B10EC C4720000 */ lwc1 $f18, ($v1) -/* 0E5C20 7F0B10F0 00001010 */ mfhi $v0 -/* 0E5C24 7F0B10F4 000260C0 */ sll $t4, $v0, 3 -/* 0E5C28 7F0B10F8 E7B20010 */ swc1 $f18, 0x10($sp) -/* 0E5C2C 7F0B10FC C4640004 */ lwc1 $f4, 4($v1) -/* 0E5C30 7F0B1100 01EC2021 */ addu $a0, $t7, $t4 -/* 0E5C34 7F0B1104 4406C000 */ mfc1 $a2, $f24 -/* 0E5C38 7F0B1108 E7A40014 */ swc1 $f4, 0x14($sp) -/* 0E5C3C 7F0B110C C4860000 */ lwc1 $f6, ($a0) -/* 0E5C40 7F0B1110 4407D000 */ mfc1 $a3, $f26 -/* 0E5C44 7F0B1114 15A00002 */ bnez $t5, .L7F0B1120 -/* 0E5C48 7F0B1118 00000000 */ nop -/* 0E5C4C 7F0B111C 0007000D */ break 7 -.L7F0B1120: -/* 0E5C50 7F0B1120 2401FFFF */ li $at, -1 -/* 0E5C54 7F0B1124 15A10004 */ bne $t5, $at, .L7F0B1138 -/* 0E5C58 7F0B1128 3C018000 */ li $at, 0x80000000 # -0.000000 -/* 0E5C5C 7F0B112C 16410002 */ bne $s2, $at, .L7F0B1138 -/* 0E5C60 7F0B1130 00000000 */ nop -/* 0E5C64 7F0B1134 0006000D */ break 6 -.L7F0B1138: -/* 0E5C68 7F0B1138 E7A60018 */ swc1 $f6, 0x18($sp) -/* 0E5C6C 7F0B113C C4880004 */ lwc1 $f8, 4($a0) -/* 0E5C70 7F0B1140 00408025 */ move $s0, $v0 -/* 0E5C74 7F0B1144 E7B000C0 */ swc1 $f16, 0xc0($sp) -/* 0E5C78 7F0B1148 C7AC0164 */ lwc1 $f12, 0x164($sp) -/* 0E5C7C 7F0B114C C7AE0168 */ lwc1 $f14, 0x168($sp) -/* 0E5C80 7F0B1150 0FC2C1A2 */ jal sub_GAME_7F0B0688 -/* 0E5C84 7F0B1154 E7A8001C */ swc1 $f8, 0x1c($sp) -/* 0E5C88 7F0B1158 10400074 */ beqz $v0, .L7F0B132C -/* 0E5C8C 7F0B115C C7B000C0 */ lwc1 $f16, 0xc0($sp) -/* 0E5C90 7F0B1160 8FB800B4 */ lw $t8, 0xb4($sp) -/* 0E5C94 7F0B1164 001070C0 */ sll $t6, $s0, 3 -/* 0E5C98 7F0B1168 27A4014C */ addiu $a0, $sp, 0x14c -/* 0E5C9C 7F0B116C 03111821 */ addu $v1, $t8, $s1 -/* 0E5CA0 7F0B1170 C46A0000 */ lwc1 $f10, ($v1) -/* 0E5CA4 7F0B1174 030E1021 */ addu $v0, $t8, $t6 -/* 0E5CA8 7F0B1178 27A50144 */ addiu $a1, $sp, 0x144 -/* 0E5CAC 7F0B117C E7AA0134 */ swc1 $f10, 0x134($sp) -/* 0E5CB0 7F0B1180 C4720004 */ lwc1 $f18, 4($v1) -/* 0E5CB4 7F0B1184 02603025 */ move $a2, $s3 -/* 0E5CB8 7F0B1188 02803825 */ move $a3, $s4 -/* 0E5CBC 7F0B118C E7B20138 */ swc1 $f18, 0x138($sp) -/* 0E5CC0 7F0B1190 C4440000 */ lwc1 $f4, ($v0) -/* 0E5CC4 7F0B1194 E7A4012C */ swc1 $f4, 0x12c($sp) -/* 0E5CC8 7F0B1198 C4460004 */ lwc1 $f6, 4($v0) -/* 0E5CCC 7F0B119C E7B000C0 */ swc1 $f16, 0xc0($sp) -/* 0E5CD0 7F0B11A0 0FC2CC80 */ jal sub_GAME_7F0B3200 -/* 0E5CD4 7F0B11A4 E7A60130 */ swc1 $f6, 0x130($sp) -/* 0E5CD8 7F0B11A8 461C003C */ c.lt.s $f0, $f28 -/* 0E5CDC 7F0B11AC C7B000C0 */ lwc1 $f16, 0xc0($sp) -/* 0E5CE0 7F0B11B0 46000586 */ mov.s $f22, $f0 -/* 0E5CE4 7F0B11B4 4502005E */ bc1fl .L7F0B1330 -/* 0E5CE8 7F0B11B8 8FA200B0 */ lw $v0, 0xb0($sp) -/* 0E5CEC 7F0B11BC 8FB900CC */ lw $t9, 0xcc($sp) -/* 0E5CF0 7F0B11C0 24100001 */ li $s0, 1 -/* 0E5CF4 7F0B11C4 13200043 */ beqz $t9, .L7F0B12D4 -/* 0E5CF8 7F0B11C8 00000000 */ nop -/* 0E5CFC 7F0B11CC 16A00030 */ bnez $s5, .L7F0B1290 -/* 0E5D00 7F0B11D0 C7A80180 */ lwc1 $f8, 0x180($sp) -/* 0E5D04 7F0B11D4 C7AA0184 */ lwc1 $f10, 0x184($sp) -/* 0E5D08 7F0B11D8 24150001 */ li $s5, 1 -/* 0E5D0C 7F0B11DC C7B20178 */ lwc1 $f18, 0x178($sp) -/* 0E5D10 7F0B11E0 4608503E */ c.le.s $f10, $f8 -/* 0E5D14 7F0B11E4 C7A4017C */ lwc1 $f4, 0x17c($sp) -/* 0E5D18 7F0B11E8 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 0E5D1C 7F0B11EC 45020005 */ bc1fl .L7F0B1204 -/* 0E5D20 7F0B11F0 44813000 */ mtc1 $at, $f6 -/* 0E5D24 7F0B11F4 46124781 */ sub.s $f30, $f8, $f18 -/* 0E5D28 7F0B11F8 10000025 */ b .L7F0B1290 -/* 0E5D2C 7F0B11FC 46045401 */ sub.s $f16, $f10, $f4 -/* 0E5D30 7F0B1200 44813000 */ mtc1 $at, $f6 -.L7F0B1204: -/* 0E5D34 7F0B1204 C7A00164 */ lwc1 $f0, 0x164($sp) -/* 0E5D38 7F0B1208 C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0E5D3C 7F0B120C 4606E03C */ c.lt.s $f28, $f6 -/* 0E5D40 7F0B1210 00000000 */ nop -/* 0E5D44 7F0B1214 45020009 */ bc1fl .L7F0B123C -/* 0E5D48 7F0B1218 C7A00164 */ lwc1 $f0, 0x164($sp) -/* 0E5D4C 7F0B121C 4600C601 */ sub.s $f24, $f24, $f0 -/* 0E5D50 7F0B1220 4602D681 */ sub.s $f26, $f26, $f2 -/* 0E5D54 7F0B1224 461CC602 */ mul.s $f24, $f24, $f28 -/* 0E5D58 7F0B1228 00000000 */ nop -/* 0E5D5C 7F0B122C 461CD682 */ mul.s $f26, $f26, $f28 -/* 0E5D60 7F0B1230 46180600 */ add.s $f24, $f0, $f24 -/* 0E5D64 7F0B1234 461A1680 */ add.s $f26, $f2, $f26 -/* 0E5D68 7F0B1238 C7A00164 */ lwc1 $f0, 0x164($sp) -.L7F0B123C: -/* 0E5D6C 7F0B123C C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0E5D70 7F0B1240 8FAB0160 */ lw $t3, 0x160($sp) -/* 0E5D74 7F0B1244 44050000 */ mfc1 $a1, $f0 -/* 0E5D78 7F0B1248 44061000 */ mfc1 $a2, $f2 -/* 0E5D7C 7F0B124C 0FC2CA5C */ jal stanGetPositionYValue -/* 0E5D80 7F0B1250 8D640000 */ lw $a0, ($t3) -/* 0E5D84 7F0B1254 C7A80178 */ lwc1 $f8, 0x178($sp) -/* 0E5D88 7F0B1258 C7AA017C */ lwc1 $f10, 0x17c($sp) -/* 0E5D8C 7F0B125C 4405C000 */ mfc1 $a1, $f24 -/* 0E5D90 7F0B1260 46004480 */ add.s $f18, $f8, $f0 -/* 0E5D94 7F0B1264 4406D000 */ mfc1 $a2, $f26 -/* 0E5D98 7F0B1268 46000506 */ mov.s $f20, $f0 -/* 0E5D9C 7F0B126C 46005100 */ add.s $f4, $f10, $f0 -/* 0E5DA0 7F0B1270 E7B20178 */ swc1 $f18, 0x178($sp) -/* 0E5DA4 7F0B1274 8FA40154 */ lw $a0, 0x154($sp) -/* 0E5DA8 7F0B1278 0FC2CA5C */ jal stanGetPositionYValue -/* 0E5DAC 7F0B127C E7A4017C */ swc1 $f4, 0x17c($sp) -/* 0E5DB0 7F0B1280 46140181 */ sub.s $f6, $f0, $f20 -/* 0E5DB4 7F0B1284 461C3083 */ div.s $f2, $f6, $f28 -/* 0E5DB8 7F0B1288 46001406 */ mov.s $f16, $f2 -/* 0E5DBC 7F0B128C 46001786 */ mov.s $f30, $f2 -.L7F0B1290: -/* 0E5DC0 7F0B1290 46168202 */ mul.s $f8, $f16, $f22 -/* 0E5DC4 7F0B1294 C7B2017C */ lwc1 $f18, 0x17c($sp) -/* 0E5DC8 7F0B1298 C7A400A4 */ lwc1 $f4, 0xa4($sp) -/* 0E5DCC 7F0B129C 46124280 */ add.s $f10, $f8, $f18 -/* 0E5DD0 7F0B12A0 460A203E */ c.le.s $f4, $f10 -/* 0E5DD4 7F0B12A4 00000000 */ nop -/* 0E5DD8 7F0B12A8 4503000A */ bc1tl .L7F0B12D4 -/* 0E5DDC 7F0B12AC 00008025 */ move $s0, $zero -/* 0E5DE0 7F0B12B0 4616F202 */ mul.s $f8, $f30, $f22 -/* 0E5DE4 7F0B12B4 C7B20178 */ lwc1 $f18, 0x178($sp) -/* 0E5DE8 7F0B12B8 C7A600A0 */ lwc1 $f6, 0xa0($sp) -/* 0E5DEC 7F0B12BC 46124280 */ add.s $f10, $f8, $f18 -/* 0E5DF0 7F0B12C0 4606503E */ c.le.s $f10, $f6 -/* 0E5DF4 7F0B12C4 00000000 */ nop -/* 0E5DF8 7F0B12C8 45000002 */ bc1f .L7F0B12D4 -/* 0E5DFC 7F0B12CC 00000000 */ nop -/* 0E5E00 7F0B12D0 00008025 */ move $s0, $zero -.L7F0B12D4: -/* 0E5E04 7F0B12D4 12000015 */ beqz $s0, .L7F0B132C -/* 0E5E08 7F0B12D8 240D0001 */ li $t5, 1 -/* 0E5E0C 7F0B12DC 3C018004 */ lui $at, %hi(D_800413BC) -/* 0E5E10 7F0B12E0 AFA00158 */ sw $zero, 0x158($sp) -/* 0E5E14 7F0B12E4 AC2D13BC */ sw $t5, %lo(D_800413BC)($at) -/* 0E5E18 7F0B12E8 8E610000 */ lw $at, ($s3) -/* 0E5E1C 7F0B12EC 8E780004 */ lw $t8, 4($s3) -/* 0E5E20 7F0B12F0 3C0E8008 */ lui $t6, %hi(stanSavedColl_pntB) -/* 0E5E24 7F0B12F4 AFC10000 */ sw $at, ($fp) -/* 0E5E28 7F0B12F8 8E810000 */ lw $at, ($s4) -/* 0E5E2C 7F0B12FC 25CEB9F8 */ addiu $t6, %lo(stanSavedColl_pntB) # addiu $t6, $t6, -0x4608 -/* 0E5E30 7F0B1300 AFD80004 */ sw $t8, 4($fp) -/* 0E5E34 7F0B1304 ADC10000 */ sw $at, ($t6) -/* 0E5E38 7F0B1308 8E8D0004 */ lw $t5, 4($s4) -/* 0E5E3C 7F0B130C 3C018008 */ lui $at, %hi(stanSavedColl_tile) -/* 0E5E40 7F0B1310 4600B706 */ mov.s $f28, $f22 -/* 0E5E44 7F0B1314 ADCD0004 */ sw $t5, 4($t6) -/* 0E5E48 7F0B1318 AC20B9E4 */ sw $zero, %lo(stanSavedColl_tile)($at) -/* 0E5E4C 7F0B131C 3C018008 */ lui $at, %hi(stanSavedColl_pointI) -/* 0E5E50 7F0B1320 AC20B9E8 */ sw $zero, %lo(stanSavedColl_pointI)($at) -/* 0E5E54 7F0B1324 AEF60000 */ sw $s6, ($s7) -/* 0E5E58 7F0B1328 AFA00154 */ sw $zero, 0x154($sp) -.L7F0B132C: -/* 0E5E5C 7F0B132C 8FA200B0 */ lw $v0, 0xb0($sp) -.L7F0B1330: -/* 0E5E60 7F0B1330 02402825 */ move $a1, $s2 -/* 0E5E64 7F0B1334 26310008 */ addiu $s1, $s1, 8 -/* 0E5E68 7F0B1338 0242082A */ slt $at, $s2, $v0 -/* 0E5E6C 7F0B133C 5420FF67 */ bnezl $at, .L7F0B10DC -/* 0E5E70 7F0B1340 8FAD00B0 */ lw $t5, 0xb0($sp) -.L7F0B1344: -/* 0E5E74 7F0B1344 8FA300B8 */ lw $v1, 0xb8($sp) -.L7F0B1348: -/* 0E5E78 7F0B1348 84620002 */ lh $v0, 2($v1) -/* 0E5E7C 7F0B134C 24630002 */ addiu $v1, $v1, 2 -/* 0E5E80 7F0B1350 AFA300B8 */ sw $v1, 0xb8($sp) -/* 0E5E84 7F0B1354 0441FF44 */ bgez $v0, .L7F0B1068 -/* 0E5E88 7F0B1358 E7B000C0 */ swc1 $f16, 0xc0($sp) -/* 0E5E8C 7F0B135C E7BE00C4 */ swc1 $f30, 0xc4($sp) -.L7F0B1360: -/* 0E5E90 7F0B1360 8FAC0154 */ lw $t4, 0x154($sp) -.L7F0B1364: -/* 0E5E94 7F0B1364 C7A00164 */ lwc1 $f0, 0x164($sp) -/* 0E5E98 7F0B1368 C7A20168 */ lwc1 $f2, 0x168($sp) -/* 0E5E9C 7F0B136C 55800011 */ bnezl $t4, .L7F0B13B4 -/* 0E5EA0 7F0B1370 8FAB0154 */ lw $t3, 0x154($sp) -/* 0E5EA4 7F0B1374 4600C601 */ sub.s $f24, $f24, $f0 -/* 0E5EA8 7F0B1378 8FAF0160 */ lw $t7, 0x160($sp) -/* 0E5EAC 7F0B137C 44050000 */ mfc1 $a1, $f0 -/* 0E5EB0 7F0B1380 4602D681 */ sub.s $f26, $f26, $f2 -/* 0E5EB4 7F0B1384 461CC602 */ mul.s $f24, $f24, $f28 -/* 0E5EB8 7F0B1388 8DF80000 */ lw $t8, ($t7) -/* 0E5EBC 7F0B138C 44061000 */ mfc1 $a2, $f2 -/* 0E5EC0 7F0B1390 461CD682 */ mul.s $f26, $f26, $f28 -/* 0E5EC4 7F0B1394 27A40154 */ addiu $a0, $sp, 0x154 -/* 0E5EC8 7F0B1398 AFB80154 */ sw $t8, 0x154($sp) -/* 0E5ECC 7F0B139C 46180600 */ add.s $f24, $f0, $f24 -/* 0E5ED0 7F0B13A0 461A1680 */ add.s $f26, $f2, $f26 -/* 0E5ED4 7F0B13A4 4407C000 */ mfc1 $a3, $f24 -/* 0E5ED8 7F0B13A8 0FC2C2F9 */ jal walkTilesBetweenPoints_NoCallback -/* 0E5EDC 7F0B13AC E7BA0010 */ swc1 $f26, 0x10($sp) -/* 0E5EE0 7F0B13B0 8FAB0154 */ lw $t3, 0x154($sp) -.L7F0B13B4: -/* 0E5EE4 7F0B13B4 8FB90160 */ lw $t9, 0x160($sp) -/* 0E5EE8 7F0B13B8 3C018008 */ lui $at, %hi(stanSavedColl_someMin) -/* 0E5EEC 7F0B13BC AF2B0000 */ sw $t3, ($t9) -/* 0E5EF0 7F0B13C0 8FBF007C */ lw $ra, 0x7c($sp) -/* 0E5EF4 7F0B13C4 E43CBA00 */ swc1 $f28, %lo(stanSavedColl_someMin)($at) -/* 0E5EF8 7F0B13C8 D7BC0048 */ ldc1 $f28, 0x48($sp) -/* 0E5EFC 7F0B13CC 8FBE0078 */ lw $fp, 0x78($sp) -/* 0E5F00 7F0B13D0 8FB70074 */ lw $s7, 0x74($sp) -/* 0E5F04 7F0B13D4 8FB60070 */ lw $s6, 0x70($sp) -/* 0E5F08 7F0B13D8 8FB5006C */ lw $s5, 0x6c($sp) -/* 0E5F0C 7F0B13DC 8FB40068 */ lw $s4, 0x68($sp) -/* 0E5F10 7F0B13E0 8FB30064 */ lw $s3, 0x64($sp) -/* 0E5F14 7F0B13E4 8FB20060 */ lw $s2, 0x60($sp) -/* 0E5F18 7F0B13E8 8FB1005C */ lw $s1, 0x5c($sp) -/* 0E5F1C 7F0B13EC 8FB00058 */ lw $s0, 0x58($sp) -/* 0E5F20 7F0B13F0 D7BE0050 */ ldc1 $f30, 0x50($sp) -/* 0E5F24 7F0B13F4 D7BA0040 */ ldc1 $f26, 0x40($sp) -/* 0E5F28 7F0B13F8 D7B80038 */ ldc1 $f24, 0x38($sp) -/* 0E5F2C 7F0B13FC D7B60030 */ ldc1 $f22, 0x30($sp) -/* 0E5F30 7F0B1400 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 0E5F34 7F0B1404 8FA20158 */ lw $v0, 0x158($sp) -/* 0E5F38 7F0B1408 03E00008 */ jr $ra -/* 0E5F3C 7F0B140C 27BD0160 */ addiu $sp, $sp, 0x160 -) -#endif @@ -3653,7 +3377,7 @@ glabel sub_GAME_7F0B1410 /* 0E6008 7F0B14D8 00034080 */ sll $t0, $v1, 2 /* 0E600C 7F0B14DC 02284821 */ addu $t1, $s1, $t0 /* 0E6010 7F0B14E0 AD390000 */ sw $t9, ($t1) -/* 0E6014 7F0B14E4 0FC0F8FF */ jal sub_GAME_7F03E3FC +/* 0E6014 7F0B14E4 0FC0F8FF */ jal roomGetProps /* 0E6018 7F0B14E8 AFA300EC */ sw $v1, 0xec($sp) /* 0E601C 7F0B14EC 3C038007 */ lui $v1, %hi(ptr_list_object_lookup_indices) /* 0E6020 7F0B14F0 8C639C30 */ lw $v1, %lo(ptr_list_object_lookup_indices)($v1) @@ -3739,7 +3463,7 @@ glabel sub_GAME_7F0B1410 /* 0E6150 7F0B1620 C4440000 */ lwc1 $f4, ($v0) /* 0E6154 7F0B1624 E7A400F8 */ swc1 $f4, 0xf8($sp) /* 0E6158 7F0B1628 C4460004 */ lwc1 $f6, 4($v0) -/* 0E615C 7F0B162C 0FC2CC80 */ jal sub_GAME_7F0B3200 +/* 0E615C 7F0B162C 0FC2CC80 */ jal unkGeometry7F0B3200 /* 0E6160 7F0B1630 E7A600FC */ swc1 $f6, 0xfc($sp) /* 0E6164 7F0B1634 4614003C */ c.lt.s $f0, $f20 /* 0E6168 7F0B1638 00000000 */ nop @@ -3836,294 +3560,137 @@ bool sub_GAME_7F0B17E4(f32 x1, f32 z1, f32 x2, f32 z2, f32 x3, f32 z3) -#ifdef NONMATCHING -void sub_GAME_7F0B18B8(void) { +/** + * Can change global variables + * - D_800413BC + * - stanSavedColl_pntA + * - stanSavedColl_pntB + * - stanSavedColl_tile + * - stanSavedColl_pointI + * - stanSavedColl_posData + * + * US address 7F0B18B8. + * Perfect Dark cdTestVolume (from context) +*/ +s32 stanTestVolume(StandTile **arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, f32 arg5, f32 arg6) +{ + s32 i; // stack ?? + f32 var_f20; // stack ?? + f32 var_f24; // stack ?? + s32 temp_v0; // stack ?? + s32 next; // stack ?? + + s32 sp108; + f32 temp_f0; // stack ?? + s16 *sp100; + s32 spFC; + struct PropRecord *temp_s5; // no stack + s32 spA8[0x14]; + struct rect4f *spA4; + s32 numvertices0; // spa0 + f32 temp_f0_3; // stack ?? + f32 temp_f0_2; // stack ?? + f32 sp94; + f32 sp90; + + s32 padding1; + s32 padding2; + + sp108 = (arg6 <= arg5); + + spFC = 0; + + temp_v0 = sub_GAME_7F0B21B0(arg0, arg1, arg2, arg3, &spA8[0], &spFC, 0x14); + if (temp_v0 >= 0) + { + return temp_v0; + } + + if (spFC > 0x14) + { + spFC = 0x14; + } -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B18B8 -/* 0E63E8 7F0B18B8 27BDFEE0 */ addiu $sp, $sp, -0x120 -/* 0E63EC 7F0B18BC C7A40134 */ lwc1 $f4, 0x134($sp) -/* 0E63F0 7F0B18C0 C7A60138 */ lwc1 $f6, 0x138($sp) -/* 0E63F4 7F0B18C4 F7BE0050 */ sdc1 $f30, 0x50($sp) -/* 0E63F8 7F0B18C8 F7BC0048 */ sdc1 $f28, 0x48($sp) -/* 0E63FC 7F0B18CC 4604303E */ c.le.s $f6, $f4 -/* 0E6400 7F0B18D0 F7BA0040 */ sdc1 $f26, 0x40($sp) -/* 0E6404 7F0B18D4 4485D000 */ mtc1 $a1, $f26 -/* 0E6408 7F0B18D8 4486E000 */ mtc1 $a2, $f28 -/* 0E640C 7F0B18DC 4487F000 */ mtc1 $a3, $f30 -/* 0E6410 7F0B18E0 AFB20060 */ sw $s2, 0x60($sp) -/* 0E6414 7F0B18E4 AFB1005C */ sw $s1, 0x5c($sp) -/* 0E6418 7F0B18E8 AFB00058 */ sw $s0, 0x58($sp) -/* 0E641C 7F0B18EC 00808825 */ move $s1, $a0 -/* 0E6420 7F0B18F0 27B200A8 */ addiu $s2, $sp, 0xa8 -/* 0E6424 7F0B18F4 AFBF007C */ sw $ra, 0x7c($sp) -/* 0E6428 7F0B18F8 AFBE0078 */ sw $fp, 0x78($sp) -/* 0E642C 7F0B18FC AFB70074 */ sw $s7, 0x74($sp) -/* 0E6430 7F0B1900 AFB60070 */ sw $s6, 0x70($sp) -/* 0E6434 7F0B1904 AFB5006C */ sw $s5, 0x6c($sp) -/* 0E6438 7F0B1908 AFB40068 */ sw $s4, 0x68($sp) -/* 0E643C 7F0B190C AFB30064 */ sw $s3, 0x64($sp) -/* 0E6440 7F0B1910 F7B80038 */ sdc1 $f24, 0x38($sp) -/* 0E6444 7F0B1914 F7B60030 */ sdc1 $f22, 0x30($sp) -/* 0E6448 7F0B1918 F7B40028 */ sdc1 $f20, 0x28($sp) -/* 0E644C 7F0B191C 45000002 */ bc1f .L7F0B1928 -/* 0E6450 7F0B1920 00008025 */ move $s0, $zero -/* 0E6454 7F0B1924 24100001 */ li $s0, 1 -.L7F0B1928: -/* 0E6458 7F0B1928 4405D000 */ mfc1 $a1, $f26 -/* 0E645C 7F0B192C 4406E000 */ mfc1 $a2, $f28 -/* 0E6460 7F0B1930 4407F000 */ mfc1 $a3, $f30 -/* 0E6464 7F0B1934 27AE00FC */ addiu $t6, $sp, 0xfc -/* 0E6468 7F0B1938 240F0014 */ li $t7, 20 -/* 0E646C 7F0B193C AFB00108 */ sw $s0, 0x108($sp) -/* 0E6470 7F0B1940 AFA000FC */ sw $zero, 0xfc($sp) -/* 0E6474 7F0B1944 AFAF0018 */ sw $t7, 0x18($sp) -/* 0E6478 7F0B1948 AFAE0014 */ sw $t6, 0x14($sp) -/* 0E647C 7F0B194C 02202025 */ move $a0, $s1 -/* 0E6480 7F0B1950 0FC2C86C */ jal sub_GAME_7F0B21B0 -/* 0E6484 7F0B1954 AFB20010 */ sw $s2, 0x10($sp) -/* 0E6488 7F0B1958 04400003 */ bltz $v0, .L7F0B1968 -/* 0E648C 7F0B195C 8FB800FC */ lw $t8, 0xfc($sp) -/* 0E6490 7F0B1960 100000C7 */ b .L7F0B1C80 -/* 0E6494 7F0B1964 8FBF007C */ lw $ra, 0x7c($sp) -.L7F0B1968: -/* 0E6498 7F0B1968 2B010015 */ slti $at, $t8, 0x15 -/* 0E649C 7F0B196C 14200002 */ bnez $at, .L7F0B1978 -/* 0E64A0 7F0B1970 24190014 */ li $t9, 20 -/* 0E64A4 7F0B1974 AFB900FC */ sw $t9, 0xfc($sp) -.L7F0B1978: -/* 0E64A8 7F0B1978 8FA80130 */ lw $t0, 0x130($sp) -/* 0E64AC 7F0B197C 3C018008 */ lui $at, %hi(stanSavedColl_posData) -/* 0E64B0 7F0B1980 AC20BA04 */ sw $zero, %lo(stanSavedColl_posData)($at) -/* 0E64B4 7F0B1984 510000BD */ beql $t0, $zero, .L7F0B1C7C -/* 0E64B8 7F0B1988 2402FFFE */ li $v0, -2 -/* 0E64BC 7F0B198C 5200000C */ beql $s0, $zero, .L7F0B19C0 -/* 0E64C0 7F0B1990 8FAA00FC */ lw $t2, 0xfc($sp) -/* 0E64C4 7F0B1994 4405D000 */ mfc1 $a1, $f26 -/* 0E64C8 7F0B1998 4406E000 */ mfc1 $a2, $f28 -/* 0E64CC 7F0B199C 0FC2CA5C */ jal stanGetPositionYValue -/* 0E64D0 7F0B19A0 8E240000 */ lw $a0, ($s1) -/* 0E64D4 7F0B19A4 C7A80134 */ lwc1 $f8, 0x134($sp) -/* 0E64D8 7F0B19A8 C7B00138 */ lwc1 $f16, 0x138($sp) -/* 0E64DC 7F0B19AC 46004280 */ add.s $f10, $f8, $f0 -/* 0E64E0 7F0B19B0 46008480 */ add.s $f18, $f16, $f0 -/* 0E64E4 7F0B19B4 E7AA0134 */ swc1 $f10, 0x134($sp) -/* 0E64E8 7F0B19B8 E7B20138 */ swc1 $f18, 0x138($sp) -/* 0E64EC 7F0B19BC 8FAA00FC */ lw $t2, 0xfc($sp) -.L7F0B19C0: -/* 0E64F0 7F0B19C0 2409FFFF */ li $t1, -1 -/* 0E64F4 7F0B19C4 02402025 */ move $a0, $s2 -/* 0E64F8 7F0B19C8 000A5880 */ sll $t3, $t2, 2 -/* 0E64FC 7F0B19CC 024B6021 */ addu $t4, $s2, $t3 -/* 0E6500 7F0B19D0 0FC0F8FF */ jal sub_GAME_7F03E3FC -/* 0E6504 7F0B19D4 AD890000 */ sw $t1, ($t4) -/* 0E6508 7F0B19D8 3C038007 */ lui $v1, %hi(ptr_list_object_lookup_indices) -/* 0E650C 7F0B19DC 8C639C30 */ lw $v1, %lo(ptr_list_object_lookup_indices)($v1) -/* 0E6510 7F0B19E0 3C1E8008 */ lui $fp, %hi(stanSavedColl_tile) -/* 0E6514 7F0B19E4 3C168004 */ lui $s6, %hi(D_800413BC) -/* 0E6518 7F0B19E8 84620000 */ lh $v0, ($v1) -/* 0E651C 7F0B19EC 26D613BC */ addiu $s6, %lo(D_800413BC) # addiu $s6, $s6, 0x13bc -/* 0E6520 7F0B19F0 27DEB9E4 */ addiu $fp, %lo(stanSavedColl_tile) # addiu $fp, $fp, -0x461c -/* 0E6524 7F0B19F4 044000A0 */ bltz $v0, .L7F0B1C78 -/* 0E6528 7F0B19F8 24170001 */ li $s7, 1 -/* 0E652C 7F0B19FC 3C148008 */ lui $s4, %hi(stanSavedColl_pntB) -/* 0E6530 7F0B1A00 3C138008 */ lui $s3, %hi(stanSavedColl_pntA) -/* 0E6534 7F0B1A04 2673B9F0 */ addiu $s3, %lo(stanSavedColl_pntA) # addiu $s3, $s3, -0x4610 -/* 0E6538 7F0B1A08 2694B9F8 */ addiu $s4, %lo(stanSavedColl_pntB) # addiu $s4, $s4, -0x4608 -/* 0E653C 7F0B1A0C AFA30100 */ sw $v1, 0x100($sp) -/* 0E6540 7F0B1A10 00026880 */ sll $t5, $v0, 2 -.L7F0B1A14: -/* 0E6544 7F0B1A14 01A26823 */ subu $t5, $t5, $v0 -/* 0E6548 7F0B1A18 000D6880 */ sll $t5, $t5, 2 -/* 0E654C 7F0B1A1C 01A26821 */ addu $t5, $t5, $v0 -/* 0E6550 7F0B1A20 3C0E8007 */ lui $t6, %hi(pos_data_entry) -/* 0E6554 7F0B1A24 25CE9C38 */ addiu $t6, %lo(pos_data_entry) # addiu $t6, $t6, -0x63c8 -/* 0E6558 7F0B1A28 000D6880 */ sll $t5, $t5, 2 -/* 0E655C 7F0B1A2C 01AEA821 */ addu $s5, $t5, $t6 -/* 0E6560 7F0B1A30 02A02025 */ move $a0, $s5 -/* 0E6564 7F0B1A34 0FC0F694 */ jal sub_GAME_7F03DA50 -/* 0E6568 7F0B1A38 8FA50130 */ lw $a1, 0x130($sp) -/* 0E656C 7F0B1A3C 10400088 */ beqz $v0, .L7F0B1C60 -/* 0E6570 7F0B1A40 02A02025 */ move $a0, $s5 -/* 0E6574 7F0B1A44 27AF0090 */ addiu $t7, $sp, 0x90 -/* 0E6578 7F0B1A48 AFAF0010 */ sw $t7, 0x10($sp) -/* 0E657C 7F0B1A4C 27A500A4 */ addiu $a1, $sp, 0xa4 -/* 0E6580 7F0B1A50 27A600A0 */ addiu $a2, $sp, 0xa0 -/* 0E6584 7F0B1A54 0FC0F308 */ jal chraiGetCollisionBounds -/* 0E6588 7F0B1A58 27A70094 */ addiu $a3, $sp, 0x94 -/* 0E658C 7F0B1A5C 8FB800A0 */ lw $t8, 0xa0($sp) -/* 0E6590 7F0B1A60 8FB90108 */ lw $t9, 0x108($sp) -/* 0E6594 7F0B1A64 5B00007F */ blezl $t8, .L7F0B1C64 -/* 0E6598 7F0B1A68 8FA30100 */ lw $v1, 0x100($sp) -/* 0E659C 7F0B1A6C 1320000D */ beqz $t9, .L7F0B1AA4 -/* 0E65A0 7F0B1A70 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -/* 0E65A4 7F0B1A74 C7A40134 */ lwc1 $f4, 0x134($sp) -/* 0E65A8 7F0B1A78 C7A60090 */ lwc1 $f6, 0x90($sp) -/* 0E65AC 7F0B1A7C C7A80094 */ lwc1 $f8, 0x94($sp) -/* 0E65B0 7F0B1A80 C7AA0138 */ lwc1 $f10, 0x138($sp) -/* 0E65B4 7F0B1A84 4604303E */ c.le.s $f6, $f4 -/* 0E65B8 7F0B1A88 00000000 */ nop -/* 0E65BC 7F0B1A8C 45020075 */ bc1fl .L7F0B1C64 -/* 0E65C0 7F0B1A90 8FA30100 */ lw $v1, 0x100($sp) -/* 0E65C4 7F0B1A94 4608503E */ c.le.s $f10, $f8 -/* 0E65C8 7F0B1A98 00000000 */ nop -/* 0E65CC 7F0B1A9C 45020071 */ bc1fl .L7F0B1C64 -/* 0E65D0 7F0B1AA0 8FA30100 */ lw $v1, 0x100($sp) -.L7F0B1AA4: -/* 0E65D4 7F0B1AA4 4481C000 */ mtc1 $at, $f24 -/* 0E65D8 7F0B1AA8 00002825 */ move $a1, $zero -.L7F0B1AAC: -/* 0E65DC 7F0B1AAC 8FAA00A0 */ lw $t2, 0xa0($sp) -/* 0E65E0 7F0B1AB0 24A80001 */ addiu $t0, $a1, 1 -/* 0E65E4 7F0B1AB4 8FAB00A4 */ lw $t3, 0xa4($sp) -/* 0E65E8 7F0B1AB8 010A001A */ div $zero, $t0, $t2 -/* 0E65EC 7F0B1ABC 00001810 */ mfhi $v1 -/* 0E65F0 7F0B1AC0 000348C0 */ sll $t1, $v1, 3 -/* 0E65F4 7F0B1AC4 000588C0 */ sll $s1, $a1, 3 -/* 0E65F8 7F0B1AC8 01711021 */ addu $v0, $t3, $s1 -/* 0E65FC 7F0B1ACC 01692021 */ addu $a0, $t3, $t1 -/* 0E6600 7F0B1AD0 8C860000 */ lw $a2, ($a0) -/* 0E6604 7F0B1AD4 8C870004 */ lw $a3, 4($a0) -/* 0E6608 7F0B1AD8 C44C0000 */ lwc1 $f12, ($v0) -/* 0E660C 7F0B1ADC C44E0004 */ lwc1 $f14, 4($v0) -/* 0E6610 7F0B1AE0 15400002 */ bnez $t2, .L7F0B1AEC -/* 0E6614 7F0B1AE4 00000000 */ nop -/* 0E6618 7F0B1AE8 0007000D */ break 7 -.L7F0B1AEC: -/* 0E661C 7F0B1AEC 2401FFFF */ li $at, -1 -/* 0E6620 7F0B1AF0 15410004 */ bne $t2, $at, .L7F0B1B04 -/* 0E6624 7F0B1AF4 3C018000 */ lui $at, 0x8000 -/* 0E6628 7F0B1AF8 15010002 */ bne $t0, $at, .L7F0B1B04 -/* 0E662C 7F0B1AFC 00000000 */ nop -/* 0E6630 7F0B1B00 0006000D */ break 6 -.L7F0B1B04: -/* 0E6634 7F0B1B04 00609025 */ move $s2, $v1 -/* 0E6638 7F0B1B08 E7BC0014 */ swc1 $f28, 0x14($sp) -/* 0E663C 7F0B1B0C 0FC2C5B1 */ jal sub_GAME_7F0B16C4 -/* 0E6640 7F0B1B10 E7BA0010 */ swc1 $f26, 0x10($sp) -/* 0E6644 7F0B1B14 44808000 */ mtc1 $zero, $f16 -/* 0E6648 7F0B1B18 46000506 */ mov.s $f20, $f0 -/* 0E664C 7F0B1B1C 4610003C */ c.lt.s $f0, $f16 -/* 0E6650 7F0B1B20 00000000 */ nop -/* 0E6654 7F0B1B24 45020003 */ bc1fl .L7F0B1B34 -/* 0E6658 7F0B1B28 4614C03C */ c.lt.s $f24, $f20 -/* 0E665C 7F0B1B2C 46000507 */ neg.s $f20, $f0 -/* 0E6660 7F0B1B30 4614C03C */ c.lt.s $f24, $f20 -.L7F0B1B34: -/* 0E6664 7F0B1B34 00000000 */ nop -/* 0E6668 7F0B1B38 4500003C */ bc1f .L7F0B1C2C -/* 0E666C 7F0B1B3C 00000000 */ nop -/* 0E6670 7F0B1B40 8FAC00A4 */ lw $t4, 0xa4($sp) -/* 0E6674 7F0B1B44 4406D000 */ mfc1 $a2, $f26 -/* 0E6678 7F0B1B48 4407E000 */ mfc1 $a3, $f28 -/* 0E667C 7F0B1B4C 01911021 */ addu $v0, $t4, $s1 -/* 0E6680 7F0B1B50 C44C0000 */ lwc1 $f12, ($v0) -/* 0E6684 7F0B1B54 0FC2C5E5 */ jal distBetweenPoints2d -/* 0E6688 7F0B1B58 C44E0004 */ lwc1 $f14, 4($v0) -/* 0E668C 7F0B1B5C 8FAD00A4 */ lw $t5, 0xa4($sp) -/* 0E6690 7F0B1B60 001280C0 */ sll $s0, $s2, 3 -/* 0E6694 7F0B1B64 4406D000 */ mfc1 $a2, $f26 -/* 0E6698 7F0B1B68 4407E000 */ mfc1 $a3, $f28 -/* 0E669C 7F0B1B6C 01B01821 */ addu $v1, $t5, $s0 -/* 0E66A0 7F0B1B70 46000586 */ mov.s $f22, $f0 -/* 0E66A4 7F0B1B74 C46C0000 */ lwc1 $f12, ($v1) -/* 0E66A8 7F0B1B78 0FC2C5E5 */ jal distBetweenPoints2d -/* 0E66AC 7F0B1B7C C46E0004 */ lwc1 $f14, 4($v1) -/* 0E66B0 7F0B1B80 461EA03C */ c.lt.s $f20, $f30 -/* 0E66B4 7F0B1B84 00000000 */ nop -/* 0E66B8 7F0B1B88 45000028 */ bc1f .L7F0B1C2C -/* 0E66BC 7F0B1B8C 00000000 */ nop -/* 0E66C0 7F0B1B90 461EB03C */ c.lt.s $f22, $f30 -/* 0E66C4 7F0B1B94 00000000 */ nop -/* 0E66C8 7F0B1B98 45030012 */ bc1tl .L7F0B1BE4 -/* 0E66CC 7F0B1B9C 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 0E66D0 7F0B1BA0 461E003C */ c.lt.s $f0, $f30 -/* 0E66D4 7F0B1BA4 00000000 */ nop -/* 0E66D8 7F0B1BA8 4503000E */ bc1tl .L7F0B1BE4 -/* 0E66DC 7F0B1BAC 8FAF00A4 */ lw $t7, 0xa4($sp) -/* 0E66E0 7F0B1BB0 8FAE00A4 */ lw $t6, 0xa4($sp) -/* 0E66E4 7F0B1BB4 01D11021 */ addu $v0, $t6, $s1 -/* 0E66E8 7F0B1BB8 01D01821 */ addu $v1, $t6, $s0 -/* 0E66EC 7F0B1BBC 8C660000 */ lw $a2, ($v1) -/* 0E66F0 7F0B1BC0 8C670004 */ lw $a3, 4($v1) -/* 0E66F4 7F0B1BC4 C44C0000 */ lwc1 $f12, ($v0) -/* 0E66F8 7F0B1BC8 C44E0004 */ lwc1 $f14, 4($v0) -/* 0E66FC 7F0B1BCC E7BC0014 */ swc1 $f28, 0x14($sp) -/* 0E6700 7F0B1BD0 0FC2C5F9 */ jal sub_GAME_7F0B17E4 -/* 0E6704 7F0B1BD4 E7BA0010 */ swc1 $f26, 0x10($sp) -/* 0E6708 7F0B1BD8 10400014 */ beqz $v0, .L7F0B1C2C -/* 0E670C 7F0B1BDC 00000000 */ nop -/* 0E6710 7F0B1BE0 8FAF00A4 */ lw $t7, 0xa4($sp) -.L7F0B1BE4: -/* 0E6714 7F0B1BE4 AED70000 */ sw $s7, ($s6) -/* 0E6718 7F0B1BE8 8FB800A4 */ lw $t8, 0xa4($sp) -/* 0E671C 7F0B1BEC 01F11021 */ addu $v0, $t7, $s1 -/* 0E6720 7F0B1BF0 C4520000 */ lwc1 $f18, ($v0) -/* 0E6724 7F0B1BF4 03101821 */ addu $v1, $t8, $s0 -/* 0E6728 7F0B1BF8 3C018008 */ lui $at, %hi(stanSavedColl_pointI) -/* 0E672C 7F0B1BFC E6720000 */ swc1 $f18, ($s3) -/* 0E6730 7F0B1C00 C4440004 */ lwc1 $f4, 4($v0) -/* 0E6734 7F0B1C04 4600A606 */ mov.s $f24, $f20 -/* 0E6738 7F0B1C08 E6640004 */ swc1 $f4, 4($s3) -/* 0E673C 7F0B1C0C C4660000 */ lwc1 $f6, ($v1) -/* 0E6740 7F0B1C10 E6860000 */ swc1 $f6, ($s4) -/* 0E6744 7F0B1C14 C4680004 */ lwc1 $f8, 4($v1) -/* 0E6748 7F0B1C18 AFC00000 */ sw $zero, ($fp) -/* 0E674C 7F0B1C1C E6880004 */ swc1 $f8, 4($s4) -/* 0E6750 7F0B1C20 AC20B9E8 */ sw $zero, %lo(stanSavedColl_pointI)($at) -/* 0E6754 7F0B1C24 3C018008 */ lui $at, %hi(stanSavedColl_posData) -/* 0E6758 7F0B1C28 AC35BA04 */ sw $s5, %lo(stanSavedColl_posData)($at) -.L7F0B1C2C: -/* 0E675C 7F0B1C2C 52400004 */ beql $s2, $zero, .L7F0B1C40 -/* 0E6760 7F0B1C30 3C01BF80 */ lui $at, 0xbf80 -/* 0E6764 7F0B1C34 1000FF9D */ b .L7F0B1AAC -/* 0E6768 7F0B1C38 02402825 */ move $a1, $s2 -/* 0E676C 7F0B1C3C 3C01BF80 */ li $at, 0xBF800000 # -1.000000 -.L7F0B1C40: -/* 0E6770 7F0B1C40 44815000 */ mtc1 $at, $f10 -/* 0E6774 7F0B1C44 00000000 */ nop -/* 0E6778 7F0B1C48 4618503C */ c.lt.s $f10, $f24 -/* 0E677C 7F0B1C4C 00000000 */ nop -/* 0E6780 7F0B1C50 45020004 */ bc1fl .L7F0B1C64 -/* 0E6784 7F0B1C54 8FA30100 */ lw $v1, 0x100($sp) -/* 0E6788 7F0B1C58 10000008 */ b .L7F0B1C7C -/* 0E678C 7F0B1C5C 24020002 */ li $v0, 2 -.L7F0B1C60: -/* 0E6790 7F0B1C60 8FA30100 */ lw $v1, 0x100($sp) -.L7F0B1C64: -/* 0E6794 7F0B1C64 84620002 */ lh $v0, 2($v1) -/* 0E6798 7F0B1C68 24630002 */ addiu $v1, $v1, 2 -/* 0E679C 7F0B1C6C AFA30100 */ sw $v1, 0x100($sp) -/* 0E67A0 7F0B1C70 0443FF68 */ bgezl $v0, .L7F0B1A14 -/* 0E67A4 7F0B1C74 00026880 */ sll $t5, $v0, 2 -.L7F0B1C78: -/* 0E67A8 7F0B1C78 2402FFFE */ li $v0, -2 -.L7F0B1C7C: -/* 0E67AC 7F0B1C7C 8FBF007C */ lw $ra, 0x7c($sp) -.L7F0B1C80: -/* 0E67B0 7F0B1C80 D7B40028 */ ldc1 $f20, 0x28($sp) -/* 0E67B4 7F0B1C84 D7B60030 */ ldc1 $f22, 0x30($sp) -/* 0E67B8 7F0B1C88 D7B80038 */ ldc1 $f24, 0x38($sp) -/* 0E67BC 7F0B1C8C D7BA0040 */ ldc1 $f26, 0x40($sp) -/* 0E67C0 7F0B1C90 D7BC0048 */ ldc1 $f28, 0x48($sp) -/* 0E67C4 7F0B1C94 D7BE0050 */ ldc1 $f30, 0x50($sp) -/* 0E67C8 7F0B1C98 8FB00058 */ lw $s0, 0x58($sp) -/* 0E67CC 7F0B1C9C 8FB1005C */ lw $s1, 0x5c($sp) -/* 0E67D0 7F0B1CA0 8FB20060 */ lw $s2, 0x60($sp) -/* 0E67D4 7F0B1CA4 8FB30064 */ lw $s3, 0x64($sp) -/* 0E67D8 7F0B1CA8 8FB40068 */ lw $s4, 0x68($sp) -/* 0E67DC 7F0B1CAC 8FB5006C */ lw $s5, 0x6c($sp) -/* 0E67E0 7F0B1CB0 8FB60070 */ lw $s6, 0x70($sp) -/* 0E67E4 7F0B1CB4 8FB70074 */ lw $s7, 0x74($sp) -/* 0E67E8 7F0B1CB8 8FBE0078 */ lw $fp, 0x78($sp) -/* 0E67EC 7F0B1CBC 03E00008 */ jr $ra -/* 0E67F0 7F0B1CC0 27BD0120 */ addiu $sp, $sp, 0x120 -) -#endif + stanSavedColl_posData = NULL; + + if (arg4) + { + if (sp108) + { + temp_f0 = stanGetPositionYValue(*arg0, arg1, arg2); + arg5 += temp_f0; + arg6 += temp_f0; + } + spA8[spFC] = -1; + roomGetProps(&spA8[0]); + + for (sp100 = ptr_list_object_lookup_indices; *sp100 >= 0; sp100++) + { + temp_s5 = &pos_data_entry[*sp100]; + + if (sub_GAME_7F03DA50(temp_s5, arg4) != 0) + { + chraiGetCollisionBounds(temp_s5, &spA4, &numvertices0, &sp94, &sp90); + if ((numvertices0 > 0) && ((sp108 == 0) || ((sp90 <= arg5) && (arg6 <= sp94)))) + { + var_f24 = -1.0f; + + i=0; + while(1) + { + next = (i + 1) % numvertices0; + + var_f20 = sub_GAME_7F0B16C4(spA4->points[i].f[0], spA4->points[i].f[1], spA4->points[next].f[0], spA4->points[next].f[1], arg1, arg2); + + if (var_f20 < 0.0f) + { + var_f20 = -var_f20; + } + + if (var_f24 < var_f20) + { + temp_f0_2 = distBetweenPoints2d(spA4->points[i].f[0], spA4->points[i].f[1], arg1, arg2); + temp_f0_3 = distBetweenPoints2d(spA4->points[next].f[0], spA4->points[next].f[1], arg1, arg2); + + if ((var_f20 < arg3) + && ( + (temp_f0_2 < arg3) + || (temp_f0_3 < arg3) + || (sub_GAME_7F0B17E4(spA4->points[i].f[0], spA4->points[i].f[1], spA4->points[next].f[0], spA4->points[next].f[1], arg1, arg2) != 0))) + { + D_800413BC = 1; + var_f24 = var_f20; + + stanSavedColl_pntA.f[0] = spA4->points[i].f[0]; + stanSavedColl_pntA.f[1] = spA4->points[i].f[1]; + stanSavedColl_pntB.f[0] = spA4->points[next].f[0]; + stanSavedColl_pntB.f[1] = spA4->points[next].f[1]; + stanSavedColl_tile = NULL; + stanSavedColl_pointI = 0; + stanSavedColl_posData = temp_s5; + } + } + + if (next == 0) + { + break; + } + + i = next; + } + + if (var_f24 > -1.0f) + { + return 2; + } + } + } + } + } + + return -2; +} @@ -4458,7 +4025,7 @@ glabel sub_GAME_7F0B1DDC s32 sub_GAME_7F0B20D0(StandTile **tileStack, f32 target_x, f32 target_z, f32 unknown) { - return sub_GAME_7F0B1DDC(tileStack, target_x, target_z, unknown, 0, 0, 0, 0); + return sub_GAME_7F0B1DDC(tileStack, target_x, target_z, unknown, NULL, NULL, NULL, NULL); } @@ -4545,7 +4112,8 @@ s32 incrNearEdgeCount(StandTile **tileStack, s32 stackHeight, struct StandTileLo -s32 sub_GAME_7F0B21B0(StandTile **tileStack, f32 target_x, f32 target_z, f32 unknown, s32 unk00, s32 *count_rtn, s32 bufMax){ +s32 sub_GAME_7F0B21B0(StandTile **tileStack, f32 target_x, f32 target_z, f32 unknown, s32 unk00, s32 *count_rtn, s32 bufMax) +{ struct StandTileLocusCallbackRecord data; s32 rtn; @@ -4555,7 +4123,7 @@ s32 sub_GAME_7F0B21B0(StandTile **tileStack, f32 target_x, f32 target_z, f32 unk data.nearEdgeCount = 0; rtn = sub_GAME_7F0B1DDC(tileStack, target_x, target_z, unknown, - sub_GAME_7F0B2110, 0x0, incrNearEdgeCount, &data + sub_GAME_7F0B2110, NULL, incrNearEdgeCount, &data ); *count_rtn = data.count; @@ -4937,20 +4505,19 @@ glabel stanGetMoveBondCollisionTiles #ifdef NONMATCHING -// Tests do appear to be lts -s32 sub_GAME_7F0B260C(StandTile *tile, s32 index, f32 p_x,f32 p_z, void, f32 *rtn) +/** + * arg5 type is wrong, first offset needs to be a float +*/ +s32 sub_GAME_7F0B260C(StandTile *tile, s32 index, f32 p_x, f32 p_z, s32 arg4, struct StandTileLocusCallbackRecord *arg5) { - s32 nextIndex; - - if (*rtn < (f32)tile->points[index].y) { - if (*rtn < (f32)tile->points[(index + 1) % STAN_POINT_COUNT(tile)].y) - { - return 1; - } - } - else { - return 0; + if (arg5->unk00 < (f32)tile->points[index].y + && arg5->unk00 < (f32)tile->points[(index + 1) % STAN_TAIL_E(tile)].y) + { + return 1; } + + return 0; + } #else @@ -5010,52 +4577,19 @@ glabel sub_GAME_7F0B260C - -#ifdef NONMATCHING -// We'll wait to decomp sub_GAME_7F0B260C properly, the reference to the f32 seems to be misbehaving and pointless. -void sub_GAME_7F0B26B8(StandTile **tile, f32 target_x, f32 target_z, f32 b_z, f32 param_5) +/** + * US address 7F0B26B8. +*/ +s32 sub_GAME_7F0B26B8(StandTile **tile, f32 target_x, f32 target_z, f32 b_z, f32 param_5) { - f32 unk_float; - - unk_float = param_5 * level_scale; - - return sub_GAME_7F0B1DDC( - tile, target_x, target_z, b_z, - 0x0, sub_GAME_7F0B260C, 0x0, &unk_float - ); -} + f32 data; -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B26B8 -/* 0E71E8 7F0B26B8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 0E71EC 7F0B26BC 3C018004 */ lui $at, %hi(level_scale) -/* 0E71F0 7F0B26C0 C4260F44 */ lwc1 $f6, %lo(level_scale)($at) -/* 0E71F4 7F0B26C4 C7A40040 */ lwc1 $f4, 0x40($sp) -/* 0E71F8 7F0B26C8 44856000 */ mtc1 $a1, $f12 -/* 0E71FC 7F0B26CC 44867000 */ mtc1 $a2, $f14 -/* 0E7200 7F0B26D0 46062202 */ mul.s $f8, $f4, $f6 -/* 0E7204 7F0B26D4 3C0E7F0B */ lui $t6, %hi(sub_GAME_7F0B260C) # $t6, 0x7f0b -/* 0E7208 7F0B26D8 AFBF0024 */ sw $ra, 0x24($sp) -/* 0E720C 7F0B26DC 25CE260C */ addiu $t6, %lo(sub_GAME_7F0B260C) # addiu $t6, $t6, 0x260c -/* 0E7210 7F0B26E0 27AF002C */ addiu $t7, $sp, 0x2c -/* 0E7214 7F0B26E4 44056000 */ mfc1 $a1, $f12 -/* 0E7218 7F0B26E8 44067000 */ mfc1 $a2, $f14 -/* 0E721C 7F0B26EC AFA7003C */ sw $a3, 0x3c($sp) -/* 0E7220 7F0B26F0 E7A8002C */ swc1 $f8, 0x2c($sp) -/* 0E7224 7F0B26F4 AFAF001C */ sw $t7, 0x1c($sp) -/* 0E7228 7F0B26F8 AFAE0014 */ sw $t6, 0x14($sp) -/* 0E722C 7F0B26FC AFA00010 */ sw $zero, 0x10($sp) -/* 0E7230 7F0B2700 0FC2C777 */ jal sub_GAME_7F0B1DDC -/* 0E7234 7F0B2704 AFA00018 */ sw $zero, 0x18($sp) -/* 0E7238 7F0B2708 8FBF0024 */ lw $ra, 0x24($sp) -/* 0E723C 7F0B270C 27BD0030 */ addiu $sp, $sp, 0x30 -/* 0E7240 7F0B2710 03E00008 */ jr $ra -/* 0E7244 7F0B2714 00000000 */ nop -) -#endif + data = param_5 * level_scale; + + /// TODO: Why is this cast wrong? + return sub_GAME_7F0B1DDC(tile, target_x, target_z, b_z, NULL, sub_GAME_7F0B260C, NULL, (struct StandTileLocusCallbackRecord*)&data); +} #ifdef NONMATCHING @@ -5287,13 +4821,13 @@ bool getCollisionEdge_maybe(coord3d *pntA, coord3d *pntB) { if (D_800413BC) { - pntA->x = stanSavedColl_pntA[0]; + pntA->x = stanSavedColl_pntA.f[0]; pntA->y = 0; - pntA->z = stanSavedColl_pntA[1]; + pntA->z = stanSavedColl_pntA.f[1]; - pntB->x = stanSavedColl_pntB[0]; + pntB->x = stanSavedColl_pntB.f[0]; pntB->y = 0; - pntB->z = stanSavedColl_pntB[1]; + pntB->z = stanSavedColl_pntB.f[1]; return TRUE; } @@ -5732,32 +5266,9 @@ glabel stanMatchTileName -#ifdef NONMATCHING -void sub_GAME_7F0B2F00(void *arg0) { - ? temp_ret; - - // Node 0 - temp_ret = stanMatchTileName(*arg0); - *arg0 = temp_ret; - return temp_ret; +void sub_GAME_7F0B2F00(StandTilePoint** arg0) { + *arg0 = stanMatchTileName(*arg0); } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0B2F00 -/* 0E7A30 7F0B2F00 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0E7A34 7F0B2F04 AFBF0014 */ sw $ra, 0x14($sp) -/* 0E7A38 7F0B2F08 AFA40018 */ sw $a0, 0x18($sp) -/* 0E7A3C 7F0B2F0C 0FC2CB96 */ jal stanMatchTileName -/* 0E7A40 7F0B2F10 8C840000 */ lw $a0, ($a0) -/* 0E7A44 7F0B2F14 8FAF0018 */ lw $t7, 0x18($sp) -/* 0E7A48 7F0B2F18 ADE20000 */ sw $v0, ($t7) -/* 0E7A4C 7F0B2F1C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0E7A50 7F0B2F20 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0E7A54 7F0B2F24 03E00008 */ jr $ra -/* 0E7A58 7F0B2F28 00000000 */ nop -) -#endif @@ -5949,7 +5460,7 @@ Gfx * sub_GAME_7F0B312C(Gfx *arg0, s32 arg1) { int sub_GAME_7F0B3138(void* unused, StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, int objFlags, f32 unkHeight, f32 unkA) { - return sub_GAME_7F0B0E24(pTile, p_x, p_z, dest_x, dest_z, objFlags, unkHeight, unkA, 0, 1); + return stanTestLineUnobstructed(pTile, p_x, p_z, dest_x, dest_z, objFlags, unkHeight, unkA, 0, 1); } #else GLOBAL_ASM( @@ -5976,7 +5487,7 @@ glabel sub_GAME_7F0B3138 /* 0E7CB0 7F0B3180 AFAE0014 */ sw $t6, 0x14($sp) /* 0E7CB4 7F0B3184 E7A60018 */ swc1 $f6, 0x18($sp) /* 0E7CB8 7F0B3188 E7A8001C */ swc1 $f8, 0x1c($sp) -/* 0E7CBC 7F0B318C 0FC2C389 */ jal sub_GAME_7F0B0E24 +/* 0E7CBC 7F0B318C 0FC2C389 */ jal stanTestLineUnobstructed /* 0E7CC0 7F0B3190 E7AA0020 */ swc1 $f10, 0x20($sp) /* 0E7CC4 7F0B3194 8FBF002C */ lw $ra, 0x2c($sp) /* 0E7CC8 7F0B3198 27BD0030 */ addiu $sp, $sp, 0x30 @@ -5988,11 +5499,10 @@ glabel sub_GAME_7F0B3138 - #ifdef NONMATCHING -void sub_GAME_7F0B31A4(s32 arg0, s32 arg1, ? arg2, ? arg3, ? arg4, ?32 arg5, f32 arg6, f32 arg7) { - // Node 0 - return sub_GAME_7F0B18B8(arg2, arg3, arg1, arg2, arg3, arg4, arg5, arg6, arg7); +void sub_GAME_7F0B31A4(StandTile ** arg1, f32 arg0, f32 arg2, f32 arg3, f32 arg4, s32 arg5, f32 arg6, f32 arg7) { + // almost a match. missing sw a0,0x28(sp) and move a0,a1 instructions + stanTestVolume(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } #else GLOBAL_ASM( @@ -6013,7 +5523,7 @@ glabel sub_GAME_7F0B31A4 /* 0E7D04 7F0B31D4 8FA70038 */ lw $a3, 0x38($sp) /* 0E7D08 7F0B31D8 AFAE0010 */ sw $t6, 0x10($sp) /* 0E7D0C 7F0B31DC E7A40014 */ swc1 $f4, 0x14($sp) -/* 0E7D10 7F0B31E0 0FC2C62E */ jal sub_GAME_7F0B18B8 +/* 0E7D10 7F0B31E0 0FC2C62E */ jal stanTestVolume /* 0E7D14 7F0B31E4 E7A60018 */ swc1 $f6, 0x18($sp) /* 0E7D18 7F0B31E8 8FBF0024 */ lw $ra, 0x24($sp) /* 0E7D1C 7F0B31EC 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/src/game/stan.h b/src/game/stan.h index 60ff42d1..a7c48454 100644 --- a/src/game/stan.h +++ b/src/game/stan.h @@ -20,7 +20,7 @@ #define STAN_TAIL_E(tile) ((tile->tail.half >> 0x0C) & 0xF) struct move_bond_collision { - struct coord3d sp184; + struct coord3d bondCollision; struct coord3d sp190; struct coord3d sp19C; struct coord3d sp1A8; @@ -41,7 +41,7 @@ extern s32 stanlinelog_flag; // Necessary forward declaration void noteTileRoomIfDifferentToPrev( StandTile *tile, StandTile *unused, struct StandTileWalkCallbackRecord *data); -void stanInitDebugNoticeList(void); +void stanInit(void); void sub_GAME_7F0B2D38(s8 arg0, s8 arg1, u16 arg2); void sub_GAME_7F0AF630(s32 arg0); @@ -52,17 +52,17 @@ Gfx * sub_GAME_7F0B3034(Gfx *arg0); Gfx * sub_GAME_7F0B312C(Gfx *arg0, s32 arg1); Gfx * sub_GAME_7F0B3024(Gfx *ptrdl, StandTilePoint *tile_point, u32 RGBAColor); s32 walkTilesBetweenPoints_NoCallback(StandTile **tileStack, f32 start_x, f32 start_z, f32 dest_x, f32 dest_z); -s32 sub_GAME_7F0B0518(StandTile *tile, f32 p_x, f32 p_z); +s32 stanTestPointWithinTileBoundsMaybe(StandTile *tile, f32 p_x, f32 p_z); f32 stanGetPositionYValue(StandTile* tile, f32 p_x, f32 p_z); s32 getCollisionEdge_maybe(coord3d *pntA, coord3d *pntB); s32 sub_GAME_7F0B26B8(StandTile **tile, f32 target_x, f32 target_z, f32 b_z, f32 param_5); s32 sub_GAME_7F0B20D0(StandTile** tileStack, f32 target_x, f32 target_z, f32 unknown); -s32 sub_GAME_7F0B0E24(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, int objFlags, f32 unkHeight, f32 unkA, f32 unkB, f32 unkC); +s32 stanTestLineUnobstructed(StandTile **pTile, f32 p_x, f32 p_z, f32 dest_x, f32 dest_z, int objFlags, f32 unkHeight, f32 unkA, f32 unkB, f32 unkC); StandTile* sub_GAME_7F0B2718(StandTile* srcTile, tilePredicate_t tilePred); s32 sub_GAME_7F0B0D0C(StandTile *tile, f32 start_x, f32 start_z, StandTile **tilePtr, f32 end_x, f32 end_z, s32 *roomBuf, s32 maxBufSize); s32 sub_GAME_7F0B0C24(StandTile **tileStack, f32 start_x, f32 start_z, f32 dest_x, f32 dest_z, s32 *roomBuffer, s32 *rtnCountSize, s32 maxBufSize); -s32 sub_GAME_7F0B18B8(StandTile **, f32, f32, f32, s32, f32, f32); +s32 stanTestVolume(StandTile **, f32 posX, f32 posY, f32 radius, s32 integer, f32 float1, f32 float2); s32 getTileRoom(StandTile* tile); PropRecord *sub_GAME_7F0B1410(StandTile *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); void copy_tile_RGB_as_24bit(StandTile *tile, f32 p_x, f32 p_z, u8 *rtn); @@ -74,4 +74,5 @@ bool sub_GAME_7F0B17E4(f32 x1, f32 z1, f32 x2, f32 z2, f32 x3, f32 z3); f32 sub_GAME_7F0B16C4(f32 x1, f32 z1, f32 x2, f32 z2, f32 x3, f32 z3); void stanGetMoveBondCollisionTiles(struct StandTile **arg0, struct StandTile **arg1, struct move_bond_collision *arg2); struct StandTile *sub_GAME_7F0AFB78(f32 *arg_x, f32 *arg_y, f32 *arg_z, f32 arg3); +s32 sub_GAME_7F0B0688(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7); #endif diff --git a/src/game/textrelated.c b/src/game/textrelated.c index 74349af9..e662c36d 100644 --- a/src/game/textrelated.c +++ b/src/game/textrelated.c @@ -2,6 +2,7 @@ #include #include "textrelated.h" #include "bondtypes.h" +#include "game/lvl_text.h" // data s32 D_80040E80 = 0; @@ -15,10 +16,10 @@ s32 text_y = 0; s32 text_s = 0; s32 text_t = 0; s32 D_80040EA8 = 0; -s32 ptrFirstFontTableSmall = 0; -s32 ptrSecondFontTableSmall = 0; -s32 ptrFirstFontTableLarge = 0; -s32 ptrSecondFontTableLarge = 0; +s32 ptrFontBankGothic = 0; +s32 ptrFontBankGothicChars = 0; +s32 ptrFontZurichBold = 0; +s32 ptrFontZurichBoldChars = 0; u16 D_80040EBC[] = { 0x0000, 0x5555, 0xaaaa, 0xffff, @@ -104,36 +105,36 @@ void load_font_tables(void) text_s = 0; MACROSIZE = 0x24b0 - 0; text_t = 0; - ptrFirstFontTableSmall = mempAllocBytesInBank(MACROSIZE, 4); - ptrSecondFontTableSmall = (s32) (ptrFirstFontTableSmall + 0x2a4); - romCopy(&ptrFirstFontTableSmall, &_fonttablectlsmall1SegmentRomStart, MACROSIZE); + ptrFontBankGothic = mempAllocBytesInBank(MACROSIZE, 4); + ptrFontBankGothicChars = (s32) (ptrFontBankGothic + 0x2a4); + romCopy(&ptrFontBankGothic, &_fontbankgothicSegmentRomStart, MACROSIZE); i = 0; loop_1: - temp_v0 = ptrSecondFontTableSmall + i; + temp_v0 = ptrFontBankGothicChars + i; i_next = i + 0x18; - temp_v0->unk14 = (s32) (temp_v0->unk14 + ptrFirstFontTableSmall); + temp_v0->unk14 = (s32) (temp_v0->unk14 + ptrFontBankGothic); i = i_next; if (i_next < 0x8d0) { goto loop_1; } MACROSIZE = 0x3540 - 0; - ptrFirstFontTableLarge = mempAllocBytesInBank(MACROSIZE, 4); - ptrSecondFontTableLarge = (s32) (ptrFirstFontTableLarge + 0x2a4); - romCopy(&ptrFirstFontTableLarge, &_fonttablectllarge1SegmentRomStart, MACROSIZE); - ptrSecondFontTableLarge->unk14 = (s32) (ptrSecondFontTableLarge->unk14 + ptrFirstFontTableLarge); - ptrSecondFontTableLarge->unk2C = (s32) (ptrSecondFontTableLarge->unk2C + ptrFirstFontTableLarge); + ptrFontZurichBold = mempAllocBytesInBank(MACROSIZE, 4); + ptrFontZurichBoldChars = (s32) (ptrFontZurichBold + 0x2a4); + romCopy(&ptrFontZurichBold, &_fontzurichboldSegmentRomStart, MACROSIZE); + ptrFontZurichBoldChars->unk14 = (s32) (ptrFontZurichBoldChars->unk14 + ptrFontZurichBold); + ptrFontZurichBoldChars->unk2C = (s32) (ptrFontZurichBoldChars->unk2C + ptrFontZurichBold); phi_v1_2 = 0x30; loop_3: - temp_v0_2 = ptrSecondFontTableLarge + phi_v1_2; - temp_v0_2->unk14 = (s32) (temp_v0_2->unk14 + ptrFirstFontTableLarge); - temp_v0_3 = ptrSecondFontTableLarge + phi_v1_2; - temp_v0_3->unk2C = (s32) (temp_v0_3->unk2C + ptrFirstFontTableLarge); - temp_v0_4 = ptrSecondFontTableLarge + phi_v1_2; - temp_v0_4->unk44 = (s32) (temp_v0_4->unk44 + ptrFirstFontTableLarge); - temp_v0_5 = ptrSecondFontTableLarge + phi_v1_2; + temp_v0_2 = ptrFontZurichBoldChars + phi_v1_2; + temp_v0_2->unk14 = (s32) (temp_v0_2->unk14 + ptrFontZurichBold); + temp_v0_3 = ptrFontZurichBoldChars + phi_v1_2; + temp_v0_3->unk2C = (s32) (temp_v0_3->unk2C + ptrFontZurichBold); + temp_v0_4 = ptrFontZurichBoldChars + phi_v1_2; + temp_v0_4->unk44 = (s32) (temp_v0_4->unk44 + ptrFontZurichBold); + temp_v0_5 = ptrFontZurichBoldChars + phi_v1_2; temp_v1_2 = phi_v1_2 + 0x60; - temp_v0_5->unk5C = (s32) (temp_v0_5->unk5C + ptrFirstFontTableLarge); + temp_v0_5->unk5C = (s32) (temp_v0_5->unk5C + ptrFontZurichBold); phi_v1_2 = temp_v1_2; if (temp_v1_2 != 0x8d0) { @@ -174,22 +175,22 @@ glabel load_font_tables /* 0E1748 7F0ACC18 AFA6001C */ sw $a2, 0x1c($sp) /* 0E174C 7F0ACC1C 0C0025C8 */ jal mempAllocBytesInBank /* 0E1750 7F0ACC20 24050004 */ li $a1, 4 -/* 0E1754 7F0ACC24 3C078004 */ lui $a3, %hi(ptrFirstFontTableSmall) -/* 0E1758 7F0ACC28 3C088004 */ lui $t0, %hi(ptrSecondFontTableSmall) -/* 0E175C 7F0ACC2C 25080EB0 */ addiu $t0, %lo(ptrSecondFontTableSmall) # addiu $t0, $t0, 0xeb0 -/* 0E1760 7F0ACC30 24E70EAC */ addiu $a3, %lo(ptrFirstFontTableSmall) # addiu $a3, $a3, 0xeac +/* 0E1754 7F0ACC24 3C078004 */ lui $a3, %hi(ptrFontBankGothic) +/* 0E1758 7F0ACC28 3C088004 */ lui $t0, %hi(ptrFontBankGothicChars) +/* 0E175C 7F0ACC2C 25080EB0 */ addiu $t0, %lo(ptrFontBankGothicChars) # addiu $t0, $t0, 0xeb0 +/* 0E1760 7F0ACC30 24E70EAC */ addiu $a3, %lo(ptrFontBankGothic) # addiu $a3, $a3, 0xeac /* 0E1764 7F0ACC34 245902A4 */ addiu $t9, $v0, 0x2a4 -/* 0E1768 7F0ACC38 3C05002E */ lui $a1, %hi(_fonttablectlsmall1SegmentRomStart) # $a1, 0x2e +/* 0E1768 7F0ACC38 3C05002E */ lui $a1, %hi(_fontbankgothicSegmentRomStart) # $a1, 0x2e /* 0E176C 7F0ACC3C ACE20000 */ sw $v0, ($a3) /* 0E1770 7F0ACC40 8FA6001C */ lw $a2, 0x1c($sp) /* 0E1774 7F0ACC44 AD190000 */ sw $t9, ($t0) /* 0E1778 7F0ACC48 00402025 */ move $a0, $v0 /* 0E177C 7F0ACC4C 0C001707 */ jal romCopy -/* 0E1780 7F0ACC50 24A563F0 */ addiu $a1, %lo(_fonttablectlsmall1SegmentRomStart) # addiu $a1, $a1, 0x63f0 -/* 0E1784 7F0ACC54 3C078004 */ lui $a3, %hi(ptrFirstFontTableSmall) -/* 0E1788 7F0ACC58 3C088004 */ lui $t0, %hi(ptrSecondFontTableSmall) -/* 0E178C 7F0ACC5C 25080EB0 */ addiu $t0, %lo(ptrSecondFontTableSmall) # addiu $t0, $t0, 0xeb0 -/* 0E1790 7F0ACC60 24E70EAC */ addiu $a3, %lo(ptrFirstFontTableSmall) # addiu $a3, $a3, 0xeac +/* 0E1780 7F0ACC50 24A563F0 */ addiu $a1, %lo(_fontbankgothicSegmentRomStart) # addiu $a1, $a1, 0x63f0 +/* 0E1784 7F0ACC54 3C078004 */ lui $a3, %hi(ptrFontBankGothic) +/* 0E1788 7F0ACC58 3C088004 */ lui $t0, %hi(ptrFontBankGothicChars) +/* 0E178C 7F0ACC5C 25080EB0 */ addiu $t0, %lo(ptrFontBankGothicChars) # addiu $t0, $t0, 0xeb0 +/* 0E1790 7F0ACC60 24E70EAC */ addiu $a3, %lo(ptrFontBankGothic) # addiu $a3, $a3, 0xeac /* 0E1794 7F0ACC64 00001825 */ move $v1, $zero .L7F0ACC68: /* 0E1798 7F0ACC68 8D090000 */ lw $t1, ($t0) @@ -210,23 +211,23 @@ glabel load_font_tables /* 0E17D4 7F0ACCA4 AFA6001C */ sw $a2, 0x1c($sp) /* 0E17D8 7F0ACCA8 0C0025C8 */ jal mempAllocBytesInBank /* 0E17DC 7F0ACCAC 24050004 */ li $a1, 4 -/* 0E17E0 7F0ACCB0 3C078004 */ lui $a3, %hi(ptrFirstFontTableLarge) -/* 0E17E4 7F0ACCB4 3C088004 */ lui $t0, %hi(ptrSecondFontTableLarge) -/* 0E17E8 7F0ACCB8 25080EB8 */ addiu $t0, %lo(ptrSecondFontTableLarge) # addiu $t0, $t0, 0xeb8 -/* 0E17EC 7F0ACCBC 24E70EB4 */ addiu $a3, %lo(ptrFirstFontTableLarge) # addiu $a3, $a3, 0xeb4 +/* 0E17E0 7F0ACCB0 3C078004 */ lui $a3, %hi(ptrFontZurichBold) +/* 0E17E4 7F0ACCB4 3C088004 */ lui $t0, %hi(ptrFontZurichBoldChars) +/* 0E17E8 7F0ACCB8 25080EB8 */ addiu $t0, %lo(ptrFontZurichBoldChars) # addiu $t0, $t0, 0xeb8 +/* 0E17EC 7F0ACCBC 24E70EB4 */ addiu $a3, %lo(ptrFontZurichBold) # addiu $a3, $a3, 0xeb4 /* 0E17F0 7F0ACCC0 244F02A4 */ addiu $t7, $v0, 0x2a4 -/* 0E17F4 7F0ACCC4 3C05002F */ lui $a1, %hi(_fonttablectllarge1SegmentRomStart) # $a1, 0x2f +/* 0E17F4 7F0ACCC4 3C05002F */ lui $a1, %hi(_fontzurichboldSegmentRomStart) # $a1, 0x2f /* 0E17F8 7F0ACCC8 ACE20000 */ sw $v0, ($a3) /* 0E17FC 7F0ACCCC 8FA6001C */ lw $a2, 0x1c($sp) /* 0E1800 7F0ACCD0 AD0F0000 */ sw $t7, ($t0) /* 0E1804 7F0ACCD4 00402025 */ move $a0, $v0 /* 0E1808 7F0ACCD8 0C001707 */ jal romCopy -/* 0E180C 7F0ACCDC 24A588A0 */ addiu $a1, %lo(_fonttablectllarge1SegmentRomStart) # addiu $a1, $a1, -0x7760 -/* 0E1810 7F0ACCE0 3C088004 */ lui $t0, %hi(ptrSecondFontTableLarge) -/* 0E1814 7F0ACCE4 25080EB8 */ addiu $t0, %lo(ptrSecondFontTableLarge) # addiu $t0, $t0, 0xeb8 +/* 0E180C 7F0ACCDC 24A588A0 */ addiu $a1, %lo(_fontzurichboldSegmentRomStart) # addiu $a1, $a1, -0x7760 +/* 0E1810 7F0ACCE0 3C088004 */ lui $t0, %hi(ptrFontZurichBoldChars) +/* 0E1814 7F0ACCE4 25080EB8 */ addiu $t0, %lo(ptrFontZurichBoldChars) # addiu $t0, $t0, 0xeb8 /* 0E1818 7F0ACCE8 8D020000 */ lw $v0, ($t0) -/* 0E181C 7F0ACCEC 3C078004 */ lui $a3, %hi(ptrFirstFontTableLarge) -/* 0E1820 7F0ACCF0 24E70EB4 */ addiu $a3, %lo(ptrFirstFontTableLarge) # addiu $a3, $a3, 0xeb4 +/* 0E181C 7F0ACCEC 3C078004 */ lui $a3, %hi(ptrFontZurichBold) +/* 0E1820 7F0ACCF0 24E70EB4 */ addiu $a3, %lo(ptrFontZurichBold) # addiu $a3, $a3, 0xeb4 /* 0E1824 7F0ACCF4 8CF90000 */ lw $t9, ($a3) /* 0E1828 7F0ACCF8 8C580014 */ lw $t8, 0x14($v0) /* 0E182C 7F0ACCFC 24030030 */ li $v1, 48 @@ -1118,14 +1119,14 @@ glabel construct_fontchar_microcode #ifdef NONMATCHING -void en_text_write_stuff(void) { +void textRender(void) { } #else #ifdef VERSION_US GLOBAL_ASM( .text -glabel en_text_write_stuff +glabel textRender /* 0E25EC 7F0ADABC 27BDFF58 */ addiu $sp, $sp, -0xa8 /* 0E25F0 7F0ADAC0 240E0001 */ li $t6, 1 /* 0E25F4 7F0ADAC4 3C018004 */ lui $at, %hi(D_80040EA8) @@ -1289,7 +1290,7 @@ glabel en_text_write_stuff /* 0E2844 7F0ADD14 24040002 */ li $a0, 2 /* 0E2848 7F0ADD18 24890080 */ addiu $t1, $a0, 0x80 .L7F0ADD1C: -/* 0E284C 7F0ADD1C 0FC3068C */ jal something_with_LnameX +/* 0E284C 7F0ADD1C 0FC3068C */ jal langGetJpnCharPixels /* 0E2850 7F0ADD20 AFA9006C */ sw $t1, 0x6c($sp) /* 0E2854 7F0ADD24 8FAC00A0 */ lw $t4, 0xa0($sp) /* 0E2858 7F0ADD28 8FA800C8 */ lw $t0, 0xc8($sp) @@ -1332,7 +1333,7 @@ glabel en_text_write_stuff #ifdef VERSION_JP GLOBAL_ASM( .text -glabel en_text_write_stuff +glabel textRender /* 0E25EC 7F0ADABC 27BDFF58 */ addiu $sp, $sp, -0xa8 /* 0E25F0 7F0ADAC0 240E0001 */ li $t6, 1 /* 0E25F4 7F0ADAC4 3C018004 */ lui $at, %hi(D_80040EA8) @@ -1496,7 +1497,7 @@ glabel en_text_write_stuff /* 0E2844 7F0ADD14 24040002 */ li $a0, 2 /* 0E2848 7F0ADD18 24890080 */ addiu $t1, $a0, 0x80 .L7F0ADD1C: -/* 0E284C 7F0ADD1C 0FC3068C */ jal something_with_LnameX +/* 0E284C 7F0ADD1C 0FC3068C */ jal langGetJpnCharPixels /* 0E2850 7F0ADD20 AFA9006C */ sw $t1, 0x6c($sp) /* 0E2854 7F0ADD24 8FAC00A0 */ lw $t4, 0xa0($sp) /* 0E2858 7F0ADD28 8FA800C8 */ lw $t0, 0xc8($sp) @@ -1540,7 +1541,7 @@ glabel en_text_write_stuff #ifdef VERSION_EU GLOBAL_ASM( .text -glabel en_text_write_stuff +glabel textRender /* 0DF76C 7F0ACD7C 27BDFF58 */ addiu $sp, $sp, -0xa8 /* 0DF770 7F0ACD80 240E0001 */ li $t6, 1 /* 0DF774 7F0ACD84 3C018004 */ lui $at, %hi(D_80040EA8) # $at, 0x8004 @@ -1704,7 +1705,7 @@ glabel en_text_write_stuff /* 0DF9C4 7F0ACFD4 24040002 */ li $a0, 2 /* 0DF9C8 7F0ACFD8 24890080 */ addiu $t1, $a0, 0x80 .L7F0ACFDC: -/* 0DF9CC 7F0ACFDC 0FC303C4 */ jal something_with_LnameX +/* 0DF9CC 7F0ACFDC 0FC303C4 */ jal langGetJpnCharPixels /* 0DF9D0 7F0ACFE0 AFA9006C */ sw $t1, 0x6c($sp) /* 0DF9D4 7F0ACFE4 8FAC00A0 */ lw $t4, 0xa0($sp) /* 0DF9D8 7F0ACFE8 8FA800C8 */ lw $t0, 0xc8($sp) @@ -2398,14 +2399,14 @@ glabel sub_GAME_7F0AE45C #ifdef NONMATCHING -void jp_text_write_stuff(void) { +void textRenderGlow(void) { } #else #ifdef VERSION_US GLOBAL_ASM( .text -glabel jp_text_write_stuff +glabel textRenderGlow /* 0E321C 7F0AE6EC 27BDFF68 */ addiu $sp, $sp, -0x98 /* 0E3220 7F0AE6F0 240E0001 */ li $t6, 1 /* 0E3224 7F0AE6F4 3C018004 */ lui $at, %hi(D_80040EA8) @@ -2542,7 +2543,7 @@ glabel jp_text_write_stuff /* 0E3414 7F0AE8E4 24040002 */ li $a0, 2 /* 0E3418 7F0AE8E8 248B0080 */ addiu $t3, $a0, 0x80 .L7F0AE8EC: -/* 0E341C 7F0AE8EC 0FC3068C */ jal something_with_LnameX +/* 0E341C 7F0AE8EC 0FC3068C */ jal langGetJpnCharPixels /* 0E3420 7F0AE8F0 AFAB0074 */ sw $t3, 0x74($sp) /* 0E3424 7F0AE8F4 8FAC0090 */ lw $t4, 0x90($sp) /* 0E3428 7F0AE8F8 8FAD00B4 */ lw $t5, 0xb4($sp) @@ -2589,7 +2590,7 @@ glabel jp_text_write_stuff #ifdef VERSION_JP GLOBAL_ASM( .text -glabel jp_text_write_stuff +glabel textRenderGlow /* 0E321C 7F0AE6EC 27BDFF68 */ addiu $sp, $sp, -0x98 /* 0E3220 7F0AE6F0 240E0001 */ li $t6, 1 /* 0E3224 7F0AE6F4 3C018004 */ lui $at, %hi(D_80040EA8) @@ -2726,7 +2727,7 @@ glabel jp_text_write_stuff /* 0E3414 7F0AE8E4 24040002 */ li $a0, 2 /* 0E3418 7F0AE8E8 248B0080 */ addiu $t3, $a0, 0x80 .L7F0AE8EC: -/* 0E341C 7F0AE8EC 0FC3068C */ jal something_with_LnameX +/* 0E341C 7F0AE8EC 0FC3068C */ jal langGetJpnCharPixels /* 0E3420 7F0AE8F0 AFAB0074 */ sw $t3, 0x74($sp) /* 0E3424 7F0AE8F4 8FAC0090 */ lw $t4, 0x90($sp) /* 0E3428 7F0AE8F8 8FAD00B4 */ lw $t5, 0xb4($sp) @@ -2774,7 +2775,7 @@ glabel jp_text_write_stuff #ifdef VERSION_EU GLOBAL_ASM( .text -glabel jp_text_write_stuff +glabel textRenderGlow /* 0E039C 7F0AD9AC 27BDFF68 */ addiu $sp, $sp, -0x98 /* 0E03A0 7F0AD9B0 240E0001 */ li $t6, 1 /* 0E03A4 7F0AD9B4 3C018004 */ lui $at, %hi(D_80040EA8) # $at, 0x8004 @@ -2911,7 +2912,7 @@ glabel jp_text_write_stuff /* 0E0594 7F0ADBA4 24040002 */ li $a0, 2 /* 0E0598 7F0ADBA8 248B0080 */ addiu $t3, $a0, 0x80 .L7F0ADBAC: -/* 0E059C 7F0ADBAC 0FC303C4 */ jal something_with_LnameX +/* 0E059C 7F0ADBAC 0FC303C4 */ jal langGetJpnCharPixels /* 0E05A0 7F0ADBB0 AFAB0074 */ sw $t3, 0x74($sp) /* 0E05A4 7F0ADBB4 8FAC0090 */ lw $t4, 0x90($sp) /* 0E05A8 7F0ADBB8 8FAD00B4 */ lw $t5, 0xb4($sp) @@ -2962,13 +2963,87 @@ glabel jp_text_write_stuff #ifdef NONMATCHING -void sub_GAME_7F0AE98C(void) { +void textMeasure(s32 *textheight, s32 *textwidth, char *text, struct fontchar *font1, struct font *font2, s32 lineheight) +{ + unsigned char prevchar; + unsigned char thischar; + s32 longest; + s32 tmp; + + prevchar = 'H'; + thischar = '\0'; + longest = 0; + *textheight = 0; + *textwidth = 0; + + + if (lineheight == 0) + { + lineheight = font1['['].baseline + font1['['].height; + } + if ((j_text_trigger) && (lineheight < 14)) + { + lineheight = 14; + } + if (text) + { + while (*text != '\0') + { + if (*text == ' ') + { + // Space + if (text[1] != '\n') { + *textwidth += 5; + } + + prevchar = 'H'; + text++; + } else if (*text == '\n') { + // Line break + + if (*textwidth > longest) { + longest = *textwidth; + } + + *textwidth = 0; + *textheight += lineheight; + text++; + } else if (*text < 0x80) + { + // Normal single-byte character + thischar = *text; + tmp = font2->kerning[font1[prevchar - 0x21].kerningindex * 13 + font1[thischar - 0x21].kerningindex] + text_spacing - 1; + *textwidth = font1[thischar - 0x21].width + *textwidth - tmp; + + prevchar = *text; + text++; + } + else if ((s32) text < 0xC0) + { + // Multi-byte character + tmp = font2->kerning[0] + text_spacing - 1; + *textwidth = *textwidth - tmp + 11; + text += 2; + } + else + { + // Multi-byte character + tmp = font2->kerning[0] + text_spacing - 1; + *textwidth = *textwidth - tmp + 15; + text += 2; + } + }; + } + if (*textwidth < longest) + { + *textwidth = longest; + } } #else GLOBAL_ASM( .text -glabel sub_GAME_7F0AE98C +glabel textMeasure /* 0E34BC 7F0AE98C 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0E34C0 7F0AE990 AFB00008 */ sw $s0, 8($sp) /* 0E34C4 7F0AE994 8FB0002C */ lw $s0, 0x2c($sp) @@ -3180,7 +3255,7 @@ glabel sub_GAME_7F0AEB64 /* 0E377C 7F0AEC4C 27A4007C */ addiu $a0, $sp, 0x7c /* 0E3780 7F0AEC50 02803025 */ move $a2, $s4 /* 0E3784 7F0AEC54 02603825 */ move $a3, $s3 -/* 0E3788 7F0AEC58 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E3788 7F0AEC58 0FC2BA63 */ jal textMeasure /* 0E378C 7F0AEC5C AFB90010 */ sw $t9, 0x10($sp) /* 0E3790 7F0AEC60 8FAB008C */ lw $t3, 0x8c($sp) /* 0E3794 7F0AEC64 8FAE0080 */ lw $t6, 0x80($sp) diff --git a/src/game/textrelated.h b/src/game/textrelated.h index 1b34a05e..23dacc03 100644 --- a/src/game/textrelated.h +++ b/src/game/textrelated.h @@ -3,19 +3,39 @@ #include #include "bondtypes.h" -extern s32 ptrFirstFontTableSmall; -extern s32 ptrSecondFontTableSmall; -extern s32 ptrFirstFontTableLarge; -extern s32 ptrSecondFontTableLarge; +extern s32 ptrFontBankGothic; +extern s32 ptrFontBankGothicChars; +extern s32 ptrFontZurichBold; +extern s32 ptrFontZurichBoldChars; void textrelatedInit_REMOVED(void); void load_font_tables(void); +struct fontchar { + u32 index; + s32 baseline; + u32 height; + u32 width; + s32 kerningindex; + u8 *pixeldata; +}; + +struct font { + s32 kerning[13 * 13]; + struct fontchar chars[94]; // can be 135 in PAL +}; + Gfx * microcode_constructor_related_to_menus(Gfx *, s32, s32, s32, s32, s32); -void sub_GAME_7F0AE98C(s32 *y2, s32 *x2, u8 *text, s32 ptrSecondFontTableLarge, s32 ptrFirstFontTableLarge, s32 unk5); +void textMeasure(s32 *textheight, s32 *textwidth, char *text, struct fontchar *font1, struct font *font2, s32 lineheight); Gfx *microcode_constructor(Gfx *gdl); -Gfx *en_text_write_stuff(Gfx *gdl, s32 *x, s32 *y, char *text, s32 second_font_table, s32 first_font_table, s32 arg6, s16 view_x, s16 view_y, s32 arg9, s32 arga); -Gfx *jp_text_write_stuff(Gfx *gdl, s32 *x, s32 *y, s8 *text, s32 second_font_table, s32 first_font_table, s32 arg6, u32 arg7, s16 view_x, s16 view_y, s32 arga, s32 argb); +Gfx *textRender(Gfx *gdl, s32 *x, s32 *y, char *text, s32 second_font_table, s32 first_font_table, s32 arg6, s16 view_x, s16 view_y, s32 arg9, s32 arga); +Gfx *textRenderGlow(Gfx *gdl, s32 *x, s32 *y, s8 *text, s32 second_font_table, s32 first_font_table, s32 arg6, u32 arg7, s16 view_x, s16 view_y, s32 arga, s32 argb); + +Gfx *combiner_bayer_lod_perspective(Gfx *gdl); +void setTextSpacingInverted(s32 spacing); +void setTextWordWrap(s32 flag); +void sub_GAME_7F0AEB64(s32 arg0, s8 *arg1, s8 *arg2, struct fontchar *arg3, struct font *arg4); +void setTextOverlapCorrection(s32 flag); #endif diff --git a/src/game/title.c b/src/game/title.c index 291589a2..bde051e6 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -66,8 +66,12 @@ s32 dword_CODE_bss_80069594; u32 D_8002A7D0 = 0; u8 gunbarrel_mode = 0x3; u32 D_8002A7D8 = 0; +/* s32 D_8002A7DC[3] = {0x00, 0x00, 0x00}; s32 D_8002A7E8[3] = {0xFF, 0xFF, 0xFF}; +*/ +struct FolderSelect D_8002A7DC = { 0x00, 0x00, 0x00 }; +struct FolderSelect D_8002A7E8 = { 0xFF, 0xFF, 0xFF }; u32 D_8002A7F4 = 0; u32 D_8002A7F8 = 0; u32 D_8002A7FC = 0; @@ -139,7 +143,7 @@ Gfx *insert_sight_backdrop_eye_intro(Gfx *gdl) return gdl; } -Gfx *sub_GAME_7F007CC8(Gfx *gdl, s32 arg1, s32 arg2[3], s32 arg3[3]) +Gfx *sub_GAME_7F007CC8(Gfx *gdl, s32 arg1, struct FolderSelect *arg2, struct FolderSelect *arg3) { gDPSetRenderMode(gdl++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetCycleType(gdl++, G_CYC_1CYCLE); @@ -152,8 +156,8 @@ Gfx *sub_GAME_7F007CC8(Gfx *gdl, s32 arg1, s32 arg2[3], s32 arg3[3]) Gfx *insert_sniper_sight_eye_intro(Gfx *gdl) { - s32 sp3C[3] = D_8002A7DC; - s32 sp30[3] = D_8002A7E8; + struct FolderSelect sp3C = D_8002A7DC; + struct FolderSelect sp30 = D_8002A7E8; gSPDisplayList(gdl++, &fontDL_0x000); @@ -161,7 +165,7 @@ Gfx *insert_sniper_sight_eye_intro(Gfx *gdl) gDPSetCombineMode(gdl++, G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM); - return sub_GAME_7F007CC8(gdl, floorFloat((viGetX() * g_TitleX) / 1280.0f), sp3C, sp30); + return sub_GAME_7F007CC8(gdl, floorFloat((viGetX() * g_TitleX) / 1280.0f), &sp3C, &sp30); } Gfx *sub_GAME_7F007E70(Gfx *gdl, u32 alpha) @@ -261,7 +265,7 @@ glabel sub_GAME_7F007F30 .L7F008030: /* 03CB60 7F008030 8E640000 */ lw $a0, ($s3) /* 03CB64 7F008034 24050001 */ li $a1, 1 -/* 03CB68 7F008038 0FC1C2BB */ jal sub_GAME_7F070AEC +/* 03CB68 7F008038 0FC1C2BB */ jal modelTickAnimQuarterSpeed /* 03CB6C 7F00803C 24060001 */ li $a2, 1 /* 03CB70 7F008040 8E0C0000 */ lw $t4, ($s0) /* 03CB74 7F008044 240100E6 */ li $at, 230 @@ -281,7 +285,7 @@ glabel sub_GAME_7F007F30 .L7F008078: /* 03CBA8 7F008078 3C138003 */ lui $s3, %hi(D_8002A7F4) /* 03CBAC 7F00807C 2673A7F4 */ addiu $s3, %lo(D_8002A7F4) # addiu $s3, $s3, -0x580c -/* 03CBB0 7F008080 0FC1B100 */ jal set_80036084 +/* 03CBB0 7F008080 0FC1B100 */ jal modelSetDistanceDisabled /* 03CBB4 7F008084 24040001 */ li $a0, 1 /* 03CBB8 7F008088 0FC1CFF2 */ jal sub_GAME_7F073FC8 /* 03CBBC 7F00808C 24040050 */ li $a0, 80 @@ -324,7 +328,7 @@ glabel sub_GAME_7F007F30 /* 03CC48 7F008118 8E8A0000 */ lw $t2, ($s4) /* 03CC4C 7F00811C 8E640000 */ lw $a0, ($s3) /* 03CC50 7F008120 00003025 */ move $a2, $zero -/* 03CC54 7F008124 0FC1B198 */ jal sub_GAME_7F06C660 +/* 03CC54 7F008124 0FC1B198 */ jal modelFindNodeMtx /* 03CC58 7F008128 8D45001C */ lw $a1, 0x1c($t2) /* 03CC5C 7F00812C 8E8B0000 */ lw $t3, ($s4) /* 03CC60 7F008130 AFA200DC */ sw $v0, 0xdc($sp) @@ -364,7 +368,7 @@ glabel sub_GAME_7F007F30 /* 03CCE8 7F0081B8 27A400DC */ addiu $a0, $sp, 0xdc /* 03CCEC 7F0081BC 0FC1AF03 */ jal drawjointlist /* 03CCF0 7F0081C0 02002825 */ move $a1, $s0 -/* 03CCF4 7F0081C4 0FC1B100 */ jal set_80036084 +/* 03CCF4 7F0081C4 0FC1B100 */ jal modelSetDistanceDisabled /* 03CCF8 7F0081C8 00002025 */ move $a0, $zero /* 03CCFC 7F0081CC 0FC1AC92 */ jal sub_GAME_7F06B248 /* 03CD00 7F0081D0 02002025 */ move $a0, $s0 @@ -513,7 +517,7 @@ glabel sub_GAME_7F007F30 .L7F007FB0: /* 03A9A0 7F007FB0 8E640000 */ lw $a0, ($s3) /* 03A9A4 7F007FB4 24050001 */ li $a1, 1 -/* 03A9A8 7F007FB8 0FC1C323 */ jal sub_GAME_7F070AEC +/* 03A9A8 7F007FB8 0FC1C323 */ jal modelTickAnimQuarterSpeed /* 03A9AC 7F007FBC 24060001 */ li $a2, 1 /* 03A9B0 7F007FC0 8E0C0000 */ lw $t4, ($s0) /* 03A9B4 7F007FC4 240100BF */ li $at, 191 @@ -533,7 +537,7 @@ glabel sub_GAME_7F007F30 .L7F007FF8: /* 03A9E8 7F007FF8 3C138002 */ lui $s3, %hi(D_8002A7F4) # $s3, 0x8002 /* 03A9EC 7F007FFC 26735D44 */ addiu $s3, %lo(D_8002A7F4) # addiu $s3, $s3, 0x5d44 -/* 03A9F0 7F008000 0FC1B2D0 */ jal set_80036084 +/* 03A9F0 7F008000 0FC1B2D0 */ jal modelSetDistanceDisabled /* 03A9F4 7F008004 24040001 */ li $a0, 1 /* 03A9F8 7F008008 0FC1D037 */ jal sub_GAME_7F073FC8 /* 03A9FC 7F00800C 24040050 */ li $a0, 80 @@ -576,7 +580,7 @@ glabel sub_GAME_7F007F30 /* 03AA88 7F008098 8E8A0000 */ lw $t2, ($s4) /* 03AA8C 7F00809C 8E640000 */ lw $a0, ($s3) /* 03AA90 7F0080A0 00003025 */ move $a2, $zero -/* 03AA94 7F0080A4 0FC1B366 */ jal sub_GAME_7F06C660 +/* 03AA94 7F0080A4 0FC1B366 */ jal modelFindNodeMtx /* 03AA98 7F0080A8 8D45001C */ lw $a1, 0x1c($t2) /* 03AA9C 7F0080AC 8E8B0000 */ lw $t3, ($s4) /* 03AAA0 7F0080B0 AFA200DC */ sw $v0, 0xdc($sp) @@ -616,7 +620,7 @@ glabel sub_GAME_7F007F30 /* 03AB28 7F008138 27A400DC */ addiu $a0, $sp, 0xdc /* 03AB2C 7F00813C 0FC1B0EF */ jal drawjointlist /* 03AB30 7F008140 02002825 */ move $a1, $s0 -/* 03AB34 7F008144 0FC1B2D0 */ jal set_80036084 +/* 03AB34 7F008144 0FC1B2D0 */ jal modelSetDistanceDisabled /* 03AB38 7F008148 00002025 */ move $a0, $zero /* 03AB3C 7F00814C 0FC1AE7E */ jal sub_GAME_7F06B248 /* 03AB40 7F008150 02002025 */ move $a0, $s0 @@ -761,16 +765,16 @@ Gfx *load_display_rare_logo(Gfx *gdl, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { return gdl; } -extern void *_GlobalimagetablecmdblkSegmentRomStart; -extern void *_GlobalimagetablecmdblkSegmentStart; -extern void *_GlobalimagetablecmdblkSegmentEnd; +extern void *_rarewarelogoSegmentRomStart; +extern void *_rarewarelogoSegmentStart; +extern void *_rarewarelogoSegmentEnd; void sub_GAME_7F008B58(s32 address, s32 size) { gunbarrel_mode = 0; g_TitleX = 880.0f; D_8002A89C = -40.0f; intro_eye_counter = 0; virtualaddress = address; - romCopy(virtualaddress, &_GlobalimagetablecmdblkSegmentRomStart, ALIGN64_V2((u32)&_GlobalimagetablecmdblkSegmentEnd - (u32)&_GlobalimagetablecmdblkSegmentStart)); + romCopy(virtualaddress, &_rarewarelogoSegmentRomStart, ALIGN64_V2((u32)&_rarewarelogoSegmentEnd - (u32)&_rarewarelogoSegmentStart)); } Gfx *retrieve_display_rareware_logo(Gfx *gdl) @@ -1051,7 +1055,7 @@ glabel sub_GAME_7F008E80 /* 03DC0C 7F0090DC 24050000 */ li $a1, 0 /* 03DC10 7F0090E0 8E240000 */ lw $a0, ($s1) /* 03DC14 7F0090E4 3C053F00 */ lui $a1, 0x3f00 -/* 03DC18 7F0090E8 0FC1BFC6 */ jal modelSetAnimRateForDuration +/* 03DC18 7F0090E8 0FC1BFC6 */ jal modelSetAnimPlaySpeed /* 03DC1C 7F0090EC 24060000 */ li $a2, 0 /* 03DC20 7F0090F0 3C0F8007 */ lui $t7, %hi(ptr_animation_table) /* 03DC24 7F0090F4 8DEF9538 */ lw $t7, %lo(ptr_animation_table)($t7) @@ -1290,7 +1294,7 @@ glabel sub_GAME_7F008E80 /* 03BA50 7F009060 3C053F19 */ lui $a1, (0x3F19999A >> 16) # lui $a1, 0x3f19 /* 03BA54 7F009064 34A5999A */ ori $a1, (0x3F19999A & 0xFFFF) # ori $a1, $a1, 0x999a /* 03BA58 7F009068 8E240000 */ lw $a0, ($s1) -/* 03BA5C 7F00906C 0FC1C02E */ jal modelSetAnimRateForDuration +/* 03BA5C 7F00906C 0FC1C02E */ jal modelSetAnimPlaySpeed /* 03BA60 7F009070 24060000 */ li $a2, 0 /* 03BA64 7F009074 3C0F8006 */ lui $t7, %hi(ptr_animation_table) # $t7, 0x8006 /* 03BA68 7F009078 8DEF8478 */ lw $t7, %lo(ptr_animation_table)($t7) @@ -1374,7 +1378,7 @@ void sub_GAME_7F00920C(void) { if (D_8002A7F4) { - set_aircraft_obj_inst_scale_to_zero(D_8002A7F4); + clear_aircraft_model_obj(D_8002A7F4); } if (D_8002A7F8) @@ -1450,7 +1454,9 @@ Gfx *sub_GAME_7F009254(Gfx *gdl) { break; case 2: - gdl = insert_bond_eye_intro(insert_sight_backdrop_eye_intro(insert_sniper_sight_eye_intro(gdl))); + gdl = insert_sniper_sight_eye_intro(gdl); + gdl = insert_sight_backdrop_eye_intro(gdl); + gdl = insert_bond_eye_intro(gdl); intro_eye_counter--; if (intro_eye_counter < 0) { gunbarrel_mode++; diff --git a/src/game/title.h b/src/game/title.h index a5f009fd..0f7c6ae7 100644 --- a/src/game/title.h +++ b/src/game/title.h @@ -22,4 +22,6 @@ extern s32 virtualaddress; extern s32 dword_CODE_bss_80069594; extern u32 D_8002A7D0; + +Gfx *sub_GAME_7F007CC8(Gfx *gdl, s32 arg1, struct FolderSelect *arg2, struct FolderSelect *arg3); #endif diff --git a/src/game/unk_01B240.h b/src/game/unk_01B240.h index ec31c73c..8053bee1 100644 --- a/src/game/unk_01B240.h +++ b/src/game/unk_01B240.h @@ -4,6 +4,6 @@ #include "include/PR/gbi.h" -Gfx *sub_GAME_7F01B240(Gfx*, s32, s32, s32[3], s32[3]); +Gfx *sub_GAME_7F01B240(Gfx*, s32, s32, struct FolderSelect *, struct FolderSelect *); #endif diff --git a/src/game/unk_09B7A0.c b/src/game/unk_09B7A0.c index bff88b26..31dce50c 100644 --- a/src/game/unk_09B7A0.c +++ b/src/game/unk_09B7A0.c @@ -1,401 +1,137 @@ #include #include +#include "bondtypes.h" #include "unk_09B7A0.h" +// unsure if these structs are defined as something else, elsewhere +struct unk_09B7A0_struct_child { + s32 unk00; + s32 unk04; + s32 unk08; + s32 unk0C; +}; + +// unsure if these structs are defined as something else, elsewhere +struct unk_09B7A0_struct_parent { + struct unk_09B7A0_struct_child* unk00; + s32 unk04; + s32 unk08; + s16 unk0C; + s16 unk0E; + s16 unk10; + s16 unk12; +}; + // bss //CODE.bss:8007A0D0 -s32 dword_CODE_bss_8007A0D0; +s32 dword_CODE_bss_8007A0D0; // item count for dword_CODE_bss_8007A0E0 //CODE.bss:8007A0D4 -s32 dword_CODE_bss_8007A0D4; +s32 dword_CODE_bss_8007A0D4; // item count for dword_CODE_bss_8007A0E8 //CODE.bss:8007A0D8 -s32 dword_CODE_bss_8007A0D8; +s32 dword_CODE_bss_8007A0D8; // item count for dword_CODE_bss_8007A0E4 //CODE.bss:8007A0DC -s32 dword_CODE_bss_8007A0DC; +s32 dword_CODE_bss_8007A0DC; // item count for dword_CODE_bss_8007A0EC //CODE.bss:8007A0E0 -s32 dword_CODE_bss_8007A0E0; +struct unk_09B7A0_struct_parent* dword_CODE_bss_8007A0E0; // array ( uses dword_CODE_bss_8007A0D0 as alloc count, item size 0x10 ) //CODE.bss:8007A0E4 -s32 dword_CODE_bss_8007A0E4; +struct unk_09B7A0_struct_parent* dword_CODE_bss_8007A0E4; // array ( uses dword_CODE_bss_8007A0D8 as alloc count, item size 0x10 ) //CODE.bss:8007A0E8 -s32 dword_CODE_bss_8007A0E8; +struct unk_09B7A0_struct_parent* dword_CODE_bss_8007A0E8; // array ( uses dword_CODE_bss_8007A0D4 as alloc count, item size 0x14 ) //CODE.bss:8007A0EC -s32 dword_CODE_bss_8007A0EC; +struct unk_09B7A0_struct_parent* dword_CODE_bss_8007A0EC; // array ( uses dword_CODE_bss_8007A0DC as alloc count, item size 0x14 ) //CODE.bss:8007A0F0 s16 word_CODE_bss_8007A0F0; //CODE.bss:8007A0F2 s16 word_CODE_bss_8007A0F2; - - -void null_init_main_1(void) { +void null_init_main_1(void) +{ return; } - - -#ifdef NONMATCHING -void sub_GAME_7F09B7A8(void) { - //extern s32 dword_CODE_bss_8007A0D4; - //extern s32 dword_CODE_bss_8007A0E8; - - s32 temp_v0; - s32 temp_v1; - s32 phi_v0; - - temp_v1 = dword_CODE_bss_8007A0D4; - phi_v0 = 0; - if (temp_v1 > 0) { - do { - temp_v0 = phi_v0 + 0x14; - phi_v0 = temp_v0; - } while (temp_v0 < (temp_v1 * 0x14)); +void sub_GAME_7F09B7A8(void) +{ + s32 i; + for (i = 0; i < dword_CODE_bss_8007A0D4; i++) + { + if (dword_CODE_bss_8007A0E8[i].unk00); } - } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F09B7A8 -/* 0D02D8 7F09B7A8 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007A0D4) -/* 0D02DC 7F09B7AC 8C63A0D4 */ lw $v1, %lo(dword_CODE_bss_8007A0D4)($v1) -/* 0D02E0 7F09B7B0 00001025 */ move $v0, $zero -/* 0D02E4 7F09B7B4 3C048008 */ lui $a0, %hi(dword_CODE_bss_8007A0E8) -/* 0D02E8 7F09B7B8 18600008 */ blez $v1, .L7F09B7DC -/* 0D02EC 7F09B7BC 00032880 */ sll $a1, $v1, 2 -/* 0D02F0 7F09B7C0 00A32821 */ addu $a1, $a1, $v1 -/* 0D02F4 7F09B7C4 00052880 */ sll $a1, $a1, 2 -/* 0D02F8 7F09B7C8 8C84A0E8 */ lw $a0, %lo(dword_CODE_bss_8007A0E8)($a0) -.L7F09B7CC: -/* 0D02FC 7F09B7CC 24420014 */ addiu $v0, $v0, 0x14 -/* 0D0300 7F09B7D0 0045082A */ slt $at, $v0, $a1 -/* 0D0304 7F09B7D4 1420FFFD */ bnez $at, .L7F09B7CC -/* 0D0308 7F09B7D8 24840014 */ addiu $a0, $a0, 0x14 -.L7F09B7DC: -/* 0D030C 7F09B7DC 03E00008 */ jr $ra -/* 0D0310 7F09B7E0 00000000 */ nop -) -#endif - - - - - -#ifdef NONMATCHING -void sub_GAME_7F09B7E4(void) { - //extern s32 dword_CODE_bss_8007A0DC; - //extern s32 dword_CODE_bss_8007A0EC; - s32 temp_v0; - s32 temp_v1; - s32 phi_v0; - - temp_v1 = dword_CODE_bss_8007A0DC; - phi_v0 = 0; - if (temp_v1 > 0) { - do { - temp_v0 = phi_v0 + 0x14; - phi_v0 = temp_v0; - } while (temp_v0 < (temp_v1 * 0x14)); +void sub_GAME_7F09B7E4(void) +{ + s32 i; + for (i = 0; i < dword_CODE_bss_8007A0DC; i++) + { + if (dword_CODE_bss_8007A0EC[i].unk00); } - } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F09B7E4 -/* 0D0314 7F09B7E4 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007A0DC) -/* 0D0318 7F09B7E8 8C63A0DC */ lw $v1, %lo(dword_CODE_bss_8007A0DC)($v1) -/* 0D031C 7F09B7EC 00001025 */ move $v0, $zero -/* 0D0320 7F09B7F0 3C048008 */ lui $a0, %hi(dword_CODE_bss_8007A0EC) -/* 0D0324 7F09B7F4 18600008 */ blez $v1, .L7F09B818 -/* 0D0328 7F09B7F8 00032880 */ sll $a1, $v1, 2 -/* 0D032C 7F09B7FC 00A32821 */ addu $a1, $a1, $v1 -/* 0D0330 7F09B800 00052880 */ sll $a1, $a1, 2 -/* 0D0334 7F09B804 8C84A0EC */ lw $a0, %lo(dword_CODE_bss_8007A0EC)($a0) -.L7F09B808: -/* 0D0338 7F09B808 24420014 */ addiu $v0, $v0, 0x14 -/* 0D033C 7F09B80C 0045082A */ slt $at, $v0, $a1 -/* 0D0340 7F09B810 1420FFFD */ bnez $at, .L7F09B808 -/* 0D0344 7F09B814 24840014 */ addiu $a0, $a0, 0x14 -.L7F09B818: -/* 0D0348 7F09B818 03E00008 */ jr $ra -/* 0D034C 7F09B81C 00000000 */ nop -) -#endif - - +void sub_GAME_7F09B820(void) +{ + u32 tmp; + s32 stage; + s32 i; + tmp = 0x5DC; -#ifdef NONMATCHING -void sub_GAME_7F09B820(void) { - //s32 getPlayerCount(); /* extern */ - //s32 lvlGetCurrentStageToLoad(); /* extern */ - //void *mempAllocBytesInBank(s32, ?, void **); /* extern */ - //extern s32 dword_CODE_bss_8007A0D0; - //extern s32 dword_CODE_bss_8007A0D4; - //extern s32 dword_CODE_bss_8007A0D8; - //extern s32 dword_CODE_bss_8007A0DC; - //extern void *dword_CODE_bss_8007A0E0; - //extern void *dword_CODE_bss_8007A0E4; - //extern void *dword_CODE_bss_8007A0E8; - //extern void *dword_CODE_bss_8007A0EC; - //extern s16 word_CODE_bss_8007A0F0; - //extern s16 word_CODE_bss_8007A0F2; - - s32 temp_v0; - s32 temp_v1; - s32 temp_v1_2; - s32 *phi_t0; - s32 phi_v0; - s32 phi_v1; - s32 phi_v0_2; - s32 phi_v1_2; - - if (getPlayerCount() >= 2) { + if (getPlayerCount() >= 2) + { dword_CODE_bss_8007A0D0 = 0xBB8; dword_CODE_bss_8007A0D4 = 0x50; dword_CODE_bss_8007A0D8 = 0x1F4; - goto block_6; - } - temp_v0 = lvlGetCurrentStageToLoad(); - if ((temp_v0 != 0x1E) && (temp_v0 != 0x1D)) { - dword_CODE_bss_8007A0D0 = 0x1F4; - dword_CODE_bss_8007A0D4 = 0x14; - dword_CODE_bss_8007A0D8 = 0x5DC; - dword_CODE_bss_8007A0DC = 0x28; - phi_t0 = &dword_CODE_bss_8007A0D4; - } else { - dword_CODE_bss_8007A0D0 = 0x1F4; - dword_CODE_bss_8007A0D4 = 0x14; - dword_CODE_bss_8007A0D8 = 0x1F4; -block_6: dword_CODE_bss_8007A0DC = 0x14; - phi_t0 = &dword_CODE_bss_8007A0D4; } - dword_CODE_bss_8007A0E8 = mempAllocBytesInBank(*phi_t0 * 0x14, 4); - dword_CODE_bss_8007A0E0 = mempAllocBytesInBank(dword_CODE_bss_8007A0D0 * 0x10, 4, &dword_CODE_bss_8007A0E8); - dword_CODE_bss_8007A0EC = mempAllocBytesInBank(dword_CODE_bss_8007A0DC * 0x14, 4); - dword_CODE_bss_8007A0E4 = mempAllocBytesInBank(dword_CODE_bss_8007A0D8 * 0x10, 4); + else + { + stage = lvlGetCurrentStageToLoad(); + if ((stage != 0x1E) && (stage != 0x1D)) + { + dword_CODE_bss_8007A0D0 = 0x1F4; + dword_CODE_bss_8007A0D4 = 0x14; + dword_CODE_bss_8007A0D8 = tmp; + dword_CODE_bss_8007A0DC = 0x28; + } + else + { + dword_CODE_bss_8007A0D0 = 0x1F4; + dword_CODE_bss_8007A0D4 = 0x14; + dword_CODE_bss_8007A0D8 = 0x1F4; + dword_CODE_bss_8007A0DC = 0x14; + } + } + + tmp = 0x14; + dword_CODE_bss_8007A0E8 = mempAllocBytesInBank(dword_CODE_bss_8007A0D4 * tmp, 4U); + dword_CODE_bss_8007A0E0 = mempAllocBytesInBank(dword_CODE_bss_8007A0D0 * 0x10, 4U); + dword_CODE_bss_8007A0EC = mempAllocBytesInBank(dword_CODE_bss_8007A0DC * tmp, 4U); + dword_CODE_bss_8007A0E4 = mempAllocBytesInBank(dword_CODE_bss_8007A0D8 * 0x10, 4U); + word_CODE_bss_8007A0F0 = (s16) dword_CODE_bss_8007A0D0; - dword_CODE_bss_8007A0E8->unk0 = (void *) dword_CODE_bss_8007A0E0; - dword_CODE_bss_8007A0E8->unkC = (s16) dword_CODE_bss_8007A0D0; - dword_CODE_bss_8007A0E8->unkE = 0; + dword_CODE_bss_8007A0E8->unk00 = (struct unk_09B7A0_struct_child *) dword_CODE_bss_8007A0E0; + dword_CODE_bss_8007A0E8->unk0C = (s16) dword_CODE_bss_8007A0D0; + dword_CODE_bss_8007A0E8->unk0E = 0; dword_CODE_bss_8007A0E8->unk10 = -1; dword_CODE_bss_8007A0E8->unk12 = -1; - phi_v0 = 0x14; - phi_v1 = 1; - phi_v0_2 = 0x14; - if (dword_CODE_bss_8007A0D4 >= 2) { - do { - temp_v1 = phi_v1 + 1; - (dword_CODE_bss_8007A0E8 + phi_v0)->unkE = -1; - phi_v0 += 0x14; - phi_v1 = temp_v1; - } while (temp_v1 < dword_CODE_bss_8007A0D4); + + for (i = 1; i < dword_CODE_bss_8007A0D4; i++) + { + dword_CODE_bss_8007A0E8[i].unk0E = -1; } + word_CODE_bss_8007A0F2 = (s16) dword_CODE_bss_8007A0D8; - dword_CODE_bss_8007A0EC->unk0 = (void *) dword_CODE_bss_8007A0E4; - dword_CODE_bss_8007A0EC->unkC = (s16) dword_CODE_bss_8007A0D8; - dword_CODE_bss_8007A0EC->unkE = 0; + dword_CODE_bss_8007A0EC->unk00 = (struct unk_09B7A0_struct_child *) dword_CODE_bss_8007A0E4; + dword_CODE_bss_8007A0EC->unk0C = (s16) dword_CODE_bss_8007A0D8; + dword_CODE_bss_8007A0EC->unk0E = 0; dword_CODE_bss_8007A0EC->unk10 = -1; dword_CODE_bss_8007A0EC->unk12 = -1; - phi_v1_2 = 1; - if (dword_CODE_bss_8007A0DC >= 2) { - do { - temp_v1_2 = phi_v1_2 + 1; - (dword_CODE_bss_8007A0EC + phi_v0_2)->unkE = -1; - phi_v0_2 += 0x14; - phi_v1_2 = temp_v1_2; - } while (temp_v1_2 < dword_CODE_bss_8007A0DC); - } + for (i = 1; i < dword_CODE_bss_8007A0DC; i++) + { + dword_CODE_bss_8007A0EC[i].unk0E = -1; + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F09B820 -/* 0D0350 7F09B820 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0D0354 7F09B824 AFBF0014 */ sw $ra, 0x14($sp) -/* 0D0358 7F09B828 0FC26919 */ jal getPlayerCount -/* 0D035C 7F09B82C 00000000 */ nop -/* 0D0360 7F09B830 28410002 */ slti $at, $v0, 2 -/* 0D0364 7F09B834 1420000F */ bnez $at, .L7F09B874 -/* 0D0368 7F09B838 240201F4 */ li $v0, 500 -/* 0D036C 7F09B83C 240E0BB8 */ li $t6, 3000 -/* 0D0370 7F09B840 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D0) -/* 0D0374 7F09B844 3C088008 */ lui $t0, %hi(dword_CODE_bss_8007A0D4) -/* 0D0378 7F09B848 AC2EA0D0 */ sw $t6, %lo(dword_CODE_bss_8007A0D0)($at) -/* 0D037C 7F09B84C 2508A0D4 */ addiu $t0, %lo(dword_CODE_bss_8007A0D4) # addiu $t0, $t0, -0x5f2c -/* 0D0380 7F09B850 240F0050 */ li $t7, 80 -/* 0D0384 7F09B854 3C098008 */ lui $t1, %hi(dword_CODE_bss_8007A0DC) -/* 0D0388 7F09B858 AD0F0000 */ sw $t7, ($t0) -/* 0D038C 7F09B85C 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D8) -/* 0D0390 7F09B860 2529A0DC */ addiu $t1, %lo(dword_CODE_bss_8007A0DC) # addiu $t1, $t1, -0x5f24 -/* 0D0394 7F09B864 24030014 */ li $v1, 20 -/* 0D0398 7F09B868 AC22A0D8 */ sw $v0, %lo(dword_CODE_bss_8007A0D8)($at) -/* 0D039C 7F09B86C 10000022 */ b .L7F09B8F8 -/* 0D03A0 7F09B870 AD230000 */ sw $v1, ($t1) -.L7F09B874: -/* 0D03A4 7F09B874 0FC2F7C1 */ jal lvlGetCurrentStageToLoad -/* 0D03A8 7F09B878 00000000 */ nop -/* 0D03AC 7F09B87C 2401001E */ li $at, 30 -/* 0D03B0 7F09B880 10410011 */ beq $v0, $at, .L7F09B8C8 -/* 0D03B4 7F09B884 2401001D */ li $at, 29 -/* 0D03B8 7F09B888 1041000F */ beq $v0, $at, .L7F09B8C8 -/* 0D03BC 7F09B88C 24030014 */ li $v1, 20 -/* 0D03C0 7F09B890 240201F4 */ li $v0, 500 -/* 0D03C4 7F09B894 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D0) -/* 0D03C8 7F09B898 3C088008 */ lui $t0, %hi(dword_CODE_bss_8007A0D4) -/* 0D03CC 7F09B89C AC22A0D0 */ sw $v0, %lo(dword_CODE_bss_8007A0D0)($at) -/* 0D03D0 7F09B8A0 2508A0D4 */ addiu $t0, %lo(dword_CODE_bss_8007A0D4) # addiu $t0, $t0, -0x5f2c -/* 0D03D4 7F09B8A4 3C098008 */ lui $t1, %hi(dword_CODE_bss_8007A0DC) -/* 0D03D8 7F09B8A8 AD030000 */ sw $v1, ($t0) -/* 0D03DC 7F09B8AC 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D8) -/* 0D03E0 7F09B8B0 241805DC */ li $t8, 1500 -/* 0D03E4 7F09B8B4 2529A0DC */ addiu $t1, %lo(dword_CODE_bss_8007A0DC) # addiu $t1, $t1, -0x5f24 -/* 0D03E8 7F09B8B8 AC38A0D8 */ sw $t8, %lo(dword_CODE_bss_8007A0D8)($at) -/* 0D03EC 7F09B8BC 24190028 */ li $t9, 40 -/* 0D03F0 7F09B8C0 1000000D */ b .L7F09B8F8 -/* 0D03F4 7F09B8C4 AD390000 */ sw $t9, ($t1) -.L7F09B8C8: -/* 0D03F8 7F09B8C8 240201F4 */ li $v0, 500 -/* 0D03FC 7F09B8CC 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D0) -/* 0D0400 7F09B8D0 3C088008 */ lui $t0, %hi(dword_CODE_bss_8007A0D4) -/* 0D0404 7F09B8D4 AC22A0D0 */ sw $v0, %lo(dword_CODE_bss_8007A0D0)($at) -/* 0D0408 7F09B8D8 2508A0D4 */ addiu $t0, %lo(dword_CODE_bss_8007A0D4) # addiu $t0, $t0, -0x5f2c -/* 0D040C 7F09B8DC 24030014 */ li $v1, 20 -/* 0D0410 7F09B8E0 3C098008 */ lui $t1, %hi(dword_CODE_bss_8007A0DC) -/* 0D0414 7F09B8E4 AD030000 */ sw $v1, ($t0) -/* 0D0418 7F09B8E8 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0D8) -/* 0D041C 7F09B8EC 2529A0DC */ addiu $t1, %lo(dword_CODE_bss_8007A0DC) # addiu $t1, $t1, -0x5f24 -/* 0D0420 7F09B8F0 AC22A0D8 */ sw $v0, %lo(dword_CODE_bss_8007A0D8)($at) -/* 0D0424 7F09B8F4 AD230000 */ sw $v1, ($t1) -.L7F09B8F8: -/* 0D0428 7F09B8F8 8D040000 */ lw $a0, ($t0) -/* 0D042C 7F09B8FC 24050004 */ li $a1, 4 -/* 0D0430 7F09B900 00045880 */ sll $t3, $a0, 2 -/* 0D0434 7F09B904 01645821 */ addu $t3, $t3, $a0 -/* 0D0438 7F09B908 0C0025C8 */ jal mempAllocBytesInBank -/* 0D043C 7F09B90C 000B2080 */ sll $a0, $t3, 2 -/* 0D0440 7F09B910 3C068008 */ lui $a2, %hi(dword_CODE_bss_8007A0E8) -/* 0D0444 7F09B914 24C6A0E8 */ addiu $a2, %lo(dword_CODE_bss_8007A0E8) # addiu $a2, $a2, -0x5f18 -/* 0D0448 7F09B918 ACC20000 */ sw $v0, ($a2) -/* 0D044C 7F09B91C 3C048008 */ lui $a0, %hi(dword_CODE_bss_8007A0D0) -/* 0D0450 7F09B920 8C84A0D0 */ lw $a0, %lo(dword_CODE_bss_8007A0D0)($a0) -/* 0D0454 7F09B924 24050004 */ li $a1, 4 -/* 0D0458 7F09B928 00046100 */ sll $t4, $a0, 4 -/* 0D045C 7F09B92C 0C0025C8 */ jal mempAllocBytesInBank -/* 0D0460 7F09B930 01802025 */ move $a0, $t4 -/* 0D0464 7F09B934 3C098008 */ lui $t1, %hi(dword_CODE_bss_8007A0DC) -/* 0D0468 7F09B938 3C018008 */ lui $at, %hi(dword_CODE_bss_8007A0E0) -/* 0D046C 7F09B93C AC22A0E0 */ sw $v0, %lo(dword_CODE_bss_8007A0E0)($at) -/* 0D0470 7F09B940 2529A0DC */ addiu $t1, %lo(dword_CODE_bss_8007A0DC) # addiu $t1, $t1, -0x5f24 -/* 0D0474 7F09B944 8D240000 */ lw $a0, ($t1) -/* 0D0478 7F09B948 24050004 */ li $a1, 4 -/* 0D047C 7F09B94C 00046880 */ sll $t5, $a0, 2 -/* 0D0480 7F09B950 01A46821 */ addu $t5, $t5, $a0 -/* 0D0484 7F09B954 0C0025C8 */ jal mempAllocBytesInBank -/* 0D0488 7F09B958 000D2080 */ sll $a0, $t5, 2 -/* 0D048C 7F09B95C 3C078008 */ lui $a3, %hi(dword_CODE_bss_8007A0EC) -/* 0D0490 7F09B960 24E7A0EC */ addiu $a3, %lo(dword_CODE_bss_8007A0EC) # addiu $a3, $a3, -0x5f14 -/* 0D0494 7F09B964 ACE20000 */ sw $v0, ($a3) -/* 0D0498 7F09B968 3C048008 */ lui $a0, %hi(dword_CODE_bss_8007A0D8) -/* 0D049C 7F09B96C 8C84A0D8 */ lw $a0, %lo(dword_CODE_bss_8007A0D8)($a0) -/* 0D04A0 7F09B970 24050004 */ li $a1, 4 -/* 0D04A4 7F09B974 00047100 */ sll $t6, $a0, 4 -/* 0D04A8 7F09B978 0C0025C8 */ jal mempAllocBytesInBank -/* 0D04AC 7F09B97C 01C02025 */ move $a0, $t6 -/* 0D04B0 7F09B980 3C0A8008 */ lui $t2, %hi(dword_CODE_bss_8007A0D0) -/* 0D04B4 7F09B984 254AA0D0 */ addiu $t2, %lo(dword_CODE_bss_8007A0D0) # addiu $t2, $t2, -0x5f30 -/* 0D04B8 7F09B988 8D4F0000 */ lw $t7, ($t2) -/* 0D04BC 7F09B98C 3C058008 */ lui $a1, %hi(dword_CODE_bss_8007A0E4) -/* 0D04C0 7F09B990 24A5A0E4 */ addiu $a1, %lo(dword_CODE_bss_8007A0E4) # addiu $a1, $a1, -0x5f1c -/* 0D04C4 7F09B994 ACA20000 */ sw $v0, ($a1) -/* 0D04C8 7F09B998 3C068008 */ lui $a2, %hi(dword_CODE_bss_8007A0E8) -/* 0D04CC 7F09B99C 3C018008 */ lui $at, %hi(word_CODE_bss_8007A0F0) -/* 0D04D0 7F09B9A0 24C6A0E8 */ addiu $a2, %lo(dword_CODE_bss_8007A0E8) # addiu $a2, $a2, -0x5f18 -/* 0D04D4 7F09B9A4 3C188008 */ lui $t8, %hi(dword_CODE_bss_8007A0E0) -/* 0D04D8 7F09B9A8 A42FA0F0 */ sh $t7, %lo(word_CODE_bss_8007A0F0)($at) -/* 0D04DC 7F09B9AC 8CD90000 */ lw $t9, ($a2) -/* 0D04E0 7F09B9B0 8F18A0E0 */ lw $t8, %lo(dword_CODE_bss_8007A0E0)($t8) -/* 0D04E4 7F09B9B4 2404FFFF */ li $a0, -1 -/* 0D04E8 7F09B9B8 3C088008 */ lui $t0, %hi(dword_CODE_bss_8007A0D4) -/* 0D04EC 7F09B9BC AF380000 */ sw $t8, ($t9) -/* 0D04F0 7F09B9C0 8CCC0000 */ lw $t4, ($a2) -/* 0D04F4 7F09B9C4 8D4B0000 */ lw $t3, ($t2) -/* 0D04F8 7F09B9C8 2508A0D4 */ addiu $t0, %lo(dword_CODE_bss_8007A0D4) # addiu $t0, $t0, -0x5f2c -/* 0D04FC 7F09B9CC 3C078008 */ lui $a3, %hi(dword_CODE_bss_8007A0EC) -/* 0D0500 7F09B9D0 A58B000C */ sh $t3, 0xc($t4) -/* 0D0504 7F09B9D4 8CCD0000 */ lw $t5, ($a2) -/* 0D0508 7F09B9D8 3C098008 */ lui $t1, %hi(dword_CODE_bss_8007A0DC) -/* 0D050C 7F09B9DC 2529A0DC */ addiu $t1, %lo(dword_CODE_bss_8007A0DC) # addiu $t1, $t1, -0x5f24 -/* 0D0510 7F09B9E0 A5A0000E */ sh $zero, 0xe($t5) -/* 0D0514 7F09B9E4 8CCE0000 */ lw $t6, ($a2) -/* 0D0518 7F09B9E8 24E7A0EC */ addiu $a3, %lo(dword_CODE_bss_8007A0EC) # addiu $a3, $a3, -0x5f14 -/* 0D051C 7F09B9EC 24020014 */ li $v0, 20 -/* 0D0520 7F09B9F0 A5C40010 */ sh $a0, 0x10($t6) -/* 0D0524 7F09B9F4 8CCF0000 */ lw $t7, ($a2) -/* 0D0528 7F09B9F8 24030001 */ li $v1, 1 -/* 0D052C 7F09B9FC 3C0D8008 */ lui $t5, %hi(dword_CODE_bss_8007A0D8) -/* 0D0530 7F09BA00 A5E40012 */ sh $a0, 0x12($t7) -/* 0D0534 7F09BA04 8D180000 */ lw $t8, ($t0) -/* 0D0538 7F09BA08 2B010002 */ slti $at, $t8, 2 -/* 0D053C 7F09BA0C 1420000B */ bnez $at, .L7F09BA3C -/* 0D0540 7F09BA10 00000000 */ nop -/* 0D0544 7F09BA14 8CD90000 */ lw $t9, ($a2) -.L7F09BA18: -/* 0D0548 7F09BA18 24630001 */ addiu $v1, $v1, 1 -/* 0D054C 7F09BA1C 03225821 */ addu $t3, $t9, $v0 -/* 0D0550 7F09BA20 A564000E */ sh $a0, 0xe($t3) -/* 0D0554 7F09BA24 8D0C0000 */ lw $t4, ($t0) -/* 0D0558 7F09BA28 24420014 */ addiu $v0, $v0, 0x14 -/* 0D055C 7F09BA2C 006C082A */ slt $at, $v1, $t4 -/* 0D0560 7F09BA30 5420FFF9 */ bnezl $at, .L7F09BA18 -/* 0D0564 7F09BA34 8CD90000 */ lw $t9, ($a2) -/* 0D0568 7F09BA38 24030001 */ li $v1, 1 -.L7F09BA3C: -/* 0D056C 7F09BA3C 8DADA0D8 */ lw $t5, %lo(dword_CODE_bss_8007A0D8)($t5) -/* 0D0570 7F09BA40 3C018008 */ lui $at, %hi(word_CODE_bss_8007A0F2) -/* 0D0574 7F09BA44 3C188008 */ lui $t8, %hi(dword_CODE_bss_8007A0D8) -/* 0D0578 7F09BA48 A42DA0F2 */ sh $t5, %lo(word_CODE_bss_8007A0F2)($at) -/* 0D057C 7F09BA4C 8CEF0000 */ lw $t7, ($a3) -/* 0D0580 7F09BA50 8CAE0000 */ lw $t6, ($a1) -/* 0D0584 7F09BA54 24020014 */ li $v0, 20 -/* 0D0588 7F09BA58 ADEE0000 */ sw $t6, ($t7) -/* 0D058C 7F09BA5C 8CF90000 */ lw $t9, ($a3) -/* 0D0590 7F09BA60 8F18A0D8 */ lw $t8, %lo(dword_CODE_bss_8007A0D8)($t8) -/* 0D0594 7F09BA64 A738000C */ sh $t8, 0xc($t9) -/* 0D0598 7F09BA68 8CEB0000 */ lw $t3, ($a3) -/* 0D059C 7F09BA6C A560000E */ sh $zero, 0xe($t3) -/* 0D05A0 7F09BA70 8CEC0000 */ lw $t4, ($a3) -/* 0D05A4 7F09BA74 A5840010 */ sh $a0, 0x10($t4) -/* 0D05A8 7F09BA78 8CED0000 */ lw $t5, ($a3) -/* 0D05AC 7F09BA7C A5A40012 */ sh $a0, 0x12($t5) -/* 0D05B0 7F09BA80 8D2E0000 */ lw $t6, ($t1) -/* 0D05B4 7F09BA84 29C10002 */ slti $at, $t6, 2 -/* 0D05B8 7F09BA88 5420000B */ bnezl $at, .L7F09BAB8 -/* 0D05BC 7F09BA8C 8FBF0014 */ lw $ra, 0x14($sp) -/* 0D05C0 7F09BA90 8CEF0000 */ lw $t7, ($a3) -.L7F09BA94: -/* 0D05C4 7F09BA94 24630001 */ addiu $v1, $v1, 1 -/* 0D05C8 7F09BA98 01E2C021 */ addu $t8, $t7, $v0 -/* 0D05CC 7F09BA9C A704000E */ sh $a0, 0xe($t8) -/* 0D05D0 7F09BAA0 8D390000 */ lw $t9, ($t1) -/* 0D05D4 7F09BAA4 24420014 */ addiu $v0, $v0, 0x14 -/* 0D05D8 7F09BAA8 0079082A */ slt $at, $v1, $t9 -/* 0D05DC 7F09BAAC 5420FFF9 */ bnezl $at, .L7F09BA94 -/* 0D05E0 7F09BAB0 8CEF0000 */ lw $t7, ($a3) -/* 0D05E4 7F09BAB4 8FBF0014 */ lw $ra, 0x14($sp) -.L7F09BAB8: -/* 0D05E8 7F09BAB8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0D05EC 7F09BABC 03E00008 */ jr $ra -/* 0D05F0 7F09BAC0 00000000 */ nop -) -#endif - - - #ifdef NONMATCHING @@ -894,10 +630,12 @@ glabel sub_GAME_7F09BE4C #ifdef NONMATCHING -void sub_GAME_7F09C044(void) { +void sub_GAME_7F09C044(Vertex* arg0) { } #else +void sub_GAME_7F09C044(Vertex* arg0); + GLOBAL_ASM( .text glabel sub_GAME_7F09C044 diff --git a/src/game/unk_0A1DA0.c b/src/game/unk_0A1DA0.c index 9966326a..5cc671f3 100644 --- a/src/game/unk_0A1DA0.c +++ b/src/game/unk_0A1DA0.c @@ -3,6 +3,7 @@ #include "math_atan2f.h" #include "unk_0A1DA0.h" #include "random.h" +#include "lvl.h" #ifndef VERSION_EU #define SCALAR_1_7F0A2160 1.5f @@ -72,10 +73,11 @@ u32 D_80040980 = 0; #ifdef NONMATCHING -void sub_GAME_7F0A1DA0(void) { +void sub_GAME_7F0A1DA0(f32*, f32*, f32*, f32*, f32, f32, f32, f32, f32, f32) { } #else +void sub_GAME_7F0A1DA0(f32*, f32*, f32*, f32*, f32, f32, f32, f32, f32, f32); GLOBAL_ASM( .late_rodata glabel D_80057710 @@ -225,7 +227,7 @@ glabel sub_GAME_7F0A1DA0 /* 0D6AF4 7F0A1FC4 0C002382 */ jal sndPlaySfx /* 0D6AF8 7F0A1FC8 E7A600A4 */ swc1 $f6, 0xa4($sp) /* 0D6AFC 7F0A1FCC 00402025 */ move $a0, $v0 -/* 0D6B00 7F0A1FD0 0FC14E84 */ jal sub_GAME_7F053A10 +/* 0D6B00 7F0A1FD0 0FC14E84 */ jal chrobjSndCreatePostEventDefault /* 0D6B04 7F0A1FD4 02202825 */ move $a1, $s1 /* 0D6B08 7F0A1FD8 44922000 */ mtc1 $s2, $f4 /* 0D6B0C 7F0A1FDC 44909000 */ mtc1 $s0, $f18 @@ -3168,59 +3170,22 @@ glabel sub_GAME_7F0A3E1C -#ifdef NONMATCHING -// not close to matching but functionally equivalent void sub_GAME_7F0A3EA0(void) { - s32 i; - - for (i = 0; (i < UNK_8007A170_MAX); i++) - { - if (dword_CODE_bss_8007A170[i].unk04 <= 0) { continue; } + bondstruct_unk_8007A170 *thing = &dword_CODE_bss_8007A170[0]; \ + bondstruct_unk_8007A170 *end = dword_CODE_bss_8007A170 + UNK_8007A170_MAX; - dword_CODE_bss_8007A170[i].unk00 += g_ClockTimer; + for (; thing < end; thing++) { + if (thing->unk04 > 0) { + thing->unk00 += g_ClockTimer; - if ((dword_CODE_bss_8007A170[i].unk00 >= 0) && (dword_CODE_bss_8007A170[i].unk00 >= dword_CODE_bss_8007A170[i].unk04)) { - dword_CODE_bss_8007A170[i].unk04 = 0; + if (thing->unk00 >= 0 && thing->unk00 >= thing->unk04) { + thing->unk04 = 0; + } } } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A3EA0 -/* 0D89D0 7F0A3EA0 3C028008 */ lui $v0, %hi(dword_CODE_bss_8007A170) -/* 0D89D4 7F0A3EA4 3C038008 */ lui $v1, %hi(dword_CODE_bss_8007A170 + 0x370) -/* 0D89D8 7F0A3EA8 3C058005 */ lui $a1, %hi(g_ClockTimer) -/* 0D89DC 7F0A3EAC 2463A4E0 */ addiu $v1, %lo(dword_CODE_bss_8007A170 + 0x370) # addiu $v1, $v1, -0x5b20 -/* 0D89E0 7F0A3EB0 2442A170 */ addiu $v0, %lo(dword_CODE_bss_8007A170) # addiu $v0, $v0, -0x5e90 -/* 0D89E4 7F0A3EB4 24A58374 */ addiu $a1, %lo(g_ClockTimer) # addiu $a1, $a1, -0x7c8c -/* 0D89E8 7F0A3EB8 844E0004 */ lh $t6, 4($v0) -.L7F0A3EBC: -/* 0D89EC 7F0A3EBC 59C0000C */ blezl $t6, .L7F0A3EF0 -/* 0D89F0 7F0A3EC0 2442002C */ addiu $v0, $v0, 0x2c -/* 0D89F4 7F0A3EC4 8C4F0000 */ lw $t7, ($v0) -/* 0D89F8 7F0A3EC8 8CB80000 */ lw $t8, ($a1) -/* 0D89FC 7F0A3ECC 01F8C821 */ addu $t9, $t7, $t8 -/* 0D8A00 7F0A3ED0 07200006 */ bltz $t9, .L7F0A3EEC -/* 0D8A04 7F0A3ED4 AC590000 */ sw $t9, ($v0) -/* 0D8A08 7F0A3ED8 84480004 */ lh $t0, 4($v0) -/* 0D8A0C 7F0A3EDC 0328082A */ slt $at, $t9, $t0 -/* 0D8A10 7F0A3EE0 54200003 */ bnezl $at, .L7F0A3EF0 -/* 0D8A14 7F0A3EE4 2442002C */ addiu $v0, $v0, 0x2c -/* 0D8A18 7F0A3EE8 A4400004 */ sh $zero, 4($v0) -.L7F0A3EEC: -/* 0D8A1C 7F0A3EEC 2442002C */ addiu $v0, $v0, 0x2c -.L7F0A3EF0: -/* 0D8A20 7F0A3EF0 0043082B */ sltu $at, $v0, $v1 -/* 0D8A24 7F0A3EF4 5420FFF1 */ bnezl $at, .L7F0A3EBC -/* 0D8A28 7F0A3EF8 844E0004 */ lh $t6, 4($v0) -/* 0D8A2C 7F0A3EFC 03E00008 */ jr $ra -/* 0D8A30 7F0A3F00 00000000 */ nop -) -#endif - @@ -3631,52 +3596,16 @@ glabel sub_GAME_7F0A3F04 ) #endif +void sub_GAME_7F0A4528(Gfx *gdl, s32 arg1) { + + bondstruct_unk_8007A170 *thing = &dword_CODE_bss_8007A170[0]; \ + bondstruct_unk_8007A170 *end = dword_CODE_bss_8007A170 + UNK_8007A170_MAX; - - - -#ifdef NONMATCHING -void sub_GAME_7F0A4528(Gfx *arg0, s32 arg1) { - + for (; (thing < end); thing++) + { + sub_GAME_7F0A3F04(thing, gdl, arg1); + } } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A4528 -/* 0D9058 7F0A4528 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 0D905C 7F0A452C AFB10018 */ sw $s1, 0x18($sp) -/* 0D9060 7F0A4530 AFB00014 */ sw $s0, 0x14($sp) -/* 0D9064 7F0A4534 AFB30020 */ sw $s3, 0x20($sp) -/* 0D9068 7F0A4538 AFB2001C */ sw $s2, 0x1c($sp) -/* 0D906C 7F0A453C 3C108008 */ lui $s0, %hi(dword_CODE_bss_8007A170) -/* 0D9070 7F0A4540 3C118008 */ lui $s1, %hi(dword_CODE_bss_8007A170 + 0x370) -/* 0D9074 7F0A4544 00809025 */ move $s2, $a0 -/* 0D9078 7F0A4548 00A09825 */ move $s3, $a1 -/* 0D907C 7F0A454C AFBF0024 */ sw $ra, 0x24($sp) -/* 0D9080 7F0A4550 2631A4E0 */ addiu $s1, %lo(dword_CODE_bss_8007A170 + 0x370) # addiu $s1, $s1, -0x5b20 -/* 0D9084 7F0A4554 2610A170 */ addiu $s0, %lo(dword_CODE_bss_8007A170) # addiu $s0, $s0, -0x5e90 -/* 0D9088 7F0A4558 02002025 */ move $a0, $s0 -.L7F0A455C: -/* 0D908C 7F0A455C 02402825 */ move $a1, $s2 -/* 0D9090 7F0A4560 0FC28FC1 */ jal sub_GAME_7F0A3F04 -/* 0D9094 7F0A4564 02603025 */ move $a2, $s3 -/* 0D9098 7F0A4568 2610002C */ addiu $s0, $s0, 0x2c -/* 0D909C 7F0A456C 0211082B */ sltu $at, $s0, $s1 -/* 0D90A0 7F0A4570 5420FFFA */ bnezl $at, .L7F0A455C -/* 0D90A4 7F0A4574 02002025 */ move $a0, $s0 -/* 0D90A8 7F0A4578 8FBF0024 */ lw $ra, 0x24($sp) -/* 0D90AC 7F0A457C 8FB00014 */ lw $s0, 0x14($sp) -/* 0D90B0 7F0A4580 8FB10018 */ lw $s1, 0x18($sp) -/* 0D90B4 7F0A4584 8FB2001C */ lw $s2, 0x1c($sp) -/* 0D90B8 7F0A4588 8FB30020 */ lw $s3, 0x20($sp) -/* 0D90BC 7F0A458C 03E00008 */ jr $ra -/* 0D90C0 7F0A4590 27BD0028 */ addiu $sp, $sp, 0x28 -) -#endif - - - - #ifdef NONMATCHING void sub_GAME_7F0A4594(void) { @@ -3693,10 +3622,10 @@ glabel sub_GAME_7F0A4594 /* 0D90D4 7F0A45A4 C4860014 */ lwc1 $f6, 0x14($a0) /* 0D90D8 7F0A45A8 E7A60020 */ swc1 $f6, 0x20($sp) /* 0D90DC 7F0A45AC C4880018 */ lwc1 $f8, 0x18($a0) -/* 0D90E0 7F0A45B0 0FC1E0F1 */ jal currentPlayerGetMatrix10CC +/* 0D90E0 7F0A45B0 0FC1E0F1 */ jal camGetWorldToScreenMtxf /* 0D90E4 7F0A45B4 E7A80024 */ swc1 $f8, 0x24($sp) /* 0D90E8 7F0A45B8 00402025 */ move $a0, $v0 -/* 0D90EC 7F0A45BC 0FC1611D */ jal matrix_4x4_transform_vector_in_place +/* 0D90EC 7F0A45BC 0FC1611D */ jal mtx4TransformVecInPlace /* 0D90F0 7F0A45C0 27A5001C */ addiu $a1, $sp, 0x1c /* 0D90F4 7F0A45C4 8FBF0014 */ lw $ra, 0x14($sp) /* 0D90F8 7F0A45C8 C7A00024 */ lwc1 $f0, 0x24($sp) diff --git a/src/game/unk_0A1DA0.h b/src/game/unk_0A1DA0.h index 0768d0e5..0675a362 100644 --- a/src/game/unk_0A1DA0.h +++ b/src/game/unk_0A1DA0.h @@ -51,7 +51,7 @@ typedef struct s_shattered_window_piece { } s_shattered_window_piece; typedef struct bondstruct_unk_8007A170 { - u32 unk00; + s32 unk00; s16 unk04; s16 unk06; u32 unk08; @@ -94,5 +94,6 @@ Gfx * sub_GAME_7F0A3330(Gfx *arg0, void * arg1, s32 arg2); void sub_GAME_7F0A2F30(s32 *arg0, s32 arg1, s32 arg2, f32 arg3); struct WatchVertex *setup_watch_rectangles(struct WatchVertex *vtx, s32 startx, s32 startz, s32 width, s32 height, s32 horizontal_offset, s32 vertical_offset); void sub_GAME_7F0A2160(coord3d * arg0, f32 arg1, f32 arg2); +void sub_GAME_7F0A3EA0(void); #endif diff --git a/src/game/unk_0B3200.c b/src/game/unk_0B3200.c index 2bbfb414..bbc31a93 100644 --- a/src/game/unk_0B3200.c +++ b/src/game/unk_0B3200.c @@ -3,7 +3,7 @@ // rodata -f32 sub_GAME_7F0B3200(coord2d *arg0, coord2d *arg1, coord2d *arg2, coord2d *arg3) +f32 unkGeometry7F0B3200(coord2d *arg0, coord2d *arg1, coord2d *arg2, coord2d *arg3) { f32 mult1 = arg2->f[1] - arg3->f[1]; f32 mult2 = arg3->f[0] - arg2->f[0]; @@ -63,7 +63,7 @@ f32 sub_GAME_7F0B32D8(struct coord3d *arg0, coord2d *arg1, coord2d *arg2) } -f32 sub_GAME_7F0B33DC(coord3d *arg0, coord2d *arg1, coord2d *arg2,coord2d *arg3) +f32 unkGeometry7F0B33DC(coord3d *arg0, coord2d *arg1, coord2d *arg2,coord2d *arg3) { f32 spac; f32 spa8; diff --git a/src/game/unk_0B3200.h b/src/game/unk_0B3200.h new file mode 100644 index 00000000..84924bd3 --- /dev/null +++ b/src/game/unk_0B3200.h @@ -0,0 +1,10 @@ +#ifndef _UNK_0B3200_H_ +#define _UNK_0B3200_H_ +#include +#include "bondtypes.h" + +f32 unkGeometry7F0B3200(coord2d *arg0, coord2d *arg1, coord2d *arg2, coord2d *arg3); +f32 sub_GAME_7F0B32D8(struct coord3d *arg0, coord2d *arg1, coord2d *arg2); +f32 unkGeometry7F0B33DC(coord3d *arg0, coord2d *arg1, coord2d *arg2,coord2d *arg3); + +#endif diff --git a/src/game/unk_0CC4C0.c b/src/game/unk_0CC4C0.c index 5a0dc1ec..fa2e28e7 100644 --- a/src/game/unk_0CC4C0.c +++ b/src/game/unk_0CC4C0.c @@ -6,7 +6,7 @@ // bss //8008D140 -s32 dword_CODE_bss_8008D140; +s32 g_TexLutMode; //8008D144 s32 dword_CODE_bss_8008D144; //8008D148 @@ -158,7 +158,7 @@ void sub_GAME_7F0CC4C8(void) dword_CODE_bss_8008D148[i].unk_0 = 0; dword_CODE_bss_8008D2A8[i].unk_0 = 0; } - dword_CODE_bss_8008D140 = -1; + g_TexLutMode = -1; } @@ -183,10 +183,10 @@ s32 unused_copy_byte_array(u8* src, s32 count, u8* dst) u32 texSetLutMode(s32 arg0) { - if (arg0 == dword_CODE_bss_8008D140) { + if (arg0 == g_TexLutMode) { return 0; } - dword_CODE_bss_8008D140 = arg0; + g_TexLutMode = arg0; return 1; } @@ -215,7 +215,7 @@ s32 sub_GAME_7F0CC574(s32 index, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg dword_CODE_bss_8008D148[index].unk_20 = arg8; dword_CODE_bss_8008D148[index].unk_24 = arg9; dword_CODE_bss_8008D148[index].unk_28 = argA; - + } return retval; } @@ -224,7 +224,7 @@ s32 sub_GAME_7F0CC574(s32 index, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg s32 sub_GAME_7F0CC690(s32 index,s32 arg1,s32 arg2,s32 arg3,s32 arg4) { s32 retval; - + retval = 0; if ((((dword_CODE_bss_8008D2A8[index].unk_0 == 0) || (arg1 != dword_CODE_bss_8008D2A8[index].unk_4)) || (arg2 != dword_CODE_bss_8008D2A8[index].unk_8)) || ((arg3 != dword_CODE_bss_8008D2A8[index].unk_C || (arg4 != dword_CODE_bss_8008D2A8[index].unk_10)))) @@ -466,72 +466,36 @@ Gfx *sub_GAME_7F0CCC50(Gfx *gdl, struct tex *tex, s32 arg2, s32 shifts, s32 shif return gdl; } +Gfx* sub_GAME_7F0CCFBC(Gfx* arg0, Gfx* arg1, struct tex* tex, s32 arg3) +{ + s32 lod = tex->maxlod ? tex->maxlod - 1 : 0; -#ifdef NONMATCHING -void sub_GAME_7F0CCFBC(void) { - -} -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0CCFBC -/* 101AEC 7F0CCFBC 27BDFFF8 */ addiu $sp, $sp, -8 -/* 101AF0 7F0CCFC0 AFB00004 */ sw $s0, 4($sp) -/* 101AF4 7F0CCFC4 90C2000B */ lbu $v0, 0xb($a2) -/* 101AF8 7F0CCFC8 00808025 */ move $s0, $a0 -/* 101AFC 7F0CCFCC 00001825 */ move $v1, $zero -/* 101B00 7F0CCFD0 00027142 */ srl $t6, $v0, 5 -/* 101B04 7F0CCFD4 11C00003 */ beqz $t6, .L7F0CCFE4 -/* 101B08 7F0CCFD8 00000000 */ nop -/* 101B0C 7F0CCFDC 10000001 */ b .L7F0CCFE4 -/* 101B10 7F0CCFE0 25C3FFFF */ addiu $v1, $t6, -1 -.L7F0CCFE4: -/* 101B14 7F0CCFE4 50E0001A */ beql $a3, $zero, .L7F0CD050 -/* 101B18 7F0CCFE8 8CAD0000 */ lw $t5, ($a1) -/* 101B1C 7F0CCFEC 10A0000D */ beqz $a1, .L7F0CD024 -/* 101B20 7F0CCFF0 02001025 */ move $v0, $s0 -/* 101B24 7F0CCFF4 8CA40000 */ lw $a0, ($a1) -/* 101B28 7F0CCFF8 2401C7FF */ li $at, -14337 -/* 101B2C 7F0CCFFC 0003C2C0 */ sll $t8, $v1, 0xb -/* 101B30 7F0CD000 00817824 */ and $t7, $a0, $at -/* 101B34 7F0CD004 01F81025 */ or $v0, $t7, $t8 -/* 101B38 7F0CD008 50440018 */ beql $v0, $a0, .L7F0CD06C -/* 101B3C 7F0CD00C 02001025 */ move $v0, $s0 -/* 101B40 7F0CD010 AE020000 */ sw $v0, ($s0) -/* 101B44 7F0CD014 8CB90004 */ lw $t9, 4($a1) -/* 101B48 7F0CD018 26100008 */ addiu $s0, $s0, 8 -/* 101B4C 7F0CD01C 10000012 */ b .L7F0CD068 -/* 101B50 7F0CD020 AE19FFFC */ sw $t9, -4($s0) -.L7F0CD024: -/* 101B54 7F0CD024 30680007 */ andi $t0, $v1, 7 -/* 101B58 7F0CD028 00084AC0 */ sll $t1, $t0, 0xb -/* 101B5C 7F0CD02C 3C01BB00 */ lui $at, 0xbb00 -/* 101B60 7F0CD030 01215025 */ or $t2, $t1, $at -/* 101B64 7F0CD034 354B0001 */ ori $t3, $t2, 1 -/* 101B68 7F0CD038 240CFFFF */ li $t4, -1 -/* 101B6C 7F0CD03C AC4C0004 */ sw $t4, 4($v0) -/* 101B70 7F0CD040 AC4B0000 */ sw $t3, ($v0) -/* 101B74 7F0CD044 10000008 */ b .L7F0CD068 -/* 101B78 7F0CD048 26100008 */ addiu $s0, $s0, 8 -/* 101B7C 7F0CD04C 8CAD0000 */ lw $t5, ($a1) -.L7F0CD050: -/* 101B80 7F0CD050 2401C7FF */ li $at, -14337 -/* 101B84 7F0CD054 0003C2C0 */ sll $t8, $v1, 0xb -/* 101B88 7F0CD058 01A17024 */ and $t6, $t5, $at -/* 101B8C 7F0CD05C ACAE0000 */ sw $t6, ($a1) -/* 101B90 7F0CD060 01D8C825 */ or $t9, $t6, $t8 -/* 101B94 7F0CD064 ACB90000 */ sw $t9, ($a1) -.L7F0CD068: -/* 101B98 7F0CD068 02001025 */ move $v0, $s0 -.L7F0CD06C: -/* 101B9C 7F0CD06C 8FB00004 */ lw $s0, 4($sp) -/* 101BA0 7F0CD070 03E00008 */ jr $ra -/* 101BA4 7F0CD074 27BD0008 */ addiu $sp, $sp, 8 -) -#endif - + if (arg3) + { + if (arg1 != NULL) + { + u32 v0 = (arg1->words.w0 & ~0x3800) | (lod << 11); + if (v0 != arg1->words.w0) + { + arg0->words.w0 = v0; + arg0->words.w1 = arg1->words.w1; + arg0++; + } + } + else + { + gSPTexture(arg0++, 0xffff, 0xffff, lod, G_TX_RENDERTILE, G_ON); + } + } + else + { + arg1->words.w0 &= ~0x3800; + arg1->words.w0 |= lod << 11; + } + return arg0; +} #ifdef NONMATCHING @@ -1355,7 +1319,6 @@ Gfx *sub_GAME_7F0CDB64(Gfx *gdl, struct tex *tex, s32 arg2, s32 arg3, s32 arg4, #ifdef NONMATCHING Gfx * sub_GAME_7F0CDE18(Gfx *DL,u8 *facemapper_entry,s32 s_flags,s32 t_flags,s32 settilesize_offset) { - DL = expland_c0DL_psuedocommands(DL,facemapper_entry,0); DL = sub_GAME_7F0CD430(DL,facemapper_entry,s_flags,t_flags,settilesize_offset,0,0); //1029a0: srl t8,t7,0x5 | 1029a0: sra t8,t7,0x5 @@ -1417,7 +1380,6 @@ Gfx * sub_GAME_7F0CDEA8(Gfx *DL,u8 *arg1,s32 arg2,s32 arg3,s32 arg4,u32 arg5,u32 { u32 uVar1; - uVar1 = texGetSizeInBytes(arg5,NULL); DL = sub_GAME_7F0CD7AC(DL,arg5); gDPTileSync(DL++); diff --git a/src/game/unk_0D1AC0.c b/src/game/unk_0D1AC0.c index ba534a18..019c68f2 100644 --- a/src/game/unk_0D1AC0.c +++ b/src/game/unk_0D1AC0.c @@ -225,6 +225,7 @@ void sub_GAME_7F0D1DFC(s32 arg1, ?32 argC) { sub_GAME_7F0D1B94(arg1, ((D_8004EAF0 + arg1) - D_8004EAF4), argC); return; // (possible return value: sub_GAME_7F0D1B94(arg1, ((D_8004EAF0 + arg1) - D_8004EAF4), argC)) + // IDA: return sub_GAME_7F0D1B94(a1, (float)(D_8004EAF0 + a2) - D_8004EAF4, a3, a4, a5); } #else @@ -262,6 +263,7 @@ void sub_GAME_7F0D1E44(s32 arg1, ?32 argE, ?32 argF, ?32 arg10) { sub_GAME_7F0D1BD0(arg1, ((D_8004EAF0 + arg1) - D_8004EAF4), argE, argF, arg10); return; // (possible return value: sub_GAME_7F0D1BD0(arg1, ((D_8004EAF0 + arg1) - D_8004EAF4), argE, argF, arg10)) + //IDA: return sub_GAME_7F0D1BD0(a1, (float)(D_8004EAF0 + a2) - D_8004EAF4, a3, a4, a5, a6, a7); } #else diff --git a/src/game/watch.c b/src/game/watch.c index 9df6c135..dee12c57 100644 --- a/src/game/watch.c +++ b/src/game/watch.c @@ -16,7 +16,7 @@ #include "textrelated.h" #include "unk_0A1DA0.h" #include "unk_0C0A70.h" - +#include "assets/obseg/text/LoptionE.h" #define WATCH_BACKGROUND_VERTEX_COUNT 30 @@ -64,25 +64,25 @@ f32 D_800409D4 = 0.0f; s32 D_800409D8 = 8; //D:800409DC u16 D_800409DC[] = { - /*1.1 honey*/ TEXT(LOPTIONS,0x9), /*weapon*/TEXT(LOPTIONS,0x3), /*action*/TEXT(LOPTIONS,0x2), /*fire*/TEXT(LOPTIONS,0x0), /*aim*/TEXT(LOPTIONS,0x1), /*aim*/TEXT(LOPTIONS,0x1), /*look*/TEXT(LOPTIONS,0x6), /*look*/TEXT(LOPTIONS,0x6), /*pause*/TEXT(LOPTIONS,0x4), /*move*/TEXT(LOPTIONS,0x5), - /*1.2 solitaire*/TEXT(LOPTIONS,0xA), /*weapon*/TEXT(LOPTIONS,0x3), /*action*/TEXT(LOPTIONS,0x2), /*fire*/TEXT(LOPTIONS,0x0), /*aim*/TEXT(LOPTIONS,0x1), /*aim*/TEXT(LOPTIONS,0x1), /*move*/TEXT(LOPTIONS,0x5), /*move*/TEXT(LOPTIONS,0x5), /*pause*/TEXT(LOPTIONS,0x4), /*look*/TEXT(LOPTIONS,0x6), - /*1.3 kissy*/ TEXT(LOPTIONS,0xB), /*fire*/TEXT(LOPTIONS,0x0), /*action*/TEXT(LOPTIONS,0x2), /*aim*/TEXT(LOPTIONS,0x1), /*weapon*/TEXT(LOPTIONS,0x3), /*weapon*/TEXT(LOPTIONS,0x3), /*look*/TEXT(LOPTIONS,0x6), /*look*/TEXT(LOPTIONS,0x6), /*pause*/TEXT(LOPTIONS,0x4), /*move*/TEXT(LOPTIONS,0x5), - /*1.4 goodnight*/TEXT(LOPTIONS,0xC), /*fire*/TEXT(LOPTIONS,0x0), /*action*/TEXT(LOPTIONS,0x2), /*aim*/TEXT(LOPTIONS,0x1), /*weapon*/TEXT(LOPTIONS,0x3), /*weapon*/TEXT(LOPTIONS,0x3), /*move*/TEXT(LOPTIONS,0x5), /*move*/TEXT(LOPTIONS,0x5), /*pause*/TEXT(LOPTIONS,0x4), /*look*/TEXT(LOPTIONS,0x6), - /*2.1 plenty*/ TEXT(LOPTIONS,0xD), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), - /*2.2 galore*/ TEXT(LOPTIONS,0xE), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), - /*2.3 domino*/ TEXT(LOPTIONS,0xF), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), - /*2.4 goodhead*/ TEXT(LOPTIONS,0x10), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7), /*?*/TEXT(LOPTIONS,0x7) + /*1.1 honey*/ TEXT(LOPTIONS, OPTION_STR_09), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*action*/TEXT(LOPTIONS, OPTION_STR_02), /*fire*/TEXT(LOPTIONS, OPTION_STR_00), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*look*/TEXT(LOPTIONS, OPTION_STR_06), /*look*/TEXT(LOPTIONS, OPTION_STR_06), /*pause*/TEXT(LOPTIONS, OPTION_STR_04), /*move*/TEXT(LOPTIONS, OPTION_STR_05), + /*1.2 solitaire*/TEXT(LOPTIONS, OPTION_STR_0A), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*action*/TEXT(LOPTIONS, OPTION_STR_02), /*fire*/TEXT(LOPTIONS, OPTION_STR_00), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*move*/TEXT(LOPTIONS, OPTION_STR_05), /*move*/TEXT(LOPTIONS, OPTION_STR_05), /*pause*/TEXT(LOPTIONS, OPTION_STR_04), /*look*/TEXT(LOPTIONS, OPTION_STR_06), + /*1.3 kissy*/ TEXT(LOPTIONS, OPTION_STR_0B), /*fire*/TEXT(LOPTIONS, OPTION_STR_00), /*action*/TEXT(LOPTIONS, OPTION_STR_02), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*look*/TEXT(LOPTIONS, OPTION_STR_06), /*look*/TEXT(LOPTIONS, OPTION_STR_06), /*pause*/TEXT(LOPTIONS, OPTION_STR_04), /*move*/TEXT(LOPTIONS, OPTION_STR_05), + /*1.4 goodnight*/TEXT(LOPTIONS, OPTION_STR_0C), /*fire*/TEXT(LOPTIONS, OPTION_STR_00), /*action*/TEXT(LOPTIONS, OPTION_STR_02), /*aim*/TEXT(LOPTIONS, OPTION_STR_01), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*weapon*/TEXT(LOPTIONS, OPTION_STR_03), /*move*/TEXT(LOPTIONS, OPTION_STR_05), /*move*/TEXT(LOPTIONS, OPTION_STR_05), /*pause*/TEXT(LOPTIONS, OPTION_STR_04), /*look*/TEXT(LOPTIONS, OPTION_STR_06), + /*2.1 plenty*/ TEXT(LOPTIONS, OPTION_STR_0D), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), + /*2.2 galore*/ TEXT(LOPTIONS, OPTION_STR_0E), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), + /*2.3 domino*/ TEXT(LOPTIONS, OPTION_STR_0F), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), + /*2.4 goodhead*/ TEXT(LOPTIONS, OPTION_STR_10), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07), /*?*/TEXT(LOPTIONS, OPTION_STR_07) }; struct game_options game_options_entries[] = { - { {TEXT(LOPTIONS,0x11), TEXT(LOPTIONS,0x1C), TEXT(LOPTIONS,0x1B), 0}, 0}, //look up/down, reverse, upright - { {TEXT(LOPTIONS,0x12), TEXT(LOPTIONS,0x1A), TEXT(LOPTIONS,0x19), 0}, 1}, //autoaim, off, on - { {TEXT(LOPTIONS,0x14), TEXT(LOPTIONS,0x1E), TEXT(LOPTIONS,0x1D), 0}, 0}, //aim control, hold, toggle - { {TEXT(LOPTIONS,0x15), TEXT(LOPTIONS,0x1A), TEXT(LOPTIONS,0x19), 0}, 1}, //sight on screen, off, on - { {TEXT(LOPTIONS,0x13), TEXT(LOPTIONS,0x1A), TEXT(LOPTIONS,0x19), 0}, 1}, //look ahead, off, on - { {TEXT(LOPTIONS,0x16), TEXT(LOPTIONS,0x1A), TEXT(LOPTIONS,0x19), 0}, 1}, //ammo on screen, off, on - { {TEXT(LOPTIONS,0x17), TEXT(LOPTIONS,0x1F), TEXT(LOPTIONS,0x20), TEXT(LOPTIONS,0x21)}, 0}, //screen, full, wide, cinema - { {TEXT(LOPTIONS,0x18), TEXT(LOPTIONS,0x22), TEXT(LOPTIONS,0x23), 0}, 0} //ratio, normal, 16:9 + { {TEXT(LOPTIONS, OPTION_STR_11), TEXT(LOPTIONS, OPTION_STR_1C), TEXT(LOPTIONS, OPTION_STR_1B), 0}, 0}, //look up/down, reverse, upright + { {TEXT(LOPTIONS, OPTION_STR_12), TEXT(LOPTIONS, OPTION_STR_1A), TEXT(LOPTIONS, OPTION_STR_19), 0}, 1}, //autoaim, off, on + { {TEXT(LOPTIONS, OPTION_STR_14), TEXT(LOPTIONS, OPTION_STR_1E), TEXT(LOPTIONS, OPTION_STR_1D), 0}, 0}, //aim control, hold, toggle + { {TEXT(LOPTIONS, OPTION_STR_15), TEXT(LOPTIONS, OPTION_STR_1A), TEXT(LOPTIONS, OPTION_STR_19), 0}, 1}, //sight on screen, off, on + { {TEXT(LOPTIONS, OPTION_STR_13), TEXT(LOPTIONS, OPTION_STR_1A), TEXT(LOPTIONS, OPTION_STR_19), 0}, 1}, //look ahead, off, on + { {TEXT(LOPTIONS, OPTION_STR_16), TEXT(LOPTIONS, OPTION_STR_1A), TEXT(LOPTIONS, OPTION_STR_19), 0}, 1}, //ammo on screen, off, on + { {TEXT(LOPTIONS, OPTION_STR_17), TEXT(LOPTIONS, OPTION_STR_1F), TEXT(LOPTIONS, OPTION_STR_20), TEXT(LOPTIONS, OPTION_STR_21)}, 0}, //screen, full, wide, cinema + { {TEXT(LOPTIONS, OPTION_STR_18), TEXT(LOPTIONS, OPTION_STR_22), TEXT(LOPTIONS, OPTION_STR_23), 0}, 0} //ratio, normal, 16:9 }; //D:80040ADC @@ -357,202 +357,54 @@ void controller_deadzone_related(void) -#ifdef NONMATCHING -//code seems to match, can't seem to get data lined up correctly Gfx * sub_GAME_7F0A4B40(Gfx *DL) { - u8 buffer [0x16]; - int *fontTBL1; - int *fontTBL2; - - u32 y; - u32 x; - - if (10 < joyGetStickX(PLAYER_1)) { + if (10 < joyGetStickX(PLAYER_1)) + { D_80040B48 += 1; } - if (joyGetStickX(PLAYER_1) < -10) { + if (joyGetStickX(PLAYER_1) < -10) + { D_80040B48 -= 1; } - if (10 < joyGetStickY(PLAYER_1)) { + if (10 < joyGetStickY(PLAYER_1)) + { D_80040B4C -= 1; } - if (joyGetStickY(PLAYER_1) < -10) { + if (joyGetStickY(PLAYER_1) < -10) + { D_80040B4C += 1; } + gDPSetRenderMode(DL++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(DL++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetPrimColor(DL++, 0, 0, 0xFF, 0x00, 0x00, 0xFF); gDPFillRectangle(DL++, D_80040B48, D_80040B4C, D_80040B48+1, D_80040B4C+1); - fontTBL1 = ptrFirstFontTableSmall; - fontTBL2 = ptrSecondFontTableSmall; - sprintf(buffer,"%d, %d\n",D_80040B48,D_80040B4C); + { + u8 buffer [0x12]; + struct font * pFontFile; + struct fontchar * pFontChars; + s32 y; + s32 x; + + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; + sprintf(buffer,"%d, %d\n",D_80040B48,D_80040B4C); + + DL = microcode_constructor(DL++); - DL = microcode_constructor(DL++); - sub_GAME_7F0AE98C(x,y,buffer,fontTBL2,fontTBL1,0); - DL = en_text_write_stuff(DL,&D_80040B48,&D_80040B4C,buffer,fontTBL2,fontTBL1, 0xff0000ff,y,x,0,0); - D_80040B4C = (D_80040B4C - fontTBL2[0x224]) + 1; + textMeasure(&x, &y, buffer, pFontChars, pFontFile, 0); + DL = textRender(DL, &D_80040B48, &D_80040B4C, buffer, pFontChars, pFontFile, 0xff0000ff, y, x, 0, 0); + // HACK: what is this: ((s32*)pFontChars)[0x224] + D_80040B4C = (D_80040B4C - ((s32*)pFontChars)[0x224]) + 1; + } + return DL; } -#else -// rodata -//D:80057760 -const char aDD[] = "%d, %d\n"; - -GLOBAL_ASM( -.text -glabel sub_GAME_7F0A4B40 -/* 0D9670 7F0A4B40 27BDFF80 */ addiu $sp, $sp, -0x80 -/* 0D9674 7F0A4B44 AFB00038 */ sw $s0, 0x38($sp) -/* 0D9678 7F0A4B48 00808025 */ move $s0, $a0 -/* 0D967C 7F0A4B4C AFBF0044 */ sw $ra, 0x44($sp) -/* 0D9680 7F0A4B50 AFB20040 */ sw $s2, 0x40($sp) -/* 0D9684 7F0A4B54 AFB1003C */ sw $s1, 0x3c($sp) -/* 0D9688 7F0A4B58 0C00303B */ jal joyGetStickX -/* 0D968C 7F0A4B5C 00002025 */ move $a0, $zero -/* 0D9690 7F0A4B60 2841000B */ slti $at, $v0, 0xb -/* 0D9694 7F0A4B64 14200006 */ bnez $at, .L7F0A4B80 -/* 0D9698 7F0A4B68 00002025 */ move $a0, $zero -/* 0D969C 7F0A4B6C 3C128004 */ lui $s2, %hi(D_80040B48) -/* 0D96A0 7F0A4B70 26520B48 */ addiu $s2, %lo(D_80040B48) # addiu $s2, $s2, 0xb48 -/* 0D96A4 7F0A4B74 8E4E0000 */ lw $t6, ($s2) -/* 0D96A8 7F0A4B78 25CF0001 */ addiu $t7, $t6, 1 -/* 0D96AC 7F0A4B7C AE4F0000 */ sw $t7, ($s2) -.L7F0A4B80: -/* 0D96B0 7F0A4B80 3C128004 */ lui $s2, %hi(D_80040B48) -/* 0D96B4 7F0A4B84 0C00303B */ jal joyGetStickX -/* 0D96B8 7F0A4B88 26520B48 */ addiu $s2, %lo(D_80040B48) # addiu $s2, $s2, 0xb48 -/* 0D96BC 7F0A4B8C 2841FFF6 */ slti $at, $v0, -0xa -/* 0D96C0 7F0A4B90 10200004 */ beqz $at, .L7F0A4BA4 -/* 0D96C4 7F0A4B94 00000000 */ nop -/* 0D96C8 7F0A4B98 8E580000 */ lw $t8, ($s2) -/* 0D96CC 7F0A4B9C 2719FFFF */ addiu $t9, $t8, -1 -/* 0D96D0 7F0A4BA0 AE590000 */ sw $t9, ($s2) -.L7F0A4BA4: -/* 0D96D4 7F0A4BA4 0C00307F */ jal joyGetStickY -/* 0D96D8 7F0A4BA8 00002025 */ move $a0, $zero -/* 0D96DC 7F0A4BAC 2841000B */ slti $at, $v0, 0xb -/* 0D96E0 7F0A4BB0 14200006 */ bnez $at, .L7F0A4BCC -/* 0D96E4 7F0A4BB4 00002025 */ move $a0, $zero -/* 0D96E8 7F0A4BB8 3C118004 */ lui $s1, %hi(D_80040B4C) -/* 0D96EC 7F0A4BBC 26310B4C */ addiu $s1, %lo(D_80040B4C) # addiu $s1, $s1, 0xb4c -/* 0D96F0 7F0A4BC0 8E2A0000 */ lw $t2, ($s1) -/* 0D96F4 7F0A4BC4 254BFFFF */ addiu $t3, $t2, -1 -/* 0D96F8 7F0A4BC8 AE2B0000 */ sw $t3, ($s1) -.L7F0A4BCC: -/* 0D96FC 7F0A4BCC 3C118004 */ lui $s1, %hi(D_80040B4C) -/* 0D9700 7F0A4BD0 0C00307F */ jal joyGetStickY -/* 0D9704 7F0A4BD4 26310B4C */ addiu $s1, %lo(D_80040B4C) # addiu $s1, $s1, 0xb4c -/* 0D9708 7F0A4BD8 2841FFF6 */ slti $at, $v0, -0xa -/* 0D970C 7F0A4BDC 10200004 */ beqz $at, .L7F0A4BF0 -/* 0D9710 7F0A4BE0 02001025 */ move $v0, $s0 -/* 0D9714 7F0A4BE4 8E2C0000 */ lw $t4, ($s1) -/* 0D9718 7F0A4BE8 258D0001 */ addiu $t5, $t4, 1 -/* 0D971C 7F0A4BEC AE2D0000 */ sw $t5, ($s1) -.L7F0A4BF0: -/* 0D9720 7F0A4BF0 26100008 */ addiu $s0, $s0, 8 -/* 0D9724 7F0A4BF4 3C0EB900 */ lui $t6, (0xB900031D >> 16) # lui $t6, 0xb900 -/* 0D9728 7F0A4BF8 3C0F0050 */ lui $t7, (0x00504240 >> 16) # lui $t7, 0x50 -/* 0D972C 7F0A4BFC 35EF4240 */ ori $t7, (0x00504240 & 0xFFFF) # ori $t7, $t7, 0x4240 -/* 0D9730 7F0A4C00 35CE031D */ ori $t6, (0xB900031D & 0xFFFF) # ori $t6, $t6, 0x31d -/* 0D9734 7F0A4C04 02001825 */ move $v1, $s0 -/* 0D9738 7F0A4C08 AC4E0000 */ sw $t6, ($v0) -/* 0D973C 7F0A4C0C AC4F0004 */ sw $t7, 4($v0) -/* 0D9740 7F0A4C10 3C18FCFF */ lui $t8, (0xFCFFFFFF >> 16) # lui $t8, 0xfcff -/* 0D9744 7F0A4C14 3C19FFFD */ lui $t9, (0xFFFDF6FB >> 16) # lui $t9, 0xfffd -/* 0D9748 7F0A4C18 3739F6FB */ ori $t9, (0xFFFDF6FB & 0xFFFF) # ori $t9, $t9, 0xf6fb -/* 0D974C 7F0A4C1C 3718FFFF */ ori $t8, (0xFCFFFFFF & 0xFFFF) # ori $t8, $t8, 0xffff -/* 0D9750 7F0A4C20 26100008 */ addiu $s0, $s0, 8 -/* 0D9754 7F0A4C24 AC780000 */ sw $t8, ($v1) -/* 0D9758 7F0A4C28 AC790004 */ sw $t9, 4($v1) -/* 0D975C 7F0A4C2C 02004025 */ move $t0, $s0 -/* 0D9760 7F0A4C30 3C0BFF00 */ lui $t3, (0xFF0000FF >> 16) # lui $t3, 0xff00 -/* 0D9764 7F0A4C34 356B00FF */ ori $t3, (0xFF0000FF & 0xFFFF) # ori $t3, $t3, 0xff -/* 0D9768 7F0A4C38 3C0AFA00 */ lui $t2, 0xfa00 -/* 0D976C 7F0A4C3C AD0A0000 */ sw $t2, ($t0) -/* 0D9770 7F0A4C40 AD0B0004 */ sw $t3, 4($t0) -/* 0D9774 7F0A4C44 8E4C0000 */ lw $t4, ($s2) -/* 0D9778 7F0A4C48 8E390000 */ lw $t9, ($s1) -/* 0D977C 7F0A4C4C 3C01F600 */ lui $at, 0xf600 -/* 0D9780 7F0A4C50 258D0001 */ addiu $t5, $t4, 1 -/* 0D9784 7F0A4C54 31AE03FF */ andi $t6, $t5, 0x3ff -/* 0D9788 7F0A4C58 272A0001 */ addiu $t2, $t9, 1 -/* 0D978C 7F0A4C5C 314B03FF */ andi $t3, $t2, 0x3ff -/* 0D9790 7F0A4C60 000E7B80 */ sll $t7, $t6, 0xe -/* 0D9794 7F0A4C64 26100008 */ addiu $s0, $s0, 8 -/* 0D9798 7F0A4C68 01E1C025 */ or $t8, $t7, $at -/* 0D979C 7F0A4C6C 000B6080 */ sll $t4, $t3, 2 -/* 0D97A0 7F0A4C70 030C6825 */ or $t5, $t8, $t4 -/* 0D97A4 7F0A4C74 02004825 */ move $t1, $s0 -/* 0D97A8 7F0A4C78 AD2D0000 */ sw $t5, ($t1) -/* 0D97AC 7F0A4C7C 8E2A0000 */ lw $t2, ($s1) -/* 0D97B0 7F0A4C80 8E4E0000 */ lw $t6, ($s2) -/* 0D97B4 7F0A4C84 3C0D8004 */ lui $t5, %hi(ptrFirstFontTableSmall) -/* 0D97B8 7F0A4C88 314B03FF */ andi $t3, $t2, 0x3ff -/* 0D97BC 7F0A4C8C 31CF03FF */ andi $t7, $t6, 0x3ff -/* 0D97C0 7F0A4C90 000FCB80 */ sll $t9, $t7, 0xe -/* 0D97C4 7F0A4C94 000BC080 */ sll $t8, $t3, 2 -/* 0D97C8 7F0A4C98 03386025 */ or $t4, $t9, $t8 -/* 0D97CC 7F0A4C9C AD2C0004 */ sw $t4, 4($t1) -/* 0D97D0 7F0A4CA0 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) -/* 0D97D4 7F0A4CA4 8DAD0EAC */ lw $t5, %lo(ptrFirstFontTableSmall)($t5) -/* 0D97D8 7F0A4CA8 8DCE0EB0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) -/* 0D97DC 7F0A4CAC 3C058005 */ lui $a1, %hi(aDD) -/* 0D97E0 7F0A4CB0 26100008 */ addiu $s0, $s0, 8 -/* 0D97E4 7F0A4CB4 24A57760 */ addiu $a1, %lo(aDD) # addiu $a1, $a1, 0x7760 -/* 0D97E8 7F0A4CB8 8E270000 */ lw $a3, ($s1) -/* 0D97EC 7F0A4CBC 8E460000 */ lw $a2, ($s2) -/* 0D97F0 7F0A4CC0 27A4005C */ addiu $a0, $sp, 0x5c -/* 0D97F4 7F0A4CC4 AFAD0058 */ sw $t5, 0x58($sp) -/* 0D97F8 7F0A4CC8 0C002B25 */ jal sprintf -/* 0D97FC 7F0A4CCC AFAE0054 */ sw $t6, 0x54($sp) -/* 0D9800 7F0A4CD0 0FC2B366 */ jal microcode_constructor -/* 0D9804 7F0A4CD4 02002025 */ move $a0, $s0 -/* 0D9808 7F0A4CD8 8FAF0058 */ lw $t7, 0x58($sp) -/* 0D980C 7F0A4CDC 00408025 */ move $s0, $v0 -/* 0D9810 7F0A4CE0 27A4004C */ addiu $a0, $sp, 0x4c -/* 0D9814 7F0A4CE4 27A50050 */ addiu $a1, $sp, 0x50 -/* 0D9818 7F0A4CE8 27A6005C */ addiu $a2, $sp, 0x5c -/* 0D981C 7F0A4CEC 8FA70054 */ lw $a3, 0x54($sp) -/* 0D9820 7F0A4CF0 AFA00014 */ sw $zero, 0x14($sp) -/* 0D9824 7F0A4CF4 0FC2BA63 */ jal sub_GAME_7F0AE98C -/* 0D9828 7F0A4CF8 AFAF0010 */ sw $t7, 0x10($sp) -/* 0D982C 7F0A4CFC 8FAA0054 */ lw $t2, 0x54($sp) -/* 0D9830 7F0A4D00 8FAB0058 */ lw $t3, 0x58($sp) -/* 0D9834 7F0A4D04 8FB80050 */ lw $t8, 0x50($sp) -/* 0D9838 7F0A4D08 8FAC004C */ lw $t4, 0x4c($sp) -/* 0D983C 7F0A4D0C 3C19FF00 */ lui $t9, (0xFF0000FF >> 16) # lui $t9, 0xff00 -/* 0D9840 7F0A4D10 373900FF */ ori $t9, (0xFF0000FF & 0xFFFF) # ori $t9, $t9, 0xff -/* 0D9844 7F0A4D14 AFB90018 */ sw $t9, 0x18($sp) -/* 0D9848 7F0A4D18 02002025 */ move $a0, $s0 -/* 0D984C 7F0A4D1C 02402825 */ move $a1, $s2 -/* 0D9850 7F0A4D20 02203025 */ move $a2, $s1 -/* 0D9854 7F0A4D24 27A7005C */ addiu $a3, $sp, 0x5c -/* 0D9858 7F0A4D28 AFA00024 */ sw $zero, 0x24($sp) -/* 0D985C 7F0A4D2C AFA00028 */ sw $zero, 0x28($sp) -/* 0D9860 7F0A4D30 AFAA0010 */ sw $t2, 0x10($sp) -/* 0D9864 7F0A4D34 AFAB0014 */ sw $t3, 0x14($sp) -/* 0D9868 7F0A4D38 AFB8001C */ sw $t8, 0x1c($sp) -/* 0D986C 7F0A4D3C 0FC2B6AF */ jal en_text_write_stuff -/* 0D9870 7F0A4D40 AFAC0020 */ sw $t4, 0x20($sp) -/* 0D9874 7F0A4D44 8FAE0054 */ lw $t6, 0x54($sp) -/* 0D9878 7F0A4D48 8E2D0000 */ lw $t5, ($s1) -/* 0D987C 7F0A4D4C 8FBF0044 */ lw $ra, 0x44($sp) -/* 0D9880 7F0A4D50 8DCF0890 */ lw $t7, 0x890($t6) -/* 0D9884 7F0A4D54 8FB00038 */ lw $s0, 0x38($sp) -/* 0D9888 7F0A4D58 8FB20040 */ lw $s2, 0x40($sp) -/* 0D988C 7F0A4D5C 01AF5023 */ subu $t2, $t5, $t7 -/* 0D9890 7F0A4D60 254B0001 */ addiu $t3, $t2, 1 -/* 0D9894 7F0A4D64 AE2B0000 */ sw $t3, ($s1) -/* 0D9898 7F0A4D68 8FB1003C */ lw $s1, 0x3c($sp) -/* 0D989C 7F0A4D6C 03E00008 */ jr $ra -/* 0D98A0 7F0A4D70 27BD0080 */ addiu $sp, $sp, 0x80 -) -#endif @@ -2192,13 +2044,13 @@ void sub_GAME_7F0A69A8(void) * Address 0x7F0A6A2C. (VERSION_US, VERSION_JP) * Address 0x7F0A5D78. (VERSION_EU) */ -f32 sub_GAME_7F0A6A2C(f32 arg0) +f32 watchWrapAroundPI(f32 arg0) { - if (arg0 > 3.1415927f) + if (arg0 > M_PI_F) { arg0 = arg0 - M_TAU_F; } - else if (arg0 < -3.1415927f) + else if (arg0 < M_MINUS_PI_F) { arg0 = arg0 + M_TAU_F; } @@ -2282,7 +2134,7 @@ void sub_GAME_7F0A6A80(void) D_80040B14 += ((D_80040B1C * jpD_800484D0 * M_TAU_F) / 360.0f); #endif - D_80040B14 = sub_GAME_7F0A6A2C(D_80040B14); + D_80040B14 = watchWrapAroundPI(D_80040B14); temp_1 = D_80040B0C << 0x10; if (temp_1 < randomGetNext()) @@ -2664,17 +2516,17 @@ Gfx *draw_abort_cancel_confirm(Gfx *gdl) s32 sp64; s32 sp60; - s32 pFirstFontTable; - s32 pSecondFontTable; + s32 pFontFile; + s32 pFontChars; s32 sp54; s32 sp50; s32 sp4C; - pFirstFontTable = ptrFirstFontTableSmall; - pSecondFontTable = ptrSecondFontTableSmall; - sp54 = langGet(TEXT(LOPTIONS, 0x24)); //abort: - sp50 = langGet(TEXT(LOPTIONS, 0x25)); //confirm - sp4C = langGet(TEXT(LOPTIONS, 0x26)); //cancel + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; + sp54 = langGet(TEXT(LOPTIONS, OPTION_STR_24)); //abort: + sp50 = langGet(TEXT(LOPTIONS, OPTION_STR_25)); //confirm + sp4C = langGet(TEXT(LOPTIONS, OPTION_STR_26)); //cancel sp7C = 0x51; sp78 = (j_text_trigger ? 0xF : 0) + 0xBD; @@ -2706,30 +2558,30 @@ Gfx *draw_abort_cancel_confirm(Gfx *gdl) if (watch_item_is_actively_selected != 0) { - sub_GAME_7F0AE98C(&sp60, &sp64, sp54, pSecondFontTable, pFirstFontTable, 0); + textMeasure(&sp60, &sp64, sp54, pFontChars, pFontFile, 0); - gdl = en_text_write_stuff(gdl, &sp7C, &sp70, sp54, pSecondFontTable, pFirstFontTable, 0xA0FFA0F0, sp64, sp60, 0, 0); + gdl = textRender(gdl, &sp7C, &sp70, sp54, pFontChars, pFontFile, 0xA0FFA0F0, sp64, sp60, 0, 0); if (D_800409A4 != 0) { - gdl = jp_text_write_stuff(gdl, &sp78, &sp6C, sp50, pSecondFontTable, pFirstFontTable, -1, 0x7000A0, viGetX(), viGetY(), 0, 0); - gdl = en_text_write_stuff(gdl, &sp74, &sp68, sp4C, pSecondFontTable, pFirstFontTable, 0xFF00B0, viGetX(), viGetY(), 0, 0); + gdl = textRenderGlow(gdl, &sp78, &sp6C, sp50, pFontChars, pFontFile, -1, 0x7000A0, viGetX(), viGetY(), 0, 0); + gdl = textRender(gdl, &sp74, &sp68, sp4C, pFontChars, pFontFile, 0xFF00B0, viGetX(), viGetY(), 0, 0); } else { if (D_800409A4 == 0) { - gdl = en_text_write_stuff(gdl, &sp78, &sp6C, sp50, pSecondFontTable, pFirstFontTable, 0xFF00B0, viGetX(), viGetY(), 0, 0); - gdl = jp_text_write_stuff(gdl, &sp74, &sp68, sp4C, pSecondFontTable, pFirstFontTable, -1, 0x7000A0, viGetX(), viGetY(), 0, 0); + gdl = textRender(gdl, &sp78, &sp6C, sp50, pFontChars, pFontFile, 0xFF00B0, viGetX(), viGetY(), 0, 0); + gdl = textRenderGlow(gdl, &sp74, &sp68, sp4C, pFontChars, pFontFile, -1, 0x7000A0, viGetX(), viGetY(), 0, 0); } } } else { - sub_GAME_7F0AE98C(&sp60, &sp64, sp54, pSecondFontTable, pFirstFontTable, 0); - gdl = en_text_write_stuff(gdl, &sp7C, &sp70, sp54, pSecondFontTable, pFirstFontTable, 0x800080, sp64, sp60, 0, 0); - gdl = en_text_write_stuff(gdl, &sp78, &sp6C, sp50, pSecondFontTable, pFirstFontTable, 0x800080, viGetX(), viGetY(), 0, 0); - gdl = en_text_write_stuff(gdl, &sp74, &sp68, sp4C, pSecondFontTable, pFirstFontTable, 0x800080, viGetX(), viGetY(), 0, 0); + textMeasure(&sp60, &sp64, sp54, pFontChars, pFontFile, 0); + gdl = textRender(gdl, &sp7C, &sp70, sp54, pFontChars, pFontFile, 0x800080, sp64, sp60, 0, 0); + gdl = textRender(gdl, &sp78, &sp6C, sp50, pFontChars, pFontFile, 0x800080, viGetX(), viGetY(), 0, 0); + gdl = textRender(gdl, &sp74, &sp68, sp4C, pFontChars, pFontFile, 0x800080, viGetX(), viGetY(), 0, 0); } return gdl; @@ -2744,31 +2596,31 @@ Gfx *draw_text_mission_status(Gfx *gdl) s32 sp60; s32 sp5C; s32 sp58; - s32 ptr_first_font; - s32 ptr_second_font; + s32 pFontFile; + s32 pFontChars; s32 sp4C; s32 joffset; - txtptr_1 = langGet(TEXT(LOPTIONS, 0x27)); //mission status: - ptr_first_font = ptrFirstFontTableSmall; - ptr_second_font = ptrSecondFontTableSmall; + txtptr_1 = langGet(TEXT(LOPTIONS, OPTION_STR_27)); //mission status: + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; if (objectiveIsAllComplete()) { sp4C = 0xFF00B0; - txtptr_2 = langGet(TEXT(LOPTIONS, 0x28)); //complete + txtptr_2 = langGet(TEXT(LOPTIONS, OPTION_STR_28)); //complete } else { sp4C = D_80040AF4; - txtptr_2 = langGet(TEXT(LOPTIONS, 0x29)); //incomplete + txtptr_2 = langGet(TEXT(LOPTIONS, OPTION_STR_29)); //incomplete } gdl = microcode_constructor(gdl); - sub_GAME_7F0AE98C(&sp5C, &sp58, txtptr_1, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp5C, &sp58, txtptr_1, pFontChars, pFontFile, 0); sp64 = 0x51; sp60 = YOFFSET_MISSIONSTATUS; - gdl = en_text_write_stuff(gdl, &sp64, &sp60, txtptr_1, ptr_second_font, ptr_first_font, 0xFF00B0, sp58, sp5C, 0, 0); + gdl = textRender(gdl, &sp64, &sp60, txtptr_1, pFontChars, pFontFile, 0xFF00B0, sp58, sp5C, 0, 0); if (j_text_trigger) { @@ -2781,8 +2633,8 @@ Gfx *draw_text_mission_status(Gfx *gdl) sp64 = sp64 + sp58 + joffset + 4; sp60 = sp60 - sp5C; - sub_GAME_7F0AE98C(&sp5C, &sp58, txtptr_2, ptr_second_font, ptr_first_font, 0); - gdl = en_text_write_stuff(gdl, &sp64, &sp60, txtptr_2, ptr_second_font, ptr_first_font, sp4C, sp58, sp5C, 0, 0); + textMeasure(&sp5C, &sp58, txtptr_2, pFontChars, pFontFile, 0); + gdl = textRender(gdl, &sp64, &sp60, txtptr_2, pFontChars, pFontFile, sp4C, sp58, sp5C, 0, 0); gdl = draw_abort_cancel_confirm(gdl); return gdl; @@ -2801,11 +2653,11 @@ Gfx *draw_text_q_watch_v201_beta(Gfx *gdl) s32 sp4C; s32 sp48; s32 sp44; - s32 pFirstFontTable; - s32 pSecondFontTable; + s32 pFontFile; + s32 pFontChars; s32 joffset; - txtptr = langGet(TEXT(LOPTIONS, 0x2B)); //q watch v2.01 beta + txtptr = langGet(TEXT(LOPTIONS, OPTION_STR_2B)); //q watch v2.01 beta if (j_text_trigger) { @@ -2819,11 +2671,11 @@ Gfx *draw_text_q_watch_v201_beta(Gfx *gdl) sp4C = YOFFSET_7; sp48 = 0; sp44 = 0; - pFirstFontTable = ptrFirstFontTableSmall; - pSecondFontTable = ptrSecondFontTableSmall; + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; gdl = microcode_constructor(gdl); - sub_GAME_7F0AE98C(&sp48, &sp44, txtptr, pSecondFontTable, pFirstFontTable, 0); - gdl = en_text_write_stuff(gdl, &sp50, &sp4C, txtptr, pSecondFontTable, pFirstFontTable, 0xFF00B0, sp44, sp48, 0, 0); + textMeasure(&sp48, &sp44, txtptr, pFontChars, pFontFile, 0); + gdl = textRender(gdl, &sp50, &sp4C, txtptr, pFontChars, pFontFile, 0xFF00B0, sp44, sp48, 0, 0); return gdl; } @@ -2865,10 +2717,10 @@ glabel draw_current_hand_item_and_ammo /* 0DC9E0 7F0A7EB0 AFB00038 */ sw $s0, 0x38($sp) /* 0DC9E4 7F0A7EB4 0FC2F5B8 */ jal dynAllocateMatrix /* 0DC9E8 7F0A7EB8 00808025 */ move $s0, $a0 -/* 0DC9EC 7F0A7EBC 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0DC9F0 7F0A7EC0 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0DC9F4 7F0A7EC4 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0DC9F8 7F0A7EC8 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0DC9EC 7F0A7EBC 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0DC9F0 7F0A7EC0 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0DC9F4 7F0A7EC4 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0DC9F8 7F0A7EC8 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0DC9FC 7F0A7ECC AFA20114 */ sw $v0, 0x114($sp) /* 0DCA00 7F0A7ED0 AFA00084 */ sw $zero, 0x84($sp) /* 0DCA04 7F0A7ED4 AFA00080 */ sw $zero, 0x80($sp) @@ -3096,7 +2948,7 @@ glabel draw_current_hand_item_and_ammo /* 0DCD58 7F0A8228 8FA60054 */ lw $a2, 0x54($sp) /* 0DCD5C 7F0A822C 8FA70078 */ lw $a3, 0x78($sp) /* 0DCD60 7F0A8230 AFA00014 */ sw $zero, 0x14($sp) -/* 0DCD64 7F0A8234 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DCD64 7F0A8234 0FC2BA63 */ jal textMeasure /* 0DCD68 7F0A8238 AFAD0010 */ sw $t5, 0x10($sp) /* 0DCD6C 7F0A823C 8FAE0078 */ lw $t6, 0x78($sp) /* 0DCD70 7F0A8240 8FAF007C */ lw $t7, 0x7c($sp) @@ -3114,7 +2966,7 @@ glabel draw_current_hand_item_and_ammo /* 0DCDA0 7F0A8270 AFAE0010 */ sw $t6, 0x10($sp) /* 0DCDA4 7F0A8274 AFAF0014 */ sw $t7, 0x14($sp) /* 0DCDA8 7F0A8278 AFB9001C */ sw $t9, 0x1c($sp) -/* 0DCDAC 7F0A827C 0FC2B6AF */ jal en_text_write_stuff +/* 0DCDAC 7F0A827C 0FC2B6AF */ jal textRender /* 0DCDB0 7F0A8280 AFA80020 */ sw $t0, 0x20($sp) /* 0DCDB4 7F0A8284 8FAA007C */ lw $t2, 0x7c($sp) /* 0DCDB8 7F0A8288 240900AA */ li $t1, 170 @@ -3125,7 +2977,7 @@ glabel draw_current_hand_item_and_ammo /* 0DCDCC 7F0A829C 8FA60050 */ lw $a2, 0x50($sp) /* 0DCDD0 7F0A82A0 8FA70078 */ lw $a3, 0x78($sp) /* 0DCDD4 7F0A82A4 AFA00014 */ sw $zero, 0x14($sp) -/* 0DCDD8 7F0A82A8 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DCDD8 7F0A82A8 0FC2BA63 */ jal textMeasure /* 0DCDDC 7F0A82AC AFAA0010 */ sw $t2, 0x10($sp) /* 0DCDE0 7F0A82B0 8FAB0078 */ lw $t3, 0x78($sp) /* 0DCDE4 7F0A82B4 8FAC007C */ lw $t4, 0x7c($sp) @@ -3143,7 +2995,7 @@ glabel draw_current_hand_item_and_ammo /* 0DCE14 7F0A82E4 AFAB0010 */ sw $t3, 0x10($sp) /* 0DCE18 7F0A82E8 AFAC0014 */ sw $t4, 0x14($sp) /* 0DCE1C 7F0A82EC AFAE001C */ sw $t6, 0x1c($sp) -/* 0DCE20 7F0A82F0 0FC2B6AF */ jal en_text_write_stuff +/* 0DCE20 7F0A82F0 0FC2B6AF */ jal textRender /* 0DCE24 7F0A82F4 AFAF0020 */ sw $t7, 0x20($sp) /* 0DCE28 7F0A82F8 8FBF003C */ lw $ra, 0x3c($sp) /* 0DCE2C 7F0A82FC 8FB00038 */ lw $s0, 0x38($sp) @@ -3183,10 +3035,10 @@ glabel draw_current_hand_item_and_ammo /* 0D9BB8 7F0A71C8 AFB00038 */ sw $s0, 0x38($sp) /* 0D9BBC 7F0A71CC 0FC2F2A4 */ jal dynAllocateMatrix /* 0D9BC0 7F0A71D0 00808025 */ move $s0, $a0 -/* 0D9BC4 7F0A71D4 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0D9BC8 7F0A71D8 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0D9BCC 7F0A71DC 8DCEAAFC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0D9BD0 7F0A71E0 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0D9BC4 7F0A71D4 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0D9BC8 7F0A71D8 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0D9BCC 7F0A71DC 8DCEAAFC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0D9BD0 7F0A71E0 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0D9BD4 7F0A71E4 AFA20114 */ sw $v0, 0x114($sp) /* 0D9BD8 7F0A71E8 AFA00084 */ sw $zero, 0x84($sp) /* 0D9BDC 7F0A71EC AFA00080 */ sw $zero, 0x80($sp) @@ -3414,7 +3266,7 @@ glabel draw_current_hand_item_and_ammo /* 0D9F30 7F0A7540 8FA60054 */ lw $a2, 0x54($sp) /* 0D9F34 7F0A7544 8FA70078 */ lw $a3, 0x78($sp) /* 0D9F38 7F0A7548 AFA00014 */ sw $zero, 0x14($sp) -/* 0D9F3C 7F0A754C 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0D9F3C 7F0A754C 0FC2B713 */ jal textMeasure /* 0D9F40 7F0A7550 AFAD0010 */ sw $t5, 0x10($sp) /* 0D9F44 7F0A7554 8FAE0078 */ lw $t6, 0x78($sp) /* 0D9F48 7F0A7558 8FAF007C */ lw $t7, 0x7c($sp) @@ -3432,7 +3284,7 @@ glabel draw_current_hand_item_and_ammo /* 0D9F78 7F0A7588 AFAE0010 */ sw $t6, 0x10($sp) /* 0D9F7C 7F0A758C AFAF0014 */ sw $t7, 0x14($sp) /* 0D9F80 7F0A7590 AFB9001C */ sw $t9, 0x1c($sp) -/* 0D9F84 7F0A7594 0FC2B35F */ jal en_text_write_stuff +/* 0D9F84 7F0A7594 0FC2B35F */ jal textRender /* 0D9F88 7F0A7598 AFA80020 */ sw $t0, 0x20($sp) /* 0D9F8C 7F0A759C 8FAA007C */ lw $t2, 0x7c($sp) /* 0D9F90 7F0A75A0 240900C6 */ li $t1, 198 @@ -3443,7 +3295,7 @@ glabel draw_current_hand_item_and_ammo /* 0D9FA4 7F0A75B4 8FA60050 */ lw $a2, 0x50($sp) /* 0D9FA8 7F0A75B8 8FA70078 */ lw $a3, 0x78($sp) /* 0D9FAC 7F0A75BC AFA00014 */ sw $zero, 0x14($sp) -/* 0D9FB0 7F0A75C0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0D9FB0 7F0A75C0 0FC2B713 */ jal textMeasure /* 0D9FB4 7F0A75C4 AFAA0010 */ sw $t2, 0x10($sp) /* 0D9FB8 7F0A75C8 8FAB0078 */ lw $t3, 0x78($sp) /* 0D9FBC 7F0A75CC 8FAC007C */ lw $t4, 0x7c($sp) @@ -3461,7 +3313,7 @@ glabel draw_current_hand_item_and_ammo /* 0D9FEC 7F0A75FC AFAB0010 */ sw $t3, 0x10($sp) /* 0D9FF0 7F0A7600 AFAC0014 */ sw $t4, 0x14($sp) /* 0D9FF4 7F0A7604 AFAE001C */ sw $t6, 0x1c($sp) -/* 0D9FF8 7F0A7608 0FC2B35F */ jal en_text_write_stuff +/* 0D9FF8 7F0A7608 0FC2B35F */ jal textRender /* 0D9FFC 7F0A760C AFAF0020 */ sw $t7, 0x20($sp) /* 0DA000 7F0A7610 8FBF003C */ lw $ra, 0x3c($sp) /* 0DA004 7F0A7614 8FB00038 */ lw $s0, 0x38($sp) @@ -3728,10 +3580,10 @@ glabel draw_watch_inventory_page /* 0DD254 7F0A8724 27A608E0 */ addiu $a2, $sp, 0x8e0 /* 0DD258 7F0A8728 0FC18C01 */ jal set_enviro_fog_for_items_in_solo_watch_menu /* 0DD25C 7F0A872C 24070040 */ li $a3, 64 -/* 0DD260 7F0A8730 3C098004 */ lui $t1, %hi(ptrFirstFontTableSmall) -/* 0DD264 7F0A8734 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) -/* 0DD268 7F0A8738 8D290EAC */ lw $t1, %lo(ptrFirstFontTableSmall)($t1) -/* 0DD26C 7F0A873C 8D4A0EB0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0DD260 7F0A8730 3C098004 */ lui $t1, %hi(ptrFontBankGothic) +/* 0DD264 7F0A8734 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) +/* 0DD268 7F0A8738 8D290EAC */ lw $t1, %lo(ptrFontBankGothic)($t1) +/* 0DD26C 7F0A873C 8D4A0EB0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0DD270 7F0A8740 AFA20928 */ sw $v0, 0x928($sp) /* 0DD274 7F0A8744 AFA00860 */ sw $zero, 0x860($sp) /* 0DD278 7F0A8748 AFA0085C */ sw $zero, 0x85c($sp) @@ -3794,7 +3646,7 @@ glabel draw_watch_inventory_page /* 0DD340 7F0A8810 27A60084 */ addiu $a2, $sp, 0x84 /* 0DD344 7F0A8814 8FA70854 */ lw $a3, 0x854($sp) /* 0DD348 7F0A8818 AFA20014 */ sw $v0, 0x14($sp) -/* 0DD34C 7F0A881C 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DD34C 7F0A881C 0FC2BA63 */ jal textMeasure /* 0DD350 7F0A8820 AFB80010 */ sw $t8, 0x10($sp) /* 0DD354 7F0A8824 3C198005 */ lui $t9, %hi(j_text_trigger) /* 0DD358 7F0A8828 8F3984D0 */ lw $t9, %lo(j_text_trigger)($t9) @@ -3849,7 +3701,7 @@ glabel draw_watch_inventory_page /* 0DD404 7F0A88D4 AFA20028 */ sw $v0, 0x28($sp) /* 0DD408 7F0A88D8 AFB90024 */ sw $t9, 0x24($sp) /* 0DD40C 7F0A88DC AFAB0010 */ sw $t3, 0x10($sp) -/* 0DD410 7F0A88E0 0FC2B6AF */ jal en_text_write_stuff +/* 0DD410 7F0A88E0 0FC2B6AF */ jal textRender /* 0DD414 7F0A88E4 AFAC0014 */ sw $t4, 0x14($sp) /* 0DD418 7F0A88E8 3C098005 */ lui $t1, %hi(j_text_trigger) /* 0DD41C 7F0A88EC 8D2984D0 */ lw $t1, %lo(j_text_trigger)($t1) @@ -3871,12 +3723,12 @@ glabel draw_watch_inventory_page /* 0DD454 7F0A8924 AFAC0014 */ sw $t4, 0x14($sp) /* 0DD458 7F0A8928 0FC2B405 */ jal microcode_constructor_related_to_menus /* 0DD45C 7F0A892C 24E70052 */ addiu $a3, $a3, 0x52 -/* 0DD460 7F0A8930 3C0D8004 */ lui $t5, %hi(ptrSecondFontTableSmall) -/* 0DD464 7F0A8934 8DAD0EB0 */ lw $t5, %lo(ptrSecondFontTableSmall)($t5) -/* 0DD468 7F0A8938 3C108004 */ lui $s0, %hi(ptrFirstFontTableSmall) +/* 0DD460 7F0A8930 3C0D8004 */ lui $t5, %hi(ptrFontBankGothicChars) +/* 0DD464 7F0A8934 8DAD0EB0 */ lw $t5, %lo(ptrFontBankGothicChars)($t5) +/* 0DD468 7F0A8938 3C108004 */ lui $s0, %hi(ptrFontBankGothic) /* 0DD46C 7F0A893C 3C048004 */ lui $a0, %hi(g_curWatchItemIndex) /* 0DD470 7F0A8940 AFA20928 */ sw $v0, 0x928($sp) -/* 0DD474 7F0A8944 8E100EAC */ lw $s0, %lo(ptrFirstFontTableSmall)($s0) +/* 0DD474 7F0A8944 8E100EAC */ lw $s0, %lo(ptrFontBankGothic)($s0) /* 0DD478 7F0A8948 8C8409B8 */ lw $a0, %lo(g_curWatchItemIndex)($a0) /* 0DD47C 7F0A894C 0FC234D0 */ jal bondinvGetNameByIndex /* 0DD480 7F0A8950 AFAD0058 */ sw $t5, 0x58($sp) @@ -3904,7 +3756,7 @@ glabel draw_watch_inventory_page /* 0DD4D8 7F0A89A8 27A60060 */ addiu $a2, $sp, 0x60 /* 0DD4DC 7F0A89AC 8FA70058 */ lw $a3, 0x58($sp) /* 0DD4E0 7F0A89B0 AFB00010 */ sw $s0, 0x10($sp) -/* 0DD4E4 7F0A89B4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DD4E4 7F0A89B4 0FC2BA63 */ jal textMeasure /* 0DD4E8 7F0A89B8 AFA00014 */ sw $zero, 0x14($sp) /* 0DD4EC 7F0A89BC 3C0F8004 */ lui $t7, %hi(D_800409C0) /* 0DD4F0 7F0A89C0 8DEF09C0 */ lw $t7, %lo(D_800409C0)($t7) @@ -3921,7 +3773,7 @@ glabel draw_watch_inventory_page /* 0DD51C 7F0A89EC 2402000E */ li $v0, 14 .L7F0A89F0: /* 0DD520 7F0A89F0 AFB00010 */ sw $s0, 0x10($sp) -/* 0DD524 7F0A89F4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DD524 7F0A89F4 0FC2BA63 */ jal textMeasure /* 0DD528 7F0A89F8 AFA20014 */ sw $v0, 0x14($sp) /* 0DD52C 7F0A89FC 3C038005 */ lui $v1, %hi(j_text_trigger) /* 0DD530 7F0A8A00 8C6384D0 */ lw $v1, %lo(j_text_trigger)($v1) @@ -3960,7 +3812,7 @@ glabel draw_watch_inventory_page /* 0DD5A4 7F0A8A74 AFA00024 */ sw $zero, 0x24($sp) /* 0DD5A8 7F0A8A78 AFA20028 */ sw $v0, 0x28($sp) /* 0DD5AC 7F0A8A7C AFAC0010 */ sw $t4, 0x10($sp) -/* 0DD5B0 7F0A8A80 0FC2B6AF */ jal en_text_write_stuff +/* 0DD5B0 7F0A8A80 0FC2B6AF */ jal textRender /* 0DD5B4 7F0A8A84 AFAE001C */ sw $t6, 0x1c($sp) /* 0DD5B8 7F0A8A88 1000001A */ b .L7F0A8AF4 /* 0DD5BC 7F0A8A8C AFA20928 */ sw $v0, 0x928($sp) @@ -3989,7 +3841,7 @@ glabel draw_watch_inventory_page /* 0DD60C 7F0A8ADC AFB00014 */ sw $s0, 0x14($sp) /* 0DD610 7F0A8AE0 AFA00028 */ sw $zero, 0x28($sp) /* 0DD614 7F0A8AE4 AFA2002C */ sw $v0, 0x2c($sp) -/* 0DD618 7F0A8AE8 0FC2B9BB */ jal jp_text_write_stuff +/* 0DD618 7F0A8AE8 0FC2B9BB */ jal textRenderGlow /* 0DD61C 7F0A8AEC AFB80010 */ sw $t8, 0x10($sp) /* 0DD620 7F0A8AF0 AFA20928 */ sw $v0, 0x928($sp) .L7F0A8AF4: @@ -4213,10 +4065,10 @@ glabel draw_watch_inventory_page /* 0DDE34 7F0A92C4 24070040 */ li $a3, 64 /* 0DDE38 7F0A92C8 3C0B8005 */ lui $t3, %hi(j_text_trigger) # $t3, 0x8005 /* 0DDE3C 7F0A92CC 8D6B8500 */ lw $t3, %lo(j_text_trigger)($t3) -/* 0DDE40 7F0A92D0 3C098004 */ lui $t1, %hi(ptrFirstFontTableSmall) # $t1, 0x8004 -/* 0DDE44 7F0A92D4 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) # $t2, 0x8004 -/* 0DDE48 7F0A92D8 8D290EDC */ lw $t1, %lo(ptrFirstFontTableSmall)($t1) -/* 0DDE4C 7F0A92DC 8D4A0EE0 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0DDE40 7F0A92D0 3C098004 */ lui $t1, %hi(ptrFontBankGothic) # $t1, 0x8004 +/* 0DDE44 7F0A92D4 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) # $t2, 0x8004 +/* 0DDE48 7F0A92D8 8D290EDC */ lw $t1, %lo(ptrFontBankGothic)($t1) +/* 0DDE4C 7F0A92DC 8D4A0EE0 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0DDE50 7F0A92E0 AFA20930 */ sw $v0, 0x930($sp) /* 0DDE54 7F0A92E4 AFA00868 */ sw $zero, 0x868($sp) /* 0DDE58 7F0A92E8 AFA00864 */ sw $zero, 0x864($sp) @@ -4288,7 +4140,7 @@ glabel draw_watch_inventory_page /* 0DDF3C 7F0A93CC 27A6008C */ addiu $a2, $sp, 0x8c /* 0DDF40 7F0A93D0 8FA7085C */ lw $a3, 0x85c($sp) /* 0DDF44 7F0A93D4 AFA20014 */ sw $v0, 0x14($sp) -/* 0DDF48 7F0A93D8 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0DDF48 7F0A93D8 0FC2BD4F */ jal textMeasure /* 0DDF4C 7F0A93DC AFAA0010 */ sw $t2, 0x10($sp) /* 0DDF50 7F0A93E0 3C0B8005 */ lui $t3, %hi(j_text_trigger) # $t3, 0x8005 /* 0DDF54 7F0A93E4 8D6B8500 */ lw $t3, %lo(j_text_trigger)($t3) @@ -4343,7 +4195,7 @@ glabel draw_watch_inventory_page /* 0DE000 7F0A9490 AFA20028 */ sw $v0, 0x28($sp) /* 0DE004 7F0A9494 AFAB0024 */ sw $t3, 0x24($sp) /* 0DE008 7F0A9498 AFAE0010 */ sw $t6, 0x10($sp) -/* 0DE00C 7F0A949C 0FC2B99B */ jal en_text_write_stuff +/* 0DE00C 7F0A949C 0FC2B99B */ jal textRender /* 0DE010 7F0A94A0 AFAF0014 */ sw $t7, 0x14($sp) /* 0DE014 7F0A94A4 3C0C8005 */ lui $t4, %hi(j_text_trigger) # $t4, 0x8005 /* 0DE018 7F0A94A8 8D8C8500 */ lw $t4, %lo(j_text_trigger)($t4) @@ -4365,12 +4217,12 @@ glabel draw_watch_inventory_page /* 0DE050 7F0A94E0 AFAF0014 */ sw $t7, 0x14($sp) /* 0DE054 7F0A94E4 0FC2B6F1 */ jal microcode_constructor_related_to_menus /* 0DE058 7F0A94E8 24E70052 */ addiu $a3, $a3, 0x52 -/* 0DE05C 7F0A94EC 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0DE060 7F0A94F0 8F180EE0 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) -/* 0DE064 7F0A94F4 3C108004 */ lui $s0, %hi(ptrFirstFontTableSmall) # $s0, 0x8004 +/* 0DE05C 7F0A94EC 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0DE060 7F0A94F0 8F180EE0 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) +/* 0DE064 7F0A94F4 3C108004 */ lui $s0, %hi(ptrFontBankGothic) # $s0, 0x8004 /* 0DE068 7F0A94F8 3C048004 */ lui $a0, %hi(g_curWatchItemIndex) # $a0, 0x8004 /* 0DE06C 7F0A94FC AFA20930 */ sw $v0, 0x930($sp) -/* 0DE070 7F0A9500 8E100EDC */ lw $s0, %lo(ptrFirstFontTableSmall)($s0) +/* 0DE070 7F0A9500 8E100EDC */ lw $s0, %lo(ptrFontBankGothic)($s0) /* 0DE074 7F0A9504 8C8409E8 */ lw $a0, %lo(g_curWatchItemIndex)($a0) /* 0DE078 7F0A9508 0FC2374A */ jal bondinvGetNameByIndex /* 0DE07C 7F0A950C AFB8005C */ sw $t8, 0x5c($sp) @@ -4398,7 +4250,7 @@ glabel draw_watch_inventory_page /* 0DE0D4 7F0A9564 27A60064 */ addiu $a2, $sp, 0x64 /* 0DE0D8 7F0A9568 8FA7005C */ lw $a3, 0x5c($sp) /* 0DE0DC 7F0A956C AFB00010 */ sw $s0, 0x10($sp) -/* 0DE0E0 7F0A9570 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0DE0E0 7F0A9570 0FC2BD4F */ jal textMeasure /* 0DE0E4 7F0A9574 AFA00014 */ sw $zero, 0x14($sp) /* 0DE0E8 7F0A9578 3C098004 */ lui $t1, %hi(D_800409C0) # $t1, 0x8004 /* 0DE0EC 7F0A957C 8D2909F0 */ lw $t1, %lo(D_800409C0)($t1) @@ -4415,7 +4267,7 @@ glabel draw_watch_inventory_page /* 0DE118 7F0A95A8 2402000E */ li $v0, 14 .Ljp7F0A95AC: /* 0DE11C 7F0A95AC AFB00010 */ sw $s0, 0x10($sp) -/* 0DE120 7F0A95B0 0FC2BD4F */ jal sub_GAME_7F0AE98C +/* 0DE120 7F0A95B0 0FC2BD4F */ jal textMeasure /* 0DE124 7F0A95B4 AFA20014 */ sw $v0, 0x14($sp) /* 0DE128 7F0A95B8 3C038005 */ lui $v1, %hi(j_text_trigger) # $v1, 0x8005 /* 0DE12C 7F0A95BC 8C638500 */ lw $v1, %lo(j_text_trigger)($v1) @@ -4455,7 +4307,7 @@ glabel draw_watch_inventory_page /* 0DE1A4 7F0A9634 AFA00024 */ sw $zero, 0x24($sp) /* 0DE1A8 7F0A9638 AFA20028 */ sw $v0, 0x28($sp) /* 0DE1AC 7F0A963C AFB80010 */ sw $t8, 0x10($sp) -/* 0DE1B0 7F0A9640 0FC2B99B */ jal en_text_write_stuff +/* 0DE1B0 7F0A9640 0FC2B99B */ jal textRender /* 0DE1B4 7F0A9644 AFA9001C */ sw $t1, 0x1c($sp) /* 0DE1B8 7F0A9648 1000001A */ b .Ljp7F0A96B4 /* 0DE1BC 7F0A964C AFA20930 */ sw $v0, 0x930($sp) @@ -4484,7 +4336,7 @@ glabel draw_watch_inventory_page /* 0DE20C 7F0A969C AFB00014 */ sw $s0, 0x14($sp) /* 0DE210 7F0A96A0 AFA00028 */ sw $zero, 0x28($sp) /* 0DE214 7F0A96A4 AFA2002C */ sw $v0, 0x2c($sp) -/* 0DE218 7F0A96A8 0FC2BCA7 */ jal jp_text_write_stuff +/* 0DE218 7F0A96A8 0FC2BCA7 */ jal textRenderGlow /* 0DE21C 7F0A96AC AFAB0010 */ sw $t3, 0x10($sp) /* 0DE220 7F0A96B0 AFA20930 */ sw $v0, 0x930($sp) .Ljp7F0A96B4: @@ -4708,10 +4560,10 @@ glabel draw_watch_inventory_page /* 0DA434 7F0A7A44 24070040 */ li $a3, 64 /* 0DA438 7F0A7A48 3C0B8004 */ lui $t3, %hi(j_text_trigger) # $t3, 0x8004 /* 0DA43C 7F0A7A4C 8D6B1150 */ lw $t3, %lo(j_text_trigger)($t3) -/* 0DA440 7F0A7A50 3C098004 */ lui $t1, %hi(ptrFirstFontTableSmall) # $t1, 0x8004 -/* 0DA444 7F0A7A54 3C0A8004 */ lui $t2, %hi(ptrSecondFontTableSmall) # $t2, 0x8004 -/* 0DA448 7F0A7A58 8D29AAFC */ lw $t1, %lo(ptrFirstFontTableSmall)($t1) -/* 0DA44C 7F0A7A5C 8D4AAB00 */ lw $t2, %lo(ptrSecondFontTableSmall)($t2) +/* 0DA440 7F0A7A50 3C098004 */ lui $t1, %hi(ptrFontBankGothic) # $t1, 0x8004 +/* 0DA444 7F0A7A54 3C0A8004 */ lui $t2, %hi(ptrFontBankGothicChars) # $t2, 0x8004 +/* 0DA448 7F0A7A58 8D29AAFC */ lw $t1, %lo(ptrFontBankGothic)($t1) +/* 0DA44C 7F0A7A5C 8D4AAB00 */ lw $t2, %lo(ptrFontBankGothicChars)($t2) /* 0DA450 7F0A7A60 AFA20930 */ sw $v0, 0x930($sp) /* 0DA454 7F0A7A64 AFA00868 */ sw $zero, 0x868($sp) /* 0DA458 7F0A7A68 AFA00864 */ sw $zero, 0x864($sp) @@ -4783,7 +4635,7 @@ glabel draw_watch_inventory_page /* 0DA53C 7F0A7B4C 27A6008C */ addiu $a2, $sp, 0x8c /* 0DA540 7F0A7B50 8FA7085C */ lw $a3, 0x85c($sp) /* 0DA544 7F0A7B54 AFA20014 */ sw $v0, 0x14($sp) -/* 0DA548 7F0A7B58 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DA548 7F0A7B58 0FC2B713 */ jal textMeasure /* 0DA54C 7F0A7B5C AFAA0010 */ sw $t2, 0x10($sp) /* 0DA550 7F0A7B60 3C0B8004 */ lui $t3, %hi(j_text_trigger) # $t3, 0x8004 /* 0DA554 7F0A7B64 8D6B1150 */ lw $t3, %lo(j_text_trigger)($t3) @@ -4838,7 +4690,7 @@ glabel draw_watch_inventory_page /* 0DA600 7F0A7C10 AFA20028 */ sw $v0, 0x28($sp) /* 0DA604 7F0A7C14 AFAB0024 */ sw $t3, 0x24($sp) /* 0DA608 7F0A7C18 AFAE0010 */ sw $t6, 0x10($sp) -/* 0DA60C 7F0A7C1C 0FC2B35F */ jal en_text_write_stuff +/* 0DA60C 7F0A7C1C 0FC2B35F */ jal textRender /* 0DA610 7F0A7C20 AFAF0014 */ sw $t7, 0x14($sp) /* 0DA614 7F0A7C24 3C0C8004 */ lui $t4, %hi(j_text_trigger) # $t4, 0x8004 /* 0DA618 7F0A7C28 8D8C1150 */ lw $t4, %lo(j_text_trigger)($t4) @@ -4860,12 +4712,12 @@ glabel draw_watch_inventory_page /* 0DA650 7F0A7C60 AFAF0014 */ sw $t7, 0x14($sp) /* 0DA654 7F0A7C64 0FC2B0B5 */ jal microcode_constructor_related_to_menus /* 0DA658 7F0A7C68 24E70052 */ addiu $a3, $a3, 0x52 -/* 0DA65C 7F0A7C6C 3C188004 */ lui $t8, %hi(ptrSecondFontTableSmall) # $t8, 0x8004 -/* 0DA660 7F0A7C70 8F18AB00 */ lw $t8, %lo(ptrSecondFontTableSmall)($t8) -/* 0DA664 7F0A7C74 3C108004 */ lui $s0, %hi(ptrFirstFontTableSmall) # $s0, 0x8004 +/* 0DA65C 7F0A7C6C 3C188004 */ lui $t8, %hi(ptrFontBankGothicChars) # $t8, 0x8004 +/* 0DA660 7F0A7C70 8F18AB00 */ lw $t8, %lo(ptrFontBankGothicChars)($t8) +/* 0DA664 7F0A7C74 3C108004 */ lui $s0, %hi(ptrFontBankGothic) # $s0, 0x8004 /* 0DA668 7F0A7C78 3C048004 */ lui $a0, %hi(g_curWatchItemIndex) # $a0, 0x8004 /* 0DA66C 7F0A7C7C AFA20930 */ sw $v0, 0x930($sp) -/* 0DA670 7F0A7C80 8E10AAFC */ lw $s0, %lo(ptrFirstFontTableSmall)($s0) +/* 0DA670 7F0A7C80 8E10AAFC */ lw $s0, %lo(ptrFontBankGothic)($s0) /* 0DA674 7F0A7C84 8C84A608 */ lw $a0, %lo(g_curWatchItemIndex)($a0) /* 0DA678 7F0A7C88 0FC235EA */ jal bondinvGetNameByIndex /* 0DA67C 7F0A7C8C AFB8005C */ sw $t8, 0x5c($sp) @@ -4893,7 +4745,7 @@ glabel draw_watch_inventory_page /* 0DA6D4 7F0A7CE4 27A60064 */ addiu $a2, $sp, 0x64 /* 0DA6D8 7F0A7CE8 8FA7005C */ lw $a3, 0x5c($sp) /* 0DA6DC 7F0A7CEC AFB00010 */ sw $s0, 0x10($sp) -/* 0DA6E0 7F0A7CF0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DA6E0 7F0A7CF0 0FC2B713 */ jal textMeasure /* 0DA6E4 7F0A7CF4 AFA00014 */ sw $zero, 0x14($sp) /* 0DA6E8 7F0A7CF8 3C098004 */ lui $t1, %hi(D_800409C0) # $t1, 0x8004 /* 0DA6EC 7F0A7CFC 8D29A610 */ lw $t1, %lo(D_800409C0)($t1) @@ -4910,7 +4762,7 @@ glabel draw_watch_inventory_page /* 0DA718 7F0A7D28 2402000E */ li $v0, 14 .L7F0A7D2C: /* 0DA71C 7F0A7D2C AFB00010 */ sw $s0, 0x10($sp) -/* 0DA720 7F0A7D30 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DA720 7F0A7D30 0FC2B713 */ jal textMeasure /* 0DA724 7F0A7D34 AFA20014 */ sw $v0, 0x14($sp) /* 0DA728 7F0A7D38 3C038004 */ lui $v1, %hi(j_text_trigger) # $v1, 0x8004 /* 0DA72C 7F0A7D3C 8C631150 */ lw $v1, %lo(j_text_trigger)($v1) @@ -4950,7 +4802,7 @@ glabel draw_watch_inventory_page /* 0DA7A4 7F0A7DB4 AFA00024 */ sw $zero, 0x24($sp) /* 0DA7A8 7F0A7DB8 AFA20028 */ sw $v0, 0x28($sp) /* 0DA7AC 7F0A7DBC AFB80010 */ sw $t8, 0x10($sp) -/* 0DA7B0 7F0A7DC0 0FC2B35F */ jal en_text_write_stuff +/* 0DA7B0 7F0A7DC0 0FC2B35F */ jal textRender /* 0DA7B4 7F0A7DC4 AFA9001C */ sw $t1, 0x1c($sp) /* 0DA7B8 7F0A7DC8 1000001A */ b .L7F0A7E34 /* 0DA7BC 7F0A7DCC AFA20930 */ sw $v0, 0x930($sp) @@ -4979,7 +4831,7 @@ glabel draw_watch_inventory_page /* 0DA80C 7F0A7E1C AFB00014 */ sw $s0, 0x14($sp) /* 0DA810 7F0A7E20 AFA00028 */ sw $zero, 0x28($sp) /* 0DA814 7F0A7E24 AFA2002C */ sw $v0, 0x2c($sp) -/* 0DA818 7F0A7E28 0FC2B66B */ jal jp_text_write_stuff +/* 0DA818 7F0A7E28 0FC2B66B */ jal textRenderGlow /* 0DA81C 7F0A7E2C AFAB0010 */ sw $t3, 0x10($sp) /* 0DA820 7F0A7E30 AFA20930 */ sw $v0, 0x930($sp) .L7F0A7E34: @@ -5008,8 +4860,8 @@ Gfx *unused_draw_watch_inventory_page(Gfx *gdl, Mtx *param_2) { s32 sp5C; s32 sp58; s32 sp54; - s32 ptr_first_font; - s32 ptr_second_font; + s32 pFontFile; + s32 pFontChars; u16 *long_name; s32 temp_2; @@ -5017,8 +4869,8 @@ Gfx *unused_draw_watch_inventory_page(Gfx *gdl, Mtx *param_2) { sp58 = 0; sp54 = 0; - ptr_first_font = ptrFirstFontTableSmall; - ptr_second_font = ptrSecondFontTableSmall; + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; long_name = bondinvGetLongNameByIndex(g_curWatchItemIndex); gdl = draw_background_health_and_armor(gdl, param_2, 0); @@ -5034,7 +4886,7 @@ Gfx *unused_draw_watch_inventory_page(Gfx *gdl, Mtx *param_2) { sub_GAME_7F0A5B80(); gdl = microcode_constructor(gdl); - sub_GAME_7F0AE98C(&sp58, &sp54, long_name, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp58, &sp54, long_name, pFontChars, pFontFile, 0); sp70 = ((s32) (0xAA - sp54) / 2) + 0x4B; temp_2 = sp70; @@ -5047,16 +4899,16 @@ Gfx *unused_draw_watch_inventory_page(Gfx *gdl, Mtx *param_2) { sub_GAME_7F0A8378(); if (D_800409C4 == 0) { - gdl = en_text_write_stuff(gdl, &sp70, &sp6C, long_name, ptr_second_font, ptr_first_font, 0xA0FFA0F0, sp54, 0x64, 0, 0); + gdl = textRender(gdl, &sp70, &sp6C, long_name, pFontChars, pFontFile, 0xA0FFA0F0, sp54, 0x64, 0, 0); } else { - gdl = jp_text_write_stuff(gdl, &sp70, &sp6C, long_name, ptr_second_font, ptr_first_font, -1, 0x7000A0, sp54 + 1, 0x64, 0, 0); + gdl = textRenderGlow(gdl, &sp70, &sp6C, long_name, pFontChars, pFontFile, -1, 0x7000A0, sp54 + 1, 0x64, 0, 0); } } else { - gdl = en_text_write_stuff(gdl, &sp70, &sp6C, long_name, ptr_second_font, ptr_first_font, 0xAA00B0, sp54, 0x64, 0, 0); + gdl = textRender(gdl, &sp70, &sp6C, long_name, pFontChars, pFontFile, 0xAA00B0, sp54, 0x64, 0, 0); } } @@ -5489,10 +5341,10 @@ GLOBAL_ASM( glabel sub_GAME_7F0A9398 /* 0DDEC8 7F0A9398 27BDFF98 */ addiu $sp, $sp, -0x68 /* 0DDECC 7F0A939C AFA70074 */ sw $a3, 0x74($sp) -/* 0DDED0 7F0A93A0 3C028004 */ lui $v0, %hi(ptrFirstFontTableSmall) -/* 0DDED4 7F0A93A4 8C420EAC */ lw $v0, %lo(ptrFirstFontTableSmall)($v0) -/* 0DDED8 7F0A93A8 3C078004 */ lui $a3, %hi(ptrSecondFontTableSmall) -/* 0DDEDC 7F0A93AC 8CE70EB0 */ lw $a3, %lo(ptrSecondFontTableSmall)($a3) +/* 0DDED0 7F0A93A0 3C028004 */ lui $v0, %hi(ptrFontBankGothic) +/* 0DDED4 7F0A93A4 8C420EAC */ lw $v0, %lo(ptrFontBankGothic)($v0) +/* 0DDED8 7F0A93A8 3C078004 */ lui $a3, %hi(ptrFontBankGothicChars) +/* 0DDEDC 7F0A93AC 8CE70EB0 */ lw $a3, %lo(ptrFontBankGothicChars)($a3) /* 0DDEE0 7F0A93B0 AFB00038 */ sw $s0, 0x38($sp) /* 0DDEE4 7F0A93B4 00808025 */ move $s0, $a0 /* 0DDEE8 7F0A93B8 AFBF003C */ sw $ra, 0x3c($sp) @@ -5505,7 +5357,7 @@ glabel sub_GAME_7F0A9398 /* 0DDF04 7F0A93D4 27A40054 */ addiu $a0, $sp, 0x54 /* 0DDF08 7F0A93D8 AFA20010 */ sw $v0, 0x10($sp) /* 0DDF0C 7F0A93DC AFA20050 */ sw $v0, 0x50($sp) -/* 0DDF10 7F0A93E0 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DDF10 7F0A93E0 0FC2BA63 */ jal textMeasure /* 0DDF14 7F0A93E4 AFA7004C */ sw $a3, 0x4c($sp) /* 0DDF18 7F0A93E8 8FAF0084 */ lw $t7, 0x84($sp) /* 0DDF1C 7F0A93EC 8FA2006C */ lw $v0, 0x6c($sp) @@ -5600,7 +5452,7 @@ glabel sub_GAME_7F0A9398 /* 0DE068 7F0A9538 AFAD0014 */ sw $t5, 0x14($sp) /* 0DE06C 7F0A953C AFAE0018 */ sw $t6, 0x18($sp) /* 0DE070 7F0A9540 AFAF001C */ sw $t7, 0x1c($sp) -/* 0DE074 7F0A9544 0FC2B6AF */ jal en_text_write_stuff +/* 0DE074 7F0A9544 0FC2B6AF */ jal textRender /* 0DE078 7F0A9548 AFB80020 */ sw $t8, 0x20($sp) /* 0DE07C 7F0A954C 00408025 */ move $s0, $v0 .L7F0A9550: @@ -5625,7 +5477,7 @@ glabel sub_GAME_7F0A9398 /* 0DE0C8 7F0A9598 AFAC0014 */ sw $t4, 0x14($sp) /* 0DE0CC 7F0A959C AFAD0018 */ sw $t5, 0x18($sp) /* 0DE0D0 7F0A95A0 AFAE001C */ sw $t6, 0x1c($sp) -/* 0DE0D4 7F0A95A4 0FC2B9BB */ jal jp_text_write_stuff +/* 0DE0D4 7F0A95A4 0FC2B9BB */ jal textRenderGlow /* 0DE0D8 7F0A95A8 AFB90024 */ sw $t9, 0x24($sp) /* 0DE0DC 7F0A95AC 00408025 */ move $s0, $v0 .L7F0A95B0: @@ -5787,10 +5639,10 @@ glabel sub_GAME_7F0A97D0 /* 0DE300 7F0A97D0 27BDF7B0 */ addiu $sp, $sp, -0x850 /* 0DE304 7F0A97D4 3C068004 */ lui $a2, %hi(D_800409D8) /* 0DE308 7F0A97D8 8CC609D8 */ lw $a2, %lo(D_800409D8)($a2) -/* 0DE30C 7F0A97DC 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) -/* 0DE310 7F0A97E0 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) -/* 0DE314 7F0A97E4 8DCE0EAC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0DE318 7F0A97E8 8DEF0EB0 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0DE30C 7F0A97DC 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) +/* 0DE310 7F0A97E0 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) +/* 0DE314 7F0A97E4 8DCE0EAC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0DE318 7F0A97E8 8DEF0EB0 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0DE31C 7F0A97EC AFB00034 */ sw $s0, 0x34($sp) /* 0DE320 7F0A97F0 AFBF003C */ sw $ra, 0x3c($sp) /* 0DE324 7F0A97F4 AFB10038 */ sw $s1, 0x38($sp) @@ -5868,7 +5720,7 @@ glabel sub_GAME_7F0A97D0 /* 0DE42C 7F0A98FC 27A60074 */ addiu $a2, $sp, 0x74 /* 0DE430 7F0A9900 8FA70054 */ lw $a3, 0x54($sp) /* 0DE434 7F0A9904 AFA20014 */ sw $v0, 0x14($sp) -/* 0DE438 7F0A9908 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DE438 7F0A9908 0FC2BA63 */ jal textMeasure /* 0DE43C 7F0A990C AFAE0010 */ sw $t6, 0x10($sp) /* 0DE440 7F0A9910 8E220000 */ lw $v0, ($s1) /* 0DE444 7F0A9914 8FA40850 */ lw $a0, 0x850($sp) @@ -5901,7 +5753,7 @@ glabel sub_GAME_7F0A97D0 /* 0DE4A0 7F0A9970 AFA8001C */ sw $t0, 0x1c($sp) /* 0DE4A4 7F0A9974 8D2A2A64 */ lw $t2, 0x2a64($t1) /* 0DE4A8 7F0A9978 AFA20028 */ sw $v0, 0x28($sp) -/* 0DE4AC 7F0A997C 0FC2B6AF */ jal en_text_write_stuff +/* 0DE4AC 7F0A997C 0FC2B6AF */ jal textRender /* 0DE4B0 7F0A9980 AFAA0024 */ sw $t2, 0x24($sp) /* 0DE4B4 7F0A9984 3C038008 */ lui $v1, %hi(g_CurrentPlayer) /* 0DE4B8 7F0A9988 8C63A0B0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -5931,7 +5783,7 @@ glabel sub_GAME_7F0A97D0 /* 0DE510 7F0A99E0 02003025 */ move $a2, $s0 /* 0DE514 7F0A99E4 8FA70054 */ lw $a3, 0x54($sp) /* 0DE518 7F0A99E8 AFA20014 */ sw $v0, 0x14($sp) -/* 0DE51C 7F0A99EC 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0DE51C 7F0A99EC 0FC2BA63 */ jal textMeasure /* 0DE520 7F0A99F0 AFAF0010 */ sw $t7, 0x10($sp) /* 0DE524 7F0A99F4 8E390000 */ lw $t9, ($s1) /* 0DE528 7F0A99F8 241800AA */ li $t8, 170 @@ -5976,7 +5828,7 @@ glabel sub_GAME_7F0A97D0 /* 0DE5B8 7F0A9A88 AFA20028 */ sw $v0, 0x28($sp) /* 0DE5BC 7F0A9A8C AFAD0010 */ sw $t5, 0x10($sp) /* 0DE5C0 7F0A9A90 AFAE0014 */ sw $t6, 0x14($sp) -/* 0DE5C4 7F0A9A94 0FC2B6AF */ jal en_text_write_stuff +/* 0DE5C4 7F0A9A94 0FC2B6AF */ jal textRender /* 0DE5C8 7F0A9A98 AFB8001C */ sw $t8, 0x1c($sp) /* 0DE5CC 7F0A9A9C AFA20850 */ sw $v0, 0x850($sp) /* 0DE5D0 7F0A9AA0 8FBF003C */ lw $ra, 0x3c($sp) @@ -5996,10 +5848,10 @@ glabel sub_GAME_7F0A97D0 /* 0DB500 7F0A8B10 27BDF7B0 */ addiu $sp, $sp, -0x850 /* 0DB504 7F0A8B14 3C068004 */ lui $a2, %hi(D_800409D8) # $a2, 0x8004 /* 0DB508 7F0A8B18 8CC6A628 */ lw $a2, %lo(D_800409D8)($a2) -/* 0DB50C 7F0A8B1C 3C0E8004 */ lui $t6, %hi(ptrFirstFontTableSmall) # $t6, 0x8004 -/* 0DB510 7F0A8B20 3C0F8004 */ lui $t7, %hi(ptrSecondFontTableSmall) # $t7, 0x8004 -/* 0DB514 7F0A8B24 8DCEAAFC */ lw $t6, %lo(ptrFirstFontTableSmall)($t6) -/* 0DB518 7F0A8B28 8DEFAB00 */ lw $t7, %lo(ptrSecondFontTableSmall)($t7) +/* 0DB50C 7F0A8B1C 3C0E8004 */ lui $t6, %hi(ptrFontBankGothic) # $t6, 0x8004 +/* 0DB510 7F0A8B20 3C0F8004 */ lui $t7, %hi(ptrFontBankGothicChars) # $t7, 0x8004 +/* 0DB514 7F0A8B24 8DCEAAFC */ lw $t6, %lo(ptrFontBankGothic)($t6) +/* 0DB518 7F0A8B28 8DEFAB00 */ lw $t7, %lo(ptrFontBankGothicChars)($t7) /* 0DB51C 7F0A8B2C AFB00034 */ sw $s0, 0x34($sp) /* 0DB520 7F0A8B30 AFBF003C */ sw $ra, 0x3c($sp) /* 0DB524 7F0A8B34 AFB10038 */ sw $s1, 0x38($sp) @@ -6077,7 +5929,7 @@ glabel sub_GAME_7F0A97D0 /* 0DB62C 7F0A8C3C 27A60074 */ addiu $a2, $sp, 0x74 /* 0DB630 7F0A8C40 8FA70054 */ lw $a3, 0x54($sp) /* 0DB634 7F0A8C44 AFA20014 */ sw $v0, 0x14($sp) -/* 0DB638 7F0A8C48 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DB638 7F0A8C48 0FC2B713 */ jal textMeasure /* 0DB63C 7F0A8C4C AFAE0010 */ sw $t6, 0x10($sp) /* 0DB640 7F0A8C50 8E220000 */ lw $v0, ($s1) /* 0DB644 7F0A8C54 8FA40850 */ lw $a0, 0x850($sp) @@ -6110,7 +5962,7 @@ glabel sub_GAME_7F0A97D0 /* 0DB6A0 7F0A8CB0 AFA8001C */ sw $t0, 0x1c($sp) /* 0DB6A4 7F0A8CB4 8D2A2A5C */ lw $t2, 0x2a5c($t1) /* 0DB6A8 7F0A8CB8 AFA20028 */ sw $v0, 0x28($sp) -/* 0DB6AC 7F0A8CBC 0FC2B35F */ jal en_text_write_stuff +/* 0DB6AC 7F0A8CBC 0FC2B35F */ jal textRender /* 0DB6B0 7F0A8CC0 AFAA0024 */ sw $t2, 0x24($sp) /* 0DB6B4 7F0A8CC4 3C038007 */ lui $v1, %hi(g_CurrentPlayer) # $v1, 0x8007 /* 0DB6B8 7F0A8CC8 8C638BC0 */ lw $v1, %lo(g_CurrentPlayer)($v1) @@ -6140,7 +5992,7 @@ glabel sub_GAME_7F0A97D0 /* 0DB710 7F0A8D20 02003025 */ move $a2, $s0 /* 0DB714 7F0A8D24 8FA70054 */ lw $a3, 0x54($sp) /* 0DB718 7F0A8D28 AFA20014 */ sw $v0, 0x14($sp) -/* 0DB71C 7F0A8D2C 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DB71C 7F0A8D2C 0FC2B713 */ jal textMeasure /* 0DB720 7F0A8D30 AFAF0010 */ sw $t7, 0x10($sp) /* 0DB724 7F0A8D34 8E390000 */ lw $t9, ($s1) /* 0DB728 7F0A8D38 241800AA */ li $t8, 170 @@ -6185,7 +6037,7 @@ glabel sub_GAME_7F0A97D0 /* 0DB7B8 7F0A8DC8 AFA20028 */ sw $v0, 0x28($sp) /* 0DB7BC 7F0A8DCC AFAD0010 */ sw $t5, 0x10($sp) /* 0DB7C0 7F0A8DD0 AFAE0014 */ sw $t6, 0x14($sp) -/* 0DB7C4 7F0A8DD4 0FC2B35F */ jal en_text_write_stuff +/* 0DB7C4 7F0A8DD4 0FC2B35F */ jal textRender /* 0DB7C8 7F0A8DD8 AFB8001C */ sw $t8, 0x1c($sp) /* 0DB7CC 7F0A8DDC AFA20850 */ sw $v0, 0x850($sp) /* 0DB7D0 7F0A8DE0 8FBF003C */ lw $ra, 0x3c($sp) @@ -7999,29 +7851,29 @@ Gfx *display_text_buttons_dual_control(Gfx *gdl) if (joyGetButtons(PLAYER_1, A_BUTTON)) { - gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, 0x03)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); //weapon + gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_03)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); //weapon } else { - gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, 0x03)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); //weapon + gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_03)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); //weapon } if (joyGetButtons(PLAYER_1, B_BUTTON)) { - gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, 0x02)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); //action + gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_02)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 0); //action } else { - gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, 0x02)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); //action + gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_02)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); //action } if ((g_CurrentPlayer->cur_player_control_type_0 == 4) || (g_CurrentPlayer->cur_player_control_type_0 == 5)) { - textptr_aux = langGet(TEXT(LOPTIONS, 0x00)); //fire + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_00)); //fire } else { - textptr_aux = langGet(TEXT(LOPTIONS, 0x01)); //aim + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_01)); //aim } if (joyGetButtons(PLAYER_1, Z_TRIG)) @@ -8035,40 +7887,40 @@ Gfx *display_text_buttons_dual_control(Gfx *gdl) if ((g_CurrentPlayer->cur_player_control_type_0 == 4) || (g_CurrentPlayer->cur_player_control_type_0 == 6)) { - textptr_aux = langGet(TEXT(LOPTIONS, 0x05)); //move + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_05)); //move } else { - textptr_aux = langGet(TEXT(LOPTIONS, 0x06)); //look + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_06)); //look } gdl = sub_GAME_7F0A9398(gdl, 0x5A, YOFFSET_4, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 0); if (joyGetButtons(1, A_BUTTON)) { - gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, 0x03)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); //weapon + gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_03)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); //weapon } else { - gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, 0x03)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); //weapon + gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_WEAPTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_03)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); //weapon } if (joyGetButtons(1, B_BUTTON)) { - gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, 0x02)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); //action + gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_02)), -1, 1, 0x7000A0, 0, 0, 0x3000B0, 1); //action } else { - gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, 0x02)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); //action + gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_ACTIONTEXT, langGet(TEXT(LOPTIONS, OPTION_STR_02)), 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); //action } if ((g_CurrentPlayer->cur_player_control_type_0 == 4) || (g_CurrentPlayer->cur_player_control_type_0 == 5)) { - textptr_aux = langGet(TEXT(LOPTIONS, 0x01)); //aim + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_01)); //aim } else { - textptr_aux = langGet(TEXT(LOPTIONS, 0x00)); //fire + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_00)); //fire } if (joyGetButtons(1, Z_TRIG)) @@ -8082,11 +7934,11 @@ Gfx *display_text_buttons_dual_control(Gfx *gdl) if ((g_CurrentPlayer->cur_player_control_type_0 == 4) || (g_CurrentPlayer->cur_player_control_type_0 == 6)) { - textptr_aux = langGet(TEXT(LOPTIONS, 0x06)); //look + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_06)); //look } else { - textptr_aux = langGet(TEXT(LOPTIONS, 0x05)); //move + textptr_aux = langGet(TEXT(LOPTIONS, OPTION_STR_05)); //move } gdl = sub_GAME_7F0A9398(gdl, 0xE6, YOFFSET_4, textptr_aux, 0xAA00B0, 0, -1, 0, 0, 0x3000B0, 1); @@ -8214,7 +8066,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFA48 7F0AAF18 46105482 */ mul.s $f18, $f10, $f16 /* 0DFA4C 7F0AAF1C 46123100 */ add.s $f4, $f6, $f18 /* 0DFA50 7F0AAF20 E4440000 */ swc1 $f4, ($v0) -/* 0DFA54 7F0AAF24 0FC29A8B */ jal sub_GAME_7F0A6A2C +/* 0DFA54 7F0AAF24 0FC29A8B */ jal watchWrapAroundPI /* 0DFA58 7F0AAF28 C44C0000 */ lwc1 $f12, ($v0) /* 0DFA5C 7F0AAF2C 3C018004 */ lui $at, %hi(D_80040B24) /* 0DFA60 7F0AAF30 E4200B24 */ swc1 $f0, %lo(D_80040B24)($at) @@ -8414,7 +8266,7 @@ glabel sub_GAME_7F0AADC0 /* 0DFD50 7F0AB220 46105182 */ mul.s $f6, $f10, $f16 /* 0DFD54 7F0AB224 46062480 */ add.s $f18, $f4, $f6 /* 0DFD58 7F0AB228 E4520000 */ swc1 $f18, ($v0) -/* 0DFD5C 7F0AB22C 0FC29A8B */ jal sub_GAME_7F0A6A2C +/* 0DFD5C 7F0AB22C 0FC29A8B */ jal watchWrapAroundPI /* 0DFD60 7F0AB230 C44C0000 */ lwc1 $f12, ($v0) /* 0DFD64 7F0AB234 3C018004 */ lui $at, %hi(D_80040B34) /* 0DFD68 7F0AB238 E4200B34 */ swc1 $f0, %lo(D_80040B34)($at) @@ -8685,7 +8537,7 @@ glabel sub_GAME_7F0AADC0 /* 0E063C 7F0ABACC 460A4402 */ mul.s $f16, $f8, $f10 /* 0E0640 7F0ABAD0 46109100 */ add.s $f4, $f18, $f16 /* 0E0644 7F0ABAD4 E4440000 */ swc1 $f4, ($v0) -/* 0E0648 7F0ABAD8 0FC29D73 */ jal sub_GAME_7F0A6A2C +/* 0E0648 7F0ABAD8 0FC29D73 */ jal watchWrapAroundPI /* 0E064C 7F0ABADC C44C0000 */ lwc1 $f12, ($v0) /* 0E0650 7F0ABAE0 3C018004 */ lui $at, %hi(D_80040B24) # $at, 0x8004 /* 0E0654 7F0ABAE4 E4200B54 */ swc1 $f0, %lo(D_80040B24)($at) @@ -8882,7 +8734,7 @@ glabel sub_GAME_7F0AADC0 /* 0E0938 7F0ABDC8 46083282 */ mul.s $f10, $f6, $f8 /* 0E093C 7F0ABDCC 460A9400 */ add.s $f16, $f18, $f10 /* 0E0940 7F0ABDD0 E4500000 */ swc1 $f16, ($v0) -/* 0E0944 7F0ABDD4 0FC29D73 */ jal sub_GAME_7F0A6A2C +/* 0E0944 7F0ABDD4 0FC29D73 */ jal watchWrapAroundPI /* 0E0948 7F0ABDD8 C44C0000 */ lwc1 $f12, ($v0) /* 0E094C 7F0ABDDC 3C018004 */ lui $at, %hi(D_80040B34) # $at, 0x8004 /* 0E0950 7F0ABDE0 E4200B64 */ swc1 $f0, %lo(D_80040B34)($at) @@ -9153,7 +9005,7 @@ glabel sub_GAME_7F0AADC0 /* 0DCC3C 7F0AA24C 460A4402 */ mul.s $f16, $f8, $f10 /* 0DCC40 7F0AA250 46109100 */ add.s $f4, $f18, $f16 /* 0DCC44 7F0AA254 E4440000 */ swc1 $f4, ($v0) -/* 0DCC48 7F0AA258 0FC29753 */ jal sub_GAME_7F0A6A2C +/* 0DCC48 7F0AA258 0FC29753 */ jal watchWrapAroundPI /* 0DCC4C 7F0AA25C C44C0000 */ lwc1 $f12, ($v0) /* 0DCC50 7F0AA260 3C018004 */ lui $at, %hi(D_80040B24) # $at, 0x8004 /* 0DCC54 7F0AA264 E420A774 */ swc1 $f0, %lo(D_80040B24)($at) @@ -9350,7 +9202,7 @@ glabel sub_GAME_7F0AADC0 /* 0DCF38 7F0AA548 46083282 */ mul.s $f10, $f6, $f8 /* 0DCF3C 7F0AA54C 460A9400 */ add.s $f16, $f18, $f10 /* 0DCF40 7F0AA550 E4500000 */ swc1 $f16, ($v0) -/* 0DCF44 7F0AA554 0FC29753 */ jal sub_GAME_7F0A6A2C +/* 0DCF44 7F0AA554 0FC29753 */ jal watchWrapAroundPI /* 0DCF48 7F0AA558 C44C0000 */ lwc1 $f12, ($v0) /* 0DCF4C 7F0AA55C 3C018004 */ lui $at, %hi(D_80040B34) # $at, 0x8004 /* 0DCF50 7F0AA560 E420A784 */ swc1 $f0, %lo(D_80040B34)($at) @@ -9544,19 +9396,19 @@ Gfx *draw_watch_control_options_page(Gfx *gdl, Mtx *param_2) { s32 sp58; s32 sp54; s32 sp50; - s32 ptr_first_font; - s32 ptr_second_font; + s32 pFontFile; + s32 pFontChars; gdl = draw_background_health_and_armor(gdl, param_2, 0); if (check_watch_page_transistion_running() != 1) { gdl = sub_GAME_7F0AADC0(gdl); - ptr_first_font = ptrFirstFontTableSmall; - ptr_second_font = ptrSecondFontTableSmall; + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; gdl = microcode_constructor(gdl); - textptr = langGet(TEXT(LOPTIONS, 0x32)); //control style + textptr = langGet(TEXT(LOPTIONS, OPTION_STR_32)); //control style sp5C = XOFFSET_1; sp58 = 0x1A; @@ -9570,24 +9422,24 @@ Gfx *draw_watch_control_options_page(Gfx *gdl, Mtx *param_2) { } } - sub_GAME_7F0AE98C(&sp50, &sp54, textptr, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp50, &sp54, textptr, pFontChars, pFontFile, 0); if ((watch_item_is_actively_selected != 0) && (controller_options_index == 0)) { - gdl = jp_text_write_stuff(gdl, &sp5C, &sp58, textptr, ptr_second_font, ptr_first_font, phi_s1, 0x7000A0, sp54 + 1, sp50, 0, 0); + gdl = textRenderGlow(gdl, &sp5C, &sp58, textptr, pFontChars, pFontFile, phi_s1, 0x7000A0, sp54 + 1, sp50, 0, 0); } else { - gdl = en_text_write_stuff(gdl, &sp5C, &sp58, textptr, ptr_second_font, ptr_first_font, phi_s1, sp54, sp50, 0, 0); + gdl = textRender(gdl, &sp5C, &sp58, textptr, pFontChars, pFontFile, phi_s1, sp54, sp50, 0, 0); } gdl = sub_GAME_7F0A97D0(gdl); - textptr = langGet(TEXT(LOPTIONS, 0x33)); //controller; + textptr = langGet(TEXT(LOPTIONS, OPTION_STR_33)); //controller; phi_s1 = 0xFF00B0; if (controllerCheckDualControllerTypesAllowed()) { - textptr = langGet(TEXT(LOPTIONS, 0x34)); //controllers; + textptr = langGet(TEXT(LOPTIONS, OPTION_STR_34)); //controllers; } sp5C = XOFFSET_1; sp58 = 0x2B; @@ -9601,14 +9453,14 @@ Gfx *draw_watch_control_options_page(Gfx *gdl, Mtx *param_2) { } } - sub_GAME_7F0AE98C(&sp50, &sp54, textptr, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp50, &sp54, textptr, pFontChars, pFontFile, 0); if ((watch_item_is_actively_selected != 0) && (controller_options_index == 1)) { - gdl = jp_text_write_stuff(gdl, &sp5C, &sp58, textptr, ptr_second_font, ptr_first_font, phi_s1, 0x7000A0, sp54 + 1, sp50, 0, 0); + gdl = textRenderGlow(gdl, &sp5C, &sp58, textptr, pFontChars, pFontFile, phi_s1, 0x7000A0, sp54 + 1, sp50, 0, 0); } else { - gdl = en_text_write_stuff(gdl, &sp5C, &sp58, textptr, ptr_second_font, ptr_first_font, phi_s1, sp54, sp50, 0, 0); + gdl = textRender(gdl, &sp5C, &sp58, textptr, pFontChars, pFontFile, phi_s1, sp54, sp50, 0, 0); } } @@ -10072,8 +9924,8 @@ Gfx *draw_watch_game_options_page(Gfx *gdl, Mtx *param_2) { s32 sp4C; s32 sp48; - s32 ptr_first_font; - s32 ptr_second_font; + s32 pFontFile; + s32 pFontChars; gdl = draw_background_health_and_armor(gdl, param_2, 0); @@ -10081,11 +9933,11 @@ Gfx *draw_watch_game_options_page(Gfx *gdl, Mtx *param_2) { { gdl = sub_GAME_7F0A91C8(gdl); gdl = sub_GAME_7F0A8FEC(gdl); - ptr_first_font = ptrFirstFontTableSmall; - ptr_second_font = ptrSecondFontTableSmall; + pFontFile = ptrFontBankGothic; + pFontChars = ptrFontBankGothicChars; gdl = microcode_constructor(gdl); - textptr = langGet(TEXT(LOPTIONS, 0x35)); //music + textptr = langGet(TEXT(LOPTIONS, OPTION_STR_35)); //music sp54 = XOFFSET_1; sp50 = YOFFSET_8; @@ -10101,19 +9953,19 @@ Gfx *draw_watch_game_options_page(Gfx *gdl, Mtx *param_2) { } } - sub_GAME_7F0AE98C(&sp48, &sp4C, textptr, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp48, &sp4C, textptr, pFontChars, pFontFile, 0); if ((watch_item_is_actively_selected != 0) && (game_options_index == 0)) { - gdl = jp_text_write_stuff(gdl, &sp54, &sp50, textptr, ptr_second_font, ptr_first_font, sp5C, 0x7000A0, sp4C + 1, sp48, 0, 0); + gdl = textRenderGlow(gdl, &sp54, &sp50, textptr, pFontChars, pFontFile, sp5C, 0x7000A0, sp4C + 1, sp48, 0, 0); } else { - gdl = en_text_write_stuff(gdl, &sp54, &sp50, textptr, ptr_second_font, ptr_first_font, sp5C, sp4C, sp48, 0, 0); + gdl = textRender(gdl, &sp54, &sp50, textptr, pFontChars, pFontFile, sp5C, sp4C, sp48, 0, 0); } sp5C = 0xFF00B0; - textptr = langGet(TEXT(LOPTIONS, 0x36)); //fx + textptr = langGet(TEXT(LOPTIONS, OPTION_STR_36)); //fx sp54 = XOFFSET_1; sp50 = YOFFSET_9; @@ -10128,15 +9980,15 @@ Gfx *draw_watch_game_options_page(Gfx *gdl, Mtx *param_2) { } } - sub_GAME_7F0AE98C(&sp48, &sp4C, textptr, ptr_second_font, ptr_first_font, 0); + textMeasure(&sp48, &sp4C, textptr, pFontChars, pFontFile, 0); if ((watch_item_is_actively_selected != 0) && (game_options_index == 1)) { - gdl = jp_text_write_stuff(gdl, &sp54, &sp50, textptr, ptr_second_font, ptr_first_font, sp5C, 0x7000A0, sp4C + 1, sp48, 0, 0); + gdl = textRenderGlow(gdl, &sp54, &sp50, textptr, pFontChars, pFontFile, sp5C, 0x7000A0, sp4C + 1, sp48, 0, 0); } else { - gdl = en_text_write_stuff(gdl, &sp54, &sp50, textptr, ptr_second_font, ptr_first_font, sp5C, sp4C, sp48, 0, 0); + gdl = textRender(gdl, &sp54, &sp50, textptr, pFontChars, pFontFile, sp5C, sp4C, sp48, 0, 0); } gdl = draw_toggle_options(gdl); @@ -10167,60 +10019,33 @@ int sub_GAME_7F0AC0E8(u8 *arg) { } -#ifndef VERSION_EU u8 *sub_GAME_7F0AC120(u8 *arg) { - u8 cVar1; - u8 *pcVar2; - - cVar1 = *arg; - pcVar2 = arg; - - while (cVar1) { + u8 *ret; - if (cVar1 == 0xA) { - arg += 1; + ret = arg; - if (arg[0]) { - pcVar2 = arg; + while (*arg != 0) + { + if (*arg == 0xa) + { + if (*++arg != 0) + { + ret = arg; } } - - cVar1 = arg[1]; - arg += 1; +#if defined(VERSION_EU) + else + { + arg++; + } +#else + arg++; +#endif } - return pcVar2; + return ret; } -#else -GLOBAL_ASM( -.text -glabel sub_GAME_7F0AC120 -/* 0DDE38 7F0AB448 90820000 */ lbu $v0, ($a0) -/* 0DDE3C 7F0AB44C 00801825 */ move $v1, $a0 -/* 0DDE40 7F0AB450 2405000A */ li $a1, 10 -/* 0DDE44 7F0AB454 1040000D */ beqz $v0, .L7F0AB48C -/* 0DDE48 7F0AB458 00000000 */ nop -.L7F0AB45C: -/* 0DDE4C 7F0AB45C 54A20008 */ bnel $a1, $v0, .L7F0AB480 -/* 0DDE50 7F0AB460 24840001 */ addiu $a0, $a0, 1 -/* 0DDE54 7F0AB464 90820001 */ lbu $v0, 1($a0) -/* 0DDE58 7F0AB468 24840001 */ addiu $a0, $a0, 1 -/* 0DDE5C 7F0AB46C 10400005 */ beqz $v0, .L7F0AB484 -/* 0DDE60 7F0AB470 00000000 */ nop -/* 0DDE64 7F0AB474 10000003 */ b .L7F0AB484 -/* 0DDE68 7F0AB478 00801825 */ move $v1, $a0 -/* 0DDE6C 7F0AB47C 24840001 */ addiu $a0, $a0, 1 -.L7F0AB480: -/* 0DDE70 7F0AB480 90820000 */ lbu $v0, ($a0) -.L7F0AB484: -/* 0DDE74 7F0AB484 1440FFF5 */ bnez $v0, .L7F0AB45C -/* 0DDE78 7F0AB488 00000000 */ nop -.L7F0AB48C: -/* 0DDE7C 7F0AB48C 03E00008 */ jr $ra -/* 0DDE80 7F0AB490 00601025 */ move $v0, $v1 -) -#endif #ifdef NONMATCHING @@ -10352,10 +10177,10 @@ glabel draw_watch_mission_briefing_page /* 0E0D54 7F0AC224 8DA1FFFC */ lw $at, -4($t5) /* 0E0D58 7F0AC228 15B9FFF8 */ bne $t5, $t9, .L7F0AC20C /* 0E0D5C 7F0AC22C AD81FFFC */ sw $at, -4($t4) -/* 0E0D60 7F0AC230 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) -/* 0E0D64 7F0AC234 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) -/* 0E0D68 7F0AC238 8DEF0EAC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0E0D6C 7F0AC23C 8DCE0EB0 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0E0D60 7F0AC230 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) +/* 0E0D64 7F0AC234 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) +/* 0E0D68 7F0AC238 8DEF0EAC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0E0D6C 7F0AC23C 8DCE0EB0 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0E0D70 7F0AC240 3C088005 */ lui $t0, %hi(D_800577C0) /* 0E0D74 7F0AC244 250877C0 */ addiu $t0, %lo(D_800577C0) # addiu $t0, $t0, 0x77c0 /* 0E0D78 7F0AC248 AFA00D54 */ sw $zero, 0xd54($sp) @@ -10395,7 +10220,7 @@ glabel draw_watch_mission_briefing_page /* 0E0DFC 7F0AC2CC 02003025 */ move $a2, $s0 /* 0E0E00 7F0AC2D0 8FA70D48 */ lw $a3, 0xd48($sp) /* 0E0E04 7F0AC2D4 AFA00014 */ sw $zero, 0x14($sp) -/* 0E0E08 7F0AC2D8 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E0E08 7F0AC2D8 0FC2BA63 */ jal textMeasure /* 0E0E0C 7F0AC2DC AFB90010 */ sw $t9, 0x10($sp) /* 0E0E10 7F0AC2E0 8FA20D50 */ lw $v0, 0xd50($sp) /* 0E0E14 7F0AC2E4 240D00AA */ li $t5, 170 @@ -10437,7 +10262,7 @@ glabel draw_watch_mission_briefing_page /* 0E0EA0 7F0AC370 AFA80010 */ sw $t0, 0x10($sp) /* 0E0EA4 7F0AC374 AFAA0014 */ sw $t2, 0x14($sp) /* 0E0EA8 7F0AC378 AFAD001C */ sw $t5, 0x1c($sp) -/* 0E0EAC 7F0AC37C 0FC2B6AF */ jal en_text_write_stuff +/* 0E0EAC 7F0AC37C 0FC2B6AF */ jal textRender /* 0E0EB0 7F0AC380 AFAC0020 */ sw $t4, 0x20($sp) /* 0E0EB4 7F0AC384 3C0F8004 */ lui $t7, %hi(mission_brief_index) /* 0E0EB8 7F0AC388 8DEF09A0 */ lw $t7, %lo(mission_brief_index)($t7) @@ -10653,7 +10478,7 @@ glabel draw_watch_mission_briefing_page /* 0E11CC 7F0AC69C AFA00024 */ sw $zero, 0x24($sp) /* 0E11D0 7F0AC6A0 AFB90010 */ sw $t9, 0x10($sp) /* 0E11D4 7F0AC6A4 AFAA0014 */ sw $t2, 0x14($sp) -/* 0E11D8 7F0AC6A8 0FC2B6AF */ jal en_text_write_stuff +/* 0E11D8 7F0AC6A8 0FC2B6AF */ jal textRender /* 0E11DC 7F0AC6AC AFA8001C */ sw $t0, 0x1c($sp) /* 0E11E0 7F0AC6B0 AFA20DE8 */ sw $v0, 0xde8($sp) /* 0E11E4 7F0AC6B4 0FC2B03A */ jal sub_GAME_7F0AC0E8 @@ -10668,7 +10493,7 @@ glabel draw_watch_mission_briefing_page /* 0E1208 7F0AC6D8 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0E120C 7F0AC6DC 00403025 */ move $a2, $v0 /* 0E1210 7F0AC6E0 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0E1214 7F0AC6E4 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E1214 7F0AC6E4 0FC2BA63 */ jal textMeasure /* 0E1218 7F0AC6E8 AFAF0010 */ sw $t7, 0x10($sp) /* 0E121C 7F0AC6EC 0C001107 */ jal viGetX /* 0E1220 7F0AC6F0 00000000 */ nop @@ -10758,7 +10583,7 @@ glabel draw_watch_mission_briefing_page /* 0E1340 7F0AC810 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0E1344 7F0AC814 02203025 */ move $a2, $s1 /* 0E1348 7F0AC818 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0E134C 7F0AC81C 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E134C 7F0AC81C 0FC2BA63 */ jal textMeasure /* 0E1350 7F0AC820 AFA90010 */ sw $t1, 0x10($sp) /* 0E1354 7F0AC824 3C028005 */ lui $v0, %hi(j_text_trigger) /* 0E1358 7F0AC828 8C4284D0 */ lw $v0, %lo(j_text_trigger)($v0) @@ -10797,7 +10622,7 @@ glabel draw_watch_mission_briefing_page /* 0E13D0 7F0AC8A0 AFA00024 */ sw $zero, 0x24($sp) /* 0E13D4 7F0AC8A4 AFAF0010 */ sw $t7, 0x10($sp) /* 0E13D8 7F0AC8A8 AFAE0014 */ sw $t6, 0x14($sp) -/* 0E13DC 7F0AC8AC 0FC2B6AF */ jal en_text_write_stuff +/* 0E13DC 7F0AC8AC 0FC2B6AF */ jal textRender /* 0E13E0 7F0AC8B0 AFA90018 */ sw $t1, 0x18($sp) /* 0E13E4 7F0AC8B4 8FB90074 */ lw $t9, 0x74($sp) /* 0E13E8 7F0AC8B8 AFA20DE8 */ sw $v0, 0xde8($sp) @@ -10824,7 +10649,7 @@ glabel draw_watch_mission_briefing_page /* 0E142C 7F0AC8FC 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0E1430 7F0AC900 27A60170 */ addiu $a2, $sp, 0x170 /* 0E1434 7F0AC904 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0E1438 7F0AC908 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E1438 7F0AC908 0FC2BA63 */ jal textMeasure /* 0E143C 7F0AC90C AFAA0010 */ sw $t2, 0x10($sp) /* 0E1440 7F0AC910 8FAC0D48 */ lw $t4, 0xd48($sp) /* 0E1444 7F0AC914 8FAF0D4C */ lw $t7, 0xd4c($sp) @@ -10843,7 +10668,7 @@ glabel draw_watch_mission_briefing_page /* 0E1478 7F0AC948 27A70170 */ addiu $a3, $sp, 0x170 /* 0E147C 7F0AC94C AFA00024 */ sw $zero, 0x24($sp) /* 0E1480 7F0AC950 AFAC0010 */ sw $t4, 0x10($sp) -/* 0E1484 7F0AC954 0FC2B6AF */ jal en_text_write_stuff +/* 0E1484 7F0AC954 0FC2B6AF */ jal textRender /* 0E1488 7F0AC958 AFAF0014 */ sw $t7, 0x14($sp) /* 0E148C 7F0AC95C 8FB90D60 */ lw $t9, 0xd60($sp) /* 0E1490 7F0AC960 8FAA0D4C */ lw $t2, 0xd4c($sp) @@ -10858,7 +10683,7 @@ glabel draw_watch_mission_briefing_page /* 0E14B4 7F0AC984 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0E14B8 7F0AC988 27A60190 */ addiu $a2, $sp, 0x190 /* 0E14BC 7F0AC98C 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0E14C0 7F0AC990 0FC2BA63 */ jal sub_GAME_7F0AE98C +/* 0E14C0 7F0AC990 0FC2BA63 */ jal textMeasure /* 0E14C4 7F0AC994 AFAA0010 */ sw $t2, 0x10($sp) /* 0E14C8 7F0AC998 0C001107 */ jal viGetX /* 0E14CC 7F0AC99C 00000000 */ nop @@ -10880,7 +10705,7 @@ glabel draw_watch_mission_briefing_page /* 0E150C 7F0AC9DC AFA00024 */ sw $zero, 0x24($sp) /* 0E1510 7F0AC9E0 AFAC0010 */ sw $t4, 0x10($sp) /* 0E1514 7F0AC9E4 AFAF0014 */ sw $t7, 0x14($sp) -/* 0E1518 7F0AC9E8 0FC2B6AF */ jal en_text_write_stuff +/* 0E1518 7F0AC9E8 0FC2B6AF */ jal textRender /* 0E151C 7F0AC9EC AFA9001C */ sw $t1, 0x1c($sp) /* 0E1520 7F0AC9F0 AFA20DE8 */ sw $v0, 0xde8($sp) .L7F0AC9F4: @@ -10968,10 +10793,10 @@ glabel draw_watch_mission_briefing_page /* 0DDF40 7F0AB550 8DA1FFFC */ lw $at, -4($t5) /* 0DDF44 7F0AB554 15B9FFF8 */ bne $t5, $t9, .L7F0AB538 /* 0DDF48 7F0AB558 AD81FFFC */ sw $at, -4($t4) -/* 0DDF4C 7F0AB55C 3C0F8004 */ lui $t7, %hi(ptrFirstFontTableSmall) # $t7, 0x8004 -/* 0DDF50 7F0AB560 3C0E8004 */ lui $t6, %hi(ptrSecondFontTableSmall) # $t6, 0x8004 -/* 0DDF54 7F0AB564 8DEFAAFC */ lw $t7, %lo(ptrFirstFontTableSmall)($t7) -/* 0DDF58 7F0AB568 8DCEAB00 */ lw $t6, %lo(ptrSecondFontTableSmall)($t6) +/* 0DDF4C 7F0AB55C 3C0F8004 */ lui $t7, %hi(ptrFontBankGothic) # $t7, 0x8004 +/* 0DDF50 7F0AB560 3C0E8004 */ lui $t6, %hi(ptrFontBankGothicChars) # $t6, 0x8004 +/* 0DDF54 7F0AB564 8DEFAAFC */ lw $t7, %lo(ptrFontBankGothic)($t7) +/* 0DDF58 7F0AB568 8DCEAB00 */ lw $t6, %lo(ptrFontBankGothicChars)($t6) /* 0DDF5C 7F0AB56C AFA00D54 */ sw $zero, 0xd54($sp) /* 0DDF60 7F0AB570 AFA00D50 */ sw $zero, 0xd50($sp) /* 0DDF64 7F0AB574 3404AC28 */ li $a0, 44072 @@ -11001,7 +10826,7 @@ glabel draw_watch_mission_briefing_page /* 0DDFC4 7F0AB5D4 02003025 */ move $a2, $s0 /* 0DDFC8 7F0AB5D8 8FA70D48 */ lw $a3, 0xd48($sp) /* 0DDFCC 7F0AB5DC AFA00014 */ sw $zero, 0x14($sp) -/* 0DDFD0 7F0AB5E0 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DDFD0 7F0AB5E0 0FC2B713 */ jal textMeasure /* 0DDFD4 7F0AB5E4 AFAA0010 */ sw $t2, 0x10($sp) /* 0DDFD8 7F0AB5E8 8FA20D50 */ lw $v0, 0xd50($sp) /* 0DDFDC 7F0AB5EC 240800AA */ li $t0, 170 @@ -11043,7 +10868,7 @@ glabel draw_watch_mission_briefing_page /* 0DE068 7F0AB678 AFAF0010 */ sw $t7, 0x10($sp) /* 0DE06C 7F0AB67C AFAE0014 */ sw $t6, 0x14($sp) /* 0DE070 7F0AB680 AFA8001C */ sw $t0, 0x1c($sp) -/* 0DE074 7F0AB684 0FC2B35F */ jal en_text_write_stuff +/* 0DE074 7F0AB684 0FC2B35F */ jal textRender /* 0DE078 7F0AB688 AFA90020 */ sw $t1, 0x20($sp) /* 0DE07C 7F0AB68C 3C0B8004 */ lui $t3, %hi(mission_brief_index) # $t3, 0x8004 /* 0DE080 7F0AB690 8D6BA5F0 */ lw $t3, %lo(mission_brief_index)($t3) @@ -11241,7 +11066,7 @@ glabel draw_watch_mission_briefing_page /* 0DE34C 7F0AB95C AFA00024 */ sw $zero, 0x24($sp) /* 0DE350 7F0AB960 AFAB0010 */ sw $t3, 0x10($sp) /* 0DE354 7F0AB964 AFB80014 */ sw $t8, 0x14($sp) -/* 0DE358 7F0AB968 0FC2B35F */ jal en_text_write_stuff +/* 0DE358 7F0AB968 0FC2B35F */ jal textRender /* 0DE35C 7F0AB96C AFAD001C */ sw $t5, 0x1c($sp) /* 0DE360 7F0AB970 AFA20DE8 */ sw $v0, 0xde8($sp) /* 0DE364 7F0AB974 0FC2AD04 */ jal sub_GAME_7F0AC0E8 @@ -11256,7 +11081,7 @@ glabel draw_watch_mission_briefing_page /* 0DE388 7F0AB998 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0DE38C 7F0AB99C 00403025 */ move $a2, $v0 /* 0DE390 7F0AB9A0 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0DE394 7F0AB9A4 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DE394 7F0AB9A4 0FC2B713 */ jal textMeasure /* 0DE398 7F0AB9A8 AFAF0010 */ sw $t7, 0x10($sp) /* 0DE39C 7F0AB9AC 0C000F9B */ jal viGetX /* 0DE3A0 7F0AB9B0 00000000 */ nop @@ -11346,7 +11171,7 @@ glabel draw_watch_mission_briefing_page /* 0DE4C0 7F0ABAD0 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0DE4C4 7F0ABAD4 02203025 */ move $a2, $s1 /* 0DE4C8 7F0ABAD8 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0DE4CC 7F0ABADC 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DE4CC 7F0ABADC 0FC2B713 */ jal textMeasure /* 0DE4D0 7F0ABAE0 AFA80010 */ sw $t0, 0x10($sp) /* 0DE4D4 7F0ABAE4 3C028004 */ lui $v0, %hi(j_text_trigger) # $v0, 0x8004 /* 0DE4D8 7F0ABAE8 8C421150 */ lw $v0, %lo(j_text_trigger)($v0) @@ -11385,7 +11210,7 @@ glabel draw_watch_mission_briefing_page /* 0DE550 7F0ABB60 AFA00024 */ sw $zero, 0x24($sp) /* 0DE554 7F0ABB64 AFAF0010 */ sw $t7, 0x10($sp) /* 0DE558 7F0ABB68 AFAE0014 */ sw $t6, 0x14($sp) -/* 0DE55C 7F0ABB6C 0FC2B35F */ jal en_text_write_stuff +/* 0DE55C 7F0ABB6C 0FC2B35F */ jal textRender /* 0DE560 7F0ABB70 AFA80018 */ sw $t0, 0x18($sp) /* 0DE564 7F0ABB74 8FAB0074 */ lw $t3, 0x74($sp) /* 0DE568 7F0ABB78 AFA20DE8 */ sw $v0, 0xde8($sp) @@ -11412,7 +11237,7 @@ glabel draw_watch_mission_briefing_page /* 0DE5AC 7F0ABBBC 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0DE5B0 7F0ABBC0 27A60170 */ addiu $a2, $sp, 0x170 /* 0DE5B4 7F0ABBC4 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0DE5B8 7F0ABBC8 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DE5B8 7F0ABBC8 0FC2B713 */ jal textMeasure /* 0DE5BC 7F0ABBCC AFB80010 */ sw $t8, 0x10($sp) /* 0DE5C0 7F0ABBD0 8FAC0D48 */ lw $t4, 0xd48($sp) /* 0DE5C4 7F0ABBD4 8FAF0D4C */ lw $t7, 0xd4c($sp) @@ -11431,7 +11256,7 @@ glabel draw_watch_mission_briefing_page /* 0DE5F8 7F0ABC08 27A70170 */ addiu $a3, $sp, 0x170 /* 0DE5FC 7F0ABC0C AFA00024 */ sw $zero, 0x24($sp) /* 0DE600 7F0ABC10 AFAC0010 */ sw $t4, 0x10($sp) -/* 0DE604 7F0ABC14 0FC2B35F */ jal en_text_write_stuff +/* 0DE604 7F0ABC14 0FC2B35F */ jal textRender /* 0DE608 7F0ABC18 AFAF0014 */ sw $t7, 0x14($sp) /* 0DE60C 7F0ABC1C 8FAB0D60 */ lw $t3, 0xd60($sp) /* 0DE610 7F0ABC20 8FB80D4C */ lw $t8, 0xd4c($sp) @@ -11446,7 +11271,7 @@ glabel draw_watch_mission_briefing_page /* 0DE634 7F0ABC44 27A50D50 */ addiu $a1, $sp, 0xd50 /* 0DE638 7F0ABC48 27A60190 */ addiu $a2, $sp, 0x190 /* 0DE63C 7F0ABC4C 8FA70D48 */ lw $a3, 0xd48($sp) -/* 0DE640 7F0ABC50 0FC2B713 */ jal sub_GAME_7F0AE98C +/* 0DE640 7F0ABC50 0FC2B713 */ jal textMeasure /* 0DE644 7F0ABC54 AFB80010 */ sw $t8, 0x10($sp) /* 0DE648 7F0ABC58 0C000F9B */ jal viGetX /* 0DE64C 7F0ABC5C 00000000 */ nop @@ -11468,7 +11293,7 @@ glabel draw_watch_mission_briefing_page /* 0DE68C 7F0ABC9C AFA00024 */ sw $zero, 0x24($sp) /* 0DE690 7F0ABCA0 AFAC0010 */ sw $t4, 0x10($sp) /* 0DE694 7F0ABCA4 AFAF0014 */ sw $t7, 0x14($sp) -/* 0DE698 7F0ABCA8 0FC2B35F */ jal en_text_write_stuff +/* 0DE698 7F0ABCA8 0FC2B35F */ jal textRender /* 0DE69C 7F0ABCAC AFA8001C */ sw $t0, 0x1c($sp) /* 0DE6A0 7F0ABCB0 AFA20DE8 */ sw $v0, 0xde8($sp) .L7F0ABCB4: diff --git a/src/game/watch.h b/src/game/watch.h index a242d4b1..818818cf 100644 --- a/src/game/watch.h +++ b/src/game/watch.h @@ -66,6 +66,12 @@ // default: 25 #define WATCH_SCREEN_SELECT_SPACER_WIDTH (s32)(WATCH_SCREEN_SELECT_RECTANGLE_WIDTH / (WATCH_NUMBER_SCREENS - 1)) +/** + * Horizontal spacing between watch menu screen select rectangles. + * Default = 125. +*/ +#define WATCH_SCREEN_SELECT_RECTANGLE_HSTEP (WATCH_SCREEN_SELECT_RECTANGLE_WIDTH + WATCH_SCREEN_SELECT_SPACER_WIDTH) + typedef enum WATCH_INDEX { WATCH_INDEX_MISSION_STATUS = 0, WATCH_INDEX_INVENTORY, @@ -113,7 +119,7 @@ void reset_game_options_index(); void zero_D_800409A4(); -f32 sub_GAME_7F0A6A2C(f32 arg0); +f32 watchWrapAroundPI(f32 arg0); f32 sub_GAME_7F0A95C4(f32 param_1, f32 param_2, f32 param_3); @@ -135,7 +141,11 @@ u16 get_mTrack2Vol(void); void set_mTrack2Vol(u16 param_1); void sub_GAME_7F0A91A0(u16 arg0); void cur_player_set_control_type(int type); -void init_watch_at_start_of_stage(int a); + +// Do not declare a public prototype for this method. lvlStageLoad is expecting +// this to be defined with no arguments, but the actual method is defined with +// one argument. +//void init_watch_at_start_of_stage(int a); Gfx *sub_GAME_7F0ACA28(Gfx *gdl, Mtx *arg1, s32 watch_transitioning); void sub_GAME_7F0A69A8(void); diff --git a/src/game/zlib.c b/src/game/zlib.c index fb8e35ed..c9fc4394 100644 --- a/src/game/zlib.c +++ b/src/game/zlib.c @@ -3,6 +3,9 @@ #include "include/string.h" #include "include/bstring.h" +/* this file comes from gzip (1.2.4, 1993-08-20 release), but + * inflate.c placed in public domain by Mark Adler */ + #define GETBYTE() (rz_inbuf[rz_inptr++]) #define NEXTBYTE() (u8)GETBYTE() #define NEEDBITS(n) {while(k<(n)){b|=((u32)NEXTBYTE())<e) > 16) @@ -308,20 +302,22 @@ s32 zlib_inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) e -= 16; NEEDBITS(e) - } while ((e = (t = t->v.t + ((u32)b & maskbits[e]))->e) > 16); + } while ((e = (t = t->v.t + ((u32)b & rz_mask_bits[e]))->e) > 16); } DUMPBITS(t->b) if (e == 16) /* then it's a literal */ { - rz_outbuf[w++] = (u8)t->v.n; - - if ((&outbuf[w] >= &rz_inbuf[rz_inptr]) && (u32)(&outbuf[w] - &rz_inbuf[rz_inptr]) < WSIZE) + if ((u32)(s32)&rz_outbuf[w] >= (u32)(s32)&rz_inbuf[rz_inptr]) { - while(1) - ; + if ((u32)((s32)&rz_outbuf[w] - (s32)&rz_inbuf[rz_inptr]) < WSIZE) + { + while(1){} + } } + + rz_outbuf[w++] = (u8)t->v.n; } else /* it's an EOB or a length */ { @@ -331,10 +327,10 @@ s32 zlib_inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) break; } - /* get length of block to copy */ NEEDBITS(e) - n = t->v.n + ((u32)b & maskbits[e]); - DUMPBITS(e); + /* get length of block to copy */ + n = t->v.n + ((u32)b & rz_mask_bits[e]); + DUMPBITS(e) /* decode distance of block to copy */ NEEDBITS((u32)bd) @@ -347,30 +343,31 @@ s32 zlib_inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) e -= 16; NEEDBITS(e) - } while ((e = (t = t->v.t + ((u32)b & maskbits[e]))->e) > 16); + } while ((e = (t = t->v.t + ((u32)b & rz_mask_bits[e]))->e) > 16); } DUMPBITS(t->b) NEEDBITS(e) - d = w - t->v.n - ((u32)b & maskbits[e]); + d = w - t->v.n - ((u32)b & rz_mask_bits[e]); DUMPBITS(e) - if ((&outbuf[w] >= &rz_inbuf[rz_inptr]) && (u32)(&outbuf[w] - &rz_inbuf[rz_inptr]) < WSIZE) - { - while(1) - ; - } - /* do the copy */ do { e = n; n = 0; - //n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); - + if (w - d >= e) /* (this test assumes unsigned comparison) */ { - memcpy(rz_outbuf + w, rz_outbuf + d, e); + if ((u32)(s32)&rz_outbuf[w+e-1] >= (u32)(s32)&rz_inbuf[rz_inptr]) + { + if ((u32)((s32)&rz_outbuf[w+e-1] - (s32)&rz_inbuf[rz_inptr]) < WSIZE) + { + while(1){} + } + } + + memcpy(&rz_outbuf[w], &rz_outbuf[d], e); w += e; d += e; } @@ -378,15 +375,17 @@ s32 zlib_inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) { do { + if ((u32)(s32)&rz_outbuf[w] >= (u32)(s32)&rz_inbuf[rz_inptr]) + { + if ((u32)((s32)&rz_outbuf[w] - (s32)&rz_inbuf[rz_inptr]) < WSIZE) + { + while(1){} + } + } + rz_outbuf[w++] = rz_outbuf[d++]; } while (--e); } - - if ((&outbuf[w] >= &rz_inbuf[rz_inptr]) && (u32)(&outbuf[w] - &rz_inbuf[rz_inptr]) < WSIZE) - { - while(1) - ; - } } while (n); } } @@ -399,349 +398,15 @@ s32 zlib_inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) /* done */ return 0; } -#else -GLOBAL_ASM( -.text -glabel zlib_inflate_codes -/* 103A20 7F0CEEF0 27BDFF90 */ addiu $sp, $sp, -0x70 -/* 103A24 7F0CEEF4 3C098005 */ lui $t1, %hi(rz_mask_bits) -/* 103A28 7F0CEEF8 2529E9B0 */ addiu $t1, %lo(rz_mask_bits) # addiu $t1, $t1, -0x1650 -/* 103A2C 7F0CEEFC AFBE0038 */ sw $fp, 0x38($sp) -/* 103A30 7F0CEF00 AFB70034 */ sw $s7, 0x34($sp) -/* 103A34 7F0CEF04 AFB5002C */ sw $s5, 0x2c($sp) -/* 103A38 7F0CEF08 AFB40028 */ sw $s4, 0x28($sp) -/* 103A3C 7F0CEF0C AFB30024 */ sw $s3, 0x24($sp) -/* 103A40 7F0CEF10 AFB1001C */ sw $s1, 0x1c($sp) -/* 103A44 7F0CEF14 00067840 */ sll $t7, $a2, 1 -/* 103A48 7F0CEF18 0007C840 */ sll $t9, $a3, 1 -/* 103A4C 7F0CEF1C AFBF003C */ sw $ra, 0x3c($sp) -/* 103A50 7F0CEF20 AFA7007C */ sw $a3, 0x7c($sp) -/* 103A54 7F0CEF24 3C148009 */ lui $s4, %hi(rz_bb) -/* 103A58 7F0CEF28 3C118009 */ lui $s1, %hi(rz_bk) -/* 103A5C 7F0CEF2C 3C158009 */ lui $s5, %hi(rz_wp) -/* 103A60 7F0CEF30 012F6021 */ addu $t4, $t1, $t7 -/* 103A64 7F0CEF34 01396821 */ addu $t5, $t1, $t9 -/* 103A68 7F0CEF38 3C138009 */ lui $s3, %hi(rz_inptr) -/* 103A6C 7F0CEF3C 3C178009 */ lui $s7, %hi(rz_outbuf) -/* 103A70 7F0CEF40 3C1E8009 */ lui $fp, %hi(rz_inbuf) -/* 103A74 7F0CEF44 AFB60030 */ sw $s6, 0x30($sp) -/* 103A78 7F0CEF48 AFB20020 */ sw $s2, 0x20($sp) -/* 103A7C 7F0CEF4C AFB00018 */ sw $s0, 0x18($sp) -/* 103A80 7F0CEF50 AFA40070 */ sw $a0, 0x70($sp) -/* 103A84 7F0CEF54 AFA50074 */ sw $a1, 0x74($sp) -/* 103A88 7F0CEF58 AFA60078 */ sw $a2, 0x78($sp) -/* 103A8C 7F0CEF5C 8E94D364 */ lw $s4, %lo(rz_bb)($s4) -/* 103A90 7F0CEF60 8E31D368 */ lw $s1, %lo(rz_bk)($s1) -/* 103A94 7F0CEF64 8EB5D35C */ lw $s5, %lo(rz_wp)($s5) -/* 103A98 7F0CEF68 958A0000 */ lhu $t2, ($t4) -/* 103A9C 7F0CEF6C 95AB0000 */ lhu $t3, ($t5) -/* 103AA0 7F0CEF70 27DED350 */ addiu $fp, %lo(rz_inbuf) # addiu $fp, $fp, -0x2cb0 -/* 103AA4 7F0CEF74 26F7D354 */ addiu $s7, %lo(rz_outbuf) # addiu $s7, $s7, -0x2cac -/* 103AA8 7F0CEF78 2673D358 */ addiu $s3, %lo(rz_inptr) # addiu $s3, $s3, -0x2ca8 -/* 103AAC 7F0CEF7C 34078000 */ li $a3, 32768 -/* 103AB0 7F0CEF80 00C0F825 */ move $ra, $a2 -.L7F0CEF84: -/* 103AB4 7F0CEF84 023F082B */ sltu $at, $s1, $ra -.L7F0CEF88: -/* 103AB8 7F0CEF88 5020000D */ beql $at, $zero, .L7F0CEFC0 -/* 103ABC 7F0CEF8C 8FB90070 */ lw $t9, 0x70($sp) -/* 103AC0 7F0CEF90 8FC30000 */ lw $v1, ($fp) -.L7F0CEF94: -/* 103AC4 7F0CEF94 8E620000 */ lw $v0, ($s3) -/* 103AC8 7F0CEF98 00627821 */ addu $t7, $v1, $v0 -/* 103ACC 7F0CEF9C 91F80000 */ lbu $t8, ($t7) -/* 103AD0 7F0CEFA0 244E0001 */ addiu $t6, $v0, 1 -/* 103AD4 7F0CEFA4 AE6E0000 */ sw $t6, ($s3) -/* 103AD8 7F0CEFA8 0238C804 */ sllv $t9, $t8, $s1 -/* 103ADC 7F0CEFAC 26310008 */ addiu $s1, $s1, 8 -/* 103AE0 7F0CEFB0 023F082B */ sltu $at, $s1, $ra -/* 103AE4 7F0CEFB4 1420FFF7 */ bnez $at, .L7F0CEF94 -/* 103AE8 7F0CEFB8 0299A025 */ or $s4, $s4, $t9 -/* 103AEC 7F0CEFBC 8FB90070 */ lw $t9, 0x70($sp) -.L7F0CEFC0: -/* 103AF0 7F0CEFC0 028A7824 */ and $t7, $s4, $t2 -/* 103AF4 7F0CEFC4 000FC0C0 */ sll $t8, $t7, 3 -/* 103AF8 7F0CEFC8 03193021 */ addu $a2, $t8, $t9 -/* 103AFC 7F0CEFCC 90D20000 */ lbu $s2, ($a2) -/* 103B00 7F0CEFD0 2E410011 */ sltiu $at, $s2, 0x11 -/* 103B04 7F0CEFD4 5420001E */ bnezl $at, .L7F0CF050 -/* 103B08 7F0CEFD8 90C20001 */ lbu $v0, 1($a2) -/* 103B0C 7F0CEFDC 90C20001 */ lbu $v0, 1($a2) -.L7F0CEFE0: -/* 103B10 7F0CEFE0 2652FFF0 */ addiu $s2, $s2, -0x10 -/* 103B14 7F0CEFE4 02228823 */ subu $s1, $s1, $v0 -/* 103B18 7F0CEFE8 0232082B */ sltu $at, $s1, $s2 -/* 103B1C 7F0CEFEC 1020000C */ beqz $at, .L7F0CF020 -/* 103B20 7F0CEFF0 0054A006 */ srlv $s4, $s4, $v0 -/* 103B24 7F0CEFF4 8FC30000 */ lw $v1, ($fp) -.L7F0CEFF8: -/* 103B28 7F0CEFF8 8E620000 */ lw $v0, ($s3) -/* 103B2C 7F0CEFFC 00627021 */ addu $t6, $v1, $v0 -/* 103B30 7F0CF000 91CF0000 */ lbu $t7, ($t6) -/* 103B34 7F0CF004 24590001 */ addiu $t9, $v0, 1 -/* 103B38 7F0CF008 AE790000 */ sw $t9, ($s3) -/* 103B3C 7F0CF00C 022FC004 */ sllv $t8, $t7, $s1 -/* 103B40 7F0CF010 26310008 */ addiu $s1, $s1, 8 -/* 103B44 7F0CF014 0232082B */ sltu $at, $s1, $s2 -/* 103B48 7F0CF018 1420FFF7 */ bnez $at, .L7F0CEFF8 -/* 103B4C 7F0CF01C 0298A025 */ or $s4, $s4, $t8 -.L7F0CF020: -/* 103B50 7F0CF020 00127040 */ sll $t6, $s2, 1 -/* 103B54 7F0CF024 012E7821 */ addu $t7, $t1, $t6 -/* 103B58 7F0CF028 95F80000 */ lhu $t8, ($t7) -/* 103B5C 7F0CF02C 8CCF0004 */ lw $t7, 4($a2) -/* 103B60 7F0CF030 0314C824 */ and $t9, $t8, $s4 -/* 103B64 7F0CF034 001970C0 */ sll $t6, $t9, 3 -/* 103B68 7F0CF038 01CF3021 */ addu $a2, $t6, $t7 -/* 103B6C 7F0CF03C 90D20000 */ lbu $s2, ($a2) -/* 103B70 7F0CF040 2E410011 */ sltiu $at, $s2, 0x11 -/* 103B74 7F0CF044 5020FFE6 */ beql $at, $zero, .L7F0CEFE0 -/* 103B78 7F0CF048 90C20001 */ lbu $v0, 1($a2) -/* 103B7C 7F0CF04C 90C20001 */ lbu $v0, 1($a2) -.L7F0CF050: -/* 103B80 7F0CF050 24010010 */ li $at, 16 -/* 103B84 7F0CF054 0054A006 */ srlv $s4, $s4, $v0 -/* 103B88 7F0CF058 16410013 */ bne $s2, $at, .L7F0CF0A8 -/* 103B8C 7F0CF05C 02228823 */ subu $s1, $s1, $v0 -/* 103B90 7F0CF060 8EF80000 */ lw $t8, ($s7) -/* 103B94 7F0CF064 8FD90000 */ lw $t9, ($fp) -/* 103B98 7F0CF068 8E6E0000 */ lw $t6, ($s3) -/* 103B9C 7F0CF06C 03152821 */ addu $a1, $t8, $s5 -/* 103BA0 7F0CF070 00A01025 */ move $v0, $a1 -/* 103BA4 7F0CF074 032E2021 */ addu $a0, $t9, $t6 -/* 103BA8 7F0CF078 00A4082B */ sltu $at, $a1, $a0 -/* 103BAC 7F0CF07C 14200006 */ bnez $at, .L7F0CF098 -/* 103rz_bb0 7F0CF080 00447823 */ subu $t7, $v0, $a0 -/* 103rz_bb4 7F0CF084 01E7082B */ sltu $at, $t7, $a3 -/* 103rz_bb8 7F0CF088 50200004 */ beql $at, $zero, .L7F0CF09C -/* 103rz_bbC 7F0CF08C 94D80004 */ lhu $t8, 4($a2) -.L7F0CF090: -/* 103BC0 7F0CF090 1000FFFF */ b .L7F0CF090 -/* 103BC4 7F0CF094 00000000 */ nop -.L7F0CF098: -/* 103BC8 7F0CF098 94D80004 */ lhu $t8, 4($a2) -.L7F0CF09C: -/* 103BCC 7F0CF09C 26B50001 */ addiu $s5, $s5, 1 -/* 103BD0 7F0CF0A0 1000FFB8 */ b .L7F0CEF84 -/* 103BD4 7F0CF0A4 A0B80000 */ sb $t8, ($a1) -.L7F0CF0A8: -/* 103BD8 7F0CF0A8 2401000F */ li $at, 15 -/* 103BDC 7F0CF0AC 124100A4 */ beq $s2, $at, .L7F0CF340 -/* 103BE0 7F0CF0B0 0232082B */ sltu $at, $s1, $s2 -/* 103BE4 7F0CF0B4 5020000D */ beql $at, $zero, .L7F0CF0EC -/* 103BE8 7F0CF0B8 0012C840 */ sll $t9, $s2, 1 -/* 103BEC 7F0CF0BC 8FC30000 */ lw $v1, ($fp) -.L7F0CF0C0: -/* 103BF0 7F0CF0C0 8E620000 */ lw $v0, ($s3) -/* 103BF4 7F0CF0C4 0062C821 */ addu $t9, $v1, $v0 -/* 103BF8 7F0CF0C8 932E0000 */ lbu $t6, ($t9) -/* 103BFC 7F0CF0CC 24580001 */ addiu $t8, $v0, 1 -/* 103C00 7F0CF0D0 AE780000 */ sw $t8, ($s3) -/* 103C04 7F0CF0D4 022E7804 */ sllv $t7, $t6, $s1 -/* 103C08 7F0CF0D8 26310008 */ addiu $s1, $s1, 8 -/* 103C0C 7F0CF0DC 0232082B */ sltu $at, $s1, $s2 -/* 103C10 7F0CF0E0 1420FFF7 */ bnez $at, .L7F0CF0C0 -/* 103C14 7F0CF0E4 028FA025 */ or $s4, $s4, $t7 -/* 103C18 7F0CF0E8 0012C840 */ sll $t9, $s2, 1 -.L7F0CF0EC: -/* 103C1C 7F0CF0EC 01397021 */ addu $t6, $t1, $t9 -/* 103C20 7F0CF0F0 95CF0000 */ lhu $t7, ($t6) -/* 103C24 7F0CF0F4 8FAE007C */ lw $t6, 0x7c($sp) -/* 103C28 7F0CF0F8 94D90004 */ lhu $t9, 4($a2) -/* 103C2C 7F0CF0FC 02328823 */ subu $s1, $s1, $s2 -/* 103C30 7F0CF100 01F4C024 */ and $t8, $t7, $s4 -/* 103C34 7F0CF104 022E082B */ sltu $at, $s1, $t6 -/* 103C38 7F0CF108 0254A006 */ srlv $s4, $s4, $s2 -/* 103C3C 7F0CF10C 1020000D */ beqz $at, .L7F0CF144 -/* 103C40 7F0CF110 03194021 */ addu $t0, $t8, $t9 -/* 103C44 7F0CF114 8FC30000 */ lw $v1, ($fp) -/* 103C48 7F0CF118 01C02025 */ move $a0, $t6 -.L7F0CF11C: -/* 103C4C 7F0CF11C 8E620000 */ lw $v0, ($s3) -/* 103C50 7F0CF120 00627821 */ addu $t7, $v1, $v0 -/* 103C54 7F0CF124 91F80000 */ lbu $t8, ($t7) -/* 103C58 7F0CF128 244E0001 */ addiu $t6, $v0, 1 -/* 103C5C 7F0CF12C AE6E0000 */ sw $t6, ($s3) -/* 103C60 7F0CF130 0238C804 */ sllv $t9, $t8, $s1 -/* 103C64 7F0CF134 26310008 */ addiu $s1, $s1, 8 -/* 103C68 7F0CF138 0224082B */ sltu $at, $s1, $a0 -/* 103C6C 7F0CF13C 1420FFF7 */ bnez $at, .L7F0CF11C -/* 103C70 7F0CF140 0299A025 */ or $s4, $s4, $t9 -.L7F0CF144: -/* 103C74 7F0CF144 8FB90074 */ lw $t9, 0x74($sp) -/* 103C78 7F0CF148 028B7824 */ and $t7, $s4, $t3 -/* 103C7C 7F0CF14C 000FC0C0 */ sll $t8, $t7, 3 -/* 103C80 7F0CF150 03193021 */ addu $a2, $t8, $t9 -/* 103C84 7F0CF154 90D20000 */ lbu $s2, ($a2) -/* 103C88 7F0CF158 2E410011 */ sltiu $at, $s2, 0x11 -/* 103C8C 7F0CF15C 5420001E */ bnezl $at, .L7F0CF1D8 -/* 103C90 7F0CF160 90C20001 */ lbu $v0, 1($a2) -/* 103C94 7F0CF164 90C20001 */ lbu $v0, 1($a2) -.L7F0CF168: -/* 103C98 7F0CF168 2652FFF0 */ addiu $s2, $s2, -0x10 -/* 103C9C 7F0CF16C 02228823 */ subu $s1, $s1, $v0 -/* 103CA0 7F0CF170 0232082B */ sltu $at, $s1, $s2 -/* 103CA4 7F0CF174 1020000C */ beqz $at, .L7F0CF1A8 -/* 103CA8 7F0CF178 0054A006 */ srlv $s4, $s4, $v0 -/* 103CAC 7F0CF17C 8FC30000 */ lw $v1, ($fp) -.L7F0CF180: -/* 103CB0 7F0CF180 8E620000 */ lw $v0, ($s3) -/* 103CB4 7F0CF184 00627021 */ addu $t6, $v1, $v0 -/* 103CB8 7F0CF188 91CF0000 */ lbu $t7, ($t6) -/* 103CBC 7F0CF18C 24590001 */ addiu $t9, $v0, 1 -/* 103CC0 7F0CF190 AE790000 */ sw $t9, ($s3) -/* 103CC4 7F0CF194 022FC004 */ sllv $t8, $t7, $s1 -/* 103CC8 7F0CF198 26310008 */ addiu $s1, $s1, 8 -/* 103CCC 7F0CF19C 0232082B */ sltu $at, $s1, $s2 -/* 103CD0 7F0CF1A0 1420FFF7 */ bnez $at, .L7F0CF180 -/* 103CD4 7F0CF1A4 0298A025 */ or $s4, $s4, $t8 -.L7F0CF1A8: -/* 103CD8 7F0CF1A8 00127040 */ sll $t6, $s2, 1 -/* 103CDC 7F0CF1AC 012E7821 */ addu $t7, $t1, $t6 -/* 103CE0 7F0CF1B0 95F80000 */ lhu $t8, ($t7) -/* 103CE4 7F0CF1B4 8CCF0004 */ lw $t7, 4($a2) -/* 103CE8 7F0CF1B8 0314C824 */ and $t9, $t8, $s4 -/* 103CEC 7F0CF1BC 001970C0 */ sll $t6, $t9, 3 -/* 103CF0 7F0CF1C0 01CF3021 */ addu $a2, $t6, $t7 -/* 103CF4 7F0CF1C4 90D20000 */ lbu $s2, ($a2) -/* 103CF8 7F0CF1C8 2E410011 */ sltiu $at, $s2, 0x11 -/* 103CFC 7F0CF1CC 5020FFE6 */ beql $at, $zero, .L7F0CF168 -/* 103D00 7F0CF1D0 90C20001 */ lbu $v0, 1($a2) -/* 103D04 7F0CF1D4 90C20001 */ lbu $v0, 1($a2) -.L7F0CF1D8: -/* 103D08 7F0CF1D8 02228823 */ subu $s1, $s1, $v0 -/* 103D0C 7F0CF1DC 0232082B */ sltu $at, $s1, $s2 -/* 103D10 7F0CF1E0 1020000C */ beqz $at, .L7F0CF214 -/* 103D14 7F0CF1E4 0054A006 */ srlv $s4, $s4, $v0 -/* 103D18 7F0CF1E8 8FC30000 */ lw $v1, ($fp) -.L7F0CF1EC: -/* 103D1C 7F0CF1EC 8E620000 */ lw $v0, ($s3) -/* 103D20 7F0CF1F0 0062C021 */ addu $t8, $v1, $v0 -/* 103D24 7F0CF1F4 93190000 */ lbu $t9, ($t8) -/* 103D28 7F0CF1F8 244F0001 */ addiu $t7, $v0, 1 -/* 103D2C 7F0CF1FC AE6F0000 */ sw $t7, ($s3) -/* 103D30 7F0CF200 02397004 */ sllv $t6, $t9, $s1 -/* 103D34 7F0CF204 26310008 */ addiu $s1, $s1, 8 -/* 103D38 7F0CF208 0232082B */ sltu $at, $s1, $s2 -/* 103D3C 7F0CF20C 1420FFF7 */ bnez $at, .L7F0CF1EC -/* 103D40 7F0CF210 028EA025 */ or $s4, $s4, $t6 -.L7F0CF214: -/* 103D44 7F0CF214 94D80004 */ lhu $t8, 4($a2) -/* 103D48 7F0CF218 00127040 */ sll $t6, $s2, 1 -/* 103D4C 7F0CF21C 012E7821 */ addu $t7, $t1, $t6 -/* 103D50 7F0CF220 02B8C823 */ subu $t9, $s5, $t8 -/* 103D54 7F0CF224 95F80000 */ lhu $t8, ($t7) -/* 103D58 7F0CF228 02328823 */ subu $s1, $s1, $s2 -/* 103D5C 7F0CF22C 03147024 */ and $t6, $t8, $s4 -/* 103D60 7F0CF230 032E8023 */ subu $s0, $t9, $t6 -/* 103D64 7F0CF234 0254A006 */ srlv $s4, $s4, $s2 -/* 103D68 7F0CF238 01009025 */ move $s2, $t0 -.L7F0CF23C: -/* 103D6C 7F0CF23C 02B07823 */ subu $t7, $s5, $s0 -/* 103D70 7F0CF240 01F2082B */ sltu $at, $t7, $s2 -/* 103D74 7F0CF244 14200025 */ bnez $at, .L7F0CF2DC -/* 103D78 7F0CF248 00004025 */ move $t0, $zero -/* 103D7C 7F0CF24C 8EE30000 */ lw $v1, ($s7) -/* 103D80 7F0CF250 8FD80000 */ lw $t8, ($fp) -/* 103D84 7F0CF254 8E790000 */ lw $t9, ($s3) -/* 103D88 7F0CF258 02B2B021 */ addu $s6, $s5, $s2 -/* 103D8C 7F0CF25C 02C31021 */ addu $v0, $s6, $v1 -/* 103D90 7F0CF260 2442FFFF */ addiu $v0, $v0, -1 -/* 103D94 7F0CF264 03192021 */ addu $a0, $t8, $t9 -/* 103D98 7F0CF268 0044082B */ sltu $at, $v0, $a0 -/* 103D9C 7F0CF26C 14200006 */ bnez $at, .L7F0CF288 -/* 103DA0 7F0CF270 00447023 */ subu $t6, $v0, $a0 -/* 103DA4 7F0CF274 01C7082B */ sltu $at, $t6, $a3 -/* 103DA8 7F0CF278 50200004 */ beql $at, $zero, .L7F0CF28C -/* 103DAC 7F0CF27C 00752021 */ addu $a0, $v1, $s5 -.L7F0CF280: -/* 103DB0 7F0CF280 1000FFFF */ b .L7F0CF280 -/* 103DB4 7F0CF284 00000000 */ nop -.L7F0CF288: -/* 103DB8 7F0CF288 00752021 */ addu $a0, $v1, $s5 -.L7F0CF28C: -/* 103DBC 7F0CF28C 00702821 */ addu $a1, $v1, $s0 -/* 103DC0 7F0CF290 02403025 */ move $a2, $s2 -/* 103DC4 7F0CF294 AFA80068 */ sw $t0, 0x68($sp) -/* 103DC8 7F0CF298 AFAA0058 */ sw $t2, 0x58($sp) -/* 103DCC 7F0CF29C AFAB0054 */ sw $t3, 0x54($sp) -/* 103DD0 7F0CF2A0 AFAC0044 */ sw $t4, 0x44($sp) -/* 103DD4 7F0CF2A4 0C004E14 */ jal memcpy -/* 103DD8 7F0CF2A8 AFAD0040 */ sw $t5, 0x40($sp) -/* 103DDC 7F0CF2AC 3C098005 */ lui $t1, %hi(rz_mask_bits) -/* 103DE0 7F0CF2B0 2529E9B0 */ addiu $t1, %lo(rz_mask_bits) # addiu $t1, $t1, -0x1650 -/* 103DE4 7F0CF2B4 34078000 */ li $a3, 32768 -/* 103DE8 7F0CF2B8 8FA80068 */ lw $t0, 0x68($sp) -/* 103DEC 7F0CF2BC 8FAA0058 */ lw $t2, 0x58($sp) -/* 103DF0 7F0CF2C0 8FAB0054 */ lw $t3, 0x54($sp) -/* 103DF4 7F0CF2C4 8FAC0044 */ lw $t4, 0x44($sp) -/* 103DF8 7F0CF2C8 8FAD0040 */ lw $t5, 0x40($sp) -/* 103DFC 7F0CF2CC 8FBF0078 */ lw $ra, 0x78($sp) -/* 103E00 7F0CF2D0 02C0A825 */ move $s5, $s6 -/* 103E04 7F0CF2D4 10000016 */ b .L7F0CF330 -/* 103E08 7F0CF2D8 02128021 */ addu $s0, $s0, $s2 -.L7F0CF2DC: -/* 103E0C 7F0CF2DC 8EE30000 */ lw $v1, ($s7) -/* 103E10 7F0CF2E0 8FCF0000 */ lw $t7, ($fp) -/* 103E14 7F0CF2E4 8E780000 */ lw $t8, ($s3) -/* 103E18 7F0CF2E8 00752821 */ addu $a1, $v1, $s5 -/* 103E1C 7F0CF2EC 00A01025 */ move $v0, $a1 -/* 103E20 7F0CF2F0 01F82021 */ addu $a0, $t7, $t8 -/* 103E24 7F0CF2F4 00A4082B */ sltu $at, $a1, $a0 -/* 103E28 7F0CF2F8 14200006 */ bnez $at, .L7F0CF314 -/* 103E2C 7F0CF2FC 0044C823 */ subu $t9, $v0, $a0 -/* 103E30 7F0CF300 0327082B */ sltu $at, $t9, $a3 -/* 103E34 7F0CF304 50200004 */ beql $at, $zero, .L7F0CF318 -/* 103E38 7F0CF308 02037021 */ addu $t6, $s0, $v1 -.L7F0CF30C: -/* 103E3C 7F0CF30C 1000FFFF */ b .L7F0CF30C -/* 103E40 7F0CF310 00000000 */ nop -.L7F0CF314: -/* 103E44 7F0CF314 02037021 */ addu $t6, $s0, $v1 -.L7F0CF318: -/* 103E48 7F0CF318 91CF0000 */ lbu $t7, ($t6) -/* 103E4C 7F0CF31C 2652FFFF */ addiu $s2, $s2, -1 -/* 103E50 7F0CF320 26100001 */ addiu $s0, $s0, 1 -/* 103E54 7F0CF324 26B50001 */ addiu $s5, $s5, 1 -/* 103E58 7F0CF328 1640FFEC */ bnez $s2, .L7F0CF2DC -/* 103E5C 7F0CF32C A0AF0000 */ sb $t7, ($a1) -.L7F0CF330: -/* 103E60 7F0CF330 5500FFC2 */ bnezl $t0, .L7F0CF23C -/* 103E64 7F0CF334 01009025 */ move $s2, $t0 -/* 103E68 7F0CF338 1000FF13 */ b .L7F0CEF88 -/* 103E6C 7F0CF33C 023F082B */ sltu $at, $s1, $ra -.L7F0CF340: -/* 103E70 7F0CF340 3C018009 */ lui $at, %hi(rz_wp) -/* 103E74 7F0CF344 AC35D35C */ sw $s5, %lo(rz_wp)($at) -/* 103E78 7F0CF348 3C018009 */ lui $at, %hi(rz_bb) -/* 103E7C 7F0CF34C AC34D364 */ sw $s4, %lo(rz_bb)($at) -/* 103E80 7F0CF350 8FBF003C */ lw $ra, 0x3c($sp) -/* 103E84 7F0CF354 3C018009 */ lui $at, %hi(rz_bk) -/* 103E88 7F0CF358 AC31D368 */ sw $s1, %lo(rz_bk)($at) -/* 103E8C 7F0CF35C 8FB1001C */ lw $s1, 0x1c($sp) -/* 103E90 7F0CF360 8FB40028 */ lw $s4, 0x28($sp) -/* 103E94 7F0CF364 8FB5002C */ lw $s5, 0x2c($sp) -/* 103E98 7F0CF368 8FB00018 */ lw $s0, 0x18($sp) -/* 103E9C 7F0CF36C 8FB20020 */ lw $s2, 0x20($sp) -/* 103EA0 7F0CF370 8FB30024 */ lw $s3, 0x24($sp) -/* 103EA4 7F0CF374 8FB60030 */ lw $s6, 0x30($sp) -/* 103EA8 7F0CF378 8FB70034 */ lw $s7, 0x34($sp) -/* 103EAC 7F0CF37C 8FBE0038 */ lw $fp, 0x38($sp) -/* 103EB0 7F0CF380 27BD0070 */ addiu $sp, $sp, 0x70 -/* 103EB4 7F0CF384 03E00008 */ jr $ra -/* 103EB8 7F0CF388 00001025 */ move $v0, $zero -) -#endif - - - - - -#ifdef NONMATCHING + + + + + s32 zlib_inflate_stored(void) { - s32 n; /* number of bytes in block */ - s32 w; /* current window position */ + u32 n; /* number of bytes in block */ + u32 w; /* current window position */ register u32 b; /* bit buffer */ register u32 k; /* number of bits in bit buffer */ @@ -765,28 +430,23 @@ s32 zlib_inflate_stored(void) // removed } DUMPBITS(16) - + /* read and output the compressed data */ while (n--) { - /** - * decomp problem area. - * This while loop is incorrect.* - */ - - u8 *outbuf = rz_outbuf; - NEEDBITS(8) - - b >>= 8; - - if ((&outbuf[w] >= &rz_inbuf[rz_inptr]) && (u32)(&outbuf[w]) - (u32)(&rz_inbuf[rz_inptr]) < WSIZE) { while(1){} } - - outbuf[w++] = (u8)b; - - k -= 8; - //DUMPBITS(8) + if ((u32)(s32)&rz_outbuf[w] >= (u32)(s32)&rz_inbuf[rz_inptr]) + { + if ((u32)((s32)&rz_outbuf[w] - (s32)&rz_inbuf[rz_inptr]) < WSIZE) + { + while(1){} + } + } + + rz_outbuf[w++] = (u8)b; + + DUMPBITS(8) } /* restore the globals from the locals */ @@ -796,128 +456,6 @@ s32 zlib_inflate_stored(void) return 0; } -#else -GLOBAL_ASM( -.text -glabel zlib_inflate_stored -/* 103EBC 7F0CF38C 3C0B8009 */ lui $t3, %hi(rz_bk) -/* 103EC0 7F0CF390 256BD368 */ addiu $t3, %lo(rz_bk) # addiu $t3, $t3, -0x2c98 -/* 103EC4 7F0CF394 8D640000 */ lw $a0, ($t3) -/* 103EC8 7F0CF398 3C0A8009 */ lui $t2, %hi(rz_bb) -/* 103ECC 7F0CF39C 254AD364 */ addiu $t2, %lo(rz_bb) # addiu $t2, $t2, -0x2c9c -/* 103ED0 7F0CF3A0 30820007 */ andi $v0, $a0, 7 -/* 103ED4 7F0CF3A4 8D430000 */ lw $v1, ($t2) -/* 103ED8 7F0CF3A8 3C0C8009 */ lui $t4, %hi(rz_wp) -/* 103EDC 7F0CF3AC 00822023 */ subu $a0, $a0, $v0 -/* 103EE0 7F0CF3B0 258CD35C */ addiu $t4, %lo(rz_wp) # addiu $t4, $t4, -0x2ca4 -/* 103EE4 7F0CF3B4 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* 103EE8 7F0CF3B8 2C810010 */ sltiu $at, $a0, 0x10 -/* 103EEC 7F0CF3BC AFB1000C */ sw $s1, 0xc($sp) -/* 103EF0 7F0CF3C0 AFB00008 */ sw $s0, 8($sp) -/* 103EF4 7F0CF3C4 8D850000 */ lw $a1, ($t4) -/* 103EF8 7F0CF3C8 1020000F */ beqz $at, .L7F0CF408 -/* 103EFC 7F0CF3CC 00431806 */ srlv $v1, $v1, $v0 -/* 103F00 7F0CF3D0 3C068009 */ lui $a2, %hi(rz_inbuf) -/* 103F04 7F0CF3D4 3C0D8009 */ lui $t5, %hi(rz_inptr) -/* 103F08 7F0CF3D8 25ADD358 */ addiu $t5, %lo(rz_inptr) # addiu $t5, $t5, -0x2ca8 -/* 103F0C 7F0CF3DC 8CC6D350 */ lw $a2, %lo(rz_inbuf)($a2) -.L7F0CF3E0: -/* 103F10 7F0CF3E0 8DA70000 */ lw $a3, ($t5) -/* 103F14 7F0CF3E4 00C77021 */ addu $t6, $a2, $a3 -/* 103F18 7F0CF3E8 91CF0000 */ lbu $t7, ($t6) -/* 103F1C 7F0CF3EC 24F90001 */ addiu $t9, $a3, 1 -/* 103F20 7F0CF3F0 ADB90000 */ sw $t9, ($t5) -/* 103F24 7F0CF3F4 008FC004 */ sllv $t8, $t7, $a0 -/* 103F28 7F0CF3F8 24840008 */ addiu $a0, $a0, 8 -/* 103F2C 7F0CF3FC 2C810010 */ sltiu $at, $a0, 0x10 -/* 103F30 7F0CF400 1420FFF7 */ bnez $at, .L7F0CF3E0 -/* 103F34 7F0CF404 00781825 */ or $v1, $v1, $t8 -.L7F0CF408: -/* 103F38 7F0CF408 2484FFF0 */ addiu $a0, $a0, -0x10 -/* 103F3C 7F0CF40C 3C0D8009 */ lui $t5, %hi(rz_inptr) -/* 103F40 7F0CF410 3062FFFF */ andi $v0, $v1, 0xffff -/* 103F44 7F0CF414 00037402 */ srl $t6, $v1, 0x10 -/* 103F48 7F0CF418 2C810010 */ sltiu $at, $a0, 0x10 -/* 103F4C 7F0CF41C 25ADD358 */ addiu $t5, %lo(rz_inptr) # addiu $t5, $t5, -0x2ca8 -/* 103F50 7F0CF420 1020000D */ beqz $at, .L7F0CF458 -/* 103F54 7F0CF424 01C01825 */ move $v1, $t6 -/* 103F58 7F0CF428 3C068009 */ lui $a2, %hi(rz_inbuf) -/* 103F5C 7F0CF42C 8CC6D350 */ lw $a2, %lo(rz_inbuf)($a2) -.L7F0CF430: -/* 103F60 7F0CF430 8DA70000 */ lw $a3, ($t5) -/* 103F64 7F0CF434 00C77821 */ addu $t7, $a2, $a3 -/* 103F68 7F0CF438 91F80000 */ lbu $t8, ($t7) -/* 103F6C 7F0CF43C 24EE0001 */ addiu $t6, $a3, 1 -/* 103F70 7F0CF440 ADAE0000 */ sw $t6, ($t5) -/* 103F74 7F0CF444 0098C804 */ sllv $t9, $t8, $a0 -/* 103F78 7F0CF448 24840008 */ addiu $a0, $a0, 8 -/* 103F7C 7F0CF44C 2C810010 */ sltiu $at, $a0, 0x10 -/* 103F80 7F0CF450 1420FFF7 */ bnez $at, .L7F0CF430 -/* 103F84 7F0CF454 00791825 */ or $v1, $v1, $t9 -.L7F0CF458: -/* 103F88 7F0CF458 00403025 */ move $a2, $v0 -/* 103F8C 7F0CF45C 00037C02 */ srl $t7, $v1, 0x10 -/* 103F90 7F0CF460 01E01825 */ move $v1, $t7 -/* 103F94 7F0CF464 2484FFF0 */ addiu $a0, $a0, -0x10 -/* 103F98 7F0CF468 10400027 */ beqz $v0, .L7F0CF508 -/* 103F9C 7F0CF46C 2442FFFF */ addiu $v0, $v0, -1 -/* 103FA0 7F0CF470 3C108009 */ lui $s0, %hi(rz_outbuf) -/* 103FA4 7F0CF474 2610D354 */ addiu $s0, %lo(rz_outbuf) # addiu $s0, $s0, -0x2cac -/* 103FA8 7F0CF478 34118000 */ li $s1, 32768 -.L7F0CF47C: -/* 103FAC 7F0CF47C 3C068009 */ lui $a2, %hi(rz_inbuf) -/* 103FB0 7F0CF480 2C810008 */ sltiu $at, $a0, 8 -/* 103FB4 7F0CF484 1020000B */ beqz $at, .L7F0CF4B4 -/* 103FB8 7F0CF488 8CC6D350 */ lw $a2, %lo(rz_inbuf)($a2) -.L7F0CF48C: -/* 103FBC 7F0CF48C 8DA70000 */ lw $a3, ($t5) -/* 103FC0 7F0CF490 00C7C021 */ addu $t8, $a2, $a3 -/* 103FC4 7F0CF494 93190000 */ lbu $t9, ($t8) -/* 103FC8 7F0CF498 24EF0001 */ addiu $t7, $a3, 1 -/* 103FCC 7F0CF49C ADAF0000 */ sw $t7, ($t5) -/* 103FD0 7F0CF4A0 00997004 */ sllv $t6, $t9, $a0 -/* 103FD4 7F0CF4A4 24840008 */ addiu $a0, $a0, 8 -/* 103FD8 7F0CF4A8 2C810008 */ sltiu $at, $a0, 8 -/* 103FDC 7F0CF4AC 1420FFF7 */ bnez $at, .L7F0CF48C -/* 103FE0 7F0CF4B0 006E1825 */ or $v1, $v1, $t6 -.L7F0CF4B4: -/* 103FE4 7F0CF4B4 8E180000 */ lw $t8, ($s0) -/* 103FE8 7F0CF4B8 8DB90000 */ lw $t9, ($t5) -/* 103FEC 7F0CF4BC 00037A02 */ srl $t7, $v1, 8 -/* 103FF0 7F0CF4C0 03053821 */ addu $a3, $t8, $a1 -/* 103FF4 7F0CF4C4 00D94821 */ addu $t1, $a2, $t9 -/* 103FF8 7F0CF4C8 00E9082B */ sltu $at, $a3, $t1 -/* 103FFC 7F0CF4CC 14200007 */ bnez $at, .L7F0CF4EC -/* 104000 7F0CF4D0 00E04025 */ move $t0, $a3 -/* 104004 7F0CF4D4 01097023 */ subu $t6, $t0, $t1 -/* 104008 7F0CF4D8 01D1082B */ sltu $at, $t6, $s1 -/* 10400C 7F0CF4DC 50200004 */ beql $at, $zero, .L7F0CF4F0 -/* 104010 7F0CF4E0 00403025 */ move $a2, $v0 -.L7F0CF4E4: -/* 104014 7F0CF4E4 1000FFFF */ b .L7F0CF4E4 -/* 104018 7F0CF4E8 00000000 */ nop -.L7F0CF4EC: -/* 10401C 7F0CF4EC 00403025 */ move $a2, $v0 -.L7F0CF4F0: -/* 104020 7F0CF4F0 A0E30000 */ sb $v1, ($a3) -/* 104024 7F0CF4F4 24A50001 */ addiu $a1, $a1, 1 -/* 104028 7F0CF4F8 01E01825 */ move $v1, $t7 -/* 10402C 7F0CF4FC 2484FFF8 */ addiu $a0, $a0, -8 -/* 104030 7F0CF500 1440FFDE */ bnez $v0, .L7F0CF47C -/* 104034 7F0CF504 2442FFFF */ addiu $v0, $v0, -1 -.L7F0CF508: -/* 104038 7F0CF508 8FB00008 */ lw $s0, 8($sp) -/* 10403C 7F0CF50C 8FB1000C */ lw $s1, 0xc($sp) -/* 104040 7F0CF510 AD850000 */ sw $a1, ($t4) -/* 104044 7F0CF514 AD430000 */ sw $v1, ($t2) -/* 104048 7F0CF518 AD640000 */ sw $a0, ($t3) -/* 10404C 7F0CF51C 27BD0010 */ addiu $sp, $sp, 0x10 -/* 104050 7F0CF520 03E00008 */ jr $ra -/* 104054 7F0CF524 00001025 */ move $v0, $zero -) -#endif - - diff --git a/src/game/zlib.h b/src/game/zlib.h index e8ee6588..3d8e1054 100644 --- a/src/game/zlib.h +++ b/src/game/zlib.h @@ -15,6 +15,7 @@ extern struct huft *rz_hlist; the next table, which codes e - 16 bits, and lastly e == 99 indicates an unused code. If a code with e == 99 is looked up, this implies an error in the data. */ +// from gzip 1.2.4 inflate.c (public domain) struct huft { u8 e; /* number of extra bits or operation */ u8 b; /* number of bits in this code or subcode */ diff --git a/src/inflate/inflate.c b/src/inflate/inflate.c index 8ce16130..afb1aec0 100644 --- a/src/inflate/inflate.c +++ b/src/inflate/inflate.c @@ -12,6 +12,12 @@ //this file is modified from inflate.c found in gzip... //does this create a license conflict in rare's original source tree? +// -- no, because Mark Adler placed the original inflate.c used in gzip in the public domain. +// The rest of gzip (1.2.4, 1993-08-20 release) was licensed under GPL2, RARE seems to have +// been careful not to include any of that (e.g., decompress.c or other entry points). +// +// -- BB, June 23, 2023 + u8 *inbuf = 0; u8 *outbuf = 0; diff --git a/src/init.c b/src/init.c index ced77339..4ac61a1f 100644 --- a/src/init.c +++ b/src/init.c @@ -1,6 +1,8 @@ #include +#include #include #include +#include #include #include "boot.h" #include "sched.h" @@ -18,32 +20,55 @@ /** * @file init.c - * This file contains the initial non bootstrap code ran. - * + * This file contains the initial non bootstrap code ran. + * * In particular, it: * - unpacks main data payload * - starts idle and rmon loops * - starts main loop */ + #define NUM_FIELDS 1 +#define MAXSP 7 + +#define RZIPLOADADDR 0x70200000 +#define RZIPBUFADDR 0x80300000 + +#define MAXCODESIZE 0xFFFB0 -u32 unknown_val_80023040 = 0; -/*D:80023044*/ -u32 unknown_init_val = 2; -u32 cart_hw_address = 0x10000000; -struct debug_handler_entry debug_handler_table[] = +/** + * These 3 values (likely more as u32 piDeviceType = DEVICE_TYPE_CART could be 4x u8) + * piDeviceType is completely unused but the most logical value here + * piStatusReg, and piDomAddr are explicitly stored as 32bit values +*/ +u32 piDeviceType = DEVICE_TYPE_CART; +u32 piStatusReg = PI_CLR_INTR; +u32 piDomAddr = PI_DOM1_ADDR2; + +union debug_handler_container { - {sp_boot, "boot"}, - {sp_rmon, "rmon"}, - {sp_idle, "idle"}, - {sp_shed, "shed"}, - {sp_main, "main"}, - {sp_audi, "audi"}, - {0, 0}, + /* There is a bulk memory copy of debug_handler_table, + * it seems to require a container with a known size, + * which doesn't seem correct .... + */ + struct debug_handler_entry rows[MAXSP]; + s32 data[MAXSP * 2]; +}; + +union debug_handler_container debug_handler_table = { + { + {sp_boot, "boot"}, + {sp_rmon, "rmon"}, + {sp_idle, "idle"}, + {sp_shed, "shed"}, + {sp_main, "main"}, + {sp_audi, "audi"}, + {0, 0} + } }; OSThread rmonThread; @@ -56,308 +81,198 @@ OSMesgQueue *sched_cmdQ; void mainproc(void *args); -extern u8 * _inflateSegmentStart; /** * 1110 70000510 - * ??? initializes TLB index... - * copies compressed 21990 to virtual address 701EE400, using 70200000 to decompress + * init - The real main entry point, called from boot.s + * Deflates the compressed data segment + * Installs the TLB miss handler + * Then starts the main thread */ -#ifdef NONMATCHING -// -// https://decomp.me/scratch/vhVzi -// - -// left to fix: -// minor reg swapping -// - -extern u32* _alt_startSegmentRomStart; -extern u32* _alt_startSegmentStart; void init(void) { + u32 inflateromSize; + u8 *csegmentSegmentVaddrStart; + u8 *cdataSegmentRomStart; + u32 flags; + u32 cdataSegmentRomSize; + u8 *inflateSegmentRomStart; s32 i; - u32 csegmentSegmentVaddrStart = get_csegmentSegmentStart(); - u32 cdataSegmentRomStart = get_cdataSegmentRomStart(); s32 j; - u32 cdataSegmentRomSize = get_cdataSegmentRomEnd() - cdataSegmentRomStart; - u32 inflateSegmentRomStart = get_inflateSegmentRomStart(); - u32 inflateromSize = get_inflateSegmentRomEnd() - inflateSegmentRomStart; - s32 codeAndDataSegRomSize; - for (j = (cdataSegmentRomSize + (inflateromSize)) - 1; j >= 0; j--) + u8 *datazipram; + s32 inflate_code_size; + u32 decompress_result; + s32 *dest; + s32 *src; + u32 copylen; + s32 *stack_pointer; + u8 *dataziprom; + + csegmentSegmentVaddrStart = get_csegmentSegmentStart(); + cdataSegmentRomStart = get_cdataSegmentRomStart(); + cdataSegmentRomSize = (u8 *) get_cdataSegmentRomEnd() - cdataSegmentRomStart; + inflateSegmentRomStart = get_inflateSegmentRomStart(); + inflateromSize = (u8 *) get_inflateSegmentRomEnd() - inflateSegmentRomStart; + copylen = cdataSegmentRomSize + inflateromSize; + datazipram = (u8 *) (RZIPLOADADDR - cdataSegmentRomSize); + dataziprom = csegmentSegmentVaddrStart; + + for (j = copylen - 1; j >= 0; j--) { - ((u8 *)(0x70200000 - cdataSegmentRomSize))[j] = ((u8*)csegmentSegmentVaddrStart)[j]; + datazipram[j] = dataziprom[j]; } - jump_decompressfile(0x70200000 - cdataSegmentRomSize, csegmentSegmentVaddrStart, 0x80300000); - if (0) {} - codeAndDataSegRomSize = (u32)&_inflateSegmentRomStart - (u32)&_codeSegmentRomStart; - if ((codeAndDataSegRomSize > 0xFFFB0)) + decompress_result = jump_decompressfile(datazipram, csegmentSegmentVaddrStart, RZIPBUFADDR); + if (decompress_result); + + inflate_code_size = (s32) ((u32) &_inflateSegmentRomStart - (u32) &_codeSegmentRomStart); + if (inflate_code_size > MAXCODESIZE) { - osPiRawStartDma(0, &_alt_startSegmentRomStart, &_alt_startSegmentStart, codeAndDataSegRomSize + 0xFFF00050); - while ((osPiGetStatus() & 1)) {} + osPiRawStartDma(OS_READ, &_alt_startSegmentRomStart, &_alt_startSegmentStart, inflate_code_size - MAXCODESIZE); + while ((osPiGetStatus() & PI_STATUS_DMA_BUSY)) + { + } } + osInitialize(); - set_hardwire_TLB_to_2(); - - codeAndDataSegRomSize = 0x80000000; - - j=&resolve_TLBaddress_for_InvalidHit; - i=codeAndDataSegRomSize; - - while (i!=0x80000080) + + // This sets up TLB CONTEXT to allow the TLB miss handler to work + initTLBPrepareContext(); + + // Copy the TLB miss handler to proper place + src = &resolve_TLBaddress_for_InvalidHit; + dest = (s32 *) K0BASE; + while (dest < (s32 *) XUT_VEC) { - *(__exceptionVector *)i = *(__exceptionVector *)j; - i+=0x10; j+=0x10; + *dest++ = *src++; } + // Refresh Cache osWritebackDCacheAll(); - osInvalICache(codeAndDataSegRomSize, 0x4000); + osInvalICache((void *) K0BASE, ICACHE_SIZE); - for (i=2; i<32; i++) + // Cleanup TLB + for (i = 2; i < NTLBENTRIES + 1; i++) { - osUnmapTLB(i); - } + osUnmapTLB(i); + } - __osSetFpcCsr(__osGetFpcCsr() | 0xE80); - osCreateThread(&mainThread, MAIN_THREAD_ID, &mainproc, NULL, set_stack_entry(sp_main, 0x8000), MAIN_THREAD_PRIORITY); + // Setup floating point register + flags = __osGetFpcCsr(); + flags |= FPCSR_EI; // enable inexact operation + flags |= FPCSR_EO; // enable overflow + flags |= FPCSR_EZ; // enable division by zero + flags |= FPCSR_EV; // enable invalid operation + __osSetFpcCsr(flags); + + stack_pointer = setSPToEnd(sp_main, sizeof(sp_main)); + osCreateThread(&mainThread, MAIN_THREAD_ID, &mainproc, NULL, stack_pointer, MAIN_THREAD_PRIORITY); osStartThread(&mainThread); } -//#ifdef NONMATCHING -#else -GLOBAL_ASM( -.section .text -glabel init -/* 001110 70000510 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 001114 70000514 AFBF0024 */ sw $ra, 0x24($sp) -/* 001118 70000518 AFB10020 */ sw $s1, 0x20($sp) -/* 00111C 7000051C 0C00012F */ jal get_csegmentSegmentStart -/* 001120 70000520 AFB0001C */ sw $s0, 0x1c($sp) -/* 001124 70000524 0C000132 */ jal get_cdataSegmentRomStart -/* 001128 70000528 00408025 */ move $s0, $v0 -/* 00112C 7000052C 0C000135 */ jal get_cdataSegmentRomEnd -/* 001130 70000530 AFA20034 */ sw $v0, 0x34($sp) -/* 001134 70000534 8FAE0034 */ lw $t6, 0x34($sp) -/* 001138 70000538 0C000138 */ jal get_inflateSegmentRomStart -/* 00113C 7000053C 004E8823 */ subu $s1, $v0, $t6 -/* 001140 70000540 0C00013B */ jal get_inflateSegmentRomEnd -/* 001144 70000544 AFA20028 */ sw $v0, 0x28($sp) -/* 001148 70000548 8FAF0028 */ lw $t7, 0x28($sp) -/* 00114C 7000054C 3C0A7020 */ lui $t2, 0x7020 -/* 001150 70000550 02002825 */ move $a1, $s0 -/* 001154 70000554 004FC023 */ subu $t8, $v0, $t7 -/* 001158 70000558 02382021 */ addu $a0, $s1, $t8 -/* 00115C 7000055C 2483FFFF */ addiu $v1, $a0, -1 -/* 001160 70000560 0460000A */ bltz $v1, .L7000058C -/* 001164 70000564 3C068030 */ lui $a2, 0x8030 -/* 001168 70000568 3C197020 */ lui $t9, 0x7020 -/* 00116C 7000056C 03312023 */ subu $a0, $t9, $s1 -/* 001170 70000570 02031021 */ addu $v0, $s0, $v1 -.L70000574: -/* 001174 70000574 90480000 */ lbu $t0, ($v0) -/* 001178 70000578 00834821 */ addu $t1, $a0, $v1 -/* 00117C 7000057C 2463FFFF */ addiu $v1, $v1, -1 -/* 001180 70000580 2442FFFF */ addiu $v0, $v0, -1 -/* 001184 70000584 0461FFFB */ bgez $v1, .L70000574 -/* 001188 70000588 A1280000 */ sb $t0, ($t1) -.L7000058C: -/* 00118C 7000058C 0C00013E */ jal jump_decompressfile -/* 001190 70000590 01512023 */ subu $a0, $t2, $s1 -/* 001194 70000594 3C0B0003 */ lui $t3, %hi(_inflateSegmentRomStart) # $t3, 3 -/* 001198 70000598 3C0C0000 */ lui $t4, %hi(_codeSegmentRomStart) # $t4, 0 -/* 00119C 7000059C 258C1050 */ addiu $t4, %lo(_codeSegmentRomStart) # addiu $t4, $t4, 0x1050 -/* 0011A0 700005A0 256B3590 */ addiu $t3, %lo(_inflateSegmentRomStart) # addiu $t3, $t3, 0x3590 -/* 0011A4 700005A4 3C01000F */ lui $at, (0x000FFFB1 >> 16) # lui $at, 0xf -/* 0011A8 700005A8 3421FFB1 */ ori $at, (0x000FFFB1 & 0xFFFF) # ori $at, $at, 0xffb1 -/* 0011AC 700005AC 016C1023 */ subu $v0, $t3, $t4 -/* 0011B0 700005B0 0041082A */ slt $at, $v0, $at -/* 0011B4 700005B4 14200013 */ bnez $at, .L70000604 -/* 0011B8 700005B8 3C01FFF0 */ lui $at, (0xFFF00050 >> 16) # lui $at, 0xfff0 -/* 0011BC 700005BC 34210050 */ ori $at, (0xFFF00050 & 0xFFFF) # ori $at, $at, 0x50 -/* 0011C0 700005C0 3C050010 */ lui $a1, %hi(0x00101000) # $a1, 0x10 -/* 0011C4 700005C4 3C067010 */ lui $a2, %hi(0x70100400) # $a2, 0x7010 -/* 0011C8 700005C8 24C60400 */ addiu $a2, %lo(0x70100400) # addiu $a2, $a2, 0x400 -/* 0011CC 700005CC 24A51000 */ addiu $a1, %lo(0x00101000) # addiu $a1, $a1, 0x1000 -/* 0011D0 700005D0 00413821 */ addu $a3, $v0, $at -/* 0011D4 700005D4 0C0033E4 */ jal osPiRawStartDma -/* 0011D8 700005D8 00002025 */ move $a0, $zero -/* 0011DC 700005DC 0C00341C */ jal osPiGetStatus -/* 0011E0 700005E0 00000000 */ nop -/* 0011E4 700005E4 304D0001 */ andi $t5, $v0, 1 -/* 0011E8 700005E8 11A00006 */ beqz $t5, .L70000604 -/* 0011EC 700005EC 00000000 */ nop -.L700005F0: -/* 0011F0 700005F0 0C00341C */ jal osPiGetStatus -/* 0011F4 700005F4 00000000 */ nop -/* 0011F8 700005F8 304E0001 */ andi $t6, $v0, 1 -/* 0011FC 700005FC 15C0FFFC */ bnez $t6, .L700005F0 -/* 001200 70000600 00000000 */ nop -.L70000604: -/* 001204 70000604 0C003420 */ jal osInitialize -/* 001208 70000608 00000000 */ nop -/* 00120C 7000060C 0C0006EC */ jal set_hardwire_TLB_to_2 -/* 001210 70000610 00000000 */ nop - - -/* 001214 70000614 3C108000 */ lui $s0, %hi(0x80000000) -/* 001218 70000618 3C027000 */ lui $v0, %hi(resolve_TLBaddress_for_InvalidHit) # $v0, 0x7000 -/* 00121C 7000061C 3C048000 */ lui $a0, (0x80000080 >> 16) # lui $a0, 0x8000 -/* 001220 70000620 24421B60 */ addiu $v0, %lo(resolve_TLBaddress_for_InvalidHit) # addiu $v0, $v0, 0x1b60 -/* 001224 70000624 02001825 */ move $v1, $s0 -/* 001228 70000628 34840080 */ ori $a0, (0x80000080 & 0xFFFF) # ori $a0, $a0, 0x80 -.L7000062C: -/* 00122C 7000062C 8C4F0000 */ lw $t7, ($v0) -/* 001230 70000630 24630010 */ addiu $v1, $v1, 0x10 -/* 001234 70000634 24420010 */ addiu $v0, $v0, 0x10 -/* 001238 70000638 AC6FFFF0 */ sw $t7, -0x10($v1) -/* 00123C 7000063C 8C58FFF4 */ lw $t8, -0xc($v0) -/* 001240 70000640 AC78FFF4 */ sw $t8, -0xc($v1) -/* 001244 70000644 8C59FFF8 */ lw $t9, -8($v0) -/* 001248 70000648 AC79FFF8 */ sw $t9, -8($v1) -/* 00124C 7000064C 8C48FFFC */ lw $t0, -4($v0) -/* 001250 70000650 1464FFF6 */ bne $v1, $a0, .L7000062C -/* 001254 70000654 AC68FFFC */ sw $t0, -4($v1) - - -/* 001258 70000658 0C0034C8 */ jal osWritebackDCacheAll -/* 00125C 7000065C 00000000 */ nop -/* 001260 70000660 02002025 */ move $a0, $s0 -/* 001264 70000664 0C0034D4 */ jal osInvalICache -/* 001268 70000668 24054000 */ li $a1, 16384 -/* 00126C 7000066C 24100002 */ li $s0, 2 -/* 001270 70000670 24110020 */ li $s1, 32 -.L70000674: -/* 001274 70000674 0C0034F4 */ jal osUnmapTLB -/* 001278 70000678 02002025 */ move $a0, $s0 -/* 00127C 7000067C 26100001 */ addiu $s0, 1 # addiu $s0, $s0, 1 -/* 001280 70000680 1611FFFC */ bne $s0, $s1, .L70000674 -/* 001284 70000684 00000000 */ nop -/* 001288 70000688 0C003504 */ jal __osGetFpcCsr -/* 00128C 7000068C 00000000 */ nop -/* 001290 70000690 0C003508 */ jal __osSetFpcCsr -/* 001294 70000694 34440E80 */ ori $a0, $v0, 0xe80 -/* 001298 70000698 3C04803B */ lui $a0, %hi(sp_main) # $a0, 0x803b -/* 00129C 7000069C 2484B950 */ addiu $a0, %lo(sp_main) # addiu $a0, $a0, -0x46b0 -/* 0012A0 700006A0 0C0001BC */ jal set_stack_entry -/* 0012A4 700006A4 34058000 */ li $a1, 32768 -/* 0012A8 700006A8 3C108006 */ lui $s0, %hi(mainThread) -/* 0012AC 700006AC 2610D640 */ addiu $s0, %lo(mainThread) # addiu $s0, $s0, -0x29c0 -/* 0012B0 700006B0 3C067000 */ lui $a2, %hi(mainproc) # $a2, 0x7000 -/* 0012B4 700006B4 240C000A */ li $t4, 10 -/* 0012B8 700006B8 AFAC0014 */ sw $t4, 0x14($sp) -/* 0012BC 700006BC 24C6089C */ addiu $a2, %lo(mainproc) # addiu $a2, $a2, 0x89c -/* 0012C0 700006C0 02002025 */ move $a0, $s0 -/* 0012C4 700006C4 24050003 */ li $a1, 3 -/* 0012C8 700006C8 00003825 */ move $a3, $zero -/* 0012CC 700006CC 0C00350C */ jal osCreateThread -/* 0012D0 700006D0 AFA20010 */ sw $v0, 0x10($sp) -/* 0012D4 700006D4 0C003560 */ jal osStartThread -/* 0012D8 700006D8 02002025 */ move $a0, $s0 -/* 0012DC 700006DC 8FBF0024 */ lw $ra, 0x24($sp) -/* 0012E0 700006E0 8FB0001C */ lw $s0, 0x1c($sp) -/* 0012E4 700006E4 8FB10020 */ lw $s1, 0x20($sp) -/* 0012E8 700006E8 03E00008 */ jr $ra -/* 0012EC 700006EC 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif /** * 12F0 700006F0 - * V0= new stack pointer; A0+A1-8 - * accepts: A0=base address, A1=size + * setSPToEnd - set stack pointer to end of stack + * @param stack + * @param size + * @return stack+size-8 */ -void *set_stack_entry(u8 *stack, u32 size) +void *setSPToEnd(u8 *stack, u32 size) { - return stack+size-8; + return stack + size - 8; } /** * 12FC 700006FC - * 1->80023044, 10000000->80023048 + * piStatusRegReset - set PI status register to trigger a reset + * This is unused and is leftover from Indy debug, */ -void set_hw_address_and_unknown(void) +void piStatusRegReset(void) { - unknown_init_val = 1; - cart_hw_address = 0x10000000; + piStatusReg = PI_SET_RESET; + piDomAddr = PI_DOM1_ADDR2; } /** * 1318 70000718 - * A0->SP+0, infinite loop + * idleproc - infinite loop + * @param arg doesn't matter as this is infinite loop */ -void idleproc(void *arg) +void idleproc(void *arg) { - for (;;); + for (;;); } /** * 1338 70000738 - * Null thread; executes 70000718 + * idleCreateThread - creates an empty thread; */ -void idleCreateThread(void) +void idleCreateThread(void) { - osCreateThread(&idleThread, IDLE_THREAD_ID, idleproc, 0, set_stack_entry(&sp_idle, 0x40), IDLE_THREAD_PRIORITY); + osCreateThread(&idleThread, IDLE_THREAD_ID, idleproc, NULL, setSPToEnd(&sp_idle, sizeof(sp_idle)), IDLE_THREAD_PRIORITY); osStartThread(&idleThread); } /** * 1390 70000790 - * Indi board detection thread; now forcably returns INDI_NOT_DETECTED (1) + * rmonCreateThread - remote communication thread + * rmonMain now forcably returns INDI_NOT_DETECTED (1) */ -void rmonCreateThread(void) +void rmonCreateThread(void) { - osCreateThread(&rmonThread, RMON_THREAD_ID, rmonMain, 0, set_stack_entry(&sp_rmon, 0x300), RMON_THREAD_PRIORITY); + osCreateThread(&rmonThread, RMON_THREAD_ID, rmonMain, NULL, setSPToEnd(&sp_rmon, sizeof(sp_rmon)), RMON_THREAD_PRIORITY); osStartThread(&rmonThread); } /** * 13EC 700007EC + * schedulerInitThread - create scheduler thread based on TV type */ void schedulerInitThread(void) { osCreateMesgQueue(&gfxFrameMsgQ, &gfxFrameMsgBuf, 32); - if (osTvType == 2) //OS_TV_MPAL - { + if (osTvType == OS_TV_MPAL) + { osCreateScheduler(&os_scheduler, &shedThread, OS_VI_MPAL_LAN1, NUM_FIELDS); } - else + else { osCreateScheduler(&os_scheduler, &shedThread, OS_VI_NTSC_LAN1, NUM_FIELDS); - } + } - osScAddClient(&os_scheduler, &gfxClient, &gfxFrameMsgQ, 0); + osScAddClient(&os_scheduler, &gfxClient, &gfxFrameMsgQ, NULL); sched_cmdQ = osScGetCmdQ(&os_scheduler); } /** - * 149C 7000089C datastart main game setup and loop - * calls command line parser, debug console setup, etc. - * called by 70000510, using 7000D430: A0=8005D640, A1=3, A2=7000089C, A3=0, SP+10=[803B3948], SP+14=0xA - * never returns; 7000601C is an infinite loop + * 149C 7000089C + * mainproc - main game setup and loop + * calls command line parser, debug console setup, etc. + * @param args */ void mainproc(void *args) { - idleCreateThread(); - viDebugRemoved(); - piCreateManager(); + idleCreateThread(); + viDebugRemoved(); + piCreateManager(); #ifdef ENABLE_USB // make debug print output available as soon as possible. // This uses blocking calls, and the PI manager, so can't be called // before here. usb_initialize(); #else - rmonCreateThread(); + rmonCreateThread(); #endif - if (tokenReadIo() != 0) - { - osStopThread(0); - } - - osSetThreadPri(NULL, 0xa); + if (tokenReadIo()) + { + osStopThread(RMON_THREAD_ID); + } + + osSetThreadPri(RMON_THREAD_ID, MAIN_THREAD_PRIORITY); // Timers are initialized via: // schedulerInitThread -> osCreateScheduler -> osCreateViManager -> __osTimerServicesInit schedulerInitThread(); @@ -370,82 +285,21 @@ void mainproc(void *args) } /** - * 1508 70000908 V0= p->last entry in copy of debug handler code/name table; fries AT,V1,T0,T1,T6,T9 - * copies table from 8002304C-80023084 to stack + * 1508 70000908 + * initDebugHandlerTable - setup debug handler table + * This is unused and is leftover from Indy debug. */ -#ifdef NONMATCHING -void setuplastentryofdebughandler(void) - +void initDebugHandlerTable(void) { - //debug_handler_entry *new; - //debug_handler_entry *old; - debug_handler_entry local_38 [7]; - s32 i; - - //debug_handler_entry *nextnewname; - //debug_handler_entry *nextoldname; - /* - nextoldname = debug_handler_table; - nextnewname = local_38; - do { - new = nextnewname; - old = nextoldname; - new->address = old->address; - new->ptr_name = old->ptr_name; - new[1].address = old[1].address; - nextoldname = &old[1].ptr_name; - nextnewname = &new[1].ptr_name; - } while (&old[1].ptr_name != debug_handler_table + 6); - (&new[1].ptr_name)->address = debug_handler_table[6].address; - new[2].address = old[2].address; - nextnewname = local_38; - while (local_38[1].address != 0x0) { - local_38[1].address = nextnewname[2].address; - nextnewname = nextnewname + 1; - } - return; - */ - for (i=0;i<8;i++) - { - *(debug_handler_entry*)&local_38[i]=*(debug_handler_entry*)&debug_handler_table[i]; - } - for (i=1;local_38[i].address; i++) - { - local_38[i].address = local_38[i+1].address; - } + union debug_handler_container dhe; + struct debug_handler_entry *p; + + dhe = debug_handler_table; + + p = &dhe.rows[0]; + + do + { + p++; + } while (p->address != NULL); } -//#ifdef NONMATCHING -#else -GLOBAL_ASM( -.section .text -glabel setuplastentryofdebughandler -/* 001508 70000908 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 00150C 7000090C 3C0E8002 */ lui $t6, %hi(debug_handler_table) -/* 001510 70000910 27A30008 */ addiu $v1, $sp, 8 -/* 001514 70000914 25CE304C */ addiu $t6, %lo(debug_handler_table) # addiu $t6, $t6, 0x304c -/* 001518 70000918 25D90030 */ addiu $t9, $t6, 0x30 -/* 00151C 7000091C 00604025 */ move $t0, $v1 -.L70000920: -/* 001520 70000920 8DC10000 */ lw $at, ($t6) -/* 001524 70000924 25CE000C */ addiu $t6, $t6, 0xc -/* 001528 70000928 2508000C */ addiu $t0, $t0, 0xc -/* 00152C 7000092C AD01FFF4 */ sw $at, -0xc($t0) -/* 001530 70000930 8DC1FFF8 */ lw $at, -8($t6) -/* 001534 70000934 AD01FFF8 */ sw $at, -8($t0) -/* 001538 70000938 8DC1FFFC */ lw $at, -4($t6) -/* 00153C 7000093C 15D9FFF8 */ bne $t6, $t9, .L70000920 -/* 001540 70000940 AD01FFFC */ sw $at, -4($t0) -/* 001544 70000944 8DC10000 */ lw $at, ($t6) -/* 001548 70000948 00601025 */ move $v0, $v1 -/* 00154C 7000094C AD010000 */ sw $at, ($t0) -/* 001550 70000950 8DD90004 */ lw $t9, 4($t6) -/* 001554 70000954 AD190004 */ sw $t9, 4($t0) -/* 001558 70000958 8C490008 */ lw $t1, 8($v0) -.L7000095C: -/* 00155C 7000095C 24420008 */ addiu $v0, $v0, 8 -/* 001560 70000960 5520FFFE */ bnezl $t1, .L7000095C -/* 001564 70000964 8C490008 */ lw $t1, 8($v0) -/* 001568 70000968 03E00008 */ jr $ra -/* 00156C 7000096C 27BD0040 */ addiu $sp, $sp, 0x40 -) -#endif diff --git a/src/init.h b/src/init.h index 984aea8f..f81c9640 100644 --- a/src/init.h +++ b/src/init.h @@ -10,25 +10,24 @@ extern OSMesgQueue gfxFrameMsgQ; extern OSMesg gfxFrameMsgBuf[32]; extern OSMesgQueue *sched_cmdQ; -extern u32 unknown_init_val; -extern u32 cart_hw_address; +extern u32 piStatusReg; +extern u32 piDomAddr; -typedef struct { - unsigned int inst1; - unsigned int inst2; - unsigned int inst3; - unsigned int inst4; +typedef struct +{ + unsigned int inst1; + unsigned int inst2; + unsigned int inst3; + unsigned int inst4; } __exceptionVector; typedef struct debug_handler_entry { - void *address; - char *ptr_name; + void *address; + char *ptr_name; } debug_handler_entry; void init(void); -void *set_stack_entry(u8 *stack, u32 size); -void set_hw_address_and_unknown(void); -void setuplastentryofdebughandler(void); +void *setSPToEnd(u8 *stack, u32 size); #endif diff --git a/src/joy.c b/src/joy.c index 77b8d999..3c24be3b 100644 --- a/src/joy.c +++ b/src/joy.c @@ -2,11 +2,6 @@ #include "joy.h" #include -/** - * Number of samples in contdata. - */ -#define CONTSAMPLE_LEN 20 - #define JOY_CLAMP_MIN 0 #define JOY_CLAMP_MAX 120 #define JOY_CLAMP_MAX_F 120.0f @@ -430,9 +425,18 @@ void joyConsumeSamplesWrapper(void) #ifdef NONMATCHING // Stack + Regalloc +// https://decomp.me/scratch/IOID3 97.27% void joyPoll(void) { OSMesg msg; + + s32 padding[6]; + + static s32 count = 0; + s32 index; + s8 i_s8; + s32 i; + // Check if there are any disable requests if (osRecvMesg(&g_ContDisablePollSendMessageQueue, &msg, OS_MESG_NOBLOCK) == 0) { @@ -451,9 +455,10 @@ void joyPoll(void) // Check if there are any enable requests if (osRecvMesg(&g_ContEnablePollSendMessageQueue, &msg, OS_MESG_NOBLOCK) == 0) { - osContStartPollData(&g_ContInputMessageQueue); + osContStartReadData(&g_ContInputMessageQueue); g_ContBusy = TRUE; osSendMesg(&g_ContEnablePollReceiveMessageQueue, &msg, OS_MESG_NOBLOCK); + g_ContPollDisableCount--; return; @@ -464,10 +469,6 @@ void joyPoll(void) // Poll controller input from SI if (osRecvMesg(&g_ContInputMessageQueue, &msg, OS_MESG_NOBLOCK) == 0) { - static s32 count = 0; - s32 index; - s8 i; - g_ContBusy = FALSE; index = ((g_ContData[CONTDATA_REGULAR].nextlast + 1) % CONTSAMPLE_LEN); @@ -476,9 +477,10 @@ void joyPoll(void) index = g_ContData[CONTDATA_REGULAR].nextlast; } + osContGetReadData(g_ContData[CONTDATA_REGULAR].samples[index].pads); g_ContData[CONTDATA_REGULAR].nextlast = index; - g_ContData[CONTDATA_REGULAR].nextsecondlast = ((g_ContData[CONTDATA_REGULAR].nextlast + 19) % CONTSAMPLE_LEN); + g_ContData[CONTDATA_REGULAR].nextsecondlast = ((g_ContData[CONTDATA_REGULAR].nextlast + (CONTSAMPLE_LEN - 1)) % CONTSAMPLE_LEN); g_ContCheckStatusTimer60++; if ((g_ContCheckStatusTimer60 % 120) == 0) @@ -486,12 +488,13 @@ void joyPoll(void) joyCheckStatus(); } - for (i = 0; i < MAXCONTROLLERS; i++) - { - if (((g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextlast].pads[i].errno == 0) && (g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextsecondlast].pads[i].errno != 0)) || - ((g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextlast].pads[i].errno != 0) && (g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextsecondlast].pads[i].errno == 0))) - { + for (i_s8 = 0; i_s8 < MAXCONTROLLERS; i_s8++) + { + if (((g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextlast].pads[i_s8].errno == 0) && (g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextsecondlast].pads[i_s8].errno != 0)) || + ((g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextlast].pads[i_s8].errno != 0) && (g_ContData[CONTDATA_REGULAR].samples[g_ContData[CONTDATA_REGULAR].nextsecondlast].pads[i_s8].errno == 0))) + { joyCheckStatus(); + break; } } @@ -503,7 +506,6 @@ void joyPoll(void) if (count >= 60) { - s32 i; for (i = 0; i < MAXCONTROLLERS; i++) { if (g_ContBadReadsStickX[i] || g_ContBadReadsStickY[i] || g_ContBadReadsButtons[i] || g_ContBadReadsButtonsPressed[i]) @@ -514,6 +516,7 @@ void joyPoll(void) g_ContBadReadsButtonsPressed[i] = 0; } } + count = 0; } } diff --git a/src/joy.h b/src/joy.h index 8ab69652..a73a2eb0 100644 --- a/src/joy.h +++ b/src/joy.h @@ -3,6 +3,12 @@ #include + +/** + * Number of samples in contdata. + */ +#define CONTSAMPLE_LEN 20 + struct contsample { OSContPad pads[MAXCONTROLLERS]; }; diff --git a/src/macro.h b/src/macro.h index 01e75bd1..e536f5ea 100644 --- a/src/macro.h +++ b/src/macro.h @@ -9,4 +9,12 @@ #define ALIGN64_V2(val) ((((u32)val) + 0x3f | 0x3f) ^ 0x3f) +/* +* Align to 16 bit boundary. Version "a", with preliminary addition. +*/ +#define ALIGN16_a(val) (((val) + 0xf | 0xf) ^ 0xf) + + +#define align_addr_even(X) (((X) | 1) ^ 1) + #endif diff --git a/src/mema.c b/src/mema.c index 2205673b..2bd3ef39 100644 --- a/src/mema.c +++ b/src/mema.c @@ -2,6 +2,32 @@ #include "mema.h" #include "deb.h" +/** + * mema - memory (ad hoc) allocation system. + * + * Mema's heap is 300KB and is itself allocated out of memp's stage pool. + * Memp resets its stage pool each time a new stage is loaded, which means mema + * is also reset each time a stage is loaded. + * + * Unlike memp, mema supports freeing of individual allocations. This makes it + * a good system to use when the allocation is somewhat temporary and should be + * freed without having to load a new stage. It's used by the (inaccessible) + * Perfect Head editor, file listings and room code. + * + * Mema tracks what has been allocated by storing references to free spaces in + * its spaces array. The allocations themselves are not referenced. When + * initialising the spaces array, the first element is set to the entire heap + * and the remaining elements are set to 0. + * + * This creates a bit of a terminology problem. Just remember that a memaspace + * is not an allocation; it's a free space that is available for allocation. + * + * Due to the ability to free individual allocations, both the heap and the + * spaces array can become fragmented. Mema supports defragmenting the spaces + * array: entries are ordered by address, and back to back entries are merged. + * The data in the heap itself is never moved, as that would require updating + * pointers throughout the game code which mema cannot do. + */ #if defined(VERSION_EU) #define ALLOCATIONS_LENGTH 125 @@ -9,13 +35,34 @@ #define ALLOCATIONS_LENGTH 509 #endif -s32 g_MemoryAllocationBuffer; -s32 g_MemoryAllocationBufferSize; -allocation g_MemoryAllocations[ALLOCATIONS_LENGTH+3]; +typedef struct memaspace { + s32 addr; + u32 size; +} memaspace; + +/** + * This structure contains dummy entries before and after the spaces array. + * These are used as start and end markers, but could have been avoided by + * using loop counters (eg. a typical i < numspaces loop). + */ +struct memaheap { + u32 unk000; + u32 unk004; + struct memaspace start; + //u32 unk010; + //u32 unk014; + struct memaspace spaces[ALLOCATIONS_LENGTH - 1]; + struct memaspace end1; + struct memaspace end2; +}; + +s32 g_MemaHeapStart; +s32 g_MemaHeapSize; +struct memaheap g_MemoryAllocations; void *g_MemoryAllocationDebugData = NULL; // Swap two allocations. -void memaSwap(allocation *a, allocation *b) { +void memaSwap(memaspace *a, memaspace *b) { u32 tempaddr = a->addr; u32 tempsize = a->size; a->addr = b->addr; @@ -25,7 +72,7 @@ void memaSwap(allocation *a, allocation *b) { } // Merge two allocations. -void memaMerge(allocation *a, allocation *b) { +void memaMerge(memaspace *a, memaspace *b) { a->size = (a->size + b->size); b->addr = 0; b->size = 0; @@ -34,12 +81,11 @@ void memaMerge(allocation *a, allocation *b) { // Do a single iteration over the allocations and attempt to // merge adjacent ones. Return value indicates if there were // any merges. -s32 memaIterateAndMergeInternal(allocation *allocations) { +s32 memaDefragPass(struct memaheap *heap) { s32 any = FALSE; - allocation *prev = &allocations[1]; - allocation *curr = &allocations[2]; - - allocation *last = &allocations[ALLOCATIONS_LENGTH]; + struct memaspace *prev = &heap->start; + struct memaspace *curr = &heap->spaces[0]; + struct memaspace *last = &heap->spaces[ALLOCATIONS_LENGTH - 2]; u32 addr = 0; while (curr <= last) { @@ -62,110 +108,152 @@ s32 memaIterateAndMergeInternal(allocation *allocations) { // Do multiple merge iterations until there are no // mergable pairs left. -void memaMergeAll(void) { - while (memaIterateAndMergeInternal(&g_MemoryAllocations)); +void memaDefrag(void) +{ + while (memaDefragPass(&g_MemoryAllocations)); } -// Loop through all allocations and attempt to find a free one. Alternatively, -// if two can be merged, then do that and use the leftover one. If none is found, -// then use the smallest allocation in the buffer. -allocation *memaSearch(allocation *allocations) { - allocation *curr = &allocations[2]; - allocation *best; +/** + * Defrag the spaces list in an attempt to free up any slot. + * + * If none can be found, return the smallest run of free space so it can be + * overwritten by the caller. + */ +memaspace *memaSearch(struct memaheap *heap) +{ + struct memaspace *curr = &heap->spaces[0]; + struct memaspace *best; + u32 min; s32 i; - for (i = 0; i < (ALLOCATIONS_LENGTH-1); i++) { - while (curr <= &allocations[ALLOCATIONS_LENGTH]) { + + // Do 124 passes over the list. This ensures the list is in order by the + // end. Though in most cases it's roughly in order anyway, and the excessive + // looping is just wasting CPU cycles. In reality this situation probably + // never occurs. + for (i = 0; i < (ALLOCATIONS_LENGTH - 1); i++) { + while (curr <= &heap->spaces[ALLOCATIONS_LENGTH - 2]) { if (curr->size == 0) { return curr; } + if ((u32)curr[1].addr < (u32)curr[0].addr) { memaSwap(&curr[0], &curr[1]); } + if (curr[1].addr == (curr[0].size + curr[0].addr)) { + // Found two that can be merged curr[0].size += curr[1].size; curr[1].addr = 0; curr[1].size = 0; return &curr[1]; } + curr++; } - curr = &allocations[2]; + + curr = &heap->spaces[0]; } + + // If this code is reached then the spaces list is so badly and unrepairably + // fragmented that we can't find any slot to record the free space in. + // Find the smallest run of free space and use that instead. + // The caller will overwrite it with its own free allocation, causing the + // original run of free space to be unusable until the mema heap is reset. min = 0xFFFFFFFF; best = curr; - while (curr <= &allocations[ALLOCATIONS_LENGTH]) { + while (curr <= &heap->spaces[ALLOCATIONS_LENGTH - 2]) { if (curr->size < min) { best = curr; min = curr->size; } + curr++; } + return best; } -// Register a new allocation. Start by calculating a suitable index to start search from -// based on the relative address in the buffer. Then look forward and backwards -// for a free allocation. If none is found, then use the more advanced memaSearch method. -void memaRegisterInternal(s32 addr, s32 size) { - s32 index = ((addr - g_MemoryAllocationBuffer) * (ALLOCATIONS_LENGTH-1)) / g_MemoryAllocationBufferSize; - allocation *curr = &g_MemoryAllocations[index + 2]; +void _memaFree(s32 addr, s32 size) +{ + // Choose an index in the spaces array which we'll mark a space as free, + // based on how far into the heap the allocation is. This is a rough + // estimate and doesn't need to be any particular index, but the defrag + // function tries to order the spaces by address so the closer we get to it + // the less work the defrag function will have to do should it be called. + s32 index = ((addr - g_MemaHeapStart) * (ALLOCATIONS_LENGTH-1)) / g_MemaHeapSize; + struct memaspace *curr = &g_MemoryAllocations.spaces[index]; + + // If the entry is taken, keep moving forward until a zero is found. while (curr->size != 0) { curr++; } + + // If we reached the end of the spaces list, go backwards instead if (curr->addr == -1) { - curr = &g_MemoryAllocations[index + 2]; + curr = &g_MemoryAllocations.spaces[index]; + while (curr->size != 0) { curr--; } + if (curr->addr == 0) { - curr = memaSearch(g_MemoryAllocations); + curr = memaSearch(&g_MemoryAllocations); } } + + // Mark this space as free curr->addr = addr; curr->size = size; } // Initialize the (removed) debug features. -void memaInit(void) { +void memaInit(void) +{ debTryAdd(&g_MemoryAllocationDebugData, "mema_c_debug"); } -// Initialize g_MemoryAllocations given a new buffer. The first -// and last two allocations serve as sentinels. -void memaSetBuffer(s32 buffer, s32 size) { - allocation *curr; - g_MemoryAllocations[0].addr = 0; - g_MemoryAllocations[0].size = 0; - g_MemoryAllocations[1].addr = 0; - g_MemoryAllocations[1].size = 0; - g_MemoryAllocations[ALLOCATIONS_LENGTH+1].addr = -1; - g_MemoryAllocations[ALLOCATIONS_LENGTH+1].size = 0; - g_MemoryAllocations[ALLOCATIONS_LENGTH+2].addr = -1; - g_MemoryAllocations[ALLOCATIONS_LENGTH+2].size = 0xFFFFFFFF; - for (curr = &g_MemoryAllocations[2]; curr <= &g_MemoryAllocations[ALLOCATIONS_LENGTH]; curr++) { - curr->addr = 0; - curr->size = 0; - } - g_MemoryAllocations[2].addr = g_MemoryAllocationBuffer = buffer; - g_MemoryAllocations[2].size = g_MemoryAllocationBufferSize = size; +void memaReset(void *heapaddr, u32 heapsize) +{ + struct memaspace *space; + + g_MemoryAllocations.unk000 = 0; + g_MemoryAllocations.unk004 = 0; + + g_MemoryAllocations.start.addr = 0; + g_MemoryAllocations.start.size = 0; + + g_MemoryAllocations.end1.addr = 0xffffffff; + g_MemoryAllocations.end1.size = 0; + g_MemoryAllocations.end2.addr = 0xffffffff; + g_MemoryAllocations.end2.size = 0xffffffff; + + for (space = &g_MemoryAllocations.spaces[0]; space <= &g_MemoryAllocations.spaces[ALLOCATIONS_LENGTH - 2]; space++) { + space->addr = 0; + space->size = 0; + } + + g_MemoryAllocations.spaces[0].addr = g_MemaHeapStart = (uintptr_t) heapaddr; + g_MemoryAllocations.spaces[0].size = g_MemaHeapSize = heapsize; } -void memaIterateAndMerge(void) { - memaIterateAndMergeInternal(&g_MemoryAllocations); +void memaSingleDefragPass(void) +{ + memaDefragPass(&g_MemoryAllocations); } + #ifdef NONMATCHING // Attempt to free up some memory. Start by looking through the first 16 allocations // for a suitable one. If none is found, then look through the rest for any that are // large enough. If this also fails, then do 8 merge iterations and then look through // entire buffer again. If successful, return the address to the freed memory, otherwise 0. -s32 memaFree(u32 amount) { +s32 memaAlloc(u32 amount) { s32 addr; u32 diff; s32 i; - allocation *curr = &g_MemoryAllocations[2]; - allocation *best = NULL; + memaspace *curr = &g_MemoryAllocations[2]; + memaspace *best = NULL; for (i = 0; i < 16; i++, curr++) { if (curr->size >= amount) { if (curr->addr == -1) { @@ -186,7 +274,7 @@ s32 memaFree(u32 amount) { } if (curr->addr == -1) { for (i = 0; i < 8; i++) { - memaIterateAndMergeInternal(g_MemoryAllocations); + memaDefragPass(g_MemoryAllocations); } curr = &g_MemoryAllocations[2]; while (curr->size < amount) { @@ -208,7 +296,7 @@ s32 memaFree(u32 amount) { #else GLOBAL_ASM( .text -glabel memaFree +glabel memaAlloc /* 00AA34 70009E34 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 00AA38 70009E38 AFB2001C */ sw $s2, 0x1c($sp) /* 00AA3C 70009E3C AFB10018 */ sw $s1, 0x18($sp) @@ -270,7 +358,7 @@ glabel memaFree /* 00AB08 70009F08 3C118006 */ lui $s1, %hi(g_MemoryAllocations + 0x10) /* 00AB0C 70009F0C 26313C38 */ addiu $s1, %lo(g_MemoryAllocations + 0x10) # addiu $s1, $s1, 0x3c38 .L70009F10: -/* 00AB10 70009F10 0C002694 */ jal memaIterateAndMergeInternal +/* 00AB10 70009F10 0C002694 */ jal memaDefragPass /* 00AB14 70009F14 02602025 */ move $a0, $s3 /* 00AB18 70009F18 26100001 */ addiu $s0, $s0, 1 /* 00AB1C 70009F1C 1614FFFC */ bne $s0, $s4, .L70009F10 @@ -317,31 +405,45 @@ glabel memaFree ) #endif + #ifdef NONMATCHING -// Find the allocation of the given address and reduce its size by the given +// Find the memaspace of the given address and reduce its size by the given // amount. If successful, return the same address, otherwise 0. -s32 memaShrink(s32 addr, u32 amount) { - allocation *curr = &g_MemoryAllocations[2]; - while (curr->addr != -1) { - if ((curr->addr == addr) && (curr->size >= amount)) { - break; - } - curr++; - if (curr->addr == -1) { - return 0; + +// Only regalloc problems left. Called memaGrow in PD + +// https://decomp.me/scratch/tGfms 93.83% +s32 memaGrow(s32 addr, u32 amount) +{ + memaspace *curr = &g_MemoryAllocations[2]; + + while (curr->addr != -1) + { + if (curr->addr == addr && curr->size >= amount) + { + goto found; } + + curr++; } + + return 0; + +found: curr->addr += amount; curr->size -= amount; - if (curr->size == 0) { + + if (curr->size == 0) + { curr->addr = 0; } + return addr; } #else GLOBAL_ASM( .text -glabel memaShrink +glabel memaGrow /* 00ABA8 70009FA8 3C198006 */ lui $t9, %hi(g_MemoryAllocations + 0x10) /* 00ABAC 70009FAC 8F393C38 */ lw $t9, %lo(g_MemoryAllocations + 0x10)($t9) /* 00ABB0 70009FB0 3C188006 */ lui $t8, %hi(g_MemoryAllocations + 0x10) @@ -381,61 +483,35 @@ glabel memaShrink ) #endif -void memaRegister(u32 addr, u32 size) { - memaRegisterInternal(addr, size); +void memaFree(void *addr, s32 size) +{ + _memaFree((uintptr_t) addr, size); } -#ifdef NONMATCHING -// ac54: bnel v1,v0,0xac54 ~> r ac54: bnel v0,v1,0xac54 ~> -void mema7000A040(void) { + +void mema7000A040(void) +{ s32 i; - for (i = 0; &g_MemoryAllocations[i] != &g_MemoryAllocations[ALLOCATIONS_LENGTH-1]; i += 4) { - // Removed + struct memaspace *curr; + + for (i=0; iaddr) + { + // removed + } } } -#else - -#if defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel mema7000A040 -/* 00AC40 7000A040 3C038006 */ lui $v1, %hi(g_MemoryAllocations) -/* 00AC44 7000A044 3C028006 */ lui $v0, %hi(g_MemoryAllocations + 0xFE0) -/* 00AC48 7000A048 24424C08 */ addiu $v0, %lo(g_MemoryAllocations + 0xFE0) # addiu $v0, $v0, 0x4c08 -/* 00AC4C 7000A04C 24633C28 */ addiu $v1, %lo(g_MemoryAllocations) # addiu $v1, $v1, 0x3c28 -/* 00AC50 7000A050 24630020 */ addiu $v1, $v1, 0x20 -.L7000A054: -/* 00AC54 7000A054 5462FFFF */ bnel $v1, $v0, .L7000A054 -/* 00AC58 7000A058 24630020 */ addiu $v1, $v1, 0x20 -/* 00AC5C 7000A05C 03E00008 */ jr $ra -/* 00AC60 7000A060 00000000 */ nop -) -#endif -#if !defined(LEFTOVERDEBUG) -GLOBAL_ASM( -.text -glabel mema7000A040 -/* 00A0A0 700094A0 3C038005 */ lui $v1, %hi(g_MemoryAllocations) # $v1, 0x8005 -/* 00A0A4 700094A4 3C028005 */ lui $v0, %hi(g_MemoryAllocations + 0x3E0) # $v0, 0x8005 -/* 00A0A8 700094A8 244271E8 */ addiu $v0, %lo(g_MemoryAllocations + 0x3E0) # addiu $v0, $v0, 0x71e8 -/* 00A0AC 700094AC 24636E08 */ addiu $v1, %lo(g_MemoryAllocations) # addiu $v1, $v1, 0x6e08 -/* 00A0B0 700094B0 24630020 */ addiu $v1, $v1, 0x20 -.L700094B4: -/* 00A0B4 700094B4 5462FFFF */ bnel $v1, $v0, .L700094B4 -/* 00A0B8 700094B8 24630020 */ addiu $v1, $v1, 0x20 -/* 00A0BC 700094BC 03E00008 */ jr $ra -/* 00A0C0 700094C0 00000000 */ nop -) -#endif -#endif // Calculate the ratio between the sum of all allocations minus // the largest one, and the sum of all allocations. f32 memaCalculateNonLargestToTotalRatio(void) { u32 tot = 0; u32 max = 0; - allocation *curr = &g_MemoryAllocations[2]; + memaspace *curr = &g_MemoryAllocations.spaces[0]; while (curr->addr != -1) { tot += curr->size; if (max < curr->size) { @@ -449,178 +525,70 @@ f32 memaCalculateNonLargestToTotalRatio(void) { return ((f32)(tot - max) / tot); } -#ifdef NONMATCHING // Print a list of allocations, in descending size order. Sizes are specified in // kilobytes, rounded to nearest integer. Up to 200 allocations can be listed. -void memaDump(void) { - const char buffer[4096]; - const char *pos; - s32 count = 0; +void memaDump(void) +{ + char *pos; u32 tot = 0; s32 lim = (1 << 31); - allocation *curr = &g_MemoryAllocations[2]; - while (curr->addr != -1) { + s32 count; + memaspace *curr; + char buffer[4096]; + u32 max; + u32 acc; + + count = 0; + + for (curr = &g_MemoryAllocations.spaces[0], tot = 0; curr->addr != -1; curr++) + { tot += curr->size; - curr++; } + pos = buffer; - while (TRUE) { - u32 max = 0; - u32 acc = 0; - curr = &g_MemoryAllocations[2]; - while (curr->addr != -1) { - if ((curr->size < lim) && (curr->size > max)) { + + for (max = 0, acc = 0; 1; lim = max, max = 0) + { + for (curr = &g_MemoryAllocations.spaces[0]; curr->addr != -1; curr++) + { + if ((curr->size < lim) && (curr->size > max)) + { max = curr->size; acc++; } - curr++; } - if (acc == 0) { + + if (acc == 0) + { break; } - curr = &g_MemoryAllocations[2]; - while (curr->addr != -1) { - if (curr->size == max) { - if (count < 200) { + + + lim = max; + + for (curr = &g_MemoryAllocations.spaces[0],acc=0; curr->addr != -1; curr++) + { + if (curr->size == lim) + { + if (count < 200) + { pos += sprintf(pos, "%d ", ((curr->size + 512) / 1024)); - } else if (count == 200) { + } + else if (count == 200) + { pos += sprintf(pos, "..."); } + count++; } - curr++; } } - if (count > 200) { + + if (count > 200) + { sprintf(pos, "[%d]", count); } } -#else -const char aD_3[] = "%d "; -const char a___[] = "..."; -const char aD_5[] = "[%d]"; -GLOBAL_ASM( -.text -glabel memaDump -/* 00AD00 7000A100 27BDEF98 */ addiu $sp, $sp, -0x1068 -/* 00AD04 7000A104 3C048006 */ lui $a0, %hi(g_MemoryAllocations + 0x10) -/* 00AD08 7000A108 8C843C38 */ lw $a0, %lo(g_MemoryAllocations + 0x10)($a0) -/* 00AD0C 7000A10C AFB5002C */ sw $s5, 0x2c($sp) -/* 00AD10 7000A110 AFB00018 */ sw $s0, 0x18($sp) -/* 00AD14 7000A114 2415FFFF */ li $s5, -1 -/* 00AD18 7000A118 AFB20020 */ sw $s2, 0x20($sp) -/* 00AD1C 7000A11C 3C108006 */ lui $s0, %hi(g_MemoryAllocations + 0x10) -/* 00AD20 7000A120 AFBF003C */ sw $ra, 0x3c($sp) -/* 00AD24 7000A124 AFBE0038 */ sw $fp, 0x38($sp) -/* 00AD28 7000A128 AFB70034 */ sw $s7, 0x34($sp) -/* 00AD2C 7000A12C AFB60030 */ sw $s6, 0x30($sp) -/* 00AD30 7000A130 AFB40028 */ sw $s4, 0x28($sp) -/* 00AD34 7000A134 AFB30024 */ sw $s3, 0x24($sp) -/* 00AD38 7000A138 AFB1001C */ sw $s1, 0x1c($sp) -/* 00AD3C 7000A13C 3C038000 */ lui $v1, 0x8000 -/* 00AD40 7000A140 00009025 */ move $s2, $zero -/* 00AD44 7000A144 26103C38 */ addiu $s0, %lo(g_MemoryAllocations + 0x10) # addiu $s0, $s0, 0x3c38 -/* 00AD48 7000A148 12A40008 */ beq $s5, $a0, .L7000A16C -/* 00AD4C 7000A14C 00001025 */ move $v0, $zero -.L7000A150: -/* 00AD50 7000A150 8E0F0008 */ lw $t7, 8($s0) -/* 00AD54 7000A154 8E0E0004 */ lw $t6, 4($s0) -/* 00AD58 7000A158 26100008 */ addiu $s0, $s0, 8 -/* 00AD5C 7000A15C 16AFFFFC */ bne $s5, $t7, .L7000A150 -/* 00AD60 7000A160 004E1021 */ addu $v0, $v0, $t6 -/* 00AD64 7000A164 3C108006 */ lui $s0, %hi(g_MemoryAllocations + 0x10) -/* 00AD68 7000A168 26103C38 */ addiu $s0, %lo(g_MemoryAllocations + 0x10) # addiu $s0, $s0, 0x3c38 -.L7000A16C: -/* 00AD6C 7000A16C 3C1E8003 */ lui $fp, %hi(a___) -/* 00AD70 7000A170 3C168003 */ lui $s6, %hi(aD_3) -/* 00AD74 7000A174 27B10054 */ addiu $s1, $sp, 0x54 -/* 00AD78 7000A178 26D691E0 */ addiu $s6, %lo(aD_3) # addiu $s6, $s6, -0x6e20 -/* 00AD7C 7000A17C 27DE91E4 */ addiu $fp, %lo(a___) # addiu $fp, $fp, -0x6e1c -/* 00AD80 7000A180 00009825 */ move $s3, $zero -/* 00AD84 7000A184 0000A025 */ move $s4, $zero -/* 00AD88 7000A188 241700C8 */ li $s7, 200 -.L7000A18C: -/* 00AD8C 7000A18C 12A4000D */ beq $s5, $a0, .L7000A1C4 -/* 00AD90 7000A190 00000000 */ nop -/* 00AD94 7000A194 8E020004 */ lw $v0, 4($s0) -.L7000A198: -/* 00AD98 7000A198 0043082B */ sltu $at, $v0, $v1 -/* 00AD9C 7000A19C 10200005 */ beqz $at, .L7000A1B4 -/* 00ADA0 7000A1A0 0262082B */ sltu $at, $s3, $v0 -/* 00ADA4 7000A1A4 50200004 */ beql $at, $zero, .L7000A1B8 -/* 00ADA8 7000A1A8 8E180008 */ lw $t8, 8($s0) -/* 00ADAC 7000A1AC 00409825 */ move $s3, $v0 -/* 00ADB0 7000A1B0 26940001 */ addiu $s4, $s4, 1 -.L7000A1B4: -/* 00ADB4 7000A1B4 8E180008 */ lw $t8, 8($s0) -.L7000A1B8: -/* 00ADB8 7000A1B8 26100008 */ addiu $s0, $s0, 8 -/* 00ADBC 7000A1BC 56B8FFF6 */ bnel $s5, $t8, .L7000A198 -/* 00ADC0 7000A1C0 8E020004 */ lw $v0, 4($s0) -.L7000A1C4: -/* 00ADC4 7000A1C4 12800022 */ beqz $s4, .L7000A250 -/* 00ADC8 7000A1C8 3C108006 */ lui $s0, %hi(g_MemoryAllocations + 0x10) -/* 00ADCC 7000A1CC 26103C38 */ addiu $s0, %lo(g_MemoryAllocations + 0x10) # addiu $s0, $s0, 0x3c38 -/* 00ADD0 7000A1D0 12A4001C */ beq $s5, $a0, .L7000A244 -/* 00ADD4 7000A1D4 0000A025 */ move $s4, $zero -/* 00ADD8 7000A1D8 8E020004 */ lw $v0, 4($s0) -.L7000A1DC: -/* 00ADDC 7000A1DC 2A4100C8 */ slti $at, $s2, 0xc8 -/* 00ADE0 7000A1E0 56620011 */ bnel $s3, $v0, .L7000A228 -/* 00ADE4 7000A1E4 8E080008 */ lw $t0, 8($s0) -/* 00ADE8 7000A1E8 10200008 */ beqz $at, .L7000A20C -/* 00ADEC 7000A1EC 02202025 */ move $a0, $s1 -/* 00ADF0 7000A1F0 24460200 */ addiu $a2, $v0, 0x200 -/* 00ADF4 7000A1F4 0006CA82 */ srl $t9, $a2, 0xa -/* 00ADF8 7000A1F8 03203025 */ move $a2, $t9 -/* 00ADFC 7000A1FC 0C002B25 */ jal sprintf -/* 00AE00 7000A200 02C02825 */ move $a1, $s6 -/* 00AE04 7000A204 10000006 */ b .L7000A220 -/* 00AE08 7000A208 02228821 */ addu $s1, $s1, $v0 -.L7000A20C: -/* 00AE0C 7000A20C 16570004 */ bne $s2, $s7, .L7000A220 -/* 00AE10 7000A210 02202025 */ move $a0, $s1 -/* 00AE14 7000A214 0C002B25 */ jal sprintf -/* 00AE18 7000A218 03C02825 */ move $a1, $fp -/* 00AE1C 7000A21C 02228821 */ addu $s1, $s1, $v0 -.L7000A220: -/* 00AE20 7000A220 26520001 */ addiu $s2, $s2, 1 -/* 00AE24 7000A224 8E080008 */ lw $t0, 8($s0) -.L7000A228: -/* 00AE28 7000A228 26100008 */ addiu $s0, $s0, 8 -/* 00AE2C 7000A22C 56A8FFEB */ bnel $s5, $t0, .L7000A1DC -/* 00AE30 7000A230 8E020004 */ lw $v0, 4($s0) -/* 00AE34 7000A234 3C108006 */ lui $s0, %hi(g_MemoryAllocations + 0x10) -/* 00AE38 7000A238 3C048006 */ lui $a0, %hi(g_MemoryAllocations + 0x10) -/* 00AE3C 7000A23C 8C843C38 */ lw $a0, %lo(g_MemoryAllocations + 0x10)($a0) -/* 00AE40 7000A240 26103C38 */ addiu $s0, %lo(g_MemoryAllocations + 0x10) # addiu $s0, $s0, 0x3c38 -.L7000A244: -/* 00AE44 7000A244 02601825 */ move $v1, $s3 -/* 00AE48 7000A248 1000FFD0 */ b .L7000A18C -/* 00AE4C 7000A24C 00009825 */ move $s3, $zero -.L7000A250: -/* 00AE50 7000A250 2A4100C9 */ slti $at, $s2, 0xc9 -/* 00AE54 7000A254 14200005 */ bnez $at, .L7000A26C -/* 00AE58 7000A258 02202025 */ move $a0, $s1 -/* 00AE5C 7000A25C 3C058003 */ lui $a1, %hi(aD_5) -/* 00AE60 7000A260 24A591E8 */ addiu $a1, %lo(aD_5) # addiu $a1, $a1, -0x6e18 -/* 00AE64 7000A264 0C002B25 */ jal sprintf -/* 00AE68 7000A268 02403025 */ move $a2, $s2 -.L7000A26C: -/* 00AE6C 7000A26C 8FBF003C */ lw $ra, 0x3c($sp) -/* 00AE70 7000A270 8FB00018 */ lw $s0, 0x18($sp) -/* 00AE74 7000A274 8FB1001C */ lw $s1, 0x1c($sp) -/* 00AE78 7000A278 8FB20020 */ lw $s2, 0x20($sp) -/* 00AE7C 7000A27C 8FB30024 */ lw $s3, 0x24($sp) -/* 00AE80 7000A280 8FB40028 */ lw $s4, 0x28($sp) -/* 00AE84 7000A284 8FB5002C */ lw $s5, 0x2c($sp) -/* 00AE88 7000A288 8FB60030 */ lw $s6, 0x30($sp) -/* 00AE8C 7000A28C 8FB70034 */ lw $s7, 0x34($sp) -/* 00AE90 7000A290 8FBE0038 */ lw $fp, 0x38($sp) -/* 00AE94 7000A294 03E00008 */ jr $ra -/* 00AE98 7000A298 27BD1068 */ addiu $sp, $sp, 0x1068 -) -#endif // Dump a list of allocations before and after a full // merge pass. @@ -628,89 +596,89 @@ void memaDumpPrePostMerge(void) { s32 i; memaDump(); for (i = 0; i < (ALLOCATIONS_LENGTH-1); i++) { - memaIterateAndMergeInternal(&g_MemoryAllocations); + memaDefragPass(&g_MemoryAllocations); } memaDump(); } -void mema7000A2F8(void (*func)(u32, allocation*)) { - allocation *curr = &g_MemoryAllocations[2]; +void mema7000A2F8(void (*func)(u32, memaspace*)) { + memaspace *curr = &g_MemoryAllocations.spaces[0]; while (curr->addr != -1) { func((curr->addr + curr->size), curr); curr++; } } -// Return the size of the largest allocation, after -// a full merge pass. -u32 memaGetLargestAllocSize(void) { - allocation *curr; - u32 max = 0; - memaMergeAll(); - curr = &g_MemoryAllocations[2]; - while (curr->addr != -1) { - if (max < curr->size) { - max = curr->size; - } - curr++; - } - if (max != 0) { - return max; - } - return 0; +/** + * Find and return the largest amount of contiguous free space in the pool. + * ie. the biggest allocation that mema can currently make. + */ +s32 memaGetLongestFree(void) +{ + struct memaspace *curr; + s32 biggest = 0; + + memaDefrag(); + + curr = &g_MemoryAllocations.spaces[0]; + + while (curr->addr != -1) { + if (curr->size > biggest) { + biggest = curr->size; + } + + curr++; + } + + if (biggest) { + return biggest; + } + + return 0; } -#ifdef NONMATCHING -// Resize an existing allocation. Either by shrinking the old one, or -// by registering a new allocation containing the remaining bytes. -s32 memaResize(s32 addr, u32 newsize, u32 oldsize) { - if (newsize < oldsize) { - if (memaShrink((addr + newsize), (oldsize - newsize)) == 0) { - return 0; - } else { +/** + * Resize an existing memaspace. Either by shrinking the old one, or + * by registering a new memaspace containing the remaining bytes. + * + * US address 7000A3DC. +*/ +s32 memaRealloc(s32 addr, u32 oldsize, u32 newsize) +{ + if ((newsize > oldsize)) + { + if (memaGrow(addr + oldsize, newsize - oldsize) == 0) + { + return 0; + } + else + { return 1; } + } + + /** + * Hack: the following few `if` statements are probably not what was originally + * here, but it shifts the temp registers enough to generate a match. + * https://decomp.me/scratch/RoPAF 99.62% + */ + + if (addr + 1) {} + else if (addr + 2) {} + else if (addr + 3) {} + + if (oldsize + 1) {} + else if (oldsize + 2) {} + else if (oldsize + 3) {} + + if (newsize + 1) {} + else if (newsize + 2) {} + else if (newsize + 3) {} + + if ((oldsize > newsize)) + { + memaFree(addr + newsize, oldsize - newsize); } - else { - if (newsize > oldsize) { - memaRegister((addr + oldsize), (newsize - oldsize)); - } - return 1; - } -} -#else -GLOBAL_ASM( -.text -glabel memaResize -/* 00AFDC 7000A3DC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 00AFE0 7000A3E0 00A6082B */ sltu $at, $a1, $a2 -/* 00AFE4 7000A3E4 AFBF0014 */ sw $ra, 0x14($sp) -/* 00AFE8 7000A3E8 AFA40018 */ sw $a0, 0x18($sp) -/* 00AFEC 7000A3EC 1020000A */ beqz $at, .L7000A418 -/* 00AFF0 7000A3F0 00A03825 */ move $a3, $a1 -/* 00AFF4 7000A3F4 00852021 */ addu $a0, $a0, $a1 -/* 00AFF8 7000A3F8 0C0027EA */ jal memaShrink -/* 00AFFC 7000A3FC 00C52823 */ subu $a1, $a2, $a1 -/* 00B000 7000A400 14400003 */ bnez $v0, .L7000A410 -/* 00B004 7000A404 00000000 */ nop -/* 00B008 7000A408 1000000A */ b .L7000A434 -/* 00B00C 7000A40C 00001025 */ move $v0, $zero -.L7000A410: -/* 00B010 7000A410 10000008 */ b .L7000A434 -/* 00B014 7000A414 24020001 */ li $v0, 1 -.L7000A418: -/* 00B018 7000A418 00C7082B */ sltu $at, $a2, $a3 -/* 00B01C 7000A41C 10200004 */ beqz $at, .L7000A430 -/* 00B020 7000A420 8FA90018 */ lw $t1, 0x18($sp) -/* 00B024 7000A424 01262021 */ addu $a0, $t1, $a2 -/* 00B028 7000A428 0C002808 */ jal memaRegister -/* 00B02C 7000A42C 00E62823 */ subu $a1, $a3, $a2 -.L7000A430: -/* 00B030 7000A430 24020001 */ li $v0, 1 -.L7000A434: -/* 00B034 7000A434 8FBF0014 */ lw $ra, 0x14($sp) -/* 00B038 7000A438 27BD0018 */ addiu $sp, $sp, 0x18 -/* 00B03C 7000A43C 03E00008 */ jr $ra -/* 00B040 7000A440 00000000 */ nop -) -#endif + + return 1; +} \ No newline at end of file diff --git a/src/mema.h b/src/mema.h index 4d3d16a5..99399942 100644 --- a/src/mema.h +++ b/src/mema.h @@ -3,18 +3,13 @@ #include -typedef struct allocation { - s32 addr; - u32 size; -} allocation; - void memaInit(void); -void memaSetBuffer(s32 buffer, s32 size); -void memaIterateAndMerge(void); -s32 memaFree(u32 size); -void memaRegister(u32 addr, u32 size); +void memaReset(void *heapaddr, u32 heapsize); +void memaSingleDefragPass(void); +s32 memaAlloc(u32 size); +void memaFree(void *addr, s32 size); void memaDumpPrePostMerge(void); -u32 memaGetLargestAllocSize(void); -s32 memaResize(s32 addr, u32 newsize, u32 oldsize); +s32 memaGetLongestFree(void); +s32 memaRealloc(s32 addr, u32 newsize, u32 oldsize); #endif diff --git a/src/memp.c b/src/memp.c index 2f02968a..66348a63 100644 --- a/src/memp.c +++ b/src/memp.c @@ -29,7 +29,7 @@ struct s_mempMVALS sdefaultmvals = { 0, 0x00 }; -void mempInitDebugNoticeList(void) +void mempInit(void) { debTryAdd(&ptr_memp_c_debug_debug_notice_list, "memp_c_debug"); } @@ -229,6 +229,7 @@ glabel mempAllocBytesInBank #ifdef NONMATCHING // Mostly regalloc +// https://decomp.me/scratch/IkY1t 98.98% s32 mempAddEntryOfSizeToBank(u8* ptrdata, u32 newsize, u8 bank) { s32 oldsize; diff --git a/src/memp.h b/src/memp.h index caced78e..02a42354 100644 --- a/src/memp.h +++ b/src/memp.h @@ -38,7 +38,7 @@ enum MEMPOOL MEMPOOL_7 }; -void mempInitDebugNoticeList(void); +void mempInit(void); void mempCheckMemflagTokens(int bstart,int bsize); void mempSetBankStarts(s32 banks[8]); void *mempAllocBytesInBank(u32 bytes,u8 bank); diff --git a/src/music.c b/src/music.c index 78a498fc..417aa38b 100644 --- a/src/music.c +++ b/src/music.c @@ -9,6 +9,7 @@ #include "music.h" #include "ramrom.h" #include "snd.h" +#include /** * EU .data, offset from start of data_seg : 0x3570 diff --git a/src/ramrom.c b/src/ramrom.c index cb45b80e..6e91dd8d 100644 --- a/src/ramrom.c +++ b/src/ramrom.c @@ -1,13 +1,12 @@ #include #include "ramrom.h" +#include /** * @file ramrom.c * This file contains code to handle reading and writing rom addresses. */ -#define align_addr_zero(X) ((((X) + 0xF) | 0xF) ^ 0xF) -#define align_addr_even(X) (((X) | 1) ^ 1) OSIoMesg memoryMesgMB; OSMesg memoryMesg; @@ -19,7 +18,8 @@ OSMesgQueue memoryMesgQueue; * romCreateMesgQueue * creates a message queue */ -void romCreateMesgQueue(void) { +void romCreateMesgQueue(void) +{ osCreateMesgQueue(&memoryMesgQueue, &memoryMesg, 1); } @@ -28,7 +28,8 @@ void romCreateMesgQueue(void) { * doRomCopy * invalidate cache and do pi dma */ -void doRomCopy(void *target, void *source, u32 size) { +void doRomCopy(void *target, void *source, u32 size) +{ osInvalDCache(target, size); osPiStartDma(&memoryMesgMB, 0, 0, source, target, size, &memoryMesgQueue); } @@ -38,7 +39,8 @@ void doRomCopy(void *target, void *source, u32 size) { * romReceiveMesg * receives a message queue */ -void romReceiveMesg(void) { +void romReceiveMesg(void) +{ osRecvMesg(&memoryMesgQueue, 0, 1); } @@ -48,7 +50,8 @@ void romReceiveMesg(void) { * romCopy * copy from rom to ram */ -void romCopy(void *target, void *source, u32 size) { +void romCopy(void *target, void *source, u32 size) +{ doRomCopy(target, source, size); romReceiveMesg(); } @@ -59,7 +62,8 @@ void romCopy(void *target, void *source, u32 size) { * romCopyAligned * aligns data, does a romCopy(), then returns aligned pointer to target */ -s32 romCopyAligned(void *target, void *source, s32 length) { +s32 romCopyAligned(void *target, void *source, s32 length) +{ s32 target_offset; s32 *target_aligned; s32 *source_aligned; @@ -67,9 +71,9 @@ s32 romCopyAligned(void *target, void *source, s32 length) { source_aligned = align_addr_even((s32)source); source_offset = (s32)source - (s32)source_aligned; - target_aligned = align_addr_zero((s32)target); + target_aligned = ALIGN16_a((s32)target); target_offset = source_offset; - romCopy(target_aligned, source_aligned, align_addr_zero((s32)source_offset + length)); + romCopy(target_aligned, source_aligned, ALIGN16_a((s32)source_offset + length)); return ((s32)target_aligned + target_offset); } @@ -78,7 +82,8 @@ s32 romCopyAligned(void *target, void *source, s32 length) { * doRomWrite * actually writes to rom (buffer on Indy) */ -void doRomWrite(void *source, void *target, u32 size) { +void doRomWrite(void *source, void *target, u32 size) +{ osWritebackDCache(source, size); osPiStartDma(&memoryMesgMB, 0, 1, target, source, size, &memoryMesgQueue); } @@ -89,7 +94,8 @@ void doRomWrite(void *source, void *target, u32 size) { * romWrite * let's write to the rom (buffer on Indy) */ -void romWrite(void *source, void *target, u32 size) { +void romWrite(void *source, void *target, u32 size) +{ doRomWrite(source, target, size); romReceiveMesg(); } diff --git a/src/random.h b/src/random.h index 104b790d..232add96 100644 --- a/src/random.h +++ b/src/random.h @@ -6,4 +6,7 @@ void randomSetSeed(u32 param_1); u32 randomGetNext(void); u32 randomGetNextFrom(u64 *param_1); +// 4294967295 == UINT_MAX +#define RANDOMGETNEXT_F32() ((f32) (u32)randomGetNext() * (1.0f / 4294967295)) + #endif diff --git a/src/rmon.c b/src/rmon.c index 8f8f6a44..1f8ad1ca 100644 --- a/src/rmon.c +++ b/src/rmon.c @@ -138,7 +138,7 @@ void osWriteHost(void * buffer, u32 size) if (size); #ifdef ENABLE_USB //flesh out a proper ge parser on pc app - //usb_write(DATATYPE_RAWBINARY , buffer, size); + usb_write(DATATYPE_RMONBINARY , buffer, size); #endif } @@ -150,12 +150,41 @@ void osWriteHost(void * buffer, u32 size) */ void osReadHost(void * buffer, u32 size) { +#ifdef ENABLE_USB + char incoming_type = 0; + int incoming_size = 0; +#endif if (buffer); if (size); - #ifdef ENABLE_USB +#ifdef ENABLE_USB //flesh out a proper pc side tool still - //usb_read(buffer, size); - #endif + osSyncPrintf("USB: Waiting for data\n"); + while(1) + { + // Check if there's data in USB + // Needs to be a while loop because we can't write to USB if there's data that needs to be read first + while (usb_poll() != 0) + { + int header = usb_poll(); + // Store the size and type from the header + incoming_type = USBHEADER_GETTYPE(header); + incoming_size = USBHEADER_GETSIZE(header); + osSyncPrintf("USB: Received header %d\n", incoming_type); + osSyncPrintf("USB: Received size %d\n", incoming_size); + // Ensure we're receiving a text command + if (incoming_type != DATATYPE_RMONBINARY) + { + //errortype = 1; + usb_purge(); + osSyncPrintf("USB: Received invalid type %d\n", incoming_type); + return; + } + osSyncPrintf("USB: Read data\n"); + usb_read(buffer, size); + return; + } + } +#endif } diff --git a/src/sched.c b/src/sched.c index 2b280675..2daa25b6 100644 --- a/src/sched.c +++ b/src/sched.c @@ -166,7 +166,7 @@ void osCreateScheduler (OSSched * sc, void * stack, u8 mode, u32 numFields) sc->audioListTail = 0; sc->gfxListTail = 0; sc->retraceMsg.type = OS_SC_RETRACE_MSG; - sc->prenmiMsg.type = 5; // OS_SC_PRE_NMI_MSG + sc->prenmiMsg.type = OS_SC_PRE_NMI_MSG; sc->thread = stack; osCreateMesgQueue(&sc->interruptQ, sc->intBuf, OS_SC_MAX_MESGS); osCreateMesgQueue(&sc->cmdQ, sc->cmdMsgBuf, OS_SC_MAX_MESGS); @@ -180,7 +180,7 @@ void osCreateScheduler (OSSched * sc, void * stack, u8 mode, u32 numFields) osSetEventMesg(OS_EVENT_PRENMI, &sc->interruptQ, (OSMesg)PRE_NMI_MSG); osViSetEvent(&sc->interruptQ, (OSMesg)VIDEO_MSG, numFields); osCreateLog(); - osCreateThread(sc->thread, SCHED_THREAD_ID, &__scMain, sc, set_stack_entry(&sp_shed, 0x200), SCHED_THREAD_PRIORITY); + osCreateThread(sc->thread, SCHED_THREAD_ID, &__scMain, sc, setSPToEnd(&sp_shed, sizeof(sp_shed)), SCHED_THREAD_PRIORITY); osStartThread(sc->thread); } diff --git a/src/sched.h b/src/sched.h index fee85aeb..d18c0a1a 100644 --- a/src/sched.h +++ b/src/sched.h @@ -8,8 +8,9 @@ #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 #define OS_SC_RDP_DONE_MSG 3 -#define OS_SC_PRE_NMI_MSG 4 -#define OS_SC_LAST_MSG 4 /* this should have highest number */ +#define OS_SC_RSP_MSG 4 // custom - tells audiomgr it's time to do an audio frame +#define OS_SC_PRE_NMI_MSG 5 +#define OS_SC_LAST_MSG 5 /* this should have highest number */ #define OS_SC_MAX_MESGS 8 typedef struct { diff --git a/src/snd.c b/src/snd.c index 7c9e28ad..2091f4b5 100644 --- a/src/snd.c +++ b/src/snd.c @@ -266,6 +266,7 @@ ALMicroTime sndPlayerVoiceHandler(void *node) * to make a difference, it's present in sndplayer.c _handleEvent ... */ #ifdef NONMATCHING +// https://decomp.me/scratch/2v3fu 97.63% void sndHandleEvent(ALSndPlayer *sndp, ALSndpEvent *event) { // declarations diff --git a/src/thread_config.h b/src/thread_config.h index 34df3cad..b4009280 100644 --- a/src/thread_config.h +++ b/src/thread_config.h @@ -23,4 +23,6 @@ #define RMON_THREAD_PRIORITY (OSPri)250 #endif +#define STACKSIZE_MAIN 0x8000 + #endif diff --git a/src/tlb_hardwire.h b/src/tlb_hardwire.h index e0e17345..8574412d 100644 --- a/src/tlb_hardwire.h +++ b/src/tlb_hardwire.h @@ -3,7 +3,7 @@ #include -extern void set_hardwire_TLB_to_2(void); +extern void initTLBPrepareContext(void); #endif diff --git a/src/tlb_hardwire.s b/src/tlb_hardwire.s index c77d5c2d..720bfedf 100644 --- a/src/tlb_hardwire.s +++ b/src/tlb_hardwire.s @@ -3,18 +3,25 @@ .set noreorder # don't insert nops after branches .set gp=64 +#include "regdef.h" +#include "asm.h" +#include + .include "macros.inc" .section .text, "ax" + /** * 29B0 70001BB0 - * sets hardwired TLB entries to 2 + * initTLBPrepareContext + * C0_WIRED: If set 2 or 3, TLB entries can be wired downwards + * C0_CONTEXT: If 0 then exceptions cause the virtual address to be written in the context */ -glabel set_hardwire_TLB_to_2 +glabel initTLBPrepareContext /* 0027B0 70001BB0 24080002 */ li $t0, 2 -/* 0027B4 70001BB4 40883000 */ mtc0 $t0, $6 +/* 0027B4 70001BB4 40883000 */ mtc0 $t0, $6 #C0_WIRED /* 0027B8 70001BB8 24080000 */ li $t0, 0 -/* 0027BC 70001BBC 40882000 */ mtc0 $t0, $4 +/* 0027BC 70001BBC 40882000 */ mtc0 $t0, $4 #C0_CONTEXT /* 0027C0 70001BC0 03E00008 */ jr $ra /* 0027C4 70001BC4 00000000 */ nop diff --git a/src/tlb_manage.c b/src/tlb_manage.c index 13c9eefe..600b082f 100644 --- a/src/tlb_manage.c +++ b/src/tlb_manage.c @@ -9,6 +9,7 @@ * This file contains tlb management code. */ +#define PAGE_SIZE 0x2000 /** * N64 (MIPS 4300) has 32 TLB entries. @@ -33,18 +34,15 @@ /** * Number of entries in the mapping table. */ -#define MAPPING_TABLE_COUNT 90 - -/** - * Chosen by fair dice roll. - * Guaranteed to be random. - */ #ifndef VERSION_EU -#define TLB_RANDOM_MOD 90 +#define MAPPING_TABLE_COUNT 90 #else -#define TLB_RANDOM_MOD 93 +#define MAPPING_TABLE_COUNT 93 #endif +#define TLB_RANDOM_MOD MAPPING_TABLE_COUNT + + struct TlbManageTableEntry { u32 contextValue; @@ -64,20 +62,12 @@ u32 g_tlbmanageTlbSegmentNumber = 0; struct TlbManageTableEntry g_tlbmanageMangementTable[MANAGEMENT_TABLE_COUNT]; struct TlbManageMap g_tlbmanageMappingTable[MAPPING_TABLE_COUNT]; -#ifdef VERSION_EU -/* .bss hack, probably need to extend the above array and reference last element ... */ -s32 eu_bss_D_80052E54; -s16 eu_bss_D_80052E58; -s16 eu_bss_D_80052E5A; -#endif - u32 g_tlbmanageMappingTableEnd; u8 (*g_tlbmanageTlbAllocatedBlock) [TLB_ALLOCATION_BLOCK_SIZE]; extern u8 *_gameSegmentRomStart; extern u8 *sp_boot; -#ifndef VERSION_EU void tlbmanageEstablishManagementTable(void) { s32 i; @@ -93,82 +83,9 @@ void tlbmanageEstablishManagementTable(void) g_tlbmanageMappingTable[i].entry0 = 1; } - g_tlbmanageTlbAllocatedBlock = (u8(*)[TLB_ALLOCATION_BLOCK_SIZE]) (((u32)&sp_boot & ~0x1FFF) + 0xFFF4C000); - g_tlbmanageMappingTableEnd = ((u32)&g_tlbmanageMangementTable) + 0xFFC08000; -} -#else -#ifdef NONMATCHING -void tlbmanageEstablishManagementTable(void) -{ - s32 i; - for (i = 0; i < MANAGEMENT_TABLE_COUNT; i++) - { - g_tlbmanageMangementTable[i].contextValue = 1; - g_tlbmanageMangementTable[i].pagenum = 0; - } - - for (i = 0; i < MAPPING_TABLE_COUNT; i++) - { - g_tlbmanageMappingTable[i].entry1 = 0; - g_tlbmanageMappingTable[i].entry0 = 1; - //get rid of extra copy here from optimizations in EU - - g_tlbmanageTlbAllocatedBlock = (u8(*)[TLB_ALLOCATION_BLOCK_SIZE]) (((u32)&sp_boot & ~0x1FFF) + 0xFFF4C000); + g_tlbmanageTlbAllocatedBlock = (u8(*)[TLB_ALLOCATION_BLOCK_SIZE]) (((u32)&sp_boot & ~(PAGE_SIZE - 1)) - (MAPPING_TABLE_COUNT * PAGE_SIZE)); g_tlbmanageMappingTableEnd = ((u32)&g_tlbmanageMangementTable) + 0xFFC08000; } -#else -GLOBAL_ASM( -.text -glabel tlbmanageEstablishManagementTable -/* 002860 70001C60 3C038005 */ lui $v1, %hi(g_tlbmanageMangementTable) # $v1, 0x8005 -/* 002864 70001C64 3C028005 */ lui $v0, %hi(g_tlbmanageMappingTable) # $v0, 0x8005 -/* 002868 70001C68 24422DA0 */ addiu $v0, %lo(g_tlbmanageMappingTable) # addiu $v0, $v0, 0x2da0 -/* 00286C 70001C6C 246325A0 */ addiu $v1, %lo(g_tlbmanageMangementTable) # addiu $v1, $v1, 0x25a0 -/* 002870 70001C70 24040001 */ li $a0, 1 -.L70001C74: -/* 002874 70001C74 24630010 */ addiu $v1, $v1, 0x10 -/* 002878 70001C78 0062082B */ sltu $at, $v1, $v0 -/* 00287C 70001C7C AC64FFF0 */ sw $a0, -0x10($v1) -/* 002880 70001C80 1420FFFC */ bnez $at, .L70001C74 -/* 002884 70001C84 AC60FFF4 */ sw $zero, -0xc($v1) -/* 002888 70001C88 3C018005 */ lui $at, %hi(g_tlbmanageMappingTable) # $at, 0x8005 -/* 00288C 70001C8C 3C038005 */ lui $v1, %hi(g_tlbmanageMappingTable+2) # $v1, 0x8005 -/* 002890 70001C90 3C028005 */ lui $v0, %hi(eu_bss_D_80052E5A) # $v0, 0x8005 -/* 002894 70001C94 24422E5A */ addiu $v0, %lo(eu_bss_D_80052E5A) # addiu $v0, $v0, 0x2e5a -/* 002898 70001C98 24632DA2 */ addiu $v1, %lo(g_tlbmanageMappingTable+2) # addiu $v1, $v1, 0x2da2 -/* 00289C 70001C9C A0202DA1 */ sb $zero, %lo(g_tlbmanageMappingTable+1)($at) -/* 0028A0 70001CA0 A0242DA0 */ sb $a0, %lo(g_tlbmanageMappingTable)($at) -.L70001CA4: -/* 0028A4 70001CA4 24630008 */ addiu $v1, $v1, 8 -/* 0028A8 70001CA8 A060FFFB */ sb $zero, -5($v1) -/* 0028AC 70001CAC A064FFFA */ sb $a0, -6($v1) -/* 0028B0 70001CB0 A060FFFD */ sb $zero, -3($v1) -/* 0028B4 70001CB4 A064FFFC */ sb $a0, -4($v1) -/* 0028B8 70001CB8 A060FFFF */ sb $zero, -1($v1) -/* 0028BC 70001CBC A064FFFE */ sb $a0, -2($v1) -/* 0028C0 70001CC0 A060FFF9 */ sb $zero, -7($v1) -/* 0028C4 70001CC4 1462FFF7 */ bne $v1, $v0, .L70001CA4 -/* 0028C8 70001CC8 A064FFF8 */ sb $a0, -8($v1) -/* 0028CC 70001CCC 3C0E803A */ lui $t6, %hi(sp_boot) # $t6, 0x803a -/* 0028D0 70001CD0 25CE1AB0 */ addiu $t6, %lo(sp_boot) # addiu $t6, $t6, 0x1ab0 -/* 0028D4 70001CD4 2401E000 */ li $at, -8192 -/* 0028D8 70001CD8 01C17824 */ and $t7, $t6, $at -/* 0028DC 70001CDC 3C01FFF4 */ lui $at, (0xFFF46000 >> 16) # lui $at, 0xfff4 -/* 0028E0 70001CE0 34216000 */ ori $at, (0xFFF46000 & 0xFFFF) # ori $at, $at, 0x6000 -/* 0028E4 70001CE4 01E1C021 */ addu $t8, $t7, $at -/* 0028E8 70001CE8 3C018005 */ lui $at, %hi(g_tlbmanageTlbAllocatedBlock) # $at, 0x8005 -/* 0028EC 70001CEC AC382E60 */ sw $t8, %lo(g_tlbmanageTlbAllocatedBlock)($at) -/* 0028F0 70001CF0 3C01FFC0 */ lui $at, (0xFFC08000 >> 16) # lui $at, 0xffc0 -/* 0028F4 70001CF4 3C198005 */ lui $t9, %hi(g_tlbmanageMangementTable) # $t9, 0x8005 -/* 0028F8 70001CF8 273925A0 */ addiu $t9, %lo(g_tlbmanageMangementTable) # addiu $t9, $t9, 0x25a0 -/* 0028FC 70001CFC 34218000 */ ori $at, (0xFFC08000 & 0xFFFF) # ori $at, $at, 0x8000 -/* 002900 70001D00 03214021 */ addu $t0, $t9, $at -/* 002904 70001D04 3C018005 */ lui $at, %hi(g_tlbmanageMappingTableEnd) -/* 002908 70001D08 03E00008 */ jr $ra -/* 00290C 70001D0C AC282E5C */ sw $t0, %lo(g_tlbmanageMappingTableEnd)($at) -) -#endif -#endif /** * Sets g_tlbmanageCurrentTlbEntries to zero. diff --git a/src/usb.c b/src/usb.c index 6880d791..22b2bbac 100644 --- a/src/usb.c +++ b/src/usb.c @@ -5,15 +5,16 @@ Allows USB communication between an N64 flashcart and the PC using UNFLoader. https://github.com/buu342/N64-UNFLoader ***************************************************************/ - +#undef LIBDRAGON #include "usb.h" -#include +#ifndef LIBDRAGON + #include + #include +#else + #include +#endif #include -#include -#include - -s32 everdrive_status; /********************************* Data macros @@ -23,174 +24,208 @@ s32 everdrive_status; #define BUFFER_SIZE 512 // USB Memory location -#define DEBUG_ADDRESS 0x04000000-DEBUG_ADDRESS_SIZE // Put the debug area at the 63MB area in ROM space +#define DEBUG_ADDRESS (0x04000000 - DEBUG_ADDRESS_SIZE) // Put the debug area at the 64MB - DEBUG_ADDRESS_SIZE area in ROM space // Data header related -#define USBHEADER_CREATE(type, left) (((type<<24) | (left & 0x00FFFFFF))) +#define USBHEADER_CREATE(type, left) ((((type)<<24) | ((left) & 0x00FFFFFF))) + +// Protocol related +#define USBPROTOCOL_VERSION 2 +#define HEARTBEAT_VERSION 1 /********************************* Libultra macros for libdragon *********************************/ -#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1)) +#ifdef LIBDRAGON + // Useful + #ifndef MIN + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #endif + #ifndef ALIGN + #define ALIGN(value, align) (((value) + ((typeof(value))(align) - 1)) & ~((typeof(value))(align) - 1)) + #endif + #ifndef TRUE + #define TRUE 1 + #endif + #ifndef FALSE + #define FALSE 0 + #endif + #ifndef NULL + #define NULL 0 + #endif + + // MIPS addresses + #define KSEG0 0x80000000 + #define KSEG1 0xA0000000 + + // Memory translation stuff + #define PHYS_TO_K1(x) ((u32)(x)|KSEG1) + #define IO_WRITE(addr,data) (*(vu32 *)PHYS_TO_K1(addr)=(u32)(data)) + #define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr)) + + // Data alignment + #define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10)) + #define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10)) +#endif /********************************* - Parallel Interface macros + 64Drive macros *********************************/ -#define N64_PI_ADDRESS 0xA4600000 +#define D64_COMMAND_TIMEOUT 1000 +#define D64_WRITE_TIMEOUT 1000 -#define N64_PI_RAMADDRESS 0x00 -#define N64_PI_PIADDRESS 0x04 -#define N64_PI_READLENGTH 0x08 -#define N64_PI_WRITELENGTH 0x0C -#define N64_PI_STATUS 0x10 +#define D64_BASE 0x10000000 +#define D64_REGS_BASE 0x18000000 +#define D64_REG_STATUS (D64_REGS_BASE + 0x0200) +#define D64_REG_COMMAND (D64_REGS_BASE + 0x0208) -/********************************* - 64Drive macros -*********************************/ - -// How many cycles for the 64Drive to wait for data. -// Lowering this might improve performance slightly faster at the expense of USB reading accuracy -#define D64_POLLTIME 2000 - -// Cartridge Interface definitions. Obtained from 64Drive's Spec Sheet -#define D64_BASE_ADDRESS 0xB0000000 -#define D64_CIREG_ADDRESS 0x08000000 -#define D64_CIBASE_ADDRESS 0xB8000000 +#define D64_REG_MAGIC (D64_REGS_BASE + 0x02EC) -#define D64_REGISTER_STATUS 0x00000200 -#define D64_REGISTER_COMMAND 0x00000208 -#define D64_REGISTER_LBA 0x00000210 -#define D64_REGISTER_LENGTH 0x00000218 -#define D64_REGISTER_RESULT 0x00000220 +#define D64_REG_USBCOMSTAT (D64_REGS_BASE + 0x0400) +#define D64_REG_USBP0R0 (D64_REGS_BASE + 0x0404) +#define D64_REG_USBP1R1 (D64_REGS_BASE + 0x0408) -#define D64_REGISTER_MAGIC 0x000002EC -#define D64_REGISTER_VARIANT 0x000002F0 -#define D64_REGISTER_BUTTON 0x000002F8 -#define D64_REGISTER_REVISION 0x000002FC +#define D64_CI_BUSY 0x1000 -#define D64_REGISTER_USBCOMSTAT 0x00000400 -#define D64_REGISTER_USBP0R0 0x00000404 -#define D64_REGISTER_USBP1R1 0x00000408 +#define D64_MAGIC 0x55444556 -#define D64_ENABLE_ROMWR 0xF0 -#define D64_DISABLE_ROMWR 0xF1 -#define D64_COMMAND_WRITE 0x08 +#define D64_CI_ENABLE_ROMWR 0xF0 +#define D64_CI_DISABLE_ROMWR 0xF1 -// Cartridge Interface return values -#define D64_MAGIC 0x55444556 +#define D64_CUI_ARM 0x0A +#define D64_CUI_DISARM 0x0F +#define D64_CUI_WRITE 0x08 -#define D64_USB_IDLE 0x00 -#define D64_USB_IDLEUNARMED 0x00 -#define D64_USB_ARMED 0x01 -#define D64_USB_DATA 0x02 -#define D64_USB_ARM 0x0A -#define D64_USB_BUSY 0x0F -#define D64_USB_DISARM 0x0F -#define D64_USB_ARMING 0x0F +#define D64_CUI_ARM_MASK 0x0F +#define D64_CUI_ARM_IDLE 0x00 +#define D64_CUI_ARM_UNARMED_DATA 0x02 -#define D64_CI_IDLE 0x00 -#define D64_CI_BUSY 0x10 -#define D64_CI_WRITE 0x20 +#define D64_CUI_WRITE_MASK 0xF0 +#define D64_CUI_WRITE_IDLE 0x00 +#define D64_CUI_WRITE_BUSY 0xF0 /********************************* EverDrive macros *********************************/ +#define ED_TIMEOUT 1000 + #define ED_BASE 0x10000000 #define ED_BASE_ADDRESS 0x1F800000 -#define ED_GET_REGADD(reg) (0xA0000000 | ED_BASE_ADDRESS | (reg)) - -#define ED_REG_USBCFG 0x0004 -#define ED_REG_VERSION 0x0014 -#define ED_REG_USBDAT 0x0400 -#define ED_REG_SYSCFG 0x8000 -#define ED_REG_KEY 0x8004 -#define ED_USBMODE_RDNOP 0xC400 -#define ED_USBMODE_RD 0xC600 -#define ED_USBMODE_WRNOP 0xC000 -#define ED_USBMODE_WR 0xC200 +#define ED_REG_USBCFG (ED_BASE_ADDRESS | 0x0004) +#define ED_REG_VERSION (ED_BASE_ADDRESS | 0x0014) +#define ED_REG_USBDAT (ED_BASE_ADDRESS | 0x0400) +#define ED_REG_SYSCFG (ED_BASE_ADDRESS | 0x8000) +#define ED_REG_KEY (ED_BASE_ADDRESS | 0x8004) -#define ED_USBSTAT_ACT 0x0200 -#define ED_USBSTAT_RXF 0x0400 -#define ED_USBSTAT_TXE 0x0800 -#define ED_USBSTAT_POWER 0x1000 -#define ED_USBSTAT_BUSY 0x2000 +#define ED_USBMODE_RDNOP 0xC400 +#define ED_USBMODE_RD 0xC600 +#define ED_USBMODE_WRNOP 0xC000 +#define ED_USBMODE_WR 0xC200 -#define ED_REGKEY 0xAA55 +#define ED_USBSTAT_ACT 0x0200 +#define ED_USBSTAT_RXF 0x0400 +#define ED_USBSTAT_TXE 0x0800 +#define ED_USBSTAT_POWER 0x1000 +#define ED_USBSTAT_BUSY 0x2000 -#define ED3_VERSION 0xED640008 -#define ED7_VERSION 0xED640013 +#define ED_REGKEY 0xAA55 -/* -#define CART_ID_V2 0xED640007 -#define CART_ID_V3 0xED640008 -#define CART_ID_X7 0xED640013 -#define CART_ID_X5 0xED640014 -*/ +#define ED25_VERSION 0xED640007 +#define ED3_VERSION 0xED640008 +#define ED7_VERSION 0xED640013 /********************************* - SummerCart64 macros + SC64 macros *********************************/ -#define SC64_SDRAM_BASE 0x10000000 +#define SC64_WRITE_TIMEOUT 1000 + +#define SC64_BASE 0x10000000 +#define SC64_REGS_BASE 0x1FFF0000 + +#define SC64_REG_SR_CMD (SC64_REGS_BASE + 0x00) +#define SC64_REG_DATA_0 (SC64_REGS_BASE + 0x04) +#define SC64_REG_DATA_1 (SC64_REGS_BASE + 0x08) +#define SC64_REG_IDENTIFIER (SC64_REGS_BASE + 0x0C) +#define SC64_REG_KEY (SC64_REGS_BASE + 0x10) -#define SC64_BANK_ROM 1 +#define SC64_SR_CMD_ERROR (1 << 30) +#define SC64_SR_CMD_BUSY (1 << 31) -#define SC64_REGS_BASE 0x1E000000 -#define SC64_REG_SCR (SC64_REGS_BASE + 0x00) -#define SC64_REG_VERSION (SC64_REGS_BASE + 0x08) -#define SC64_REG_USB_SCR (SC64_REGS_BASE + 0x10) -#define SC64_REG_USB_DMA_ADDR (SC64_REGS_BASE + 0x14) -#define SC64_REG_USB_DMA_LEN (SC64_REGS_BASE + 0x18) +#define SC64_V2_IDENTIFIER 0x53437632 -#define SC64_MEM_BASE (SC64_REGS_BASE + 0x1000) -#define SC64_MEM_USB_FIFO_BASE (SC64_MEM_BASE + 0x0000) -#define SC64_MEM_USB_FIFO_LEN (4 * 1024) +#define SC64_KEY_RESET 0x00000000 +#define SC64_KEY_UNLOCK_1 0x5F554E4C +#define SC64_KEY_UNLOCK_2 0x4F434B5F -#define SC64_SCR_SDRAM_WRITE_EN (1 << 0) +#define SC64_CMD_CONFIG_SET 'C' +#define SC64_CMD_USB_WRITE_STATUS 'U' +#define SC64_CMD_USB_WRITE 'M' +#define SC64_CMD_USB_READ_STATUS 'u' +#define SC64_CMD_USB_READ 'm' -#define SC64_VERSION_A 0x53363461 +#define SC64_CFG_ROM_WRITE_ENABLE 1 -#define SC64_USB_STATUS_BUSY (1 << 0) -#define SC64_USB_STATUS_READY (1 << 1) -#define SC64_USB_CONTROL_START (1 << 0) -#define SC64_USB_CONTROL_FIFO_FLUSH (1 << 2) +#define SC64_USB_WRITE_STATUS_BUSY (1 << 31) +#define SC64_USB_READ_STATUS_BUSY (1 << 31) + + +/********************************* + Libultra types (for libdragon) +*********************************/ + +#ifdef LIBDRAGON + typedef uint8_t u8; + typedef uint16_t u16; + typedef uint32_t u32; + typedef uint64_t u64; + + typedef int8_t s8; + typedef int16_t s16; + typedef int32_t s32; + typedef int64_t s64; + + typedef volatile uint8_t vu8; + typedef volatile uint16_t vu16; + typedef volatile uint32_t vu32; + typedef volatile uint64_t vu64; + + typedef volatile int8_t vs8; + typedef volatile int16_t vs16; + typedef volatile int32_t vs32; + typedef volatile int64_t vs64; + + typedef float f32; + typedef double f64; +#endif -#define SC64_USB_BANK_ADDR(b, a) ((((b) & 0xF) << 28) | ((a) & 0x3FFFFFF)) -#define SC64_USB_LENGTH(l) (ALIGN((l), 4) / 4) -#define SC64_USB_DMA_MAX_LEN (2 * 1024 * 1024) -#define SC64_USB_FIFO_ITEMS(s) (((s) >> 3) & 0x7FF) /********************************* Function Prototypes *********************************/ -static void usb_findcart(); +static void usb_findcart(void); + static void usb_64drive_write(int datatype, const void* data, int size); -static u32 usb_64drive_poll(); -static void usb_64drive_read(); -void usb_everdrive_readreg(u32 reg, u32* result); +static u32 usb_64drive_poll(void); +static void usb_64drive_read(void); + static void usb_everdrive_write(int datatype, const void* data, int size); -static u32 usb_everdrive_poll(); -static void usb_everdrive_read(); -void usb_everdrive_writereg(u32 reg, u32 value); -static void usb_sc64_write(int datatype, const void* data, int size); -static u32 usb_sc64_poll(); -static void usb_sc64_read(); -void usb_everdrive_usbbusy(void); -u8 usb_everdrive_canread(void); -void usb_everdrive_readusb(void* buffer, int size); +static u32 usb_everdrive_poll(void); +static void usb_everdrive_read(void); -u32 usb_everdrive_read_version; -static void usb_everdrive_wait_pidma(void); +static void usb_sc64_write(int datatype, const void* data, int size); +static u32 usb_sc64_poll(void); +static void usb_sc64_read(void); /********************************* @@ -199,39 +234,186 @@ static void usb_everdrive_wait_pidma(void); // Function pointers void (*funcPointer_write)(int datatype, const void* data, int size); -u32 (*funcPointer_poll)(); -void (*funcPointer_read)(); +u32 (*funcPointer_poll)(void); +void (*funcPointer_read)(void); // USB globals -static u32 usb_cart = CART_NONE; -#ifdef __GNUC__ - static u8 __attribute__((aligned(16))) usb_buffer[BUFFER_SIZE]; -#else - static u8 usb_buffer_alloc[BUFFER_SIZE+18]; - static u8 *usb_buffer; +static s8 usb_cart = CART_NONE; +static u8 usb_buffer_align[BUFFER_SIZE+16]; // IDO doesn't support GCC's __attribute__((aligned(x))), so this is a workaround +static u8* usb_buffer; +static char usb_didtimeout = FALSE; +static int usb_datatype = 0; +static int usb_datasize = 0; +static int usb_dataleft = 0; +static int usb_readblock = -1; + +#ifndef LIBDRAGON + // Message globals + #if !USE_OSRAW + OSMesg dmaMessageBuf; + OSIoMesg dmaIOMessageBuf; + OSMesgQueue dmaMessageQ; + #endif + + // osPiRaw + #if USE_OSRAW + extern s32 __osPiRawWriteIo(u32, u32); + extern s32 __osPiRawReadIo(u32, u32 *); + extern s32 __osPiRawStartDma(s32, u32, void *, u32); + + #define osPiRawWriteIo(a, b) __osPiRawWriteIo(a, b) + #define osPiRawReadIo(a, b) __osPiRawReadIo(a, b) + #define osPiRawStartDma(a, b, c, d) __osPiRawStartDma(a, b, c, d) + #endif #endif -int usb_datatype = 0; -int usb_datasize = 0; -int usb_dataleft = 0; -int usb_readblock = -1; - -// Message globals -#if !USE_OSRAW - OSMesg dmaMessageBuf; - OSIoMesg dmaIOMessageBuf; - OSMesgQueue dmaMessageQ; + + +/********************************* + I/O Wrapper Functions +*********************************/ + +/*============================== + usb_io_read + Reads a 32-bit value from a + given address using the PI. + @param The address to read from + @return The 4 byte value that was read +==============================*/ + +u32 usb_io_read(u32 pi_address) +{ + #ifndef LIBDRAGON + u32 value; + #if USE_OSRAW + osPiRawReadIo(pi_address, &value); + #else + osPiReadIo(pi_address, &value); + #endif + return value; + #else + return io_read(pi_address); + #endif +} + + +/*============================== + usb_io_write + Writes a 32-bit value to a + given address using the PI. + @param The address to write to + @param The 4 byte value to write +==============================*/ + +void usb_io_write(u32 pi_address, u32 value) +{ + #ifndef LIBDRAGON + #if USE_OSRAW + osPiRawWriteIo(pi_address, value); + #else + osPiWriteIo(pi_address, value); + #endif + #else + io_write(pi_address, value); + #endif +} + + +/*============================== + usb_dma_read + Reads arbitrarily sized data from a + given address using DMA. + @param The buffer to read into + @param The address to read from + @param The size of the data to read +==============================*/ + +void usb_dma_read(void *ram_address, u32 pi_address, size_t size) +{ + #ifndef LIBDRAGON + osWritebackDCache(ram_address, size); + osInvalDCache(ram_address, size); + #if USE_OSRAW + osPiRawStartDma(OS_READ, pi_address, ram_address, size); + #else + osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_READ, pi_address, ram_address, size, &dmaMessageQ); + osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); + #endif + #else + data_cache_hit_writeback_invalidate(ram_address, size); + dma_read(ram_address, pi_address, size); + #endif +} + + +/*============================== + usb_dma_write + writes arbitrarily sized data to a + given address using DMA. + @param The buffer to read from + @param The address to write to + @param The size of the data to write +==============================*/ + +void usb_dma_write(void *ram_address, u32 pi_address, size_t size) +{ + #ifndef LIBDRAGON + osWritebackDCache(ram_address, size); + #if USE_OSRAW + osPiRawStartDma(OS_WRITE, pi_address, ram_address, size); + #else + osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_WRITE, pi_address, ram_address, size, &dmaMessageQ); + osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); + #endif + #else + data_cache_hit_writeback(ram_address, size); + dma_write(ram_address, pi_address, size); + #endif +} + + +/********************************* + Timeout helpers +*********************************/ + +/*============================== + usb_timeout_start + Returns current value of COUNT coprocessor 0 register + @return C0_COUNT value +==============================*/ + +static u32 usb_timeout_start(void) +{ +#ifndef LIBDRAGON + return osGetCount(); +#else + return get_ticks(); #endif +} -// osPiRaw -#if USE_OSRAW - extern s32 __osPiRawWriteIo(u32, u32); - extern s32 __osPiRawReadIo(u32, u32 *); - extern s32 __osPiRawStartDma(s32, u32, void *, u32); - - #define osPiRawWriteIo(a, b) __osPiRawWriteIo(a, b) - #define osPiRawReadIo(a, b) __osPiRawReadIo(a, b) - #define osPiRawStartDma(a, b, c, d) __osPiRawStartDma(a, b, c, d) + +/*============================== + usb_timeout_check + Checks if timeout occurred + @param Starting value obtained from usb_timeout_start + @param Timeout duration specified in milliseconds + @return TRUE if timeout occurred, otherwise FALSE +==============================*/ + +static char usb_timeout_check(u32 start_ticks, u32 duration) +{ +#ifndef LIBDRAGON + u64 current_ticks = (u64)osGetCount(); + u64 timeout_ticks = OS_USEC_TO_CYCLES((u64)duration * 1000); +#else + u64 current_ticks = (u64)get_ticks(); + u64 timeout_ticks = (u64)TICKS_FROM_MS(duration); #endif + if (current_ticks < start_ticks) + current_ticks += 0x100000000ULL; + if (current_ticks >= (start_ticks + timeout_ticks)) + return TRUE; + return FALSE; +} /********************************* @@ -244,23 +426,22 @@ int usb_readblock = -1; @returns 1 if the USB initialization was successful, 0 if not ==============================*/ -u32 usb_initialize() +char usb_initialize(void) { - #ifndef __GNUC__ - usb_buffer = (u8*)OS_DCACHE_ROUNDUP_ADDR(&usb_buffer_alloc[0]); - #endif - // Initialize the debug related globals + usb_buffer = (u8*)OS_DCACHE_ROUNDUP_ADDR(usb_buffer_align); memset(usb_buffer, 0, BUFFER_SIZE); - // Create the message queue - #if !USE_OSRAW - osCreateMesgQueue(&dmaMessageQ, &dmaMessageBuf, 1); + #ifndef LIBDRAGON + // Create the message queue + #if !USE_OSRAW + osCreateMesgQueue(&dmaMessageQ, &dmaMessageBuf, 1); + #endif #endif // Find the flashcart usb_findcart(); - + // Set the function pointers based on the flashcart switch (usb_cart) { @@ -282,72 +463,84 @@ u32 usb_initialize() default: return 0; } + + // Send a heartbeat + usb_sendheartbeat(); return 1; } /*============================== usb_findcart - Checks if the game is running on a 64Drive, EverDrive or a SummerCart64. + Checks if the game is running on a 64Drive, EverDrive or a SC64. ==============================*/ -static void usb_findcart() +static void usb_findcart(void) { - // PI requires 8 byte aligned address. - u32 pibuff[5]; - u32 *up; - - up = (u32*)OS_DCACHE_ROUNDUP_ADDR(&pibuff[0]); - - *up = 0x12345678; + u32 buff; - // Read the cartridge and check if we have a 64Drive. - #if USE_OSRAW - osPiRawReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_MAGIC, up); - #else - osPiReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_MAGIC, up); + // Before we do anything, check that we are using an emulator + #if CHECK_EMULATOR + // Check the RDP clock register. + // Always zero on emulators + if (IO_READ(0xA4100010) == 0) // DPC_CLOCK_REG in Libultra + return; + + // Fallback, harder emulator check. + // The VI has an interesting quirk where its values are mirrored every 0x40 bytes + // It's unlikely that emulators handle this, so we'll write to the VI_TEST_ADDR register and readback 0x40 bytes from its address + // If they don't match, we probably have an emulator + buff = (*(u32*)0xA4400038); + (*(u32*)0xA4400038) = 0x6ABCDEF9; + if ((*(u32*)0xA4400038) != (*(u32*)0xA4400078)) + { + (*(u32*)0xA4400038) = buff; + return; + } + (*(u32*)0xA4400038) = buff; #endif - if (*up == D64_MAGIC) - { - usb_everdrive_read_version = *up; - usb_cart = CART_64DRIVE; - return; - } - *up = 0x12345678; - - // Read the cartridge and check if we have a SummerCart64. - #if USE_OSRAW - osPiRawReadIo(SC64_REG_VERSION, &up); - #else - osPiReadIo(SC64_REG_VERSION, up); - #endif - if (*up == SC64_VERSION_A) + // Read the cartridge and check if we have a 64Drive. + if (usb_io_read(D64_REG_MAGIC) == D64_MAGIC) { - usb_cart = CART_SC64; + usb_cart = CART_64DRIVE; return; } - - *up = 0x12345678; - // Since we didn't find a 64Drive or SummerCart64, let's assume we have an EverDrive + // Since we didn't find a 64Drive let's assume we have an EverDrive // Write the key to unlock the registers, then read the version register - usb_everdrive_writereg(ED_REG_KEY, ED_REGKEY); - usb_everdrive_readreg(ED_REG_VERSION, up); - - usb_everdrive_read_version = *up; + usb_io_write(ED_REG_KEY, ED_REGKEY); + buff = usb_io_read(ED_REG_VERSION); + // EverDrive 2.5 not compatible + if (buff == ED25_VERSION) + return; + // Check if we have an EverDrive - if (*up == ED7_VERSION || *up == ED3_VERSION) + if (buff == ED7_VERSION || buff == ED3_VERSION) { // Set the USB mode - usb_everdrive_writereg(ED_REG_SYSCFG, 0); - usb_everdrive_writereg(ED_REG_USBCFG, ED_USBMODE_RDNOP); + usb_io_write(ED_REG_SYSCFG, 0); + usb_io_write(ED_REG_USBCFG, ED_USBMODE_RDNOP); // Set the cart to EverDrive usb_cart = CART_EVERDRIVE; return; } + + // Since we didn't find an EverDrive either let's assume we have a SC64 + // Write the key sequence to unlock the registers, then read the identifier register + usb_io_write(SC64_REG_KEY, SC64_KEY_RESET); + usb_io_write(SC64_REG_KEY, SC64_KEY_UNLOCK_1); + usb_io_write(SC64_REG_KEY, SC64_KEY_UNLOCK_2); + + // Check if we have a SC64 + if (usb_io_read(SC64_REG_IDENTIFIER) == SC64_V2_IDENTIFIER) + { + // Set the cart to SC64 + usb_cart = CART_SC64; + return; + } } @@ -357,7 +550,7 @@ static void usb_findcart() @return The CART macro that corresponds to the identified flashcart ==============================*/ -char usb_getcart() +char usb_getcart(void) { return usb_cart; } @@ -377,11 +570,11 @@ void usb_write(int datatype, const void* data, int size) // If no debug cart exists, stop if (usb_cart == CART_NONE) return; - + // If there's data to read first, stop if (usb_dataleft != 0) return; - + // Call the correct write function funcPointer_write(datatype, data, size); } @@ -392,6 +585,7 @@ void usb_write_text(const u8* data, int size) } + /*============================== usb_poll Returns the header of data being received via USB @@ -399,7 +593,7 @@ void usb_write_text(const u8* data, int size) @return The data header, or 0 ==============================*/ -u32 usb_poll() +unsigned long usb_poll(void) { // If no debug cart exists, stop if (usb_cart == CART_NONE) @@ -430,7 +624,7 @@ u32 usb_poll() @param The number of bytes to read ==============================*/ -s32 usb_read(void* buffer, int nbytes) +void usb_read(void* buffer, int nbytes) { int read = 0; int left = nbytes; @@ -441,12 +635,12 @@ s32 usb_read(void* buffer, int nbytes) // If no debug cart exists, stop if (usb_cart == CART_NONE) - return read; + return; // If there's no data to read, stop if (usb_dataleft == 0) - return read; - + return; + // Read chunks from ROM while (left > 0) { @@ -455,7 +649,7 @@ s32 usb_read(void* buffer, int nbytes) left = usb_dataleft; if (block > left) block = left; - + // Call the read function if we're reading a new block if (usb_readblock != blockoffset) { @@ -464,7 +658,7 @@ s32 usb_read(void* buffer, int nbytes) } // Copy from the USB buffer to the supplied buffer - memcpy((u8*)buffer+read, usb_buffer+copystart, block); + memcpy((void*)((u32)buffer+read), usb_buffer+copystart, block); // Increment/decrement all our counters read += block; @@ -474,8 +668,6 @@ s32 usb_read(void* buffer, int nbytes) block = BUFFER_SIZE; copystart = 0; } - - return read; } @@ -514,7 +706,7 @@ void usb_rewind(int nbytes) Purges the incoming USB data ==============================*/ -void usb_purge() +void usb_purge(void) { usb_dataleft = 0; usb_datatype = 0; @@ -523,142 +715,205 @@ void usb_purge() } +/*============================== + usb_timedout + Checks if the USB timed out recently + @return 1 if the USB timed out, 0 if not +==============================*/ + +char usb_timedout() +{ + return usb_didtimeout; +} + + +/*============================== + usb_sendheartbeat + Sends a heartbeat packet to the PC + This is done once automatically at initialization, + but can be called manually to ensure that the + host side tool is aware of the current USB protocol + version. +==============================*/ + +void usb_sendheartbeat(void) +{ + u8 buffer[4]; + + // First two bytes describe the USB library protocol version + buffer[0] = (u8)(((USBPROTOCOL_VERSION)>>8)&0xFF); + buffer[1] = (u8)(((USBPROTOCOL_VERSION))&0xFF); + + // Next two bytes describe the heartbeat packet version + buffer[2] = (u8)(((HEARTBEAT_VERSION)>>8)&0xFF); + buffer[3] = (u8)(((HEARTBEAT_VERSION))&0xFF); + + // Send through USB + usb_write(DATATYPE_HEARTBEAT, buffer, sizeof(buffer)/sizeof(buffer[0])); +} + + /********************************* 64Drive functions *********************************/ /*============================== usb_64drive_wait - Wait until the 64Drive is ready - @return 0 if success or -1 if failure + Wait until the 64Drive CI is ready + @return FALSE if success or TRUE if failure ==============================*/ -s8 usb_64drive_wait() +#ifndef LIBDRAGON +static char usb_64drive_wait(void) +#else +char usb_64drive_wait(void) +#endif { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *retp; - - u32 timeout = 0; // I wanted to use osGetTime() but that requires the VI manager + u32 timeout; - retp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - // Wait until the cartridge interface is ready + timeout = usb_timeout_start(); do { - #if USE_OSRAW - osPiRawReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_STATUS, retp); - #else - osPiReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_STATUS, retp); - #endif - // Took too long, abort - if((timeout++) > 10000) - return -1; + if (usb_timeout_check(timeout, D64_COMMAND_TIMEOUT)) + { + usb_didtimeout = TRUE; + return TRUE; + } } - while(((*retp) >> 8) & D64_CI_BUSY); - (void) timeout; // Needed to stop unused variable warning - + while(usb_io_read(D64_REG_STATUS) & D64_CI_BUSY); + // Success - return 0; + usb_didtimeout = FALSE; + return FALSE; } /*============================== - usb_64drive_setwritable - Set the write mode on the 64Drive + usb_64drive_set_writable + Set the CARTROM write mode on the 64Drive @param A boolean with whether to enable or disable ==============================*/ -void usb_64drive_setwritable(u8 enable) +static void usb_64drive_set_writable(u32 enable) { + // Wait until CI is not busy usb_64drive_wait(); - #if USE_OSRAW - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_COMMAND, enable ? D64_ENABLE_ROMWR : D64_DISABLE_ROMWR); - #else - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_COMMAND, enable ? D64_ENABLE_ROMWR : D64_DISABLE_ROMWR); - #endif + + // Send enable/disable CARTROM writes command + usb_io_write(D64_REG_COMMAND, enable ? D64_CI_ENABLE_ROMWR : D64_CI_DISABLE_ROMWR); + + // Wait until operation is finished usb_64drive_wait(); } /*============================== - usb_64drive_waitidle - Waits for the 64Drive's USB to be idle + usb_64drive_cui_write + Writes data from buffer in the 64drive through USB + @param Data type + @param Offset in CARTROM memory space + @param Transfer size ==============================*/ -static int usb_64drive_waitidle() +static void usb_64drive_cui_write(u8 datatype, u32 offset, u32 size) { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *statusp; - - u32 timeout = 0; // I wanted to use osGetTime() but that requires the VI manager + u32 timeout; - statusp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + // Start USB write + usb_io_write(D64_REG_USBP0R0, offset >> 1); + usb_io_write(D64_REG_USBP1R1, USBHEADER_CREATE(datatype, ALIGN(size, 4))); // Align size to 32-bits due to bugs in the firmware + usb_io_write(D64_REG_USBCOMSTAT, D64_CUI_WRITE); - do + // Spin until the write buffer is free + timeout = usb_timeout_start(); + do { - #if USE_OSRAW - osPiRawReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #else - osPiReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #endif - *statusp = ((*statusp) >> 4) & D64_USB_BUSY; - if (timeout++ > 128) - return 0; + // Took too long, abort + if (usb_timeout_check(timeout, D64_WRITE_TIMEOUT)) + { + usb_didtimeout = TRUE; + return; + } } - while((*statusp) != D64_USB_IDLE); - return 1; + while((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_WRITE_MASK) != D64_CUI_WRITE_IDLE); } /*============================== - usb_64drive_armstatus - Checks if the 64Drive is armed - @return The arming status + usb_64drive_cui_poll + Checks if there is data waiting to be read from USB FIFO + @return TRUE if data is waiting, FALSE if otherwise ==============================*/ -static u32 usb_64drive_armstatus() +static char usb_64drive_cui_poll(void) { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *statusp; - - statusp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - - #if USE_OSRAW - osPiRawReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #else - osPiReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #endif - return (*statusp) & 0xf; + // Check if we have data waiting in buffer + if ((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_ARM_MASK) == D64_CUI_ARM_UNARMED_DATA) + return TRUE; + return FALSE; } /*============================== - usb_64drive_waitdisarmed - Waits for the 64Drive's USB to be disarmed + usb_64drive_cui_read + Reads data from USB FIFO to buffer in the 64drive + @param Offset in CARTROM memory space + @return USB header (datatype + size) ==============================*/ -static void usb_64drive_waitdisarmed() +static u32 usb_64drive_cui_read(u32 offset) { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *statusp; + u32 header; + u32 left; + u32 datatype; + u32 size; + + // Arm USB FIFO with 8 byte sized transfer + usb_io_write(D64_REG_USBP0R0, offset >> 1); + usb_io_write(D64_REG_USBP1R1, 8); + usb_io_write(D64_REG_USBCOMSTAT, D64_CUI_ARM); + + // Wait until data is received + while ((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_ARM_MASK) != D64_CUI_ARM_UNARMED_DATA) + ; - statusp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + // Get datatype and bytes remaining + header = usb_io_read(D64_REG_USBP0R0); + left = usb_io_read(D64_REG_USBP1R1) & 0x00FFFFFF; + datatype = header & 0xFF000000; + size = header & 0x00FFFFFF; - do + // Determine if we need to read more data + if (left > 0) { - #if USE_OSRAW - osPiRawReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #else - osPiReadIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, statusp); - #endif - *statusp = (*statusp) & 0x0F; + // Arm USB FIFO with known transfer size + usb_io_write(D64_REG_USBP0R0, (offset + 8) >> 1); + usb_io_write(D64_REG_USBP1R1, left); + usb_io_write(D64_REG_USBCOMSTAT, D64_CUI_ARM); + + // Wait until data is received + while ((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_ARM_MASK) != D64_CUI_ARM_UNARMED_DATA) + ; + + // Calculate total transfer length + size += left; } - while ((*statusp) != D64_USB_IDLEUNARMED); + + // Disarm USB FIFO + usb_io_write(D64_REG_USBCOMSTAT, D64_CUI_DISARM); + + // Wait until USB FIFO is disarmed + while ((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_ARM_MASK) != D64_CUI_ARM_IDLE) + ; + + // Due to a 64drive bug, we need to ignore the last 512 bytes of the transfer if it's larger than 512 bytes + if (size > 512) + size -= 512; + + // Return data header (datatype and size) + return (datatype | size); } @@ -673,125 +928,47 @@ static void usb_64drive_waitdisarmed() static void usb_64drive_write(int datatype, const void* data, int size) { - int left = size; - int read = 0; - - // Spin until the write buffer is free and then set the cartridge to write mode - if (!usb_64drive_waitidle()) + s32 left = size; + u32 pi_address = D64_BASE + DEBUG_ADDRESS; + + // Return if previous transfer timed out + if ((usb_io_read(D64_REG_USBCOMSTAT) & D64_CUI_WRITE_MASK) == D64_CUI_WRITE_BUSY) + { + usb_didtimeout = TRUE; return; - usb_64drive_setwritable(TRUE); - + } + + // Set the cartridge to write mode + usb_64drive_set_writable(TRUE); + // Write data to SDRAM until we've finished while (left > 0) { - int block = left; - if (block > BUFFER_SIZE) - block = BUFFER_SIZE; - - // Copy the data to the global buffer - memcpy(usb_buffer, (void*)((char*)data+read), block); + // Calculate transfer size + u32 block = MIN(left, BUFFER_SIZE); - // If the data was not 32-bit aligned, pad the buffer - if (block < BUFFER_SIZE && size%4 != 0) - { - u32 i; - u32 size_new = (size & ~3)+4; - block += size_new-size; - for (i=size; i> 1); - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP1R1, (size & 0xFFFFFF) | (datatype << 24)); - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_COMMAND_WRITE); - #else - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP0R0, (DEBUG_ADDRESS) >> 1); - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP1R1, (size & 0xFFFFFF) | (datatype << 24)); - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_COMMAND_WRITE); - #endif + // Pad the buffer with zeroes if it wasn't 4 byte aligned + while (block%4) + usb_buffer[block++] = 0; - // Spin until the write buffer is free and then disable write mode - usb_64drive_waitidle(); - usb_64drive_setwritable(FALSE); -} + // Copy block of data from RDRAM to SDRAM + usb_dma_write(usb_buffer, pi_address, ALIGN(block, 2)); - -/*============================== - usb_64drive_arm - Arms the 64Drive's USB - @param The ROM offset to arm - @param The size of the data to transfer -==============================*/ - -static void usb_64drive_arm(u32 offset, u32 size) -{ - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *retp; - - retp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - - *retp = usb_64drive_armstatus(); - - if ((*retp) != D64_USB_ARMING && (*retp) != D64_USB_ARMED) - { - usb_64drive_waitidle(); - - // Arm the 64Drive, using the ROM space as a buffer - #if USE_OSRAW - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_USB_ARM); - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP0R0, (offset >> 1)); - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP1R1, (size & 0xFFFFFF)); - #else - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_USB_ARM); - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP0R0, (offset >> 1)); - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBP1R1, (size & 0xFFFFFF)); - #endif + // Update pointers and variables + data = (void*)((u32)data + block); + left -= block; + pi_address += block; } -} + // Disable write mode + usb_64drive_set_writable(FALSE); -/*============================== - usb_64drive_disarm - Disarms the 64Drive's USB -==============================*/ - -static void usb_64drive_disarm() -{ - // Disarm the USB - #if USE_OSRAW - osPiRawWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_USB_DISARM); - #else - osPiWriteIo(D64_CIBASE_ADDRESS + D64_REGISTER_USBCOMSTAT, D64_USB_DISARM); - #endif - usb_64drive_waitdisarmed(); + // Send the data through USB + usb_64drive_cui_write(datatype, DEBUG_ADDRESS, size); + usb_didtimeout = FALSE; } @@ -802,51 +979,27 @@ static void usb_64drive_disarm() @return The data header, or 0 ==============================*/ -static u32 usb_64drive_poll() +static u32 usb_64drive_poll(void) { - int i; + u32 header; - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *retp; - - retp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - - // Arm the USB buffer - usb_64drive_waitidle(); - usb_64drive_setwritable(TRUE); - usb_64drive_arm(DEBUG_ADDRESS, DEBUG_ADDRESS_SIZE); - - // Burn some time to see if any USB data comes in - for (i=0; i 0) { - // Wait for the USB to be ready and then read data - usb_everdrive_usbbusy(); - usb_everdrive_readdata(usb_buffer, ED_GET_REGADD(ED_REG_USBDAT), BUFFER_SIZE); // TODO: Replace with usb_everdrive_readusb? - - // Tell the FPGA we can receive more data - if (len != 0) - usb_everdrive_writereg(ED_REG_USBCFG, ED_USBMODE_RD | BUFFER_SIZE); + u32 bytes_do = BUFFER_SIZE; + if (len < BUFFER_SIZE) + bytes_do = len; + + // Read a chunk from USB and store it into our temp buffer + usb_everdrive_readusb(usb_buffer, bytes_do); // Copy received block to ROM - usb_everdrive_writedata(usb_buffer, ED_BASE + DEBUG_ADDRESS + offset, BUFFER_SIZE); - offset += BUFFER_SIZE; + usb_dma_write(usb_buffer, ED_BASE + DEBUG_ADDRESS + offset, bytes_do); + offset += bytes_do; + len -= bytes_do; } // Read the CMP Signal - usb_everdrive_usbbusy(); - usb_everdrive_readusb(buffp, 16); - if (buffp[0] != 'C' || buffp[1] != 'M' || buffp[2] != 'P' || buffp[3] != 'H') + if (usb_everdrive_usbbusy()) + return 0; + usb_everdrive_readusb(buff, 4); + if (buff[0] != 'C' || buff[1] != 'M' || buff[2] != 'P' || buff[3] != 'H') { // Something went wrong with the data usb_datatype = 0; @@ -1199,7 +1238,7 @@ static u32 usb_everdrive_poll() usb_readblock = -1; return 0; } - + // Return the data header return USBHEADER_CREATE(usb_datatype, usb_datasize); } @@ -1210,162 +1249,89 @@ static u32 usb_everdrive_poll() Reads bytes from the EverDrive ROM into the global buffer with the block offset ==============================*/ -static void usb_everdrive_read() +static void usb_everdrive_read(void) { // Set up DMA transfer between RDRAM and the PI - osWritebackDCacheAll(); - #if USE_OSRAW - osPiRawStartDma(OS_READ, - ED_BASE + DEBUG_ADDRESS + usb_readblock, usb_buffer, - BUFFER_SIZE); - #else - osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_READ, - ED_BASE + DEBUG_ADDRESS + usb_readblock, usb_buffer, - BUFFER_SIZE, &dmaMessageQ); - (void)osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); - #endif + usb_dma_read(usb_buffer, ED_BASE + DEBUG_ADDRESS + usb_readblock, BUFFER_SIZE); } /********************************* - SummerCart64 functions + SC64 functions *********************************/ /*============================== - usb_sc64_read_usb_scr - Reads SummerCart64 REG_USB_SCR register - @return value of REG_USB_SCR register + usb_sc64_execute_cmd + Executes specified command in SC64 controller + @param Command ID to execute + @param 2 element array of 32 bit arguments to pass with command, use NULL when argument values are not needed + @param 2 element array of 32 bit values to read command result, use NULL when result values are not needed + @return TRUE if there was error during command execution, otherwise FALSE ==============================*/ -static u32 usb_sc64_read_usb_scr(void) -{ - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *usb_scrp; - - usb_scrp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - - #if USE_OSRAW - osPiRawReadIo(SC64_REG_USB_SCR, usb_scrp); - #else - osPiReadIo(SC64_REG_USB_SCR, usb_scrp); - #endif - return *usb_scrp; -} - - -/*============================== - usb_sc64_read_usb_fifo - Loads one element from USB FIFO - @return value popped from USB FIFO -==============================*/ - -static u32 usb_sc64_read_usb_fifo(void) +#ifndef LIBDRAGON +static char usb_sc64_execute_cmd(u8 cmd, u32 *args, u32 *result) +#else +char usb_sc64_execute_cmd(u8 cmd, u32 *args, u32 *result) +#endif { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *datap; - - datap = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); - - #if USE_OSRAW - osPiRawReadIo(SC64_MEM_USB_FIFO_BASE, datap); - #else - osPiReadIo(SC64_MEM_USB_FIFO_BASE, datap); - #endif - - return *datap; -} + u32 sr; + // Write arguments if provided + if (args != NULL) + { + usb_io_write(SC64_REG_DATA_0, args[0]); + usb_io_write(SC64_REG_DATA_1, args[1]); + } -/*============================== - usb_sc64_waitidle - Waits for the SummerCart64 USB interface to be idle - @return 0 if interface is ready, -1 if USB cable is not connected -==============================*/ - -static s8 usb_sc64_waitidle(void) -{ - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *usb_scrp; - - usb_scrp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + // Start execution + usb_io_write(SC64_REG_SR_CMD, cmd); + // Wait for completion do { - *usb_scrp = usb_sc64_read_usb_scr(); - if (!((*usb_scrp) & SC64_USB_STATUS_READY)) { - // Reset usb_cart type if USB cable is not connected - usb_cart = CART_NONE; - return -1; - } - } while ((*usb_scrp) & SC64_USB_STATUS_BUSY); - - return 0; -} - - -/*============================== - usb_sc64_waitdata - Waits for the SummerCart64 USB FIFO to contain specified amount of data or for full FIFO - @param length in bytes - @return number of available bytes in FIFO, -1 if USB cable is not connected -==============================*/ - -static s32 usb_sc64_waitdata(u32 length) -{ - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *usb_scrp; - - u32 wait_length = ALIGN(MIN(length, SC64_MEM_USB_FIFO_LEN), 4); - u32 bytes = 0; - - usb_scrp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + sr = usb_io_read(SC64_REG_SR_CMD); + } + while (sr & SC64_SR_CMD_BUSY); - do + // Read result if provided + if (result != NULL) { - *usb_scrp = usb_sc64_read_usb_scr(); - if (!((*usb_scrp) & SC64_USB_STATUS_READY)) { - // Reset usb_cart type if USB cable is not connected - usb_cart = CART_NONE; - return -1; - } - bytes = SC64_USB_FIFO_ITEMS((*usb_scrp)) * 4; - } while (bytes < wait_length); + result[0] = usb_io_read(SC64_REG_DATA_0); + result[1] = usb_io_read(SC64_REG_DATA_1); + } - return (s32) bytes; + // Return error status + if (sr & SC64_SR_CMD_ERROR) + return TRUE; + return FALSE; } /*============================== - usb_sc64_setwritable - Enable ROM (SDRAM) writes in SummerCart64 - @param A boolean with whether to enable or disable + usb_sc64_set_writable + Enable ROM (SDRAM) writes in SC64 + @param A boolean with whether to enable or disable + @return Previous value of setting ==============================*/ -static void usb_sc64_setwritable(u8 enable) +static u32 usb_sc64_set_writable(u32 enable) { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *scrp; + u32 args[2]; + u32 result[2]; - scrp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + args[0] = SC64_CFG_ROM_WRITE_ENABLE; + args[1] = enable; + if (usb_sc64_execute_cmd(SC64_CMD_CONFIG_SET, args, result)) + return 0; - #if USE_OSRAW - osPiRawReadIo(SC64_REG_SCR, scrp); - osPiRawWriteIo(SC64_REG_SCR, enable ? ((*scrp) | SC64_SCR_SDRAM_WRITE_EN) : ((*scrp) & (~SC64_SCR_SDRAM_WRITE_EN))); - #else - osPiReadIo(SC64_REG_SCR, scrp); - osPiWriteIo(SC64_REG_SCR, enable ? ((*scrp) | SC64_SCR_SDRAM_WRITE_EN) : ((*scrp) & (~SC64_SCR_SDRAM_WRITE_EN))); - #endif + return result[1]; } /*============================== usb_sc64_write - Sends data through USB from the SummerCart64 + Sends data through USB from the SC64 @param The DATATYPE that is being sent @param A buffer with the data to send @param The size of the data being sent @@ -1373,238 +1339,124 @@ static void usb_sc64_setwritable(u8 enable) static void usb_sc64_write(int datatype, const void* data, int size) { - u8 dma[4] = {'D', 'M', 'A', '@'}; - u32 header = USBHEADER_CREATE(datatype, size); - u8 cmp[4] = {'C', 'M', 'P', 'H'}; - u8 wrote_cmp = FALSE; - - size_t block_size = MIN(BUFFER_SIZE, DEBUG_ADDRESS_SIZE); - size_t usb_block_max_size = MIN(DEBUG_ADDRESS_SIZE, SC64_USB_DMA_MAX_LEN); - - u8* data_ptr = (u8*) data; - u32 sdram_address = SC64_SDRAM_BASE + DEBUG_ADDRESS; - - int offset; - int left; - u32 transfer_length; - - // Wait until ready - if (usb_sc64_waitidle()) + u32 left = size; + u32 pi_address = SC64_BASE + DEBUG_ADDRESS; + u32 writable_restore; + u32 timeout; + u32 args[2]; + u32 result[2]; + + // Return if previous transfer timed out + usb_sc64_execute_cmd(SC64_CMD_USB_WRITE_STATUS, NULL, result); + if (result[0] & SC64_USB_WRITE_STATUS_BUSY) { - // Do nothing if USB cable is not connected + usb_didtimeout = TRUE; return; } - // Enable SDRAM writes - usb_sc64_setwritable(TRUE); - - // Prepare transfer header - memcpy(usb_buffer, dma, sizeof(dma)); - memcpy(usb_buffer + sizeof(dma), &header, sizeof(header)); - - offset = sizeof(dma) + sizeof(header); - left = size; - transfer_length = 0; + // Enable SDRAM writes and get previous setting + writable_restore = usb_sc64_set_writable(TRUE); while (left > 0) { - // Calculate data copy length - size_t data_length = MIN(MIN(left, block_size - offset), usb_block_max_size - transfer_length); - u32 dma_length; + // Calculate transfer size + u32 block = MIN(left, BUFFER_SIZE); - // Fill buffer - memcpy(usb_buffer + offset, data_ptr, data_length); - - // Write CMPH at the end of data - if (!wrote_cmp && (left - data_length) <= 0) - { - wrote_cmp = TRUE; - data_ptr = cmp; - offset = MIN(offset + data_length, block_size); - left = sizeof(cmp); - continue; - } + // Copy data to PI DMA aligned buffer + memcpy(usb_buffer, data, block); - // Calculate RDRAM -> PI transfer length - dma_length = ALIGN(offset + data_length, 4); - - // Write data to buffer in SDRAM - osWritebackDCache(usb_buffer, dma_length); - #if USE_OSRAW - osPiRawStartDma(OS_WRITE, sdram_address, usb_buffer, dma_length); - #else - osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_WRITE, sdram_address, usb_buffer, dma_length, &dmaMessageQ); - osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); - #endif - - // Update pointers and remaining data tracking - data_ptr += data_length; - sdram_address += dma_length; - offset = 0; - left -= data_length; - transfer_length = sdram_address - (SC64_SDRAM_BASE + DEBUG_ADDRESS); + // Copy block of data from RDRAM to SDRAM + usb_dma_write(usb_buffer, pi_address, ALIGN(block, 2)); - // Continue filling SDRAM buffer if total length is lower than maximum transfer length or if there's no more data - if ((transfer_length < usb_block_max_size) && (left > 0)) - { - continue; - } + // Update pointers and variables + data = (void*)((u32)data + block); + left -= block; + pi_address += block; + } - // Disable SDRAM writes if there's no more data to write - if (left <= 0) - { - usb_sc64_setwritable(FALSE); - } + // Restore previous SDRAM writable setting + usb_sc64_set_writable(writable_restore); - // Setup hardware registers - #if USE_OSRAW - osPiRawWriteIo(SC64_REG_USB_DMA_ADDR, SC64_USB_BANK_ADDR(SC64_BANK_ROM, DEBUG_ADDRESS)); - osPiRawWriteIo(SC64_REG_USB_DMA_LEN, SC64_USB_LENGTH(transfer_length)); - osPiRawWriteIo(SC64_REG_USB_SCR, SC64_USB_CONTROL_START); - #else - osPiWriteIo(SC64_REG_USB_DMA_ADDR, SC64_USB_BANK_ADDR(SC64_BANK_ROM, DEBUG_ADDRESS)); - osPiWriteIo(SC64_REG_USB_DMA_LEN, SC64_USB_LENGTH(transfer_length)); - osPiWriteIo(SC64_REG_USB_SCR, SC64_USB_CONTROL_START); - #endif + // Start sending data from buffer in SDRAM + args[0] = SC64_BASE + DEBUG_ADDRESS; + args[1] = USBHEADER_CREATE(datatype, size); + if (usb_sc64_execute_cmd(SC64_CMD_USB_WRITE, args, NULL)) + { + usb_didtimeout = TRUE; + return; // Return if USB write was unsuccessful + } - // Wait for transfer to complete if there's more data to send - if (left > 0) + // Wait for transfer to end + timeout = usb_timeout_start(); + do + { + // Took too long, abort + if (usb_timeout_check(timeout, SC64_WRITE_TIMEOUT)) { - if (usb_sc64_waitidle()) - { - // Disable SDRAM writes - usb_sc64_setwritable(FALSE); - - // Stop sending data if USB cable has been disconnected - return; - } + usb_didtimeout = TRUE; + return; } - - // Reset SDRAM address and transfer length - sdram_address = SC64_SDRAM_BASE + DEBUG_ADDRESS; - transfer_length = 0; + usb_sc64_execute_cmd(SC64_CMD_USB_WRITE_STATUS, NULL, result); } + while (result[0] & SC64_USB_WRITE_STATUS_BUSY); + usb_didtimeout = FALSE; } /*============================== usb_sc64_poll - Returns the header of data being received via USB on the SummerCart64 + Returns the header of data being received via USB on the SC64 The first byte contains the data type, the next 3 the number of bytes left to read @return The data header, or 0 ==============================*/ static u32 usb_sc64_poll(void) { - // PI requires 8 byte aligned address. - u32 allocbuff[5]; - u32 *buffp; - - u32 sdram_address; - int left; - - // Load how many 32 bit words are in FIFO - u32 fifo_items = SC64_USB_FIFO_ITEMS(usb_sc64_read_usb_scr()); + u8 datatype; + u32 size; + u32 args[2]; + u32 result[2]; + + // Get read status and extract packet info + usb_sc64_execute_cmd(SC64_CMD_USB_READ_STATUS, NULL, result); + datatype = result[0] & 0xFF; + size = result[1] & 0xFFFFFF; + + // Return 0 if there's no data + if (size == 0) + return 0; + + // Fill USB read data variables + usb_datatype = datatype; + usb_dataleft = size; + usb_datasize = usb_dataleft; + usb_readblock = -1; - buffp = (u32*)OS_DCACHE_ROUNDUP_ADDR(&allocbuff[0]); + // Start receiving data to buffer in SDRAM + args[0] = SC64_BASE + DEBUG_ADDRESS; + args[1] = size; + if (usb_sc64_execute_cmd(SC64_CMD_USB_READ, args, NULL)) + return 0; // Return 0 if USB read was unsuccessful - // Check data if there's at least DMA@ and header in FIFO - if (fifo_items >= 2) + // Wait for completion + do { - // Load and check DMA@ identifier - *buffp = usb_sc64_read_usb_fifo(); - if (memcmp(buffp, "DMA@", 4) != 0) - { - // Return if identifier is wrong - return 0; - } - - // Load header - *buffp = usb_sc64_read_usb_fifo(); - - // Fill USB read data variables - usb_datatype = USBHEADER_GETTYPE((*buffp)); - usb_dataleft = USBHEADER_GETSIZE((*buffp)); - usb_datasize = usb_dataleft; - usb_readblock = -1; - - // Calculate copy length, data size + CMPH identifier aligned to 4 bytes - left = ALIGN(usb_datasize + 4, 4); - - // Starting address in SDRAM - sdram_address = SC64_SDRAM_BASE + DEBUG_ADDRESS; - - // Enable SDRAM writes - usb_sc64_setwritable(TRUE); - - // Copy data until finished - while (left > 0) - { - // Calculate transfer length - s32 dma_length = MIN(left, BUFFER_SIZE); - - // Wait for data in FIFO - dma_length = usb_sc64_waitdata(dma_length); - if (dma_length < 0) - { - // Disable SDRAM writes - usb_sc64_setwritable(FALSE); - - // Stop waiting for data if USB cable has been disconnected - return 0; - } - - // Load data from FIFO to buffer in RDRAM - #if USE_OSRAW - osPiRawStartDma(OS_READ, SC64_MEM_USB_FIFO_BASE, usb_buffer, dma_length); - #else - osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_READ, SC64_MEM_USB_FIFO_BASE, usb_buffer, dma_length, &dmaMessageQ); - osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); - #endif - - // Copy data from RDRAM to SDRAM - #if USE_OSRAW - osPiRawStartDma(OS_WRITE, sdram_address, usb_buffer, dma_length); - #else - osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_WRITE, sdram_address, usb_buffer, dma_length, &dmaMessageQ); - osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); - #endif - - // Update tracking variables - left -= dma_length; - sdram_address += dma_length; - } - - // Disable SDRAM writes - usb_sc64_setwritable(FALSE); - - // Return USB header - return USBHEADER_CREATE(usb_datatype, usb_dataleft); + usb_sc64_execute_cmd(SC64_CMD_USB_READ_STATUS, NULL, result); } + while (result[0] & SC64_USB_READ_STATUS_BUSY); - // Return no USB header if FIFO is empty - return 0; + // Return USB header + return USBHEADER_CREATE(datatype, size); } /*============================== usb_sc64_read - Reads bytes from the SummerCart64 ROM into the global buffer with the block offset + Reads bytes from the SC64 SDRAM into the global buffer with the block offset ==============================*/ static void usb_sc64_read(void) { - // Calculate address in SDRAM - u32 sdram_address = SC64_SDRAM_BASE + DEBUG_ADDRESS + usb_readblock; - // Set up DMA transfer between RDRAM and the PI - #if USE_OSRAW - osPiRawStartDma(OS_READ, sdram_address, usb_buffer, BUFFER_SIZE); - #else - osPiStartDma(&dmaIOMessageBuf, OS_MESG_PRI_NORMAL, OS_READ, sdram_address, usb_buffer, BUFFER_SIZE, &dmaMessageQ); - osRecvMesg(&dmaMessageQ, NULL, OS_MESG_BLOCK); - #endif - - // Invalidate cache - osInvalDCache(usb_buffer, BUFFER_SIZE); + usb_dma_read(usb_buffer, SC64_BASE + DEBUG_ADDRESS + usb_readblock, BUFFER_SIZE); } diff --git a/src/usb.h b/src/usb.h index 601146c8..f44bafe9 100644 --- a/src/usb.h +++ b/src/usb.h @@ -1,19 +1,18 @@ #ifndef UNFL_USB_H #define UNFL_USB_H - -#include /********************************* DataType macros *********************************/ // UNCOMMENT THE #DEFINE IF USING LIBDRAGON - ///#define LIBDRAGON - + //#define LIBDRAGON + // Settings #define USE_OSRAW 0 // Use if you're doing USB operations without the PI Manager (libultra only) #define DEBUG_ADDRESS_SIZE 8*1024*1024 // Max size of USB I/O. The bigger this value, the more ROM you lose! - + #define CHECK_EMULATOR 0 // Stops the USB library from working if it detects an emulator to prevent problems + // Cart definitions #define CART_NONE 0 #define CART_64DRIVE 1 @@ -25,33 +24,30 @@ #define DATATYPE_RAWBINARY 0x02 #define DATATYPE_HEADER 0x03 #define DATATYPE_SCREENSHOT 0x04 - - extern int usb_datatype; - extern int usb_datasize; - extern int usb_dataleft; - extern int usb_readblock; - + #define DATATYPE_HEARTBEAT 0x05 + #define DATATYPE_RMONBINARY 0x69 + /********************************* Convenience macros *********************************/ // Use these to conveniently read the header from usb_poll() - #define USBHEADER_GETTYPE(header) ((header & 0xFF000000) >> 24) - #define USBHEADER_GETSIZE(header) ((header & 0x00FFFFFF)) + #define USBHEADER_GETTYPE(header) (((header) & 0xFF000000) >> 24) + #define USBHEADER_GETSIZE(header) (((header) & 0x00FFFFFF)) + - /********************************* USB Functions *********************************/ - + /*============================== usb_initialize Initializes the USB buffers and pointers @return 1 if the USB initialization was successful, 0 if not ==============================*/ - extern u32 usb_initialize(); + extern char usb_initialize(void); /*============================== @@ -60,7 +56,7 @@ @return The CART macro that corresponds to the identified flashcart ==============================*/ - extern char usb_getcart(); + extern char usb_getcart(void); /*============================== @@ -73,8 +69,8 @@ ==============================*/ extern void usb_write(int datatype, const void* data, int size); - - extern void usb_write_text(const u8* data, int size); + + //extern void usb_write_text( u8 * data, int size); /*============================== @@ -84,7 +80,7 @@ @return The data header, or 0 ==============================*/ - extern u32 usb_poll(); + extern unsigned long usb_poll(void); /*============================== @@ -94,7 +90,7 @@ @param The number of bytes to read ==============================*/ - extern s32 usb_read(void* buffer, int size); + extern void usb_read(void* buffer, int size); /*============================== @@ -120,7 +116,27 @@ Purges the incoming USB data ==============================*/ - extern void usb_purge(); + extern void usb_purge(void); + + + /*============================== + usb_timedout + Checks if the USB timed out recently + @return 1 if the USB timed out, 0 if not + ==============================*/ + + extern char usb_timedout(void); -#endif + /*============================== + usb_sendheartbeat + Sends a heartbeat packet to the PC + This is done once automatically at initialization, + but can be called manually to ensure that the + host side tool is aware of the current USB protocol + version. + ==============================*/ + + extern void usb_sendheartbeat(void); + +#endif diff --git a/src/vi.c b/src/vi.c index f8451c94..ca00ad89 100644 --- a/src/vi.c +++ b/src/vi.c @@ -33,7 +33,7 @@ void viDebugRemoved(void) { return; } -void viInitDebugNoticeList(void) +void viInit(void) { #if defined(VERSION_EU) debTryAdd(&eu_D_80022330, "vi_c_debug"); diff --git a/src/vi.h b/src/vi.h index 9d8ffb92..a1c4420b 100644 --- a/src/vi.h +++ b/src/vi.h @@ -8,6 +8,6 @@ extern OSMesgQueue vi_c_debug_MQ; extern u32 viDLEnd[]; void viDebugRemoved(void); -void viInitDebugNoticeList(void); +void viInit(void); #endif diff --git a/tools/aiParse.c b/tools/aiParse.c index bbc5bb3d..8b9f9e8d 100644 --- a/tools/aiParse.c +++ b/tools/aiParse.c @@ -752,8 +752,8 @@ char *CAMERAMODE_ToString[] = { "CAMERAMODE_FADESWIRL", "CAMERAMODE_SWIRL", "CAMERAMODE_FP", - "CAMERAMODE_UNK5", - "CAMERAMODE_UNK6", + "CAMERAMODE_DEATH_CAM_FIRST", + "CAMERAMODE_DEATH_CAM_SECOND", "CAMERAMODE_POSEND", "CAMERAMODE_FP_NOINPUT", "CAMERAMODE_MP", diff --git a/tools/asmpreproc/asm-processor.py b/tools/asmpreproc/asm-processor.py index cbfd6b8b..ea18c384 100755 --- a/tools/asmpreproc/asm-processor.py +++ b/tools/asmpreproc/asm-processor.py @@ -6,6 +6,11 @@ import sys import re import os +from collections import namedtuple +from io import StringIO + +MAX_FN_SIZE = 100 +SLOW_CHECKS = False EI_NIDENT = 16 EI_CLASS = 4 @@ -180,7 +185,7 @@ def __init__(self, header, data, index): if self.sh_entsize != 0: assert self.sh_size % self.sh_entsize == 0 if self.sh_type == SHT_NOBITS: - self.data = '' + self.data = b'' else: self.data = data[self.sh_offset:self.sh_offset + self.sh_size] self.index = index @@ -195,12 +200,12 @@ def lookup_str(self, index): assert self.sh_type == SHT_STRTAB to = self.data.find(b'\0', index) assert to != -1 - return self.data[index:to].decode('utf-8') + return self.data[index:to].decode('latin1') def add_str(self, string): assert self.sh_type == SHT_STRTAB ret = len(self.data) - self.data += bytes(string, 'utf-8') + b'\0' + self.data += string.encode('latin1') + b'\0' return ret def is_rel(self): @@ -226,6 +231,12 @@ def find_symbol(self, name): return (s.st_shndx, s.st_value) return None + def find_symbol_in_section(self, name, section): + pos = self.find_symbol(name) + assert pos is not None + assert pos[0] == section.index + return pos[1] + def init_symbols(self, sections): assert self.sh_type == SHT_SYMTAB assert self.sh_entsize == 16 @@ -337,211 +348,478 @@ def pad_out(align): def is_temp_name(name): return name.startswith('_asmpp_') -def parse_source(f, print_source, optimized, framepointer): - if optimized: + +# https://stackoverflow.com/a/241506 +def re_comment_replacer(match): + s = match.group(0) + if s[0] in "/#": + return " " + else: + return s + + +re_comment_or_string = re.compile( + r'#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' +) + + +class Failure(Exception): + def __init__(self, message): + self.message = message + + def __str__(self): + return self.message + + +class GlobalState: + def __init__(self, min_instr_count, skip_instr_count, use_jtbl_for_rodata): + # A value that hopefully never appears as a 32-bit rodata constant (or we + # miscompile late rodata). Increases by 1 in each step. + self.late_rodata_hex = 0xE0123456 + self.namectr = 0 + self.min_instr_count = min_instr_count + self.skip_instr_count = skip_instr_count + self.use_jtbl_for_rodata = use_jtbl_for_rodata + + def next_late_rodata_hex(self): + dummy_bytes = struct.pack('>I', self.late_rodata_hex) + if (self.late_rodata_hex & 0xffff) == 0: + # Avoid lui + self.late_rodata_hex += 1 + self.late_rodata_hex += 1 + return dummy_bytes + + def make_name(self, cat): + self.namectr += 1 + return '_asmpp_{}{}'.format(cat, self.namectr) + + +Function = namedtuple('Function', ['text_glabels', 'asm_conts', 'late_rodata_dummy_bytes', 'jtbl_rodata_size', 'late_rodata_asm_conts', 'fn_desc', 'data']) + + +class GlobalAsmBlock: + def __init__(self, fn_desc): + self.fn_desc = fn_desc + self.cur_section = '.text' + self.asm_conts = [] + self.late_rodata_asm_conts = [] + self.late_rodata_alignment = 0 + self.late_rodata_alignment_from_content = False + self.text_glabels = [] + self.fn_section_sizes = { + '.text': 0, + '.data': 0, + '.bss': 0, + '.rodata': 0, + '.late_rodata': 0, + } + self.fn_ins_inds = [] + self.glued_line = '' + self.num_lines = 0 + + def fail(self, message, line=None): + context = self.fn_desc + if line: + context += ", at line \"" + line + "\"" + raise Failure(message + "\nwithin " + context) + + def count_quoted_size(self, line, z, real_line, output_enc): + line = line.encode(output_enc).decode('latin1') + in_quote = False + num_parts = 0 + ret = 0 + i = 0 + digits = "0123456789" # 0-7 would be more sane, but this matches GNU as + while i < len(line): + c = line[i] + i += 1 + if not in_quote: + if c == '"': + in_quote = True + num_parts += 1 + else: + if c == '"': + in_quote = False + continue + ret += 1 + if c != '\\': + continue + if i == len(line): + self.fail("backslash at end of line not supported", real_line) + c = line[i] + i += 1 + # (if c is in "bfnrtv", we have a real escaped literal) + if c == 'x': + # hex literal, consume any number of hex chars, possibly none + while i < len(line) and line[i] in digits + "abcdefABCDEF": + i += 1 + elif c in digits: + # octal literal, consume up to two more digits + it = 0 + while i < len(line) and line[i] in digits and it < 2: + i += 1 + it += 1 + + if in_quote: + self.fail("unterminated string literal", real_line) + if num_parts == 0: + self.fail(".ascii with no string", real_line) + return ret + num_parts if z else ret + + def align2(self): + while self.fn_section_sizes[self.cur_section] % 2 != 0: + self.fn_section_sizes[self.cur_section] += 1 + + def align4(self): + while self.fn_section_sizes[self.cur_section] % 4 != 0: + self.fn_section_sizes[self.cur_section] += 1 + + def add_sized(self, size, line): + if self.cur_section in ['.text', '.late_rodata']: + if size % 4 != 0: + self.fail("size must be a multiple of 4", line) + if size < 0: + self.fail("size cannot be negative", line) + self.fn_section_sizes[self.cur_section] += size + if self.cur_section == '.text': + if not self.text_glabels: + self.fail(".text block without an initial glabel", line) + self.fn_ins_inds.append((self.num_lines - 1, size // 4)) + + def process_line(self, line, output_enc): + self.num_lines += 1 + if line.endswith('\\'): + self.glued_line += line[:-1] + return + line = self.glued_line + line + self.glued_line = '' + + real_line = line + line = re.sub(re_comment_or_string, re_comment_replacer, line) + line = line.strip() + line = re.sub(r'^[a-zA-Z0-9_]+:\s*', '', line) + changed_section = False + emitting_double = False + if line.startswith('glabel ') and self.cur_section == '.text': + self.text_glabels.append(line.split()[1]) + if not line: + pass # empty line + elif line.startswith('glabel ') or (' ' not in line and line.endswith(':')): + pass # label + elif line.startswith('.section') or line in ['.text', '.data', '.rdata', '.rodata', '.bss', '.late_rodata']: + # section change + self.cur_section = '.rodata' if line == '.rdata' else line.split(',')[0].split()[-1] + if self.cur_section not in ['.data', '.text', '.rodata', '.late_rodata', '.bss']: + self.fail("unrecognized .section directive", real_line) + changed_section = True + elif line.startswith('.late_rodata_alignment'): + if self.cur_section != '.late_rodata': + self.fail(".late_rodata_alignment must occur within .late_rodata section", real_line) + value = int(line.split()[1]) + if value not in [4, 8]: + self.fail(".late_rodata_alignment argument must be 4 or 8", real_line) + if self.late_rodata_alignment and self.late_rodata_alignment != value: + self.fail(".late_rodata_alignment alignment assumption conflicts with earlier .double directive. Make sure to provide explicit alignment padding.") + self.late_rodata_alignment = value + changed_section = True + elif line.startswith('.incbin'): + self.add_sized(int(line.split(',')[-1].strip(), 0), real_line) + elif line.startswith('.word') or line.startswith('.float'): + self.align4() + self.add_sized(4 * len(line.split(',')), real_line) + elif line.startswith('.double'): + self.align4() + if self.cur_section == '.late_rodata': + align8 = self.fn_section_sizes[self.cur_section] % 8 + # Automatically set late_rodata_alignment, so the generated C code uses doubles. + # This gives us correct alignment for the transferred doubles even when the + # late_rodata_alignment is wrong, e.g. for non-matching compilation. + if not self.late_rodata_alignment: + self.late_rodata_alignment = 8 - align8 + self.late_rodata_alignment_from_content = True + elif self.late_rodata_alignment != 8 - align8: + if self.late_rodata_alignment_from_content: + self.fail("found two .double directives with different start addresses mod 8. Make sure to provide explicit alignment padding.", real_line) + else: + self.fail(".double at address that is not 0 mod 8 (based on .late_rodata_alignment assumption). Make sure to provide explicit alignment padding.", real_line) + self.add_sized(8 * len(line.split(',')), real_line) + emitting_double = True + elif line.startswith('.space'): + self.add_sized(int(line.split()[1], 0), real_line) + elif line.startswith('.balign') or line.startswith('.align'): + align = int(line.split()[1]) + if align != 4: + self.fail("only .balign 4 is supported", real_line) + self.align4() + elif line.startswith('.asci'): + z = (line.startswith('.asciz') or line.startswith('.asciiz')) + self.add_sized(self.count_quoted_size(line, z, real_line, output_enc), real_line) + elif line.startswith('.byte'): + self.add_sized(len(line.split(',')), real_line) + elif line.startswith('.half'): + self.align2() + self.add_sized(2*len(line.split(',')), real_line) + elif line.startswith('.'): + # .macro, ... + self.fail("asm directive not supported", real_line) + else: + # Unfortunately, macros are hard to support for .rodata -- + # we don't know how how space they will expand to before + # running the assembler, but we need that information to + # construct the C code. So if we need that we'll either + # need to run the assembler twice (at least in some rare + # cases), or change how this program is invoked. + # Similarly, we can't currently deal with pseudo-instructions + # that expand to several real instructions. + if self.cur_section != '.text': + self.fail("instruction or macro call in non-.text section? not supported", real_line) + self.add_sized(4, real_line) + if self.cur_section == '.late_rodata': + if not changed_section: + if emitting_double: + self.late_rodata_asm_conts.append(".align 0") + self.late_rodata_asm_conts.append(real_line) + if emitting_double: + self.late_rodata_asm_conts.append(".align 2") + else: + self.asm_conts.append(real_line) + + def finish(self, state): + src = [''] * (self.num_lines + 1) + late_rodata_dummy_bytes = [] + jtbl_rodata_size = 0 + late_rodata_fn_output = [] + + num_instr = self.fn_section_sizes['.text'] // 4 + + if self.fn_section_sizes['.late_rodata'] > 0: + # Generate late rodata by emitting unique float constants. + # This requires 3 instructions for each 4 bytes of rodata. + # If we know alignment, we can use doubles, which give 3 + # instructions for 8 bytes of rodata. + size = self.fn_section_sizes['.late_rodata'] // 4 + skip_next = False + needs_double = (self.late_rodata_alignment != 0) + for i in range(size): + if skip_next: + skip_next = False + continue + # Jump tables give 9 instructions for >= 5 words of rodata, and should be + # emitted when: + # - -O2 or -O2 -g3 are used, which give the right codegen + # - we have emitted our first .float/.double (to ensure that we find the + # created rodata in the binary) + # - we have emitted our first .double, if any (to ensure alignment of doubles + # in shifted rodata sections) + # - we have at least 5 words of rodata left to emit (otherwise IDO does not + # generate a jump table) + # - we have at least 10 more instructions to go in this function (otherwise our + # function size computation will be wrong since the delay slot goes unused) + if (not needs_double and state.use_jtbl_for_rodata and i >= 1 and + size - i >= 5 and num_instr - len(late_rodata_fn_output) >= 10): + cases = " ".join("case {}:".format(case) for case in range(size - i)) + late_rodata_fn_output.append("switch (*(volatile int*)0) { " + cases + " ; }") + late_rodata_fn_output.extend([""] * 8) + jtbl_rodata_size = (size - i) * 4 + break + dummy_bytes = state.next_late_rodata_hex() + late_rodata_dummy_bytes.append(dummy_bytes) + if self.late_rodata_alignment == 4 * ((i + 1) % 2 + 1) and i + 1 < size: + dummy_bytes2 = state.next_late_rodata_hex() + late_rodata_dummy_bytes.append(dummy_bytes2) + fval, = struct.unpack('>d', dummy_bytes + dummy_bytes2) + late_rodata_fn_output.append('*(volatile double*)0 = {};'.format(fval)) + skip_next = True + needs_double = True + else: + fval, = struct.unpack('>f', dummy_bytes) + late_rodata_fn_output.append('*(volatile float*)0 = {}f;'.format(fval)) + late_rodata_fn_output.append('') + late_rodata_fn_output.append('') + + text_name = None + if self.fn_section_sizes['.text'] > 0 or late_rodata_fn_output: + text_name = state.make_name('func') + src[0] = 'void {}(void) {{'.format(text_name) + src[self.num_lines] = '}' + instr_count = self.fn_section_sizes['.text'] // 4 + if instr_count < state.min_instr_count: + self.fail("too short .text block") + tot_emitted = 0 + tot_skipped = 0 + fn_emitted = 0 + fn_skipped = 0 + rodata_stack = late_rodata_fn_output[::-1] + for (line, count) in self.fn_ins_inds: + for _ in range(count): + if (fn_emitted > MAX_FN_SIZE and instr_count - tot_emitted > state.min_instr_count and + (not rodata_stack or rodata_stack[-1])): + # Don't let functions become too large. When a function reaches 284 + # instructions, and -O2 -framepointer flags are passed, the IRIX + # compiler decides it is a great idea to start optimizing more. + fn_emitted = 0 + fn_skipped = 0 + src[line] += ' }} void {}(void) {{ '.format(state.make_name('large_func')) + if fn_skipped < state.skip_instr_count: + fn_skipped += 1 + tot_skipped += 1 + elif rodata_stack: + src[line] += rodata_stack.pop() + else: + src[line] += '*(volatile int*)0 = 0;' + tot_emitted += 1 + fn_emitted += 1 + if rodata_stack: + size = len(late_rodata_fn_output) // 3 + available = instr_count - tot_skipped + self.fail( + "late rodata to text ratio is too high: {} / {} must be <= 1/3\n" + "add .late_rodata_alignment (4|8) to the .late_rodata " + "block to double the allowed ratio." + .format(size, available)) + + rodata_name = None + if self.fn_section_sizes['.rodata'] > 0: + rodata_name = state.make_name('rodata') + src[self.num_lines] += ' const char {}[{}] = {{1}};'.format(rodata_name, self.fn_section_sizes['.rodata']) + + data_name = None + if self.fn_section_sizes['.data'] > 0: + data_name = state.make_name('data') + src[self.num_lines] += ' char {}[{}] = {{1}};'.format(data_name, self.fn_section_sizes['.data']) + + bss_name = None + if self.fn_section_sizes['.bss'] > 0: + bss_name = state.make_name('bss') + src[self.num_lines] += ' char {}[{}];'.format(bss_name, self.fn_section_sizes['.bss']) + + fn = Function( + text_glabels=self.text_glabels, + asm_conts=self.asm_conts, + late_rodata_dummy_bytes=late_rodata_dummy_bytes, + jtbl_rodata_size=jtbl_rodata_size, + late_rodata_asm_conts=self.late_rodata_asm_conts, + fn_desc=self.fn_desc, + data={ + '.text': (text_name, self.fn_section_sizes['.text']), + '.data': (data_name, self.fn_section_sizes['.data']), + '.rodata': (rodata_name, self.fn_section_sizes['.rodata']), + '.bss': (bss_name, self.fn_section_sizes['.bss']), + }) + return src, fn + +cutscene_data_regexpr = re.compile(r"CutsceneData (.|\n)*\[\] = {") +float_regexpr = re.compile(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f") + +def repl_float_hex(m): + return str(struct.unpack(">I", struct.pack(">f", float(m.group(0).strip().rstrip("f"))))[0]) + +def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None): + if opt in ['O2', 'O1']: if framepointer: min_instr_count = 6 skip_instr_count = 5 else: min_instr_count = 2 skip_instr_count = 1 - else: + elif opt == 'g': if framepointer: min_instr_count = 7 skip_instr_count = 7 else: min_instr_count = 4 skip_instr_count = 4 - MAX_FN_SIZE = 100 - SECTIONS = ['.data', '.text', '.rodata', '.late_rodata', '.bss'] - - in_asm = False - fn_section_sizes = None - fn_ins_inds = None - asm_conts = [] - late_rodata_asm_conts = None - first_fn_name = None - cur_section = None - start_index = None + else: + if opt != 'g3': + raise Failure("must pass one of -g, -O1, -O2, -O2 -g3") + if framepointer: + min_instr_count = 4 + skip_instr_count = 4 + else: + min_instr_count = 2 + skip_instr_count = 2 + + use_jtbl_for_rodata = False + if opt in ['O2', 'g3'] and not framepointer: + use_jtbl_for_rodata = True + + state = GlobalState(min_instr_count, skip_instr_count, use_jtbl_for_rodata) + + global_asm = None asm_functions = [] output_lines = [] - # A value that hopefully never appears as a 32-bit rodata constant (or we - # miscompile late rodata). Increases by 1 in each step. - cur_late_rodata_hex = 0xE0123456 + is_cutscene_data = False - namectr = 0 - def make_name(cat): - nonlocal namectr - namectr += 1 - return '_asmpp_{}{}'.format(cat, namectr) - - for raw_line in f: + for line_no, raw_line in enumerate(f, 1): raw_line = raw_line.rstrip() line = raw_line.lstrip() - output_line = '' - - def add_sized(size): - if cur_section in ['.text', '.late_rodata']: - assert size % 4 == 0, "size must be a multiple of 4 on line: " + raw_line - assert size >= 0 - fn_section_sizes[cur_section] += size - if cur_section == '.text': - assert first_fn_name is not None, ".text block without an initial glabel" - fn_ins_inds.append((len(output_lines), size // 4)) - - if in_asm: + + # Print exactly one output line per source line, to make compiler + # errors have correct line numbers. These will be overridden with + # reasonable content further down. + output_lines.append('') + + if global_asm is not None: if line.startswith(')'): - in_asm = False - late_rodata = [] - late_rodata_fn_output = [] - if fn_section_sizes['.late_rodata'] > 0: - # Generate late rodata by emitting unique float constants. - # This requires 3 instructions for each 4 bytes of rodata. - # Doubles would increase 4 to 8, but unfortunately we know - # too little about alignment to be able to use them. - size = fn_section_sizes['.late_rodata'] // 4 - for i in range(0, size*3, 3): - if (cur_late_rodata_hex & 0xffff) == 0: - # Avoid lui - cur_late_rodata_hex += 1 - dummy_bytes = struct.pack('>I', cur_late_rodata_hex) - cur_late_rodata_hex += 1 - late_rodata.append(dummy_bytes) - fval, = struct.unpack('>f', dummy_bytes) - late_rodata_fn_output.append('*(volatile float*)0 = {}f;'.format(fval)) - late_rodata_fn_output.append('') - late_rodata_fn_output.append('') - temp_fn_name = None - if fn_section_sizes['.text'] > 0 or late_rodata_fn_output: - temp_fn_name = make_name('func') - output_lines[start_index] = 'void {}(void) {{'.format(temp_fn_name) - instr_count = fn_section_sizes['.text'] // 4 - assert instr_count >= min_instr_count, "too short .text block" - available_instr_count = 0 - tot_emitted = 0 - tot_skipped = 0 - fn_emitted = 0 - fn_skipped = 0 - rodata_stack = late_rodata_fn_output[::-1] - for (line, count) in fn_ins_inds: - for _ in range(count): - if (fn_emitted > MAX_FN_SIZE and instr_count - tot_emitted > min_instr_count and - (not rodata_stack or rodata_stack[-1])): - # Don't let functions become too large. When a function reaches 284 - # instructions, and -O2 -framepointer flags are passed, the IRIX - # compiler decides it is a great idea to start optimizing more. - fn_emitted = 0 - fn_skipped = 0 - output_lines[line] += ' }} void {}(void) {{ '.format(make_name('large_func')) - if fn_skipped < skip_instr_count: - fn_skipped += 1 - tot_skipped += 1 - elif rodata_stack: - output_lines[line] += rodata_stack.pop() - else: - available_instr_count += 1 - output_lines[line] += '*(volatile int*)0 = 0;' - tot_emitted += 1 - fn_emitted += 1 - if rodata_stack: - size = len(late_rodata_fn_output) // 3 - available = instr_count - tot_skipped - print("late rodata to text ratio is too high: {} / {} must be <= 1/3" - .format(size, available), file=sys.stderr) - exit(1) - output_line = '}' - rodata_name = None - if fn_section_sizes['.rodata'] > 0: - rodata_name = make_name('rodata') - output_line += ' const char {}[{}] = {{1}};'.format(rodata_name, fn_section_sizes['.rodata']) - data_name = None - if fn_section_sizes['.data'] > 0: - data_name = make_name('data') - output_line += ' char {}[{}] = {{1}};'.format(data_name, fn_section_sizes['.data']) - bss_name = None - if fn_section_sizes['.bss'] > 0: - bss_name = make_name('bss') - output_line += ' char {}[{}];'.format(bss_name, fn_section_sizes['.bss']) - asm_functions.append((first_fn_name, asm_conts, late_rodata, late_rodata_asm_conts, { - '.text': (temp_fn_name, fn_section_sizes['.text']), - '.data': (data_name, fn_section_sizes['.data']), - '.rodata': (rodata_name, fn_section_sizes['.rodata']), - '.bss': (bss_name, fn_section_sizes['.bss']), - })) + src, fn = global_asm.finish(state) + for i, line2 in enumerate(src): + output_lines[start_index + i] = line2 + asm_functions.append(fn) + global_asm = None else: - line = re.sub(r'/\*.*?\*/', '', line) - line = re.sub(r'#.*', '', line) - line = line.strip() - changed_section = False - if line.startswith('glabel ') and first_fn_name is None and cur_section == '.text': - first_fn_name = line.split()[1] - if not line: - pass # empty line - elif line.startswith('glabel ') or (' ' not in line and line.endswith(':')): - pass # label - elif line.startswith('.section') or line in ['.text', '.data', '.rdata', '.rodata', '.bss', '.late_rodata']: - # section change - cur_section = '.rodata' if line == '.rdata' else line.split(',')[0].split()[-1] - changed_section = True - assert cur_section in SECTIONS, "unrecognized .section directive" - elif line.startswith('.incbin'): - add_sized(int(line.split(',')[-1].strip(), 0)) - elif line.startswith('.word') or line.startswith('.float'): - add_sized(4 * len(line.split(','))) - elif line.startswith('.double'): - add_sized(8 * len(line.split(','))) - elif line.startswith('.space'): - add_sized(int(line.split()[1], 0)) - elif line.startswith('.'): - # .macro, .ascii, .asciiz, .balign, .align, ... - assert False, 'not supported yet: ' + line - else: - # Unfortunately, macros are hard to support for .rodata -- - # we don't know how how space they will expand to before - # running the assembler, but we need that information to - # construct the C code. So if we need that we'll either - # need to run the assembler twice (at least in some rare - # cases), or change how this program is invoked. - # Similarly, we can't currently deal with pseudo-instructions - # that expand to several real instructions. - assert cur_section == '.text', "instruction or macro call in non-.text section? not supported: " + line - add_sized(4) - if cur_section == '.late_rodata': - if not changed_section: - late_rodata_asm_conts.append(line) - else: - asm_conts.append(line) + global_asm.process_line(raw_line, output_enc) else: - if line.startswith('GLOBAL_ASM('): - in_asm = True - cur_section = '.text' - asm_conts = [] - late_rodata_asm_conts = [] + if line in ['GLOBAL_ASM(', '#pragma GLOBAL_ASM(']: + global_asm = GlobalAsmBlock("GLOBAL_ASM block at line " + str(line_no)) start_index = len(output_lines) - first_fn_name = None - fn_section_sizes = { - '.text': 0, - '.data': 0, - '.bss': 0, - '.rodata': 0, - '.late_rodata': 0, - } - fn_ins_inds = [] + elif ((line.startswith('GLOBAL_ASM("') or line.startswith('#pragma GLOBAL_ASM("')) + and line.endswith('")')): + fname = line[line.index('(') + 2 : -2] + global_asm = GlobalAsmBlock(fname) + with open(fname, encoding=input_enc) as f: + for line2 in f: + global_asm.process_line(line2.rstrip(), output_enc) + src, fn = global_asm.finish(state) + output_lines[-1] = ''.join(src) + asm_functions.append(fn) + global_asm = None + elif line.startswith('#include "') and line.endswith('" EARLY'): + # C includes qualified with EARLY (i.e. #include "file.c" EARLY) will be + # processed recursively when encountered + fpath = os.path.dirname(f.name) + fname = line[line.index(' ') + 2 : -7] + include_src = StringIO() + with open(fpath + os.path.sep + fname, encoding=input_enc) as include_file: + parse_source(include_file, opt, framepointer, input_enc, output_enc, include_src) + output_lines[-1] = include_src.getvalue() + include_src.write('#line ' + str(line_no) + '\n') + include_src.close() else: - output_line = raw_line - - # Print exactly one output line per source line, to make compiler - # errors have correct line numbers. - output_lines.append(output_line) + # This is a hack to replace all floating-point numbers in an array of a particular type + # (in this case CutsceneData) with their corresponding IEEE-754 hexadecimal representation + if cutscene_data_regexpr.search(line) is not None: + is_cutscene_data = True + elif line.endswith("};"): + is_cutscene_data = False + if is_cutscene_data: + raw_line = re.sub(float_regexpr, repl_float_hex, raw_line) + output_lines[-1] = raw_line if print_source: - for line in output_lines: - print(line) + if isinstance(print_source, StringIO): + for line in output_lines: + print_source.write(line + '\n') + else: + for line in output_lines: + print_source.write(line.encode(output_enc) + b'\n') + print_source.flush() + if print_source != sys.stdout.buffer: + print_source.close() return asm_functions -def fixup_objfile(objfile_name, functions, asm_prelude, assembler): +def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc): SECTIONS = ['.data', '.text', '.rodata', '.bss'] with open(objfile_name, 'rb') as f: @@ -557,19 +835,22 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): '.text': [], '.data': [], '.rodata': [], + '.bss': [], } asm = [] - late_rodata = [] + all_late_rodata_dummy_bytes = [] + all_jtbl_rodata_size = [] late_rodata_asm = [] - late_rodata_source_name = None + late_rodata_source_name_start = None + late_rodata_source_name_end = None # Generate an assembly file with all the assembly we need to fill in. For # simplicity we pad with nops/.space so that addresses match exactly, so we # don't have to fix up relocations/symbol references. - first_fn_names = set() - for (first_fn_name, body, fn_late_rodata, fn_late_rodata_body, data) in functions: + all_text_glabels = set() + for function in functions: ifdefed = False - for sectype, (temp_name, size) in data.items(): + for sectype, (temp_name, size) in function.data.items(): if temp_name is None: continue assert size > 0 @@ -579,7 +860,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): break loc = loc[1] prev_loc = prev_locs[sectype] - assert loc >= prev_loc + if loc < prev_loc: + raise Failure("Wrongly computed size for section {} (diff {}). This is an asm-processor bug!".format(sectype, prev_loc- loc)) if loc != prev_loc: asm.append('.section ' + sectype) if sectype == '.text': @@ -587,22 +869,32 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): asm.append('nop') else: asm.append('.space {}'.format(loc - prev_loc)) - if sectype != '.bss': - to_copy[sectype].append((loc, size)) + to_copy[sectype].append((loc, size, temp_name, function.fn_desc)) prev_locs[sectype] = loc + size if not ifdefed: - if first_fn_name: - first_fn_names.add(first_fn_name) - late_rodata.extend(fn_late_rodata) - late_rodata_asm.extend(fn_late_rodata_body) + all_text_glabels.update(function.text_glabels) + all_late_rodata_dummy_bytes.append(function.late_rodata_dummy_bytes) + all_jtbl_rodata_size.append(function.jtbl_rodata_size) + late_rodata_asm.append(function.late_rodata_asm_conts) + for sectype, (temp_name, size) in function.data.items(): + if temp_name is not None: + asm.append('.section ' + sectype) + asm.append('glabel ' + temp_name + '_asm_start') asm.append('.text') - for line in body: + for line in function.asm_conts: asm.append(line) - if late_rodata_asm: - late_rodata_source_name = '_asmpp_late_rodata' + for sectype, (temp_name, size) in function.data.items(): + if temp_name is not None: + asm.append('.section ' + sectype) + asm.append('glabel ' + temp_name + '_asm_end') + if any(late_rodata_asm): + late_rodata_source_name_start = '_asmpp_late_rodata_start' + late_rodata_source_name_end = '_asmpp_late_rodata_end' asm.append('.rdata') - asm.append('glabel {}'.format(late_rodata_source_name)) - asm.extend(late_rodata_asm) + asm.append('glabel {}'.format(late_rodata_source_name_start)) + for conts in late_rodata_asm: + asm.extend(conts) + asm.append('glabel {}'.format(late_rodata_source_name_end)) o_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.o', delete=False) o_name = o_file.name @@ -612,11 +904,11 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): try: s_file.write(asm_prelude + b'\n') for line in asm: - s_file.write(line.encode('utf-8') + b'\n') + s_file.write(line.encode(output_enc) + b'\n') s_file.close() ret = os.system(assembler + " " + s_name + " -o " + o_name) if ret != 0: - raise Exception("failed to assemble") + raise Failure("failed to assemble") with open(o_name, 'rb') as f: asm_objfile = ElfFile(f.read()) @@ -633,17 +925,25 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): # Move over section contents modified_text_positions = set() + jtbl_rodata_positions = set() last_rodata_pos = 0 for sectype in SECTIONS: - if sectype == '.bss': + if not to_copy[sectype]: continue source = asm_objfile.find_section(sectype) - target = objfile.find_section(sectype) - if source is None or not to_copy[sectype]: + assert source is not None, "didn't find source section: " + sectype + for (pos, count, temp_name, fn_desc) in to_copy[sectype]: + loc1 = asm_objfile.symtab.find_symbol_in_section(temp_name + '_asm_start', source) + loc2 = asm_objfile.symtab.find_symbol_in_section(temp_name + '_asm_end', source) + assert loc1 == pos, "assembly and C files don't line up for section " + sectype + ", " + fn_desc + if loc2 - loc1 != count: + raise Failure("incorrectly computed size for section " + sectype + ", " + fn_desc + ". If using .double, make sure to provide explicit alignment padding.") + if sectype == '.bss': continue - assert target is not None, "must have a section to overwrite: " + sectype + target = objfile.find_section(sectype) + assert target is not None, "missing target section of type " + sectype data = list(target.data) - for (pos, count) in to_copy[sectype]: + for (pos, count, _, _) in to_copy[sectype]: data[pos:pos + count] = source.data[pos:pos + count] if sectype == '.text': assert count % 4 == 0 @@ -657,19 +957,43 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): # Move over late rodata. This is heuristic, sadly, since I can't think # of another way of doing it. moved_late_rodata = {} - if late_rodata: + if any(all_late_rodata_dummy_bytes) or any(all_jtbl_rodata_size): source = asm_objfile.find_section('.rodata') target = objfile.find_section('.rodata') - source_pos = asm_objfile.symtab.find_symbol(late_rodata_source_name) - assert source_pos is not None and source_pos[0] == source.index - source_pos = source_pos[1] + source_pos = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_start, source) + source_end = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_end, source) + if source_end - source_pos != sum(map(len, all_late_rodata_dummy_bytes)) * 4 + sum(all_jtbl_rodata_size): + raise Failure("computed wrong size of .late_rodata") new_data = list(target.data) - for dummy_bytes in late_rodata: - pos = target.data.index(dummy_bytes, last_rodata_pos) - new_data[pos:pos+4] = source.data[source_pos:source_pos+4] - moved_late_rodata[source_pos] = pos - last_rodata_pos = pos + 4 - source_pos += 4 + for dummy_bytes_list, jtbl_rodata_size in zip(all_late_rodata_dummy_bytes, all_jtbl_rodata_size): + for index, dummy_bytes in enumerate(dummy_bytes_list): + pos = target.data.index(dummy_bytes, last_rodata_pos) + # This check is nice, but makes time complexity worse for large files: + if SLOW_CHECKS and target.data.find(dummy_bytes, pos + 4) != -1: + raise Failure("multiple occurrences of late_rodata hex magic. Change asm-processor to use something better than 0xE0123456!") + if index == 0 and len(dummy_bytes_list) > 1 and target.data[pos+4:pos+8] == b'\0\0\0\0': + # Ugly hack to handle double alignment for non-matching builds. + # We were told by .late_rodata_alignment (or deduced from a .double) + # that a function's late_rodata started out 4 (mod 8), and emitted + # a float and then a double. But it was actually 0 (mod 8), so our + # double was moved by 4 bytes. To make them adjacent to keep jump + # tables correct, move the float by 4 bytes as well. + new_data[pos:pos+4] = b'\0\0\0\0' + pos += 4 + new_data[pos:pos+4] = source.data[source_pos:source_pos+4] + moved_late_rodata[source_pos] = pos + last_rodata_pos = pos + 4 + source_pos += 4 + if jtbl_rodata_size > 0: + assert dummy_bytes_list, "should always have dummy bytes before jtbl data" + pos = last_rodata_pos + new_data[pos : pos + jtbl_rodata_size] = \ + source.data[source_pos : source_pos + jtbl_rodata_size] + for i in range(0, jtbl_rodata_size, 4): + moved_late_rodata[source_pos + i] = pos + i + jtbl_rodata_positions.add(pos + i) + last_rodata_pos += jtbl_rodata_size + source_pos += jtbl_rodata_size target.data = bytes(new_data) # Merge strtab data. @@ -700,15 +1024,16 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): continue if is_temp_name(s.name): continue - if s.st_shndx != SHN_UNDEF: + if s.st_shndx not in [SHN_UNDEF, SHN_ABS]: section_name = asm_objfile.sections[s.st_shndx].name - assert section_name in SECTIONS, "Generated assembly .o must only have symbols for .text, .data, .rodata and UNDEF, but found {}".format(section_name) + if section_name not in SECTIONS: + raise Failure("generated assembly .o must only have symbols for .text, .data, .rodata, ABS and UNDEF, but found " + section_name) s.st_shndx = objfile.find_section(section_name).index # glabel's aren't marked as functions, making objdump output confusing. Fix that. - if s.name in first_fn_names: + if s.name in all_text_glabels: s.type = STT_FUNC - if objfile.sections[s.st_shndx].name == '.rodata' and s.st_value in moved_late_rodata: - s.st_value = moved_late_rodata[s.st_value] + if objfile.sections[s.st_shndx].name == '.rodata' and s.st_value in moved_late_rodata: + s.st_value = moved_late_rodata[s.st_value] s.st_name += strtab_adj if is_local: new_local_syms.append(s) @@ -730,7 +1055,8 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): for reltab in target.relocated_by: nrels = [] for rel in reltab.relocations: - if sectype == '.text' and rel.r_offset in modified_text_positions: + if (sectype == '.text' and rel.r_offset in modified_text_positions or + sectype == '.rodata' and rel.r_offset in jtbl_rodata_positions): # don't include relocations for late_rodata dummy code continue # hopefully we don't have relocations for local or @@ -775,32 +1101,50 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler): except: pass -def main(): +def run_wrapped(argv, outfile, functions): parser = argparse.ArgumentParser(description="Pre-process .c files and post-process .o files to enable embedding assembly into C.") parser.add_argument('filename', help="path to .c code") parser.add_argument('--post-process', dest='objfile', help="path to .o file to post-process") parser.add_argument('--assembler', dest='assembler', help="assembler command (e.g. \"mips-linux-gnu-as -march=vr4300 -mabi=32\")") parser.add_argument('--asm-prelude', dest='asm_prelude', help="path to a file containing a prelude to the assembly file (with .set and .macro directives, e.g.)") + parser.add_argument('--input-enc', default='latin1', help="Input encoding (default: latin1)") + parser.add_argument('--output-enc', default='latin1', help="Output encoding (default: latin1)") parser.add_argument('-framepointer', dest='framepointer', action='store_true') + parser.add_argument('-g3', dest='g3', action='store_true') group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('-O2', dest='optimized', action='store_true') - group.add_argument('-g', dest='optimized', action='store_false') - args = parser.parse_args() + group.add_argument('-O1', dest='opt', action='store_const', const='O1') + group.add_argument('-O2', dest='opt', action='store_const', const='O2') + group.add_argument('-g', dest='opt', action='store_const', const='g') + args = parser.parse_args(argv) + opt = args.opt + if args.g3: + if opt != 'O2': + raise Failure("-g3 is only supported together with -O2") + opt = 'g3' if args.objfile is None: - with open(args.filename) as f: - parse_source(f, print_source=True, optimized=args.optimized, framepointer=args.framepointer) + with open(args.filename, encoding=args.input_enc) as f: + return parse_source(f, opt=opt, framepointer=args.framepointer, input_enc=args.input_enc, output_enc=args.output_enc, print_source=outfile) else: - assert args.assembler is not None, "must pass assembler command" - with open(args.filename) as f: - functions = parse_source(f, print_source=False, optimized=args.optimized, framepointer=args.framepointer) + if args.assembler is None: + raise Failure("must pass assembler command") + if functions is None: + with open(args.filename, encoding=args.input_enc) as f: + functions = parse_source(f, opt=opt, framepointer=args.framepointer, input_enc=args.input_enc, output_enc=args.output_enc) if not functions: return asm_prelude = b'' if args.asm_prelude: with open(args.asm_prelude, 'rb') as f: asm_prelude = f.read() - fixup_objfile(args.objfile, functions, asm_prelude, args.assembler) + fixup_objfile(args.objfile, functions, asm_prelude, args.assembler, args.output_enc) + +def run(argv, outfile=sys.stdout.buffer, functions=None): + try: + return run_wrapped(argv, outfile, functions) + except Failure as e: + print("Error:", e, file=sys.stderr) + sys.exit(1) if __name__ == "__main__": - main() \ No newline at end of file + run(sys.argv[1:]) diff --git a/tools/asmpreproc/asm_processor.py b/tools/asmpreproc/asm_processor.py new file mode 100755 index 00000000..68e651af --- /dev/null +++ b/tools/asmpreproc/asm_processor.py @@ -0,0 +1,1479 @@ +#!/usr/bin/env python3 +import argparse +import tempfile +import struct +import copy +import sys +import re +import os +from collections import namedtuple +from io import StringIO + +MAX_FN_SIZE = 100 +SLOW_CHECKS = False + +EI_NIDENT = 16 +EI_CLASS = 4 +EI_DATA = 5 +EI_VERSION = 6 +EI_OSABI = 7 +EI_ABIVERSION = 8 +STN_UNDEF = 0 + +SHN_UNDEF = 0 +SHN_ABS = 0xfff1 +SHN_COMMON = 0xfff2 +SHN_XINDEX = 0xffff +SHN_LORESERVE = 0xff00 + +STT_NOTYPE = 0 +STT_OBJECT = 1 +STT_FUNC = 2 +STT_SECTION = 3 +STT_FILE = 4 +STT_COMMON = 5 +STT_TLS = 6 + +STB_LOCAL = 0 +STB_GLOBAL = 1 +STB_WEAK = 2 + +STV_DEFAULT = 0 +STV_INTERNAL = 1 +STV_HIDDEN = 2 +STV_PROTECTED = 3 + +SHT_NULL = 0 +SHT_PROGBITS = 1 +SHT_SYMTAB = 2 +SHT_STRTAB = 3 +SHT_RELA = 4 +SHT_HASH = 5 +SHT_DYNAMIC = 6 +SHT_NOTE = 7 +SHT_NOBITS = 8 +SHT_REL = 9 +SHT_SHLIB = 10 +SHT_DYNSYM = 11 +SHT_INIT_ARRAY = 14 +SHT_FINI_ARRAY = 15 +SHT_PREINIT_ARRAY = 16 +SHT_GROUP = 17 +SHT_SYMTAB_SHNDX = 18 +SHT_MIPS_GPTAB = 0x70000003 +SHT_MIPS_DEBUG = 0x70000005 +SHT_MIPS_REGINFO = 0x70000006 +SHT_MIPS_OPTIONS = 0x7000000d + +SHF_WRITE = 0x1 +SHF_ALLOC = 0x2 +SHF_EXECINSTR = 0x4 +SHF_MERGE = 0x10 +SHF_STRINGS = 0x20 +SHF_INFO_LINK = 0x40 +SHF_LINK_ORDER = 0x80 +SHF_OS_NONCONFORMING = 0x100 +SHF_GROUP = 0x200 +SHF_TLS = 0x400 + +R_MIPS_32 = 2 +R_MIPS_26 = 4 +R_MIPS_HI16 = 5 +R_MIPS_LO16 = 6 + +MIPS_DEBUG_ST_STATIC = 2 +MIPS_DEBUG_ST_STATIC_PROC = 14 + + +class ElfFormat: + def __init__(self, is_big_endian): + self.is_big_endian = is_big_endian + self.struct_char = ">" if is_big_endian else "<" + + def pack(self, fmt, *args): + return struct.pack(self.struct_char + fmt, *args) + + def unpack(self, fmt, data): + return struct.unpack(self.struct_char + fmt, data) + + +class ElfHeader: + """ + typedef struct { + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; + } Elf32_Ehdr; + """ + + def __init__(self, data): + self.e_ident = data[:EI_NIDENT] + assert self.e_ident[EI_CLASS] == 1 # 32-bit + self.fmt = ElfFormat(is_big_endian=(self.e_ident[EI_DATA] == 2)) + self.e_type, self.e_machine, self.e_version, self.e_entry, self.e_phoff, self.e_shoff, self.e_flags, self.e_ehsize, self.e_phentsize, self.e_phnum, self.e_shentsize, self.e_shnum, self.e_shstrndx = self.fmt.unpack('HHIIIIIHHHHHH', data[EI_NIDENT:]) + assert self.e_type == 1 # relocatable + assert self.e_machine == 8 # MIPS I Architecture + assert self.e_phoff == 0 # no program header + assert self.e_shoff != 0 # section header + assert self.e_shstrndx != SHN_UNDEF + + def to_bin(self): + return self.e_ident + self.fmt.pack('HHIIIIIHHHHHH', self.e_type, + self.e_machine, self.e_version, self.e_entry, self.e_phoff, + self.e_shoff, self.e_flags, self.e_ehsize, self.e_phentsize, + self.e_phnum, self.e_shentsize, self.e_shnum, self.e_shstrndx) + + +class Symbol: + """ + typedef struct { + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; + } Elf32_Sym; + """ + + def __init__(self, fmt, data, strtab, name=None): + self.fmt = fmt + self.st_name, self.st_value, self.st_size, st_info, self.st_other, self.st_shndx = fmt.unpack('IIIBBH', data) + assert self.st_shndx != SHN_XINDEX, "too many sections (SHN_XINDEX not supported)" + self.bind = st_info >> 4 + self.type = st_info & 15 + self.name = name if name is not None else strtab.lookup_str(self.st_name) + self.visibility = self.st_other & 3 + + @staticmethod + def from_parts(fmt, st_name, st_value, st_size, st_info, st_other, st_shndx, strtab, name): + header = fmt.pack('IIIBBH', st_name, st_value, st_size, st_info, st_other, st_shndx) + return Symbol(fmt, header, strtab, name) + + def to_bin(self): + st_info = (self.bind << 4) | self.type + return self.fmt.pack('IIIBBH', self.st_name, self.st_value, self.st_size, st_info, self.st_other, self.st_shndx) + + +class Relocation: + def __init__(self, fmt, data, sh_type): + self.fmt = fmt + self.sh_type = sh_type + if sh_type == SHT_REL: + self.r_offset, self.r_info = fmt.unpack('II', data) + else: + self.r_offset, self.r_info, self.r_addend = fmt.unpack('III', data) + self.sym_index = self.r_info >> 8 + self.rel_type = self.r_info & 0xff + + def to_bin(self): + self.r_info = (self.sym_index << 8) | self.rel_type + if self.sh_type == SHT_REL: + return self.fmt.pack('II', self.r_offset, self.r_info) + else: + return self.fmt.pack('III', self.r_offset, self.r_info, self.r_addend) + + +class Section: + """ + typedef struct { + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; + } Elf32_Shdr; + """ + + def __init__(self, fmt, header, data, index): + self.fmt = fmt + self.sh_name, self.sh_type, self.sh_flags, self.sh_addr, self.sh_offset, self.sh_size, self.sh_link, self.sh_info, self.sh_addralign, self.sh_entsize = fmt.unpack('IIIIIIIIII', header) + assert not self.sh_flags & SHF_LINK_ORDER + if self.sh_entsize != 0: + assert self.sh_size % self.sh_entsize == 0 + if self.sh_type == SHT_NOBITS: + self.data = b'' + else: + self.data = data[self.sh_offset:self.sh_offset + self.sh_size] + self.index = index + self.relocated_by = [] + + @staticmethod + def from_parts(fmt, sh_name, sh_type, sh_flags, sh_link, sh_info, sh_addralign, sh_entsize, data, index): + header = fmt.pack('IIIIIIIIII', sh_name, sh_type, sh_flags, 0, 0, len(data), sh_link, sh_info, sh_addralign, sh_entsize) + return Section(fmt, header, data, index) + + def lookup_str(self, index): + assert self.sh_type == SHT_STRTAB + to = self.data.find(b'\0', index) + assert to != -1 + return self.data[index:to].decode('latin1') + + def add_str(self, string): + assert self.sh_type == SHT_STRTAB + ret = len(self.data) + self.data += string.encode('latin1') + b'\0' + return ret + + def is_rel(self): + return self.sh_type == SHT_REL or self.sh_type == SHT_RELA + + def header_to_bin(self): + if self.sh_type != SHT_NOBITS: + self.sh_size = len(self.data) + return self.fmt.pack('IIIIIIIIII', self.sh_name, self.sh_type, self.sh_flags, self.sh_addr, self.sh_offset, self.sh_size, self.sh_link, self.sh_info, self.sh_addralign, self.sh_entsize) + + def late_init(self, sections): + if self.sh_type == SHT_SYMTAB: + self.init_symbols(sections) + elif self.is_rel(): + self.rel_target = sections[self.sh_info] + self.rel_target.relocated_by.append(self) + self.init_relocs() + + def find_symbol(self, name): + assert self.sh_type == SHT_SYMTAB + for s in self.symbol_entries: + if s.name == name: + return (s.st_shndx, s.st_value) + return None + + def find_symbol_in_section(self, name, section): + pos = self.find_symbol(name) + assert pos is not None + assert pos[0] == section.index + return pos[1] + + def init_symbols(self, sections): + assert self.sh_type == SHT_SYMTAB + assert self.sh_entsize == 16 + self.strtab = sections[self.sh_link] + entries = [] + for i in range(0, self.sh_size, self.sh_entsize): + entries.append(Symbol(self.fmt, self.data[i:i+self.sh_entsize], self.strtab)) + self.symbol_entries = entries + + def init_relocs(self): + assert self.is_rel() + entries = [] + for i in range(0, self.sh_size, self.sh_entsize): + entries.append(Relocation(self.fmt, self.data[i:i+self.sh_entsize], self.sh_type)) + self.relocations = entries + + def local_symbols(self): + assert self.sh_type == SHT_SYMTAB + return self.symbol_entries[:self.sh_info] + + def global_symbols(self): + assert self.sh_type == SHT_SYMTAB + return self.symbol_entries[self.sh_info:] + + def relocate_mdebug(self, original_offset): + assert self.sh_type == SHT_MIPS_DEBUG + new_data = bytearray(self.data) + shift_by = self.sh_offset - original_offset + + # Update the file-relative offsets in the Symbolic HDRR + hdrr_magic, hdrr_vstamp, hdrr_ilineMax, hdrr_cbLine, \ + hdrr_cbLineOffset, hdrr_idnMax, hdrr_cbDnOffset, hdrr_ipdMax, \ + hdrr_cbPdOffset, hdrr_isymMax, hdrr_cbSymOffset, hdrr_ioptMax, \ + hdrr_cbOptOffset, hdrr_iauxMax, hdrr_cbAuxOffset, hdrr_issMax, \ + hdrr_cbSsOffset, hdrr_issExtMax, hdrr_cbSsExtOffset, hdrr_ifdMax, \ + hdrr_cbFdOffset, hdrr_crfd, hdrr_cbRfdOffset, hdrr_iextMax, \ + hdrr_cbExtOffset = self.fmt.unpack("HHIIIIIIIIIIIIIIIIIIIIIII", self.data[0:0x60]) + + assert hdrr_magic == 0x7009, "Invalid magic value for .mdebug symbolic header" + + hdrr_cbLineOffset += shift_by + hdrr_cbDnOffset += shift_by + hdrr_cbPdOffset += shift_by + hdrr_cbSymOffset += shift_by + hdrr_cbOptOffset += shift_by + hdrr_cbAuxOffset += shift_by + hdrr_cbSsOffset += shift_by + hdrr_cbSsExtOffset += shift_by + hdrr_cbFdOffset += shift_by + hdrr_cbRfdOffset += shift_by + hdrr_cbExtOffset += shift_by + + new_data[0:0x60] = self.fmt.pack("HHIIIIIIIIIIIIIIIIIIIIIII", hdrr_magic, hdrr_vstamp, hdrr_ilineMax, hdrr_cbLine, \ + hdrr_cbLineOffset, hdrr_idnMax, hdrr_cbDnOffset, hdrr_ipdMax, \ + hdrr_cbPdOffset, hdrr_isymMax, hdrr_cbSymOffset, hdrr_ioptMax, \ + hdrr_cbOptOffset, hdrr_iauxMax, hdrr_cbAuxOffset, hdrr_issMax, \ + hdrr_cbSsOffset, hdrr_issExtMax, hdrr_cbSsExtOffset, hdrr_ifdMax, \ + hdrr_cbFdOffset, hdrr_crfd, hdrr_cbRfdOffset, hdrr_iextMax, \ + hdrr_cbExtOffset) + + self.data = bytes(new_data) + +class ElfFile: + def __init__(self, data): + self.data = data + assert data[:4] == b'\x7fELF', "not an ELF file" + + self.elf_header = ElfHeader(data[0:52]) + self.fmt = self.elf_header.fmt + + offset, size = self.elf_header.e_shoff, self.elf_header.e_shentsize + null_section = Section(self.fmt, data[offset:offset + size], data, 0) + num_sections = self.elf_header.e_shnum or null_section.sh_size + + self.sections = [null_section] + for i in range(1, num_sections): + ind = offset + i * size + self.sections.append(Section(self.fmt, data[ind:ind + size], data, i)) + + symtab = None + for s in self.sections: + if s.sh_type == SHT_SYMTAB: + assert not symtab + symtab = s + assert symtab is not None + self.symtab = symtab + + shstr = self.sections[self.elf_header.e_shstrndx] + for s in self.sections: + s.name = shstr.lookup_str(s.sh_name) + s.late_init(self.sections) + + def find_section(self, name): + for s in self.sections: + if s.name == name: + return s + return None + + def add_section(self, name, sh_type, sh_flags, sh_link, sh_info, sh_addralign, sh_entsize, data): + shstr = self.sections[self.elf_header.e_shstrndx] + sh_name = shstr.add_str(name) + s = Section.from_parts(self.fmt, sh_name=sh_name, sh_type=sh_type, + sh_flags=sh_flags, sh_link=sh_link, sh_info=sh_info, + sh_addralign=sh_addralign, sh_entsize=sh_entsize, data=data, + index=len(self.sections)) + self.sections.append(s) + s.name = name + s.late_init(self.sections) + return s + + def drop_mdebug_gptab(self): + # We can only drop sections at the end, since otherwise section + # references might be wrong. Luckily, these sections typically are. + while self.sections[-1].sh_type in [SHT_MIPS_DEBUG, SHT_MIPS_GPTAB]: + self.sections.pop() + + def write(self, filename): + outfile = open(filename, 'wb') + outidx = 0 + def write_out(data): + nonlocal outidx + outfile.write(data) + outidx += len(data) + def pad_out(align): + if align and outidx % align: + write_out(b'\0' * (align - outidx % align)) + + self.elf_header.e_shnum = len(self.sections) + write_out(self.elf_header.to_bin()) + + for s in self.sections: + if s.sh_type != SHT_NOBITS and s.sh_type != SHT_NULL: + pad_out(s.sh_addralign) + old_offset = s.sh_offset + s.sh_offset = outidx + if s.sh_type == SHT_MIPS_DEBUG and s.sh_offset != old_offset: + # The .mdebug section has moved, relocate offsets + s.relocate_mdebug(old_offset) + write_out(s.data) + + pad_out(4) + self.elf_header.e_shoff = outidx + for s in self.sections: + write_out(s.header_to_bin()) + + outfile.seek(0) + outfile.write(self.elf_header.to_bin()) + outfile.close() + + +def is_temp_name(name): + return name.startswith('_asmpp_') + + +# https://stackoverflow.com/a/241506 +def re_comment_replacer(match): + s = match.group(0) + if s[0] in "/#": + return " " + else: + return s + + +re_comment_or_string = re.compile( + r'#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' +) + + +class Failure(Exception): + def __init__(self, message): + self.message = message + + def __str__(self): + return self.message + + +class GlobalState: + def __init__(self, min_instr_count, skip_instr_count, use_jtbl_for_rodata, prelude_if_late_rodata, mips1, pascal): + # A value that hopefully never appears as a 32-bit rodata constant (or we + # miscompile late rodata). Increases by 1 in each step. + self.late_rodata_hex = 0xE0123456 + self.valuectr = 0 + self.namectr = 0 + self.min_instr_count = min_instr_count + self.skip_instr_count = skip_instr_count + self.use_jtbl_for_rodata = use_jtbl_for_rodata + self.prelude_if_late_rodata = prelude_if_late_rodata + self.mips1 = mips1 + self.pascal = pascal + + def next_late_rodata_hex(self): + dummy_bytes = struct.pack('>I', self.late_rodata_hex) + if (self.late_rodata_hex & 0xffff) == 0: + # Avoid lui + self.late_rodata_hex += 1 + self.late_rodata_hex += 1 + return dummy_bytes + + def make_name(self, cat): + self.namectr += 1 + return '_asmpp_{}{}'.format(cat, self.namectr) + + def func_prologue(self, name): + if self.pascal: + return " ".join([ + "procedure {}();".format(name), + "type", + " pi = ^integer;", + " pf = ^single;", + " pd = ^double;", + "var", + " vi: pi;", + " vf: pf;", + " vd: pd;", + "begin", + " vi := vi;", + " vf := vf;", + " vd := vd;", + ]) + else: + return 'void {}(void) {{'.format(name) + + def func_epilogue(self): + if self.pascal: + return "end;" + else: + return "}" + + def pascal_assignment(self, tp, val): + self.valuectr += 1 + address = (8 * self.valuectr) & 0x7FFF + return 'v{} := p{}({}); v{}^ := {};'.format(tp, tp, address, tp, val) + +Function = namedtuple('Function', ['text_glabels', 'asm_conts', 'late_rodata_dummy_bytes', 'jtbl_rodata_size', 'late_rodata_asm_conts', 'fn_desc', 'data']) + + +class GlobalAsmBlock: + def __init__(self, fn_desc): + self.fn_desc = fn_desc + self.cur_section = '.text' + self.asm_conts = [] + self.late_rodata_asm_conts = [] + self.late_rodata_alignment = 0 + self.late_rodata_alignment_from_content = False + self.text_glabels = [] + self.fn_section_sizes = { + '.text': 0, + '.data': 0, + '.bss': 0, + '.rodata': 0, + '.late_rodata': 0, + } + self.fn_ins_inds = [] + self.glued_line = '' + self.num_lines = 0 + + def fail(self, message, line=None): + context = self.fn_desc + if line: + context += ", at line \"" + line + "\"" + raise Failure(message + "\nwithin " + context) + + def count_quoted_size(self, line, z, real_line, output_enc): + line = line.encode(output_enc).decode('latin1') + in_quote = False + has_comma = True + num_parts = 0 + ret = 0 + i = 0 + digits = "0123456789" # 0-7 would be more sane, but this matches GNU as + while i < len(line): + c = line[i] + i += 1 + if not in_quote: + if c == '"': + in_quote = True + if z and not has_comma: + self.fail(".asciiz with glued strings is not supported due to GNU as version diffs") + num_parts += 1 + elif c == ',': + has_comma = True + else: + if c == '"': + in_quote = False + has_comma = False + continue + ret += 1 + if c != '\\': + continue + if i == len(line): + self.fail("backslash at end of line not supported", real_line) + c = line[i] + i += 1 + # (if c is in "bfnrtv", we have a real escaped literal) + if c == 'x': + # hex literal, consume any number of hex chars, possibly none + while i < len(line) and line[i] in digits + "abcdefABCDEF": + i += 1 + elif c in digits: + # octal literal, consume up to two more digits + it = 0 + while i < len(line) and line[i] in digits and it < 2: + i += 1 + it += 1 + + if in_quote: + self.fail("unterminated string literal", real_line) + if num_parts == 0: + self.fail(".ascii with no string", real_line) + return ret + num_parts if z else ret + + def align2(self): + while self.fn_section_sizes[self.cur_section] % 2 != 0: + self.fn_section_sizes[self.cur_section] += 1 + + def align4(self): + while self.fn_section_sizes[self.cur_section] % 4 != 0: + self.fn_section_sizes[self.cur_section] += 1 + + def add_sized(self, size, line): + if self.cur_section in ['.text', '.late_rodata']: + if size % 4 != 0: + self.fail("size must be a multiple of 4", line) + if size < 0: + self.fail("size cannot be negative", line) + self.fn_section_sizes[self.cur_section] += size + if self.cur_section == '.text': + if not self.text_glabels: + self.fail(".text block without an initial glabel", line) + self.fn_ins_inds.append((self.num_lines - 1, size // 4)) + + def process_line(self, line, output_enc): + self.num_lines += 1 + if line.endswith('\\'): + self.glued_line += line[:-1] + return + line = self.glued_line + line + self.glued_line = '' + + real_line = line + line = re.sub(re_comment_or_string, re_comment_replacer, line) + line = line.strip() + line = re.sub(r'^[a-zA-Z0-9_]+:\s*', '', line) + changed_section = False + emitting_double = False + if (line.startswith('glabel ') or line.startswith('jlabel ')) and self.cur_section == '.text': + self.text_glabels.append(line.split()[1]) + if not line: + pass # empty line + elif line.startswith('glabel ') or line.startswith('dlabel ') or line.startswith('jlabel ') or line.startswith('endlabel ') or (' ' not in line and line.endswith(':')): + pass # label + elif line.startswith('.section') or line in ['.text', '.data', '.rdata', '.rodata', '.bss', '.late_rodata']: + # section change + self.cur_section = '.rodata' if line == '.rdata' else line.split(',')[0].split()[-1] + if self.cur_section not in ['.data', '.text', '.rodata', '.late_rodata', '.bss']: + self.fail("unrecognized .section directive", real_line) + changed_section = True + elif line.startswith('.late_rodata_alignment'): + if self.cur_section != '.late_rodata': + self.fail(".late_rodata_alignment must occur within .late_rodata section", real_line) + value = int(line.split()[1]) + if value not in [4, 8]: + self.fail(".late_rodata_alignment argument must be 4 or 8", real_line) + if self.late_rodata_alignment and self.late_rodata_alignment != value: + self.fail(".late_rodata_alignment alignment assumption conflicts with earlier .double directive. Make sure to provide explicit alignment padding.") + self.late_rodata_alignment = value + changed_section = True + elif line.startswith('.incbin'): + self.add_sized(int(line.split(',')[-1].strip(), 0), real_line) + elif line.startswith('.word') or line.startswith('.gpword') or line.startswith('.float'): + self.align4() + self.add_sized(4 * len(line.split(',')), real_line) + elif line.startswith('.double'): + self.align4() + if self.cur_section == '.late_rodata': + align8 = self.fn_section_sizes[self.cur_section] % 8 + # Automatically set late_rodata_alignment, so the generated C code uses doubles. + # This gives us correct alignment for the transferred doubles even when the + # late_rodata_alignment is wrong, e.g. for non-matching compilation. + if not self.late_rodata_alignment: + self.late_rodata_alignment = 8 - align8 + self.late_rodata_alignment_from_content = True + elif self.late_rodata_alignment != 8 - align8: + if self.late_rodata_alignment_from_content: + self.fail("found two .double directives with different start addresses mod 8. Make sure to provide explicit alignment padding.", real_line) + else: + self.fail(".double at address that is not 0 mod 8 (based on .late_rodata_alignment assumption). Make sure to provide explicit alignment padding.", real_line) + self.add_sized(8 * len(line.split(',')), real_line) + emitting_double = True + elif line.startswith('.space'): + self.add_sized(int(line.split()[1], 0), real_line) + elif line.startswith('.balign'): + align = int(line.split()[1]) + if align != 4: + self.fail("only .balign 4 is supported", real_line) + self.align4() + elif line.startswith('.align'): + align = int(line.split()[1]) + if align != 2: + self.fail("only .align 2 is supported", real_line) + self.align4() + elif line.startswith('.asci'): + z = (line.startswith('.asciz') or line.startswith('.asciiz')) + self.add_sized(self.count_quoted_size(line, z, real_line, output_enc), real_line) + elif line.startswith('.byte'): + self.add_sized(len(line.split(',')), real_line) + elif line.startswith('.half') or line.startswith('.hword') or line.startswith(".short"): + self.align2() + self.add_sized(2*len(line.split(',')), real_line) + elif line.startswith('.size'): + pass + elif line.startswith('.'): + # .macro, ... + self.fail("asm directive not supported", real_line) + else: + # Unfortunately, macros are hard to support for .rodata -- + # we don't know how how space they will expand to before + # running the assembler, but we need that information to + # construct the C code. So if we need that we'll either + # need to run the assembler twice (at least in some rare + # cases), or change how this program is invoked. + # Similarly, we can't currently deal with pseudo-instructions + # that expand to several real instructions. + if self.cur_section != '.text': + self.fail("instruction or macro call in non-.text section? not supported", real_line) + self.add_sized(4, real_line) + if self.cur_section == '.late_rodata': + if not changed_section: + if emitting_double: + self.late_rodata_asm_conts.append(".align 0") + self.late_rodata_asm_conts.append(real_line) + if emitting_double: + self.late_rodata_asm_conts.append(".align 2") + else: + self.asm_conts.append(real_line) + + def finish(self, state): + src = [''] * (self.num_lines + 1) + late_rodata_dummy_bytes = [] + jtbl_rodata_size = 0 + late_rodata_fn_output = [] + + num_instr = self.fn_section_sizes['.text'] // 4 + + if self.fn_section_sizes['.late_rodata'] > 0: + # Generate late rodata by emitting unique float constants. + # This requires 3 instructions for each 4 bytes of rodata. + # If we know alignment, we can use doubles, which give 3 + # instructions for 8 bytes of rodata. + size = self.fn_section_sizes['.late_rodata'] // 4 + skip_next = False + needs_double = (self.late_rodata_alignment != 0) + extra_mips1_nop = False + if state.pascal: + jtbl_size = 9 if state.mips1 else 8 + jtbl_min_rodata_size = 2 + else: + jtbl_size = 11 if state.mips1 else 9 + jtbl_min_rodata_size = 5 + for i in range(size): + if skip_next: + skip_next = False + continue + # Jump tables give 9 instructions (11 with -mips1) for >= 5 words of rodata, + # and should be emitted when: + # - -O2 or -O2 -g3 are used, which give the right codegen + # - we have emitted our first .float/.double (to ensure that we find the + # created rodata in the binary) + # - we have emitted our first .double, if any (to ensure alignment of doubles + # in shifted rodata sections) + # - we have at least 5 words of rodata left to emit (otherwise IDO does not + # generate a jump table) + # - we have at least 10 more instructions to go in this function (otherwise our + # function size computation will be wrong since the delay slot goes unused) + if (not needs_double and state.use_jtbl_for_rodata and i >= 1 and + size - i >= jtbl_min_rodata_size and + num_instr - len(late_rodata_fn_output) >= jtbl_size + 1): + if state.pascal: + cases = " ".join("{}: ;".format(case) for case in range(size - i)) + line = "case 0 of " + cases + " otherwise end;" + else: + cases = " ".join("case {}:".format(case) for case in range(size - i)) + line = "switch (*(volatile int*)0) { " + cases + " ; }" + late_rodata_fn_output.append(line) + late_rodata_fn_output.extend([""] * (jtbl_size - 1)) + jtbl_rodata_size = (size - i) * 4 + extra_mips1_nop = i != 2 + break + dummy_bytes = state.next_late_rodata_hex() + late_rodata_dummy_bytes.append(dummy_bytes) + if self.late_rodata_alignment == 4 * ((i + 1) % 2 + 1) and i + 1 < size: + dummy_bytes2 = state.next_late_rodata_hex() + late_rodata_dummy_bytes.append(dummy_bytes2) + fval, = struct.unpack('>d', dummy_bytes + dummy_bytes2) + if state.pascal: + line = state.pascal_assignment('d', fval) + else: + line = '*(volatile double*)0 = {};'.format(fval) + late_rodata_fn_output.append(line) + skip_next = True + needs_double = False + if state.mips1: + # mips1 does not have ldc1/sdc1 + late_rodata_fn_output.append('') + late_rodata_fn_output.append('') + extra_mips1_nop = False + else: + fval, = struct.unpack('>f', dummy_bytes) + if state.pascal: + line = state.pascal_assignment('f', fval) + else: + line = '*(volatile float*)0 = {}f;'.format(fval) + late_rodata_fn_output.append(line) + extra_mips1_nop = True + late_rodata_fn_output.append('') + late_rodata_fn_output.append('') + if state.mips1 and extra_mips1_nop: + late_rodata_fn_output.append('') + + text_name = None + if self.fn_section_sizes['.text'] > 0 or late_rodata_fn_output: + text_name = state.make_name('func') + src[0] = state.func_prologue(text_name) + src[self.num_lines] = state.func_epilogue() + instr_count = self.fn_section_sizes['.text'] // 4 + if instr_count < state.min_instr_count: + self.fail("too short .text block") + tot_emitted = 0 + tot_skipped = 0 + fn_emitted = 0 + fn_skipped = 0 + skipping = True + rodata_stack = late_rodata_fn_output[::-1] + for (line, count) in self.fn_ins_inds: + for _ in range(count): + if (fn_emitted > MAX_FN_SIZE and instr_count - tot_emitted > state.min_instr_count and + (not rodata_stack or rodata_stack[-1])): + # Don't let functions become too large. When a function reaches 284 + # instructions, and -O2 -framepointer flags are passed, the IRIX + # compiler decides it is a great idea to start optimizing more. + # Also, Pascal cannot handle too large functions before it runs out + # of unique statements to write. + fn_emitted = 0 + fn_skipped = 0 + skipping = True + src[line] += (' ' + state.func_epilogue() + ' ' + + state.func_prologue(state.make_name('large_func')) + ' ') + if ( + skipping and + fn_skipped < state.skip_instr_count + + (state.prelude_if_late_rodata if rodata_stack else 0) + ): + fn_skipped += 1 + tot_skipped += 1 + else: + skipping = False + if rodata_stack: + src[line] += rodata_stack.pop() + elif state.pascal: + src[line] += state.pascal_assignment('i', '0') + else: + src[line] += '*(volatile int*)0 = 0;' + tot_emitted += 1 + fn_emitted += 1 + if rodata_stack: + size = len(late_rodata_fn_output) // 3 + available = instr_count - tot_skipped + self.fail( + "late rodata to text ratio is too high: {} / {} must be <= 1/3\n" + "add .late_rodata_alignment (4|8) to the .late_rodata " + "block to double the allowed ratio." + .format(size, available)) + + rodata_name = None + if self.fn_section_sizes['.rodata'] > 0: + if state.pascal: + self.fail(".rodata isn't supported with Pascal for now") + rodata_name = state.make_name('rodata') + src[self.num_lines] += ' const char {}[{}] = {{1}};'.format(rodata_name, self.fn_section_sizes['.rodata']) + + data_name = None + if self.fn_section_sizes['.data'] > 0: + data_name = state.make_name('data') + if state.pascal: + line = ' var {}: packed array[1..{}] of char := [otherwise: 0];'.format(data_name, self.fn_section_sizes['.data']) + else: + line = ' char {}[{}] = {{1}};'.format(data_name, self.fn_section_sizes['.data']) + src[self.num_lines] += line + + bss_name = None + if self.fn_section_sizes['.bss'] > 0: + if state.pascal: + self.fail(".bss isn't supported with Pascal") + bss_name = state.make_name('bss') + src[self.num_lines] += ' char {}[{}];'.format(bss_name, self.fn_section_sizes['.bss']) + + fn = Function( + text_glabels=self.text_glabels, + asm_conts=self.asm_conts, + late_rodata_dummy_bytes=late_rodata_dummy_bytes, + jtbl_rodata_size=jtbl_rodata_size, + late_rodata_asm_conts=self.late_rodata_asm_conts, + fn_desc=self.fn_desc, + data={ + '.text': (text_name, self.fn_section_sizes['.text']), + '.data': (data_name, self.fn_section_sizes['.data']), + '.rodata': (rodata_name, self.fn_section_sizes['.rodata']), + '.bss': (bss_name, self.fn_section_sizes['.bss']), + }) + return src, fn + +cutscene_data_regexpr = re.compile(r"CutsceneData (.|\n)*\[\] = {") +float_regexpr = re.compile(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f") + +def repl_float_hex(m): + return str(struct.unpack(">I", struct.pack(">f", float(m.group(0).strip().rstrip("f"))))[0]) + +Opts = namedtuple('Opts', ['opt', 'framepointer', 'mips1', 'kpic', 'pascal', 'input_enc', 'output_enc']) + +def parse_source(f, opts, out_dependencies, print_source=None): + if opts.opt in ['O1', 'O2']: + if opts.framepointer: + min_instr_count = 6 + skip_instr_count = 5 + else: + min_instr_count = 2 + skip_instr_count = 1 + elif opts.opt == 'O0': + if opts.framepointer: + min_instr_count = 8 + skip_instr_count = 8 + else: + min_instr_count = 4 + skip_instr_count = 4 + elif opts.opt == 'g': + if opts.framepointer: + min_instr_count = 7 + skip_instr_count = 7 + else: + min_instr_count = 4 + skip_instr_count = 4 + elif opts.opt == 'g3': + if opts.framepointer: + min_instr_count = 4 + skip_instr_count = 4 + else: + min_instr_count = 2 + skip_instr_count = 2 + else: + raise Failure("must pass one of -g, -O0, -O1, -O2, -O2 -g3") + prelude_if_late_rodata = 0 + if opts.kpic: + # Without optimizations, the PIC prelude always takes up 3 instructions. + # With optimizations, the prelude is optimized out if there's no late rodata. + if opts.opt in ('g3', 'O2'): + prelude_if_late_rodata = 3 + else: + min_instr_count += 3 + skip_instr_count += 3 + + use_jtbl_for_rodata = False + if opts.opt in ['O2', 'g3'] and not opts.framepointer and not opts.kpic: + use_jtbl_for_rodata = True + + state = GlobalState(min_instr_count, skip_instr_count, use_jtbl_for_rodata, prelude_if_late_rodata, opts.mips1, opts.pascal) + output_enc = opts.output_enc + + global_asm = None + asm_functions = [] + output_lines = [ + '#line 1 "' + f.name + '"' + ] + + is_cutscene_data = False + is_early_include = False + + for line_no, raw_line in enumerate(f, 1): + raw_line = raw_line.rstrip() + line = raw_line.lstrip() + + # Print exactly one output line per source line, to make compiler + # errors have correct line numbers. These will be overridden with + # reasonable content further down. + output_lines.append('') + + if global_asm is not None: + if line.startswith(')'): + src, fn = global_asm.finish(state) + for i, line2 in enumerate(src): + output_lines[start_index + i] = line2 + asm_functions.append(fn) + global_asm = None + else: + global_asm.process_line(raw_line, output_enc) + elif line in ['GLOBAL_ASM(', '#pragma GLOBAL_ASM(']: + global_asm = GlobalAsmBlock("GLOBAL_ASM block at line " + str(line_no)) + start_index = len(output_lines) + elif ((line.startswith('GLOBAL_ASM("') or line.startswith('#pragma GLOBAL_ASM("')) + and line.endswith('")')): + fname = line[line.index('(') + 2 : -2] + out_dependencies.append(fname) + global_asm = GlobalAsmBlock(fname) + with open(fname, encoding=opts.input_enc) as f: + for line2 in f: + global_asm.process_line(line2.rstrip(), output_enc) + src, fn = global_asm.finish(state) + output_lines[-1] = ''.join(src) + asm_functions.append(fn) + global_asm = None + elif line == '#pragma asmproc recurse': + # C includes qualified as + # #pragma asmproc recurse + # #include "file.c" + # will be processed recursively when encountered + is_early_include = True + elif is_early_include: + # Previous line was a #pragma asmproc recurse + is_early_include = False + if not line.startswith("#include "): + raise Failure("#pragma asmproc recurse must be followed by an #include ") + fpath = os.path.dirname(f.name) + fname = os.path.join(fpath, line[line.index(' ') + 2 : -1]) + out_dependencies.append(fname) + include_src = StringIO() + with open(fname, encoding=opts.input_enc) as include_file: + parse_source(include_file, opts, out_dependencies, include_src) + include_src.write('#line ' + str(line_no + 1) + ' "' + f.name + '"') + output_lines[-1] = include_src.getvalue() + include_src.close() + else: + # This is a hack to replace all floating-point numbers in an array of a particular type + # (in this case CutsceneData) with their corresponding IEEE-754 hexadecimal representation + if cutscene_data_regexpr.search(line) is not None: + is_cutscene_data = True + elif line.endswith("};"): + is_cutscene_data = False + if is_cutscene_data: + raw_line = re.sub(float_regexpr, repl_float_hex, raw_line) + output_lines[-1] = raw_line + + if print_source: + if isinstance(print_source, StringIO): + for line in output_lines: + print_source.write(line + '\n') + else: + newline_encoded = "\n".encode(output_enc) + for line in output_lines: + try: + line_encoded = line.encode(output_enc) + except UnicodeEncodeError: + print("Failed to encode a line to", output_enc) + print("The line:", line) + print("The line, utf-8-encoded:", line.encode("utf-8")) + raise + print_source.write(line_encoded) + print_source.write(newline_encoded) + print_source.flush() + + return asm_functions + +def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc, drop_mdebug_gptab, convert_statics): + SECTIONS = ['.data', '.text', '.rodata', '.bss'] + + with open(objfile_name, 'rb') as f: + objfile = ElfFile(f.read()) + fmt = objfile.fmt + + prev_locs = { + '.text': 0, + '.data': 0, + '.rodata': 0, + '.bss': 0, + } + to_copy = { + '.text': [], + '.data': [], + '.rodata': [], + '.bss': [], + } + asm = [] + all_late_rodata_dummy_bytes = [] + all_jtbl_rodata_size = [] + late_rodata_asm = [] + late_rodata_source_name_start = None + late_rodata_source_name_end = None + + # Generate an assembly file with all the assembly we need to fill in. For + # simplicity we pad with nops/.space so that addresses match exactly, so we + # don't have to fix up relocations/symbol references. + all_text_glabels = set() + func_sizes = {} + for function in functions: + ifdefed = False + for sectype, (temp_name, size) in function.data.items(): + if temp_name is None: + continue + assert size > 0 + loc = objfile.symtab.find_symbol(temp_name) + if loc is None: + ifdefed = True + break + loc = loc[1] + prev_loc = prev_locs[sectype] + if loc < prev_loc: + # If the dummy C generates too little asm, and we have two + # consecutive GLOBAL_ASM blocks, we detect that error here. + # On the other hand, if it generates too much, we don't have + # a good way of discovering that error: it's indistinguishable + # from a static symbol occurring after the GLOBAL_ASM block. + raise Failure("Wrongly computed size for section {} (diff {}). This is an asm-processor bug!".format(sectype, prev_loc- loc)) + if loc != prev_loc: + asm.append('.section ' + sectype) + if sectype == '.text': + for i in range((loc - prev_loc) // 4): + asm.append('nop') + else: + asm.append('.space {}'.format(loc - prev_loc)) + to_copy[sectype].append((loc, size, temp_name, function.fn_desc)) + if function.text_glabels and sectype == '.text': + func_sizes[function.text_glabels[0]] = size + prev_locs[sectype] = loc + size + if not ifdefed: + all_text_glabels.update(function.text_glabels) + all_late_rodata_dummy_bytes.append(function.late_rodata_dummy_bytes) + all_jtbl_rodata_size.append(function.jtbl_rodata_size) + late_rodata_asm.append(function.late_rodata_asm_conts) + for sectype, (temp_name, size) in function.data.items(): + if temp_name is not None: + asm.append('.section ' + sectype) + asm.append('glabel ' + temp_name + '_asm_start') + asm.append('.text') + for line in function.asm_conts: + asm.append(line) + for sectype, (temp_name, size) in function.data.items(): + if temp_name is not None: + asm.append('.section ' + sectype) + asm.append('glabel ' + temp_name + '_asm_end') + if any(late_rodata_asm): + late_rodata_source_name_start = '_asmpp_late_rodata_start' + late_rodata_source_name_end = '_asmpp_late_rodata_end' + asm.append('.section .late_rodata') + # Put some padding at the start to avoid conflating symbols with + # references to the whole section. + asm.append('.word 0, 0') + asm.append('glabel {}'.format(late_rodata_source_name_start)) + for conts in late_rodata_asm: + asm.extend(conts) + asm.append('glabel {}'.format(late_rodata_source_name_end)) + + o_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.o', delete=False) + o_name = o_file.name + o_file.close() + s_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.s', delete=False) + s_name = s_file.name + try: + s_file.write(asm_prelude + b'\n') + for line in asm: + s_file.write(line.encode(output_enc) + b'\n') + s_file.close() + ret = os.system(assembler + " " + s_name + " -o " + o_name) + if ret != 0: + raise Failure("failed to assemble") + with open(o_name, 'rb') as f: + asm_objfile = ElfFile(f.read()) + + # Remove clutter from objdump output for tests, and make the tests + # portable by avoiding absolute paths. Outside of tests .mdebug is + # useful for showing source together with asm, though. + mdebug_section = objfile.find_section('.mdebug') + if drop_mdebug_gptab: + objfile.drop_mdebug_gptab() + + # Unify reginfo sections + target_reginfo = objfile.find_section('.reginfo') + if target_reginfo is not None: + source_reginfo_data = list(asm_objfile.find_section('.reginfo').data) + data = list(target_reginfo.data) + for i in range(20): + data[i] |= source_reginfo_data[i] + target_reginfo.data = bytes(data) + + # Move over section contents + modified_text_positions = set() + jtbl_rodata_positions = set() + last_rodata_pos = 0 + for sectype in SECTIONS: + if not to_copy[sectype]: + continue + source = asm_objfile.find_section(sectype) + assert source is not None, "didn't find source section: " + sectype + for (pos, count, temp_name, fn_desc) in to_copy[sectype]: + loc1 = asm_objfile.symtab.find_symbol_in_section(temp_name + '_asm_start', source) + loc2 = asm_objfile.symtab.find_symbol_in_section(temp_name + '_asm_end', source) + assert loc1 == pos, "assembly and C files don't line up for section " + sectype + ", " + fn_desc + if loc2 - loc1 != count: + raise Failure("incorrectly computed size for section " + sectype + ", " + fn_desc + ". If using .double, make sure to provide explicit alignment padding.") + if sectype == '.bss': + continue + target = objfile.find_section(sectype) + assert target is not None, "missing target section of type " + sectype + data = list(target.data) + for (pos, count, _, _) in to_copy[sectype]: + data[pos:pos + count] = source.data[pos:pos + count] + if sectype == '.text': + assert count % 4 == 0 + assert pos % 4 == 0 + for i in range(count // 4): + modified_text_positions.add(pos + 4 * i) + elif sectype == '.rodata': + last_rodata_pos = pos + count + target.data = bytes(data) + + # Move over late rodata. This is heuristic, sadly, since I can't think + # of another way of doing it. + moved_late_rodata = {} + if any(all_late_rodata_dummy_bytes) or any(all_jtbl_rodata_size): + source = asm_objfile.find_section('.late_rodata') + target = objfile.find_section('.rodata') + source_pos = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_start, source) + source_end = asm_objfile.symtab.find_symbol_in_section(late_rodata_source_name_end, source) + if source_end - source_pos != sum(map(len, all_late_rodata_dummy_bytes)) * 4 + sum(all_jtbl_rodata_size): + raise Failure("computed wrong size of .late_rodata") + new_data = list(target.data) + for dummy_bytes_list, jtbl_rodata_size in zip(all_late_rodata_dummy_bytes, all_jtbl_rodata_size): + for index, dummy_bytes in enumerate(dummy_bytes_list): + if not fmt.is_big_endian: + dummy_bytes = dummy_bytes[::-1] + pos = target.data.index(dummy_bytes, last_rodata_pos) + # This check is nice, but makes time complexity worse for large files: + if SLOW_CHECKS and target.data.find(dummy_bytes, pos + 4) != -1: + raise Failure("multiple occurrences of late_rodata hex magic. Change asm-processor to use something better than 0xE0123456!") + if index == 0 and len(dummy_bytes_list) > 1 and target.data[pos+4:pos+8] == b'\0\0\0\0': + # Ugly hack to handle double alignment for non-matching builds. + # We were told by .late_rodata_alignment (or deduced from a .double) + # that a function's late_rodata started out 4 (mod 8), and emitted + # a float and then a double. But it was actually 0 (mod 8), so our + # double was moved by 4 bytes. To make them adjacent to keep jump + # tables correct, move the float by 4 bytes as well. + new_data[pos:pos+4] = b'\0\0\0\0' + pos += 4 + new_data[pos:pos+4] = source.data[source_pos:source_pos+4] + moved_late_rodata[source_pos] = pos + last_rodata_pos = pos + 4 + source_pos += 4 + if jtbl_rodata_size > 0: + assert dummy_bytes_list, "should always have dummy bytes before jtbl data" + pos = last_rodata_pos + new_data[pos : pos + jtbl_rodata_size] = \ + source.data[source_pos : source_pos + jtbl_rodata_size] + for i in range(0, jtbl_rodata_size, 4): + moved_late_rodata[source_pos + i] = pos + i + jtbl_rodata_positions.add(pos + i) + last_rodata_pos += jtbl_rodata_size + source_pos += jtbl_rodata_size + target.data = bytes(new_data) + + # Merge strtab data. + strtab_adj = len(objfile.symtab.strtab.data) + objfile.symtab.strtab.data += asm_objfile.symtab.strtab.data + + # Find relocated symbols + relocated_symbols = set() + for sectype in SECTIONS + ['.late_rodata']: + for obj in [asm_objfile, objfile]: + sec = obj.find_section(sectype) + if sec is None: + continue + for reltab in sec.relocated_by: + for rel in reltab.relocations: + relocated_symbols.add(obj.symtab.symbol_entries[rel.sym_index]) + + # Move over symbols, deleting the temporary function labels. + # Skip over new local symbols that aren't relocated against, to + # avoid conflicts. + empty_symbol = objfile.symtab.symbol_entries[0] + new_syms = [s for s in objfile.symtab.symbol_entries[1:] if not is_temp_name(s.name)] + + for i, s in enumerate(asm_objfile.symtab.symbol_entries): + is_local = (i < asm_objfile.symtab.sh_info) + if is_local and s not in relocated_symbols: + continue + if is_temp_name(s.name): + assert s not in relocated_symbols + continue + if s.st_shndx not in [SHN_UNDEF, SHN_ABS]: + section_name = asm_objfile.sections[s.st_shndx].name + target_section_name = section_name + if section_name == ".late_rodata": + target_section_name = ".rodata" + elif section_name not in SECTIONS: + raise Failure("generated assembly .o must only have symbols for .text, .data, .rodata, .late_rodata, ABS and UNDEF, but found " + section_name) + objfile_section = objfile.find_section(target_section_name) + if objfile_section is None: + raise Failure("generated assembly .o has section that real objfile lacks: " + target_section_name) + s.st_shndx = objfile_section.index + # glabel's aren't marked as functions, making objdump output confusing. Fix that. + if s.name in all_text_glabels: + s.type = STT_FUNC + if s.name in func_sizes: + s.st_size = func_sizes[s.name] + if section_name == '.late_rodata': + if s.st_value == 0: + # This must be a symbol corresponding to the whole .late_rodata + # section, being referred to from a relocation. + # Moving local symbols is tricky, because it requires fixing up + # lo16/hi16 relocation references to .late_rodata+. + # Just disallow it for now. + raise Failure("local symbols in .late_rodata are not allowed") + s.st_value = moved_late_rodata[s.st_value] + s.st_name += strtab_adj + new_syms.append(s) + make_statics_global = convert_statics in ("global", "global-with-filename") + + # Add static symbols from .mdebug, so they can be referred to from GLOBAL_ASM + if mdebug_section and convert_statics != "no": + strtab_index = len(objfile.symtab.strtab.data) + new_strtab_data = [] + ifd_max, cb_fd_offset = fmt.unpack('II', mdebug_section.data[18*4 : 20*4]) + cb_sym_offset, = fmt.unpack('I', mdebug_section.data[9*4 : 10*4]) + cb_ss_offset, = fmt.unpack('I', mdebug_section.data[15*4 : 16*4]) + for i in range(ifd_max): + offset = cb_fd_offset + 18*4*i + iss_base, _, isym_base, csym = fmt.unpack('IIII', objfile.data[offset + 2*4 : offset + 6*4]) + for j in range(csym): + offset2 = cb_sym_offset + 12 * (isym_base + j) + iss, value, st_sc_index = fmt.unpack('III', objfile.data[offset2 : offset2 + 12]) + st = (st_sc_index >> 26) + sc = (st_sc_index >> 21) & 0x1f + if st in [MIPS_DEBUG_ST_STATIC, MIPS_DEBUG_ST_STATIC_PROC]: + symbol_name_offset = cb_ss_offset + iss_base + iss + symbol_name_offset_end = objfile.data.find(b'\0', symbol_name_offset) + assert symbol_name_offset_end != -1 + symbol_name = objfile.data[symbol_name_offset : symbol_name_offset_end + 1] + emitted_symbol_name = symbol_name + if convert_statics == "global-with-filename": + # Change the emitted symbol name to include the filename, + # but don't let that affect deduplication logic. + emitted_symbol_name = objfile_name.encode("utf-8") + b":" + symbol_name + section_name = {1: '.text', 2: '.data', 3: '.bss', 15: '.rodata'}[sc] + section = objfile.find_section(section_name) + symtype = STT_FUNC if sc == 1 else STT_OBJECT + binding = STB_GLOBAL if make_statics_global else STB_LOCAL + sym = Symbol.from_parts( + fmt, + st_name=strtab_index, + st_value=value, + st_size=0, + st_info=(binding << 4 | symtype), + st_other=STV_DEFAULT, + st_shndx=section.index, + strtab=objfile.symtab.strtab, + name=symbol_name[:-1].decode('latin1')) + strtab_index += len(emitted_symbol_name) + new_strtab_data.append(emitted_symbol_name) + new_syms.append(sym) + objfile.symtab.strtab.data += b''.join(new_strtab_data) + + # Get rid of duplicate symbols, favoring ones that are not UNDEF. + # Skip this for unnamed local symbols though. + new_syms.sort(key=lambda s: 0 if s.st_shndx != SHN_UNDEF else 1) + old_syms = [] + newer_syms = [] + name_to_sym = {} + for s in new_syms: + if s.name == "_gp_disp": + s.type = STT_OBJECT + if s.bind == STB_LOCAL and s.st_shndx == SHN_UNDEF: + raise Failure("local symbol \"" + s.name + "\" is undefined") + if not s.name: + if s.bind != STB_LOCAL: + raise Failure("global symbol with no name") + newer_syms.append(s) + else: + existing = name_to_sym.get(s.name) + if not existing: + name_to_sym[s.name] = s + newer_syms.append(s) + elif s.st_shndx != SHN_UNDEF: + raise Failure("symbol \"" + s.name + "\" defined twice") + else: + s.replace_by = existing + old_syms.append(s) + new_syms = newer_syms + + # Put local symbols in front, with the initial dummy entry first, and + # _gp_disp at the end if it exists. + new_syms.insert(0, empty_symbol) + new_syms.sort(key=lambda s: (s.bind != STB_LOCAL, s.name == "_gp_disp")) + num_local_syms = sum(1 for s in new_syms if s.bind == STB_LOCAL) + + for i, s in enumerate(new_syms): + s.new_index = i + for s in old_syms: + s.new_index = s.replace_by.new_index + objfile.symtab.data = b''.join(s.to_bin() for s in new_syms) + objfile.symtab.sh_info = num_local_syms + + # Fix up relocation symbol references + for sectype in SECTIONS: + target = objfile.find_section(sectype) + + if target is not None: + # fixup relocation symbol indices, since we butchered them above + for reltab in target.relocated_by: + nrels = [] + for rel in reltab.relocations: + if (sectype == '.text' and rel.r_offset in modified_text_positions or + sectype == '.rodata' and rel.r_offset in jtbl_rodata_positions): + # don't include relocations for late_rodata dummy code + continue + rel.sym_index = objfile.symtab.symbol_entries[rel.sym_index].new_index + nrels.append(rel) + reltab.relocations = nrels + reltab.data = b''.join(rel.to_bin() for rel in nrels) + + # Move over relocations + for sectype in SECTIONS + ['.late_rodata']: + source = asm_objfile.find_section(sectype) + if source is None or not source.data: + continue + + target_sectype = '.rodata' if sectype == '.late_rodata' else sectype + target = objfile.find_section(target_sectype) + assert target is not None, target_sectype + target_reltab = objfile.find_section('.rel' + target_sectype) + target_reltaba = objfile.find_section('.rela' + target_sectype) + for reltab in source.relocated_by: + for rel in reltab.relocations: + rel.sym_index = asm_objfile.symtab.symbol_entries[rel.sym_index].new_index + if sectype == '.late_rodata': + rel.r_offset = moved_late_rodata[rel.r_offset] + new_data = b''.join(rel.to_bin() for rel in reltab.relocations) + if reltab.sh_type == SHT_REL: + if not target_reltab: + target_reltab = objfile.add_section('.rel' + target_sectype, + sh_type=SHT_REL, sh_flags=0, + sh_link=objfile.symtab.index, sh_info=target.index, + sh_addralign=4, sh_entsize=8, data=b'') + target_reltab.data += new_data + else: + if not target_reltaba: + target_reltaba = objfile.add_section('.rela' + target_sectype, + sh_type=SHT_RELA, sh_flags=0, + sh_link=objfile.symtab.index, sh_info=target.index, + sh_addralign=4, sh_entsize=12, data=b'') + target_reltaba.data += new_data + + objfile.write(objfile_name) + finally: + s_file.close() + os.remove(s_name) + try: + os.remove(o_name) + except: + pass + +def run_wrapped(argv, outfile, functions): + parser = argparse.ArgumentParser(description="Pre-process .c files and post-process .o files to enable embedding assembly into C.") + parser.add_argument('filename', help="path to .c code") + parser.add_argument('--post-process', dest='objfile', help="path to .o file to post-process") + parser.add_argument('--assembler', dest='assembler', help="assembler command (e.g. \"mips-linux-gnu-as -march=vr4300 -mabi=32\")") + parser.add_argument('--asm-prelude', dest='asm_prelude', help="path to a file containing a prelude to the assembly file (with .set and .macro directives, e.g.)") + parser.add_argument('--input-enc', default='latin1', help="input encoding (default: %(default)s)") + parser.add_argument('--output-enc', default='latin1', help="output encoding (default: %(default)s)") + parser.add_argument('--drop-mdebug-gptab', dest='drop_mdebug_gptab', action='store_true', help="drop mdebug and gptab sections") + parser.add_argument('--convert-statics', dest='convert_statics', choices=["no", "local", "global", "global-with-filename"], default="local", help="change static symbol visibility (default: %(default)s)") + parser.add_argument('--force', dest='force', action='store_true', help="force processing of files without GLOBAL_ASM blocks") + parser.add_argument('-framepointer', dest='framepointer', action='store_true') + parser.add_argument('-mips1', dest='mips1', action='store_true') + parser.add_argument('-g3', dest='g3', action='store_true') + parser.add_argument('-KPIC', dest='kpic', action='store_true') + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-O0', dest='opt', action='store_const', const='O0') + group.add_argument('-O1', dest='opt', action='store_const', const='O1') + group.add_argument('-O2', dest='opt', action='store_const', const='O2') + group.add_argument('-g', dest='opt', action='store_const', const='g') + args = parser.parse_args(argv) + opt = args.opt + pascal = any(args.filename.endswith(ext) for ext in (".p", ".pas", ".pp")) + if args.g3: + if opt != 'O2': + raise Failure("-g3 is only supported together with -O2") + opt = 'g3' + if args.mips1 and (opt not in ('O1', 'O2') or args.framepointer): + raise Failure("-mips1 is only supported together with -O1 or -O2") + if pascal and opt not in ('O1', 'O2', 'g3'): + raise Failure("Pascal is only supported together with -O1, -O2 or -O2 -g3") + opts = Opts(opt, args.framepointer, args.mips1, args.kpic, pascal, args.input_enc, args.output_enc) + + if args.objfile is None: + with open(args.filename, encoding=args.input_enc) as f: + deps = [] + functions = parse_source(f, opts, out_dependencies=deps, print_source=outfile) + return functions, deps + else: + if args.assembler is None: + raise Failure("must pass assembler command") + if functions is None: + with open(args.filename, encoding=args.input_enc) as f: + functions = parse_source(f, opts, out_dependencies=[]) + if not functions and not args.force: + return + asm_prelude = b'' + if args.asm_prelude: + with open(args.asm_prelude, 'rb') as f: + asm_prelude = f.read() + fixup_objfile(args.objfile, functions, asm_prelude, args.assembler, args.output_enc, args.drop_mdebug_gptab, args.convert_statics) + +def run(argv, outfile=sys.stdout.buffer, functions=None): + try: + return run_wrapped(argv, outfile, functions) + except Failure as e: + print("Error:", e, file=sys.stderr) + sys.exit(1) + +if __name__ == "__main__": + run(sys.argv[1:]) diff --git a/tools/ge-stats.py b/tools/ge-stats.py index e2737a0a..cd23a87f 100755 --- a/tools/ge-stats.py +++ b/tools/ge-stats.py @@ -186,14 +186,16 @@ def __init__(self): -def mtime_os(file, now): - print('using os') +def mtime_os(file, now, qlocal = False): + if not qlocal: + print('using os') return int(os.path.getmtime(file)) -def mtime_git(file, now): - print('using git') +def mtime_git(file, now, qlocal = False): + if not qlocal: + print('using git') try: date_str = now.strftime('%Y-%m-%dT%H:%M:%S%z') result = subprocess.run(['git', 'log', '-1', '--format=\"%ct\"', '--date=local', '--before=\"' + date_str + '\"', '--', file], stdout=subprocess.PIPE, universal_newlines=True) @@ -207,7 +209,7 @@ def mtime_git(file, now): return int(log_out) -def process_source_files(search, stats: StatResults, mtime_resolver): +def process_source_files(search, stats: StatResults, mtime_resolver, qlocal = False): stats.search_dirs = search @@ -238,11 +240,12 @@ def process_source_files(search, stats: StatResults, mtime_resolver): sfc.asm_functions = set() sfc.parent = s - sfc.mtime = mtime_resolver(file, stats.now) + sfc.mtime = mtime_resolver(file, stats.now, qlocal) import datetime x = datetime.datetime.fromtimestamp(sfc.mtime) - print(sfc.path, ' = ', x.strftime('%c')) + if not qlocal: + print(sfc.path, ' = ', x.strftime('%c')) # The `completed` list is manually configured to specify which files should not be # counted against the total. This is done by simply not adding asm function @@ -631,6 +634,7 @@ def print_help(): print(' -n, --non_matching print csv of all non matching function definitions') print(' --mtime_os use OS last modified time instead of git log') print(' -h, --help display this help text and exit') + print(' --qlocal quiet "local" version. Disable all the extra print statements included for github actions.') def main(): # default to US version @@ -638,9 +642,10 @@ def main(): run_report = False print_method = 'default' mtime_use_os = False + qlocal = False if (len(sys.argv) > 1): - arguments, values = getopt.getopt(sys.argv[1:], "hv:rn", ["help", "version=", "report", "non_matching", "mtime_os"]) + arguments, values = getopt.getopt(sys.argv[1:], "hv:rn", ["help", "version=", "report", "non_matching", "mtime_os", "qlocal"]) for current_argument, current_value in arguments: if current_argument in ("-h", "--help"): @@ -654,6 +659,8 @@ def main(): print_method = 'non_matching' elif current_argument in ("--mtime_os"): mtime_use_os = True + elif current_argument in ("--qlocal"): + qlocal = True if version not in __supported_versions: print('fatal: version', version, 'not supported! Supported versions are: ', ', '.join(__supported_versions)) @@ -667,8 +674,9 @@ def main(): # if this is just getting status on nonmatching files, ignore modified time lookup. if print_method == 'non_matching' and not run_report: mtime_use_os = True - - print(subprocess.run(['git', 'diff', 'origin/master', '--name-only', '"@{10 minutes ago}"']).stdout) + + if not qlocal: + print(subprocess.run(['git', 'diff', 'origin/master', '--name-only', '"@{10 minutes ago}"']).stdout) # Default to using git log to get the file's modified date. # Git log will be much slower, but cloning a new repo (i.e., github actions online) # will reset all the modified timestamps to the same value, so will need to @@ -707,7 +715,7 @@ def main(): stats = StatResults() - process_source_files(search, stats, mtime_resolver) + process_source_files(search, stats, mtime_resolver, qlocal) apply_build_map(stats, version) generate_default_stats(stats)